18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Driver for the ST Microelectronics SPEAr1340 pinmux
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Copyright (C) 2012 ST Microelectronics
58c2ecf20Sopenharmony_ci * Viresh Kumar <vireshk@kernel.org>
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * This file is licensed under the terms of the GNU General Public
88c2ecf20Sopenharmony_ci * License version 2. This program is licensed "as is" without any
98c2ecf20Sopenharmony_ci * warranty of any kind, whether express or implied.
108c2ecf20Sopenharmony_ci */
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#include <linux/err.h>
138c2ecf20Sopenharmony_ci#include <linux/init.h>
148c2ecf20Sopenharmony_ci#include <linux/of_device.h>
158c2ecf20Sopenharmony_ci#include <linux/platform_device.h>
168c2ecf20Sopenharmony_ci#include "pinctrl-spear.h"
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#define DRIVER_NAME "spear1340-pinmux"
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci/* pins */
218c2ecf20Sopenharmony_cistatic const struct pinctrl_pin_desc spear1340_pins[] = {
228c2ecf20Sopenharmony_ci	SPEAR_PIN_0_TO_101,
238c2ecf20Sopenharmony_ci	SPEAR_PIN_102_TO_245,
248c2ecf20Sopenharmony_ci	PINCTRL_PIN(246, "PLGPIO246"),
258c2ecf20Sopenharmony_ci	PINCTRL_PIN(247, "PLGPIO247"),
268c2ecf20Sopenharmony_ci	PINCTRL_PIN(248, "PLGPIO248"),
278c2ecf20Sopenharmony_ci	PINCTRL_PIN(249, "PLGPIO249"),
288c2ecf20Sopenharmony_ci	PINCTRL_PIN(250, "PLGPIO250"),
298c2ecf20Sopenharmony_ci	PINCTRL_PIN(251, "PLGPIO251"),
308c2ecf20Sopenharmony_ci};
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci/* In SPEAr1340 there are two levels of pad muxing */
338c2ecf20Sopenharmony_ci/* - pads as gpio OR peripherals */
348c2ecf20Sopenharmony_ci#define PAD_FUNCTION_EN_1			0x668
358c2ecf20Sopenharmony_ci#define PAD_FUNCTION_EN_2			0x66C
368c2ecf20Sopenharmony_ci#define PAD_FUNCTION_EN_3			0x670
378c2ecf20Sopenharmony_ci#define PAD_FUNCTION_EN_4			0x674
388c2ecf20Sopenharmony_ci#define PAD_FUNCTION_EN_5			0x690
398c2ecf20Sopenharmony_ci#define PAD_FUNCTION_EN_6			0x694
408c2ecf20Sopenharmony_ci#define PAD_FUNCTION_EN_7			0x698
418c2ecf20Sopenharmony_ci#define PAD_FUNCTION_EN_8			0x69C
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci/* - If peripherals, then primary OR alternate peripheral */
448c2ecf20Sopenharmony_ci#define PAD_SHARED_IP_EN_1			0x6A0
458c2ecf20Sopenharmony_ci#define PAD_SHARED_IP_EN_2			0x6A4
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci/*
488c2ecf20Sopenharmony_ci * Macro's for first level of pmx - pads as gpio OR peripherals. There are 8
498c2ecf20Sopenharmony_ci * registers with 32 bits each for handling gpio pads, register 8 has only 26
508c2ecf20Sopenharmony_ci * relevant bits.
518c2ecf20Sopenharmony_ci */
528c2ecf20Sopenharmony_ci/* macro's for making pads as gpio's */
538c2ecf20Sopenharmony_ci#define PADS_AS_GPIO_REG0_MASK			0xFFFFFFFE
548c2ecf20Sopenharmony_ci#define PADS_AS_GPIO_REGS_MASK			0xFFFFFFFF
558c2ecf20Sopenharmony_ci#define PADS_AS_GPIO_REG7_MASK			0x07FFFFFF
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci/* macro's for making pads as peripherals */
588c2ecf20Sopenharmony_ci#define FSMC_16_BIT_AND_KBD_ROW_COL_REG0_MASK	0x00000FFE
598c2ecf20Sopenharmony_ci#define UART0_ENH_AND_GPT_REG0_MASK		0x0003F000
608c2ecf20Sopenharmony_ci#define PWM1_AND_KBD_COL5_REG0_MASK		0x00040000
618c2ecf20Sopenharmony_ci#define I2C1_REG0_MASK				0x01080000
628c2ecf20Sopenharmony_ci#define SPDIF_IN_REG0_MASK			0x00100000
638c2ecf20Sopenharmony_ci#define PWM2_AND_GPT0_TMR0_CPT_REG0_MASK	0x00400000
648c2ecf20Sopenharmony_ci#define PWM3_AND_GPT0_TMR1_CLK_REG0_MASK	0x00800000
658c2ecf20Sopenharmony_ci#define PWM0_AND_SSP0_CS1_REG0_MASK		0x02000000
668c2ecf20Sopenharmony_ci#define VIP_AND_CAM3_REG0_MASK			0xFC200000
678c2ecf20Sopenharmony_ci#define VIP_AND_CAM3_REG1_MASK			0x0000000F
688c2ecf20Sopenharmony_ci#define VIP_REG1_MASK				0x00001EF0
698c2ecf20Sopenharmony_ci#define VIP_AND_CAM2_REG1_MASK			0x007FE100
708c2ecf20Sopenharmony_ci#define VIP_AND_CAM1_REG1_MASK			0xFF800000
718c2ecf20Sopenharmony_ci#define VIP_AND_CAM1_REG2_MASK			0x00000003
728c2ecf20Sopenharmony_ci#define VIP_AND_CAM0_REG2_MASK			0x00001FFC
738c2ecf20Sopenharmony_ci#define SMI_REG2_MASK				0x0021E000
748c2ecf20Sopenharmony_ci#define SSP0_REG2_MASK				0x001E0000
758c2ecf20Sopenharmony_ci#define TS_AND_SSP0_CS2_REG2_MASK		0x00400000
768c2ecf20Sopenharmony_ci#define UART0_REG2_MASK				0x01800000
778c2ecf20Sopenharmony_ci#define UART1_REG2_MASK				0x06000000
788c2ecf20Sopenharmony_ci#define I2S_IN_REG2_MASK			0xF8000000
798c2ecf20Sopenharmony_ci#define DEVS_GRP_AND_MIPHY_DBG_REG3_MASK	0x000001FE
808c2ecf20Sopenharmony_ci#define I2S_OUT_REG3_MASK			0x000001EF
818c2ecf20Sopenharmony_ci#define I2S_IN_REG3_MASK			0x00000010
828c2ecf20Sopenharmony_ci#define GMAC_REG3_MASK				0xFFFFFE00
838c2ecf20Sopenharmony_ci#define GMAC_REG4_MASK				0x0000001F
848c2ecf20Sopenharmony_ci#define DEVS_GRP_AND_MIPHY_DBG_REG4_MASK	0x7FFFFF20
858c2ecf20Sopenharmony_ci#define SSP0_CS3_REG4_MASK			0x00000020
868c2ecf20Sopenharmony_ci#define I2C0_REG4_MASK				0x000000C0
878c2ecf20Sopenharmony_ci#define CEC0_REG4_MASK				0x00000100
888c2ecf20Sopenharmony_ci#define CEC1_REG4_MASK				0x00000200
898c2ecf20Sopenharmony_ci#define SPDIF_OUT_REG4_MASK			0x00000400
908c2ecf20Sopenharmony_ci#define CLCD_REG4_MASK				0x7FFFF800
918c2ecf20Sopenharmony_ci#define CLCD_AND_ARM_TRACE_REG4_MASK		0x80000000
928c2ecf20Sopenharmony_ci#define CLCD_AND_ARM_TRACE_REG5_MASK		0xFFFFFFFF
938c2ecf20Sopenharmony_ci#define CLCD_AND_ARM_TRACE_REG6_MASK		0x00000001
948c2ecf20Sopenharmony_ci#define FSMC_PNOR_AND_MCIF_REG6_MASK		0x073FFFFE
958c2ecf20Sopenharmony_ci#define MCIF_REG6_MASK				0xF8C00000
968c2ecf20Sopenharmony_ci#define MCIF_REG7_MASK				0x000043FF
978c2ecf20Sopenharmony_ci#define FSMC_8BIT_REG7_MASK			0x07FFBC00
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci/* other registers */
1008c2ecf20Sopenharmony_ci#define PERIP_CFG				0x42C
1018c2ecf20Sopenharmony_ci	/* PERIP_CFG register masks */
1028c2ecf20Sopenharmony_ci	#define SSP_CS_CTL_HW			0
1038c2ecf20Sopenharmony_ci	#define SSP_CS_CTL_SW			1
1048c2ecf20Sopenharmony_ci	#define SSP_CS_CTL_MASK			1
1058c2ecf20Sopenharmony_ci	#define SSP_CS_CTL_SHIFT		21
1068c2ecf20Sopenharmony_ci	#define SSP_CS_VAL_MASK			1
1078c2ecf20Sopenharmony_ci	#define SSP_CS_VAL_SHIFT		20
1088c2ecf20Sopenharmony_ci	#define SSP_CS_SEL_CS0			0
1098c2ecf20Sopenharmony_ci	#define SSP_CS_SEL_CS1			1
1108c2ecf20Sopenharmony_ci	#define SSP_CS_SEL_CS2			2
1118c2ecf20Sopenharmony_ci	#define SSP_CS_SEL_MASK			3
1128c2ecf20Sopenharmony_ci	#define SSP_CS_SEL_SHIFT		18
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_ci	#define I2S_CHNL_2_0			(0)
1158c2ecf20Sopenharmony_ci	#define I2S_CHNL_3_1			(1)
1168c2ecf20Sopenharmony_ci	#define I2S_CHNL_5_1			(2)
1178c2ecf20Sopenharmony_ci	#define I2S_CHNL_7_1			(3)
1188c2ecf20Sopenharmony_ci	#define I2S_CHNL_PLAY_SHIFT		(4)
1198c2ecf20Sopenharmony_ci	#define I2S_CHNL_PLAY_MASK		(3 << 4)
1208c2ecf20Sopenharmony_ci	#define I2S_CHNL_REC_SHIFT		(6)
1218c2ecf20Sopenharmony_ci	#define I2S_CHNL_REC_MASK		(3 << 6)
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci	#define SPDIF_OUT_ENB_MASK		(1 << 2)
1248c2ecf20Sopenharmony_ci	#define SPDIF_OUT_ENB_SHIFT		2
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ci	#define MCIF_SEL_SD			1
1278c2ecf20Sopenharmony_ci	#define MCIF_SEL_CF			2
1288c2ecf20Sopenharmony_ci	#define MCIF_SEL_XD			3
1298c2ecf20Sopenharmony_ci	#define MCIF_SEL_MASK			3
1308c2ecf20Sopenharmony_ci	#define MCIF_SEL_SHIFT			0
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci#define GMAC_CLK_CFG				0x248
1338c2ecf20Sopenharmony_ci	#define GMAC_PHY_IF_GMII_VAL		(0 << 3)
1348c2ecf20Sopenharmony_ci	#define GMAC_PHY_IF_RGMII_VAL		(1 << 3)
1358c2ecf20Sopenharmony_ci	#define GMAC_PHY_IF_SGMII_VAL		(2 << 3)
1368c2ecf20Sopenharmony_ci	#define GMAC_PHY_IF_RMII_VAL		(4 << 3)
1378c2ecf20Sopenharmony_ci	#define GMAC_PHY_IF_SEL_MASK		(7 << 3)
1388c2ecf20Sopenharmony_ci	#define GMAC_PHY_INPUT_ENB_VAL		0
1398c2ecf20Sopenharmony_ci	#define GMAC_PHY_SYNT_ENB_VAL		1
1408c2ecf20Sopenharmony_ci	#define GMAC_PHY_CLK_MASK		1
1418c2ecf20Sopenharmony_ci	#define GMAC_PHY_CLK_SHIFT		2
1428c2ecf20Sopenharmony_ci	#define GMAC_PHY_125M_PAD_VAL		0
1438c2ecf20Sopenharmony_ci	#define GMAC_PHY_PLL2_VAL		1
1448c2ecf20Sopenharmony_ci	#define GMAC_PHY_OSC3_VAL		2
1458c2ecf20Sopenharmony_ci	#define GMAC_PHY_INPUT_CLK_MASK		3
1468c2ecf20Sopenharmony_ci	#define GMAC_PHY_INPUT_CLK_SHIFT	0
1478c2ecf20Sopenharmony_ci
1488c2ecf20Sopenharmony_ci#define PCIE_SATA_CFG				0x424
1498c2ecf20Sopenharmony_ci	/* PCIE CFG MASks */
1508c2ecf20Sopenharmony_ci	#define PCIE_CFG_DEVICE_PRESENT		(1 << 11)
1518c2ecf20Sopenharmony_ci	#define PCIE_CFG_POWERUP_RESET		(1 << 10)
1528c2ecf20Sopenharmony_ci	#define PCIE_CFG_CORE_CLK_EN		(1 << 9)
1538c2ecf20Sopenharmony_ci	#define PCIE_CFG_AUX_CLK_EN		(1 << 8)
1548c2ecf20Sopenharmony_ci	#define SATA_CFG_TX_CLK_EN		(1 << 4)
1558c2ecf20Sopenharmony_ci	#define SATA_CFG_RX_CLK_EN		(1 << 3)
1568c2ecf20Sopenharmony_ci	#define SATA_CFG_POWERUP_RESET		(1 << 2)
1578c2ecf20Sopenharmony_ci	#define SATA_CFG_PM_CLK_EN		(1 << 1)
1588c2ecf20Sopenharmony_ci	#define PCIE_SATA_SEL_PCIE		(0)
1598c2ecf20Sopenharmony_ci	#define PCIE_SATA_SEL_SATA		(1)
1608c2ecf20Sopenharmony_ci	#define SATA_PCIE_CFG_MASK		0xF1F
1618c2ecf20Sopenharmony_ci	#define PCIE_CFG_VAL	(PCIE_SATA_SEL_PCIE | PCIE_CFG_AUX_CLK_EN | \
1628c2ecf20Sopenharmony_ci				PCIE_CFG_CORE_CLK_EN | PCIE_CFG_POWERUP_RESET |\
1638c2ecf20Sopenharmony_ci				PCIE_CFG_DEVICE_PRESENT)
1648c2ecf20Sopenharmony_ci	#define SATA_CFG_VAL	(PCIE_SATA_SEL_SATA | SATA_CFG_PM_CLK_EN | \
1658c2ecf20Sopenharmony_ci				SATA_CFG_POWERUP_RESET | SATA_CFG_RX_CLK_EN | \
1668c2ecf20Sopenharmony_ci				SATA_CFG_TX_CLK_EN)
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_ci/* Macro's for second level of pmx - pads as primary OR alternate peripheral */
1698c2ecf20Sopenharmony_ci/* Write 0 to enable FSMC_16_BIT */
1708c2ecf20Sopenharmony_ci#define KBD_ROW_COL_MASK			(1 << 0)
1718c2ecf20Sopenharmony_ci
1728c2ecf20Sopenharmony_ci/* Write 0 to enable UART0_ENH */
1738c2ecf20Sopenharmony_ci#define GPT_MASK				(1 << 1) /* Only clk & cpt */
1748c2ecf20Sopenharmony_ci
1758c2ecf20Sopenharmony_ci/* Write 0 to enable PWM1 */
1768c2ecf20Sopenharmony_ci#define KBD_COL5_MASK				(1 << 2)
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_ci/* Write 0 to enable PWM2 */
1798c2ecf20Sopenharmony_ci#define GPT0_TMR0_CPT_MASK			(1 << 3) /* Only clk & cpt */
1808c2ecf20Sopenharmony_ci
1818c2ecf20Sopenharmony_ci/* Write 0 to enable PWM3 */
1828c2ecf20Sopenharmony_ci#define GPT0_TMR1_CLK_MASK			(1 << 4) /* Only clk & cpt */
1838c2ecf20Sopenharmony_ci
1848c2ecf20Sopenharmony_ci/* Write 0 to enable PWM0 */
1858c2ecf20Sopenharmony_ci#define SSP0_CS1_MASK				(1 << 5)
1868c2ecf20Sopenharmony_ci
1878c2ecf20Sopenharmony_ci/* Write 0 to enable VIP */
1888c2ecf20Sopenharmony_ci#define CAM3_MASK				(1 << 6)
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_ci/* Write 0 to enable VIP */
1918c2ecf20Sopenharmony_ci#define CAM2_MASK				(1 << 7)
1928c2ecf20Sopenharmony_ci
1938c2ecf20Sopenharmony_ci/* Write 0 to enable VIP */
1948c2ecf20Sopenharmony_ci#define CAM1_MASK				(1 << 8)
1958c2ecf20Sopenharmony_ci
1968c2ecf20Sopenharmony_ci/* Write 0 to enable VIP */
1978c2ecf20Sopenharmony_ci#define CAM0_MASK				(1 << 9)
1988c2ecf20Sopenharmony_ci
1998c2ecf20Sopenharmony_ci/* Write 0 to enable TS */
2008c2ecf20Sopenharmony_ci#define SSP0_CS2_MASK				(1 << 10)
2018c2ecf20Sopenharmony_ci
2028c2ecf20Sopenharmony_ci/* Write 0 to enable FSMC PNOR */
2038c2ecf20Sopenharmony_ci#define MCIF_MASK				(1 << 11)
2048c2ecf20Sopenharmony_ci
2058c2ecf20Sopenharmony_ci/* Write 0 to enable CLCD */
2068c2ecf20Sopenharmony_ci#define ARM_TRACE_MASK				(1 << 12)
2078c2ecf20Sopenharmony_ci
2088c2ecf20Sopenharmony_ci/* Write 0 to enable I2S, SSP0_CS2, CEC0, 1, SPDIF out, CLCD */
2098c2ecf20Sopenharmony_ci#define MIPHY_DBG_MASK				(1 << 13)
2108c2ecf20Sopenharmony_ci
2118c2ecf20Sopenharmony_ci/*
2128c2ecf20Sopenharmony_ci * Pad multiplexing for making all pads as gpio's. This is done to override the
2138c2ecf20Sopenharmony_ci * values passed from bootloader and start from scratch.
2148c2ecf20Sopenharmony_ci */
2158c2ecf20Sopenharmony_cistatic const unsigned pads_as_gpio_pins[] = { 12, 88, 89, 251 };
2168c2ecf20Sopenharmony_cistatic struct spear_muxreg pads_as_gpio_muxreg[] = {
2178c2ecf20Sopenharmony_ci	{
2188c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_1,
2198c2ecf20Sopenharmony_ci		.mask = PADS_AS_GPIO_REG0_MASK,
2208c2ecf20Sopenharmony_ci		.val = 0x0,
2218c2ecf20Sopenharmony_ci	}, {
2228c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_2,
2238c2ecf20Sopenharmony_ci		.mask = PADS_AS_GPIO_REGS_MASK,
2248c2ecf20Sopenharmony_ci		.val = 0x0,
2258c2ecf20Sopenharmony_ci	}, {
2268c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_3,
2278c2ecf20Sopenharmony_ci		.mask = PADS_AS_GPIO_REGS_MASK,
2288c2ecf20Sopenharmony_ci		.val = 0x0,
2298c2ecf20Sopenharmony_ci	}, {
2308c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_4,
2318c2ecf20Sopenharmony_ci		.mask = PADS_AS_GPIO_REGS_MASK,
2328c2ecf20Sopenharmony_ci		.val = 0x0,
2338c2ecf20Sopenharmony_ci	}, {
2348c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_5,
2358c2ecf20Sopenharmony_ci		.mask = PADS_AS_GPIO_REGS_MASK,
2368c2ecf20Sopenharmony_ci		.val = 0x0,
2378c2ecf20Sopenharmony_ci	}, {
2388c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_6,
2398c2ecf20Sopenharmony_ci		.mask = PADS_AS_GPIO_REGS_MASK,
2408c2ecf20Sopenharmony_ci		.val = 0x0,
2418c2ecf20Sopenharmony_ci	}, {
2428c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_7,
2438c2ecf20Sopenharmony_ci		.mask = PADS_AS_GPIO_REGS_MASK,
2448c2ecf20Sopenharmony_ci		.val = 0x0,
2458c2ecf20Sopenharmony_ci	}, {
2468c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_8,
2478c2ecf20Sopenharmony_ci		.mask = PADS_AS_GPIO_REG7_MASK,
2488c2ecf20Sopenharmony_ci		.val = 0x0,
2498c2ecf20Sopenharmony_ci	},
2508c2ecf20Sopenharmony_ci};
2518c2ecf20Sopenharmony_ci
2528c2ecf20Sopenharmony_cistatic struct spear_modemux pads_as_gpio_modemux[] = {
2538c2ecf20Sopenharmony_ci	{
2548c2ecf20Sopenharmony_ci		.muxregs = pads_as_gpio_muxreg,
2558c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pads_as_gpio_muxreg),
2568c2ecf20Sopenharmony_ci	},
2578c2ecf20Sopenharmony_ci};
2588c2ecf20Sopenharmony_ci
2598c2ecf20Sopenharmony_cistatic struct spear_pingroup pads_as_gpio_pingroup = {
2608c2ecf20Sopenharmony_ci	.name = "pads_as_gpio_grp",
2618c2ecf20Sopenharmony_ci	.pins = pads_as_gpio_pins,
2628c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(pads_as_gpio_pins),
2638c2ecf20Sopenharmony_ci	.modemuxs = pads_as_gpio_modemux,
2648c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(pads_as_gpio_modemux),
2658c2ecf20Sopenharmony_ci};
2668c2ecf20Sopenharmony_ci
2678c2ecf20Sopenharmony_cistatic const char *const pads_as_gpio_grps[] = { "pads_as_gpio_grp" };
2688c2ecf20Sopenharmony_cistatic struct spear_function pads_as_gpio_function = {
2698c2ecf20Sopenharmony_ci	.name = "pads_as_gpio",
2708c2ecf20Sopenharmony_ci	.groups = pads_as_gpio_grps,
2718c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(pads_as_gpio_grps),
2728c2ecf20Sopenharmony_ci};
2738c2ecf20Sopenharmony_ci
2748c2ecf20Sopenharmony_ci/* Pad multiplexing for fsmc_8bit device */
2758c2ecf20Sopenharmony_cistatic const unsigned fsmc_8bit_pins[] = { 233, 234, 235, 236, 238, 239, 240,
2768c2ecf20Sopenharmony_ci	241, 242, 243, 244, 245, 246, 247, 248, 249 };
2778c2ecf20Sopenharmony_cistatic struct spear_muxreg fsmc_8bit_muxreg[] = {
2788c2ecf20Sopenharmony_ci	{
2798c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_8,
2808c2ecf20Sopenharmony_ci		.mask = FSMC_8BIT_REG7_MASK,
2818c2ecf20Sopenharmony_ci		.val = FSMC_8BIT_REG7_MASK,
2828c2ecf20Sopenharmony_ci	}
2838c2ecf20Sopenharmony_ci};
2848c2ecf20Sopenharmony_ci
2858c2ecf20Sopenharmony_cistatic struct spear_modemux fsmc_8bit_modemux[] = {
2868c2ecf20Sopenharmony_ci	{
2878c2ecf20Sopenharmony_ci		.muxregs = fsmc_8bit_muxreg,
2888c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(fsmc_8bit_muxreg),
2898c2ecf20Sopenharmony_ci	},
2908c2ecf20Sopenharmony_ci};
2918c2ecf20Sopenharmony_ci
2928c2ecf20Sopenharmony_cistatic struct spear_pingroup fsmc_8bit_pingroup = {
2938c2ecf20Sopenharmony_ci	.name = "fsmc_8bit_grp",
2948c2ecf20Sopenharmony_ci	.pins = fsmc_8bit_pins,
2958c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(fsmc_8bit_pins),
2968c2ecf20Sopenharmony_ci	.modemuxs = fsmc_8bit_modemux,
2978c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(fsmc_8bit_modemux),
2988c2ecf20Sopenharmony_ci};
2998c2ecf20Sopenharmony_ci
3008c2ecf20Sopenharmony_ci/* Pad multiplexing for fsmc_16bit device */
3018c2ecf20Sopenharmony_cistatic const unsigned fsmc_16bit_pins[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
3028c2ecf20Sopenharmony_cistatic struct spear_muxreg fsmc_16bit_muxreg[] = {
3038c2ecf20Sopenharmony_ci	{
3048c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
3058c2ecf20Sopenharmony_ci		.mask = KBD_ROW_COL_MASK,
3068c2ecf20Sopenharmony_ci		.val = 0,
3078c2ecf20Sopenharmony_ci	}, {
3088c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_1,
3098c2ecf20Sopenharmony_ci		.mask = FSMC_16_BIT_AND_KBD_ROW_COL_REG0_MASK,
3108c2ecf20Sopenharmony_ci		.val = FSMC_16_BIT_AND_KBD_ROW_COL_REG0_MASK,
3118c2ecf20Sopenharmony_ci	},
3128c2ecf20Sopenharmony_ci};
3138c2ecf20Sopenharmony_ci
3148c2ecf20Sopenharmony_cistatic struct spear_modemux fsmc_16bit_modemux[] = {
3158c2ecf20Sopenharmony_ci	{
3168c2ecf20Sopenharmony_ci		.muxregs = fsmc_16bit_muxreg,
3178c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(fsmc_16bit_muxreg),
3188c2ecf20Sopenharmony_ci	},
3198c2ecf20Sopenharmony_ci};
3208c2ecf20Sopenharmony_ci
3218c2ecf20Sopenharmony_cistatic struct spear_pingroup fsmc_16bit_pingroup = {
3228c2ecf20Sopenharmony_ci	.name = "fsmc_16bit_grp",
3238c2ecf20Sopenharmony_ci	.pins = fsmc_16bit_pins,
3248c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(fsmc_16bit_pins),
3258c2ecf20Sopenharmony_ci	.modemuxs = fsmc_16bit_modemux,
3268c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(fsmc_16bit_modemux),
3278c2ecf20Sopenharmony_ci};
3288c2ecf20Sopenharmony_ci
3298c2ecf20Sopenharmony_ci/* pad multiplexing for fsmc_pnor device */
3308c2ecf20Sopenharmony_cistatic const unsigned fsmc_pnor_pins[] = { 192, 193, 194, 195, 196, 197, 198,
3318c2ecf20Sopenharmony_ci	199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212,
3328c2ecf20Sopenharmony_ci	215, 216, 217 };
3338c2ecf20Sopenharmony_cistatic struct spear_muxreg fsmc_pnor_muxreg[] = {
3348c2ecf20Sopenharmony_ci	{
3358c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
3368c2ecf20Sopenharmony_ci		.mask = MCIF_MASK,
3378c2ecf20Sopenharmony_ci		.val = 0,
3388c2ecf20Sopenharmony_ci	}, {
3398c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_7,
3408c2ecf20Sopenharmony_ci		.mask = FSMC_PNOR_AND_MCIF_REG6_MASK,
3418c2ecf20Sopenharmony_ci		.val = FSMC_PNOR_AND_MCIF_REG6_MASK,
3428c2ecf20Sopenharmony_ci	},
3438c2ecf20Sopenharmony_ci};
3448c2ecf20Sopenharmony_ci
3458c2ecf20Sopenharmony_cistatic struct spear_modemux fsmc_pnor_modemux[] = {
3468c2ecf20Sopenharmony_ci	{
3478c2ecf20Sopenharmony_ci		.muxregs = fsmc_pnor_muxreg,
3488c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(fsmc_pnor_muxreg),
3498c2ecf20Sopenharmony_ci	},
3508c2ecf20Sopenharmony_ci};
3518c2ecf20Sopenharmony_ci
3528c2ecf20Sopenharmony_cistatic struct spear_pingroup fsmc_pnor_pingroup = {
3538c2ecf20Sopenharmony_ci	.name = "fsmc_pnor_grp",
3548c2ecf20Sopenharmony_ci	.pins = fsmc_pnor_pins,
3558c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(fsmc_pnor_pins),
3568c2ecf20Sopenharmony_ci	.modemuxs = fsmc_pnor_modemux,
3578c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(fsmc_pnor_modemux),
3588c2ecf20Sopenharmony_ci};
3598c2ecf20Sopenharmony_ci
3608c2ecf20Sopenharmony_cistatic const char *const fsmc_grps[] = { "fsmc_8bit_grp", "fsmc_16bit_grp",
3618c2ecf20Sopenharmony_ci	"fsmc_pnor_grp" };
3628c2ecf20Sopenharmony_cistatic struct spear_function fsmc_function = {
3638c2ecf20Sopenharmony_ci	.name = "fsmc",
3648c2ecf20Sopenharmony_ci	.groups = fsmc_grps,
3658c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(fsmc_grps),
3668c2ecf20Sopenharmony_ci};
3678c2ecf20Sopenharmony_ci
3688c2ecf20Sopenharmony_ci/* pad multiplexing for keyboard rows-cols device */
3698c2ecf20Sopenharmony_cistatic const unsigned keyboard_row_col_pins[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
3708c2ecf20Sopenharmony_ci	10 };
3718c2ecf20Sopenharmony_cistatic struct spear_muxreg keyboard_row_col_muxreg[] = {
3728c2ecf20Sopenharmony_ci	{
3738c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
3748c2ecf20Sopenharmony_ci		.mask = KBD_ROW_COL_MASK,
3758c2ecf20Sopenharmony_ci		.val = KBD_ROW_COL_MASK,
3768c2ecf20Sopenharmony_ci	}, {
3778c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_1,
3788c2ecf20Sopenharmony_ci		.mask = FSMC_16_BIT_AND_KBD_ROW_COL_REG0_MASK,
3798c2ecf20Sopenharmony_ci		.val = FSMC_16_BIT_AND_KBD_ROW_COL_REG0_MASK,
3808c2ecf20Sopenharmony_ci	},
3818c2ecf20Sopenharmony_ci};
3828c2ecf20Sopenharmony_ci
3838c2ecf20Sopenharmony_cistatic struct spear_modemux keyboard_row_col_modemux[] = {
3848c2ecf20Sopenharmony_ci	{
3858c2ecf20Sopenharmony_ci		.muxregs = keyboard_row_col_muxreg,
3868c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(keyboard_row_col_muxreg),
3878c2ecf20Sopenharmony_ci	},
3888c2ecf20Sopenharmony_ci};
3898c2ecf20Sopenharmony_ci
3908c2ecf20Sopenharmony_cistatic struct spear_pingroup keyboard_row_col_pingroup = {
3918c2ecf20Sopenharmony_ci	.name = "keyboard_row_col_grp",
3928c2ecf20Sopenharmony_ci	.pins = keyboard_row_col_pins,
3938c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(keyboard_row_col_pins),
3948c2ecf20Sopenharmony_ci	.modemuxs = keyboard_row_col_modemux,
3958c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(keyboard_row_col_modemux),
3968c2ecf20Sopenharmony_ci};
3978c2ecf20Sopenharmony_ci
3988c2ecf20Sopenharmony_ci/* pad multiplexing for keyboard col5 device */
3998c2ecf20Sopenharmony_cistatic const unsigned keyboard_col5_pins[] = { 17 };
4008c2ecf20Sopenharmony_cistatic struct spear_muxreg keyboard_col5_muxreg[] = {
4018c2ecf20Sopenharmony_ci	{
4028c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
4038c2ecf20Sopenharmony_ci		.mask = KBD_COL5_MASK,
4048c2ecf20Sopenharmony_ci		.val = KBD_COL5_MASK,
4058c2ecf20Sopenharmony_ci	}, {
4068c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_1,
4078c2ecf20Sopenharmony_ci		.mask = PWM1_AND_KBD_COL5_REG0_MASK,
4088c2ecf20Sopenharmony_ci		.val = PWM1_AND_KBD_COL5_REG0_MASK,
4098c2ecf20Sopenharmony_ci	},
4108c2ecf20Sopenharmony_ci};
4118c2ecf20Sopenharmony_ci
4128c2ecf20Sopenharmony_cistatic struct spear_modemux keyboard_col5_modemux[] = {
4138c2ecf20Sopenharmony_ci	{
4148c2ecf20Sopenharmony_ci		.muxregs = keyboard_col5_muxreg,
4158c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(keyboard_col5_muxreg),
4168c2ecf20Sopenharmony_ci	},
4178c2ecf20Sopenharmony_ci};
4188c2ecf20Sopenharmony_ci
4198c2ecf20Sopenharmony_cistatic struct spear_pingroup keyboard_col5_pingroup = {
4208c2ecf20Sopenharmony_ci	.name = "keyboard_col5_grp",
4218c2ecf20Sopenharmony_ci	.pins = keyboard_col5_pins,
4228c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(keyboard_col5_pins),
4238c2ecf20Sopenharmony_ci	.modemuxs = keyboard_col5_modemux,
4248c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(keyboard_col5_modemux),
4258c2ecf20Sopenharmony_ci};
4268c2ecf20Sopenharmony_ci
4278c2ecf20Sopenharmony_cistatic const char *const keyboard_grps[] = { "keyboard_row_col_grp",
4288c2ecf20Sopenharmony_ci	"keyboard_col5_grp" };
4298c2ecf20Sopenharmony_cistatic struct spear_function keyboard_function = {
4308c2ecf20Sopenharmony_ci	.name = "keyboard",
4318c2ecf20Sopenharmony_ci	.groups = keyboard_grps,
4328c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(keyboard_grps),
4338c2ecf20Sopenharmony_ci};
4348c2ecf20Sopenharmony_ci
4358c2ecf20Sopenharmony_ci/* pad multiplexing for spdif_in device */
4368c2ecf20Sopenharmony_cistatic const unsigned spdif_in_pins[] = { 19 };
4378c2ecf20Sopenharmony_cistatic struct spear_muxreg spdif_in_muxreg[] = {
4388c2ecf20Sopenharmony_ci	{
4398c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_1,
4408c2ecf20Sopenharmony_ci		.mask = SPDIF_IN_REG0_MASK,
4418c2ecf20Sopenharmony_ci		.val = SPDIF_IN_REG0_MASK,
4428c2ecf20Sopenharmony_ci	},
4438c2ecf20Sopenharmony_ci};
4448c2ecf20Sopenharmony_ci
4458c2ecf20Sopenharmony_cistatic struct spear_modemux spdif_in_modemux[] = {
4468c2ecf20Sopenharmony_ci	{
4478c2ecf20Sopenharmony_ci		.muxregs = spdif_in_muxreg,
4488c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(spdif_in_muxreg),
4498c2ecf20Sopenharmony_ci	},
4508c2ecf20Sopenharmony_ci};
4518c2ecf20Sopenharmony_ci
4528c2ecf20Sopenharmony_cistatic struct spear_pingroup spdif_in_pingroup = {
4538c2ecf20Sopenharmony_ci	.name = "spdif_in_grp",
4548c2ecf20Sopenharmony_ci	.pins = spdif_in_pins,
4558c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(spdif_in_pins),
4568c2ecf20Sopenharmony_ci	.modemuxs = spdif_in_modemux,
4578c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(spdif_in_modemux),
4588c2ecf20Sopenharmony_ci};
4598c2ecf20Sopenharmony_ci
4608c2ecf20Sopenharmony_cistatic const char *const spdif_in_grps[] = { "spdif_in_grp" };
4618c2ecf20Sopenharmony_cistatic struct spear_function spdif_in_function = {
4628c2ecf20Sopenharmony_ci	.name = "spdif_in",
4638c2ecf20Sopenharmony_ci	.groups = spdif_in_grps,
4648c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(spdif_in_grps),
4658c2ecf20Sopenharmony_ci};
4668c2ecf20Sopenharmony_ci
4678c2ecf20Sopenharmony_ci/* pad multiplexing for spdif_out device */
4688c2ecf20Sopenharmony_cistatic const unsigned spdif_out_pins[] = { 137 };
4698c2ecf20Sopenharmony_cistatic struct spear_muxreg spdif_out_muxreg[] = {
4708c2ecf20Sopenharmony_ci	{
4718c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_5,
4728c2ecf20Sopenharmony_ci		.mask = SPDIF_OUT_REG4_MASK,
4738c2ecf20Sopenharmony_ci		.val = SPDIF_OUT_REG4_MASK,
4748c2ecf20Sopenharmony_ci	}, {
4758c2ecf20Sopenharmony_ci		.reg = PERIP_CFG,
4768c2ecf20Sopenharmony_ci		.mask = SPDIF_OUT_ENB_MASK,
4778c2ecf20Sopenharmony_ci		.val = SPDIF_OUT_ENB_MASK,
4788c2ecf20Sopenharmony_ci	}
4798c2ecf20Sopenharmony_ci};
4808c2ecf20Sopenharmony_ci
4818c2ecf20Sopenharmony_cistatic struct spear_modemux spdif_out_modemux[] = {
4828c2ecf20Sopenharmony_ci	{
4838c2ecf20Sopenharmony_ci		.muxregs = spdif_out_muxreg,
4848c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(spdif_out_muxreg),
4858c2ecf20Sopenharmony_ci	},
4868c2ecf20Sopenharmony_ci};
4878c2ecf20Sopenharmony_ci
4888c2ecf20Sopenharmony_cistatic struct spear_pingroup spdif_out_pingroup = {
4898c2ecf20Sopenharmony_ci	.name = "spdif_out_grp",
4908c2ecf20Sopenharmony_ci	.pins = spdif_out_pins,
4918c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(spdif_out_pins),
4928c2ecf20Sopenharmony_ci	.modemuxs = spdif_out_modemux,
4938c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(spdif_out_modemux),
4948c2ecf20Sopenharmony_ci};
4958c2ecf20Sopenharmony_ci
4968c2ecf20Sopenharmony_cistatic const char *const spdif_out_grps[] = { "spdif_out_grp" };
4978c2ecf20Sopenharmony_cistatic struct spear_function spdif_out_function = {
4988c2ecf20Sopenharmony_ci	.name = "spdif_out",
4998c2ecf20Sopenharmony_ci	.groups = spdif_out_grps,
5008c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(spdif_out_grps),
5018c2ecf20Sopenharmony_ci};
5028c2ecf20Sopenharmony_ci
5038c2ecf20Sopenharmony_ci/* pad multiplexing for gpt_0_1 device */
5048c2ecf20Sopenharmony_cistatic const unsigned gpt_0_1_pins[] = { 11, 12, 13, 14, 15, 16, 21, 22 };
5058c2ecf20Sopenharmony_cistatic struct spear_muxreg gpt_0_1_muxreg[] = {
5068c2ecf20Sopenharmony_ci	{
5078c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
5088c2ecf20Sopenharmony_ci		.mask = GPT_MASK | GPT0_TMR0_CPT_MASK | GPT0_TMR1_CLK_MASK,
5098c2ecf20Sopenharmony_ci		.val = GPT_MASK | GPT0_TMR0_CPT_MASK | GPT0_TMR1_CLK_MASK,
5108c2ecf20Sopenharmony_ci	}, {
5118c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_1,
5128c2ecf20Sopenharmony_ci		.mask = UART0_ENH_AND_GPT_REG0_MASK |
5138c2ecf20Sopenharmony_ci			PWM2_AND_GPT0_TMR0_CPT_REG0_MASK |
5148c2ecf20Sopenharmony_ci			PWM3_AND_GPT0_TMR1_CLK_REG0_MASK,
5158c2ecf20Sopenharmony_ci		.val = UART0_ENH_AND_GPT_REG0_MASK |
5168c2ecf20Sopenharmony_ci			PWM2_AND_GPT0_TMR0_CPT_REG0_MASK |
5178c2ecf20Sopenharmony_ci			PWM3_AND_GPT0_TMR1_CLK_REG0_MASK,
5188c2ecf20Sopenharmony_ci	},
5198c2ecf20Sopenharmony_ci};
5208c2ecf20Sopenharmony_ci
5218c2ecf20Sopenharmony_cistatic struct spear_modemux gpt_0_1_modemux[] = {
5228c2ecf20Sopenharmony_ci	{
5238c2ecf20Sopenharmony_ci		.muxregs = gpt_0_1_muxreg,
5248c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(gpt_0_1_muxreg),
5258c2ecf20Sopenharmony_ci	},
5268c2ecf20Sopenharmony_ci};
5278c2ecf20Sopenharmony_ci
5288c2ecf20Sopenharmony_cistatic struct spear_pingroup gpt_0_1_pingroup = {
5298c2ecf20Sopenharmony_ci	.name = "gpt_0_1_grp",
5308c2ecf20Sopenharmony_ci	.pins = gpt_0_1_pins,
5318c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(gpt_0_1_pins),
5328c2ecf20Sopenharmony_ci	.modemuxs = gpt_0_1_modemux,
5338c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(gpt_0_1_modemux),
5348c2ecf20Sopenharmony_ci};
5358c2ecf20Sopenharmony_ci
5368c2ecf20Sopenharmony_cistatic const char *const gpt_0_1_grps[] = { "gpt_0_1_grp" };
5378c2ecf20Sopenharmony_cistatic struct spear_function gpt_0_1_function = {
5388c2ecf20Sopenharmony_ci	.name = "gpt_0_1",
5398c2ecf20Sopenharmony_ci	.groups = gpt_0_1_grps,
5408c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(gpt_0_1_grps),
5418c2ecf20Sopenharmony_ci};
5428c2ecf20Sopenharmony_ci
5438c2ecf20Sopenharmony_ci/* pad multiplexing for pwm0 device */
5448c2ecf20Sopenharmony_cistatic const unsigned pwm0_pins[] = { 24 };
5458c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm0_muxreg[] = {
5468c2ecf20Sopenharmony_ci	{
5478c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
5488c2ecf20Sopenharmony_ci		.mask = SSP0_CS1_MASK,
5498c2ecf20Sopenharmony_ci		.val = 0,
5508c2ecf20Sopenharmony_ci	}, {
5518c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_1,
5528c2ecf20Sopenharmony_ci		.mask = PWM0_AND_SSP0_CS1_REG0_MASK,
5538c2ecf20Sopenharmony_ci		.val = PWM0_AND_SSP0_CS1_REG0_MASK,
5548c2ecf20Sopenharmony_ci	},
5558c2ecf20Sopenharmony_ci};
5568c2ecf20Sopenharmony_ci
5578c2ecf20Sopenharmony_cistatic struct spear_modemux pwm0_modemux[] = {
5588c2ecf20Sopenharmony_ci	{
5598c2ecf20Sopenharmony_ci		.muxregs = pwm0_muxreg,
5608c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm0_muxreg),
5618c2ecf20Sopenharmony_ci	},
5628c2ecf20Sopenharmony_ci};
5638c2ecf20Sopenharmony_ci
5648c2ecf20Sopenharmony_cistatic struct spear_pingroup pwm0_pingroup = {
5658c2ecf20Sopenharmony_ci	.name = "pwm0_grp",
5668c2ecf20Sopenharmony_ci	.pins = pwm0_pins,
5678c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(pwm0_pins),
5688c2ecf20Sopenharmony_ci	.modemuxs = pwm0_modemux,
5698c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(pwm0_modemux),
5708c2ecf20Sopenharmony_ci};
5718c2ecf20Sopenharmony_ci
5728c2ecf20Sopenharmony_ci/* pad multiplexing for pwm1 device */
5738c2ecf20Sopenharmony_cistatic const unsigned pwm1_pins[] = { 17 };
5748c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm1_muxreg[] = {
5758c2ecf20Sopenharmony_ci	{
5768c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
5778c2ecf20Sopenharmony_ci		.mask = KBD_COL5_MASK,
5788c2ecf20Sopenharmony_ci		.val = 0,
5798c2ecf20Sopenharmony_ci	}, {
5808c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_1,
5818c2ecf20Sopenharmony_ci		.mask = PWM1_AND_KBD_COL5_REG0_MASK,
5828c2ecf20Sopenharmony_ci		.val = PWM1_AND_KBD_COL5_REG0_MASK,
5838c2ecf20Sopenharmony_ci	},
5848c2ecf20Sopenharmony_ci};
5858c2ecf20Sopenharmony_ci
5868c2ecf20Sopenharmony_cistatic struct spear_modemux pwm1_modemux[] = {
5878c2ecf20Sopenharmony_ci	{
5888c2ecf20Sopenharmony_ci		.muxregs = pwm1_muxreg,
5898c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm1_muxreg),
5908c2ecf20Sopenharmony_ci	},
5918c2ecf20Sopenharmony_ci};
5928c2ecf20Sopenharmony_ci
5938c2ecf20Sopenharmony_cistatic struct spear_pingroup pwm1_pingroup = {
5948c2ecf20Sopenharmony_ci	.name = "pwm1_grp",
5958c2ecf20Sopenharmony_ci	.pins = pwm1_pins,
5968c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(pwm1_pins),
5978c2ecf20Sopenharmony_ci	.modemuxs = pwm1_modemux,
5988c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(pwm1_modemux),
5998c2ecf20Sopenharmony_ci};
6008c2ecf20Sopenharmony_ci
6018c2ecf20Sopenharmony_ci/* pad multiplexing for pwm2 device */
6028c2ecf20Sopenharmony_cistatic const unsigned pwm2_pins[] = { 21 };
6038c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm2_muxreg[] = {
6048c2ecf20Sopenharmony_ci	{
6058c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
6068c2ecf20Sopenharmony_ci		.mask = GPT0_TMR0_CPT_MASK,
6078c2ecf20Sopenharmony_ci		.val = 0,
6088c2ecf20Sopenharmony_ci	}, {
6098c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_1,
6108c2ecf20Sopenharmony_ci		.mask = PWM2_AND_GPT0_TMR0_CPT_REG0_MASK,
6118c2ecf20Sopenharmony_ci		.val = PWM2_AND_GPT0_TMR0_CPT_REG0_MASK,
6128c2ecf20Sopenharmony_ci	},
6138c2ecf20Sopenharmony_ci};
6148c2ecf20Sopenharmony_ci
6158c2ecf20Sopenharmony_cistatic struct spear_modemux pwm2_modemux[] = {
6168c2ecf20Sopenharmony_ci	{
6178c2ecf20Sopenharmony_ci		.muxregs = pwm2_muxreg,
6188c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm2_muxreg),
6198c2ecf20Sopenharmony_ci	},
6208c2ecf20Sopenharmony_ci};
6218c2ecf20Sopenharmony_ci
6228c2ecf20Sopenharmony_cistatic struct spear_pingroup pwm2_pingroup = {
6238c2ecf20Sopenharmony_ci	.name = "pwm2_grp",
6248c2ecf20Sopenharmony_ci	.pins = pwm2_pins,
6258c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(pwm2_pins),
6268c2ecf20Sopenharmony_ci	.modemuxs = pwm2_modemux,
6278c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(pwm2_modemux),
6288c2ecf20Sopenharmony_ci};
6298c2ecf20Sopenharmony_ci
6308c2ecf20Sopenharmony_ci/* pad multiplexing for pwm3 device */
6318c2ecf20Sopenharmony_cistatic const unsigned pwm3_pins[] = { 22 };
6328c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm3_muxreg[] = {
6338c2ecf20Sopenharmony_ci	{
6348c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
6358c2ecf20Sopenharmony_ci		.mask = GPT0_TMR1_CLK_MASK,
6368c2ecf20Sopenharmony_ci		.val = 0,
6378c2ecf20Sopenharmony_ci	}, {
6388c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_1,
6398c2ecf20Sopenharmony_ci		.mask = PWM3_AND_GPT0_TMR1_CLK_REG0_MASK,
6408c2ecf20Sopenharmony_ci		.val = PWM3_AND_GPT0_TMR1_CLK_REG0_MASK,
6418c2ecf20Sopenharmony_ci	},
6428c2ecf20Sopenharmony_ci};
6438c2ecf20Sopenharmony_ci
6448c2ecf20Sopenharmony_cistatic struct spear_modemux pwm3_modemux[] = {
6458c2ecf20Sopenharmony_ci	{
6468c2ecf20Sopenharmony_ci		.muxregs = pwm3_muxreg,
6478c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm3_muxreg),
6488c2ecf20Sopenharmony_ci	},
6498c2ecf20Sopenharmony_ci};
6508c2ecf20Sopenharmony_ci
6518c2ecf20Sopenharmony_cistatic struct spear_pingroup pwm3_pingroup = {
6528c2ecf20Sopenharmony_ci	.name = "pwm3_grp",
6538c2ecf20Sopenharmony_ci	.pins = pwm3_pins,
6548c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(pwm3_pins),
6558c2ecf20Sopenharmony_ci	.modemuxs = pwm3_modemux,
6568c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(pwm3_modemux),
6578c2ecf20Sopenharmony_ci};
6588c2ecf20Sopenharmony_ci
6598c2ecf20Sopenharmony_cistatic const char *const pwm_grps[] = { "pwm0_grp", "pwm1_grp", "pwm2_grp",
6608c2ecf20Sopenharmony_ci	"pwm3_grp" };
6618c2ecf20Sopenharmony_cistatic struct spear_function pwm_function = {
6628c2ecf20Sopenharmony_ci	.name = "pwm",
6638c2ecf20Sopenharmony_ci	.groups = pwm_grps,
6648c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(pwm_grps),
6658c2ecf20Sopenharmony_ci};
6668c2ecf20Sopenharmony_ci
6678c2ecf20Sopenharmony_ci/* pad multiplexing for vip_mux device */
6688c2ecf20Sopenharmony_cistatic const unsigned vip_mux_pins[] = { 35, 36, 37, 38, 40, 41, 42, 43 };
6698c2ecf20Sopenharmony_cistatic struct spear_muxreg vip_mux_muxreg[] = {
6708c2ecf20Sopenharmony_ci	{
6718c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_2,
6728c2ecf20Sopenharmony_ci		.mask = VIP_REG1_MASK,
6738c2ecf20Sopenharmony_ci		.val = VIP_REG1_MASK,
6748c2ecf20Sopenharmony_ci	},
6758c2ecf20Sopenharmony_ci};
6768c2ecf20Sopenharmony_ci
6778c2ecf20Sopenharmony_cistatic struct spear_modemux vip_mux_modemux[] = {
6788c2ecf20Sopenharmony_ci	{
6798c2ecf20Sopenharmony_ci		.muxregs = vip_mux_muxreg,
6808c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(vip_mux_muxreg),
6818c2ecf20Sopenharmony_ci	},
6828c2ecf20Sopenharmony_ci};
6838c2ecf20Sopenharmony_ci
6848c2ecf20Sopenharmony_cistatic struct spear_pingroup vip_mux_pingroup = {
6858c2ecf20Sopenharmony_ci	.name = "vip_mux_grp",
6868c2ecf20Sopenharmony_ci	.pins = vip_mux_pins,
6878c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(vip_mux_pins),
6888c2ecf20Sopenharmony_ci	.modemuxs = vip_mux_modemux,
6898c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(vip_mux_modemux),
6908c2ecf20Sopenharmony_ci};
6918c2ecf20Sopenharmony_ci
6928c2ecf20Sopenharmony_ci/* pad multiplexing for vip_mux_cam0 (disables cam0) device */
6938c2ecf20Sopenharmony_cistatic const unsigned vip_mux_cam0_pins[] = { 65, 66, 67, 68, 69, 70, 71, 72,
6948c2ecf20Sopenharmony_ci	73, 74, 75 };
6958c2ecf20Sopenharmony_cistatic struct spear_muxreg vip_mux_cam0_muxreg[] = {
6968c2ecf20Sopenharmony_ci	{
6978c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
6988c2ecf20Sopenharmony_ci		.mask = CAM0_MASK,
6998c2ecf20Sopenharmony_ci		.val = 0,
7008c2ecf20Sopenharmony_ci	}, {
7018c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_3,
7028c2ecf20Sopenharmony_ci		.mask = VIP_AND_CAM0_REG2_MASK,
7038c2ecf20Sopenharmony_ci		.val = VIP_AND_CAM0_REG2_MASK,
7048c2ecf20Sopenharmony_ci	},
7058c2ecf20Sopenharmony_ci};
7068c2ecf20Sopenharmony_ci
7078c2ecf20Sopenharmony_cistatic struct spear_modemux vip_mux_cam0_modemux[] = {
7088c2ecf20Sopenharmony_ci	{
7098c2ecf20Sopenharmony_ci		.muxregs = vip_mux_cam0_muxreg,
7108c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(vip_mux_cam0_muxreg),
7118c2ecf20Sopenharmony_ci	},
7128c2ecf20Sopenharmony_ci};
7138c2ecf20Sopenharmony_ci
7148c2ecf20Sopenharmony_cistatic struct spear_pingroup vip_mux_cam0_pingroup = {
7158c2ecf20Sopenharmony_ci	.name = "vip_mux_cam0_grp",
7168c2ecf20Sopenharmony_ci	.pins = vip_mux_cam0_pins,
7178c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(vip_mux_cam0_pins),
7188c2ecf20Sopenharmony_ci	.modemuxs = vip_mux_cam0_modemux,
7198c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(vip_mux_cam0_modemux),
7208c2ecf20Sopenharmony_ci};
7218c2ecf20Sopenharmony_ci
7228c2ecf20Sopenharmony_ci/* pad multiplexing for vip_mux_cam1 (disables cam1) device */
7238c2ecf20Sopenharmony_cistatic const unsigned vip_mux_cam1_pins[] = { 54, 55, 56, 57, 58, 59, 60, 61,
7248c2ecf20Sopenharmony_ci	62, 63, 64 };
7258c2ecf20Sopenharmony_cistatic struct spear_muxreg vip_mux_cam1_muxreg[] = {
7268c2ecf20Sopenharmony_ci	{
7278c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
7288c2ecf20Sopenharmony_ci		.mask = CAM1_MASK,
7298c2ecf20Sopenharmony_ci		.val = 0,
7308c2ecf20Sopenharmony_ci	}, {
7318c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_2,
7328c2ecf20Sopenharmony_ci		.mask = VIP_AND_CAM1_REG1_MASK,
7338c2ecf20Sopenharmony_ci		.val = VIP_AND_CAM1_REG1_MASK,
7348c2ecf20Sopenharmony_ci	}, {
7358c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_3,
7368c2ecf20Sopenharmony_ci		.mask = VIP_AND_CAM1_REG2_MASK,
7378c2ecf20Sopenharmony_ci		.val = VIP_AND_CAM1_REG2_MASK,
7388c2ecf20Sopenharmony_ci	},
7398c2ecf20Sopenharmony_ci};
7408c2ecf20Sopenharmony_ci
7418c2ecf20Sopenharmony_cistatic struct spear_modemux vip_mux_cam1_modemux[] = {
7428c2ecf20Sopenharmony_ci	{
7438c2ecf20Sopenharmony_ci		.muxregs = vip_mux_cam1_muxreg,
7448c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(vip_mux_cam1_muxreg),
7458c2ecf20Sopenharmony_ci	},
7468c2ecf20Sopenharmony_ci};
7478c2ecf20Sopenharmony_ci
7488c2ecf20Sopenharmony_cistatic struct spear_pingroup vip_mux_cam1_pingroup = {
7498c2ecf20Sopenharmony_ci	.name = "vip_mux_cam1_grp",
7508c2ecf20Sopenharmony_ci	.pins = vip_mux_cam1_pins,
7518c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(vip_mux_cam1_pins),
7528c2ecf20Sopenharmony_ci	.modemuxs = vip_mux_cam1_modemux,
7538c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(vip_mux_cam1_modemux),
7548c2ecf20Sopenharmony_ci};
7558c2ecf20Sopenharmony_ci
7568c2ecf20Sopenharmony_ci/* pad multiplexing for vip_mux_cam2 (disables cam2) device */
7578c2ecf20Sopenharmony_cistatic const unsigned vip_mux_cam2_pins[] = { 39, 44, 45, 46, 47, 48, 49, 50,
7588c2ecf20Sopenharmony_ci	51, 52, 53 };
7598c2ecf20Sopenharmony_cistatic struct spear_muxreg vip_mux_cam2_muxreg[] = {
7608c2ecf20Sopenharmony_ci	{
7618c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
7628c2ecf20Sopenharmony_ci		.mask = CAM2_MASK,
7638c2ecf20Sopenharmony_ci		.val = 0,
7648c2ecf20Sopenharmony_ci	}, {
7658c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_2,
7668c2ecf20Sopenharmony_ci		.mask = VIP_AND_CAM2_REG1_MASK,
7678c2ecf20Sopenharmony_ci		.val = VIP_AND_CAM2_REG1_MASK,
7688c2ecf20Sopenharmony_ci	},
7698c2ecf20Sopenharmony_ci};
7708c2ecf20Sopenharmony_ci
7718c2ecf20Sopenharmony_cistatic struct spear_modemux vip_mux_cam2_modemux[] = {
7728c2ecf20Sopenharmony_ci	{
7738c2ecf20Sopenharmony_ci		.muxregs = vip_mux_cam2_muxreg,
7748c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(vip_mux_cam2_muxreg),
7758c2ecf20Sopenharmony_ci	},
7768c2ecf20Sopenharmony_ci};
7778c2ecf20Sopenharmony_ci
7788c2ecf20Sopenharmony_cistatic struct spear_pingroup vip_mux_cam2_pingroup = {
7798c2ecf20Sopenharmony_ci	.name = "vip_mux_cam2_grp",
7808c2ecf20Sopenharmony_ci	.pins = vip_mux_cam2_pins,
7818c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(vip_mux_cam2_pins),
7828c2ecf20Sopenharmony_ci	.modemuxs = vip_mux_cam2_modemux,
7838c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(vip_mux_cam2_modemux),
7848c2ecf20Sopenharmony_ci};
7858c2ecf20Sopenharmony_ci
7868c2ecf20Sopenharmony_ci/* pad multiplexing for vip_mux_cam3 (disables cam3) device */
7878c2ecf20Sopenharmony_cistatic const unsigned vip_mux_cam3_pins[] = { 20, 25, 26, 27, 28, 29, 30, 31,
7888c2ecf20Sopenharmony_ci	32, 33, 34 };
7898c2ecf20Sopenharmony_cistatic struct spear_muxreg vip_mux_cam3_muxreg[] = {
7908c2ecf20Sopenharmony_ci	{
7918c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
7928c2ecf20Sopenharmony_ci		.mask = CAM3_MASK,
7938c2ecf20Sopenharmony_ci		.val = 0,
7948c2ecf20Sopenharmony_ci	}, {
7958c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_1,
7968c2ecf20Sopenharmony_ci		.mask = VIP_AND_CAM3_REG0_MASK,
7978c2ecf20Sopenharmony_ci		.val = VIP_AND_CAM3_REG0_MASK,
7988c2ecf20Sopenharmony_ci	}, {
7998c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_2,
8008c2ecf20Sopenharmony_ci		.mask = VIP_AND_CAM3_REG1_MASK,
8018c2ecf20Sopenharmony_ci		.val = VIP_AND_CAM3_REG1_MASK,
8028c2ecf20Sopenharmony_ci	},
8038c2ecf20Sopenharmony_ci};
8048c2ecf20Sopenharmony_ci
8058c2ecf20Sopenharmony_cistatic struct spear_modemux vip_mux_cam3_modemux[] = {
8068c2ecf20Sopenharmony_ci	{
8078c2ecf20Sopenharmony_ci		.muxregs = vip_mux_cam3_muxreg,
8088c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(vip_mux_cam3_muxreg),
8098c2ecf20Sopenharmony_ci	},
8108c2ecf20Sopenharmony_ci};
8118c2ecf20Sopenharmony_ci
8128c2ecf20Sopenharmony_cistatic struct spear_pingroup vip_mux_cam3_pingroup = {
8138c2ecf20Sopenharmony_ci	.name = "vip_mux_cam3_grp",
8148c2ecf20Sopenharmony_ci	.pins = vip_mux_cam3_pins,
8158c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(vip_mux_cam3_pins),
8168c2ecf20Sopenharmony_ci	.modemuxs = vip_mux_cam3_modemux,
8178c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(vip_mux_cam3_modemux),
8188c2ecf20Sopenharmony_ci};
8198c2ecf20Sopenharmony_ci
8208c2ecf20Sopenharmony_cistatic const char *const vip_grps[] = { "vip_mux_grp", "vip_mux_cam0_grp" ,
8218c2ecf20Sopenharmony_ci	"vip_mux_cam1_grp" , "vip_mux_cam2_grp", "vip_mux_cam3_grp" };
8228c2ecf20Sopenharmony_cistatic struct spear_function vip_function = {
8238c2ecf20Sopenharmony_ci	.name = "vip",
8248c2ecf20Sopenharmony_ci	.groups = vip_grps,
8258c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(vip_grps),
8268c2ecf20Sopenharmony_ci};
8278c2ecf20Sopenharmony_ci
8288c2ecf20Sopenharmony_ci/* pad multiplexing for cam0 device */
8298c2ecf20Sopenharmony_cistatic const unsigned cam0_pins[] = { 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75
8308c2ecf20Sopenharmony_ci};
8318c2ecf20Sopenharmony_cistatic struct spear_muxreg cam0_muxreg[] = {
8328c2ecf20Sopenharmony_ci	{
8338c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
8348c2ecf20Sopenharmony_ci		.mask = CAM0_MASK,
8358c2ecf20Sopenharmony_ci		.val = CAM0_MASK,
8368c2ecf20Sopenharmony_ci	}, {
8378c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_3,
8388c2ecf20Sopenharmony_ci		.mask = VIP_AND_CAM0_REG2_MASK,
8398c2ecf20Sopenharmony_ci		.val = VIP_AND_CAM0_REG2_MASK,
8408c2ecf20Sopenharmony_ci	},
8418c2ecf20Sopenharmony_ci};
8428c2ecf20Sopenharmony_ci
8438c2ecf20Sopenharmony_cistatic struct spear_modemux cam0_modemux[] = {
8448c2ecf20Sopenharmony_ci	{
8458c2ecf20Sopenharmony_ci		.muxregs = cam0_muxreg,
8468c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(cam0_muxreg),
8478c2ecf20Sopenharmony_ci	},
8488c2ecf20Sopenharmony_ci};
8498c2ecf20Sopenharmony_ci
8508c2ecf20Sopenharmony_cistatic struct spear_pingroup cam0_pingroup = {
8518c2ecf20Sopenharmony_ci	.name = "cam0_grp",
8528c2ecf20Sopenharmony_ci	.pins = cam0_pins,
8538c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(cam0_pins),
8548c2ecf20Sopenharmony_ci	.modemuxs = cam0_modemux,
8558c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(cam0_modemux),
8568c2ecf20Sopenharmony_ci};
8578c2ecf20Sopenharmony_ci
8588c2ecf20Sopenharmony_cistatic const char *const cam0_grps[] = { "cam0_grp" };
8598c2ecf20Sopenharmony_cistatic struct spear_function cam0_function = {
8608c2ecf20Sopenharmony_ci	.name = "cam0",
8618c2ecf20Sopenharmony_ci	.groups = cam0_grps,
8628c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(cam0_grps),
8638c2ecf20Sopenharmony_ci};
8648c2ecf20Sopenharmony_ci
8658c2ecf20Sopenharmony_ci/* pad multiplexing for cam1 device */
8668c2ecf20Sopenharmony_cistatic const unsigned cam1_pins[] = { 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64
8678c2ecf20Sopenharmony_ci};
8688c2ecf20Sopenharmony_cistatic struct spear_muxreg cam1_muxreg[] = {
8698c2ecf20Sopenharmony_ci	{
8708c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
8718c2ecf20Sopenharmony_ci		.mask = CAM1_MASK,
8728c2ecf20Sopenharmony_ci		.val = CAM1_MASK,
8738c2ecf20Sopenharmony_ci	}, {
8748c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_2,
8758c2ecf20Sopenharmony_ci		.mask = VIP_AND_CAM1_REG1_MASK,
8768c2ecf20Sopenharmony_ci		.val = VIP_AND_CAM1_REG1_MASK,
8778c2ecf20Sopenharmony_ci	}, {
8788c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_3,
8798c2ecf20Sopenharmony_ci		.mask = VIP_AND_CAM1_REG2_MASK,
8808c2ecf20Sopenharmony_ci		.val = VIP_AND_CAM1_REG2_MASK,
8818c2ecf20Sopenharmony_ci	},
8828c2ecf20Sopenharmony_ci};
8838c2ecf20Sopenharmony_ci
8848c2ecf20Sopenharmony_cistatic struct spear_modemux cam1_modemux[] = {
8858c2ecf20Sopenharmony_ci	{
8868c2ecf20Sopenharmony_ci		.muxregs = cam1_muxreg,
8878c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(cam1_muxreg),
8888c2ecf20Sopenharmony_ci	},
8898c2ecf20Sopenharmony_ci};
8908c2ecf20Sopenharmony_ci
8918c2ecf20Sopenharmony_cistatic struct spear_pingroup cam1_pingroup = {
8928c2ecf20Sopenharmony_ci	.name = "cam1_grp",
8938c2ecf20Sopenharmony_ci	.pins = cam1_pins,
8948c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(cam1_pins),
8958c2ecf20Sopenharmony_ci	.modemuxs = cam1_modemux,
8968c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(cam1_modemux),
8978c2ecf20Sopenharmony_ci};
8988c2ecf20Sopenharmony_ci
8998c2ecf20Sopenharmony_cistatic const char *const cam1_grps[] = { "cam1_grp" };
9008c2ecf20Sopenharmony_cistatic struct spear_function cam1_function = {
9018c2ecf20Sopenharmony_ci	.name = "cam1",
9028c2ecf20Sopenharmony_ci	.groups = cam1_grps,
9038c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(cam1_grps),
9048c2ecf20Sopenharmony_ci};
9058c2ecf20Sopenharmony_ci
9068c2ecf20Sopenharmony_ci/* pad multiplexing for cam2 device */
9078c2ecf20Sopenharmony_cistatic const unsigned cam2_pins[] = { 39, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53
9088c2ecf20Sopenharmony_ci};
9098c2ecf20Sopenharmony_cistatic struct spear_muxreg cam2_muxreg[] = {
9108c2ecf20Sopenharmony_ci	{
9118c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
9128c2ecf20Sopenharmony_ci		.mask = CAM2_MASK,
9138c2ecf20Sopenharmony_ci		.val = CAM2_MASK,
9148c2ecf20Sopenharmony_ci	}, {
9158c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_2,
9168c2ecf20Sopenharmony_ci		.mask = VIP_AND_CAM2_REG1_MASK,
9178c2ecf20Sopenharmony_ci		.val = VIP_AND_CAM2_REG1_MASK,
9188c2ecf20Sopenharmony_ci	},
9198c2ecf20Sopenharmony_ci};
9208c2ecf20Sopenharmony_ci
9218c2ecf20Sopenharmony_cistatic struct spear_modemux cam2_modemux[] = {
9228c2ecf20Sopenharmony_ci	{
9238c2ecf20Sopenharmony_ci		.muxregs = cam2_muxreg,
9248c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(cam2_muxreg),
9258c2ecf20Sopenharmony_ci	},
9268c2ecf20Sopenharmony_ci};
9278c2ecf20Sopenharmony_ci
9288c2ecf20Sopenharmony_cistatic struct spear_pingroup cam2_pingroup = {
9298c2ecf20Sopenharmony_ci	.name = "cam2_grp",
9308c2ecf20Sopenharmony_ci	.pins = cam2_pins,
9318c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(cam2_pins),
9328c2ecf20Sopenharmony_ci	.modemuxs = cam2_modemux,
9338c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(cam2_modemux),
9348c2ecf20Sopenharmony_ci};
9358c2ecf20Sopenharmony_ci
9368c2ecf20Sopenharmony_cistatic const char *const cam2_grps[] = { "cam2_grp" };
9378c2ecf20Sopenharmony_cistatic struct spear_function cam2_function = {
9388c2ecf20Sopenharmony_ci	.name = "cam2",
9398c2ecf20Sopenharmony_ci	.groups = cam2_grps,
9408c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(cam2_grps),
9418c2ecf20Sopenharmony_ci};
9428c2ecf20Sopenharmony_ci
9438c2ecf20Sopenharmony_ci/* pad multiplexing for cam3 device */
9448c2ecf20Sopenharmony_cistatic const unsigned cam3_pins[] = { 20, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34
9458c2ecf20Sopenharmony_ci};
9468c2ecf20Sopenharmony_cistatic struct spear_muxreg cam3_muxreg[] = {
9478c2ecf20Sopenharmony_ci	{
9488c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
9498c2ecf20Sopenharmony_ci		.mask = CAM3_MASK,
9508c2ecf20Sopenharmony_ci		.val = CAM3_MASK,
9518c2ecf20Sopenharmony_ci	}, {
9528c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_1,
9538c2ecf20Sopenharmony_ci		.mask = VIP_AND_CAM3_REG0_MASK,
9548c2ecf20Sopenharmony_ci		.val = VIP_AND_CAM3_REG0_MASK,
9558c2ecf20Sopenharmony_ci	}, {
9568c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_2,
9578c2ecf20Sopenharmony_ci		.mask = VIP_AND_CAM3_REG1_MASK,
9588c2ecf20Sopenharmony_ci		.val = VIP_AND_CAM3_REG1_MASK,
9598c2ecf20Sopenharmony_ci	},
9608c2ecf20Sopenharmony_ci};
9618c2ecf20Sopenharmony_ci
9628c2ecf20Sopenharmony_cistatic struct spear_modemux cam3_modemux[] = {
9638c2ecf20Sopenharmony_ci	{
9648c2ecf20Sopenharmony_ci		.muxregs = cam3_muxreg,
9658c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(cam3_muxreg),
9668c2ecf20Sopenharmony_ci	},
9678c2ecf20Sopenharmony_ci};
9688c2ecf20Sopenharmony_ci
9698c2ecf20Sopenharmony_cistatic struct spear_pingroup cam3_pingroup = {
9708c2ecf20Sopenharmony_ci	.name = "cam3_grp",
9718c2ecf20Sopenharmony_ci	.pins = cam3_pins,
9728c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(cam3_pins),
9738c2ecf20Sopenharmony_ci	.modemuxs = cam3_modemux,
9748c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(cam3_modemux),
9758c2ecf20Sopenharmony_ci};
9768c2ecf20Sopenharmony_ci
9778c2ecf20Sopenharmony_cistatic const char *const cam3_grps[] = { "cam3_grp" };
9788c2ecf20Sopenharmony_cistatic struct spear_function cam3_function = {
9798c2ecf20Sopenharmony_ci	.name = "cam3",
9808c2ecf20Sopenharmony_ci	.groups = cam3_grps,
9818c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(cam3_grps),
9828c2ecf20Sopenharmony_ci};
9838c2ecf20Sopenharmony_ci
9848c2ecf20Sopenharmony_ci/* pad multiplexing for smi device */
9858c2ecf20Sopenharmony_cistatic const unsigned smi_pins[] = { 76, 77, 78, 79, 84 };
9868c2ecf20Sopenharmony_cistatic struct spear_muxreg smi_muxreg[] = {
9878c2ecf20Sopenharmony_ci	{
9888c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_3,
9898c2ecf20Sopenharmony_ci		.mask = SMI_REG2_MASK,
9908c2ecf20Sopenharmony_ci		.val = SMI_REG2_MASK,
9918c2ecf20Sopenharmony_ci	},
9928c2ecf20Sopenharmony_ci};
9938c2ecf20Sopenharmony_ci
9948c2ecf20Sopenharmony_cistatic struct spear_modemux smi_modemux[] = {
9958c2ecf20Sopenharmony_ci	{
9968c2ecf20Sopenharmony_ci		.muxregs = smi_muxreg,
9978c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(smi_muxreg),
9988c2ecf20Sopenharmony_ci	},
9998c2ecf20Sopenharmony_ci};
10008c2ecf20Sopenharmony_ci
10018c2ecf20Sopenharmony_cistatic struct spear_pingroup smi_pingroup = {
10028c2ecf20Sopenharmony_ci	.name = "smi_grp",
10038c2ecf20Sopenharmony_ci	.pins = smi_pins,
10048c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(smi_pins),
10058c2ecf20Sopenharmony_ci	.modemuxs = smi_modemux,
10068c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(smi_modemux),
10078c2ecf20Sopenharmony_ci};
10088c2ecf20Sopenharmony_ci
10098c2ecf20Sopenharmony_cistatic const char *const smi_grps[] = { "smi_grp" };
10108c2ecf20Sopenharmony_cistatic struct spear_function smi_function = {
10118c2ecf20Sopenharmony_ci	.name = "smi",
10128c2ecf20Sopenharmony_ci	.groups = smi_grps,
10138c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(smi_grps),
10148c2ecf20Sopenharmony_ci};
10158c2ecf20Sopenharmony_ci
10168c2ecf20Sopenharmony_ci/* pad multiplexing for ssp0 device */
10178c2ecf20Sopenharmony_cistatic const unsigned ssp0_pins[] = { 80, 81, 82, 83 };
10188c2ecf20Sopenharmony_cistatic struct spear_muxreg ssp0_muxreg[] = {
10198c2ecf20Sopenharmony_ci	{
10208c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_3,
10218c2ecf20Sopenharmony_ci		.mask = SSP0_REG2_MASK,
10228c2ecf20Sopenharmony_ci		.val = SSP0_REG2_MASK,
10238c2ecf20Sopenharmony_ci	},
10248c2ecf20Sopenharmony_ci};
10258c2ecf20Sopenharmony_ci
10268c2ecf20Sopenharmony_cistatic struct spear_modemux ssp0_modemux[] = {
10278c2ecf20Sopenharmony_ci	{
10288c2ecf20Sopenharmony_ci		.muxregs = ssp0_muxreg,
10298c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(ssp0_muxreg),
10308c2ecf20Sopenharmony_ci	},
10318c2ecf20Sopenharmony_ci};
10328c2ecf20Sopenharmony_ci
10338c2ecf20Sopenharmony_cistatic struct spear_pingroup ssp0_pingroup = {
10348c2ecf20Sopenharmony_ci	.name = "ssp0_grp",
10358c2ecf20Sopenharmony_ci	.pins = ssp0_pins,
10368c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(ssp0_pins),
10378c2ecf20Sopenharmony_ci	.modemuxs = ssp0_modemux,
10388c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(ssp0_modemux),
10398c2ecf20Sopenharmony_ci};
10408c2ecf20Sopenharmony_ci
10418c2ecf20Sopenharmony_ci/* pad multiplexing for ssp0_cs1 device */
10428c2ecf20Sopenharmony_cistatic const unsigned ssp0_cs1_pins[] = { 24 };
10438c2ecf20Sopenharmony_cistatic struct spear_muxreg ssp0_cs1_muxreg[] = {
10448c2ecf20Sopenharmony_ci	{
10458c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
10468c2ecf20Sopenharmony_ci		.mask = SSP0_CS1_MASK,
10478c2ecf20Sopenharmony_ci		.val = SSP0_CS1_MASK,
10488c2ecf20Sopenharmony_ci	}, {
10498c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_1,
10508c2ecf20Sopenharmony_ci		.mask = PWM0_AND_SSP0_CS1_REG0_MASK,
10518c2ecf20Sopenharmony_ci		.val = PWM0_AND_SSP0_CS1_REG0_MASK,
10528c2ecf20Sopenharmony_ci	},
10538c2ecf20Sopenharmony_ci};
10548c2ecf20Sopenharmony_ci
10558c2ecf20Sopenharmony_cistatic struct spear_modemux ssp0_cs1_modemux[] = {
10568c2ecf20Sopenharmony_ci	{
10578c2ecf20Sopenharmony_ci		.muxregs = ssp0_cs1_muxreg,
10588c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(ssp0_cs1_muxreg),
10598c2ecf20Sopenharmony_ci	},
10608c2ecf20Sopenharmony_ci};
10618c2ecf20Sopenharmony_ci
10628c2ecf20Sopenharmony_cistatic struct spear_pingroup ssp0_cs1_pingroup = {
10638c2ecf20Sopenharmony_ci	.name = "ssp0_cs1_grp",
10648c2ecf20Sopenharmony_ci	.pins = ssp0_cs1_pins,
10658c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(ssp0_cs1_pins),
10668c2ecf20Sopenharmony_ci	.modemuxs = ssp0_cs1_modemux,
10678c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(ssp0_cs1_modemux),
10688c2ecf20Sopenharmony_ci};
10698c2ecf20Sopenharmony_ci
10708c2ecf20Sopenharmony_ci/* pad multiplexing for ssp0_cs2 device */
10718c2ecf20Sopenharmony_cistatic const unsigned ssp0_cs2_pins[] = { 85 };
10728c2ecf20Sopenharmony_cistatic struct spear_muxreg ssp0_cs2_muxreg[] = {
10738c2ecf20Sopenharmony_ci	{
10748c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
10758c2ecf20Sopenharmony_ci		.mask = SSP0_CS2_MASK,
10768c2ecf20Sopenharmony_ci		.val = SSP0_CS2_MASK,
10778c2ecf20Sopenharmony_ci	}, {
10788c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_3,
10798c2ecf20Sopenharmony_ci		.mask = TS_AND_SSP0_CS2_REG2_MASK,
10808c2ecf20Sopenharmony_ci		.val = TS_AND_SSP0_CS2_REG2_MASK,
10818c2ecf20Sopenharmony_ci	},
10828c2ecf20Sopenharmony_ci};
10838c2ecf20Sopenharmony_ci
10848c2ecf20Sopenharmony_cistatic struct spear_modemux ssp0_cs2_modemux[] = {
10858c2ecf20Sopenharmony_ci	{
10868c2ecf20Sopenharmony_ci		.muxregs = ssp0_cs2_muxreg,
10878c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(ssp0_cs2_muxreg),
10888c2ecf20Sopenharmony_ci	},
10898c2ecf20Sopenharmony_ci};
10908c2ecf20Sopenharmony_ci
10918c2ecf20Sopenharmony_cistatic struct spear_pingroup ssp0_cs2_pingroup = {
10928c2ecf20Sopenharmony_ci	.name = "ssp0_cs2_grp",
10938c2ecf20Sopenharmony_ci	.pins = ssp0_cs2_pins,
10948c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(ssp0_cs2_pins),
10958c2ecf20Sopenharmony_ci	.modemuxs = ssp0_cs2_modemux,
10968c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(ssp0_cs2_modemux),
10978c2ecf20Sopenharmony_ci};
10988c2ecf20Sopenharmony_ci
10998c2ecf20Sopenharmony_ci/* pad multiplexing for ssp0_cs3 device */
11008c2ecf20Sopenharmony_cistatic const unsigned ssp0_cs3_pins[] = { 132 };
11018c2ecf20Sopenharmony_cistatic struct spear_muxreg ssp0_cs3_muxreg[] = {
11028c2ecf20Sopenharmony_ci	{
11038c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_5,
11048c2ecf20Sopenharmony_ci		.mask = SSP0_CS3_REG4_MASK,
11058c2ecf20Sopenharmony_ci		.val = SSP0_CS3_REG4_MASK,
11068c2ecf20Sopenharmony_ci	},
11078c2ecf20Sopenharmony_ci};
11088c2ecf20Sopenharmony_ci
11098c2ecf20Sopenharmony_cistatic struct spear_modemux ssp0_cs3_modemux[] = {
11108c2ecf20Sopenharmony_ci	{
11118c2ecf20Sopenharmony_ci		.muxregs = ssp0_cs3_muxreg,
11128c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(ssp0_cs3_muxreg),
11138c2ecf20Sopenharmony_ci	},
11148c2ecf20Sopenharmony_ci};
11158c2ecf20Sopenharmony_ci
11168c2ecf20Sopenharmony_cistatic struct spear_pingroup ssp0_cs3_pingroup = {
11178c2ecf20Sopenharmony_ci	.name = "ssp0_cs3_grp",
11188c2ecf20Sopenharmony_ci	.pins = ssp0_cs3_pins,
11198c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(ssp0_cs3_pins),
11208c2ecf20Sopenharmony_ci	.modemuxs = ssp0_cs3_modemux,
11218c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(ssp0_cs3_modemux),
11228c2ecf20Sopenharmony_ci};
11238c2ecf20Sopenharmony_ci
11248c2ecf20Sopenharmony_cistatic const char *const ssp0_grps[] = { "ssp0_grp", "ssp0_cs1_grp",
11258c2ecf20Sopenharmony_ci	"ssp0_cs2_grp", "ssp0_cs3_grp" };
11268c2ecf20Sopenharmony_cistatic struct spear_function ssp0_function = {
11278c2ecf20Sopenharmony_ci	.name = "ssp0",
11288c2ecf20Sopenharmony_ci	.groups = ssp0_grps,
11298c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(ssp0_grps),
11308c2ecf20Sopenharmony_ci};
11318c2ecf20Sopenharmony_ci
11328c2ecf20Sopenharmony_ci/* pad multiplexing for uart0 device */
11338c2ecf20Sopenharmony_cistatic const unsigned uart0_pins[] = { 86, 87 };
11348c2ecf20Sopenharmony_cistatic struct spear_muxreg uart0_muxreg[] = {
11358c2ecf20Sopenharmony_ci	{
11368c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_3,
11378c2ecf20Sopenharmony_ci		.mask = UART0_REG2_MASK,
11388c2ecf20Sopenharmony_ci		.val = UART0_REG2_MASK,
11398c2ecf20Sopenharmony_ci	},
11408c2ecf20Sopenharmony_ci};
11418c2ecf20Sopenharmony_ci
11428c2ecf20Sopenharmony_cistatic struct spear_modemux uart0_modemux[] = {
11438c2ecf20Sopenharmony_ci	{
11448c2ecf20Sopenharmony_ci		.muxregs = uart0_muxreg,
11458c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(uart0_muxreg),
11468c2ecf20Sopenharmony_ci	},
11478c2ecf20Sopenharmony_ci};
11488c2ecf20Sopenharmony_ci
11498c2ecf20Sopenharmony_cistatic struct spear_pingroup uart0_pingroup = {
11508c2ecf20Sopenharmony_ci	.name = "uart0_grp",
11518c2ecf20Sopenharmony_ci	.pins = uart0_pins,
11528c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(uart0_pins),
11538c2ecf20Sopenharmony_ci	.modemuxs = uart0_modemux,
11548c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(uart0_modemux),
11558c2ecf20Sopenharmony_ci};
11568c2ecf20Sopenharmony_ci
11578c2ecf20Sopenharmony_ci/* pad multiplexing for uart0_enh device */
11588c2ecf20Sopenharmony_cistatic const unsigned uart0_enh_pins[] = { 11, 12, 13, 14, 15, 16 };
11598c2ecf20Sopenharmony_cistatic struct spear_muxreg uart0_enh_muxreg[] = {
11608c2ecf20Sopenharmony_ci	{
11618c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
11628c2ecf20Sopenharmony_ci		.mask = GPT_MASK,
11638c2ecf20Sopenharmony_ci		.val = 0,
11648c2ecf20Sopenharmony_ci	}, {
11658c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_1,
11668c2ecf20Sopenharmony_ci		.mask = UART0_ENH_AND_GPT_REG0_MASK,
11678c2ecf20Sopenharmony_ci		.val = UART0_ENH_AND_GPT_REG0_MASK,
11688c2ecf20Sopenharmony_ci	},
11698c2ecf20Sopenharmony_ci};
11708c2ecf20Sopenharmony_ci
11718c2ecf20Sopenharmony_cistatic struct spear_modemux uart0_enh_modemux[] = {
11728c2ecf20Sopenharmony_ci	{
11738c2ecf20Sopenharmony_ci		.muxregs = uart0_enh_muxreg,
11748c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(uart0_enh_muxreg),
11758c2ecf20Sopenharmony_ci	},
11768c2ecf20Sopenharmony_ci};
11778c2ecf20Sopenharmony_ci
11788c2ecf20Sopenharmony_cistatic struct spear_pingroup uart0_enh_pingroup = {
11798c2ecf20Sopenharmony_ci	.name = "uart0_enh_grp",
11808c2ecf20Sopenharmony_ci	.pins = uart0_enh_pins,
11818c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(uart0_enh_pins),
11828c2ecf20Sopenharmony_ci	.modemuxs = uart0_enh_modemux,
11838c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(uart0_enh_modemux),
11848c2ecf20Sopenharmony_ci};
11858c2ecf20Sopenharmony_ci
11868c2ecf20Sopenharmony_cistatic const char *const uart0_grps[] = { "uart0_grp", "uart0_enh_grp" };
11878c2ecf20Sopenharmony_cistatic struct spear_function uart0_function = {
11888c2ecf20Sopenharmony_ci	.name = "uart0",
11898c2ecf20Sopenharmony_ci	.groups = uart0_grps,
11908c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(uart0_grps),
11918c2ecf20Sopenharmony_ci};
11928c2ecf20Sopenharmony_ci
11938c2ecf20Sopenharmony_ci/* pad multiplexing for uart1 device */
11948c2ecf20Sopenharmony_cistatic const unsigned uart1_pins[] = { 88, 89 };
11958c2ecf20Sopenharmony_cistatic struct spear_muxreg uart1_muxreg[] = {
11968c2ecf20Sopenharmony_ci	{
11978c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_3,
11988c2ecf20Sopenharmony_ci		.mask = UART1_REG2_MASK,
11998c2ecf20Sopenharmony_ci		.val = UART1_REG2_MASK,
12008c2ecf20Sopenharmony_ci	},
12018c2ecf20Sopenharmony_ci};
12028c2ecf20Sopenharmony_ci
12038c2ecf20Sopenharmony_cistatic struct spear_modemux uart1_modemux[] = {
12048c2ecf20Sopenharmony_ci	{
12058c2ecf20Sopenharmony_ci		.muxregs = uart1_muxreg,
12068c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(uart1_muxreg),
12078c2ecf20Sopenharmony_ci	},
12088c2ecf20Sopenharmony_ci};
12098c2ecf20Sopenharmony_ci
12108c2ecf20Sopenharmony_cistatic struct spear_pingroup uart1_pingroup = {
12118c2ecf20Sopenharmony_ci	.name = "uart1_grp",
12128c2ecf20Sopenharmony_ci	.pins = uart1_pins,
12138c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(uart1_pins),
12148c2ecf20Sopenharmony_ci	.modemuxs = uart1_modemux,
12158c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(uart1_modemux),
12168c2ecf20Sopenharmony_ci};
12178c2ecf20Sopenharmony_ci
12188c2ecf20Sopenharmony_cistatic const char *const uart1_grps[] = { "uart1_grp" };
12198c2ecf20Sopenharmony_cistatic struct spear_function uart1_function = {
12208c2ecf20Sopenharmony_ci	.name = "uart1",
12218c2ecf20Sopenharmony_ci	.groups = uart1_grps,
12228c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(uart1_grps),
12238c2ecf20Sopenharmony_ci};
12248c2ecf20Sopenharmony_ci
12258c2ecf20Sopenharmony_ci/* pad multiplexing for i2s_in device */
12268c2ecf20Sopenharmony_cistatic const unsigned i2s_in_pins[] = { 90, 91, 92, 93, 94, 99 };
12278c2ecf20Sopenharmony_cistatic struct spear_muxreg i2s_in_muxreg[] = {
12288c2ecf20Sopenharmony_ci	{
12298c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_3,
12308c2ecf20Sopenharmony_ci		.mask = I2S_IN_REG2_MASK,
12318c2ecf20Sopenharmony_ci		.val = I2S_IN_REG2_MASK,
12328c2ecf20Sopenharmony_ci	}, {
12338c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_4,
12348c2ecf20Sopenharmony_ci		.mask = I2S_IN_REG3_MASK,
12358c2ecf20Sopenharmony_ci		.val = I2S_IN_REG3_MASK,
12368c2ecf20Sopenharmony_ci	},
12378c2ecf20Sopenharmony_ci};
12388c2ecf20Sopenharmony_ci
12398c2ecf20Sopenharmony_cistatic struct spear_modemux i2s_in_modemux[] = {
12408c2ecf20Sopenharmony_ci	{
12418c2ecf20Sopenharmony_ci		.muxregs = i2s_in_muxreg,
12428c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(i2s_in_muxreg),
12438c2ecf20Sopenharmony_ci	},
12448c2ecf20Sopenharmony_ci};
12458c2ecf20Sopenharmony_ci
12468c2ecf20Sopenharmony_cistatic struct spear_pingroup i2s_in_pingroup = {
12478c2ecf20Sopenharmony_ci	.name = "i2s_in_grp",
12488c2ecf20Sopenharmony_ci	.pins = i2s_in_pins,
12498c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(i2s_in_pins),
12508c2ecf20Sopenharmony_ci	.modemuxs = i2s_in_modemux,
12518c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(i2s_in_modemux),
12528c2ecf20Sopenharmony_ci};
12538c2ecf20Sopenharmony_ci
12548c2ecf20Sopenharmony_ci/* pad multiplexing for i2s_out device */
12558c2ecf20Sopenharmony_cistatic const unsigned i2s_out_pins[] = { 95, 96, 97, 98, 100, 101, 102, 103 };
12568c2ecf20Sopenharmony_cistatic struct spear_muxreg i2s_out_muxreg[] = {
12578c2ecf20Sopenharmony_ci	{
12588c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_4,
12598c2ecf20Sopenharmony_ci		.mask = I2S_OUT_REG3_MASK,
12608c2ecf20Sopenharmony_ci		.val = I2S_OUT_REG3_MASK,
12618c2ecf20Sopenharmony_ci	},
12628c2ecf20Sopenharmony_ci};
12638c2ecf20Sopenharmony_ci
12648c2ecf20Sopenharmony_cistatic struct spear_modemux i2s_out_modemux[] = {
12658c2ecf20Sopenharmony_ci	{
12668c2ecf20Sopenharmony_ci		.muxregs = i2s_out_muxreg,
12678c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(i2s_out_muxreg),
12688c2ecf20Sopenharmony_ci	},
12698c2ecf20Sopenharmony_ci};
12708c2ecf20Sopenharmony_ci
12718c2ecf20Sopenharmony_cistatic struct spear_pingroup i2s_out_pingroup = {
12728c2ecf20Sopenharmony_ci	.name = "i2s_out_grp",
12738c2ecf20Sopenharmony_ci	.pins = i2s_out_pins,
12748c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(i2s_out_pins),
12758c2ecf20Sopenharmony_ci	.modemuxs = i2s_out_modemux,
12768c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(i2s_out_modemux),
12778c2ecf20Sopenharmony_ci};
12788c2ecf20Sopenharmony_ci
12798c2ecf20Sopenharmony_cistatic const char *const i2s_grps[] = { "i2s_in_grp", "i2s_out_grp" };
12808c2ecf20Sopenharmony_cistatic struct spear_function i2s_function = {
12818c2ecf20Sopenharmony_ci	.name = "i2s",
12828c2ecf20Sopenharmony_ci	.groups = i2s_grps,
12838c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(i2s_grps),
12848c2ecf20Sopenharmony_ci};
12858c2ecf20Sopenharmony_ci
12868c2ecf20Sopenharmony_ci/* pad multiplexing for gmac device */
12878c2ecf20Sopenharmony_cistatic const unsigned gmac_pins[] = { 104, 105, 106, 107, 108, 109, 110, 111,
12888c2ecf20Sopenharmony_ci	112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125,
12898c2ecf20Sopenharmony_ci	126, 127, 128, 129, 130, 131 };
12908c2ecf20Sopenharmony_ci#define GMAC_MUXREG				\
12918c2ecf20Sopenharmony_ci	{					\
12928c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_4,	\
12938c2ecf20Sopenharmony_ci		.mask = GMAC_REG3_MASK,		\
12948c2ecf20Sopenharmony_ci		.val = GMAC_REG3_MASK,		\
12958c2ecf20Sopenharmony_ci	}, {					\
12968c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_5,	\
12978c2ecf20Sopenharmony_ci		.mask = GMAC_REG4_MASK,		\
12988c2ecf20Sopenharmony_ci		.val = GMAC_REG4_MASK,		\
12998c2ecf20Sopenharmony_ci	}
13008c2ecf20Sopenharmony_ci
13018c2ecf20Sopenharmony_ci/* pad multiplexing for gmii device */
13028c2ecf20Sopenharmony_cistatic struct spear_muxreg gmii_muxreg[] = {
13038c2ecf20Sopenharmony_ci	GMAC_MUXREG,
13048c2ecf20Sopenharmony_ci	{
13058c2ecf20Sopenharmony_ci		.reg = GMAC_CLK_CFG,
13068c2ecf20Sopenharmony_ci		.mask = GMAC_PHY_IF_SEL_MASK,
13078c2ecf20Sopenharmony_ci		.val = GMAC_PHY_IF_GMII_VAL,
13088c2ecf20Sopenharmony_ci	},
13098c2ecf20Sopenharmony_ci};
13108c2ecf20Sopenharmony_ci
13118c2ecf20Sopenharmony_cistatic struct spear_modemux gmii_modemux[] = {
13128c2ecf20Sopenharmony_ci	{
13138c2ecf20Sopenharmony_ci		.muxregs = gmii_muxreg,
13148c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(gmii_muxreg),
13158c2ecf20Sopenharmony_ci	},
13168c2ecf20Sopenharmony_ci};
13178c2ecf20Sopenharmony_ci
13188c2ecf20Sopenharmony_cistatic struct spear_pingroup gmii_pingroup = {
13198c2ecf20Sopenharmony_ci	.name = "gmii_grp",
13208c2ecf20Sopenharmony_ci	.pins = gmac_pins,
13218c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(gmac_pins),
13228c2ecf20Sopenharmony_ci	.modemuxs = gmii_modemux,
13238c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(gmii_modemux),
13248c2ecf20Sopenharmony_ci};
13258c2ecf20Sopenharmony_ci
13268c2ecf20Sopenharmony_ci/* pad multiplexing for rgmii device */
13278c2ecf20Sopenharmony_cistatic struct spear_muxreg rgmii_muxreg[] = {
13288c2ecf20Sopenharmony_ci	GMAC_MUXREG,
13298c2ecf20Sopenharmony_ci	{
13308c2ecf20Sopenharmony_ci		.reg = GMAC_CLK_CFG,
13318c2ecf20Sopenharmony_ci		.mask = GMAC_PHY_IF_SEL_MASK,
13328c2ecf20Sopenharmony_ci		.val = GMAC_PHY_IF_RGMII_VAL,
13338c2ecf20Sopenharmony_ci	},
13348c2ecf20Sopenharmony_ci};
13358c2ecf20Sopenharmony_ci
13368c2ecf20Sopenharmony_cistatic struct spear_modemux rgmii_modemux[] = {
13378c2ecf20Sopenharmony_ci	{
13388c2ecf20Sopenharmony_ci		.muxregs = rgmii_muxreg,
13398c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(rgmii_muxreg),
13408c2ecf20Sopenharmony_ci	},
13418c2ecf20Sopenharmony_ci};
13428c2ecf20Sopenharmony_ci
13438c2ecf20Sopenharmony_cistatic struct spear_pingroup rgmii_pingroup = {
13448c2ecf20Sopenharmony_ci	.name = "rgmii_grp",
13458c2ecf20Sopenharmony_ci	.pins = gmac_pins,
13468c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(gmac_pins),
13478c2ecf20Sopenharmony_ci	.modemuxs = rgmii_modemux,
13488c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(rgmii_modemux),
13498c2ecf20Sopenharmony_ci};
13508c2ecf20Sopenharmony_ci
13518c2ecf20Sopenharmony_ci/* pad multiplexing for rmii device */
13528c2ecf20Sopenharmony_cistatic struct spear_muxreg rmii_muxreg[] = {
13538c2ecf20Sopenharmony_ci	GMAC_MUXREG,
13548c2ecf20Sopenharmony_ci	{
13558c2ecf20Sopenharmony_ci		.reg = GMAC_CLK_CFG,
13568c2ecf20Sopenharmony_ci		.mask = GMAC_PHY_IF_SEL_MASK,
13578c2ecf20Sopenharmony_ci		.val = GMAC_PHY_IF_RMII_VAL,
13588c2ecf20Sopenharmony_ci	},
13598c2ecf20Sopenharmony_ci};
13608c2ecf20Sopenharmony_ci
13618c2ecf20Sopenharmony_cistatic struct spear_modemux rmii_modemux[] = {
13628c2ecf20Sopenharmony_ci	{
13638c2ecf20Sopenharmony_ci		.muxregs = rmii_muxreg,
13648c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(rmii_muxreg),
13658c2ecf20Sopenharmony_ci	},
13668c2ecf20Sopenharmony_ci};
13678c2ecf20Sopenharmony_ci
13688c2ecf20Sopenharmony_cistatic struct spear_pingroup rmii_pingroup = {
13698c2ecf20Sopenharmony_ci	.name = "rmii_grp",
13708c2ecf20Sopenharmony_ci	.pins = gmac_pins,
13718c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(gmac_pins),
13728c2ecf20Sopenharmony_ci	.modemuxs = rmii_modemux,
13738c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(rmii_modemux),
13748c2ecf20Sopenharmony_ci};
13758c2ecf20Sopenharmony_ci
13768c2ecf20Sopenharmony_ci/* pad multiplexing for sgmii device */
13778c2ecf20Sopenharmony_cistatic struct spear_muxreg sgmii_muxreg[] = {
13788c2ecf20Sopenharmony_ci	GMAC_MUXREG,
13798c2ecf20Sopenharmony_ci	{
13808c2ecf20Sopenharmony_ci		.reg = GMAC_CLK_CFG,
13818c2ecf20Sopenharmony_ci		.mask = GMAC_PHY_IF_SEL_MASK,
13828c2ecf20Sopenharmony_ci		.val = GMAC_PHY_IF_SGMII_VAL,
13838c2ecf20Sopenharmony_ci	},
13848c2ecf20Sopenharmony_ci};
13858c2ecf20Sopenharmony_ci
13868c2ecf20Sopenharmony_cistatic struct spear_modemux sgmii_modemux[] = {
13878c2ecf20Sopenharmony_ci	{
13888c2ecf20Sopenharmony_ci		.muxregs = sgmii_muxreg,
13898c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(sgmii_muxreg),
13908c2ecf20Sopenharmony_ci	},
13918c2ecf20Sopenharmony_ci};
13928c2ecf20Sopenharmony_ci
13938c2ecf20Sopenharmony_cistatic struct spear_pingroup sgmii_pingroup = {
13948c2ecf20Sopenharmony_ci	.name = "sgmii_grp",
13958c2ecf20Sopenharmony_ci	.pins = gmac_pins,
13968c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(gmac_pins),
13978c2ecf20Sopenharmony_ci	.modemuxs = sgmii_modemux,
13988c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(sgmii_modemux),
13998c2ecf20Sopenharmony_ci};
14008c2ecf20Sopenharmony_ci
14018c2ecf20Sopenharmony_cistatic const char *const gmac_grps[] = { "gmii_grp", "rgmii_grp", "rmii_grp",
14028c2ecf20Sopenharmony_ci	"sgmii_grp" };
14038c2ecf20Sopenharmony_cistatic struct spear_function gmac_function = {
14048c2ecf20Sopenharmony_ci	.name = "gmac",
14058c2ecf20Sopenharmony_ci	.groups = gmac_grps,
14068c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(gmac_grps),
14078c2ecf20Sopenharmony_ci};
14088c2ecf20Sopenharmony_ci
14098c2ecf20Sopenharmony_ci/* pad multiplexing for i2c0 device */
14108c2ecf20Sopenharmony_cistatic const unsigned i2c0_pins[] = { 133, 134 };
14118c2ecf20Sopenharmony_cistatic struct spear_muxreg i2c0_muxreg[] = {
14128c2ecf20Sopenharmony_ci	{
14138c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_5,
14148c2ecf20Sopenharmony_ci		.mask = I2C0_REG4_MASK,
14158c2ecf20Sopenharmony_ci		.val = I2C0_REG4_MASK,
14168c2ecf20Sopenharmony_ci	},
14178c2ecf20Sopenharmony_ci};
14188c2ecf20Sopenharmony_ci
14198c2ecf20Sopenharmony_cistatic struct spear_modemux i2c0_modemux[] = {
14208c2ecf20Sopenharmony_ci	{
14218c2ecf20Sopenharmony_ci		.muxregs = i2c0_muxreg,
14228c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(i2c0_muxreg),
14238c2ecf20Sopenharmony_ci	},
14248c2ecf20Sopenharmony_ci};
14258c2ecf20Sopenharmony_ci
14268c2ecf20Sopenharmony_cistatic struct spear_pingroup i2c0_pingroup = {
14278c2ecf20Sopenharmony_ci	.name = "i2c0_grp",
14288c2ecf20Sopenharmony_ci	.pins = i2c0_pins,
14298c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(i2c0_pins),
14308c2ecf20Sopenharmony_ci	.modemuxs = i2c0_modemux,
14318c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(i2c0_modemux),
14328c2ecf20Sopenharmony_ci};
14338c2ecf20Sopenharmony_ci
14348c2ecf20Sopenharmony_cistatic const char *const i2c0_grps[] = { "i2c0_grp" };
14358c2ecf20Sopenharmony_cistatic struct spear_function i2c0_function = {
14368c2ecf20Sopenharmony_ci	.name = "i2c0",
14378c2ecf20Sopenharmony_ci	.groups = i2c0_grps,
14388c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(i2c0_grps),
14398c2ecf20Sopenharmony_ci};
14408c2ecf20Sopenharmony_ci
14418c2ecf20Sopenharmony_ci/* pad multiplexing for i2c1 device */
14428c2ecf20Sopenharmony_cistatic const unsigned i2c1_pins[] = { 18, 23 };
14438c2ecf20Sopenharmony_cistatic struct spear_muxreg i2c1_muxreg[] = {
14448c2ecf20Sopenharmony_ci	{
14458c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_1,
14468c2ecf20Sopenharmony_ci		.mask = I2C1_REG0_MASK,
14478c2ecf20Sopenharmony_ci		.val = I2C1_REG0_MASK,
14488c2ecf20Sopenharmony_ci	},
14498c2ecf20Sopenharmony_ci};
14508c2ecf20Sopenharmony_ci
14518c2ecf20Sopenharmony_cistatic struct spear_modemux i2c1_modemux[] = {
14528c2ecf20Sopenharmony_ci	{
14538c2ecf20Sopenharmony_ci		.muxregs = i2c1_muxreg,
14548c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(i2c1_muxreg),
14558c2ecf20Sopenharmony_ci	},
14568c2ecf20Sopenharmony_ci};
14578c2ecf20Sopenharmony_ci
14588c2ecf20Sopenharmony_cistatic struct spear_pingroup i2c1_pingroup = {
14598c2ecf20Sopenharmony_ci	.name = "i2c1_grp",
14608c2ecf20Sopenharmony_ci	.pins = i2c1_pins,
14618c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(i2c1_pins),
14628c2ecf20Sopenharmony_ci	.modemuxs = i2c1_modemux,
14638c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(i2c1_modemux),
14648c2ecf20Sopenharmony_ci};
14658c2ecf20Sopenharmony_ci
14668c2ecf20Sopenharmony_cistatic const char *const i2c1_grps[] = { "i2c1_grp" };
14678c2ecf20Sopenharmony_cistatic struct spear_function i2c1_function = {
14688c2ecf20Sopenharmony_ci	.name = "i2c1",
14698c2ecf20Sopenharmony_ci	.groups = i2c1_grps,
14708c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(i2c1_grps),
14718c2ecf20Sopenharmony_ci};
14728c2ecf20Sopenharmony_ci
14738c2ecf20Sopenharmony_ci/* pad multiplexing for cec0 device */
14748c2ecf20Sopenharmony_cistatic const unsigned cec0_pins[] = { 135 };
14758c2ecf20Sopenharmony_cistatic struct spear_muxreg cec0_muxreg[] = {
14768c2ecf20Sopenharmony_ci	{
14778c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_5,
14788c2ecf20Sopenharmony_ci		.mask = CEC0_REG4_MASK,
14798c2ecf20Sopenharmony_ci		.val = CEC0_REG4_MASK,
14808c2ecf20Sopenharmony_ci	},
14818c2ecf20Sopenharmony_ci};
14828c2ecf20Sopenharmony_ci
14838c2ecf20Sopenharmony_cistatic struct spear_modemux cec0_modemux[] = {
14848c2ecf20Sopenharmony_ci	{
14858c2ecf20Sopenharmony_ci		.muxregs = cec0_muxreg,
14868c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(cec0_muxreg),
14878c2ecf20Sopenharmony_ci	},
14888c2ecf20Sopenharmony_ci};
14898c2ecf20Sopenharmony_ci
14908c2ecf20Sopenharmony_cistatic struct spear_pingroup cec0_pingroup = {
14918c2ecf20Sopenharmony_ci	.name = "cec0_grp",
14928c2ecf20Sopenharmony_ci	.pins = cec0_pins,
14938c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(cec0_pins),
14948c2ecf20Sopenharmony_ci	.modemuxs = cec0_modemux,
14958c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(cec0_modemux),
14968c2ecf20Sopenharmony_ci};
14978c2ecf20Sopenharmony_ci
14988c2ecf20Sopenharmony_cistatic const char *const cec0_grps[] = { "cec0_grp" };
14998c2ecf20Sopenharmony_cistatic struct spear_function cec0_function = {
15008c2ecf20Sopenharmony_ci	.name = "cec0",
15018c2ecf20Sopenharmony_ci	.groups = cec0_grps,
15028c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(cec0_grps),
15038c2ecf20Sopenharmony_ci};
15048c2ecf20Sopenharmony_ci
15058c2ecf20Sopenharmony_ci/* pad multiplexing for cec1 device */
15068c2ecf20Sopenharmony_cistatic const unsigned cec1_pins[] = { 136 };
15078c2ecf20Sopenharmony_cistatic struct spear_muxreg cec1_muxreg[] = {
15088c2ecf20Sopenharmony_ci	{
15098c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_5,
15108c2ecf20Sopenharmony_ci		.mask = CEC1_REG4_MASK,
15118c2ecf20Sopenharmony_ci		.val = CEC1_REG4_MASK,
15128c2ecf20Sopenharmony_ci	},
15138c2ecf20Sopenharmony_ci};
15148c2ecf20Sopenharmony_ci
15158c2ecf20Sopenharmony_cistatic struct spear_modemux cec1_modemux[] = {
15168c2ecf20Sopenharmony_ci	{
15178c2ecf20Sopenharmony_ci		.muxregs = cec1_muxreg,
15188c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(cec1_muxreg),
15198c2ecf20Sopenharmony_ci	},
15208c2ecf20Sopenharmony_ci};
15218c2ecf20Sopenharmony_ci
15228c2ecf20Sopenharmony_cistatic struct spear_pingroup cec1_pingroup = {
15238c2ecf20Sopenharmony_ci	.name = "cec1_grp",
15248c2ecf20Sopenharmony_ci	.pins = cec1_pins,
15258c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(cec1_pins),
15268c2ecf20Sopenharmony_ci	.modemuxs = cec1_modemux,
15278c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(cec1_modemux),
15288c2ecf20Sopenharmony_ci};
15298c2ecf20Sopenharmony_ci
15308c2ecf20Sopenharmony_cistatic const char *const cec1_grps[] = { "cec1_grp" };
15318c2ecf20Sopenharmony_cistatic struct spear_function cec1_function = {
15328c2ecf20Sopenharmony_ci	.name = "cec1",
15338c2ecf20Sopenharmony_ci	.groups = cec1_grps,
15348c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(cec1_grps),
15358c2ecf20Sopenharmony_ci};
15368c2ecf20Sopenharmony_ci
15378c2ecf20Sopenharmony_ci/* pad multiplexing for mcif devices */
15388c2ecf20Sopenharmony_cistatic const unsigned mcif_pins[] = { 193, 194, 195, 196, 197, 198, 199, 200,
15398c2ecf20Sopenharmony_ci	201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
15408c2ecf20Sopenharmony_ci	215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228,
15418c2ecf20Sopenharmony_ci	229, 230, 231, 232, 237 };
15428c2ecf20Sopenharmony_ci#define MCIF_MUXREG							\
15438c2ecf20Sopenharmony_ci	{								\
15448c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,				\
15458c2ecf20Sopenharmony_ci		.mask = MCIF_MASK,					\
15468c2ecf20Sopenharmony_ci		.val = MCIF_MASK,					\
15478c2ecf20Sopenharmony_ci	}, {								\
15488c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_7,				\
15498c2ecf20Sopenharmony_ci		.mask = FSMC_PNOR_AND_MCIF_REG6_MASK | MCIF_REG6_MASK,	\
15508c2ecf20Sopenharmony_ci		.val = FSMC_PNOR_AND_MCIF_REG6_MASK | MCIF_REG6_MASK,	\
15518c2ecf20Sopenharmony_ci	}, {								\
15528c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_8,				\
15538c2ecf20Sopenharmony_ci		.mask = MCIF_REG7_MASK,					\
15548c2ecf20Sopenharmony_ci		.val = MCIF_REG7_MASK,					\
15558c2ecf20Sopenharmony_ci	}
15568c2ecf20Sopenharmony_ci
15578c2ecf20Sopenharmony_ci/* Pad multiplexing for sdhci device */
15588c2ecf20Sopenharmony_cistatic struct spear_muxreg sdhci_muxreg[] = {
15598c2ecf20Sopenharmony_ci	MCIF_MUXREG,
15608c2ecf20Sopenharmony_ci	{
15618c2ecf20Sopenharmony_ci		.reg = PERIP_CFG,
15628c2ecf20Sopenharmony_ci		.mask = MCIF_SEL_MASK,
15638c2ecf20Sopenharmony_ci		.val = MCIF_SEL_SD,
15648c2ecf20Sopenharmony_ci	},
15658c2ecf20Sopenharmony_ci};
15668c2ecf20Sopenharmony_ci
15678c2ecf20Sopenharmony_cistatic struct spear_modemux sdhci_modemux[] = {
15688c2ecf20Sopenharmony_ci	{
15698c2ecf20Sopenharmony_ci		.muxregs = sdhci_muxreg,
15708c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(sdhci_muxreg),
15718c2ecf20Sopenharmony_ci	},
15728c2ecf20Sopenharmony_ci};
15738c2ecf20Sopenharmony_ci
15748c2ecf20Sopenharmony_cistatic struct spear_pingroup sdhci_pingroup = {
15758c2ecf20Sopenharmony_ci	.name = "sdhci_grp",
15768c2ecf20Sopenharmony_ci	.pins = mcif_pins,
15778c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(mcif_pins),
15788c2ecf20Sopenharmony_ci	.modemuxs = sdhci_modemux,
15798c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(sdhci_modemux),
15808c2ecf20Sopenharmony_ci};
15818c2ecf20Sopenharmony_ci
15828c2ecf20Sopenharmony_cistatic const char *const sdhci_grps[] = { "sdhci_grp" };
15838c2ecf20Sopenharmony_cistatic struct spear_function sdhci_function = {
15848c2ecf20Sopenharmony_ci	.name = "sdhci",
15858c2ecf20Sopenharmony_ci	.groups = sdhci_grps,
15868c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(sdhci_grps),
15878c2ecf20Sopenharmony_ci};
15888c2ecf20Sopenharmony_ci
15898c2ecf20Sopenharmony_ci/* Pad multiplexing for cf device */
15908c2ecf20Sopenharmony_cistatic struct spear_muxreg cf_muxreg[] = {
15918c2ecf20Sopenharmony_ci	MCIF_MUXREG,
15928c2ecf20Sopenharmony_ci	{
15938c2ecf20Sopenharmony_ci		.reg = PERIP_CFG,
15948c2ecf20Sopenharmony_ci		.mask = MCIF_SEL_MASK,
15958c2ecf20Sopenharmony_ci		.val = MCIF_SEL_CF,
15968c2ecf20Sopenharmony_ci	},
15978c2ecf20Sopenharmony_ci};
15988c2ecf20Sopenharmony_ci
15998c2ecf20Sopenharmony_cistatic struct spear_modemux cf_modemux[] = {
16008c2ecf20Sopenharmony_ci	{
16018c2ecf20Sopenharmony_ci		.muxregs = cf_muxreg,
16028c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(cf_muxreg),
16038c2ecf20Sopenharmony_ci	},
16048c2ecf20Sopenharmony_ci};
16058c2ecf20Sopenharmony_ci
16068c2ecf20Sopenharmony_cistatic struct spear_pingroup cf_pingroup = {
16078c2ecf20Sopenharmony_ci	.name = "cf_grp",
16088c2ecf20Sopenharmony_ci	.pins = mcif_pins,
16098c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(mcif_pins),
16108c2ecf20Sopenharmony_ci	.modemuxs = cf_modemux,
16118c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(cf_modemux),
16128c2ecf20Sopenharmony_ci};
16138c2ecf20Sopenharmony_ci
16148c2ecf20Sopenharmony_cistatic const char *const cf_grps[] = { "cf_grp" };
16158c2ecf20Sopenharmony_cistatic struct spear_function cf_function = {
16168c2ecf20Sopenharmony_ci	.name = "cf",
16178c2ecf20Sopenharmony_ci	.groups = cf_grps,
16188c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(cf_grps),
16198c2ecf20Sopenharmony_ci};
16208c2ecf20Sopenharmony_ci
16218c2ecf20Sopenharmony_ci/* Pad multiplexing for xd device */
16228c2ecf20Sopenharmony_cistatic struct spear_muxreg xd_muxreg[] = {
16238c2ecf20Sopenharmony_ci	MCIF_MUXREG,
16248c2ecf20Sopenharmony_ci	{
16258c2ecf20Sopenharmony_ci		.reg = PERIP_CFG,
16268c2ecf20Sopenharmony_ci		.mask = MCIF_SEL_MASK,
16278c2ecf20Sopenharmony_ci		.val = MCIF_SEL_XD,
16288c2ecf20Sopenharmony_ci	},
16298c2ecf20Sopenharmony_ci};
16308c2ecf20Sopenharmony_ci
16318c2ecf20Sopenharmony_cistatic struct spear_modemux xd_modemux[] = {
16328c2ecf20Sopenharmony_ci	{
16338c2ecf20Sopenharmony_ci		.muxregs = xd_muxreg,
16348c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(xd_muxreg),
16358c2ecf20Sopenharmony_ci	},
16368c2ecf20Sopenharmony_ci};
16378c2ecf20Sopenharmony_ci
16388c2ecf20Sopenharmony_cistatic struct spear_pingroup xd_pingroup = {
16398c2ecf20Sopenharmony_ci	.name = "xd_grp",
16408c2ecf20Sopenharmony_ci	.pins = mcif_pins,
16418c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(mcif_pins),
16428c2ecf20Sopenharmony_ci	.modemuxs = xd_modemux,
16438c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(xd_modemux),
16448c2ecf20Sopenharmony_ci};
16458c2ecf20Sopenharmony_ci
16468c2ecf20Sopenharmony_cistatic const char *const xd_grps[] = { "xd_grp" };
16478c2ecf20Sopenharmony_cistatic struct spear_function xd_function = {
16488c2ecf20Sopenharmony_ci	.name = "xd",
16498c2ecf20Sopenharmony_ci	.groups = xd_grps,
16508c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(xd_grps),
16518c2ecf20Sopenharmony_ci};
16528c2ecf20Sopenharmony_ci
16538c2ecf20Sopenharmony_ci/* pad multiplexing for clcd device */
16548c2ecf20Sopenharmony_cistatic const unsigned clcd_pins[] = { 138, 139, 140, 141, 142, 143, 144, 145,
16558c2ecf20Sopenharmony_ci	146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
16568c2ecf20Sopenharmony_ci	160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173,
16578c2ecf20Sopenharmony_ci	174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
16588c2ecf20Sopenharmony_ci	188, 189, 190, 191 };
16598c2ecf20Sopenharmony_cistatic struct spear_muxreg clcd_muxreg[] = {
16608c2ecf20Sopenharmony_ci	{
16618c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
16628c2ecf20Sopenharmony_ci		.mask = ARM_TRACE_MASK | MIPHY_DBG_MASK,
16638c2ecf20Sopenharmony_ci		.val = 0,
16648c2ecf20Sopenharmony_ci	}, {
16658c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_5,
16668c2ecf20Sopenharmony_ci		.mask = CLCD_REG4_MASK | CLCD_AND_ARM_TRACE_REG4_MASK,
16678c2ecf20Sopenharmony_ci		.val = CLCD_REG4_MASK | CLCD_AND_ARM_TRACE_REG4_MASK,
16688c2ecf20Sopenharmony_ci	}, {
16698c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_6,
16708c2ecf20Sopenharmony_ci		.mask = CLCD_AND_ARM_TRACE_REG5_MASK,
16718c2ecf20Sopenharmony_ci		.val = CLCD_AND_ARM_TRACE_REG5_MASK,
16728c2ecf20Sopenharmony_ci	}, {
16738c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_7,
16748c2ecf20Sopenharmony_ci		.mask = CLCD_AND_ARM_TRACE_REG6_MASK,
16758c2ecf20Sopenharmony_ci		.val = CLCD_AND_ARM_TRACE_REG6_MASK,
16768c2ecf20Sopenharmony_ci	},
16778c2ecf20Sopenharmony_ci};
16788c2ecf20Sopenharmony_ci
16798c2ecf20Sopenharmony_cistatic struct spear_modemux clcd_modemux[] = {
16808c2ecf20Sopenharmony_ci	{
16818c2ecf20Sopenharmony_ci		.muxregs = clcd_muxreg,
16828c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(clcd_muxreg),
16838c2ecf20Sopenharmony_ci	},
16848c2ecf20Sopenharmony_ci};
16858c2ecf20Sopenharmony_ci
16868c2ecf20Sopenharmony_cistatic struct spear_pingroup clcd_pingroup = {
16878c2ecf20Sopenharmony_ci	.name = "clcd_grp",
16888c2ecf20Sopenharmony_ci	.pins = clcd_pins,
16898c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(clcd_pins),
16908c2ecf20Sopenharmony_ci	.modemuxs = clcd_modemux,
16918c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(clcd_modemux),
16928c2ecf20Sopenharmony_ci};
16938c2ecf20Sopenharmony_ci
16948c2ecf20Sopenharmony_ci/* Disable cld runtime to save panel damage */
16958c2ecf20Sopenharmony_cistatic struct spear_muxreg clcd_sleep_muxreg[] = {
16968c2ecf20Sopenharmony_ci	{
16978c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
16988c2ecf20Sopenharmony_ci		.mask = ARM_TRACE_MASK | MIPHY_DBG_MASK,
16998c2ecf20Sopenharmony_ci		.val = 0,
17008c2ecf20Sopenharmony_ci	}, {
17018c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_5,
17028c2ecf20Sopenharmony_ci		.mask = CLCD_REG4_MASK | CLCD_AND_ARM_TRACE_REG4_MASK,
17038c2ecf20Sopenharmony_ci		.val = 0x0,
17048c2ecf20Sopenharmony_ci	}, {
17058c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_6,
17068c2ecf20Sopenharmony_ci		.mask = CLCD_AND_ARM_TRACE_REG5_MASK,
17078c2ecf20Sopenharmony_ci		.val = 0x0,
17088c2ecf20Sopenharmony_ci	}, {
17098c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_7,
17108c2ecf20Sopenharmony_ci		.mask = CLCD_AND_ARM_TRACE_REG6_MASK,
17118c2ecf20Sopenharmony_ci		.val = 0x0,
17128c2ecf20Sopenharmony_ci	},
17138c2ecf20Sopenharmony_ci};
17148c2ecf20Sopenharmony_ci
17158c2ecf20Sopenharmony_cistatic struct spear_modemux clcd_sleep_modemux[] = {
17168c2ecf20Sopenharmony_ci	{
17178c2ecf20Sopenharmony_ci		.muxregs = clcd_sleep_muxreg,
17188c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(clcd_sleep_muxreg),
17198c2ecf20Sopenharmony_ci	},
17208c2ecf20Sopenharmony_ci};
17218c2ecf20Sopenharmony_ci
17228c2ecf20Sopenharmony_cistatic struct spear_pingroup clcd_sleep_pingroup = {
17238c2ecf20Sopenharmony_ci	.name = "clcd_sleep_grp",
17248c2ecf20Sopenharmony_ci	.pins = clcd_pins,
17258c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(clcd_pins),
17268c2ecf20Sopenharmony_ci	.modemuxs = clcd_sleep_modemux,
17278c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(clcd_sleep_modemux),
17288c2ecf20Sopenharmony_ci};
17298c2ecf20Sopenharmony_ci
17308c2ecf20Sopenharmony_cistatic const char *const clcd_grps[] = { "clcd_grp", "clcd_sleep_grp" };
17318c2ecf20Sopenharmony_cistatic struct spear_function clcd_function = {
17328c2ecf20Sopenharmony_ci	.name = "clcd",
17338c2ecf20Sopenharmony_ci	.groups = clcd_grps,
17348c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(clcd_grps),
17358c2ecf20Sopenharmony_ci};
17368c2ecf20Sopenharmony_ci
17378c2ecf20Sopenharmony_ci/* pad multiplexing for arm_trace device */
17388c2ecf20Sopenharmony_cistatic const unsigned arm_trace_pins[] = { 158, 159, 160, 161, 162, 163, 164,
17398c2ecf20Sopenharmony_ci	165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178,
17408c2ecf20Sopenharmony_ci	179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
17418c2ecf20Sopenharmony_ci	193, 194, 195, 196, 197, 198, 199, 200 };
17428c2ecf20Sopenharmony_cistatic struct spear_muxreg arm_trace_muxreg[] = {
17438c2ecf20Sopenharmony_ci	{
17448c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
17458c2ecf20Sopenharmony_ci		.mask = ARM_TRACE_MASK,
17468c2ecf20Sopenharmony_ci		.val = ARM_TRACE_MASK,
17478c2ecf20Sopenharmony_ci	}, {
17488c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_5,
17498c2ecf20Sopenharmony_ci		.mask = CLCD_AND_ARM_TRACE_REG4_MASK,
17508c2ecf20Sopenharmony_ci		.val = CLCD_AND_ARM_TRACE_REG4_MASK,
17518c2ecf20Sopenharmony_ci	}, {
17528c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_6,
17538c2ecf20Sopenharmony_ci		.mask = CLCD_AND_ARM_TRACE_REG5_MASK,
17548c2ecf20Sopenharmony_ci		.val = CLCD_AND_ARM_TRACE_REG5_MASK,
17558c2ecf20Sopenharmony_ci	}, {
17568c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_7,
17578c2ecf20Sopenharmony_ci		.mask = CLCD_AND_ARM_TRACE_REG6_MASK,
17588c2ecf20Sopenharmony_ci		.val = CLCD_AND_ARM_TRACE_REG6_MASK,
17598c2ecf20Sopenharmony_ci	},
17608c2ecf20Sopenharmony_ci};
17618c2ecf20Sopenharmony_ci
17628c2ecf20Sopenharmony_cistatic struct spear_modemux arm_trace_modemux[] = {
17638c2ecf20Sopenharmony_ci	{
17648c2ecf20Sopenharmony_ci		.muxregs = arm_trace_muxreg,
17658c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(arm_trace_muxreg),
17668c2ecf20Sopenharmony_ci	},
17678c2ecf20Sopenharmony_ci};
17688c2ecf20Sopenharmony_ci
17698c2ecf20Sopenharmony_cistatic struct spear_pingroup arm_trace_pingroup = {
17708c2ecf20Sopenharmony_ci	.name = "arm_trace_grp",
17718c2ecf20Sopenharmony_ci	.pins = arm_trace_pins,
17728c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(arm_trace_pins),
17738c2ecf20Sopenharmony_ci	.modemuxs = arm_trace_modemux,
17748c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(arm_trace_modemux),
17758c2ecf20Sopenharmony_ci};
17768c2ecf20Sopenharmony_ci
17778c2ecf20Sopenharmony_cistatic const char *const arm_trace_grps[] = { "arm_trace_grp" };
17788c2ecf20Sopenharmony_cistatic struct spear_function arm_trace_function = {
17798c2ecf20Sopenharmony_ci	.name = "arm_trace",
17808c2ecf20Sopenharmony_ci	.groups = arm_trace_grps,
17818c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(arm_trace_grps),
17828c2ecf20Sopenharmony_ci};
17838c2ecf20Sopenharmony_ci
17848c2ecf20Sopenharmony_ci/* pad multiplexing for miphy_dbg device */
17858c2ecf20Sopenharmony_cistatic const unsigned miphy_dbg_pins[] = { 96, 97, 98, 99, 100, 101, 102, 103,
17868c2ecf20Sopenharmony_ci	132, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
17878c2ecf20Sopenharmony_ci	148, 149, 150, 151, 152, 153, 154, 155, 156, 157 };
17888c2ecf20Sopenharmony_cistatic struct spear_muxreg miphy_dbg_muxreg[] = {
17898c2ecf20Sopenharmony_ci	{
17908c2ecf20Sopenharmony_ci		.reg = PAD_SHARED_IP_EN_1,
17918c2ecf20Sopenharmony_ci		.mask = MIPHY_DBG_MASK,
17928c2ecf20Sopenharmony_ci		.val = MIPHY_DBG_MASK,
17938c2ecf20Sopenharmony_ci	}, {
17948c2ecf20Sopenharmony_ci		.reg = PAD_FUNCTION_EN_5,
17958c2ecf20Sopenharmony_ci		.mask = DEVS_GRP_AND_MIPHY_DBG_REG4_MASK,
17968c2ecf20Sopenharmony_ci		.val = DEVS_GRP_AND_MIPHY_DBG_REG4_MASK,
17978c2ecf20Sopenharmony_ci	},
17988c2ecf20Sopenharmony_ci};
17998c2ecf20Sopenharmony_ci
18008c2ecf20Sopenharmony_cistatic struct spear_modemux miphy_dbg_modemux[] = {
18018c2ecf20Sopenharmony_ci	{
18028c2ecf20Sopenharmony_ci		.muxregs = miphy_dbg_muxreg,
18038c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(miphy_dbg_muxreg),
18048c2ecf20Sopenharmony_ci	},
18058c2ecf20Sopenharmony_ci};
18068c2ecf20Sopenharmony_ci
18078c2ecf20Sopenharmony_cistatic struct spear_pingroup miphy_dbg_pingroup = {
18088c2ecf20Sopenharmony_ci	.name = "miphy_dbg_grp",
18098c2ecf20Sopenharmony_ci	.pins = miphy_dbg_pins,
18108c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(miphy_dbg_pins),
18118c2ecf20Sopenharmony_ci	.modemuxs = miphy_dbg_modemux,
18128c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(miphy_dbg_modemux),
18138c2ecf20Sopenharmony_ci};
18148c2ecf20Sopenharmony_ci
18158c2ecf20Sopenharmony_cistatic const char *const miphy_dbg_grps[] = { "miphy_dbg_grp" };
18168c2ecf20Sopenharmony_cistatic struct spear_function miphy_dbg_function = {
18178c2ecf20Sopenharmony_ci	.name = "miphy_dbg",
18188c2ecf20Sopenharmony_ci	.groups = miphy_dbg_grps,
18198c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(miphy_dbg_grps),
18208c2ecf20Sopenharmony_ci};
18218c2ecf20Sopenharmony_ci
18228c2ecf20Sopenharmony_ci/* pad multiplexing for pcie device */
18238c2ecf20Sopenharmony_cistatic const unsigned pcie_pins[] = { 250 };
18248c2ecf20Sopenharmony_cistatic struct spear_muxreg pcie_muxreg[] = {
18258c2ecf20Sopenharmony_ci	{
18268c2ecf20Sopenharmony_ci		.reg = PCIE_SATA_CFG,
18278c2ecf20Sopenharmony_ci		.mask = SATA_PCIE_CFG_MASK,
18288c2ecf20Sopenharmony_ci		.val = PCIE_CFG_VAL,
18298c2ecf20Sopenharmony_ci	},
18308c2ecf20Sopenharmony_ci};
18318c2ecf20Sopenharmony_ci
18328c2ecf20Sopenharmony_cistatic struct spear_modemux pcie_modemux[] = {
18338c2ecf20Sopenharmony_ci	{
18348c2ecf20Sopenharmony_ci		.muxregs = pcie_muxreg,
18358c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pcie_muxreg),
18368c2ecf20Sopenharmony_ci	},
18378c2ecf20Sopenharmony_ci};
18388c2ecf20Sopenharmony_ci
18398c2ecf20Sopenharmony_cistatic struct spear_pingroup pcie_pingroup = {
18408c2ecf20Sopenharmony_ci	.name = "pcie_grp",
18418c2ecf20Sopenharmony_ci	.pins = pcie_pins,
18428c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(pcie_pins),
18438c2ecf20Sopenharmony_ci	.modemuxs = pcie_modemux,
18448c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(pcie_modemux),
18458c2ecf20Sopenharmony_ci};
18468c2ecf20Sopenharmony_ci
18478c2ecf20Sopenharmony_cistatic const char *const pcie_grps[] = { "pcie_grp" };
18488c2ecf20Sopenharmony_cistatic struct spear_function pcie_function = {
18498c2ecf20Sopenharmony_ci	.name = "pcie",
18508c2ecf20Sopenharmony_ci	.groups = pcie_grps,
18518c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(pcie_grps),
18528c2ecf20Sopenharmony_ci};
18538c2ecf20Sopenharmony_ci
18548c2ecf20Sopenharmony_ci/* pad multiplexing for sata device */
18558c2ecf20Sopenharmony_cistatic const unsigned sata_pins[] = { 250 };
18568c2ecf20Sopenharmony_cistatic struct spear_muxreg sata_muxreg[] = {
18578c2ecf20Sopenharmony_ci	{
18588c2ecf20Sopenharmony_ci		.reg = PCIE_SATA_CFG,
18598c2ecf20Sopenharmony_ci		.mask = SATA_PCIE_CFG_MASK,
18608c2ecf20Sopenharmony_ci		.val = SATA_CFG_VAL,
18618c2ecf20Sopenharmony_ci	},
18628c2ecf20Sopenharmony_ci};
18638c2ecf20Sopenharmony_ci
18648c2ecf20Sopenharmony_cistatic struct spear_modemux sata_modemux[] = {
18658c2ecf20Sopenharmony_ci	{
18668c2ecf20Sopenharmony_ci		.muxregs = sata_muxreg,
18678c2ecf20Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(sata_muxreg),
18688c2ecf20Sopenharmony_ci	},
18698c2ecf20Sopenharmony_ci};
18708c2ecf20Sopenharmony_ci
18718c2ecf20Sopenharmony_cistatic struct spear_pingroup sata_pingroup = {
18728c2ecf20Sopenharmony_ci	.name = "sata_grp",
18738c2ecf20Sopenharmony_ci	.pins = sata_pins,
18748c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(sata_pins),
18758c2ecf20Sopenharmony_ci	.modemuxs = sata_modemux,
18768c2ecf20Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(sata_modemux),
18778c2ecf20Sopenharmony_ci};
18788c2ecf20Sopenharmony_ci
18798c2ecf20Sopenharmony_cistatic const char *const sata_grps[] = { "sata_grp" };
18808c2ecf20Sopenharmony_cistatic struct spear_function sata_function = {
18818c2ecf20Sopenharmony_ci	.name = "sata",
18828c2ecf20Sopenharmony_ci	.groups = sata_grps,
18838c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(sata_grps),
18848c2ecf20Sopenharmony_ci};
18858c2ecf20Sopenharmony_ci
18868c2ecf20Sopenharmony_ci/* pingroups */
18878c2ecf20Sopenharmony_cistatic struct spear_pingroup *spear1340_pingroups[] = {
18888c2ecf20Sopenharmony_ci	&pads_as_gpio_pingroup,
18898c2ecf20Sopenharmony_ci	&fsmc_8bit_pingroup,
18908c2ecf20Sopenharmony_ci	&fsmc_16bit_pingroup,
18918c2ecf20Sopenharmony_ci	&fsmc_pnor_pingroup,
18928c2ecf20Sopenharmony_ci	&keyboard_row_col_pingroup,
18938c2ecf20Sopenharmony_ci	&keyboard_col5_pingroup,
18948c2ecf20Sopenharmony_ci	&spdif_in_pingroup,
18958c2ecf20Sopenharmony_ci	&spdif_out_pingroup,
18968c2ecf20Sopenharmony_ci	&gpt_0_1_pingroup,
18978c2ecf20Sopenharmony_ci	&pwm0_pingroup,
18988c2ecf20Sopenharmony_ci	&pwm1_pingroup,
18998c2ecf20Sopenharmony_ci	&pwm2_pingroup,
19008c2ecf20Sopenharmony_ci	&pwm3_pingroup,
19018c2ecf20Sopenharmony_ci	&vip_mux_pingroup,
19028c2ecf20Sopenharmony_ci	&vip_mux_cam0_pingroup,
19038c2ecf20Sopenharmony_ci	&vip_mux_cam1_pingroup,
19048c2ecf20Sopenharmony_ci	&vip_mux_cam2_pingroup,
19058c2ecf20Sopenharmony_ci	&vip_mux_cam3_pingroup,
19068c2ecf20Sopenharmony_ci	&cam0_pingroup,
19078c2ecf20Sopenharmony_ci	&cam1_pingroup,
19088c2ecf20Sopenharmony_ci	&cam2_pingroup,
19098c2ecf20Sopenharmony_ci	&cam3_pingroup,
19108c2ecf20Sopenharmony_ci	&smi_pingroup,
19118c2ecf20Sopenharmony_ci	&ssp0_pingroup,
19128c2ecf20Sopenharmony_ci	&ssp0_cs1_pingroup,
19138c2ecf20Sopenharmony_ci	&ssp0_cs2_pingroup,
19148c2ecf20Sopenharmony_ci	&ssp0_cs3_pingroup,
19158c2ecf20Sopenharmony_ci	&uart0_pingroup,
19168c2ecf20Sopenharmony_ci	&uart0_enh_pingroup,
19178c2ecf20Sopenharmony_ci	&uart1_pingroup,
19188c2ecf20Sopenharmony_ci	&i2s_in_pingroup,
19198c2ecf20Sopenharmony_ci	&i2s_out_pingroup,
19208c2ecf20Sopenharmony_ci	&gmii_pingroup,
19218c2ecf20Sopenharmony_ci	&rgmii_pingroup,
19228c2ecf20Sopenharmony_ci	&rmii_pingroup,
19238c2ecf20Sopenharmony_ci	&sgmii_pingroup,
19248c2ecf20Sopenharmony_ci	&i2c0_pingroup,
19258c2ecf20Sopenharmony_ci	&i2c1_pingroup,
19268c2ecf20Sopenharmony_ci	&cec0_pingroup,
19278c2ecf20Sopenharmony_ci	&cec1_pingroup,
19288c2ecf20Sopenharmony_ci	&sdhci_pingroup,
19298c2ecf20Sopenharmony_ci	&cf_pingroup,
19308c2ecf20Sopenharmony_ci	&xd_pingroup,
19318c2ecf20Sopenharmony_ci	&clcd_sleep_pingroup,
19328c2ecf20Sopenharmony_ci	&clcd_pingroup,
19338c2ecf20Sopenharmony_ci	&arm_trace_pingroup,
19348c2ecf20Sopenharmony_ci	&miphy_dbg_pingroup,
19358c2ecf20Sopenharmony_ci	&pcie_pingroup,
19368c2ecf20Sopenharmony_ci	&sata_pingroup,
19378c2ecf20Sopenharmony_ci};
19388c2ecf20Sopenharmony_ci
19398c2ecf20Sopenharmony_ci/* functions */
19408c2ecf20Sopenharmony_cistatic struct spear_function *spear1340_functions[] = {
19418c2ecf20Sopenharmony_ci	&pads_as_gpio_function,
19428c2ecf20Sopenharmony_ci	&fsmc_function,
19438c2ecf20Sopenharmony_ci	&keyboard_function,
19448c2ecf20Sopenharmony_ci	&spdif_in_function,
19458c2ecf20Sopenharmony_ci	&spdif_out_function,
19468c2ecf20Sopenharmony_ci	&gpt_0_1_function,
19478c2ecf20Sopenharmony_ci	&pwm_function,
19488c2ecf20Sopenharmony_ci	&vip_function,
19498c2ecf20Sopenharmony_ci	&cam0_function,
19508c2ecf20Sopenharmony_ci	&cam1_function,
19518c2ecf20Sopenharmony_ci	&cam2_function,
19528c2ecf20Sopenharmony_ci	&cam3_function,
19538c2ecf20Sopenharmony_ci	&smi_function,
19548c2ecf20Sopenharmony_ci	&ssp0_function,
19558c2ecf20Sopenharmony_ci	&uart0_function,
19568c2ecf20Sopenharmony_ci	&uart1_function,
19578c2ecf20Sopenharmony_ci	&i2s_function,
19588c2ecf20Sopenharmony_ci	&gmac_function,
19598c2ecf20Sopenharmony_ci	&i2c0_function,
19608c2ecf20Sopenharmony_ci	&i2c1_function,
19618c2ecf20Sopenharmony_ci	&cec0_function,
19628c2ecf20Sopenharmony_ci	&cec1_function,
19638c2ecf20Sopenharmony_ci	&sdhci_function,
19648c2ecf20Sopenharmony_ci	&cf_function,
19658c2ecf20Sopenharmony_ci	&xd_function,
19668c2ecf20Sopenharmony_ci	&clcd_function,
19678c2ecf20Sopenharmony_ci	&arm_trace_function,
19688c2ecf20Sopenharmony_ci	&miphy_dbg_function,
19698c2ecf20Sopenharmony_ci	&pcie_function,
19708c2ecf20Sopenharmony_ci	&sata_function,
19718c2ecf20Sopenharmony_ci};
19728c2ecf20Sopenharmony_ci
19738c2ecf20Sopenharmony_cistatic void gpio_request_endisable(struct spear_pmx *pmx, int pin,
19748c2ecf20Sopenharmony_ci		bool enable)
19758c2ecf20Sopenharmony_ci{
19768c2ecf20Sopenharmony_ci	unsigned int regoffset, regindex, bitoffset;
19778c2ecf20Sopenharmony_ci	unsigned int val;
19788c2ecf20Sopenharmony_ci
19798c2ecf20Sopenharmony_ci	/* pin++ as gpio configuration starts from 2nd bit of base register */
19808c2ecf20Sopenharmony_ci	pin++;
19818c2ecf20Sopenharmony_ci
19828c2ecf20Sopenharmony_ci	regindex = pin / 32;
19838c2ecf20Sopenharmony_ci	bitoffset = pin % 32;
19848c2ecf20Sopenharmony_ci
19858c2ecf20Sopenharmony_ci	if (regindex <= 3)
19868c2ecf20Sopenharmony_ci		regoffset = PAD_FUNCTION_EN_1 + regindex * sizeof(int *);
19878c2ecf20Sopenharmony_ci	else
19888c2ecf20Sopenharmony_ci		regoffset = PAD_FUNCTION_EN_5 + (regindex - 4) * sizeof(int *);
19898c2ecf20Sopenharmony_ci
19908c2ecf20Sopenharmony_ci	val = pmx_readl(pmx, regoffset);
19918c2ecf20Sopenharmony_ci	if (enable)
19928c2ecf20Sopenharmony_ci		val &= ~(0x1 << bitoffset);
19938c2ecf20Sopenharmony_ci	else
19948c2ecf20Sopenharmony_ci		val |= 0x1 << bitoffset;
19958c2ecf20Sopenharmony_ci
19968c2ecf20Sopenharmony_ci	pmx_writel(pmx, val, regoffset);
19978c2ecf20Sopenharmony_ci}
19988c2ecf20Sopenharmony_ci
19998c2ecf20Sopenharmony_cistatic struct spear_pinctrl_machdata spear1340_machdata = {
20008c2ecf20Sopenharmony_ci	.pins = spear1340_pins,
20018c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(spear1340_pins),
20028c2ecf20Sopenharmony_ci	.groups = spear1340_pingroups,
20038c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(spear1340_pingroups),
20048c2ecf20Sopenharmony_ci	.functions = spear1340_functions,
20058c2ecf20Sopenharmony_ci	.nfunctions = ARRAY_SIZE(spear1340_functions),
20068c2ecf20Sopenharmony_ci	.gpio_request_endisable = gpio_request_endisable,
20078c2ecf20Sopenharmony_ci	.modes_supported = false,
20088c2ecf20Sopenharmony_ci};
20098c2ecf20Sopenharmony_ci
20108c2ecf20Sopenharmony_cistatic const struct of_device_id spear1340_pinctrl_of_match[] = {
20118c2ecf20Sopenharmony_ci	{
20128c2ecf20Sopenharmony_ci		.compatible = "st,spear1340-pinmux",
20138c2ecf20Sopenharmony_ci	},
20148c2ecf20Sopenharmony_ci	{},
20158c2ecf20Sopenharmony_ci};
20168c2ecf20Sopenharmony_ci
20178c2ecf20Sopenharmony_cistatic int spear1340_pinctrl_probe(struct platform_device *pdev)
20188c2ecf20Sopenharmony_ci{
20198c2ecf20Sopenharmony_ci	return spear_pinctrl_probe(pdev, &spear1340_machdata);
20208c2ecf20Sopenharmony_ci}
20218c2ecf20Sopenharmony_ci
20228c2ecf20Sopenharmony_cistatic struct platform_driver spear1340_pinctrl_driver = {
20238c2ecf20Sopenharmony_ci	.driver = {
20248c2ecf20Sopenharmony_ci		.name = DRIVER_NAME,
20258c2ecf20Sopenharmony_ci		.of_match_table = spear1340_pinctrl_of_match,
20268c2ecf20Sopenharmony_ci	},
20278c2ecf20Sopenharmony_ci	.probe = spear1340_pinctrl_probe,
20288c2ecf20Sopenharmony_ci};
20298c2ecf20Sopenharmony_ci
20308c2ecf20Sopenharmony_cistatic int __init spear1340_pinctrl_init(void)
20318c2ecf20Sopenharmony_ci{
20328c2ecf20Sopenharmony_ci	return platform_driver_register(&spear1340_pinctrl_driver);
20338c2ecf20Sopenharmony_ci}
20348c2ecf20Sopenharmony_ciarch_initcall(spear1340_pinctrl_init);
2035