162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Intel Lakefield PCH pinctrl/GPIO driver
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Copyright (C) 2020, Intel Corporation
662306a36Sopenharmony_ci * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
762306a36Sopenharmony_ci */
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#include <linux/mod_devicetable.h>
1062306a36Sopenharmony_ci#include <linux/module.h>
1162306a36Sopenharmony_ci#include <linux/platform_device.h>
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci#include <linux/pinctrl/pinctrl.h>
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci#include "pinctrl-intel.h"
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci#define LKF_PAD_OWN	0x020
1862306a36Sopenharmony_ci#define LKF_PADCFGLOCK	0x070
1962306a36Sopenharmony_ci#define LKF_HOSTSW_OWN	0x090
2062306a36Sopenharmony_ci#define LKF_GPI_IS	0x100
2162306a36Sopenharmony_ci#define LKF_GPI_IE	0x110
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci#define LKF_GPP(r, s, e, g)				\
2462306a36Sopenharmony_ci	{						\
2562306a36Sopenharmony_ci		.reg_num = (r),				\
2662306a36Sopenharmony_ci		.base = (s),				\
2762306a36Sopenharmony_ci		.size = ((e) - (s) + 1),		\
2862306a36Sopenharmony_ci		.gpio_base = (g),			\
2962306a36Sopenharmony_ci	}
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci#define LKF_COMMUNITY(b, s, e, g)			\
3262306a36Sopenharmony_ci	INTEL_COMMUNITY_GPPS(b, s, e, g, LKF)
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci/* Lakefield */
3562306a36Sopenharmony_cistatic const struct pinctrl_pin_desc lkf_pins[] = {
3662306a36Sopenharmony_ci	/* EAST */
3762306a36Sopenharmony_ci	PINCTRL_PIN(0, "MDSI_A_TE0"),
3862306a36Sopenharmony_ci	PINCTRL_PIN(1, "MDSI_A_TE1"),
3962306a36Sopenharmony_ci	PINCTRL_PIN(2, "PANEL0_AVDD_EN"),
4062306a36Sopenharmony_ci	PINCTRL_PIN(3, "PANEL0_BKLTEN"),
4162306a36Sopenharmony_ci	PINCTRL_PIN(4, "PANEL0_BKLTCTL"),
4262306a36Sopenharmony_ci	PINCTRL_PIN(5, "PANEL1_AVDD_EN"),
4362306a36Sopenharmony_ci	PINCTRL_PIN(6, "PANEL1_BKLTEN"),
4462306a36Sopenharmony_ci	PINCTRL_PIN(7, "PANEL1_BKLTCTL"),
4562306a36Sopenharmony_ci	PINCTRL_PIN(8, "THC0_SPI1_IO_0"),
4662306a36Sopenharmony_ci	PINCTRL_PIN(9, "THC0_SPI1_IO_1"),
4762306a36Sopenharmony_ci	PINCTRL_PIN(10, "THC0_SPI1_IO_2"),
4862306a36Sopenharmony_ci	PINCTRL_PIN(11, "THC0_SPI1_IO_3"),
4962306a36Sopenharmony_ci	PINCTRL_PIN(12, "THC0_SPI1_CSB"),
5062306a36Sopenharmony_ci	PINCTRL_PIN(13, "THC0_SPI1_CLK"),
5162306a36Sopenharmony_ci	PINCTRL_PIN(14, "THC0_SPI1_RESETB"),
5262306a36Sopenharmony_ci	PINCTRL_PIN(15, "THC0_SPI1_CLK_FB"),
5362306a36Sopenharmony_ci	PINCTRL_PIN(16, "SPI_TOUCH_CLK_FB"),
5462306a36Sopenharmony_ci	PINCTRL_PIN(17, "THC1_SPI2_IO_0"),
5562306a36Sopenharmony_ci	PINCTRL_PIN(18, "THC1_SPI2_IO_1"),
5662306a36Sopenharmony_ci	PINCTRL_PIN(19, "THC1_SPI2_IO_2"),
5762306a36Sopenharmony_ci	PINCTRL_PIN(20, "THC1_SPI2_IO_3"),
5862306a36Sopenharmony_ci	PINCTRL_PIN(21, "THC1_SPI2_CSB"),
5962306a36Sopenharmony_ci	PINCTRL_PIN(22, "THC1_SPI2_CLK"),
6062306a36Sopenharmony_ci	PINCTRL_PIN(23, "THC1_SPI2_RESETB"),
6162306a36Sopenharmony_ci	PINCTRL_PIN(24, "THC1_SPI2_CLK_FB"),
6262306a36Sopenharmony_ci	PINCTRL_PIN(25, "eSPI_IO_0"),
6362306a36Sopenharmony_ci	PINCTRL_PIN(26, "eSPI_IO_1"),
6462306a36Sopenharmony_ci	PINCTRL_PIN(27, "eSPI_IO_2"),
6562306a36Sopenharmony_ci	PINCTRL_PIN(28, "eSPI_IO_3"),
6662306a36Sopenharmony_ci	PINCTRL_PIN(29, "eSPI_CSB"),
6762306a36Sopenharmony_ci	PINCTRL_PIN(30, "eSPI_RESETB"),
6862306a36Sopenharmony_ci	PINCTRL_PIN(31, "eSPI_CLK"),
6962306a36Sopenharmony_ci	PINCTRL_PIN(32, "eSPI_CLK_FB"),
7062306a36Sopenharmony_ci	PINCTRL_PIN(33, "FAST_SPI0_IO_0"),
7162306a36Sopenharmony_ci	PINCTRL_PIN(34, "FAST_SPI0_IO_1"),
7262306a36Sopenharmony_ci	PINCTRL_PIN(35, "FAST_SPI0_IO_2"),
7362306a36Sopenharmony_ci	PINCTRL_PIN(36, "FAST_SPI0_IO_3"),
7462306a36Sopenharmony_ci	PINCTRL_PIN(37, "FAST_SPI0_CSB_0"),
7562306a36Sopenharmony_ci	PINCTRL_PIN(38, "FAST_SPI0_CSB_2"),
7662306a36Sopenharmony_ci	PINCTRL_PIN(39, "FAST_SPI0_CLK"),
7762306a36Sopenharmony_ci	PINCTRL_PIN(40, "FAST_SPI_CLK_FB"),
7862306a36Sopenharmony_ci	PINCTRL_PIN(41, "FAST_SPI0_CSB_1"),
7962306a36Sopenharmony_ci	PINCTRL_PIN(42, "ISH_GP_12"),
8062306a36Sopenharmony_ci	PINCTRL_PIN(43, "THC0_SPI1_INTB"),
8162306a36Sopenharmony_ci	PINCTRL_PIN(44, "THC1_SPI2_INTB"),
8262306a36Sopenharmony_ci	PINCTRL_PIN(45, "PANEL0_AVEE_EN"),
8362306a36Sopenharmony_ci	PINCTRL_PIN(46, "PANEL0_VIO_EN"),
8462306a36Sopenharmony_ci	PINCTRL_PIN(47, "PANEL1_AVEE_EN"),
8562306a36Sopenharmony_ci	PINCTRL_PIN(48, "PANEL1_VIO_EN"),
8662306a36Sopenharmony_ci	PINCTRL_PIN(49, "PANEL0_RESET"),
8762306a36Sopenharmony_ci	PINCTRL_PIN(50, "PANEL1_RESET"),
8862306a36Sopenharmony_ci	PINCTRL_PIN(51, "ISH_GP_15"),
8962306a36Sopenharmony_ci	PINCTRL_PIN(52, "ISH_GP_16"),
9062306a36Sopenharmony_ci	PINCTRL_PIN(53, "ISH_GP_17"),
9162306a36Sopenharmony_ci	PINCTRL_PIN(54, "ISH_GP_18"),
9262306a36Sopenharmony_ci	PINCTRL_PIN(55, "ISH_GP_19"),
9362306a36Sopenharmony_ci	PINCTRL_PIN(56, "ISH_GP_20"),
9462306a36Sopenharmony_ci	PINCTRL_PIN(57, "ISH_GP_21"),
9562306a36Sopenharmony_ci	PINCTRL_PIN(58, "ISH_GP_22"),
9662306a36Sopenharmony_ci	PINCTRL_PIN(59, "ISH_GP_23"),
9762306a36Sopenharmony_ci	/* NORTHWEST */
9862306a36Sopenharmony_ci	PINCTRL_PIN(60, "MCSI_GPIO_0"),
9962306a36Sopenharmony_ci	PINCTRL_PIN(61, "MCSI_GPIO_1"),
10062306a36Sopenharmony_ci	PINCTRL_PIN(62, "MCSI_GPIO_2"),
10162306a36Sopenharmony_ci	PINCTRL_PIN(63, "MCSI_GPIO_3"),
10262306a36Sopenharmony_ci	PINCTRL_PIN(64, "LPSS_I2C0_SDA"),
10362306a36Sopenharmony_ci	PINCTRL_PIN(65, "LPSS_I2C0_SCL"),
10462306a36Sopenharmony_ci	PINCTRL_PIN(66, "LPSS_I2C1_SDA"),
10562306a36Sopenharmony_ci	PINCTRL_PIN(67, "LPSS_I2C1_SCL"),
10662306a36Sopenharmony_ci	PINCTRL_PIN(68, "LPSS_I2C2_SDA"),
10762306a36Sopenharmony_ci	PINCTRL_PIN(69, "LPSS_I2C2_SCL"),
10862306a36Sopenharmony_ci	PINCTRL_PIN(70, "LPSS_I2C3_SDA"),
10962306a36Sopenharmony_ci	PINCTRL_PIN(71, "LPSS_I2C3_SCL"),
11062306a36Sopenharmony_ci	PINCTRL_PIN(72, "LPSS_I2C4_SDA"),
11162306a36Sopenharmony_ci	PINCTRL_PIN(73, "LPSS_I2C4_SCL"),
11262306a36Sopenharmony_ci	PINCTRL_PIN(74, "LPSS_I2C5_SDA"),
11362306a36Sopenharmony_ci	PINCTRL_PIN(75, "LPSS_I2C5_SCL"),
11462306a36Sopenharmony_ci	PINCTRL_PIN(76, "LPSS_I3C0_SDA"),
11562306a36Sopenharmony_ci	PINCTRL_PIN(77, "LPSS_I3C0_SCL"),
11662306a36Sopenharmony_ci	PINCTRL_PIN(78, "LPSS_I3C0_SCL_FB"),
11762306a36Sopenharmony_ci	PINCTRL_PIN(79, "LPSS_I3C1_SDA"),
11862306a36Sopenharmony_ci	PINCTRL_PIN(80, "LPSS_I3C1_SCL"),
11962306a36Sopenharmony_ci	PINCTRL_PIN(81, "LPSS_I3C1_SCL_FB"),
12062306a36Sopenharmony_ci	PINCTRL_PIN(82, "ISH_I2C0_SDA"),
12162306a36Sopenharmony_ci	PINCTRL_PIN(83, "ISH_I2C0_SCL"),
12262306a36Sopenharmony_ci	PINCTRL_PIN(84, "ISH_I2C1_SCL"),
12362306a36Sopenharmony_ci	PINCTRL_PIN(85, "ISH_I2C1_SDA"),
12462306a36Sopenharmony_ci	PINCTRL_PIN(86, "DBG_PMODE"),
12562306a36Sopenharmony_ci	PINCTRL_PIN(87, "BJTAG_TCK"),
12662306a36Sopenharmony_ci	PINCTRL_PIN(88, "BJTAG_TDI"),
12762306a36Sopenharmony_ci	PINCTRL_PIN(89, "BJTAGX"),
12862306a36Sopenharmony_ci	PINCTRL_PIN(90, "BPREQ_B"),
12962306a36Sopenharmony_ci	PINCTRL_PIN(91, "BJTAG_TMS"),
13062306a36Sopenharmony_ci	PINCTRL_PIN(92, "BPRDY_B"),
13162306a36Sopenharmony_ci	PINCTRL_PIN(93, "BJTAG_TDO"),
13262306a36Sopenharmony_ci	PINCTRL_PIN(94, "BJTAG_TRST_B_0"),
13362306a36Sopenharmony_ci	PINCTRL_PIN(95, "ISH_I3C0_SDA"),
13462306a36Sopenharmony_ci	PINCTRL_PIN(96, "ISH_I3C0_SCL"),
13562306a36Sopenharmony_ci	PINCTRL_PIN(97, "ISH_I3C0_SCL_FB"),
13662306a36Sopenharmony_ci	PINCTRL_PIN(98, "AVS_I2S_BCLK_0"),
13762306a36Sopenharmony_ci	PINCTRL_PIN(99, "AVS_I2S_MCLK_0"),
13862306a36Sopenharmony_ci	PINCTRL_PIN(100, "AVS_I2S_SFRM_0"),
13962306a36Sopenharmony_ci	PINCTRL_PIN(101, "AVS_I2S_RXD_0"),
14062306a36Sopenharmony_ci	PINCTRL_PIN(102, "AVS_I2S_TXD_0"),
14162306a36Sopenharmony_ci	PINCTRL_PIN(103, "AVS_I2S_BCLK_1"),
14262306a36Sopenharmony_ci	PINCTRL_PIN(104, "AVS_I2S_SFRM_1"),
14362306a36Sopenharmony_ci	PINCTRL_PIN(105, "AVS_I2S_RXD_1"),
14462306a36Sopenharmony_ci	PINCTRL_PIN(106, "AVS_I2S_TXD_1"),
14562306a36Sopenharmony_ci	PINCTRL_PIN(107, "AVS_I2S_BCLK_2"),
14662306a36Sopenharmony_ci	PINCTRL_PIN(108, "AVS_I2S_SFRM_2"),
14762306a36Sopenharmony_ci	PINCTRL_PIN(109, "AVS_I2S_RXD_2"),
14862306a36Sopenharmony_ci	PINCTRL_PIN(110, "AVS_I2S_TXD_2"),
14962306a36Sopenharmony_ci	PINCTRL_PIN(111, "AVS_I2S_BCLK_3"),
15062306a36Sopenharmony_ci	PINCTRL_PIN(112, "AVS_I2S_SFRM_3"),
15162306a36Sopenharmony_ci	PINCTRL_PIN(113, "AVS_I2S_RXD_3"),
15262306a36Sopenharmony_ci	PINCTRL_PIN(114, "AVS_I2S_TXD_3"),
15362306a36Sopenharmony_ci	PINCTRL_PIN(115, "AVS_I2S_BCLK_4"),
15462306a36Sopenharmony_ci	PINCTRL_PIN(116, "AVS_I2S_SFRM_4"),
15562306a36Sopenharmony_ci	PINCTRL_PIN(117, "AVS_I2S_RXD_4"),
15662306a36Sopenharmony_ci	PINCTRL_PIN(118, "AVS_I2S_TXD_4"),
15762306a36Sopenharmony_ci	PINCTRL_PIN(119, "AVS_I2S_SFRM_5"),
15862306a36Sopenharmony_ci	PINCTRL_PIN(120, "AVS_I2S_RXD_5"),
15962306a36Sopenharmony_ci	PINCTRL_PIN(121, "AVS_I2S_TXD_5"),
16062306a36Sopenharmony_ci	PINCTRL_PIN(122, "AVS_I2S_BCLK_5"),
16162306a36Sopenharmony_ci	PINCTRL_PIN(123, "AVS_SNDW_CLK_0"),
16262306a36Sopenharmony_ci	PINCTRL_PIN(124, "AVS_SNDW_DATA_0"),
16362306a36Sopenharmony_ci	PINCTRL_PIN(125, "AVS_SNDW_CLK_1"),
16462306a36Sopenharmony_ci	PINCTRL_PIN(126, "AVS_SNDW_DATA_1"),
16562306a36Sopenharmony_ci	PINCTRL_PIN(127, "AVS_SNDW_CLK_2"),
16662306a36Sopenharmony_ci	PINCTRL_PIN(128, "AVS_SNDW_DATA_2"),
16762306a36Sopenharmony_ci	PINCTRL_PIN(129, "AVS_SNDW_CLK_3"),
16862306a36Sopenharmony_ci	PINCTRL_PIN(130, "AVS_SNDW_DATA_3"),
16962306a36Sopenharmony_ci	PINCTRL_PIN(131, "VISA_PTI_CH0_D0_internal"),
17062306a36Sopenharmony_ci	PINCTRL_PIN(132, "VISA_PTI_CH0_D1_internal"),
17162306a36Sopenharmony_ci	PINCTRL_PIN(133, "VISA_PTI_CH0_D2_internal"),
17262306a36Sopenharmony_ci	PINCTRL_PIN(134, "VISA_PTI_CH0_D3_internal"),
17362306a36Sopenharmony_ci	PINCTRL_PIN(135, "VISA_PTI_CH0_D4_internal"),
17462306a36Sopenharmony_ci	PINCTRL_PIN(136, "VISA_PTI_CH0_D5_internal"),
17562306a36Sopenharmony_ci	PINCTRL_PIN(137, "VISA_PTI_CH0_D6_internal"),
17662306a36Sopenharmony_ci	PINCTRL_PIN(138, "VISA_PTI_CH0_D7_internal"),
17762306a36Sopenharmony_ci	PINCTRL_PIN(139, "VISA_PTI_CH0_CLK_internal"),
17862306a36Sopenharmony_ci	PINCTRL_PIN(140, "VISA_PTI_CH1_D0_internal"),
17962306a36Sopenharmony_ci	PINCTRL_PIN(141, "VISA_PTI_CH1_D1_internal"),
18062306a36Sopenharmony_ci	PINCTRL_PIN(142, "VISA_PTI_CH1_D2_internal"),
18162306a36Sopenharmony_ci	PINCTRL_PIN(143, "VISA_PTI_CH1_D3_internal"),
18262306a36Sopenharmony_ci	PINCTRL_PIN(144, "VISA_PTI_CH1_D4_internal"),
18362306a36Sopenharmony_ci	PINCTRL_PIN(145, "VISA_PTI_CH1_D5_internal"),
18462306a36Sopenharmony_ci	PINCTRL_PIN(146, "VISA_PTI_CH1_D6_internal"),
18562306a36Sopenharmony_ci	PINCTRL_PIN(147, "VISA_PTI_CH1_D7_internal"),
18662306a36Sopenharmony_ci	PINCTRL_PIN(148, "VISA_PTI_CH1_CLK_internal"),
18762306a36Sopenharmony_ci	/* WEST */
18862306a36Sopenharmony_ci	PINCTRL_PIN(149, "LPSS_UART0_TXD"),
18962306a36Sopenharmony_ci	PINCTRL_PIN(150, "LPSS_UART0_RXD"),
19062306a36Sopenharmony_ci	PINCTRL_PIN(151, "LPSS_UART0_RTS_B"),
19162306a36Sopenharmony_ci	PINCTRL_PIN(152, "LPSS_UART0_CTS_B"),
19262306a36Sopenharmony_ci	PINCTRL_PIN(153, "LPSS_UART1_RXD"),
19362306a36Sopenharmony_ci	PINCTRL_PIN(154, "LPSS_UART1_TXD"),
19462306a36Sopenharmony_ci	PINCTRL_PIN(155, "LPSS_UART1_RTS_B"),
19562306a36Sopenharmony_ci	PINCTRL_PIN(156, "LPSS_UART1_CTS_B"),
19662306a36Sopenharmony_ci	PINCTRL_PIN(157, "ISH_UART0_RXD"),
19762306a36Sopenharmony_ci	PINCTRL_PIN(158, "ISH_UART0_TXD"),
19862306a36Sopenharmony_ci	PINCTRL_PIN(159, "ISH_UART0_RTSB"),
19962306a36Sopenharmony_ci	PINCTRL_PIN(160, "ISH_UART0_CTSB"),
20062306a36Sopenharmony_ci	PINCTRL_PIN(161, "LPSS_SSP_0_CLK"),
20162306a36Sopenharmony_ci	PINCTRL_PIN(162, "LPSS_SSP_0_CLK_FB"),
20262306a36Sopenharmony_ci	PINCTRL_PIN(163, "LPSS_SSP_0_FS0"),
20362306a36Sopenharmony_ci	PINCTRL_PIN(164, "LPSS_SSP_0_FS1"),
20462306a36Sopenharmony_ci	PINCTRL_PIN(165, "LPSS_SSP_0_RXD"),
20562306a36Sopenharmony_ci	PINCTRL_PIN(166, "LPSS_SSP_0_TXD"),
20662306a36Sopenharmony_ci	PINCTRL_PIN(167, "ISH_UART1_RXD"),
20762306a36Sopenharmony_ci	PINCTRL_PIN(168, "ISH_UART1_TXD"),
20862306a36Sopenharmony_ci	PINCTRL_PIN(169, "ISH_UART1_RTSB"),
20962306a36Sopenharmony_ci	PINCTRL_PIN(170, "ISH_UART1_CTSB"),
21062306a36Sopenharmony_ci	PINCTRL_PIN(171, "LPSS_SSP_1_FS0"),
21162306a36Sopenharmony_ci	PINCTRL_PIN(172, "LPSS_SSP_1_FS1"),
21262306a36Sopenharmony_ci	PINCTRL_PIN(173, "LPSS_SSP_1_CLK"),
21362306a36Sopenharmony_ci	PINCTRL_PIN(174, "LPSS_SSP_1_CLK_FB"),
21462306a36Sopenharmony_ci	PINCTRL_PIN(175, "LPSS_SSP_1_RXD"),
21562306a36Sopenharmony_ci	PINCTRL_PIN(176, "LPSS_SSP_1_TXD"),
21662306a36Sopenharmony_ci	PINCTRL_PIN(177, "LPSS_SSP_2_CLK"),
21762306a36Sopenharmony_ci	PINCTRL_PIN(178, "LPSS_SSP_2_CLK_FB"),
21862306a36Sopenharmony_ci	PINCTRL_PIN(179, "LPSS_SSP_2_FS0"),
21962306a36Sopenharmony_ci	PINCTRL_PIN(180, "LPSS_SSP_2_FS1"),
22062306a36Sopenharmony_ci	PINCTRL_PIN(181, "LPSS_SSP_2_RXD"),
22162306a36Sopenharmony_ci	PINCTRL_PIN(182, "LPSS_SSP_2_TXD"),
22262306a36Sopenharmony_ci	PINCTRL_PIN(183, "ISH_SPI0_CSB0"),
22362306a36Sopenharmony_ci	PINCTRL_PIN(184, "ISH_SPI0_CSB1"),
22462306a36Sopenharmony_ci	PINCTRL_PIN(185, "ISH_SPI0_CLK"),
22562306a36Sopenharmony_ci	PINCTRL_PIN(186, "ISH_SPI0_MISO"),
22662306a36Sopenharmony_ci	PINCTRL_PIN(187, "ISH_SPI0_MOSI"),
22762306a36Sopenharmony_ci	PINCTRL_PIN(188, "ISH_GP_0"),
22862306a36Sopenharmony_ci	PINCTRL_PIN(189, "ISH_GP_1"),
22962306a36Sopenharmony_ci	PINCTRL_PIN(190, "ISH_GP_2"),
23062306a36Sopenharmony_ci	PINCTRL_PIN(191, "ISH_GP_13"),
23162306a36Sopenharmony_ci	PINCTRL_PIN(192, "ISH_GP_3"),
23262306a36Sopenharmony_ci	PINCTRL_PIN(193, "ISH_GP_4"),
23362306a36Sopenharmony_ci	PINCTRL_PIN(194, "ISH_GP_5"),
23462306a36Sopenharmony_ci	PINCTRL_PIN(195, "ISH_GP_6"),
23562306a36Sopenharmony_ci	PINCTRL_PIN(196, "ISH_GP_7"),
23662306a36Sopenharmony_ci	PINCTRL_PIN(197, "ISH_GP_8"),
23762306a36Sopenharmony_ci	PINCTRL_PIN(198, "ISH_GP_9"),
23862306a36Sopenharmony_ci	PINCTRL_PIN(199, "ISH_GP_10"),
23962306a36Sopenharmony_ci	PINCTRL_PIN(200, "ISH_GP_11"),
24062306a36Sopenharmony_ci	PINCTRL_PIN(201, "ISH_GP_14"),
24162306a36Sopenharmony_ci	PINCTRL_PIN(202, "ISH_GP_15"),
24262306a36Sopenharmony_ci	PINCTRL_PIN(203, "ISH_GP_22"),
24362306a36Sopenharmony_ci	PINCTRL_PIN(204, "ISH_GP_12"),
24462306a36Sopenharmony_ci	PINCTRL_PIN(205, "ISH_GP_30_USB_OC"),
24562306a36Sopenharmony_ci	PINCTRL_PIN(206, "LPDDRx_RESET0_n"),
24662306a36Sopenharmony_ci	PINCTRL_PIN(207, "UFS_RESET_B"),
24762306a36Sopenharmony_ci	PINCTRL_PIN(208, "UFS_REFCLK0"),
24862306a36Sopenharmony_ci	PINCTRL_PIN(209, "EMMC_SD_CLK"),
24962306a36Sopenharmony_ci	PINCTRL_PIN(210, "EMMC_SD_D0"),
25062306a36Sopenharmony_ci	PINCTRL_PIN(211, "EMMC_SD_D1"),
25162306a36Sopenharmony_ci	PINCTRL_PIN(212, "EMMC_SD_D2"),
25262306a36Sopenharmony_ci	PINCTRL_PIN(213, "EMMC_SD_D3"),
25362306a36Sopenharmony_ci	PINCTRL_PIN(214, "EMMC_D4"),
25462306a36Sopenharmony_ci	PINCTRL_PIN(215, "EMMC_D5"),
25562306a36Sopenharmony_ci	PINCTRL_PIN(216, "EMMC_D6"),
25662306a36Sopenharmony_ci	PINCTRL_PIN(217, "EMMC_D7"),
25762306a36Sopenharmony_ci	PINCTRL_PIN(218, "EMMC_SD_CMD"),
25862306a36Sopenharmony_ci	PINCTRL_PIN(219, "EMMC_RCLK"),
25962306a36Sopenharmony_ci	PINCTRL_PIN(220, "SDCARD_CLK_FB"),
26062306a36Sopenharmony_ci	PINCTRL_PIN(221, "SD_Virtual_GPIO"),
26162306a36Sopenharmony_ci	PINCTRL_PIN(222, "OSC_CLK_OUT_NFC"),
26262306a36Sopenharmony_ci	PINCTRL_PIN(223, "OSC_CLK_OUT_CAM_0"),
26362306a36Sopenharmony_ci	PINCTRL_PIN(224, "OSC_CLK_OUT_CAM_1"),
26462306a36Sopenharmony_ci	PINCTRL_PIN(225, "OSC_CLK_OUT_CAM_2"),
26562306a36Sopenharmony_ci	PINCTRL_PIN(226, "OSC_CLK_OUT_CAM_3"),
26662306a36Sopenharmony_ci	PINCTRL_PIN(227, "PCIe_LINKDOWN"),
26762306a36Sopenharmony_ci	PINCTRL_PIN(228, "NFC_CLK_REQ"),
26862306a36Sopenharmony_ci	PINCTRL_PIN(229, "PCIE_CLKREQ_N_DEV2"),
26962306a36Sopenharmony_ci	PINCTRL_PIN(230, "PCIE_CLKREQ_N_DEV3"),
27062306a36Sopenharmony_ci	PINCTRL_PIN(231, "PCIE_CLKREQ_N_DEV4"),
27162306a36Sopenharmony_ci	PINCTRL_PIN(232, "PCIE_CLKREQ_N_DEV1"),
27262306a36Sopenharmony_ci	PINCTRL_PIN(233, "PCIE_CLKREQ_N_DEV0"),
27362306a36Sopenharmony_ci	PINCTRL_PIN(234, "GMBUS_1_SCL"),
27462306a36Sopenharmony_ci	PINCTRL_PIN(235, "GMBUS_1_SDA"),
27562306a36Sopenharmony_ci	PINCTRL_PIN(236, "GMBUS_0_SCL"),
27662306a36Sopenharmony_ci	PINCTRL_PIN(237, "GMBUS_0_SDA"),
27762306a36Sopenharmony_ci	/* SOUTHEAST */
27862306a36Sopenharmony_ci	PINCTRL_PIN(238, "COMPUTE_PMIC_SVID_DATA"),
27962306a36Sopenharmony_ci	PINCTRL_PIN(239, "COMPUTE_PMIC_SVID_CLK"),
28062306a36Sopenharmony_ci	PINCTRL_PIN(240, "COMPUTE_PMIC_SVID_ALERT_B"),
28162306a36Sopenharmony_ci	PINCTRL_PIN(241, "ROP_PMIC_I2C_SCL"),
28262306a36Sopenharmony_ci	PINCTRL_PIN(242, "ROP_PMIC_I2C_SDA"),
28362306a36Sopenharmony_ci	PINCTRL_PIN(243, "ISH_TYPEC_I2C2_SDA"),
28462306a36Sopenharmony_ci	PINCTRL_PIN(244, "ISH_TYPEC_I2C2_SCL"),
28562306a36Sopenharmony_ci	PINCTRL_PIN(245, "COMPUTE_PMU_PROCHOT_B"),
28662306a36Sopenharmony_ci	PINCTRL_PIN(246, "PMU_CATERR_B"),
28762306a36Sopenharmony_ci	PINCTRL_PIN(247, "COMPUTE_PMIC_VR_READY"),
28862306a36Sopenharmony_ci	PINCTRL_PIN(248, "FORCE_FW_RELOAD"),
28962306a36Sopenharmony_ci	PINCTRL_PIN(249, "ROP_PMIC_IRQ_ISH_GPIO31_TPC_ALERT_B"),
29062306a36Sopenharmony_ci	PINCTRL_PIN(250, "ROP_PMIC_RESET_B"),
29162306a36Sopenharmony_ci	PINCTRL_PIN(251, "ROP_PMIC_STNBY_SLP_S0_B"),
29262306a36Sopenharmony_ci	PINCTRL_PIN(252, "ROP_PMIC_THERMTRIP_B"),
29362306a36Sopenharmony_ci	PINCTRL_PIN(253, "MODEM_CLKREQ"),
29462306a36Sopenharmony_ci	PINCTRL_PIN(254, "TPC0_BSSB_SBU1"),
29562306a36Sopenharmony_ci	PINCTRL_PIN(255, "TPC0_BSSB_SBU2"),
29662306a36Sopenharmony_ci	PINCTRL_PIN(256, "OSC_CLK_OUT_CAM_4"),
29762306a36Sopenharmony_ci	PINCTRL_PIN(257, "HPD1"),
29862306a36Sopenharmony_ci	PINCTRL_PIN(258, "HPD0"),
29962306a36Sopenharmony_ci	PINCTRL_PIN(259, "PMC_TIME_SYNC_0"),
30062306a36Sopenharmony_ci	PINCTRL_PIN(260, "PMC_TIME_SYNC_1"),
30162306a36Sopenharmony_ci	PINCTRL_PIN(261, "OSC_CLK_OUT_CAM_5"),
30262306a36Sopenharmony_ci	PINCTRL_PIN(262, "ISH_GP_20"),
30362306a36Sopenharmony_ci	PINCTRL_PIN(263, "ISH_GP_16"),
30462306a36Sopenharmony_ci	PINCTRL_PIN(264, "ISH_GP_17"),
30562306a36Sopenharmony_ci	PINCTRL_PIN(265, "ISH_GP_18"),
30662306a36Sopenharmony_ci	PINCTRL_PIN(266, "ISH_GP_19"),
30762306a36Sopenharmony_ci};
30862306a36Sopenharmony_ci
30962306a36Sopenharmony_cistatic const struct intel_padgroup lkf_community0_gpps[] = {
31062306a36Sopenharmony_ci	LKF_GPP(0, 0, 31, 0),		/* EAST_0 */
31162306a36Sopenharmony_ci	LKF_GPP(1, 32, 59, 32),		/* EAST_1 */
31262306a36Sopenharmony_ci};
31362306a36Sopenharmony_ci
31462306a36Sopenharmony_cistatic const struct intel_padgroup lkf_community1_gpps[] = {
31562306a36Sopenharmony_ci	LKF_GPP(0, 60, 91, 64),		/* NORTHWEST_0 */
31662306a36Sopenharmony_ci	LKF_GPP(1, 92, 123, 96),	/* NORTHWEST_1 */
31762306a36Sopenharmony_ci	LKF_GPP(2, 124, 148, 128),	/* NORTHWEST_2 */
31862306a36Sopenharmony_ci};
31962306a36Sopenharmony_ci
32062306a36Sopenharmony_cistatic const struct intel_padgroup lkf_community2_gpps[] = {
32162306a36Sopenharmony_ci	LKF_GPP(0, 149, 180, 160),	/* WEST_0 */
32262306a36Sopenharmony_ci	LKF_GPP(1, 181, 212, 192),	/* WEST_1 */
32362306a36Sopenharmony_ci	LKF_GPP(2, 213, 237, 224),	/* WEST_2 */
32462306a36Sopenharmony_ci};
32562306a36Sopenharmony_ci
32662306a36Sopenharmony_cistatic const struct intel_padgroup lkf_community3_gpps[] = {
32762306a36Sopenharmony_ci	LKF_GPP(0, 238, 266, 256),	/* SOUTHEAST */
32862306a36Sopenharmony_ci};
32962306a36Sopenharmony_ci
33062306a36Sopenharmony_cistatic const struct intel_community lkf_communities[] = {
33162306a36Sopenharmony_ci	LKF_COMMUNITY(0, 0, 59, lkf_community0_gpps),		/* EAST */
33262306a36Sopenharmony_ci	LKF_COMMUNITY(1, 60, 148, lkf_community1_gpps),		/* NORTHWEST */
33362306a36Sopenharmony_ci	LKF_COMMUNITY(2, 149, 237, lkf_community2_gpps),	/* WEST */
33462306a36Sopenharmony_ci	LKF_COMMUNITY(3, 238, 266, lkf_community3_gpps),	/* SOUTHEAST */
33562306a36Sopenharmony_ci};
33662306a36Sopenharmony_ci
33762306a36Sopenharmony_cistatic const struct intel_pinctrl_soc_data lkf_soc_data = {
33862306a36Sopenharmony_ci	.pins = lkf_pins,
33962306a36Sopenharmony_ci	.npins = ARRAY_SIZE(lkf_pins),
34062306a36Sopenharmony_ci	.communities = lkf_communities,
34162306a36Sopenharmony_ci	.ncommunities = ARRAY_SIZE(lkf_communities),
34262306a36Sopenharmony_ci};
34362306a36Sopenharmony_ci
34462306a36Sopenharmony_cistatic const struct acpi_device_id lkf_pinctrl_acpi_match[] = {
34562306a36Sopenharmony_ci	{ "INT34C4", (kernel_ulong_t)&lkf_soc_data },
34662306a36Sopenharmony_ci	{ }
34762306a36Sopenharmony_ci};
34862306a36Sopenharmony_ciMODULE_DEVICE_TABLE(acpi, lkf_pinctrl_acpi_match);
34962306a36Sopenharmony_ci
35062306a36Sopenharmony_cistatic INTEL_PINCTRL_PM_OPS(lkf_pinctrl_pm_ops);
35162306a36Sopenharmony_ci
35262306a36Sopenharmony_cistatic struct platform_driver lkf_pinctrl_driver = {
35362306a36Sopenharmony_ci	.probe = intel_pinctrl_probe_by_hid,
35462306a36Sopenharmony_ci	.driver = {
35562306a36Sopenharmony_ci		.name = "lakefield-pinctrl",
35662306a36Sopenharmony_ci		.acpi_match_table = lkf_pinctrl_acpi_match,
35762306a36Sopenharmony_ci		.pm = &lkf_pinctrl_pm_ops,
35862306a36Sopenharmony_ci	},
35962306a36Sopenharmony_ci};
36062306a36Sopenharmony_cimodule_platform_driver(lkf_pinctrl_driver);
36162306a36Sopenharmony_ci
36262306a36Sopenharmony_ciMODULE_AUTHOR("Andy Shevchenko <andriy.shevchenko@linux.intel.com>");
36362306a36Sopenharmony_ciMODULE_DESCRIPTION("Intel Lakefield PCH pinctrl/GPIO driver");
36462306a36Sopenharmony_ciMODULE_LICENSE("GPL v2");
36562306a36Sopenharmony_ciMODULE_IMPORT_NS(PINCTRL_INTEL);
366