18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Marvell berlin4ct pinctrl driver
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2015 Marvell Technology Group Ltd.
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Author: Jisheng Zhang <jszhang@marvell.com>
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#include <linux/init.h>
118c2ecf20Sopenharmony_ci#include <linux/of_device.h>
128c2ecf20Sopenharmony_ci#include <linux/platform_device.h>
138c2ecf20Sopenharmony_ci#include <linux/regmap.h>
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#include "berlin.h"
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_cistatic const struct berlin_desc_group berlin4ct_soc_pinctrl_groups[] = {
188c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("EMMC_RSTn", 0x0, 0x3, 0x00,
198c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "emmc"), /* RSTn */
208c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio")), /* GPIO47 */
218c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_IO0", 0x0, 0x3, 0x03,
228c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO0 */
238c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* RXD0 */
248c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sd1"), /* CLK */
258c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO0 */
268c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_IO1", 0x0, 0x3, 0x06,
278c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO1 */
288c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* RXD1 */
298c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sd1"), /* CDn */
308c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO1 */
318c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_IO2", 0x0, 0x3, 0x09,
328c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO2 */
338c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* RXD2 */
348c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sd1"), /* DAT0 */
358c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO2 */
368c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_IO3", 0x0, 0x3, 0x0c,
378c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO3 */
388c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* RXD3 */
398c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sd1"), /* DAT1 */
408c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO3 */
418c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_IO4", 0x0, 0x3, 0x0f,
428c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO4 */
438c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* RXC */
448c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sd1"), /* DAT2 */
458c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO4 */
468c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_IO5", 0x0, 0x3, 0x12,
478c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO5 */
488c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* RXCTL */
498c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sd1"), /* DAT3 */
508c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO5 */
518c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_IO6", 0x0, 0x3, 0x15,
528c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO6 */
538c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* MDC */
548c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sd1"), /* CMD */
558c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO6 */
568c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_IO7", 0x0, 0x3, 0x18,
578c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO7 */
588c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* MDIO */
598c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sd1"), /* WP */
608c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO7 */
618c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_ALE", 0x0, 0x3, 0x1b,
628c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* ALE */
638c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* TXD0 */
648c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO8 */
658c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_CLE", 0x4, 0x3, 0x00,
668c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* CLE */
678c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* TXD1 */
688c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO9 */
698c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_WEn", 0x4, 0x3, 0x03,
708c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* WEn */
718c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* TXD2 */
728c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO10 */
738c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_REn", 0x4, 0x3, 0x06,
748c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* REn */
758c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* TXD3 */
768c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO11 */
778c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_WPn", 0x4, 0x3, 0x09,
788c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* WPn */
798c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO12 */
808c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_CEn", 0x4, 0x3, 0x0c,
818c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* CEn */
828c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* TXC */
838c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO13 */
848c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_RDY", 0x4, 0x3, 0x0f,
858c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* RDY */
868c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* TXCTL */
878c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO14 */
888c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SD0_CLK", 0x4, 0x3, 0x12,
898c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO29 */
908c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sd0"), /* CLK*/
918c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts4"), /* CLK */
928c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG8 */
938c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG8 */
948c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SD0_DAT0", 0x4, 0x3, 0x15,
958c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO30 */
968c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sd0"), /* DAT0 */
978c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts4"), /* SOP */
988c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG9 */
998c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG9 */
1008c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SD0_DAT1", 0x4, 0x3, 0x18,
1018c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO31 */
1028c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sd0"), /* DAT1 */
1038c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts4"), /* SD */
1048c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG10 */
1058c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG10 */
1068c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SD0_DAT2", 0x4, 0x3, 0x1b,
1078c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO32 */
1088c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sd0"), /* DAT2 */
1098c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts4"), /* VALD */
1108c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG11 */
1118c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG11 */
1128c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SD0_DAT3", 0x8, 0x3, 0x00,
1138c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO33 */
1148c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sd0"), /* DAT3 */
1158c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts5"), /* CLK */
1168c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG12 */
1178c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG12 */
1188c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SD0_CDn", 0x8, 0x3, 0x03,
1198c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO34 */
1208c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sd0"), /* CDn */
1218c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts5"), /* SOP */
1228c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG13 */
1238c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG13 */
1248c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SD0_CMD", 0x8, 0x3, 0x06,
1258c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO35 */
1268c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sd0"), /* CMD */
1278c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts5"), /* SD */
1288c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG14 */
1298c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG14 */
1308c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SD0_WP", 0x8, 0x3, 0x09,
1318c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO36 */
1328c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sd0"), /* WP */
1338c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts5"), /* VALD */
1348c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG15 */
1358c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG15 */
1368c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("STS0_CLK", 0x8, 0x3, 0x0c,
1378c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO21 */
1388c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sts0"), /* CLK */
1398c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "cpupll"), /* CLKO */
1408c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG0 */
1418c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG0 */
1428c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("STS0_SOP", 0x8, 0x3, 0x0f,
1438c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO22 */
1448c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sts0"), /* SOP */
1458c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "syspll"), /* CLKO */
1468c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG1 */
1478c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG1 */
1488c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("STS0_SD", 0x8, 0x3, 0x12,
1498c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO23 */
1508c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sts0"), /* SD */
1518c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "mempll"), /* CLKO */
1528c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG2 */
1538c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG2 */
1548c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("STS0_VALD", 0x8, 0x3, 0x15,
1558c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO24 */
1568c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sts0"), /* VALD */
1578c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG3 */
1588c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG3 */
1598c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("STS1_CLK", 0x8, 0x3, 0x18,
1608c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO25 */
1618c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sts1"), /* CLK */
1628c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "pwm0"),
1638c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG4 */
1648c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG4 */
1658c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("STS1_SOP", 0x8, 0x3, 0x1b,
1668c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO26 */
1678c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sts1"), /* SOP */
1688c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "pwm1"),
1698c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG5 */
1708c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG5 */
1718c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("STS1_SD", 0xc, 0x3, 0x00,
1728c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO27 */
1738c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sts1"), /* SD */
1748c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "pwm2"),
1758c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG6 */
1768c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG6 */
1778c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("STS1_VALD", 0xc, 0x3, 0x03,
1788c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO28 */
1798c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sts1"), /* VALD */
1808c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "pwm3"),
1818c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG7 */
1828c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG7 */
1838c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SCRD0_RST", 0xc, 0x3, 0x06,
1848c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO15 */
1858c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "scrd0"), /* RST */
1868c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sd1a")), /* CLK */
1878c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SCRD0_DCLK", 0xc, 0x3, 0x09,
1888c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO16 */
1898c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "scrd0"), /* DCLK */
1908c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sd1a")), /* CMD */
1918c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SCRD0_GPIO0", 0xc, 0x3, 0x0c,
1928c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO17 */
1938c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "scrd0"), /* SCRD0 GPIO0 */
1948c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sif"), /* DIO */
1958c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sd1a")), /* DAT0 */
1968c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SCRD0_GPIO1", 0xc, 0x3, 0x0f,
1978c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO18 */
1988c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "scrd0"), /* SCRD0 GPIO1 */
1998c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sif"), /* CLK */
2008c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sd1a")), /* DAT1 */
2018c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SCRD0_DIO", 0xc, 0x3, 0x12,
2028c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO19 */
2038c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "scrd0"), /* DIO */
2048c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sif"), /* DEN */
2058c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sd1a")), /* DAT2 */
2068c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SCRD0_CRD_PRES", 0xc, 0x3, 0x15,
2078c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO20 */
2088c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "scrd0"), /* crd pres */
2098c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sd1a")), /* DAT3 */
2108c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SPI1_SS0n", 0xc, 0x3, 0x18,
2118c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SS0n */
2128c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* GPIO37 */
2138c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts2")), /* CLK */
2148c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SPI1_SS1n", 0xc, 0x3, 0x1b,
2158c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SS1n */
2168c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* GPIO38 */
2178c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts2"), /* SOP */
2188c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "pwm1")),
2198c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SPI1_SS2n", 0x10, 0x3, 0x00,
2208c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SS2n */
2218c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* GPIO39 */
2228c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts2"), /* SD */
2238c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "pwm0")),
2248c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SPI1_SS3n", 0x10, 0x3, 0x03,
2258c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SS3n */
2268c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* GPIO40 */
2278c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts2")), /* VALD */
2288c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SPI1_SCLK", 0x10, 0x3, 0x06,
2298c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SCLK */
2308c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* GPIO41 */
2318c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts3")), /* CLK */
2328c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SPI1_SDO", 0x10, 0x3, 0x09,
2338c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SDO */
2348c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* GPIO42 */
2358c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts3")), /* SOP */
2368c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SPI1_SDI", 0x10, 0x3, 0x0c,
2378c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SDI */
2388c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* GPIO43 */
2398c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts3")), /* SD */
2408c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("USB0_DRV_VBUS", 0x10, 0x3, 0x0f,
2418c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO44 */
2428c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "usb0"), /* VBUS */
2438c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts3")), /* VALD */
2448c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("TW0_SCL", 0x10, 0x3, 0x12,
2458c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO45 */
2468c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "tw0")), /* SCL */
2478c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("TW0_SDA", 0x10, 0x3, 0x15,
2488c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO46 */
2498c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "tw0")), /* SDA */
2508c2ecf20Sopenharmony_ci};
2518c2ecf20Sopenharmony_ci
2528c2ecf20Sopenharmony_cistatic const struct berlin_desc_group berlin4ct_avio_pinctrl_groups[] = {
2538c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("TX_EDDC_SCL", 0x0, 0x3, 0x00,
2548c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO0 */
2558c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "tx_eddc"), /* SCL */
2568c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "tw1")), /* SCL */
2578c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("TX_EDDC_SDA", 0x0, 0x3, 0x03,
2588c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO1 */
2598c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "tx_eddc"), /* SDA */
2608c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "tw1")), /* SDA */
2618c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("I2S1_LRCKO", 0x0, 0x3, 0x06,
2628c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO2 */
2638c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"), /* LRCKO */
2648c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sts6"), /* CLK */
2658c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "adac"), /* DBG0 */
2668c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x6, "sd1b"), /* CLK */
2678c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "avio")), /* DBG0 */
2688c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("I2S1_BCLKO", 0x0, 0x3, 0x09,
2698c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO3 */
2708c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"), /* BCLKO */
2718c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sts6"), /* SOP */
2728c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "adac"), /* DBG1 */
2738c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x6, "sd1b"), /* CMD */
2748c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "avio")), /* DBG1 */
2758c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("I2S1_DO", 0x0, 0x3, 0x0c,
2768c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO4 */
2778c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"), /* DO */
2788c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sts6"), /* SD */
2798c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "adac"), /* DBG2 */
2808c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x6, "sd1b"), /* DAT0 */
2818c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "avio")), /* DBG2 */
2828c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("I2S1_MCLK", 0x0, 0x3, 0x0f,
2838c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO5 */
2848c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"), /* MCLK */
2858c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sts6"), /* VALD */
2868c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "adac_test"), /* MCLK */
2878c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x6, "sd1b"), /* DAT1 */
2888c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "avio")), /* DBG3 */
2898c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SPDIFO", 0x0, 0x3, 0x12,
2908c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO6 */
2918c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "spdifo"),
2928c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "avpll"), /* CLKO */
2938c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "adac")), /* DBG3 */
2948c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("I2S2_MCLK", 0x0, 0x3, 0x15,
2958c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO7 */
2968c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"), /* MCLK */
2978c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "hdmi"), /* FBCLK */
2988c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "pdm")), /* CLKO */
2998c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("I2S2_LRCKI", 0x0, 0x3, 0x18,
3008c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO8 */
3018c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"), /* LRCKI */
3028c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "pwm0"),
3038c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sts7"), /* CLK */
3048c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "adac_test"), /* LRCK */
3058c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x6, "sd1b")), /* DAT2 */
3068c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("I2S2_BCLKI", 0x0, 0x3, 0x1b,
3078c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO9 */
3088c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"), /* BCLKI */
3098c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "pwm1"),
3108c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sts7"), /* SOP */
3118c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "adac_test"), /* BCLK */
3128c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x6, "sd1b")), /* DAT3 */
3138c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("I2S2_DI0", 0x4, 0x3, 0x00,
3148c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO10 */
3158c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"), /* DI0 */
3168c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "pwm2"),
3178c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sts7"), /* SD */
3188c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "adac_test"), /* SDIN */
3198c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "pdm"), /* DI0 */
3208c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x6, "sd1b")), /* CDn */
3218c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("I2S2_DI1", 0x4, 0x3, 0x03,
3228c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO11 */
3238c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"), /* DI1 */
3248c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "pwm3"),
3258c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sts7"), /* VALD */
3268c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "adac_test"), /* PWMCLK */
3278c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "pdm"), /* DI1 */
3288c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x6, "sd1b")), /* WP */
3298c2ecf20Sopenharmony_ci};
3308c2ecf20Sopenharmony_ci
3318c2ecf20Sopenharmony_cistatic const struct berlin_desc_group berlin4ct_sysmgr_pinctrl_groups[] = {
3328c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_TW2_SCL", 0x0, 0x3, 0x00,
3338c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO19 */
3348c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "tw2")), /* SCL */
3358c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_TW2_SDA", 0x0, 0x3, 0x03,
3368c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO20 */
3378c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "tw2")), /* SDA */
3388c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_TW3_SCL", 0x0, 0x3, 0x06,
3398c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO21 */
3408c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "tw3")), /* SCL */
3418c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_TW3_SDA", 0x0, 0x3, 0x09,
3428c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO22 */
3438c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "tw3")), /* SDA */
3448c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_TMS", 0x0, 0x3, 0x0c,
3458c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "jtag"), /* TMS */
3468c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* SM GPIO0 */
3478c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "pwm0")),
3488c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_TDI", 0x0, 0x3, 0x0f,
3498c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "jtag"), /* TDI */
3508c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* SM GPIO1 */
3518c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "pwm1")),
3528c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_TDO", 0x0, 0x3, 0x12,
3538c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "jtag"), /* TDO */
3548c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio")), /* SM GPIO2 */
3558c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_URT0_TXD", 0x0, 0x3, 0x15,
3568c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "uart0"), /* TXD */
3578c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio")), /* SM GPIO3 */
3588c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_URT0_RXD", 0x0, 0x3, 0x18,
3598c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "uart0"), /* RXD */
3608c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio")), /* SM GPIO4 */
3618c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_URT1_TXD", 0x0, 0x3, 0x1b,
3628c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO5 */
3638c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "uart1"), /* TXD */
3648c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "eth1"), /* RXCLK */
3658c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "pwm2"),
3668c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "timer0"),
3678c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "clk_25m")),
3688c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_URT1_RXD", 0x4, 0x3, 0x00,
3698c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO6 */
3708c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "uart1"), /* RXD */
3718c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "pwm3"),
3728c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "timer1")),
3738c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_SPI2_SS0n", 0x4, 0x3, 0x03,
3748c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "spi2"), /* SS0 n*/
3758c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio")), /* SM GPIO7 */
3768c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_SPI2_SS1n", 0x4, 0x3, 0x06,
3778c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO8 */
3788c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "spi2")), /* SS1n */
3798c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_SPI2_SS2n", 0x4, 0x3, 0x09,
3808c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO9 */
3818c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "spi2"), /* SS2n */
3828c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "eth1"), /* MDC */
3838c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "pwm0"),
3848c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "timer0"),
3858c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "clk_25m")),
3868c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_SPI2_SS3n", 0x4, 0x3, 0x0c,
3878c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO10 */
3888c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "spi2"), /* SS3n */
3898c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "eth1"), /* MDIO */
3908c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "pwm1"),
3918c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "timer1")),
3928c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_SPI2_SDO", 0x4, 0x3, 0x0f,
3938c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "spi2"), /* SDO */
3948c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio")), /* SM GPIO11 */
3958c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_SPI2_SDI", 0x4, 0x3, 0x12,
3968c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "spi2"), /* SDI */
3978c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio")), /* SM GPIO12 */
3988c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_SPI2_SCLK", 0x4, 0x3, 0x15,
3998c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "spi2"), /* SCLK */
4008c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio")), /* SM GPIO13 */
4018c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_FE_LED0", 0x4, 0x3, 0x18,
4028c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO14 */
4038c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "led")), /* LED0 */
4048c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_FE_LED1", 0x4, 0x3, 0x1b,
4058c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "pwr"),
4068c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* SM GPIO 15 */
4078c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "led")), /* LED1 */
4088c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_FE_LED2", 0x8, 0x3, 0x00,
4098c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO16 */
4108c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "led")), /* LED2 */
4118c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_HDMI_HPD", 0x8, 0x3, 0x03,
4128c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO17 */
4138c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "hdmi")), /* HPD */
4148c2ecf20Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_HDMI_CEC", 0x8, 0x3, 0x06,
4158c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO18 */
4168c2ecf20Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "hdmi")), /* CEC */
4178c2ecf20Sopenharmony_ci};
4188c2ecf20Sopenharmony_ci
4198c2ecf20Sopenharmony_cistatic const struct berlin_pinctrl_desc berlin4ct_soc_pinctrl_data = {
4208c2ecf20Sopenharmony_ci	.groups = berlin4ct_soc_pinctrl_groups,
4218c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(berlin4ct_soc_pinctrl_groups),
4228c2ecf20Sopenharmony_ci};
4238c2ecf20Sopenharmony_ci
4248c2ecf20Sopenharmony_cistatic const struct berlin_pinctrl_desc berlin4ct_avio_pinctrl_data = {
4258c2ecf20Sopenharmony_ci	.groups = berlin4ct_avio_pinctrl_groups,
4268c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(berlin4ct_avio_pinctrl_groups),
4278c2ecf20Sopenharmony_ci};
4288c2ecf20Sopenharmony_ci
4298c2ecf20Sopenharmony_cistatic const struct berlin_pinctrl_desc berlin4ct_sysmgr_pinctrl_data = {
4308c2ecf20Sopenharmony_ci	.groups = berlin4ct_sysmgr_pinctrl_groups,
4318c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(berlin4ct_sysmgr_pinctrl_groups),
4328c2ecf20Sopenharmony_ci};
4338c2ecf20Sopenharmony_ci
4348c2ecf20Sopenharmony_cistatic const struct of_device_id berlin4ct_pinctrl_match[] = {
4358c2ecf20Sopenharmony_ci	{
4368c2ecf20Sopenharmony_ci		.compatible = "marvell,berlin4ct-soc-pinctrl",
4378c2ecf20Sopenharmony_ci		.data = &berlin4ct_soc_pinctrl_data,
4388c2ecf20Sopenharmony_ci	},
4398c2ecf20Sopenharmony_ci	{
4408c2ecf20Sopenharmony_ci		.compatible = "marvell,berlin4ct-avio-pinctrl",
4418c2ecf20Sopenharmony_ci		.data = &berlin4ct_avio_pinctrl_data,
4428c2ecf20Sopenharmony_ci	},
4438c2ecf20Sopenharmony_ci	{
4448c2ecf20Sopenharmony_ci		.compatible = "marvell,berlin4ct-system-pinctrl",
4458c2ecf20Sopenharmony_ci		.data = &berlin4ct_sysmgr_pinctrl_data,
4468c2ecf20Sopenharmony_ci	},
4478c2ecf20Sopenharmony_ci	{}
4488c2ecf20Sopenharmony_ci};
4498c2ecf20Sopenharmony_ci
4508c2ecf20Sopenharmony_cistatic int berlin4ct_pinctrl_probe(struct platform_device *pdev)
4518c2ecf20Sopenharmony_ci{
4528c2ecf20Sopenharmony_ci	const struct of_device_id *match =
4538c2ecf20Sopenharmony_ci		of_match_device(berlin4ct_pinctrl_match, &pdev->dev);
4548c2ecf20Sopenharmony_ci	struct regmap_config *rmconfig;
4558c2ecf20Sopenharmony_ci	struct regmap *regmap;
4568c2ecf20Sopenharmony_ci	struct resource *res;
4578c2ecf20Sopenharmony_ci	void __iomem *base;
4588c2ecf20Sopenharmony_ci
4598c2ecf20Sopenharmony_ci	rmconfig = devm_kzalloc(&pdev->dev, sizeof(*rmconfig), GFP_KERNEL);
4608c2ecf20Sopenharmony_ci	if (!rmconfig)
4618c2ecf20Sopenharmony_ci		return -ENOMEM;
4628c2ecf20Sopenharmony_ci
4638c2ecf20Sopenharmony_ci	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
4648c2ecf20Sopenharmony_ci	base = devm_ioremap_resource(&pdev->dev, res);
4658c2ecf20Sopenharmony_ci	if (IS_ERR(base))
4668c2ecf20Sopenharmony_ci		return PTR_ERR(base);
4678c2ecf20Sopenharmony_ci
4688c2ecf20Sopenharmony_ci	rmconfig->reg_bits = 32,
4698c2ecf20Sopenharmony_ci	rmconfig->val_bits = 32,
4708c2ecf20Sopenharmony_ci	rmconfig->reg_stride = 4,
4718c2ecf20Sopenharmony_ci	rmconfig->max_register = resource_size(res);
4728c2ecf20Sopenharmony_ci
4738c2ecf20Sopenharmony_ci	regmap = devm_regmap_init_mmio(&pdev->dev, base, rmconfig);
4748c2ecf20Sopenharmony_ci	if (IS_ERR(regmap))
4758c2ecf20Sopenharmony_ci		return PTR_ERR(regmap);
4768c2ecf20Sopenharmony_ci
4778c2ecf20Sopenharmony_ci	return berlin_pinctrl_probe_regmap(pdev, match->data, regmap);
4788c2ecf20Sopenharmony_ci}
4798c2ecf20Sopenharmony_ci
4808c2ecf20Sopenharmony_cistatic struct platform_driver berlin4ct_pinctrl_driver = {
4818c2ecf20Sopenharmony_ci	.probe	= berlin4ct_pinctrl_probe,
4828c2ecf20Sopenharmony_ci	.driver	= {
4838c2ecf20Sopenharmony_ci		.name = "berlin4ct-pinctrl",
4848c2ecf20Sopenharmony_ci		.of_match_table = berlin4ct_pinctrl_match,
4858c2ecf20Sopenharmony_ci	},
4868c2ecf20Sopenharmony_ci};
4878c2ecf20Sopenharmony_cibuiltin_platform_driver(berlin4ct_pinctrl_driver);
488