#include <linux/err.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/seq_file.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 BCM281XX_PIN_REG_F_SEL_MASK …
#define BCM281XX_PIN_REG_F_SEL_SHIFT …
#define BCM281XX_STD_PIN_REG_DRV_STR_MASK …
#define BCM281XX_STD_PIN_REG_DRV_STR_SHIFT …
#define BCM281XX_STD_PIN_REG_INPUT_DIS_MASK …
#define BCM281XX_STD_PIN_REG_INPUT_DIS_SHIFT …
#define BCM281XX_STD_PIN_REG_SLEW_MASK …
#define BCM281XX_STD_PIN_REG_SLEW_SHIFT …
#define BCM281XX_STD_PIN_REG_PULL_UP_MASK …
#define BCM281XX_STD_PIN_REG_PULL_UP_SHIFT …
#define BCM281XX_STD_PIN_REG_PULL_DN_MASK …
#define BCM281XX_STD_PIN_REG_PULL_DN_SHIFT …
#define BCM281XX_STD_PIN_REG_HYST_MASK …
#define BCM281XX_STD_PIN_REG_HYST_SHIFT …
#define BCM281XX_I2C_PIN_REG_INPUT_DIS_MASK …
#define BCM281XX_I2C_PIN_REG_INPUT_DIS_SHIFT …
#define BCM281XX_I2C_PIN_REG_SLEW_MASK …
#define BCM281XX_I2C_PIN_REG_SLEW_SHIFT …
#define BCM281XX_I2C_PIN_REG_PULL_UP_STR_MASK …
#define BCM281XX_I2C_PIN_REG_PULL_UP_STR_SHIFT …
#define BCM281XX_HDMI_PIN_REG_INPUT_DIS_MASK …
#define BCM281XX_HDMI_PIN_REG_INPUT_DIS_SHIFT …
#define BCM281XX_HDMI_PIN_REG_MODE_MASK …
#define BCM281XX_HDMI_PIN_REG_MODE_SHIFT …
enum bcm281xx_pin_type { … };
static enum bcm281xx_pin_type std_pin = …;
static enum bcm281xx_pin_type i2c_pin = …;
static enum bcm281xx_pin_type hdmi_pin = …;
struct bcm281xx_pin_function { … };
struct bcm281xx_pinctrl_data { … };
#define BCM281XX_PIN_ADCSYNC …
#define BCM281XX_PIN_BAT_RM …
#define BCM281XX_PIN_BSC1_SCL …
#define BCM281XX_PIN_BSC1_SDA …
#define BCM281XX_PIN_BSC2_SCL …
#define BCM281XX_PIN_BSC2_SDA …
#define BCM281XX_PIN_CLASSGPWR …
#define BCM281XX_PIN_CLK_CX8 …
#define BCM281XX_PIN_CLKOUT_0 …
#define BCM281XX_PIN_CLKOUT_1 …
#define BCM281XX_PIN_CLKOUT_2 …
#define BCM281XX_PIN_CLKOUT_3 …
#define BCM281XX_PIN_CLKREQ_IN_0 …
#define BCM281XX_PIN_CLKREQ_IN_1 …
#define BCM281XX_PIN_CWS_SYS_REQ1 …
#define BCM281XX_PIN_CWS_SYS_REQ2 …
#define BCM281XX_PIN_CWS_SYS_REQ3 …
#define BCM281XX_PIN_DIGMIC1_CLK …
#define BCM281XX_PIN_DIGMIC1_DQ …
#define BCM281XX_PIN_DIGMIC2_CLK …
#define BCM281XX_PIN_DIGMIC2_DQ …
#define BCM281XX_PIN_GPEN13 …
#define BCM281XX_PIN_GPEN14 …
#define BCM281XX_PIN_GPEN15 …
#define BCM281XX_PIN_GPIO00 …
#define BCM281XX_PIN_GPIO01 …
#define BCM281XX_PIN_GPIO02 …
#define BCM281XX_PIN_GPIO03 …
#define BCM281XX_PIN_GPIO04 …
#define BCM281XX_PIN_GPIO05 …
#define BCM281XX_PIN_GPIO06 …
#define BCM281XX_PIN_GPIO07 …
#define BCM281XX_PIN_GPIO08 …
#define BCM281XX_PIN_GPIO09 …
#define BCM281XX_PIN_GPIO10 …
#define BCM281XX_PIN_GPIO11 …
#define BCM281XX_PIN_GPIO12 …
#define BCM281XX_PIN_GPIO13 …
#define BCM281XX_PIN_GPIO14 …
#define BCM281XX_PIN_GPS_PABLANK …
#define BCM281XX_PIN_GPS_TMARK …
#define BCM281XX_PIN_HDMI_SCL …
#define BCM281XX_PIN_HDMI_SDA …
#define BCM281XX_PIN_IC_DM …
#define BCM281XX_PIN_IC_DP …
#define BCM281XX_PIN_KP_COL_IP_0 …
#define BCM281XX_PIN_KP_COL_IP_1 …
#define BCM281XX_PIN_KP_COL_IP_2 …
#define BCM281XX_PIN_KP_COL_IP_3 …
#define BCM281XX_PIN_KP_ROW_OP_0 …
#define BCM281XX_PIN_KP_ROW_OP_1 …
#define BCM281XX_PIN_KP_ROW_OP_2 …
#define BCM281XX_PIN_KP_ROW_OP_3 …
#define BCM281XX_PIN_LCD_B_0 …
#define BCM281XX_PIN_LCD_B_1 …
#define BCM281XX_PIN_LCD_B_2 …
#define BCM281XX_PIN_LCD_B_3 …
#define BCM281XX_PIN_LCD_B_4 …
#define BCM281XX_PIN_LCD_B_5 …
#define BCM281XX_PIN_LCD_B_6 …
#define BCM281XX_PIN_LCD_B_7 …
#define BCM281XX_PIN_LCD_G_0 …
#define BCM281XX_PIN_LCD_G_1 …
#define BCM281XX_PIN_LCD_G_2 …
#define BCM281XX_PIN_LCD_G_3 …
#define BCM281XX_PIN_LCD_G_4 …
#define BCM281XX_PIN_LCD_G_5 …
#define BCM281XX_PIN_LCD_G_6 …
#define BCM281XX_PIN_LCD_G_7 …
#define BCM281XX_PIN_LCD_HSYNC …
#define BCM281XX_PIN_LCD_OE …
#define BCM281XX_PIN_LCD_PCLK …
#define BCM281XX_PIN_LCD_R_0 …
#define BCM281XX_PIN_LCD_R_1 …
#define BCM281XX_PIN_LCD_R_2 …
#define BCM281XX_PIN_LCD_R_3 …
#define BCM281XX_PIN_LCD_R_4 …
#define BCM281XX_PIN_LCD_R_5 …
#define BCM281XX_PIN_LCD_R_6 …
#define BCM281XX_PIN_LCD_R_7 …
#define BCM281XX_PIN_LCD_VSYNC …
#define BCM281XX_PIN_MDMGPIO0 …
#define BCM281XX_PIN_MDMGPIO1 …
#define BCM281XX_PIN_MDMGPIO2 …
#define BCM281XX_PIN_MDMGPIO3 …
#define BCM281XX_PIN_MDMGPIO4 …
#define BCM281XX_PIN_MDMGPIO5 …
#define BCM281XX_PIN_MDMGPIO6 …
#define BCM281XX_PIN_MDMGPIO7 …
#define BCM281XX_PIN_MDMGPIO8 …
#define BCM281XX_PIN_MPHI_DATA_0 …
#define BCM281XX_PIN_MPHI_DATA_1 …
#define BCM281XX_PIN_MPHI_DATA_2 …
#define BCM281XX_PIN_MPHI_DATA_3 …
#define BCM281XX_PIN_MPHI_DATA_4 …
#define BCM281XX_PIN_MPHI_DATA_5 …
#define BCM281XX_PIN_MPHI_DATA_6 …
#define BCM281XX_PIN_MPHI_DATA_7 …
#define BCM281XX_PIN_MPHI_DATA_8 …
#define BCM281XX_PIN_MPHI_DATA_9 …
#define BCM281XX_PIN_MPHI_DATA_10 …
#define BCM281XX_PIN_MPHI_DATA_11 …
#define BCM281XX_PIN_MPHI_DATA_12 …
#define BCM281XX_PIN_MPHI_DATA_13 …
#define BCM281XX_PIN_MPHI_DATA_14 …
#define BCM281XX_PIN_MPHI_DATA_15 …
#define BCM281XX_PIN_MPHI_HA0 …
#define BCM281XX_PIN_MPHI_HAT0 …
#define BCM281XX_PIN_MPHI_HAT1 …
#define BCM281XX_PIN_MPHI_HCE0_N …
#define BCM281XX_PIN_MPHI_HCE1_N …
#define BCM281XX_PIN_MPHI_HRD_N …
#define BCM281XX_PIN_MPHI_HWR_N …
#define BCM281XX_PIN_MPHI_RUN0 …
#define BCM281XX_PIN_MPHI_RUN1 …
#define BCM281XX_PIN_MTX_SCAN_CLK …
#define BCM281XX_PIN_MTX_SCAN_DATA …
#define BCM281XX_PIN_NAND_AD_0 …
#define BCM281XX_PIN_NAND_AD_1 …
#define BCM281XX_PIN_NAND_AD_2 …
#define BCM281XX_PIN_NAND_AD_3 …
#define BCM281XX_PIN_NAND_AD_4 …
#define BCM281XX_PIN_NAND_AD_5 …
#define BCM281XX_PIN_NAND_AD_6 …
#define BCM281XX_PIN_NAND_AD_7 …
#define BCM281XX_PIN_NAND_ALE …
#define BCM281XX_PIN_NAND_CEN_0 …
#define BCM281XX_PIN_NAND_CEN_1 …
#define BCM281XX_PIN_NAND_CLE …
#define BCM281XX_PIN_NAND_OEN …
#define BCM281XX_PIN_NAND_RDY_0 …
#define BCM281XX_PIN_NAND_RDY_1 …
#define BCM281XX_PIN_NAND_WEN …
#define BCM281XX_PIN_NAND_WP …
#define BCM281XX_PIN_PC1 …
#define BCM281XX_PIN_PC2 …
#define BCM281XX_PIN_PMU_INT …
#define BCM281XX_PIN_PMU_SCL …
#define BCM281XX_PIN_PMU_SDA …
#define BCM281XX_PIN_RFST2G_MTSLOTEN3G …
#define BCM281XX_PIN_RGMII_0_RX_CTL …
#define BCM281XX_PIN_RGMII_0_RXC …
#define BCM281XX_PIN_RGMII_0_RXD_0 …
#define BCM281XX_PIN_RGMII_0_RXD_1 …
#define BCM281XX_PIN_RGMII_0_RXD_2 …
#define BCM281XX_PIN_RGMII_0_RXD_3 …
#define BCM281XX_PIN_RGMII_0_TX_CTL …
#define BCM281XX_PIN_RGMII_0_TXC …
#define BCM281XX_PIN_RGMII_0_TXD_0 …
#define BCM281XX_PIN_RGMII_0_TXD_1 …
#define BCM281XX_PIN_RGMII_0_TXD_2 …
#define BCM281XX_PIN_RGMII_0_TXD_3 …
#define BCM281XX_PIN_RGMII_1_RX_CTL …
#define BCM281XX_PIN_RGMII_1_RXC …
#define BCM281XX_PIN_RGMII_1_RXD_0 …
#define BCM281XX_PIN_RGMII_1_RXD_1 …
#define BCM281XX_PIN_RGMII_1_RXD_2 …
#define BCM281XX_PIN_RGMII_1_RXD_3 …
#define BCM281XX_PIN_RGMII_1_TX_CTL …
#define BCM281XX_PIN_RGMII_1_TXC …
#define BCM281XX_PIN_RGMII_1_TXD_0 …
#define BCM281XX_PIN_RGMII_1_TXD_1 …
#define BCM281XX_PIN_RGMII_1_TXD_2 …
#define BCM281XX_PIN_RGMII_1_TXD_3 …
#define BCM281XX_PIN_RGMII_GPIO_0 …
#define BCM281XX_PIN_RGMII_GPIO_1 …
#define BCM281XX_PIN_RGMII_GPIO_2 …
#define BCM281XX_PIN_RGMII_GPIO_3 …
#define BCM281XX_PIN_RTXDATA2G_TXDATA3G1 …
#define BCM281XX_PIN_RTXEN2G_TXDATA3G2 …
#define BCM281XX_PIN_RXDATA3G0 …
#define BCM281XX_PIN_RXDATA3G1 …
#define BCM281XX_PIN_RXDATA3G2 …
#define BCM281XX_PIN_SDIO1_CLK …
#define BCM281XX_PIN_SDIO1_CMD …
#define BCM281XX_PIN_SDIO1_DATA_0 …
#define BCM281XX_PIN_SDIO1_DATA_1 …
#define BCM281XX_PIN_SDIO1_DATA_2 …
#define BCM281XX_PIN_SDIO1_DATA_3 …
#define BCM281XX_PIN_SDIO4_CLK …
#define BCM281XX_PIN_SDIO4_CMD …
#define BCM281XX_PIN_SDIO4_DATA_0 …
#define BCM281XX_PIN_SDIO4_DATA_1 …
#define BCM281XX_PIN_SDIO4_DATA_2 …
#define BCM281XX_PIN_SDIO4_DATA_3 …
#define BCM281XX_PIN_SIM_CLK …
#define BCM281XX_PIN_SIM_DATA …
#define BCM281XX_PIN_SIM_DET …
#define BCM281XX_PIN_SIM_RESETN …
#define BCM281XX_PIN_SIM2_CLK …
#define BCM281XX_PIN_SIM2_DATA …
#define BCM281XX_PIN_SIM2_DET …
#define BCM281XX_PIN_SIM2_RESETN …
#define BCM281XX_PIN_SRI_C …
#define BCM281XX_PIN_SRI_D …
#define BCM281XX_PIN_SRI_E …
#define BCM281XX_PIN_SSP_EXTCLK …
#define BCM281XX_PIN_SSP0_CLK …
#define BCM281XX_PIN_SSP0_FS …
#define BCM281XX_PIN_SSP0_RXD …
#define BCM281XX_PIN_SSP0_TXD …
#define BCM281XX_PIN_SSP2_CLK …
#define BCM281XX_PIN_SSP2_FS_0 …
#define BCM281XX_PIN_SSP2_FS_1 …
#define BCM281XX_PIN_SSP2_FS_2 …
#define BCM281XX_PIN_SSP2_FS_3 …
#define BCM281XX_PIN_SSP2_RXD_0 …
#define BCM281XX_PIN_SSP2_RXD_1 …
#define BCM281XX_PIN_SSP2_TXD_0 …
#define BCM281XX_PIN_SSP2_TXD_1 …
#define BCM281XX_PIN_SSP3_CLK …
#define BCM281XX_PIN_SSP3_FS …
#define BCM281XX_PIN_SSP3_RXD …
#define BCM281XX_PIN_SSP3_TXD …
#define BCM281XX_PIN_SSP4_CLK …
#define BCM281XX_PIN_SSP4_FS …
#define BCM281XX_PIN_SSP4_RXD …
#define BCM281XX_PIN_SSP4_TXD …
#define BCM281XX_PIN_SSP5_CLK …
#define BCM281XX_PIN_SSP5_FS …
#define BCM281XX_PIN_SSP5_RXD …
#define BCM281XX_PIN_SSP5_TXD …
#define BCM281XX_PIN_SSP6_CLK …
#define BCM281XX_PIN_SSP6_FS …
#define BCM281XX_PIN_SSP6_RXD …
#define BCM281XX_PIN_SSP6_TXD …
#define BCM281XX_PIN_STAT_1 …
#define BCM281XX_PIN_STAT_2 …
#define BCM281XX_PIN_SYSCLKEN …
#define BCM281XX_PIN_TRACECLK …
#define BCM281XX_PIN_TRACEDT00 …
#define BCM281XX_PIN_TRACEDT01 …
#define BCM281XX_PIN_TRACEDT02 …
#define BCM281XX_PIN_TRACEDT03 …
#define BCM281XX_PIN_TRACEDT04 …
#define BCM281XX_PIN_TRACEDT05 …
#define BCM281XX_PIN_TRACEDT06 …
#define BCM281XX_PIN_TRACEDT07 …
#define BCM281XX_PIN_TRACEDT08 …
#define BCM281XX_PIN_TRACEDT09 …
#define BCM281XX_PIN_TRACEDT10 …
#define BCM281XX_PIN_TRACEDT11 …
#define BCM281XX_PIN_TRACEDT12 …
#define BCM281XX_PIN_TRACEDT13 …
#define BCM281XX_PIN_TRACEDT14 …
#define BCM281XX_PIN_TRACEDT15 …
#define BCM281XX_PIN_TXDATA3G0 …
#define BCM281XX_PIN_TXPWRIND …
#define BCM281XX_PIN_UARTB1_UCTS …
#define BCM281XX_PIN_UARTB1_URTS …
#define BCM281XX_PIN_UARTB1_URXD …
#define BCM281XX_PIN_UARTB1_UTXD …
#define BCM281XX_PIN_UARTB2_URXD …
#define BCM281XX_PIN_UARTB2_UTXD …
#define BCM281XX_PIN_UARTB3_UCTS …
#define BCM281XX_PIN_UARTB3_URTS …
#define BCM281XX_PIN_UARTB3_URXD …
#define BCM281XX_PIN_UARTB3_UTXD …
#define BCM281XX_PIN_UARTB4_UCTS …
#define BCM281XX_PIN_UARTB4_URTS …
#define BCM281XX_PIN_UARTB4_URXD …
#define BCM281XX_PIN_UARTB4_UTXD …
#define BCM281XX_PIN_VC_CAM1_SCL …
#define BCM281XX_PIN_VC_CAM1_SDA …
#define BCM281XX_PIN_VC_CAM2_SCL …
#define BCM281XX_PIN_VC_CAM2_SDA …
#define BCM281XX_PIN_VC_CAM3_SCL …
#define BCM281XX_PIN_VC_CAM3_SDA …
#define BCM281XX_PIN_DESC(a, b, c) …
static const struct pinctrl_pin_desc bcm281xx_pinctrl_pins[] = …;
static const char * const bcm281xx_alt_groups[] = …;
#define BCM281XX_PIN_FUNCTION(fcn_name) …
static const struct bcm281xx_pin_function bcm281xx_functions[] = …;
static struct bcm281xx_pinctrl_data bcm281xx_pinctrl = …;
static inline enum bcm281xx_pin_type pin_type_get(struct pinctrl_dev *pctldev,
unsigned pin)
{ … }
#define BCM281XX_PIN_SHIFT(type, param) …
#define BCM281XX_PIN_MASK(type, param) …
static inline void bcm281xx_pin_update(u32 *reg_val, u32 *reg_mask,
u32 param_val, u32 param_shift,
u32 param_mask)
{ … }
static const struct regmap_config bcm281xx_pinctrl_regmap_config = …;
static int bcm281xx_pinctrl_get_groups_count(struct pinctrl_dev *pctldev)
{ … }
static const char *bcm281xx_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
unsigned group)
{ … }
static int bcm281xx_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
unsigned group,
const unsigned **pins,
unsigned *num_pins)
{ … }
static void bcm281xx_pinctrl_pin_dbg_show(struct pinctrl_dev *pctldev,
struct seq_file *s,
unsigned offset)
{ … }
static const struct pinctrl_ops bcm281xx_pinctrl_ops = …;
static int bcm281xx_pinctrl_get_fcns_count(struct pinctrl_dev *pctldev)
{ … }
static const char *bcm281xx_pinctrl_get_fcn_name(struct pinctrl_dev *pctldev,
unsigned function)
{ … }
static int bcm281xx_pinctrl_get_fcn_groups(struct pinctrl_dev *pctldev,
unsigned function,
const char * const **groups,
unsigned * const num_groups)
{ … }
static int bcm281xx_pinmux_set(struct pinctrl_dev *pctldev,
unsigned function,
unsigned group)
{ … }
static const struct pinmux_ops bcm281xx_pinctrl_pinmux_ops = …;
static int bcm281xx_pinctrl_pin_config_get(struct pinctrl_dev *pctldev,
unsigned pin,
unsigned long *config)
{ … }
static int bcm281xx_std_pin_update(struct pinctrl_dev *pctldev,
unsigned pin,
unsigned long *configs,
unsigned num_configs,
u32 *val,
u32 *mask)
{ … }
static const u16 bcm281xx_pullup_map[] = …;
static int bcm281xx_i2c_pin_update(struct pinctrl_dev *pctldev,
unsigned pin,
unsigned long *configs,
unsigned num_configs,
u32 *val,
u32 *mask)
{ … }
static int bcm281xx_hdmi_pin_update(struct pinctrl_dev *pctldev,
unsigned pin,
unsigned long *configs,
unsigned num_configs,
u32 *val,
u32 *mask)
{ … }
static int bcm281xx_pinctrl_pin_config_set(struct pinctrl_dev *pctldev,
unsigned pin,
unsigned long *configs,
unsigned num_configs)
{ … }
static const struct pinconf_ops bcm281xx_pinctrl_pinconf_ops = …;
static struct pinctrl_desc bcm281xx_pinctrl_desc = …;
static int __init bcm281xx_pinctrl_probe(struct platform_device *pdev)
{ … }
static const struct of_device_id bcm281xx_pinctrl_of_match[] = …;
static struct platform_driver bcm281xx_pinctrl_driver = …;
builtin_platform_driver_probe(…);