#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 as370_soc_pinctrl_groups[] = {
BERLIN_PINCTRL_GROUP("I2S1_BCLKIO", 0x0, 0x3, 0x00,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("I2S1_LRCKIO", 0x0, 0x3, 0x03,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("I2S1_DO0", 0x0, 0x3, 0x06,
BERLIN_PINCTRL_FUNCTION(0x0, "por"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("I2S1_DO1", 0x0, 0x3, 0x09,
BERLIN_PINCTRL_FUNCTION(0x0, "por"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("I2S1_DO2", 0x0, 0x3, 0x0c,
BERLIN_PINCTRL_FUNCTION(0x0, "por"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"),
BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("I2S1_DO3", 0x0, 0x3, 0x0f,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"),
BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
BERLIN_PINCTRL_FUNCTION(0x3, "spdifib"),
BERLIN_PINCTRL_FUNCTION(0x4, "spdifo"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("I2S1_MCLK", 0x0, 0x3, 0x12,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("I2S2_BCLKIO", 0x0, 0x3, 0x15,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("I2S2_LRCKIO", 0x0, 0x3, 0x18,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("I2S2_DI0", 0x0, 0x3, 0x1b,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"),
BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("I2S2_DI1", 0x4, 0x3, 0x00,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"),
BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("I2S2_DI2", 0x4, 0x3, 0x03,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"),
BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
BERLIN_PINCTRL_FUNCTION(0x3, "spdific"),
BERLIN_PINCTRL_FUNCTION(0x4, "spdifo"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("I2S2_DI3", 0x4, 0x3, 0x06,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"),
BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
BERLIN_PINCTRL_FUNCTION(0x3, "spdifia"),
BERLIN_PINCTRL_FUNCTION(0x4, "spdifo"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("PDM_CLKO", 0x4, 0x3, 0x09,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "pdm"),
BERLIN_PINCTRL_FUNCTION(0x2, "i2s2"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("PDM_DI0", 0x4, 0x3, 0x0c,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "pdm"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("PDM_DI1", 0x4, 0x3, 0x0f,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "pdm"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("PDM_DI2", 0x4, 0x3, 0x12,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "pdm"),
BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
BERLIN_PINCTRL_FUNCTION(0x3, "spdifid"),
BERLIN_PINCTRL_FUNCTION(0x4, "spdifo"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("PDM_DI3", 0x4, 0x3, 0x15,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "pdm"),
BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
BERLIN_PINCTRL_FUNCTION(0x3, "spdifi"),
BERLIN_PINCTRL_FUNCTION(0x4, "spdifo"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("NAND_IO0", 0x4, 0x3, 0x18,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "emmc"),
BERLIN_PINCTRL_FUNCTION(0x4, "pcie0")),
BERLIN_PINCTRL_GROUP("NAND_IO1", 0x4, 0x3, 0x1b,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "emmc"),
BERLIN_PINCTRL_FUNCTION(0x4, "pcie0")),
BERLIN_PINCTRL_GROUP("NAND_IO2", 0x8, 0x3, 0x00,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "emmc"),
BERLIN_PINCTRL_FUNCTION(0x4, "pcie1")),
BERLIN_PINCTRL_GROUP("NAND_IO3", 0x8, 0x3, 0x03,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "emmc"),
BERLIN_PINCTRL_FUNCTION(0x4, "pcie1")),
BERLIN_PINCTRL_GROUP("NAND_IO4", 0x8, 0x3, 0x06,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "emmc")),
BERLIN_PINCTRL_GROUP("NAND_IO5", 0x8, 0x3, 0x09,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "emmc")),
BERLIN_PINCTRL_GROUP("NAND_IO6", 0x8, 0x3, 0x0c,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "emmc")),
BERLIN_PINCTRL_GROUP("NAND_IO7", 0x8, 0x3, 0x0f,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "emmc")),
BERLIN_PINCTRL_GROUP("NAND_ALE", 0x8, 0x3, 0x12,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
BERLIN_PINCTRL_GROUP("NAND_CLE", 0x8, 0x3, 0x15,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
BERLIN_PINCTRL_GROUP("NAND_WEn", 0x8, 0x3, 0x18,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
BERLIN_PINCTRL_GROUP("NAND_REn", 0x8, 0x3, 0x1b,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
BERLIN_PINCTRL_GROUP("NAND_WPn", 0xc, 0x3, 0x00,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "emmc"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
BERLIN_PINCTRL_GROUP("NAND_CEn", 0xc, 0x3, 0x03,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "emmc"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
BERLIN_PINCTRL_GROUP("NAND_RDY", 0xc, 0x3, 0x06,
BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
BERLIN_PINCTRL_FUNCTION(0x1, "emmc"),
BERLIN_PINCTRL_FUNCTION(0x3, "gpio")),
BERLIN_PINCTRL_GROUP("SPI1_SS0n", 0xc, 0x3, 0x09,
BERLIN_PINCTRL_FUNCTION(0x0, "spi1"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio")),
BERLIN_PINCTRL_GROUP("SPI1_SS1n", 0xc, 0x3, 0x0c,
BERLIN_PINCTRL_FUNCTION(0x0, "spi1"),
BERLIN_PINCTRL_FUNCTION(0x2, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x3, "pwm")),
BERLIN_PINCTRL_GROUP("SPI1_SS2n", 0xc, 0x3, 0x0f,
BERLIN_PINCTRL_FUNCTION(0x0, "uart0"),
BERLIN_PINCTRL_FUNCTION(0x1, "spi1"),
BERLIN_PINCTRL_FUNCTION(0x2, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x3, "pwm")),
BERLIN_PINCTRL_GROUP("SPI1_SS3n", 0xc, 0x3, 0x12,
BERLIN_PINCTRL_FUNCTION(0x0, "uart0"),
BERLIN_PINCTRL_FUNCTION(0x1, "spi1"),
BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
BERLIN_PINCTRL_GROUP("SPI1_SCLK", 0xc, 0x3, 0x15,
BERLIN_PINCTRL_FUNCTION(0x0, "spi1"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x3, "pwm")),
BERLIN_PINCTRL_GROUP("SPI1_SDO", 0xc, 0x3, 0x18,
BERLIN_PINCTRL_FUNCTION(0x0, "spi1"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x3, "pwm")),
BERLIN_PINCTRL_GROUP("SPI1_SDI", 0xc, 0x3, 0x1b,
BERLIN_PINCTRL_FUNCTION(0x0, "spi1"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio")),
BERLIN_PINCTRL_GROUP("USB0_DRV_VBUS", 0x10, 0x3, 0x00,
BERLIN_PINCTRL_FUNCTION(0x0, "usb0"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x3, "refclko")),
BERLIN_PINCTRL_GROUP("TW1_SCL", 0x10, 0x3, 0x03,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "tw1")),
BERLIN_PINCTRL_GROUP("TW1_SDA", 0x10, 0x3, 0x06,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "tw1")),
BERLIN_PINCTRL_GROUP("TW0_SCL", 0x10, 0x3, 0x09,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "tw0")),
BERLIN_PINCTRL_GROUP("TW0_SDA", 0x10, 0x3, 0x0c,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "tw0")),
BERLIN_PINCTRL_GROUP("TMS", 0x10, 0x3, 0x0f,
BERLIN_PINCTRL_FUNCTION(0x0, "jtag"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x4, "pwm")),
BERLIN_PINCTRL_GROUP("TDI", 0x10, 0x3, 0x12,
BERLIN_PINCTRL_FUNCTION(0x0, "jtag"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x4, "pwm")),
BERLIN_PINCTRL_GROUP("TDO", 0x10, 0x3, 0x15,
BERLIN_PINCTRL_FUNCTION(0x0, "jtag"),
BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x4, "pwm")),
BERLIN_PINCTRL_GROUP("PWM6", 0x10, 0x3, 0x18,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "pwm")),
BERLIN_PINCTRL_GROUP("PWM7", 0x10, 0x3, 0x1b,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "pwm")),
BERLIN_PINCTRL_GROUP("PWM0", 0x14, 0x3, 0x00,
BERLIN_PINCTRL_FUNCTION(0x0, "por"),
BERLIN_PINCTRL_FUNCTION(0x1, "pwm"),
BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
BERLIN_PINCTRL_GROUP("PWM1", 0x14, 0x3, 0x03,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "pwm")),
BERLIN_PINCTRL_GROUP("PWM2", 0x14, 0x3, 0x06,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "pwm")),
BERLIN_PINCTRL_GROUP("PWM3", 0x14, 0x3, 0x09,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "pwm")),
BERLIN_PINCTRL_GROUP("PWM4", 0x14, 0x3, 0x0c,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "pwm")),
BERLIN_PINCTRL_GROUP("PWM5", 0x14, 0x3, 0x0f,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "pwm")),
BERLIN_PINCTRL_GROUP("URT1_RTSn", 0x14, 0x3, 0x12,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "uart1"),
BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
BERLIN_PINCTRL_FUNCTION(0x3, "tw1a"),
BERLIN_PINCTRL_FUNCTION(0x4, "aio"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("URT1_CTSn", 0x14, 0x3, 0x15,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "uart1"),
BERLIN_PINCTRL_FUNCTION(0x2, "pwm"),
BERLIN_PINCTRL_FUNCTION(0x3, "tw1a"),
BERLIN_PINCTRL_FUNCTION(0x4, "aio"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("URT1_RXD", 0x14, 0x3, 0x18,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "uart1"),
BERLIN_PINCTRL_FUNCTION(0x4, "aio"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("URT1_TXD", 0x14, 0x3, 0x1b,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "uart1"),
BERLIN_PINCTRL_FUNCTION(0x4, "aio"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("I2S3_DI", 0x18, 0x3, 0x00,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s3"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("I2S3_DO", 0x18, 0x3, 0x03,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s3"),
BERLIN_PINCTRL_FUNCTION(0x5, "phy")),
BERLIN_PINCTRL_GROUP("I2S3_BCLKIO", 0x18, 0x3, 0x06,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s3"),
BERLIN_PINCTRL_FUNCTION(0x5, "clk")),
BERLIN_PINCTRL_GROUP("I2S3_LRCKIO", 0x18, 0x3, 0x09,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "i2s3")),
BERLIN_PINCTRL_GROUP("SD0_DAT0", 0x18, 0x3, 0x0c,
BERLIN_PINCTRL_FUNCTION(0x0, "cpupll"),
BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
BERLIN_PINCTRL_GROUP("SD0_DAT1", 0x18, 0x3, 0x0f,
BERLIN_PINCTRL_FUNCTION(0x0, "syspll"),
BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
BERLIN_PINCTRL_GROUP("SD0_CLK", 0x18, 0x3, 0x12,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "sd0")),
BERLIN_PINCTRL_GROUP("SD0_DAT2", 0x18, 0x3, 0x15,
BERLIN_PINCTRL_FUNCTION(0x0, "mempll"),
BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
BERLIN_PINCTRL_GROUP("SD0_DAT3", 0x18, 0x3, 0x18,
BERLIN_PINCTRL_FUNCTION(0x0, "apll0"),
BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
BERLIN_PINCTRL_GROUP("SD0_CMD", 0x18, 0x3, 0x1b,
BERLIN_PINCTRL_FUNCTION(0x0, "apll1"),
BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
BERLIN_PINCTRL_GROUP("SD0_CDn", 0x1c, 0x3, 0x00,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
BERLIN_PINCTRL_FUNCTION(0x3, "pwm")),
BERLIN_PINCTRL_GROUP("SD0_WP", 0x1c, 0x3, 0x03,
BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
BERLIN_PINCTRL_FUNCTION(0x3, "pwm")),
};
static const struct berlin_pinctrl_desc as370_soc_pinctrl_data = {
.groups = as370_soc_pinctrl_groups,
.ngroups = ARRAY_SIZE(as370_soc_pinctrl_groups),
};
static const struct of_device_id as370_pinctrl_match[] = {
{
.compatible = "syna,as370-soc-pinctrl",
.data = &as370_soc_pinctrl_data,
},
{}
};
static int as370_pinctrl_probe(struct platform_device *pdev)
{
const struct of_device_id *match =
of_match_device(as370_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 as370_pinctrl_driver = {
.probe = as370_pinctrl_probe,
.driver = {
.name = "as370-pinctrl",
.of_match_table = as370_pinctrl_match,
},
};
builtin_platform_driver