162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Intel Sunrisepoint PCH pinctrl/GPIO driver
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Copyright (C) 2015, Intel Corporation
662306a36Sopenharmony_ci * Authors: Mathias Nyman <mathias.nyman@linux.intel.com>
762306a36Sopenharmony_ci *          Mika Westerberg <mika.westerberg@linux.intel.com>
862306a36Sopenharmony_ci */
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci#include <linux/mod_devicetable.h>
1162306a36Sopenharmony_ci#include <linux/module.h>
1262306a36Sopenharmony_ci#include <linux/platform_device.h>
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci#include <linux/pinctrl/pinctrl.h>
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ci#include "pinctrl-intel.h"
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci#define SPT_H_PAD_OWN		0x020
1962306a36Sopenharmony_ci#define SPT_H_PADCFGLOCK	0x090
2062306a36Sopenharmony_ci#define SPT_H_HOSTSW_OWN	0x0d0
2162306a36Sopenharmony_ci#define SPT_H_GPI_IS		0x100
2262306a36Sopenharmony_ci#define SPT_H_GPI_IE		0x120
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci#define SPT_LP_PAD_OWN		0x020
2562306a36Sopenharmony_ci#define SPT_LP_PADCFGLOCK	0x0a0
2662306a36Sopenharmony_ci#define SPT_LP_HOSTSW_OWN	0x0d0
2762306a36Sopenharmony_ci#define SPT_LP_GPI_IS		0x100
2862306a36Sopenharmony_ci#define SPT_LP_GPI_IE		0x120
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci#define SPT_H_GPP(r, s, e, g)				\
3162306a36Sopenharmony_ci	{						\
3262306a36Sopenharmony_ci		.reg_num = (r),				\
3362306a36Sopenharmony_ci		.base = (s),				\
3462306a36Sopenharmony_ci		.size = ((e) - (s) + 1),		\
3562306a36Sopenharmony_ci		.gpio_base = (g),			\
3662306a36Sopenharmony_ci	}
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ci#define SPT_H_COMMUNITY(b, s, e, g)			\
3962306a36Sopenharmony_ci	INTEL_COMMUNITY_GPPS(b, s, e, g, SPT_H)
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci#define SPT_LP_COMMUNITY(b, s, e)			\
4262306a36Sopenharmony_ci	INTEL_COMMUNITY_SIZE(b, s, e, 24, 4, SPT_LP)
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ci/* Sunrisepoint-LP */
4562306a36Sopenharmony_cistatic const struct pinctrl_pin_desc sptlp_pins[] = {
4662306a36Sopenharmony_ci	/* GPP_A */
4762306a36Sopenharmony_ci	PINCTRL_PIN(0, "RCINB"),
4862306a36Sopenharmony_ci	PINCTRL_PIN(1, "LAD_0"),
4962306a36Sopenharmony_ci	PINCTRL_PIN(2, "LAD_1"),
5062306a36Sopenharmony_ci	PINCTRL_PIN(3, "LAD_2"),
5162306a36Sopenharmony_ci	PINCTRL_PIN(4, "LAD_3"),
5262306a36Sopenharmony_ci	PINCTRL_PIN(5, "LFRAMEB"),
5362306a36Sopenharmony_ci	PINCTRL_PIN(6, "SERIQ"),
5462306a36Sopenharmony_ci	PINCTRL_PIN(7, "PIRQAB"),
5562306a36Sopenharmony_ci	PINCTRL_PIN(8, "CLKRUNB"),
5662306a36Sopenharmony_ci	PINCTRL_PIN(9, "CLKOUT_LPC_0"),
5762306a36Sopenharmony_ci	PINCTRL_PIN(10, "CLKOUT_LPC_1"),
5862306a36Sopenharmony_ci	PINCTRL_PIN(11, "PMEB"),
5962306a36Sopenharmony_ci	PINCTRL_PIN(12, "BM_BUSYB"),
6062306a36Sopenharmony_ci	PINCTRL_PIN(13, "SUSWARNB_SUS_PWRDNACK"),
6162306a36Sopenharmony_ci	PINCTRL_PIN(14, "SUS_STATB"),
6262306a36Sopenharmony_ci	PINCTRL_PIN(15, "SUSACKB"),
6362306a36Sopenharmony_ci	PINCTRL_PIN(16, "SD_1P8_SEL"),
6462306a36Sopenharmony_ci	PINCTRL_PIN(17, "SD_PWR_EN_B"),
6562306a36Sopenharmony_ci	PINCTRL_PIN(18, "ISH_GP_0"),
6662306a36Sopenharmony_ci	PINCTRL_PIN(19, "ISH_GP_1"),
6762306a36Sopenharmony_ci	PINCTRL_PIN(20, "ISH_GP_2"),
6862306a36Sopenharmony_ci	PINCTRL_PIN(21, "ISH_GP_3"),
6962306a36Sopenharmony_ci	PINCTRL_PIN(22, "ISH_GP_4"),
7062306a36Sopenharmony_ci	PINCTRL_PIN(23, "ISH_GP_5"),
7162306a36Sopenharmony_ci	/* GPP_B */
7262306a36Sopenharmony_ci	PINCTRL_PIN(24, "CORE_VID_0"),
7362306a36Sopenharmony_ci	PINCTRL_PIN(25, "CORE_VID_1"),
7462306a36Sopenharmony_ci	PINCTRL_PIN(26, "VRALERTB"),
7562306a36Sopenharmony_ci	PINCTRL_PIN(27, "CPU_GP_2"),
7662306a36Sopenharmony_ci	PINCTRL_PIN(28, "CPU_GP_3"),
7762306a36Sopenharmony_ci	PINCTRL_PIN(29, "SRCCLKREQB_0"),
7862306a36Sopenharmony_ci	PINCTRL_PIN(30, "SRCCLKREQB_1"),
7962306a36Sopenharmony_ci	PINCTRL_PIN(31, "SRCCLKREQB_2"),
8062306a36Sopenharmony_ci	PINCTRL_PIN(32, "SRCCLKREQB_3"),
8162306a36Sopenharmony_ci	PINCTRL_PIN(33, "SRCCLKREQB_4"),
8262306a36Sopenharmony_ci	PINCTRL_PIN(34, "SRCCLKREQB_5"),
8362306a36Sopenharmony_ci	PINCTRL_PIN(35, "EXT_PWR_GATEB"),
8462306a36Sopenharmony_ci	PINCTRL_PIN(36, "SLP_S0B"),
8562306a36Sopenharmony_ci	PINCTRL_PIN(37, "PLTRSTB"),
8662306a36Sopenharmony_ci	PINCTRL_PIN(38, "SPKR"),
8762306a36Sopenharmony_ci	PINCTRL_PIN(39, "GSPI0_CSB"),
8862306a36Sopenharmony_ci	PINCTRL_PIN(40, "GSPI0_CLK"),
8962306a36Sopenharmony_ci	PINCTRL_PIN(41, "GSPI0_MISO"),
9062306a36Sopenharmony_ci	PINCTRL_PIN(42, "GSPI0_MOSI"),
9162306a36Sopenharmony_ci	PINCTRL_PIN(43, "GSPI1_CSB"),
9262306a36Sopenharmony_ci	PINCTRL_PIN(44, "GSPI1_CLK"),
9362306a36Sopenharmony_ci	PINCTRL_PIN(45, "GSPI1_MISO"),
9462306a36Sopenharmony_ci	PINCTRL_PIN(46, "GSPI1_MOSI"),
9562306a36Sopenharmony_ci	PINCTRL_PIN(47, "SML1ALERTB"),
9662306a36Sopenharmony_ci	/* GPP_C */
9762306a36Sopenharmony_ci	PINCTRL_PIN(48, "SMBCLK"),
9862306a36Sopenharmony_ci	PINCTRL_PIN(49, "SMBDATA"),
9962306a36Sopenharmony_ci	PINCTRL_PIN(50, "SMBALERTB"),
10062306a36Sopenharmony_ci	PINCTRL_PIN(51, "SML0CLK"),
10162306a36Sopenharmony_ci	PINCTRL_PIN(52, "SML0DATA"),
10262306a36Sopenharmony_ci	PINCTRL_PIN(53, "SML0ALERTB"),
10362306a36Sopenharmony_ci	PINCTRL_PIN(54, "SML1CLK"),
10462306a36Sopenharmony_ci	PINCTRL_PIN(55, "SML1DATA"),
10562306a36Sopenharmony_ci	PINCTRL_PIN(56, "UART0_RXD"),
10662306a36Sopenharmony_ci	PINCTRL_PIN(57, "UART0_TXD"),
10762306a36Sopenharmony_ci	PINCTRL_PIN(58, "UART0_RTSB"),
10862306a36Sopenharmony_ci	PINCTRL_PIN(59, "UART0_CTSB"),
10962306a36Sopenharmony_ci	PINCTRL_PIN(60, "UART1_RXD"),
11062306a36Sopenharmony_ci	PINCTRL_PIN(61, "UART1_TXD"),
11162306a36Sopenharmony_ci	PINCTRL_PIN(62, "UART1_RTSB"),
11262306a36Sopenharmony_ci	PINCTRL_PIN(63, "UART1_CTSB"),
11362306a36Sopenharmony_ci	PINCTRL_PIN(64, "I2C0_SDA"),
11462306a36Sopenharmony_ci	PINCTRL_PIN(65, "I2C0_SCL"),
11562306a36Sopenharmony_ci	PINCTRL_PIN(66, "I2C1_SDA"),
11662306a36Sopenharmony_ci	PINCTRL_PIN(67, "I2C1_SCL"),
11762306a36Sopenharmony_ci	PINCTRL_PIN(68, "UART2_RXD"),
11862306a36Sopenharmony_ci	PINCTRL_PIN(69, "UART2_TXD"),
11962306a36Sopenharmony_ci	PINCTRL_PIN(70, "UART2_RTSB"),
12062306a36Sopenharmony_ci	PINCTRL_PIN(71, "UART2_CTSB"),
12162306a36Sopenharmony_ci	/* GPP_D */
12262306a36Sopenharmony_ci	PINCTRL_PIN(72, "SPI1_CSB"),
12362306a36Sopenharmony_ci	PINCTRL_PIN(73, "SPI1_CLK"),
12462306a36Sopenharmony_ci	PINCTRL_PIN(74, "SPI1_MISO_IO_1"),
12562306a36Sopenharmony_ci	PINCTRL_PIN(75, "SPI1_MOSI_IO_0"),
12662306a36Sopenharmony_ci	PINCTRL_PIN(76, "FLASHTRIG"),
12762306a36Sopenharmony_ci	PINCTRL_PIN(77, "ISH_I2C0_SDA"),
12862306a36Sopenharmony_ci	PINCTRL_PIN(78, "ISH_I2C0_SCL"),
12962306a36Sopenharmony_ci	PINCTRL_PIN(79, "ISH_I2C1_SDA"),
13062306a36Sopenharmony_ci	PINCTRL_PIN(80, "ISH_I2C1_SCL"),
13162306a36Sopenharmony_ci	PINCTRL_PIN(81, "ISH_SPI_CSB"),
13262306a36Sopenharmony_ci	PINCTRL_PIN(82, "ISH_SPI_CLK"),
13362306a36Sopenharmony_ci	PINCTRL_PIN(83, "ISH_SPI_MISO"),
13462306a36Sopenharmony_ci	PINCTRL_PIN(84, "ISH_SPI_MOSI"),
13562306a36Sopenharmony_ci	PINCTRL_PIN(85, "ISH_UART0_RXD"),
13662306a36Sopenharmony_ci	PINCTRL_PIN(86, "ISH_UART0_TXD"),
13762306a36Sopenharmony_ci	PINCTRL_PIN(87, "ISH_UART0_RTSB"),
13862306a36Sopenharmony_ci	PINCTRL_PIN(88, "ISH_UART0_CTSB"),
13962306a36Sopenharmony_ci	PINCTRL_PIN(89, "DMIC_CLK_1"),
14062306a36Sopenharmony_ci	PINCTRL_PIN(90, "DMIC_DATA_1"),
14162306a36Sopenharmony_ci	PINCTRL_PIN(91, "DMIC_CLK_0"),
14262306a36Sopenharmony_ci	PINCTRL_PIN(92, "DMIC_DATA_0"),
14362306a36Sopenharmony_ci	PINCTRL_PIN(93, "SPI1_IO_2"),
14462306a36Sopenharmony_ci	PINCTRL_PIN(94, "SPI1_IO_3"),
14562306a36Sopenharmony_ci	PINCTRL_PIN(95, "SSP_MCLK"),
14662306a36Sopenharmony_ci	/* GPP_E */
14762306a36Sopenharmony_ci	PINCTRL_PIN(96, "SATAXPCIE_0"),
14862306a36Sopenharmony_ci	PINCTRL_PIN(97, "SATAXPCIE_1"),
14962306a36Sopenharmony_ci	PINCTRL_PIN(98, "SATAXPCIE_2"),
15062306a36Sopenharmony_ci	PINCTRL_PIN(99, "CPU_GP_0"),
15162306a36Sopenharmony_ci	PINCTRL_PIN(100, "SATA_DEVSLP_0"),
15262306a36Sopenharmony_ci	PINCTRL_PIN(101, "SATA_DEVSLP_1"),
15362306a36Sopenharmony_ci	PINCTRL_PIN(102, "SATA_DEVSLP_2"),
15462306a36Sopenharmony_ci	PINCTRL_PIN(103, "CPU_GP_1"),
15562306a36Sopenharmony_ci	PINCTRL_PIN(104, "SATA_LEDB"),
15662306a36Sopenharmony_ci	PINCTRL_PIN(105, "USB2_OCB_0"),
15762306a36Sopenharmony_ci	PINCTRL_PIN(106, "USB2_OCB_1"),
15862306a36Sopenharmony_ci	PINCTRL_PIN(107, "USB2_OCB_2"),
15962306a36Sopenharmony_ci	PINCTRL_PIN(108, "USB2_OCB_3"),
16062306a36Sopenharmony_ci	PINCTRL_PIN(109, "DDSP_HPD_0"),
16162306a36Sopenharmony_ci	PINCTRL_PIN(110, "DDSP_HPD_1"),
16262306a36Sopenharmony_ci	PINCTRL_PIN(111, "DDSP_HPD_2"),
16362306a36Sopenharmony_ci	PINCTRL_PIN(112, "DDSP_HPD_3"),
16462306a36Sopenharmony_ci	PINCTRL_PIN(113, "EDP_HPD"),
16562306a36Sopenharmony_ci	PINCTRL_PIN(114, "DDPB_CTRLCLK"),
16662306a36Sopenharmony_ci	PINCTRL_PIN(115, "DDPB_CTRLDATA"),
16762306a36Sopenharmony_ci	PINCTRL_PIN(116, "DDPC_CTRLCLK"),
16862306a36Sopenharmony_ci	PINCTRL_PIN(117, "DDPC_CTRLDATA"),
16962306a36Sopenharmony_ci	PINCTRL_PIN(118, "DDPD_CTRLCLK"),
17062306a36Sopenharmony_ci	PINCTRL_PIN(119, "DDPD_CTRLDATA"),
17162306a36Sopenharmony_ci	/* GPP_F */
17262306a36Sopenharmony_ci	PINCTRL_PIN(120, "SSP2_SCLK"),
17362306a36Sopenharmony_ci	PINCTRL_PIN(121, "SSP2_SFRM"),
17462306a36Sopenharmony_ci	PINCTRL_PIN(122, "SSP2_TXD"),
17562306a36Sopenharmony_ci	PINCTRL_PIN(123, "SSP2_RXD"),
17662306a36Sopenharmony_ci	PINCTRL_PIN(124, "I2C2_SDA"),
17762306a36Sopenharmony_ci	PINCTRL_PIN(125, "I2C2_SCL"),
17862306a36Sopenharmony_ci	PINCTRL_PIN(126, "I2C3_SDA"),
17962306a36Sopenharmony_ci	PINCTRL_PIN(127, "I2C3_SCL"),
18062306a36Sopenharmony_ci	PINCTRL_PIN(128, "I2C4_SDA"),
18162306a36Sopenharmony_ci	PINCTRL_PIN(129, "I2C4_SCL"),
18262306a36Sopenharmony_ci	PINCTRL_PIN(130, "I2C5_SDA"),
18362306a36Sopenharmony_ci	PINCTRL_PIN(131, "I2C5_SCL"),
18462306a36Sopenharmony_ci	PINCTRL_PIN(132, "EMMC_CMD"),
18562306a36Sopenharmony_ci	PINCTRL_PIN(133, "EMMC_DATA_0"),
18662306a36Sopenharmony_ci	PINCTRL_PIN(134, "EMMC_DATA_1"),
18762306a36Sopenharmony_ci	PINCTRL_PIN(135, "EMMC_DATA_2"),
18862306a36Sopenharmony_ci	PINCTRL_PIN(136, "EMMC_DATA_3"),
18962306a36Sopenharmony_ci	PINCTRL_PIN(137, "EMMC_DATA_4"),
19062306a36Sopenharmony_ci	PINCTRL_PIN(138, "EMMC_DATA_5"),
19162306a36Sopenharmony_ci	PINCTRL_PIN(139, "EMMC_DATA_6"),
19262306a36Sopenharmony_ci	PINCTRL_PIN(140, "EMMC_DATA_7"),
19362306a36Sopenharmony_ci	PINCTRL_PIN(141, "EMMC_RCLK"),
19462306a36Sopenharmony_ci	PINCTRL_PIN(142, "EMMC_CLK"),
19562306a36Sopenharmony_ci	PINCTRL_PIN(143, "GPP_F_23"),
19662306a36Sopenharmony_ci	/* GPP_G */
19762306a36Sopenharmony_ci	PINCTRL_PIN(144, "SD_CMD"),
19862306a36Sopenharmony_ci	PINCTRL_PIN(145, "SD_DATA_0"),
19962306a36Sopenharmony_ci	PINCTRL_PIN(146, "SD_DATA_1"),
20062306a36Sopenharmony_ci	PINCTRL_PIN(147, "SD_DATA_2"),
20162306a36Sopenharmony_ci	PINCTRL_PIN(148, "SD_DATA_3"),
20262306a36Sopenharmony_ci	PINCTRL_PIN(149, "SD_CDB"),
20362306a36Sopenharmony_ci	PINCTRL_PIN(150, "SD_CLK"),
20462306a36Sopenharmony_ci	PINCTRL_PIN(151, "SD_WP"),
20562306a36Sopenharmony_ci};
20662306a36Sopenharmony_ci
20762306a36Sopenharmony_cistatic const unsigned sptlp_spi0_pins[] = { 39, 40, 41, 42 };
20862306a36Sopenharmony_cistatic const unsigned sptlp_spi1_pins[] = { 43, 44, 45, 46 };
20962306a36Sopenharmony_cistatic const unsigned sptlp_uart0_pins[] = { 56, 57, 58, 59 };
21062306a36Sopenharmony_cistatic const unsigned sptlp_uart1_pins[] = { 60, 61, 62, 63 };
21162306a36Sopenharmony_cistatic const unsigned sptlp_uart2_pins[] = { 68, 69, 71, 71 };
21262306a36Sopenharmony_cistatic const unsigned sptlp_i2c0_pins[] = { 64, 65 };
21362306a36Sopenharmony_cistatic const unsigned sptlp_i2c1_pins[] = { 66, 67 };
21462306a36Sopenharmony_cistatic const unsigned sptlp_i2c2_pins[] = { 124, 125 };
21562306a36Sopenharmony_cistatic const unsigned sptlp_i2c3_pins[] = { 126, 127 };
21662306a36Sopenharmony_cistatic const unsigned sptlp_i2c4_pins[] = { 128, 129 };
21762306a36Sopenharmony_cistatic const unsigned sptlp_i2c4b_pins[] = { 85, 86 };
21862306a36Sopenharmony_cistatic const unsigned sptlp_i2c5_pins[] = { 130, 131 };
21962306a36Sopenharmony_cistatic const unsigned sptlp_ssp2_pins[] = { 120, 121, 122, 123 };
22062306a36Sopenharmony_cistatic const unsigned sptlp_emmc_pins[] = {
22162306a36Sopenharmony_ci	132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
22262306a36Sopenharmony_ci};
22362306a36Sopenharmony_cistatic const unsigned sptlp_sd_pins[] = {
22462306a36Sopenharmony_ci	144, 145, 146, 147, 148, 149, 150, 151,
22562306a36Sopenharmony_ci};
22662306a36Sopenharmony_ci
22762306a36Sopenharmony_cistatic const struct intel_pingroup sptlp_groups[] = {
22862306a36Sopenharmony_ci	PIN_GROUP("spi0_grp", sptlp_spi0_pins, 1),
22962306a36Sopenharmony_ci	PIN_GROUP("spi1_grp", sptlp_spi1_pins, 1),
23062306a36Sopenharmony_ci	PIN_GROUP("uart0_grp", sptlp_uart0_pins, 1),
23162306a36Sopenharmony_ci	PIN_GROUP("uart1_grp", sptlp_uart1_pins, 1),
23262306a36Sopenharmony_ci	PIN_GROUP("uart2_grp", sptlp_uart2_pins, 1),
23362306a36Sopenharmony_ci	PIN_GROUP("i2c0_grp", sptlp_i2c0_pins, 1),
23462306a36Sopenharmony_ci	PIN_GROUP("i2c1_grp", sptlp_i2c1_pins, 1),
23562306a36Sopenharmony_ci	PIN_GROUP("i2c2_grp", sptlp_i2c2_pins, 1),
23662306a36Sopenharmony_ci	PIN_GROUP("i2c3_grp", sptlp_i2c3_pins, 1),
23762306a36Sopenharmony_ci	PIN_GROUP("i2c4_grp", sptlp_i2c4_pins, 1),
23862306a36Sopenharmony_ci	PIN_GROUP("i2c4b_grp", sptlp_i2c4b_pins, 3),
23962306a36Sopenharmony_ci	PIN_GROUP("i2c5_grp", sptlp_i2c5_pins, 1),
24062306a36Sopenharmony_ci	PIN_GROUP("ssp2_grp", sptlp_ssp2_pins, 1),
24162306a36Sopenharmony_ci	PIN_GROUP("emmc_grp", sptlp_emmc_pins, 1),
24262306a36Sopenharmony_ci	PIN_GROUP("sd_grp", sptlp_sd_pins, 1),
24362306a36Sopenharmony_ci};
24462306a36Sopenharmony_ci
24562306a36Sopenharmony_cistatic const char * const sptlp_spi0_groups[] = { "spi0_grp" };
24662306a36Sopenharmony_cistatic const char * const sptlp_spi1_groups[] = { "spi0_grp" };
24762306a36Sopenharmony_cistatic const char * const sptlp_uart0_groups[] = { "uart0_grp" };
24862306a36Sopenharmony_cistatic const char * const sptlp_uart1_groups[] = { "uart1_grp" };
24962306a36Sopenharmony_cistatic const char * const sptlp_uart2_groups[] = { "uart2_grp" };
25062306a36Sopenharmony_cistatic const char * const sptlp_i2c0_groups[] = { "i2c0_grp" };
25162306a36Sopenharmony_cistatic const char * const sptlp_i2c1_groups[] = { "i2c1_grp" };
25262306a36Sopenharmony_cistatic const char * const sptlp_i2c2_groups[] = { "i2c2_grp" };
25362306a36Sopenharmony_cistatic const char * const sptlp_i2c3_groups[] = { "i2c3_grp" };
25462306a36Sopenharmony_cistatic const char * const sptlp_i2c4_groups[] = { "i2c4_grp", "i2c4b_grp" };
25562306a36Sopenharmony_cistatic const char * const sptlp_i2c5_groups[] = { "i2c5_grp" };
25662306a36Sopenharmony_cistatic const char * const sptlp_ssp2_groups[] = { "ssp2_grp" };
25762306a36Sopenharmony_cistatic const char * const sptlp_emmc_groups[] = { "emmc_grp" };
25862306a36Sopenharmony_cistatic const char * const sptlp_sd_groups[] = { "sd_grp" };
25962306a36Sopenharmony_ci
26062306a36Sopenharmony_cistatic const struct intel_function sptlp_functions[] = {
26162306a36Sopenharmony_ci	FUNCTION("spi0", sptlp_spi0_groups),
26262306a36Sopenharmony_ci	FUNCTION("spi1", sptlp_spi1_groups),
26362306a36Sopenharmony_ci	FUNCTION("uart0", sptlp_uart0_groups),
26462306a36Sopenharmony_ci	FUNCTION("uart1", sptlp_uart1_groups),
26562306a36Sopenharmony_ci	FUNCTION("uart2", sptlp_uart2_groups),
26662306a36Sopenharmony_ci	FUNCTION("i2c0", sptlp_i2c0_groups),
26762306a36Sopenharmony_ci	FUNCTION("i2c1", sptlp_i2c1_groups),
26862306a36Sopenharmony_ci	FUNCTION("i2c2", sptlp_i2c2_groups),
26962306a36Sopenharmony_ci	FUNCTION("i2c3", sptlp_i2c3_groups),
27062306a36Sopenharmony_ci	FUNCTION("i2c4", sptlp_i2c4_groups),
27162306a36Sopenharmony_ci	FUNCTION("i2c5", sptlp_i2c5_groups),
27262306a36Sopenharmony_ci	FUNCTION("ssp2", sptlp_ssp2_groups),
27362306a36Sopenharmony_ci	FUNCTION("emmc", sptlp_emmc_groups),
27462306a36Sopenharmony_ci	FUNCTION("sd", sptlp_sd_groups),
27562306a36Sopenharmony_ci};
27662306a36Sopenharmony_ci
27762306a36Sopenharmony_cistatic const struct intel_community sptlp_communities[] = {
27862306a36Sopenharmony_ci	SPT_LP_COMMUNITY(0, 0, 47),
27962306a36Sopenharmony_ci	SPT_LP_COMMUNITY(1, 48, 119),
28062306a36Sopenharmony_ci	SPT_LP_COMMUNITY(2, 120, 151),
28162306a36Sopenharmony_ci};
28262306a36Sopenharmony_ci
28362306a36Sopenharmony_cistatic const struct intel_pinctrl_soc_data sptlp_soc_data = {
28462306a36Sopenharmony_ci	.pins = sptlp_pins,
28562306a36Sopenharmony_ci	.npins = ARRAY_SIZE(sptlp_pins),
28662306a36Sopenharmony_ci	.groups = sptlp_groups,
28762306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(sptlp_groups),
28862306a36Sopenharmony_ci	.functions = sptlp_functions,
28962306a36Sopenharmony_ci	.nfunctions = ARRAY_SIZE(sptlp_functions),
29062306a36Sopenharmony_ci	.communities = sptlp_communities,
29162306a36Sopenharmony_ci	.ncommunities = ARRAY_SIZE(sptlp_communities),
29262306a36Sopenharmony_ci};
29362306a36Sopenharmony_ci
29462306a36Sopenharmony_ci/* Sunrisepoint-H */
29562306a36Sopenharmony_cistatic const struct pinctrl_pin_desc spth_pins[] = {
29662306a36Sopenharmony_ci	/* GPP_A */
29762306a36Sopenharmony_ci	PINCTRL_PIN(0, "RCINB"),
29862306a36Sopenharmony_ci	PINCTRL_PIN(1, "LAD_0"),
29962306a36Sopenharmony_ci	PINCTRL_PIN(2, "LAD_1"),
30062306a36Sopenharmony_ci	PINCTRL_PIN(3, "LAD_2"),
30162306a36Sopenharmony_ci	PINCTRL_PIN(4, "LAD_3"),
30262306a36Sopenharmony_ci	PINCTRL_PIN(5, "LFRAMEB"),
30362306a36Sopenharmony_ci	PINCTRL_PIN(6, "SERIQ"),
30462306a36Sopenharmony_ci	PINCTRL_PIN(7, "PIRQAB"),
30562306a36Sopenharmony_ci	PINCTRL_PIN(8, "CLKRUNB"),
30662306a36Sopenharmony_ci	PINCTRL_PIN(9, "CLKOUT_LPC_0"),
30762306a36Sopenharmony_ci	PINCTRL_PIN(10, "CLKOUT_LPC_1"),
30862306a36Sopenharmony_ci	PINCTRL_PIN(11, "PMEB"),
30962306a36Sopenharmony_ci	PINCTRL_PIN(12, "BM_BUSYB"),
31062306a36Sopenharmony_ci	PINCTRL_PIN(13, "SUSWARNB_SUS_PWRDNACK"),
31162306a36Sopenharmony_ci	PINCTRL_PIN(14, "SUS_STATB"),
31262306a36Sopenharmony_ci	PINCTRL_PIN(15, "SUSACKB"),
31362306a36Sopenharmony_ci	PINCTRL_PIN(16, "CLKOUT_48"),
31462306a36Sopenharmony_ci	PINCTRL_PIN(17, "ISH_GP_7"),
31562306a36Sopenharmony_ci	PINCTRL_PIN(18, "ISH_GP_0"),
31662306a36Sopenharmony_ci	PINCTRL_PIN(19, "ISH_GP_1"),
31762306a36Sopenharmony_ci	PINCTRL_PIN(20, "ISH_GP_2"),
31862306a36Sopenharmony_ci	PINCTRL_PIN(21, "ISH_GP_3"),
31962306a36Sopenharmony_ci	PINCTRL_PIN(22, "ISH_GP_4"),
32062306a36Sopenharmony_ci	PINCTRL_PIN(23, "ISH_GP_5"),
32162306a36Sopenharmony_ci	/* GPP_B */
32262306a36Sopenharmony_ci	PINCTRL_PIN(24, "CORE_VID_0"),
32362306a36Sopenharmony_ci	PINCTRL_PIN(25, "CORE_VID_1"),
32462306a36Sopenharmony_ci	PINCTRL_PIN(26, "VRALERTB"),
32562306a36Sopenharmony_ci	PINCTRL_PIN(27, "CPU_GP_2"),
32662306a36Sopenharmony_ci	PINCTRL_PIN(28, "CPU_GP_3"),
32762306a36Sopenharmony_ci	PINCTRL_PIN(29, "SRCCLKREQB_0"),
32862306a36Sopenharmony_ci	PINCTRL_PIN(30, "SRCCLKREQB_1"),
32962306a36Sopenharmony_ci	PINCTRL_PIN(31, "SRCCLKREQB_2"),
33062306a36Sopenharmony_ci	PINCTRL_PIN(32, "SRCCLKREQB_3"),
33162306a36Sopenharmony_ci	PINCTRL_PIN(33, "SRCCLKREQB_4"),
33262306a36Sopenharmony_ci	PINCTRL_PIN(34, "SRCCLKREQB_5"),
33362306a36Sopenharmony_ci	PINCTRL_PIN(35, "EXT_PWR_GATEB"),
33462306a36Sopenharmony_ci	PINCTRL_PIN(36, "SLP_S0B"),
33562306a36Sopenharmony_ci	PINCTRL_PIN(37, "PLTRSTB"),
33662306a36Sopenharmony_ci	PINCTRL_PIN(38, "SPKR"),
33762306a36Sopenharmony_ci	PINCTRL_PIN(39, "GSPI0_CSB"),
33862306a36Sopenharmony_ci	PINCTRL_PIN(40, "GSPI0_CLK"),
33962306a36Sopenharmony_ci	PINCTRL_PIN(41, "GSPI0_MISO"),
34062306a36Sopenharmony_ci	PINCTRL_PIN(42, "GSPI0_MOSI"),
34162306a36Sopenharmony_ci	PINCTRL_PIN(43, "GSPI1_CSB"),
34262306a36Sopenharmony_ci	PINCTRL_PIN(44, "GSPI1_CLK"),
34362306a36Sopenharmony_ci	PINCTRL_PIN(45, "GSPI1_MISO"),
34462306a36Sopenharmony_ci	PINCTRL_PIN(46, "GSPI1_MOSI"),
34562306a36Sopenharmony_ci	PINCTRL_PIN(47, "SML1ALERTB"),
34662306a36Sopenharmony_ci	/* GPP_C */
34762306a36Sopenharmony_ci	PINCTRL_PIN(48, "SMBCLK"),
34862306a36Sopenharmony_ci	PINCTRL_PIN(49, "SMBDATA"),
34962306a36Sopenharmony_ci	PINCTRL_PIN(50, "SMBALERTB"),
35062306a36Sopenharmony_ci	PINCTRL_PIN(51, "SML0CLK"),
35162306a36Sopenharmony_ci	PINCTRL_PIN(52, "SML0DATA"),
35262306a36Sopenharmony_ci	PINCTRL_PIN(53, "SML0ALERTB"),
35362306a36Sopenharmony_ci	PINCTRL_PIN(54, "SML1CLK"),
35462306a36Sopenharmony_ci	PINCTRL_PIN(55, "SML1DATA"),
35562306a36Sopenharmony_ci	PINCTRL_PIN(56, "UART0_RXD"),
35662306a36Sopenharmony_ci	PINCTRL_PIN(57, "UART0_TXD"),
35762306a36Sopenharmony_ci	PINCTRL_PIN(58, "UART0_RTSB"),
35862306a36Sopenharmony_ci	PINCTRL_PIN(59, "UART0_CTSB"),
35962306a36Sopenharmony_ci	PINCTRL_PIN(60, "UART1_RXD"),
36062306a36Sopenharmony_ci	PINCTRL_PIN(61, "UART1_TXD"),
36162306a36Sopenharmony_ci	PINCTRL_PIN(62, "UART1_RTSB"),
36262306a36Sopenharmony_ci	PINCTRL_PIN(63, "UART1_CTSB"),
36362306a36Sopenharmony_ci	PINCTRL_PIN(64, "I2C0_SDA"),
36462306a36Sopenharmony_ci	PINCTRL_PIN(65, "I2C0_SCL"),
36562306a36Sopenharmony_ci	PINCTRL_PIN(66, "I2C1_SDA"),
36662306a36Sopenharmony_ci	PINCTRL_PIN(67, "I2C1_SCL"),
36762306a36Sopenharmony_ci	PINCTRL_PIN(68, "UART2_RXD"),
36862306a36Sopenharmony_ci	PINCTRL_PIN(69, "UART2_TXD"),
36962306a36Sopenharmony_ci	PINCTRL_PIN(70, "UART2_RTSB"),
37062306a36Sopenharmony_ci	PINCTRL_PIN(71, "UART2_CTSB"),
37162306a36Sopenharmony_ci	/* GPP_D */
37262306a36Sopenharmony_ci	PINCTRL_PIN(72, "SPI1_CSB"),
37362306a36Sopenharmony_ci	PINCTRL_PIN(73, "SPI1_CLK"),
37462306a36Sopenharmony_ci	PINCTRL_PIN(74, "SPI1_MISO_IO_1"),
37562306a36Sopenharmony_ci	PINCTRL_PIN(75, "SPI1_MOSI_IO_0"),
37662306a36Sopenharmony_ci	PINCTRL_PIN(76, "ISH_I2C2_SDA"),
37762306a36Sopenharmony_ci	PINCTRL_PIN(77, "SSP0_SFRM"),
37862306a36Sopenharmony_ci	PINCTRL_PIN(78, "SSP0_TXD"),
37962306a36Sopenharmony_ci	PINCTRL_PIN(79, "SSP0_RXD"),
38062306a36Sopenharmony_ci	PINCTRL_PIN(80, "SSP0_SCLK"),
38162306a36Sopenharmony_ci	PINCTRL_PIN(81, "ISH_SPI_CSB"),
38262306a36Sopenharmony_ci	PINCTRL_PIN(82, "ISH_SPI_CLK"),
38362306a36Sopenharmony_ci	PINCTRL_PIN(83, "ISH_SPI_MISO"),
38462306a36Sopenharmony_ci	PINCTRL_PIN(84, "ISH_SPI_MOSI"),
38562306a36Sopenharmony_ci	PINCTRL_PIN(85, "ISH_UART0_RXD"),
38662306a36Sopenharmony_ci	PINCTRL_PIN(86, "ISH_UART0_TXD"),
38762306a36Sopenharmony_ci	PINCTRL_PIN(87, "ISH_UART0_RTSB"),
38862306a36Sopenharmony_ci	PINCTRL_PIN(88, "ISH_UART0_CTSB"),
38962306a36Sopenharmony_ci	PINCTRL_PIN(89, "DMIC_CLK_1"),
39062306a36Sopenharmony_ci	PINCTRL_PIN(90, "DMIC_DATA_1"),
39162306a36Sopenharmony_ci	PINCTRL_PIN(91, "DMIC_CLK_0"),
39262306a36Sopenharmony_ci	PINCTRL_PIN(92, "DMIC_DATA_0"),
39362306a36Sopenharmony_ci	PINCTRL_PIN(93, "SPI1_IO_2"),
39462306a36Sopenharmony_ci	PINCTRL_PIN(94, "SPI1_IO_3"),
39562306a36Sopenharmony_ci	PINCTRL_PIN(95, "ISH_I2C2_SCL"),
39662306a36Sopenharmony_ci	/* GPP_E */
39762306a36Sopenharmony_ci	PINCTRL_PIN(96, "SATAXPCIE_0"),
39862306a36Sopenharmony_ci	PINCTRL_PIN(97, "SATAXPCIE_1"),
39962306a36Sopenharmony_ci	PINCTRL_PIN(98, "SATAXPCIE_2"),
40062306a36Sopenharmony_ci	PINCTRL_PIN(99, "CPU_GP_0"),
40162306a36Sopenharmony_ci	PINCTRL_PIN(100, "SATA_DEVSLP_0"),
40262306a36Sopenharmony_ci	PINCTRL_PIN(101, "SATA_DEVSLP_1"),
40362306a36Sopenharmony_ci	PINCTRL_PIN(102, "SATA_DEVSLP_2"),
40462306a36Sopenharmony_ci	PINCTRL_PIN(103, "CPU_GP_1"),
40562306a36Sopenharmony_ci	PINCTRL_PIN(104, "SATA_LEDB"),
40662306a36Sopenharmony_ci	PINCTRL_PIN(105, "USB2_OCB_0"),
40762306a36Sopenharmony_ci	PINCTRL_PIN(106, "USB2_OCB_1"),
40862306a36Sopenharmony_ci	PINCTRL_PIN(107, "USB2_OCB_2"),
40962306a36Sopenharmony_ci	PINCTRL_PIN(108, "USB2_OCB_3"),
41062306a36Sopenharmony_ci	/* GPP_F */
41162306a36Sopenharmony_ci	PINCTRL_PIN(109, "SATAXPCIE_3"),
41262306a36Sopenharmony_ci	PINCTRL_PIN(110, "SATAXPCIE_4"),
41362306a36Sopenharmony_ci	PINCTRL_PIN(111, "SATAXPCIE_5"),
41462306a36Sopenharmony_ci	PINCTRL_PIN(112, "SATAXPCIE_6"),
41562306a36Sopenharmony_ci	PINCTRL_PIN(113, "SATAXPCIE_7"),
41662306a36Sopenharmony_ci	PINCTRL_PIN(114, "SATA_DEVSLP_3"),
41762306a36Sopenharmony_ci	PINCTRL_PIN(115, "SATA_DEVSLP_4"),
41862306a36Sopenharmony_ci	PINCTRL_PIN(116, "SATA_DEVSLP_5"),
41962306a36Sopenharmony_ci	PINCTRL_PIN(117, "SATA_DEVSLP_6"),
42062306a36Sopenharmony_ci	PINCTRL_PIN(118, "SATA_DEVSLP_7"),
42162306a36Sopenharmony_ci	PINCTRL_PIN(119, "SATA_SCLOCK"),
42262306a36Sopenharmony_ci	PINCTRL_PIN(120, "SATA_SLOAD"),
42362306a36Sopenharmony_ci	PINCTRL_PIN(121, "SATA_SDATAOUT1"),
42462306a36Sopenharmony_ci	PINCTRL_PIN(122, "SATA_SDATAOUT0"),
42562306a36Sopenharmony_ci	PINCTRL_PIN(123, "GPP_F_14"),
42662306a36Sopenharmony_ci	PINCTRL_PIN(124, "USB_OCB_4"),
42762306a36Sopenharmony_ci	PINCTRL_PIN(125, "USB_OCB_5"),
42862306a36Sopenharmony_ci	PINCTRL_PIN(126, "USB_OCB_6"),
42962306a36Sopenharmony_ci	PINCTRL_PIN(127, "USB_OCB_7"),
43062306a36Sopenharmony_ci	PINCTRL_PIN(128, "L_VDDEN"),
43162306a36Sopenharmony_ci	PINCTRL_PIN(129, "L_BKLTEN"),
43262306a36Sopenharmony_ci	PINCTRL_PIN(130, "L_BKLTCTL"),
43362306a36Sopenharmony_ci	PINCTRL_PIN(131, "GPP_F_22"),
43462306a36Sopenharmony_ci	PINCTRL_PIN(132, "GPP_F_23"),
43562306a36Sopenharmony_ci	/* GPP_G */
43662306a36Sopenharmony_ci	PINCTRL_PIN(133, "FAN_TACH_0"),
43762306a36Sopenharmony_ci	PINCTRL_PIN(134, "FAN_TACH_1"),
43862306a36Sopenharmony_ci	PINCTRL_PIN(135, "FAN_TACH_2"),
43962306a36Sopenharmony_ci	PINCTRL_PIN(136, "FAN_TACH_3"),
44062306a36Sopenharmony_ci	PINCTRL_PIN(137, "FAN_TACH_4"),
44162306a36Sopenharmony_ci	PINCTRL_PIN(138, "FAN_TACH_5"),
44262306a36Sopenharmony_ci	PINCTRL_PIN(139, "FAN_TACH_6"),
44362306a36Sopenharmony_ci	PINCTRL_PIN(140, "FAN_TACH_7"),
44462306a36Sopenharmony_ci	PINCTRL_PIN(141, "FAN_PWM_0"),
44562306a36Sopenharmony_ci	PINCTRL_PIN(142, "FAN_PWM_1"),
44662306a36Sopenharmony_ci	PINCTRL_PIN(143, "FAN_PWM_2"),
44762306a36Sopenharmony_ci	PINCTRL_PIN(144, "FAN_PWM_3"),
44862306a36Sopenharmony_ci	PINCTRL_PIN(145, "GSXDOUT"),
44962306a36Sopenharmony_ci	PINCTRL_PIN(146, "GSXSLOAD"),
45062306a36Sopenharmony_ci	PINCTRL_PIN(147, "GSXDIN"),
45162306a36Sopenharmony_ci	PINCTRL_PIN(148, "GSXRESETB"),
45262306a36Sopenharmony_ci	PINCTRL_PIN(149, "GSXCLK"),
45362306a36Sopenharmony_ci	PINCTRL_PIN(150, "ADR_COMPLETE"),
45462306a36Sopenharmony_ci	PINCTRL_PIN(151, "NMIB"),
45562306a36Sopenharmony_ci	PINCTRL_PIN(152, "SMIB"),
45662306a36Sopenharmony_ci	PINCTRL_PIN(153, "GPP_G_20"),
45762306a36Sopenharmony_ci	PINCTRL_PIN(154, "GPP_G_21"),
45862306a36Sopenharmony_ci	PINCTRL_PIN(155, "GPP_G_22"),
45962306a36Sopenharmony_ci	PINCTRL_PIN(156, "GPP_G_23"),
46062306a36Sopenharmony_ci	/* GPP_H */
46162306a36Sopenharmony_ci	PINCTRL_PIN(157, "SRCCLKREQB_6"),
46262306a36Sopenharmony_ci	PINCTRL_PIN(158, "SRCCLKREQB_7"),
46362306a36Sopenharmony_ci	PINCTRL_PIN(159, "SRCCLKREQB_8"),
46462306a36Sopenharmony_ci	PINCTRL_PIN(160, "SRCCLKREQB_9"),
46562306a36Sopenharmony_ci	PINCTRL_PIN(161, "SRCCLKREQB_10"),
46662306a36Sopenharmony_ci	PINCTRL_PIN(162, "SRCCLKREQB_11"),
46762306a36Sopenharmony_ci	PINCTRL_PIN(163, "SRCCLKREQB_12"),
46862306a36Sopenharmony_ci	PINCTRL_PIN(164, "SRCCLKREQB_13"),
46962306a36Sopenharmony_ci	PINCTRL_PIN(165, "SRCCLKREQB_14"),
47062306a36Sopenharmony_ci	PINCTRL_PIN(166, "SRCCLKREQB_15"),
47162306a36Sopenharmony_ci	PINCTRL_PIN(167, "SML2CLK"),
47262306a36Sopenharmony_ci	PINCTRL_PIN(168, "SML2DATA"),
47362306a36Sopenharmony_ci	PINCTRL_PIN(169, "SML2ALERTB"),
47462306a36Sopenharmony_ci	PINCTRL_PIN(170, "SML3CLK"),
47562306a36Sopenharmony_ci	PINCTRL_PIN(171, "SML3DATA"),
47662306a36Sopenharmony_ci	PINCTRL_PIN(172, "SML3ALERTB"),
47762306a36Sopenharmony_ci	PINCTRL_PIN(173, "SML4CLK"),
47862306a36Sopenharmony_ci	PINCTRL_PIN(174, "SML4DATA"),
47962306a36Sopenharmony_ci	PINCTRL_PIN(175, "SML4ALERTB"),
48062306a36Sopenharmony_ci	PINCTRL_PIN(176, "ISH_I2C0_SDA"),
48162306a36Sopenharmony_ci	PINCTRL_PIN(177, "ISH_I2C0_SCL"),
48262306a36Sopenharmony_ci	PINCTRL_PIN(178, "ISH_I2C1_SDA"),
48362306a36Sopenharmony_ci	PINCTRL_PIN(179, "ISH_I2C1_SCL"),
48462306a36Sopenharmony_ci	PINCTRL_PIN(180, "GPP_H_23"),
48562306a36Sopenharmony_ci	/* GPP_I */
48662306a36Sopenharmony_ci	PINCTRL_PIN(181, "DDSP_HDP_0"),
48762306a36Sopenharmony_ci	PINCTRL_PIN(182, "DDSP_HDP_1"),
48862306a36Sopenharmony_ci	PINCTRL_PIN(183, "DDSP_HDP_2"),
48962306a36Sopenharmony_ci	PINCTRL_PIN(184, "DDSP_HDP_3"),
49062306a36Sopenharmony_ci	PINCTRL_PIN(185, "EDP_HPD"),
49162306a36Sopenharmony_ci	PINCTRL_PIN(186, "DDPB_CTRLCLK"),
49262306a36Sopenharmony_ci	PINCTRL_PIN(187, "DDPB_CTRLDATA"),
49362306a36Sopenharmony_ci	PINCTRL_PIN(188, "DDPC_CTRLCLK"),
49462306a36Sopenharmony_ci	PINCTRL_PIN(189, "DDPC_CTRLDATA"),
49562306a36Sopenharmony_ci	PINCTRL_PIN(190, "DDPD_CTRLCLK"),
49662306a36Sopenharmony_ci	PINCTRL_PIN(191, "DDPD_CTRLDATA"),
49762306a36Sopenharmony_ci};
49862306a36Sopenharmony_ci
49962306a36Sopenharmony_cistatic const unsigned spth_spi0_pins[] = { 39, 40, 41, 42 };
50062306a36Sopenharmony_cistatic const unsigned spth_spi1_pins[] = { 43, 44, 45, 46 };
50162306a36Sopenharmony_cistatic const unsigned spth_uart0_pins[] = { 56, 57, 58, 59 };
50262306a36Sopenharmony_cistatic const unsigned spth_uart1_pins[] = { 60, 61, 62, 63 };
50362306a36Sopenharmony_cistatic const unsigned spth_uart2_pins[] = { 68, 69, 71, 71 };
50462306a36Sopenharmony_cistatic const unsigned spth_i2c0_pins[] = { 64, 65 };
50562306a36Sopenharmony_cistatic const unsigned spth_i2c1_pins[] = { 66, 67 };
50662306a36Sopenharmony_cistatic const unsigned spth_i2c2_pins[] = { 76, 95 };
50762306a36Sopenharmony_ci
50862306a36Sopenharmony_cistatic const struct intel_pingroup spth_groups[] = {
50962306a36Sopenharmony_ci	PIN_GROUP("spi0_grp", spth_spi0_pins, 1),
51062306a36Sopenharmony_ci	PIN_GROUP("spi1_grp", spth_spi1_pins, 1),
51162306a36Sopenharmony_ci	PIN_GROUP("uart0_grp", spth_uart0_pins, 1),
51262306a36Sopenharmony_ci	PIN_GROUP("uart1_grp", spth_uart1_pins, 1),
51362306a36Sopenharmony_ci	PIN_GROUP("uart2_grp", spth_uart2_pins, 1),
51462306a36Sopenharmony_ci	PIN_GROUP("i2c0_grp", spth_i2c0_pins, 1),
51562306a36Sopenharmony_ci	PIN_GROUP("i2c1_grp", spth_i2c1_pins, 1),
51662306a36Sopenharmony_ci	PIN_GROUP("i2c2_grp", spth_i2c2_pins, 2),
51762306a36Sopenharmony_ci};
51862306a36Sopenharmony_ci
51962306a36Sopenharmony_cistatic const char * const spth_spi0_groups[] = { "spi0_grp" };
52062306a36Sopenharmony_cistatic const char * const spth_spi1_groups[] = { "spi0_grp" };
52162306a36Sopenharmony_cistatic const char * const spth_uart0_groups[] = { "uart0_grp" };
52262306a36Sopenharmony_cistatic const char * const spth_uart1_groups[] = { "uart1_grp" };
52362306a36Sopenharmony_cistatic const char * const spth_uart2_groups[] = { "uart2_grp" };
52462306a36Sopenharmony_cistatic const char * const spth_i2c0_groups[] = { "i2c0_grp" };
52562306a36Sopenharmony_cistatic const char * const spth_i2c1_groups[] = { "i2c1_grp" };
52662306a36Sopenharmony_cistatic const char * const spth_i2c2_groups[] = { "i2c2_grp" };
52762306a36Sopenharmony_ci
52862306a36Sopenharmony_cistatic const struct intel_function spth_functions[] = {
52962306a36Sopenharmony_ci	FUNCTION("spi0", spth_spi0_groups),
53062306a36Sopenharmony_ci	FUNCTION("spi1", spth_spi1_groups),
53162306a36Sopenharmony_ci	FUNCTION("uart0", spth_uart0_groups),
53262306a36Sopenharmony_ci	FUNCTION("uart1", spth_uart1_groups),
53362306a36Sopenharmony_ci	FUNCTION("uart2", spth_uart2_groups),
53462306a36Sopenharmony_ci	FUNCTION("i2c0", spth_i2c0_groups),
53562306a36Sopenharmony_ci	FUNCTION("i2c1", spth_i2c1_groups),
53662306a36Sopenharmony_ci	FUNCTION("i2c2", spth_i2c2_groups),
53762306a36Sopenharmony_ci};
53862306a36Sopenharmony_ci
53962306a36Sopenharmony_cistatic const struct intel_padgroup spth_community0_gpps[] = {
54062306a36Sopenharmony_ci	SPT_H_GPP(0, 0, 23, 0),		/* GPP_A */
54162306a36Sopenharmony_ci	SPT_H_GPP(1, 24, 47, 24),	/* GPP_B */
54262306a36Sopenharmony_ci};
54362306a36Sopenharmony_ci
54462306a36Sopenharmony_cistatic const struct intel_padgroup spth_community1_gpps[] = {
54562306a36Sopenharmony_ci	SPT_H_GPP(0, 48, 71, 48),	/* GPP_C */
54662306a36Sopenharmony_ci	SPT_H_GPP(1, 72, 95, 72),	/* GPP_D */
54762306a36Sopenharmony_ci	SPT_H_GPP(2, 96, 108, 96),	/* GPP_E */
54862306a36Sopenharmony_ci	SPT_H_GPP(3, 109, 132, 120),	/* GPP_F */
54962306a36Sopenharmony_ci	SPT_H_GPP(4, 133, 156, 144),	/* GPP_G */
55062306a36Sopenharmony_ci	SPT_H_GPP(5, 157, 180, 168),	/* GPP_H */
55162306a36Sopenharmony_ci};
55262306a36Sopenharmony_ci
55362306a36Sopenharmony_cistatic const struct intel_padgroup spth_community3_gpps[] = {
55462306a36Sopenharmony_ci	SPT_H_GPP(0, 181, 191, 192),	/* GPP_I */
55562306a36Sopenharmony_ci};
55662306a36Sopenharmony_ci
55762306a36Sopenharmony_cistatic const struct intel_community spth_communities[] = {
55862306a36Sopenharmony_ci	SPT_H_COMMUNITY(0, 0, 47, spth_community0_gpps),
55962306a36Sopenharmony_ci	SPT_H_COMMUNITY(1, 48, 180, spth_community1_gpps),
56062306a36Sopenharmony_ci	SPT_H_COMMUNITY(2, 181, 191, spth_community3_gpps),
56162306a36Sopenharmony_ci};
56262306a36Sopenharmony_ci
56362306a36Sopenharmony_cistatic const struct intel_pinctrl_soc_data spth_soc_data = {
56462306a36Sopenharmony_ci	.pins = spth_pins,
56562306a36Sopenharmony_ci	.npins = ARRAY_SIZE(spth_pins),
56662306a36Sopenharmony_ci	.groups = spth_groups,
56762306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(spth_groups),
56862306a36Sopenharmony_ci	.functions = spth_functions,
56962306a36Sopenharmony_ci	.nfunctions = ARRAY_SIZE(spth_functions),
57062306a36Sopenharmony_ci	.communities = spth_communities,
57162306a36Sopenharmony_ci	.ncommunities = ARRAY_SIZE(spth_communities),
57262306a36Sopenharmony_ci};
57362306a36Sopenharmony_ci
57462306a36Sopenharmony_cistatic const struct acpi_device_id spt_pinctrl_acpi_match[] = {
57562306a36Sopenharmony_ci	{ "INT344B", (kernel_ulong_t)&sptlp_soc_data },
57662306a36Sopenharmony_ci	{ "INT3451", (kernel_ulong_t)&spth_soc_data },
57762306a36Sopenharmony_ci	{ "INT345D", (kernel_ulong_t)&spth_soc_data },
57862306a36Sopenharmony_ci	{ }
57962306a36Sopenharmony_ci};
58062306a36Sopenharmony_ciMODULE_DEVICE_TABLE(acpi, spt_pinctrl_acpi_match);
58162306a36Sopenharmony_ci
58262306a36Sopenharmony_cistatic INTEL_PINCTRL_PM_OPS(spt_pinctrl_pm_ops);
58362306a36Sopenharmony_ci
58462306a36Sopenharmony_cistatic struct platform_driver spt_pinctrl_driver = {
58562306a36Sopenharmony_ci	.probe = intel_pinctrl_probe_by_hid,
58662306a36Sopenharmony_ci	.driver = {
58762306a36Sopenharmony_ci		.name = "sunrisepoint-pinctrl",
58862306a36Sopenharmony_ci		.acpi_match_table = spt_pinctrl_acpi_match,
58962306a36Sopenharmony_ci		.pm = &spt_pinctrl_pm_ops,
59062306a36Sopenharmony_ci	},
59162306a36Sopenharmony_ci};
59262306a36Sopenharmony_ci
59362306a36Sopenharmony_cistatic int __init spt_pinctrl_init(void)
59462306a36Sopenharmony_ci{
59562306a36Sopenharmony_ci	return platform_driver_register(&spt_pinctrl_driver);
59662306a36Sopenharmony_ci}
59762306a36Sopenharmony_cisubsys_initcall(spt_pinctrl_init);
59862306a36Sopenharmony_ci
59962306a36Sopenharmony_cistatic void __exit spt_pinctrl_exit(void)
60062306a36Sopenharmony_ci{
60162306a36Sopenharmony_ci	platform_driver_unregister(&spt_pinctrl_driver);
60262306a36Sopenharmony_ci}
60362306a36Sopenharmony_cimodule_exit(spt_pinctrl_exit);
60462306a36Sopenharmony_ci
60562306a36Sopenharmony_ciMODULE_AUTHOR("Mathias Nyman <mathias.nyman@linux.intel.com>");
60662306a36Sopenharmony_ciMODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>");
60762306a36Sopenharmony_ciMODULE_DESCRIPTION("Intel Sunrisepoint PCH pinctrl/GPIO driver");
60862306a36Sopenharmony_ciMODULE_LICENSE("GPL v2");
60962306a36Sopenharmony_ciMODULE_IMPORT_NS(PINCTRL_INTEL);
610