pinctrl-broxton.c 35 KB

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