pinctrl-cannonlake.c 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865
  1. /*
  2. * Intel Cannon Lake PCH pinctrl/GPIO driver
  3. *
  4. * Copyright (C) 2017, Intel Corporation
  5. * Authors: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
  6. * Mika Westerberg <mika.westerberg@linux.intel.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #include <linux/acpi.h>
  13. #include <linux/module.h>
  14. #include <linux/platform_device.h>
  15. #include <linux/pm.h>
  16. #include <linux/pinctrl/pinctrl.h>
  17. #include "pinctrl-intel.h"
  18. #define CNL_PAD_OWN 0x020
  19. #define CNL_PADCFGLOCK 0x080
  20. #define CNL_HOSTSW_OWN 0x0b0
  21. #define CNL_GPI_IE 0x120
  22. #define CNL_GPP(r, s, e) \
  23. { \
  24. .reg_num = (r), \
  25. .base = (s), \
  26. .size = ((e) - (s) + 1), \
  27. }
  28. #define CNL_COMMUNITY(b, s, e, g) \
  29. { \
  30. .barno = (b), \
  31. .padown_offset = CNL_PAD_OWN, \
  32. .padcfglock_offset = CNL_PADCFGLOCK, \
  33. .hostown_offset = CNL_HOSTSW_OWN, \
  34. .ie_offset = CNL_GPI_IE, \
  35. .pin_base = (s), \
  36. .npins = ((e) - (s) + 1), \
  37. .gpps = (g), \
  38. .ngpps = ARRAY_SIZE(g), \
  39. }
  40. /* Cannon Lake-H */
  41. static const struct pinctrl_pin_desc cnlh_pins[] = {
  42. /* GPP_A */
  43. PINCTRL_PIN(0, "RCINB"),
  44. PINCTRL_PIN(1, "LAD_0"),
  45. PINCTRL_PIN(2, "LAD_1"),
  46. PINCTRL_PIN(3, "LAD_2"),
  47. PINCTRL_PIN(4, "LAD_3"),
  48. PINCTRL_PIN(5, "LFRAMEB"),
  49. PINCTRL_PIN(6, "SERIRQ"),
  50. PINCTRL_PIN(7, "PIRQAB"),
  51. PINCTRL_PIN(8, "CLKRUNB"),
  52. PINCTRL_PIN(9, "CLKOUT_LPC_0"),
  53. PINCTRL_PIN(10, "CLKOUT_LPC_1"),
  54. PINCTRL_PIN(11, "PMEB"),
  55. PINCTRL_PIN(12, "BM_BUSYB"),
  56. PINCTRL_PIN(13, "SUSWARNB_SUSPWRDNACK"),
  57. PINCTRL_PIN(14, "SUS_STATB"),
  58. PINCTRL_PIN(15, "SUSACKB"),
  59. PINCTRL_PIN(16, "CLKOUT_48"),
  60. PINCTRL_PIN(17, "SD_VDD1_PWR_EN_B"),
  61. PINCTRL_PIN(18, "ISH_GP_0"),
  62. PINCTRL_PIN(19, "ISH_GP_1"),
  63. PINCTRL_PIN(20, "ISH_GP_2"),
  64. PINCTRL_PIN(21, "ISH_GP_3"),
  65. PINCTRL_PIN(22, "ISH_GP_4"),
  66. PINCTRL_PIN(23, "ISH_GP_5"),
  67. PINCTRL_PIN(24, "ESPI_CLK_LOOPBK"),
  68. /* GPP_B */
  69. PINCTRL_PIN(25, "GSPI0_CS1B"),
  70. PINCTRL_PIN(26, "GSPI1_CS1B"),
  71. PINCTRL_PIN(27, "VRALERTB"),
  72. PINCTRL_PIN(28, "CPU_GP_2"),
  73. PINCTRL_PIN(29, "CPU_GP_3"),
  74. PINCTRL_PIN(30, "SRCCLKREQB_0"),
  75. PINCTRL_PIN(31, "SRCCLKREQB_1"),
  76. PINCTRL_PIN(32, "SRCCLKREQB_2"),
  77. PINCTRL_PIN(33, "SRCCLKREQB_3"),
  78. PINCTRL_PIN(34, "SRCCLKREQB_4"),
  79. PINCTRL_PIN(35, "SRCCLKREQB_5"),
  80. PINCTRL_PIN(36, "SSP_MCLK"),
  81. PINCTRL_PIN(37, "SLP_S0B"),
  82. PINCTRL_PIN(38, "PLTRSTB"),
  83. PINCTRL_PIN(39, "SPKR"),
  84. PINCTRL_PIN(40, "GSPI0_CS0B"),
  85. PINCTRL_PIN(41, "GSPI0_CLK"),
  86. PINCTRL_PIN(42, "GSPI0_MISO"),
  87. PINCTRL_PIN(43, "GSPI0_MOSI"),
  88. PINCTRL_PIN(44, "GSPI1_CS0B"),
  89. PINCTRL_PIN(45, "GSPI1_CLK"),
  90. PINCTRL_PIN(46, "GSPI1_MISO"),
  91. PINCTRL_PIN(47, "GSPI1_MOSI"),
  92. PINCTRL_PIN(48, "SML1ALERTB"),
  93. PINCTRL_PIN(49, "GSPI0_CLK_LOOPBK"),
  94. PINCTRL_PIN(50, "GSPI1_CLK_LOOPBK"),
  95. /* GPP_C */
  96. PINCTRL_PIN(51, "SMBCLK"),
  97. PINCTRL_PIN(52, "SMBDATA"),
  98. PINCTRL_PIN(53, "SMBALERTB"),
  99. PINCTRL_PIN(54, "SML0CLK"),
  100. PINCTRL_PIN(55, "SML0DATA"),
  101. PINCTRL_PIN(56, "SML0ALERTB"),
  102. PINCTRL_PIN(57, "SML1CLK"),
  103. PINCTRL_PIN(58, "SML1DATA"),
  104. PINCTRL_PIN(59, "UART0_RXD"),
  105. PINCTRL_PIN(60, "UART0_TXD"),
  106. PINCTRL_PIN(61, "UART0_RTSB"),
  107. PINCTRL_PIN(62, "UART0_CTSB"),
  108. PINCTRL_PIN(63, "UART1_RXD"),
  109. PINCTRL_PIN(64, "UART1_TXD"),
  110. PINCTRL_PIN(65, "UART1_RTSB"),
  111. PINCTRL_PIN(66, "UART1_CTSB"),
  112. PINCTRL_PIN(67, "I2C0_SDA"),
  113. PINCTRL_PIN(68, "I2C0_SCL"),
  114. PINCTRL_PIN(69, "I2C1_SDA"),
  115. PINCTRL_PIN(70, "I2C1_SCL"),
  116. PINCTRL_PIN(71, "UART2_RXD"),
  117. PINCTRL_PIN(72, "UART2_TXD"),
  118. PINCTRL_PIN(73, "UART2_RTSB"),
  119. PINCTRL_PIN(74, "UART2_CTSB"),
  120. /* GPP_D */
  121. PINCTRL_PIN(75, "SPI1_CSB"),
  122. PINCTRL_PIN(76, "SPI1_CLK"),
  123. PINCTRL_PIN(77, "SPI1_MISO_IO_1"),
  124. PINCTRL_PIN(78, "SPI1_MOSI_IO_0"),
  125. PINCTRL_PIN(79, "ISH_I2C2_SDA"),
  126. PINCTRL_PIN(80, "SSP2_SFRM"),
  127. PINCTRL_PIN(81, "SSP2_TXD"),
  128. PINCTRL_PIN(82, "SSP2_RXD"),
  129. PINCTRL_PIN(83, "SSP2_SCLK"),
  130. PINCTRL_PIN(84, "ISH_SPI_CSB"),
  131. PINCTRL_PIN(85, "ISH_SPI_CLK"),
  132. PINCTRL_PIN(86, "ISH_SPI_MISO"),
  133. PINCTRL_PIN(87, "ISH_SPI_MOSI"),
  134. PINCTRL_PIN(88, "ISH_UART0_RXD"),
  135. PINCTRL_PIN(89, "ISH_UART0_TXD"),
  136. PINCTRL_PIN(90, "ISH_UART0_RTSB"),
  137. PINCTRL_PIN(91, "ISH_UART0_CTSB"),
  138. PINCTRL_PIN(92, "DMIC_CLK_1"),
  139. PINCTRL_PIN(93, "DMIC_DATA_1"),
  140. PINCTRL_PIN(94, "DMIC_CLK_0"),
  141. PINCTRL_PIN(95, "DMIC_DATA_0"),
  142. PINCTRL_PIN(96, "SPI1_IO_2"),
  143. PINCTRL_PIN(97, "SPI1_IO_3"),
  144. PINCTRL_PIN(98, "ISH_I2C2_SCL"),
  145. /* GPP_G */
  146. PINCTRL_PIN(99, "SD3_CMD"),
  147. PINCTRL_PIN(100, "SD3_D0"),
  148. PINCTRL_PIN(101, "SD3_D1"),
  149. PINCTRL_PIN(102, "SD3_D2"),
  150. PINCTRL_PIN(103, "SD3_D3"),
  151. PINCTRL_PIN(104, "SD3_CDB"),
  152. PINCTRL_PIN(105, "SD3_CLK"),
  153. PINCTRL_PIN(106, "SD3_WP"),
  154. /* AZA */
  155. PINCTRL_PIN(107, "HDA_BCLK"),
  156. PINCTRL_PIN(108, "HDA_RSTB"),
  157. PINCTRL_PIN(109, "HDA_SYNC"),
  158. PINCTRL_PIN(110, "HDA_SDO"),
  159. PINCTRL_PIN(111, "HDA_SDI_0"),
  160. PINCTRL_PIN(112, "HDA_SDI_1"),
  161. PINCTRL_PIN(113, "SSP1_SFRM"),
  162. PINCTRL_PIN(114, "SSP1_TXD"),
  163. /* vGPIO */
  164. PINCTRL_PIN(115, "CNV_BTEN"),
  165. PINCTRL_PIN(116, "CNV_GNEN"),
  166. PINCTRL_PIN(117, "CNV_WFEN"),
  167. PINCTRL_PIN(118, "CNV_WCEN"),
  168. PINCTRL_PIN(119, "CNV_BT_HOST_WAKEB"),
  169. PINCTRL_PIN(120, "vCNV_GNSS_HOST_WAKEB"),
  170. PINCTRL_PIN(121, "vSD3_CD_B"),
  171. PINCTRL_PIN(122, "CNV_BT_IF_SELECT"),
  172. PINCTRL_PIN(123, "vCNV_BT_UART_TXD"),
  173. PINCTRL_PIN(124, "vCNV_BT_UART_RXD"),
  174. PINCTRL_PIN(125, "vCNV_BT_UART_CTS_B"),
  175. PINCTRL_PIN(126, "vCNV_BT_UART_RTS_B"),
  176. PINCTRL_PIN(127, "vCNV_MFUART1_TXD"),
  177. PINCTRL_PIN(128, "vCNV_MFUART1_RXD"),
  178. PINCTRL_PIN(129, "vCNV_MFUART1_CTS_B"),
  179. PINCTRL_PIN(130, "vCNV_MFUART1_RTS_B"),
  180. PINCTRL_PIN(131, "vCNV_GNSS_UART_TXD"),
  181. PINCTRL_PIN(132, "vCNV_GNSS_UART_RXD"),
  182. PINCTRL_PIN(133, "vCNV_GNSS_UART_CTS_B"),
  183. PINCTRL_PIN(134, "vCNV_GNSS_UART_RTS_B"),
  184. PINCTRL_PIN(135, "vUART0_TXD"),
  185. PINCTRL_PIN(136, "vUART0_RXD"),
  186. PINCTRL_PIN(137, "vUART0_CTS_B"),
  187. PINCTRL_PIN(138, "vUART0_RTSB"),
  188. PINCTRL_PIN(139, "vISH_UART0_TXD"),
  189. PINCTRL_PIN(140, "vISH_UART0_RXD"),
  190. PINCTRL_PIN(141, "vISH_UART0_CTS_B"),
  191. PINCTRL_PIN(142, "vISH_UART0_RTSB"),
  192. PINCTRL_PIN(143, "vISH_UART1_TXD"),
  193. PINCTRL_PIN(144, "vISH_UART1_RXD"),
  194. PINCTRL_PIN(145, "vISH_UART1_CTS_B"),
  195. PINCTRL_PIN(146, "vISH_UART1_RTS_B"),
  196. PINCTRL_PIN(147, "vCNV_BT_I2S_BCLK"),
  197. PINCTRL_PIN(148, "vCNV_BT_I2S_WS_SYNC"),
  198. PINCTRL_PIN(149, "vCNV_BT_I2S_SDO"),
  199. PINCTRL_PIN(150, "vCNV_BT_I2S_SDI"),
  200. PINCTRL_PIN(151, "vSSP2_SCLK"),
  201. PINCTRL_PIN(152, "vSSP2_SFRM"),
  202. PINCTRL_PIN(153, "vSSP2_TXD"),
  203. PINCTRL_PIN(154, "vSSP2_RXD"),
  204. /* GPP_K */
  205. PINCTRL_PIN(155, "FAN_TACH_0"),
  206. PINCTRL_PIN(156, "FAN_TACH_1"),
  207. PINCTRL_PIN(157, "FAN_TACH_2"),
  208. PINCTRL_PIN(158, "FAN_TACH_3"),
  209. PINCTRL_PIN(159, "FAN_TACH_4"),
  210. PINCTRL_PIN(160, "FAN_TACH_5"),
  211. PINCTRL_PIN(161, "FAN_TACH_6"),
  212. PINCTRL_PIN(162, "FAN_TACH_7"),
  213. PINCTRL_PIN(163, "FAN_PWM_0"),
  214. PINCTRL_PIN(164, "FAN_PWM_1"),
  215. PINCTRL_PIN(165, "FAN_PWM_2"),
  216. PINCTRL_PIN(166, "FAN_PWM_3"),
  217. PINCTRL_PIN(167, "GSXDOUT"),
  218. PINCTRL_PIN(168, "GSXSLOAD"),
  219. PINCTRL_PIN(169, "GSXDIN"),
  220. PINCTRL_PIN(170, "GSXSRESETB"),
  221. PINCTRL_PIN(171, "GSXCLK"),
  222. PINCTRL_PIN(172, "ADR_COMPLETE"),
  223. PINCTRL_PIN(173, "NMIB"),
  224. PINCTRL_PIN(174, "SMIB"),
  225. PINCTRL_PIN(175, "CORE_VID_0"),
  226. PINCTRL_PIN(176, "CORE_VID_1"),
  227. PINCTRL_PIN(177, "IMGCLKOUT_0"),
  228. PINCTRL_PIN(178, "IMGCLKOUT_1"),
  229. /* GPP_H */
  230. PINCTRL_PIN(179, "SRCCLKREQB_6"),
  231. PINCTRL_PIN(180, "SRCCLKREQB_7"),
  232. PINCTRL_PIN(181, "SRCCLKREQB_8"),
  233. PINCTRL_PIN(182, "SRCCLKREQB_9"),
  234. PINCTRL_PIN(183, "SRCCLKREQB_10"),
  235. PINCTRL_PIN(184, "SRCCLKREQB_11"),
  236. PINCTRL_PIN(185, "SRCCLKREQB_12"),
  237. PINCTRL_PIN(186, "SRCCLKREQB_13"),
  238. PINCTRL_PIN(187, "SRCCLKREQB_14"),
  239. PINCTRL_PIN(188, "SRCCLKREQB_15"),
  240. PINCTRL_PIN(189, "SML2CLK"),
  241. PINCTRL_PIN(190, "SML2DATA"),
  242. PINCTRL_PIN(191, "SML2ALERTB"),
  243. PINCTRL_PIN(192, "SML3CLK"),
  244. PINCTRL_PIN(193, "SML3DATA"),
  245. PINCTRL_PIN(194, "SML3ALERTB"),
  246. PINCTRL_PIN(195, "SML4CLK"),
  247. PINCTRL_PIN(196, "SML4DATA"),
  248. PINCTRL_PIN(197, "SML4ALERTB"),
  249. PINCTRL_PIN(198, "ISH_I2C0_SDA"),
  250. PINCTRL_PIN(199, "ISH_I2C0_SCL"),
  251. PINCTRL_PIN(200, "ISH_I2C1_SDA"),
  252. PINCTRL_PIN(201, "ISH_I2C1_SCL"),
  253. PINCTRL_PIN(202, "TIME_SYNC_0"),
  254. /* GPP_E */
  255. PINCTRL_PIN(203, "SATAXPCIE_0"),
  256. PINCTRL_PIN(204, "SATAXPCIE_1"),
  257. PINCTRL_PIN(205, "SATAXPCIE_2"),
  258. PINCTRL_PIN(206, "CPU_GP_0"),
  259. PINCTRL_PIN(207, "SATA_DEVSLP_0"),
  260. PINCTRL_PIN(208, "SATA_DEVSLP_1"),
  261. PINCTRL_PIN(209, "SATA_DEVSLP_2"),
  262. PINCTRL_PIN(210, "CPU_GP_1"),
  263. PINCTRL_PIN(211, "SATA_LEDB"),
  264. PINCTRL_PIN(212, "USB2_OCB_0"),
  265. PINCTRL_PIN(213, "USB2_OCB_1"),
  266. PINCTRL_PIN(214, "USB2_OCB_2"),
  267. PINCTRL_PIN(215, "USB2_OCB_3"),
  268. /* GPP_F */
  269. PINCTRL_PIN(216, "SATAXPCIE_3"),
  270. PINCTRL_PIN(217, "SATAXPCIE_4"),
  271. PINCTRL_PIN(218, "SATAXPCIE_5"),
  272. PINCTRL_PIN(219, "SATAXPCIE_6"),
  273. PINCTRL_PIN(220, "SATAXPCIE_7"),
  274. PINCTRL_PIN(221, "SATA_DEVSLP_3"),
  275. PINCTRL_PIN(222, "SATA_DEVSLP_4"),
  276. PINCTRL_PIN(223, "SATA_DEVSLP_5"),
  277. PINCTRL_PIN(224, "SATA_DEVSLP_6"),
  278. PINCTRL_PIN(225, "SATA_DEVSLP_7"),
  279. PINCTRL_PIN(226, "SATA_SCLOCK"),
  280. PINCTRL_PIN(227, "SATA_SLOAD"),
  281. PINCTRL_PIN(228, "SATA_SDATAOUT1"),
  282. PINCTRL_PIN(229, "SATA_SDATAOUT0"),
  283. PINCTRL_PIN(230, "EXT_PWR_GATEB"),
  284. PINCTRL_PIN(231, "USB2_OCB_4"),
  285. PINCTRL_PIN(232, "USB2_OCB_5"),
  286. PINCTRL_PIN(233, "USB2_OCB_6"),
  287. PINCTRL_PIN(234, "USB2_OCB_7"),
  288. PINCTRL_PIN(235, "L_VDDEN"),
  289. PINCTRL_PIN(236, "L_BKLTEN"),
  290. PINCTRL_PIN(237, "L_BKLTCTL"),
  291. PINCTRL_PIN(238, "DDPF_CTRLCLK"),
  292. PINCTRL_PIN(239, "DDPF_CTRLDATA"),
  293. /* SPI */
  294. PINCTRL_PIN(240, "SPI0_IO_2"),
  295. PINCTRL_PIN(241, "SPI0_IO_3"),
  296. PINCTRL_PIN(242, "SPI0_MOSI_IO_0"),
  297. PINCTRL_PIN(243, "SPI0_MISO_IO_1"),
  298. PINCTRL_PIN(244, "SPI0_TPM_CSB"),
  299. PINCTRL_PIN(245, "SPI0_FLASH_0_CSB"),
  300. PINCTRL_PIN(246, "SPI0_FLASH_1_CSB"),
  301. PINCTRL_PIN(247, "SPI0_CLK"),
  302. PINCTRL_PIN(248, "SPI0_CLK_LOOPBK"),
  303. /* CPU */
  304. PINCTRL_PIN(249, "HDACPU_SDI"),
  305. PINCTRL_PIN(250, "HDACPU_SDO"),
  306. PINCTRL_PIN(251, "HDACPU_SCLK"),
  307. PINCTRL_PIN(252, "PM_SYNC"),
  308. PINCTRL_PIN(253, "PECI"),
  309. PINCTRL_PIN(254, "CPUPWRGD"),
  310. PINCTRL_PIN(255, "THRMTRIPB"),
  311. PINCTRL_PIN(256, "PLTRST_CPUB"),
  312. PINCTRL_PIN(257, "PM_DOWN"),
  313. PINCTRL_PIN(258, "TRIGGER_IN"),
  314. PINCTRL_PIN(259, "TRIGGER_OUT"),
  315. /* JTAG */
  316. PINCTRL_PIN(260, "JTAG_TDO"),
  317. PINCTRL_PIN(261, "JTAGX"),
  318. PINCTRL_PIN(262, "PRDYB"),
  319. PINCTRL_PIN(263, "PREQB"),
  320. PINCTRL_PIN(264, "CPU_TRSTB"),
  321. PINCTRL_PIN(265, "JTAG_TDI"),
  322. PINCTRL_PIN(266, "JTAG_TMS"),
  323. PINCTRL_PIN(267, "JTAG_TCK"),
  324. PINCTRL_PIN(268, "ITP_PMODE"),
  325. /* GPP_I */
  326. PINCTRL_PIN(269, "DDSP_HPD_0"),
  327. PINCTRL_PIN(270, "DDSP_HPD_1"),
  328. PINCTRL_PIN(271, "DDSP_HPD_2"),
  329. PINCTRL_PIN(272, "DDSP_HPD_3"),
  330. PINCTRL_PIN(273, "EDP_HPD"),
  331. PINCTRL_PIN(274, "DDPB_CTRLCLK"),
  332. PINCTRL_PIN(275, "DDPB_CTRLDATA"),
  333. PINCTRL_PIN(276, "DDPC_CTRLCLK"),
  334. PINCTRL_PIN(277, "DDPC_CTRLDATA"),
  335. PINCTRL_PIN(278, "DDPD_CTRLCLK"),
  336. PINCTRL_PIN(279, "DDPD_CTRLDATA"),
  337. PINCTRL_PIN(280, "M2_SKT2_CFG_0"),
  338. PINCTRL_PIN(281, "M2_SKT2_CFG_1"),
  339. PINCTRL_PIN(282, "M2_SKT2_CFG_2"),
  340. PINCTRL_PIN(283, "M2_SKT2_CFG_3"),
  341. PINCTRL_PIN(284, "SYS_PWROK"),
  342. PINCTRL_PIN(285, "SYS_RESETB"),
  343. PINCTRL_PIN(286, "MLK_RSTB"),
  344. /* GPP_J */
  345. PINCTRL_PIN(287, "CNV_PA_BLANKING"),
  346. PINCTRL_PIN(288, "CNV_GNSS_FTA"),
  347. PINCTRL_PIN(289, "CNV_GNSS_SYSCK"),
  348. PINCTRL_PIN(290, "CNV_RF_RESET_B"),
  349. PINCTRL_PIN(291, "CNV_BRI_DT"),
  350. PINCTRL_PIN(292, "CNV_BRI_RSP"),
  351. PINCTRL_PIN(293, "CNV_RGI_DT"),
  352. PINCTRL_PIN(294, "CNV_RGI_RSP"),
  353. PINCTRL_PIN(295, "CNV_MFUART2_RXD"),
  354. PINCTRL_PIN(296, "CNV_MFUART2_TXD"),
  355. PINCTRL_PIN(297, "CNV_MODEM_CLKREQ"),
  356. PINCTRL_PIN(298, "A4WP_PRESENT"),
  357. };
  358. static const struct intel_padgroup cnlh_community0_gpps[] = {
  359. CNL_GPP(0, 0, 24), /* GPP_A */
  360. CNL_GPP(1, 25, 50), /* GPP_B */
  361. };
  362. static const struct intel_padgroup cnlh_community1_gpps[] = {
  363. CNL_GPP(0, 51, 74), /* GPP_C */
  364. CNL_GPP(1, 75, 98), /* GPP_D */
  365. CNL_GPP(2, 99, 106), /* GPP_G */
  366. CNL_GPP(3, 107, 114), /* AZA */
  367. CNL_GPP(4, 115, 146), /* vGPIO_0 */
  368. CNL_GPP(5, 147, 154), /* vGPIO_1 */
  369. };
  370. static const struct intel_padgroup cnlh_community3_gpps[] = {
  371. CNL_GPP(0, 155, 178), /* GPP_K */
  372. CNL_GPP(1, 179, 202), /* GPP_H */
  373. CNL_GPP(2, 203, 215), /* GPP_E */
  374. CNL_GPP(3, 216, 239), /* GPP_F */
  375. CNL_GPP(4, 240, 248), /* SPI */
  376. };
  377. static const struct intel_padgroup cnlh_community4_gpps[] = {
  378. CNL_GPP(0, 249, 259), /* CPU */
  379. CNL_GPP(1, 260, 268), /* JTAG */
  380. CNL_GPP(2, 269, 286), /* GPP_I */
  381. CNL_GPP(3, 287, 298), /* GPP_J */
  382. };
  383. static const unsigned int cnlh_spi0_pins[] = { 40, 41, 42, 43 };
  384. static const unsigned int cnlh_spi1_pins[] = { 44, 45, 46, 47 };
  385. static const unsigned int cnlh_spi2_pins[] = { 84, 85, 86, 87 };
  386. static const unsigned int cnlh_uart0_pins[] = { 59, 60, 61, 62 };
  387. static const unsigned int cnlh_uart1_pins[] = { 63, 64, 65, 66 };
  388. static const unsigned int cnlh_uart2_pins[] = { 71, 72, 73, 74 };
  389. static const unsigned int cnlh_i2c0_pins[] = { 67, 68 };
  390. static const unsigned int cnlh_i2c1_pins[] = { 69, 70 };
  391. static const unsigned int cnlh_i2c2_pins[] = { 88, 89 };
  392. static const unsigned int cnlh_i2c3_pins[] = { 79, 98 };
  393. static const struct intel_pingroup cnlh_groups[] = {
  394. PIN_GROUP("spi0_grp", cnlh_spi0_pins, 1),
  395. PIN_GROUP("spi1_grp", cnlh_spi1_pins, 1),
  396. PIN_GROUP("spi2_grp", cnlh_spi2_pins, 3),
  397. PIN_GROUP("uart0_grp", cnlh_uart0_pins, 1),
  398. PIN_GROUP("uart1_grp", cnlh_uart1_pins, 1),
  399. PIN_GROUP("uart2_grp", cnlh_uart2_pins, 1),
  400. PIN_GROUP("i2c0_grp", cnlh_i2c0_pins, 1),
  401. PIN_GROUP("i2c1_grp", cnlh_i2c1_pins, 1),
  402. PIN_GROUP("i2c2_grp", cnlh_i2c2_pins, 3),
  403. PIN_GROUP("i2c3_grp", cnlh_i2c3_pins, 2),
  404. };
  405. static const char * const cnlh_spi0_groups[] = { "spi0_grp" };
  406. static const char * const cnlh_spi1_groups[] = { "spi1_grp" };
  407. static const char * const cnlh_spi2_groups[] = { "spi2_grp" };
  408. static const char * const cnlh_uart0_groups[] = { "uart0_grp" };
  409. static const char * const cnlh_uart1_groups[] = { "uart1_grp" };
  410. static const char * const cnlh_uart2_groups[] = { "uart2_grp" };
  411. static const char * const cnlh_i2c0_groups[] = { "i2c0_grp" };
  412. static const char * const cnlh_i2c1_groups[] = { "i2c1_grp" };
  413. static const char * const cnlh_i2c2_groups[] = { "i2c2_grp" };
  414. static const char * const cnlh_i2c3_groups[] = { "i2c3_grp" };
  415. static const struct intel_function cnlh_functions[] = {
  416. FUNCTION("spi0", cnlh_spi0_groups),
  417. FUNCTION("spi1", cnlh_spi1_groups),
  418. FUNCTION("spi2", cnlh_spi2_groups),
  419. FUNCTION("uart0", cnlh_uart0_groups),
  420. FUNCTION("uart1", cnlh_uart1_groups),
  421. FUNCTION("uart2", cnlh_uart2_groups),
  422. FUNCTION("i2c0", cnlh_i2c0_groups),
  423. FUNCTION("i2c1", cnlh_i2c1_groups),
  424. FUNCTION("i2c2", cnlh_i2c2_groups),
  425. FUNCTION("i2c3", cnlh_i2c3_groups),
  426. };
  427. static const struct intel_community cnlh_communities[] = {
  428. CNL_COMMUNITY(0, 0, 50, cnlh_community0_gpps),
  429. CNL_COMMUNITY(1, 51, 154, cnlh_community1_gpps),
  430. /*
  431. * ACPI MMIO resources are returned in reverse order for
  432. * communities 3 and 4.
  433. */
  434. CNL_COMMUNITY(3, 155, 248, cnlh_community3_gpps),
  435. CNL_COMMUNITY(2, 249, 298, cnlh_community4_gpps),
  436. };
  437. static const struct intel_pinctrl_soc_data cnlh_soc_data = {
  438. .pins = cnlh_pins,
  439. .npins = ARRAY_SIZE(cnlh_pins),
  440. .groups = cnlh_groups,
  441. .ngroups = ARRAY_SIZE(cnlh_groups),
  442. .functions = cnlh_functions,
  443. .nfunctions = ARRAY_SIZE(cnlh_functions),
  444. .communities = cnlh_communities,
  445. .ncommunities = ARRAY_SIZE(cnlh_communities),
  446. };
  447. /* Cannon Lake-LP */
  448. static const struct pinctrl_pin_desc cnllp_pins[] = {
  449. /* GPP_A */
  450. PINCTRL_PIN(0, "RCINB"),
  451. PINCTRL_PIN(1, "LAD_0"),
  452. PINCTRL_PIN(2, "LAD_1"),
  453. PINCTRL_PIN(3, "LAD_2"),
  454. PINCTRL_PIN(4, "LAD_3"),
  455. PINCTRL_PIN(5, "LFRAMEB"),
  456. PINCTRL_PIN(6, "SERIRQ"),
  457. PINCTRL_PIN(7, "PIRQAB"),
  458. PINCTRL_PIN(8, "CLKRUNB"),
  459. PINCTRL_PIN(9, "CLKOUT_LPC_0"),
  460. PINCTRL_PIN(10, "CLKOUT_LPC_1"),
  461. PINCTRL_PIN(11, "PMEB"),
  462. PINCTRL_PIN(12, "BM_BUSYB"),
  463. PINCTRL_PIN(13, "SUSWARNB_SUSPWRDNACK"),
  464. PINCTRL_PIN(14, "SUS_STATB"),
  465. PINCTRL_PIN(15, "SUSACKB"),
  466. PINCTRL_PIN(16, "SD_1P8_SEL"),
  467. PINCTRL_PIN(17, "SD_PWR_EN_B"),
  468. PINCTRL_PIN(18, "ISH_GP_0"),
  469. PINCTRL_PIN(19, "ISH_GP_1"),
  470. PINCTRL_PIN(20, "ISH_GP_2"),
  471. PINCTRL_PIN(21, "ISH_GP_3"),
  472. PINCTRL_PIN(22, "ISH_GP_4"),
  473. PINCTRL_PIN(23, "ISH_GP_5"),
  474. PINCTRL_PIN(24, "ESPI_CLK_LOOPBK"),
  475. /* GPP_B */
  476. PINCTRL_PIN(25, "CORE_VID_0"),
  477. PINCTRL_PIN(26, "CORE_VID_1"),
  478. PINCTRL_PIN(27, "VRALERTB"),
  479. PINCTRL_PIN(28, "CPU_GP_2"),
  480. PINCTRL_PIN(29, "CPU_GP_3"),
  481. PINCTRL_PIN(30, "SRCCLKREQB_0"),
  482. PINCTRL_PIN(31, "SRCCLKREQB_1"),
  483. PINCTRL_PIN(32, "SRCCLKREQB_2"),
  484. PINCTRL_PIN(33, "SRCCLKREQB_3"),
  485. PINCTRL_PIN(34, "SRCCLKREQB_4"),
  486. PINCTRL_PIN(35, "SRCCLKREQB_5"),
  487. PINCTRL_PIN(36, "EXT_PWR_GATEB"),
  488. PINCTRL_PIN(37, "SLP_S0B"),
  489. PINCTRL_PIN(38, "PLTRSTB"),
  490. PINCTRL_PIN(39, "SPKR"),
  491. PINCTRL_PIN(40, "GSPI0_CS0B"),
  492. PINCTRL_PIN(41, "GSPI0_CLK"),
  493. PINCTRL_PIN(42, "GSPI0_MISO"),
  494. PINCTRL_PIN(43, "GSPI0_MOSI"),
  495. PINCTRL_PIN(44, "GSPI1_CS0B"),
  496. PINCTRL_PIN(45, "GSPI1_CLK"),
  497. PINCTRL_PIN(46, "GSPI1_MISO"),
  498. PINCTRL_PIN(47, "GSPI1_MOSI"),
  499. PINCTRL_PIN(48, "SML1ALERTB"),
  500. PINCTRL_PIN(49, "GSPI0_CLK_LOOPBK"),
  501. PINCTRL_PIN(50, "GSPI1_CLK_LOOPBK"),
  502. /* GPP_G */
  503. PINCTRL_PIN(51, "SD3_CMD"),
  504. PINCTRL_PIN(52, "SD3_D0_SD4_RCLK_P"),
  505. PINCTRL_PIN(53, "SD3_D1_SD4_RCLK_N"),
  506. PINCTRL_PIN(54, "SD3_D2"),
  507. PINCTRL_PIN(55, "SD3_D3"),
  508. PINCTRL_PIN(56, "SD3_CDB"),
  509. PINCTRL_PIN(57, "SD3_CLK"),
  510. PINCTRL_PIN(58, "SD3_WP"),
  511. /* SPI */
  512. PINCTRL_PIN(59, "SPI0_IO_2"),
  513. PINCTRL_PIN(60, "SPI0_IO_3"),
  514. PINCTRL_PIN(61, "SPI0_MOSI_IO_0"),
  515. PINCTRL_PIN(62, "SPI0_MISO_IO_1"),
  516. PINCTRL_PIN(63, "SPI0_TPM_CSB"),
  517. PINCTRL_PIN(64, "SPI0_FLASH_0_CSB"),
  518. PINCTRL_PIN(65, "SPI0_FLASH_1_CSB"),
  519. PINCTRL_PIN(66, "SPI0_CLK"),
  520. PINCTRL_PIN(67, "SPI0_CLK_LOOPBK"),
  521. /* GPP_D */
  522. PINCTRL_PIN(68, "SPI1_CSB"),
  523. PINCTRL_PIN(69, "SPI1_CLK"),
  524. PINCTRL_PIN(70, "SPI1_MISO_IO_1"),
  525. PINCTRL_PIN(71, "SPI1_MOSI_IO_0"),
  526. PINCTRL_PIN(72, "IMGCLKOUT_0"),
  527. PINCTRL_PIN(73, "ISH_I2C0_SDA"),
  528. PINCTRL_PIN(74, "ISH_I2C0_SCL"),
  529. PINCTRL_PIN(75, "ISH_I2C1_SDA"),
  530. PINCTRL_PIN(76, "ISH_I2C1_SCL"),
  531. PINCTRL_PIN(77, "ISH_SPI_CSB"),
  532. PINCTRL_PIN(78, "ISH_SPI_CLK"),
  533. PINCTRL_PIN(79, "ISH_SPI_MISO"),
  534. PINCTRL_PIN(80, "ISH_SPI_MOSI"),
  535. PINCTRL_PIN(81, "ISH_UART0_RXD"),
  536. PINCTRL_PIN(82, "ISH_UART0_TXD"),
  537. PINCTRL_PIN(83, "ISH_UART0_RTSB"),
  538. PINCTRL_PIN(84, "ISH_UART0_CTSB"),
  539. PINCTRL_PIN(85, "DMIC_CLK_1"),
  540. PINCTRL_PIN(86, "DMIC_DATA_1"),
  541. PINCTRL_PIN(87, "DMIC_CLK_0"),
  542. PINCTRL_PIN(88, "DMIC_DATA_0"),
  543. PINCTRL_PIN(89, "SPI1_IO_2"),
  544. PINCTRL_PIN(90, "SPI1_IO_3"),
  545. PINCTRL_PIN(91, "SSP_MCLK"),
  546. PINCTRL_PIN(92, "GSPI2_CLK_LOOPBK"),
  547. /* GPP_F */
  548. PINCTRL_PIN(93, "CNV_GNSS_PA_BLANKING"),
  549. PINCTRL_PIN(94, "CNV_GNSS_FTA"),
  550. PINCTRL_PIN(95, "CNV_GNSS_SYSCK"),
  551. PINCTRL_PIN(96, "EMMC_HIP_MON"),
  552. PINCTRL_PIN(97, "CNV_BRI_DT"),
  553. PINCTRL_PIN(98, "CNV_BRI_RSP"),
  554. PINCTRL_PIN(99, "CNV_RGI_DT"),
  555. PINCTRL_PIN(100, "CNV_RGI_RSP"),
  556. PINCTRL_PIN(101, "CNV_MFUART2_RXD"),
  557. PINCTRL_PIN(102, "CNV_MFUART2_TXD"),
  558. PINCTRL_PIN(103, "GPP_F_10"),
  559. PINCTRL_PIN(104, "EMMC_CMD"),
  560. PINCTRL_PIN(105, "EMMC_DATA_0"),
  561. PINCTRL_PIN(106, "EMMC_DATA_1"),
  562. PINCTRL_PIN(107, "EMMC_DATA_2"),
  563. PINCTRL_PIN(108, "EMMC_DATA_3"),
  564. PINCTRL_PIN(109, "EMMC_DATA_4"),
  565. PINCTRL_PIN(110, "EMMC_DATA_5"),
  566. PINCTRL_PIN(111, "EMMC_DATA_6"),
  567. PINCTRL_PIN(112, "EMMC_DATA_7"),
  568. PINCTRL_PIN(113, "EMMC_RCLK"),
  569. PINCTRL_PIN(114, "EMMC_CLK"),
  570. PINCTRL_PIN(115, "EMMC_RESETB"),
  571. PINCTRL_PIN(116, "A4WP_PRESENT"),
  572. /* GPP_H */
  573. PINCTRL_PIN(117, "SSP2_SCLK"),
  574. PINCTRL_PIN(118, "SSP2_SFRM"),
  575. PINCTRL_PIN(119, "SSP2_TXD"),
  576. PINCTRL_PIN(120, "SSP2_RXD"),
  577. PINCTRL_PIN(121, "I2C2_SDA"),
  578. PINCTRL_PIN(122, "I2C2_SCL"),
  579. PINCTRL_PIN(123, "I2C3_SDA"),
  580. PINCTRL_PIN(124, "I2C3_SCL"),
  581. PINCTRL_PIN(125, "I2C4_SDA"),
  582. PINCTRL_PIN(126, "I2C4_SCL"),
  583. PINCTRL_PIN(127, "I2C5_SDA"),
  584. PINCTRL_PIN(128, "I2C5_SCL"),
  585. PINCTRL_PIN(129, "M2_SKT2_CFG_0"),
  586. PINCTRL_PIN(130, "M2_SKT2_CFG_1"),
  587. PINCTRL_PIN(131, "M2_SKT2_CFG_2"),
  588. PINCTRL_PIN(132, "M2_SKT2_CFG_3"),
  589. PINCTRL_PIN(133, "DDPF_CTRLCLK"),
  590. PINCTRL_PIN(134, "DDPF_CTRLDATA"),
  591. PINCTRL_PIN(135, "CPU_VCCIO_PWR_GATEB"),
  592. PINCTRL_PIN(136, "TIMESYNC_0"),
  593. PINCTRL_PIN(137, "IMGCLKOUT_1"),
  594. PINCTRL_PIN(138, "GPPC_H_21"),
  595. PINCTRL_PIN(139, "GPPC_H_22"),
  596. PINCTRL_PIN(140, "GPPC_H_23"),
  597. /* vGPIO */
  598. PINCTRL_PIN(141, "CNV_BTEN"),
  599. PINCTRL_PIN(142, "CNV_GNEN"),
  600. PINCTRL_PIN(143, "CNV_WFEN"),
  601. PINCTRL_PIN(144, "CNV_WCEN"),
  602. PINCTRL_PIN(145, "CNV_BT_HOST_WAKEB"),
  603. PINCTRL_PIN(146, "CNV_BT_IF_SELECT"),
  604. PINCTRL_PIN(147, "vCNV_BT_UART_TXD"),
  605. PINCTRL_PIN(148, "vCNV_BT_UART_RXD"),
  606. PINCTRL_PIN(149, "vCNV_BT_UART_CTS_B"),
  607. PINCTRL_PIN(150, "vCNV_BT_UART_RTS_B"),
  608. PINCTRL_PIN(151, "vCNV_MFUART1_TXD"),
  609. PINCTRL_PIN(152, "vCNV_MFUART1_RXD"),
  610. PINCTRL_PIN(153, "vCNV_MFUART1_CTS_B"),
  611. PINCTRL_PIN(154, "vCNV_MFUART1_RTS_B"),
  612. PINCTRL_PIN(155, "vCNV_GNSS_UART_TXD"),
  613. PINCTRL_PIN(156, "vCNV_GNSS_UART_RXD"),
  614. PINCTRL_PIN(157, "vCNV_GNSS_UART_CTS_B"),
  615. PINCTRL_PIN(158, "vCNV_GNSS_UART_RTS_B"),
  616. PINCTRL_PIN(159, "vUART0_TXD"),
  617. PINCTRL_PIN(160, "vUART0_RXD"),
  618. PINCTRL_PIN(161, "vUART0_CTS_B"),
  619. PINCTRL_PIN(162, "vUART0_RTS_B"),
  620. PINCTRL_PIN(163, "vISH_UART0_TXD"),
  621. PINCTRL_PIN(164, "vISH_UART0_RXD"),
  622. PINCTRL_PIN(165, "vISH_UART0_CTS_B"),
  623. PINCTRL_PIN(166, "vISH_UART0_RTS_B"),
  624. PINCTRL_PIN(167, "vISH_UART1_TXD"),
  625. PINCTRL_PIN(168, "vISH_UART1_RXD"),
  626. PINCTRL_PIN(169, "vISH_UART1_CTS_B"),
  627. PINCTRL_PIN(170, "vISH_UART1_RTS_B"),
  628. PINCTRL_PIN(171, "vCNV_BT_I2S_BCLK"),
  629. PINCTRL_PIN(172, "vCNV_BT_I2S_WS_SYNC"),
  630. PINCTRL_PIN(173, "vCNV_BT_I2S_SDO"),
  631. PINCTRL_PIN(174, "vCNV_BT_I2S_SDI"),
  632. PINCTRL_PIN(175, "vSSP2_SCLK"),
  633. PINCTRL_PIN(176, "vSSP2_SFRM"),
  634. PINCTRL_PIN(177, "vSSP2_TXD"),
  635. PINCTRL_PIN(178, "vSSP2_RXD"),
  636. PINCTRL_PIN(179, "vCNV_GNSS_HOST_WAKEB"),
  637. PINCTRL_PIN(180, "vSD3_CD_B"),
  638. /* GPP_C */
  639. PINCTRL_PIN(181, "SMBCLK"),
  640. PINCTRL_PIN(182, "SMBDATA"),
  641. PINCTRL_PIN(183, "SMBALERTB"),
  642. PINCTRL_PIN(184, "SML0CLK"),
  643. PINCTRL_PIN(185, "SML0DATA"),
  644. PINCTRL_PIN(186, "SML0ALERTB"),
  645. PINCTRL_PIN(187, "SML1CLK"),
  646. PINCTRL_PIN(188, "SML1DATA"),
  647. PINCTRL_PIN(189, "UART0_RXD"),
  648. PINCTRL_PIN(190, "UART0_TXD"),
  649. PINCTRL_PIN(191, "UART0_RTSB"),
  650. PINCTRL_PIN(192, "UART0_CTSB"),
  651. PINCTRL_PIN(193, "UART1_RXD"),
  652. PINCTRL_PIN(194, "UART1_TXD"),
  653. PINCTRL_PIN(195, "UART1_RTSB"),
  654. PINCTRL_PIN(196, "UART1_CTSB"),
  655. PINCTRL_PIN(197, "I2C0_SDA"),
  656. PINCTRL_PIN(198, "I2C0_SCL"),
  657. PINCTRL_PIN(199, "I2C1_SDA"),
  658. PINCTRL_PIN(200, "I2C1_SCL"),
  659. PINCTRL_PIN(201, "UART2_RXD"),
  660. PINCTRL_PIN(202, "UART2_TXD"),
  661. PINCTRL_PIN(203, "UART2_RTSB"),
  662. PINCTRL_PIN(204, "UART2_CTSB"),
  663. /* GPP_E */
  664. PINCTRL_PIN(205, "SATAXPCIE_0"),
  665. PINCTRL_PIN(206, "SATAXPCIE_1"),
  666. PINCTRL_PIN(207, "SATAXPCIE_2"),
  667. PINCTRL_PIN(208, "CPU_GP_0"),
  668. PINCTRL_PIN(209, "SATA_DEVSLP_0"),
  669. PINCTRL_PIN(210, "SATA_DEVSLP_1"),
  670. PINCTRL_PIN(211, "SATA_DEVSLP_2"),
  671. PINCTRL_PIN(212, "CPU_GP_1"),
  672. PINCTRL_PIN(213, "SATA_LEDB"),
  673. PINCTRL_PIN(214, "USB2_OCB_0"),
  674. PINCTRL_PIN(215, "USB2_OCB_1"),
  675. PINCTRL_PIN(216, "USB2_OCB_2"),
  676. PINCTRL_PIN(217, "USB2_OCB_3"),
  677. PINCTRL_PIN(218, "DDSP_HPD_0"),
  678. PINCTRL_PIN(219, "DDSP_HPD_1"),
  679. PINCTRL_PIN(220, "DDSP_HPD_2"),
  680. PINCTRL_PIN(221, "DDSP_HPD_3"),
  681. PINCTRL_PIN(222, "EDP_HPD"),
  682. PINCTRL_PIN(223, "DDPB_CTRLCLK"),
  683. PINCTRL_PIN(224, "DDPB_CTRLDATA"),
  684. PINCTRL_PIN(225, "DDPC_CTRLCLK"),
  685. PINCTRL_PIN(226, "DDPC_CTRLDATA"),
  686. PINCTRL_PIN(227, "DDPD_CTRLCLK"),
  687. PINCTRL_PIN(228, "DDPD_CTRLDATA"),
  688. /* JTAG */
  689. PINCTRL_PIN(229, "JTAG_TDO"),
  690. PINCTRL_PIN(230, "JTAGX"),
  691. PINCTRL_PIN(231, "PRDYB"),
  692. PINCTRL_PIN(232, "PREQB"),
  693. PINCTRL_PIN(233, "CPU_TRSTB"),
  694. PINCTRL_PIN(234, "JTAG_TDI"),
  695. PINCTRL_PIN(235, "JTAG_TMS"),
  696. PINCTRL_PIN(236, "JTAG_TCK"),
  697. PINCTRL_PIN(237, "ITP_PMODE"),
  698. /* HVCMOS */
  699. PINCTRL_PIN(238, "L_BKLTEN"),
  700. PINCTRL_PIN(239, "L_BKLTCTL"),
  701. PINCTRL_PIN(240, "L_VDDEN"),
  702. PINCTRL_PIN(241, "SYS_PWROK"),
  703. PINCTRL_PIN(242, "SYS_RESETB"),
  704. PINCTRL_PIN(243, "MLK_RSTB"),
  705. };
  706. static const unsigned int cnllp_spi0_pins[] = { 40, 41, 42, 43, 7 };
  707. static const unsigned int cnllp_spi0_modes[] = { 1, 1, 1, 1, 2 };
  708. static const unsigned int cnllp_spi1_pins[] = { 44, 45, 46, 47, 11 };
  709. static const unsigned int cnllp_spi1_modes[] = { 1, 1, 1, 1, 2 };
  710. static const unsigned int cnllp_spi2_pins[] = { 77, 78, 79, 80, 83 };
  711. static const unsigned int cnllp_spi2_modes[] = { 3, 3, 3, 3, 2 };
  712. static const unsigned int cnllp_i2c0_pins[] = { 197, 198 };
  713. static const unsigned int cnllp_i2c1_pins[] = { 199, 200 };
  714. static const unsigned int cnllp_i2c2_pins[] = { 121, 122 };
  715. static const unsigned int cnllp_i2c3_pins[] = { 123, 124 };
  716. static const unsigned int cnllp_i2c4_pins[] = { 125, 126 };
  717. static const unsigned int cnllp_i2c5_pins[] = { 127, 128 };
  718. static const unsigned int cnllp_uart0_pins[] = { 189, 190, 191, 192 };
  719. static const unsigned int cnllp_uart1_pins[] = { 193, 194, 195, 196 };
  720. static const unsigned int cnllp_uart2_pins[] = { 201, 202, 203, 204 };
  721. static const struct intel_pingroup cnllp_groups[] = {
  722. PIN_GROUP("spi0_grp", cnllp_spi0_pins, cnllp_spi0_modes),
  723. PIN_GROUP("spi1_grp", cnllp_spi1_pins, cnllp_spi1_modes),
  724. PIN_GROUP("spi2_grp", cnllp_spi2_pins, cnllp_spi2_modes),
  725. PIN_GROUP("i2c0_grp", cnllp_i2c0_pins, 1),
  726. PIN_GROUP("i2c1_grp", cnllp_i2c1_pins, 1),
  727. PIN_GROUP("i2c2_grp", cnllp_i2c2_pins, 1),
  728. PIN_GROUP("i2c3_grp", cnllp_i2c3_pins, 1),
  729. PIN_GROUP("i2c4_grp", cnllp_i2c4_pins, 1),
  730. PIN_GROUP("i2c5_grp", cnllp_i2c5_pins, 1),
  731. PIN_GROUP("uart0_grp", cnllp_uart0_pins, 1),
  732. PIN_GROUP("uart1_grp", cnllp_uart1_pins, 1),
  733. PIN_GROUP("uart2_grp", cnllp_uart2_pins, 1),
  734. };
  735. static const char * const cnllp_spi0_groups[] = { "spi0_grp" };
  736. static const char * const cnllp_spi1_groups[] = { "spi1_grp" };
  737. static const char * const cnllp_spi2_groups[] = { "spi2_grp" };
  738. static const char * const cnllp_i2c0_groups[] = { "i2c0_grp" };
  739. static const char * const cnllp_i2c1_groups[] = { "i2c1_grp" };
  740. static const char * const cnllp_i2c2_groups[] = { "i2c2_grp" };
  741. static const char * const cnllp_i2c3_groups[] = { "i2c3_grp" };
  742. static const char * const cnllp_i2c4_groups[] = { "i2c4_grp" };
  743. static const char * const cnllp_i2c5_groups[] = { "i2c5_grp" };
  744. static const char * const cnllp_uart0_groups[] = { "uart0_grp" };
  745. static const char * const cnllp_uart1_groups[] = { "uart1_grp" };
  746. static const char * const cnllp_uart2_groups[] = { "uart2_grp" };
  747. static const struct intel_function cnllp_functions[] = {
  748. FUNCTION("spi0", cnllp_spi0_groups),
  749. FUNCTION("spi1", cnllp_spi1_groups),
  750. FUNCTION("spi2", cnllp_spi2_groups),
  751. FUNCTION("i2c0", cnllp_i2c0_groups),
  752. FUNCTION("i2c1", cnllp_i2c1_groups),
  753. FUNCTION("i2c2", cnllp_i2c2_groups),
  754. FUNCTION("i2c3", cnllp_i2c3_groups),
  755. FUNCTION("i2c4", cnllp_i2c4_groups),
  756. FUNCTION("i2c5", cnllp_i2c5_groups),
  757. FUNCTION("uart0", cnllp_uart0_groups),
  758. FUNCTION("uart1", cnllp_uart1_groups),
  759. FUNCTION("uart2", cnllp_uart2_groups),
  760. };
  761. static const struct intel_padgroup cnllp_community0_gpps[] = {
  762. CNL_GPP(0, 0, 24), /* GPP_A */
  763. CNL_GPP(1, 25, 50), /* GPP_B */
  764. CNL_GPP(2, 51, 58), /* GPP_G */
  765. CNL_GPP(3, 59, 67), /* SPI */
  766. };
  767. static const struct intel_padgroup cnllp_community1_gpps[] = {
  768. CNL_GPP(0, 68, 92), /* GPP_D */
  769. CNL_GPP(1, 93, 116), /* GPP_F */
  770. CNL_GPP(2, 117, 140), /* GPP_H */
  771. CNL_GPP(3, 141, 172), /* vGPIO */
  772. CNL_GPP(4, 173, 180), /* vGPIO */
  773. };
  774. static const struct intel_padgroup cnllp_community4_gpps[] = {
  775. CNL_GPP(0, 181, 204), /* GPP_C */
  776. CNL_GPP(1, 205, 228), /* GPP_E */
  777. CNL_GPP(2, 229, 237), /* JTAG */
  778. CNL_GPP(3, 238, 243), /* HVCMOS */
  779. };
  780. static const struct intel_community cnllp_communities[] = {
  781. CNL_COMMUNITY(0, 0, 67, cnllp_community0_gpps),
  782. CNL_COMMUNITY(1, 68, 180, cnllp_community1_gpps),
  783. CNL_COMMUNITY(2, 181, 243, cnllp_community4_gpps),
  784. };
  785. static const struct intel_pinctrl_soc_data cnllp_soc_data = {
  786. .pins = cnllp_pins,
  787. .npins = ARRAY_SIZE(cnllp_pins),
  788. .groups = cnllp_groups,
  789. .ngroups = ARRAY_SIZE(cnllp_groups),
  790. .functions = cnllp_functions,
  791. .nfunctions = ARRAY_SIZE(cnllp_functions),
  792. .communities = cnllp_communities,
  793. .ncommunities = ARRAY_SIZE(cnllp_communities),
  794. };
  795. static const struct acpi_device_id cnl_pinctrl_acpi_match[] = {
  796. { "INT3450", (kernel_ulong_t)&cnlh_soc_data },
  797. { "INT34BB", (kernel_ulong_t)&cnllp_soc_data },
  798. { },
  799. };
  800. MODULE_DEVICE_TABLE(acpi, cnl_pinctrl_acpi_match);
  801. static int cnl_pinctrl_probe(struct platform_device *pdev)
  802. {
  803. const struct intel_pinctrl_soc_data *soc_data;
  804. const struct acpi_device_id *id;
  805. id = acpi_match_device(cnl_pinctrl_acpi_match, &pdev->dev);
  806. if (!id || !id->driver_data)
  807. return -ENODEV;
  808. soc_data = (const struct intel_pinctrl_soc_data *)id->driver_data;
  809. return intel_pinctrl_probe(pdev, soc_data);
  810. }
  811. static const struct dev_pm_ops cnl_pinctrl_pm_ops = {
  812. SET_LATE_SYSTEM_SLEEP_PM_OPS(intel_pinctrl_suspend,
  813. intel_pinctrl_resume)
  814. };
  815. static struct platform_driver cnl_pinctrl_driver = {
  816. .probe = cnl_pinctrl_probe,
  817. .driver = {
  818. .name = "cannonlake-pinctrl",
  819. .acpi_match_table = cnl_pinctrl_acpi_match,
  820. .pm = &cnl_pinctrl_pm_ops,
  821. },
  822. };
  823. module_platform_driver(cnl_pinctrl_driver);
  824. MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>");
  825. MODULE_DESCRIPTION("Intel Cannon Lake PCH pinctrl/GPIO driver");
  826. MODULE_LICENSE("GPL v2");