linux/drivers/pinctrl/pinctrl-bm1880.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Bitmain BM1880 SoC Pinctrl driver
 *
 * Copyright (c) 2019 Linaro Ltd.
 * Author: Manivannan Sadhasivam <[email protected]>
 */

#include <linux/io.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/slab.h>

#include <linux/pinctrl/pinconf-generic.h>
#include <linux/pinctrl/pinconf.h>
#include <linux/pinctrl/pinctrl.h>
#include <linux/pinctrl/pinmux.h>

#include "core.h"
#include "pinctrl-utils.h"

#define BM1880_REG_MUX

/**
 * struct bm1880_pinctrl - driver data
 * @base:	Pinctrl base address
 * @pctrldev:	Pinctrl device
 * @groups:	Pingroups
 * @ngroups:	Number of @groups
 * @funcs:	Pinmux functions
 * @nfuncs:	Number of @funcs
 * @pinconf:	Pinconf data
 */
struct bm1880_pinctrl {};

/**
 * struct bm1880_pctrl_group - pinctrl group
 * @name:	Name of the group
 * @pins:	Array of pins belonging to this group
 * @npins:	Number of @pins
 */
struct bm1880_pctrl_group {};

/**
 * struct bm1880_pinmux_function - a pinmux function
 * @name:	Name of the pinmux function.
 * @groups:	List of pingroups for this function.
 * @ngroups:	Number of entries in @groups.
 * @mux_val:	Selector for this function
 * @mux:	Offset of function specific mux
 * @mux_shift:	Shift for function specific selector
 */
struct bm1880_pinmux_function {};

/**
 * struct bm1880_pinconf_data - pinconf data
 * @drv_bits:	Drive strength bit width
 */
struct bm1880_pinconf_data {};

static const struct pinctrl_pin_desc bm1880_pins[] =;

enum bm1880_pinmux_functions {};

