162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Marvell berlin4ct pinctrl driver
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Copyright (C) 2015 Marvell Technology Group Ltd.
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci * Author: Jisheng Zhang <jszhang@marvell.com>
862306a36Sopenharmony_ci */
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci#include <linux/init.h>
1162306a36Sopenharmony_ci#include <linux/of_device.h>
1262306a36Sopenharmony_ci#include <linux/platform_device.h>
1362306a36Sopenharmony_ci#include <linux/regmap.h>
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci#include "berlin.h"
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_cistatic const struct berlin_desc_group berlin4ct_soc_pinctrl_groups[] = {
1862306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("EMMC_RSTn", 0x0, 0x3, 0x00,
1962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "emmc"), /* RSTn */
2062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio")), /* GPIO47 */
2162306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_IO0", 0x0, 0x3, 0x03,
2262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO0 */
2362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* RXD0 */
2462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sd1"), /* CLK */
2562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO0 */
2662306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_IO1", 0x0, 0x3, 0x06,
2762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO1 */
2862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* RXD1 */
2962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sd1"), /* CDn */
3062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO1 */
3162306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_IO2", 0x0, 0x3, 0x09,
3262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO2 */
3362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* RXD2 */
3462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sd1"), /* DAT0 */
3562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO2 */
3662306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_IO3", 0x0, 0x3, 0x0c,
3762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO3 */
3862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* RXD3 */
3962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sd1"), /* DAT1 */
4062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO3 */
4162306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_IO4", 0x0, 0x3, 0x0f,
4262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO4 */
4362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* RXC */
4462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sd1"), /* DAT2 */
4562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO4 */
4662306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_IO5", 0x0, 0x3, 0x12,
4762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO5 */
4862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* RXCTL */
4962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sd1"), /* DAT3 */
5062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO5 */
5162306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_IO6", 0x0, 0x3, 0x15,
5262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO6 */
5362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* MDC */
5462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sd1"), /* CMD */
5562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO6 */
5662306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_IO7", 0x0, 0x3, 0x18,
5762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO7 */
5862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* MDIO */
5962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sd1"), /* WP */
6062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO7 */
6162306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_ALE", 0x0, 0x3, 0x1b,
6262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* ALE */
6362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* TXD0 */
6462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO8 */
6562306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_CLE", 0x4, 0x3, 0x00,
6662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* CLE */
6762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* TXD1 */
6862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO9 */
6962306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_WEn", 0x4, 0x3, 0x03,
7062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* WEn */
7162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* TXD2 */
7262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO10 */
7362306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_REn", 0x4, 0x3, 0x06,
7462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* REn */
7562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* TXD3 */
7662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO11 */
7762306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_WPn", 0x4, 0x3, 0x09,
7862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* WPn */
7962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO12 */
8062306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_CEn", 0x4, 0x3, 0x0c,
8162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* CEn */
8262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* TXC */
8362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO13 */
8462306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("NAND_RDY", 0x4, 0x3, 0x0f,
8562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* RDY */
8662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii"), /* TXCTL */
8762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO14 */
8862306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SD0_CLK", 0x4, 0x3, 0x12,
8962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO29 */
9062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sd0"), /* CLK*/
9162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts4"), /* CLK */
9262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG8 */
9362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG8 */
9462306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SD0_DAT0", 0x4, 0x3, 0x15,
9562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO30 */
9662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sd0"), /* DAT0 */
9762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts4"), /* SOP */
9862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG9 */
9962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG9 */
10062306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SD0_DAT1", 0x4, 0x3, 0x18,
10162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO31 */
10262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sd0"), /* DAT1 */
10362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts4"), /* SD */
10462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG10 */
10562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG10 */
10662306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SD0_DAT2", 0x4, 0x3, 0x1b,
10762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO32 */
10862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sd0"), /* DAT2 */
10962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts4"), /* VALD */
11062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG11 */
11162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG11 */
11262306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SD0_DAT3", 0x8, 0x3, 0x00,
11362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO33 */
11462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sd0"), /* DAT3 */
11562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts5"), /* CLK */
11662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG12 */
11762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG12 */
11862306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SD0_CDn", 0x8, 0x3, 0x03,
11962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO34 */
12062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sd0"), /* CDn */
12162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts5"), /* SOP */
12262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG13 */
12362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG13 */
12462306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SD0_CMD", 0x8, 0x3, 0x06,
12562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO35 */
12662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sd0"), /* CMD */
12762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts5"), /* SD */
12862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG14 */
12962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG14 */
13062306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SD0_WP", 0x8, 0x3, 0x09,
13162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO36 */
13262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sd0"), /* WP */
13362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts5"), /* VALD */
13462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG15 */
13562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG15 */
13662306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("STS0_CLK", 0x8, 0x3, 0x0c,
13762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO21 */
13862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sts0"), /* CLK */
13962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "cpupll"), /* CLKO */
14062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG0 */
14162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG0 */
14262306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("STS0_SOP", 0x8, 0x3, 0x0f,
14362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO22 */
14462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sts0"), /* SOP */
14562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "syspll"), /* CLKO */
14662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG1 */
14762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG1 */
14862306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("STS0_SD", 0x8, 0x3, 0x12,
14962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO23 */
15062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sts0"), /* SD */
15162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "mempll"), /* CLKO */
15262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG2 */
15362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG2 */
15462306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("STS0_VALD", 0x8, 0x3, 0x15,
15562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO24 */
15662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sts0"), /* VALD */
15762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG3 */
15862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG3 */
15962306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("STS1_CLK", 0x8, 0x3, 0x18,
16062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO25 */
16162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sts1"), /* CLK */
16262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "pwm0"),
16362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG4 */
16462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG4 */
16562306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("STS1_SOP", 0x8, 0x3, 0x1b,
16662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO26 */
16762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sts1"), /* SOP */
16862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "pwm1"),
16962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG5 */
17062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG5 */
17162306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("STS1_SD", 0xc, 0x3, 0x00,
17262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO27 */
17362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sts1"), /* SD */
17462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "pwm2"),
17562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG6 */
17662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG6 */
17762306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("STS1_VALD", 0xc, 0x3, 0x03,
17862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO28 */
17962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "sts1"), /* VALD */
18062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "pwm3"),
18162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "v4g"), /* DBG7 */
18262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "phy")), /* DBG7 */
18362306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SCRD0_RST", 0xc, 0x3, 0x06,
18462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO15 */
18562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "scrd0"), /* RST */
18662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sd1a")), /* CLK */
18762306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SCRD0_DCLK", 0xc, 0x3, 0x09,
18862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO16 */
18962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "scrd0"), /* DCLK */
19062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sd1a")), /* CMD */
19162306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SCRD0_GPIO0", 0xc, 0x3, 0x0c,
19262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO17 */
19362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "scrd0"), /* SCRD0 GPIO0 */
19462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sif"), /* DIO */
19562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sd1a")), /* DAT0 */
19662306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SCRD0_GPIO1", 0xc, 0x3, 0x0f,
19762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO18 */
19862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "scrd0"), /* SCRD0 GPIO1 */
19962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sif"), /* CLK */
20062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sd1a")), /* DAT1 */
20162306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SCRD0_DIO", 0xc, 0x3, 0x12,
20262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO19 */
20362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "scrd0"), /* DIO */
20462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sif"), /* DEN */
20562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sd1a")), /* DAT2 */
20662306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SCRD0_CRD_PRES", 0xc, 0x3, 0x15,
20762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO20 */
20862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "scrd0"), /* crd pres */
20962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sd1a")), /* DAT3 */
21062306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SPI1_SS0n", 0xc, 0x3, 0x18,
21162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SS0n */
21262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* GPIO37 */
21362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts2")), /* CLK */
21462306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SPI1_SS1n", 0xc, 0x3, 0x1b,
21562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SS1n */
21662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* GPIO38 */
21762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts2"), /* SOP */
21862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "pwm1")),
21962306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SPI1_SS2n", 0x10, 0x3, 0x00,
22062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SS2n */
22162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* GPIO39 */
22262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts2"), /* SD */
22362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "pwm0")),
22462306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SPI1_SS3n", 0x10, 0x3, 0x03,
22562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SS3n */
22662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* GPIO40 */
22762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts2")), /* VALD */
22862306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SPI1_SCLK", 0x10, 0x3, 0x06,
22962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SCLK */
23062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* GPIO41 */
23162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts3")), /* CLK */
23262306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SPI1_SDO", 0x10, 0x3, 0x09,
23362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SDO */
23462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* GPIO42 */
23562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts3")), /* SOP */
23662306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SPI1_SDI", 0x10, 0x3, 0x0c,
23762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SDI */
23862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* GPIO43 */
23962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts3")), /* SD */
24062306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("USB0_DRV_VBUS", 0x10, 0x3, 0x0f,
24162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO44 */
24262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "usb0"), /* VBUS */
24362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "sts3")), /* VALD */
24462306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("TW0_SCL", 0x10, 0x3, 0x12,
24562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO45 */
24662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "tw0")), /* SCL */
24762306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("TW0_SDA", 0x10, 0x3, 0x15,
24862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO46 */
24962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "tw0")), /* SDA */
25062306a36Sopenharmony_ci};
25162306a36Sopenharmony_ci
25262306a36Sopenharmony_cistatic const struct berlin_desc_group berlin4ct_avio_pinctrl_groups[] = {
25362306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("TX_EDDC_SCL", 0x0, 0x3, 0x00,
25462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO0 */
25562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "tx_eddc"), /* SCL */
25662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "tw1")), /* SCL */
25762306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("TX_EDDC_SDA", 0x0, 0x3, 0x03,
25862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO1 */
25962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "tx_eddc"), /* SDA */
26062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "tw1")), /* SDA */
26162306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("I2S1_LRCKO", 0x0, 0x3, 0x06,
26262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO2 */
26362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"), /* LRCKO */
26462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sts6"), /* CLK */
26562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "adac"), /* DBG0 */
26662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x6, "sd1b"), /* CLK */
26762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "avio")), /* DBG0 */
26862306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("I2S1_BCLKO", 0x0, 0x3, 0x09,
26962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO3 */
27062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"), /* BCLKO */
27162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sts6"), /* SOP */
27262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "adac"), /* DBG1 */
27362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x6, "sd1b"), /* CMD */
27462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "avio")), /* DBG1 */
27562306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("I2S1_DO", 0x0, 0x3, 0x0c,
27662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO4 */
27762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"), /* DO */
27862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sts6"), /* SD */
27962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "adac"), /* DBG2 */
28062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x6, "sd1b"), /* DAT0 */
28162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "avio")), /* DBG2 */
28262306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("I2S1_MCLK", 0x0, 0x3, 0x0f,
28362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO5 */
28462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"), /* MCLK */
28562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sts6"), /* VALD */
28662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "adac_test"), /* MCLK */
28762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x6, "sd1b"), /* DAT1 */
28862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x7, "avio")), /* DBG3 */
28962306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SPDIFO", 0x0, 0x3, 0x12,
29062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO6 */
29162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "spdifo"),
29262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "avpll"), /* CLKO */
29362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "adac")), /* DBG3 */
29462306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("I2S2_MCLK", 0x0, 0x3, 0x15,
29562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO7 */
29662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"), /* MCLK */
29762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "hdmi"), /* FBCLK */
29862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "pdm")), /* CLKO */
29962306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("I2S2_LRCKI", 0x0, 0x3, 0x18,
30062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO8 */
30162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"), /* LRCKI */
30262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "pwm0"),
30362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sts7"), /* CLK */
30462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "adac_test"), /* LRCK */
30562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x6, "sd1b")), /* DAT2 */
30662306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("I2S2_BCLKI", 0x0, 0x3, 0x1b,
30762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO9 */
30862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"), /* BCLKI */
30962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "pwm1"),
31062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sts7"), /* SOP */
31162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "adac_test"), /* BCLK */
31262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x6, "sd1b")), /* DAT3 */
31362306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("I2S2_DI0", 0x4, 0x3, 0x00,
31462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO10 */
31562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"), /* DI0 */
31662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "pwm2"),
31762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sts7"), /* SD */
31862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "adac_test"), /* SDIN */
31962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "pdm"), /* DI0 */
32062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x6, "sd1b")), /* CDn */
32162306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("I2S2_DI1", 0x4, 0x3, 0x03,
32262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* AVIO GPIO11 */
32362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"), /* DI1 */
32462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "pwm3"),
32562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "sts7"), /* VALD */
32662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "adac_test"), /* PWMCLK */
32762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "pdm"), /* DI1 */
32862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x6, "sd1b")), /* WP */
32962306a36Sopenharmony_ci};
33062306a36Sopenharmony_ci
33162306a36Sopenharmony_cistatic const struct berlin_desc_group berlin4ct_sysmgr_pinctrl_groups[] = {
33262306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_TW2_SCL", 0x0, 0x3, 0x00,
33362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO19 */
33462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "tw2")), /* SCL */
33562306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_TW2_SDA", 0x0, 0x3, 0x03,
33662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO20 */
33762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "tw2")), /* SDA */
33862306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_TW3_SCL", 0x0, 0x3, 0x06,
33962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO21 */
34062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "tw3")), /* SCL */
34162306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_TW3_SDA", 0x0, 0x3, 0x09,
34262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO22 */
34362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "tw3")), /* SDA */
34462306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_TMS", 0x0, 0x3, 0x0c,
34562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "jtag"), /* TMS */
34662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* SM GPIO0 */
34762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "pwm0")),
34862306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_TDI", 0x0, 0x3, 0x0f,
34962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "jtag"), /* TDI */
35062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* SM GPIO1 */
35162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "pwm1")),
35262306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_TDO", 0x0, 0x3, 0x12,
35362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "jtag"), /* TDO */
35462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio")), /* SM GPIO2 */
35562306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_URT0_TXD", 0x0, 0x3, 0x15,
35662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "uart0"), /* TXD */
35762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio")), /* SM GPIO3 */
35862306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_URT0_RXD", 0x0, 0x3, 0x18,
35962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "uart0"), /* RXD */
36062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio")), /* SM GPIO4 */
36162306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_URT1_TXD", 0x0, 0x3, 0x1b,
36262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO5 */
36362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "uart1"), /* TXD */
36462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "eth1"), /* RXCLK */
36562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "pwm2"),
36662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "timer0"),
36762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "clk_25m")),
36862306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_URT1_RXD", 0x4, 0x3, 0x00,
36962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO6 */
37062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "uart1"), /* RXD */
37162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "pwm3"),
37262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "timer1")),
37362306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_SPI2_SS0n", 0x4, 0x3, 0x03,
37462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "spi2"), /* SS0 n*/
37562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio")), /* SM GPIO7 */
37662306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_SPI2_SS1n", 0x4, 0x3, 0x06,
37762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO8 */
37862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "spi2")), /* SS1n */
37962306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_SPI2_SS2n", 0x4, 0x3, 0x09,
38062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO9 */
38162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "spi2"), /* SS2n */
38262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "eth1"), /* MDC */
38362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "pwm0"),
38462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "timer0"),
38562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x5, "clk_25m")),
38662306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_SPI2_SS3n", 0x4, 0x3, 0x0c,
38762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO10 */
38862306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "spi2"), /* SS3n */
38962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "eth1"), /* MDIO */
39062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x3, "pwm1"),
39162306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x4, "timer1")),
39262306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_SPI2_SDO", 0x4, 0x3, 0x0f,
39362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "spi2"), /* SDO */
39462306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio")), /* SM GPIO11 */
39562306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_SPI2_SDI", 0x4, 0x3, 0x12,
39662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "spi2"), /* SDI */
39762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio")), /* SM GPIO12 */
39862306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_SPI2_SCLK", 0x4, 0x3, 0x15,
39962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "spi2"), /* SCLK */
40062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio")), /* SM GPIO13 */
40162306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_FE_LED0", 0x4, 0x3, 0x18,
40262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO14 */
40362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "led")), /* LED0 */
40462306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_FE_LED1", 0x4, 0x3, 0x1b,
40562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "pwr"),
40662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* SM GPIO 15 */
40762306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "led")), /* LED1 */
40862306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_FE_LED2", 0x8, 0x3, 0x00,
40962306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO16 */
41062306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x2, "led")), /* LED2 */
41162306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_HDMI_HPD", 0x8, 0x3, 0x03,
41262306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO17 */
41362306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "hdmi")), /* HPD */
41462306a36Sopenharmony_ci	BERLIN_PINCTRL_GROUP("SM_HDMI_CEC", 0x8, 0x3, 0x06,
41562306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO18 */
41662306a36Sopenharmony_ci			BERLIN_PINCTRL_FUNCTION(0x1, "hdmi")), /* CEC */
41762306a36Sopenharmony_ci};
41862306a36Sopenharmony_ci
41962306a36Sopenharmony_cistatic const struct berlin_pinctrl_desc berlin4ct_soc_pinctrl_data = {
42062306a36Sopenharmony_ci	.groups = berlin4ct_soc_pinctrl_groups,
42162306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(berlin4ct_soc_pinctrl_groups),
42262306a36Sopenharmony_ci};
42362306a36Sopenharmony_ci
42462306a36Sopenharmony_cistatic const struct berlin_pinctrl_desc berlin4ct_avio_pinctrl_data = {
42562306a36Sopenharmony_ci	.groups = berlin4ct_avio_pinctrl_groups,
42662306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(berlin4ct_avio_pinctrl_groups),
42762306a36Sopenharmony_ci};
42862306a36Sopenharmony_ci
42962306a36Sopenharmony_cistatic const struct berlin_pinctrl_desc berlin4ct_sysmgr_pinctrl_data = {
43062306a36Sopenharmony_ci	.groups = berlin4ct_sysmgr_pinctrl_groups,
43162306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(berlin4ct_sysmgr_pinctrl_groups),
43262306a36Sopenharmony_ci};
43362306a36Sopenharmony_ci
43462306a36Sopenharmony_cistatic const struct of_device_id berlin4ct_pinctrl_match[] = {
43562306a36Sopenharmony_ci	{
43662306a36Sopenharmony_ci		.compatible = "marvell,berlin4ct-soc-pinctrl",
43762306a36Sopenharmony_ci		.data = &berlin4ct_soc_pinctrl_data,
43862306a36Sopenharmony_ci	},
43962306a36Sopenharmony_ci	{
44062306a36Sopenharmony_ci		.compatible = "marvell,berlin4ct-avio-pinctrl",
44162306a36Sopenharmony_ci		.data = &berlin4ct_avio_pinctrl_data,
44262306a36Sopenharmony_ci	},
44362306a36Sopenharmony_ci	{
44462306a36Sopenharmony_ci		.compatible = "marvell,berlin4ct-system-pinctrl",
44562306a36Sopenharmony_ci		.data = &berlin4ct_sysmgr_pinctrl_data,
44662306a36Sopenharmony_ci	},
44762306a36Sopenharmony_ci	{}
44862306a36Sopenharmony_ci};
44962306a36Sopenharmony_ci
45062306a36Sopenharmony_cistatic int berlin4ct_pinctrl_probe(struct platform_device *pdev)
45162306a36Sopenharmony_ci{
45262306a36Sopenharmony_ci	const struct of_device_id *match =
45362306a36Sopenharmony_ci		of_match_device(berlin4ct_pinctrl_match, &pdev->dev);
45462306a36Sopenharmony_ci	struct regmap_config *rmconfig;
45562306a36Sopenharmony_ci	struct regmap *regmap;
45662306a36Sopenharmony_ci	struct resource *res;
45762306a36Sopenharmony_ci	void __iomem *base;
45862306a36Sopenharmony_ci
45962306a36Sopenharmony_ci	rmconfig = devm_kzalloc(&pdev->dev, sizeof(*rmconfig), GFP_KERNEL);
46062306a36Sopenharmony_ci	if (!rmconfig)
46162306a36Sopenharmony_ci		return -ENOMEM;
46262306a36Sopenharmony_ci
46362306a36Sopenharmony_ci	base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
46462306a36Sopenharmony_ci	if (IS_ERR(base))
46562306a36Sopenharmony_ci		return PTR_ERR(base);
46662306a36Sopenharmony_ci
46762306a36Sopenharmony_ci	rmconfig->reg_bits = 32,
46862306a36Sopenharmony_ci	rmconfig->val_bits = 32,
46962306a36Sopenharmony_ci	rmconfig->reg_stride = 4,
47062306a36Sopenharmony_ci	rmconfig->max_register = resource_size(res);
47162306a36Sopenharmony_ci
47262306a36Sopenharmony_ci	regmap = devm_regmap_init_mmio(&pdev->dev, base, rmconfig);
47362306a36Sopenharmony_ci	if (IS_ERR(regmap))
47462306a36Sopenharmony_ci		return PTR_ERR(regmap);
47562306a36Sopenharmony_ci
47662306a36Sopenharmony_ci	return berlin_pinctrl_probe_regmap(pdev, match->data, regmap);
47762306a36Sopenharmony_ci}
47862306a36Sopenharmony_ci
47962306a36Sopenharmony_cistatic struct platform_driver berlin4ct_pinctrl_driver = {
48062306a36Sopenharmony_ci	.probe	= berlin4ct_pinctrl_probe,
48162306a36Sopenharmony_ci	.driver	= {
48262306a36Sopenharmony_ci		.name = "berlin4ct-pinctrl",
48362306a36Sopenharmony_ci		.of_match_table = berlin4ct_pinctrl_match,
48462306a36Sopenharmony_ci	},
48562306a36Sopenharmony_ci};
48662306a36Sopenharmony_cibuiltin_platform_driver(berlin4ct_pinctrl_driver);
487