pinctrl-ipq5018.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2019-2021, 2023 The Linux Foundation. All rights reserved.
  4. */
  5. #include <linux/module.h>
  6. #include <linux/mod_devicetable.h>
  7. #include <linux/platform_device.h>
  8. #include "pinctrl-msm.h"
  9. #define REG_SIZE 0x1000
  10. #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9) \
  11. { \
  12. .grp = PINCTRL_PINGROUP("gpio" #id, \
  13. gpio##id##_pins, \
  14. ARRAY_SIZE(gpio##id##_pins)), \
  15. .funcs = (int[]){ \
  16. msm_mux_gpio, /* gpio mode */ \
  17. msm_mux_##f1, \
  18. msm_mux_##f2, \
  19. msm_mux_##f3, \
  20. msm_mux_##f4, \
  21. msm_mux_##f5, \
  22. msm_mux_##f6, \
  23. msm_mux_##f7, \
  24. msm_mux_##f8, \
  25. msm_mux_##f9 \
  26. }, \
  27. .nfuncs = 10, \
  28. .ctl_reg = REG_SIZE * id, \
  29. .io_reg = 0x4 + REG_SIZE * id, \
  30. .intr_cfg_reg = 0x8 + REG_SIZE * id, \
  31. .intr_status_reg = 0xc + REG_SIZE * id, \
  32. .intr_target_reg = 0x8 + REG_SIZE * id, \
  33. .mux_bit = 2, \
  34. .pull_bit = 0, \
  35. .drv_bit = 6, \
  36. .oe_bit = 9, \
  37. .in_bit = 0, \
  38. .out_bit = 1, \
  39. .intr_enable_bit = 0, \
  40. .intr_status_bit = 0, \
  41. .intr_target_bit = 5, \
  42. .intr_target_kpss_val = 3, \
  43. .intr_raw_status_bit = 4, \
  44. .intr_polarity_bit = 1, \
  45. .intr_detection_bit = 2, \
  46. .intr_detection_width = 2, \
  47. }
  48. static const struct pinctrl_pin_desc ipq5018_pins[] = {
  49. PINCTRL_PIN(0, "GPIO_0"),
  50. PINCTRL_PIN(1, "GPIO_1"),
  51. PINCTRL_PIN(2, "GPIO_2"),
  52. PINCTRL_PIN(3, "GPIO_3"),
  53. PINCTRL_PIN(4, "GPIO_4"),
  54. PINCTRL_PIN(5, "GPIO_5"),
  55. PINCTRL_PIN(6, "GPIO_6"),
  56. PINCTRL_PIN(7, "GPIO_7"),
  57. PINCTRL_PIN(8, "GPIO_8"),
  58. PINCTRL_PIN(9, "GPIO_9"),
  59. PINCTRL_PIN(10, "GPIO_10"),
  60. PINCTRL_PIN(11, "GPIO_11"),
  61. PINCTRL_PIN(12, "GPIO_12"),
  62. PINCTRL_PIN(13, "GPIO_13"),
  63. PINCTRL_PIN(14, "GPIO_14"),
  64. PINCTRL_PIN(15, "GPIO_15"),
  65. PINCTRL_PIN(16, "GPIO_16"),
  66. PINCTRL_PIN(17, "GPIO_17"),
  67. PINCTRL_PIN(18, "GPIO_18"),
  68. PINCTRL_PIN(19, "GPIO_19"),
  69. PINCTRL_PIN(20, "GPIO_20"),
  70. PINCTRL_PIN(21, "GPIO_21"),
  71. PINCTRL_PIN(22, "GPIO_22"),
  72. PINCTRL_PIN(23, "GPIO_23"),
  73. PINCTRL_PIN(24, "GPIO_24"),
  74. PINCTRL_PIN(25, "GPIO_25"),
  75. PINCTRL_PIN(26, "GPIO_26"),
  76. PINCTRL_PIN(27, "GPIO_27"),
  77. PINCTRL_PIN(28, "GPIO_28"),
  78. PINCTRL_PIN(29, "GPIO_29"),
  79. PINCTRL_PIN(30, "GPIO_30"),
  80. PINCTRL_PIN(31, "GPIO_31"),
  81. PINCTRL_PIN(32, "GPIO_32"),
  82. PINCTRL_PIN(33, "GPIO_33"),
  83. PINCTRL_PIN(34, "GPIO_34"),
  84. PINCTRL_PIN(35, "GPIO_35"),
  85. PINCTRL_PIN(36, "GPIO_36"),
  86. PINCTRL_PIN(37, "GPIO_37"),
  87. PINCTRL_PIN(38, "GPIO_38"),
  88. PINCTRL_PIN(39, "GPIO_39"),
  89. PINCTRL_PIN(40, "GPIO_40"),
  90. PINCTRL_PIN(41, "GPIO_41"),
  91. PINCTRL_PIN(42, "GPIO_42"),
  92. PINCTRL_PIN(43, "GPIO_43"),
  93. PINCTRL_PIN(44, "GPIO_44"),
  94. PINCTRL_PIN(45, "GPIO_45"),
  95. PINCTRL_PIN(46, "GPIO_46"),
  96. };
  97. #define DECLARE_MSM_GPIO_PINS(pin) \
  98. static const unsigned int gpio##pin##_pins[] = { pin }
  99. DECLARE_MSM_GPIO_PINS(0);
  100. DECLARE_MSM_GPIO_PINS(1);
  101. DECLARE_MSM_GPIO_PINS(2);
  102. DECLARE_MSM_GPIO_PINS(3);
  103. DECLARE_MSM_GPIO_PINS(4);
  104. DECLARE_MSM_GPIO_PINS(5);
  105. DECLARE_MSM_GPIO_PINS(6);
  106. DECLARE_MSM_GPIO_PINS(7);
  107. DECLARE_MSM_GPIO_PINS(8);
  108. DECLARE_MSM_GPIO_PINS(9);
  109. DECLARE_MSM_GPIO_PINS(10);
  110. DECLARE_MSM_GPIO_PINS(11);
  111. DECLARE_MSM_GPIO_PINS(12);
  112. DECLARE_MSM_GPIO_PINS(13);
  113. DECLARE_MSM_GPIO_PINS(14);
  114. DECLARE_MSM_GPIO_PINS(15);
  115. DECLARE_MSM_GPIO_PINS(16);
  116. DECLARE_MSM_GPIO_PINS(17);
  117. DECLARE_MSM_GPIO_PINS(18);
  118. DECLARE_MSM_GPIO_PINS(19);
  119. DECLARE_MSM_GPIO_PINS(20);
  120. DECLARE_MSM_GPIO_PINS(21);
  121. DECLARE_MSM_GPIO_PINS(22);
  122. DECLARE_MSM_GPIO_PINS(23);
  123. DECLARE_MSM_GPIO_PINS(24);
  124. DECLARE_MSM_GPIO_PINS(25);
  125. DECLARE_MSM_GPIO_PINS(26);
  126. DECLARE_MSM_GPIO_PINS(27);
  127. DECLARE_MSM_GPIO_PINS(28);
  128. DECLARE_MSM_GPIO_PINS(29);
  129. DECLARE_MSM_GPIO_PINS(30);
  130. DECLARE_MSM_GPIO_PINS(31);
  131. DECLARE_MSM_GPIO_PINS(32);
  132. DECLARE_MSM_GPIO_PINS(33);
  133. DECLARE_MSM_GPIO_PINS(34);
  134. DECLARE_MSM_GPIO_PINS(35);
  135. DECLARE_MSM_GPIO_PINS(36);
  136. DECLARE_MSM_GPIO_PINS(37);
  137. DECLARE_MSM_GPIO_PINS(38);
  138. DECLARE_MSM_GPIO_PINS(39);
  139. DECLARE_MSM_GPIO_PINS(40);
  140. DECLARE_MSM_GPIO_PINS(41);
  141. DECLARE_MSM_GPIO_PINS(42);
  142. DECLARE_MSM_GPIO_PINS(43);
  143. DECLARE_MSM_GPIO_PINS(44);
  144. DECLARE_MSM_GPIO_PINS(45);
  145. DECLARE_MSM_GPIO_PINS(46);
  146. enum ipq5018_functions {
  147. msm_mux_atest_char,
  148. msm_mux_audio_pdm0,
  149. msm_mux_audio_pdm1,
  150. msm_mux_audio_rxbclk,
  151. msm_mux_audio_rxd,
  152. msm_mux_audio_rxfsync,
  153. msm_mux_audio_rxmclk,
  154. msm_mux_audio_txbclk,
  155. msm_mux_audio_txd,
  156. msm_mux_audio_txfsync,
  157. msm_mux_audio_txmclk,
  158. msm_mux_blsp0_i2c,
  159. msm_mux_blsp0_spi,
  160. msm_mux_blsp0_uart0,
  161. msm_mux_blsp0_uart1,
  162. msm_mux_blsp1_i2c0,
  163. msm_mux_blsp1_i2c1,
  164. msm_mux_blsp1_spi0,
  165. msm_mux_blsp1_spi1,
  166. msm_mux_blsp1_uart0,
  167. msm_mux_blsp1_uart1,
  168. msm_mux_blsp1_uart2,
  169. msm_mux_blsp2_i2c0,
  170. msm_mux_blsp2_i2c1,
  171. msm_mux_blsp2_spi,
  172. msm_mux_blsp2_spi0,
  173. msm_mux_blsp2_spi1,
  174. msm_mux_btss,
  175. msm_mux_burn0,
  176. msm_mux_burn1,
  177. msm_mux_cri_trng,
  178. msm_mux_cri_trng0,
  179. msm_mux_cri_trng1,
  180. msm_mux_cxc_clk,
  181. msm_mux_cxc_data,
  182. msm_mux_dbg_out,
  183. msm_mux_eud_gpio,
  184. msm_mux_gcc_plltest,
  185. msm_mux_gcc_tlmm,
  186. msm_mux_gpio,
  187. msm_mux_led0,
  188. msm_mux_led2,
  189. msm_mux_mac0,
  190. msm_mux_mac1,
  191. msm_mux_mdc,
  192. msm_mux_mdio,
  193. msm_mux_pcie0_clk,
  194. msm_mux_pcie0_wake,
  195. msm_mux_pcie1_clk,
  196. msm_mux_pcie1_wake,
  197. msm_mux_pll_test,
  198. msm_mux_prng_rosc,
  199. msm_mux_pwm0,
  200. msm_mux_pwm1,
  201. msm_mux_pwm2,
  202. msm_mux_pwm3,
  203. msm_mux_qdss_cti_trig_in_a0,
  204. msm_mux_qdss_cti_trig_in_a1,
  205. msm_mux_qdss_cti_trig_in_b0,
  206. msm_mux_qdss_cti_trig_in_b1,
  207. msm_mux_qdss_cti_trig_out_a0,
  208. msm_mux_qdss_cti_trig_out_a1,
  209. msm_mux_qdss_cti_trig_out_b0,
  210. msm_mux_qdss_cti_trig_out_b1,
  211. msm_mux_qdss_traceclk_a,
  212. msm_mux_qdss_traceclk_b,
  213. msm_mux_qdss_tracectl_a,
  214. msm_mux_qdss_tracectl_b,
  215. msm_mux_qdss_tracedata_a,
  216. msm_mux_qdss_tracedata_b,
  217. msm_mux_qspi_clk,
  218. msm_mux_qspi_cs,
  219. msm_mux_qspi_data,
  220. msm_mux_reset_out,
  221. msm_mux_sdc1_clk,
  222. msm_mux_sdc1_cmd,
  223. msm_mux_sdc1_data,
  224. msm_mux_wci_txd,
  225. msm_mux_wci_rxd,
  226. msm_mux_wsa_swrm,
  227. msm_mux_wsi_clk3,
  228. msm_mux_wsi_data3,
  229. msm_mux_wsis_reset,
  230. msm_mux_xfem,
  231. msm_mux__,
  232. };
  233. static const char * const atest_char_groups[] = {
  234. "gpio0", "gpio1", "gpio2", "gpio3", "gpio37",
  235. };
  236. static const char * const wci_txd_groups[] = {
  237. "gpio0", "gpio1", "gpio2", "gpio3",
  238. "gpio42", "gpio43", "gpio44", "gpio45",
  239. };
  240. static const char * const wci_rxd_groups[] = {
  241. "gpio0", "gpio1", "gpio2", "gpio3",
  242. "gpio42", "gpio43", "gpio44", "gpio45",
  243. };
  244. static const char * const xfem_groups[] = {
  245. "gpio0", "gpio1", "gpio2", "gpio3",
  246. "gpio42", "gpio43", "gpio44", "gpio45",
  247. };
  248. static const char * const qdss_cti_trig_out_a0_groups[] = {
  249. "gpio0",
  250. };
  251. static const char * const qdss_cti_trig_in_a0_groups[] = {
  252. "gpio1",
  253. };
  254. static const char * const qdss_cti_trig_out_a1_groups[] = {
  255. "gpio2",
  256. };
  257. static const char * const qdss_cti_trig_in_a1_groups[] = {
  258. "gpio3",
  259. };
  260. static const char * const sdc1_data_groups[] = {
  261. "gpio4", "gpio5", "gpio6", "gpio7",
  262. };
  263. static const char * const qspi_data_groups[] = {
  264. "gpio4",
  265. "gpio5",
  266. "gpio6",
  267. "gpio7",
  268. };
  269. static const char * const blsp1_spi1_groups[] = {
  270. "gpio4", "gpio5", "gpio6", "gpio7",
  271. };
  272. static const char * const btss_groups[] = {
  273. "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio17", "gpio18",
  274. "gpio19", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28",
  275. };
  276. static const char * const dbg_out_groups[] = {
  277. "gpio4",
  278. };
  279. static const char * const qdss_traceclk_a_groups[] = {
  280. "gpio4",
  281. };
  282. static const char * const burn0_groups[] = {
  283. "gpio4",
  284. };
  285. static const char * const cxc_clk_groups[] = {
  286. "gpio5",
  287. };
  288. static const char * const blsp1_i2c1_groups[] = {
  289. "gpio5", "gpio6",
  290. };
  291. static const char * const qdss_tracectl_a_groups[] = {
  292. "gpio5",
  293. };
  294. static const char * const burn1_groups[] = {
  295. "gpio5",
  296. };
  297. static const char * const cxc_data_groups[] = {
  298. "gpio6",
  299. };
  300. static const char * const qdss_tracedata_a_groups[] = {
  301. "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio12",
  302. "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19",
  303. "gpio20", "gpio21",
  304. };
  305. static const char * const mac0_groups[] = {
  306. "gpio7",
  307. };
  308. static const char * const sdc1_cmd_groups[] = {
  309. "gpio8",
  310. };
  311. static const char * const qspi_cs_groups[] = {
  312. "gpio8",
  313. };
  314. static const char * const mac1_groups[] = {
  315. "gpio8",
  316. };
  317. static const char * const sdc1_clk_groups[] = {
  318. "gpio9",
  319. };
  320. static const char * const qspi_clk_groups[] = {
  321. "gpio9",
  322. };
  323. static const char * const blsp0_spi_groups[] = {
  324. "gpio10", "gpio11", "gpio12", "gpio13",
  325. };
  326. static const char * const blsp1_uart0_groups[] = {
  327. "gpio10", "gpio11", "gpio12", "gpio13",
  328. };
  329. static const char * const gcc_plltest_groups[] = {
  330. "gpio10", "gpio12",
  331. };
  332. static const char * const gcc_tlmm_groups[] = {
  333. "gpio11",
  334. };
  335. static const char * const blsp0_i2c_groups[] = {
  336. "gpio12", "gpio13",
  337. };
  338. static const char * const pcie0_clk_groups[] = {
  339. "gpio14",
  340. };
  341. static const char * const cri_trng0_groups[] = {
  342. "gpio14",
  343. };
  344. static const char * const cri_trng1_groups[] = {
  345. "gpio15",
  346. };
  347. static const char * const pcie0_wake_groups[] = {
  348. "gpio16",
  349. };
  350. static const char * const cri_trng_groups[] = {
  351. "gpio16",
  352. };
  353. static const char * const pcie1_clk_groups[] = {
  354. "gpio17",
  355. };
  356. static const char * const prng_rosc_groups[] = {
  357. "gpio17",
  358. };
  359. static const char * const blsp1_spi0_groups[] = {
  360. "gpio18", "gpio19", "gpio20", "gpio21",
  361. };
  362. static const char * const pcie1_wake_groups[] = {
  363. "gpio19",
  364. };
  365. static const char * const blsp1_i2c0_groups[] = {
  366. "gpio19", "gpio20",
  367. };
  368. static const char * const blsp0_uart0_groups[] = {
  369. "gpio20", "gpio21",
  370. };
  371. static const char * const pll_test_groups[] = {
  372. "gpio22",
  373. };
  374. static const char * const eud_gpio_groups[] = {
  375. "gpio22", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35",
  376. };
  377. static const char * const audio_rxmclk_groups[] = {
  378. "gpio23", "gpio23",
  379. };
  380. static const char * const audio_pdm0_groups[] = {
  381. "gpio23", "gpio24",
  382. };
  383. static const char * const blsp2_spi1_groups[] = {
  384. "gpio23", "gpio24", "gpio25", "gpio26",
  385. };
  386. static const char * const blsp1_uart2_groups[] = {
  387. "gpio23", "gpio24", "gpio25", "gpio26",
  388. };
  389. static const char * const qdss_tracedata_b_groups[] = {
  390. "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", "gpio29",
  391. "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35", "gpio36",
  392. "gpio37", "gpio38",
  393. };
  394. static const char * const audio_rxbclk_groups[] = {
  395. "gpio24",
  396. };
  397. static const char * const audio_rxfsync_groups[] = {
  398. "gpio25",
  399. };
  400. static const char * const audio_pdm1_groups[] = {
  401. "gpio25", "gpio26",
  402. };
  403. static const char * const blsp2_i2c1_groups[] = {
  404. "gpio25", "gpio26",
  405. };
  406. static const char * const audio_rxd_groups[] = {
  407. "gpio26",
  408. };
  409. static const char * const audio_txmclk_groups[] = {
  410. "gpio27", "gpio27",
  411. };
  412. static const char * const wsa_swrm_groups[] = {
  413. "gpio27", "gpio28",
  414. };
  415. static const char * const blsp2_spi_groups[] = {
  416. "gpio27",
  417. };
  418. static const char * const audio_txbclk_groups[] = {
  419. "gpio28",
  420. };
  421. static const char * const blsp0_uart1_groups[] = {
  422. "gpio28", "gpio29",
  423. };
  424. static const char * const audio_txfsync_groups[] = {
  425. "gpio29",
  426. };
  427. static const char * const audio_txd_groups[] = {
  428. "gpio30",
  429. };
  430. static const char * const wsis_reset_groups[] = {
  431. "gpio30",
  432. };
  433. static const char * const blsp2_spi0_groups[] = {
  434. "gpio31", "gpio32", "gpio33", "gpio34",
  435. };
  436. static const char * const blsp1_uart1_groups[] = {
  437. "gpio31", "gpio32", "gpio33", "gpio34",
  438. };
  439. static const char * const blsp2_i2c0_groups[] = {
  440. "gpio33", "gpio34",
  441. };
  442. static const char * const mdc_groups[] = {
  443. "gpio36",
  444. };
  445. static const char * const wsi_clk3_groups[] = {
  446. "gpio36",
  447. };
  448. static const char * const mdio_groups[] = {
  449. "gpio37",
  450. };
  451. static const char * const wsi_data3_groups[] = {
  452. "gpio37",
  453. };
  454. static const char * const qdss_traceclk_b_groups[] = {
  455. "gpio39",
  456. };
  457. static const char * const reset_out_groups[] = {
  458. "gpio40",
  459. };
  460. static const char * const qdss_tracectl_b_groups[] = {
  461. "gpio40",
  462. };
  463. static const char * const pwm0_groups[] = {
  464. "gpio42",
  465. };
  466. static const char * const qdss_cti_trig_out_b0_groups[] = {
  467. "gpio42",
  468. };
  469. static const char * const pwm1_groups[] = {
  470. "gpio43",
  471. };
  472. static const char * const qdss_cti_trig_in_b0_groups[] = {
  473. "gpio43",
  474. };
  475. static const char * const pwm2_groups[] = {
  476. "gpio44",
  477. };
  478. static const char * const qdss_cti_trig_out_b1_groups[] = {
  479. "gpio44",
  480. };
  481. static const char * const pwm3_groups[] = {
  482. "gpio45",
  483. };
  484. static const char * const qdss_cti_trig_in_b1_groups[] = {
  485. "gpio45",
  486. };
  487. static const char * const led0_groups[] = {
  488. "gpio46", "gpio30", "gpio10",
  489. };
  490. static const char * const led2_groups[] = {
  491. "gpio30",
  492. };
  493. static const char * const gpio_groups[] = {
  494. "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7",
  495. "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14",
  496. "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21",
  497. "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28",
  498. "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35",
  499. "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42",
  500. "gpio43", "gpio44", "gpio45", "gpio46",
  501. };
  502. static const struct pinfunction ipq5018_functions[] = {
  503. MSM_PIN_FUNCTION(atest_char),
  504. MSM_PIN_FUNCTION(audio_pdm0),
  505. MSM_PIN_FUNCTION(audio_pdm1),
  506. MSM_PIN_FUNCTION(audio_rxbclk),
  507. MSM_PIN_FUNCTION(audio_rxd),
  508. MSM_PIN_FUNCTION(audio_rxfsync),
  509. MSM_PIN_FUNCTION(audio_rxmclk),
  510. MSM_PIN_FUNCTION(audio_txbclk),
  511. MSM_PIN_FUNCTION(audio_txd),
  512. MSM_PIN_FUNCTION(audio_txfsync),
  513. MSM_PIN_FUNCTION(audio_txmclk),
  514. MSM_PIN_FUNCTION(blsp0_i2c),
  515. MSM_PIN_FUNCTION(blsp0_spi),
  516. MSM_PIN_FUNCTION(blsp0_uart0),
  517. MSM_PIN_FUNCTION(blsp0_uart1),
  518. MSM_PIN_FUNCTION(blsp1_i2c0),
  519. MSM_PIN_FUNCTION(blsp1_i2c1),
  520. MSM_PIN_FUNCTION(blsp1_spi0),
  521. MSM_PIN_FUNCTION(blsp1_spi1),
  522. MSM_PIN_FUNCTION(blsp1_uart0),
  523. MSM_PIN_FUNCTION(blsp1_uart1),
  524. MSM_PIN_FUNCTION(blsp1_uart2),
  525. MSM_PIN_FUNCTION(blsp2_i2c0),
  526. MSM_PIN_FUNCTION(blsp2_i2c1),
  527. MSM_PIN_FUNCTION(blsp2_spi),
  528. MSM_PIN_FUNCTION(blsp2_spi0),
  529. MSM_PIN_FUNCTION(blsp2_spi1),
  530. MSM_PIN_FUNCTION(btss),
  531. MSM_PIN_FUNCTION(burn0),
  532. MSM_PIN_FUNCTION(burn1),
  533. MSM_PIN_FUNCTION(cri_trng),
  534. MSM_PIN_FUNCTION(cri_trng0),
  535. MSM_PIN_FUNCTION(cri_trng1),
  536. MSM_PIN_FUNCTION(cxc_clk),
  537. MSM_PIN_FUNCTION(cxc_data),
  538. MSM_PIN_FUNCTION(dbg_out),
  539. MSM_PIN_FUNCTION(eud_gpio),
  540. MSM_PIN_FUNCTION(gcc_plltest),
  541. MSM_PIN_FUNCTION(gcc_tlmm),
  542. MSM_PIN_FUNCTION(gpio),
  543. MSM_PIN_FUNCTION(led0),
  544. MSM_PIN_FUNCTION(led2),
  545. MSM_PIN_FUNCTION(mac0),
  546. MSM_PIN_FUNCTION(mac1),
  547. MSM_PIN_FUNCTION(mdc),
  548. MSM_PIN_FUNCTION(mdio),
  549. MSM_PIN_FUNCTION(pcie0_clk),
  550. MSM_PIN_FUNCTION(pcie0_wake),
  551. MSM_PIN_FUNCTION(pcie1_clk),
  552. MSM_PIN_FUNCTION(pcie1_wake),
  553. MSM_PIN_FUNCTION(pll_test),
  554. MSM_PIN_FUNCTION(prng_rosc),
  555. MSM_PIN_FUNCTION(pwm0),
  556. MSM_PIN_FUNCTION(pwm1),
  557. MSM_PIN_FUNCTION(pwm2),
  558. MSM_PIN_FUNCTION(pwm3),
  559. MSM_PIN_FUNCTION(qdss_cti_trig_in_a0),
  560. MSM_PIN_FUNCTION(qdss_cti_trig_in_a1),
  561. MSM_PIN_FUNCTION(qdss_cti_trig_in_b0),
  562. MSM_PIN_FUNCTION(qdss_cti_trig_in_b1),
  563. MSM_PIN_FUNCTION(qdss_cti_trig_out_a0),
  564. MSM_PIN_FUNCTION(qdss_cti_trig_out_a1),
  565. MSM_PIN_FUNCTION(qdss_cti_trig_out_b0),
  566. MSM_PIN_FUNCTION(qdss_cti_trig_out_b1),
  567. MSM_PIN_FUNCTION(qdss_traceclk_a),
  568. MSM_PIN_FUNCTION(qdss_traceclk_b),
  569. MSM_PIN_FUNCTION(qdss_tracectl_a),
  570. MSM_PIN_FUNCTION(qdss_tracectl_b),
  571. MSM_PIN_FUNCTION(qdss_tracedata_a),
  572. MSM_PIN_FUNCTION(qdss_tracedata_b),
  573. MSM_PIN_FUNCTION(qspi_clk),
  574. MSM_PIN_FUNCTION(qspi_cs),
  575. MSM_PIN_FUNCTION(qspi_data),
  576. MSM_PIN_FUNCTION(reset_out),
  577. MSM_PIN_FUNCTION(sdc1_clk),
  578. MSM_PIN_FUNCTION(sdc1_cmd),
  579. MSM_PIN_FUNCTION(sdc1_data),
  580. MSM_PIN_FUNCTION(wci_txd),
  581. MSM_PIN_FUNCTION(wci_rxd),
  582. MSM_PIN_FUNCTION(wsa_swrm),
  583. MSM_PIN_FUNCTION(wsi_clk3),
  584. MSM_PIN_FUNCTION(wsi_data3),
  585. MSM_PIN_FUNCTION(wsis_reset),
  586. MSM_PIN_FUNCTION(xfem),
  587. };
  588. static const struct msm_pingroup ipq5018_groups[] = {
  589. PINGROUP(0, atest_char, _, qdss_cti_trig_out_a0, wci_txd, wci_rxd, xfem, _, _, _),
  590. PINGROUP(1, atest_char, _, qdss_cti_trig_in_a0, wci_txd, wci_rxd, xfem, _, _, _),
  591. PINGROUP(2, atest_char, _, qdss_cti_trig_out_a1, wci_txd, wci_rxd, xfem, _, _, _),
  592. PINGROUP(3, atest_char, _, qdss_cti_trig_in_a1, wci_txd, wci_rxd, xfem, _, _, _),
  593. PINGROUP(4, sdc1_data, qspi_data, blsp1_spi1, btss, dbg_out, qdss_traceclk_a, _, burn0, _),
  594. PINGROUP(5, sdc1_data, qspi_data, cxc_clk, blsp1_spi1, blsp1_i2c1, btss, _, qdss_tracectl_a, _),
  595. PINGROUP(6, sdc1_data, qspi_data, cxc_data, blsp1_spi1, blsp1_i2c1, btss, _, qdss_tracedata_a, _),
  596. PINGROUP(7, sdc1_data, qspi_data, mac0, blsp1_spi1, btss, _, qdss_tracedata_a, _, _),
  597. PINGROUP(8, sdc1_cmd, qspi_cs, mac1, btss, _, qdss_tracedata_a, _, _, _),
  598. PINGROUP(9, sdc1_clk, qspi_clk, _, qdss_tracedata_a, _, _, _, _, _),
  599. PINGROUP(10, blsp0_spi, blsp1_uart0, led0, gcc_plltest, qdss_tracedata_a, _, _, _, _),
  600. PINGROUP(11, blsp0_spi, blsp1_uart0, _, gcc_tlmm, qdss_tracedata_a, _, _, _, _),
  601. PINGROUP(12, blsp0_spi, blsp0_i2c, blsp1_uart0, _, gcc_plltest, qdss_tracedata_a, _, _, _),
  602. PINGROUP(13, blsp0_spi, blsp0_i2c, blsp1_uart0, _, qdss_tracedata_a, _, _, _, _),
  603. PINGROUP(14, pcie0_clk, _, _, cri_trng0, qdss_tracedata_a, _, _, _, _),
  604. PINGROUP(15, _, _, cri_trng1, qdss_tracedata_a, _, _, _, _, _),
  605. PINGROUP(16, pcie0_wake, _, _, cri_trng, qdss_tracedata_a, _, _, _, _),
  606. PINGROUP(17, pcie1_clk, btss, _, prng_rosc, qdss_tracedata_a, _, _, _, _),
  607. PINGROUP(18, blsp1_spi0, btss, _, qdss_tracedata_a, _, _, _, _, _),
  608. PINGROUP(19, pcie1_wake, blsp1_spi0, blsp1_i2c0, btss, _, qdss_tracedata_a, _, _, _),
  609. PINGROUP(20, blsp0_uart0, blsp1_spi0, blsp1_i2c0, _, qdss_tracedata_a, _, _, _, _),
  610. PINGROUP(21, blsp0_uart0, blsp1_spi0, _, qdss_tracedata_a, _, _, _, _, _),
  611. PINGROUP(22, _, pll_test, eud_gpio, _, _, _, _, _, _),
  612. PINGROUP(23, audio_rxmclk, audio_pdm0, audio_rxmclk, blsp2_spi1, blsp1_uart2, btss, _, qdss_tracedata_b, _),
  613. PINGROUP(24, audio_rxbclk, audio_pdm0, blsp2_spi1, blsp1_uart2, btss, _, qdss_tracedata_b, _, _),
  614. PINGROUP(25, audio_rxfsync, audio_pdm1, blsp2_i2c1, blsp2_spi1, blsp1_uart2, btss, _, qdss_tracedata_b, _),
  615. PINGROUP(26, audio_rxd, audio_pdm1, blsp2_i2c1, blsp2_spi1, blsp1_uart2, btss, _, qdss_tracedata_b, _),
  616. PINGROUP(27, audio_txmclk, wsa_swrm, audio_txmclk, blsp2_spi, btss, _, qdss_tracedata_b, _, _),
  617. PINGROUP(28, audio_txbclk, wsa_swrm, blsp0_uart1, btss, qdss_tracedata_b, _, _, _, _),
  618. PINGROUP(29, audio_txfsync, _, blsp0_uart1, _, qdss_tracedata_b, _, _, _, _),
  619. PINGROUP(30, audio_txd, led2, led0, _, _, _, _, _, _),
  620. PINGROUP(31, blsp2_spi0, blsp1_uart1, _, qdss_tracedata_b, eud_gpio, _, _, _, _),
  621. PINGROUP(32, blsp2_spi0, blsp1_uart1, _, qdss_tracedata_b, eud_gpio, _, _, _, _),
  622. PINGROUP(33, blsp2_i2c0, blsp2_spi0, blsp1_uart1, _, qdss_tracedata_b, eud_gpio, _, _, _),
  623. PINGROUP(34, blsp2_i2c0, blsp2_spi0, blsp1_uart1, _, qdss_tracedata_b, eud_gpio, _, _, _),
  624. PINGROUP(35, _, qdss_tracedata_b, eud_gpio, _, _, _, _, _, _),
  625. PINGROUP(36, mdc, qdss_tracedata_b, _, wsi_clk3, _, _, _, _, _),
  626. PINGROUP(37, mdio, atest_char, qdss_tracedata_b, _, wsi_data3, _, _, _, _),
  627. PINGROUP(38, qdss_tracedata_b, _, _, _, _, _, _, _, _),
  628. PINGROUP(39, qdss_traceclk_b, _, _, _, _, _, _, _, _),
  629. PINGROUP(40, reset_out, qdss_tracectl_b, _, _, _, _, _, _, _),
  630. PINGROUP(41, _, _, _, _, _, _, _, _, _),
  631. PINGROUP(42, pwm0, qdss_cti_trig_out_b0, wci_txd, wci_rxd, xfem, _, _, _, _),
  632. PINGROUP(43, pwm1, qdss_cti_trig_in_b0, wci_txd, wci_rxd, xfem, _, _, _, _),
  633. PINGROUP(44, pwm2, qdss_cti_trig_out_b1, wci_txd, wci_rxd, xfem, _, _, _, _),
  634. PINGROUP(45, pwm3, qdss_cti_trig_in_b1, wci_txd, wci_rxd, xfem, _, _, _, _),
  635. PINGROUP(46, led0, _, _, _, _, _, _, _, _),
  636. };
  637. static const struct msm_pinctrl_soc_data ipq5018_pinctrl = {
  638. .pins = ipq5018_pins,
  639. .npins = ARRAY_SIZE(ipq5018_pins),
  640. .functions = ipq5018_functions,
  641. .nfunctions = ARRAY_SIZE(ipq5018_functions),
  642. .groups = ipq5018_groups,
  643. .ngroups = ARRAY_SIZE(ipq5018_groups),
  644. .ngpios = 47,
  645. };
  646. static int ipq5018_pinctrl_probe(struct platform_device *pdev)
  647. {
  648. return msm_pinctrl_probe(pdev, &ipq5018_pinctrl);
  649. }
  650. static const struct of_device_id ipq5018_pinctrl_of_match[] = {
  651. { .compatible = "qcom,ipq5018-tlmm", },
  652. { }
  653. };
  654. MODULE_DEVICE_TABLE(of, ipq5018_pinctrl_of_match);
  655. static struct platform_driver ipq5018_pinctrl_driver = {
  656. .driver = {
  657. .name = "ipq5018-tlmm",
  658. .of_match_table = ipq5018_pinctrl_of_match,
  659. },
  660. .probe = ipq5018_pinctrl_probe,
  661. .remove_new = msm_pinctrl_remove,
  662. };
  663. static int __init ipq5018_pinctrl_init(void)
  664. {
  665. return platform_driver_register(&ipq5018_pinctrl_driver);
  666. }
  667. arch_initcall(ipq5018_pinctrl_init);
  668. static void __exit ipq5018_pinctrl_exit(void)
  669. {
  670. platform_driver_unregister(&ipq5018_pinctrl_driver);
  671. }
  672. module_exit(ipq5018_pinctrl_exit);
  673. MODULE_DESCRIPTION("Qualcomm Technologies Inc ipq5018 pinctrl driver");
  674. MODULE_LICENSE("GPL");