static const unsigned int nand_pins[] =;
static const unsigned int spi_pins[] =;
static const unsigned int emmc_pins[] =;
static const unsigned int sdio_pins[] =;
static const unsigned int eth0_pins[] =;
static const unsigned int pwm0_pins[] =;
static const unsigned int pwm1_pins[] =;
static const unsigned int pwm2_pins[] =;
static const unsigned int pwm3_pins[] =;
static const unsigned int pwm4_pins[] =;
static const unsigned int pwm5_pins[] =;
static const unsigned int pwm6_pins[] =;
static const unsigned int pwm7_pins[] =;
static const unsigned int pwm8_pins[] =;
static const unsigned int pwm9_pins[] =;
static const unsigned int pwm10_pins[] =;
static const unsigned int pwm11_pins[] =;
static const unsigned int pwm12_pins[] =;
static const unsigned int pwm13_pins[] =;
static const unsigned int pwm14_pins[] =;
static const unsigned int pwm15_pins[] =;
static const unsigned int pwm16_pins[] =;
static const unsigned int pwm17_pins[] =;
static const unsigned int pwm18_pins[] =;
static const unsigned int pwm19_pins[] =;
static const unsigned int pwm20_pins[] =;
static const unsigned int pwm21_pins[] =;
static const unsigned int pwm22_pins[] =;
static const unsigned int pwm23_pins[] =;
static const unsigned int pwm24_pins[] =;
static const unsigned int pwm25_pins[] =;
static const unsigned int pwm26_pins[] =;
static const unsigned int pwm27_pins[] =;
static const unsigned int pwm28_pins[] =;
static const unsigned int pwm29_pins[] =;
static const unsigned int pwm30_pins[] =;
static const unsigned int pwm31_pins[] =;
static const unsigned int pwm32_pins[] =;
static const unsigned int pwm33_pins[] =;
static const unsigned int pwm34_pins[] =;
static const unsigned int pwm35_pins[] =;
static const unsigned int pwm36_pins[] =;
static const unsigned int pwm37_pins[] =;
static const unsigned int i2c0_pins[] =;
static const unsigned int i2c1_pins[] =;
static const unsigned int i2c2_pins[] =;
static const unsigned int i2c3_pins[] =;
static const unsigned int i2c4_pins[] =;
static const unsigned int uart0_pins[] =;
static const unsigned int uart1_pins[] =;
static const unsigned int uart2_pins[] =;
static const unsigned int uart3_pins[] =;
static const unsigned int uart4_pins[] =;
static const unsigned int uart5_pins[] =;
static const unsigned int uart6_pins[] =;
static const unsigned int uart7_pins[] =;
static const unsigned int uart8_pins[] =;
static const unsigned int uart9_pins[] =;
static const unsigned int uart10_pins[] =;
static const unsigned int uart11_pins[] =;
static const unsigned int uart12_pins[] =;
static const unsigned int uart13_pins[] =;
static const unsigned int uart14_pins[] =;
static const unsigned int uart15_pins[] =;
static const unsigned int gpio0_pins[] =;
static const unsigned int gpio1_pins[] =;
static const unsigned int gpio2_pins[] =;
static const unsigned int gpio3_pins[] =;
static const unsigned int gpio4_pins[] =;
static const unsigned int gpio5_pins[] =;
static const unsigned int gpio6_pins[] =;
static const unsigned int gpio7_pins[] =;
static const unsigned int gpio8_pins[] =;
static const unsigned int gpio9_pins[] =;
static const unsigned int gpio10_pins[] =;
static const unsigned int gpio11_pins[] =;
static const unsigned int gpio12_pins[] =;
static const unsigned int gpio13_pins[] =;
static const unsigned int gpio14_pins[] =;
static const unsigned int gpio15_pins[] =;
static const unsigned int gpio16_pins[] =;
static const unsigned int gpio17_pins[] =;
static const unsigned int gpio18_pins[] =;
static const unsigned int gpio19_pins[] =;
static const unsigned int gpio20_pins[] =;
static const unsigned int gpio21_pins[] =;
static const unsigned int gpio22_pins[] =;
static const unsigned int gpio23_pins[] =;
static const unsigned int gpio24_pins[] =;
static const unsigned int gpio25_pins[] =;
static const unsigned int gpio26_pins[] =;
static const unsigned int gpio27_pins[] =;
static const unsigned int gpio28_pins[] =;
static const unsigned int gpio29_pins[] =;
static const unsigned int gpio30_pins[] =;
static const unsigned int gpio31_pins[] =;
static const unsigned int gpio32_pins[] =;
static const unsigned int gpio33_pins[] =;
static const unsigned int gpio34_pins[] =;
static const unsigned int gpio35_pins[] =;
static const unsigned int gpio36_pins[] =;
static const unsigned int gpio37_pins[] =;
static const unsigned int gpio38_pins[] =;
static const unsigned int gpio39_pins[] =;
static const unsigned int gpio40_pins[] =;
static const unsigned int gpio41_pins[] =;
static const unsigned int gpio42_pins[] =;
static const unsigned int gpio43_pins[] =;
static const unsigned int gpio44_pins[] =;
static const unsigned int gpio45_pins[] =;
static const unsigned int gpio46_pins[] =;
static const unsigned int gpio47_pins[] =;
static const unsigned int gpio48_pins[] =;
static const unsigned int gpio49_pins[] =;
static const unsigned int gpio50_pins[] =;
static const unsigned int gpio51_pins[] =;
static const unsigned int gpio52_pins[] =;
static const unsigned int gpio53_pins[] =;
static const unsigned int gpio54_pins[] =;
static const unsigned int gpio55_pins[] =;
static const unsigned int gpio56_pins[] =;
static const unsigned int gpio57_pins[] =;
static const unsigned int gpio58_pins[] =;
static const unsigned int gpio59_pins[] =;
static const unsigned int gpio60_pins[] =;
static const unsigned int gpio61_pins[] =;
static const unsigned int gpio62_pins[] =;
static const unsigned int gpio63_pins[] =;
static const unsigned int gpio64_pins[] =;
static const unsigned int gpio65_pins[] =;
static const unsigned int gpio66_pins[] =;
static const unsigned int gpio67_pins[] =;
static const unsigned int eth1_pins[] =;
static const unsigned int i2s0_pins[] =;
static const unsigned int i2s0_mclkin_pins[] =;
static const unsigned int i2s1_pins[] =;
static const unsigned int i2s1_mclkin_pins[] =;
static const unsigned int spi0_pins[] =;

#define BM1880_PINCTRL_GRP(nm)

static const struct bm1880_pctrl_group bm1880_pctrl_groups[] =;

