1875a92b3SAndy Shevchenko // SPDX-License-Identifier: GPL-2.0
20f80dbc1SMika Westerberg /*
30f80dbc1SMika Westerberg * Intel Cedar Fork PCH pinctrl/GPIO driver
40f80dbc1SMika Westerberg *
50f80dbc1SMika Westerberg * Copyright (C) 2017, Intel Corporation
60f80dbc1SMika Westerberg * Author: Mika Westerberg <mika.westerberg@linux.intel.com>
70f80dbc1SMika Westerberg */
80f80dbc1SMika Westerberg
935bf5007SAndy Shevchenko #include <linux/mod_devicetable.h>
100f80dbc1SMika Westerberg #include <linux/module.h>
110f80dbc1SMika Westerberg #include <linux/platform_device.h>
12677506eeSAndy Shevchenko
130f80dbc1SMika Westerberg #include <linux/pinctrl/pinctrl.h>
140f80dbc1SMika Westerberg
150f80dbc1SMika Westerberg #include "pinctrl-intel.h"
160f80dbc1SMika Westerberg
170f80dbc1SMika Westerberg #define CDF_PAD_OWN 0x020
180f80dbc1SMika Westerberg #define CDF_PADCFGLOCK 0x0c0
190f80dbc1SMika Westerberg #define CDF_HOSTSW_OWN 0x120
200f80dbc1SMika Westerberg #define CDF_GPI_IS 0x200
210f80dbc1SMika Westerberg #define CDF_GPI_IE 0x230
220f80dbc1SMika Westerberg
230f80dbc1SMika Westerberg #define CDF_GPP(r, s, e) \
240f80dbc1SMika Westerberg { \
250f80dbc1SMika Westerberg .reg_num = (r), \
260f80dbc1SMika Westerberg .base = (s), \
270f80dbc1SMika Westerberg .size = ((e) - (s) + 1), \
280f80dbc1SMika Westerberg }
290f80dbc1SMika Westerberg
300f80dbc1SMika Westerberg #define CDF_COMMUNITY(b, s, e, g) \
31e83d7ef0SAndy Shevchenko INTEL_COMMUNITY_GPPS(b, s, e, g, CDF)
320f80dbc1SMika Westerberg
330f80dbc1SMika Westerberg /* Cedar Fork PCH */
340f80dbc1SMika Westerberg static const struct pinctrl_pin_desc cdf_pins[] = {
350f80dbc1SMika Westerberg /* WEST2 */
360f80dbc1SMika Westerberg PINCTRL_PIN(0, "GBE_SDP_TIMESYNC0_S2N"),
370f80dbc1SMika Westerberg PINCTRL_PIN(1, "GBE_SDP_TIMESYNC1_S2N"),
380f80dbc1SMika Westerberg PINCTRL_PIN(2, "GBE_SDP_TIMESYNC2_S2N"),
390f80dbc1SMika Westerberg PINCTRL_PIN(3, "GBE_SDP_TIMESYNC3_S2N"),
400f80dbc1SMika Westerberg PINCTRL_PIN(4, "GBE0_I2C_CLK"),
410f80dbc1SMika Westerberg PINCTRL_PIN(5, "GBE0_I2C_DATA"),
420f80dbc1SMika Westerberg PINCTRL_PIN(6, "GBE1_I2C_CLK"),
430f80dbc1SMika Westerberg PINCTRL_PIN(7, "GBE1_I2C_DATA"),
440f80dbc1SMika Westerberg PINCTRL_PIN(8, "GBE2_I2C_CLK"),
450f80dbc1SMika Westerberg PINCTRL_PIN(9, "GBE2_I2C_DATA"),
460f80dbc1SMika Westerberg PINCTRL_PIN(10, "GBE3_I2C_CLK"),
470f80dbc1SMika Westerberg PINCTRL_PIN(11, "GBE3_I2C_DATA"),
480f80dbc1SMika Westerberg PINCTRL_PIN(12, "GBE0_LED0"),
490f80dbc1SMika Westerberg PINCTRL_PIN(13, "GBE0_LED1"),
500f80dbc1SMika Westerberg PINCTRL_PIN(14, "GBE0_LED2"),
510f80dbc1SMika Westerberg PINCTRL_PIN(15, "GBE1_LED0"),
520f80dbc1SMika Westerberg PINCTRL_PIN(16, "GBE1_LED1"),
530f80dbc1SMika Westerberg PINCTRL_PIN(17, "GBE1_LED2"),
540f80dbc1SMika Westerberg PINCTRL_PIN(18, "GBE2_LED0"),
550f80dbc1SMika Westerberg PINCTRL_PIN(19, "GBE2_LED1"),
560f80dbc1SMika Westerberg PINCTRL_PIN(20, "GBE2_LED2"),
570f80dbc1SMika Westerberg PINCTRL_PIN(21, "GBE3_LED0"),
580f80dbc1SMika Westerberg PINCTRL_PIN(22, "GBE3_LED1"),
590f80dbc1SMika Westerberg PINCTRL_PIN(23, "GBE3_LED2"),
600f80dbc1SMika Westerberg /* WEST3 */
610f80dbc1SMika Westerberg PINCTRL_PIN(24, "NCSI_RXD0"),
620f80dbc1SMika Westerberg PINCTRL_PIN(25, "NCSI_CLK_IN"),
630f80dbc1SMika Westerberg PINCTRL_PIN(26, "NCSI_RXD1"),
640f80dbc1SMika Westerberg PINCTRL_PIN(27, "NCSI_CRS_DV"),
650f80dbc1SMika Westerberg PINCTRL_PIN(28, "NCSI_ARB_IN"),
660f80dbc1SMika Westerberg PINCTRL_PIN(29, "NCSI_TX_EN"),
670f80dbc1SMika Westerberg PINCTRL_PIN(30, "NCSI_TXD0"),
680f80dbc1SMika Westerberg PINCTRL_PIN(31, "NCSI_TXD1"),
690f80dbc1SMika Westerberg PINCTRL_PIN(32, "NCSI_ARB_OUT"),
700f80dbc1SMika Westerberg PINCTRL_PIN(33, "GBE_SMB_CLK"),
710f80dbc1SMika Westerberg PINCTRL_PIN(34, "GBE_SMB_DATA"),
720f80dbc1SMika Westerberg PINCTRL_PIN(35, "GBE_SMB_ALRT_N"),
730f80dbc1SMika Westerberg PINCTRL_PIN(36, "THERMTRIP_N"),
740f80dbc1SMika Westerberg PINCTRL_PIN(37, "PCHHOT_N"),
750f80dbc1SMika Westerberg PINCTRL_PIN(38, "ERROR0_N"),
760f80dbc1SMika Westerberg PINCTRL_PIN(39, "ERROR1_N"),
770f80dbc1SMika Westerberg PINCTRL_PIN(40, "ERROR2_N"),
780f80dbc1SMika Westerberg PINCTRL_PIN(41, "MSMI_N"),
790f80dbc1SMika Westerberg PINCTRL_PIN(42, "CATERR_N"),
800f80dbc1SMika Westerberg PINCTRL_PIN(43, "MEMTRIP_N"),
810f80dbc1SMika Westerberg PINCTRL_PIN(44, "UART0_RXD"),
820f80dbc1SMika Westerberg PINCTRL_PIN(45, "UART0_TXD"),
8310d64c87SAndy Shevchenko PINCTRL_PIN(46, "GBE_UART_RXD"),
8410d64c87SAndy Shevchenko PINCTRL_PIN(47, "GBE_UART_TXD"),
850f80dbc1SMika Westerberg /* WEST01 */
860f80dbc1SMika Westerberg PINCTRL_PIN(48, "GBE_GPIO13"),
870f80dbc1SMika Westerberg PINCTRL_PIN(49, "AUX_PWR"),
8810d64c87SAndy Shevchenko PINCTRL_PIN(50, "UART0_RTS"),
8910d64c87SAndy Shevchenko PINCTRL_PIN(51, "UART0_CTS"),
900f80dbc1SMika Westerberg PINCTRL_PIN(52, "FAN_PWM_0"),
910f80dbc1SMika Westerberg PINCTRL_PIN(53, "FAN_PWM_1"),
920f80dbc1SMika Westerberg PINCTRL_PIN(54, "FAN_PWM_2"),
930f80dbc1SMika Westerberg PINCTRL_PIN(55, "FAN_PWM_3"),
940f80dbc1SMika Westerberg PINCTRL_PIN(56, "FAN_TACH_0"),
950f80dbc1SMika Westerberg PINCTRL_PIN(57, "FAN_TACH_1"),
960f80dbc1SMika Westerberg PINCTRL_PIN(58, "FAN_TACH_2"),
970f80dbc1SMika Westerberg PINCTRL_PIN(59, "FAN_TACH_3"),
980f80dbc1SMika Westerberg PINCTRL_PIN(60, "ME_SMB0_CLK"),
990f80dbc1SMika Westerberg PINCTRL_PIN(61, "ME_SMB0_DATA"),
1000f80dbc1SMika Westerberg PINCTRL_PIN(62, "ME_SMB0_ALRT_N"),
1010f80dbc1SMika Westerberg PINCTRL_PIN(63, "ME_SMB1_CLK"),
1020f80dbc1SMika Westerberg PINCTRL_PIN(64, "ME_SMB1_DATA"),
1030f80dbc1SMika Westerberg PINCTRL_PIN(65, "ME_SMB1_ALRT_N"),
1040f80dbc1SMika Westerberg PINCTRL_PIN(66, "ME_SMB2_CLK"),
1050f80dbc1SMika Westerberg PINCTRL_PIN(67, "ME_SMB2_DATA"),
1060f80dbc1SMika Westerberg PINCTRL_PIN(68, "ME_SMB2_ALRT_N"),
1070f80dbc1SMika Westerberg PINCTRL_PIN(69, "GBE_MNG_I2C_CLK"),
1080f80dbc1SMika Westerberg PINCTRL_PIN(70, "GBE_MNG_I2C_DATA"),
1090f80dbc1SMika Westerberg /* WEST5 */
1100f80dbc1SMika Westerberg PINCTRL_PIN(71, "IE_UART_RXD"),
1110f80dbc1SMika Westerberg PINCTRL_PIN(72, "IE_UART_TXD"),
1120f80dbc1SMika Westerberg PINCTRL_PIN(73, "VPP_SMB_CLK"),
1130f80dbc1SMika Westerberg PINCTRL_PIN(74, "VPP_SMB_DATA"),
1140f80dbc1SMika Westerberg PINCTRL_PIN(75, "VPP_SMB_ALRT_N"),
1150f80dbc1SMika Westerberg PINCTRL_PIN(76, "PCIE_CLKREQ0_N"),
1160f80dbc1SMika Westerberg PINCTRL_PIN(77, "PCIE_CLKREQ1_N"),
1170f80dbc1SMika Westerberg PINCTRL_PIN(78, "PCIE_CLKREQ2_N"),
1180f80dbc1SMika Westerberg PINCTRL_PIN(79, "PCIE_CLKREQ3_N"),
1190f80dbc1SMika Westerberg PINCTRL_PIN(80, "PCIE_CLKREQ4_N"),
1200f80dbc1SMika Westerberg PINCTRL_PIN(81, "PCIE_CLKREQ5_N"),
1210f80dbc1SMika Westerberg PINCTRL_PIN(82, "PCIE_CLKREQ6_N"),
1220f80dbc1SMika Westerberg PINCTRL_PIN(83, "PCIE_CLKREQ7_N"),
1230f80dbc1SMika Westerberg PINCTRL_PIN(84, "PCIE_CLKREQ8_N"),
1240f80dbc1SMika Westerberg PINCTRL_PIN(85, "PCIE_CLKREQ9_N"),
1250f80dbc1SMika Westerberg PINCTRL_PIN(86, "FLEX_CLK_SE0"),
1260f80dbc1SMika Westerberg PINCTRL_PIN(87, "FLEX_CLK_SE1"),
1270f80dbc1SMika Westerberg PINCTRL_PIN(88, "FLEX_CLK1_50"),
1280f80dbc1SMika Westerberg PINCTRL_PIN(89, "FLEX_CLK2_50"),
1290f80dbc1SMika Westerberg PINCTRL_PIN(90, "FLEX_CLK_125"),
1300f80dbc1SMika Westerberg /* WESTC */
1310f80dbc1SMika Westerberg PINCTRL_PIN(91, "TCK_PCH"),
1320f80dbc1SMika Westerberg PINCTRL_PIN(92, "JTAGX_PCH"),
1330f80dbc1SMika Westerberg PINCTRL_PIN(93, "TRST_N_PCH"),
1340f80dbc1SMika Westerberg PINCTRL_PIN(94, "TMS_PCH"),
1350f80dbc1SMika Westerberg PINCTRL_PIN(95, "TDI_PCH"),
1360f80dbc1SMika Westerberg PINCTRL_PIN(96, "TDO_PCH"),
1370f80dbc1SMika Westerberg /* WESTC_DFX */
1380f80dbc1SMika Westerberg PINCTRL_PIN(97, "CX_PRDY_N"),
1390f80dbc1SMika Westerberg PINCTRL_PIN(98, "CX_PREQ_N"),
1400f80dbc1SMika Westerberg PINCTRL_PIN(99, "CPU_FBREAK_OUT_N"),
1410f80dbc1SMika Westerberg PINCTRL_PIN(100, "TRIGGER0_N"),
1420f80dbc1SMika Westerberg PINCTRL_PIN(101, "TRIGGER1_N"),
1430f80dbc1SMika Westerberg /* WESTA */
1440f80dbc1SMika Westerberg PINCTRL_PIN(102, "DBG_PTI_CLK0"),
1450f80dbc1SMika Westerberg PINCTRL_PIN(103, "DBG_PTI_CLK3"),
1460f80dbc1SMika Westerberg PINCTRL_PIN(104, "DBG_PTI_DATA0"),
1470f80dbc1SMika Westerberg PINCTRL_PIN(105, "DBG_PTI_DATA1"),
1480f80dbc1SMika Westerberg PINCTRL_PIN(106, "DBG_PTI_DATA2"),
1490f80dbc1SMika Westerberg PINCTRL_PIN(107, "DBG_PTI_DATA3"),
1500f80dbc1SMika Westerberg PINCTRL_PIN(108, "DBG_PTI_DATA4"),
1510f80dbc1SMika Westerberg PINCTRL_PIN(109, "DBG_PTI_DATA5"),
1520f80dbc1SMika Westerberg PINCTRL_PIN(110, "DBG_PTI_DATA6"),
1530f80dbc1SMika Westerberg PINCTRL_PIN(111, "DBG_PTI_DATA7"),
1540f80dbc1SMika Westerberg /* WESTB */
1550f80dbc1SMika Westerberg PINCTRL_PIN(112, "DBG_PTI_DATA8"),
1560f80dbc1SMika Westerberg PINCTRL_PIN(113, "DBG_PTI_DATA9"),
1570f80dbc1SMika Westerberg PINCTRL_PIN(114, "DBG_PTI_DATA10"),
1580f80dbc1SMika Westerberg PINCTRL_PIN(115, "DBG_PTI_DATA11"),
1590f80dbc1SMika Westerberg PINCTRL_PIN(116, "DBG_PTI_DATA12"),
1600f80dbc1SMika Westerberg PINCTRL_PIN(117, "DBG_PTI_DATA13"),
1610f80dbc1SMika Westerberg PINCTRL_PIN(118, "DBG_PTI_DATA14"),
1620f80dbc1SMika Westerberg PINCTRL_PIN(119, "DBG_PTI_DATA15"),
1630f80dbc1SMika Westerberg PINCTRL_PIN(120, "DBG_SPARE0"),
1640f80dbc1SMika Westerberg PINCTRL_PIN(121, "DBG_SPARE1"),
1650f80dbc1SMika Westerberg PINCTRL_PIN(122, "DBG_SPARE2"),
1660f80dbc1SMika Westerberg PINCTRL_PIN(123, "DBG_SPARE3"),
1670f80dbc1SMika Westerberg /* WESTD */
1680f80dbc1SMika Westerberg PINCTRL_PIN(124, "CPU_PWR_GOOD"),
1690f80dbc1SMika Westerberg PINCTRL_PIN(125, "PLTRST_CPU_N"),
1700f80dbc1SMika Westerberg PINCTRL_PIN(126, "NAC_RESET_NAC_N"),
1710f80dbc1SMika Westerberg PINCTRL_PIN(127, "PCH_SBLINK_RX"),
1720f80dbc1SMika Westerberg PINCTRL_PIN(128, "PCH_SBLINK_TX"),
1730f80dbc1SMika Westerberg PINCTRL_PIN(129, "PMSYNC_CLK"),
1740f80dbc1SMika Westerberg PINCTRL_PIN(130, "CPU_ERR0_N"),
1750f80dbc1SMika Westerberg PINCTRL_PIN(131, "CPU_ERR1_N"),
1760f80dbc1SMika Westerberg PINCTRL_PIN(132, "CPU_ERR2_N"),
1770f80dbc1SMika Westerberg PINCTRL_PIN(133, "CPU_THERMTRIP_N"),
1780f80dbc1SMika Westerberg PINCTRL_PIN(134, "CPU_MSMI_N"),
1790f80dbc1SMika Westerberg PINCTRL_PIN(135, "CPU_CATERR_N"),
1800f80dbc1SMika Westerberg PINCTRL_PIN(136, "CPU_MEMTRIP_N"),
1810f80dbc1SMika Westerberg PINCTRL_PIN(137, "NAC_GR_N"),
1820f80dbc1SMika Westerberg PINCTRL_PIN(138, "NAC_XTAL_VALID"),
1830f80dbc1SMika Westerberg PINCTRL_PIN(139, "NAC_WAKE_N"),
1840f80dbc1SMika Westerberg PINCTRL_PIN(140, "NAC_SBLINK_CLK_S2N"),
1850f80dbc1SMika Westerberg PINCTRL_PIN(141, "NAC_SBLINK_N2S"),
1860f80dbc1SMika Westerberg PINCTRL_PIN(142, "NAC_SBLINK_S2N"),
1870f80dbc1SMika Westerberg PINCTRL_PIN(143, "NAC_SBLINK_CLK_N2S"),
1880f80dbc1SMika Westerberg /* WESTD_PECI */
1890f80dbc1SMika Westerberg PINCTRL_PIN(144, "ME_PECI"),
1900f80dbc1SMika Westerberg /* WESTF */
1910f80dbc1SMika Westerberg PINCTRL_PIN(145, "NAC_RMII_CLK"),
1920f80dbc1SMika Westerberg PINCTRL_PIN(146, "NAC_RGMII_CLK"),
19310d64c87SAndy Shevchenko PINCTRL_PIN(147, "NAC_GBE_SMB_CLK_TX_N2S"),
19410d64c87SAndy Shevchenko PINCTRL_PIN(148, "NAC_GBE_SMB_DATA_TX_N2S"),
1950f80dbc1SMika Westerberg PINCTRL_PIN(149, "NAC_SPARE2"),
1960f80dbc1SMika Westerberg PINCTRL_PIN(150, "NAC_INIT_SX_WAKE_N"),
1970f80dbc1SMika Westerberg PINCTRL_PIN(151, "NAC_GBE_GPIO0_S2N"),
1980f80dbc1SMika Westerberg PINCTRL_PIN(152, "NAC_GBE_GPIO1_S2N"),
1990f80dbc1SMika Westerberg PINCTRL_PIN(153, "NAC_GBE_GPIO2_S2N"),
2000f80dbc1SMika Westerberg PINCTRL_PIN(154, "NAC_GBE_GPIO3_S2N"),
2010f80dbc1SMika Westerberg PINCTRL_PIN(155, "NAC_NCSI_RXD0"),
2020f80dbc1SMika Westerberg PINCTRL_PIN(156, "NAC_NCSI_CLK_IN"),
2030f80dbc1SMika Westerberg PINCTRL_PIN(157, "NAC_NCSI_RXD1"),
2040f80dbc1SMika Westerberg PINCTRL_PIN(158, "NAC_NCSI_CRS_DV"),
2050f80dbc1SMika Westerberg PINCTRL_PIN(159, "NAC_NCSI_ARB_IN"),
2060f80dbc1SMika Westerberg PINCTRL_PIN(160, "NAC_NCSI_TX_EN"),
2070f80dbc1SMika Westerberg PINCTRL_PIN(161, "NAC_NCSI_TXD0"),
2080f80dbc1SMika Westerberg PINCTRL_PIN(162, "NAC_NCSI_TXD1"),
2090f80dbc1SMika Westerberg PINCTRL_PIN(163, "NAC_NCSI_ARB_OUT"),
2100f80dbc1SMika Westerberg PINCTRL_PIN(164, "NAC_NCSI_OE_N"),
21110d64c87SAndy Shevchenko PINCTRL_PIN(165, "NAC_GBE_SMB_CLK_RX_S2N"),
21210d64c87SAndy Shevchenko PINCTRL_PIN(166, "NAC_GBE_SMB_DATA_RX_S2N"),
2130f80dbc1SMika Westerberg PINCTRL_PIN(167, "NAC_GBE_SMB_ALRT_N"),
2140f80dbc1SMika Westerberg /* EAST2 */
2150f80dbc1SMika Westerberg PINCTRL_PIN(168, "USB_OC0_N"),
2160f80dbc1SMika Westerberg PINCTRL_PIN(169, "GBE_GPIO0"),
2170f80dbc1SMika Westerberg PINCTRL_PIN(170, "GBE_GPIO1"),
2180f80dbc1SMika Westerberg PINCTRL_PIN(171, "GBE_GPIO2"),
2190f80dbc1SMika Westerberg PINCTRL_PIN(172, "GBE_GPIO3"),
2200f80dbc1SMika Westerberg PINCTRL_PIN(173, "GBE_GPIO4"),
2210f80dbc1SMika Westerberg PINCTRL_PIN(174, "GBE_GPIO5"),
2220f80dbc1SMika Westerberg PINCTRL_PIN(175, "GBE_GPIO6"),
2230f80dbc1SMika Westerberg PINCTRL_PIN(176, "GBE_GPIO7"),
22410d64c87SAndy Shevchenko PINCTRL_PIN(177, "SPI_TPM_CS_N"),
2250f80dbc1SMika Westerberg PINCTRL_PIN(178, "GBE_GPIO9"),
2260f80dbc1SMika Westerberg PINCTRL_PIN(179, "GBE_GPIO10"),
2270f80dbc1SMika Westerberg PINCTRL_PIN(180, "GBE_GPIO11"),
2280f80dbc1SMika Westerberg PINCTRL_PIN(181, "GBE_GPIO12"),
229a319b561SMika Westerberg PINCTRL_PIN(182, "PECI_SMB_DATA"),
230a319b561SMika Westerberg PINCTRL_PIN(183, "SATA0_LED_N"),
231a319b561SMika Westerberg PINCTRL_PIN(184, "SATA1_LED_N"),
232a319b561SMika Westerberg PINCTRL_PIN(185, "SATA_PDETECT0"),
233a319b561SMika Westerberg PINCTRL_PIN(186, "SATA_PDETECT1"),
234a319b561SMika Westerberg PINCTRL_PIN(187, "SATA0_SDOUT"),
235a319b561SMika Westerberg PINCTRL_PIN(188, "SATA1_SDOUT"),
236a319b561SMika Westerberg PINCTRL_PIN(189, "SATA2_LED_N"),
237a319b561SMika Westerberg PINCTRL_PIN(190, "SATA_PDETECT2"),
238a319b561SMika Westerberg PINCTRL_PIN(191, "SATA2_SDOUT"),
2390f80dbc1SMika Westerberg /* EAST3 */
240a319b561SMika Westerberg PINCTRL_PIN(192, "ESPI_IO0"),
241a319b561SMika Westerberg PINCTRL_PIN(193, "ESPI_IO1"),
242a319b561SMika Westerberg PINCTRL_PIN(194, "ESPI_IO2"),
243a319b561SMika Westerberg PINCTRL_PIN(195, "ESPI_IO3"),
244a319b561SMika Westerberg PINCTRL_PIN(196, "ESPI_CLK"),
245a319b561SMika Westerberg PINCTRL_PIN(197, "ESPI_RST_N"),
246a319b561SMika Westerberg PINCTRL_PIN(198, "ESPI_CS0_N"),
247a319b561SMika Westerberg PINCTRL_PIN(199, "ESPI_ALRT0_N"),
248a319b561SMika Westerberg PINCTRL_PIN(200, "ESPI_CS1_N"),
249a319b561SMika Westerberg PINCTRL_PIN(201, "ESPI_ALRT1_N"),
250a319b561SMika Westerberg PINCTRL_PIN(202, "ESPI_CLK_LOOPBK"),
2510f80dbc1SMika Westerberg /* EAST0 */
252a319b561SMika Westerberg PINCTRL_PIN(203, "SPI_CS0_N"),
253a319b561SMika Westerberg PINCTRL_PIN(204, "SPI_CS1_N"),
254a319b561SMika Westerberg PINCTRL_PIN(205, "SPI_MOSI_IO0"),
255a319b561SMika Westerberg PINCTRL_PIN(206, "SPI_MISO_IO1"),
256a319b561SMika Westerberg PINCTRL_PIN(207, "SPI_IO2"),
257a319b561SMika Westerberg PINCTRL_PIN(208, "SPI_IO3"),
258a319b561SMika Westerberg PINCTRL_PIN(209, "SPI_CLK"),
259a319b561SMika Westerberg PINCTRL_PIN(210, "SPI_CLK_LOOPBK"),
260a319b561SMika Westerberg PINCTRL_PIN(211, "SUSPWRDNACK"),
261a319b561SMika Westerberg PINCTRL_PIN(212, "PMU_SUSCLK"),
262a319b561SMika Westerberg PINCTRL_PIN(213, "ADR_COMPLETE"),
263a319b561SMika Westerberg PINCTRL_PIN(214, "ADR_TRIGGER_N"),
264a319b561SMika Westerberg PINCTRL_PIN(215, "PMU_SLP_S45_N"),
265a319b561SMika Westerberg PINCTRL_PIN(216, "PMU_SLP_S3_N"),
266a319b561SMika Westerberg PINCTRL_PIN(217, "PMU_WAKE_N"),
267a319b561SMika Westerberg PINCTRL_PIN(218, "PMU_PWRBTN_N"),
268a319b561SMika Westerberg PINCTRL_PIN(219, "PMU_RESETBUTTON_N"),
269a319b561SMika Westerberg PINCTRL_PIN(220, "PMU_PLTRST_N"),
270a319b561SMika Westerberg PINCTRL_PIN(221, "SUS_STAT_N"),
271a319b561SMika Westerberg PINCTRL_PIN(222, "PMU_I2C_CLK"),
272a319b561SMika Westerberg PINCTRL_PIN(223, "PMU_I2C_DATA"),
273a319b561SMika Westerberg PINCTRL_PIN(224, "PECI_SMB_CLK"),
2740f80dbc1SMika Westerberg PINCTRL_PIN(225, "PECI_SMB_ALRT_N"),
2750f80dbc1SMika Westerberg /* EMMC */
2760f80dbc1SMika Westerberg PINCTRL_PIN(226, "EMMC_CMD"),
2770f80dbc1SMika Westerberg PINCTRL_PIN(227, "EMMC_STROBE"),
2780f80dbc1SMika Westerberg PINCTRL_PIN(228, "EMMC_CLK"),
2790f80dbc1SMika Westerberg PINCTRL_PIN(229, "EMMC_D0"),
2800f80dbc1SMika Westerberg PINCTRL_PIN(230, "EMMC_D1"),
2810f80dbc1SMika Westerberg PINCTRL_PIN(231, "EMMC_D2"),
2820f80dbc1SMika Westerberg PINCTRL_PIN(232, "EMMC_D3"),
2830f80dbc1SMika Westerberg PINCTRL_PIN(233, "EMMC_D4"),
2840f80dbc1SMika Westerberg PINCTRL_PIN(234, "EMMC_D5"),
2850f80dbc1SMika Westerberg PINCTRL_PIN(235, "EMMC_D6"),
2860f80dbc1SMika Westerberg PINCTRL_PIN(236, "EMMC_D7"),
2870f80dbc1SMika Westerberg };
2880f80dbc1SMika Westerberg
2890f80dbc1SMika Westerberg static const struct intel_padgroup cdf_community0_gpps[] = {
2900f80dbc1SMika Westerberg CDF_GPP(0, 0, 23), /* WEST2 */
2910f80dbc1SMika Westerberg CDF_GPP(1, 24, 47), /* WEST3 */
2920f80dbc1SMika Westerberg CDF_GPP(2, 48, 70), /* WEST01 */
2930f80dbc1SMika Westerberg CDF_GPP(3, 71, 90), /* WEST5 */
2940f80dbc1SMika Westerberg CDF_GPP(4, 91, 96), /* WESTC */
2950f80dbc1SMika Westerberg CDF_GPP(5, 97, 101), /* WESTC_DFX */
2960f80dbc1SMika Westerberg CDF_GPP(6, 102, 111), /* WESTA */
2970f80dbc1SMika Westerberg CDF_GPP(7, 112, 123), /* WESTB */
2980f80dbc1SMika Westerberg CDF_GPP(8, 124, 143), /* WESTD */
2990f80dbc1SMika Westerberg CDF_GPP(9, 144, 144), /* WESTD_PECI */
3000f80dbc1SMika Westerberg CDF_GPP(10, 145, 167), /* WESTF */
3010f80dbc1SMika Westerberg };
3020f80dbc1SMika Westerberg
3030f80dbc1SMika Westerberg static const struct intel_padgroup cdf_community1_gpps[] = {
304a319b561SMika Westerberg CDF_GPP(0, 168, 191), /* EAST2 */
305a319b561SMika Westerberg CDF_GPP(1, 192, 202), /* EAST3 */
306a319b561SMika Westerberg CDF_GPP(2, 203, 225), /* EAST0 */
3070f80dbc1SMika Westerberg CDF_GPP(3, 226, 236), /* EMMC */
3080f80dbc1SMika Westerberg };
3090f80dbc1SMika Westerberg
3100f80dbc1SMika Westerberg static const struct intel_community cdf_communities[] = {
3110f80dbc1SMika Westerberg CDF_COMMUNITY(0, 0, 167, cdf_community0_gpps), /* West */
3120f80dbc1SMika Westerberg CDF_COMMUNITY(1, 168, 236, cdf_community1_gpps), /* East */
3130f80dbc1SMika Westerberg };
3140f80dbc1SMika Westerberg
3150f80dbc1SMika Westerberg static const struct intel_pinctrl_soc_data cdf_soc_data = {
3160f80dbc1SMika Westerberg .pins = cdf_pins,
3170f80dbc1SMika Westerberg .npins = ARRAY_SIZE(cdf_pins),
3180f80dbc1SMika Westerberg .communities = cdf_communities,
3190f80dbc1SMika Westerberg .ncommunities = ARRAY_SIZE(cdf_communities),
3200f80dbc1SMika Westerberg };
3210f80dbc1SMika Westerberg
322b417748cSAndy Shevchenko static INTEL_PINCTRL_PM_OPS(cdf_pinctrl_pm_ops);
3230f80dbc1SMika Westerberg
3240f80dbc1SMika Westerberg static const struct acpi_device_id cdf_pinctrl_acpi_match[] = {
3256ad3d495SAndy Shevchenko { "INTC3001", (kernel_ulong_t)&cdf_soc_data },
3260f80dbc1SMika Westerberg { }
3270f80dbc1SMika Westerberg };
3280f80dbc1SMika Westerberg MODULE_DEVICE_TABLE(acpi, cdf_pinctrl_acpi_match);
3290f80dbc1SMika Westerberg
3300f80dbc1SMika Westerberg static struct platform_driver cdf_pinctrl_driver = {
3316ad3d495SAndy Shevchenko .probe = intel_pinctrl_probe_by_hid,
3320f80dbc1SMika Westerberg .driver = {
3330f80dbc1SMika Westerberg .name = "cedarfork-pinctrl",
3340f80dbc1SMika Westerberg .acpi_match_table = cdf_pinctrl_acpi_match,
3350f80dbc1SMika Westerberg .pm = &cdf_pinctrl_pm_ops,
3360f80dbc1SMika Westerberg },
3370f80dbc1SMika Westerberg };
3380f80dbc1SMika Westerberg
cdf_pinctrl_init(void)3390f80dbc1SMika Westerberg static int __init cdf_pinctrl_init(void)
3400f80dbc1SMika Westerberg {
3410f80dbc1SMika Westerberg return platform_driver_register(&cdf_pinctrl_driver);
3420f80dbc1SMika Westerberg }
3430f80dbc1SMika Westerberg subsys_initcall(cdf_pinctrl_init);
3440f80dbc1SMika Westerberg
cdf_pinctrl_exit(void)3450f80dbc1SMika Westerberg static void __exit cdf_pinctrl_exit(void)
3460f80dbc1SMika Westerberg {
3470f80dbc1SMika Westerberg platform_driver_unregister(&cdf_pinctrl_driver);
3480f80dbc1SMika Westerberg }
3490f80dbc1SMika Westerberg module_exit(cdf_pinctrl_exit);
3500f80dbc1SMika Westerberg
3510f80dbc1SMika Westerberg MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>");
3520f80dbc1SMika Westerberg MODULE_DESCRIPTION("Intel Cedar Fork PCH pinctrl/GPIO driver");
3530f80dbc1SMika Westerberg MODULE_LICENSE("GPL v2");
354*34393c36SAndy Shevchenko MODULE_IMPORT_NS(PINCTRL_INTEL);
355