18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright (C) 2013-2017 Broadcom
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * This program is free software; you can redistribute it and/or
58c2ecf20Sopenharmony_ci * modify it under the terms of the GNU General Public License as
68c2ecf20Sopenharmony_ci * published by the Free Software Foundation version 2.
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * This program is distributed "as is" WITHOUT ANY WARRANTY of any
98c2ecf20Sopenharmony_ci * kind, whether express or implied; without even the implied warranty
108c2ecf20Sopenharmony_ci * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
118c2ecf20Sopenharmony_ci * GNU General Public License for more details.
128c2ecf20Sopenharmony_ci */
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#include <linux/err.h>
158c2ecf20Sopenharmony_ci#include <linux/io.h>
168c2ecf20Sopenharmony_ci#include <linux/init.h>
178c2ecf20Sopenharmony_ci#include <linux/of.h>
188c2ecf20Sopenharmony_ci#include <linux/platform_device.h>
198c2ecf20Sopenharmony_ci#include <linux/pinctrl/pinctrl.h>
208c2ecf20Sopenharmony_ci#include <linux/pinctrl/pinmux.h>
218c2ecf20Sopenharmony_ci#include <linux/pinctrl/pinconf.h>
228c2ecf20Sopenharmony_ci#include <linux/pinctrl/pinconf-generic.h>
238c2ecf20Sopenharmony_ci#include <linux/regmap.h>
248c2ecf20Sopenharmony_ci#include <linux/slab.h>
258c2ecf20Sopenharmony_ci#include "../core.h"
268c2ecf20Sopenharmony_ci#include "../pinctrl-utils.h"
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci/* BCM281XX Pin Control Registers Definitions */
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci/* Function Select bits are the same for all pin control registers */
318c2ecf20Sopenharmony_ci#define BCM281XX_PIN_REG_F_SEL_MASK		0x0700
328c2ecf20Sopenharmony_ci#define BCM281XX_PIN_REG_F_SEL_SHIFT		8
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci/* Standard pin register */
358c2ecf20Sopenharmony_ci#define BCM281XX_STD_PIN_REG_DRV_STR_MASK	0x0007
368c2ecf20Sopenharmony_ci#define BCM281XX_STD_PIN_REG_DRV_STR_SHIFT	0
378c2ecf20Sopenharmony_ci#define BCM281XX_STD_PIN_REG_INPUT_DIS_MASK	0x0008
388c2ecf20Sopenharmony_ci#define BCM281XX_STD_PIN_REG_INPUT_DIS_SHIFT	3
398c2ecf20Sopenharmony_ci#define BCM281XX_STD_PIN_REG_SLEW_MASK		0x0010
408c2ecf20Sopenharmony_ci#define BCM281XX_STD_PIN_REG_SLEW_SHIFT		4
418c2ecf20Sopenharmony_ci#define BCM281XX_STD_PIN_REG_PULL_UP_MASK	0x0020
428c2ecf20Sopenharmony_ci#define BCM281XX_STD_PIN_REG_PULL_UP_SHIFT	5
438c2ecf20Sopenharmony_ci#define BCM281XX_STD_PIN_REG_PULL_DN_MASK	0x0040
448c2ecf20Sopenharmony_ci#define BCM281XX_STD_PIN_REG_PULL_DN_SHIFT	6
458c2ecf20Sopenharmony_ci#define BCM281XX_STD_PIN_REG_HYST_MASK		0x0080
468c2ecf20Sopenharmony_ci#define BCM281XX_STD_PIN_REG_HYST_SHIFT		7
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci/* I2C pin register */
498c2ecf20Sopenharmony_ci#define BCM281XX_I2C_PIN_REG_INPUT_DIS_MASK	0x0004
508c2ecf20Sopenharmony_ci#define BCM281XX_I2C_PIN_REG_INPUT_DIS_SHIFT	2
518c2ecf20Sopenharmony_ci#define BCM281XX_I2C_PIN_REG_SLEW_MASK		0x0008
528c2ecf20Sopenharmony_ci#define BCM281XX_I2C_PIN_REG_SLEW_SHIFT		3
538c2ecf20Sopenharmony_ci#define BCM281XX_I2C_PIN_REG_PULL_UP_STR_MASK	0x0070
548c2ecf20Sopenharmony_ci#define BCM281XX_I2C_PIN_REG_PULL_UP_STR_SHIFT	4
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci/* HDMI pin register */
578c2ecf20Sopenharmony_ci#define BCM281XX_HDMI_PIN_REG_INPUT_DIS_MASK	0x0008
588c2ecf20Sopenharmony_ci#define BCM281XX_HDMI_PIN_REG_INPUT_DIS_SHIFT	3
598c2ecf20Sopenharmony_ci#define BCM281XX_HDMI_PIN_REG_MODE_MASK		0x0010
608c2ecf20Sopenharmony_ci#define BCM281XX_HDMI_PIN_REG_MODE_SHIFT	4
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci/*
638c2ecf20Sopenharmony_ci * bcm281xx_pin_type - types of pin register
648c2ecf20Sopenharmony_ci */
658c2ecf20Sopenharmony_cienum bcm281xx_pin_type {
668c2ecf20Sopenharmony_ci	BCM281XX_PIN_TYPE_UNKNOWN = 0,
678c2ecf20Sopenharmony_ci	BCM281XX_PIN_TYPE_STD,
688c2ecf20Sopenharmony_ci	BCM281XX_PIN_TYPE_I2C,
698c2ecf20Sopenharmony_ci	BCM281XX_PIN_TYPE_HDMI,
708c2ecf20Sopenharmony_ci};
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_cistatic enum bcm281xx_pin_type std_pin = BCM281XX_PIN_TYPE_STD;
738c2ecf20Sopenharmony_cistatic enum bcm281xx_pin_type i2c_pin = BCM281XX_PIN_TYPE_I2C;
748c2ecf20Sopenharmony_cistatic enum bcm281xx_pin_type hdmi_pin = BCM281XX_PIN_TYPE_HDMI;
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci/*
778c2ecf20Sopenharmony_ci * bcm281xx_pin_function- define pin function
788c2ecf20Sopenharmony_ci */
798c2ecf20Sopenharmony_cistruct bcm281xx_pin_function {
808c2ecf20Sopenharmony_ci	const char *name;
818c2ecf20Sopenharmony_ci	const char * const *groups;
828c2ecf20Sopenharmony_ci	const unsigned ngroups;
838c2ecf20Sopenharmony_ci};
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci/*
868c2ecf20Sopenharmony_ci * bcm281xx_pinctrl_data - Broadcom-specific pinctrl data
878c2ecf20Sopenharmony_ci * @reg_base - base of pinctrl registers
888c2ecf20Sopenharmony_ci */
898c2ecf20Sopenharmony_cistruct bcm281xx_pinctrl_data {
908c2ecf20Sopenharmony_ci	void __iomem *reg_base;
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci	/* List of all pins */
938c2ecf20Sopenharmony_ci	const struct pinctrl_pin_desc *pins;
948c2ecf20Sopenharmony_ci	const unsigned npins;
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci	const struct bcm281xx_pin_function *functions;
978c2ecf20Sopenharmony_ci	const unsigned nfunctions;
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci	struct regmap *regmap;
1008c2ecf20Sopenharmony_ci};
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ci/*
1038c2ecf20Sopenharmony_ci * Pin number definition.  The order here must be the same as defined in the
1048c2ecf20Sopenharmony_ci * PADCTRLREG block in the RDB.
1058c2ecf20Sopenharmony_ci */
1068c2ecf20Sopenharmony_ci#define BCM281XX_PIN_ADCSYNC		0
1078c2ecf20Sopenharmony_ci#define BCM281XX_PIN_BAT_RM		1
1088c2ecf20Sopenharmony_ci#define BCM281XX_PIN_BSC1_SCL		2
1098c2ecf20Sopenharmony_ci#define BCM281XX_PIN_BSC1_SDA		3
1108c2ecf20Sopenharmony_ci#define BCM281XX_PIN_BSC2_SCL		4
1118c2ecf20Sopenharmony_ci#define BCM281XX_PIN_BSC2_SDA		5
1128c2ecf20Sopenharmony_ci#define BCM281XX_PIN_CLASSGPWR		6
1138c2ecf20Sopenharmony_ci#define BCM281XX_PIN_CLK_CX8		7
1148c2ecf20Sopenharmony_ci#define BCM281XX_PIN_CLKOUT_0		8
1158c2ecf20Sopenharmony_ci#define BCM281XX_PIN_CLKOUT_1		9
1168c2ecf20Sopenharmony_ci#define BCM281XX_PIN_CLKOUT_2		10
1178c2ecf20Sopenharmony_ci#define BCM281XX_PIN_CLKOUT_3		11
1188c2ecf20Sopenharmony_ci#define BCM281XX_PIN_CLKREQ_IN_0	12
1198c2ecf20Sopenharmony_ci#define BCM281XX_PIN_CLKREQ_IN_1	13
1208c2ecf20Sopenharmony_ci#define BCM281XX_PIN_CWS_SYS_REQ1	14
1218c2ecf20Sopenharmony_ci#define BCM281XX_PIN_CWS_SYS_REQ2	15
1228c2ecf20Sopenharmony_ci#define BCM281XX_PIN_CWS_SYS_REQ3	16
1238c2ecf20Sopenharmony_ci#define BCM281XX_PIN_DIGMIC1_CLK	17
1248c2ecf20Sopenharmony_ci#define BCM281XX_PIN_DIGMIC1_DQ		18
1258c2ecf20Sopenharmony_ci#define BCM281XX_PIN_DIGMIC2_CLK	19
1268c2ecf20Sopenharmony_ci#define BCM281XX_PIN_DIGMIC2_DQ		20
1278c2ecf20Sopenharmony_ci#define BCM281XX_PIN_GPEN13		21
1288c2ecf20Sopenharmony_ci#define BCM281XX_PIN_GPEN14		22
1298c2ecf20Sopenharmony_ci#define BCM281XX_PIN_GPEN15		23
1308c2ecf20Sopenharmony_ci#define BCM281XX_PIN_GPIO00		24
1318c2ecf20Sopenharmony_ci#define BCM281XX_PIN_GPIO01		25
1328c2ecf20Sopenharmony_ci#define BCM281XX_PIN_GPIO02		26
1338c2ecf20Sopenharmony_ci#define BCM281XX_PIN_GPIO03		27
1348c2ecf20Sopenharmony_ci#define BCM281XX_PIN_GPIO04		28
1358c2ecf20Sopenharmony_ci#define BCM281XX_PIN_GPIO05		29
1368c2ecf20Sopenharmony_ci#define BCM281XX_PIN_GPIO06		30
1378c2ecf20Sopenharmony_ci#define BCM281XX_PIN_GPIO07		31
1388c2ecf20Sopenharmony_ci#define BCM281XX_PIN_GPIO08		32
1398c2ecf20Sopenharmony_ci#define BCM281XX_PIN_GPIO09		33
1408c2ecf20Sopenharmony_ci#define BCM281XX_PIN_GPIO10		34
1418c2ecf20Sopenharmony_ci#define BCM281XX_PIN_GPIO11		35
1428c2ecf20Sopenharmony_ci#define BCM281XX_PIN_GPIO12		36
1438c2ecf20Sopenharmony_ci#define BCM281XX_PIN_GPIO13		37
1448c2ecf20Sopenharmony_ci#define BCM281XX_PIN_GPIO14		38
1458c2ecf20Sopenharmony_ci#define BCM281XX_PIN_GPS_PABLANK	39
1468c2ecf20Sopenharmony_ci#define BCM281XX_PIN_GPS_TMARK		40
1478c2ecf20Sopenharmony_ci#define BCM281XX_PIN_HDMI_SCL		41
1488c2ecf20Sopenharmony_ci#define BCM281XX_PIN_HDMI_SDA		42
1498c2ecf20Sopenharmony_ci#define BCM281XX_PIN_IC_DM		43
1508c2ecf20Sopenharmony_ci#define BCM281XX_PIN_IC_DP		44
1518c2ecf20Sopenharmony_ci#define BCM281XX_PIN_KP_COL_IP_0	45
1528c2ecf20Sopenharmony_ci#define BCM281XX_PIN_KP_COL_IP_1	46
1538c2ecf20Sopenharmony_ci#define BCM281XX_PIN_KP_COL_IP_2	47
1548c2ecf20Sopenharmony_ci#define BCM281XX_PIN_KP_COL_IP_3	48
1558c2ecf20Sopenharmony_ci#define BCM281XX_PIN_KP_ROW_OP_0	49
1568c2ecf20Sopenharmony_ci#define BCM281XX_PIN_KP_ROW_OP_1	50
1578c2ecf20Sopenharmony_ci#define BCM281XX_PIN_KP_ROW_OP_2	51
1588c2ecf20Sopenharmony_ci#define BCM281XX_PIN_KP_ROW_OP_3	52
1598c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_B_0		53
1608c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_B_1		54
1618c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_B_2		55
1628c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_B_3		56
1638c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_B_4		57
1648c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_B_5		58
1658c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_B_6		59
1668c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_B_7		60
1678c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_G_0		61
1688c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_G_1		62
1698c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_G_2		63
1708c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_G_3		64
1718c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_G_4		65
1728c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_G_5		66
1738c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_G_6		67
1748c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_G_7		68
1758c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_HSYNC		69
1768c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_OE		70
1778c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_PCLK		71
1788c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_R_0		72
1798c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_R_1		73
1808c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_R_2		74
1818c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_R_3		75
1828c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_R_4		76
1838c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_R_5		77
1848c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_R_6		78
1858c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_R_7		79
1868c2ecf20Sopenharmony_ci#define BCM281XX_PIN_LCD_VSYNC		80
1878c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MDMGPIO0		81
1888c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MDMGPIO1		82
1898c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MDMGPIO2		83
1908c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MDMGPIO3		84
1918c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MDMGPIO4		85
1928c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MDMGPIO5		86
1938c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MDMGPIO6		87
1948c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MDMGPIO7		88
1958c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MDMGPIO8		89
1968c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_0	90
1978c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_1	91
1988c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_2	92
1998c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_3	93
2008c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_4	94
2018c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_5	95
2028c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_6	96
2038c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_7	97
2048c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_8	98
2058c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_9	99
2068c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_10	100
2078c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_11	101
2088c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_12	102
2098c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_13	103
2108c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_14	104
2118c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_15	105
2128c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_HA0		106
2138c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_HAT0		107
2148c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_HAT1		108
2158c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_HCE0_N	109
2168c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_HCE1_N	110
2178c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_HRD_N		111
2188c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_HWR_N		112
2198c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_RUN0		113
2208c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MPHI_RUN1		114
2218c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MTX_SCAN_CLK	115
2228c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MTX_SCAN_DATA	116
2238c2ecf20Sopenharmony_ci#define BCM281XX_PIN_NAND_AD_0		117
2248c2ecf20Sopenharmony_ci#define BCM281XX_PIN_NAND_AD_1		118
2258c2ecf20Sopenharmony_ci#define BCM281XX_PIN_NAND_AD_2		119
2268c2ecf20Sopenharmony_ci#define BCM281XX_PIN_NAND_AD_3		120
2278c2ecf20Sopenharmony_ci#define BCM281XX_PIN_NAND_AD_4		121
2288c2ecf20Sopenharmony_ci#define BCM281XX_PIN_NAND_AD_5		122
2298c2ecf20Sopenharmony_ci#define BCM281XX_PIN_NAND_AD_6		123
2308c2ecf20Sopenharmony_ci#define BCM281XX_PIN_NAND_AD_7		124
2318c2ecf20Sopenharmony_ci#define BCM281XX_PIN_NAND_ALE		125
2328c2ecf20Sopenharmony_ci#define BCM281XX_PIN_NAND_CEN_0		126
2338c2ecf20Sopenharmony_ci#define BCM281XX_PIN_NAND_CEN_1		127
2348c2ecf20Sopenharmony_ci#define BCM281XX_PIN_NAND_CLE		128
2358c2ecf20Sopenharmony_ci#define BCM281XX_PIN_NAND_OEN		129
2368c2ecf20Sopenharmony_ci#define BCM281XX_PIN_NAND_RDY_0		130
2378c2ecf20Sopenharmony_ci#define BCM281XX_PIN_NAND_RDY_1		131
2388c2ecf20Sopenharmony_ci#define BCM281XX_PIN_NAND_WEN		132
2398c2ecf20Sopenharmony_ci#define BCM281XX_PIN_NAND_WP		133
2408c2ecf20Sopenharmony_ci#define BCM281XX_PIN_PC1		134
2418c2ecf20Sopenharmony_ci#define BCM281XX_PIN_PC2		135
2428c2ecf20Sopenharmony_ci#define BCM281XX_PIN_PMU_INT		136
2438c2ecf20Sopenharmony_ci#define BCM281XX_PIN_PMU_SCL		137
2448c2ecf20Sopenharmony_ci#define BCM281XX_PIN_PMU_SDA		138
2458c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RFST2G_MTSLOTEN3G	139
2468c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_RX_CTL	140
2478c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_RXC	141
2488c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_RXD_0	142
2498c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_RXD_1	143
2508c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_RXD_2	144
2518c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_RXD_3	145
2528c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_TX_CTL	146
2538c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_TXC	147
2548c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_TXD_0	148
2558c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_TXD_1	149
2568c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_TXD_2	150
2578c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_TXD_3	151
2588c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_RX_CTL	152
2598c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_RXC	153
2608c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_RXD_0	154
2618c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_RXD_1	155
2628c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_RXD_2	156
2638c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_RXD_3	157
2648c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_TX_CTL	158
2658c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_TXC	159
2668c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_TXD_0	160
2678c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_TXD_1	161
2688c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_TXD_2	162
2698c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_TXD_3	163
2708c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_GPIO_0	164
2718c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_GPIO_1	165
2728c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_GPIO_2	166
2738c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RGMII_GPIO_3	167
2748c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RTXDATA2G_TXDATA3G1	168
2758c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RTXEN2G_TXDATA3G2	169
2768c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RXDATA3G0		170
2778c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RXDATA3G1		171
2788c2ecf20Sopenharmony_ci#define BCM281XX_PIN_RXDATA3G2		172
2798c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SDIO1_CLK		173
2808c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SDIO1_CMD		174
2818c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SDIO1_DATA_0	175
2828c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SDIO1_DATA_1	176
2838c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SDIO1_DATA_2	177
2848c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SDIO1_DATA_3	178
2858c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SDIO4_CLK		179
2868c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SDIO4_CMD		180
2878c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SDIO4_DATA_0	181
2888c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SDIO4_DATA_1	182
2898c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SDIO4_DATA_2	183
2908c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SDIO4_DATA_3	184
2918c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SIM_CLK		185
2928c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SIM_DATA		186
2938c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SIM_DET		187
2948c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SIM_RESETN		188
2958c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SIM2_CLK		189
2968c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SIM2_DATA		190
2978c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SIM2_DET		191
2988c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SIM2_RESETN	192
2998c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SRI_C		193
3008c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SRI_D		194
3018c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SRI_E		195
3028c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP_EXTCLK		196
3038c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP0_CLK		197
3048c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP0_FS		198
3058c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP0_RXD		199
3068c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP0_TXD		200
3078c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP2_CLK		201
3088c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP2_FS_0		202
3098c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP2_FS_1		203
3108c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP2_FS_2		204
3118c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP2_FS_3		205
3128c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP2_RXD_0		206
3138c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP2_RXD_1		207
3148c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP2_TXD_0		208
3158c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP2_TXD_1		209
3168c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP3_CLK		210
3178c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP3_FS		211
3188c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP3_RXD		212
3198c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP3_TXD		213
3208c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP4_CLK		214
3218c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP4_FS		215
3228c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP4_RXD		216
3238c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP4_TXD		217
3248c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP5_CLK		218
3258c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP5_FS		219
3268c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP5_RXD		220
3278c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP5_TXD		221
3288c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP6_CLK		222
3298c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP6_FS		223
3308c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP6_RXD		224
3318c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SSP6_TXD		225
3328c2ecf20Sopenharmony_ci#define BCM281XX_PIN_STAT_1		226
3338c2ecf20Sopenharmony_ci#define BCM281XX_PIN_STAT_2		227
3348c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SYSCLKEN		228
3358c2ecf20Sopenharmony_ci#define BCM281XX_PIN_TRACECLK		229
3368c2ecf20Sopenharmony_ci#define BCM281XX_PIN_TRACEDT00		230
3378c2ecf20Sopenharmony_ci#define BCM281XX_PIN_TRACEDT01		231
3388c2ecf20Sopenharmony_ci#define BCM281XX_PIN_TRACEDT02		232
3398c2ecf20Sopenharmony_ci#define BCM281XX_PIN_TRACEDT03		233
3408c2ecf20Sopenharmony_ci#define BCM281XX_PIN_TRACEDT04		234
3418c2ecf20Sopenharmony_ci#define BCM281XX_PIN_TRACEDT05		235
3428c2ecf20Sopenharmony_ci#define BCM281XX_PIN_TRACEDT06		236
3438c2ecf20Sopenharmony_ci#define BCM281XX_PIN_TRACEDT07		237
3448c2ecf20Sopenharmony_ci#define BCM281XX_PIN_TRACEDT08		238
3458c2ecf20Sopenharmony_ci#define BCM281XX_PIN_TRACEDT09		239
3468c2ecf20Sopenharmony_ci#define BCM281XX_PIN_TRACEDT10		240
3478c2ecf20Sopenharmony_ci#define BCM281XX_PIN_TRACEDT11		241
3488c2ecf20Sopenharmony_ci#define BCM281XX_PIN_TRACEDT12		242
3498c2ecf20Sopenharmony_ci#define BCM281XX_PIN_TRACEDT13		243
3508c2ecf20Sopenharmony_ci#define BCM281XX_PIN_TRACEDT14		244
3518c2ecf20Sopenharmony_ci#define BCM281XX_PIN_TRACEDT15		245
3528c2ecf20Sopenharmony_ci#define BCM281XX_PIN_TXDATA3G0		246
3538c2ecf20Sopenharmony_ci#define BCM281XX_PIN_TXPWRIND		247
3548c2ecf20Sopenharmony_ci#define BCM281XX_PIN_UARTB1_UCTS	248
3558c2ecf20Sopenharmony_ci#define BCM281XX_PIN_UARTB1_URTS	249
3568c2ecf20Sopenharmony_ci#define BCM281XX_PIN_UARTB1_URXD	250
3578c2ecf20Sopenharmony_ci#define BCM281XX_PIN_UARTB1_UTXD	251
3588c2ecf20Sopenharmony_ci#define BCM281XX_PIN_UARTB2_URXD	252
3598c2ecf20Sopenharmony_ci#define BCM281XX_PIN_UARTB2_UTXD	253
3608c2ecf20Sopenharmony_ci#define BCM281XX_PIN_UARTB3_UCTS	254
3618c2ecf20Sopenharmony_ci#define BCM281XX_PIN_UARTB3_URTS	255
3628c2ecf20Sopenharmony_ci#define BCM281XX_PIN_UARTB3_URXD	256
3638c2ecf20Sopenharmony_ci#define BCM281XX_PIN_UARTB3_UTXD	257
3648c2ecf20Sopenharmony_ci#define BCM281XX_PIN_UARTB4_UCTS	258
3658c2ecf20Sopenharmony_ci#define BCM281XX_PIN_UARTB4_URTS	259
3668c2ecf20Sopenharmony_ci#define BCM281XX_PIN_UARTB4_URXD	260
3678c2ecf20Sopenharmony_ci#define BCM281XX_PIN_UARTB4_UTXD	261
3688c2ecf20Sopenharmony_ci#define BCM281XX_PIN_VC_CAM1_SCL	262
3698c2ecf20Sopenharmony_ci#define BCM281XX_PIN_VC_CAM1_SDA	263
3708c2ecf20Sopenharmony_ci#define BCM281XX_PIN_VC_CAM2_SCL	264
3718c2ecf20Sopenharmony_ci#define BCM281XX_PIN_VC_CAM2_SDA	265
3728c2ecf20Sopenharmony_ci#define BCM281XX_PIN_VC_CAM3_SCL	266
3738c2ecf20Sopenharmony_ci#define BCM281XX_PIN_VC_CAM3_SDA	267
3748c2ecf20Sopenharmony_ci
3758c2ecf20Sopenharmony_ci#define BCM281XX_PIN_DESC(a, b, c) \
3768c2ecf20Sopenharmony_ci	{ .number = a, .name = b, .drv_data = &c##_pin }
3778c2ecf20Sopenharmony_ci
3788c2ecf20Sopenharmony_ci/*
3798c2ecf20Sopenharmony_ci * Pin description definition.  The order here must be the same as defined in
3808c2ecf20Sopenharmony_ci * the PADCTRLREG block in the RDB, since the pin number is used as an index
3818c2ecf20Sopenharmony_ci * into this array.
3828c2ecf20Sopenharmony_ci */
3838c2ecf20Sopenharmony_cistatic const struct pinctrl_pin_desc bcm281xx_pinctrl_pins[] = {
3848c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_ADCSYNC, "adcsync", std),
3858c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_BAT_RM, "bat_rm", std),
3868c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_BSC1_SCL, "bsc1_scl", i2c),
3878c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_BSC1_SDA, "bsc1_sda", i2c),
3888c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_BSC2_SCL, "bsc2_scl", i2c),
3898c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_BSC2_SDA, "bsc2_sda", i2c),
3908c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_CLASSGPWR, "classgpwr", std),
3918c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_CLK_CX8, "clk_cx8", std),
3928c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_CLKOUT_0, "clkout_0", std),
3938c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_CLKOUT_1, "clkout_1", std),
3948c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_CLKOUT_2, "clkout_2", std),
3958c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_CLKOUT_3, "clkout_3", std),
3968c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_CLKREQ_IN_0, "clkreq_in_0", std),
3978c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_CLKREQ_IN_1, "clkreq_in_1", std),
3988c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_CWS_SYS_REQ1, "cws_sys_req1", std),
3998c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_CWS_SYS_REQ2, "cws_sys_req2", std),
4008c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_CWS_SYS_REQ3, "cws_sys_req3", std),
4018c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_DIGMIC1_CLK, "digmic1_clk", std),
4028c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_DIGMIC1_DQ, "digmic1_dq", std),
4038c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_DIGMIC2_CLK, "digmic2_clk", std),
4048c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_DIGMIC2_DQ, "digmic2_dq", std),
4058c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPEN13, "gpen13", std),
4068c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPEN14, "gpen14", std),
4078c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPEN15, "gpen15", std),
4088c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO00, "gpio00", std),
4098c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO01, "gpio01", std),
4108c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO02, "gpio02", std),
4118c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO03, "gpio03", std),
4128c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO04, "gpio04", std),
4138c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO05, "gpio05", std),
4148c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO06, "gpio06", std),
4158c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO07, "gpio07", std),
4168c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO08, "gpio08", std),
4178c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO09, "gpio09", std),
4188c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO10, "gpio10", std),
4198c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO11, "gpio11", std),
4208c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO12, "gpio12", std),
4218c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO13, "gpio13", std),
4228c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO14, "gpio14", std),
4238c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPS_PABLANK, "gps_pablank", std),
4248c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPS_TMARK, "gps_tmark", std),
4258c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_HDMI_SCL, "hdmi_scl", hdmi),
4268c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_HDMI_SDA, "hdmi_sda", hdmi),
4278c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_IC_DM, "ic_dm", std),
4288c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_IC_DP, "ic_dp", std),
4298c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_KP_COL_IP_0, "kp_col_ip_0", std),
4308c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_KP_COL_IP_1, "kp_col_ip_1", std),
4318c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_KP_COL_IP_2, "kp_col_ip_2", std),
4328c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_KP_COL_IP_3, "kp_col_ip_3", std),
4338c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_KP_ROW_OP_0, "kp_row_op_0", std),
4348c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_KP_ROW_OP_1, "kp_row_op_1", std),
4358c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_KP_ROW_OP_2, "kp_row_op_2", std),
4368c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_KP_ROW_OP_3, "kp_row_op_3", std),
4378c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_B_0, "lcd_b_0", std),
4388c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_B_1, "lcd_b_1", std),
4398c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_B_2, "lcd_b_2", std),
4408c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_B_3, "lcd_b_3", std),
4418c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_B_4, "lcd_b_4", std),
4428c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_B_5, "lcd_b_5", std),
4438c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_B_6, "lcd_b_6", std),
4448c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_B_7, "lcd_b_7", std),
4458c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_G_0, "lcd_g_0", std),
4468c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_G_1, "lcd_g_1", std),
4478c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_G_2, "lcd_g_2", std),
4488c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_G_3, "lcd_g_3", std),
4498c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_G_4, "lcd_g_4", std),
4508c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_G_5, "lcd_g_5", std),
4518c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_G_6, "lcd_g_6", std),
4528c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_G_7, "lcd_g_7", std),
4538c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_HSYNC, "lcd_hsync", std),
4548c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_OE, "lcd_oe", std),
4558c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_PCLK, "lcd_pclk", std),
4568c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_R_0, "lcd_r_0", std),
4578c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_R_1, "lcd_r_1", std),
4588c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_R_2, "lcd_r_2", std),
4598c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_R_3, "lcd_r_3", std),
4608c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_R_4, "lcd_r_4", std),
4618c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_R_5, "lcd_r_5", std),
4628c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_R_6, "lcd_r_6", std),
4638c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_R_7, "lcd_r_7", std),
4648c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_VSYNC, "lcd_vsync", std),
4658c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MDMGPIO0, "mdmgpio0", std),
4668c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MDMGPIO1, "mdmgpio1", std),
4678c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MDMGPIO2, "mdmgpio2", std),
4688c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MDMGPIO3, "mdmgpio3", std),
4698c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MDMGPIO4, "mdmgpio4", std),
4708c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MDMGPIO5, "mdmgpio5", std),
4718c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MDMGPIO6, "mdmgpio6", std),
4728c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MDMGPIO7, "mdmgpio7", std),
4738c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MDMGPIO8, "mdmgpio8", std),
4748c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_0, "mphi_data_0", std),
4758c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_1, "mphi_data_1", std),
4768c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_2, "mphi_data_2", std),
4778c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_3, "mphi_data_3", std),
4788c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_4, "mphi_data_4", std),
4798c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_5, "mphi_data_5", std),
4808c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_6, "mphi_data_6", std),
4818c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_7, "mphi_data_7", std),
4828c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_8, "mphi_data_8", std),
4838c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_9, "mphi_data_9", std),
4848c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_10, "mphi_data_10", std),
4858c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_11, "mphi_data_11", std),
4868c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_12, "mphi_data_12", std),
4878c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_13, "mphi_data_13", std),
4888c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_14, "mphi_data_14", std),
4898c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_15, "mphi_data_15", std),
4908c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_HA0, "mphi_ha0", std),
4918c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_HAT0, "mphi_hat0", std),
4928c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_HAT1, "mphi_hat1", std),
4938c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_HCE0_N, "mphi_hce0_n", std),
4948c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_HCE1_N, "mphi_hce1_n", std),
4958c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_HRD_N, "mphi_hrd_n", std),
4968c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_HWR_N, "mphi_hwr_n", std),
4978c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_RUN0, "mphi_run0", std),
4988c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_RUN1, "mphi_run1", std),
4998c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MTX_SCAN_CLK, "mtx_scan_clk", std),
5008c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MTX_SCAN_DATA, "mtx_scan_data", std),
5018c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_AD_0, "nand_ad_0", std),
5028c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_AD_1, "nand_ad_1", std),
5038c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_AD_2, "nand_ad_2", std),
5048c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_AD_3, "nand_ad_3", std),
5058c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_AD_4, "nand_ad_4", std),
5068c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_AD_5, "nand_ad_5", std),
5078c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_AD_6, "nand_ad_6", std),
5088c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_AD_7, "nand_ad_7", std),
5098c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_ALE, "nand_ale", std),
5108c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_CEN_0, "nand_cen_0", std),
5118c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_CEN_1, "nand_cen_1", std),
5128c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_CLE, "nand_cle", std),
5138c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_OEN, "nand_oen", std),
5148c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_RDY_0, "nand_rdy_0", std),
5158c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_RDY_1, "nand_rdy_1", std),
5168c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_WEN, "nand_wen", std),
5178c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_WP, "nand_wp", std),
5188c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_PC1, "pc1", std),
5198c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_PC2, "pc2", std),
5208c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_PMU_INT, "pmu_int", std),
5218c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_PMU_SCL, "pmu_scl", i2c),
5228c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_PMU_SDA, "pmu_sda", i2c),
5238c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RFST2G_MTSLOTEN3G, "rfst2g_mtsloten3g",
5248c2ecf20Sopenharmony_ci		std),
5258c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_RX_CTL, "rgmii_0_rx_ctl", std),
5268c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_RXC, "rgmii_0_rxc", std),
5278c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_RXD_0, "rgmii_0_rxd_0", std),
5288c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_RXD_1, "rgmii_0_rxd_1", std),
5298c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_RXD_2, "rgmii_0_rxd_2", std),
5308c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_RXD_3, "rgmii_0_rxd_3", std),
5318c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_TX_CTL, "rgmii_0_tx_ctl", std),
5328c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_TXC, "rgmii_0_txc", std),
5338c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_TXD_0, "rgmii_0_txd_0", std),
5348c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_TXD_1, "rgmii_0_txd_1", std),
5358c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_TXD_2, "rgmii_0_txd_2", std),
5368c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_TXD_3, "rgmii_0_txd_3", std),
5378c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_RX_CTL, "rgmii_1_rx_ctl", std),
5388c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_RXC, "rgmii_1_rxc", std),
5398c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_RXD_0, "rgmii_1_rxd_0", std),
5408c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_RXD_1, "rgmii_1_rxd_1", std),
5418c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_RXD_2, "rgmii_1_rxd_2", std),
5428c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_RXD_3, "rgmii_1_rxd_3", std),
5438c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_TX_CTL, "rgmii_1_tx_ctl", std),
5448c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_TXC, "rgmii_1_txc", std),
5458c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_TXD_0, "rgmii_1_txd_0", std),
5468c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_TXD_1, "rgmii_1_txd_1", std),
5478c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_TXD_2, "rgmii_1_txd_2", std),
5488c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_TXD_3, "rgmii_1_txd_3", std),
5498c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_GPIO_0, "rgmii_gpio_0", std),
5508c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_GPIO_1, "rgmii_gpio_1", std),
5518c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_GPIO_2, "rgmii_gpio_2", std),
5528c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_GPIO_3, "rgmii_gpio_3", std),
5538c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RTXDATA2G_TXDATA3G1,
5548c2ecf20Sopenharmony_ci		"rtxdata2g_txdata3g1", std),
5558c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RTXEN2G_TXDATA3G2, "rtxen2g_txdata3g2",
5568c2ecf20Sopenharmony_ci		std),
5578c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RXDATA3G0, "rxdata3g0", std),
5588c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RXDATA3G1, "rxdata3g1", std),
5598c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RXDATA3G2, "rxdata3g2", std),
5608c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO1_CLK, "sdio1_clk", std),
5618c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO1_CMD, "sdio1_cmd", std),
5628c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO1_DATA_0, "sdio1_data_0", std),
5638c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO1_DATA_1, "sdio1_data_1", std),
5648c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO1_DATA_2, "sdio1_data_2", std),
5658c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO1_DATA_3, "sdio1_data_3", std),
5668c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO4_CLK, "sdio4_clk", std),
5678c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO4_CMD, "sdio4_cmd", std),
5688c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO4_DATA_0, "sdio4_data_0", std),
5698c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO4_DATA_1, "sdio4_data_1", std),
5708c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO4_DATA_2, "sdio4_data_2", std),
5718c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO4_DATA_3, "sdio4_data_3", std),
5728c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SIM_CLK, "sim_clk", std),
5738c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SIM_DATA, "sim_data", std),
5748c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SIM_DET, "sim_det", std),
5758c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SIM_RESETN, "sim_resetn", std),
5768c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SIM2_CLK, "sim2_clk", std),
5778c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SIM2_DATA, "sim2_data", std),
5788c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SIM2_DET, "sim2_det", std),
5798c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SIM2_RESETN, "sim2_resetn", std),
5808c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SRI_C, "sri_c", std),
5818c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SRI_D, "sri_d", std),
5828c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SRI_E, "sri_e", std),
5838c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP_EXTCLK, "ssp_extclk", std),
5848c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP0_CLK, "ssp0_clk", std),
5858c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP0_FS, "ssp0_fs", std),
5868c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP0_RXD, "ssp0_rxd", std),
5878c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP0_TXD, "ssp0_txd", std),
5888c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP2_CLK, "ssp2_clk", std),
5898c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP2_FS_0, "ssp2_fs_0", std),
5908c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP2_FS_1, "ssp2_fs_1", std),
5918c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP2_FS_2, "ssp2_fs_2", std),
5928c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP2_FS_3, "ssp2_fs_3", std),
5938c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP2_RXD_0, "ssp2_rxd_0", std),
5948c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP2_RXD_1, "ssp2_rxd_1", std),
5958c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP2_TXD_0, "ssp2_txd_0", std),
5968c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP2_TXD_1, "ssp2_txd_1", std),
5978c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP3_CLK, "ssp3_clk", std),
5988c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP3_FS, "ssp3_fs", std),
5998c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP3_RXD, "ssp3_rxd", std),
6008c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP3_TXD, "ssp3_txd", std),
6018c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP4_CLK, "ssp4_clk", std),
6028c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP4_FS, "ssp4_fs", std),
6038c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP4_RXD, "ssp4_rxd", std),
6048c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP4_TXD, "ssp4_txd", std),
6058c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP5_CLK, "ssp5_clk", std),
6068c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP5_FS, "ssp5_fs", std),
6078c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP5_RXD, "ssp5_rxd", std),
6088c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP5_TXD, "ssp5_txd", std),
6098c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP6_CLK, "ssp6_clk", std),
6108c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP6_FS, "ssp6_fs", std),
6118c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP6_RXD, "ssp6_rxd", std),
6128c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP6_TXD, "ssp6_txd", std),
6138c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_STAT_1, "stat_1", std),
6148c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_STAT_2, "stat_2", std),
6158c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SYSCLKEN, "sysclken", std),
6168c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACECLK, "traceclk", std),
6178c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT00, "tracedt00", std),
6188c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT01, "tracedt01", std),
6198c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT02, "tracedt02", std),
6208c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT03, "tracedt03", std),
6218c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT04, "tracedt04", std),
6228c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT05, "tracedt05", std),
6238c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT06, "tracedt06", std),
6248c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT07, "tracedt07", std),
6258c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT08, "tracedt08", std),
6268c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT09, "tracedt09", std),
6278c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT10, "tracedt10", std),
6288c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT11, "tracedt11", std),
6298c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT12, "tracedt12", std),
6308c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT13, "tracedt13", std),
6318c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT14, "tracedt14", std),
6328c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT15, "tracedt15", std),
6338c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TXDATA3G0, "txdata3g0", std),
6348c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TXPWRIND, "txpwrind", std),
6358c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB1_UCTS, "uartb1_ucts", std),
6368c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB1_URTS, "uartb1_urts", std),
6378c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB1_URXD, "uartb1_urxd", std),
6388c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB1_UTXD, "uartb1_utxd", std),
6398c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB2_URXD, "uartb2_urxd", std),
6408c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB2_UTXD, "uartb2_utxd", std),
6418c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB3_UCTS, "uartb3_ucts", std),
6428c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB3_URTS, "uartb3_urts", std),
6438c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB3_URXD, "uartb3_urxd", std),
6448c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB3_UTXD, "uartb3_utxd", std),
6458c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB4_UCTS, "uartb4_ucts", std),
6468c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB4_URTS, "uartb4_urts", std),
6478c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB4_URXD, "uartb4_urxd", std),
6488c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB4_UTXD, "uartb4_utxd", std),
6498c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_VC_CAM1_SCL, "vc_cam1_scl", i2c),
6508c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_VC_CAM1_SDA, "vc_cam1_sda", i2c),
6518c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_VC_CAM2_SCL, "vc_cam2_scl", i2c),
6528c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_VC_CAM2_SDA, "vc_cam2_sda", i2c),
6538c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_VC_CAM3_SCL, "vc_cam3_scl", i2c),
6548c2ecf20Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_VC_CAM3_SDA, "vc_cam3_sda", i2c),
6558c2ecf20Sopenharmony_ci};
6568c2ecf20Sopenharmony_ci
6578c2ecf20Sopenharmony_cistatic const char * const bcm281xx_alt_groups[] = {
6588c2ecf20Sopenharmony_ci	"adcsync",
6598c2ecf20Sopenharmony_ci	"bat_rm",
6608c2ecf20Sopenharmony_ci	"bsc1_scl",
6618c2ecf20Sopenharmony_ci	"bsc1_sda",
6628c2ecf20Sopenharmony_ci	"bsc2_scl",
6638c2ecf20Sopenharmony_ci	"bsc2_sda",
6648c2ecf20Sopenharmony_ci	"classgpwr",
6658c2ecf20Sopenharmony_ci	"clk_cx8",
6668c2ecf20Sopenharmony_ci	"clkout_0",
6678c2ecf20Sopenharmony_ci	"clkout_1",
6688c2ecf20Sopenharmony_ci	"clkout_2",
6698c2ecf20Sopenharmony_ci	"clkout_3",
6708c2ecf20Sopenharmony_ci	"clkreq_in_0",
6718c2ecf20Sopenharmony_ci	"clkreq_in_1",
6728c2ecf20Sopenharmony_ci	"cws_sys_req1",
6738c2ecf20Sopenharmony_ci	"cws_sys_req2",
6748c2ecf20Sopenharmony_ci	"cws_sys_req3",
6758c2ecf20Sopenharmony_ci	"digmic1_clk",
6768c2ecf20Sopenharmony_ci	"digmic1_dq",
6778c2ecf20Sopenharmony_ci	"digmic2_clk",
6788c2ecf20Sopenharmony_ci	"digmic2_dq",
6798c2ecf20Sopenharmony_ci	"gpen13",
6808c2ecf20Sopenharmony_ci	"gpen14",
6818c2ecf20Sopenharmony_ci	"gpen15",
6828c2ecf20Sopenharmony_ci	"gpio00",
6838c2ecf20Sopenharmony_ci	"gpio01",
6848c2ecf20Sopenharmony_ci	"gpio02",
6858c2ecf20Sopenharmony_ci	"gpio03",
6868c2ecf20Sopenharmony_ci	"gpio04",
6878c2ecf20Sopenharmony_ci	"gpio05",
6888c2ecf20Sopenharmony_ci	"gpio06",
6898c2ecf20Sopenharmony_ci	"gpio07",
6908c2ecf20Sopenharmony_ci	"gpio08",
6918c2ecf20Sopenharmony_ci	"gpio09",
6928c2ecf20Sopenharmony_ci	"gpio10",
6938c2ecf20Sopenharmony_ci	"gpio11",
6948c2ecf20Sopenharmony_ci	"gpio12",
6958c2ecf20Sopenharmony_ci	"gpio13",
6968c2ecf20Sopenharmony_ci	"gpio14",
6978c2ecf20Sopenharmony_ci	"gps_pablank",
6988c2ecf20Sopenharmony_ci	"gps_tmark",
6998c2ecf20Sopenharmony_ci	"hdmi_scl",
7008c2ecf20Sopenharmony_ci	"hdmi_sda",
7018c2ecf20Sopenharmony_ci	"ic_dm",
7028c2ecf20Sopenharmony_ci	"ic_dp",
7038c2ecf20Sopenharmony_ci	"kp_col_ip_0",
7048c2ecf20Sopenharmony_ci	"kp_col_ip_1",
7058c2ecf20Sopenharmony_ci	"kp_col_ip_2",
7068c2ecf20Sopenharmony_ci	"kp_col_ip_3",
7078c2ecf20Sopenharmony_ci	"kp_row_op_0",
7088c2ecf20Sopenharmony_ci	"kp_row_op_1",
7098c2ecf20Sopenharmony_ci	"kp_row_op_2",
7108c2ecf20Sopenharmony_ci	"kp_row_op_3",
7118c2ecf20Sopenharmony_ci	"lcd_b_0",
7128c2ecf20Sopenharmony_ci	"lcd_b_1",
7138c2ecf20Sopenharmony_ci	"lcd_b_2",
7148c2ecf20Sopenharmony_ci	"lcd_b_3",
7158c2ecf20Sopenharmony_ci	"lcd_b_4",
7168c2ecf20Sopenharmony_ci	"lcd_b_5",
7178c2ecf20Sopenharmony_ci	"lcd_b_6",
7188c2ecf20Sopenharmony_ci	"lcd_b_7",
7198c2ecf20Sopenharmony_ci	"lcd_g_0",
7208c2ecf20Sopenharmony_ci	"lcd_g_1",
7218c2ecf20Sopenharmony_ci	"lcd_g_2",
7228c2ecf20Sopenharmony_ci	"lcd_g_3",
7238c2ecf20Sopenharmony_ci	"lcd_g_4",
7248c2ecf20Sopenharmony_ci	"lcd_g_5",
7258c2ecf20Sopenharmony_ci	"lcd_g_6",
7268c2ecf20Sopenharmony_ci	"lcd_g_7",
7278c2ecf20Sopenharmony_ci	"lcd_hsync",
7288c2ecf20Sopenharmony_ci	"lcd_oe",
7298c2ecf20Sopenharmony_ci	"lcd_pclk",
7308c2ecf20Sopenharmony_ci	"lcd_r_0",
7318c2ecf20Sopenharmony_ci	"lcd_r_1",
7328c2ecf20Sopenharmony_ci	"lcd_r_2",
7338c2ecf20Sopenharmony_ci	"lcd_r_3",
7348c2ecf20Sopenharmony_ci	"lcd_r_4",
7358c2ecf20Sopenharmony_ci	"lcd_r_5",
7368c2ecf20Sopenharmony_ci	"lcd_r_6",
7378c2ecf20Sopenharmony_ci	"lcd_r_7",
7388c2ecf20Sopenharmony_ci	"lcd_vsync",
7398c2ecf20Sopenharmony_ci	"mdmgpio0",
7408c2ecf20Sopenharmony_ci	"mdmgpio1",
7418c2ecf20Sopenharmony_ci	"mdmgpio2",
7428c2ecf20Sopenharmony_ci	"mdmgpio3",
7438c2ecf20Sopenharmony_ci	"mdmgpio4",
7448c2ecf20Sopenharmony_ci	"mdmgpio5",
7458c2ecf20Sopenharmony_ci	"mdmgpio6",
7468c2ecf20Sopenharmony_ci	"mdmgpio7",
7478c2ecf20Sopenharmony_ci	"mdmgpio8",
7488c2ecf20Sopenharmony_ci	"mphi_data_0",
7498c2ecf20Sopenharmony_ci	"mphi_data_1",
7508c2ecf20Sopenharmony_ci	"mphi_data_2",
7518c2ecf20Sopenharmony_ci	"mphi_data_3",
7528c2ecf20Sopenharmony_ci	"mphi_data_4",
7538c2ecf20Sopenharmony_ci	"mphi_data_5",
7548c2ecf20Sopenharmony_ci	"mphi_data_6",
7558c2ecf20Sopenharmony_ci	"mphi_data_7",
7568c2ecf20Sopenharmony_ci	"mphi_data_8",
7578c2ecf20Sopenharmony_ci	"mphi_data_9",
7588c2ecf20Sopenharmony_ci	"mphi_data_10",
7598c2ecf20Sopenharmony_ci	"mphi_data_11",
7608c2ecf20Sopenharmony_ci	"mphi_data_12",
7618c2ecf20Sopenharmony_ci	"mphi_data_13",
7628c2ecf20Sopenharmony_ci	"mphi_data_14",
7638c2ecf20Sopenharmony_ci	"mphi_data_15",
7648c2ecf20Sopenharmony_ci	"mphi_ha0",
7658c2ecf20Sopenharmony_ci	"mphi_hat0",
7668c2ecf20Sopenharmony_ci	"mphi_hat1",
7678c2ecf20Sopenharmony_ci	"mphi_hce0_n",
7688c2ecf20Sopenharmony_ci	"mphi_hce1_n",
7698c2ecf20Sopenharmony_ci	"mphi_hrd_n",
7708c2ecf20Sopenharmony_ci	"mphi_hwr_n",
7718c2ecf20Sopenharmony_ci	"mphi_run0",
7728c2ecf20Sopenharmony_ci	"mphi_run1",
7738c2ecf20Sopenharmony_ci	"mtx_scan_clk",
7748c2ecf20Sopenharmony_ci	"mtx_scan_data",
7758c2ecf20Sopenharmony_ci	"nand_ad_0",
7768c2ecf20Sopenharmony_ci	"nand_ad_1",
7778c2ecf20Sopenharmony_ci	"nand_ad_2",
7788c2ecf20Sopenharmony_ci	"nand_ad_3",
7798c2ecf20Sopenharmony_ci	"nand_ad_4",
7808c2ecf20Sopenharmony_ci	"nand_ad_5",
7818c2ecf20Sopenharmony_ci	"nand_ad_6",
7828c2ecf20Sopenharmony_ci	"nand_ad_7",
7838c2ecf20Sopenharmony_ci	"nand_ale",
7848c2ecf20Sopenharmony_ci	"nand_cen_0",
7858c2ecf20Sopenharmony_ci	"nand_cen_1",
7868c2ecf20Sopenharmony_ci	"nand_cle",
7878c2ecf20Sopenharmony_ci	"nand_oen",
7888c2ecf20Sopenharmony_ci	"nand_rdy_0",
7898c2ecf20Sopenharmony_ci	"nand_rdy_1",
7908c2ecf20Sopenharmony_ci	"nand_wen",
7918c2ecf20Sopenharmony_ci	"nand_wp",
7928c2ecf20Sopenharmony_ci	"pc1",
7938c2ecf20Sopenharmony_ci	"pc2",
7948c2ecf20Sopenharmony_ci	"pmu_int",
7958c2ecf20Sopenharmony_ci	"pmu_scl",
7968c2ecf20Sopenharmony_ci	"pmu_sda",
7978c2ecf20Sopenharmony_ci	"rfst2g_mtsloten3g",
7988c2ecf20Sopenharmony_ci	"rgmii_0_rx_ctl",
7998c2ecf20Sopenharmony_ci	"rgmii_0_rxc",
8008c2ecf20Sopenharmony_ci	"rgmii_0_rxd_0",
8018c2ecf20Sopenharmony_ci	"rgmii_0_rxd_1",
8028c2ecf20Sopenharmony_ci	"rgmii_0_rxd_2",
8038c2ecf20Sopenharmony_ci	"rgmii_0_rxd_3",
8048c2ecf20Sopenharmony_ci	"rgmii_0_tx_ctl",
8058c2ecf20Sopenharmony_ci	"rgmii_0_txc",
8068c2ecf20Sopenharmony_ci	"rgmii_0_txd_0",
8078c2ecf20Sopenharmony_ci	"rgmii_0_txd_1",
8088c2ecf20Sopenharmony_ci	"rgmii_0_txd_2",
8098c2ecf20Sopenharmony_ci	"rgmii_0_txd_3",
8108c2ecf20Sopenharmony_ci	"rgmii_1_rx_ctl",
8118c2ecf20Sopenharmony_ci	"rgmii_1_rxc",
8128c2ecf20Sopenharmony_ci	"rgmii_1_rxd_0",
8138c2ecf20Sopenharmony_ci	"rgmii_1_rxd_1",
8148c2ecf20Sopenharmony_ci	"rgmii_1_rxd_2",
8158c2ecf20Sopenharmony_ci	"rgmii_1_rxd_3",
8168c2ecf20Sopenharmony_ci	"rgmii_1_tx_ctl",
8178c2ecf20Sopenharmony_ci	"rgmii_1_txc",
8188c2ecf20Sopenharmony_ci	"rgmii_1_txd_0",
8198c2ecf20Sopenharmony_ci	"rgmii_1_txd_1",
8208c2ecf20Sopenharmony_ci	"rgmii_1_txd_2",
8218c2ecf20Sopenharmony_ci	"rgmii_1_txd_3",
8228c2ecf20Sopenharmony_ci	"rgmii_gpio_0",
8238c2ecf20Sopenharmony_ci	"rgmii_gpio_1",
8248c2ecf20Sopenharmony_ci	"rgmii_gpio_2",
8258c2ecf20Sopenharmony_ci	"rgmii_gpio_3",
8268c2ecf20Sopenharmony_ci	"rtxdata2g_txdata3g1",
8278c2ecf20Sopenharmony_ci	"rtxen2g_txdata3g2",
8288c2ecf20Sopenharmony_ci	"rxdata3g0",
8298c2ecf20Sopenharmony_ci	"rxdata3g1",
8308c2ecf20Sopenharmony_ci	"rxdata3g2",
8318c2ecf20Sopenharmony_ci	"sdio1_clk",
8328c2ecf20Sopenharmony_ci	"sdio1_cmd",
8338c2ecf20Sopenharmony_ci	"sdio1_data_0",
8348c2ecf20Sopenharmony_ci	"sdio1_data_1",
8358c2ecf20Sopenharmony_ci	"sdio1_data_2",
8368c2ecf20Sopenharmony_ci	"sdio1_data_3",
8378c2ecf20Sopenharmony_ci	"sdio4_clk",
8388c2ecf20Sopenharmony_ci	"sdio4_cmd",
8398c2ecf20Sopenharmony_ci	"sdio4_data_0",
8408c2ecf20Sopenharmony_ci	"sdio4_data_1",
8418c2ecf20Sopenharmony_ci	"sdio4_data_2",
8428c2ecf20Sopenharmony_ci	"sdio4_data_3",
8438c2ecf20Sopenharmony_ci	"sim_clk",
8448c2ecf20Sopenharmony_ci	"sim_data",
8458c2ecf20Sopenharmony_ci	"sim_det",
8468c2ecf20Sopenharmony_ci	"sim_resetn",
8478c2ecf20Sopenharmony_ci	"sim2_clk",
8488c2ecf20Sopenharmony_ci	"sim2_data",
8498c2ecf20Sopenharmony_ci	"sim2_det",
8508c2ecf20Sopenharmony_ci	"sim2_resetn",
8518c2ecf20Sopenharmony_ci	"sri_c",
8528c2ecf20Sopenharmony_ci	"sri_d",
8538c2ecf20Sopenharmony_ci	"sri_e",
8548c2ecf20Sopenharmony_ci	"ssp_extclk",
8558c2ecf20Sopenharmony_ci	"ssp0_clk",
8568c2ecf20Sopenharmony_ci	"ssp0_fs",
8578c2ecf20Sopenharmony_ci	"ssp0_rxd",
8588c2ecf20Sopenharmony_ci	"ssp0_txd",
8598c2ecf20Sopenharmony_ci	"ssp2_clk",
8608c2ecf20Sopenharmony_ci	"ssp2_fs_0",
8618c2ecf20Sopenharmony_ci	"ssp2_fs_1",
8628c2ecf20Sopenharmony_ci	"ssp2_fs_2",
8638c2ecf20Sopenharmony_ci	"ssp2_fs_3",
8648c2ecf20Sopenharmony_ci	"ssp2_rxd_0",
8658c2ecf20Sopenharmony_ci	"ssp2_rxd_1",
8668c2ecf20Sopenharmony_ci	"ssp2_txd_0",
8678c2ecf20Sopenharmony_ci	"ssp2_txd_1",
8688c2ecf20Sopenharmony_ci	"ssp3_clk",
8698c2ecf20Sopenharmony_ci	"ssp3_fs",
8708c2ecf20Sopenharmony_ci	"ssp3_rxd",
8718c2ecf20Sopenharmony_ci	"ssp3_txd",
8728c2ecf20Sopenharmony_ci	"ssp4_clk",
8738c2ecf20Sopenharmony_ci	"ssp4_fs",
8748c2ecf20Sopenharmony_ci	"ssp4_rxd",
8758c2ecf20Sopenharmony_ci	"ssp4_txd",
8768c2ecf20Sopenharmony_ci	"ssp5_clk",
8778c2ecf20Sopenharmony_ci	"ssp5_fs",
8788c2ecf20Sopenharmony_ci	"ssp5_rxd",
8798c2ecf20Sopenharmony_ci	"ssp5_txd",
8808c2ecf20Sopenharmony_ci	"ssp6_clk",
8818c2ecf20Sopenharmony_ci	"ssp6_fs",
8828c2ecf20Sopenharmony_ci	"ssp6_rxd",
8838c2ecf20Sopenharmony_ci	"ssp6_txd",
8848c2ecf20Sopenharmony_ci	"stat_1",
8858c2ecf20Sopenharmony_ci	"stat_2",
8868c2ecf20Sopenharmony_ci	"sysclken",
8878c2ecf20Sopenharmony_ci	"traceclk",
8888c2ecf20Sopenharmony_ci	"tracedt00",
8898c2ecf20Sopenharmony_ci	"tracedt01",
8908c2ecf20Sopenharmony_ci	"tracedt02",
8918c2ecf20Sopenharmony_ci	"tracedt03",
8928c2ecf20Sopenharmony_ci	"tracedt04",
8938c2ecf20Sopenharmony_ci	"tracedt05",
8948c2ecf20Sopenharmony_ci	"tracedt06",
8958c2ecf20Sopenharmony_ci	"tracedt07",
8968c2ecf20Sopenharmony_ci	"tracedt08",
8978c2ecf20Sopenharmony_ci	"tracedt09",
8988c2ecf20Sopenharmony_ci	"tracedt10",
8998c2ecf20Sopenharmony_ci	"tracedt11",
9008c2ecf20Sopenharmony_ci	"tracedt12",
9018c2ecf20Sopenharmony_ci	"tracedt13",
9028c2ecf20Sopenharmony_ci	"tracedt14",
9038c2ecf20Sopenharmony_ci	"tracedt15",
9048c2ecf20Sopenharmony_ci	"txdata3g0",
9058c2ecf20Sopenharmony_ci	"txpwrind",
9068c2ecf20Sopenharmony_ci	"uartb1_ucts",
9078c2ecf20Sopenharmony_ci	"uartb1_urts",
9088c2ecf20Sopenharmony_ci	"uartb1_urxd",
9098c2ecf20Sopenharmony_ci	"uartb1_utxd",
9108c2ecf20Sopenharmony_ci	"uartb2_urxd",
9118c2ecf20Sopenharmony_ci	"uartb2_utxd",
9128c2ecf20Sopenharmony_ci	"uartb3_ucts",
9138c2ecf20Sopenharmony_ci	"uartb3_urts",
9148c2ecf20Sopenharmony_ci	"uartb3_urxd",
9158c2ecf20Sopenharmony_ci	"uartb3_utxd",
9168c2ecf20Sopenharmony_ci	"uartb4_ucts",
9178c2ecf20Sopenharmony_ci	"uartb4_urts",
9188c2ecf20Sopenharmony_ci	"uartb4_urxd",
9198c2ecf20Sopenharmony_ci	"uartb4_utxd",
9208c2ecf20Sopenharmony_ci	"vc_cam1_scl",
9218c2ecf20Sopenharmony_ci	"vc_cam1_sda",
9228c2ecf20Sopenharmony_ci	"vc_cam2_scl",
9238c2ecf20Sopenharmony_ci	"vc_cam2_sda",
9248c2ecf20Sopenharmony_ci	"vc_cam3_scl",
9258c2ecf20Sopenharmony_ci	"vc_cam3_sda",
9268c2ecf20Sopenharmony_ci};
9278c2ecf20Sopenharmony_ci
9288c2ecf20Sopenharmony_ci/* Every pin can implement all ALT1-ALT4 functions */
9298c2ecf20Sopenharmony_ci#define BCM281XX_PIN_FUNCTION(fcn_name)			\
9308c2ecf20Sopenharmony_ci{							\
9318c2ecf20Sopenharmony_ci	.name = #fcn_name,				\
9328c2ecf20Sopenharmony_ci	.groups = bcm281xx_alt_groups,			\
9338c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(bcm281xx_alt_groups),	\
9348c2ecf20Sopenharmony_ci}
9358c2ecf20Sopenharmony_ci
9368c2ecf20Sopenharmony_cistatic const struct bcm281xx_pin_function bcm281xx_functions[] = {
9378c2ecf20Sopenharmony_ci	BCM281XX_PIN_FUNCTION(alt1),
9388c2ecf20Sopenharmony_ci	BCM281XX_PIN_FUNCTION(alt2),
9398c2ecf20Sopenharmony_ci	BCM281XX_PIN_FUNCTION(alt3),
9408c2ecf20Sopenharmony_ci	BCM281XX_PIN_FUNCTION(alt4),
9418c2ecf20Sopenharmony_ci};
9428c2ecf20Sopenharmony_ci
9438c2ecf20Sopenharmony_cistatic struct bcm281xx_pinctrl_data bcm281xx_pinctrl = {
9448c2ecf20Sopenharmony_ci	.pins = bcm281xx_pinctrl_pins,
9458c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(bcm281xx_pinctrl_pins),
9468c2ecf20Sopenharmony_ci	.functions = bcm281xx_functions,
9478c2ecf20Sopenharmony_ci	.nfunctions = ARRAY_SIZE(bcm281xx_functions),
9488c2ecf20Sopenharmony_ci};
9498c2ecf20Sopenharmony_ci
9508c2ecf20Sopenharmony_cistatic inline enum bcm281xx_pin_type pin_type_get(struct pinctrl_dev *pctldev,
9518c2ecf20Sopenharmony_ci						  unsigned pin)
9528c2ecf20Sopenharmony_ci{
9538c2ecf20Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
9548c2ecf20Sopenharmony_ci
9558c2ecf20Sopenharmony_ci	if (pin >= pdata->npins)
9568c2ecf20Sopenharmony_ci		return BCM281XX_PIN_TYPE_UNKNOWN;
9578c2ecf20Sopenharmony_ci
9588c2ecf20Sopenharmony_ci	return *(enum bcm281xx_pin_type *)(pdata->pins[pin].drv_data);
9598c2ecf20Sopenharmony_ci}
9608c2ecf20Sopenharmony_ci
9618c2ecf20Sopenharmony_ci#define BCM281XX_PIN_SHIFT(type, param) \
9628c2ecf20Sopenharmony_ci	(BCM281XX_ ## type ## _PIN_REG_ ## param ## _SHIFT)
9638c2ecf20Sopenharmony_ci
9648c2ecf20Sopenharmony_ci#define BCM281XX_PIN_MASK(type, param) \
9658c2ecf20Sopenharmony_ci	(BCM281XX_ ## type ## _PIN_REG_ ## param ## _MASK)
9668c2ecf20Sopenharmony_ci
9678c2ecf20Sopenharmony_ci/*
9688c2ecf20Sopenharmony_ci * This helper function is used to build up the value and mask used to write to
9698c2ecf20Sopenharmony_ci * a pin register, but does not actually write to the register.
9708c2ecf20Sopenharmony_ci */
9718c2ecf20Sopenharmony_cistatic inline void bcm281xx_pin_update(u32 *reg_val, u32 *reg_mask,
9728c2ecf20Sopenharmony_ci				       u32 param_val, u32 param_shift,
9738c2ecf20Sopenharmony_ci				       u32 param_mask)
9748c2ecf20Sopenharmony_ci{
9758c2ecf20Sopenharmony_ci	*reg_val &= ~param_mask;
9768c2ecf20Sopenharmony_ci	*reg_val |= (param_val << param_shift) & param_mask;
9778c2ecf20Sopenharmony_ci	*reg_mask |= param_mask;
9788c2ecf20Sopenharmony_ci}
9798c2ecf20Sopenharmony_ci
9808c2ecf20Sopenharmony_cistatic const struct regmap_config bcm281xx_pinctrl_regmap_config = {
9818c2ecf20Sopenharmony_ci	.reg_bits = 32,
9828c2ecf20Sopenharmony_ci	.reg_stride = 4,
9838c2ecf20Sopenharmony_ci	.val_bits = 32,
9848c2ecf20Sopenharmony_ci	.max_register = BCM281XX_PIN_VC_CAM3_SDA,
9858c2ecf20Sopenharmony_ci};
9868c2ecf20Sopenharmony_ci
9878c2ecf20Sopenharmony_cistatic int bcm281xx_pinctrl_get_groups_count(struct pinctrl_dev *pctldev)
9888c2ecf20Sopenharmony_ci{
9898c2ecf20Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
9908c2ecf20Sopenharmony_ci
9918c2ecf20Sopenharmony_ci	return pdata->npins;
9928c2ecf20Sopenharmony_ci}
9938c2ecf20Sopenharmony_ci
9948c2ecf20Sopenharmony_cistatic const char *bcm281xx_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
9958c2ecf20Sopenharmony_ci						   unsigned group)
9968c2ecf20Sopenharmony_ci{
9978c2ecf20Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
9988c2ecf20Sopenharmony_ci
9998c2ecf20Sopenharmony_ci	return pdata->pins[group].name;
10008c2ecf20Sopenharmony_ci}
10018c2ecf20Sopenharmony_ci
10028c2ecf20Sopenharmony_cistatic int bcm281xx_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
10038c2ecf20Sopenharmony_ci					   unsigned group,
10048c2ecf20Sopenharmony_ci					   const unsigned **pins,
10058c2ecf20Sopenharmony_ci					   unsigned *num_pins)
10068c2ecf20Sopenharmony_ci{
10078c2ecf20Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
10088c2ecf20Sopenharmony_ci
10098c2ecf20Sopenharmony_ci	*pins = &pdata->pins[group].number;
10108c2ecf20Sopenharmony_ci	*num_pins = 1;
10118c2ecf20Sopenharmony_ci
10128c2ecf20Sopenharmony_ci	return 0;
10138c2ecf20Sopenharmony_ci}
10148c2ecf20Sopenharmony_ci
10158c2ecf20Sopenharmony_cistatic void bcm281xx_pinctrl_pin_dbg_show(struct pinctrl_dev *pctldev,
10168c2ecf20Sopenharmony_ci					  struct seq_file *s,
10178c2ecf20Sopenharmony_ci					  unsigned offset)
10188c2ecf20Sopenharmony_ci{
10198c2ecf20Sopenharmony_ci	seq_printf(s, " %s", dev_name(pctldev->dev));
10208c2ecf20Sopenharmony_ci}
10218c2ecf20Sopenharmony_ci
10228c2ecf20Sopenharmony_cistatic const struct pinctrl_ops bcm281xx_pinctrl_ops = {
10238c2ecf20Sopenharmony_ci	.get_groups_count = bcm281xx_pinctrl_get_groups_count,
10248c2ecf20Sopenharmony_ci	.get_group_name = bcm281xx_pinctrl_get_group_name,
10258c2ecf20Sopenharmony_ci	.get_group_pins = bcm281xx_pinctrl_get_group_pins,
10268c2ecf20Sopenharmony_ci	.pin_dbg_show = bcm281xx_pinctrl_pin_dbg_show,
10278c2ecf20Sopenharmony_ci	.dt_node_to_map = pinconf_generic_dt_node_to_map_pin,
10288c2ecf20Sopenharmony_ci	.dt_free_map = pinctrl_utils_free_map,
10298c2ecf20Sopenharmony_ci};
10308c2ecf20Sopenharmony_ci
10318c2ecf20Sopenharmony_cistatic int bcm281xx_pinctrl_get_fcns_count(struct pinctrl_dev *pctldev)
10328c2ecf20Sopenharmony_ci{
10338c2ecf20Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
10348c2ecf20Sopenharmony_ci
10358c2ecf20Sopenharmony_ci	return pdata->nfunctions;
10368c2ecf20Sopenharmony_ci}
10378c2ecf20Sopenharmony_ci
10388c2ecf20Sopenharmony_cistatic const char *bcm281xx_pinctrl_get_fcn_name(struct pinctrl_dev *pctldev,
10398c2ecf20Sopenharmony_ci						 unsigned function)
10408c2ecf20Sopenharmony_ci{
10418c2ecf20Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
10428c2ecf20Sopenharmony_ci
10438c2ecf20Sopenharmony_ci	return pdata->functions[function].name;
10448c2ecf20Sopenharmony_ci}
10458c2ecf20Sopenharmony_ci
10468c2ecf20Sopenharmony_cistatic int bcm281xx_pinctrl_get_fcn_groups(struct pinctrl_dev *pctldev,
10478c2ecf20Sopenharmony_ci					   unsigned function,
10488c2ecf20Sopenharmony_ci					   const char * const **groups,
10498c2ecf20Sopenharmony_ci					   unsigned * const num_groups)
10508c2ecf20Sopenharmony_ci{
10518c2ecf20Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
10528c2ecf20Sopenharmony_ci
10538c2ecf20Sopenharmony_ci	*groups = pdata->functions[function].groups;
10548c2ecf20Sopenharmony_ci	*num_groups = pdata->functions[function].ngroups;
10558c2ecf20Sopenharmony_ci
10568c2ecf20Sopenharmony_ci	return 0;
10578c2ecf20Sopenharmony_ci}
10588c2ecf20Sopenharmony_ci
10598c2ecf20Sopenharmony_cistatic int bcm281xx_pinmux_set(struct pinctrl_dev *pctldev,
10608c2ecf20Sopenharmony_ci			       unsigned function,
10618c2ecf20Sopenharmony_ci			       unsigned group)
10628c2ecf20Sopenharmony_ci{
10638c2ecf20Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
10648c2ecf20Sopenharmony_ci	const struct bcm281xx_pin_function *f = &pdata->functions[function];
10658c2ecf20Sopenharmony_ci	u32 offset = 4 * pdata->pins[group].number;
10668c2ecf20Sopenharmony_ci	int rc = 0;
10678c2ecf20Sopenharmony_ci
10688c2ecf20Sopenharmony_ci	dev_dbg(pctldev->dev,
10698c2ecf20Sopenharmony_ci		"%s(): Enable function %s (%d) of pin %s (%d) @offset 0x%x.\n",
10708c2ecf20Sopenharmony_ci		__func__, f->name, function, pdata->pins[group].name,
10718c2ecf20Sopenharmony_ci		pdata->pins[group].number, offset);
10728c2ecf20Sopenharmony_ci
10738c2ecf20Sopenharmony_ci	rc = regmap_update_bits(pdata->regmap, offset,
10748c2ecf20Sopenharmony_ci		BCM281XX_PIN_REG_F_SEL_MASK,
10758c2ecf20Sopenharmony_ci		function << BCM281XX_PIN_REG_F_SEL_SHIFT);
10768c2ecf20Sopenharmony_ci	if (rc)
10778c2ecf20Sopenharmony_ci		dev_err(pctldev->dev,
10788c2ecf20Sopenharmony_ci			"Error updating register for pin %s (%d).\n",
10798c2ecf20Sopenharmony_ci			pdata->pins[group].name, pdata->pins[group].number);
10808c2ecf20Sopenharmony_ci
10818c2ecf20Sopenharmony_ci	return rc;
10828c2ecf20Sopenharmony_ci}
10838c2ecf20Sopenharmony_ci
10848c2ecf20Sopenharmony_cistatic const struct pinmux_ops bcm281xx_pinctrl_pinmux_ops = {
10858c2ecf20Sopenharmony_ci	.get_functions_count = bcm281xx_pinctrl_get_fcns_count,
10868c2ecf20Sopenharmony_ci	.get_function_name = bcm281xx_pinctrl_get_fcn_name,
10878c2ecf20Sopenharmony_ci	.get_function_groups = bcm281xx_pinctrl_get_fcn_groups,
10888c2ecf20Sopenharmony_ci	.set_mux = bcm281xx_pinmux_set,
10898c2ecf20Sopenharmony_ci};
10908c2ecf20Sopenharmony_ci
10918c2ecf20Sopenharmony_cistatic int bcm281xx_pinctrl_pin_config_get(struct pinctrl_dev *pctldev,
10928c2ecf20Sopenharmony_ci					   unsigned pin,
10938c2ecf20Sopenharmony_ci					   unsigned long *config)
10948c2ecf20Sopenharmony_ci{
10958c2ecf20Sopenharmony_ci	return -ENOTSUPP;
10968c2ecf20Sopenharmony_ci}
10978c2ecf20Sopenharmony_ci
10988c2ecf20Sopenharmony_ci
10998c2ecf20Sopenharmony_ci/* Goes through the configs and update register val/mask */
11008c2ecf20Sopenharmony_cistatic int bcm281xx_std_pin_update(struct pinctrl_dev *pctldev,
11018c2ecf20Sopenharmony_ci				   unsigned pin,
11028c2ecf20Sopenharmony_ci				   unsigned long *configs,
11038c2ecf20Sopenharmony_ci				   unsigned num_configs,
11048c2ecf20Sopenharmony_ci				   u32 *val,
11058c2ecf20Sopenharmony_ci				   u32 *mask)
11068c2ecf20Sopenharmony_ci{
11078c2ecf20Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
11088c2ecf20Sopenharmony_ci	int i;
11098c2ecf20Sopenharmony_ci	enum pin_config_param param;
11108c2ecf20Sopenharmony_ci	u32 arg;
11118c2ecf20Sopenharmony_ci
11128c2ecf20Sopenharmony_ci	for (i = 0; i < num_configs; i++) {
11138c2ecf20Sopenharmony_ci		param = pinconf_to_config_param(configs[i]);
11148c2ecf20Sopenharmony_ci		arg = pinconf_to_config_argument(configs[i]);
11158c2ecf20Sopenharmony_ci
11168c2ecf20Sopenharmony_ci		switch (param) {
11178c2ecf20Sopenharmony_ci		case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
11188c2ecf20Sopenharmony_ci			arg = (arg >= 1 ? 1 : 0);
11198c2ecf20Sopenharmony_ci			bcm281xx_pin_update(val, mask, arg,
11208c2ecf20Sopenharmony_ci				BCM281XX_PIN_SHIFT(STD, HYST),
11218c2ecf20Sopenharmony_ci				BCM281XX_PIN_MASK(STD, HYST));
11228c2ecf20Sopenharmony_ci			break;
11238c2ecf20Sopenharmony_ci		/*
11248c2ecf20Sopenharmony_ci		 * The pin bias can only be one of pull-up, pull-down, or
11258c2ecf20Sopenharmony_ci		 * disable.  The user does not need to specify a value for the
11268c2ecf20Sopenharmony_ci		 * property, and the default value from pinconf-generic is
11278c2ecf20Sopenharmony_ci		 * ignored.
11288c2ecf20Sopenharmony_ci		 */
11298c2ecf20Sopenharmony_ci		case PIN_CONFIG_BIAS_DISABLE:
11308c2ecf20Sopenharmony_ci			bcm281xx_pin_update(val, mask, 0,
11318c2ecf20Sopenharmony_ci				BCM281XX_PIN_SHIFT(STD, PULL_UP),
11328c2ecf20Sopenharmony_ci				BCM281XX_PIN_MASK(STD, PULL_UP));
11338c2ecf20Sopenharmony_ci			bcm281xx_pin_update(val, mask, 0,
11348c2ecf20Sopenharmony_ci				BCM281XX_PIN_SHIFT(STD, PULL_DN),
11358c2ecf20Sopenharmony_ci				BCM281XX_PIN_MASK(STD, PULL_DN));
11368c2ecf20Sopenharmony_ci			break;
11378c2ecf20Sopenharmony_ci
11388c2ecf20Sopenharmony_ci		case PIN_CONFIG_BIAS_PULL_UP:
11398c2ecf20Sopenharmony_ci			bcm281xx_pin_update(val, mask, 1,
11408c2ecf20Sopenharmony_ci				BCM281XX_PIN_SHIFT(STD, PULL_UP),
11418c2ecf20Sopenharmony_ci				BCM281XX_PIN_MASK(STD, PULL_UP));
11428c2ecf20Sopenharmony_ci			bcm281xx_pin_update(val, mask, 0,
11438c2ecf20Sopenharmony_ci				BCM281XX_PIN_SHIFT(STD, PULL_DN),
11448c2ecf20Sopenharmony_ci				BCM281XX_PIN_MASK(STD, PULL_DN));
11458c2ecf20Sopenharmony_ci			break;
11468c2ecf20Sopenharmony_ci
11478c2ecf20Sopenharmony_ci		case PIN_CONFIG_BIAS_PULL_DOWN:
11488c2ecf20Sopenharmony_ci			bcm281xx_pin_update(val, mask, 0,
11498c2ecf20Sopenharmony_ci				BCM281XX_PIN_SHIFT(STD, PULL_UP),
11508c2ecf20Sopenharmony_ci				BCM281XX_PIN_MASK(STD, PULL_UP));
11518c2ecf20Sopenharmony_ci			bcm281xx_pin_update(val, mask, 1,
11528c2ecf20Sopenharmony_ci				BCM281XX_PIN_SHIFT(STD, PULL_DN),
11538c2ecf20Sopenharmony_ci				BCM281XX_PIN_MASK(STD, PULL_DN));
11548c2ecf20Sopenharmony_ci			break;
11558c2ecf20Sopenharmony_ci
11568c2ecf20Sopenharmony_ci		case PIN_CONFIG_SLEW_RATE:
11578c2ecf20Sopenharmony_ci			arg = (arg >= 1 ? 1 : 0);
11588c2ecf20Sopenharmony_ci			bcm281xx_pin_update(val, mask, arg,
11598c2ecf20Sopenharmony_ci				BCM281XX_PIN_SHIFT(STD, SLEW),
11608c2ecf20Sopenharmony_ci				BCM281XX_PIN_MASK(STD, SLEW));
11618c2ecf20Sopenharmony_ci			break;
11628c2ecf20Sopenharmony_ci
11638c2ecf20Sopenharmony_ci		case PIN_CONFIG_INPUT_ENABLE:
11648c2ecf20Sopenharmony_ci			/* inversed since register is for input _disable_ */
11658c2ecf20Sopenharmony_ci			arg = (arg >= 1 ? 0 : 1);
11668c2ecf20Sopenharmony_ci			bcm281xx_pin_update(val, mask, arg,
11678c2ecf20Sopenharmony_ci				BCM281XX_PIN_SHIFT(STD, INPUT_DIS),
11688c2ecf20Sopenharmony_ci				BCM281XX_PIN_MASK(STD, INPUT_DIS));
11698c2ecf20Sopenharmony_ci			break;
11708c2ecf20Sopenharmony_ci
11718c2ecf20Sopenharmony_ci		case PIN_CONFIG_DRIVE_STRENGTH:
11728c2ecf20Sopenharmony_ci			/* Valid range is 2-16 mA, even numbers only */
11738c2ecf20Sopenharmony_ci			if ((arg < 2) || (arg > 16) || (arg % 2)) {
11748c2ecf20Sopenharmony_ci				dev_err(pctldev->dev,
11758c2ecf20Sopenharmony_ci					"Invalid Drive Strength value (%d) for "
11768c2ecf20Sopenharmony_ci					"pin %s (%d). Valid values are "
11778c2ecf20Sopenharmony_ci					"(2..16) mA, even numbers only.\n",
11788c2ecf20Sopenharmony_ci					arg, pdata->pins[pin].name, pin);
11798c2ecf20Sopenharmony_ci				return -EINVAL;
11808c2ecf20Sopenharmony_ci			}
11818c2ecf20Sopenharmony_ci			bcm281xx_pin_update(val, mask, (arg/2)-1,
11828c2ecf20Sopenharmony_ci				BCM281XX_PIN_SHIFT(STD, DRV_STR),
11838c2ecf20Sopenharmony_ci				BCM281XX_PIN_MASK(STD, DRV_STR));
11848c2ecf20Sopenharmony_ci			break;
11858c2ecf20Sopenharmony_ci
11868c2ecf20Sopenharmony_ci		default:
11878c2ecf20Sopenharmony_ci			dev_err(pctldev->dev,
11888c2ecf20Sopenharmony_ci				"Unrecognized pin config %d for pin %s (%d).\n",
11898c2ecf20Sopenharmony_ci				param, pdata->pins[pin].name, pin);
11908c2ecf20Sopenharmony_ci			return -EINVAL;
11918c2ecf20Sopenharmony_ci
11928c2ecf20Sopenharmony_ci		} /* switch config */
11938c2ecf20Sopenharmony_ci	} /* for each config */
11948c2ecf20Sopenharmony_ci
11958c2ecf20Sopenharmony_ci	return 0;
11968c2ecf20Sopenharmony_ci}
11978c2ecf20Sopenharmony_ci
11988c2ecf20Sopenharmony_ci/*
11998c2ecf20Sopenharmony_ci * The pull-up strength for an I2C pin is represented by bits 4-6 in the
12008c2ecf20Sopenharmony_ci * register with the following mapping:
12018c2ecf20Sopenharmony_ci *   0b000: No pull-up
12028c2ecf20Sopenharmony_ci *   0b001: 1200 Ohm
12038c2ecf20Sopenharmony_ci *   0b010: 1800 Ohm
12048c2ecf20Sopenharmony_ci *   0b011: 720 Ohm
12058c2ecf20Sopenharmony_ci *   0b100: 2700 Ohm
12068c2ecf20Sopenharmony_ci *   0b101: 831 Ohm
12078c2ecf20Sopenharmony_ci *   0b110: 1080 Ohm
12088c2ecf20Sopenharmony_ci *   0b111: 568 Ohm
12098c2ecf20Sopenharmony_ci * This array maps pull-up strength in Ohms to register values (1+index).
12108c2ecf20Sopenharmony_ci */
12118c2ecf20Sopenharmony_cistatic const u16 bcm281xx_pullup_map[] = {
12128c2ecf20Sopenharmony_ci	1200, 1800, 720, 2700, 831, 1080, 568
12138c2ecf20Sopenharmony_ci};
12148c2ecf20Sopenharmony_ci
12158c2ecf20Sopenharmony_ci/* Goes through the configs and update register val/mask */
12168c2ecf20Sopenharmony_cistatic int bcm281xx_i2c_pin_update(struct pinctrl_dev *pctldev,
12178c2ecf20Sopenharmony_ci				   unsigned pin,
12188c2ecf20Sopenharmony_ci				   unsigned long *configs,
12198c2ecf20Sopenharmony_ci				   unsigned num_configs,
12208c2ecf20Sopenharmony_ci				   u32 *val,
12218c2ecf20Sopenharmony_ci				   u32 *mask)
12228c2ecf20Sopenharmony_ci{
12238c2ecf20Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
12248c2ecf20Sopenharmony_ci	int i, j;
12258c2ecf20Sopenharmony_ci	enum pin_config_param param;
12268c2ecf20Sopenharmony_ci	u32 arg;
12278c2ecf20Sopenharmony_ci
12288c2ecf20Sopenharmony_ci	for (i = 0; i < num_configs; i++) {
12298c2ecf20Sopenharmony_ci		param = pinconf_to_config_param(configs[i]);
12308c2ecf20Sopenharmony_ci		arg = pinconf_to_config_argument(configs[i]);
12318c2ecf20Sopenharmony_ci
12328c2ecf20Sopenharmony_ci		switch (param) {
12338c2ecf20Sopenharmony_ci		case PIN_CONFIG_BIAS_PULL_UP:
12348c2ecf20Sopenharmony_ci			for (j = 0; j < ARRAY_SIZE(bcm281xx_pullup_map); j++)
12358c2ecf20Sopenharmony_ci				if (bcm281xx_pullup_map[j] == arg)
12368c2ecf20Sopenharmony_ci					break;
12378c2ecf20Sopenharmony_ci
12388c2ecf20Sopenharmony_ci			if (j == ARRAY_SIZE(bcm281xx_pullup_map)) {
12398c2ecf20Sopenharmony_ci				dev_err(pctldev->dev,
12408c2ecf20Sopenharmony_ci					"Invalid pull-up value (%d) for pin %s "
12418c2ecf20Sopenharmony_ci					"(%d). Valid values are 568, 720, 831, "
12428c2ecf20Sopenharmony_ci					"1080, 1200, 1800, 2700 Ohms.\n",
12438c2ecf20Sopenharmony_ci					arg, pdata->pins[pin].name, pin);
12448c2ecf20Sopenharmony_ci				return -EINVAL;
12458c2ecf20Sopenharmony_ci			}
12468c2ecf20Sopenharmony_ci
12478c2ecf20Sopenharmony_ci			bcm281xx_pin_update(val, mask, j+1,
12488c2ecf20Sopenharmony_ci				BCM281XX_PIN_SHIFT(I2C, PULL_UP_STR),
12498c2ecf20Sopenharmony_ci				BCM281XX_PIN_MASK(I2C, PULL_UP_STR));
12508c2ecf20Sopenharmony_ci			break;
12518c2ecf20Sopenharmony_ci
12528c2ecf20Sopenharmony_ci		case PIN_CONFIG_BIAS_DISABLE:
12538c2ecf20Sopenharmony_ci			bcm281xx_pin_update(val, mask, 0,
12548c2ecf20Sopenharmony_ci				BCM281XX_PIN_SHIFT(I2C, PULL_UP_STR),
12558c2ecf20Sopenharmony_ci				BCM281XX_PIN_MASK(I2C, PULL_UP_STR));
12568c2ecf20Sopenharmony_ci			break;
12578c2ecf20Sopenharmony_ci
12588c2ecf20Sopenharmony_ci		case PIN_CONFIG_SLEW_RATE:
12598c2ecf20Sopenharmony_ci			arg = (arg >= 1 ? 1 : 0);
12608c2ecf20Sopenharmony_ci			bcm281xx_pin_update(val, mask, arg,
12618c2ecf20Sopenharmony_ci				BCM281XX_PIN_SHIFT(I2C, SLEW),
12628c2ecf20Sopenharmony_ci				BCM281XX_PIN_MASK(I2C, SLEW));
12638c2ecf20Sopenharmony_ci			break;
12648c2ecf20Sopenharmony_ci
12658c2ecf20Sopenharmony_ci		case PIN_CONFIG_INPUT_ENABLE:
12668c2ecf20Sopenharmony_ci			/* inversed since register is for input _disable_ */
12678c2ecf20Sopenharmony_ci			arg = (arg >= 1 ? 0 : 1);
12688c2ecf20Sopenharmony_ci			bcm281xx_pin_update(val, mask, arg,
12698c2ecf20Sopenharmony_ci				BCM281XX_PIN_SHIFT(I2C, INPUT_DIS),
12708c2ecf20Sopenharmony_ci				BCM281XX_PIN_MASK(I2C, INPUT_DIS));
12718c2ecf20Sopenharmony_ci			break;
12728c2ecf20Sopenharmony_ci
12738c2ecf20Sopenharmony_ci		default:
12748c2ecf20Sopenharmony_ci			dev_err(pctldev->dev,
12758c2ecf20Sopenharmony_ci				"Unrecognized pin config %d for pin %s (%d).\n",
12768c2ecf20Sopenharmony_ci				param, pdata->pins[pin].name, pin);
12778c2ecf20Sopenharmony_ci			return -EINVAL;
12788c2ecf20Sopenharmony_ci
12798c2ecf20Sopenharmony_ci		} /* switch config */
12808c2ecf20Sopenharmony_ci	} /* for each config */
12818c2ecf20Sopenharmony_ci
12828c2ecf20Sopenharmony_ci	return 0;
12838c2ecf20Sopenharmony_ci}
12848c2ecf20Sopenharmony_ci
12858c2ecf20Sopenharmony_ci/* Goes through the configs and update register val/mask */
12868c2ecf20Sopenharmony_cistatic int bcm281xx_hdmi_pin_update(struct pinctrl_dev *pctldev,
12878c2ecf20Sopenharmony_ci				    unsigned pin,
12888c2ecf20Sopenharmony_ci				    unsigned long *configs,
12898c2ecf20Sopenharmony_ci				    unsigned num_configs,
12908c2ecf20Sopenharmony_ci				    u32 *val,
12918c2ecf20Sopenharmony_ci				    u32 *mask)
12928c2ecf20Sopenharmony_ci{
12938c2ecf20Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
12948c2ecf20Sopenharmony_ci	int i;
12958c2ecf20Sopenharmony_ci	enum pin_config_param param;
12968c2ecf20Sopenharmony_ci	u32 arg;
12978c2ecf20Sopenharmony_ci
12988c2ecf20Sopenharmony_ci	for (i = 0; i < num_configs; i++) {
12998c2ecf20Sopenharmony_ci		param = pinconf_to_config_param(configs[i]);
13008c2ecf20Sopenharmony_ci		arg = pinconf_to_config_argument(configs[i]);
13018c2ecf20Sopenharmony_ci
13028c2ecf20Sopenharmony_ci		switch (param) {
13038c2ecf20Sopenharmony_ci		case PIN_CONFIG_SLEW_RATE:
13048c2ecf20Sopenharmony_ci			arg = (arg >= 1 ? 1 : 0);
13058c2ecf20Sopenharmony_ci			bcm281xx_pin_update(val, mask, arg,
13068c2ecf20Sopenharmony_ci				BCM281XX_PIN_SHIFT(HDMI, MODE),
13078c2ecf20Sopenharmony_ci				BCM281XX_PIN_MASK(HDMI, MODE));
13088c2ecf20Sopenharmony_ci			break;
13098c2ecf20Sopenharmony_ci
13108c2ecf20Sopenharmony_ci		case PIN_CONFIG_INPUT_ENABLE:
13118c2ecf20Sopenharmony_ci			/* inversed since register is for input _disable_ */
13128c2ecf20Sopenharmony_ci			arg = (arg >= 1 ? 0 : 1);
13138c2ecf20Sopenharmony_ci			bcm281xx_pin_update(val, mask, arg,
13148c2ecf20Sopenharmony_ci				BCM281XX_PIN_SHIFT(HDMI, INPUT_DIS),
13158c2ecf20Sopenharmony_ci				BCM281XX_PIN_MASK(HDMI, INPUT_DIS));
13168c2ecf20Sopenharmony_ci			break;
13178c2ecf20Sopenharmony_ci
13188c2ecf20Sopenharmony_ci		default:
13198c2ecf20Sopenharmony_ci			dev_err(pctldev->dev,
13208c2ecf20Sopenharmony_ci				"Unrecognized pin config %d for pin %s (%d).\n",
13218c2ecf20Sopenharmony_ci				param, pdata->pins[pin].name, pin);
13228c2ecf20Sopenharmony_ci			return -EINVAL;
13238c2ecf20Sopenharmony_ci
13248c2ecf20Sopenharmony_ci		} /* switch config */
13258c2ecf20Sopenharmony_ci	} /* for each config */
13268c2ecf20Sopenharmony_ci
13278c2ecf20Sopenharmony_ci	return 0;
13288c2ecf20Sopenharmony_ci}
13298c2ecf20Sopenharmony_ci
13308c2ecf20Sopenharmony_cistatic int bcm281xx_pinctrl_pin_config_set(struct pinctrl_dev *pctldev,
13318c2ecf20Sopenharmony_ci					   unsigned pin,
13328c2ecf20Sopenharmony_ci					   unsigned long *configs,
13338c2ecf20Sopenharmony_ci					   unsigned num_configs)
13348c2ecf20Sopenharmony_ci{
13358c2ecf20Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
13368c2ecf20Sopenharmony_ci	enum bcm281xx_pin_type pin_type;
13378c2ecf20Sopenharmony_ci	u32 offset = 4 * pin;
13388c2ecf20Sopenharmony_ci	u32 cfg_val, cfg_mask;
13398c2ecf20Sopenharmony_ci	int rc;
13408c2ecf20Sopenharmony_ci
13418c2ecf20Sopenharmony_ci	cfg_val = 0;
13428c2ecf20Sopenharmony_ci	cfg_mask = 0;
13438c2ecf20Sopenharmony_ci	pin_type = pin_type_get(pctldev, pin);
13448c2ecf20Sopenharmony_ci
13458c2ecf20Sopenharmony_ci	/* Different pins have different configuration options */
13468c2ecf20Sopenharmony_ci	switch (pin_type) {
13478c2ecf20Sopenharmony_ci	case BCM281XX_PIN_TYPE_STD:
13488c2ecf20Sopenharmony_ci		rc = bcm281xx_std_pin_update(pctldev, pin, configs,
13498c2ecf20Sopenharmony_ci			num_configs, &cfg_val, &cfg_mask);
13508c2ecf20Sopenharmony_ci		break;
13518c2ecf20Sopenharmony_ci
13528c2ecf20Sopenharmony_ci	case BCM281XX_PIN_TYPE_I2C:
13538c2ecf20Sopenharmony_ci		rc = bcm281xx_i2c_pin_update(pctldev, pin, configs,
13548c2ecf20Sopenharmony_ci			num_configs, &cfg_val, &cfg_mask);
13558c2ecf20Sopenharmony_ci		break;
13568c2ecf20Sopenharmony_ci
13578c2ecf20Sopenharmony_ci	case BCM281XX_PIN_TYPE_HDMI:
13588c2ecf20Sopenharmony_ci		rc = bcm281xx_hdmi_pin_update(pctldev, pin, configs,
13598c2ecf20Sopenharmony_ci			num_configs, &cfg_val, &cfg_mask);
13608c2ecf20Sopenharmony_ci		break;
13618c2ecf20Sopenharmony_ci
13628c2ecf20Sopenharmony_ci	default:
13638c2ecf20Sopenharmony_ci		dev_err(pctldev->dev, "Unknown pin type for pin %s (%d).\n",
13648c2ecf20Sopenharmony_ci			pdata->pins[pin].name, pin);
13658c2ecf20Sopenharmony_ci		return -EINVAL;
13668c2ecf20Sopenharmony_ci
13678c2ecf20Sopenharmony_ci	} /* switch pin type */
13688c2ecf20Sopenharmony_ci
13698c2ecf20Sopenharmony_ci	if (rc)
13708c2ecf20Sopenharmony_ci		return rc;
13718c2ecf20Sopenharmony_ci
13728c2ecf20Sopenharmony_ci	dev_dbg(pctldev->dev,
13738c2ecf20Sopenharmony_ci		"%s(): Set pin %s (%d) with config 0x%x, mask 0x%x\n",
13748c2ecf20Sopenharmony_ci		__func__, pdata->pins[pin].name, pin, cfg_val, cfg_mask);
13758c2ecf20Sopenharmony_ci
13768c2ecf20Sopenharmony_ci	rc = regmap_update_bits(pdata->regmap, offset, cfg_mask, cfg_val);
13778c2ecf20Sopenharmony_ci	if (rc) {
13788c2ecf20Sopenharmony_ci		dev_err(pctldev->dev,
13798c2ecf20Sopenharmony_ci			"Error updating register for pin %s (%d).\n",
13808c2ecf20Sopenharmony_ci			pdata->pins[pin].name, pin);
13818c2ecf20Sopenharmony_ci		return rc;
13828c2ecf20Sopenharmony_ci	}
13838c2ecf20Sopenharmony_ci
13848c2ecf20Sopenharmony_ci	return 0;
13858c2ecf20Sopenharmony_ci}
13868c2ecf20Sopenharmony_ci
13878c2ecf20Sopenharmony_cistatic const struct pinconf_ops bcm281xx_pinctrl_pinconf_ops = {
13888c2ecf20Sopenharmony_ci	.pin_config_get = bcm281xx_pinctrl_pin_config_get,
13898c2ecf20Sopenharmony_ci	.pin_config_set = bcm281xx_pinctrl_pin_config_set,
13908c2ecf20Sopenharmony_ci};
13918c2ecf20Sopenharmony_ci
13928c2ecf20Sopenharmony_cistatic struct pinctrl_desc bcm281xx_pinctrl_desc = {
13938c2ecf20Sopenharmony_ci	/* name, pins, npins members initialized in probe function */
13948c2ecf20Sopenharmony_ci	.pctlops = &bcm281xx_pinctrl_ops,
13958c2ecf20Sopenharmony_ci	.pmxops = &bcm281xx_pinctrl_pinmux_ops,
13968c2ecf20Sopenharmony_ci	.confops = &bcm281xx_pinctrl_pinconf_ops,
13978c2ecf20Sopenharmony_ci	.owner = THIS_MODULE,
13988c2ecf20Sopenharmony_ci};
13998c2ecf20Sopenharmony_ci
14008c2ecf20Sopenharmony_cistatic int __init bcm281xx_pinctrl_probe(struct platform_device *pdev)
14018c2ecf20Sopenharmony_ci{
14028c2ecf20Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = &bcm281xx_pinctrl;
14038c2ecf20Sopenharmony_ci	struct pinctrl_dev *pctl;
14048c2ecf20Sopenharmony_ci
14058c2ecf20Sopenharmony_ci	/* So far We can assume there is only 1 bank of registers */
14068c2ecf20Sopenharmony_ci	pdata->reg_base = devm_platform_ioremap_resource(pdev, 0);
14078c2ecf20Sopenharmony_ci	if (IS_ERR(pdata->reg_base)) {
14088c2ecf20Sopenharmony_ci		dev_err(&pdev->dev, "Failed to ioremap MEM resource\n");
14098c2ecf20Sopenharmony_ci		return PTR_ERR(pdata->reg_base);
14108c2ecf20Sopenharmony_ci	}
14118c2ecf20Sopenharmony_ci
14128c2ecf20Sopenharmony_ci	/* Initialize the dynamic part of pinctrl_desc */
14138c2ecf20Sopenharmony_ci	pdata->regmap = devm_regmap_init_mmio(&pdev->dev, pdata->reg_base,
14148c2ecf20Sopenharmony_ci		&bcm281xx_pinctrl_regmap_config);
14158c2ecf20Sopenharmony_ci	if (IS_ERR(pdata->regmap)) {
14168c2ecf20Sopenharmony_ci		dev_err(&pdev->dev, "Regmap MMIO init failed.\n");
14178c2ecf20Sopenharmony_ci		return -ENODEV;
14188c2ecf20Sopenharmony_ci	}
14198c2ecf20Sopenharmony_ci
14208c2ecf20Sopenharmony_ci	bcm281xx_pinctrl_desc.name = dev_name(&pdev->dev);
14218c2ecf20Sopenharmony_ci	bcm281xx_pinctrl_desc.pins = bcm281xx_pinctrl.pins;
14228c2ecf20Sopenharmony_ci	bcm281xx_pinctrl_desc.npins = bcm281xx_pinctrl.npins;
14238c2ecf20Sopenharmony_ci
14248c2ecf20Sopenharmony_ci	pctl = devm_pinctrl_register(&pdev->dev, &bcm281xx_pinctrl_desc, pdata);
14258c2ecf20Sopenharmony_ci	if (IS_ERR(pctl)) {
14268c2ecf20Sopenharmony_ci		dev_err(&pdev->dev, "Failed to register pinctrl\n");
14278c2ecf20Sopenharmony_ci		return PTR_ERR(pctl);
14288c2ecf20Sopenharmony_ci	}
14298c2ecf20Sopenharmony_ci
14308c2ecf20Sopenharmony_ci	platform_set_drvdata(pdev, pdata);
14318c2ecf20Sopenharmony_ci
14328c2ecf20Sopenharmony_ci	return 0;
14338c2ecf20Sopenharmony_ci}
14348c2ecf20Sopenharmony_ci
14358c2ecf20Sopenharmony_cistatic const struct of_device_id bcm281xx_pinctrl_of_match[] = {
14368c2ecf20Sopenharmony_ci	{ .compatible = "brcm,bcm11351-pinctrl", },
14378c2ecf20Sopenharmony_ci	{ },
14388c2ecf20Sopenharmony_ci};
14398c2ecf20Sopenharmony_ci
14408c2ecf20Sopenharmony_cistatic struct platform_driver bcm281xx_pinctrl_driver = {
14418c2ecf20Sopenharmony_ci	.driver = {
14428c2ecf20Sopenharmony_ci		.name = "bcm281xx-pinctrl",
14438c2ecf20Sopenharmony_ci		.of_match_table = bcm281xx_pinctrl_of_match,
14448c2ecf20Sopenharmony_ci	},
14458c2ecf20Sopenharmony_ci};
14468c2ecf20Sopenharmony_cibuiltin_platform_driver_probe(bcm281xx_pinctrl_driver, bcm281xx_pinctrl_probe);
1447