static const char * const nand_group[] =;
static const char * const spi_group[] =;
static const char * const emmc_group[] =;
static const char * const sdio_group[] =;
static const char * const eth0_group[] =;
static const char * const pwm0_group[] =;
static const char * const pwm1_group[] =;
static const char * const pwm2_group[] =;
static const char * const pwm3_group[] =;
static const char * const pwm4_group[] =;
static const char * const pwm5_group[] =;
static const char * const pwm6_group[] =;
static const char * const pwm7_group[] =;
static const char * const pwm8_group[] =;
static const char * const pwm9_group[] =;
static const char * const pwm10_group[] =;
static const char * const pwm11_group[] =;
static const char * const pwm12_group[] =;
static const char * const pwm13_group[] =;
static const char * const pwm14_group[] =;
static const char * const pwm15_group[] =;
static const char * const pwm16_group[] =;
static const char * const pwm17_group[] =;
static const char * const pwm18_group[] =;
static const char * const pwm19_group[] =;
static const char * const pwm20_group[] =;
static const char * const pwm21_group[] =;
static const char * const pwm22_group[] =;
static const char * const pwm23_group[] =;
static const char * const pwm24_group[] =;
static const char * const pwm25_group[] =;
static const char * const pwm26_group[] =;
static const char * const pwm27_group[] =;
static const char * const pwm28_group[] =;
static const char * const pwm29_group[] =;
static const char * const pwm30_group[] =;
static const char * const pwm31_group[] =;
static const char * const pwm32_group[] =;
static const char * const pwm33_group[] =;
static const char * const pwm34_group[] =;
static const char * const pwm35_group[] =;
static const char * const pwm36_group[] =;
static const char * const pwm37_group[] =;
static const char * const i2c0_group[] =;
static const char * const i2c1_group[] =;
static const char * const i2c2_group[] =;
static const char * const i2c3_group[] =;
static const char * const i2c4_group[] =;
static const char * const uart0_group[] =;
static const char * const uart1_group[] =;
static const char * const uart2_group[] =;
static const char * const uart3_group[] =;
static const char * const uart4_group[] =;
static const char * const uart5_group[] =;
static const char * const uart6_group[] =;
static const char * const uart7_group[] =;
static const char * const uart8_group[] =;
static const char * const uart9_group[] =;
static const char * const uart10_group[] =;
static const char * const uart11_group[] =;
static const char * const uart12_group[] =;
static const char * const uart13_group[] =;
static const char * const uart14_group[] =;
static const char * const uart15_group[] =;
static const char * const gpio0_group[] =;
static const char * const gpio1_group[] =;
static const char * const gpio2_group[] =;
static const char * const gpio3_group[] =;
static const char * const gpio4_group[] =;
static const char * const gpio5_group[] =;
static const char * const gpio6_group[] =;
static const char * const gpio7_group[] =;
static const char * const gpio8_group[] =;
static const char * const gpio9_group[] =;
static const char * const gpio10_group[] =;
static const char * const gpio11_group[] =;
static const char * const gpio12_group[] =;
static const char * const gpio13_group[] =;
static const char * const gpio14_group[] =;
static const char * const gpio15_group[] =;
static const char * const gpio16_group[] =;
static const char * const gpio17_group[] =;
static const char * const gpio18_group[] =;
static const char * const gpio19_group[] =;
static const char * const gpio20_group[] =;
static const char * const gpio21_group[] =;
static const char * const gpio22_group[] =;
static const char * const gpio23_group[] =;
static const char * const gpio24_group[] =;
static const char * const gpio25_group[] =;
static const char * const gpio26_group[] =;
static const char * const gpio27_group[] =;
static const char * const gpio28_group[] =;
static const char * const gpio29_group[] =;
static const char * const gpio30_group[] =;
static const char * const gpio31_group[] =;
static const char * const gpio32_group[] =;
static const char * const gpio33_group[] =;
static const char * const gpio34_group[] =;
static const char * const gpio35_group[] =;
static const char * const gpio36_group[] =;
static const char * const gpio37_group[] =;
static const char * const gpio38_group[] =;
static const char * const gpio39_group[] =;
static const char * const gpio40_group[] =;
static const char * const gpio41_group[] =;
static const char * const gpio42_group[] =;
static const char * const gpio43_group[] =;
static const char * const gpio44_group[] =;
static const char * const gpio45_group[] =;
static const char * const gpio46_group[] =;
static const char * const gpio47_group[] =;
static const char * const gpio48_group[] =;
static const char * const gpio49_group[] =;
static const char * const gpio50_group[] =;
static const char * const gpio51_group[] =;
static const char * const gpio52_group[] =;
static const char * const gpio53_group[] =;
static const char * const gpio54_group[] =;
static const char * const gpio55_group[] =;
static const char * const gpio56_group[] =;
static const char * const gpio57_group[] =;
static const char * const gpio58_group[] =;
static const char * const gpio59_group[] =;
static const char * const gpio60_group[] =;
static const char * const gpio61_group[] =;
static const char * const gpio62_group[] =;
static const char * const gpio63_group[] =;
static const char * const gpio64_group[] =;
static const char * const gpio65_group[] =;
static const char * const gpio66_group[] =;
static const char * const gpio67_group[] =;
static const char * const eth1_group[] =;
static const char * const i2s0_group[] =;
static const char * const i2s0_mclkin_group[] =;
static const char * const i2s1_group[] =;
static const char * const i2s1_mclkin_group[] =;
static const char * const spi0_group[] =;

