pinctrl-geminilake.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Intel Gemini Lake SoC pinctrl/GPIO driver
  4. *
  5. * Copyright (C) 2017 Intel Corporation
  6. * Author: Mika Westerberg <mika.westerberg@linux.intel.com>
  7. */
  8. #include <linux/mod_devicetable.h>
  9. #include <linux/module.h>
  10. #include <linux/platform_device.h>
  11. #include <linux/pm.h>
  12. #include <linux/pinctrl/pinctrl.h>
  13. #include "pinctrl-intel.h"
  14. #define GLK_PAD_OWN 0x020
  15. #define GLK_PADCFGLOCK 0x080
  16. #define GLK_HOSTSW_OWN 0x0b0
  17. #define GLK_GPI_IS 0x100
  18. #define GLK_GPI_IE 0x110
  19. #define GLK_COMMUNITY(b, s, e) \
  20. INTEL_COMMUNITY_SIZE(b, s, e, 32, 4, GLK)
  21. /* GLK */
  22. static const struct pinctrl_pin_desc glk_northwest_pins[] = {
  23. PINCTRL_PIN(0, "TCK"),
  24. PINCTRL_PIN(1, "TRST_B"),
  25. PINCTRL_PIN(2, "TMS"),
  26. PINCTRL_PIN(3, "TDI"),
  27. PINCTRL_PIN(4, "TDO"),
  28. PINCTRL_PIN(5, "JTAGX"),
  29. PINCTRL_PIN(6, "CX_PREQ_B"),
  30. PINCTRL_PIN(7, "CX_PRDY_B"),
  31. PINCTRL_PIN(8, "GPIO_8"),
  32. PINCTRL_PIN(9, "GPIO_9"),
  33. PINCTRL_PIN(10, "GPIO_10"),
  34. PINCTRL_PIN(11, "GPIO_11"),
  35. PINCTRL_PIN(12, "GPIO_12"),
  36. PINCTRL_PIN(13, "GPIO_13"),
  37. PINCTRL_PIN(14, "GPIO_14"),
  38. PINCTRL_PIN(15, "GPIO_15"),
  39. PINCTRL_PIN(16, "GPIO_16"),
  40. PINCTRL_PIN(17, "GPIO_17"),
  41. PINCTRL_PIN(18, "GPIO_18"),
  42. PINCTRL_PIN(19, "GPIO_19"),
  43. PINCTRL_PIN(20, "GPIO_20"),
  44. PINCTRL_PIN(21, "GPIO_21"),
  45. PINCTRL_PIN(22, "GPIO_22"),
  46. PINCTRL_PIN(23, "GPIO_23"),
  47. PINCTRL_PIN(24, "GPIO_24"),
  48. PINCTRL_PIN(25, "GPIO_25"),
  49. PINCTRL_PIN(26, "ISH_GPIO_0"),
  50. PINCTRL_PIN(27, "ISH_GPIO_1"),
  51. PINCTRL_PIN(28, "ISH_GPIO_2"),
  52. PINCTRL_PIN(29, "ISH_GPIO_3"),
  53. PINCTRL_PIN(30, "ISH_GPIO_4"),
  54. PINCTRL_PIN(31, "ISH_GPIO_5"),
  55. PINCTRL_PIN(32, "ISH_GPIO_6"),
  56. PINCTRL_PIN(33, "ISH_GPIO_7"),
  57. PINCTRL_PIN(34, "ISH_GPIO_8"),
  58. PINCTRL_PIN(35, "ISH_GPIO_9"),
  59. PINCTRL_PIN(36, "GPIO_36"),
  60. PINCTRL_PIN(37, "GPIO_37"),
  61. PINCTRL_PIN(38, "GPIO_38"),
  62. PINCTRL_PIN(39, "GPIO_39"),
  63. PINCTRL_PIN(40, "GPIO_40"),
  64. PINCTRL_PIN(41, "GPIO_41"),
  65. PINCTRL_PIN(42, "GP_INTD_DSI_TE1"),
  66. PINCTRL_PIN(43, "GP_INTD_DSI_TE2"),
  67. PINCTRL_PIN(44, "USB_OC0_B"),
  68. PINCTRL_PIN(45, "USB_OC1_B"),
  69. PINCTRL_PIN(46, "DSI_I2C_SDA"),
  70. PINCTRL_PIN(47, "DSI_I2C_SCL"),
  71. PINCTRL_PIN(48, "PMC_I2C_SDA"),
  72. PINCTRL_PIN(49, "PMC_I2C_SCL"),
  73. PINCTRL_PIN(50, "LPSS_I2C0_SDA"),
  74. PINCTRL_PIN(51, "LPSS_I2C0_SCL"),
  75. PINCTRL_PIN(52, "LPSS_I2C1_SDA"),
  76. PINCTRL_PIN(53, "LPSS_I2C1_SCL"),
  77. PINCTRL_PIN(54, "LPSS_I2C2_SDA"),
  78. PINCTRL_PIN(55, "LPSS_I2C2_SCL"),
  79. PINCTRL_PIN(56, "LPSS_I2C3_SDA"),
  80. PINCTRL_PIN(57, "LPSS_I2C3_SCL"),
  81. PINCTRL_PIN(58, "LPSS_I2C4_SDA"),
  82. PINCTRL_PIN(59, "LPSS_I2C4_SCL"),
  83. PINCTRL_PIN(60, "LPSS_UART0_RXD"),
  84. PINCTRL_PIN(61, "LPSS_UART0_TXD"),
  85. PINCTRL_PIN(62, "LPSS_UART0_RTS_B"),
  86. PINCTRL_PIN(63, "LPSS_UART0_CTS_B"),
  87. PINCTRL_PIN(64, "LPSS_UART2_RXD"),
  88. PINCTRL_PIN(65, "LPSS_UART2_TXD"),
  89. PINCTRL_PIN(66, "LPSS_UART2_RTS_B"),
  90. PINCTRL_PIN(67, "LPSS_UART2_CTS_B"),
  91. PINCTRL_PIN(68, "PMC_SPI_FS0"),
  92. PINCTRL_PIN(69, "PMC_SPI_FS1"),
  93. PINCTRL_PIN(70, "PMC_SPI_FS2"),
  94. PINCTRL_PIN(71, "PMC_SPI_RXD"),
  95. PINCTRL_PIN(72, "PMC_SPI_TXD"),
  96. PINCTRL_PIN(73, "PMC_SPI_CLK"),
  97. PINCTRL_PIN(74, "THERMTRIP_B"),
  98. PINCTRL_PIN(75, "PROCHOT_B"),
  99. PINCTRL_PIN(76, "EMMC_RST_B"),
  100. PINCTRL_PIN(77, "GPIO_212"),
  101. PINCTRL_PIN(78, "GPIO_213"),
  102. PINCTRL_PIN(79, "GPIO_214"),
  103. };
  104. static const unsigned int glk_northwest_uart1_pins[] = { 26, 27, 28, 29 };
  105. static const unsigned int glk_northwest_pwm0_pins[] = { 42 };
  106. static const unsigned int glk_northwest_pwm1_pins[] = { 43 };
  107. static const unsigned int glk_northwest_pwm2_pins[] = { 44 };
  108. static const unsigned int glk_northwest_pwm3_pins[] = { 45 };
  109. static const unsigned int glk_northwest_i2c0_pins[] = { 50, 51 };
  110. static const unsigned int glk_northwest_i2c1_pins[] = { 52, 53 };
  111. static const unsigned int glk_northwest_i2c2_pins[] = { 54, 55 };
  112. static const unsigned int glk_northwest_i2c3_pins[] = { 56, 57 };
  113. static const unsigned int glk_northwest_i2c4_pins[] = { 58, 59 };
  114. static const unsigned int glk_northwest_uart0_pins[] = { 60, 61, 62, 63 };
  115. static const unsigned int glk_northwest_uart2_pins[] = { 64, 65, 66, 67 };
  116. static const struct intel_pingroup glk_northwest_groups[] = {
  117. PIN_GROUP("uart1_grp", glk_northwest_uart1_pins, 2),
  118. PIN_GROUP("pwm0_grp", glk_northwest_pwm0_pins, 2),
  119. PIN_GROUP("pwm1_grp", glk_northwest_pwm1_pins, 2),
  120. PIN_GROUP("pwm2_grp", glk_northwest_pwm2_pins, 2),
  121. PIN_GROUP("pwm3_grp", glk_northwest_pwm3_pins, 2),
  122. PIN_GROUP("i2c0_grp", glk_northwest_i2c0_pins, 1),
  123. PIN_GROUP("i2c1_grp", glk_northwest_i2c1_pins, 1),
  124. PIN_GROUP("i2c2_grp", glk_northwest_i2c2_pins, 1),
  125. PIN_GROUP("i2c3_grp", glk_northwest_i2c3_pins, 1),
  126. PIN_GROUP("i2c4_grp", glk_northwest_i2c4_pins, 1),
  127. PIN_GROUP("uart0_grp", glk_northwest_uart0_pins, 1),
  128. PIN_GROUP("uart2_grp", glk_northwest_uart2_pins, 1),
  129. };
  130. static const char * const glk_northwest_uart1_groups[] = { "uart1_grp" };
  131. static const char * const glk_northwest_pwm0_groups[] = { "pwm0_grp" };
  132. static const char * const glk_northwest_pwm1_groups[] = { "pwm1_grp" };
  133. static const char * const glk_northwest_pwm2_groups[] = { "pwm2_grp" };
  134. static const char * const glk_northwest_pwm3_groups[] = { "pwm3_grp" };
  135. static const char * const glk_northwest_i2c0_groups[] = { "i2c0_grp" };
  136. static const char * const glk_northwest_i2c1_groups[] = { "i2c1_grp" };
  137. static const char * const glk_northwest_i2c2_groups[] = { "i2c2_grp" };
  138. static const char * const glk_northwest_i2c3_groups[] = { "i2c3_grp" };
  139. static const char * const glk_northwest_i2c4_groups[] = { "i2c4_grp" };
  140. static const char * const glk_northwest_uart0_groups[] = { "uart0_grp" };
  141. static const char * const glk_northwest_uart2_groups[] = { "uart2_grp" };
  142. static const struct intel_function glk_northwest_functions[] = {
  143. FUNCTION("uart1", glk_northwest_uart1_groups),
  144. FUNCTION("pmw0", glk_northwest_pwm0_groups),
  145. FUNCTION("pmw1", glk_northwest_pwm1_groups),
  146. FUNCTION("pmw2", glk_northwest_pwm2_groups),
  147. FUNCTION("pmw3", glk_northwest_pwm3_groups),
  148. FUNCTION("i2c0", glk_northwest_i2c0_groups),
  149. FUNCTION("i2c1", glk_northwest_i2c1_groups),
  150. FUNCTION("i2c2", glk_northwest_i2c2_groups),
  151. FUNCTION("i2c3", glk_northwest_i2c3_groups),
  152. FUNCTION("i2c4", glk_northwest_i2c4_groups),
  153. FUNCTION("uart0", glk_northwest_uart0_groups),
  154. FUNCTION("uart2", glk_northwest_uart2_groups),
  155. };
  156. static const struct intel_community glk_northwest_communities[] = {
  157. GLK_COMMUNITY(0, 0, 79),
  158. };
  159. static const struct intel_pinctrl_soc_data glk_northwest_soc_data = {
  160. .uid = "1",
  161. .pins = glk_northwest_pins,
  162. .npins = ARRAY_SIZE(glk_northwest_pins),
  163. .groups = glk_northwest_groups,
  164. .ngroups = ARRAY_SIZE(glk_northwest_groups),
  165. .functions = glk_northwest_functions,
  166. .nfunctions = ARRAY_SIZE(glk_northwest_functions),
  167. .communities = glk_northwest_communities,
  168. .ncommunities = ARRAY_SIZE(glk_northwest_communities),
  169. };
  170. static const struct pinctrl_pin_desc glk_north_pins[] = {
  171. PINCTRL_PIN(0, "SVID0_ALERT_B"),
  172. PINCTRL_PIN(1, "SVID0_DATA"),
  173. PINCTRL_PIN(2, "SVID0_CLK"),
  174. PINCTRL_PIN(3, "LPSS_SPI_0_CLK"),
  175. PINCTRL_PIN(4, "LPSS_SPI_0_FS0"),
  176. PINCTRL_PIN(5, "LPSS_SPI_0_FS1"),
  177. PINCTRL_PIN(6, "LPSS_SPI_0_RXD"),
  178. PINCTRL_PIN(7, "LPSS_SPI_0_TXD"),
  179. PINCTRL_PIN(8, "LPSS_SPI_2_CLK"),
  180. PINCTRL_PIN(9, "LPSS_SPI_2_FS0"),
  181. PINCTRL_PIN(10, "LPSS_SPI_2_FS1"),
  182. PINCTRL_PIN(11, "LPSS_SPI_2_FS2"),
  183. PINCTRL_PIN(12, "LPSS_SPI_2_RXD"),
  184. PINCTRL_PIN(13, "LPSS_SPI_2_TXD"),
  185. PINCTRL_PIN(14, "FST_SPI_CS0_B"),
  186. PINCTRL_PIN(15, "FST_SPI_CS1_B"),
  187. PINCTRL_PIN(16, "FST_SPI_MOSI_IO0"),
  188. PINCTRL_PIN(17, "FST_SPI_MISO_IO1"),
  189. PINCTRL_PIN(18, "FST_SPI_IO2"),
  190. PINCTRL_PIN(19, "FST_SPI_IO3"),
  191. PINCTRL_PIN(20, "FST_SPI_CLK"),
  192. PINCTRL_PIN(21, "FST_SPI_CLK_FB"),
  193. PINCTRL_PIN(22, "PMU_PLTRST_B"),
  194. PINCTRL_PIN(23, "PMU_PWRBTN_B"),
  195. PINCTRL_PIN(24, "PMU_SLP_S0_B"),
  196. PINCTRL_PIN(25, "PMU_SLP_S3_B"),
  197. PINCTRL_PIN(26, "PMU_SLP_S4_B"),
  198. PINCTRL_PIN(27, "SUSPWRDNACK"),
  199. PINCTRL_PIN(28, "EMMC_DNX_PWR_EN_B"),
  200. PINCTRL_PIN(29, "GPIO_105"),
  201. PINCTRL_PIN(30, "PMU_BATLOW_B"),
  202. PINCTRL_PIN(31, "PMU_RESETBUTTON_B"),
  203. PINCTRL_PIN(32, "PMU_SUSCLK"),
  204. PINCTRL_PIN(33, "SUS_STAT_B"),
  205. PINCTRL_PIN(34, "LPSS_I2C5_SDA"),
  206. PINCTRL_PIN(35, "LPSS_I2C5_SCL"),
  207. PINCTRL_PIN(36, "LPSS_I2C6_SDA"),
  208. PINCTRL_PIN(37, "LPSS_I2C6_SCL"),
  209. PINCTRL_PIN(38, "LPSS_I2C7_SDA"),
  210. PINCTRL_PIN(39, "LPSS_I2C7_SCL"),
  211. PINCTRL_PIN(40, "PCIE_WAKE0_B"),
  212. PINCTRL_PIN(41, "PCIE_WAKE1_B"),
  213. PINCTRL_PIN(42, "PCIE_WAKE2_B"),
  214. PINCTRL_PIN(43, "PCIE_WAKE3_B"),
  215. PINCTRL_PIN(44, "PCIE_CLKREQ0_B"),
  216. PINCTRL_PIN(45, "PCIE_CLKREQ1_B"),
  217. PINCTRL_PIN(46, "PCIE_CLKREQ2_B"),
  218. PINCTRL_PIN(47, "PCIE_CLKREQ3_B"),
  219. PINCTRL_PIN(48, "HV_DDI0_DDC_SDA"),
  220. PINCTRL_PIN(49, "HV_DDI0_DDC_SCL"),
  221. PINCTRL_PIN(50, "HV_DDI1_DDC_SDA"),
  222. PINCTRL_PIN(51, "HV_DDI1_DDC_SCL"),
  223. PINCTRL_PIN(52, "PANEL0_VDDEN"),
  224. PINCTRL_PIN(53, "PANEL0_BKLTEN"),
  225. PINCTRL_PIN(54, "PANEL0_BKLTCTL"),
  226. PINCTRL_PIN(55, "HV_DDI0_HPD"),
  227. PINCTRL_PIN(56, "HV_DDI1_HPD"),
  228. PINCTRL_PIN(57, "HV_EDP_HPD"),
  229. PINCTRL_PIN(58, "GPIO_134"),
  230. PINCTRL_PIN(59, "GPIO_135"),
  231. PINCTRL_PIN(60, "GPIO_136"),
  232. PINCTRL_PIN(61, "GPIO_137"),
  233. PINCTRL_PIN(62, "GPIO_138"),
  234. PINCTRL_PIN(63, "GPIO_139"),
  235. PINCTRL_PIN(64, "GPIO_140"),
  236. PINCTRL_PIN(65, "GPIO_141"),
  237. PINCTRL_PIN(66, "GPIO_142"),
  238. PINCTRL_PIN(67, "GPIO_143"),
  239. PINCTRL_PIN(68, "GPIO_144"),
  240. PINCTRL_PIN(69, "GPIO_145"),
  241. PINCTRL_PIN(70, "GPIO_146"),
  242. PINCTRL_PIN(71, "LPC_ILB_SERIRQ"),
  243. PINCTRL_PIN(72, "LPC_CLKOUT0"),
  244. PINCTRL_PIN(73, "LPC_CLKOUT1"),
  245. PINCTRL_PIN(74, "LPC_AD0"),
  246. PINCTRL_PIN(75, "LPC_AD1"),
  247. PINCTRL_PIN(76, "LPC_AD2"),
  248. PINCTRL_PIN(77, "LPC_AD3"),
  249. PINCTRL_PIN(78, "LPC_CLKRUNB"),
  250. PINCTRL_PIN(79, "LPC_FRAMEB"),
  251. };
  252. static const unsigned int glk_north_spi0_pins[] = { 3, 4, 5, 6, 7 };
  253. static const unsigned int glk_north_spi1_pins[] = { 8, 9, 10, 11, 12, 13 };
  254. static const unsigned int glk_north_i2c5_pins[] = { 34, 35 };
  255. static const unsigned int glk_north_i2c6_pins[] = { 36, 37 };
  256. static const unsigned int glk_north_i2c7_pins[] = { 38, 39 };
  257. static const unsigned int glk_north_uart0_pins[] = { 62, 63, 64, 65 };
  258. static const unsigned int glk_north_spi0b_pins[] = { 66, 67, 68, 69, 70 };
  259. static const struct intel_pingroup glk_north_groups[] = {
  260. PIN_GROUP("spi0_grp", glk_north_spi0_pins, 1),
  261. PIN_GROUP("spi1_grp", glk_north_spi1_pins, 1),
  262. PIN_GROUP("i2c5_grp", glk_north_i2c5_pins, 1),
  263. PIN_GROUP("i2c6_grp", glk_north_i2c6_pins, 1),
  264. PIN_GROUP("i2c7_grp", glk_north_i2c7_pins, 1),
  265. PIN_GROUP("uart0_grp", glk_north_uart0_pins, 2),
  266. PIN_GROUP("spi0b_grp", glk_north_spi0b_pins, 2),
  267. };
  268. static const char * const glk_north_spi0_groups[] = { "spi0_grp", "spi0b_grp" };
  269. static const char * const glk_north_spi1_groups[] = { "spi1_grp" };
  270. static const char * const glk_north_i2c5_groups[] = { "i2c5_grp" };
  271. static const char * const glk_north_i2c6_groups[] = { "i2c6_grp" };
  272. static const char * const glk_north_i2c7_groups[] = { "i2c7_grp" };
  273. static const char * const glk_north_uart0_groups[] = { "uart0_grp" };
  274. static const struct intel_function glk_north_functions[] = {
  275. FUNCTION("spi0", glk_north_spi0_groups),
  276. FUNCTION("spi1", glk_north_spi1_groups),
  277. FUNCTION("i2c5", glk_north_i2c5_groups),
  278. FUNCTION("i2c6", glk_north_i2c6_groups),
  279. FUNCTION("i2c7", glk_north_i2c7_groups),
  280. FUNCTION("uart0", glk_north_uart0_groups),
  281. };
  282. static const struct intel_community glk_north_communities[] = {
  283. GLK_COMMUNITY(0, 0, 79),
  284. };
  285. static const struct intel_pinctrl_soc_data glk_north_soc_data = {
  286. .uid = "2",
  287. .pins = glk_north_pins,
  288. .npins = ARRAY_SIZE(glk_north_pins),
  289. .groups = glk_north_groups,
  290. .ngroups = ARRAY_SIZE(glk_north_groups),
  291. .functions = glk_north_functions,
  292. .nfunctions = ARRAY_SIZE(glk_north_functions),
  293. .communities = glk_north_communities,
  294. .ncommunities = ARRAY_SIZE(glk_north_communities),
  295. };
  296. static const struct pinctrl_pin_desc glk_audio_pins[] = {
  297. PINCTRL_PIN(0, "AVS_I2S0_MCLK"),
  298. PINCTRL_PIN(1, "AVS_I2S0_BCLK"),
  299. PINCTRL_PIN(2, "AVS_I2S0_WS_SYNC"),
  300. PINCTRL_PIN(3, "AVS_I2S0_SDI"),
  301. PINCTRL_PIN(4, "AVS_I2S0_SDO"),
  302. PINCTRL_PIN(5, "AVS_I2S1_MCLK"),
  303. PINCTRL_PIN(6, "AVS_I2S1_BCLK"),
  304. PINCTRL_PIN(7, "AVS_I2S1_WS_SYNC"),
  305. PINCTRL_PIN(8, "AVS_I2S1_SDI"),
  306. PINCTRL_PIN(9, "AVS_I2S1_SDO"),
  307. PINCTRL_PIN(10, "AVS_HDA_BCLK"),
  308. PINCTRL_PIN(11, "AVS_HDA_WS_SYNC"),
  309. PINCTRL_PIN(12, "AVS_HDA_SDI"),
  310. PINCTRL_PIN(13, "AVS_HDA_SDO"),
  311. PINCTRL_PIN(14, "AVS_HDA_RSTB"),
  312. PINCTRL_PIN(15, "AVS_M_CLK_A1"),
  313. PINCTRL_PIN(16, "AVS_M_CLK_B1"),
  314. PINCTRL_PIN(17, "AVS_M_DATA_1"),
  315. PINCTRL_PIN(18, "AVS_M_CLK_AB2"),
  316. PINCTRL_PIN(19, "AVS_M_DATA_2"),
  317. };
  318. static const struct intel_community glk_audio_communities[] = {
  319. GLK_COMMUNITY(0, 0, 19),
  320. };
  321. static const struct intel_pinctrl_soc_data glk_audio_soc_data = {
  322. .uid = "3",
  323. .pins = glk_audio_pins,
  324. .npins = ARRAY_SIZE(glk_audio_pins),
  325. .communities = glk_audio_communities,
  326. .ncommunities = ARRAY_SIZE(glk_audio_communities),
  327. };
  328. static const struct pinctrl_pin_desc glk_scc_pins[] = {
  329. PINCTRL_PIN(0, "SMB_ALERTB"),
  330. PINCTRL_PIN(1, "SMB_CLK"),
  331. PINCTRL_PIN(2, "SMB_DATA"),
  332. PINCTRL_PIN(3, "SDCARD_LVL_WP"),
  333. PINCTRL_PIN(4, "SDCARD_CLK"),
  334. PINCTRL_PIN(5, "SDCARD_CLK_FB"),
  335. PINCTRL_PIN(6, "SDCARD_D0"),
  336. PINCTRL_PIN(7, "SDCARD_D1"),
  337. PINCTRL_PIN(8, "SDCARD_D2"),
  338. PINCTRL_PIN(9, "SDCARD_D3"),
  339. PINCTRL_PIN(10, "SDCARD_CMD"),
  340. PINCTRL_PIN(11, "SDCARD_CD_B"),
  341. PINCTRL_PIN(12, "SDCARD_PWR_DOWN_B"),
  342. PINCTRL_PIN(13, "GPIO_210"),
  343. PINCTRL_PIN(14, "OSC_CLK_OUT_0"),
  344. PINCTRL_PIN(15, "OSC_CLK_OUT_1"),
  345. PINCTRL_PIN(16, "CNV_BRI_DT"),
  346. PINCTRL_PIN(17, "CNV_BRI_RSP"),
  347. PINCTRL_PIN(18, "CNV_RGI_DT"),
  348. PINCTRL_PIN(19, "CNV_RGI_RSP"),
  349. PINCTRL_PIN(20, "CNV_RF_RESET_B"),
  350. PINCTRL_PIN(21, "XTAL_CLKREQ"),
  351. PINCTRL_PIN(22, "SDIO_CLK_FB"),
  352. PINCTRL_PIN(23, "EMMC0_CLK"),
  353. PINCTRL_PIN(24, "EMMC0_CLK_FB"),
  354. PINCTRL_PIN(25, "EMMC0_D0"),
  355. PINCTRL_PIN(26, "EMMC0_D1"),
  356. PINCTRL_PIN(27, "EMMC0_D2"),
  357. PINCTRL_PIN(28, "EMMC0_D3"),
  358. PINCTRL_PIN(29, "EMMC0_D4"),
  359. PINCTRL_PIN(30, "EMMC0_D5"),
  360. PINCTRL_PIN(31, "EMMC0_D6"),
  361. PINCTRL_PIN(32, "EMMC0_D7"),
  362. PINCTRL_PIN(33, "EMMC0_CMD"),
  363. PINCTRL_PIN(34, "EMMC0_STROBE"),
  364. };
  365. static const unsigned int glk_scc_i2c7_pins[] = { 1, 2 };
  366. static const unsigned int glk_scc_sdcard_pins[] = {
  367. 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
  368. };
  369. static const unsigned int glk_scc_sdio_pins[] = { 16, 17, 18, 19, 20, 21, 22 };
  370. static const unsigned int glk_scc_uart1_pins[] = { 16, 17, 18, 19 };
  371. static const unsigned int glk_scc_emmc_pins[] = {
  372. 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
  373. };
  374. static const struct intel_pingroup glk_scc_groups[] = {
  375. PIN_GROUP("i2c7_grp", glk_scc_i2c7_pins, 2),
  376. PIN_GROUP("sdcard_grp", glk_scc_sdcard_pins, 1),
  377. PIN_GROUP("sdio_grp", glk_scc_sdio_pins, 2),
  378. PIN_GROUP("uart1_grp", glk_scc_uart1_pins, 3),
  379. PIN_GROUP("emmc_grp", glk_scc_emmc_pins, 1),
  380. };
  381. static const char * const glk_scc_i2c7_groups[] = { "i2c7_grp" };
  382. static const char * const glk_scc_sdcard_groups[] = { "sdcard_grp" };
  383. static const char * const glk_scc_sdio_groups[] = { "sdio_grp" };
  384. static const char * const glk_scc_uart1_groups[] = { "uart1_grp" };
  385. static const char * const glk_scc_emmc_groups[] = { "emmc_grp" };
  386. static const struct intel_function glk_scc_functions[] = {
  387. FUNCTION("i2c7", glk_scc_i2c7_groups),
  388. FUNCTION("sdcard", glk_scc_sdcard_groups),
  389. FUNCTION("sdio", glk_scc_sdio_groups),
  390. FUNCTION("uart1", glk_scc_uart1_groups),
  391. FUNCTION("emmc", glk_scc_emmc_groups),
  392. };
  393. static const struct intel_community glk_scc_communities[] = {
  394. GLK_COMMUNITY(0, 0, 34),
  395. };
  396. static const struct intel_pinctrl_soc_data glk_scc_soc_data = {
  397. .uid = "4",
  398. .pins = glk_scc_pins,
  399. .npins = ARRAY_SIZE(glk_scc_pins),
  400. .groups = glk_scc_groups,
  401. .ngroups = ARRAY_SIZE(glk_scc_groups),
  402. .functions = glk_scc_functions,
  403. .nfunctions = ARRAY_SIZE(glk_scc_functions),
  404. .communities = glk_scc_communities,
  405. .ncommunities = ARRAY_SIZE(glk_scc_communities),
  406. };
  407. static const struct intel_pinctrl_soc_data *glk_pinctrl_soc_data[] = {
  408. &glk_northwest_soc_data,
  409. &glk_north_soc_data,
  410. &glk_audio_soc_data,
  411. &glk_scc_soc_data,
  412. NULL
  413. };
  414. static const struct acpi_device_id glk_pinctrl_acpi_match[] = {
  415. { "INT3453", (kernel_ulong_t)glk_pinctrl_soc_data },
  416. { }
  417. };
  418. MODULE_DEVICE_TABLE(acpi, glk_pinctrl_acpi_match);
  419. static struct platform_driver glk_pinctrl_driver = {
  420. .probe = intel_pinctrl_probe_by_uid,
  421. .driver = {
  422. .name = "geminilake-pinctrl",
  423. .acpi_match_table = glk_pinctrl_acpi_match,
  424. .pm = pm_sleep_ptr(&intel_pinctrl_pm_ops),
  425. },
  426. };
  427. static int __init glk_pinctrl_init(void)
  428. {
  429. return platform_driver_register(&glk_pinctrl_driver);
  430. }
  431. subsys_initcall(glk_pinctrl_init);
  432. static void __exit glk_pinctrl_exit(void)
  433. {
  434. platform_driver_unregister(&glk_pinctrl_driver);
  435. }
  436. module_exit(glk_pinctrl_exit);
  437. MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>");
  438. MODULE_DESCRIPTION("Intel Gemini Lake SoC pinctrl/GPIO driver");
  439. MODULE_LICENSE("GPL v2");
  440. MODULE_IMPORT_NS(PINCTRL_INTEL);