pinctrl-broxton.c 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066
  1. /*
  2. * Intel Broxton SoC pinctrl/GPIO driver
  3. *
  4. * Copyright (C) 2015, Intel Corporation
  5. * Author: Mika Westerberg <mika.westerberg@linux.intel.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #include <linux/acpi.h>
  12. #include <linux/module.h>
  13. #include <linux/platform_device.h>
  14. #include <linux/pm.h>
  15. #include <linux/pinctrl/pinctrl.h>
  16. #include "pinctrl-intel.h"
  17. #define BXT_PAD_OWN 0x020
  18. #define BXT_HOSTSW_OWN 0x080
  19. #define BXT_PADCFGLOCK 0x060
  20. #define BXT_GPI_IE 0x110
  21. #define BXT_COMMUNITY(s, e) \
  22. { \
  23. .padown_offset = BXT_PAD_OWN, \
  24. .padcfglock_offset = BXT_PADCFGLOCK, \
  25. .hostown_offset = BXT_HOSTSW_OWN, \
  26. .ie_offset = BXT_GPI_IE, \
  27. .gpp_size = 32, \
  28. .pin_base = (s), \
  29. .npins = ((e) - (s) + 1), \
  30. }
  31. /* BXT */
  32. static const struct pinctrl_pin_desc bxt_north_pins[] = {
  33. PINCTRL_PIN(0, "GPIO_0"),
  34. PINCTRL_PIN(1, "GPIO_1"),
  35. PINCTRL_PIN(2, "GPIO_2"),
  36. PINCTRL_PIN(3, "GPIO_3"),
  37. PINCTRL_PIN(4, "GPIO_4"),
  38. PINCTRL_PIN(5, "GPIO_5"),
  39. PINCTRL_PIN(6, "GPIO_6"),
  40. PINCTRL_PIN(7, "GPIO_7"),
  41. PINCTRL_PIN(8, "GPIO_8"),
  42. PINCTRL_PIN(9, "GPIO_9"),
  43. PINCTRL_PIN(10, "GPIO_10"),
  44. PINCTRL_PIN(11, "GPIO_11"),
  45. PINCTRL_PIN(12, "GPIO_12"),
  46. PINCTRL_PIN(13, "GPIO_13"),
  47. PINCTRL_PIN(14, "GPIO_14"),
  48. PINCTRL_PIN(15, "GPIO_15"),
  49. PINCTRL_PIN(16, "GPIO_16"),
  50. PINCTRL_PIN(17, "GPIO_17"),
  51. PINCTRL_PIN(18, "GPIO_18"),
  52. PINCTRL_PIN(19, "GPIO_19"),
  53. PINCTRL_PIN(20, "GPIO_20"),
  54. PINCTRL_PIN(21, "GPIO_21"),
  55. PINCTRL_PIN(22, "GPIO_22"),
  56. PINCTRL_PIN(23, "GPIO_23"),
  57. PINCTRL_PIN(24, "GPIO_24"),
  58. PINCTRL_PIN(25, "GPIO_25"),
  59. PINCTRL_PIN(26, "GPIO_26"),
  60. PINCTRL_PIN(27, "GPIO_27"),
  61. PINCTRL_PIN(28, "GPIO_28"),
  62. PINCTRL_PIN(29, "GPIO_29"),
  63. PINCTRL_PIN(30, "GPIO_30"),
  64. PINCTRL_PIN(31, "GPIO_31"),
  65. PINCTRL_PIN(32, "GPIO_32"),
  66. PINCTRL_PIN(33, "GPIO_33"),
  67. PINCTRL_PIN(34, "PWM0"),
  68. PINCTRL_PIN(35, "PWM1"),
  69. PINCTRL_PIN(36, "PWM2"),
  70. PINCTRL_PIN(37, "PWM3"),
  71. PINCTRL_PIN(38, "LPSS_UART0_RXD"),
  72. PINCTRL_PIN(39, "LPSS_UART0_TXD"),
  73. PINCTRL_PIN(40, "LPSS_UART0_RTS_B"),
  74. PINCTRL_PIN(41, "LPSS_UART0_CTS_B"),
  75. PINCTRL_PIN(42, "LPSS_UART1_RXD"),
  76. PINCTRL_PIN(43, "LPSS_UART1_TXD"),
  77. PINCTRL_PIN(44, "LPSS_UART1_RTS_B"),
  78. PINCTRL_PIN(45, "LPSS_UART1_CTS_B"),
  79. PINCTRL_PIN(46, "LPSS_UART2_RXD"),
  80. PINCTRL_PIN(47, "LPSS_UART2_TXD"),
  81. PINCTRL_PIN(48, "LPSS_UART2_RTS_B"),
  82. PINCTRL_PIN(49, "LPSS_UART2_CTS_B"),
  83. PINCTRL_PIN(50, "ISH_UART0_RXD"),
  84. PINCTRL_PIN(51, "ISH_UART0_TXT"),
  85. PINCTRL_PIN(52, "ISH_UART0_RTS_B"),
  86. PINCTRL_PIN(53, "ISH_UART0_CTS_B"),
  87. PINCTRL_PIN(54, "ISH_UART1_RXD"),
  88. PINCTRL_PIN(55, "ISH_UART1_TXT"),
  89. PINCTRL_PIN(56, "ISH_UART1_RTS_B"),
  90. PINCTRL_PIN(57, "ISH_UART1_CTS_B"),
  91. PINCTRL_PIN(58, "ISH_UART2_RXD"),
  92. PINCTRL_PIN(59, "ISH_UART2_TXD"),
  93. PINCTRL_PIN(60, "ISH_UART2_RTS_B"),
  94. PINCTRL_PIN(61, "ISH_UART2_CTS_B"),
  95. PINCTRL_PIN(62, "GP_CAMERASB00"),
  96. PINCTRL_PIN(63, "GP_CAMERASB01"),
  97. PINCTRL_PIN(64, "GP_CAMERASB02"),
  98. PINCTRL_PIN(65, "GP_CAMERASB03"),
  99. PINCTRL_PIN(66, "GP_CAMERASB04"),
  100. PINCTRL_PIN(67, "GP_CAMERASB05"),
  101. PINCTRL_PIN(68, "GP_CAMERASB06"),
  102. PINCTRL_PIN(69, "GP_CAMERASB07"),
  103. PINCTRL_PIN(70, "GP_CAMERASB08"),
  104. PINCTRL_PIN(71, "GP_CAMERASB09"),
  105. PINCTRL_PIN(72, "GP_CAMERASB10"),
  106. PINCTRL_PIN(73, "GP_CAMERASB11"),
  107. PINCTRL_PIN(74, "TCK"),
  108. PINCTRL_PIN(75, "TRST_B"),
  109. PINCTRL_PIN(76, "TMS"),
  110. PINCTRL_PIN(77, "TDI"),
  111. PINCTRL_PIN(78, "CX_PMODE"),
  112. PINCTRL_PIN(79, "CX_PREQ_B"),
  113. PINCTRL_PIN(80, "JTAGX"),
  114. PINCTRL_PIN(81, "CX_PRDY_B"),
  115. PINCTRL_PIN(82, "TDO"),
  116. };
  117. static const unsigned bxt_north_pwm0_pins[] = { 34 };
  118. static const unsigned bxt_north_pwm1_pins[] = { 35 };
  119. static const unsigned bxt_north_pwm2_pins[] = { 36 };
  120. static const unsigned bxt_north_pwm3_pins[] = { 37 };
  121. static const unsigned bxt_north_uart0_pins[] = { 38, 39, 40, 41 };
  122. static const unsigned bxt_north_uart1_pins[] = { 42, 43, 44, 45 };
  123. static const unsigned bxt_north_uart2_pins[] = { 46, 47, 48, 49 };
  124. static const unsigned bxt_north_uart0b_pins[] = { 50, 51, 52, 53 };
  125. static const unsigned bxt_north_uart1b_pins[] = { 54, 55, 56, 57 };
  126. static const unsigned bxt_north_uart2b_pins[] = { 58, 59, 60, 61 };
  127. static const unsigned bxt_north_uart3_pins[] = { 58, 59, 60, 61 };
  128. static const struct intel_pingroup bxt_north_groups[] = {
  129. PIN_GROUP("pwm0_grp", bxt_north_pwm0_pins, 1),
  130. PIN_GROUP("pwm1_grp", bxt_north_pwm1_pins, 1),
  131. PIN_GROUP("pwm2_grp", bxt_north_pwm2_pins, 1),
  132. PIN_GROUP("pwm3_grp", bxt_north_pwm3_pins, 1),
  133. PIN_GROUP("uart0_grp", bxt_north_uart0_pins, 1),
  134. PIN_GROUP("uart1_grp", bxt_north_uart1_pins, 1),
  135. PIN_GROUP("uart2_grp", bxt_north_uart2_pins, 1),
  136. PIN_GROUP("uart0b_grp", bxt_north_uart0b_pins, 2),
  137. PIN_GROUP("uart1b_grp", bxt_north_uart1b_pins, 2),
  138. PIN_GROUP("uart2b_grp", bxt_north_uart2b_pins, 2),
  139. PIN_GROUP("uart3_grp", bxt_north_uart3_pins, 3),
  140. };
  141. static const char * const bxt_north_pwm0_groups[] = { "pwm0_grp" };
  142. static const char * const bxt_north_pwm1_groups[] = { "pwm1_grp" };
  143. static const char * const bxt_north_pwm2_groups[] = { "pwm2_grp" };
  144. static const char * const bxt_north_pwm3_groups[] = { "pwm3_grp" };
  145. static const char * const bxt_north_uart0_groups[] = {
  146. "uart0_grp", "uart0b_grp",
  147. };
  148. static const char * const bxt_north_uart1_groups[] = {
  149. "uart1_grp", "uart1b_grp",
  150. };
  151. static const char * const bxt_north_uart2_groups[] = {
  152. "uart2_grp", "uart2b_grp",
  153. };
  154. static const char * const bxt_north_uart3_groups[] = { "uart3_grp" };
  155. static const struct intel_function bxt_north_functions[] = {
  156. FUNCTION("pwm0", bxt_north_pwm0_groups),
  157. FUNCTION("pwm1", bxt_north_pwm1_groups),
  158. FUNCTION("pwm2", bxt_north_pwm2_groups),
  159. FUNCTION("pwm3", bxt_north_pwm3_groups),
  160. FUNCTION("uart0", bxt_north_uart0_groups),
  161. FUNCTION("uart1", bxt_north_uart1_groups),
  162. FUNCTION("uart2", bxt_north_uart2_groups),
  163. FUNCTION("uart3", bxt_north_uart3_groups),
  164. };
  165. static const struct intel_community bxt_north_communities[] = {
  166. BXT_COMMUNITY(0, 82),
  167. };
  168. static const struct intel_pinctrl_soc_data bxt_north_soc_data = {
  169. .uid = "1",
  170. .pins = bxt_north_pins,
  171. .npins = ARRAY_SIZE(bxt_north_pins),
  172. .groups = bxt_north_groups,
  173. .ngroups = ARRAY_SIZE(bxt_north_groups),
  174. .functions = bxt_north_functions,
  175. .nfunctions = ARRAY_SIZE(bxt_north_functions),
  176. .communities = bxt_north_communities,
  177. .ncommunities = ARRAY_SIZE(bxt_north_communities),
  178. };
  179. static const struct pinctrl_pin_desc bxt_northwest_pins[] = {
  180. PINCTRL_PIN(0, "PMC_SPI_FS0"),
  181. PINCTRL_PIN(1, "PMC_SPI_FS1"),
  182. PINCTRL_PIN(2, "PMC_SPI_FS2"),
  183. PINCTRL_PIN(3, "PMC_SPI_RXD"),
  184. PINCTRL_PIN(4, "PMC_SPI_TXD"),
  185. PINCTRL_PIN(5, "PMC_SPI_CLK"),
  186. PINCTRL_PIN(6, "PMC_UART_RXD"),
  187. PINCTRL_PIN(7, "PMC_UART_TXD"),
  188. PINCTRL_PIN(8, "PMIC_PWRGOOD"),
  189. PINCTRL_PIN(9, "PMIC_RESET_B"),
  190. PINCTRL_PIN(10, "RTC_CLK"),
  191. PINCTRL_PIN(11, "PMIC_SDWN_B"),
  192. PINCTRL_PIN(12, "PMIC_BCUDISW2"),
  193. PINCTRL_PIN(13, "PMIC_BCUDISCRIT"),
  194. PINCTRL_PIN(14, "PMIC_THERMTRIP_B"),
  195. PINCTRL_PIN(15, "PMIC_STDBY"),
  196. PINCTRL_PIN(16, "SVID0_ALERT_B"),
  197. PINCTRL_PIN(17, "SVID0_DATA"),
  198. PINCTRL_PIN(18, "SVID0_CLK"),
  199. PINCTRL_PIN(19, "PMIC_I2C_SCL"),
  200. PINCTRL_PIN(20, "PMIC_I2C_SDA"),
  201. PINCTRL_PIN(21, "AVS_I2S1_MCLK"),
  202. PINCTRL_PIN(22, "AVS_I2S1_BCLK"),
  203. PINCTRL_PIN(23, "AVS_I2S1_WS_SYNC"),
  204. PINCTRL_PIN(24, "AVS_I2S1_SDI"),
  205. PINCTRL_PIN(25, "AVS_I2S1_SDO"),
  206. PINCTRL_PIN(26, "AVS_M_CLK_A1"),
  207. PINCTRL_PIN(27, "AVS_M_CLK_B1"),
  208. PINCTRL_PIN(28, "AVS_M_DATA_1"),
  209. PINCTRL_PIN(29, "AVS_M_CLK_AB2"),
  210. PINCTRL_PIN(30, "AVS_M_DATA_2"),
  211. PINCTRL_PIN(31, "AVS_I2S2_MCLK"),
  212. PINCTRL_PIN(32, "AVS_I2S2_BCLK"),
  213. PINCTRL_PIN(33, "AVS_I2S2_WS_SYNC"),
  214. PINCTRL_PIN(34, "AVS_I2S2_SDI"),
  215. PINCTRL_PIN(35, "AVS_I2S2_SDOK"),
  216. PINCTRL_PIN(36, "AVS_I2S3_BCLK"),
  217. PINCTRL_PIN(37, "AVS_I2S3_WS_SYNC"),
  218. PINCTRL_PIN(38, "AVS_I2S3_SDI"),
  219. PINCTRL_PIN(39, "AVS_I2S3_SDO"),
  220. PINCTRL_PIN(40, "AVS_I2S4_BCLK"),
  221. PINCTRL_PIN(41, "AVS_I2S4_WS_SYNC"),
  222. PINCTRL_PIN(42, "AVS_I2S4_SDI"),
  223. PINCTRL_PIN(43, "AVS_I2S4_SDO"),
  224. PINCTRL_PIN(44, "PROCHOT_B"),
  225. PINCTRL_PIN(45, "FST_SPI_CS0_B"),
  226. PINCTRL_PIN(46, "FST_SPI_CS1_B"),
  227. PINCTRL_PIN(47, "FST_SPI_MOSI_IO0"),
  228. PINCTRL_PIN(48, "FST_SPI_MISO_IO1"),
  229. PINCTRL_PIN(49, "FST_SPI_IO2"),
  230. PINCTRL_PIN(50, "FST_SPI_IO3"),
  231. PINCTRL_PIN(51, "FST_SPI_CLK"),
  232. PINCTRL_PIN(52, "FST_SPI_CLK_FB"),
  233. PINCTRL_PIN(53, "GP_SSP_0_CLK"),
  234. PINCTRL_PIN(54, "GP_SSP_0_FS0"),
  235. PINCTRL_PIN(55, "GP_SSP_0_FS1"),
  236. PINCTRL_PIN(56, "GP_SSP_0_FS2"),
  237. PINCTRL_PIN(57, "GP_SSP_0_RXD"),
  238. PINCTRL_PIN(58, "GP_SSP_0_TXD"),
  239. PINCTRL_PIN(59, "GP_SSP_1_CLK"),
  240. PINCTRL_PIN(60, "GP_SSP_1_FS0"),
  241. PINCTRL_PIN(61, "GP_SSP_1_FS1"),
  242. PINCTRL_PIN(62, "GP_SSP_1_FS2"),
  243. PINCTRL_PIN(63, "GP_SSP_1_FS3"),
  244. PINCTRL_PIN(64, "GP_SSP_1_RXD"),
  245. PINCTRL_PIN(65, "GP_SSP_1_TXD"),
  246. PINCTRL_PIN(66, "GP_SSP_2_CLK"),
  247. PINCTRL_PIN(67, "GP_SSP_2_FS0"),
  248. PINCTRL_PIN(68, "GP_SSP_2_FS1"),
  249. PINCTRL_PIN(69, "GP_SSP_2_FS2"),
  250. PINCTRL_PIN(70, "GP_SSP_2_RXD"),
  251. PINCTRL_PIN(71, "GP_SSP_2_TXD"),
  252. };
  253. static const unsigned bxt_northwest_ssp0_pins[] = { 53, 54, 55, 56, 57, 58 };
  254. static const unsigned bxt_northwest_ssp1_pins[] = {
  255. 59, 60, 61, 62, 63, 64, 65
  256. };
  257. static const unsigned bxt_northwest_ssp2_pins[] = { 66, 67, 68, 69, 70, 71 };
  258. static const unsigned bxt_northwest_uart3_pins[] = { 67, 68, 69, 70 };
  259. static const struct intel_pingroup bxt_northwest_groups[] = {
  260. PIN_GROUP("ssp0_grp", bxt_northwest_ssp0_pins, 1),
  261. PIN_GROUP("ssp1_grp", bxt_northwest_ssp1_pins, 1),
  262. PIN_GROUP("ssp2_grp", bxt_northwest_ssp2_pins, 1),
  263. PIN_GROUP("uart3_grp", bxt_northwest_uart3_pins, 2),
  264. };
  265. static const char * const bxt_northwest_ssp0_groups[] = { "ssp0_grp" };
  266. static const char * const bxt_northwest_ssp1_groups[] = { "ssp1_grp" };
  267. static const char * const bxt_northwest_ssp2_groups[] = { "ssp2_grp" };
  268. static const char * const bxt_northwest_uart3_groups[] = { "uart3_grp" };
  269. static const struct intel_function bxt_northwest_functions[] = {
  270. FUNCTION("ssp0", bxt_northwest_ssp0_groups),
  271. FUNCTION("ssp1", bxt_northwest_ssp1_groups),
  272. FUNCTION("ssp2", bxt_northwest_ssp2_groups),
  273. FUNCTION("uart3", bxt_northwest_uart3_groups),
  274. };
  275. static const struct intel_community bxt_northwest_communities[] = {
  276. BXT_COMMUNITY(0, 71),
  277. };
  278. static const struct intel_pinctrl_soc_data bxt_northwest_soc_data = {
  279. .uid = "2",
  280. .pins = bxt_northwest_pins,
  281. .npins = ARRAY_SIZE(bxt_northwest_pins),
  282. .groups = bxt_northwest_groups,
  283. .ngroups = ARRAY_SIZE(bxt_northwest_groups),
  284. .functions = bxt_northwest_functions,
  285. .nfunctions = ARRAY_SIZE(bxt_northwest_functions),
  286. .communities = bxt_northwest_communities,
  287. .ncommunities = ARRAY_SIZE(bxt_northwest_communities),
  288. };
  289. static const struct pinctrl_pin_desc bxt_west_pins[] = {
  290. PINCTRL_PIN(0, "LPSS_I2C0_SDA"),
  291. PINCTRL_PIN(1, "LPSS_I2C0_SCL"),
  292. PINCTRL_PIN(2, "LPSS_I2C1_SDA"),
  293. PINCTRL_PIN(3, "LPSS_I2C1_SCL"),
  294. PINCTRL_PIN(4, "LPSS_I2C2_SDA"),
  295. PINCTRL_PIN(5, "LPSS_I2C2_SCL"),
  296. PINCTRL_PIN(6, "LPSS_I2C3_SDA"),
  297. PINCTRL_PIN(7, "LPSS_I2C3_SCL"),
  298. PINCTRL_PIN(8, "LPSS_I2C4_SDA"),
  299. PINCTRL_PIN(9, "LPSS_I2C4_SCL"),
  300. PINCTRL_PIN(10, "LPSS_I2C5_SDA"),
  301. PINCTRL_PIN(11, "LPSS_I2C5_SCL"),
  302. PINCTRL_PIN(12, "LPSS_I2C6_SDA"),
  303. PINCTRL_PIN(13, "LPSS_I2C6_SCL"),
  304. PINCTRL_PIN(14, "LPSS_I2C7_SDA"),
  305. PINCTRL_PIN(15, "LPSS_I2C7_SCL"),
  306. PINCTRL_PIN(16, "ISH_I2C0_SDA"),
  307. PINCTRL_PIN(17, "ISH_I2C0_SCL"),
  308. PINCTRL_PIN(18, "ISH_I2C1_SDA"),
  309. PINCTRL_PIN(19, "ISH_I2C1_SCL"),
  310. PINCTRL_PIN(20, "ISH_I2C2_SDA"),
  311. PINCTRL_PIN(21, "ISH_I2C2_SCL"),
  312. PINCTRL_PIN(22, "ISH_GPIO_0"),
  313. PINCTRL_PIN(23, "ISH_GPIO_1"),
  314. PINCTRL_PIN(24, "ISH_GPIO_2"),
  315. PINCTRL_PIN(25, "ISH_GPIO_3"),
  316. PINCTRL_PIN(26, "ISH_GPIO_4"),
  317. PINCTRL_PIN(27, "ISH_GPIO_5"),
  318. PINCTRL_PIN(28, "ISH_GPIO_6"),
  319. PINCTRL_PIN(29, "ISH_GPIO_7"),
  320. PINCTRL_PIN(30, "ISH_GPIO_8"),
  321. PINCTRL_PIN(31, "ISH_GPIO_9"),
  322. PINCTRL_PIN(32, "MODEM_CLKREQ"),
  323. PINCTRL_PIN(33, "DGCLKDBG_PMC_0"),
  324. PINCTRL_PIN(34, "DGCLKDBG_PMC_1"),
  325. PINCTRL_PIN(35, "DGCLKDBG_PMC_2"),
  326. PINCTRL_PIN(36, "DGCLKDBG_ICLK_0"),
  327. PINCTRL_PIN(37, "DGCLKDBG_ICLK_1"),
  328. PINCTRL_PIN(38, "OSC_CLK_OUT_0"),
  329. PINCTRL_PIN(39, "OSC_CLK_OUT_1"),
  330. PINCTRL_PIN(40, "OSC_CLK_OUT_2"),
  331. PINCTRL_PIN(41, "OSC_CLK_OUT_3"),
  332. };
  333. static const unsigned bxt_west_i2c0_pins[] = { 0, 1 };
  334. static const unsigned bxt_west_i2c1_pins[] = { 2, 3 };
  335. static const unsigned bxt_west_i2c2_pins[] = { 4, 5 };
  336. static const unsigned bxt_west_i2c3_pins[] = { 6, 7 };
  337. static const unsigned bxt_west_i2c4_pins[] = { 8, 9 };
  338. static const unsigned bxt_west_i2c5_pins[] = { 10, 11 };
  339. static const unsigned bxt_west_i2c6_pins[] = { 12, 13 };
  340. static const unsigned bxt_west_i2c7_pins[] = { 14, 15 };
  341. static const unsigned bxt_west_i2c5b_pins[] = { 16, 17 };
  342. static const unsigned bxt_west_i2c6b_pins[] = { 18, 19 };
  343. static const unsigned bxt_west_i2c7b_pins[] = { 20, 21 };
  344. static const struct intel_pingroup bxt_west_groups[] = {
  345. PIN_GROUP("i2c0_grp", bxt_west_i2c0_pins, 1),
  346. PIN_GROUP("i2c1_grp", bxt_west_i2c1_pins, 1),
  347. PIN_GROUP("i2c2_grp", bxt_west_i2c2_pins, 1),
  348. PIN_GROUP("i2c3_grp", bxt_west_i2c3_pins, 1),
  349. PIN_GROUP("i2c4_grp", bxt_west_i2c4_pins, 1),
  350. PIN_GROUP("i2c5_grp", bxt_west_i2c5_pins, 1),
  351. PIN_GROUP("i2c6_grp", bxt_west_i2c6_pins, 1),
  352. PIN_GROUP("i2c7_grp", bxt_west_i2c7_pins, 1),
  353. PIN_GROUP("i2c5b_grp", bxt_west_i2c5b_pins, 2),
  354. PIN_GROUP("i2c6b_grp", bxt_west_i2c6b_pins, 2),
  355. PIN_GROUP("i2c7b_grp", bxt_west_i2c7b_pins, 2),
  356. };
  357. static const char * const bxt_west_i2c0_groups[] = { "i2c0_grp" };
  358. static const char * const bxt_west_i2c1_groups[] = { "i2c1_grp" };
  359. static const char * const bxt_west_i2c2_groups[] = { "i2c2_grp" };
  360. static const char * const bxt_west_i2c3_groups[] = { "i2c3_grp" };
  361. static const char * const bxt_west_i2c4_groups[] = { "i2c4_grp" };
  362. static const char * const bxt_west_i2c5_groups[] = { "i2c5_grp", "i2c5b_grp" };
  363. static const char * const bxt_west_i2c6_groups[] = { "i2c6_grp", "i2c6b_grp" };
  364. static const char * const bxt_west_i2c7_groups[] = { "i2c7_grp", "i2c7b_grp" };
  365. static const struct intel_function bxt_west_functions[] = {
  366. FUNCTION("i2c0", bxt_west_i2c0_groups),
  367. FUNCTION("i2c1", bxt_west_i2c1_groups),
  368. FUNCTION("i2c2", bxt_west_i2c2_groups),
  369. FUNCTION("i2c3", bxt_west_i2c3_groups),
  370. FUNCTION("i2c4", bxt_west_i2c4_groups),
  371. FUNCTION("i2c5", bxt_west_i2c5_groups),
  372. FUNCTION("i2c6", bxt_west_i2c6_groups),
  373. FUNCTION("i2c7", bxt_west_i2c7_groups),
  374. };
  375. static const struct intel_community bxt_west_communities[] = {
  376. BXT_COMMUNITY(0, 41),
  377. };
  378. static const struct intel_pinctrl_soc_data bxt_west_soc_data = {
  379. .uid = "3",
  380. .pins = bxt_west_pins,
  381. .npins = ARRAY_SIZE(bxt_west_pins),
  382. .groups = bxt_west_groups,
  383. .ngroups = ARRAY_SIZE(bxt_west_groups),
  384. .functions = bxt_west_functions,
  385. .nfunctions = ARRAY_SIZE(bxt_west_functions),
  386. .communities = bxt_west_communities,
  387. .ncommunities = ARRAY_SIZE(bxt_west_communities),
  388. };
  389. static const struct pinctrl_pin_desc bxt_southwest_pins[] = {
  390. PINCTRL_PIN(0, "EMMC0_CLK"),
  391. PINCTRL_PIN(1, "EMMC0_D0"),
  392. PINCTRL_PIN(2, "EMMC0_D1"),
  393. PINCTRL_PIN(3, "EMMC0_D2"),
  394. PINCTRL_PIN(4, "EMMC0_D3"),
  395. PINCTRL_PIN(5, "EMMC0_D4"),
  396. PINCTRL_PIN(6, "EMMC0_D5"),
  397. PINCTRL_PIN(7, "EMMC0_D6"),
  398. PINCTRL_PIN(8, "EMMC0_D7"),
  399. PINCTRL_PIN(9, "EMMC0_CMD"),
  400. PINCTRL_PIN(10, "SDIO_CLK"),
  401. PINCTRL_PIN(11, "SDIO_D0"),
  402. PINCTRL_PIN(12, "SDIO_D1"),
  403. PINCTRL_PIN(13, "SDIO_D2"),
  404. PINCTRL_PIN(14, "SDIO_D3"),
  405. PINCTRL_PIN(15, "SDIO_CMD"),
  406. PINCTRL_PIN(16, "SDCARD_CLK"),
  407. PINCTRL_PIN(17, "SDCARD_D0"),
  408. PINCTRL_PIN(18, "SDCARD_D1"),
  409. PINCTRL_PIN(19, "SDCARD_D2"),
  410. PINCTRL_PIN(20, "SDCARD_D3"),
  411. PINCTRL_PIN(21, "SDCARD_CD_B"),
  412. PINCTRL_PIN(22, "SDCARD_CMD"),
  413. PINCTRL_PIN(23, "SDCARD_LVL_CLK_FB"),
  414. PINCTRL_PIN(24, "SDCARD_LVL_CMD_DIR"),
  415. PINCTRL_PIN(25, "SDCARD_LVL_DAT_DIR"),
  416. PINCTRL_PIN(26, "EMMC0_STROBE"),
  417. PINCTRL_PIN(27, "SDIO_PWR_DOWN_B"),
  418. PINCTRL_PIN(28, "SDCARD_PWR_DOWN_B"),
  419. PINCTRL_PIN(29, "SDCARD_LVL_SEL"),
  420. PINCTRL_PIN(30, "SDCARD_LVL_WP"),
  421. };
  422. static const unsigned bxt_southwest_emmc0_pins[] = {
  423. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 26,
  424. };
  425. static const unsigned bxt_southwest_sdio_pins[] = {
  426. 10, 11, 12, 13, 14, 15, 27,
  427. };
  428. static const unsigned bxt_southwest_sdcard_pins[] = {
  429. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 28, 29, 30,
  430. };
  431. static const struct intel_pingroup bxt_southwest_groups[] = {
  432. PIN_GROUP("emmc0_grp", bxt_southwest_emmc0_pins, 1),
  433. PIN_GROUP("sdio_grp", bxt_southwest_sdio_pins, 1),
  434. PIN_GROUP("sdcard_grp", bxt_southwest_sdcard_pins, 1),
  435. };
  436. static const char * const bxt_southwest_emmc0_groups[] = { "emmc0_grp" };
  437. static const char * const bxt_southwest_sdio_groups[] = { "sdio_grp" };
  438. static const char * const bxt_southwest_sdcard_groups[] = { "sdcard_grp" };
  439. static const struct intel_function bxt_southwest_functions[] = {
  440. FUNCTION("emmc0", bxt_southwest_emmc0_groups),
  441. FUNCTION("sdio", bxt_southwest_sdio_groups),
  442. FUNCTION("sdcard", bxt_southwest_sdcard_groups),
  443. };
  444. static const struct intel_community bxt_southwest_communities[] = {
  445. BXT_COMMUNITY(0, 30),
  446. };
  447. static const struct intel_pinctrl_soc_data bxt_southwest_soc_data = {
  448. .uid = "4",
  449. .pins = bxt_southwest_pins,
  450. .npins = ARRAY_SIZE(bxt_southwest_pins),
  451. .groups = bxt_southwest_groups,
  452. .ngroups = ARRAY_SIZE(bxt_southwest_groups),
  453. .functions = bxt_southwest_functions,
  454. .nfunctions = ARRAY_SIZE(bxt_southwest_functions),
  455. .communities = bxt_southwest_communities,
  456. .ncommunities = ARRAY_SIZE(bxt_southwest_communities),
  457. };
  458. static const struct pinctrl_pin_desc bxt_south_pins[] = {
  459. PINCTRL_PIN(0, "HV_DDI0_DDC_SDA"),
  460. PINCTRL_PIN(1, "HV_DDI0_DDC_SCL"),
  461. PINCTRL_PIN(2, "HV_DDI1_DDC_SDA"),
  462. PINCTRL_PIN(3, "HV_DDI1_DDC_SCL"),
  463. PINCTRL_PIN(4, "DBI_SDA"),
  464. PINCTRL_PIN(5, "DBI_SCL"),
  465. PINCTRL_PIN(6, "PANEL0_VDDEN"),
  466. PINCTRL_PIN(7, "PANEL0_BKLTEN"),
  467. PINCTRL_PIN(8, "PANEL0_BKLTCTL"),
  468. PINCTRL_PIN(9, "PANEL1_VDDEN"),
  469. PINCTRL_PIN(10, "PANEL1_BKLTEN"),
  470. PINCTRL_PIN(11, "PANEL1_BKLTCTL"),
  471. PINCTRL_PIN(12, "DBI_CSX"),
  472. PINCTRL_PIN(13, "DBI_RESX"),
  473. PINCTRL_PIN(14, "GP_INTD_DSI_TE1"),
  474. PINCTRL_PIN(15, "GP_INTD_DSI_TE2"),
  475. PINCTRL_PIN(16, "USB_OC0_B"),
  476. PINCTRL_PIN(17, "USB_OC1_B"),
  477. PINCTRL_PIN(18, "MEX_WAKE0_B"),
  478. PINCTRL_PIN(19, "MEX_WAKE1_B"),
  479. };
  480. static const struct intel_community bxt_south_communities[] = {
  481. BXT_COMMUNITY(0, 19),
  482. };
  483. static const struct intel_pinctrl_soc_data bxt_south_soc_data = {
  484. .uid = "5",
  485. .pins = bxt_south_pins,
  486. .npins = ARRAY_SIZE(bxt_south_pins),
  487. .communities = bxt_south_communities,
  488. .ncommunities = ARRAY_SIZE(bxt_south_communities),
  489. };
  490. static const struct intel_pinctrl_soc_data *bxt_pinctrl_soc_data[] = {
  491. &bxt_north_soc_data,
  492. &bxt_northwest_soc_data,
  493. &bxt_west_soc_data,
  494. &bxt_southwest_soc_data,
  495. &bxt_south_soc_data,
  496. NULL,
  497. };
  498. /* APL */
  499. static const struct pinctrl_pin_desc apl_north_pins[] = {
  500. PINCTRL_PIN(0, "GPIO_0"),
  501. PINCTRL_PIN(1, "GPIO_1"),
  502. PINCTRL_PIN(2, "GPIO_2"),
  503. PINCTRL_PIN(3, "GPIO_3"),
  504. PINCTRL_PIN(4, "GPIO_4"),
  505. PINCTRL_PIN(5, "GPIO_5"),
  506. PINCTRL_PIN(6, "GPIO_6"),
  507. PINCTRL_PIN(7, "GPIO_7"),
  508. PINCTRL_PIN(8, "GPIO_8"),
  509. PINCTRL_PIN(9, "GPIO_9"),
  510. PINCTRL_PIN(10, "GPIO_10"),
  511. PINCTRL_PIN(11, "GPIO_11"),
  512. PINCTRL_PIN(12, "GPIO_12"),
  513. PINCTRL_PIN(13, "GPIO_13"),
  514. PINCTRL_PIN(14, "GPIO_14"),
  515. PINCTRL_PIN(15, "GPIO_15"),
  516. PINCTRL_PIN(16, "GPIO_16"),
  517. PINCTRL_PIN(17, "GPIO_17"),
  518. PINCTRL_PIN(18, "GPIO_18"),
  519. PINCTRL_PIN(19, "GPIO_19"),
  520. PINCTRL_PIN(20, "GPIO_20"),
  521. PINCTRL_PIN(21, "GPIO_21"),
  522. PINCTRL_PIN(22, "GPIO_22"),
  523. PINCTRL_PIN(23, "GPIO_23"),
  524. PINCTRL_PIN(24, "GPIO_24"),
  525. PINCTRL_PIN(25, "GPIO_25"),
  526. PINCTRL_PIN(26, "GPIO_26"),
  527. PINCTRL_PIN(27, "GPIO_27"),
  528. PINCTRL_PIN(28, "GPIO_28"),
  529. PINCTRL_PIN(29, "GPIO_29"),
  530. PINCTRL_PIN(30, "GPIO_30"),
  531. PINCTRL_PIN(31, "GPIO_31"),
  532. PINCTRL_PIN(32, "GPIO_32"),
  533. PINCTRL_PIN(33, "GPIO_33"),
  534. PINCTRL_PIN(34, "PWM0"),
  535. PINCTRL_PIN(35, "PWM1"),
  536. PINCTRL_PIN(36, "PWM2"),
  537. PINCTRL_PIN(37, "PWM3"),
  538. PINCTRL_PIN(38, "LPSS_UART0_RXD"),
  539. PINCTRL_PIN(39, "LPSS_UART0_TXD"),
  540. PINCTRL_PIN(40, "LPSS_UART0_RTS_B"),
  541. PINCTRL_PIN(41, "LPSS_UART0_CTS_B"),
  542. PINCTRL_PIN(42, "LPSS_UART1_RXD"),
  543. PINCTRL_PIN(43, "LPSS_UART1_TXD"),
  544. PINCTRL_PIN(44, "LPSS_UART1_RTS_B"),
  545. PINCTRL_PIN(45, "LPSS_UART1_CTS_B"),
  546. PINCTRL_PIN(46, "LPSS_UART2_RXD"),
  547. PINCTRL_PIN(47, "LPSS_UART2_TXD"),
  548. PINCTRL_PIN(48, "LPSS_UART2_RTS_B"),
  549. PINCTRL_PIN(49, "LPSS_UART2_CTS_B"),
  550. PINCTRL_PIN(50, "GP_CAMERASB00"),
  551. PINCTRL_PIN(51, "GP_CAMERASB01"),
  552. PINCTRL_PIN(52, "GP_CAMERASB02"),
  553. PINCTRL_PIN(53, "GP_CAMERASB03"),
  554. PINCTRL_PIN(54, "GP_CAMERASB04"),
  555. PINCTRL_PIN(55, "GP_CAMERASB05"),
  556. PINCTRL_PIN(56, "GP_CAMERASB06"),
  557. PINCTRL_PIN(57, "GP_CAMERASB07"),
  558. PINCTRL_PIN(58, "GP_CAMERASB08"),
  559. PINCTRL_PIN(59, "GP_CAMERASB09"),
  560. PINCTRL_PIN(60, "GP_CAMERASB10"),
  561. PINCTRL_PIN(61, "GP_CAMERASB11"),
  562. PINCTRL_PIN(62, "TCK"),
  563. PINCTRL_PIN(63, "TRST_B"),
  564. PINCTRL_PIN(64, "TMS"),
  565. PINCTRL_PIN(65, "TDI"),
  566. PINCTRL_PIN(66, "CX_PMODE"),
  567. PINCTRL_PIN(67, "CX_PREQ_B"),
  568. PINCTRL_PIN(68, "JTAGX"),
  569. PINCTRL_PIN(69, "CX_PRDY_B"),
  570. PINCTRL_PIN(70, "TDO"),
  571. PINCTRL_PIN(71, "CNV_BRI_DT"),
  572. PINCTRL_PIN(72, "CNV_BRI_RSP"),
  573. PINCTRL_PIN(73, "CNV_RGI_DT"),
  574. PINCTRL_PIN(74, "CNV_RGI_RSP"),
  575. PINCTRL_PIN(75, "SVID0_ALERT_B"),
  576. PINCTRL_PIN(76, "SVID0_DATA"),
  577. PINCTRL_PIN(77, "SVID0_CLK"),
  578. };
  579. static const unsigned apl_north_pwm0_pins[] = { 34 };
  580. static const unsigned apl_north_pwm1_pins[] = { 35 };
  581. static const unsigned apl_north_pwm2_pins[] = { 36 };
  582. static const unsigned apl_north_pwm3_pins[] = { 37 };
  583. static const unsigned apl_north_uart0_pins[] = { 38, 39, 40, 41 };
  584. static const unsigned apl_north_uart1_pins[] = { 42, 43, 44, 45 };
  585. static const unsigned apl_north_uart2_pins[] = { 46, 47, 48, 49 };
  586. static const struct intel_pingroup apl_north_groups[] = {
  587. PIN_GROUP("pwm0_grp", apl_north_pwm0_pins, 1),
  588. PIN_GROUP("pwm1_grp", apl_north_pwm1_pins, 1),
  589. PIN_GROUP("pwm2_grp", apl_north_pwm2_pins, 1),
  590. PIN_GROUP("pwm3_grp", apl_north_pwm3_pins, 1),
  591. PIN_GROUP("uart0_grp", apl_north_uart0_pins, 1),
  592. PIN_GROUP("uart1_grp", apl_north_uart1_pins, 1),
  593. PIN_GROUP("uart2_grp", apl_north_uart2_pins, 1),
  594. };
  595. static const char * const apl_north_pwm0_groups[] = { "pwm0_grp" };
  596. static const char * const apl_north_pwm1_groups[] = { "pwm1_grp" };
  597. static const char * const apl_north_pwm2_groups[] = { "pwm2_grp" };
  598. static const char * const apl_north_pwm3_groups[] = { "pwm3_grp" };
  599. static const char * const apl_north_uart0_groups[] = { "uart0_grp" };
  600. static const char * const apl_north_uart1_groups[] = { "uart1_grp" };
  601. static const char * const apl_north_uart2_groups[] = { "uart2_grp" };
  602. static const struct intel_function apl_north_functions[] = {
  603. FUNCTION("pwm0", apl_north_pwm0_groups),
  604. FUNCTION("pwm1", apl_north_pwm1_groups),
  605. FUNCTION("pwm2", apl_north_pwm2_groups),
  606. FUNCTION("pwm3", apl_north_pwm3_groups),
  607. FUNCTION("uart0", apl_north_uart0_groups),
  608. FUNCTION("uart1", apl_north_uart1_groups),
  609. FUNCTION("uart2", apl_north_uart2_groups),
  610. };
  611. static const struct intel_community apl_north_communities[] = {
  612. BXT_COMMUNITY(0, 77),
  613. };
  614. static const struct intel_pinctrl_soc_data apl_north_soc_data = {
  615. .uid = "1",
  616. .pins = apl_north_pins,
  617. .npins = ARRAY_SIZE(apl_north_pins),
  618. .groups = apl_north_groups,
  619. .ngroups = ARRAY_SIZE(apl_north_groups),
  620. .functions = apl_north_functions,
  621. .nfunctions = ARRAY_SIZE(apl_north_functions),
  622. .communities = apl_north_communities,
  623. .ncommunities = ARRAY_SIZE(apl_north_communities),
  624. };
  625. static const struct pinctrl_pin_desc apl_northwest_pins[] = {
  626. PINCTRL_PIN(0, "HV_DDI0_DDC_SDA"),
  627. PINCTRL_PIN(1, "HV_DDI0_DDC_SCL"),
  628. PINCTRL_PIN(2, "HV_DDI1_DDC_SDA"),
  629. PINCTRL_PIN(3, "HV_DDI1_DDC_SCL"),
  630. PINCTRL_PIN(4, "DBI_SDA"),
  631. PINCTRL_PIN(5, "DBI_SCL"),
  632. PINCTRL_PIN(6, "PANEL0_VDDEN"),
  633. PINCTRL_PIN(7, "PANEL0_BKLTEN"),
  634. PINCTRL_PIN(8, "PANEL0_BKLTCTL"),
  635. PINCTRL_PIN(9, "PANEL1_VDDEN"),
  636. PINCTRL_PIN(10, "PANEL1_BKLTEN"),
  637. PINCTRL_PIN(11, "PANEL1_BKLTCTL"),
  638. PINCTRL_PIN(12, "DBI_CSX"),
  639. PINCTRL_PIN(13, "DBI_RESX"),
  640. PINCTRL_PIN(14, "GP_INTD_DSI_TE1"),
  641. PINCTRL_PIN(15, "GP_INTD_DSI_TE2"),
  642. PINCTRL_PIN(16, "USB_OC0_B"),
  643. PINCTRL_PIN(17, "USB_OC1_B"),
  644. PINCTRL_PIN(18, "PMC_SPI_FS0"),
  645. PINCTRL_PIN(19, "PMC_SPI_FS1"),
  646. PINCTRL_PIN(20, "PMC_SPI_FS2"),
  647. PINCTRL_PIN(21, "PMC_SPI_RXD"),
  648. PINCTRL_PIN(22, "PMC_SPI_TXD"),
  649. PINCTRL_PIN(23, "PMC_SPI_CLK"),
  650. PINCTRL_PIN(24, "PMIC_PWRGOOD"),
  651. PINCTRL_PIN(25, "PMIC_RESET_B"),
  652. PINCTRL_PIN(26, "PMIC_SDWN_B"),
  653. PINCTRL_PIN(27, "PMIC_BCUDISW2"),
  654. PINCTRL_PIN(28, "PMIC_BCUDISCRIT"),
  655. PINCTRL_PIN(29, "PMIC_THERMTRIP_B"),
  656. PINCTRL_PIN(30, "PMIC_STDBY"),
  657. PINCTRL_PIN(31, "PROCHOT_B"),
  658. PINCTRL_PIN(32, "PMIC_I2C_SCL"),
  659. PINCTRL_PIN(33, "PMIC_I2C_SDA"),
  660. PINCTRL_PIN(34, "AVS_I2S1_MCLK"),
  661. PINCTRL_PIN(35, "AVS_I2S1_BCLK"),
  662. PINCTRL_PIN(36, "AVS_I2S1_WS_SYNC"),
  663. PINCTRL_PIN(37, "AVS_I2S1_SDI"),
  664. PINCTRL_PIN(38, "AVS_I2S1_SDO"),
  665. PINCTRL_PIN(39, "AVS_M_CLK_A1"),
  666. PINCTRL_PIN(40, "AVS_M_CLK_B1"),
  667. PINCTRL_PIN(41, "AVS_M_DATA_1"),
  668. PINCTRL_PIN(42, "AVS_M_CLK_AB2"),
  669. PINCTRL_PIN(43, "AVS_M_DATA_2"),
  670. PINCTRL_PIN(44, "AVS_I2S2_MCLK"),
  671. PINCTRL_PIN(45, "AVS_I2S2_BCLK"),
  672. PINCTRL_PIN(46, "AVS_I2S2_WS_SYNC"),
  673. PINCTRL_PIN(47, "AVS_I2S2_SDI"),
  674. PINCTRL_PIN(48, "AVS_I2S2_SDO"),
  675. PINCTRL_PIN(49, "AVS_I2S3_BCLK"),
  676. PINCTRL_PIN(50, "AVS_I2S3_WS_SYNC"),
  677. PINCTRL_PIN(51, "AVS_I2S3_SDI"),
  678. PINCTRL_PIN(52, "AVS_I2S3_SDO"),
  679. PINCTRL_PIN(53, "FST_SPI_CS0_B"),
  680. PINCTRL_PIN(54, "FST_SPI_CS1_B"),
  681. PINCTRL_PIN(55, "FST_SPI_MOSI_IO0"),
  682. PINCTRL_PIN(56, "FST_SPI_MISO_IO1"),
  683. PINCTRL_PIN(57, "FST_SPI_IO2"),
  684. PINCTRL_PIN(58, "FST_SPI_IO3"),
  685. PINCTRL_PIN(59, "FST_SPI_CLK"),
  686. PINCTRL_PIN(60, "FST_SPI_CLK_FB"),
  687. PINCTRL_PIN(61, "GP_SSP_0_CLK"),
  688. PINCTRL_PIN(62, "GP_SSP_0_FS0"),
  689. PINCTRL_PIN(63, "GP_SSP_0_FS1"),
  690. PINCTRL_PIN(64, "GP_SSP_0_RXD"),
  691. PINCTRL_PIN(65, "GP_SSP_0_TXD"),
  692. PINCTRL_PIN(66, "GP_SSP_1_CLK"),
  693. PINCTRL_PIN(67, "GP_SSP_1_FS0"),
  694. PINCTRL_PIN(68, "GP_SSP_1_FS1"),
  695. PINCTRL_PIN(69, "GP_SSP_1_RXD"),
  696. PINCTRL_PIN(70, "GP_SSP_1_TXD"),
  697. PINCTRL_PIN(71, "GP_SSP_2_CLK"),
  698. PINCTRL_PIN(72, "GP_SSP_2_FS0"),
  699. PINCTRL_PIN(73, "GP_SSP_2_FS1"),
  700. PINCTRL_PIN(74, "GP_SSP_2_FS2"),
  701. PINCTRL_PIN(75, "GP_SSP_2_RXD"),
  702. PINCTRL_PIN(76, "GP_SSP_2_TXD"),
  703. };
  704. static const unsigned apl_northwest_ssp0_pins[] = { 61, 62, 63, 64, 65 };
  705. static const unsigned apl_northwest_ssp1_pins[] = { 66, 67, 68, 69, 70 };
  706. static const unsigned apl_northwest_ssp2_pins[] = { 71, 72, 73, 74, 75, 76 };
  707. static const unsigned apl_northwest_uart3_pins[] = { 67, 68, 69, 70 };
  708. static const struct intel_pingroup apl_northwest_groups[] = {
  709. PIN_GROUP("ssp0_grp", apl_northwest_ssp0_pins, 1),
  710. PIN_GROUP("ssp1_grp", apl_northwest_ssp1_pins, 1),
  711. PIN_GROUP("ssp2_grp", apl_northwest_ssp2_pins, 1),
  712. PIN_GROUP("uart3_grp", apl_northwest_uart3_pins, 2),
  713. };
  714. static const char * const apl_northwest_ssp0_groups[] = { "ssp0_grp" };
  715. static const char * const apl_northwest_ssp1_groups[] = { "ssp1_grp" };
  716. static const char * const apl_northwest_ssp2_groups[] = { "ssp2_grp" };
  717. static const char * const apl_northwest_uart3_groups[] = { "uart3_grp" };
  718. static const struct intel_function apl_northwest_functions[] = {
  719. FUNCTION("ssp0", apl_northwest_ssp0_groups),
  720. FUNCTION("ssp1", apl_northwest_ssp1_groups),
  721. FUNCTION("ssp2", apl_northwest_ssp2_groups),
  722. FUNCTION("uart3", apl_northwest_uart3_groups),
  723. };
  724. static const struct intel_community apl_northwest_communities[] = {
  725. BXT_COMMUNITY(0, 76),
  726. };
  727. static const struct intel_pinctrl_soc_data apl_northwest_soc_data = {
  728. .uid = "2",
  729. .pins = apl_northwest_pins,
  730. .npins = ARRAY_SIZE(apl_northwest_pins),
  731. .groups = apl_northwest_groups,
  732. .ngroups = ARRAY_SIZE(apl_northwest_groups),
  733. .functions = apl_northwest_functions,
  734. .nfunctions = ARRAY_SIZE(apl_northwest_functions),
  735. .communities = apl_northwest_communities,
  736. .ncommunities = ARRAY_SIZE(apl_northwest_communities),
  737. };
  738. static const struct pinctrl_pin_desc apl_west_pins[] = {
  739. PINCTRL_PIN(0, "LPSS_I2C0_SDA"),
  740. PINCTRL_PIN(1, "LPSS_I2C0_SCL"),
  741. PINCTRL_PIN(2, "LPSS_I2C1_SDA"),
  742. PINCTRL_PIN(3, "LPSS_I2C1_SCL"),
  743. PINCTRL_PIN(4, "LPSS_I2C2_SDA"),
  744. PINCTRL_PIN(5, "LPSS_I2C2_SCL"),
  745. PINCTRL_PIN(6, "LPSS_I2C3_SDA"),
  746. PINCTRL_PIN(7, "LPSS_I2C3_SCL"),
  747. PINCTRL_PIN(8, "LPSS_I2C4_SDA"),
  748. PINCTRL_PIN(9, "LPSS_I2C4_SCL"),
  749. PINCTRL_PIN(10, "LPSS_I2C5_SDA"),
  750. PINCTRL_PIN(11, "LPSS_I2C5_SCL"),
  751. PINCTRL_PIN(12, "LPSS_I2C6_SDA"),
  752. PINCTRL_PIN(13, "LPSS_I2C6_SCL"),
  753. PINCTRL_PIN(14, "LPSS_I2C7_SDA"),
  754. PINCTRL_PIN(15, "LPSS_I2C7_SCL"),
  755. PINCTRL_PIN(16, "ISH_GPIO_0"),
  756. PINCTRL_PIN(17, "ISH_GPIO_1"),
  757. PINCTRL_PIN(18, "ISH_GPIO_2"),
  758. PINCTRL_PIN(19, "ISH_GPIO_3"),
  759. PINCTRL_PIN(20, "ISH_GPIO_4"),
  760. PINCTRL_PIN(21, "ISH_GPIO_5"),
  761. PINCTRL_PIN(22, "ISH_GPIO_6"),
  762. PINCTRL_PIN(23, "ISH_GPIO_7"),
  763. PINCTRL_PIN(24, "ISH_GPIO_8"),
  764. PINCTRL_PIN(25, "ISH_GPIO_9"),
  765. PINCTRL_PIN(26, "PCIE_CLKREQ0_B"),
  766. PINCTRL_PIN(27, "PCIE_CLKREQ1_B"),
  767. PINCTRL_PIN(28, "PCIE_CLKREQ2_B"),
  768. PINCTRL_PIN(29, "PCIE_CLKREQ3_B"),
  769. PINCTRL_PIN(30, "OSC_CLK_OUT_0"),
  770. PINCTRL_PIN(31, "OSC_CLK_OUT_1"),
  771. PINCTRL_PIN(32, "OSC_CLK_OUT_2"),
  772. PINCTRL_PIN(33, "OSC_CLK_OUT_3"),
  773. PINCTRL_PIN(34, "OSC_CLK_OUT_4"),
  774. PINCTRL_PIN(35, "PMU_AC_PRESENT"),
  775. PINCTRL_PIN(36, "PMU_BATLOW_B"),
  776. PINCTRL_PIN(37, "PMU_PLTRST_B"),
  777. PINCTRL_PIN(38, "PMU_PWRBTN_B"),
  778. PINCTRL_PIN(39, "PMU_RESETBUTTON_B"),
  779. PINCTRL_PIN(40, "PMU_SLP_S0_B"),
  780. PINCTRL_PIN(41, "PMU_SLP_S3_B"),
  781. PINCTRL_PIN(42, "PMU_SLP_S4_B"),
  782. PINCTRL_PIN(43, "PMU_SUSCLK"),
  783. PINCTRL_PIN(44, "PMU_WAKE_B"),
  784. PINCTRL_PIN(45, "SUS_STAT_B"),
  785. PINCTRL_PIN(46, "SUSPWRDNACK"),
  786. };
  787. static const unsigned apl_west_i2c0_pins[] = { 0, 1 };
  788. static const unsigned apl_west_i2c1_pins[] = { 2, 3 };
  789. static const unsigned apl_west_i2c2_pins[] = { 4, 5 };
  790. static const unsigned apl_west_i2c3_pins[] = { 6, 7 };
  791. static const unsigned apl_west_i2c4_pins[] = { 8, 9 };
  792. static const unsigned apl_west_i2c5_pins[] = { 10, 11 };
  793. static const unsigned apl_west_i2c6_pins[] = { 12, 13 };
  794. static const unsigned apl_west_i2c7_pins[] = { 14, 15 };
  795. static const unsigned apl_west_uart2_pins[] = { 20, 21, 22, 34 };
  796. static const struct intel_pingroup apl_west_groups[] = {
  797. PIN_GROUP("i2c0_grp", apl_west_i2c0_pins, 1),
  798. PIN_GROUP("i2c1_grp", apl_west_i2c1_pins, 1),
  799. PIN_GROUP("i2c2_grp", apl_west_i2c2_pins, 1),
  800. PIN_GROUP("i2c3_grp", apl_west_i2c3_pins, 1),
  801. PIN_GROUP("i2c4_grp", apl_west_i2c4_pins, 1),
  802. PIN_GROUP("i2c5_grp", apl_west_i2c5_pins, 1),
  803. PIN_GROUP("i2c6_grp", apl_west_i2c6_pins, 1),
  804. PIN_GROUP("i2c7_grp", apl_west_i2c7_pins, 1),
  805. PIN_GROUP("uart2_grp", apl_west_uart2_pins, 3),
  806. };
  807. static const char * const apl_west_i2c0_groups[] = { "i2c0_grp" };
  808. static const char * const apl_west_i2c1_groups[] = { "i2c1_grp" };
  809. static const char * const apl_west_i2c2_groups[] = { "i2c2_grp" };
  810. static const char * const apl_west_i2c3_groups[] = { "i2c3_grp" };
  811. static const char * const apl_west_i2c4_groups[] = { "i2c4_grp" };
  812. static const char * const apl_west_i2c5_groups[] = { "i2c5_grp" };
  813. static const char * const apl_west_i2c6_groups[] = { "i2c6_grp" };
  814. static const char * const apl_west_i2c7_groups[] = { "i2c7_grp" };
  815. static const char * const apl_west_uart2_groups[] = { "uart2_grp" };
  816. static const struct intel_function apl_west_functions[] = {
  817. FUNCTION("i2c0", apl_west_i2c0_groups),
  818. FUNCTION("i2c1", apl_west_i2c1_groups),
  819. FUNCTION("i2c2", apl_west_i2c2_groups),
  820. FUNCTION("i2c3", apl_west_i2c3_groups),
  821. FUNCTION("i2c4", apl_west_i2c4_groups),
  822. FUNCTION("i2c5", apl_west_i2c5_groups),
  823. FUNCTION("i2c6", apl_west_i2c6_groups),
  824. FUNCTION("i2c7", apl_west_i2c7_groups),
  825. FUNCTION("uart2", apl_west_uart2_groups),
  826. };
  827. static const struct intel_community apl_west_communities[] = {
  828. BXT_COMMUNITY(0, 46),
  829. };
  830. static const struct intel_pinctrl_soc_data apl_west_soc_data = {
  831. .uid = "3",
  832. .pins = apl_west_pins,
  833. .npins = ARRAY_SIZE(apl_west_pins),
  834. .groups = apl_west_groups,
  835. .ngroups = ARRAY_SIZE(apl_west_groups),
  836. .functions = apl_west_functions,
  837. .nfunctions = ARRAY_SIZE(apl_west_functions),
  838. .communities = apl_west_communities,
  839. .ncommunities = ARRAY_SIZE(apl_west_communities),
  840. };
  841. static const struct pinctrl_pin_desc apl_southwest_pins[] = {
  842. PINCTRL_PIN(0, "PCIE_WAKE0_B"),
  843. PINCTRL_PIN(1, "PCIE_WAKE1_B"),
  844. PINCTRL_PIN(2, "PCIE_WAKE2_B"),
  845. PINCTRL_PIN(3, "PCIE_WAKE3_B"),
  846. PINCTRL_PIN(4, "EMMC0_CLK"),
  847. PINCTRL_PIN(5, "EMMC0_D0"),
  848. PINCTRL_PIN(6, "EMMC0_D1"),
  849. PINCTRL_PIN(7, "EMMC0_D2"),
  850. PINCTRL_PIN(8, "EMMC0_D3"),
  851. PINCTRL_PIN(9, "EMMC0_D4"),
  852. PINCTRL_PIN(10, "EMMC0_D5"),
  853. PINCTRL_PIN(11, "EMMC0_D6"),
  854. PINCTRL_PIN(12, "EMMC0_D7"),
  855. PINCTRL_PIN(13, "EMMC0_CMD"),
  856. PINCTRL_PIN(14, "SDIO_CLK"),
  857. PINCTRL_PIN(15, "SDIO_D0"),
  858. PINCTRL_PIN(16, "SDIO_D1"),
  859. PINCTRL_PIN(17, "SDIO_D2"),
  860. PINCTRL_PIN(18, "SDIO_D3"),
  861. PINCTRL_PIN(19, "SDIO_CMD"),
  862. PINCTRL_PIN(20, "SDCARD_CLK"),
  863. PINCTRL_PIN(21, "SDCARD_CLK_FB"),
  864. PINCTRL_PIN(22, "SDCARD_D0"),
  865. PINCTRL_PIN(23, "SDCARD_D1"),
  866. PINCTRL_PIN(24, "SDCARD_D2"),
  867. PINCTRL_PIN(25, "SDCARD_D3"),
  868. PINCTRL_PIN(26, "SDCARD_CD_B"),
  869. PINCTRL_PIN(27, "SDCARD_CMD"),
  870. PINCTRL_PIN(28, "SDCARD_LVL_WP"),
  871. PINCTRL_PIN(29, "EMMC0_STROBE"),
  872. PINCTRL_PIN(30, "SDIO_PWR_DOWN_B"),
  873. PINCTRL_PIN(31, "SMB_ALERTB"),
  874. PINCTRL_PIN(32, "SMB_CLK"),
  875. PINCTRL_PIN(33, "SMB_DATA"),
  876. PINCTRL_PIN(34, "LPC_ILB_SERIRQ"),
  877. PINCTRL_PIN(35, "LPC_CLKOUT0"),
  878. PINCTRL_PIN(36, "LPC_CLKOUT1"),
  879. PINCTRL_PIN(37, "LPC_AD0"),
  880. PINCTRL_PIN(38, "LPC_AD1"),
  881. PINCTRL_PIN(39, "LPC_AD2"),
  882. PINCTRL_PIN(40, "LPC_AD3"),
  883. PINCTRL_PIN(41, "LPC_CLKRUNB"),
  884. PINCTRL_PIN(42, "LPC_FRAMEB"),
  885. };
  886. static const unsigned apl_southwest_emmc0_pins[] = {
  887. 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 29,
  888. };
  889. static const unsigned apl_southwest_sdio_pins[] = {
  890. 14, 15, 16, 17, 18, 19, 30,
  891. };
  892. static const unsigned apl_southwest_sdcard_pins[] = {
  893. 20, 21, 22, 23, 24, 25, 26, 27, 28,
  894. };
  895. static const unsigned apl_southwest_i2c7_pins[] = { 32, 33 };
  896. static const struct intel_pingroup apl_southwest_groups[] = {
  897. PIN_GROUP("emmc0_grp", apl_southwest_emmc0_pins, 1),
  898. PIN_GROUP("sdio_grp", apl_southwest_sdio_pins, 1),
  899. PIN_GROUP("sdcard_grp", apl_southwest_sdcard_pins, 1),
  900. PIN_GROUP("i2c7_grp", apl_southwest_i2c7_pins, 2),
  901. };
  902. static const char * const apl_southwest_emmc0_groups[] = { "emmc0_grp" };
  903. static const char * const apl_southwest_sdio_groups[] = { "sdio_grp" };
  904. static const char * const apl_southwest_sdcard_groups[] = { "sdcard_grp" };
  905. static const char * const apl_southwest_i2c7_groups[] = { "i2c7_grp" };
  906. static const struct intel_function apl_southwest_functions[] = {
  907. FUNCTION("emmc0", apl_southwest_emmc0_groups),
  908. FUNCTION("sdio", apl_southwest_sdio_groups),
  909. FUNCTION("sdcard", apl_southwest_sdcard_groups),
  910. FUNCTION("i2c7", apl_southwest_i2c7_groups),
  911. };
  912. static const struct intel_community apl_southwest_communities[] = {
  913. BXT_COMMUNITY(0, 42),
  914. };
  915. static const struct intel_pinctrl_soc_data apl_southwest_soc_data = {
  916. .uid = "4",
  917. .pins = apl_southwest_pins,
  918. .npins = ARRAY_SIZE(apl_southwest_pins),
  919. .groups = apl_southwest_groups,
  920. .ngroups = ARRAY_SIZE(apl_southwest_groups),
  921. .functions = apl_southwest_functions,
  922. .nfunctions = ARRAY_SIZE(apl_southwest_functions),
  923. .communities = apl_southwest_communities,
  924. .ncommunities = ARRAY_SIZE(apl_southwest_communities),
  925. };
  926. static const struct intel_pinctrl_soc_data *apl_pinctrl_soc_data[] = {
  927. &apl_north_soc_data,
  928. &apl_northwest_soc_data,
  929. &apl_west_soc_data,
  930. &apl_southwest_soc_data,
  931. NULL,
  932. };
  933. static const struct acpi_device_id bxt_pinctrl_acpi_match[] = {
  934. { "INT3452", (kernel_ulong_t)apl_pinctrl_soc_data },
  935. { "INT34D1", (kernel_ulong_t)bxt_pinctrl_soc_data },
  936. { }
  937. };
  938. MODULE_DEVICE_TABLE(acpi, bxt_pinctrl_acpi_match);
  939. static int bxt_pinctrl_probe(struct platform_device *pdev)
  940. {
  941. const struct intel_pinctrl_soc_data *soc_data = NULL;
  942. const struct intel_pinctrl_soc_data **soc_table;
  943. const struct acpi_device_id *id;
  944. struct acpi_device *adev;
  945. int i;
  946. adev = ACPI_COMPANION(&pdev->dev);
  947. if (!adev)
  948. return -ENODEV;
  949. id = acpi_match_device(bxt_pinctrl_acpi_match, &pdev->dev);
  950. if (!id)
  951. return -ENODEV;
  952. soc_table = (const struct intel_pinctrl_soc_data **)id->driver_data;
  953. for (i = 0; soc_table[i]; i++) {
  954. if (!strcmp(adev->pnp.unique_id, soc_table[i]->uid)) {
  955. soc_data = soc_table[i];
  956. break;
  957. }
  958. }
  959. if (!soc_data)
  960. return -ENODEV;
  961. return intel_pinctrl_probe(pdev, soc_data);
  962. }
  963. static const struct dev_pm_ops bxt_pinctrl_pm_ops = {
  964. SET_LATE_SYSTEM_SLEEP_PM_OPS(intel_pinctrl_suspend,
  965. intel_pinctrl_resume)
  966. };
  967. static struct platform_driver bxt_pinctrl_driver = {
  968. .probe = bxt_pinctrl_probe,
  969. .remove = intel_pinctrl_remove,
  970. .driver = {
  971. .name = "broxton-pinctrl",
  972. .acpi_match_table = bxt_pinctrl_acpi_match,
  973. .pm = &bxt_pinctrl_pm_ops,
  974. },
  975. };
  976. static int __init bxt_pinctrl_init(void)
  977. {
  978. return platform_driver_register(&bxt_pinctrl_driver);
  979. }
  980. subsys_initcall(bxt_pinctrl_init);
  981. static void __exit bxt_pinctrl_exit(void)
  982. {
  983. platform_driver_unregister(&bxt_pinctrl_driver);
  984. }
  985. module_exit(bxt_pinctrl_exit);
  986. MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>");
  987. MODULE_DESCRIPTION("Intel Broxton SoC pinctrl/GPIO driver");
  988. MODULE_LICENSE("GPL v2");