162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only
262306a36Sopenharmony_ci// Copyright (C) 2013-2017 Broadcom
362306a36Sopenharmony_ci
462306a36Sopenharmony_ci#include <linux/err.h>
562306a36Sopenharmony_ci#include <linux/init.h>
662306a36Sopenharmony_ci#include <linux/io.h>
762306a36Sopenharmony_ci#include <linux/of.h>
862306a36Sopenharmony_ci#include <linux/platform_device.h>
962306a36Sopenharmony_ci#include <linux/regmap.h>
1062306a36Sopenharmony_ci#include <linux/seq_file.h>
1162306a36Sopenharmony_ci#include <linux/slab.h>
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci#include <linux/pinctrl/pinconf-generic.h>
1462306a36Sopenharmony_ci#include <linux/pinctrl/pinconf.h>
1562306a36Sopenharmony_ci#include <linux/pinctrl/pinctrl.h>
1662306a36Sopenharmony_ci#include <linux/pinctrl/pinmux.h>
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci#include "../core.h"
1962306a36Sopenharmony_ci#include "../pinctrl-utils.h"
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci/* BCM281XX Pin Control Registers Definitions */
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci/* Function Select bits are the same for all pin control registers */
2462306a36Sopenharmony_ci#define BCM281XX_PIN_REG_F_SEL_MASK		0x0700
2562306a36Sopenharmony_ci#define BCM281XX_PIN_REG_F_SEL_SHIFT		8
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ci/* Standard pin register */
2862306a36Sopenharmony_ci#define BCM281XX_STD_PIN_REG_DRV_STR_MASK	0x0007
2962306a36Sopenharmony_ci#define BCM281XX_STD_PIN_REG_DRV_STR_SHIFT	0
3062306a36Sopenharmony_ci#define BCM281XX_STD_PIN_REG_INPUT_DIS_MASK	0x0008
3162306a36Sopenharmony_ci#define BCM281XX_STD_PIN_REG_INPUT_DIS_SHIFT	3
3262306a36Sopenharmony_ci#define BCM281XX_STD_PIN_REG_SLEW_MASK		0x0010
3362306a36Sopenharmony_ci#define BCM281XX_STD_PIN_REG_SLEW_SHIFT		4
3462306a36Sopenharmony_ci#define BCM281XX_STD_PIN_REG_PULL_UP_MASK	0x0020
3562306a36Sopenharmony_ci#define BCM281XX_STD_PIN_REG_PULL_UP_SHIFT	5
3662306a36Sopenharmony_ci#define BCM281XX_STD_PIN_REG_PULL_DN_MASK	0x0040
3762306a36Sopenharmony_ci#define BCM281XX_STD_PIN_REG_PULL_DN_SHIFT	6
3862306a36Sopenharmony_ci#define BCM281XX_STD_PIN_REG_HYST_MASK		0x0080
3962306a36Sopenharmony_ci#define BCM281XX_STD_PIN_REG_HYST_SHIFT		7
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci/* I2C pin register */
4262306a36Sopenharmony_ci#define BCM281XX_I2C_PIN_REG_INPUT_DIS_MASK	0x0004
4362306a36Sopenharmony_ci#define BCM281XX_I2C_PIN_REG_INPUT_DIS_SHIFT	2
4462306a36Sopenharmony_ci#define BCM281XX_I2C_PIN_REG_SLEW_MASK		0x0008
4562306a36Sopenharmony_ci#define BCM281XX_I2C_PIN_REG_SLEW_SHIFT		3
4662306a36Sopenharmony_ci#define BCM281XX_I2C_PIN_REG_PULL_UP_STR_MASK	0x0070
4762306a36Sopenharmony_ci#define BCM281XX_I2C_PIN_REG_PULL_UP_STR_SHIFT	4
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci/* HDMI pin register */
5062306a36Sopenharmony_ci#define BCM281XX_HDMI_PIN_REG_INPUT_DIS_MASK	0x0008
5162306a36Sopenharmony_ci#define BCM281XX_HDMI_PIN_REG_INPUT_DIS_SHIFT	3
5262306a36Sopenharmony_ci#define BCM281XX_HDMI_PIN_REG_MODE_MASK		0x0010
5362306a36Sopenharmony_ci#define BCM281XX_HDMI_PIN_REG_MODE_SHIFT	4
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ci/*
5662306a36Sopenharmony_ci * bcm281xx_pin_type - types of pin register
5762306a36Sopenharmony_ci */
5862306a36Sopenharmony_cienum bcm281xx_pin_type {
5962306a36Sopenharmony_ci	BCM281XX_PIN_TYPE_UNKNOWN = 0,
6062306a36Sopenharmony_ci	BCM281XX_PIN_TYPE_STD,
6162306a36Sopenharmony_ci	BCM281XX_PIN_TYPE_I2C,
6262306a36Sopenharmony_ci	BCM281XX_PIN_TYPE_HDMI,
6362306a36Sopenharmony_ci};
6462306a36Sopenharmony_ci
6562306a36Sopenharmony_cistatic enum bcm281xx_pin_type std_pin = BCM281XX_PIN_TYPE_STD;
6662306a36Sopenharmony_cistatic enum bcm281xx_pin_type i2c_pin = BCM281XX_PIN_TYPE_I2C;
6762306a36Sopenharmony_cistatic enum bcm281xx_pin_type hdmi_pin = BCM281XX_PIN_TYPE_HDMI;
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_ci/*
7062306a36Sopenharmony_ci * bcm281xx_pin_function- define pin function
7162306a36Sopenharmony_ci */
7262306a36Sopenharmony_cistruct bcm281xx_pin_function {
7362306a36Sopenharmony_ci	const char *name;
7462306a36Sopenharmony_ci	const char * const *groups;
7562306a36Sopenharmony_ci	const unsigned ngroups;
7662306a36Sopenharmony_ci};
7762306a36Sopenharmony_ci
7862306a36Sopenharmony_ci/*
7962306a36Sopenharmony_ci * bcm281xx_pinctrl_data - Broadcom-specific pinctrl data
8062306a36Sopenharmony_ci * @reg_base - base of pinctrl registers
8162306a36Sopenharmony_ci */
8262306a36Sopenharmony_cistruct bcm281xx_pinctrl_data {
8362306a36Sopenharmony_ci	void __iomem *reg_base;
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ci	/* List of all pins */
8662306a36Sopenharmony_ci	const struct pinctrl_pin_desc *pins;
8762306a36Sopenharmony_ci	const unsigned npins;
8862306a36Sopenharmony_ci
8962306a36Sopenharmony_ci	const struct bcm281xx_pin_function *functions;
9062306a36Sopenharmony_ci	const unsigned nfunctions;
9162306a36Sopenharmony_ci
9262306a36Sopenharmony_ci	struct regmap *regmap;
9362306a36Sopenharmony_ci};
9462306a36Sopenharmony_ci
9562306a36Sopenharmony_ci/*
9662306a36Sopenharmony_ci * Pin number definition.  The order here must be the same as defined in the
9762306a36Sopenharmony_ci * PADCTRLREG block in the RDB.
9862306a36Sopenharmony_ci */
9962306a36Sopenharmony_ci#define BCM281XX_PIN_ADCSYNC		0
10062306a36Sopenharmony_ci#define BCM281XX_PIN_BAT_RM		1
10162306a36Sopenharmony_ci#define BCM281XX_PIN_BSC1_SCL		2
10262306a36Sopenharmony_ci#define BCM281XX_PIN_BSC1_SDA		3
10362306a36Sopenharmony_ci#define BCM281XX_PIN_BSC2_SCL		4
10462306a36Sopenharmony_ci#define BCM281XX_PIN_BSC2_SDA		5
10562306a36Sopenharmony_ci#define BCM281XX_PIN_CLASSGPWR		6
10662306a36Sopenharmony_ci#define BCM281XX_PIN_CLK_CX8		7
10762306a36Sopenharmony_ci#define BCM281XX_PIN_CLKOUT_0		8
10862306a36Sopenharmony_ci#define BCM281XX_PIN_CLKOUT_1		9
10962306a36Sopenharmony_ci#define BCM281XX_PIN_CLKOUT_2		10
11062306a36Sopenharmony_ci#define BCM281XX_PIN_CLKOUT_3		11
11162306a36Sopenharmony_ci#define BCM281XX_PIN_CLKREQ_IN_0	12
11262306a36Sopenharmony_ci#define BCM281XX_PIN_CLKREQ_IN_1	13
11362306a36Sopenharmony_ci#define BCM281XX_PIN_CWS_SYS_REQ1	14
11462306a36Sopenharmony_ci#define BCM281XX_PIN_CWS_SYS_REQ2	15
11562306a36Sopenharmony_ci#define BCM281XX_PIN_CWS_SYS_REQ3	16
11662306a36Sopenharmony_ci#define BCM281XX_PIN_DIGMIC1_CLK	17
11762306a36Sopenharmony_ci#define BCM281XX_PIN_DIGMIC1_DQ		18
11862306a36Sopenharmony_ci#define BCM281XX_PIN_DIGMIC2_CLK	19
11962306a36Sopenharmony_ci#define BCM281XX_PIN_DIGMIC2_DQ		20
12062306a36Sopenharmony_ci#define BCM281XX_PIN_GPEN13		21
12162306a36Sopenharmony_ci#define BCM281XX_PIN_GPEN14		22
12262306a36Sopenharmony_ci#define BCM281XX_PIN_GPEN15		23
12362306a36Sopenharmony_ci#define BCM281XX_PIN_GPIO00		24
12462306a36Sopenharmony_ci#define BCM281XX_PIN_GPIO01		25
12562306a36Sopenharmony_ci#define BCM281XX_PIN_GPIO02		26
12662306a36Sopenharmony_ci#define BCM281XX_PIN_GPIO03		27
12762306a36Sopenharmony_ci#define BCM281XX_PIN_GPIO04		28
12862306a36Sopenharmony_ci#define BCM281XX_PIN_GPIO05		29
12962306a36Sopenharmony_ci#define BCM281XX_PIN_GPIO06		30
13062306a36Sopenharmony_ci#define BCM281XX_PIN_GPIO07		31
13162306a36Sopenharmony_ci#define BCM281XX_PIN_GPIO08		32
13262306a36Sopenharmony_ci#define BCM281XX_PIN_GPIO09		33
13362306a36Sopenharmony_ci#define BCM281XX_PIN_GPIO10		34
13462306a36Sopenharmony_ci#define BCM281XX_PIN_GPIO11		35
13562306a36Sopenharmony_ci#define BCM281XX_PIN_GPIO12		36
13662306a36Sopenharmony_ci#define BCM281XX_PIN_GPIO13		37
13762306a36Sopenharmony_ci#define BCM281XX_PIN_GPIO14		38
13862306a36Sopenharmony_ci#define BCM281XX_PIN_GPS_PABLANK	39
13962306a36Sopenharmony_ci#define BCM281XX_PIN_GPS_TMARK		40
14062306a36Sopenharmony_ci#define BCM281XX_PIN_HDMI_SCL		41
14162306a36Sopenharmony_ci#define BCM281XX_PIN_HDMI_SDA		42
14262306a36Sopenharmony_ci#define BCM281XX_PIN_IC_DM		43
14362306a36Sopenharmony_ci#define BCM281XX_PIN_IC_DP		44
14462306a36Sopenharmony_ci#define BCM281XX_PIN_KP_COL_IP_0	45
14562306a36Sopenharmony_ci#define BCM281XX_PIN_KP_COL_IP_1	46
14662306a36Sopenharmony_ci#define BCM281XX_PIN_KP_COL_IP_2	47
14762306a36Sopenharmony_ci#define BCM281XX_PIN_KP_COL_IP_3	48
14862306a36Sopenharmony_ci#define BCM281XX_PIN_KP_ROW_OP_0	49
14962306a36Sopenharmony_ci#define BCM281XX_PIN_KP_ROW_OP_1	50
15062306a36Sopenharmony_ci#define BCM281XX_PIN_KP_ROW_OP_2	51
15162306a36Sopenharmony_ci#define BCM281XX_PIN_KP_ROW_OP_3	52
15262306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_B_0		53
15362306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_B_1		54
15462306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_B_2		55
15562306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_B_3		56
15662306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_B_4		57
15762306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_B_5		58
15862306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_B_6		59
15962306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_B_7		60
16062306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_G_0		61
16162306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_G_1		62
16262306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_G_2		63
16362306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_G_3		64
16462306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_G_4		65
16562306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_G_5		66
16662306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_G_6		67
16762306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_G_7		68
16862306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_HSYNC		69
16962306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_OE		70
17062306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_PCLK		71
17162306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_R_0		72
17262306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_R_1		73
17362306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_R_2		74
17462306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_R_3		75
17562306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_R_4		76
17662306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_R_5		77
17762306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_R_6		78
17862306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_R_7		79
17962306a36Sopenharmony_ci#define BCM281XX_PIN_LCD_VSYNC		80
18062306a36Sopenharmony_ci#define BCM281XX_PIN_MDMGPIO0		81
18162306a36Sopenharmony_ci#define BCM281XX_PIN_MDMGPIO1		82
18262306a36Sopenharmony_ci#define BCM281XX_PIN_MDMGPIO2		83
18362306a36Sopenharmony_ci#define BCM281XX_PIN_MDMGPIO3		84
18462306a36Sopenharmony_ci#define BCM281XX_PIN_MDMGPIO4		85
18562306a36Sopenharmony_ci#define BCM281XX_PIN_MDMGPIO5		86
18662306a36Sopenharmony_ci#define BCM281XX_PIN_MDMGPIO6		87
18762306a36Sopenharmony_ci#define BCM281XX_PIN_MDMGPIO7		88
18862306a36Sopenharmony_ci#define BCM281XX_PIN_MDMGPIO8		89
18962306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_0	90
19062306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_1	91
19162306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_2	92
19262306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_3	93
19362306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_4	94
19462306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_5	95
19562306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_6	96
19662306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_7	97
19762306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_8	98
19862306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_9	99
19962306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_10	100
20062306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_11	101
20162306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_12	102
20262306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_13	103
20362306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_14	104
20462306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_DATA_15	105
20562306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_HA0		106
20662306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_HAT0		107
20762306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_HAT1		108
20862306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_HCE0_N	109
20962306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_HCE1_N	110
21062306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_HRD_N		111
21162306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_HWR_N		112
21262306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_RUN0		113
21362306a36Sopenharmony_ci#define BCM281XX_PIN_MPHI_RUN1		114
21462306a36Sopenharmony_ci#define BCM281XX_PIN_MTX_SCAN_CLK	115
21562306a36Sopenharmony_ci#define BCM281XX_PIN_MTX_SCAN_DATA	116
21662306a36Sopenharmony_ci#define BCM281XX_PIN_NAND_AD_0		117
21762306a36Sopenharmony_ci#define BCM281XX_PIN_NAND_AD_1		118
21862306a36Sopenharmony_ci#define BCM281XX_PIN_NAND_AD_2		119
21962306a36Sopenharmony_ci#define BCM281XX_PIN_NAND_AD_3		120
22062306a36Sopenharmony_ci#define BCM281XX_PIN_NAND_AD_4		121
22162306a36Sopenharmony_ci#define BCM281XX_PIN_NAND_AD_5		122
22262306a36Sopenharmony_ci#define BCM281XX_PIN_NAND_AD_6		123
22362306a36Sopenharmony_ci#define BCM281XX_PIN_NAND_AD_7		124
22462306a36Sopenharmony_ci#define BCM281XX_PIN_NAND_ALE		125
22562306a36Sopenharmony_ci#define BCM281XX_PIN_NAND_CEN_0		126
22662306a36Sopenharmony_ci#define BCM281XX_PIN_NAND_CEN_1		127
22762306a36Sopenharmony_ci#define BCM281XX_PIN_NAND_CLE		128
22862306a36Sopenharmony_ci#define BCM281XX_PIN_NAND_OEN		129
22962306a36Sopenharmony_ci#define BCM281XX_PIN_NAND_RDY_0		130
23062306a36Sopenharmony_ci#define BCM281XX_PIN_NAND_RDY_1		131
23162306a36Sopenharmony_ci#define BCM281XX_PIN_NAND_WEN		132
23262306a36Sopenharmony_ci#define BCM281XX_PIN_NAND_WP		133
23362306a36Sopenharmony_ci#define BCM281XX_PIN_PC1		134
23462306a36Sopenharmony_ci#define BCM281XX_PIN_PC2		135
23562306a36Sopenharmony_ci#define BCM281XX_PIN_PMU_INT		136
23662306a36Sopenharmony_ci#define BCM281XX_PIN_PMU_SCL		137
23762306a36Sopenharmony_ci#define BCM281XX_PIN_PMU_SDA		138
23862306a36Sopenharmony_ci#define BCM281XX_PIN_RFST2G_MTSLOTEN3G	139
23962306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_RX_CTL	140
24062306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_RXC	141
24162306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_RXD_0	142
24262306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_RXD_1	143
24362306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_RXD_2	144
24462306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_RXD_3	145
24562306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_TX_CTL	146
24662306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_TXC	147
24762306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_TXD_0	148
24862306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_TXD_1	149
24962306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_TXD_2	150
25062306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_0_TXD_3	151
25162306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_RX_CTL	152
25262306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_RXC	153
25362306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_RXD_0	154
25462306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_RXD_1	155
25562306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_RXD_2	156
25662306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_RXD_3	157
25762306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_TX_CTL	158
25862306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_TXC	159
25962306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_TXD_0	160
26062306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_TXD_1	161
26162306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_TXD_2	162
26262306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_1_TXD_3	163
26362306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_GPIO_0	164
26462306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_GPIO_1	165
26562306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_GPIO_2	166
26662306a36Sopenharmony_ci#define BCM281XX_PIN_RGMII_GPIO_3	167
26762306a36Sopenharmony_ci#define BCM281XX_PIN_RTXDATA2G_TXDATA3G1	168
26862306a36Sopenharmony_ci#define BCM281XX_PIN_RTXEN2G_TXDATA3G2	169
26962306a36Sopenharmony_ci#define BCM281XX_PIN_RXDATA3G0		170
27062306a36Sopenharmony_ci#define BCM281XX_PIN_RXDATA3G1		171
27162306a36Sopenharmony_ci#define BCM281XX_PIN_RXDATA3G2		172
27262306a36Sopenharmony_ci#define BCM281XX_PIN_SDIO1_CLK		173
27362306a36Sopenharmony_ci#define BCM281XX_PIN_SDIO1_CMD		174
27462306a36Sopenharmony_ci#define BCM281XX_PIN_SDIO1_DATA_0	175
27562306a36Sopenharmony_ci#define BCM281XX_PIN_SDIO1_DATA_1	176
27662306a36Sopenharmony_ci#define BCM281XX_PIN_SDIO1_DATA_2	177
27762306a36Sopenharmony_ci#define BCM281XX_PIN_SDIO1_DATA_3	178
27862306a36Sopenharmony_ci#define BCM281XX_PIN_SDIO4_CLK		179
27962306a36Sopenharmony_ci#define BCM281XX_PIN_SDIO4_CMD		180
28062306a36Sopenharmony_ci#define BCM281XX_PIN_SDIO4_DATA_0	181
28162306a36Sopenharmony_ci#define BCM281XX_PIN_SDIO4_DATA_1	182
28262306a36Sopenharmony_ci#define BCM281XX_PIN_SDIO4_DATA_2	183
28362306a36Sopenharmony_ci#define BCM281XX_PIN_SDIO4_DATA_3	184
28462306a36Sopenharmony_ci#define BCM281XX_PIN_SIM_CLK		185
28562306a36Sopenharmony_ci#define BCM281XX_PIN_SIM_DATA		186
28662306a36Sopenharmony_ci#define BCM281XX_PIN_SIM_DET		187
28762306a36Sopenharmony_ci#define BCM281XX_PIN_SIM_RESETN		188
28862306a36Sopenharmony_ci#define BCM281XX_PIN_SIM2_CLK		189
28962306a36Sopenharmony_ci#define BCM281XX_PIN_SIM2_DATA		190
29062306a36Sopenharmony_ci#define BCM281XX_PIN_SIM2_DET		191
29162306a36Sopenharmony_ci#define BCM281XX_PIN_SIM2_RESETN	192
29262306a36Sopenharmony_ci#define BCM281XX_PIN_SRI_C		193
29362306a36Sopenharmony_ci#define BCM281XX_PIN_SRI_D		194
29462306a36Sopenharmony_ci#define BCM281XX_PIN_SRI_E		195
29562306a36Sopenharmony_ci#define BCM281XX_PIN_SSP_EXTCLK		196
29662306a36Sopenharmony_ci#define BCM281XX_PIN_SSP0_CLK		197
29762306a36Sopenharmony_ci#define BCM281XX_PIN_SSP0_FS		198
29862306a36Sopenharmony_ci#define BCM281XX_PIN_SSP0_RXD		199
29962306a36Sopenharmony_ci#define BCM281XX_PIN_SSP0_TXD		200
30062306a36Sopenharmony_ci#define BCM281XX_PIN_SSP2_CLK		201
30162306a36Sopenharmony_ci#define BCM281XX_PIN_SSP2_FS_0		202
30262306a36Sopenharmony_ci#define BCM281XX_PIN_SSP2_FS_1		203
30362306a36Sopenharmony_ci#define BCM281XX_PIN_SSP2_FS_2		204
30462306a36Sopenharmony_ci#define BCM281XX_PIN_SSP2_FS_3		205
30562306a36Sopenharmony_ci#define BCM281XX_PIN_SSP2_RXD_0		206
30662306a36Sopenharmony_ci#define BCM281XX_PIN_SSP2_RXD_1		207
30762306a36Sopenharmony_ci#define BCM281XX_PIN_SSP2_TXD_0		208
30862306a36Sopenharmony_ci#define BCM281XX_PIN_SSP2_TXD_1		209
30962306a36Sopenharmony_ci#define BCM281XX_PIN_SSP3_CLK		210
31062306a36Sopenharmony_ci#define BCM281XX_PIN_SSP3_FS		211
31162306a36Sopenharmony_ci#define BCM281XX_PIN_SSP3_RXD		212
31262306a36Sopenharmony_ci#define BCM281XX_PIN_SSP3_TXD		213
31362306a36Sopenharmony_ci#define BCM281XX_PIN_SSP4_CLK		214
31462306a36Sopenharmony_ci#define BCM281XX_PIN_SSP4_FS		215
31562306a36Sopenharmony_ci#define BCM281XX_PIN_SSP4_RXD		216
31662306a36Sopenharmony_ci#define BCM281XX_PIN_SSP4_TXD		217
31762306a36Sopenharmony_ci#define BCM281XX_PIN_SSP5_CLK		218
31862306a36Sopenharmony_ci#define BCM281XX_PIN_SSP5_FS		219
31962306a36Sopenharmony_ci#define BCM281XX_PIN_SSP5_RXD		220
32062306a36Sopenharmony_ci#define BCM281XX_PIN_SSP5_TXD		221
32162306a36Sopenharmony_ci#define BCM281XX_PIN_SSP6_CLK		222
32262306a36Sopenharmony_ci#define BCM281XX_PIN_SSP6_FS		223
32362306a36Sopenharmony_ci#define BCM281XX_PIN_SSP6_RXD		224
32462306a36Sopenharmony_ci#define BCM281XX_PIN_SSP6_TXD		225
32562306a36Sopenharmony_ci#define BCM281XX_PIN_STAT_1		226
32662306a36Sopenharmony_ci#define BCM281XX_PIN_STAT_2		227
32762306a36Sopenharmony_ci#define BCM281XX_PIN_SYSCLKEN		228
32862306a36Sopenharmony_ci#define BCM281XX_PIN_TRACECLK		229
32962306a36Sopenharmony_ci#define BCM281XX_PIN_TRACEDT00		230
33062306a36Sopenharmony_ci#define BCM281XX_PIN_TRACEDT01		231
33162306a36Sopenharmony_ci#define BCM281XX_PIN_TRACEDT02		232
33262306a36Sopenharmony_ci#define BCM281XX_PIN_TRACEDT03		233
33362306a36Sopenharmony_ci#define BCM281XX_PIN_TRACEDT04		234
33462306a36Sopenharmony_ci#define BCM281XX_PIN_TRACEDT05		235
33562306a36Sopenharmony_ci#define BCM281XX_PIN_TRACEDT06		236
33662306a36Sopenharmony_ci#define BCM281XX_PIN_TRACEDT07		237
33762306a36Sopenharmony_ci#define BCM281XX_PIN_TRACEDT08		238
33862306a36Sopenharmony_ci#define BCM281XX_PIN_TRACEDT09		239
33962306a36Sopenharmony_ci#define BCM281XX_PIN_TRACEDT10		240
34062306a36Sopenharmony_ci#define BCM281XX_PIN_TRACEDT11		241
34162306a36Sopenharmony_ci#define BCM281XX_PIN_TRACEDT12		242
34262306a36Sopenharmony_ci#define BCM281XX_PIN_TRACEDT13		243
34362306a36Sopenharmony_ci#define BCM281XX_PIN_TRACEDT14		244
34462306a36Sopenharmony_ci#define BCM281XX_PIN_TRACEDT15		245
34562306a36Sopenharmony_ci#define BCM281XX_PIN_TXDATA3G0		246
34662306a36Sopenharmony_ci#define BCM281XX_PIN_TXPWRIND		247
34762306a36Sopenharmony_ci#define BCM281XX_PIN_UARTB1_UCTS	248
34862306a36Sopenharmony_ci#define BCM281XX_PIN_UARTB1_URTS	249
34962306a36Sopenharmony_ci#define BCM281XX_PIN_UARTB1_URXD	250
35062306a36Sopenharmony_ci#define BCM281XX_PIN_UARTB1_UTXD	251
35162306a36Sopenharmony_ci#define BCM281XX_PIN_UARTB2_URXD	252
35262306a36Sopenharmony_ci#define BCM281XX_PIN_UARTB2_UTXD	253
35362306a36Sopenharmony_ci#define BCM281XX_PIN_UARTB3_UCTS	254
35462306a36Sopenharmony_ci#define BCM281XX_PIN_UARTB3_URTS	255
35562306a36Sopenharmony_ci#define BCM281XX_PIN_UARTB3_URXD	256
35662306a36Sopenharmony_ci#define BCM281XX_PIN_UARTB3_UTXD	257
35762306a36Sopenharmony_ci#define BCM281XX_PIN_UARTB4_UCTS	258
35862306a36Sopenharmony_ci#define BCM281XX_PIN_UARTB4_URTS	259
35962306a36Sopenharmony_ci#define BCM281XX_PIN_UARTB4_URXD	260
36062306a36Sopenharmony_ci#define BCM281XX_PIN_UARTB4_UTXD	261
36162306a36Sopenharmony_ci#define BCM281XX_PIN_VC_CAM1_SCL	262
36262306a36Sopenharmony_ci#define BCM281XX_PIN_VC_CAM1_SDA	263
36362306a36Sopenharmony_ci#define BCM281XX_PIN_VC_CAM2_SCL	264
36462306a36Sopenharmony_ci#define BCM281XX_PIN_VC_CAM2_SDA	265
36562306a36Sopenharmony_ci#define BCM281XX_PIN_VC_CAM3_SCL	266
36662306a36Sopenharmony_ci#define BCM281XX_PIN_VC_CAM3_SDA	267
36762306a36Sopenharmony_ci
36862306a36Sopenharmony_ci#define BCM281XX_PIN_DESC(a, b, c) \
36962306a36Sopenharmony_ci	{ .number = a, .name = b, .drv_data = &c##_pin }
37062306a36Sopenharmony_ci
37162306a36Sopenharmony_ci/*
37262306a36Sopenharmony_ci * Pin description definition.  The order here must be the same as defined in
37362306a36Sopenharmony_ci * the PADCTRLREG block in the RDB, since the pin number is used as an index
37462306a36Sopenharmony_ci * into this array.
37562306a36Sopenharmony_ci */
37662306a36Sopenharmony_cistatic const struct pinctrl_pin_desc bcm281xx_pinctrl_pins[] = {
37762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_ADCSYNC, "adcsync", std),
37862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_BAT_RM, "bat_rm", std),
37962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_BSC1_SCL, "bsc1_scl", i2c),
38062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_BSC1_SDA, "bsc1_sda", i2c),
38162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_BSC2_SCL, "bsc2_scl", i2c),
38262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_BSC2_SDA, "bsc2_sda", i2c),
38362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_CLASSGPWR, "classgpwr", std),
38462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_CLK_CX8, "clk_cx8", std),
38562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_CLKOUT_0, "clkout_0", std),
38662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_CLKOUT_1, "clkout_1", std),
38762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_CLKOUT_2, "clkout_2", std),
38862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_CLKOUT_3, "clkout_3", std),
38962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_CLKREQ_IN_0, "clkreq_in_0", std),
39062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_CLKREQ_IN_1, "clkreq_in_1", std),
39162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_CWS_SYS_REQ1, "cws_sys_req1", std),
39262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_CWS_SYS_REQ2, "cws_sys_req2", std),
39362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_CWS_SYS_REQ3, "cws_sys_req3", std),
39462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_DIGMIC1_CLK, "digmic1_clk", std),
39562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_DIGMIC1_DQ, "digmic1_dq", std),
39662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_DIGMIC2_CLK, "digmic2_clk", std),
39762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_DIGMIC2_DQ, "digmic2_dq", std),
39862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPEN13, "gpen13", std),
39962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPEN14, "gpen14", std),
40062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPEN15, "gpen15", std),
40162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO00, "gpio00", std),
40262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO01, "gpio01", std),
40362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO02, "gpio02", std),
40462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO03, "gpio03", std),
40562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO04, "gpio04", std),
40662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO05, "gpio05", std),
40762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO06, "gpio06", std),
40862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO07, "gpio07", std),
40962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO08, "gpio08", std),
41062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO09, "gpio09", std),
41162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO10, "gpio10", std),
41262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO11, "gpio11", std),
41362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO12, "gpio12", std),
41462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO13, "gpio13", std),
41562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPIO14, "gpio14", std),
41662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPS_PABLANK, "gps_pablank", std),
41762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_GPS_TMARK, "gps_tmark", std),
41862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_HDMI_SCL, "hdmi_scl", hdmi),
41962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_HDMI_SDA, "hdmi_sda", hdmi),
42062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_IC_DM, "ic_dm", std),
42162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_IC_DP, "ic_dp", std),
42262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_KP_COL_IP_0, "kp_col_ip_0", std),
42362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_KP_COL_IP_1, "kp_col_ip_1", std),
42462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_KP_COL_IP_2, "kp_col_ip_2", std),
42562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_KP_COL_IP_3, "kp_col_ip_3", std),
42662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_KP_ROW_OP_0, "kp_row_op_0", std),
42762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_KP_ROW_OP_1, "kp_row_op_1", std),
42862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_KP_ROW_OP_2, "kp_row_op_2", std),
42962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_KP_ROW_OP_3, "kp_row_op_3", std),
43062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_B_0, "lcd_b_0", std),
43162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_B_1, "lcd_b_1", std),
43262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_B_2, "lcd_b_2", std),
43362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_B_3, "lcd_b_3", std),
43462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_B_4, "lcd_b_4", std),
43562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_B_5, "lcd_b_5", std),
43662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_B_6, "lcd_b_6", std),
43762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_B_7, "lcd_b_7", std),
43862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_G_0, "lcd_g_0", std),
43962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_G_1, "lcd_g_1", std),
44062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_G_2, "lcd_g_2", std),
44162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_G_3, "lcd_g_3", std),
44262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_G_4, "lcd_g_4", std),
44362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_G_5, "lcd_g_5", std),
44462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_G_6, "lcd_g_6", std),
44562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_G_7, "lcd_g_7", std),
44662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_HSYNC, "lcd_hsync", std),
44762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_OE, "lcd_oe", std),
44862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_PCLK, "lcd_pclk", std),
44962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_R_0, "lcd_r_0", std),
45062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_R_1, "lcd_r_1", std),
45162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_R_2, "lcd_r_2", std),
45262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_R_3, "lcd_r_3", std),
45362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_R_4, "lcd_r_4", std),
45462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_R_5, "lcd_r_5", std),
45562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_R_6, "lcd_r_6", std),
45662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_R_7, "lcd_r_7", std),
45762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_LCD_VSYNC, "lcd_vsync", std),
45862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MDMGPIO0, "mdmgpio0", std),
45962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MDMGPIO1, "mdmgpio1", std),
46062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MDMGPIO2, "mdmgpio2", std),
46162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MDMGPIO3, "mdmgpio3", std),
46262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MDMGPIO4, "mdmgpio4", std),
46362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MDMGPIO5, "mdmgpio5", std),
46462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MDMGPIO6, "mdmgpio6", std),
46562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MDMGPIO7, "mdmgpio7", std),
46662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MDMGPIO8, "mdmgpio8", std),
46762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_0, "mphi_data_0", std),
46862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_1, "mphi_data_1", std),
46962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_2, "mphi_data_2", std),
47062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_3, "mphi_data_3", std),
47162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_4, "mphi_data_4", std),
47262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_5, "mphi_data_5", std),
47362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_6, "mphi_data_6", std),
47462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_7, "mphi_data_7", std),
47562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_8, "mphi_data_8", std),
47662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_9, "mphi_data_9", std),
47762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_10, "mphi_data_10", std),
47862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_11, "mphi_data_11", std),
47962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_12, "mphi_data_12", std),
48062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_13, "mphi_data_13", std),
48162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_14, "mphi_data_14", std),
48262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_DATA_15, "mphi_data_15", std),
48362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_HA0, "mphi_ha0", std),
48462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_HAT0, "mphi_hat0", std),
48562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_HAT1, "mphi_hat1", std),
48662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_HCE0_N, "mphi_hce0_n", std),
48762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_HCE1_N, "mphi_hce1_n", std),
48862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_HRD_N, "mphi_hrd_n", std),
48962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_HWR_N, "mphi_hwr_n", std),
49062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_RUN0, "mphi_run0", std),
49162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MPHI_RUN1, "mphi_run1", std),
49262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MTX_SCAN_CLK, "mtx_scan_clk", std),
49362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_MTX_SCAN_DATA, "mtx_scan_data", std),
49462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_AD_0, "nand_ad_0", std),
49562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_AD_1, "nand_ad_1", std),
49662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_AD_2, "nand_ad_2", std),
49762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_AD_3, "nand_ad_3", std),
49862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_AD_4, "nand_ad_4", std),
49962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_AD_5, "nand_ad_5", std),
50062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_AD_6, "nand_ad_6", std),
50162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_AD_7, "nand_ad_7", std),
50262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_ALE, "nand_ale", std),
50362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_CEN_0, "nand_cen_0", std),
50462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_CEN_1, "nand_cen_1", std),
50562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_CLE, "nand_cle", std),
50662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_OEN, "nand_oen", std),
50762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_RDY_0, "nand_rdy_0", std),
50862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_RDY_1, "nand_rdy_1", std),
50962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_WEN, "nand_wen", std),
51062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_NAND_WP, "nand_wp", std),
51162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_PC1, "pc1", std),
51262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_PC2, "pc2", std),
51362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_PMU_INT, "pmu_int", std),
51462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_PMU_SCL, "pmu_scl", i2c),
51562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_PMU_SDA, "pmu_sda", i2c),
51662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RFST2G_MTSLOTEN3G, "rfst2g_mtsloten3g",
51762306a36Sopenharmony_ci		std),
51862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_RX_CTL, "rgmii_0_rx_ctl", std),
51962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_RXC, "rgmii_0_rxc", std),
52062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_RXD_0, "rgmii_0_rxd_0", std),
52162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_RXD_1, "rgmii_0_rxd_1", std),
52262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_RXD_2, "rgmii_0_rxd_2", std),
52362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_RXD_3, "rgmii_0_rxd_3", std),
52462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_TX_CTL, "rgmii_0_tx_ctl", std),
52562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_TXC, "rgmii_0_txc", std),
52662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_TXD_0, "rgmii_0_txd_0", std),
52762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_TXD_1, "rgmii_0_txd_1", std),
52862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_TXD_2, "rgmii_0_txd_2", std),
52962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_0_TXD_3, "rgmii_0_txd_3", std),
53062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_RX_CTL, "rgmii_1_rx_ctl", std),
53162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_RXC, "rgmii_1_rxc", std),
53262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_RXD_0, "rgmii_1_rxd_0", std),
53362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_RXD_1, "rgmii_1_rxd_1", std),
53462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_RXD_2, "rgmii_1_rxd_2", std),
53562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_RXD_3, "rgmii_1_rxd_3", std),
53662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_TX_CTL, "rgmii_1_tx_ctl", std),
53762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_TXC, "rgmii_1_txc", std),
53862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_TXD_0, "rgmii_1_txd_0", std),
53962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_TXD_1, "rgmii_1_txd_1", std),
54062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_TXD_2, "rgmii_1_txd_2", std),
54162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_1_TXD_3, "rgmii_1_txd_3", std),
54262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_GPIO_0, "rgmii_gpio_0", std),
54362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_GPIO_1, "rgmii_gpio_1", std),
54462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_GPIO_2, "rgmii_gpio_2", std),
54562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RGMII_GPIO_3, "rgmii_gpio_3", std),
54662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RTXDATA2G_TXDATA3G1,
54762306a36Sopenharmony_ci		"rtxdata2g_txdata3g1", std),
54862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RTXEN2G_TXDATA3G2, "rtxen2g_txdata3g2",
54962306a36Sopenharmony_ci		std),
55062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RXDATA3G0, "rxdata3g0", std),
55162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RXDATA3G1, "rxdata3g1", std),
55262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_RXDATA3G2, "rxdata3g2", std),
55362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO1_CLK, "sdio1_clk", std),
55462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO1_CMD, "sdio1_cmd", std),
55562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO1_DATA_0, "sdio1_data_0", std),
55662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO1_DATA_1, "sdio1_data_1", std),
55762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO1_DATA_2, "sdio1_data_2", std),
55862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO1_DATA_3, "sdio1_data_3", std),
55962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO4_CLK, "sdio4_clk", std),
56062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO4_CMD, "sdio4_cmd", std),
56162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO4_DATA_0, "sdio4_data_0", std),
56262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO4_DATA_1, "sdio4_data_1", std),
56362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO4_DATA_2, "sdio4_data_2", std),
56462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SDIO4_DATA_3, "sdio4_data_3", std),
56562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SIM_CLK, "sim_clk", std),
56662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SIM_DATA, "sim_data", std),
56762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SIM_DET, "sim_det", std),
56862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SIM_RESETN, "sim_resetn", std),
56962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SIM2_CLK, "sim2_clk", std),
57062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SIM2_DATA, "sim2_data", std),
57162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SIM2_DET, "sim2_det", std),
57262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SIM2_RESETN, "sim2_resetn", std),
57362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SRI_C, "sri_c", std),
57462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SRI_D, "sri_d", std),
57562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SRI_E, "sri_e", std),
57662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP_EXTCLK, "ssp_extclk", std),
57762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP0_CLK, "ssp0_clk", std),
57862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP0_FS, "ssp0_fs", std),
57962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP0_RXD, "ssp0_rxd", std),
58062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP0_TXD, "ssp0_txd", std),
58162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP2_CLK, "ssp2_clk", std),
58262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP2_FS_0, "ssp2_fs_0", std),
58362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP2_FS_1, "ssp2_fs_1", std),
58462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP2_FS_2, "ssp2_fs_2", std),
58562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP2_FS_3, "ssp2_fs_3", std),
58662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP2_RXD_0, "ssp2_rxd_0", std),
58762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP2_RXD_1, "ssp2_rxd_1", std),
58862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP2_TXD_0, "ssp2_txd_0", std),
58962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP2_TXD_1, "ssp2_txd_1", std),
59062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP3_CLK, "ssp3_clk", std),
59162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP3_FS, "ssp3_fs", std),
59262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP3_RXD, "ssp3_rxd", std),
59362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP3_TXD, "ssp3_txd", std),
59462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP4_CLK, "ssp4_clk", std),
59562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP4_FS, "ssp4_fs", std),
59662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP4_RXD, "ssp4_rxd", std),
59762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP4_TXD, "ssp4_txd", std),
59862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP5_CLK, "ssp5_clk", std),
59962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP5_FS, "ssp5_fs", std),
60062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP5_RXD, "ssp5_rxd", std),
60162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP5_TXD, "ssp5_txd", std),
60262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP6_CLK, "ssp6_clk", std),
60362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP6_FS, "ssp6_fs", std),
60462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP6_RXD, "ssp6_rxd", std),
60562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SSP6_TXD, "ssp6_txd", std),
60662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_STAT_1, "stat_1", std),
60762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_STAT_2, "stat_2", std),
60862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_SYSCLKEN, "sysclken", std),
60962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACECLK, "traceclk", std),
61062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT00, "tracedt00", std),
61162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT01, "tracedt01", std),
61262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT02, "tracedt02", std),
61362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT03, "tracedt03", std),
61462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT04, "tracedt04", std),
61562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT05, "tracedt05", std),
61662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT06, "tracedt06", std),
61762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT07, "tracedt07", std),
61862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT08, "tracedt08", std),
61962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT09, "tracedt09", std),
62062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT10, "tracedt10", std),
62162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT11, "tracedt11", std),
62262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT12, "tracedt12", std),
62362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT13, "tracedt13", std),
62462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT14, "tracedt14", std),
62562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TRACEDT15, "tracedt15", std),
62662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TXDATA3G0, "txdata3g0", std),
62762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_TXPWRIND, "txpwrind", std),
62862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB1_UCTS, "uartb1_ucts", std),
62962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB1_URTS, "uartb1_urts", std),
63062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB1_URXD, "uartb1_urxd", std),
63162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB1_UTXD, "uartb1_utxd", std),
63262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB2_URXD, "uartb2_urxd", std),
63362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB2_UTXD, "uartb2_utxd", std),
63462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB3_UCTS, "uartb3_ucts", std),
63562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB3_URTS, "uartb3_urts", std),
63662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB3_URXD, "uartb3_urxd", std),
63762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB3_UTXD, "uartb3_utxd", std),
63862306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB4_UCTS, "uartb4_ucts", std),
63962306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB4_URTS, "uartb4_urts", std),
64062306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB4_URXD, "uartb4_urxd", std),
64162306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_UARTB4_UTXD, "uartb4_utxd", std),
64262306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_VC_CAM1_SCL, "vc_cam1_scl", i2c),
64362306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_VC_CAM1_SDA, "vc_cam1_sda", i2c),
64462306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_VC_CAM2_SCL, "vc_cam2_scl", i2c),
64562306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_VC_CAM2_SDA, "vc_cam2_sda", i2c),
64662306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_VC_CAM3_SCL, "vc_cam3_scl", i2c),
64762306a36Sopenharmony_ci	BCM281XX_PIN_DESC(BCM281XX_PIN_VC_CAM3_SDA, "vc_cam3_sda", i2c),
64862306a36Sopenharmony_ci};
64962306a36Sopenharmony_ci
65062306a36Sopenharmony_cistatic const char * const bcm281xx_alt_groups[] = {
65162306a36Sopenharmony_ci	"adcsync",
65262306a36Sopenharmony_ci	"bat_rm",
65362306a36Sopenharmony_ci	"bsc1_scl",
65462306a36Sopenharmony_ci	"bsc1_sda",
65562306a36Sopenharmony_ci	"bsc2_scl",
65662306a36Sopenharmony_ci	"bsc2_sda",
65762306a36Sopenharmony_ci	"classgpwr",
65862306a36Sopenharmony_ci	"clk_cx8",
65962306a36Sopenharmony_ci	"clkout_0",
66062306a36Sopenharmony_ci	"clkout_1",
66162306a36Sopenharmony_ci	"clkout_2",
66262306a36Sopenharmony_ci	"clkout_3",
66362306a36Sopenharmony_ci	"clkreq_in_0",
66462306a36Sopenharmony_ci	"clkreq_in_1",
66562306a36Sopenharmony_ci	"cws_sys_req1",
66662306a36Sopenharmony_ci	"cws_sys_req2",
66762306a36Sopenharmony_ci	"cws_sys_req3",
66862306a36Sopenharmony_ci	"digmic1_clk",
66962306a36Sopenharmony_ci	"digmic1_dq",
67062306a36Sopenharmony_ci	"digmic2_clk",
67162306a36Sopenharmony_ci	"digmic2_dq",
67262306a36Sopenharmony_ci	"gpen13",
67362306a36Sopenharmony_ci	"gpen14",
67462306a36Sopenharmony_ci	"gpen15",
67562306a36Sopenharmony_ci	"gpio00",
67662306a36Sopenharmony_ci	"gpio01",
67762306a36Sopenharmony_ci	"gpio02",
67862306a36Sopenharmony_ci	"gpio03",
67962306a36Sopenharmony_ci	"gpio04",
68062306a36Sopenharmony_ci	"gpio05",
68162306a36Sopenharmony_ci	"gpio06",
68262306a36Sopenharmony_ci	"gpio07",
68362306a36Sopenharmony_ci	"gpio08",
68462306a36Sopenharmony_ci	"gpio09",
68562306a36Sopenharmony_ci	"gpio10",
68662306a36Sopenharmony_ci	"gpio11",
68762306a36Sopenharmony_ci	"gpio12",
68862306a36Sopenharmony_ci	"gpio13",
68962306a36Sopenharmony_ci	"gpio14",
69062306a36Sopenharmony_ci	"gps_pablank",
69162306a36Sopenharmony_ci	"gps_tmark",
69262306a36Sopenharmony_ci	"hdmi_scl",
69362306a36Sopenharmony_ci	"hdmi_sda",
69462306a36Sopenharmony_ci	"ic_dm",
69562306a36Sopenharmony_ci	"ic_dp",
69662306a36Sopenharmony_ci	"kp_col_ip_0",
69762306a36Sopenharmony_ci	"kp_col_ip_1",
69862306a36Sopenharmony_ci	"kp_col_ip_2",
69962306a36Sopenharmony_ci	"kp_col_ip_3",
70062306a36Sopenharmony_ci	"kp_row_op_0",
70162306a36Sopenharmony_ci	"kp_row_op_1",
70262306a36Sopenharmony_ci	"kp_row_op_2",
70362306a36Sopenharmony_ci	"kp_row_op_3",
70462306a36Sopenharmony_ci	"lcd_b_0",
70562306a36Sopenharmony_ci	"lcd_b_1",
70662306a36Sopenharmony_ci	"lcd_b_2",
70762306a36Sopenharmony_ci	"lcd_b_3",
70862306a36Sopenharmony_ci	"lcd_b_4",
70962306a36Sopenharmony_ci	"lcd_b_5",
71062306a36Sopenharmony_ci	"lcd_b_6",
71162306a36Sopenharmony_ci	"lcd_b_7",
71262306a36Sopenharmony_ci	"lcd_g_0",
71362306a36Sopenharmony_ci	"lcd_g_1",
71462306a36Sopenharmony_ci	"lcd_g_2",
71562306a36Sopenharmony_ci	"lcd_g_3",
71662306a36Sopenharmony_ci	"lcd_g_4",
71762306a36Sopenharmony_ci	"lcd_g_5",
71862306a36Sopenharmony_ci	"lcd_g_6",
71962306a36Sopenharmony_ci	"lcd_g_7",
72062306a36Sopenharmony_ci	"lcd_hsync",
72162306a36Sopenharmony_ci	"lcd_oe",
72262306a36Sopenharmony_ci	"lcd_pclk",
72362306a36Sopenharmony_ci	"lcd_r_0",
72462306a36Sopenharmony_ci	"lcd_r_1",
72562306a36Sopenharmony_ci	"lcd_r_2",
72662306a36Sopenharmony_ci	"lcd_r_3",
72762306a36Sopenharmony_ci	"lcd_r_4",
72862306a36Sopenharmony_ci	"lcd_r_5",
72962306a36Sopenharmony_ci	"lcd_r_6",
73062306a36Sopenharmony_ci	"lcd_r_7",
73162306a36Sopenharmony_ci	"lcd_vsync",
73262306a36Sopenharmony_ci	"mdmgpio0",
73362306a36Sopenharmony_ci	"mdmgpio1",
73462306a36Sopenharmony_ci	"mdmgpio2",
73562306a36Sopenharmony_ci	"mdmgpio3",
73662306a36Sopenharmony_ci	"mdmgpio4",
73762306a36Sopenharmony_ci	"mdmgpio5",
73862306a36Sopenharmony_ci	"mdmgpio6",
73962306a36Sopenharmony_ci	"mdmgpio7",
74062306a36Sopenharmony_ci	"mdmgpio8",
74162306a36Sopenharmony_ci	"mphi_data_0",
74262306a36Sopenharmony_ci	"mphi_data_1",
74362306a36Sopenharmony_ci	"mphi_data_2",
74462306a36Sopenharmony_ci	"mphi_data_3",
74562306a36Sopenharmony_ci	"mphi_data_4",
74662306a36Sopenharmony_ci	"mphi_data_5",
74762306a36Sopenharmony_ci	"mphi_data_6",
74862306a36Sopenharmony_ci	"mphi_data_7",
74962306a36Sopenharmony_ci	"mphi_data_8",
75062306a36Sopenharmony_ci	"mphi_data_9",
75162306a36Sopenharmony_ci	"mphi_data_10",
75262306a36Sopenharmony_ci	"mphi_data_11",
75362306a36Sopenharmony_ci	"mphi_data_12",
75462306a36Sopenharmony_ci	"mphi_data_13",
75562306a36Sopenharmony_ci	"mphi_data_14",
75662306a36Sopenharmony_ci	"mphi_data_15",
75762306a36Sopenharmony_ci	"mphi_ha0",
75862306a36Sopenharmony_ci	"mphi_hat0",
75962306a36Sopenharmony_ci	"mphi_hat1",
76062306a36Sopenharmony_ci	"mphi_hce0_n",
76162306a36Sopenharmony_ci	"mphi_hce1_n",
76262306a36Sopenharmony_ci	"mphi_hrd_n",
76362306a36Sopenharmony_ci	"mphi_hwr_n",
76462306a36Sopenharmony_ci	"mphi_run0",
76562306a36Sopenharmony_ci	"mphi_run1",
76662306a36Sopenharmony_ci	"mtx_scan_clk",
76762306a36Sopenharmony_ci	"mtx_scan_data",
76862306a36Sopenharmony_ci	"nand_ad_0",
76962306a36Sopenharmony_ci	"nand_ad_1",
77062306a36Sopenharmony_ci	"nand_ad_2",
77162306a36Sopenharmony_ci	"nand_ad_3",
77262306a36Sopenharmony_ci	"nand_ad_4",
77362306a36Sopenharmony_ci	"nand_ad_5",
77462306a36Sopenharmony_ci	"nand_ad_6",
77562306a36Sopenharmony_ci	"nand_ad_7",
77662306a36Sopenharmony_ci	"nand_ale",
77762306a36Sopenharmony_ci	"nand_cen_0",
77862306a36Sopenharmony_ci	"nand_cen_1",
77962306a36Sopenharmony_ci	"nand_cle",
78062306a36Sopenharmony_ci	"nand_oen",
78162306a36Sopenharmony_ci	"nand_rdy_0",
78262306a36Sopenharmony_ci	"nand_rdy_1",
78362306a36Sopenharmony_ci	"nand_wen",
78462306a36Sopenharmony_ci	"nand_wp",
78562306a36Sopenharmony_ci	"pc1",
78662306a36Sopenharmony_ci	"pc2",
78762306a36Sopenharmony_ci	"pmu_int",
78862306a36Sopenharmony_ci	"pmu_scl",
78962306a36Sopenharmony_ci	"pmu_sda",
79062306a36Sopenharmony_ci	"rfst2g_mtsloten3g",
79162306a36Sopenharmony_ci	"rgmii_0_rx_ctl",
79262306a36Sopenharmony_ci	"rgmii_0_rxc",
79362306a36Sopenharmony_ci	"rgmii_0_rxd_0",
79462306a36Sopenharmony_ci	"rgmii_0_rxd_1",
79562306a36Sopenharmony_ci	"rgmii_0_rxd_2",
79662306a36Sopenharmony_ci	"rgmii_0_rxd_3",
79762306a36Sopenharmony_ci	"rgmii_0_tx_ctl",
79862306a36Sopenharmony_ci	"rgmii_0_txc",
79962306a36Sopenharmony_ci	"rgmii_0_txd_0",
80062306a36Sopenharmony_ci	"rgmii_0_txd_1",
80162306a36Sopenharmony_ci	"rgmii_0_txd_2",
80262306a36Sopenharmony_ci	"rgmii_0_txd_3",
80362306a36Sopenharmony_ci	"rgmii_1_rx_ctl",
80462306a36Sopenharmony_ci	"rgmii_1_rxc",
80562306a36Sopenharmony_ci	"rgmii_1_rxd_0",
80662306a36Sopenharmony_ci	"rgmii_1_rxd_1",
80762306a36Sopenharmony_ci	"rgmii_1_rxd_2",
80862306a36Sopenharmony_ci	"rgmii_1_rxd_3",
80962306a36Sopenharmony_ci	"rgmii_1_tx_ctl",
81062306a36Sopenharmony_ci	"rgmii_1_txc",
81162306a36Sopenharmony_ci	"rgmii_1_txd_0",
81262306a36Sopenharmony_ci	"rgmii_1_txd_1",
81362306a36Sopenharmony_ci	"rgmii_1_txd_2",
81462306a36Sopenharmony_ci	"rgmii_1_txd_3",
81562306a36Sopenharmony_ci	"rgmii_gpio_0",
81662306a36Sopenharmony_ci	"rgmii_gpio_1",
81762306a36Sopenharmony_ci	"rgmii_gpio_2",
81862306a36Sopenharmony_ci	"rgmii_gpio_3",
81962306a36Sopenharmony_ci	"rtxdata2g_txdata3g1",
82062306a36Sopenharmony_ci	"rtxen2g_txdata3g2",
82162306a36Sopenharmony_ci	"rxdata3g0",
82262306a36Sopenharmony_ci	"rxdata3g1",
82362306a36Sopenharmony_ci	"rxdata3g2",
82462306a36Sopenharmony_ci	"sdio1_clk",
82562306a36Sopenharmony_ci	"sdio1_cmd",
82662306a36Sopenharmony_ci	"sdio1_data_0",
82762306a36Sopenharmony_ci	"sdio1_data_1",
82862306a36Sopenharmony_ci	"sdio1_data_2",
82962306a36Sopenharmony_ci	"sdio1_data_3",
83062306a36Sopenharmony_ci	"sdio4_clk",
83162306a36Sopenharmony_ci	"sdio4_cmd",
83262306a36Sopenharmony_ci	"sdio4_data_0",
83362306a36Sopenharmony_ci	"sdio4_data_1",
83462306a36Sopenharmony_ci	"sdio4_data_2",
83562306a36Sopenharmony_ci	"sdio4_data_3",
83662306a36Sopenharmony_ci	"sim_clk",
83762306a36Sopenharmony_ci	"sim_data",
83862306a36Sopenharmony_ci	"sim_det",
83962306a36Sopenharmony_ci	"sim_resetn",
84062306a36Sopenharmony_ci	"sim2_clk",
84162306a36Sopenharmony_ci	"sim2_data",
84262306a36Sopenharmony_ci	"sim2_det",
84362306a36Sopenharmony_ci	"sim2_resetn",
84462306a36Sopenharmony_ci	"sri_c",
84562306a36Sopenharmony_ci	"sri_d",
84662306a36Sopenharmony_ci	"sri_e",
84762306a36Sopenharmony_ci	"ssp_extclk",
84862306a36Sopenharmony_ci	"ssp0_clk",
84962306a36Sopenharmony_ci	"ssp0_fs",
85062306a36Sopenharmony_ci	"ssp0_rxd",
85162306a36Sopenharmony_ci	"ssp0_txd",
85262306a36Sopenharmony_ci	"ssp2_clk",
85362306a36Sopenharmony_ci	"ssp2_fs_0",
85462306a36Sopenharmony_ci	"ssp2_fs_1",
85562306a36Sopenharmony_ci	"ssp2_fs_2",
85662306a36Sopenharmony_ci	"ssp2_fs_3",
85762306a36Sopenharmony_ci	"ssp2_rxd_0",
85862306a36Sopenharmony_ci	"ssp2_rxd_1",
85962306a36Sopenharmony_ci	"ssp2_txd_0",
86062306a36Sopenharmony_ci	"ssp2_txd_1",
86162306a36Sopenharmony_ci	"ssp3_clk",
86262306a36Sopenharmony_ci	"ssp3_fs",
86362306a36Sopenharmony_ci	"ssp3_rxd",
86462306a36Sopenharmony_ci	"ssp3_txd",
86562306a36Sopenharmony_ci	"ssp4_clk",
86662306a36Sopenharmony_ci	"ssp4_fs",
86762306a36Sopenharmony_ci	"ssp4_rxd",
86862306a36Sopenharmony_ci	"ssp4_txd",
86962306a36Sopenharmony_ci	"ssp5_clk",
87062306a36Sopenharmony_ci	"ssp5_fs",
87162306a36Sopenharmony_ci	"ssp5_rxd",
87262306a36Sopenharmony_ci	"ssp5_txd",
87362306a36Sopenharmony_ci	"ssp6_clk",
87462306a36Sopenharmony_ci	"ssp6_fs",
87562306a36Sopenharmony_ci	"ssp6_rxd",
87662306a36Sopenharmony_ci	"ssp6_txd",
87762306a36Sopenharmony_ci	"stat_1",
87862306a36Sopenharmony_ci	"stat_2",
87962306a36Sopenharmony_ci	"sysclken",
88062306a36Sopenharmony_ci	"traceclk",
88162306a36Sopenharmony_ci	"tracedt00",
88262306a36Sopenharmony_ci	"tracedt01",
88362306a36Sopenharmony_ci	"tracedt02",
88462306a36Sopenharmony_ci	"tracedt03",
88562306a36Sopenharmony_ci	"tracedt04",
88662306a36Sopenharmony_ci	"tracedt05",
88762306a36Sopenharmony_ci	"tracedt06",
88862306a36Sopenharmony_ci	"tracedt07",
88962306a36Sopenharmony_ci	"tracedt08",
89062306a36Sopenharmony_ci	"tracedt09",
89162306a36Sopenharmony_ci	"tracedt10",
89262306a36Sopenharmony_ci	"tracedt11",
89362306a36Sopenharmony_ci	"tracedt12",
89462306a36Sopenharmony_ci	"tracedt13",
89562306a36Sopenharmony_ci	"tracedt14",
89662306a36Sopenharmony_ci	"tracedt15",
89762306a36Sopenharmony_ci	"txdata3g0",
89862306a36Sopenharmony_ci	"txpwrind",
89962306a36Sopenharmony_ci	"uartb1_ucts",
90062306a36Sopenharmony_ci	"uartb1_urts",
90162306a36Sopenharmony_ci	"uartb1_urxd",
90262306a36Sopenharmony_ci	"uartb1_utxd",
90362306a36Sopenharmony_ci	"uartb2_urxd",
90462306a36Sopenharmony_ci	"uartb2_utxd",
90562306a36Sopenharmony_ci	"uartb3_ucts",
90662306a36Sopenharmony_ci	"uartb3_urts",
90762306a36Sopenharmony_ci	"uartb3_urxd",
90862306a36Sopenharmony_ci	"uartb3_utxd",
90962306a36Sopenharmony_ci	"uartb4_ucts",
91062306a36Sopenharmony_ci	"uartb4_urts",
91162306a36Sopenharmony_ci	"uartb4_urxd",
91262306a36Sopenharmony_ci	"uartb4_utxd",
91362306a36Sopenharmony_ci	"vc_cam1_scl",
91462306a36Sopenharmony_ci	"vc_cam1_sda",
91562306a36Sopenharmony_ci	"vc_cam2_scl",
91662306a36Sopenharmony_ci	"vc_cam2_sda",
91762306a36Sopenharmony_ci	"vc_cam3_scl",
91862306a36Sopenharmony_ci	"vc_cam3_sda",
91962306a36Sopenharmony_ci};
92062306a36Sopenharmony_ci
92162306a36Sopenharmony_ci/* Every pin can implement all ALT1-ALT4 functions */
92262306a36Sopenharmony_ci#define BCM281XX_PIN_FUNCTION(fcn_name)			\
92362306a36Sopenharmony_ci{							\
92462306a36Sopenharmony_ci	.name = #fcn_name,				\
92562306a36Sopenharmony_ci	.groups = bcm281xx_alt_groups,			\
92662306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(bcm281xx_alt_groups),	\
92762306a36Sopenharmony_ci}
92862306a36Sopenharmony_ci
92962306a36Sopenharmony_cistatic const struct bcm281xx_pin_function bcm281xx_functions[] = {
93062306a36Sopenharmony_ci	BCM281XX_PIN_FUNCTION(alt1),
93162306a36Sopenharmony_ci	BCM281XX_PIN_FUNCTION(alt2),
93262306a36Sopenharmony_ci	BCM281XX_PIN_FUNCTION(alt3),
93362306a36Sopenharmony_ci	BCM281XX_PIN_FUNCTION(alt4),
93462306a36Sopenharmony_ci};
93562306a36Sopenharmony_ci
93662306a36Sopenharmony_cistatic struct bcm281xx_pinctrl_data bcm281xx_pinctrl = {
93762306a36Sopenharmony_ci	.pins = bcm281xx_pinctrl_pins,
93862306a36Sopenharmony_ci	.npins = ARRAY_SIZE(bcm281xx_pinctrl_pins),
93962306a36Sopenharmony_ci	.functions = bcm281xx_functions,
94062306a36Sopenharmony_ci	.nfunctions = ARRAY_SIZE(bcm281xx_functions),
94162306a36Sopenharmony_ci};
94262306a36Sopenharmony_ci
94362306a36Sopenharmony_cistatic inline enum bcm281xx_pin_type pin_type_get(struct pinctrl_dev *pctldev,
94462306a36Sopenharmony_ci						  unsigned pin)
94562306a36Sopenharmony_ci{
94662306a36Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
94762306a36Sopenharmony_ci
94862306a36Sopenharmony_ci	if (pin >= pdata->npins)
94962306a36Sopenharmony_ci		return BCM281XX_PIN_TYPE_UNKNOWN;
95062306a36Sopenharmony_ci
95162306a36Sopenharmony_ci	return *(enum bcm281xx_pin_type *)(pdata->pins[pin].drv_data);
95262306a36Sopenharmony_ci}
95362306a36Sopenharmony_ci
95462306a36Sopenharmony_ci#define BCM281XX_PIN_SHIFT(type, param) \
95562306a36Sopenharmony_ci	(BCM281XX_ ## type ## _PIN_REG_ ## param ## _SHIFT)
95662306a36Sopenharmony_ci
95762306a36Sopenharmony_ci#define BCM281XX_PIN_MASK(type, param) \
95862306a36Sopenharmony_ci	(BCM281XX_ ## type ## _PIN_REG_ ## param ## _MASK)
95962306a36Sopenharmony_ci
96062306a36Sopenharmony_ci/*
96162306a36Sopenharmony_ci * This helper function is used to build up the value and mask used to write to
96262306a36Sopenharmony_ci * a pin register, but does not actually write to the register.
96362306a36Sopenharmony_ci */
96462306a36Sopenharmony_cistatic inline void bcm281xx_pin_update(u32 *reg_val, u32 *reg_mask,
96562306a36Sopenharmony_ci				       u32 param_val, u32 param_shift,
96662306a36Sopenharmony_ci				       u32 param_mask)
96762306a36Sopenharmony_ci{
96862306a36Sopenharmony_ci	*reg_val &= ~param_mask;
96962306a36Sopenharmony_ci	*reg_val |= (param_val << param_shift) & param_mask;
97062306a36Sopenharmony_ci	*reg_mask |= param_mask;
97162306a36Sopenharmony_ci}
97262306a36Sopenharmony_ci
97362306a36Sopenharmony_cistatic const struct regmap_config bcm281xx_pinctrl_regmap_config = {
97462306a36Sopenharmony_ci	.reg_bits = 32,
97562306a36Sopenharmony_ci	.reg_stride = 4,
97662306a36Sopenharmony_ci	.val_bits = 32,
97762306a36Sopenharmony_ci	.max_register = BCM281XX_PIN_VC_CAM3_SDA,
97862306a36Sopenharmony_ci};
97962306a36Sopenharmony_ci
98062306a36Sopenharmony_cistatic int bcm281xx_pinctrl_get_groups_count(struct pinctrl_dev *pctldev)
98162306a36Sopenharmony_ci{
98262306a36Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
98362306a36Sopenharmony_ci
98462306a36Sopenharmony_ci	return pdata->npins;
98562306a36Sopenharmony_ci}
98662306a36Sopenharmony_ci
98762306a36Sopenharmony_cistatic const char *bcm281xx_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
98862306a36Sopenharmony_ci						   unsigned group)
98962306a36Sopenharmony_ci{
99062306a36Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
99162306a36Sopenharmony_ci
99262306a36Sopenharmony_ci	return pdata->pins[group].name;
99362306a36Sopenharmony_ci}
99462306a36Sopenharmony_ci
99562306a36Sopenharmony_cistatic int bcm281xx_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
99662306a36Sopenharmony_ci					   unsigned group,
99762306a36Sopenharmony_ci					   const unsigned **pins,
99862306a36Sopenharmony_ci					   unsigned *num_pins)
99962306a36Sopenharmony_ci{
100062306a36Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
100162306a36Sopenharmony_ci
100262306a36Sopenharmony_ci	*pins = &pdata->pins[group].number;
100362306a36Sopenharmony_ci	*num_pins = 1;
100462306a36Sopenharmony_ci
100562306a36Sopenharmony_ci	return 0;
100662306a36Sopenharmony_ci}
100762306a36Sopenharmony_ci
100862306a36Sopenharmony_cistatic void bcm281xx_pinctrl_pin_dbg_show(struct pinctrl_dev *pctldev,
100962306a36Sopenharmony_ci					  struct seq_file *s,
101062306a36Sopenharmony_ci					  unsigned offset)
101162306a36Sopenharmony_ci{
101262306a36Sopenharmony_ci	seq_printf(s, " %s", dev_name(pctldev->dev));
101362306a36Sopenharmony_ci}
101462306a36Sopenharmony_ci
101562306a36Sopenharmony_cistatic const struct pinctrl_ops bcm281xx_pinctrl_ops = {
101662306a36Sopenharmony_ci	.get_groups_count = bcm281xx_pinctrl_get_groups_count,
101762306a36Sopenharmony_ci	.get_group_name = bcm281xx_pinctrl_get_group_name,
101862306a36Sopenharmony_ci	.get_group_pins = bcm281xx_pinctrl_get_group_pins,
101962306a36Sopenharmony_ci	.pin_dbg_show = bcm281xx_pinctrl_pin_dbg_show,
102062306a36Sopenharmony_ci	.dt_node_to_map = pinconf_generic_dt_node_to_map_pin,
102162306a36Sopenharmony_ci	.dt_free_map = pinctrl_utils_free_map,
102262306a36Sopenharmony_ci};
102362306a36Sopenharmony_ci
102462306a36Sopenharmony_cistatic int bcm281xx_pinctrl_get_fcns_count(struct pinctrl_dev *pctldev)
102562306a36Sopenharmony_ci{
102662306a36Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
102762306a36Sopenharmony_ci
102862306a36Sopenharmony_ci	return pdata->nfunctions;
102962306a36Sopenharmony_ci}
103062306a36Sopenharmony_ci
103162306a36Sopenharmony_cistatic const char *bcm281xx_pinctrl_get_fcn_name(struct pinctrl_dev *pctldev,
103262306a36Sopenharmony_ci						 unsigned function)
103362306a36Sopenharmony_ci{
103462306a36Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
103562306a36Sopenharmony_ci
103662306a36Sopenharmony_ci	return pdata->functions[function].name;
103762306a36Sopenharmony_ci}
103862306a36Sopenharmony_ci
103962306a36Sopenharmony_cistatic int bcm281xx_pinctrl_get_fcn_groups(struct pinctrl_dev *pctldev,
104062306a36Sopenharmony_ci					   unsigned function,
104162306a36Sopenharmony_ci					   const char * const **groups,
104262306a36Sopenharmony_ci					   unsigned * const num_groups)
104362306a36Sopenharmony_ci{
104462306a36Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
104562306a36Sopenharmony_ci
104662306a36Sopenharmony_ci	*groups = pdata->functions[function].groups;
104762306a36Sopenharmony_ci	*num_groups = pdata->functions[function].ngroups;
104862306a36Sopenharmony_ci
104962306a36Sopenharmony_ci	return 0;
105062306a36Sopenharmony_ci}
105162306a36Sopenharmony_ci
105262306a36Sopenharmony_cistatic int bcm281xx_pinmux_set(struct pinctrl_dev *pctldev,
105362306a36Sopenharmony_ci			       unsigned function,
105462306a36Sopenharmony_ci			       unsigned group)
105562306a36Sopenharmony_ci{
105662306a36Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
105762306a36Sopenharmony_ci	const struct bcm281xx_pin_function *f = &pdata->functions[function];
105862306a36Sopenharmony_ci	u32 offset = 4 * pdata->pins[group].number;
105962306a36Sopenharmony_ci	int rc = 0;
106062306a36Sopenharmony_ci
106162306a36Sopenharmony_ci	dev_dbg(pctldev->dev,
106262306a36Sopenharmony_ci		"%s(): Enable function %s (%d) of pin %s (%d) @offset 0x%x.\n",
106362306a36Sopenharmony_ci		__func__, f->name, function, pdata->pins[group].name,
106462306a36Sopenharmony_ci		pdata->pins[group].number, offset);
106562306a36Sopenharmony_ci
106662306a36Sopenharmony_ci	rc = regmap_update_bits(pdata->regmap, offset,
106762306a36Sopenharmony_ci		BCM281XX_PIN_REG_F_SEL_MASK,
106862306a36Sopenharmony_ci		function << BCM281XX_PIN_REG_F_SEL_SHIFT);
106962306a36Sopenharmony_ci	if (rc)
107062306a36Sopenharmony_ci		dev_err(pctldev->dev,
107162306a36Sopenharmony_ci			"Error updating register for pin %s (%d).\n",
107262306a36Sopenharmony_ci			pdata->pins[group].name, pdata->pins[group].number);
107362306a36Sopenharmony_ci
107462306a36Sopenharmony_ci	return rc;
107562306a36Sopenharmony_ci}
107662306a36Sopenharmony_ci
107762306a36Sopenharmony_cistatic const struct pinmux_ops bcm281xx_pinctrl_pinmux_ops = {
107862306a36Sopenharmony_ci	.get_functions_count = bcm281xx_pinctrl_get_fcns_count,
107962306a36Sopenharmony_ci	.get_function_name = bcm281xx_pinctrl_get_fcn_name,
108062306a36Sopenharmony_ci	.get_function_groups = bcm281xx_pinctrl_get_fcn_groups,
108162306a36Sopenharmony_ci	.set_mux = bcm281xx_pinmux_set,
108262306a36Sopenharmony_ci};
108362306a36Sopenharmony_ci
108462306a36Sopenharmony_cistatic int bcm281xx_pinctrl_pin_config_get(struct pinctrl_dev *pctldev,
108562306a36Sopenharmony_ci					   unsigned pin,
108662306a36Sopenharmony_ci					   unsigned long *config)
108762306a36Sopenharmony_ci{
108862306a36Sopenharmony_ci	return -ENOTSUPP;
108962306a36Sopenharmony_ci}
109062306a36Sopenharmony_ci
109162306a36Sopenharmony_ci
109262306a36Sopenharmony_ci/* Goes through the configs and update register val/mask */
109362306a36Sopenharmony_cistatic int bcm281xx_std_pin_update(struct pinctrl_dev *pctldev,
109462306a36Sopenharmony_ci				   unsigned pin,
109562306a36Sopenharmony_ci				   unsigned long *configs,
109662306a36Sopenharmony_ci				   unsigned num_configs,
109762306a36Sopenharmony_ci				   u32 *val,
109862306a36Sopenharmony_ci				   u32 *mask)
109962306a36Sopenharmony_ci{
110062306a36Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
110162306a36Sopenharmony_ci	int i;
110262306a36Sopenharmony_ci	enum pin_config_param param;
110362306a36Sopenharmony_ci	u32 arg;
110462306a36Sopenharmony_ci
110562306a36Sopenharmony_ci	for (i = 0; i < num_configs; i++) {
110662306a36Sopenharmony_ci		param = pinconf_to_config_param(configs[i]);
110762306a36Sopenharmony_ci		arg = pinconf_to_config_argument(configs[i]);
110862306a36Sopenharmony_ci
110962306a36Sopenharmony_ci		switch (param) {
111062306a36Sopenharmony_ci		case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
111162306a36Sopenharmony_ci			arg = (arg >= 1 ? 1 : 0);
111262306a36Sopenharmony_ci			bcm281xx_pin_update(val, mask, arg,
111362306a36Sopenharmony_ci				BCM281XX_PIN_SHIFT(STD, HYST),
111462306a36Sopenharmony_ci				BCM281XX_PIN_MASK(STD, HYST));
111562306a36Sopenharmony_ci			break;
111662306a36Sopenharmony_ci		/*
111762306a36Sopenharmony_ci		 * The pin bias can only be one of pull-up, pull-down, or
111862306a36Sopenharmony_ci		 * disable.  The user does not need to specify a value for the
111962306a36Sopenharmony_ci		 * property, and the default value from pinconf-generic is
112062306a36Sopenharmony_ci		 * ignored.
112162306a36Sopenharmony_ci		 */
112262306a36Sopenharmony_ci		case PIN_CONFIG_BIAS_DISABLE:
112362306a36Sopenharmony_ci			bcm281xx_pin_update(val, mask, 0,
112462306a36Sopenharmony_ci				BCM281XX_PIN_SHIFT(STD, PULL_UP),
112562306a36Sopenharmony_ci				BCM281XX_PIN_MASK(STD, PULL_UP));
112662306a36Sopenharmony_ci			bcm281xx_pin_update(val, mask, 0,
112762306a36Sopenharmony_ci				BCM281XX_PIN_SHIFT(STD, PULL_DN),
112862306a36Sopenharmony_ci				BCM281XX_PIN_MASK(STD, PULL_DN));
112962306a36Sopenharmony_ci			break;
113062306a36Sopenharmony_ci
113162306a36Sopenharmony_ci		case PIN_CONFIG_BIAS_PULL_UP:
113262306a36Sopenharmony_ci			bcm281xx_pin_update(val, mask, 1,
113362306a36Sopenharmony_ci				BCM281XX_PIN_SHIFT(STD, PULL_UP),
113462306a36Sopenharmony_ci				BCM281XX_PIN_MASK(STD, PULL_UP));
113562306a36Sopenharmony_ci			bcm281xx_pin_update(val, mask, 0,
113662306a36Sopenharmony_ci				BCM281XX_PIN_SHIFT(STD, PULL_DN),
113762306a36Sopenharmony_ci				BCM281XX_PIN_MASK(STD, PULL_DN));
113862306a36Sopenharmony_ci			break;
113962306a36Sopenharmony_ci
114062306a36Sopenharmony_ci		case PIN_CONFIG_BIAS_PULL_DOWN:
114162306a36Sopenharmony_ci			bcm281xx_pin_update(val, mask, 0,
114262306a36Sopenharmony_ci				BCM281XX_PIN_SHIFT(STD, PULL_UP),
114362306a36Sopenharmony_ci				BCM281XX_PIN_MASK(STD, PULL_UP));
114462306a36Sopenharmony_ci			bcm281xx_pin_update(val, mask, 1,
114562306a36Sopenharmony_ci				BCM281XX_PIN_SHIFT(STD, PULL_DN),
114662306a36Sopenharmony_ci				BCM281XX_PIN_MASK(STD, PULL_DN));
114762306a36Sopenharmony_ci			break;
114862306a36Sopenharmony_ci
114962306a36Sopenharmony_ci		case PIN_CONFIG_SLEW_RATE:
115062306a36Sopenharmony_ci			arg = (arg >= 1 ? 1 : 0);
115162306a36Sopenharmony_ci			bcm281xx_pin_update(val, mask, arg,
115262306a36Sopenharmony_ci				BCM281XX_PIN_SHIFT(STD, SLEW),
115362306a36Sopenharmony_ci				BCM281XX_PIN_MASK(STD, SLEW));
115462306a36Sopenharmony_ci			break;
115562306a36Sopenharmony_ci
115662306a36Sopenharmony_ci		case PIN_CONFIG_INPUT_ENABLE:
115762306a36Sopenharmony_ci			/* inversed since register is for input _disable_ */
115862306a36Sopenharmony_ci			arg = (arg >= 1 ? 0 : 1);
115962306a36Sopenharmony_ci			bcm281xx_pin_update(val, mask, arg,
116062306a36Sopenharmony_ci				BCM281XX_PIN_SHIFT(STD, INPUT_DIS),
116162306a36Sopenharmony_ci				BCM281XX_PIN_MASK(STD, INPUT_DIS));
116262306a36Sopenharmony_ci			break;
116362306a36Sopenharmony_ci
116462306a36Sopenharmony_ci		case PIN_CONFIG_DRIVE_STRENGTH:
116562306a36Sopenharmony_ci			/* Valid range is 2-16 mA, even numbers only */
116662306a36Sopenharmony_ci			if ((arg < 2) || (arg > 16) || (arg % 2)) {
116762306a36Sopenharmony_ci				dev_err(pctldev->dev,
116862306a36Sopenharmony_ci					"Invalid Drive Strength value (%d) for "
116962306a36Sopenharmony_ci					"pin %s (%d). Valid values are "
117062306a36Sopenharmony_ci					"(2..16) mA, even numbers only.\n",
117162306a36Sopenharmony_ci					arg, pdata->pins[pin].name, pin);
117262306a36Sopenharmony_ci				return -EINVAL;
117362306a36Sopenharmony_ci			}
117462306a36Sopenharmony_ci			bcm281xx_pin_update(val, mask, (arg/2)-1,
117562306a36Sopenharmony_ci				BCM281XX_PIN_SHIFT(STD, DRV_STR),
117662306a36Sopenharmony_ci				BCM281XX_PIN_MASK(STD, DRV_STR));
117762306a36Sopenharmony_ci			break;
117862306a36Sopenharmony_ci
117962306a36Sopenharmony_ci		default:
118062306a36Sopenharmony_ci			dev_err(pctldev->dev,
118162306a36Sopenharmony_ci				"Unrecognized pin config %d for pin %s (%d).\n",
118262306a36Sopenharmony_ci				param, pdata->pins[pin].name, pin);
118362306a36Sopenharmony_ci			return -EINVAL;
118462306a36Sopenharmony_ci
118562306a36Sopenharmony_ci		} /* switch config */
118662306a36Sopenharmony_ci	} /* for each config */
118762306a36Sopenharmony_ci
118862306a36Sopenharmony_ci	return 0;
118962306a36Sopenharmony_ci}
119062306a36Sopenharmony_ci
119162306a36Sopenharmony_ci/*
119262306a36Sopenharmony_ci * The pull-up strength for an I2C pin is represented by bits 4-6 in the
119362306a36Sopenharmony_ci * register with the following mapping:
119462306a36Sopenharmony_ci *   0b000: No pull-up
119562306a36Sopenharmony_ci *   0b001: 1200 Ohm
119662306a36Sopenharmony_ci *   0b010: 1800 Ohm
119762306a36Sopenharmony_ci *   0b011: 720 Ohm
119862306a36Sopenharmony_ci *   0b100: 2700 Ohm
119962306a36Sopenharmony_ci *   0b101: 831 Ohm
120062306a36Sopenharmony_ci *   0b110: 1080 Ohm
120162306a36Sopenharmony_ci *   0b111: 568 Ohm
120262306a36Sopenharmony_ci * This array maps pull-up strength in Ohms to register values (1+index).
120362306a36Sopenharmony_ci */
120462306a36Sopenharmony_cistatic const u16 bcm281xx_pullup_map[] = {
120562306a36Sopenharmony_ci	1200, 1800, 720, 2700, 831, 1080, 568
120662306a36Sopenharmony_ci};
120762306a36Sopenharmony_ci
120862306a36Sopenharmony_ci/* Goes through the configs and update register val/mask */
120962306a36Sopenharmony_cistatic int bcm281xx_i2c_pin_update(struct pinctrl_dev *pctldev,
121062306a36Sopenharmony_ci				   unsigned pin,
121162306a36Sopenharmony_ci				   unsigned long *configs,
121262306a36Sopenharmony_ci				   unsigned num_configs,
121362306a36Sopenharmony_ci				   u32 *val,
121462306a36Sopenharmony_ci				   u32 *mask)
121562306a36Sopenharmony_ci{
121662306a36Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
121762306a36Sopenharmony_ci	int i, j;
121862306a36Sopenharmony_ci	enum pin_config_param param;
121962306a36Sopenharmony_ci	u32 arg;
122062306a36Sopenharmony_ci
122162306a36Sopenharmony_ci	for (i = 0; i < num_configs; i++) {
122262306a36Sopenharmony_ci		param = pinconf_to_config_param(configs[i]);
122362306a36Sopenharmony_ci		arg = pinconf_to_config_argument(configs[i]);
122462306a36Sopenharmony_ci
122562306a36Sopenharmony_ci		switch (param) {
122662306a36Sopenharmony_ci		case PIN_CONFIG_BIAS_PULL_UP:
122762306a36Sopenharmony_ci			for (j = 0; j < ARRAY_SIZE(bcm281xx_pullup_map); j++)
122862306a36Sopenharmony_ci				if (bcm281xx_pullup_map[j] == arg)
122962306a36Sopenharmony_ci					break;
123062306a36Sopenharmony_ci
123162306a36Sopenharmony_ci			if (j == ARRAY_SIZE(bcm281xx_pullup_map)) {
123262306a36Sopenharmony_ci				dev_err(pctldev->dev,
123362306a36Sopenharmony_ci					"Invalid pull-up value (%d) for pin %s "
123462306a36Sopenharmony_ci					"(%d). Valid values are 568, 720, 831, "
123562306a36Sopenharmony_ci					"1080, 1200, 1800, 2700 Ohms.\n",
123662306a36Sopenharmony_ci					arg, pdata->pins[pin].name, pin);
123762306a36Sopenharmony_ci				return -EINVAL;
123862306a36Sopenharmony_ci			}
123962306a36Sopenharmony_ci
124062306a36Sopenharmony_ci			bcm281xx_pin_update(val, mask, j+1,
124162306a36Sopenharmony_ci				BCM281XX_PIN_SHIFT(I2C, PULL_UP_STR),
124262306a36Sopenharmony_ci				BCM281XX_PIN_MASK(I2C, PULL_UP_STR));
124362306a36Sopenharmony_ci			break;
124462306a36Sopenharmony_ci
124562306a36Sopenharmony_ci		case PIN_CONFIG_BIAS_DISABLE:
124662306a36Sopenharmony_ci			bcm281xx_pin_update(val, mask, 0,
124762306a36Sopenharmony_ci				BCM281XX_PIN_SHIFT(I2C, PULL_UP_STR),
124862306a36Sopenharmony_ci				BCM281XX_PIN_MASK(I2C, PULL_UP_STR));
124962306a36Sopenharmony_ci			break;
125062306a36Sopenharmony_ci
125162306a36Sopenharmony_ci		case PIN_CONFIG_SLEW_RATE:
125262306a36Sopenharmony_ci			arg = (arg >= 1 ? 1 : 0);
125362306a36Sopenharmony_ci			bcm281xx_pin_update(val, mask, arg,
125462306a36Sopenharmony_ci				BCM281XX_PIN_SHIFT(I2C, SLEW),
125562306a36Sopenharmony_ci				BCM281XX_PIN_MASK(I2C, SLEW));
125662306a36Sopenharmony_ci			break;
125762306a36Sopenharmony_ci
125862306a36Sopenharmony_ci		case PIN_CONFIG_INPUT_ENABLE:
125962306a36Sopenharmony_ci			/* inversed since register is for input _disable_ */
126062306a36Sopenharmony_ci			arg = (arg >= 1 ? 0 : 1);
126162306a36Sopenharmony_ci			bcm281xx_pin_update(val, mask, arg,
126262306a36Sopenharmony_ci				BCM281XX_PIN_SHIFT(I2C, INPUT_DIS),
126362306a36Sopenharmony_ci				BCM281XX_PIN_MASK(I2C, INPUT_DIS));
126462306a36Sopenharmony_ci			break;
126562306a36Sopenharmony_ci
126662306a36Sopenharmony_ci		default:
126762306a36Sopenharmony_ci			dev_err(pctldev->dev,
126862306a36Sopenharmony_ci				"Unrecognized pin config %d for pin %s (%d).\n",
126962306a36Sopenharmony_ci				param, pdata->pins[pin].name, pin);
127062306a36Sopenharmony_ci			return -EINVAL;
127162306a36Sopenharmony_ci
127262306a36Sopenharmony_ci		} /* switch config */
127362306a36Sopenharmony_ci	} /* for each config */
127462306a36Sopenharmony_ci
127562306a36Sopenharmony_ci	return 0;
127662306a36Sopenharmony_ci}
127762306a36Sopenharmony_ci
127862306a36Sopenharmony_ci/* Goes through the configs and update register val/mask */
127962306a36Sopenharmony_cistatic int bcm281xx_hdmi_pin_update(struct pinctrl_dev *pctldev,
128062306a36Sopenharmony_ci				    unsigned pin,
128162306a36Sopenharmony_ci				    unsigned long *configs,
128262306a36Sopenharmony_ci				    unsigned num_configs,
128362306a36Sopenharmony_ci				    u32 *val,
128462306a36Sopenharmony_ci				    u32 *mask)
128562306a36Sopenharmony_ci{
128662306a36Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
128762306a36Sopenharmony_ci	int i;
128862306a36Sopenharmony_ci	enum pin_config_param param;
128962306a36Sopenharmony_ci	u32 arg;
129062306a36Sopenharmony_ci
129162306a36Sopenharmony_ci	for (i = 0; i < num_configs; i++) {
129262306a36Sopenharmony_ci		param = pinconf_to_config_param(configs[i]);
129362306a36Sopenharmony_ci		arg = pinconf_to_config_argument(configs[i]);
129462306a36Sopenharmony_ci
129562306a36Sopenharmony_ci		switch (param) {
129662306a36Sopenharmony_ci		case PIN_CONFIG_SLEW_RATE:
129762306a36Sopenharmony_ci			arg = (arg >= 1 ? 1 : 0);
129862306a36Sopenharmony_ci			bcm281xx_pin_update(val, mask, arg,
129962306a36Sopenharmony_ci				BCM281XX_PIN_SHIFT(HDMI, MODE),
130062306a36Sopenharmony_ci				BCM281XX_PIN_MASK(HDMI, MODE));
130162306a36Sopenharmony_ci			break;
130262306a36Sopenharmony_ci
130362306a36Sopenharmony_ci		case PIN_CONFIG_INPUT_ENABLE:
130462306a36Sopenharmony_ci			/* inversed since register is for input _disable_ */
130562306a36Sopenharmony_ci			arg = (arg >= 1 ? 0 : 1);
130662306a36Sopenharmony_ci			bcm281xx_pin_update(val, mask, arg,
130762306a36Sopenharmony_ci				BCM281XX_PIN_SHIFT(HDMI, INPUT_DIS),
130862306a36Sopenharmony_ci				BCM281XX_PIN_MASK(HDMI, INPUT_DIS));
130962306a36Sopenharmony_ci			break;
131062306a36Sopenharmony_ci
131162306a36Sopenharmony_ci		default:
131262306a36Sopenharmony_ci			dev_err(pctldev->dev,
131362306a36Sopenharmony_ci				"Unrecognized pin config %d for pin %s (%d).\n",
131462306a36Sopenharmony_ci				param, pdata->pins[pin].name, pin);
131562306a36Sopenharmony_ci			return -EINVAL;
131662306a36Sopenharmony_ci
131762306a36Sopenharmony_ci		} /* switch config */
131862306a36Sopenharmony_ci	} /* for each config */
131962306a36Sopenharmony_ci
132062306a36Sopenharmony_ci	return 0;
132162306a36Sopenharmony_ci}
132262306a36Sopenharmony_ci
132362306a36Sopenharmony_cistatic int bcm281xx_pinctrl_pin_config_set(struct pinctrl_dev *pctldev,
132462306a36Sopenharmony_ci					   unsigned pin,
132562306a36Sopenharmony_ci					   unsigned long *configs,
132662306a36Sopenharmony_ci					   unsigned num_configs)
132762306a36Sopenharmony_ci{
132862306a36Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
132962306a36Sopenharmony_ci	enum bcm281xx_pin_type pin_type;
133062306a36Sopenharmony_ci	u32 offset = 4 * pin;
133162306a36Sopenharmony_ci	u32 cfg_val, cfg_mask;
133262306a36Sopenharmony_ci	int rc;
133362306a36Sopenharmony_ci
133462306a36Sopenharmony_ci	cfg_val = 0;
133562306a36Sopenharmony_ci	cfg_mask = 0;
133662306a36Sopenharmony_ci	pin_type = pin_type_get(pctldev, pin);
133762306a36Sopenharmony_ci
133862306a36Sopenharmony_ci	/* Different pins have different configuration options */
133962306a36Sopenharmony_ci	switch (pin_type) {
134062306a36Sopenharmony_ci	case BCM281XX_PIN_TYPE_STD:
134162306a36Sopenharmony_ci		rc = bcm281xx_std_pin_update(pctldev, pin, configs,
134262306a36Sopenharmony_ci			num_configs, &cfg_val, &cfg_mask);
134362306a36Sopenharmony_ci		break;
134462306a36Sopenharmony_ci
134562306a36Sopenharmony_ci	case BCM281XX_PIN_TYPE_I2C:
134662306a36Sopenharmony_ci		rc = bcm281xx_i2c_pin_update(pctldev, pin, configs,
134762306a36Sopenharmony_ci			num_configs, &cfg_val, &cfg_mask);
134862306a36Sopenharmony_ci		break;
134962306a36Sopenharmony_ci
135062306a36Sopenharmony_ci	case BCM281XX_PIN_TYPE_HDMI:
135162306a36Sopenharmony_ci		rc = bcm281xx_hdmi_pin_update(pctldev, pin, configs,
135262306a36Sopenharmony_ci			num_configs, &cfg_val, &cfg_mask);
135362306a36Sopenharmony_ci		break;
135462306a36Sopenharmony_ci
135562306a36Sopenharmony_ci	default:
135662306a36Sopenharmony_ci		dev_err(pctldev->dev, "Unknown pin type for pin %s (%d).\n",
135762306a36Sopenharmony_ci			pdata->pins[pin].name, pin);
135862306a36Sopenharmony_ci		return -EINVAL;
135962306a36Sopenharmony_ci
136062306a36Sopenharmony_ci	} /* switch pin type */
136162306a36Sopenharmony_ci
136262306a36Sopenharmony_ci	if (rc)
136362306a36Sopenharmony_ci		return rc;
136462306a36Sopenharmony_ci
136562306a36Sopenharmony_ci	dev_dbg(pctldev->dev,
136662306a36Sopenharmony_ci		"%s(): Set pin %s (%d) with config 0x%x, mask 0x%x\n",
136762306a36Sopenharmony_ci		__func__, pdata->pins[pin].name, pin, cfg_val, cfg_mask);
136862306a36Sopenharmony_ci
136962306a36Sopenharmony_ci	rc = regmap_update_bits(pdata->regmap, offset, cfg_mask, cfg_val);
137062306a36Sopenharmony_ci	if (rc) {
137162306a36Sopenharmony_ci		dev_err(pctldev->dev,
137262306a36Sopenharmony_ci			"Error updating register for pin %s (%d).\n",
137362306a36Sopenharmony_ci			pdata->pins[pin].name, pin);
137462306a36Sopenharmony_ci		return rc;
137562306a36Sopenharmony_ci	}
137662306a36Sopenharmony_ci
137762306a36Sopenharmony_ci	return 0;
137862306a36Sopenharmony_ci}
137962306a36Sopenharmony_ci
138062306a36Sopenharmony_cistatic const struct pinconf_ops bcm281xx_pinctrl_pinconf_ops = {
138162306a36Sopenharmony_ci	.pin_config_get = bcm281xx_pinctrl_pin_config_get,
138262306a36Sopenharmony_ci	.pin_config_set = bcm281xx_pinctrl_pin_config_set,
138362306a36Sopenharmony_ci};
138462306a36Sopenharmony_ci
138562306a36Sopenharmony_cistatic struct pinctrl_desc bcm281xx_pinctrl_desc = {
138662306a36Sopenharmony_ci	/* name, pins, npins members initialized in probe function */
138762306a36Sopenharmony_ci	.pctlops = &bcm281xx_pinctrl_ops,
138862306a36Sopenharmony_ci	.pmxops = &bcm281xx_pinctrl_pinmux_ops,
138962306a36Sopenharmony_ci	.confops = &bcm281xx_pinctrl_pinconf_ops,
139062306a36Sopenharmony_ci	.owner = THIS_MODULE,
139162306a36Sopenharmony_ci};
139262306a36Sopenharmony_ci
139362306a36Sopenharmony_cistatic int __init bcm281xx_pinctrl_probe(struct platform_device *pdev)
139462306a36Sopenharmony_ci{
139562306a36Sopenharmony_ci	struct bcm281xx_pinctrl_data *pdata = &bcm281xx_pinctrl;
139662306a36Sopenharmony_ci	struct pinctrl_dev *pctl;
139762306a36Sopenharmony_ci
139862306a36Sopenharmony_ci	/* So far We can assume there is only 1 bank of registers */
139962306a36Sopenharmony_ci	pdata->reg_base = devm_platform_ioremap_resource(pdev, 0);
140062306a36Sopenharmony_ci	if (IS_ERR(pdata->reg_base)) {
140162306a36Sopenharmony_ci		dev_err(&pdev->dev, "Failed to ioremap MEM resource\n");
140262306a36Sopenharmony_ci		return PTR_ERR(pdata->reg_base);
140362306a36Sopenharmony_ci	}
140462306a36Sopenharmony_ci
140562306a36Sopenharmony_ci	/* Initialize the dynamic part of pinctrl_desc */
140662306a36Sopenharmony_ci	pdata->regmap = devm_regmap_init_mmio(&pdev->dev, pdata->reg_base,
140762306a36Sopenharmony_ci		&bcm281xx_pinctrl_regmap_config);
140862306a36Sopenharmony_ci	if (IS_ERR(pdata->regmap)) {
140962306a36Sopenharmony_ci		dev_err(&pdev->dev, "Regmap MMIO init failed.\n");
141062306a36Sopenharmony_ci		return -ENODEV;
141162306a36Sopenharmony_ci	}
141262306a36Sopenharmony_ci
141362306a36Sopenharmony_ci	bcm281xx_pinctrl_desc.name = dev_name(&pdev->dev);
141462306a36Sopenharmony_ci	bcm281xx_pinctrl_desc.pins = bcm281xx_pinctrl.pins;
141562306a36Sopenharmony_ci	bcm281xx_pinctrl_desc.npins = bcm281xx_pinctrl.npins;
141662306a36Sopenharmony_ci
141762306a36Sopenharmony_ci	pctl = devm_pinctrl_register(&pdev->dev, &bcm281xx_pinctrl_desc, pdata);
141862306a36Sopenharmony_ci	if (IS_ERR(pctl)) {
141962306a36Sopenharmony_ci		dev_err(&pdev->dev, "Failed to register pinctrl\n");
142062306a36Sopenharmony_ci		return PTR_ERR(pctl);
142162306a36Sopenharmony_ci	}
142262306a36Sopenharmony_ci
142362306a36Sopenharmony_ci	platform_set_drvdata(pdev, pdata);
142462306a36Sopenharmony_ci
142562306a36Sopenharmony_ci	return 0;
142662306a36Sopenharmony_ci}
142762306a36Sopenharmony_ci
142862306a36Sopenharmony_cistatic const struct of_device_id bcm281xx_pinctrl_of_match[] = {
142962306a36Sopenharmony_ci	{ .compatible = "brcm,bcm11351-pinctrl", },
143062306a36Sopenharmony_ci	{ },
143162306a36Sopenharmony_ci};
143262306a36Sopenharmony_ci
143362306a36Sopenharmony_cistatic struct platform_driver bcm281xx_pinctrl_driver = {
143462306a36Sopenharmony_ci	.driver = {
143562306a36Sopenharmony_ci		.name = "bcm281xx-pinctrl",
143662306a36Sopenharmony_ci		.of_match_table = bcm281xx_pinctrl_of_match,
143762306a36Sopenharmony_ci	},
143862306a36Sopenharmony_ci};
143962306a36Sopenharmony_cibuiltin_platform_driver_probe(bcm281xx_pinctrl_driver, bcm281xx_pinctrl_probe);
1440