#define BM1880_PINMUX_FUNCTION(fname, mval)

static const struct bm1880_pinmux_function bm1880_pmux_functions[] =;

#define BM1880_PINCONF_DAT(_width)

static const struct bm1880_pinconf_data bm1880_pinconf[] =;

static int bm1880_pctrl_get_groups_count(struct pinctrl_dev *pctldev)
{}

static const char *bm1880_pctrl_get_group_name(struct pinctrl_dev *pctldev,
					       unsigned int selector)
{}

static int bm1880_pctrl_get_group_pins(struct pinctrl_dev *pctldev,
				       unsigned int selector,
				       const unsigned int **pins,
				       unsigned int *num_pins)
{}

static const struct pinctrl_ops bm1880_pctrl_ops =;

/* pinmux */
static int bm1880_pmux_get_functions_count(struct pinctrl_dev *pctldev)
{}

static const char *bm1880_pmux_get_function_name(struct pinctrl_dev *pctldev,
						 unsigned int selector)
{}

static int bm1880_pmux_get_function_groups(struct pinctrl_dev *pctldev,
					   unsigned int selector,
					   const char * const **groups,
					   unsigned * const num_groups)
{}

static int bm1880_pinmux_set_mux(struct pinctrl_dev *pctldev,
				 unsigned int function,
				 unsigned int  group)
{}

#define BM1880_PINCONF(pin, idx)
#define BM1880_PINCONF_PULLCTRL(pin)
#define BM1880_PINCONF_PULLUP(pin)
#define BM1880_PINCONF_PULLDOWN(pin)
#define BM1880_PINCONF_DRV(pin)
#define BM1880_PINCONF_SCHMITT(pin)
#define BM1880_PINCONF_SLEW(pin)

static int bm1880_pinconf_drv_set(unsigned int mA, u32 width,
				  u32 *regval, u32 bit_offset)
{}

static int bm1880_pinconf_drv_get(u32 width, u32 drv)
{}

static int bm1880_pinconf_cfg_get(struct pinctrl_dev *pctldev,
				  unsigned int pin,
				  unsigned long *config)
{}

static int bm1880_pinconf_cfg_set(struct pinctrl_dev *pctldev,
				  unsigned int pin,
				  unsigned long *configs,
				  unsigned int num_configs)
{}

static int bm1880_pinconf_group_set(struct pinctrl_dev *pctldev,
				    unsigned int selector,
				    unsigned long *configs,
				    unsigned int  num_configs)
{}

static const struct pinconf_ops bm1880_pinconf_ops =;

static const struct pinmux_ops bm1880_pinmux_ops =;

static struct pinctrl_desc bm1880_desc =;

static int bm1880_pinctrl_probe(struct platform_device *pdev)

{}

static const struct of_device_id bm1880_pinctrl_of_match[] =;

static struct platform_driver bm1880_pinctrl_driver =;

static int __init bm1880_pinctrl_init(void)
{}
arch_initcall(bm1880_pinctrl_init);