xref: /openbmc/linux/drivers/pinctrl/spear/pinctrl-spear1340.c (revision c900529f3d9161bfde5cca0754f83b4d3c3e0220)
185ed41a7SViresh Kumar /*
285ed41a7SViresh Kumar  * Driver for the ST Microelectronics SPEAr1340 pinmux
385ed41a7SViresh Kumar  *
485ed41a7SViresh Kumar  * Copyright (C) 2012 ST Microelectronics
5da89947bSViresh Kumar  * Viresh Kumar <vireshk@kernel.org>
685ed41a7SViresh Kumar  *
785ed41a7SViresh Kumar  * This file is licensed under the terms of the GNU General Public
885ed41a7SViresh Kumar  * License version 2. This program is licensed "as is" without any
985ed41a7SViresh Kumar  * warranty of any kind, whether express or implied.
1085ed41a7SViresh Kumar  */
1185ed41a7SViresh Kumar 
1285ed41a7SViresh Kumar #include <linux/err.h>
1385ed41a7SViresh Kumar #include <linux/init.h>
14*060f03e9SRob Herring #include <linux/mod_devicetable.h>
1585ed41a7SViresh Kumar #include <linux/platform_device.h>
1685ed41a7SViresh Kumar #include "pinctrl-spear.h"
1785ed41a7SViresh Kumar 
1885ed41a7SViresh Kumar #define DRIVER_NAME "spear1340-pinmux"
1985ed41a7SViresh Kumar 
2085ed41a7SViresh Kumar /* pins */
2185ed41a7SViresh Kumar static const struct pinctrl_pin_desc spear1340_pins[] = {
2285ed41a7SViresh Kumar 	SPEAR_PIN_0_TO_101,
2385ed41a7SViresh Kumar 	SPEAR_PIN_102_TO_245,
2485ed41a7SViresh Kumar 	PINCTRL_PIN(246, "PLGPIO246"),
2585ed41a7SViresh Kumar 	PINCTRL_PIN(247, "PLGPIO247"),
2685ed41a7SViresh Kumar 	PINCTRL_PIN(248, "PLGPIO248"),
2785ed41a7SViresh Kumar 	PINCTRL_PIN(249, "PLGPIO249"),
2885ed41a7SViresh Kumar 	PINCTRL_PIN(250, "PLGPIO250"),
2985ed41a7SViresh Kumar 	PINCTRL_PIN(251, "PLGPIO251"),
3085ed41a7SViresh Kumar };
3185ed41a7SViresh Kumar 
3285ed41a7SViresh Kumar /* In SPEAr1340 there are two levels of pad muxing */
3385ed41a7SViresh Kumar /* - pads as gpio OR peripherals */
3485ed41a7SViresh Kumar #define PAD_FUNCTION_EN_1			0x668
3585ed41a7SViresh Kumar #define PAD_FUNCTION_EN_2			0x66C
3685ed41a7SViresh Kumar #define PAD_FUNCTION_EN_3			0x670
3785ed41a7SViresh Kumar #define PAD_FUNCTION_EN_4			0x674
3885ed41a7SViresh Kumar #define PAD_FUNCTION_EN_5			0x690
3985ed41a7SViresh Kumar #define PAD_FUNCTION_EN_6			0x694
4085ed41a7SViresh Kumar #define PAD_FUNCTION_EN_7			0x698
4185ed41a7SViresh Kumar #define PAD_FUNCTION_EN_8			0x69C
4285ed41a7SViresh Kumar 
4385ed41a7SViresh Kumar /* - If peripherals, then primary OR alternate peripheral */
4485ed41a7SViresh Kumar #define PAD_SHARED_IP_EN_1			0x6A0
4585ed41a7SViresh Kumar #define PAD_SHARED_IP_EN_2			0x6A4
4685ed41a7SViresh Kumar 
4785ed41a7SViresh Kumar /*
4885ed41a7SViresh Kumar  * Macro's for first level of pmx - pads as gpio OR peripherals. There are 8
4985ed41a7SViresh Kumar  * registers with 32 bits each for handling gpio pads, register 8 has only 26
5085ed41a7SViresh Kumar  * relevant bits.
5185ed41a7SViresh Kumar  */
5285ed41a7SViresh Kumar /* macro's for making pads as gpio's */
5385ed41a7SViresh Kumar #define PADS_AS_GPIO_REG0_MASK			0xFFFFFFFE
5485ed41a7SViresh Kumar #define PADS_AS_GPIO_REGS_MASK			0xFFFFFFFF
5585ed41a7SViresh Kumar #define PADS_AS_GPIO_REG7_MASK			0x07FFFFFF
5685ed41a7SViresh Kumar 
5785ed41a7SViresh Kumar /* macro's for making pads as peripherals */
5885ed41a7SViresh Kumar #define FSMC_16_BIT_AND_KBD_ROW_COL_REG0_MASK	0x00000FFE
5985ed41a7SViresh Kumar #define UART0_ENH_AND_GPT_REG0_MASK		0x0003F000
6085ed41a7SViresh Kumar #define PWM1_AND_KBD_COL5_REG0_MASK		0x00040000
6185ed41a7SViresh Kumar #define I2C1_REG0_MASK				0x01080000
6285ed41a7SViresh Kumar #define SPDIF_IN_REG0_MASK			0x00100000
6385ed41a7SViresh Kumar #define PWM2_AND_GPT0_TMR0_CPT_REG0_MASK	0x00400000
6485ed41a7SViresh Kumar #define PWM3_AND_GPT0_TMR1_CLK_REG0_MASK	0x00800000
6585ed41a7SViresh Kumar #define PWM0_AND_SSP0_CS1_REG0_MASK		0x02000000
6685ed41a7SViresh Kumar #define VIP_AND_CAM3_REG0_MASK			0xFC200000
6785ed41a7SViresh Kumar #define VIP_AND_CAM3_REG1_MASK			0x0000000F
6885ed41a7SViresh Kumar #define VIP_REG1_MASK				0x00001EF0
6985ed41a7SViresh Kumar #define VIP_AND_CAM2_REG1_MASK			0x007FE100
7085ed41a7SViresh Kumar #define VIP_AND_CAM1_REG1_MASK			0xFF800000
7185ed41a7SViresh Kumar #define VIP_AND_CAM1_REG2_MASK			0x00000003
7285ed41a7SViresh Kumar #define VIP_AND_CAM0_REG2_MASK			0x00001FFC
7385ed41a7SViresh Kumar #define SMI_REG2_MASK				0x0021E000
7485ed41a7SViresh Kumar #define SSP0_REG2_MASK				0x001E0000
7585ed41a7SViresh Kumar #define TS_AND_SSP0_CS2_REG2_MASK		0x00400000
7685ed41a7SViresh Kumar #define UART0_REG2_MASK				0x01800000
7785ed41a7SViresh Kumar #define UART1_REG2_MASK				0x06000000
7885ed41a7SViresh Kumar #define I2S_IN_REG2_MASK			0xF8000000
7985ed41a7SViresh Kumar #define DEVS_GRP_AND_MIPHY_DBG_REG3_MASK	0x000001FE
8085ed41a7SViresh Kumar #define I2S_OUT_REG3_MASK			0x000001EF
8185ed41a7SViresh Kumar #define I2S_IN_REG3_MASK			0x00000010
8285ed41a7SViresh Kumar #define GMAC_REG3_MASK				0xFFFFFE00
8385ed41a7SViresh Kumar #define GMAC_REG4_MASK				0x0000001F
8485ed41a7SViresh Kumar #define DEVS_GRP_AND_MIPHY_DBG_REG4_MASK	0x7FFFFF20
8585ed41a7SViresh Kumar #define SSP0_CS3_REG4_MASK			0x00000020
8685ed41a7SViresh Kumar #define I2C0_REG4_MASK				0x000000C0
8785ed41a7SViresh Kumar #define CEC0_REG4_MASK				0x00000100
8885ed41a7SViresh Kumar #define CEC1_REG4_MASK				0x00000200
8985ed41a7SViresh Kumar #define SPDIF_OUT_REG4_MASK			0x00000400
9085ed41a7SViresh Kumar #define CLCD_REG4_MASK				0x7FFFF800
9185ed41a7SViresh Kumar #define CLCD_AND_ARM_TRACE_REG4_MASK		0x80000000
9285ed41a7SViresh Kumar #define CLCD_AND_ARM_TRACE_REG5_MASK		0xFFFFFFFF
9385ed41a7SViresh Kumar #define CLCD_AND_ARM_TRACE_REG6_MASK		0x00000001
9485ed41a7SViresh Kumar #define FSMC_PNOR_AND_MCIF_REG6_MASK		0x073FFFFE
9585ed41a7SViresh Kumar #define MCIF_REG6_MASK				0xF8C00000
9685ed41a7SViresh Kumar #define MCIF_REG7_MASK				0x000043FF
9785ed41a7SViresh Kumar #define FSMC_8BIT_REG7_MASK			0x07FFBC00
9885ed41a7SViresh Kumar 
9985ed41a7SViresh Kumar /* other registers */
10085ed41a7SViresh Kumar #define PERIP_CFG				0x42C
10185ed41a7SViresh Kumar 	/* PERIP_CFG register masks */
10285ed41a7SViresh Kumar 	#define SSP_CS_CTL_HW			0
10385ed41a7SViresh Kumar 	#define SSP_CS_CTL_SW			1
10485ed41a7SViresh Kumar 	#define SSP_CS_CTL_MASK			1
10585ed41a7SViresh Kumar 	#define SSP_CS_CTL_SHIFT		21
10685ed41a7SViresh Kumar 	#define SSP_CS_VAL_MASK			1
10785ed41a7SViresh Kumar 	#define SSP_CS_VAL_SHIFT		20
10885ed41a7SViresh Kumar 	#define SSP_CS_SEL_CS0			0
10985ed41a7SViresh Kumar 	#define SSP_CS_SEL_CS1			1
11085ed41a7SViresh Kumar 	#define SSP_CS_SEL_CS2			2
11185ed41a7SViresh Kumar 	#define SSP_CS_SEL_MASK			3
11285ed41a7SViresh Kumar 	#define SSP_CS_SEL_SHIFT		18
11385ed41a7SViresh Kumar 
11485ed41a7SViresh Kumar 	#define I2S_CHNL_2_0			(0)
11585ed41a7SViresh Kumar 	#define I2S_CHNL_3_1			(1)
11685ed41a7SViresh Kumar 	#define I2S_CHNL_5_1			(2)
11785ed41a7SViresh Kumar 	#define I2S_CHNL_7_1			(3)
11885ed41a7SViresh Kumar 	#define I2S_CHNL_PLAY_SHIFT		(4)
11985ed41a7SViresh Kumar 	#define I2S_CHNL_PLAY_MASK		(3 << 4)
12085ed41a7SViresh Kumar 	#define I2S_CHNL_REC_SHIFT		(6)
12185ed41a7SViresh Kumar 	#define I2S_CHNL_REC_MASK		(3 << 6)
12285ed41a7SViresh Kumar 
12385ed41a7SViresh Kumar 	#define SPDIF_OUT_ENB_MASK		(1 << 2)
12485ed41a7SViresh Kumar 	#define SPDIF_OUT_ENB_SHIFT		2
12585ed41a7SViresh Kumar 
12685ed41a7SViresh Kumar 	#define MCIF_SEL_SD			1
12785ed41a7SViresh Kumar 	#define MCIF_SEL_CF			2
12885ed41a7SViresh Kumar 	#define MCIF_SEL_XD			3
12985ed41a7SViresh Kumar 	#define MCIF_SEL_MASK			3
13085ed41a7SViresh Kumar 	#define MCIF_SEL_SHIFT			0
13185ed41a7SViresh Kumar 
13285ed41a7SViresh Kumar #define GMAC_CLK_CFG				0x248
13385ed41a7SViresh Kumar 	#define GMAC_PHY_IF_GMII_VAL		(0 << 3)
13485ed41a7SViresh Kumar 	#define GMAC_PHY_IF_RGMII_VAL		(1 << 3)
13585ed41a7SViresh Kumar 	#define GMAC_PHY_IF_SGMII_VAL		(2 << 3)
13685ed41a7SViresh Kumar 	#define GMAC_PHY_IF_RMII_VAL		(4 << 3)
13785ed41a7SViresh Kumar 	#define GMAC_PHY_IF_SEL_MASK		(7 << 3)
13885ed41a7SViresh Kumar 	#define GMAC_PHY_INPUT_ENB_VAL		0
13985ed41a7SViresh Kumar 	#define GMAC_PHY_SYNT_ENB_VAL		1
14085ed41a7SViresh Kumar 	#define GMAC_PHY_CLK_MASK		1
14185ed41a7SViresh Kumar 	#define GMAC_PHY_CLK_SHIFT		2
14285ed41a7SViresh Kumar 	#define GMAC_PHY_125M_PAD_VAL		0
14385ed41a7SViresh Kumar 	#define GMAC_PHY_PLL2_VAL		1
14485ed41a7SViresh Kumar 	#define GMAC_PHY_OSC3_VAL		2
14585ed41a7SViresh Kumar 	#define GMAC_PHY_INPUT_CLK_MASK		3
14685ed41a7SViresh Kumar 	#define GMAC_PHY_INPUT_CLK_SHIFT	0
14785ed41a7SViresh Kumar 
14885ed41a7SViresh Kumar #define PCIE_SATA_CFG				0x424
14985ed41a7SViresh Kumar 	/* PCIE CFG MASks */
15085ed41a7SViresh Kumar 	#define PCIE_CFG_DEVICE_PRESENT		(1 << 11)
15185ed41a7SViresh Kumar 	#define PCIE_CFG_POWERUP_RESET		(1 << 10)
15285ed41a7SViresh Kumar 	#define PCIE_CFG_CORE_CLK_EN		(1 << 9)
15385ed41a7SViresh Kumar 	#define PCIE_CFG_AUX_CLK_EN		(1 << 8)
15485ed41a7SViresh Kumar 	#define SATA_CFG_TX_CLK_EN		(1 << 4)
15585ed41a7SViresh Kumar 	#define SATA_CFG_RX_CLK_EN		(1 << 3)
15685ed41a7SViresh Kumar 	#define SATA_CFG_POWERUP_RESET		(1 << 2)
15785ed41a7SViresh Kumar 	#define SATA_CFG_PM_CLK_EN		(1 << 1)
15885ed41a7SViresh Kumar 	#define PCIE_SATA_SEL_PCIE		(0)
15985ed41a7SViresh Kumar 	#define PCIE_SATA_SEL_SATA		(1)
16085ed41a7SViresh Kumar 	#define SATA_PCIE_CFG_MASK		0xF1F
16185ed41a7SViresh Kumar 	#define PCIE_CFG_VAL	(PCIE_SATA_SEL_PCIE | PCIE_CFG_AUX_CLK_EN | \
16285ed41a7SViresh Kumar 				PCIE_CFG_CORE_CLK_EN | PCIE_CFG_POWERUP_RESET |\
16385ed41a7SViresh Kumar 				PCIE_CFG_DEVICE_PRESENT)
16485ed41a7SViresh Kumar 	#define SATA_CFG_VAL	(PCIE_SATA_SEL_SATA | SATA_CFG_PM_CLK_EN | \
16585ed41a7SViresh Kumar 				SATA_CFG_POWERUP_RESET | SATA_CFG_RX_CLK_EN | \
16685ed41a7SViresh Kumar 				SATA_CFG_TX_CLK_EN)
16785ed41a7SViresh Kumar 
16885ed41a7SViresh Kumar /* Macro's for second level of pmx - pads as primary OR alternate peripheral */
16985ed41a7SViresh Kumar /* Write 0 to enable FSMC_16_BIT */
17085ed41a7SViresh Kumar #define KBD_ROW_COL_MASK			(1 << 0)
17185ed41a7SViresh Kumar 
17285ed41a7SViresh Kumar /* Write 0 to enable UART0_ENH */
17385ed41a7SViresh Kumar #define GPT_MASK				(1 << 1) /* Only clk & cpt */
17485ed41a7SViresh Kumar 
17585ed41a7SViresh Kumar /* Write 0 to enable PWM1 */
17685ed41a7SViresh Kumar #define KBD_COL5_MASK				(1 << 2)
17785ed41a7SViresh Kumar 
17885ed41a7SViresh Kumar /* Write 0 to enable PWM2 */
17985ed41a7SViresh Kumar #define GPT0_TMR0_CPT_MASK			(1 << 3) /* Only clk & cpt */
18085ed41a7SViresh Kumar 
18185ed41a7SViresh Kumar /* Write 0 to enable PWM3 */
18285ed41a7SViresh Kumar #define GPT0_TMR1_CLK_MASK			(1 << 4) /* Only clk & cpt */
18385ed41a7SViresh Kumar 
18485ed41a7SViresh Kumar /* Write 0 to enable PWM0 */
18585ed41a7SViresh Kumar #define SSP0_CS1_MASK				(1 << 5)
18685ed41a7SViresh Kumar 
18785ed41a7SViresh Kumar /* Write 0 to enable VIP */
18885ed41a7SViresh Kumar #define CAM3_MASK				(1 << 6)
18985ed41a7SViresh Kumar 
19085ed41a7SViresh Kumar /* Write 0 to enable VIP */
19185ed41a7SViresh Kumar #define CAM2_MASK				(1 << 7)
19285ed41a7SViresh Kumar 
19385ed41a7SViresh Kumar /* Write 0 to enable VIP */
19485ed41a7SViresh Kumar #define CAM1_MASK				(1 << 8)
19585ed41a7SViresh Kumar 
19685ed41a7SViresh Kumar /* Write 0 to enable VIP */
19785ed41a7SViresh Kumar #define CAM0_MASK				(1 << 9)
19885ed41a7SViresh Kumar 
19985ed41a7SViresh Kumar /* Write 0 to enable TS */
20085ed41a7SViresh Kumar #define SSP0_CS2_MASK				(1 << 10)
20185ed41a7SViresh Kumar 
20285ed41a7SViresh Kumar /* Write 0 to enable FSMC PNOR */
20385ed41a7SViresh Kumar #define MCIF_MASK				(1 << 11)
20485ed41a7SViresh Kumar 
20585ed41a7SViresh Kumar /* Write 0 to enable CLCD */
20685ed41a7SViresh Kumar #define ARM_TRACE_MASK				(1 << 12)
20785ed41a7SViresh Kumar 
20885ed41a7SViresh Kumar /* Write 0 to enable I2S, SSP0_CS2, CEC0, 1, SPDIF out, CLCD */
20985ed41a7SViresh Kumar #define MIPHY_DBG_MASK				(1 << 13)
21085ed41a7SViresh Kumar 
21185ed41a7SViresh Kumar /*
21285ed41a7SViresh Kumar  * Pad multiplexing for making all pads as gpio's. This is done to override the
21385ed41a7SViresh Kumar  * values passed from bootloader and start from scratch.
21485ed41a7SViresh Kumar  */
21535d14806SDeepak Sikri static const unsigned pads_as_gpio_pins[] = { 12, 88, 89, 251 };
21685ed41a7SViresh Kumar static struct spear_muxreg pads_as_gpio_muxreg[] = {
21785ed41a7SViresh Kumar 	{
21885ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_1,
21985ed41a7SViresh Kumar 		.mask = PADS_AS_GPIO_REG0_MASK,
22085ed41a7SViresh Kumar 		.val = 0x0,
22185ed41a7SViresh Kumar 	}, {
22285ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_2,
22385ed41a7SViresh Kumar 		.mask = PADS_AS_GPIO_REGS_MASK,
22485ed41a7SViresh Kumar 		.val = 0x0,
22585ed41a7SViresh Kumar 	}, {
22685ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_3,
22785ed41a7SViresh Kumar 		.mask = PADS_AS_GPIO_REGS_MASK,
22885ed41a7SViresh Kumar 		.val = 0x0,
22985ed41a7SViresh Kumar 	}, {
23085ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_4,
23185ed41a7SViresh Kumar 		.mask = PADS_AS_GPIO_REGS_MASK,
23285ed41a7SViresh Kumar 		.val = 0x0,
23385ed41a7SViresh Kumar 	}, {
23485ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_5,
23585ed41a7SViresh Kumar 		.mask = PADS_AS_GPIO_REGS_MASK,
23685ed41a7SViresh Kumar 		.val = 0x0,
23785ed41a7SViresh Kumar 	}, {
23885ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_6,
23985ed41a7SViresh Kumar 		.mask = PADS_AS_GPIO_REGS_MASK,
24085ed41a7SViresh Kumar 		.val = 0x0,
24185ed41a7SViresh Kumar 	}, {
24285ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_7,
24385ed41a7SViresh Kumar 		.mask = PADS_AS_GPIO_REGS_MASK,
24485ed41a7SViresh Kumar 		.val = 0x0,
24585ed41a7SViresh Kumar 	}, {
24685ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_8,
24785ed41a7SViresh Kumar 		.mask = PADS_AS_GPIO_REG7_MASK,
24885ed41a7SViresh Kumar 		.val = 0x0,
24985ed41a7SViresh Kumar 	},
25085ed41a7SViresh Kumar };
25185ed41a7SViresh Kumar 
25285ed41a7SViresh Kumar static struct spear_modemux pads_as_gpio_modemux[] = {
25385ed41a7SViresh Kumar 	{
25485ed41a7SViresh Kumar 		.muxregs = pads_as_gpio_muxreg,
25585ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(pads_as_gpio_muxreg),
25685ed41a7SViresh Kumar 	},
25785ed41a7SViresh Kumar };
25885ed41a7SViresh Kumar 
25985ed41a7SViresh Kumar static struct spear_pingroup pads_as_gpio_pingroup = {
26085ed41a7SViresh Kumar 	.name = "pads_as_gpio_grp",
26185ed41a7SViresh Kumar 	.pins = pads_as_gpio_pins,
26285ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(pads_as_gpio_pins),
26385ed41a7SViresh Kumar 	.modemuxs = pads_as_gpio_modemux,
26485ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(pads_as_gpio_modemux),
26585ed41a7SViresh Kumar };
26685ed41a7SViresh Kumar 
26785ed41a7SViresh Kumar static const char *const pads_as_gpio_grps[] = { "pads_as_gpio_grp" };
26885ed41a7SViresh Kumar static struct spear_function pads_as_gpio_function = {
26985ed41a7SViresh Kumar 	.name = "pads_as_gpio",
27085ed41a7SViresh Kumar 	.groups = pads_as_gpio_grps,
27185ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(pads_as_gpio_grps),
27285ed41a7SViresh Kumar };
27385ed41a7SViresh Kumar 
27485ed41a7SViresh Kumar /* Pad multiplexing for fsmc_8bit device */
27585ed41a7SViresh Kumar static const unsigned fsmc_8bit_pins[] = { 233, 234, 235, 236, 238, 239, 240,
27685ed41a7SViresh Kumar 	241, 242, 243, 244, 245, 246, 247, 248, 249 };
27785ed41a7SViresh Kumar static struct spear_muxreg fsmc_8bit_muxreg[] = {
27885ed41a7SViresh Kumar 	{
27985ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_8,
28085ed41a7SViresh Kumar 		.mask = FSMC_8BIT_REG7_MASK,
28185ed41a7SViresh Kumar 		.val = FSMC_8BIT_REG7_MASK,
28285ed41a7SViresh Kumar 	}
28385ed41a7SViresh Kumar };
28485ed41a7SViresh Kumar 
28585ed41a7SViresh Kumar static struct spear_modemux fsmc_8bit_modemux[] = {
28685ed41a7SViresh Kumar 	{
28785ed41a7SViresh Kumar 		.muxregs = fsmc_8bit_muxreg,
28885ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(fsmc_8bit_muxreg),
28985ed41a7SViresh Kumar 	},
29085ed41a7SViresh Kumar };
29185ed41a7SViresh Kumar 
29285ed41a7SViresh Kumar static struct spear_pingroup fsmc_8bit_pingroup = {
29385ed41a7SViresh Kumar 	.name = "fsmc_8bit_grp",
29485ed41a7SViresh Kumar 	.pins = fsmc_8bit_pins,
29585ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(fsmc_8bit_pins),
29685ed41a7SViresh Kumar 	.modemuxs = fsmc_8bit_modemux,
29785ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(fsmc_8bit_modemux),
29885ed41a7SViresh Kumar };
29985ed41a7SViresh Kumar 
30085ed41a7SViresh Kumar /* Pad multiplexing for fsmc_16bit device */
30185ed41a7SViresh Kumar static const unsigned fsmc_16bit_pins[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
30285ed41a7SViresh Kumar static struct spear_muxreg fsmc_16bit_muxreg[] = {
30385ed41a7SViresh Kumar 	{
30485ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,
30585ed41a7SViresh Kumar 		.mask = KBD_ROW_COL_MASK,
30685ed41a7SViresh Kumar 		.val = 0,
30785ed41a7SViresh Kumar 	}, {
30885ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_1,
30985ed41a7SViresh Kumar 		.mask = FSMC_16_BIT_AND_KBD_ROW_COL_REG0_MASK,
31085ed41a7SViresh Kumar 		.val = FSMC_16_BIT_AND_KBD_ROW_COL_REG0_MASK,
31185ed41a7SViresh Kumar 	},
31285ed41a7SViresh Kumar };
31385ed41a7SViresh Kumar 
31485ed41a7SViresh Kumar static struct spear_modemux fsmc_16bit_modemux[] = {
31585ed41a7SViresh Kumar 	{
31685ed41a7SViresh Kumar 		.muxregs = fsmc_16bit_muxreg,
31785ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(fsmc_16bit_muxreg),
31885ed41a7SViresh Kumar 	},
31985ed41a7SViresh Kumar };
32085ed41a7SViresh Kumar 
32185ed41a7SViresh Kumar static struct spear_pingroup fsmc_16bit_pingroup = {
32285ed41a7SViresh Kumar 	.name = "fsmc_16bit_grp",
32385ed41a7SViresh Kumar 	.pins = fsmc_16bit_pins,
32485ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(fsmc_16bit_pins),
32585ed41a7SViresh Kumar 	.modemuxs = fsmc_16bit_modemux,
32685ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(fsmc_16bit_modemux),
32785ed41a7SViresh Kumar };
32885ed41a7SViresh Kumar 
32985ed41a7SViresh Kumar /* pad multiplexing for fsmc_pnor device */
33085ed41a7SViresh Kumar static const unsigned fsmc_pnor_pins[] = { 192, 193, 194, 195, 196, 197, 198,
33185ed41a7SViresh Kumar 	199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212,
33285ed41a7SViresh Kumar 	215, 216, 217 };
33385ed41a7SViresh Kumar static struct spear_muxreg fsmc_pnor_muxreg[] = {
33485ed41a7SViresh Kumar 	{
33585ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,
33685ed41a7SViresh Kumar 		.mask = MCIF_MASK,
33785ed41a7SViresh Kumar 		.val = 0,
33885ed41a7SViresh Kumar 	}, {
33985ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_7,
34085ed41a7SViresh Kumar 		.mask = FSMC_PNOR_AND_MCIF_REG6_MASK,
34185ed41a7SViresh Kumar 		.val = FSMC_PNOR_AND_MCIF_REG6_MASK,
34285ed41a7SViresh Kumar 	},
34385ed41a7SViresh Kumar };
34485ed41a7SViresh Kumar 
34585ed41a7SViresh Kumar static struct spear_modemux fsmc_pnor_modemux[] = {
34685ed41a7SViresh Kumar 	{
34785ed41a7SViresh Kumar 		.muxregs = fsmc_pnor_muxreg,
34885ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(fsmc_pnor_muxreg),
34985ed41a7SViresh Kumar 	},
35085ed41a7SViresh Kumar };
35185ed41a7SViresh Kumar 
35285ed41a7SViresh Kumar static struct spear_pingroup fsmc_pnor_pingroup = {
35385ed41a7SViresh Kumar 	.name = "fsmc_pnor_grp",
35485ed41a7SViresh Kumar 	.pins = fsmc_pnor_pins,
35585ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(fsmc_pnor_pins),
35685ed41a7SViresh Kumar 	.modemuxs = fsmc_pnor_modemux,
35785ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(fsmc_pnor_modemux),
35885ed41a7SViresh Kumar };
35985ed41a7SViresh Kumar 
36085ed41a7SViresh Kumar static const char *const fsmc_grps[] = { "fsmc_8bit_grp", "fsmc_16bit_grp",
36185ed41a7SViresh Kumar 	"fsmc_pnor_grp" };
36285ed41a7SViresh Kumar static struct spear_function fsmc_function = {
36385ed41a7SViresh Kumar 	.name = "fsmc",
36485ed41a7SViresh Kumar 	.groups = fsmc_grps,
36585ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(fsmc_grps),
36685ed41a7SViresh Kumar };
36785ed41a7SViresh Kumar 
36885ed41a7SViresh Kumar /* pad multiplexing for keyboard rows-cols device */
36985ed41a7SViresh Kumar static const unsigned keyboard_row_col_pins[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
37085ed41a7SViresh Kumar 	10 };
37185ed41a7SViresh Kumar static struct spear_muxreg keyboard_row_col_muxreg[] = {
37285ed41a7SViresh Kumar 	{
37385ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,
37485ed41a7SViresh Kumar 		.mask = KBD_ROW_COL_MASK,
37585ed41a7SViresh Kumar 		.val = KBD_ROW_COL_MASK,
37685ed41a7SViresh Kumar 	}, {
37785ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_1,
37885ed41a7SViresh Kumar 		.mask = FSMC_16_BIT_AND_KBD_ROW_COL_REG0_MASK,
37985ed41a7SViresh Kumar 		.val = FSMC_16_BIT_AND_KBD_ROW_COL_REG0_MASK,
38085ed41a7SViresh Kumar 	},
38185ed41a7SViresh Kumar };
38285ed41a7SViresh Kumar 
38385ed41a7SViresh Kumar static struct spear_modemux keyboard_row_col_modemux[] = {
38485ed41a7SViresh Kumar 	{
38585ed41a7SViresh Kumar 		.muxregs = keyboard_row_col_muxreg,
38685ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(keyboard_row_col_muxreg),
38785ed41a7SViresh Kumar 	},
38885ed41a7SViresh Kumar };
38985ed41a7SViresh Kumar 
39085ed41a7SViresh Kumar static struct spear_pingroup keyboard_row_col_pingroup = {
39185ed41a7SViresh Kumar 	.name = "keyboard_row_col_grp",
39285ed41a7SViresh Kumar 	.pins = keyboard_row_col_pins,
39385ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(keyboard_row_col_pins),
39485ed41a7SViresh Kumar 	.modemuxs = keyboard_row_col_modemux,
39585ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(keyboard_row_col_modemux),
39685ed41a7SViresh Kumar };
39785ed41a7SViresh Kumar 
39885ed41a7SViresh Kumar /* pad multiplexing for keyboard col5 device */
39985ed41a7SViresh Kumar static const unsigned keyboard_col5_pins[] = { 17 };
40085ed41a7SViresh Kumar static struct spear_muxreg keyboard_col5_muxreg[] = {
40185ed41a7SViresh Kumar 	{
40285ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,
40385ed41a7SViresh Kumar 		.mask = KBD_COL5_MASK,
40485ed41a7SViresh Kumar 		.val = KBD_COL5_MASK,
40585ed41a7SViresh Kumar 	}, {
40685ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_1,
40785ed41a7SViresh Kumar 		.mask = PWM1_AND_KBD_COL5_REG0_MASK,
40885ed41a7SViresh Kumar 		.val = PWM1_AND_KBD_COL5_REG0_MASK,
40985ed41a7SViresh Kumar 	},
41085ed41a7SViresh Kumar };
41185ed41a7SViresh Kumar 
41285ed41a7SViresh Kumar static struct spear_modemux keyboard_col5_modemux[] = {
41385ed41a7SViresh Kumar 	{
41485ed41a7SViresh Kumar 		.muxregs = keyboard_col5_muxreg,
41585ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(keyboard_col5_muxreg),
41685ed41a7SViresh Kumar 	},
41785ed41a7SViresh Kumar };
41885ed41a7SViresh Kumar 
41985ed41a7SViresh Kumar static struct spear_pingroup keyboard_col5_pingroup = {
42085ed41a7SViresh Kumar 	.name = "keyboard_col5_grp",
42185ed41a7SViresh Kumar 	.pins = keyboard_col5_pins,
42285ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(keyboard_col5_pins),
42385ed41a7SViresh Kumar 	.modemuxs = keyboard_col5_modemux,
42485ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(keyboard_col5_modemux),
42585ed41a7SViresh Kumar };
42685ed41a7SViresh Kumar 
42785ed41a7SViresh Kumar static const char *const keyboard_grps[] = { "keyboard_row_col_grp",
42885ed41a7SViresh Kumar 	"keyboard_col5_grp" };
42985ed41a7SViresh Kumar static struct spear_function keyboard_function = {
43085ed41a7SViresh Kumar 	.name = "keyboard",
43185ed41a7SViresh Kumar 	.groups = keyboard_grps,
43285ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(keyboard_grps),
43385ed41a7SViresh Kumar };
43485ed41a7SViresh Kumar 
43585ed41a7SViresh Kumar /* pad multiplexing for spdif_in device */
43685ed41a7SViresh Kumar static const unsigned spdif_in_pins[] = { 19 };
43785ed41a7SViresh Kumar static struct spear_muxreg spdif_in_muxreg[] = {
43885ed41a7SViresh Kumar 	{
43985ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_1,
44085ed41a7SViresh Kumar 		.mask = SPDIF_IN_REG0_MASK,
44185ed41a7SViresh Kumar 		.val = SPDIF_IN_REG0_MASK,
44285ed41a7SViresh Kumar 	},
44385ed41a7SViresh Kumar };
44485ed41a7SViresh Kumar 
44585ed41a7SViresh Kumar static struct spear_modemux spdif_in_modemux[] = {
44685ed41a7SViresh Kumar 	{
44785ed41a7SViresh Kumar 		.muxregs = spdif_in_muxreg,
44885ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(spdif_in_muxreg),
44985ed41a7SViresh Kumar 	},
45085ed41a7SViresh Kumar };
45185ed41a7SViresh Kumar 
45285ed41a7SViresh Kumar static struct spear_pingroup spdif_in_pingroup = {
45385ed41a7SViresh Kumar 	.name = "spdif_in_grp",
45485ed41a7SViresh Kumar 	.pins = spdif_in_pins,
45585ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(spdif_in_pins),
45685ed41a7SViresh Kumar 	.modemuxs = spdif_in_modemux,
45785ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(spdif_in_modemux),
45885ed41a7SViresh Kumar };
45985ed41a7SViresh Kumar 
46085ed41a7SViresh Kumar static const char *const spdif_in_grps[] = { "spdif_in_grp" };
46185ed41a7SViresh Kumar static struct spear_function spdif_in_function = {
46285ed41a7SViresh Kumar 	.name = "spdif_in",
46385ed41a7SViresh Kumar 	.groups = spdif_in_grps,
46485ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(spdif_in_grps),
46585ed41a7SViresh Kumar };
46685ed41a7SViresh Kumar 
46785ed41a7SViresh Kumar /* pad multiplexing for spdif_out device */
46885ed41a7SViresh Kumar static const unsigned spdif_out_pins[] = { 137 };
46985ed41a7SViresh Kumar static struct spear_muxreg spdif_out_muxreg[] = {
47085ed41a7SViresh Kumar 	{
47185ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_5,
47285ed41a7SViresh Kumar 		.mask = SPDIF_OUT_REG4_MASK,
47385ed41a7SViresh Kumar 		.val = SPDIF_OUT_REG4_MASK,
47485ed41a7SViresh Kumar 	}, {
47585ed41a7SViresh Kumar 		.reg = PERIP_CFG,
47685ed41a7SViresh Kumar 		.mask = SPDIF_OUT_ENB_MASK,
47785ed41a7SViresh Kumar 		.val = SPDIF_OUT_ENB_MASK,
47885ed41a7SViresh Kumar 	}
47985ed41a7SViresh Kumar };
48085ed41a7SViresh Kumar 
48185ed41a7SViresh Kumar static struct spear_modemux spdif_out_modemux[] = {
48285ed41a7SViresh Kumar 	{
48385ed41a7SViresh Kumar 		.muxregs = spdif_out_muxreg,
48485ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(spdif_out_muxreg),
48585ed41a7SViresh Kumar 	},
48685ed41a7SViresh Kumar };
48785ed41a7SViresh Kumar 
48885ed41a7SViresh Kumar static struct spear_pingroup spdif_out_pingroup = {
48985ed41a7SViresh Kumar 	.name = "spdif_out_grp",
49085ed41a7SViresh Kumar 	.pins = spdif_out_pins,
49185ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(spdif_out_pins),
49285ed41a7SViresh Kumar 	.modemuxs = spdif_out_modemux,
49385ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(spdif_out_modemux),
49485ed41a7SViresh Kumar };
49585ed41a7SViresh Kumar 
49685ed41a7SViresh Kumar static const char *const spdif_out_grps[] = { "spdif_out_grp" };
49785ed41a7SViresh Kumar static struct spear_function spdif_out_function = {
49885ed41a7SViresh Kumar 	.name = "spdif_out",
49985ed41a7SViresh Kumar 	.groups = spdif_out_grps,
50085ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(spdif_out_grps),
50185ed41a7SViresh Kumar };
50285ed41a7SViresh Kumar 
50385ed41a7SViresh Kumar /* pad multiplexing for gpt_0_1 device */
50485ed41a7SViresh Kumar static const unsigned gpt_0_1_pins[] = { 11, 12, 13, 14, 15, 16, 21, 22 };
50585ed41a7SViresh Kumar static struct spear_muxreg gpt_0_1_muxreg[] = {
50685ed41a7SViresh Kumar 	{
50785ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,
50885ed41a7SViresh Kumar 		.mask = GPT_MASK | GPT0_TMR0_CPT_MASK | GPT0_TMR1_CLK_MASK,
50985ed41a7SViresh Kumar 		.val = GPT_MASK | GPT0_TMR0_CPT_MASK | GPT0_TMR1_CLK_MASK,
51085ed41a7SViresh Kumar 	}, {
51185ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_1,
51285ed41a7SViresh Kumar 		.mask = UART0_ENH_AND_GPT_REG0_MASK |
51385ed41a7SViresh Kumar 			PWM2_AND_GPT0_TMR0_CPT_REG0_MASK |
51485ed41a7SViresh Kumar 			PWM3_AND_GPT0_TMR1_CLK_REG0_MASK,
51585ed41a7SViresh Kumar 		.val = UART0_ENH_AND_GPT_REG0_MASK |
51685ed41a7SViresh Kumar 			PWM2_AND_GPT0_TMR0_CPT_REG0_MASK |
51785ed41a7SViresh Kumar 			PWM3_AND_GPT0_TMR1_CLK_REG0_MASK,
51885ed41a7SViresh Kumar 	},
51985ed41a7SViresh Kumar };
52085ed41a7SViresh Kumar 
52185ed41a7SViresh Kumar static struct spear_modemux gpt_0_1_modemux[] = {
52285ed41a7SViresh Kumar 	{
52385ed41a7SViresh Kumar 		.muxregs = gpt_0_1_muxreg,
52485ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(gpt_0_1_muxreg),
52585ed41a7SViresh Kumar 	},
52685ed41a7SViresh Kumar };
52785ed41a7SViresh Kumar 
52885ed41a7SViresh Kumar static struct spear_pingroup gpt_0_1_pingroup = {
52985ed41a7SViresh Kumar 	.name = "gpt_0_1_grp",
53085ed41a7SViresh Kumar 	.pins = gpt_0_1_pins,
53185ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(gpt_0_1_pins),
53285ed41a7SViresh Kumar 	.modemuxs = gpt_0_1_modemux,
53385ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(gpt_0_1_modemux),
53485ed41a7SViresh Kumar };
53585ed41a7SViresh Kumar 
53685ed41a7SViresh Kumar static const char *const gpt_0_1_grps[] = { "gpt_0_1_grp" };
53785ed41a7SViresh Kumar static struct spear_function gpt_0_1_function = {
53885ed41a7SViresh Kumar 	.name = "gpt_0_1",
53985ed41a7SViresh Kumar 	.groups = gpt_0_1_grps,
54085ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(gpt_0_1_grps),
54185ed41a7SViresh Kumar };
54285ed41a7SViresh Kumar 
54385ed41a7SViresh Kumar /* pad multiplexing for pwm0 device */
54485ed41a7SViresh Kumar static const unsigned pwm0_pins[] = { 24 };
54585ed41a7SViresh Kumar static struct spear_muxreg pwm0_muxreg[] = {
54685ed41a7SViresh Kumar 	{
54785ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,
54885ed41a7SViresh Kumar 		.mask = SSP0_CS1_MASK,
54985ed41a7SViresh Kumar 		.val = 0,
55085ed41a7SViresh Kumar 	}, {
55185ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_1,
55285ed41a7SViresh Kumar 		.mask = PWM0_AND_SSP0_CS1_REG0_MASK,
55385ed41a7SViresh Kumar 		.val = PWM0_AND_SSP0_CS1_REG0_MASK,
55485ed41a7SViresh Kumar 	},
55585ed41a7SViresh Kumar };
55685ed41a7SViresh Kumar 
55785ed41a7SViresh Kumar static struct spear_modemux pwm0_modemux[] = {
55885ed41a7SViresh Kumar 	{
55985ed41a7SViresh Kumar 		.muxregs = pwm0_muxreg,
56085ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(pwm0_muxreg),
56185ed41a7SViresh Kumar 	},
56285ed41a7SViresh Kumar };
56385ed41a7SViresh Kumar 
56485ed41a7SViresh Kumar static struct spear_pingroup pwm0_pingroup = {
56585ed41a7SViresh Kumar 	.name = "pwm0_grp",
56685ed41a7SViresh Kumar 	.pins = pwm0_pins,
56785ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(pwm0_pins),
56885ed41a7SViresh Kumar 	.modemuxs = pwm0_modemux,
56985ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(pwm0_modemux),
57085ed41a7SViresh Kumar };
57185ed41a7SViresh Kumar 
57285ed41a7SViresh Kumar /* pad multiplexing for pwm1 device */
57385ed41a7SViresh Kumar static const unsigned pwm1_pins[] = { 17 };
57485ed41a7SViresh Kumar static struct spear_muxreg pwm1_muxreg[] = {
57585ed41a7SViresh Kumar 	{
57685ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,
57785ed41a7SViresh Kumar 		.mask = KBD_COL5_MASK,
57885ed41a7SViresh Kumar 		.val = 0,
57985ed41a7SViresh Kumar 	}, {
58085ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_1,
58185ed41a7SViresh Kumar 		.mask = PWM1_AND_KBD_COL5_REG0_MASK,
58285ed41a7SViresh Kumar 		.val = PWM1_AND_KBD_COL5_REG0_MASK,
58385ed41a7SViresh Kumar 	},
58485ed41a7SViresh Kumar };
58585ed41a7SViresh Kumar 
58685ed41a7SViresh Kumar static struct spear_modemux pwm1_modemux[] = {
58785ed41a7SViresh Kumar 	{
58885ed41a7SViresh Kumar 		.muxregs = pwm1_muxreg,
58985ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(pwm1_muxreg),
59085ed41a7SViresh Kumar 	},
59185ed41a7SViresh Kumar };
59285ed41a7SViresh Kumar 
59385ed41a7SViresh Kumar static struct spear_pingroup pwm1_pingroup = {
59485ed41a7SViresh Kumar 	.name = "pwm1_grp",
59585ed41a7SViresh Kumar 	.pins = pwm1_pins,
59685ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(pwm1_pins),
59785ed41a7SViresh Kumar 	.modemuxs = pwm1_modemux,
59885ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(pwm1_modemux),
59985ed41a7SViresh Kumar };
60085ed41a7SViresh Kumar 
60185ed41a7SViresh Kumar /* pad multiplexing for pwm2 device */
60285ed41a7SViresh Kumar static const unsigned pwm2_pins[] = { 21 };
60385ed41a7SViresh Kumar static struct spear_muxreg pwm2_muxreg[] = {
60485ed41a7SViresh Kumar 	{
60585ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,
60685ed41a7SViresh Kumar 		.mask = GPT0_TMR0_CPT_MASK,
60785ed41a7SViresh Kumar 		.val = 0,
60885ed41a7SViresh Kumar 	}, {
60985ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_1,
61085ed41a7SViresh Kumar 		.mask = PWM2_AND_GPT0_TMR0_CPT_REG0_MASK,
61185ed41a7SViresh Kumar 		.val = PWM2_AND_GPT0_TMR0_CPT_REG0_MASK,
61285ed41a7SViresh Kumar 	},
61385ed41a7SViresh Kumar };
61485ed41a7SViresh Kumar 
61585ed41a7SViresh Kumar static struct spear_modemux pwm2_modemux[] = {
61685ed41a7SViresh Kumar 	{
61785ed41a7SViresh Kumar 		.muxregs = pwm2_muxreg,
61885ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(pwm2_muxreg),
61985ed41a7SViresh Kumar 	},
62085ed41a7SViresh Kumar };
62185ed41a7SViresh Kumar 
62285ed41a7SViresh Kumar static struct spear_pingroup pwm2_pingroup = {
62385ed41a7SViresh Kumar 	.name = "pwm2_grp",
62485ed41a7SViresh Kumar 	.pins = pwm2_pins,
62585ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(pwm2_pins),
62685ed41a7SViresh Kumar 	.modemuxs = pwm2_modemux,
62785ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(pwm2_modemux),
62885ed41a7SViresh Kumar };
62985ed41a7SViresh Kumar 
63085ed41a7SViresh Kumar /* pad multiplexing for pwm3 device */
63185ed41a7SViresh Kumar static const unsigned pwm3_pins[] = { 22 };
63285ed41a7SViresh Kumar static struct spear_muxreg pwm3_muxreg[] = {
63385ed41a7SViresh Kumar 	{
63485ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,
63585ed41a7SViresh Kumar 		.mask = GPT0_TMR1_CLK_MASK,
63685ed41a7SViresh Kumar 		.val = 0,
63785ed41a7SViresh Kumar 	}, {
63885ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_1,
63985ed41a7SViresh Kumar 		.mask = PWM3_AND_GPT0_TMR1_CLK_REG0_MASK,
64085ed41a7SViresh Kumar 		.val = PWM3_AND_GPT0_TMR1_CLK_REG0_MASK,
64185ed41a7SViresh Kumar 	},
64285ed41a7SViresh Kumar };
64385ed41a7SViresh Kumar 
64485ed41a7SViresh Kumar static struct spear_modemux pwm3_modemux[] = {
64585ed41a7SViresh Kumar 	{
64685ed41a7SViresh Kumar 		.muxregs = pwm3_muxreg,
64785ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(pwm3_muxreg),
64885ed41a7SViresh Kumar 	},
64985ed41a7SViresh Kumar };
65085ed41a7SViresh Kumar 
65185ed41a7SViresh Kumar static struct spear_pingroup pwm3_pingroup = {
65285ed41a7SViresh Kumar 	.name = "pwm3_grp",
65385ed41a7SViresh Kumar 	.pins = pwm3_pins,
65485ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(pwm3_pins),
65585ed41a7SViresh Kumar 	.modemuxs = pwm3_modemux,
65685ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(pwm3_modemux),
65785ed41a7SViresh Kumar };
65885ed41a7SViresh Kumar 
65985ed41a7SViresh Kumar static const char *const pwm_grps[] = { "pwm0_grp", "pwm1_grp", "pwm2_grp",
66085ed41a7SViresh Kumar 	"pwm3_grp" };
66185ed41a7SViresh Kumar static struct spear_function pwm_function = {
66285ed41a7SViresh Kumar 	.name = "pwm",
66385ed41a7SViresh Kumar 	.groups = pwm_grps,
66485ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(pwm_grps),
66585ed41a7SViresh Kumar };
66685ed41a7SViresh Kumar 
66785ed41a7SViresh Kumar /* pad multiplexing for vip_mux device */
66885ed41a7SViresh Kumar static const unsigned vip_mux_pins[] = { 35, 36, 37, 38, 40, 41, 42, 43 };
66985ed41a7SViresh Kumar static struct spear_muxreg vip_mux_muxreg[] = {
67085ed41a7SViresh Kumar 	{
67185ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_2,
67285ed41a7SViresh Kumar 		.mask = VIP_REG1_MASK,
67385ed41a7SViresh Kumar 		.val = VIP_REG1_MASK,
67485ed41a7SViresh Kumar 	},
67585ed41a7SViresh Kumar };
67685ed41a7SViresh Kumar 
67785ed41a7SViresh Kumar static struct spear_modemux vip_mux_modemux[] = {
67885ed41a7SViresh Kumar 	{
67985ed41a7SViresh Kumar 		.muxregs = vip_mux_muxreg,
68085ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(vip_mux_muxreg),
68185ed41a7SViresh Kumar 	},
68285ed41a7SViresh Kumar };
68385ed41a7SViresh Kumar 
68485ed41a7SViresh Kumar static struct spear_pingroup vip_mux_pingroup = {
68585ed41a7SViresh Kumar 	.name = "vip_mux_grp",
68685ed41a7SViresh Kumar 	.pins = vip_mux_pins,
68785ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(vip_mux_pins),
68885ed41a7SViresh Kumar 	.modemuxs = vip_mux_modemux,
68985ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(vip_mux_modemux),
69085ed41a7SViresh Kumar };
69185ed41a7SViresh Kumar 
69285ed41a7SViresh Kumar /* pad multiplexing for vip_mux_cam0 (disables cam0) device */
69385ed41a7SViresh Kumar static const unsigned vip_mux_cam0_pins[] = { 65, 66, 67, 68, 69, 70, 71, 72,
69485ed41a7SViresh Kumar 	73, 74, 75 };
69585ed41a7SViresh Kumar static struct spear_muxreg vip_mux_cam0_muxreg[] = {
69685ed41a7SViresh Kumar 	{
69785ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,
69885ed41a7SViresh Kumar 		.mask = CAM0_MASK,
69985ed41a7SViresh Kumar 		.val = 0,
70085ed41a7SViresh Kumar 	}, {
70185ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_3,
70285ed41a7SViresh Kumar 		.mask = VIP_AND_CAM0_REG2_MASK,
70385ed41a7SViresh Kumar 		.val = VIP_AND_CAM0_REG2_MASK,
70485ed41a7SViresh Kumar 	},
70585ed41a7SViresh Kumar };
70685ed41a7SViresh Kumar 
70785ed41a7SViresh Kumar static struct spear_modemux vip_mux_cam0_modemux[] = {
70885ed41a7SViresh Kumar 	{
70985ed41a7SViresh Kumar 		.muxregs = vip_mux_cam0_muxreg,
71085ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(vip_mux_cam0_muxreg),
71185ed41a7SViresh Kumar 	},
71285ed41a7SViresh Kumar };
71385ed41a7SViresh Kumar 
71485ed41a7SViresh Kumar static struct spear_pingroup vip_mux_cam0_pingroup = {
71585ed41a7SViresh Kumar 	.name = "vip_mux_cam0_grp",
71685ed41a7SViresh Kumar 	.pins = vip_mux_cam0_pins,
71785ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(vip_mux_cam0_pins),
71885ed41a7SViresh Kumar 	.modemuxs = vip_mux_cam0_modemux,
71985ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(vip_mux_cam0_modemux),
72085ed41a7SViresh Kumar };
72185ed41a7SViresh Kumar 
72285ed41a7SViresh Kumar /* pad multiplexing for vip_mux_cam1 (disables cam1) device */
72385ed41a7SViresh Kumar static const unsigned vip_mux_cam1_pins[] = { 54, 55, 56, 57, 58, 59, 60, 61,
72485ed41a7SViresh Kumar 	62, 63, 64 };
72585ed41a7SViresh Kumar static struct spear_muxreg vip_mux_cam1_muxreg[] = {
72685ed41a7SViresh Kumar 	{
72785ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,
72885ed41a7SViresh Kumar 		.mask = CAM1_MASK,
72985ed41a7SViresh Kumar 		.val = 0,
73085ed41a7SViresh Kumar 	}, {
73185ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_2,
73285ed41a7SViresh Kumar 		.mask = VIP_AND_CAM1_REG1_MASK,
73385ed41a7SViresh Kumar 		.val = VIP_AND_CAM1_REG1_MASK,
73485ed41a7SViresh Kumar 	}, {
73585ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_3,
73685ed41a7SViresh Kumar 		.mask = VIP_AND_CAM1_REG2_MASK,
73785ed41a7SViresh Kumar 		.val = VIP_AND_CAM1_REG2_MASK,
73885ed41a7SViresh Kumar 	},
73985ed41a7SViresh Kumar };
74085ed41a7SViresh Kumar 
74185ed41a7SViresh Kumar static struct spear_modemux vip_mux_cam1_modemux[] = {
74285ed41a7SViresh Kumar 	{
74385ed41a7SViresh Kumar 		.muxregs = vip_mux_cam1_muxreg,
74485ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(vip_mux_cam1_muxreg),
74585ed41a7SViresh Kumar 	},
74685ed41a7SViresh Kumar };
74785ed41a7SViresh Kumar 
74885ed41a7SViresh Kumar static struct spear_pingroup vip_mux_cam1_pingroup = {
74985ed41a7SViresh Kumar 	.name = "vip_mux_cam1_grp",
75085ed41a7SViresh Kumar 	.pins = vip_mux_cam1_pins,
75185ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(vip_mux_cam1_pins),
75285ed41a7SViresh Kumar 	.modemuxs = vip_mux_cam1_modemux,
75385ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(vip_mux_cam1_modemux),
75485ed41a7SViresh Kumar };
75585ed41a7SViresh Kumar 
75685ed41a7SViresh Kumar /* pad multiplexing for vip_mux_cam2 (disables cam2) device */
75785ed41a7SViresh Kumar static const unsigned vip_mux_cam2_pins[] = { 39, 44, 45, 46, 47, 48, 49, 50,
75885ed41a7SViresh Kumar 	51, 52, 53 };
75985ed41a7SViresh Kumar static struct spear_muxreg vip_mux_cam2_muxreg[] = {
76085ed41a7SViresh Kumar 	{
76185ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,
76285ed41a7SViresh Kumar 		.mask = CAM2_MASK,
76385ed41a7SViresh Kumar 		.val = 0,
76485ed41a7SViresh Kumar 	}, {
76585ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_2,
76685ed41a7SViresh Kumar 		.mask = VIP_AND_CAM2_REG1_MASK,
76785ed41a7SViresh Kumar 		.val = VIP_AND_CAM2_REG1_MASK,
76885ed41a7SViresh Kumar 	},
76985ed41a7SViresh Kumar };
77085ed41a7SViresh Kumar 
77185ed41a7SViresh Kumar static struct spear_modemux vip_mux_cam2_modemux[] = {
77285ed41a7SViresh Kumar 	{
77385ed41a7SViresh Kumar 		.muxregs = vip_mux_cam2_muxreg,
77485ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(vip_mux_cam2_muxreg),
77585ed41a7SViresh Kumar 	},
77685ed41a7SViresh Kumar };
77785ed41a7SViresh Kumar 
77885ed41a7SViresh Kumar static struct spear_pingroup vip_mux_cam2_pingroup = {
77985ed41a7SViresh Kumar 	.name = "vip_mux_cam2_grp",
78085ed41a7SViresh Kumar 	.pins = vip_mux_cam2_pins,
78185ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(vip_mux_cam2_pins),
78285ed41a7SViresh Kumar 	.modemuxs = vip_mux_cam2_modemux,
78385ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(vip_mux_cam2_modemux),
78485ed41a7SViresh Kumar };
78585ed41a7SViresh Kumar 
78685ed41a7SViresh Kumar /* pad multiplexing for vip_mux_cam3 (disables cam3) device */
78785ed41a7SViresh Kumar static const unsigned vip_mux_cam3_pins[] = { 20, 25, 26, 27, 28, 29, 30, 31,
78885ed41a7SViresh Kumar 	32, 33, 34 };
78985ed41a7SViresh Kumar static struct spear_muxreg vip_mux_cam3_muxreg[] = {
79085ed41a7SViresh Kumar 	{
79185ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,
79285ed41a7SViresh Kumar 		.mask = CAM3_MASK,
79385ed41a7SViresh Kumar 		.val = 0,
79485ed41a7SViresh Kumar 	}, {
79585ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_1,
79685ed41a7SViresh Kumar 		.mask = VIP_AND_CAM3_REG0_MASK,
79785ed41a7SViresh Kumar 		.val = VIP_AND_CAM3_REG0_MASK,
79885ed41a7SViresh Kumar 	}, {
79985ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_2,
80085ed41a7SViresh Kumar 		.mask = VIP_AND_CAM3_REG1_MASK,
80185ed41a7SViresh Kumar 		.val = VIP_AND_CAM3_REG1_MASK,
80285ed41a7SViresh Kumar 	},
80385ed41a7SViresh Kumar };
80485ed41a7SViresh Kumar 
80585ed41a7SViresh Kumar static struct spear_modemux vip_mux_cam3_modemux[] = {
80685ed41a7SViresh Kumar 	{
80785ed41a7SViresh Kumar 		.muxregs = vip_mux_cam3_muxreg,
80885ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(vip_mux_cam3_muxreg),
80985ed41a7SViresh Kumar 	},
81085ed41a7SViresh Kumar };
81185ed41a7SViresh Kumar 
81285ed41a7SViresh Kumar static struct spear_pingroup vip_mux_cam3_pingroup = {
81385ed41a7SViresh Kumar 	.name = "vip_mux_cam3_grp",
81485ed41a7SViresh Kumar 	.pins = vip_mux_cam3_pins,
81585ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(vip_mux_cam3_pins),
81685ed41a7SViresh Kumar 	.modemuxs = vip_mux_cam3_modemux,
81785ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(vip_mux_cam3_modemux),
81885ed41a7SViresh Kumar };
81985ed41a7SViresh Kumar 
82085ed41a7SViresh Kumar static const char *const vip_grps[] = { "vip_mux_grp", "vip_mux_cam0_grp" ,
82185ed41a7SViresh Kumar 	"vip_mux_cam1_grp" , "vip_mux_cam2_grp", "vip_mux_cam3_grp" };
82285ed41a7SViresh Kumar static struct spear_function vip_function = {
82385ed41a7SViresh Kumar 	.name = "vip",
82485ed41a7SViresh Kumar 	.groups = vip_grps,
82585ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(vip_grps),
82685ed41a7SViresh Kumar };
82785ed41a7SViresh Kumar 
82885ed41a7SViresh Kumar /* pad multiplexing for cam0 device */
82985ed41a7SViresh Kumar static const unsigned cam0_pins[] = { 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75
83085ed41a7SViresh Kumar };
83185ed41a7SViresh Kumar static struct spear_muxreg cam0_muxreg[] = {
83285ed41a7SViresh Kumar 	{
83385ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,
83485ed41a7SViresh Kumar 		.mask = CAM0_MASK,
83585ed41a7SViresh Kumar 		.val = CAM0_MASK,
83685ed41a7SViresh Kumar 	}, {
83785ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_3,
83885ed41a7SViresh Kumar 		.mask = VIP_AND_CAM0_REG2_MASK,
83985ed41a7SViresh Kumar 		.val = VIP_AND_CAM0_REG2_MASK,
84085ed41a7SViresh Kumar 	},
84185ed41a7SViresh Kumar };
84285ed41a7SViresh Kumar 
84385ed41a7SViresh Kumar static struct spear_modemux cam0_modemux[] = {
84485ed41a7SViresh Kumar 	{
84585ed41a7SViresh Kumar 		.muxregs = cam0_muxreg,
84685ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(cam0_muxreg),
84785ed41a7SViresh Kumar 	},
84885ed41a7SViresh Kumar };
84985ed41a7SViresh Kumar 
85085ed41a7SViresh Kumar static struct spear_pingroup cam0_pingroup = {
85185ed41a7SViresh Kumar 	.name = "cam0_grp",
85285ed41a7SViresh Kumar 	.pins = cam0_pins,
85385ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(cam0_pins),
85485ed41a7SViresh Kumar 	.modemuxs = cam0_modemux,
85585ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(cam0_modemux),
85685ed41a7SViresh Kumar };
85785ed41a7SViresh Kumar 
85885ed41a7SViresh Kumar static const char *const cam0_grps[] = { "cam0_grp" };
85985ed41a7SViresh Kumar static struct spear_function cam0_function = {
86085ed41a7SViresh Kumar 	.name = "cam0",
86185ed41a7SViresh Kumar 	.groups = cam0_grps,
86285ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(cam0_grps),
86385ed41a7SViresh Kumar };
86485ed41a7SViresh Kumar 
86585ed41a7SViresh Kumar /* pad multiplexing for cam1 device */
86685ed41a7SViresh Kumar static const unsigned cam1_pins[] = { 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64
86785ed41a7SViresh Kumar };
86885ed41a7SViresh Kumar static struct spear_muxreg cam1_muxreg[] = {
86985ed41a7SViresh Kumar 	{
87085ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,
87185ed41a7SViresh Kumar 		.mask = CAM1_MASK,
87285ed41a7SViresh Kumar 		.val = CAM1_MASK,
87385ed41a7SViresh Kumar 	}, {
87485ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_2,
87585ed41a7SViresh Kumar 		.mask = VIP_AND_CAM1_REG1_MASK,
87685ed41a7SViresh Kumar 		.val = VIP_AND_CAM1_REG1_MASK,
87785ed41a7SViresh Kumar 	}, {
87885ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_3,
87985ed41a7SViresh Kumar 		.mask = VIP_AND_CAM1_REG2_MASK,
88085ed41a7SViresh Kumar 		.val = VIP_AND_CAM1_REG2_MASK,
88185ed41a7SViresh Kumar 	},
88285ed41a7SViresh Kumar };
88385ed41a7SViresh Kumar 
88485ed41a7SViresh Kumar static struct spear_modemux cam1_modemux[] = {
88585ed41a7SViresh Kumar 	{
88685ed41a7SViresh Kumar 		.muxregs = cam1_muxreg,
88785ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(cam1_muxreg),
88885ed41a7SViresh Kumar 	},
88985ed41a7SViresh Kumar };
89085ed41a7SViresh Kumar 
89185ed41a7SViresh Kumar static struct spear_pingroup cam1_pingroup = {
89285ed41a7SViresh Kumar 	.name = "cam1_grp",
89385ed41a7SViresh Kumar 	.pins = cam1_pins,
89485ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(cam1_pins),
89585ed41a7SViresh Kumar 	.modemuxs = cam1_modemux,
89685ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(cam1_modemux),
89785ed41a7SViresh Kumar };
89885ed41a7SViresh Kumar 
89985ed41a7SViresh Kumar static const char *const cam1_grps[] = { "cam1_grp" };
90085ed41a7SViresh Kumar static struct spear_function cam1_function = {
90185ed41a7SViresh Kumar 	.name = "cam1",
90285ed41a7SViresh Kumar 	.groups = cam1_grps,
90385ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(cam1_grps),
90485ed41a7SViresh Kumar };
90585ed41a7SViresh Kumar 
90685ed41a7SViresh Kumar /* pad multiplexing for cam2 device */
90785ed41a7SViresh Kumar static const unsigned cam2_pins[] = { 39, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53
90885ed41a7SViresh Kumar };
90985ed41a7SViresh Kumar static struct spear_muxreg cam2_muxreg[] = {
91085ed41a7SViresh Kumar 	{
91185ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,
91285ed41a7SViresh Kumar 		.mask = CAM2_MASK,
91385ed41a7SViresh Kumar 		.val = CAM2_MASK,
91485ed41a7SViresh Kumar 	}, {
91585ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_2,
91685ed41a7SViresh Kumar 		.mask = VIP_AND_CAM2_REG1_MASK,
91785ed41a7SViresh Kumar 		.val = VIP_AND_CAM2_REG1_MASK,
91885ed41a7SViresh Kumar 	},
91985ed41a7SViresh Kumar };
92085ed41a7SViresh Kumar 
92185ed41a7SViresh Kumar static struct spear_modemux cam2_modemux[] = {
92285ed41a7SViresh Kumar 	{
92385ed41a7SViresh Kumar 		.muxregs = cam2_muxreg,
92485ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(cam2_muxreg),
92585ed41a7SViresh Kumar 	},
92685ed41a7SViresh Kumar };
92785ed41a7SViresh Kumar 
92885ed41a7SViresh Kumar static struct spear_pingroup cam2_pingroup = {
92985ed41a7SViresh Kumar 	.name = "cam2_grp",
93085ed41a7SViresh Kumar 	.pins = cam2_pins,
93185ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(cam2_pins),
93285ed41a7SViresh Kumar 	.modemuxs = cam2_modemux,
93385ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(cam2_modemux),
93485ed41a7SViresh Kumar };
93585ed41a7SViresh Kumar 
93685ed41a7SViresh Kumar static const char *const cam2_grps[] = { "cam2_grp" };
93785ed41a7SViresh Kumar static struct spear_function cam2_function = {
93885ed41a7SViresh Kumar 	.name = "cam2",
93985ed41a7SViresh Kumar 	.groups = cam2_grps,
94085ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(cam2_grps),
94185ed41a7SViresh Kumar };
94285ed41a7SViresh Kumar 
94385ed41a7SViresh Kumar /* pad multiplexing for cam3 device */
94485ed41a7SViresh Kumar static const unsigned cam3_pins[] = { 20, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34
94585ed41a7SViresh Kumar };
94685ed41a7SViresh Kumar static struct spear_muxreg cam3_muxreg[] = {
94785ed41a7SViresh Kumar 	{
94885ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,
94985ed41a7SViresh Kumar 		.mask = CAM3_MASK,
95085ed41a7SViresh Kumar 		.val = CAM3_MASK,
95185ed41a7SViresh Kumar 	}, {
95285ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_1,
95385ed41a7SViresh Kumar 		.mask = VIP_AND_CAM3_REG0_MASK,
95485ed41a7SViresh Kumar 		.val = VIP_AND_CAM3_REG0_MASK,
95585ed41a7SViresh Kumar 	}, {
95685ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_2,
95785ed41a7SViresh Kumar 		.mask = VIP_AND_CAM3_REG1_MASK,
95885ed41a7SViresh Kumar 		.val = VIP_AND_CAM3_REG1_MASK,
95985ed41a7SViresh Kumar 	},
96085ed41a7SViresh Kumar };
96185ed41a7SViresh Kumar 
96285ed41a7SViresh Kumar static struct spear_modemux cam3_modemux[] = {
96385ed41a7SViresh Kumar 	{
96485ed41a7SViresh Kumar 		.muxregs = cam3_muxreg,
96585ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(cam3_muxreg),
96685ed41a7SViresh Kumar 	},
96785ed41a7SViresh Kumar };
96885ed41a7SViresh Kumar 
96985ed41a7SViresh Kumar static struct spear_pingroup cam3_pingroup = {
97085ed41a7SViresh Kumar 	.name = "cam3_grp",
97185ed41a7SViresh Kumar 	.pins = cam3_pins,
97285ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(cam3_pins),
97385ed41a7SViresh Kumar 	.modemuxs = cam3_modemux,
97485ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(cam3_modemux),
97585ed41a7SViresh Kumar };
97685ed41a7SViresh Kumar 
97785ed41a7SViresh Kumar static const char *const cam3_grps[] = { "cam3_grp" };
97885ed41a7SViresh Kumar static struct spear_function cam3_function = {
97985ed41a7SViresh Kumar 	.name = "cam3",
98085ed41a7SViresh Kumar 	.groups = cam3_grps,
98185ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(cam3_grps),
98285ed41a7SViresh Kumar };
98385ed41a7SViresh Kumar 
98485ed41a7SViresh Kumar /* pad multiplexing for smi device */
98585ed41a7SViresh Kumar static const unsigned smi_pins[] = { 76, 77, 78, 79, 84 };
98685ed41a7SViresh Kumar static struct spear_muxreg smi_muxreg[] = {
98785ed41a7SViresh Kumar 	{
98885ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_3,
98985ed41a7SViresh Kumar 		.mask = SMI_REG2_MASK,
99085ed41a7SViresh Kumar 		.val = SMI_REG2_MASK,
99185ed41a7SViresh Kumar 	},
99285ed41a7SViresh Kumar };
99385ed41a7SViresh Kumar 
99485ed41a7SViresh Kumar static struct spear_modemux smi_modemux[] = {
99585ed41a7SViresh Kumar 	{
99685ed41a7SViresh Kumar 		.muxregs = smi_muxreg,
99785ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(smi_muxreg),
99885ed41a7SViresh Kumar 	},
99985ed41a7SViresh Kumar };
100085ed41a7SViresh Kumar 
100185ed41a7SViresh Kumar static struct spear_pingroup smi_pingroup = {
100285ed41a7SViresh Kumar 	.name = "smi_grp",
100385ed41a7SViresh Kumar 	.pins = smi_pins,
100485ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(smi_pins),
100585ed41a7SViresh Kumar 	.modemuxs = smi_modemux,
100685ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(smi_modemux),
100785ed41a7SViresh Kumar };
100885ed41a7SViresh Kumar 
100985ed41a7SViresh Kumar static const char *const smi_grps[] = { "smi_grp" };
101085ed41a7SViresh Kumar static struct spear_function smi_function = {
101185ed41a7SViresh Kumar 	.name = "smi",
101285ed41a7SViresh Kumar 	.groups = smi_grps,
101385ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(smi_grps),
101485ed41a7SViresh Kumar };
101585ed41a7SViresh Kumar 
101685ed41a7SViresh Kumar /* pad multiplexing for ssp0 device */
101785ed41a7SViresh Kumar static const unsigned ssp0_pins[] = { 80, 81, 82, 83 };
101885ed41a7SViresh Kumar static struct spear_muxreg ssp0_muxreg[] = {
101985ed41a7SViresh Kumar 	{
102085ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_3,
102185ed41a7SViresh Kumar 		.mask = SSP0_REG2_MASK,
102285ed41a7SViresh Kumar 		.val = SSP0_REG2_MASK,
102385ed41a7SViresh Kumar 	},
102485ed41a7SViresh Kumar };
102585ed41a7SViresh Kumar 
102685ed41a7SViresh Kumar static struct spear_modemux ssp0_modemux[] = {
102785ed41a7SViresh Kumar 	{
102885ed41a7SViresh Kumar 		.muxregs = ssp0_muxreg,
102985ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(ssp0_muxreg),
103085ed41a7SViresh Kumar 	},
103185ed41a7SViresh Kumar };
103285ed41a7SViresh Kumar 
103385ed41a7SViresh Kumar static struct spear_pingroup ssp0_pingroup = {
103485ed41a7SViresh Kumar 	.name = "ssp0_grp",
103585ed41a7SViresh Kumar 	.pins = ssp0_pins,
103685ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(ssp0_pins),
103785ed41a7SViresh Kumar 	.modemuxs = ssp0_modemux,
103885ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(ssp0_modemux),
103985ed41a7SViresh Kumar };
104085ed41a7SViresh Kumar 
104185ed41a7SViresh Kumar /* pad multiplexing for ssp0_cs1 device */
104285ed41a7SViresh Kumar static const unsigned ssp0_cs1_pins[] = { 24 };
104385ed41a7SViresh Kumar static struct spear_muxreg ssp0_cs1_muxreg[] = {
104485ed41a7SViresh Kumar 	{
104585ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,
104685ed41a7SViresh Kumar 		.mask = SSP0_CS1_MASK,
104785ed41a7SViresh Kumar 		.val = SSP0_CS1_MASK,
104885ed41a7SViresh Kumar 	}, {
104985ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_1,
105085ed41a7SViresh Kumar 		.mask = PWM0_AND_SSP0_CS1_REG0_MASK,
105185ed41a7SViresh Kumar 		.val = PWM0_AND_SSP0_CS1_REG0_MASK,
105285ed41a7SViresh Kumar 	},
105385ed41a7SViresh Kumar };
105485ed41a7SViresh Kumar 
105585ed41a7SViresh Kumar static struct spear_modemux ssp0_cs1_modemux[] = {
105685ed41a7SViresh Kumar 	{
105785ed41a7SViresh Kumar 		.muxregs = ssp0_cs1_muxreg,
105885ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(ssp0_cs1_muxreg),
105985ed41a7SViresh Kumar 	},
106085ed41a7SViresh Kumar };
106185ed41a7SViresh Kumar 
106285ed41a7SViresh Kumar static struct spear_pingroup ssp0_cs1_pingroup = {
106385ed41a7SViresh Kumar 	.name = "ssp0_cs1_grp",
106485ed41a7SViresh Kumar 	.pins = ssp0_cs1_pins,
106585ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(ssp0_cs1_pins),
106685ed41a7SViresh Kumar 	.modemuxs = ssp0_cs1_modemux,
106785ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(ssp0_cs1_modemux),
106885ed41a7SViresh Kumar };
106985ed41a7SViresh Kumar 
107085ed41a7SViresh Kumar /* pad multiplexing for ssp0_cs2 device */
107185ed41a7SViresh Kumar static const unsigned ssp0_cs2_pins[] = { 85 };
107285ed41a7SViresh Kumar static struct spear_muxreg ssp0_cs2_muxreg[] = {
107385ed41a7SViresh Kumar 	{
107485ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,
107585ed41a7SViresh Kumar 		.mask = SSP0_CS2_MASK,
107685ed41a7SViresh Kumar 		.val = SSP0_CS2_MASK,
107785ed41a7SViresh Kumar 	}, {
107885ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_3,
107985ed41a7SViresh Kumar 		.mask = TS_AND_SSP0_CS2_REG2_MASK,
108085ed41a7SViresh Kumar 		.val = TS_AND_SSP0_CS2_REG2_MASK,
108185ed41a7SViresh Kumar 	},
108285ed41a7SViresh Kumar };
108385ed41a7SViresh Kumar 
108485ed41a7SViresh Kumar static struct spear_modemux ssp0_cs2_modemux[] = {
108585ed41a7SViresh Kumar 	{
108685ed41a7SViresh Kumar 		.muxregs = ssp0_cs2_muxreg,
108785ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(ssp0_cs2_muxreg),
108885ed41a7SViresh Kumar 	},
108985ed41a7SViresh Kumar };
109085ed41a7SViresh Kumar 
109185ed41a7SViresh Kumar static struct spear_pingroup ssp0_cs2_pingroup = {
109285ed41a7SViresh Kumar 	.name = "ssp0_cs2_grp",
109385ed41a7SViresh Kumar 	.pins = ssp0_cs2_pins,
109485ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(ssp0_cs2_pins),
109585ed41a7SViresh Kumar 	.modemuxs = ssp0_cs2_modemux,
109685ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(ssp0_cs2_modemux),
109785ed41a7SViresh Kumar };
109885ed41a7SViresh Kumar 
109985ed41a7SViresh Kumar /* pad multiplexing for ssp0_cs3 device */
110085ed41a7SViresh Kumar static const unsigned ssp0_cs3_pins[] = { 132 };
110185ed41a7SViresh Kumar static struct spear_muxreg ssp0_cs3_muxreg[] = {
110285ed41a7SViresh Kumar 	{
110385ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_5,
110485ed41a7SViresh Kumar 		.mask = SSP0_CS3_REG4_MASK,
110585ed41a7SViresh Kumar 		.val = SSP0_CS3_REG4_MASK,
110685ed41a7SViresh Kumar 	},
110785ed41a7SViresh Kumar };
110885ed41a7SViresh Kumar 
110985ed41a7SViresh Kumar static struct spear_modemux ssp0_cs3_modemux[] = {
111085ed41a7SViresh Kumar 	{
111185ed41a7SViresh Kumar 		.muxregs = ssp0_cs3_muxreg,
111285ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(ssp0_cs3_muxreg),
111385ed41a7SViresh Kumar 	},
111485ed41a7SViresh Kumar };
111585ed41a7SViresh Kumar 
111685ed41a7SViresh Kumar static struct spear_pingroup ssp0_cs3_pingroup = {
111785ed41a7SViresh Kumar 	.name = "ssp0_cs3_grp",
111885ed41a7SViresh Kumar 	.pins = ssp0_cs3_pins,
111985ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(ssp0_cs3_pins),
112085ed41a7SViresh Kumar 	.modemuxs = ssp0_cs3_modemux,
112185ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(ssp0_cs3_modemux),
112285ed41a7SViresh Kumar };
112385ed41a7SViresh Kumar 
112485ed41a7SViresh Kumar static const char *const ssp0_grps[] = { "ssp0_grp", "ssp0_cs1_grp",
112585ed41a7SViresh Kumar 	"ssp0_cs2_grp", "ssp0_cs3_grp" };
112685ed41a7SViresh Kumar static struct spear_function ssp0_function = {
112785ed41a7SViresh Kumar 	.name = "ssp0",
112885ed41a7SViresh Kumar 	.groups = ssp0_grps,
112985ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(ssp0_grps),
113085ed41a7SViresh Kumar };
113185ed41a7SViresh Kumar 
113285ed41a7SViresh Kumar /* pad multiplexing for uart0 device */
113385ed41a7SViresh Kumar static const unsigned uart0_pins[] = { 86, 87 };
113485ed41a7SViresh Kumar static struct spear_muxreg uart0_muxreg[] = {
113585ed41a7SViresh Kumar 	{
113685ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_3,
113785ed41a7SViresh Kumar 		.mask = UART0_REG2_MASK,
113885ed41a7SViresh Kumar 		.val = UART0_REG2_MASK,
113985ed41a7SViresh Kumar 	},
114085ed41a7SViresh Kumar };
114185ed41a7SViresh Kumar 
114285ed41a7SViresh Kumar static struct spear_modemux uart0_modemux[] = {
114385ed41a7SViresh Kumar 	{
114485ed41a7SViresh Kumar 		.muxregs = uart0_muxreg,
114585ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(uart0_muxreg),
114685ed41a7SViresh Kumar 	},
114785ed41a7SViresh Kumar };
114885ed41a7SViresh Kumar 
114985ed41a7SViresh Kumar static struct spear_pingroup uart0_pingroup = {
115085ed41a7SViresh Kumar 	.name = "uart0_grp",
115185ed41a7SViresh Kumar 	.pins = uart0_pins,
115285ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(uart0_pins),
115385ed41a7SViresh Kumar 	.modemuxs = uart0_modemux,
115485ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(uart0_modemux),
115585ed41a7SViresh Kumar };
115685ed41a7SViresh Kumar 
115785ed41a7SViresh Kumar /* pad multiplexing for uart0_enh device */
115885ed41a7SViresh Kumar static const unsigned uart0_enh_pins[] = { 11, 12, 13, 14, 15, 16 };
115985ed41a7SViresh Kumar static struct spear_muxreg uart0_enh_muxreg[] = {
116085ed41a7SViresh Kumar 	{
116185ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,
116285ed41a7SViresh Kumar 		.mask = GPT_MASK,
116385ed41a7SViresh Kumar 		.val = 0,
116485ed41a7SViresh Kumar 	}, {
116585ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_1,
116685ed41a7SViresh Kumar 		.mask = UART0_ENH_AND_GPT_REG0_MASK,
116785ed41a7SViresh Kumar 		.val = UART0_ENH_AND_GPT_REG0_MASK,
116885ed41a7SViresh Kumar 	},
116985ed41a7SViresh Kumar };
117085ed41a7SViresh Kumar 
117185ed41a7SViresh Kumar static struct spear_modemux uart0_enh_modemux[] = {
117285ed41a7SViresh Kumar 	{
117385ed41a7SViresh Kumar 		.muxregs = uart0_enh_muxreg,
117485ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(uart0_enh_muxreg),
117585ed41a7SViresh Kumar 	},
117685ed41a7SViresh Kumar };
117785ed41a7SViresh Kumar 
117885ed41a7SViresh Kumar static struct spear_pingroup uart0_enh_pingroup = {
117985ed41a7SViresh Kumar 	.name = "uart0_enh_grp",
118085ed41a7SViresh Kumar 	.pins = uart0_enh_pins,
118185ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(uart0_enh_pins),
118285ed41a7SViresh Kumar 	.modemuxs = uart0_enh_modemux,
118385ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(uart0_enh_modemux),
118485ed41a7SViresh Kumar };
118585ed41a7SViresh Kumar 
118685ed41a7SViresh Kumar static const char *const uart0_grps[] = { "uart0_grp", "uart0_enh_grp" };
118785ed41a7SViresh Kumar static struct spear_function uart0_function = {
118885ed41a7SViresh Kumar 	.name = "uart0",
118985ed41a7SViresh Kumar 	.groups = uart0_grps,
119085ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(uart0_grps),
119185ed41a7SViresh Kumar };
119285ed41a7SViresh Kumar 
119385ed41a7SViresh Kumar /* pad multiplexing for uart1 device */
119485ed41a7SViresh Kumar static const unsigned uart1_pins[] = { 88, 89 };
119585ed41a7SViresh Kumar static struct spear_muxreg uart1_muxreg[] = {
119685ed41a7SViresh Kumar 	{
119785ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_3,
119885ed41a7SViresh Kumar 		.mask = UART1_REG2_MASK,
119985ed41a7SViresh Kumar 		.val = UART1_REG2_MASK,
120085ed41a7SViresh Kumar 	},
120185ed41a7SViresh Kumar };
120285ed41a7SViresh Kumar 
120385ed41a7SViresh Kumar static struct spear_modemux uart1_modemux[] = {
120485ed41a7SViresh Kumar 	{
120585ed41a7SViresh Kumar 		.muxregs = uart1_muxreg,
120685ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(uart1_muxreg),
120785ed41a7SViresh Kumar 	},
120885ed41a7SViresh Kumar };
120985ed41a7SViresh Kumar 
121085ed41a7SViresh Kumar static struct spear_pingroup uart1_pingroup = {
121185ed41a7SViresh Kumar 	.name = "uart1_grp",
121285ed41a7SViresh Kumar 	.pins = uart1_pins,
121385ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(uart1_pins),
121485ed41a7SViresh Kumar 	.modemuxs = uart1_modemux,
121585ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(uart1_modemux),
121685ed41a7SViresh Kumar };
121785ed41a7SViresh Kumar 
121885ed41a7SViresh Kumar static const char *const uart1_grps[] = { "uart1_grp" };
121985ed41a7SViresh Kumar static struct spear_function uart1_function = {
122085ed41a7SViresh Kumar 	.name = "uart1",
122185ed41a7SViresh Kumar 	.groups = uart1_grps,
122285ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(uart1_grps),
122385ed41a7SViresh Kumar };
122485ed41a7SViresh Kumar 
122585ed41a7SViresh Kumar /* pad multiplexing for i2s_in device */
122685ed41a7SViresh Kumar static const unsigned i2s_in_pins[] = { 90, 91, 92, 93, 94, 99 };
122785ed41a7SViresh Kumar static struct spear_muxreg i2s_in_muxreg[] = {
122885ed41a7SViresh Kumar 	{
122985ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_3,
123085ed41a7SViresh Kumar 		.mask = I2S_IN_REG2_MASK,
123185ed41a7SViresh Kumar 		.val = I2S_IN_REG2_MASK,
123285ed41a7SViresh Kumar 	}, {
123385ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_4,
123485ed41a7SViresh Kumar 		.mask = I2S_IN_REG3_MASK,
123585ed41a7SViresh Kumar 		.val = I2S_IN_REG3_MASK,
123685ed41a7SViresh Kumar 	},
123785ed41a7SViresh Kumar };
123885ed41a7SViresh Kumar 
123985ed41a7SViresh Kumar static struct spear_modemux i2s_in_modemux[] = {
124085ed41a7SViresh Kumar 	{
124185ed41a7SViresh Kumar 		.muxregs = i2s_in_muxreg,
124285ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(i2s_in_muxreg),
124385ed41a7SViresh Kumar 	},
124485ed41a7SViresh Kumar };
124585ed41a7SViresh Kumar 
124685ed41a7SViresh Kumar static struct spear_pingroup i2s_in_pingroup = {
124785ed41a7SViresh Kumar 	.name = "i2s_in_grp",
124885ed41a7SViresh Kumar 	.pins = i2s_in_pins,
124985ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(i2s_in_pins),
125085ed41a7SViresh Kumar 	.modemuxs = i2s_in_modemux,
125185ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(i2s_in_modemux),
125285ed41a7SViresh Kumar };
125385ed41a7SViresh Kumar 
125485ed41a7SViresh Kumar /* pad multiplexing for i2s_out device */
125585ed41a7SViresh Kumar static const unsigned i2s_out_pins[] = { 95, 96, 97, 98, 100, 101, 102, 103 };
125685ed41a7SViresh Kumar static struct spear_muxreg i2s_out_muxreg[] = {
125785ed41a7SViresh Kumar 	{
125885ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_4,
125985ed41a7SViresh Kumar 		.mask = I2S_OUT_REG3_MASK,
126085ed41a7SViresh Kumar 		.val = I2S_OUT_REG3_MASK,
126185ed41a7SViresh Kumar 	},
126285ed41a7SViresh Kumar };
126385ed41a7SViresh Kumar 
126485ed41a7SViresh Kumar static struct spear_modemux i2s_out_modemux[] = {
126585ed41a7SViresh Kumar 	{
126685ed41a7SViresh Kumar 		.muxregs = i2s_out_muxreg,
126785ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(i2s_out_muxreg),
126885ed41a7SViresh Kumar 	},
126985ed41a7SViresh Kumar };
127085ed41a7SViresh Kumar 
127185ed41a7SViresh Kumar static struct spear_pingroup i2s_out_pingroup = {
127285ed41a7SViresh Kumar 	.name = "i2s_out_grp",
127385ed41a7SViresh Kumar 	.pins = i2s_out_pins,
127485ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(i2s_out_pins),
127585ed41a7SViresh Kumar 	.modemuxs = i2s_out_modemux,
127685ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(i2s_out_modemux),
127785ed41a7SViresh Kumar };
127885ed41a7SViresh Kumar 
127985ed41a7SViresh Kumar static const char *const i2s_grps[] = { "i2s_in_grp", "i2s_out_grp" };
128085ed41a7SViresh Kumar static struct spear_function i2s_function = {
128185ed41a7SViresh Kumar 	.name = "i2s",
128285ed41a7SViresh Kumar 	.groups = i2s_grps,
128385ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(i2s_grps),
128485ed41a7SViresh Kumar };
128585ed41a7SViresh Kumar 
128685ed41a7SViresh Kumar /* pad multiplexing for gmac device */
128785ed41a7SViresh Kumar static const unsigned gmac_pins[] = { 104, 105, 106, 107, 108, 109, 110, 111,
128885ed41a7SViresh Kumar 	112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125,
128985ed41a7SViresh Kumar 	126, 127, 128, 129, 130, 131 };
129085ed41a7SViresh Kumar #define GMAC_MUXREG				\
129185ed41a7SViresh Kumar 	{					\
129285ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_4,	\
129385ed41a7SViresh Kumar 		.mask = GMAC_REG3_MASK,		\
129485ed41a7SViresh Kumar 		.val = GMAC_REG3_MASK,		\
129585ed41a7SViresh Kumar 	}, {					\
129685ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_5,	\
129785ed41a7SViresh Kumar 		.mask = GMAC_REG4_MASK,		\
129885ed41a7SViresh Kumar 		.val = GMAC_REG4_MASK,		\
129985ed41a7SViresh Kumar 	}
130085ed41a7SViresh Kumar 
130185ed41a7SViresh Kumar /* pad multiplexing for gmii device */
130285ed41a7SViresh Kumar static struct spear_muxreg gmii_muxreg[] = {
130385ed41a7SViresh Kumar 	GMAC_MUXREG,
130485ed41a7SViresh Kumar 	{
130585ed41a7SViresh Kumar 		.reg = GMAC_CLK_CFG,
130685ed41a7SViresh Kumar 		.mask = GMAC_PHY_IF_SEL_MASK,
130785ed41a7SViresh Kumar 		.val = GMAC_PHY_IF_GMII_VAL,
130885ed41a7SViresh Kumar 	},
130985ed41a7SViresh Kumar };
131085ed41a7SViresh Kumar 
131185ed41a7SViresh Kumar static struct spear_modemux gmii_modemux[] = {
131285ed41a7SViresh Kumar 	{
131385ed41a7SViresh Kumar 		.muxregs = gmii_muxreg,
131485ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(gmii_muxreg),
131585ed41a7SViresh Kumar 	},
131685ed41a7SViresh Kumar };
131785ed41a7SViresh Kumar 
131885ed41a7SViresh Kumar static struct spear_pingroup gmii_pingroup = {
131985ed41a7SViresh Kumar 	.name = "gmii_grp",
132085ed41a7SViresh Kumar 	.pins = gmac_pins,
132185ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(gmac_pins),
132285ed41a7SViresh Kumar 	.modemuxs = gmii_modemux,
132385ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(gmii_modemux),
132485ed41a7SViresh Kumar };
132585ed41a7SViresh Kumar 
132685ed41a7SViresh Kumar /* pad multiplexing for rgmii device */
132785ed41a7SViresh Kumar static struct spear_muxreg rgmii_muxreg[] = {
132885ed41a7SViresh Kumar 	GMAC_MUXREG,
132985ed41a7SViresh Kumar 	{
133085ed41a7SViresh Kumar 		.reg = GMAC_CLK_CFG,
133185ed41a7SViresh Kumar 		.mask = GMAC_PHY_IF_SEL_MASK,
133285ed41a7SViresh Kumar 		.val = GMAC_PHY_IF_RGMII_VAL,
133385ed41a7SViresh Kumar 	},
133485ed41a7SViresh Kumar };
133585ed41a7SViresh Kumar 
133685ed41a7SViresh Kumar static struct spear_modemux rgmii_modemux[] = {
133785ed41a7SViresh Kumar 	{
133885ed41a7SViresh Kumar 		.muxregs = rgmii_muxreg,
133985ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(rgmii_muxreg),
134085ed41a7SViresh Kumar 	},
134185ed41a7SViresh Kumar };
134285ed41a7SViresh Kumar 
134385ed41a7SViresh Kumar static struct spear_pingroup rgmii_pingroup = {
134485ed41a7SViresh Kumar 	.name = "rgmii_grp",
134585ed41a7SViresh Kumar 	.pins = gmac_pins,
134685ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(gmac_pins),
134785ed41a7SViresh Kumar 	.modemuxs = rgmii_modemux,
134885ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(rgmii_modemux),
134985ed41a7SViresh Kumar };
135085ed41a7SViresh Kumar 
135185ed41a7SViresh Kumar /* pad multiplexing for rmii device */
135285ed41a7SViresh Kumar static struct spear_muxreg rmii_muxreg[] = {
135385ed41a7SViresh Kumar 	GMAC_MUXREG,
135485ed41a7SViresh Kumar 	{
135585ed41a7SViresh Kumar 		.reg = GMAC_CLK_CFG,
135685ed41a7SViresh Kumar 		.mask = GMAC_PHY_IF_SEL_MASK,
135785ed41a7SViresh Kumar 		.val = GMAC_PHY_IF_RMII_VAL,
135885ed41a7SViresh Kumar 	},
135985ed41a7SViresh Kumar };
136085ed41a7SViresh Kumar 
136185ed41a7SViresh Kumar static struct spear_modemux rmii_modemux[] = {
136285ed41a7SViresh Kumar 	{
136385ed41a7SViresh Kumar 		.muxregs = rmii_muxreg,
136485ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(rmii_muxreg),
136585ed41a7SViresh Kumar 	},
136685ed41a7SViresh Kumar };
136785ed41a7SViresh Kumar 
136885ed41a7SViresh Kumar static struct spear_pingroup rmii_pingroup = {
136985ed41a7SViresh Kumar 	.name = "rmii_grp",
137085ed41a7SViresh Kumar 	.pins = gmac_pins,
137185ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(gmac_pins),
137285ed41a7SViresh Kumar 	.modemuxs = rmii_modemux,
137385ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(rmii_modemux),
137485ed41a7SViresh Kumar };
137585ed41a7SViresh Kumar 
137685ed41a7SViresh Kumar /* pad multiplexing for sgmii device */
137785ed41a7SViresh Kumar static struct spear_muxreg sgmii_muxreg[] = {
137885ed41a7SViresh Kumar 	GMAC_MUXREG,
137985ed41a7SViresh Kumar 	{
138085ed41a7SViresh Kumar 		.reg = GMAC_CLK_CFG,
138185ed41a7SViresh Kumar 		.mask = GMAC_PHY_IF_SEL_MASK,
138285ed41a7SViresh Kumar 		.val = GMAC_PHY_IF_SGMII_VAL,
138385ed41a7SViresh Kumar 	},
138485ed41a7SViresh Kumar };
138585ed41a7SViresh Kumar 
138685ed41a7SViresh Kumar static struct spear_modemux sgmii_modemux[] = {
138785ed41a7SViresh Kumar 	{
138885ed41a7SViresh Kumar 		.muxregs = sgmii_muxreg,
138985ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(sgmii_muxreg),
139085ed41a7SViresh Kumar 	},
139185ed41a7SViresh Kumar };
139285ed41a7SViresh Kumar 
139385ed41a7SViresh Kumar static struct spear_pingroup sgmii_pingroup = {
139485ed41a7SViresh Kumar 	.name = "sgmii_grp",
139585ed41a7SViresh Kumar 	.pins = gmac_pins,
139685ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(gmac_pins),
139785ed41a7SViresh Kumar 	.modemuxs = sgmii_modemux,
139885ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(sgmii_modemux),
139985ed41a7SViresh Kumar };
140085ed41a7SViresh Kumar 
140185ed41a7SViresh Kumar static const char *const gmac_grps[] = { "gmii_grp", "rgmii_grp", "rmii_grp",
140285ed41a7SViresh Kumar 	"sgmii_grp" };
140385ed41a7SViresh Kumar static struct spear_function gmac_function = {
140485ed41a7SViresh Kumar 	.name = "gmac",
140585ed41a7SViresh Kumar 	.groups = gmac_grps,
140685ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(gmac_grps),
140785ed41a7SViresh Kumar };
140885ed41a7SViresh Kumar 
140985ed41a7SViresh Kumar /* pad multiplexing for i2c0 device */
141085ed41a7SViresh Kumar static const unsigned i2c0_pins[] = { 133, 134 };
141185ed41a7SViresh Kumar static struct spear_muxreg i2c0_muxreg[] = {
141285ed41a7SViresh Kumar 	{
141385ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_5,
141485ed41a7SViresh Kumar 		.mask = I2C0_REG4_MASK,
141585ed41a7SViresh Kumar 		.val = I2C0_REG4_MASK,
141685ed41a7SViresh Kumar 	},
141785ed41a7SViresh Kumar };
141885ed41a7SViresh Kumar 
141985ed41a7SViresh Kumar static struct spear_modemux i2c0_modemux[] = {
142085ed41a7SViresh Kumar 	{
142185ed41a7SViresh Kumar 		.muxregs = i2c0_muxreg,
142285ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(i2c0_muxreg),
142385ed41a7SViresh Kumar 	},
142485ed41a7SViresh Kumar };
142585ed41a7SViresh Kumar 
142685ed41a7SViresh Kumar static struct spear_pingroup i2c0_pingroup = {
142785ed41a7SViresh Kumar 	.name = "i2c0_grp",
142885ed41a7SViresh Kumar 	.pins = i2c0_pins,
142985ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(i2c0_pins),
143085ed41a7SViresh Kumar 	.modemuxs = i2c0_modemux,
143185ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(i2c0_modemux),
143285ed41a7SViresh Kumar };
143385ed41a7SViresh Kumar 
143485ed41a7SViresh Kumar static const char *const i2c0_grps[] = { "i2c0_grp" };
143585ed41a7SViresh Kumar static struct spear_function i2c0_function = {
143685ed41a7SViresh Kumar 	.name = "i2c0",
143785ed41a7SViresh Kumar 	.groups = i2c0_grps,
143885ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(i2c0_grps),
143985ed41a7SViresh Kumar };
144085ed41a7SViresh Kumar 
144185ed41a7SViresh Kumar /* pad multiplexing for i2c1 device */
144285ed41a7SViresh Kumar static const unsigned i2c1_pins[] = { 18, 23 };
144385ed41a7SViresh Kumar static struct spear_muxreg i2c1_muxreg[] = {
144485ed41a7SViresh Kumar 	{
144585ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_1,
144685ed41a7SViresh Kumar 		.mask = I2C1_REG0_MASK,
144785ed41a7SViresh Kumar 		.val = I2C1_REG0_MASK,
144885ed41a7SViresh Kumar 	},
144985ed41a7SViresh Kumar };
145085ed41a7SViresh Kumar 
145185ed41a7SViresh Kumar static struct spear_modemux i2c1_modemux[] = {
145285ed41a7SViresh Kumar 	{
145385ed41a7SViresh Kumar 		.muxregs = i2c1_muxreg,
145485ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(i2c1_muxreg),
145585ed41a7SViresh Kumar 	},
145685ed41a7SViresh Kumar };
145785ed41a7SViresh Kumar 
145885ed41a7SViresh Kumar static struct spear_pingroup i2c1_pingroup = {
145985ed41a7SViresh Kumar 	.name = "i2c1_grp",
146085ed41a7SViresh Kumar 	.pins = i2c1_pins,
146185ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(i2c1_pins),
146285ed41a7SViresh Kumar 	.modemuxs = i2c1_modemux,
146385ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(i2c1_modemux),
146485ed41a7SViresh Kumar };
146585ed41a7SViresh Kumar 
146685ed41a7SViresh Kumar static const char *const i2c1_grps[] = { "i2c1_grp" };
146785ed41a7SViresh Kumar static struct spear_function i2c1_function = {
146885ed41a7SViresh Kumar 	.name = "i2c1",
146985ed41a7SViresh Kumar 	.groups = i2c1_grps,
147085ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(i2c1_grps),
147185ed41a7SViresh Kumar };
147285ed41a7SViresh Kumar 
147385ed41a7SViresh Kumar /* pad multiplexing for cec0 device */
147485ed41a7SViresh Kumar static const unsigned cec0_pins[] = { 135 };
147585ed41a7SViresh Kumar static struct spear_muxreg cec0_muxreg[] = {
147685ed41a7SViresh Kumar 	{
147785ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_5,
147885ed41a7SViresh Kumar 		.mask = CEC0_REG4_MASK,
147985ed41a7SViresh Kumar 		.val = CEC0_REG4_MASK,
148085ed41a7SViresh Kumar 	},
148185ed41a7SViresh Kumar };
148285ed41a7SViresh Kumar 
148385ed41a7SViresh Kumar static struct spear_modemux cec0_modemux[] = {
148485ed41a7SViresh Kumar 	{
148585ed41a7SViresh Kumar 		.muxregs = cec0_muxreg,
148685ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(cec0_muxreg),
148785ed41a7SViresh Kumar 	},
148885ed41a7SViresh Kumar };
148985ed41a7SViresh Kumar 
149085ed41a7SViresh Kumar static struct spear_pingroup cec0_pingroup = {
149185ed41a7SViresh Kumar 	.name = "cec0_grp",
149285ed41a7SViresh Kumar 	.pins = cec0_pins,
149385ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(cec0_pins),
149485ed41a7SViresh Kumar 	.modemuxs = cec0_modemux,
149585ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(cec0_modemux),
149685ed41a7SViresh Kumar };
149785ed41a7SViresh Kumar 
149885ed41a7SViresh Kumar static const char *const cec0_grps[] = { "cec0_grp" };
149985ed41a7SViresh Kumar static struct spear_function cec0_function = {
150085ed41a7SViresh Kumar 	.name = "cec0",
150185ed41a7SViresh Kumar 	.groups = cec0_grps,
150285ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(cec0_grps),
150385ed41a7SViresh Kumar };
150485ed41a7SViresh Kumar 
150585ed41a7SViresh Kumar /* pad multiplexing for cec1 device */
150685ed41a7SViresh Kumar static const unsigned cec1_pins[] = { 136 };
150785ed41a7SViresh Kumar static struct spear_muxreg cec1_muxreg[] = {
150885ed41a7SViresh Kumar 	{
150985ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_5,
151085ed41a7SViresh Kumar 		.mask = CEC1_REG4_MASK,
151185ed41a7SViresh Kumar 		.val = CEC1_REG4_MASK,
151285ed41a7SViresh Kumar 	},
151385ed41a7SViresh Kumar };
151485ed41a7SViresh Kumar 
151585ed41a7SViresh Kumar static struct spear_modemux cec1_modemux[] = {
151685ed41a7SViresh Kumar 	{
151785ed41a7SViresh Kumar 		.muxregs = cec1_muxreg,
151885ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(cec1_muxreg),
151985ed41a7SViresh Kumar 	},
152085ed41a7SViresh Kumar };
152185ed41a7SViresh Kumar 
152285ed41a7SViresh Kumar static struct spear_pingroup cec1_pingroup = {
152385ed41a7SViresh Kumar 	.name = "cec1_grp",
152485ed41a7SViresh Kumar 	.pins = cec1_pins,
152585ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(cec1_pins),
152685ed41a7SViresh Kumar 	.modemuxs = cec1_modemux,
152785ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(cec1_modemux),
152885ed41a7SViresh Kumar };
152985ed41a7SViresh Kumar 
153085ed41a7SViresh Kumar static const char *const cec1_grps[] = { "cec1_grp" };
153185ed41a7SViresh Kumar static struct spear_function cec1_function = {
153285ed41a7SViresh Kumar 	.name = "cec1",
153385ed41a7SViresh Kumar 	.groups = cec1_grps,
153485ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(cec1_grps),
153585ed41a7SViresh Kumar };
153685ed41a7SViresh Kumar 
153785ed41a7SViresh Kumar /* pad multiplexing for mcif devices */
153885ed41a7SViresh Kumar static const unsigned mcif_pins[] = { 193, 194, 195, 196, 197, 198, 199, 200,
153985ed41a7SViresh Kumar 	201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
154085ed41a7SViresh Kumar 	215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228,
154185ed41a7SViresh Kumar 	229, 230, 231, 232, 237 };
154285ed41a7SViresh Kumar #define MCIF_MUXREG							\
154385ed41a7SViresh Kumar 	{								\
154485ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,				\
154585ed41a7SViresh Kumar 		.mask = MCIF_MASK,					\
154685ed41a7SViresh Kumar 		.val = MCIF_MASK,					\
154785ed41a7SViresh Kumar 	}, {								\
154885ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_7,				\
154985ed41a7SViresh Kumar 		.mask = FSMC_PNOR_AND_MCIF_REG6_MASK | MCIF_REG6_MASK,	\
155085ed41a7SViresh Kumar 		.val = FSMC_PNOR_AND_MCIF_REG6_MASK | MCIF_REG6_MASK,	\
155185ed41a7SViresh Kumar 	}, {								\
155285ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_8,				\
155385ed41a7SViresh Kumar 		.mask = MCIF_REG7_MASK,					\
155485ed41a7SViresh Kumar 		.val = MCIF_REG7_MASK,					\
155585ed41a7SViresh Kumar 	}
155685ed41a7SViresh Kumar 
155785ed41a7SViresh Kumar /* Pad multiplexing for sdhci device */
155885ed41a7SViresh Kumar static struct spear_muxreg sdhci_muxreg[] = {
155985ed41a7SViresh Kumar 	MCIF_MUXREG,
156085ed41a7SViresh Kumar 	{
156185ed41a7SViresh Kumar 		.reg = PERIP_CFG,
156285ed41a7SViresh Kumar 		.mask = MCIF_SEL_MASK,
156385ed41a7SViresh Kumar 		.val = MCIF_SEL_SD,
156485ed41a7SViresh Kumar 	},
156585ed41a7SViresh Kumar };
156685ed41a7SViresh Kumar 
156785ed41a7SViresh Kumar static struct spear_modemux sdhci_modemux[] = {
156885ed41a7SViresh Kumar 	{
156985ed41a7SViresh Kumar 		.muxregs = sdhci_muxreg,
157085ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(sdhci_muxreg),
157185ed41a7SViresh Kumar 	},
157285ed41a7SViresh Kumar };
157385ed41a7SViresh Kumar 
157485ed41a7SViresh Kumar static struct spear_pingroup sdhci_pingroup = {
157585ed41a7SViresh Kumar 	.name = "sdhci_grp",
157685ed41a7SViresh Kumar 	.pins = mcif_pins,
157785ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(mcif_pins),
157885ed41a7SViresh Kumar 	.modemuxs = sdhci_modemux,
157985ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(sdhci_modemux),
158085ed41a7SViresh Kumar };
158185ed41a7SViresh Kumar 
158285ed41a7SViresh Kumar static const char *const sdhci_grps[] = { "sdhci_grp" };
158385ed41a7SViresh Kumar static struct spear_function sdhci_function = {
158485ed41a7SViresh Kumar 	.name = "sdhci",
158585ed41a7SViresh Kumar 	.groups = sdhci_grps,
158685ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(sdhci_grps),
158785ed41a7SViresh Kumar };
158885ed41a7SViresh Kumar 
158985ed41a7SViresh Kumar /* Pad multiplexing for cf device */
159085ed41a7SViresh Kumar static struct spear_muxreg cf_muxreg[] = {
159185ed41a7SViresh Kumar 	MCIF_MUXREG,
159285ed41a7SViresh Kumar 	{
159385ed41a7SViresh Kumar 		.reg = PERIP_CFG,
159485ed41a7SViresh Kumar 		.mask = MCIF_SEL_MASK,
159585ed41a7SViresh Kumar 		.val = MCIF_SEL_CF,
159685ed41a7SViresh Kumar 	},
159785ed41a7SViresh Kumar };
159885ed41a7SViresh Kumar 
159985ed41a7SViresh Kumar static struct spear_modemux cf_modemux[] = {
160085ed41a7SViresh Kumar 	{
160185ed41a7SViresh Kumar 		.muxregs = cf_muxreg,
160285ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(cf_muxreg),
160385ed41a7SViresh Kumar 	},
160485ed41a7SViresh Kumar };
160585ed41a7SViresh Kumar 
160685ed41a7SViresh Kumar static struct spear_pingroup cf_pingroup = {
160785ed41a7SViresh Kumar 	.name = "cf_grp",
160885ed41a7SViresh Kumar 	.pins = mcif_pins,
160985ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(mcif_pins),
161085ed41a7SViresh Kumar 	.modemuxs = cf_modemux,
161185ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(cf_modemux),
161285ed41a7SViresh Kumar };
161385ed41a7SViresh Kumar 
161485ed41a7SViresh Kumar static const char *const cf_grps[] = { "cf_grp" };
161585ed41a7SViresh Kumar static struct spear_function cf_function = {
161685ed41a7SViresh Kumar 	.name = "cf",
161785ed41a7SViresh Kumar 	.groups = cf_grps,
161885ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(cf_grps),
161985ed41a7SViresh Kumar };
162085ed41a7SViresh Kumar 
162185ed41a7SViresh Kumar /* Pad multiplexing for xd device */
162285ed41a7SViresh Kumar static struct spear_muxreg xd_muxreg[] = {
162385ed41a7SViresh Kumar 	MCIF_MUXREG,
162485ed41a7SViresh Kumar 	{
162585ed41a7SViresh Kumar 		.reg = PERIP_CFG,
162685ed41a7SViresh Kumar 		.mask = MCIF_SEL_MASK,
162785ed41a7SViresh Kumar 		.val = MCIF_SEL_XD,
162885ed41a7SViresh Kumar 	},
162985ed41a7SViresh Kumar };
163085ed41a7SViresh Kumar 
163185ed41a7SViresh Kumar static struct spear_modemux xd_modemux[] = {
163285ed41a7SViresh Kumar 	{
163385ed41a7SViresh Kumar 		.muxregs = xd_muxreg,
163485ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(xd_muxreg),
163585ed41a7SViresh Kumar 	},
163685ed41a7SViresh Kumar };
163785ed41a7SViresh Kumar 
163885ed41a7SViresh Kumar static struct spear_pingroup xd_pingroup = {
163985ed41a7SViresh Kumar 	.name = "xd_grp",
164085ed41a7SViresh Kumar 	.pins = mcif_pins,
164185ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(mcif_pins),
164285ed41a7SViresh Kumar 	.modemuxs = xd_modemux,
164385ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(xd_modemux),
164485ed41a7SViresh Kumar };
164585ed41a7SViresh Kumar 
164685ed41a7SViresh Kumar static const char *const xd_grps[] = { "xd_grp" };
164785ed41a7SViresh Kumar static struct spear_function xd_function = {
164885ed41a7SViresh Kumar 	.name = "xd",
164985ed41a7SViresh Kumar 	.groups = xd_grps,
165085ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(xd_grps),
165185ed41a7SViresh Kumar };
165285ed41a7SViresh Kumar 
165385ed41a7SViresh Kumar /* pad multiplexing for clcd device */
165485ed41a7SViresh Kumar static const unsigned clcd_pins[] = { 138, 139, 140, 141, 142, 143, 144, 145,
165585ed41a7SViresh Kumar 	146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
165685ed41a7SViresh Kumar 	160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173,
165785ed41a7SViresh Kumar 	174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
165885ed41a7SViresh Kumar 	188, 189, 190, 191 };
165985ed41a7SViresh Kumar static struct spear_muxreg clcd_muxreg[] = {
166085ed41a7SViresh Kumar 	{
166185ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,
166285ed41a7SViresh Kumar 		.mask = ARM_TRACE_MASK | MIPHY_DBG_MASK,
166385ed41a7SViresh Kumar 		.val = 0,
166485ed41a7SViresh Kumar 	}, {
166585ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_5,
166685ed41a7SViresh Kumar 		.mask = CLCD_REG4_MASK | CLCD_AND_ARM_TRACE_REG4_MASK,
166785ed41a7SViresh Kumar 		.val = CLCD_REG4_MASK | CLCD_AND_ARM_TRACE_REG4_MASK,
166885ed41a7SViresh Kumar 	}, {
166985ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_6,
167085ed41a7SViresh Kumar 		.mask = CLCD_AND_ARM_TRACE_REG5_MASK,
167185ed41a7SViresh Kumar 		.val = CLCD_AND_ARM_TRACE_REG5_MASK,
167285ed41a7SViresh Kumar 	}, {
167385ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_7,
167485ed41a7SViresh Kumar 		.mask = CLCD_AND_ARM_TRACE_REG6_MASK,
167585ed41a7SViresh Kumar 		.val = CLCD_AND_ARM_TRACE_REG6_MASK,
167685ed41a7SViresh Kumar 	},
167785ed41a7SViresh Kumar };
167885ed41a7SViresh Kumar 
167985ed41a7SViresh Kumar static struct spear_modemux clcd_modemux[] = {
168085ed41a7SViresh Kumar 	{
168185ed41a7SViresh Kumar 		.muxregs = clcd_muxreg,
168285ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(clcd_muxreg),
168385ed41a7SViresh Kumar 	},
168485ed41a7SViresh Kumar };
168585ed41a7SViresh Kumar 
168685ed41a7SViresh Kumar static struct spear_pingroup clcd_pingroup = {
168785ed41a7SViresh Kumar 	.name = "clcd_grp",
168885ed41a7SViresh Kumar 	.pins = clcd_pins,
168985ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(clcd_pins),
169085ed41a7SViresh Kumar 	.modemuxs = clcd_modemux,
169185ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(clcd_modemux),
169285ed41a7SViresh Kumar };
169385ed41a7SViresh Kumar 
16940504271cSVipul Kumar Samar /* Disable cld runtime to save panel damage */
16950504271cSVipul Kumar Samar static struct spear_muxreg clcd_sleep_muxreg[] = {
16960504271cSVipul Kumar Samar 	{
16970504271cSVipul Kumar Samar 		.reg = PAD_SHARED_IP_EN_1,
16980504271cSVipul Kumar Samar 		.mask = ARM_TRACE_MASK | MIPHY_DBG_MASK,
16990504271cSVipul Kumar Samar 		.val = 0,
17000504271cSVipul Kumar Samar 	}, {
17010504271cSVipul Kumar Samar 		.reg = PAD_FUNCTION_EN_5,
17020504271cSVipul Kumar Samar 		.mask = CLCD_REG4_MASK | CLCD_AND_ARM_TRACE_REG4_MASK,
17030504271cSVipul Kumar Samar 		.val = 0x0,
17040504271cSVipul Kumar Samar 	}, {
17050504271cSVipul Kumar Samar 		.reg = PAD_FUNCTION_EN_6,
17060504271cSVipul Kumar Samar 		.mask = CLCD_AND_ARM_TRACE_REG5_MASK,
17070504271cSVipul Kumar Samar 		.val = 0x0,
17080504271cSVipul Kumar Samar 	}, {
17090504271cSVipul Kumar Samar 		.reg = PAD_FUNCTION_EN_7,
17100504271cSVipul Kumar Samar 		.mask = CLCD_AND_ARM_TRACE_REG6_MASK,
17110504271cSVipul Kumar Samar 		.val = 0x0,
17120504271cSVipul Kumar Samar 	},
17130504271cSVipul Kumar Samar };
17140504271cSVipul Kumar Samar 
17150504271cSVipul Kumar Samar static struct spear_modemux clcd_sleep_modemux[] = {
17160504271cSVipul Kumar Samar 	{
17170504271cSVipul Kumar Samar 		.muxregs = clcd_sleep_muxreg,
17180504271cSVipul Kumar Samar 		.nmuxregs = ARRAY_SIZE(clcd_sleep_muxreg),
17190504271cSVipul Kumar Samar 	},
17200504271cSVipul Kumar Samar };
17210504271cSVipul Kumar Samar 
17220504271cSVipul Kumar Samar static struct spear_pingroup clcd_sleep_pingroup = {
17230504271cSVipul Kumar Samar 	.name = "clcd_sleep_grp",
17240504271cSVipul Kumar Samar 	.pins = clcd_pins,
17250504271cSVipul Kumar Samar 	.npins = ARRAY_SIZE(clcd_pins),
17260504271cSVipul Kumar Samar 	.modemuxs = clcd_sleep_modemux,
17270504271cSVipul Kumar Samar 	.nmodemuxs = ARRAY_SIZE(clcd_sleep_modemux),
17280504271cSVipul Kumar Samar };
17290504271cSVipul Kumar Samar 
17300504271cSVipul Kumar Samar static const char *const clcd_grps[] = { "clcd_grp", "clcd_sleep_grp" };
173185ed41a7SViresh Kumar static struct spear_function clcd_function = {
173285ed41a7SViresh Kumar 	.name = "clcd",
173385ed41a7SViresh Kumar 	.groups = clcd_grps,
173485ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(clcd_grps),
173585ed41a7SViresh Kumar };
173685ed41a7SViresh Kumar 
173785ed41a7SViresh Kumar /* pad multiplexing for arm_trace device */
173885ed41a7SViresh Kumar static const unsigned arm_trace_pins[] = { 158, 159, 160, 161, 162, 163, 164,
173985ed41a7SViresh Kumar 	165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178,
174085ed41a7SViresh Kumar 	179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
174185ed41a7SViresh Kumar 	193, 194, 195, 196, 197, 198, 199, 200 };
174285ed41a7SViresh Kumar static struct spear_muxreg arm_trace_muxreg[] = {
174385ed41a7SViresh Kumar 	{
174485ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,
174585ed41a7SViresh Kumar 		.mask = ARM_TRACE_MASK,
174685ed41a7SViresh Kumar 		.val = ARM_TRACE_MASK,
174785ed41a7SViresh Kumar 	}, {
174885ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_5,
174985ed41a7SViresh Kumar 		.mask = CLCD_AND_ARM_TRACE_REG4_MASK,
175085ed41a7SViresh Kumar 		.val = CLCD_AND_ARM_TRACE_REG4_MASK,
175185ed41a7SViresh Kumar 	}, {
175285ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_6,
175385ed41a7SViresh Kumar 		.mask = CLCD_AND_ARM_TRACE_REG5_MASK,
175485ed41a7SViresh Kumar 		.val = CLCD_AND_ARM_TRACE_REG5_MASK,
175585ed41a7SViresh Kumar 	}, {
175685ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_7,
175785ed41a7SViresh Kumar 		.mask = CLCD_AND_ARM_TRACE_REG6_MASK,
175885ed41a7SViresh Kumar 		.val = CLCD_AND_ARM_TRACE_REG6_MASK,
175985ed41a7SViresh Kumar 	},
176085ed41a7SViresh Kumar };
176185ed41a7SViresh Kumar 
176285ed41a7SViresh Kumar static struct spear_modemux arm_trace_modemux[] = {
176385ed41a7SViresh Kumar 	{
176485ed41a7SViresh Kumar 		.muxregs = arm_trace_muxreg,
176585ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(arm_trace_muxreg),
176685ed41a7SViresh Kumar 	},
176785ed41a7SViresh Kumar };
176885ed41a7SViresh Kumar 
176985ed41a7SViresh Kumar static struct spear_pingroup arm_trace_pingroup = {
177085ed41a7SViresh Kumar 	.name = "arm_trace_grp",
177185ed41a7SViresh Kumar 	.pins = arm_trace_pins,
177285ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(arm_trace_pins),
177385ed41a7SViresh Kumar 	.modemuxs = arm_trace_modemux,
177485ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(arm_trace_modemux),
177585ed41a7SViresh Kumar };
177685ed41a7SViresh Kumar 
177785ed41a7SViresh Kumar static const char *const arm_trace_grps[] = { "arm_trace_grp" };
177885ed41a7SViresh Kumar static struct spear_function arm_trace_function = {
177985ed41a7SViresh Kumar 	.name = "arm_trace",
178085ed41a7SViresh Kumar 	.groups = arm_trace_grps,
178185ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(arm_trace_grps),
178285ed41a7SViresh Kumar };
178385ed41a7SViresh Kumar 
178485ed41a7SViresh Kumar /* pad multiplexing for miphy_dbg device */
178585ed41a7SViresh Kumar static const unsigned miphy_dbg_pins[] = { 96, 97, 98, 99, 100, 101, 102, 103,
178685ed41a7SViresh Kumar 	132, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
178785ed41a7SViresh Kumar 	148, 149, 150, 151, 152, 153, 154, 155, 156, 157 };
178885ed41a7SViresh Kumar static struct spear_muxreg miphy_dbg_muxreg[] = {
178985ed41a7SViresh Kumar 	{
179085ed41a7SViresh Kumar 		.reg = PAD_SHARED_IP_EN_1,
179185ed41a7SViresh Kumar 		.mask = MIPHY_DBG_MASK,
179285ed41a7SViresh Kumar 		.val = MIPHY_DBG_MASK,
179385ed41a7SViresh Kumar 	}, {
179485ed41a7SViresh Kumar 		.reg = PAD_FUNCTION_EN_5,
179585ed41a7SViresh Kumar 		.mask = DEVS_GRP_AND_MIPHY_DBG_REG4_MASK,
179685ed41a7SViresh Kumar 		.val = DEVS_GRP_AND_MIPHY_DBG_REG4_MASK,
179785ed41a7SViresh Kumar 	},
179885ed41a7SViresh Kumar };
179985ed41a7SViresh Kumar 
180085ed41a7SViresh Kumar static struct spear_modemux miphy_dbg_modemux[] = {
180185ed41a7SViresh Kumar 	{
180285ed41a7SViresh Kumar 		.muxregs = miphy_dbg_muxreg,
180385ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(miphy_dbg_muxreg),
180485ed41a7SViresh Kumar 	},
180585ed41a7SViresh Kumar };
180685ed41a7SViresh Kumar 
180785ed41a7SViresh Kumar static struct spear_pingroup miphy_dbg_pingroup = {
180885ed41a7SViresh Kumar 	.name = "miphy_dbg_grp",
180985ed41a7SViresh Kumar 	.pins = miphy_dbg_pins,
181085ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(miphy_dbg_pins),
181185ed41a7SViresh Kumar 	.modemuxs = miphy_dbg_modemux,
181285ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(miphy_dbg_modemux),
181385ed41a7SViresh Kumar };
181485ed41a7SViresh Kumar 
181585ed41a7SViresh Kumar static const char *const miphy_dbg_grps[] = { "miphy_dbg_grp" };
181685ed41a7SViresh Kumar static struct spear_function miphy_dbg_function = {
181785ed41a7SViresh Kumar 	.name = "miphy_dbg",
181885ed41a7SViresh Kumar 	.groups = miphy_dbg_grps,
181985ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(miphy_dbg_grps),
182085ed41a7SViresh Kumar };
182185ed41a7SViresh Kumar 
182285ed41a7SViresh Kumar /* pad multiplexing for pcie device */
182385ed41a7SViresh Kumar static const unsigned pcie_pins[] = { 250 };
182485ed41a7SViresh Kumar static struct spear_muxreg pcie_muxreg[] = {
182585ed41a7SViresh Kumar 	{
182685ed41a7SViresh Kumar 		.reg = PCIE_SATA_CFG,
182785ed41a7SViresh Kumar 		.mask = SATA_PCIE_CFG_MASK,
182885ed41a7SViresh Kumar 		.val = PCIE_CFG_VAL,
182985ed41a7SViresh Kumar 	},
183085ed41a7SViresh Kumar };
183185ed41a7SViresh Kumar 
183285ed41a7SViresh Kumar static struct spear_modemux pcie_modemux[] = {
183385ed41a7SViresh Kumar 	{
183485ed41a7SViresh Kumar 		.muxregs = pcie_muxreg,
183585ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(pcie_muxreg),
183685ed41a7SViresh Kumar 	},
183785ed41a7SViresh Kumar };
183885ed41a7SViresh Kumar 
183985ed41a7SViresh Kumar static struct spear_pingroup pcie_pingroup = {
184085ed41a7SViresh Kumar 	.name = "pcie_grp",
184185ed41a7SViresh Kumar 	.pins = pcie_pins,
184285ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(pcie_pins),
184385ed41a7SViresh Kumar 	.modemuxs = pcie_modemux,
184485ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(pcie_modemux),
184585ed41a7SViresh Kumar };
184685ed41a7SViresh Kumar 
184785ed41a7SViresh Kumar static const char *const pcie_grps[] = { "pcie_grp" };
184885ed41a7SViresh Kumar static struct spear_function pcie_function = {
184985ed41a7SViresh Kumar 	.name = "pcie",
185085ed41a7SViresh Kumar 	.groups = pcie_grps,
185185ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(pcie_grps),
185285ed41a7SViresh Kumar };
185385ed41a7SViresh Kumar 
185485ed41a7SViresh Kumar /* pad multiplexing for sata device */
185585ed41a7SViresh Kumar static const unsigned sata_pins[] = { 250 };
185685ed41a7SViresh Kumar static struct spear_muxreg sata_muxreg[] = {
185785ed41a7SViresh Kumar 	{
185885ed41a7SViresh Kumar 		.reg = PCIE_SATA_CFG,
185985ed41a7SViresh Kumar 		.mask = SATA_PCIE_CFG_MASK,
186085ed41a7SViresh Kumar 		.val = SATA_CFG_VAL,
186185ed41a7SViresh Kumar 	},
186285ed41a7SViresh Kumar };
186385ed41a7SViresh Kumar 
186485ed41a7SViresh Kumar static struct spear_modemux sata_modemux[] = {
186585ed41a7SViresh Kumar 	{
186685ed41a7SViresh Kumar 		.muxregs = sata_muxreg,
186785ed41a7SViresh Kumar 		.nmuxregs = ARRAY_SIZE(sata_muxreg),
186885ed41a7SViresh Kumar 	},
186985ed41a7SViresh Kumar };
187085ed41a7SViresh Kumar 
187185ed41a7SViresh Kumar static struct spear_pingroup sata_pingroup = {
187285ed41a7SViresh Kumar 	.name = "sata_grp",
187385ed41a7SViresh Kumar 	.pins = sata_pins,
187485ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(sata_pins),
187585ed41a7SViresh Kumar 	.modemuxs = sata_modemux,
187685ed41a7SViresh Kumar 	.nmodemuxs = ARRAY_SIZE(sata_modemux),
187785ed41a7SViresh Kumar };
187885ed41a7SViresh Kumar 
187985ed41a7SViresh Kumar static const char *const sata_grps[] = { "sata_grp" };
188085ed41a7SViresh Kumar static struct spear_function sata_function = {
188185ed41a7SViresh Kumar 	.name = "sata",
188285ed41a7SViresh Kumar 	.groups = sata_grps,
188385ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(sata_grps),
188485ed41a7SViresh Kumar };
188585ed41a7SViresh Kumar 
188685ed41a7SViresh Kumar /* pingroups */
188785ed41a7SViresh Kumar static struct spear_pingroup *spear1340_pingroups[] = {
188885ed41a7SViresh Kumar 	&pads_as_gpio_pingroup,
188985ed41a7SViresh Kumar 	&fsmc_8bit_pingroup,
189085ed41a7SViresh Kumar 	&fsmc_16bit_pingroup,
189185ed41a7SViresh Kumar 	&fsmc_pnor_pingroup,
189285ed41a7SViresh Kumar 	&keyboard_row_col_pingroup,
189385ed41a7SViresh Kumar 	&keyboard_col5_pingroup,
189485ed41a7SViresh Kumar 	&spdif_in_pingroup,
189585ed41a7SViresh Kumar 	&spdif_out_pingroup,
189685ed41a7SViresh Kumar 	&gpt_0_1_pingroup,
189785ed41a7SViresh Kumar 	&pwm0_pingroup,
189885ed41a7SViresh Kumar 	&pwm1_pingroup,
189985ed41a7SViresh Kumar 	&pwm2_pingroup,
190085ed41a7SViresh Kumar 	&pwm3_pingroup,
190185ed41a7SViresh Kumar 	&vip_mux_pingroup,
190285ed41a7SViresh Kumar 	&vip_mux_cam0_pingroup,
190385ed41a7SViresh Kumar 	&vip_mux_cam1_pingroup,
190485ed41a7SViresh Kumar 	&vip_mux_cam2_pingroup,
190585ed41a7SViresh Kumar 	&vip_mux_cam3_pingroup,
190685ed41a7SViresh Kumar 	&cam0_pingroup,
190785ed41a7SViresh Kumar 	&cam1_pingroup,
190885ed41a7SViresh Kumar 	&cam2_pingroup,
190985ed41a7SViresh Kumar 	&cam3_pingroup,
191085ed41a7SViresh Kumar 	&smi_pingroup,
191185ed41a7SViresh Kumar 	&ssp0_pingroup,
191285ed41a7SViresh Kumar 	&ssp0_cs1_pingroup,
191385ed41a7SViresh Kumar 	&ssp0_cs2_pingroup,
191485ed41a7SViresh Kumar 	&ssp0_cs3_pingroup,
191585ed41a7SViresh Kumar 	&uart0_pingroup,
191685ed41a7SViresh Kumar 	&uart0_enh_pingroup,
191785ed41a7SViresh Kumar 	&uart1_pingroup,
191885ed41a7SViresh Kumar 	&i2s_in_pingroup,
191985ed41a7SViresh Kumar 	&i2s_out_pingroup,
192085ed41a7SViresh Kumar 	&gmii_pingroup,
192185ed41a7SViresh Kumar 	&rgmii_pingroup,
192285ed41a7SViresh Kumar 	&rmii_pingroup,
192385ed41a7SViresh Kumar 	&sgmii_pingroup,
192485ed41a7SViresh Kumar 	&i2c0_pingroup,
192585ed41a7SViresh Kumar 	&i2c1_pingroup,
192685ed41a7SViresh Kumar 	&cec0_pingroup,
192785ed41a7SViresh Kumar 	&cec1_pingroup,
192885ed41a7SViresh Kumar 	&sdhci_pingroup,
192985ed41a7SViresh Kumar 	&cf_pingroup,
193085ed41a7SViresh Kumar 	&xd_pingroup,
19310504271cSVipul Kumar Samar 	&clcd_sleep_pingroup,
193285ed41a7SViresh Kumar 	&clcd_pingroup,
193385ed41a7SViresh Kumar 	&arm_trace_pingroup,
193485ed41a7SViresh Kumar 	&miphy_dbg_pingroup,
193585ed41a7SViresh Kumar 	&pcie_pingroup,
193685ed41a7SViresh Kumar 	&sata_pingroup,
193785ed41a7SViresh Kumar };
193885ed41a7SViresh Kumar 
193985ed41a7SViresh Kumar /* functions */
194085ed41a7SViresh Kumar static struct spear_function *spear1340_functions[] = {
194185ed41a7SViresh Kumar 	&pads_as_gpio_function,
194285ed41a7SViresh Kumar 	&fsmc_function,
194385ed41a7SViresh Kumar 	&keyboard_function,
194485ed41a7SViresh Kumar 	&spdif_in_function,
194585ed41a7SViresh Kumar 	&spdif_out_function,
194685ed41a7SViresh Kumar 	&gpt_0_1_function,
194785ed41a7SViresh Kumar 	&pwm_function,
194885ed41a7SViresh Kumar 	&vip_function,
194985ed41a7SViresh Kumar 	&cam0_function,
195085ed41a7SViresh Kumar 	&cam1_function,
195185ed41a7SViresh Kumar 	&cam2_function,
195285ed41a7SViresh Kumar 	&cam3_function,
195385ed41a7SViresh Kumar 	&smi_function,
195485ed41a7SViresh Kumar 	&ssp0_function,
195585ed41a7SViresh Kumar 	&uart0_function,
195685ed41a7SViresh Kumar 	&uart1_function,
195785ed41a7SViresh Kumar 	&i2s_function,
195885ed41a7SViresh Kumar 	&gmac_function,
195985ed41a7SViresh Kumar 	&i2c0_function,
196085ed41a7SViresh Kumar 	&i2c1_function,
196185ed41a7SViresh Kumar 	&cec0_function,
196285ed41a7SViresh Kumar 	&cec1_function,
196385ed41a7SViresh Kumar 	&sdhci_function,
196485ed41a7SViresh Kumar 	&cf_function,
196585ed41a7SViresh Kumar 	&xd_function,
196685ed41a7SViresh Kumar 	&clcd_function,
196785ed41a7SViresh Kumar 	&arm_trace_function,
196885ed41a7SViresh Kumar 	&miphy_dbg_function,
196985ed41a7SViresh Kumar 	&pcie_function,
197085ed41a7SViresh Kumar 	&sata_function,
197185ed41a7SViresh Kumar };
197285ed41a7SViresh Kumar 
gpio_request_endisable(struct spear_pmx * pmx,int pin,bool enable)1973826d6ca8SShiraz Hashim static void gpio_request_endisable(struct spear_pmx *pmx, int pin,
1974826d6ca8SShiraz Hashim 		bool enable)
1975826d6ca8SShiraz Hashim {
1976826d6ca8SShiraz Hashim 	unsigned int regoffset, regindex, bitoffset;
1977826d6ca8SShiraz Hashim 	unsigned int val;
1978826d6ca8SShiraz Hashim 
1979826d6ca8SShiraz Hashim 	/* pin++ as gpio configuration starts from 2nd bit of base register */
1980826d6ca8SShiraz Hashim 	pin++;
1981826d6ca8SShiraz Hashim 
1982826d6ca8SShiraz Hashim 	regindex = pin / 32;
1983826d6ca8SShiraz Hashim 	bitoffset = pin % 32;
1984826d6ca8SShiraz Hashim 
1985826d6ca8SShiraz Hashim 	if (regindex <= 3)
1986826d6ca8SShiraz Hashim 		regoffset = PAD_FUNCTION_EN_1 + regindex * sizeof(int *);
1987826d6ca8SShiraz Hashim 	else
1988826d6ca8SShiraz Hashim 		regoffset = PAD_FUNCTION_EN_5 + (regindex - 4) * sizeof(int *);
1989826d6ca8SShiraz Hashim 
1990826d6ca8SShiraz Hashim 	val = pmx_readl(pmx, regoffset);
1991826d6ca8SShiraz Hashim 	if (enable)
1992826d6ca8SShiraz Hashim 		val &= ~(0x1 << bitoffset);
1993826d6ca8SShiraz Hashim 	else
1994826d6ca8SShiraz Hashim 		val |= 0x1 << bitoffset;
1995826d6ca8SShiraz Hashim 
1996826d6ca8SShiraz Hashim 	pmx_writel(pmx, val, regoffset);
1997826d6ca8SShiraz Hashim }
1998826d6ca8SShiraz Hashim 
199985ed41a7SViresh Kumar static struct spear_pinctrl_machdata spear1340_machdata = {
200085ed41a7SViresh Kumar 	.pins = spear1340_pins,
200185ed41a7SViresh Kumar 	.npins = ARRAY_SIZE(spear1340_pins),
200285ed41a7SViresh Kumar 	.groups = spear1340_pingroups,
200385ed41a7SViresh Kumar 	.ngroups = ARRAY_SIZE(spear1340_pingroups),
200485ed41a7SViresh Kumar 	.functions = spear1340_functions,
200585ed41a7SViresh Kumar 	.nfunctions = ARRAY_SIZE(spear1340_functions),
2006826d6ca8SShiraz Hashim 	.gpio_request_endisable = gpio_request_endisable,
200785ed41a7SViresh Kumar 	.modes_supported = false,
200885ed41a7SViresh Kumar };
200985ed41a7SViresh Kumar 
20105dfe10b4SKiran Padwal static const struct of_device_id spear1340_pinctrl_of_match[] = {
201185ed41a7SViresh Kumar 	{
201285ed41a7SViresh Kumar 		.compatible = "st,spear1340-pinmux",
201385ed41a7SViresh Kumar 	},
201485ed41a7SViresh Kumar 	{},
201585ed41a7SViresh Kumar };
201685ed41a7SViresh Kumar 
spear1340_pinctrl_probe(struct platform_device * pdev)2017150632b0SGreg Kroah-Hartman static int spear1340_pinctrl_probe(struct platform_device *pdev)
201885ed41a7SViresh Kumar {
201985ed41a7SViresh Kumar 	return spear_pinctrl_probe(pdev, &spear1340_machdata);
202085ed41a7SViresh Kumar }
202185ed41a7SViresh Kumar 
202285ed41a7SViresh Kumar static struct platform_driver spear1340_pinctrl_driver = {
202385ed41a7SViresh Kumar 	.driver = {
202485ed41a7SViresh Kumar 		.name = DRIVER_NAME,
202585ed41a7SViresh Kumar 		.of_match_table = spear1340_pinctrl_of_match,
202685ed41a7SViresh Kumar 	},
202785ed41a7SViresh Kumar 	.probe = spear1340_pinctrl_probe,
202885ed41a7SViresh Kumar };
202985ed41a7SViresh Kumar 
spear1340_pinctrl_init(void)203085ed41a7SViresh Kumar static int __init spear1340_pinctrl_init(void)
203185ed41a7SViresh Kumar {
203285ed41a7SViresh Kumar 	return platform_driver_register(&spear1340_pinctrl_driver);
203385ed41a7SViresh Kumar }
203485ed41a7SViresh Kumar arch_initcall(spear1340_pinctrl_init);
2035