18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Intel Sunrisepoint PCH pinctrl/GPIO driver
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2015, Intel Corporation
68c2ecf20Sopenharmony_ci * Authors: Mathias Nyman <mathias.nyman@linux.intel.com>
78c2ecf20Sopenharmony_ci *          Mika Westerberg <mika.westerberg@linux.intel.com>
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#include <linux/mod_devicetable.h>
118c2ecf20Sopenharmony_ci#include <linux/module.h>
128c2ecf20Sopenharmony_ci#include <linux/platform_device.h>
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#include <linux/pinctrl/pinctrl.h>
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#include "pinctrl-intel.h"
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#define SPT_PAD_OWN		0x020
198c2ecf20Sopenharmony_ci#define SPT_H_PADCFGLOCK	0x090
208c2ecf20Sopenharmony_ci#define SPT_LP_PADCFGLOCK	0x0a0
218c2ecf20Sopenharmony_ci#define SPT_HOSTSW_OWN		0x0d0
228c2ecf20Sopenharmony_ci#define SPT_GPI_IS		0x100
238c2ecf20Sopenharmony_ci#define SPT_GPI_IE		0x120
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci#define SPT_COMMUNITY(b, s, e, pl, gs, gn, g, n)	\
268c2ecf20Sopenharmony_ci	{						\
278c2ecf20Sopenharmony_ci		.barno = (b),				\
288c2ecf20Sopenharmony_ci		.padown_offset = SPT_PAD_OWN,		\
298c2ecf20Sopenharmony_ci		.padcfglock_offset = (pl),		\
308c2ecf20Sopenharmony_ci		.hostown_offset = SPT_HOSTSW_OWN,	\
318c2ecf20Sopenharmony_ci		.is_offset = SPT_GPI_IS,		\
328c2ecf20Sopenharmony_ci		.ie_offset = SPT_GPI_IE,		\
338c2ecf20Sopenharmony_ci		.gpp_size = (gs),			\
348c2ecf20Sopenharmony_ci		.gpp_num_padown_regs = (gn),		\
358c2ecf20Sopenharmony_ci		.pin_base = (s),			\
368c2ecf20Sopenharmony_ci		.npins = ((e) - (s) + 1),		\
378c2ecf20Sopenharmony_ci		.gpps = (g),				\
388c2ecf20Sopenharmony_ci		.ngpps = (n),				\
398c2ecf20Sopenharmony_ci	}
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci#define SPT_LP_COMMUNITY(b, s, e)			\
428c2ecf20Sopenharmony_ci	SPT_COMMUNITY(b, s, e, SPT_LP_PADCFGLOCK, 24, 4, NULL, 0)
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci#define SPT_H_GPP(r, s, e, g)				\
458c2ecf20Sopenharmony_ci	{						\
468c2ecf20Sopenharmony_ci		.reg_num = (r),				\
478c2ecf20Sopenharmony_ci		.base = (s),				\
488c2ecf20Sopenharmony_ci		.size = ((e) - (s) + 1),		\
498c2ecf20Sopenharmony_ci		.gpio_base = (g),			\
508c2ecf20Sopenharmony_ci	}
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci#define SPT_H_COMMUNITY(b, s, e, g)			\
538c2ecf20Sopenharmony_ci	SPT_COMMUNITY(b, s, e, SPT_H_PADCFGLOCK, 0, 0, g, ARRAY_SIZE(g))
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci/* Sunrisepoint-LP */
568c2ecf20Sopenharmony_cistatic const struct pinctrl_pin_desc sptlp_pins[] = {
578c2ecf20Sopenharmony_ci	/* GPP_A */
588c2ecf20Sopenharmony_ci	PINCTRL_PIN(0, "RCINB"),
598c2ecf20Sopenharmony_ci	PINCTRL_PIN(1, "LAD_0"),
608c2ecf20Sopenharmony_ci	PINCTRL_PIN(2, "LAD_1"),
618c2ecf20Sopenharmony_ci	PINCTRL_PIN(3, "LAD_2"),
628c2ecf20Sopenharmony_ci	PINCTRL_PIN(4, "LAD_3"),
638c2ecf20Sopenharmony_ci	PINCTRL_PIN(5, "LFRAMEB"),
648c2ecf20Sopenharmony_ci	PINCTRL_PIN(6, "SERIQ"),
658c2ecf20Sopenharmony_ci	PINCTRL_PIN(7, "PIRQAB"),
668c2ecf20Sopenharmony_ci	PINCTRL_PIN(8, "CLKRUNB"),
678c2ecf20Sopenharmony_ci	PINCTRL_PIN(9, "CLKOUT_LPC_0"),
688c2ecf20Sopenharmony_ci	PINCTRL_PIN(10, "CLKOUT_LPC_1"),
698c2ecf20Sopenharmony_ci	PINCTRL_PIN(11, "PMEB"),
708c2ecf20Sopenharmony_ci	PINCTRL_PIN(12, "BM_BUSYB"),
718c2ecf20Sopenharmony_ci	PINCTRL_PIN(13, "SUSWARNB_SUS_PWRDNACK"),
728c2ecf20Sopenharmony_ci	PINCTRL_PIN(14, "SUS_STATB"),
738c2ecf20Sopenharmony_ci	PINCTRL_PIN(15, "SUSACKB"),
748c2ecf20Sopenharmony_ci	PINCTRL_PIN(16, "SD_1P8_SEL"),
758c2ecf20Sopenharmony_ci	PINCTRL_PIN(17, "SD_PWR_EN_B"),
768c2ecf20Sopenharmony_ci	PINCTRL_PIN(18, "ISH_GP_0"),
778c2ecf20Sopenharmony_ci	PINCTRL_PIN(19, "ISH_GP_1"),
788c2ecf20Sopenharmony_ci	PINCTRL_PIN(20, "ISH_GP_2"),
798c2ecf20Sopenharmony_ci	PINCTRL_PIN(21, "ISH_GP_3"),
808c2ecf20Sopenharmony_ci	PINCTRL_PIN(22, "ISH_GP_4"),
818c2ecf20Sopenharmony_ci	PINCTRL_PIN(23, "ISH_GP_5"),
828c2ecf20Sopenharmony_ci	/* GPP_B */
838c2ecf20Sopenharmony_ci	PINCTRL_PIN(24, "CORE_VID_0"),
848c2ecf20Sopenharmony_ci	PINCTRL_PIN(25, "CORE_VID_1"),
858c2ecf20Sopenharmony_ci	PINCTRL_PIN(26, "VRALERTB"),
868c2ecf20Sopenharmony_ci	PINCTRL_PIN(27, "CPU_GP_2"),
878c2ecf20Sopenharmony_ci	PINCTRL_PIN(28, "CPU_GP_3"),
888c2ecf20Sopenharmony_ci	PINCTRL_PIN(29, "SRCCLKREQB_0"),
898c2ecf20Sopenharmony_ci	PINCTRL_PIN(30, "SRCCLKREQB_1"),
908c2ecf20Sopenharmony_ci	PINCTRL_PIN(31, "SRCCLKREQB_2"),
918c2ecf20Sopenharmony_ci	PINCTRL_PIN(32, "SRCCLKREQB_3"),
928c2ecf20Sopenharmony_ci	PINCTRL_PIN(33, "SRCCLKREQB_4"),
938c2ecf20Sopenharmony_ci	PINCTRL_PIN(34, "SRCCLKREQB_5"),
948c2ecf20Sopenharmony_ci	PINCTRL_PIN(35, "EXT_PWR_GATEB"),
958c2ecf20Sopenharmony_ci	PINCTRL_PIN(36, "SLP_S0B"),
968c2ecf20Sopenharmony_ci	PINCTRL_PIN(37, "PLTRSTB"),
978c2ecf20Sopenharmony_ci	PINCTRL_PIN(38, "SPKR"),
988c2ecf20Sopenharmony_ci	PINCTRL_PIN(39, "GSPI0_CSB"),
998c2ecf20Sopenharmony_ci	PINCTRL_PIN(40, "GSPI0_CLK"),
1008c2ecf20Sopenharmony_ci	PINCTRL_PIN(41, "GSPI0_MISO"),
1018c2ecf20Sopenharmony_ci	PINCTRL_PIN(42, "GSPI0_MOSI"),
1028c2ecf20Sopenharmony_ci	PINCTRL_PIN(43, "GSPI1_CSB"),
1038c2ecf20Sopenharmony_ci	PINCTRL_PIN(44, "GSPI1_CLK"),
1048c2ecf20Sopenharmony_ci	PINCTRL_PIN(45, "GSPI1_MISO"),
1058c2ecf20Sopenharmony_ci	PINCTRL_PIN(46, "GSPI1_MOSI"),
1068c2ecf20Sopenharmony_ci	PINCTRL_PIN(47, "SML1ALERTB"),
1078c2ecf20Sopenharmony_ci	/* GPP_C */
1088c2ecf20Sopenharmony_ci	PINCTRL_PIN(48, "SMBCLK"),
1098c2ecf20Sopenharmony_ci	PINCTRL_PIN(49, "SMBDATA"),
1108c2ecf20Sopenharmony_ci	PINCTRL_PIN(50, "SMBALERTB"),
1118c2ecf20Sopenharmony_ci	PINCTRL_PIN(51, "SML0CLK"),
1128c2ecf20Sopenharmony_ci	PINCTRL_PIN(52, "SML0DATA"),
1138c2ecf20Sopenharmony_ci	PINCTRL_PIN(53, "SML0ALERTB"),
1148c2ecf20Sopenharmony_ci	PINCTRL_PIN(54, "SML1CLK"),
1158c2ecf20Sopenharmony_ci	PINCTRL_PIN(55, "SML1DATA"),
1168c2ecf20Sopenharmony_ci	PINCTRL_PIN(56, "UART0_RXD"),
1178c2ecf20Sopenharmony_ci	PINCTRL_PIN(57, "UART0_TXD"),
1188c2ecf20Sopenharmony_ci	PINCTRL_PIN(58, "UART0_RTSB"),
1198c2ecf20Sopenharmony_ci	PINCTRL_PIN(59, "UART0_CTSB"),
1208c2ecf20Sopenharmony_ci	PINCTRL_PIN(60, "UART1_RXD"),
1218c2ecf20Sopenharmony_ci	PINCTRL_PIN(61, "UART1_TXD"),
1228c2ecf20Sopenharmony_ci	PINCTRL_PIN(62, "UART1_RTSB"),
1238c2ecf20Sopenharmony_ci	PINCTRL_PIN(63, "UART1_CTSB"),
1248c2ecf20Sopenharmony_ci	PINCTRL_PIN(64, "I2C0_SDA"),
1258c2ecf20Sopenharmony_ci	PINCTRL_PIN(65, "I2C0_SCL"),
1268c2ecf20Sopenharmony_ci	PINCTRL_PIN(66, "I2C1_SDA"),
1278c2ecf20Sopenharmony_ci	PINCTRL_PIN(67, "I2C1_SCL"),
1288c2ecf20Sopenharmony_ci	PINCTRL_PIN(68, "UART2_RXD"),
1298c2ecf20Sopenharmony_ci	PINCTRL_PIN(69, "UART2_TXD"),
1308c2ecf20Sopenharmony_ci	PINCTRL_PIN(70, "UART2_RTSB"),
1318c2ecf20Sopenharmony_ci	PINCTRL_PIN(71, "UART2_CTSB"),
1328c2ecf20Sopenharmony_ci	/* GPP_D */
1338c2ecf20Sopenharmony_ci	PINCTRL_PIN(72, "SPI1_CSB"),
1348c2ecf20Sopenharmony_ci	PINCTRL_PIN(73, "SPI1_CLK"),
1358c2ecf20Sopenharmony_ci	PINCTRL_PIN(74, "SPI1_MISO_IO_1"),
1368c2ecf20Sopenharmony_ci	PINCTRL_PIN(75, "SPI1_MOSI_IO_0"),
1378c2ecf20Sopenharmony_ci	PINCTRL_PIN(76, "FLASHTRIG"),
1388c2ecf20Sopenharmony_ci	PINCTRL_PIN(77, "ISH_I2C0_SDA"),
1398c2ecf20Sopenharmony_ci	PINCTRL_PIN(78, "ISH_I2C0_SCL"),
1408c2ecf20Sopenharmony_ci	PINCTRL_PIN(79, "ISH_I2C1_SDA"),
1418c2ecf20Sopenharmony_ci	PINCTRL_PIN(80, "ISH_I2C1_SCL"),
1428c2ecf20Sopenharmony_ci	PINCTRL_PIN(81, "ISH_SPI_CSB"),
1438c2ecf20Sopenharmony_ci	PINCTRL_PIN(82, "ISH_SPI_CLK"),
1448c2ecf20Sopenharmony_ci	PINCTRL_PIN(83, "ISH_SPI_MISO"),
1458c2ecf20Sopenharmony_ci	PINCTRL_PIN(84, "ISH_SPI_MOSI"),
1468c2ecf20Sopenharmony_ci	PINCTRL_PIN(85, "ISH_UART0_RXD"),
1478c2ecf20Sopenharmony_ci	PINCTRL_PIN(86, "ISH_UART0_TXD"),
1488c2ecf20Sopenharmony_ci	PINCTRL_PIN(87, "ISH_UART0_RTSB"),
1498c2ecf20Sopenharmony_ci	PINCTRL_PIN(88, "ISH_UART0_CTSB"),
1508c2ecf20Sopenharmony_ci	PINCTRL_PIN(89, "DMIC_CLK_1"),
1518c2ecf20Sopenharmony_ci	PINCTRL_PIN(90, "DMIC_DATA_1"),
1528c2ecf20Sopenharmony_ci	PINCTRL_PIN(91, "DMIC_CLK_0"),
1538c2ecf20Sopenharmony_ci	PINCTRL_PIN(92, "DMIC_DATA_0"),
1548c2ecf20Sopenharmony_ci	PINCTRL_PIN(93, "SPI1_IO_2"),
1558c2ecf20Sopenharmony_ci	PINCTRL_PIN(94, "SPI1_IO_3"),
1568c2ecf20Sopenharmony_ci	PINCTRL_PIN(95, "SSP_MCLK"),
1578c2ecf20Sopenharmony_ci	/* GPP_E */
1588c2ecf20Sopenharmony_ci	PINCTRL_PIN(96, "SATAXPCIE_0"),
1598c2ecf20Sopenharmony_ci	PINCTRL_PIN(97, "SATAXPCIE_1"),
1608c2ecf20Sopenharmony_ci	PINCTRL_PIN(98, "SATAXPCIE_2"),
1618c2ecf20Sopenharmony_ci	PINCTRL_PIN(99, "CPU_GP_0"),
1628c2ecf20Sopenharmony_ci	PINCTRL_PIN(100, "SATA_DEVSLP_0"),
1638c2ecf20Sopenharmony_ci	PINCTRL_PIN(101, "SATA_DEVSLP_1"),
1648c2ecf20Sopenharmony_ci	PINCTRL_PIN(102, "SATA_DEVSLP_2"),
1658c2ecf20Sopenharmony_ci	PINCTRL_PIN(103, "CPU_GP_1"),
1668c2ecf20Sopenharmony_ci	PINCTRL_PIN(104, "SATA_LEDB"),
1678c2ecf20Sopenharmony_ci	PINCTRL_PIN(105, "USB2_OCB_0"),
1688c2ecf20Sopenharmony_ci	PINCTRL_PIN(106, "USB2_OCB_1"),
1698c2ecf20Sopenharmony_ci	PINCTRL_PIN(107, "USB2_OCB_2"),
1708c2ecf20Sopenharmony_ci	PINCTRL_PIN(108, "USB2_OCB_3"),
1718c2ecf20Sopenharmony_ci	PINCTRL_PIN(109, "DDSP_HPD_0"),
1728c2ecf20Sopenharmony_ci	PINCTRL_PIN(110, "DDSP_HPD_1"),
1738c2ecf20Sopenharmony_ci	PINCTRL_PIN(111, "DDSP_HPD_2"),
1748c2ecf20Sopenharmony_ci	PINCTRL_PIN(112, "DDSP_HPD_3"),
1758c2ecf20Sopenharmony_ci	PINCTRL_PIN(113, "EDP_HPD"),
1768c2ecf20Sopenharmony_ci	PINCTRL_PIN(114, "DDPB_CTRLCLK"),
1778c2ecf20Sopenharmony_ci	PINCTRL_PIN(115, "DDPB_CTRLDATA"),
1788c2ecf20Sopenharmony_ci	PINCTRL_PIN(116, "DDPC_CTRLCLK"),
1798c2ecf20Sopenharmony_ci	PINCTRL_PIN(117, "DDPC_CTRLDATA"),
1808c2ecf20Sopenharmony_ci	PINCTRL_PIN(118, "DDPD_CTRLCLK"),
1818c2ecf20Sopenharmony_ci	PINCTRL_PIN(119, "DDPD_CTRLDATA"),
1828c2ecf20Sopenharmony_ci	/* GPP_F */
1838c2ecf20Sopenharmony_ci	PINCTRL_PIN(120, "SSP2_SCLK"),
1848c2ecf20Sopenharmony_ci	PINCTRL_PIN(121, "SSP2_SFRM"),
1858c2ecf20Sopenharmony_ci	PINCTRL_PIN(122, "SSP2_TXD"),
1868c2ecf20Sopenharmony_ci	PINCTRL_PIN(123, "SSP2_RXD"),
1878c2ecf20Sopenharmony_ci	PINCTRL_PIN(124, "I2C2_SDA"),
1888c2ecf20Sopenharmony_ci	PINCTRL_PIN(125, "I2C2_SCL"),
1898c2ecf20Sopenharmony_ci	PINCTRL_PIN(126, "I2C3_SDA"),
1908c2ecf20Sopenharmony_ci	PINCTRL_PIN(127, "I2C3_SCL"),
1918c2ecf20Sopenharmony_ci	PINCTRL_PIN(128, "I2C4_SDA"),
1928c2ecf20Sopenharmony_ci	PINCTRL_PIN(129, "I2C4_SCL"),
1938c2ecf20Sopenharmony_ci	PINCTRL_PIN(130, "I2C5_SDA"),
1948c2ecf20Sopenharmony_ci	PINCTRL_PIN(131, "I2C5_SCL"),
1958c2ecf20Sopenharmony_ci	PINCTRL_PIN(132, "EMMC_CMD"),
1968c2ecf20Sopenharmony_ci	PINCTRL_PIN(133, "EMMC_DATA_0"),
1978c2ecf20Sopenharmony_ci	PINCTRL_PIN(134, "EMMC_DATA_1"),
1988c2ecf20Sopenharmony_ci	PINCTRL_PIN(135, "EMMC_DATA_2"),
1998c2ecf20Sopenharmony_ci	PINCTRL_PIN(136, "EMMC_DATA_3"),
2008c2ecf20Sopenharmony_ci	PINCTRL_PIN(137, "EMMC_DATA_4"),
2018c2ecf20Sopenharmony_ci	PINCTRL_PIN(138, "EMMC_DATA_5"),
2028c2ecf20Sopenharmony_ci	PINCTRL_PIN(139, "EMMC_DATA_6"),
2038c2ecf20Sopenharmony_ci	PINCTRL_PIN(140, "EMMC_DATA_7"),
2048c2ecf20Sopenharmony_ci	PINCTRL_PIN(141, "EMMC_RCLK"),
2058c2ecf20Sopenharmony_ci	PINCTRL_PIN(142, "EMMC_CLK"),
2068c2ecf20Sopenharmony_ci	PINCTRL_PIN(143, "GPP_F_23"),
2078c2ecf20Sopenharmony_ci	/* GPP_G */
2088c2ecf20Sopenharmony_ci	PINCTRL_PIN(144, "SD_CMD"),
2098c2ecf20Sopenharmony_ci	PINCTRL_PIN(145, "SD_DATA_0"),
2108c2ecf20Sopenharmony_ci	PINCTRL_PIN(146, "SD_DATA_1"),
2118c2ecf20Sopenharmony_ci	PINCTRL_PIN(147, "SD_DATA_2"),
2128c2ecf20Sopenharmony_ci	PINCTRL_PIN(148, "SD_DATA_3"),
2138c2ecf20Sopenharmony_ci	PINCTRL_PIN(149, "SD_CDB"),
2148c2ecf20Sopenharmony_ci	PINCTRL_PIN(150, "SD_CLK"),
2158c2ecf20Sopenharmony_ci	PINCTRL_PIN(151, "SD_WP"),
2168c2ecf20Sopenharmony_ci};
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_cistatic const unsigned sptlp_spi0_pins[] = { 39, 40, 41, 42 };
2198c2ecf20Sopenharmony_cistatic const unsigned sptlp_spi1_pins[] = { 43, 44, 45, 46 };
2208c2ecf20Sopenharmony_cistatic const unsigned sptlp_uart0_pins[] = { 56, 57, 58, 59 };
2218c2ecf20Sopenharmony_cistatic const unsigned sptlp_uart1_pins[] = { 60, 61, 62, 63 };
2228c2ecf20Sopenharmony_cistatic const unsigned sptlp_uart2_pins[] = { 68, 69, 71, 71 };
2238c2ecf20Sopenharmony_cistatic const unsigned sptlp_i2c0_pins[] = { 64, 65 };
2248c2ecf20Sopenharmony_cistatic const unsigned sptlp_i2c1_pins[] = { 66, 67 };
2258c2ecf20Sopenharmony_cistatic const unsigned sptlp_i2c2_pins[] = { 124, 125 };
2268c2ecf20Sopenharmony_cistatic const unsigned sptlp_i2c3_pins[] = { 126, 127 };
2278c2ecf20Sopenharmony_cistatic const unsigned sptlp_i2c4_pins[] = { 128, 129 };
2288c2ecf20Sopenharmony_cistatic const unsigned sptlp_i2c4b_pins[] = { 85, 86 };
2298c2ecf20Sopenharmony_cistatic const unsigned sptlp_i2c5_pins[] = { 130, 131 };
2308c2ecf20Sopenharmony_cistatic const unsigned sptlp_ssp2_pins[] = { 120, 121, 122, 123 };
2318c2ecf20Sopenharmony_cistatic const unsigned sptlp_emmc_pins[] = {
2328c2ecf20Sopenharmony_ci	132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
2338c2ecf20Sopenharmony_ci};
2348c2ecf20Sopenharmony_cistatic const unsigned sptlp_sd_pins[] = {
2358c2ecf20Sopenharmony_ci	144, 145, 146, 147, 148, 149, 150, 151,
2368c2ecf20Sopenharmony_ci};
2378c2ecf20Sopenharmony_ci
2388c2ecf20Sopenharmony_cistatic const struct intel_pingroup sptlp_groups[] = {
2398c2ecf20Sopenharmony_ci	PIN_GROUP("spi0_grp", sptlp_spi0_pins, 1),
2408c2ecf20Sopenharmony_ci	PIN_GROUP("spi1_grp", sptlp_spi1_pins, 1),
2418c2ecf20Sopenharmony_ci	PIN_GROUP("uart0_grp", sptlp_uart0_pins, 1),
2428c2ecf20Sopenharmony_ci	PIN_GROUP("uart1_grp", sptlp_uart1_pins, 1),
2438c2ecf20Sopenharmony_ci	PIN_GROUP("uart2_grp", sptlp_uart2_pins, 1),
2448c2ecf20Sopenharmony_ci	PIN_GROUP("i2c0_grp", sptlp_i2c0_pins, 1),
2458c2ecf20Sopenharmony_ci	PIN_GROUP("i2c1_grp", sptlp_i2c1_pins, 1),
2468c2ecf20Sopenharmony_ci	PIN_GROUP("i2c2_grp", sptlp_i2c2_pins, 1),
2478c2ecf20Sopenharmony_ci	PIN_GROUP("i2c3_grp", sptlp_i2c3_pins, 1),
2488c2ecf20Sopenharmony_ci	PIN_GROUP("i2c4_grp", sptlp_i2c4_pins, 1),
2498c2ecf20Sopenharmony_ci	PIN_GROUP("i2c4b_grp", sptlp_i2c4b_pins, 3),
2508c2ecf20Sopenharmony_ci	PIN_GROUP("i2c5_grp", sptlp_i2c5_pins, 1),
2518c2ecf20Sopenharmony_ci	PIN_GROUP("ssp2_grp", sptlp_ssp2_pins, 1),
2528c2ecf20Sopenharmony_ci	PIN_GROUP("emmc_grp", sptlp_emmc_pins, 1),
2538c2ecf20Sopenharmony_ci	PIN_GROUP("sd_grp", sptlp_sd_pins, 1),
2548c2ecf20Sopenharmony_ci};
2558c2ecf20Sopenharmony_ci
2568c2ecf20Sopenharmony_cistatic const char * const sptlp_spi0_groups[] = { "spi0_grp" };
2578c2ecf20Sopenharmony_cistatic const char * const sptlp_spi1_groups[] = { "spi0_grp" };
2588c2ecf20Sopenharmony_cistatic const char * const sptlp_uart0_groups[] = { "uart0_grp" };
2598c2ecf20Sopenharmony_cistatic const char * const sptlp_uart1_groups[] = { "uart1_grp" };
2608c2ecf20Sopenharmony_cistatic const char * const sptlp_uart2_groups[] = { "uart2_grp" };
2618c2ecf20Sopenharmony_cistatic const char * const sptlp_i2c0_groups[] = { "i2c0_grp" };
2628c2ecf20Sopenharmony_cistatic const char * const sptlp_i2c1_groups[] = { "i2c1_grp" };
2638c2ecf20Sopenharmony_cistatic const char * const sptlp_i2c2_groups[] = { "i2c2_grp" };
2648c2ecf20Sopenharmony_cistatic const char * const sptlp_i2c3_groups[] = { "i2c3_grp" };
2658c2ecf20Sopenharmony_cistatic const char * const sptlp_i2c4_groups[] = { "i2c4_grp", "i2c4b_grp" };
2668c2ecf20Sopenharmony_cistatic const char * const sptlp_i2c5_groups[] = { "i2c5_grp" };
2678c2ecf20Sopenharmony_cistatic const char * const sptlp_ssp2_groups[] = { "ssp2_grp" };
2688c2ecf20Sopenharmony_cistatic const char * const sptlp_emmc_groups[] = { "emmc_grp" };
2698c2ecf20Sopenharmony_cistatic const char * const sptlp_sd_groups[] = { "sd_grp" };
2708c2ecf20Sopenharmony_ci
2718c2ecf20Sopenharmony_cistatic const struct intel_function sptlp_functions[] = {
2728c2ecf20Sopenharmony_ci	FUNCTION("spi0", sptlp_spi0_groups),
2738c2ecf20Sopenharmony_ci	FUNCTION("spi1", sptlp_spi1_groups),
2748c2ecf20Sopenharmony_ci	FUNCTION("uart0", sptlp_uart0_groups),
2758c2ecf20Sopenharmony_ci	FUNCTION("uart1", sptlp_uart1_groups),
2768c2ecf20Sopenharmony_ci	FUNCTION("uart2", sptlp_uart2_groups),
2778c2ecf20Sopenharmony_ci	FUNCTION("i2c0", sptlp_i2c0_groups),
2788c2ecf20Sopenharmony_ci	FUNCTION("i2c1", sptlp_i2c1_groups),
2798c2ecf20Sopenharmony_ci	FUNCTION("i2c2", sptlp_i2c2_groups),
2808c2ecf20Sopenharmony_ci	FUNCTION("i2c3", sptlp_i2c3_groups),
2818c2ecf20Sopenharmony_ci	FUNCTION("i2c4", sptlp_i2c4_groups),
2828c2ecf20Sopenharmony_ci	FUNCTION("i2c5", sptlp_i2c5_groups),
2838c2ecf20Sopenharmony_ci	FUNCTION("ssp2", sptlp_ssp2_groups),
2848c2ecf20Sopenharmony_ci	FUNCTION("emmc", sptlp_emmc_groups),
2858c2ecf20Sopenharmony_ci	FUNCTION("sd", sptlp_sd_groups),
2868c2ecf20Sopenharmony_ci};
2878c2ecf20Sopenharmony_ci
2888c2ecf20Sopenharmony_cistatic const struct intel_community sptlp_communities[] = {
2898c2ecf20Sopenharmony_ci	SPT_LP_COMMUNITY(0, 0, 47),
2908c2ecf20Sopenharmony_ci	SPT_LP_COMMUNITY(1, 48, 119),
2918c2ecf20Sopenharmony_ci	SPT_LP_COMMUNITY(2, 120, 151),
2928c2ecf20Sopenharmony_ci};
2938c2ecf20Sopenharmony_ci
2948c2ecf20Sopenharmony_cistatic const struct intel_pinctrl_soc_data sptlp_soc_data = {
2958c2ecf20Sopenharmony_ci	.pins = sptlp_pins,
2968c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(sptlp_pins),
2978c2ecf20Sopenharmony_ci	.groups = sptlp_groups,
2988c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(sptlp_groups),
2998c2ecf20Sopenharmony_ci	.functions = sptlp_functions,
3008c2ecf20Sopenharmony_ci	.nfunctions = ARRAY_SIZE(sptlp_functions),
3018c2ecf20Sopenharmony_ci	.communities = sptlp_communities,
3028c2ecf20Sopenharmony_ci	.ncommunities = ARRAY_SIZE(sptlp_communities),
3038c2ecf20Sopenharmony_ci};
3048c2ecf20Sopenharmony_ci
3058c2ecf20Sopenharmony_ci/* Sunrisepoint-H */
3068c2ecf20Sopenharmony_cistatic const struct pinctrl_pin_desc spth_pins[] = {
3078c2ecf20Sopenharmony_ci	/* GPP_A */
3088c2ecf20Sopenharmony_ci	PINCTRL_PIN(0, "RCINB"),
3098c2ecf20Sopenharmony_ci	PINCTRL_PIN(1, "LAD_0"),
3108c2ecf20Sopenharmony_ci	PINCTRL_PIN(2, "LAD_1"),
3118c2ecf20Sopenharmony_ci	PINCTRL_PIN(3, "LAD_2"),
3128c2ecf20Sopenharmony_ci	PINCTRL_PIN(4, "LAD_3"),
3138c2ecf20Sopenharmony_ci	PINCTRL_PIN(5, "LFRAMEB"),
3148c2ecf20Sopenharmony_ci	PINCTRL_PIN(6, "SERIQ"),
3158c2ecf20Sopenharmony_ci	PINCTRL_PIN(7, "PIRQAB"),
3168c2ecf20Sopenharmony_ci	PINCTRL_PIN(8, "CLKRUNB"),
3178c2ecf20Sopenharmony_ci	PINCTRL_PIN(9, "CLKOUT_LPC_0"),
3188c2ecf20Sopenharmony_ci	PINCTRL_PIN(10, "CLKOUT_LPC_1"),
3198c2ecf20Sopenharmony_ci	PINCTRL_PIN(11, "PMEB"),
3208c2ecf20Sopenharmony_ci	PINCTRL_PIN(12, "BM_BUSYB"),
3218c2ecf20Sopenharmony_ci	PINCTRL_PIN(13, "SUSWARNB_SUS_PWRDNACK"),
3228c2ecf20Sopenharmony_ci	PINCTRL_PIN(14, "SUS_STATB"),
3238c2ecf20Sopenharmony_ci	PINCTRL_PIN(15, "SUSACKB"),
3248c2ecf20Sopenharmony_ci	PINCTRL_PIN(16, "CLKOUT_48"),
3258c2ecf20Sopenharmony_ci	PINCTRL_PIN(17, "ISH_GP_7"),
3268c2ecf20Sopenharmony_ci	PINCTRL_PIN(18, "ISH_GP_0"),
3278c2ecf20Sopenharmony_ci	PINCTRL_PIN(19, "ISH_GP_1"),
3288c2ecf20Sopenharmony_ci	PINCTRL_PIN(20, "ISH_GP_2"),
3298c2ecf20Sopenharmony_ci	PINCTRL_PIN(21, "ISH_GP_3"),
3308c2ecf20Sopenharmony_ci	PINCTRL_PIN(22, "ISH_GP_4"),
3318c2ecf20Sopenharmony_ci	PINCTRL_PIN(23, "ISH_GP_5"),
3328c2ecf20Sopenharmony_ci	/* GPP_B */
3338c2ecf20Sopenharmony_ci	PINCTRL_PIN(24, "CORE_VID_0"),
3348c2ecf20Sopenharmony_ci	PINCTRL_PIN(25, "CORE_VID_1"),
3358c2ecf20Sopenharmony_ci	PINCTRL_PIN(26, "VRALERTB"),
3368c2ecf20Sopenharmony_ci	PINCTRL_PIN(27, "CPU_GP_2"),
3378c2ecf20Sopenharmony_ci	PINCTRL_PIN(28, "CPU_GP_3"),
3388c2ecf20Sopenharmony_ci	PINCTRL_PIN(29, "SRCCLKREQB_0"),
3398c2ecf20Sopenharmony_ci	PINCTRL_PIN(30, "SRCCLKREQB_1"),
3408c2ecf20Sopenharmony_ci	PINCTRL_PIN(31, "SRCCLKREQB_2"),
3418c2ecf20Sopenharmony_ci	PINCTRL_PIN(32, "SRCCLKREQB_3"),
3428c2ecf20Sopenharmony_ci	PINCTRL_PIN(33, "SRCCLKREQB_4"),
3438c2ecf20Sopenharmony_ci	PINCTRL_PIN(34, "SRCCLKREQB_5"),
3448c2ecf20Sopenharmony_ci	PINCTRL_PIN(35, "EXT_PWR_GATEB"),
3458c2ecf20Sopenharmony_ci	PINCTRL_PIN(36, "SLP_S0B"),
3468c2ecf20Sopenharmony_ci	PINCTRL_PIN(37, "PLTRSTB"),
3478c2ecf20Sopenharmony_ci	PINCTRL_PIN(38, "SPKR"),
3488c2ecf20Sopenharmony_ci	PINCTRL_PIN(39, "GSPI0_CSB"),
3498c2ecf20Sopenharmony_ci	PINCTRL_PIN(40, "GSPI0_CLK"),
3508c2ecf20Sopenharmony_ci	PINCTRL_PIN(41, "GSPI0_MISO"),
3518c2ecf20Sopenharmony_ci	PINCTRL_PIN(42, "GSPI0_MOSI"),
3528c2ecf20Sopenharmony_ci	PINCTRL_PIN(43, "GSPI1_CSB"),
3538c2ecf20Sopenharmony_ci	PINCTRL_PIN(44, "GSPI1_CLK"),
3548c2ecf20Sopenharmony_ci	PINCTRL_PIN(45, "GSPI1_MISO"),
3558c2ecf20Sopenharmony_ci	PINCTRL_PIN(46, "GSPI1_MOSI"),
3568c2ecf20Sopenharmony_ci	PINCTRL_PIN(47, "SML1ALERTB"),
3578c2ecf20Sopenharmony_ci	/* GPP_C */
3588c2ecf20Sopenharmony_ci	PINCTRL_PIN(48, "SMBCLK"),
3598c2ecf20Sopenharmony_ci	PINCTRL_PIN(49, "SMBDATA"),
3608c2ecf20Sopenharmony_ci	PINCTRL_PIN(50, "SMBALERTB"),
3618c2ecf20Sopenharmony_ci	PINCTRL_PIN(51, "SML0CLK"),
3628c2ecf20Sopenharmony_ci	PINCTRL_PIN(52, "SML0DATA"),
3638c2ecf20Sopenharmony_ci	PINCTRL_PIN(53, "SML0ALERTB"),
3648c2ecf20Sopenharmony_ci	PINCTRL_PIN(54, "SML1CLK"),
3658c2ecf20Sopenharmony_ci	PINCTRL_PIN(55, "SML1DATA"),
3668c2ecf20Sopenharmony_ci	PINCTRL_PIN(56, "UART0_RXD"),
3678c2ecf20Sopenharmony_ci	PINCTRL_PIN(57, "UART0_TXD"),
3688c2ecf20Sopenharmony_ci	PINCTRL_PIN(58, "UART0_RTSB"),
3698c2ecf20Sopenharmony_ci	PINCTRL_PIN(59, "UART0_CTSB"),
3708c2ecf20Sopenharmony_ci	PINCTRL_PIN(60, "UART1_RXD"),
3718c2ecf20Sopenharmony_ci	PINCTRL_PIN(61, "UART1_TXD"),
3728c2ecf20Sopenharmony_ci	PINCTRL_PIN(62, "UART1_RTSB"),
3738c2ecf20Sopenharmony_ci	PINCTRL_PIN(63, "UART1_CTSB"),
3748c2ecf20Sopenharmony_ci	PINCTRL_PIN(64, "I2C0_SDA"),
3758c2ecf20Sopenharmony_ci	PINCTRL_PIN(65, "I2C0_SCL"),
3768c2ecf20Sopenharmony_ci	PINCTRL_PIN(66, "I2C1_SDA"),
3778c2ecf20Sopenharmony_ci	PINCTRL_PIN(67, "I2C1_SCL"),
3788c2ecf20Sopenharmony_ci	PINCTRL_PIN(68, "UART2_RXD"),
3798c2ecf20Sopenharmony_ci	PINCTRL_PIN(69, "UART2_TXD"),
3808c2ecf20Sopenharmony_ci	PINCTRL_PIN(70, "UART2_RTSB"),
3818c2ecf20Sopenharmony_ci	PINCTRL_PIN(71, "UART2_CTSB"),
3828c2ecf20Sopenharmony_ci	/* GPP_D */
3838c2ecf20Sopenharmony_ci	PINCTRL_PIN(72, "SPI1_CSB"),
3848c2ecf20Sopenharmony_ci	PINCTRL_PIN(73, "SPI1_CLK"),
3858c2ecf20Sopenharmony_ci	PINCTRL_PIN(74, "SPI1_MISO_IO_1"),
3868c2ecf20Sopenharmony_ci	PINCTRL_PIN(75, "SPI1_MOSI_IO_0"),
3878c2ecf20Sopenharmony_ci	PINCTRL_PIN(76, "ISH_I2C2_SDA"),
3888c2ecf20Sopenharmony_ci	PINCTRL_PIN(77, "SSP0_SFRM"),
3898c2ecf20Sopenharmony_ci	PINCTRL_PIN(78, "SSP0_TXD"),
3908c2ecf20Sopenharmony_ci	PINCTRL_PIN(79, "SSP0_RXD"),
3918c2ecf20Sopenharmony_ci	PINCTRL_PIN(80, "SSP0_SCLK"),
3928c2ecf20Sopenharmony_ci	PINCTRL_PIN(81, "ISH_SPI_CSB"),
3938c2ecf20Sopenharmony_ci	PINCTRL_PIN(82, "ISH_SPI_CLK"),
3948c2ecf20Sopenharmony_ci	PINCTRL_PIN(83, "ISH_SPI_MISO"),
3958c2ecf20Sopenharmony_ci	PINCTRL_PIN(84, "ISH_SPI_MOSI"),
3968c2ecf20Sopenharmony_ci	PINCTRL_PIN(85, "ISH_UART0_RXD"),
3978c2ecf20Sopenharmony_ci	PINCTRL_PIN(86, "ISH_UART0_TXD"),
3988c2ecf20Sopenharmony_ci	PINCTRL_PIN(87, "ISH_UART0_RTSB"),
3998c2ecf20Sopenharmony_ci	PINCTRL_PIN(88, "ISH_UART0_CTSB"),
4008c2ecf20Sopenharmony_ci	PINCTRL_PIN(89, "DMIC_CLK_1"),
4018c2ecf20Sopenharmony_ci	PINCTRL_PIN(90, "DMIC_DATA_1"),
4028c2ecf20Sopenharmony_ci	PINCTRL_PIN(91, "DMIC_CLK_0"),
4038c2ecf20Sopenharmony_ci	PINCTRL_PIN(92, "DMIC_DATA_0"),
4048c2ecf20Sopenharmony_ci	PINCTRL_PIN(93, "SPI1_IO_2"),
4058c2ecf20Sopenharmony_ci	PINCTRL_PIN(94, "SPI1_IO_3"),
4068c2ecf20Sopenharmony_ci	PINCTRL_PIN(95, "ISH_I2C2_SCL"),
4078c2ecf20Sopenharmony_ci	/* GPP_E */
4088c2ecf20Sopenharmony_ci	PINCTRL_PIN(96, "SATAXPCIE_0"),
4098c2ecf20Sopenharmony_ci	PINCTRL_PIN(97, "SATAXPCIE_1"),
4108c2ecf20Sopenharmony_ci	PINCTRL_PIN(98, "SATAXPCIE_2"),
4118c2ecf20Sopenharmony_ci	PINCTRL_PIN(99, "CPU_GP_0"),
4128c2ecf20Sopenharmony_ci	PINCTRL_PIN(100, "SATA_DEVSLP_0"),
4138c2ecf20Sopenharmony_ci	PINCTRL_PIN(101, "SATA_DEVSLP_1"),
4148c2ecf20Sopenharmony_ci	PINCTRL_PIN(102, "SATA_DEVSLP_2"),
4158c2ecf20Sopenharmony_ci	PINCTRL_PIN(103, "CPU_GP_1"),
4168c2ecf20Sopenharmony_ci	PINCTRL_PIN(104, "SATA_LEDB"),
4178c2ecf20Sopenharmony_ci	PINCTRL_PIN(105, "USB2_OCB_0"),
4188c2ecf20Sopenharmony_ci	PINCTRL_PIN(106, "USB2_OCB_1"),
4198c2ecf20Sopenharmony_ci	PINCTRL_PIN(107, "USB2_OCB_2"),
4208c2ecf20Sopenharmony_ci	PINCTRL_PIN(108, "USB2_OCB_3"),
4218c2ecf20Sopenharmony_ci	/* GPP_F */
4228c2ecf20Sopenharmony_ci	PINCTRL_PIN(109, "SATAXPCIE_3"),
4238c2ecf20Sopenharmony_ci	PINCTRL_PIN(110, "SATAXPCIE_4"),
4248c2ecf20Sopenharmony_ci	PINCTRL_PIN(111, "SATAXPCIE_5"),
4258c2ecf20Sopenharmony_ci	PINCTRL_PIN(112, "SATAXPCIE_6"),
4268c2ecf20Sopenharmony_ci	PINCTRL_PIN(113, "SATAXPCIE_7"),
4278c2ecf20Sopenharmony_ci	PINCTRL_PIN(114, "SATA_DEVSLP_3"),
4288c2ecf20Sopenharmony_ci	PINCTRL_PIN(115, "SATA_DEVSLP_4"),
4298c2ecf20Sopenharmony_ci	PINCTRL_PIN(116, "SATA_DEVSLP_5"),
4308c2ecf20Sopenharmony_ci	PINCTRL_PIN(117, "SATA_DEVSLP_6"),
4318c2ecf20Sopenharmony_ci	PINCTRL_PIN(118, "SATA_DEVSLP_7"),
4328c2ecf20Sopenharmony_ci	PINCTRL_PIN(119, "SATA_SCLOCK"),
4338c2ecf20Sopenharmony_ci	PINCTRL_PIN(120, "SATA_SLOAD"),
4348c2ecf20Sopenharmony_ci	PINCTRL_PIN(121, "SATA_SDATAOUT1"),
4358c2ecf20Sopenharmony_ci	PINCTRL_PIN(122, "SATA_SDATAOUT0"),
4368c2ecf20Sopenharmony_ci	PINCTRL_PIN(123, "GPP_F_14"),
4378c2ecf20Sopenharmony_ci	PINCTRL_PIN(124, "USB_OCB_4"),
4388c2ecf20Sopenharmony_ci	PINCTRL_PIN(125, "USB_OCB_5"),
4398c2ecf20Sopenharmony_ci	PINCTRL_PIN(126, "USB_OCB_6"),
4408c2ecf20Sopenharmony_ci	PINCTRL_PIN(127, "USB_OCB_7"),
4418c2ecf20Sopenharmony_ci	PINCTRL_PIN(128, "L_VDDEN"),
4428c2ecf20Sopenharmony_ci	PINCTRL_PIN(129, "L_BKLTEN"),
4438c2ecf20Sopenharmony_ci	PINCTRL_PIN(130, "L_BKLTCTL"),
4448c2ecf20Sopenharmony_ci	PINCTRL_PIN(131, "GPP_F_22"),
4458c2ecf20Sopenharmony_ci	PINCTRL_PIN(132, "GPP_F_23"),
4468c2ecf20Sopenharmony_ci	/* GPP_G */
4478c2ecf20Sopenharmony_ci	PINCTRL_PIN(133, "FAN_TACH_0"),
4488c2ecf20Sopenharmony_ci	PINCTRL_PIN(134, "FAN_TACH_1"),
4498c2ecf20Sopenharmony_ci	PINCTRL_PIN(135, "FAN_TACH_2"),
4508c2ecf20Sopenharmony_ci	PINCTRL_PIN(136, "FAN_TACH_3"),
4518c2ecf20Sopenharmony_ci	PINCTRL_PIN(137, "FAN_TACH_4"),
4528c2ecf20Sopenharmony_ci	PINCTRL_PIN(138, "FAN_TACH_5"),
4538c2ecf20Sopenharmony_ci	PINCTRL_PIN(139, "FAN_TACH_6"),
4548c2ecf20Sopenharmony_ci	PINCTRL_PIN(140, "FAN_TACH_7"),
4558c2ecf20Sopenharmony_ci	PINCTRL_PIN(141, "FAN_PWM_0"),
4568c2ecf20Sopenharmony_ci	PINCTRL_PIN(142, "FAN_PWM_1"),
4578c2ecf20Sopenharmony_ci	PINCTRL_PIN(143, "FAN_PWM_2"),
4588c2ecf20Sopenharmony_ci	PINCTRL_PIN(144, "FAN_PWM_3"),
4598c2ecf20Sopenharmony_ci	PINCTRL_PIN(145, "GSXDOUT"),
4608c2ecf20Sopenharmony_ci	PINCTRL_PIN(146, "GSXSLOAD"),
4618c2ecf20Sopenharmony_ci	PINCTRL_PIN(147, "GSXDIN"),
4628c2ecf20Sopenharmony_ci	PINCTRL_PIN(148, "GSXRESETB"),
4638c2ecf20Sopenharmony_ci	PINCTRL_PIN(149, "GSXCLK"),
4648c2ecf20Sopenharmony_ci	PINCTRL_PIN(150, "ADR_COMPLETE"),
4658c2ecf20Sopenharmony_ci	PINCTRL_PIN(151, "NMIB"),
4668c2ecf20Sopenharmony_ci	PINCTRL_PIN(152, "SMIB"),
4678c2ecf20Sopenharmony_ci	PINCTRL_PIN(153, "GPP_G_20"),
4688c2ecf20Sopenharmony_ci	PINCTRL_PIN(154, "GPP_G_21"),
4698c2ecf20Sopenharmony_ci	PINCTRL_PIN(155, "GPP_G_22"),
4708c2ecf20Sopenharmony_ci	PINCTRL_PIN(156, "GPP_G_23"),
4718c2ecf20Sopenharmony_ci	/* GPP_H */
4728c2ecf20Sopenharmony_ci	PINCTRL_PIN(157, "SRCCLKREQB_6"),
4738c2ecf20Sopenharmony_ci	PINCTRL_PIN(158, "SRCCLKREQB_7"),
4748c2ecf20Sopenharmony_ci	PINCTRL_PIN(159, "SRCCLKREQB_8"),
4758c2ecf20Sopenharmony_ci	PINCTRL_PIN(160, "SRCCLKREQB_9"),
4768c2ecf20Sopenharmony_ci	PINCTRL_PIN(161, "SRCCLKREQB_10"),
4778c2ecf20Sopenharmony_ci	PINCTRL_PIN(162, "SRCCLKREQB_11"),
4788c2ecf20Sopenharmony_ci	PINCTRL_PIN(163, "SRCCLKREQB_12"),
4798c2ecf20Sopenharmony_ci	PINCTRL_PIN(164, "SRCCLKREQB_13"),
4808c2ecf20Sopenharmony_ci	PINCTRL_PIN(165, "SRCCLKREQB_14"),
4818c2ecf20Sopenharmony_ci	PINCTRL_PIN(166, "SRCCLKREQB_15"),
4828c2ecf20Sopenharmony_ci	PINCTRL_PIN(167, "SML2CLK"),
4838c2ecf20Sopenharmony_ci	PINCTRL_PIN(168, "SML2DATA"),
4848c2ecf20Sopenharmony_ci	PINCTRL_PIN(169, "SML2ALERTB"),
4858c2ecf20Sopenharmony_ci	PINCTRL_PIN(170, "SML3CLK"),
4868c2ecf20Sopenharmony_ci	PINCTRL_PIN(171, "SML3DATA"),
4878c2ecf20Sopenharmony_ci	PINCTRL_PIN(172, "SML3ALERTB"),
4888c2ecf20Sopenharmony_ci	PINCTRL_PIN(173, "SML4CLK"),
4898c2ecf20Sopenharmony_ci	PINCTRL_PIN(174, "SML4DATA"),
4908c2ecf20Sopenharmony_ci	PINCTRL_PIN(175, "SML4ALERTB"),
4918c2ecf20Sopenharmony_ci	PINCTRL_PIN(176, "ISH_I2C0_SDA"),
4928c2ecf20Sopenharmony_ci	PINCTRL_PIN(177, "ISH_I2C0_SCL"),
4938c2ecf20Sopenharmony_ci	PINCTRL_PIN(178, "ISH_I2C1_SDA"),
4948c2ecf20Sopenharmony_ci	PINCTRL_PIN(179, "ISH_I2C1_SCL"),
4958c2ecf20Sopenharmony_ci	PINCTRL_PIN(180, "GPP_H_23"),
4968c2ecf20Sopenharmony_ci	/* GPP_I */
4978c2ecf20Sopenharmony_ci	PINCTRL_PIN(181, "DDSP_HDP_0"),
4988c2ecf20Sopenharmony_ci	PINCTRL_PIN(182, "DDSP_HDP_1"),
4998c2ecf20Sopenharmony_ci	PINCTRL_PIN(183, "DDSP_HDP_2"),
5008c2ecf20Sopenharmony_ci	PINCTRL_PIN(184, "DDSP_HDP_3"),
5018c2ecf20Sopenharmony_ci	PINCTRL_PIN(185, "EDP_HPD"),
5028c2ecf20Sopenharmony_ci	PINCTRL_PIN(186, "DDPB_CTRLCLK"),
5038c2ecf20Sopenharmony_ci	PINCTRL_PIN(187, "DDPB_CTRLDATA"),
5048c2ecf20Sopenharmony_ci	PINCTRL_PIN(188, "DDPC_CTRLCLK"),
5058c2ecf20Sopenharmony_ci	PINCTRL_PIN(189, "DDPC_CTRLDATA"),
5068c2ecf20Sopenharmony_ci	PINCTRL_PIN(190, "DDPD_CTRLCLK"),
5078c2ecf20Sopenharmony_ci	PINCTRL_PIN(191, "DDPD_CTRLDATA"),
5088c2ecf20Sopenharmony_ci};
5098c2ecf20Sopenharmony_ci
5108c2ecf20Sopenharmony_cistatic const unsigned spth_spi0_pins[] = { 39, 40, 41, 42 };
5118c2ecf20Sopenharmony_cistatic const unsigned spth_spi1_pins[] = { 43, 44, 45, 46 };
5128c2ecf20Sopenharmony_cistatic const unsigned spth_uart0_pins[] = { 56, 57, 58, 59 };
5138c2ecf20Sopenharmony_cistatic const unsigned spth_uart1_pins[] = { 60, 61, 62, 63 };
5148c2ecf20Sopenharmony_cistatic const unsigned spth_uart2_pins[] = { 68, 69, 71, 71 };
5158c2ecf20Sopenharmony_cistatic const unsigned spth_i2c0_pins[] = { 64, 65 };
5168c2ecf20Sopenharmony_cistatic const unsigned spth_i2c1_pins[] = { 66, 67 };
5178c2ecf20Sopenharmony_cistatic const unsigned spth_i2c2_pins[] = { 76, 95 };
5188c2ecf20Sopenharmony_ci
5198c2ecf20Sopenharmony_cistatic const struct intel_pingroup spth_groups[] = {
5208c2ecf20Sopenharmony_ci	PIN_GROUP("spi0_grp", spth_spi0_pins, 1),
5218c2ecf20Sopenharmony_ci	PIN_GROUP("spi1_grp", spth_spi1_pins, 1),
5228c2ecf20Sopenharmony_ci	PIN_GROUP("uart0_grp", spth_uart0_pins, 1),
5238c2ecf20Sopenharmony_ci	PIN_GROUP("uart1_grp", spth_uart1_pins, 1),
5248c2ecf20Sopenharmony_ci	PIN_GROUP("uart2_grp", spth_uart2_pins, 1),
5258c2ecf20Sopenharmony_ci	PIN_GROUP("i2c0_grp", spth_i2c0_pins, 1),
5268c2ecf20Sopenharmony_ci	PIN_GROUP("i2c1_grp", spth_i2c1_pins, 1),
5278c2ecf20Sopenharmony_ci	PIN_GROUP("i2c2_grp", spth_i2c2_pins, 2),
5288c2ecf20Sopenharmony_ci};
5298c2ecf20Sopenharmony_ci
5308c2ecf20Sopenharmony_cistatic const char * const spth_spi0_groups[] = { "spi0_grp" };
5318c2ecf20Sopenharmony_cistatic const char * const spth_spi1_groups[] = { "spi0_grp" };
5328c2ecf20Sopenharmony_cistatic const char * const spth_uart0_groups[] = { "uart0_grp" };
5338c2ecf20Sopenharmony_cistatic const char * const spth_uart1_groups[] = { "uart1_grp" };
5348c2ecf20Sopenharmony_cistatic const char * const spth_uart2_groups[] = { "uart2_grp" };
5358c2ecf20Sopenharmony_cistatic const char * const spth_i2c0_groups[] = { "i2c0_grp" };
5368c2ecf20Sopenharmony_cistatic const char * const spth_i2c1_groups[] = { "i2c1_grp" };
5378c2ecf20Sopenharmony_cistatic const char * const spth_i2c2_groups[] = { "i2c2_grp" };
5388c2ecf20Sopenharmony_ci
5398c2ecf20Sopenharmony_cistatic const struct intel_function spth_functions[] = {
5408c2ecf20Sopenharmony_ci	FUNCTION("spi0", spth_spi0_groups),
5418c2ecf20Sopenharmony_ci	FUNCTION("spi1", spth_spi1_groups),
5428c2ecf20Sopenharmony_ci	FUNCTION("uart0", spth_uart0_groups),
5438c2ecf20Sopenharmony_ci	FUNCTION("uart1", spth_uart1_groups),
5448c2ecf20Sopenharmony_ci	FUNCTION("uart2", spth_uart2_groups),
5458c2ecf20Sopenharmony_ci	FUNCTION("i2c0", spth_i2c0_groups),
5468c2ecf20Sopenharmony_ci	FUNCTION("i2c1", spth_i2c1_groups),
5478c2ecf20Sopenharmony_ci	FUNCTION("i2c2", spth_i2c2_groups),
5488c2ecf20Sopenharmony_ci};
5498c2ecf20Sopenharmony_ci
5508c2ecf20Sopenharmony_cistatic const struct intel_padgroup spth_community0_gpps[] = {
5518c2ecf20Sopenharmony_ci	SPT_H_GPP(0, 0, 23, 0),		/* GPP_A */
5528c2ecf20Sopenharmony_ci	SPT_H_GPP(1, 24, 47, 24),	/* GPP_B */
5538c2ecf20Sopenharmony_ci};
5548c2ecf20Sopenharmony_ci
5558c2ecf20Sopenharmony_cistatic const struct intel_padgroup spth_community1_gpps[] = {
5568c2ecf20Sopenharmony_ci	SPT_H_GPP(0, 48, 71, 48),	/* GPP_C */
5578c2ecf20Sopenharmony_ci	SPT_H_GPP(1, 72, 95, 72),	/* GPP_D */
5588c2ecf20Sopenharmony_ci	SPT_H_GPP(2, 96, 108, 96),	/* GPP_E */
5598c2ecf20Sopenharmony_ci	SPT_H_GPP(3, 109, 132, 120),	/* GPP_F */
5608c2ecf20Sopenharmony_ci	SPT_H_GPP(4, 133, 156, 144),	/* GPP_G */
5618c2ecf20Sopenharmony_ci	SPT_H_GPP(5, 157, 180, 168),	/* GPP_H */
5628c2ecf20Sopenharmony_ci};
5638c2ecf20Sopenharmony_ci
5648c2ecf20Sopenharmony_cistatic const struct intel_padgroup spth_community3_gpps[] = {
5658c2ecf20Sopenharmony_ci	SPT_H_GPP(0, 181, 191, 192),	/* GPP_I */
5668c2ecf20Sopenharmony_ci};
5678c2ecf20Sopenharmony_ci
5688c2ecf20Sopenharmony_cistatic const struct intel_community spth_communities[] = {
5698c2ecf20Sopenharmony_ci	SPT_H_COMMUNITY(0, 0, 47, spth_community0_gpps),
5708c2ecf20Sopenharmony_ci	SPT_H_COMMUNITY(1, 48, 180, spth_community1_gpps),
5718c2ecf20Sopenharmony_ci	SPT_H_COMMUNITY(2, 181, 191, spth_community3_gpps),
5728c2ecf20Sopenharmony_ci};
5738c2ecf20Sopenharmony_ci
5748c2ecf20Sopenharmony_cistatic const struct intel_pinctrl_soc_data spth_soc_data = {
5758c2ecf20Sopenharmony_ci	.pins = spth_pins,
5768c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(spth_pins),
5778c2ecf20Sopenharmony_ci	.groups = spth_groups,
5788c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(spth_groups),
5798c2ecf20Sopenharmony_ci	.functions = spth_functions,
5808c2ecf20Sopenharmony_ci	.nfunctions = ARRAY_SIZE(spth_functions),
5818c2ecf20Sopenharmony_ci	.communities = spth_communities,
5828c2ecf20Sopenharmony_ci	.ncommunities = ARRAY_SIZE(spth_communities),
5838c2ecf20Sopenharmony_ci};
5848c2ecf20Sopenharmony_ci
5858c2ecf20Sopenharmony_cistatic const struct acpi_device_id spt_pinctrl_acpi_match[] = {
5868c2ecf20Sopenharmony_ci	{ "INT344B", (kernel_ulong_t)&sptlp_soc_data },
5878c2ecf20Sopenharmony_ci	{ "INT3451", (kernel_ulong_t)&spth_soc_data },
5888c2ecf20Sopenharmony_ci	{ "INT345D", (kernel_ulong_t)&spth_soc_data },
5898c2ecf20Sopenharmony_ci	{ }
5908c2ecf20Sopenharmony_ci};
5918c2ecf20Sopenharmony_ciMODULE_DEVICE_TABLE(acpi, spt_pinctrl_acpi_match);
5928c2ecf20Sopenharmony_ci
5938c2ecf20Sopenharmony_cistatic INTEL_PINCTRL_PM_OPS(spt_pinctrl_pm_ops);
5948c2ecf20Sopenharmony_ci
5958c2ecf20Sopenharmony_cistatic struct platform_driver spt_pinctrl_driver = {
5968c2ecf20Sopenharmony_ci	.probe = intel_pinctrl_probe_by_hid,
5978c2ecf20Sopenharmony_ci	.driver = {
5988c2ecf20Sopenharmony_ci		.name = "sunrisepoint-pinctrl",
5998c2ecf20Sopenharmony_ci		.acpi_match_table = spt_pinctrl_acpi_match,
6008c2ecf20Sopenharmony_ci		.pm = &spt_pinctrl_pm_ops,
6018c2ecf20Sopenharmony_ci	},
6028c2ecf20Sopenharmony_ci};
6038c2ecf20Sopenharmony_ci
6048c2ecf20Sopenharmony_cistatic int __init spt_pinctrl_init(void)
6058c2ecf20Sopenharmony_ci{
6068c2ecf20Sopenharmony_ci	return platform_driver_register(&spt_pinctrl_driver);
6078c2ecf20Sopenharmony_ci}
6088c2ecf20Sopenharmony_cisubsys_initcall(spt_pinctrl_init);
6098c2ecf20Sopenharmony_ci
6108c2ecf20Sopenharmony_cistatic void __exit spt_pinctrl_exit(void)
6118c2ecf20Sopenharmony_ci{
6128c2ecf20Sopenharmony_ci	platform_driver_unregister(&spt_pinctrl_driver);
6138c2ecf20Sopenharmony_ci}
6148c2ecf20Sopenharmony_cimodule_exit(spt_pinctrl_exit);
6158c2ecf20Sopenharmony_ci
6168c2ecf20Sopenharmony_ciMODULE_AUTHOR("Mathias Nyman <mathias.nyman@linux.intel.com>");
6178c2ecf20Sopenharmony_ciMODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>");
6188c2ecf20Sopenharmony_ciMODULE_DESCRIPTION("Intel Sunrisepoint PCH pinctrl/GPIO driver");
6198c2ecf20Sopenharmony_ciMODULE_LICENSE("GPL v2");
620