#include <linux/init.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include "berlin.h"
static const struct berlin_desc_group berlin4ct_soc_pinctrl_groups[] = {
BERLIN_PINCTRL_GROUP("EMMC_RSTn", 0x0, 0x3, 0x00,
BERLIN_PINCTRL_FUNCTION(0x0, "emmc"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio")),
BERLIN_PINCTRL_GROUP("NAND_IO0", 0x0, 0x3, 0x03,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"),
BERLIN_PINCTRL_FUNCTION(0x2, "sd1"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
BERLIN_PINCTRL_GROUP("NAND_IO1", 0x0, 0x3, 0x06,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"),
BERLIN_PINCTRL_FUNCTION(0x2, "sd1"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
BERLIN_PINCTRL_GROUP("NAND_IO2", 0x0, 0x3, 0x09,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"),
BERLIN_PINCTRL_FUNCTION(0x2, "sd1"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
BERLIN_PINCTRL_GROUP("NAND_IO3", 0x0, 0x3, 0x0c,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"),
BERLIN_PINCTRL_FUNCTION(0x2, "sd1"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
BERLIN_PINCTRL_GROUP("NAND_IO4", 0x0, 0x3, 0x0f,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"),
BERLIN_PINCTRL_FUNCTION(0x2, "sd1"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
BERLIN_PINCTRL_GROUP("NAND_IO5", 0x0, 0x3, 0x12,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"),
BERLIN_PINCTRL_FUNCTION(0x2, "sd1"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
BERLIN_PINCTRL_GROUP("NAND_IO6", 0x0, 0x3, 0x15,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"),
BERLIN_PINCTRL_FUNCTION(0x2, "sd1"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
BERLIN_PINCTRL_GROUP("NAND_IO7", 0x0, 0x3, 0x18,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"),
BERLIN_PINCTRL_FUNCTION(0x2, "sd1"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
BERLIN_PINCTRL_GROUP("NAND_ALE", 0x0, 0x3, 0x1b,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
BERLIN_PINCTRL_GROUP("NAND_CLE", 0x4, 0x3, 0x00,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
BERLIN_PINCTRL_GROUP("NAND_WEn", 0x4, 0x3, 0x03,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
BERLIN_PINCTRL_GROUP("NAND_REn", 0x4, 0x3, 0x06,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
BERLIN_PINCTRL_GROUP("NAND_WPn", 0x4, 0x3, 0x09,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
BERLIN_PINCTRL_GROUP("NAND_CEn", 0x4, 0x3, 0x0c,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
BERLIN_PINCTRL_GROUP("NAND_RDY", 0x4, 0x3, 0x0f,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
BERLIN_PINCTRL_GROUP("SD0_CLK", 0x4, 0x3, 0x12,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
BERLIN_PINCTRL_FUNCTION(0x2, "sts4"),
BERLIN_PINCTRL_FUNCTION(0x5, "v4g"),
BERLIN_PINCTRL_FUNCTION(0x7, "phy")),
BERLIN_PINCTRL_GROUP("SD0_DAT0", 0x4, 0x3, 0x15,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
BERLIN_PINCTRL_FUNCTION(0x2, "sts4"),
BERLIN_PINCTRL_FUNCTION(0x5, "v4g"),
BERLIN_PINCTRL_FUNCTION(0x7, "phy")),
BERLIN_PINCTRL_GROUP("SD0_DAT1", 0x4, 0x3, 0x18,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
BERLIN_PINCTRL_FUNCTION(0x2, "sts4"),
BERLIN_PINCTRL_FUNCTION(0x5, "v4g"),
BERLIN_PINCTRL_FUNCTION(0x7, "phy")),
BERLIN_PINCTRL_GROUP("SD0_DAT2", 0x4, 0x3, 0x1b,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
BERLIN_PINCTRL_FUNCTION(0x2, "sts4"),
BERLIN_PINCTRL_FUNCTION(0x5, "v4g"),
BERLIN_PINCTRL_FUNCTION(0x7, "phy")),
BERLIN_PINCTRL_GROUP("SD0_DAT3", 0x8, 0x3, 0x00,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
BERLIN_PINCTRL_FUNCTION(0x2, "sts5"),
BERLIN_PINCTRL_FUNCTION(0x5, "v4g"),
BERLIN_PINCTRL_FUNCTION(0x7, "phy")),
BERLIN_PINCTRL_GROUP("SD0_CDn", 0x8, 0x3, 0x03,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
BERLIN_PINCTRL_FUNCTION(0x2, "sts5"),
BERLIN_PINCTRL_FUNCTION(0x5, "v4g"),
BERLIN_PINCTRL_FUNCTION(0x7, "phy")),
BERLIN_PINCTRL_GROUP("SD0_CMD", 0x8, 0x3, 0x06,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
BERLIN_PINCTRL_FUNCTION(0x2, "sts5"),
BERLIN_PINCTRL_FUNCTION(0x5, "v4g"),
BERLIN_PINCTRL_FUNCTION(0x7, "phy")),
BERLIN_PINCTRL_GROUP("SD0_WP", 0x8, 0x3, 0x09,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
BERLIN_PINCTRL_FUNCTION(0x2, "sts5"),
BERLIN_PINCTRL_FUNCTION(0x5, "v4g"),
BERLIN_PINCTRL_FUNCTION(0x7, "phy")),
BERLIN_PINCTRL_GROUP("STS0_CLK", 0x8, 0x3, 0x0c,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "sts0"),
BERLIN_PINCTRL_FUNCTION(0x2, "cpupll"),
BERLIN_PINCTRL_FUNCTION(0x5, "v4g"),
BERLIN_PINCTRL_FUNCTION(0x7, "phy")),
BERLIN_PINCTRL_GROUP("STS0_SOP", 0x8, 0x3, 0x0f,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "sts0"),
BERLIN_PINCTRL_FUNCTION(0x2, "syspll"),
BERLIN_PINCTRL_FUNCTION(0x5, "v4g"),
BERLIN_PINCTRL_FUNCTION(0x7, "phy")),
BERLIN_PINCTRL_GROUP("STS0_SD", 0x8, 0x3, 0x12,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "sts0"),
BERLIN_PINCTRL_FUNCTION(0x2, "mempll"),
BERLIN_PINCTRL_FUNCTION(0x5, "v4g"),
BERLIN_PINCTRL_FUNCTION(0x7, "phy")),
BERLIN_PINCTRL_GROUP("STS0_VALD", 0x8, 0x3, 0x15,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "sts0"),
BERLIN_PINCTRL_FUNCTION(0x5, "v4g"),
BERLIN_PINCTRL_FUNCTION(0x7, "phy")),
BERLIN_PINCTRL_GROUP("STS1_CLK", 0x8, 0x3, 0x18,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "sts1"),
BERLIN_PINCTRL_FUNCTION(0x2, "pwm0"),
BERLIN_PINCTRL_FUNCTION(0x5, "v4g"),
BERLIN_PINCTRL_FUNCTION(0x7, "phy")),
BERLIN_PINCTRL_GROUP("STS1_SOP", 0x8, 0x3, 0x1b,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "sts1"),
BERLIN_PINCTRL_FUNCTION(0x2, "pwm1"),
BERLIN_PINCTRL_FUNCTION(0x5, "v4g"),
BERLIN_PINCTRL_FUNCTION(0x7, "phy")),
BERLIN_PINCTRL_GROUP("STS1_SD", 0xc, 0x3, 0x00,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "sts1"),
BERLIN_PINCTRL_FUNCTION(0x2, "pwm2"),
BERLIN_PINCTRL_FUNCTION(0x5, "v4g"),
BERLIN_PINCTRL_FUNCTION(0x7, "phy")),
BERLIN_PINCTRL_GROUP("STS1_VALD", 0xc, 0x3, 0x03,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "sts1"),
BERLIN_PINCTRL_FUNCTION(0x2, "pwm3"),
BERLIN_PINCTRL_FUNCTION(0x5, "v4g"),
BERLIN_PINCTRL_FUNCTION(0x7, "phy")),
BERLIN_PINCTRL_GROUP("SCRD0_RST", 0xc, 0x3, 0x06,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "scrd0"),
BERLIN_PINCTRL_FUNCTION(0x3, "sd1a")),
BERLIN_PINCTRL_GROUP("SCRD0_DCLK", 0xc, 0x3, 0x09,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "scrd0"),
BERLIN_PINCTRL_FUNCTION(0x3, "sd1a")),
BERLIN_PINCTRL_GROUP("SCRD0_GPIO0", 0xc, 0x3, 0x0c,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "scrd0"),
BERLIN_PINCTRL_FUNCTION(0x2, "sif"),
BERLIN_PINCTRL_FUNCTION(0x3, "sd1a")),
BERLIN_PINCTRL_GROUP("SCRD0_GPIO1", 0xc, 0x3, 0x0f,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "scrd0"),
BERLIN_PINCTRL_FUNCTION(0x2, "sif"),
BERLIN_PINCTRL_FUNCTION(0x3, "sd1a")),
BERLIN_PINCTRL_GROUP("SCRD0_DIO", 0xc, 0x3, 0x12,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "scrd0"),
BERLIN_PINCTRL_FUNCTION(0x2, "sif"),
BERLIN_PINCTRL_FUNCTION(0x3, "sd1a")),
BERLIN_PINCTRL_GROUP("SCRD0_CRD_PRES", 0xc, 0x3, 0x15,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "scrd0"),
BERLIN_PINCTRL_FUNCTION(0x3, "sd1a")),
BERLIN_PINCTRL_GROUP("SPI1_SS0n", 0xc, 0x3, 0x18,
BERLIN_PINCTRL_FUNCTION(0x0, "spi1"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x2, "sts2")),
BERLIN_PINCTRL_GROUP("SPI1_SS1n", 0xc, 0x3, 0x1b,
BERLIN_PINCTRL_FUNCTION(0x0, "spi1"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x2, "sts2"),
BERLIN_PINCTRL_FUNCTION(0x4, "pwm1")),
BERLIN_PINCTRL_GROUP("SPI1_SS2n", 0x10, 0x3, 0x00,
BERLIN_PINCTRL_FUNCTION(0x0, "spi1"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x2, "sts2"),
BERLIN_PINCTRL_FUNCTION(0x4, "pwm0")),
BERLIN_PINCTRL_GROUP("SPI1_SS3n", 0x10, 0x3, 0x03,
BERLIN_PINCTRL_FUNCTION(0x0, "spi1"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x2, "sts2")),
BERLIN_PINCTRL_GROUP("SPI1_SCLK", 0x10, 0x3, 0x06,
BERLIN_PINCTRL_FUNCTION(0x0, "spi1"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x2, "sts3")),
BERLIN_PINCTRL_GROUP("SPI1_SDO", 0x10, 0x3, 0x09,
BERLIN_PINCTRL_FUNCTION(0x0, "spi1"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x2, "sts3")),
BERLIN_PINCTRL_GROUP("SPI1_SDI", 0x10, 0x3, 0x0c,
BERLIN_PINCTRL_FUNCTION(0x0, "spi1"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x2, "sts3")),
BERLIN_PINCTRL_GROUP("USB0_DRV_VBUS", 0x10, 0x3, 0x0f,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "usb0"),
BERLIN_PINCTRL_FUNCTION(0x2, "sts3")),
BERLIN_PINCTRL_GROUP("TW0_SCL", 0x10, 0x3, 0x12,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "tw0")),
BERLIN_PINCTRL_GROUP("TW0_SDA", 0x10, 0x3, 0x15,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "tw0")),
};
static const struct berlin_desc_group berlin4ct_avio_pinctrl_groups[] = {
BERLIN_PINCTRL_GROUP("TX_EDDC_SCL", 0x0, 0x3, 0x00,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "tx_eddc"),
BERLIN_PINCTRL_FUNCTION(0x2, "tw1")),
BERLIN_PINCTRL_GROUP("TX_EDDC_SDA", 0x0, 0x3, 0x03,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "tx_eddc"),
BERLIN_PINCTRL_FUNCTION(0x2, "tw1")),
BERLIN_PINCTRL_GROUP("I2S1_LRCKO", 0x0, 0x3, 0x06,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"),
BERLIN_PINCTRL_FUNCTION(0x3, "sts6"),
BERLIN_PINCTRL_FUNCTION(0x4, "adac"),
BERLIN_PINCTRL_FUNCTION(0x6, "sd1b"),
BERLIN_PINCTRL_FUNCTION(0x7, "avio")),
BERLIN_PINCTRL_GROUP("I2S1_BCLKO", 0x0, 0x3, 0x09,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"),
BERLIN_PINCTRL_FUNCTION(0x3, "sts6"),
BERLIN_PINCTRL_FUNCTION(0x4, "adac"),
BERLIN_PINCTRL_FUNCTION(0x6, "sd1b"),
BERLIN_PINCTRL_FUNCTION(0x7, "avio")),
BERLIN_PINCTRL_GROUP("I2S1_DO", 0x0, 0x3, 0x0c,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"),
BERLIN_PINCTRL_FUNCTION(0x3, "sts6"),
BERLIN_PINCTRL_FUNCTION(0x4, "adac"),
BERLIN_PINCTRL_FUNCTION(0x6, "sd1b"),
BERLIN_PINCTRL_FUNCTION(0x7, "avio")),
BERLIN_PINCTRL_GROUP("I2S1_MCLK", 0x0, 0x3, 0x0f,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"),
BERLIN_PINCTRL_FUNCTION(0x3, "sts6"),
BERLIN_PINCTRL_FUNCTION(0x4, "adac_test"),
BERLIN_PINCTRL_FUNCTION(0x6, "sd1b"),
BERLIN_PINCTRL_FUNCTION(0x7, "avio")),
BERLIN_PINCTRL_GROUP("SPDIFO", 0x0, 0x3, 0x12,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "spdifo"),
BERLIN_PINCTRL_FUNCTION(0x2, "avpll"),
BERLIN_PINCTRL_FUNCTION(0x4, "adac")),
BERLIN_PINCTRL_GROUP("I2S2_MCLK", 0x0, 0x3, 0x15,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"),
BERLIN_PINCTRL_FUNCTION(0x4, "hdmi"),
BERLIN_PINCTRL_FUNCTION(0x5, "pdm")),
BERLIN_PINCTRL_GROUP("I2S2_LRCKI", 0x0, 0x3, 0x18,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"),
BERLIN_PINCTRL_FUNCTION(0x2, "pwm0"),
BERLIN_PINCTRL_FUNCTION(0x3, "sts7"),
BERLIN_PINCTRL_FUNCTION(0x4, "adac_test"),
BERLIN_PINCTRL_FUNCTION(0x6, "sd1b")),
BERLIN_PINCTRL_GROUP("I2S2_BCLKI", 0x0, 0x3, 0x1b,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"),
BERLIN_PINCTRL_FUNCTION(0x2, "pwm1"),
BERLIN_PINCTRL_FUNCTION(0x3, "sts7"),
BERLIN_PINCTRL_FUNCTION(0x4, "adac_test"),
BERLIN_PINCTRL_FUNCTION(0x6, "sd1b")),
BERLIN_PINCTRL_GROUP("I2S2_DI0", 0x4, 0x3, 0x00,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"),
BERLIN_PINCTRL_FUNCTION(0x2, "pwm2"),
BERLIN_PINCTRL_FUNCTION(0x3, "sts7"),
BERLIN_PINCTRL_FUNCTION(0x4, "adac_test"),
BERLIN_PINCTRL_FUNCTION(0x5, "pdm"),
BERLIN_PINCTRL_FUNCTION(0x6, "sd1b")),
BERLIN_PINCTRL_GROUP("I2S2_DI1", 0x4, 0x3, 0x03,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"),
BERLIN_PINCTRL_FUNCTION(0x2, "pwm3"),
BERLIN_PINCTRL_FUNCTION(0x3, "sts7"),
BERLIN_PINCTRL_FUNCTION(0x4, "adac_test"),
BERLIN_PINCTRL_FUNCTION(0x5, "pdm"),
BERLIN_PINCTRL_FUNCTION(0x6, "sd1b")),
};
static const struct berlin_desc_group berlin4ct_sysmgr_pinctrl_groups[] = {
BERLIN_PINCTRL_GROUP("SM_TW2_SCL", 0x0, 0x3, 0x00,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "tw2")),
BERLIN_PINCTRL_GROUP("SM_TW2_SDA", 0x0, 0x3, 0x03,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "tw2")),
BERLIN_PINCTRL_GROUP("SM_TW3_SCL", 0x0, 0x3, 0x06,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "tw3")),
BERLIN_PINCTRL_GROUP("SM_TW3_SDA", 0x0, 0x3, 0x09,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "tw3")),
BERLIN_PINCTRL_GROUP("SM_TMS", 0x0, 0x3, 0x0c,
BERLIN_PINCTRL_FUNCTION(0x0, "jtag"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x2, "pwm0")),
BERLIN_PINCTRL_GROUP("SM_TDI", 0x0, 0x3, 0x0f,
BERLIN_PINCTRL_FUNCTION(0x0, "jtag"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x2, "pwm1")),
BERLIN_PINCTRL_GROUP("SM_TDO", 0x0, 0x3, 0x12,
BERLIN_PINCTRL_FUNCTION(0x0, "jtag"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio")),
BERLIN_PINCTRL_GROUP("SM_URT0_TXD", 0x0, 0x3, 0x15,
BERLIN_PINCTRL_FUNCTION(0x0, "uart0"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio")),
BERLIN_PINCTRL_GROUP("SM_URT0_RXD", 0x0, 0x3, 0x18,
BERLIN_PINCTRL_FUNCTION(0x0, "uart0"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio")),
BERLIN_PINCTRL_GROUP("SM_URT1_TXD", 0x0, 0x3, 0x1b,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "uart1"),
BERLIN_PINCTRL_FUNCTION(0x2, "eth1"),
BERLIN_PINCTRL_FUNCTION(0x3, "pwm2"),
BERLIN_PINCTRL_FUNCTION(0x4, "timer0"),
BERLIN_PINCTRL_FUNCTION(0x5, "clk_25m")),
BERLIN_PINCTRL_GROUP("SM_URT1_RXD", 0x4, 0x3, 0x00,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "uart1"),
BERLIN_PINCTRL_FUNCTION(0x3, "pwm3"),
BERLIN_PINCTRL_FUNCTION(0x4, "timer1")),
BERLIN_PINCTRL_GROUP("SM_SPI2_SS0n", 0x4, 0x3, 0x03,
BERLIN_PINCTRL_FUNCTION(0x0, "spi2"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio")),
BERLIN_PINCTRL_GROUP("SM_SPI2_SS1n", 0x4, 0x3, 0x06,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "spi2")),
BERLIN_PINCTRL_GROUP("SM_SPI2_SS2n", 0x4, 0x3, 0x09,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "spi2"),
BERLIN_PINCTRL_FUNCTION(0x2, "eth1"),
BERLIN_PINCTRL_FUNCTION(0x3, "pwm0"),
BERLIN_PINCTRL_FUNCTION(0x4, "timer0"),
BERLIN_PINCTRL_FUNCTION(0x5, "clk_25m")),
BERLIN_PINCTRL_GROUP("SM_SPI2_SS3n", 0x4, 0x3, 0x0c,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "spi2"),
BERLIN_PINCTRL_FUNCTION(0x2, "eth1"),
BERLIN_PINCTRL_FUNCTION(0x3, "pwm1"),
BERLIN_PINCTRL_FUNCTION(0x4, "timer1")),
BERLIN_PINCTRL_GROUP("SM_SPI2_SDO", 0x4, 0x3, 0x0f,
BERLIN_PINCTRL_FUNCTION(0x0, "spi2"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio")),
BERLIN_PINCTRL_GROUP("SM_SPI2_SDI", 0x4, 0x3, 0x12,
BERLIN_PINCTRL_FUNCTION(0x0, "spi2"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio")),
BERLIN_PINCTRL_GROUP("SM_SPI2_SCLK", 0x4, 0x3, 0x15,
BERLIN_PINCTRL_FUNCTION(0x0, "spi2"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio")),
BERLIN_PINCTRL_GROUP("SM_FE_LED0", 0x4, 0x3, 0x18,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x2, "led")),
BERLIN_PINCTRL_GROUP("SM_FE_LED1", 0x4, 0x3, 0x1b,
BERLIN_PINCTRL_FUNCTION(0x0, "pwr"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x2, "led")),
BERLIN_PINCTRL_GROUP("SM_FE_LED2", 0x8, 0x3, 0x00,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x2, "led")),
BERLIN_PINCTRL_GROUP("SM_HDMI_HPD", 0x8, 0x3, 0x03,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "hdmi")),
BERLIN_PINCTRL_GROUP("SM_HDMI_CEC", 0x8, 0x3, 0x06,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "hdmi")),
};
static const struct berlin_pinctrl_desc berlin4ct_soc_pinctrl_data = {
.groups = berlin4ct_soc_pinctrl_groups,
.ngroups = ARRAY_SIZE(berlin4ct_soc_pinctrl_groups),
};
static const struct berlin_pinctrl_desc berlin4ct_avio_pinctrl_data = {
.groups = berlin4ct_avio_pinctrl_groups,
.ngroups = ARRAY_SIZE(berlin4ct_avio_pinctrl_groups),
};
static const struct berlin_pinctrl_desc berlin4ct_sysmgr_pinctrl_data = {
.groups = berlin4ct_sysmgr_pinctrl_groups,
.ngroups = ARRAY_SIZE(berlin4ct_sysmgr_pinctrl_groups),
};
static const struct of_device_id berlin4ct_pinctrl_match[] = {
{
.compatible = "marvell,berlin4ct-soc-pinctrl",
.data = &berlin4ct_soc_pinctrl_data,
},
{
.compatible = "marvell,berlin4ct-avio-pinctrl",
.data = &berlin4ct_avio_pinctrl_data,
},
{
.compatible = "marvell,berlin4ct-system-pinctrl",
.data = &berlin4ct_sysmgr_pinctrl_data,
},
{}
};
static int berlin4ct_pinctrl_probe(struct platform_device *pdev)
{
const struct of_device_id *match =
of_match_device(berlin4ct_pinctrl_match, &pdev->dev);
struct regmap_config *rmconfig;
struct regmap *regmap;
struct resource *res;
void __iomem *base;
rmconfig = devm_kzalloc(&pdev->dev, sizeof(*rmconfig), GFP_KERNEL);
if (!rmconfig)
return -ENOMEM;
base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(base))
return PTR_ERR(base);
rmconfig->reg_bits = 32,
rmconfig->val_bits = 32,
rmconfig->reg_stride = 4,
rmconfig->max_register = resource_size(res);
regmap = devm_regmap_init_mmio(&pdev->dev, base, rmconfig);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
return berlin_pinctrl_probe_regmap(pdev, match->data, regmap);
}
static struct platform_driver berlin4ct_pinctrl_driver = {
.probe = berlin4ct_pinctrl_probe,
.driver = {
.name = "berlin4ct-pinctrl",
.of_match_table = berlin4ct_pinctrl_match,
},
};
builtin_platform_driver