pinctrl-sdx65.c 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
  4. */
  5. #include <linux/module.h>
  6. #include <linux/of.h>
  7. #include <linux/platform_device.h>
  8. #include "pinctrl-msm.h"
  9. #define REG_BASE 0x0
  10. #define REG_SIZE 0x1000
  11. #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9) \
  12. { \
  13. .grp = PINCTRL_PINGROUP("gpio" #id, \
  14. gpio##id##_pins, \
  15. ARRAY_SIZE(gpio##id##_pins)), \
  16. .funcs = (int[]){ \
  17. msm_mux_gpio, /* gpio mode */ \
  18. msm_mux_##f1, \
  19. msm_mux_##f2, \
  20. msm_mux_##f3, \
  21. msm_mux_##f4, \
  22. msm_mux_##f5, \
  23. msm_mux_##f6, \
  24. msm_mux_##f7, \
  25. msm_mux_##f8, \
  26. msm_mux_##f9 \
  27. }, \
  28. .nfuncs = 10, \
  29. .ctl_reg = REG_BASE + REG_SIZE * id, \
  30. .io_reg = REG_BASE + 0x4 + REG_SIZE * id, \
  31. .intr_cfg_reg = REG_BASE + 0x8 + REG_SIZE * id, \
  32. .intr_status_reg = REG_BASE + 0xc + REG_SIZE * id, \
  33. .intr_target_reg = REG_BASE + 0x8 + REG_SIZE * id, \
  34. .mux_bit = 2, \
  35. .pull_bit = 0, \
  36. .drv_bit = 6, \
  37. .oe_bit = 9, \
  38. .in_bit = 0, \
  39. .out_bit = 1, \
  40. .intr_enable_bit = 0, \
  41. .intr_status_bit = 0, \
  42. .intr_target_bit = 5, \
  43. .intr_target_kpss_val = 3, \
  44. .intr_raw_status_bit = 4, \
  45. .intr_polarity_bit = 1, \
  46. .intr_detection_bit = 2, \
  47. .intr_detection_width = 2, \
  48. }
  49. #define SDC_QDSD_PINGROUP(pg_name, ctl, pull, drv) \
  50. { \
  51. .grp = PINCTRL_PINGROUP(#pg_name, \
  52. pg_name##_pins, \
  53. ARRAY_SIZE(pg_name##_pins)), \
  54. .ctl_reg = ctl, \
  55. .io_reg = 0, \
  56. .intr_cfg_reg = 0, \
  57. .intr_status_reg = 0, \
  58. .intr_target_reg = 0, \
  59. .mux_bit = -1, \
  60. .pull_bit = pull, \
  61. .drv_bit = drv, \
  62. .oe_bit = -1, \
  63. .in_bit = -1, \
  64. .out_bit = -1, \
  65. .intr_enable_bit = -1, \
  66. .intr_status_bit = -1, \
  67. .intr_target_bit = -1, \
  68. .intr_raw_status_bit = -1, \
  69. .intr_polarity_bit = -1, \
  70. .intr_detection_bit = -1, \
  71. .intr_detection_width = -1, \
  72. }
  73. #define UFS_RESET(pg_name, offset) \
  74. { \
  75. .grp = PINCTRL_PINGROUP(#pg_name, \
  76. pg_name##_pins, \
  77. ARRAY_SIZE(pg_name##_pins)), \
  78. .ctl_reg = offset, \
  79. .io_reg = offset + 0x4, \
  80. .intr_cfg_reg = 0, \
  81. .intr_status_reg = 0, \
  82. .intr_target_reg = 0, \
  83. .mux_bit = -1, \
  84. .pull_bit = 3, \
  85. .drv_bit = 0, \
  86. .oe_bit = -1, \
  87. .in_bit = -1, \
  88. .out_bit = 0, \
  89. .intr_enable_bit = -1, \
  90. .intr_status_bit = -1, \
  91. .intr_target_bit = -1, \
  92. .intr_raw_status_bit = -1, \
  93. .intr_polarity_bit = -1, \
  94. .intr_detection_bit = -1, \
  95. .intr_detection_width = -1, \
  96. }
  97. static const struct pinctrl_pin_desc sdx65_pins[] = {
  98. PINCTRL_PIN(0, "GPIO_0"),
  99. PINCTRL_PIN(1, "GPIO_1"),
  100. PINCTRL_PIN(2, "GPIO_2"),
  101. PINCTRL_PIN(3, "GPIO_3"),
  102. PINCTRL_PIN(4, "GPIO_4"),
  103. PINCTRL_PIN(5, "GPIO_5"),
  104. PINCTRL_PIN(6, "GPIO_6"),
  105. PINCTRL_PIN(7, "GPIO_7"),
  106. PINCTRL_PIN(8, "GPIO_8"),
  107. PINCTRL_PIN(9, "GPIO_9"),
  108. PINCTRL_PIN(10, "GPIO_10"),
  109. PINCTRL_PIN(11, "GPIO_11"),
  110. PINCTRL_PIN(12, "GPIO_12"),
  111. PINCTRL_PIN(13, "GPIO_13"),
  112. PINCTRL_PIN(14, "GPIO_14"),
  113. PINCTRL_PIN(15, "GPIO_15"),
  114. PINCTRL_PIN(16, "GPIO_16"),
  115. PINCTRL_PIN(17, "GPIO_17"),
  116. PINCTRL_PIN(18, "GPIO_18"),
  117. PINCTRL_PIN(19, "GPIO_19"),
  118. PINCTRL_PIN(20, "GPIO_20"),
  119. PINCTRL_PIN(21, "GPIO_21"),
  120. PINCTRL_PIN(22, "GPIO_22"),
  121. PINCTRL_PIN(23, "GPIO_23"),
  122. PINCTRL_PIN(24, "GPIO_24"),
  123. PINCTRL_PIN(25, "GPIO_25"),
  124. PINCTRL_PIN(26, "GPIO_26"),
  125. PINCTRL_PIN(27, "GPIO_27"),
  126. PINCTRL_PIN(28, "GPIO_28"),
  127. PINCTRL_PIN(29, "GPIO_29"),
  128. PINCTRL_PIN(30, "GPIO_30"),
  129. PINCTRL_PIN(31, "GPIO_31"),
  130. PINCTRL_PIN(32, "GPIO_32"),
  131. PINCTRL_PIN(33, "GPIO_33"),
  132. PINCTRL_PIN(34, "GPIO_34"),
  133. PINCTRL_PIN(35, "GPIO_35"),
  134. PINCTRL_PIN(36, "GPIO_36"),
  135. PINCTRL_PIN(37, "GPIO_37"),
  136. PINCTRL_PIN(38, "GPIO_38"),
  137. PINCTRL_PIN(39, "GPIO_39"),
  138. PINCTRL_PIN(40, "GPIO_40"),
  139. PINCTRL_PIN(41, "GPIO_41"),
  140. PINCTRL_PIN(42, "GPIO_42"),
  141. PINCTRL_PIN(43, "GPIO_43"),
  142. PINCTRL_PIN(44, "GPIO_44"),
  143. PINCTRL_PIN(45, "GPIO_45"),
  144. PINCTRL_PIN(46, "GPIO_46"),
  145. PINCTRL_PIN(47, "GPIO_47"),
  146. PINCTRL_PIN(48, "GPIO_48"),
  147. PINCTRL_PIN(49, "GPIO_49"),
  148. PINCTRL_PIN(50, "GPIO_50"),
  149. PINCTRL_PIN(51, "GPIO_51"),
  150. PINCTRL_PIN(52, "GPIO_52"),
  151. PINCTRL_PIN(53, "GPIO_53"),
  152. PINCTRL_PIN(54, "GPIO_54"),
  153. PINCTRL_PIN(55, "GPIO_55"),
  154. PINCTRL_PIN(56, "GPIO_56"),
  155. PINCTRL_PIN(57, "GPIO_57"),
  156. PINCTRL_PIN(58, "GPIO_58"),
  157. PINCTRL_PIN(59, "GPIO_59"),
  158. PINCTRL_PIN(60, "GPIO_60"),
  159. PINCTRL_PIN(61, "GPIO_61"),
  160. PINCTRL_PIN(62, "GPIO_62"),
  161. PINCTRL_PIN(63, "GPIO_63"),
  162. PINCTRL_PIN(64, "GPIO_64"),
  163. PINCTRL_PIN(65, "GPIO_65"),
  164. PINCTRL_PIN(66, "GPIO_66"),
  165. PINCTRL_PIN(67, "GPIO_67"),
  166. PINCTRL_PIN(68, "GPIO_68"),
  167. PINCTRL_PIN(69, "GPIO_69"),
  168. PINCTRL_PIN(70, "GPIO_70"),
  169. PINCTRL_PIN(71, "GPIO_71"),
  170. PINCTRL_PIN(72, "GPIO_72"),
  171. PINCTRL_PIN(73, "GPIO_73"),
  172. PINCTRL_PIN(74, "GPIO_74"),
  173. PINCTRL_PIN(75, "GPIO_75"),
  174. PINCTRL_PIN(76, "GPIO_76"),
  175. PINCTRL_PIN(77, "GPIO_77"),
  176. PINCTRL_PIN(78, "GPIO_78"),
  177. PINCTRL_PIN(79, "GPIO_79"),
  178. PINCTRL_PIN(80, "GPIO_80"),
  179. PINCTRL_PIN(81, "GPIO_81"),
  180. PINCTRL_PIN(82, "GPIO_82"),
  181. PINCTRL_PIN(83, "GPIO_83"),
  182. PINCTRL_PIN(84, "GPIO_84"),
  183. PINCTRL_PIN(85, "GPIO_85"),
  184. PINCTRL_PIN(86, "GPIO_86"),
  185. PINCTRL_PIN(87, "GPIO_87"),
  186. PINCTRL_PIN(88, "GPIO_88"),
  187. PINCTRL_PIN(89, "GPIO_89"),
  188. PINCTRL_PIN(90, "GPIO_90"),
  189. PINCTRL_PIN(91, "GPIO_91"),
  190. PINCTRL_PIN(92, "GPIO_92"),
  191. PINCTRL_PIN(93, "GPIO_93"),
  192. PINCTRL_PIN(94, "GPIO_94"),
  193. PINCTRL_PIN(95, "GPIO_95"),
  194. PINCTRL_PIN(96, "GPIO_96"),
  195. PINCTRL_PIN(97, "GPIO_97"),
  196. PINCTRL_PIN(98, "GPIO_98"),
  197. PINCTRL_PIN(99, "GPIO_99"),
  198. PINCTRL_PIN(100, "GPIO_100"),
  199. PINCTRL_PIN(101, "GPIO_101"),
  200. PINCTRL_PIN(102, "GPIO_102"),
  201. PINCTRL_PIN(103, "GPIO_103"),
  202. PINCTRL_PIN(104, "GPIO_104"),
  203. PINCTRL_PIN(105, "GPIO_105"),
  204. PINCTRL_PIN(106, "GPIO_106"),
  205. PINCTRL_PIN(107, "GPIO_107"),
  206. PINCTRL_PIN(108, "UFS_RESET"),
  207. PINCTRL_PIN(109, "SDC1_RCLK"),
  208. PINCTRL_PIN(110, "SDC1_CLK"),
  209. PINCTRL_PIN(111, "SDC1_CMD"),
  210. PINCTRL_PIN(112, "SDC1_DATA"),
  211. };
  212. #define DECLARE_MSM_GPIO_PINS(pin) \
  213. static const unsigned int gpio##pin##_pins[] = { pin }
  214. DECLARE_MSM_GPIO_PINS(0);
  215. DECLARE_MSM_GPIO_PINS(1);
  216. DECLARE_MSM_GPIO_PINS(2);
  217. DECLARE_MSM_GPIO_PINS(3);
  218. DECLARE_MSM_GPIO_PINS(4);
  219. DECLARE_MSM_GPIO_PINS(5);
  220. DECLARE_MSM_GPIO_PINS(6);
  221. DECLARE_MSM_GPIO_PINS(7);
  222. DECLARE_MSM_GPIO_PINS(8);
  223. DECLARE_MSM_GPIO_PINS(9);
  224. DECLARE_MSM_GPIO_PINS(10);
  225. DECLARE_MSM_GPIO_PINS(11);
  226. DECLARE_MSM_GPIO_PINS(12);
  227. DECLARE_MSM_GPIO_PINS(13);
  228. DECLARE_MSM_GPIO_PINS(14);
  229. DECLARE_MSM_GPIO_PINS(15);
  230. DECLARE_MSM_GPIO_PINS(16);
  231. DECLARE_MSM_GPIO_PINS(17);
  232. DECLARE_MSM_GPIO_PINS(18);
  233. DECLARE_MSM_GPIO_PINS(19);
  234. DECLARE_MSM_GPIO_PINS(20);
  235. DECLARE_MSM_GPIO_PINS(21);
  236. DECLARE_MSM_GPIO_PINS(22);
  237. DECLARE_MSM_GPIO_PINS(23);
  238. DECLARE_MSM_GPIO_PINS(24);
  239. DECLARE_MSM_GPIO_PINS(25);
  240. DECLARE_MSM_GPIO_PINS(26);
  241. DECLARE_MSM_GPIO_PINS(27);
  242. DECLARE_MSM_GPIO_PINS(28);
  243. DECLARE_MSM_GPIO_PINS(29);
  244. DECLARE_MSM_GPIO_PINS(30);
  245. DECLARE_MSM_GPIO_PINS(31);
  246. DECLARE_MSM_GPIO_PINS(32);
  247. DECLARE_MSM_GPIO_PINS(33);
  248. DECLARE_MSM_GPIO_PINS(34);
  249. DECLARE_MSM_GPIO_PINS(35);
  250. DECLARE_MSM_GPIO_PINS(36);
  251. DECLARE_MSM_GPIO_PINS(37);
  252. DECLARE_MSM_GPIO_PINS(38);
  253. DECLARE_MSM_GPIO_PINS(39);
  254. DECLARE_MSM_GPIO_PINS(40);
  255. DECLARE_MSM_GPIO_PINS(41);
  256. DECLARE_MSM_GPIO_PINS(42);
  257. DECLARE_MSM_GPIO_PINS(43);
  258. DECLARE_MSM_GPIO_PINS(44);
  259. DECLARE_MSM_GPIO_PINS(45);
  260. DECLARE_MSM_GPIO_PINS(46);
  261. DECLARE_MSM_GPIO_PINS(47);
  262. DECLARE_MSM_GPIO_PINS(48);
  263. DECLARE_MSM_GPIO_PINS(49);
  264. DECLARE_MSM_GPIO_PINS(50);
  265. DECLARE_MSM_GPIO_PINS(51);
  266. DECLARE_MSM_GPIO_PINS(52);
  267. DECLARE_MSM_GPIO_PINS(53);
  268. DECLARE_MSM_GPIO_PINS(54);
  269. DECLARE_MSM_GPIO_PINS(55);
  270. DECLARE_MSM_GPIO_PINS(56);
  271. DECLARE_MSM_GPIO_PINS(57);
  272. DECLARE_MSM_GPIO_PINS(58);
  273. DECLARE_MSM_GPIO_PINS(59);
  274. DECLARE_MSM_GPIO_PINS(60);
  275. DECLARE_MSM_GPIO_PINS(61);
  276. DECLARE_MSM_GPIO_PINS(62);
  277. DECLARE_MSM_GPIO_PINS(63);
  278. DECLARE_MSM_GPIO_PINS(64);
  279. DECLARE_MSM_GPIO_PINS(65);
  280. DECLARE_MSM_GPIO_PINS(66);
  281. DECLARE_MSM_GPIO_PINS(67);
  282. DECLARE_MSM_GPIO_PINS(68);
  283. DECLARE_MSM_GPIO_PINS(69);
  284. DECLARE_MSM_GPIO_PINS(70);
  285. DECLARE_MSM_GPIO_PINS(71);
  286. DECLARE_MSM_GPIO_PINS(72);
  287. DECLARE_MSM_GPIO_PINS(73);
  288. DECLARE_MSM_GPIO_PINS(74);
  289. DECLARE_MSM_GPIO_PINS(75);
  290. DECLARE_MSM_GPIO_PINS(76);
  291. DECLARE_MSM_GPIO_PINS(77);
  292. DECLARE_MSM_GPIO_PINS(78);
  293. DECLARE_MSM_GPIO_PINS(79);
  294. DECLARE_MSM_GPIO_PINS(80);
  295. DECLARE_MSM_GPIO_PINS(81);
  296. DECLARE_MSM_GPIO_PINS(82);
  297. DECLARE_MSM_GPIO_PINS(83);
  298. DECLARE_MSM_GPIO_PINS(84);
  299. DECLARE_MSM_GPIO_PINS(85);
  300. DECLARE_MSM_GPIO_PINS(86);
  301. DECLARE_MSM_GPIO_PINS(87);
  302. DECLARE_MSM_GPIO_PINS(88);
  303. DECLARE_MSM_GPIO_PINS(89);
  304. DECLARE_MSM_GPIO_PINS(90);
  305. DECLARE_MSM_GPIO_PINS(91);
  306. DECLARE_MSM_GPIO_PINS(92);
  307. DECLARE_MSM_GPIO_PINS(93);
  308. DECLARE_MSM_GPIO_PINS(94);
  309. DECLARE_MSM_GPIO_PINS(95);
  310. DECLARE_MSM_GPIO_PINS(96);
  311. DECLARE_MSM_GPIO_PINS(97);
  312. DECLARE_MSM_GPIO_PINS(98);
  313. DECLARE_MSM_GPIO_PINS(99);
  314. DECLARE_MSM_GPIO_PINS(100);
  315. DECLARE_MSM_GPIO_PINS(101);
  316. DECLARE_MSM_GPIO_PINS(102);
  317. DECLARE_MSM_GPIO_PINS(103);
  318. DECLARE_MSM_GPIO_PINS(104);
  319. DECLARE_MSM_GPIO_PINS(105);
  320. DECLARE_MSM_GPIO_PINS(106);
  321. DECLARE_MSM_GPIO_PINS(107);
  322. static const unsigned int ufs_reset_pins[] = { 108 };
  323. static const unsigned int sdc1_rclk_pins[] = { 109 };
  324. static const unsigned int sdc1_clk_pins[] = { 110 };
  325. static const unsigned int sdc1_cmd_pins[] = { 111 };
  326. static const unsigned int sdc1_data_pins[] = { 112 };
  327. enum sdx65_functions {
  328. msm_mux_qlink0_wmss,
  329. msm_mux_adsp_ext,
  330. msm_mux_atest_char,
  331. msm_mux_atest_char0,
  332. msm_mux_atest_char1,
  333. msm_mux_atest_char2,
  334. msm_mux_atest_char3,
  335. msm_mux_audio_ref,
  336. msm_mux_bimc_dte0,
  337. msm_mux_bimc_dte1,
  338. msm_mux_blsp_i2c1,
  339. msm_mux_blsp_i2c2,
  340. msm_mux_blsp_i2c3,
  341. msm_mux_blsp_i2c4,
  342. msm_mux_blsp_spi1,
  343. msm_mux_blsp_spi2,
  344. msm_mux_blsp_spi3,
  345. msm_mux_blsp_spi4,
  346. msm_mux_blsp_uart1,
  347. msm_mux_blsp_uart2,
  348. msm_mux_blsp_uart3,
  349. msm_mux_blsp_uart4,
  350. msm_mux_char_exec,
  351. msm_mux_coex_uart,
  352. msm_mux_coex_uart2,
  353. msm_mux_cri_trng,
  354. msm_mux_cri_trng0,
  355. msm_mux_cri_trng1,
  356. msm_mux_dbg_out,
  357. msm_mux_ddr_bist,
  358. msm_mux_ddr_pxi0,
  359. msm_mux_ebi0_wrcdc,
  360. msm_mux_ebi2_a,
  361. msm_mux_ebi2_lcd,
  362. msm_mux_ext_dbg,
  363. msm_mux_gcc_gp1,
  364. msm_mux_gcc_gp2,
  365. msm_mux_gcc_gp3,
  366. msm_mux_gcc_plltest,
  367. msm_mux_gpio,
  368. msm_mux_i2s_mclk,
  369. msm_mux_jitter_bist,
  370. msm_mux_ldo_en,
  371. msm_mux_ldo_update,
  372. msm_mux_m_voc,
  373. msm_mux_mgpi_clk,
  374. msm_mux_native_char,
  375. msm_mux_native_tsens,
  376. msm_mux_native_tsense,
  377. msm_mux_nav_gpio,
  378. msm_mux_pa_indicator,
  379. msm_mux_pci_e,
  380. msm_mux_pcie_clkreq,
  381. msm_mux_pll_bist,
  382. msm_mux_pll_ref,
  383. msm_mux_pri_mi2s,
  384. msm_mux_pri_mi2s_ws,
  385. msm_mux_prng_rosc,
  386. msm_mux_qdss_cti,
  387. msm_mux_qdss_gpio,
  388. msm_mux_qlink0_en,
  389. msm_mux_qlink0_req,
  390. msm_mux_qlink1_en,
  391. msm_mux_qlink1_req,
  392. msm_mux_qlink1_wmss,
  393. msm_mux_qlink2_en,
  394. msm_mux_qlink2_req,
  395. msm_mux_qlink2_wmss,
  396. msm_mux_sdc1_tb,
  397. msm_mux_sec_mi2s,
  398. msm_mux_spmi_coex,
  399. msm_mux_spmi_vgi,
  400. msm_mux_tgu_ch0,
  401. msm_mux_uim1_clk,
  402. msm_mux_uim1_data,
  403. msm_mux_uim1_present,
  404. msm_mux_uim1_reset,
  405. msm_mux_uim2_clk,
  406. msm_mux_uim2_data,
  407. msm_mux_uim2_present,
  408. msm_mux_uim2_reset,
  409. msm_mux_usb2phy_ac,
  410. msm_mux_vsense_trigger,
  411. msm_mux__,
  412. };
  413. static const char * const gpio_groups[] = {
  414. "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7",
  415. "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14",
  416. "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21",
  417. "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28",
  418. "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35",
  419. "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42",
  420. "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49",
  421. "gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56",
  422. "gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63",
  423. "gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70",
  424. "gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77",
  425. "gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84",
  426. "gpio85", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", "gpio91",
  427. "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98",
  428. "gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104",
  429. "gpio105", "gpio106", "gpio107",
  430. };
  431. static const char * const uim2_data_groups[] = {
  432. "gpio0",
  433. };
  434. static const char * const blsp_uart1_groups[] = {
  435. "gpio0", "gpio1", "gpio2", "gpio3", "gpio48", "gpio49", "gpio80",
  436. "gpio81",
  437. };
  438. static const char * const ebi0_wrcdc_groups[] = {
  439. "gpio0", "gpio2",
  440. };
  441. static const char * const uim2_present_groups[] = {
  442. "gpio1",
  443. };
  444. static const char * const uim2_reset_groups[] = {
  445. "gpio2",
  446. };
  447. static const char * const blsp_i2c1_groups[] = {
  448. "gpio2", "gpio3", "gpio82", "gpio83",
  449. };
  450. static const char * const uim2_clk_groups[] = {
  451. "gpio3",
  452. };
  453. static const char * const blsp_spi2_groups[] = {
  454. "gpio4", "gpio5", "gpio6", "gpio7", "gpio23", "gpio47", "gpio62",
  455. };
  456. static const char * const blsp_uart2_groups[] = {
  457. "gpio4", "gpio5", "gpio6", "gpio7", "gpio63", "gpio64", "gpio65",
  458. "gpio66",
  459. };
  460. static const char * const blsp_i2c2_groups[] = {
  461. "gpio6", "gpio7", "gpio65", "gpio66",
  462. };
  463. static const char * const char_exec_groups[] = {
  464. "gpio6", "gpio7",
  465. };
  466. static const char * const qdss_gpio_groups[] = {
  467. "gpio4", "gpio5", "gpio6", "gpio7", "gpio12", "gpio13",
  468. "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19",
  469. "gpio33", "gpio42", "gpio63", "gpio64", "gpio65", "gpio66",
  470. };
  471. static const char * const blsp_spi3_groups[] = {
  472. "gpio8", "gpio9", "gpio10", "gpio11", "gpio23", "gpio47", "gpio62",
  473. };
  474. static const char * const blsp_uart3_groups[] = {
  475. "gpio8", "gpio9", "gpio10", "gpio11",
  476. };
  477. static const char * const ext_dbg_groups[] = {
  478. "gpio8", "gpio9", "gpio10", "gpio11",
  479. };
  480. static const char * const ldo_en_groups[] = {
  481. "gpio8",
  482. };
  483. static const char * const blsp_i2c3_groups[] = {
  484. "gpio10", "gpio11",
  485. };
  486. static const char * const gcc_gp3_groups[] = {
  487. "gpio11",
  488. };
  489. static const char * const pri_mi2s_ws_groups[] = {
  490. "gpio12",
  491. };
  492. static const char * const pri_mi2s_groups[] = {
  493. "gpio13", "gpio14", "gpio15",
  494. };
  495. static const char * const vsense_trigger_groups[] = {
  496. "gpio13",
  497. };
  498. static const char * const native_tsens_groups[] = {
  499. "gpio14",
  500. };
  501. static const char * const bimc_dte0_groups[] = {
  502. "gpio14", "gpio59",
  503. };
  504. static const char * const bimc_dte1_groups[] = {
  505. "gpio15", "gpio61",
  506. };
  507. static const char * const sec_mi2s_groups[] = {
  508. "gpio16", "gpio17", "gpio18", "gpio19",
  509. };
  510. static const char * const blsp_spi4_groups[] = {
  511. "gpio16", "gpio17", "gpio18", "gpio19", "gpio23", "gpio47", "gpio62",
  512. };
  513. static const char * const blsp_uart4_groups[] = {
  514. "gpio16", "gpio17", "gpio18", "gpio19", "gpio22", "gpio23", "gpio48",
  515. "gpio49",
  516. };
  517. static const char * const qdss_cti_groups[] = {
  518. "gpio16", "gpio16", "gpio17", "gpio17", "gpio54", "gpio54", "gpio55",
  519. "gpio55", "gpio59", "gpio60", "gpio65", "gpio65", "gpio66", "gpio66",
  520. "gpio94", "gpio94", "gpio95", "gpio95",
  521. };
  522. static const char * const blsp_i2c4_groups[] = {
  523. "gpio18", "gpio19", "gpio84", "gpio85",
  524. };
  525. static const char * const gcc_gp1_groups[] = {
  526. "gpio18",
  527. };
  528. static const char * const jitter_bist_groups[] = {
  529. "gpio19",
  530. };
  531. static const char * const gcc_gp2_groups[] = {
  532. "gpio19",
  533. };
  534. static const char * const pll_bist_groups[] = {
  535. "gpio22",
  536. };
  537. static const char * const blsp_spi1_groups[] = {
  538. "gpio23", "gpio47", "gpio62", "gpio80", "gpio81", "gpio82", "gpio83",
  539. };
  540. static const char * const adsp_ext_groups[] = {
  541. "gpio24", "gpio25",
  542. };
  543. static const char * const qlink0_wmss_groups[] = {
  544. "gpio28",
  545. };
  546. static const char * const native_tsense_groups[] = {
  547. "gpio29", "gpio72",
  548. };
  549. static const char * const nav_gpio_groups[] = {
  550. "gpio31", "gpio32",
  551. };
  552. static const char * const pll_ref_groups[] = {
  553. "gpio32",
  554. };
  555. static const char * const pa_indicator_groups[] = {
  556. "gpio33",
  557. };
  558. static const char * const qlink0_en_groups[] = {
  559. "gpio34",
  560. };
  561. static const char * const qlink0_req_groups[] = {
  562. "gpio35",
  563. };
  564. static const char * const dbg_out_groups[] = {
  565. "gpio35",
  566. };
  567. static const char * const cri_trng_groups[] = {
  568. "gpio36",
  569. };
  570. static const char * const prng_rosc_groups[] = {
  571. "gpio38",
  572. };
  573. static const char * const cri_trng0_groups[] = {
  574. "gpio40",
  575. };
  576. static const char * const cri_trng1_groups[] = {
  577. "gpio41",
  578. };
  579. static const char * const coex_uart_groups[] = {
  580. "gpio44", "gpio45",
  581. };
  582. static const char * const ddr_pxi0_groups[] = {
  583. "gpio45", "gpio46",
  584. };
  585. static const char * const m_voc_groups[] = {
  586. "gpio46", "gpio48", "gpio49", "gpio59", "gpio60",
  587. };
  588. static const char * const ddr_bist_groups[] = {
  589. "gpio46", "gpio47", "gpio48", "gpio49",
  590. };
  591. static const char * const pci_e_groups[] = {
  592. "gpio53",
  593. };
  594. static const char * const tgu_ch0_groups[] = {
  595. "gpio55",
  596. };
  597. static const char * const pcie_clkreq_groups[] = {
  598. "gpio56",
  599. };
  600. static const char * const native_char_groups[] = {
  601. "gpio26", "gpio29", "gpio33", "gpio42", "gpio57",
  602. };
  603. static const char * const mgpi_clk_groups[] = {
  604. "gpio61", "gpio71",
  605. };
  606. static const char * const qlink2_wmss_groups[] = {
  607. "gpio61",
  608. };
  609. static const char * const i2s_mclk_groups[] = {
  610. "gpio62",
  611. };
  612. static const char * const audio_ref_groups[] = {
  613. "gpio62",
  614. };
  615. static const char * const ldo_update_groups[] = {
  616. "gpio62",
  617. };
  618. static const char * const atest_char_groups[] = {
  619. "gpio63",
  620. };
  621. static const char * const atest_char3_groups[] = {
  622. "gpio64",
  623. };
  624. static const char * const atest_char2_groups[] = {
  625. "gpio65",
  626. };
  627. static const char * const atest_char1_groups[] = {
  628. "gpio66",
  629. };
  630. static const char * const uim1_data_groups[] = {
  631. "gpio67",
  632. };
  633. static const char * const atest_char0_groups[] = {
  634. "gpio67",
  635. };
  636. static const char * const uim1_present_groups[] = {
  637. "gpio68",
  638. };
  639. static const char * const uim1_reset_groups[] = {
  640. "gpio69",
  641. };
  642. static const char * const uim1_clk_groups[] = {
  643. "gpio70",
  644. };
  645. static const char * const qlink2_en_groups[] = {
  646. "gpio71",
  647. };
  648. static const char * const qlink1_en_groups[] = {
  649. "gpio72",
  650. };
  651. static const char * const qlink1_req_groups[] = {
  652. "gpio73",
  653. };
  654. static const char * const qlink1_wmss_groups[] = {
  655. "gpio74",
  656. };
  657. static const char * const coex_uart2_groups[] = {
  658. "gpio75", "gpio76", "gpio102", "gpio103",
  659. };
  660. static const char * const spmi_coex_groups[] = {
  661. "gpio75", "gpio76",
  662. };
  663. static const char * const qlink2_req_groups[] = {
  664. "gpio77",
  665. };
  666. static const char * const spmi_vgi_groups[] = {
  667. "gpio78", "gpio79",
  668. };
  669. static const char * const gcc_plltest_groups[] = {
  670. "gpio81", "gpio82",
  671. };
  672. static const char * const ebi2_lcd_groups[] = {
  673. "gpio84", "gpio85", "gpio90",
  674. };
  675. static const char * const ebi2_a_groups[] = {
  676. "gpio89",
  677. };
  678. static const char * const usb2phy_ac_groups[] = {
  679. "gpio93",
  680. };
  681. static const char * const sdc1_tb_groups[] = {
  682. "gpio106",
  683. };
  684. static const struct pinfunction sdx65_functions[] = {
  685. MSM_PIN_FUNCTION(qlink0_wmss),
  686. MSM_PIN_FUNCTION(adsp_ext),
  687. MSM_PIN_FUNCTION(atest_char),
  688. MSM_PIN_FUNCTION(atest_char0),
  689. MSM_PIN_FUNCTION(atest_char1),
  690. MSM_PIN_FUNCTION(atest_char2),
  691. MSM_PIN_FUNCTION(atest_char3),
  692. MSM_PIN_FUNCTION(audio_ref),
  693. MSM_PIN_FUNCTION(bimc_dte0),
  694. MSM_PIN_FUNCTION(bimc_dte1),
  695. MSM_PIN_FUNCTION(blsp_i2c1),
  696. MSM_PIN_FUNCTION(blsp_i2c2),
  697. MSM_PIN_FUNCTION(blsp_i2c3),
  698. MSM_PIN_FUNCTION(blsp_i2c4),
  699. MSM_PIN_FUNCTION(blsp_spi1),
  700. MSM_PIN_FUNCTION(blsp_spi2),
  701. MSM_PIN_FUNCTION(blsp_spi3),
  702. MSM_PIN_FUNCTION(blsp_spi4),
  703. MSM_PIN_FUNCTION(blsp_uart1),
  704. MSM_PIN_FUNCTION(blsp_uart2),
  705. MSM_PIN_FUNCTION(blsp_uart3),
  706. MSM_PIN_FUNCTION(blsp_uart4),
  707. MSM_PIN_FUNCTION(char_exec),
  708. MSM_PIN_FUNCTION(coex_uart),
  709. MSM_PIN_FUNCTION(coex_uart2),
  710. MSM_PIN_FUNCTION(cri_trng),
  711. MSM_PIN_FUNCTION(cri_trng0),
  712. MSM_PIN_FUNCTION(cri_trng1),
  713. MSM_PIN_FUNCTION(dbg_out),
  714. MSM_PIN_FUNCTION(ddr_bist),
  715. MSM_PIN_FUNCTION(ddr_pxi0),
  716. MSM_PIN_FUNCTION(ebi0_wrcdc),
  717. MSM_PIN_FUNCTION(ebi2_a),
  718. MSM_PIN_FUNCTION(ebi2_lcd),
  719. MSM_PIN_FUNCTION(ext_dbg),
  720. MSM_PIN_FUNCTION(gcc_gp1),
  721. MSM_PIN_FUNCTION(gcc_gp2),
  722. MSM_PIN_FUNCTION(gcc_gp3),
  723. MSM_PIN_FUNCTION(gcc_plltest),
  724. MSM_PIN_FUNCTION(gpio),
  725. MSM_PIN_FUNCTION(i2s_mclk),
  726. MSM_PIN_FUNCTION(jitter_bist),
  727. MSM_PIN_FUNCTION(ldo_en),
  728. MSM_PIN_FUNCTION(ldo_update),
  729. MSM_PIN_FUNCTION(m_voc),
  730. MSM_PIN_FUNCTION(mgpi_clk),
  731. MSM_PIN_FUNCTION(native_char),
  732. MSM_PIN_FUNCTION(native_tsens),
  733. MSM_PIN_FUNCTION(native_tsense),
  734. MSM_PIN_FUNCTION(nav_gpio),
  735. MSM_PIN_FUNCTION(pa_indicator),
  736. MSM_PIN_FUNCTION(pci_e),
  737. MSM_PIN_FUNCTION(pcie_clkreq),
  738. MSM_PIN_FUNCTION(pll_bist),
  739. MSM_PIN_FUNCTION(pll_ref),
  740. MSM_PIN_FUNCTION(pri_mi2s),
  741. MSM_PIN_FUNCTION(pri_mi2s_ws),
  742. MSM_PIN_FUNCTION(prng_rosc),
  743. MSM_PIN_FUNCTION(qdss_cti),
  744. MSM_PIN_FUNCTION(qdss_gpio),
  745. MSM_PIN_FUNCTION(qlink0_en),
  746. MSM_PIN_FUNCTION(qlink0_req),
  747. MSM_PIN_FUNCTION(qlink1_en),
  748. MSM_PIN_FUNCTION(qlink1_req),
  749. MSM_PIN_FUNCTION(qlink1_wmss),
  750. MSM_PIN_FUNCTION(qlink2_en),
  751. MSM_PIN_FUNCTION(qlink2_req),
  752. MSM_PIN_FUNCTION(qlink2_wmss),
  753. MSM_PIN_FUNCTION(sdc1_tb),
  754. MSM_PIN_FUNCTION(sec_mi2s),
  755. MSM_PIN_FUNCTION(spmi_coex),
  756. MSM_PIN_FUNCTION(spmi_vgi),
  757. MSM_PIN_FUNCTION(tgu_ch0),
  758. MSM_PIN_FUNCTION(uim1_clk),
  759. MSM_PIN_FUNCTION(uim1_data),
  760. MSM_PIN_FUNCTION(uim1_present),
  761. MSM_PIN_FUNCTION(uim1_reset),
  762. MSM_PIN_FUNCTION(uim2_clk),
  763. MSM_PIN_FUNCTION(uim2_data),
  764. MSM_PIN_FUNCTION(uim2_present),
  765. MSM_PIN_FUNCTION(uim2_reset),
  766. MSM_PIN_FUNCTION(usb2phy_ac),
  767. MSM_PIN_FUNCTION(vsense_trigger),
  768. };
  769. /* Every pin is maintained as a single group, and missing or non-existing pin
  770. * would be maintained as dummy group to synchronize pin group index with
  771. * pin descriptor registered with pinctrl core.
  772. * Clients would not be able to request these dummy pin groups.
  773. */
  774. static const struct msm_pingroup sdx65_groups[] = {
  775. [0] = PINGROUP(0, uim2_data, blsp_uart1, ebi0_wrcdc, _, _, _, _, _, _),
  776. [1] = PINGROUP(1, uim2_present, blsp_uart1, _, _, _, _, _, _, _),
  777. [2] = PINGROUP(2, uim2_reset, blsp_uart1, blsp_i2c1, ebi0_wrcdc, _, _, _, _, _),
  778. [3] = PINGROUP(3, uim2_clk, blsp_uart1, blsp_i2c1, _, _, _, _, _, _),
  779. [4] = PINGROUP(4, blsp_spi2, blsp_uart2, _, qdss_gpio, _, _, _, _, _),
  780. [5] = PINGROUP(5, blsp_spi2, blsp_uart2, _, qdss_gpio, _, _, _, _, _),
  781. [6] = PINGROUP(6, blsp_spi2, blsp_uart2, blsp_i2c2, char_exec, _, qdss_gpio, _, _, _),
  782. [7] = PINGROUP(7, blsp_spi2, blsp_uart2, blsp_i2c2, char_exec, _, qdss_gpio, _, _, _),
  783. [8] = PINGROUP(8, blsp_spi3, blsp_uart3, ext_dbg, ldo_en, _, _, _, _, _),
  784. [9] = PINGROUP(9, blsp_spi3, blsp_uart3, ext_dbg, _, _, _, _, _, _),
  785. [10] = PINGROUP(10, blsp_spi3, blsp_uart3, blsp_i2c3, ext_dbg, _, _, _, _, _),
  786. [11] = PINGROUP(11, blsp_spi3, blsp_uart3, blsp_i2c3, ext_dbg, gcc_gp3, _, _, _, _),
  787. [12] = PINGROUP(12, pri_mi2s_ws, _, qdss_gpio, _, _, _, _, _, _),
  788. [13] = PINGROUP(13, pri_mi2s, _, qdss_gpio, vsense_trigger, _, _, _, _, _),
  789. [14] = PINGROUP(14, pri_mi2s, _, _, qdss_gpio, native_tsens, bimc_dte0, _, _, _),
  790. [15] = PINGROUP(15, pri_mi2s, _, _, qdss_gpio, bimc_dte1, _, _, _, _),
  791. [16] = PINGROUP(16, sec_mi2s, blsp_spi4, blsp_uart4, qdss_cti, qdss_cti, _, _, qdss_gpio, _),
  792. [17] = PINGROUP(17, sec_mi2s, blsp_spi4, blsp_uart4, qdss_cti, qdss_cti, _, qdss_gpio, _, _),
  793. [18] = PINGROUP(18, sec_mi2s, blsp_spi4, blsp_uart4, blsp_i2c4, gcc_gp1, qdss_gpio, _, _, _),
  794. [19] = PINGROUP(19, sec_mi2s, blsp_spi4, blsp_uart4, blsp_i2c4, jitter_bist, gcc_gp2, _, qdss_gpio, _),
  795. [20] = PINGROUP(20, _, _, _, _, _, _, _, _, _),
  796. [21] = PINGROUP(21, _, _, _, _, _, _, _, _, _),
  797. [22] = PINGROUP(22, blsp_uart4, pll_bist, _, _, _, _, _, _, _),
  798. [23] = PINGROUP(23, blsp_uart4, blsp_spi2, blsp_spi1, blsp_spi3, blsp_spi4, _, _, _, _),
  799. [24] = PINGROUP(24, adsp_ext, _, _, _, _, _, _, _, _),
  800. [25] = PINGROUP(25, adsp_ext, _, _, _, _, _, _, _, _),
  801. [26] = PINGROUP(26, _, _, _, native_char, _, _, _, _, _),
  802. [27] = PINGROUP(27, _, _, _, _, _, _, _, _, _),
  803. [28] = PINGROUP(28, qlink0_wmss, _, _, _, _, _, _, _, _),
  804. [29] = PINGROUP(29, _, _, _, native_tsense, native_char, _, _, _, _),
  805. [30] = PINGROUP(30, _, _, _, _, _, _, _, _, _),
  806. [31] = PINGROUP(31, nav_gpio, _, _, _, _, _, _, _, _),
  807. [32] = PINGROUP(32, nav_gpio, pll_ref, _, _, _, _, _, _, _),
  808. [33] = PINGROUP(33, _, pa_indicator, qdss_gpio, native_char, _, _, _, _, _),
  809. [34] = PINGROUP(34, qlink0_en, _, _, _, _, _, _, _, _),
  810. [35] = PINGROUP(35, qlink0_req, dbg_out, _, _, _, _, _, _, _),
  811. [36] = PINGROUP(36, _, _, cri_trng, _, _, _, _, _, _),
  812. [37] = PINGROUP(37, _, _, _, _, _, _, _, _, _),
  813. [38] = PINGROUP(38, _, _, prng_rosc, _, _, _, _, _, _),
  814. [39] = PINGROUP(39, _, _, _, _, _, _, _, _, _),
  815. [40] = PINGROUP(40, _, _, cri_trng0, _, _, _, _, _, _),
  816. [41] = PINGROUP(41, _, _, cri_trng1, _, _, _, _, _, _),
  817. [42] = PINGROUP(42, _, qdss_gpio, native_char, _, _, _, _, _, _),
  818. [43] = PINGROUP(43, _, _, _, _, _, _, _, _, _),
  819. [44] = PINGROUP(44, coex_uart, _, _, _, _, _, _, _, _),
  820. [45] = PINGROUP(45, coex_uart, ddr_pxi0, _, _, _, _, _, _, _),
  821. [46] = PINGROUP(46, m_voc, ddr_bist, ddr_pxi0, _, _, _, _, _, _),
  822. [47] = PINGROUP(47, ddr_bist, blsp_spi1, blsp_spi2, blsp_spi3, blsp_spi4, _, _, _, _),
  823. [48] = PINGROUP(48, m_voc, blsp_uart1, blsp_uart4, ddr_bist, _, _, _, _, _),
  824. [49] = PINGROUP(49, m_voc, blsp_uart1, blsp_uart4, ddr_bist, _, _, _, _, _),
  825. [50] = PINGROUP(50, _, _, _, _, _, _, _, _, _),
  826. [51] = PINGROUP(51, _, _, _, _, _, _, _, _, _),
  827. [52] = PINGROUP(52, _, _, _, _, _, _, _, _, _),
  828. [53] = PINGROUP(53, pci_e, _, _, _, _, _, _, _, _),
  829. [54] = PINGROUP(54, qdss_cti, qdss_cti, _, _, _, _, _, _, _),
  830. [55] = PINGROUP(55, qdss_cti, qdss_cti, tgu_ch0, _, _, _, _, _, _),
  831. [56] = PINGROUP(56, pcie_clkreq, _, _, _, _, _, _, _, _),
  832. [57] = PINGROUP(57, _, native_char, _, _, _, _, _, _, _),
  833. [58] = PINGROUP(58, _, _, _, _, _, _, _, _, _),
  834. [59] = PINGROUP(59, qdss_cti, m_voc, bimc_dte0, _, _, _, _, _, _),
  835. [60] = PINGROUP(60, qdss_cti, _, m_voc, _, _, _, _, _, _),
  836. [61] = PINGROUP(61, mgpi_clk, qlink2_wmss, bimc_dte1, _, _, _, _, _, _),
  837. [62] = PINGROUP(62, i2s_mclk, audio_ref, blsp_spi1, blsp_spi2, blsp_spi3, blsp_spi4, ldo_update, _, _),
  838. [63] = PINGROUP(63, blsp_uart2, _, qdss_gpio, atest_char, _, _, _, _, _),
  839. [64] = PINGROUP(64, blsp_uart2, qdss_gpio, atest_char3, _, _, _, _, _, _),
  840. [65] = PINGROUP(65, blsp_uart2, blsp_i2c2, qdss_cti, qdss_cti, _, qdss_gpio, atest_char2, _, _),
  841. [66] = PINGROUP(66, blsp_uart2, blsp_i2c2, qdss_cti, qdss_cti, qdss_gpio, atest_char1, _, _, _),
  842. [67] = PINGROUP(67, uim1_data, atest_char0, _, _, _, _, _, _, _),
  843. [68] = PINGROUP(68, uim1_present, _, _, _, _, _, _, _, _),
  844. [69] = PINGROUP(69, uim1_reset, _, _, _, _, _, _, _, _),
  845. [70] = PINGROUP(70, uim1_clk, _, _, _, _, _, _, _, _),
  846. [71] = PINGROUP(71, mgpi_clk, qlink2_en, _, _, _, _, _, _, _),
  847. [72] = PINGROUP(72, qlink1_en, _, native_tsense, _, _, _, _, _, _),
  848. [73] = PINGROUP(73, qlink1_req, _, _, _, _, _, _, _, _),
  849. [74] = PINGROUP(74, qlink1_wmss, _, _, _, _, _, _, _, _),
  850. [75] = PINGROUP(75, coex_uart2, spmi_coex, _, _, _, _, _, _, _),
  851. [76] = PINGROUP(76, coex_uart2, spmi_coex, _, _, _, _, _, _, _),
  852. [77] = PINGROUP(77, _, qlink2_req, _, _, _, _, _, _, _),
  853. [78] = PINGROUP(78, spmi_vgi, _, _, _, _, _, _, _, _),
  854. [79] = PINGROUP(79, spmi_vgi, _, _, _, _, _, _, _, _),
  855. [80] = PINGROUP(80, _, blsp_spi1, _, blsp_uart1, _, _, _, _, _),
  856. [81] = PINGROUP(81, _, blsp_spi1, _, blsp_uart1, gcc_plltest, _, _, _, _),
  857. [82] = PINGROUP(82, _, blsp_spi1, _, blsp_i2c1, gcc_plltest, _, _, _, _),
  858. [83] = PINGROUP(83, _, blsp_spi1, _, blsp_i2c1, _, _, _, _, _),
  859. [84] = PINGROUP(84, _, ebi2_lcd, _, blsp_i2c4, _, _, _, _, _),
  860. [85] = PINGROUP(85, _, ebi2_lcd, _, blsp_i2c4, _, _, _, _, _),
  861. [86] = PINGROUP(86, _, _, _, _, _, _, _, _, _),
  862. [87] = PINGROUP(87, _, _, _, _, _, _, _, _, _),
  863. [88] = PINGROUP(88, _, _, _, _, _, _, _, _, _),
  864. [89] = PINGROUP(89, _, _, _, _, ebi2_a, _, _, _, _),
  865. [90] = PINGROUP(90, _, _, _, _, ebi2_lcd, _, _, _, _),
  866. [91] = PINGROUP(91, _, _, _, _, _, _, _, _, _),
  867. [92] = PINGROUP(92, _, _, _, _, _, _, _, _, _),
  868. [93] = PINGROUP(93, _, _, usb2phy_ac, _, _, _, _, _, _),
  869. [94] = PINGROUP(94, qdss_cti, qdss_cti, _, _, _, _, _, _, _),
  870. [95] = PINGROUP(95, qdss_cti, qdss_cti, _, _, _, _, _, _, _),
  871. [96] = PINGROUP(96, _, _, _, _, _, _, _, _, _),
  872. [97] = PINGROUP(97, _, _, _, _, _, _, _, _, _),
  873. [98] = PINGROUP(98, _, _, _, _, _, _, _, _, _),
  874. [99] = PINGROUP(99, _, _, _, _, _, _, _, _, _),
  875. [100] = PINGROUP(100, _, _, _, _, _, _, _, _, _),
  876. [101] = PINGROUP(101, _, _, _, _, _, _, _, _, _),
  877. [102] = PINGROUP(102, _, _, coex_uart2, _, _, _, _, _, _),
  878. [103] = PINGROUP(103, _, _, coex_uart2, _, _, _, _, _, _),
  879. [104] = PINGROUP(104, _, _, _, _, _, _, _, _, _),
  880. [105] = PINGROUP(105, _, _, _, _, _, _, _, _, _),
  881. [106] = PINGROUP(106, sdc1_tb, _, _, _, _, _, _, _, _),
  882. [107] = PINGROUP(107, _, _, _, _, _, _, _, _, _),
  883. [108] = UFS_RESET(ufs_reset, 0x0),
  884. [109] = SDC_QDSD_PINGROUP(sdc1_rclk, 0x9a000, 15, 0),
  885. [110] = SDC_QDSD_PINGROUP(sdc1_clk, 0x9a000, 13, 6),
  886. [111] = SDC_QDSD_PINGROUP(sdc1_cmd, 0x9a000, 11, 3),
  887. [112] = SDC_QDSD_PINGROUP(sdc1_data, 0x9a000, 9, 0),
  888. };
  889. static const struct msm_gpio_wakeirq_map sdx65_pdc_map[] = {
  890. {1, 20}, {2, 21}, {5, 22}, {6, 23}, {9, 24}, {10, 25},
  891. {11, 26}, {12, 27}, {13, 28}, {14, 29}, {15, 30}, {16, 31},
  892. {17, 32}, {18, 33}, {19, 34}, {21, 35}, {22, 36}, {23, 70},
  893. {24, 37}, {25, 38}, {35, 40}, {43, 41}, {46, 44}, {48, 45},
  894. {49, 57}, {50, 46}, {52, 47}, {54, 49}, {55, 50}, {60, 53},
  895. {61, 54}, {64, 55}, {65, 81}, {68, 56}, {71, 58}, {73, 59},
  896. {77, 77}, {81, 65}, {83, 63}, {84, 64}, {86, 66}, {88, 67},
  897. {89, 68}, {90, 69}, {93, 71}, {94, 72}, {95, 73}, {96, 74},
  898. {99, 75}, {103, 78}, {104, 79}
  899. };
  900. static const struct msm_pinctrl_soc_data sdx65_pinctrl = {
  901. .pins = sdx65_pins,
  902. .npins = ARRAY_SIZE(sdx65_pins),
  903. .functions = sdx65_functions,
  904. .nfunctions = ARRAY_SIZE(sdx65_functions),
  905. .groups = sdx65_groups,
  906. .ngroups = ARRAY_SIZE(sdx65_groups),
  907. .ngpios = 109,
  908. .wakeirq_map = sdx65_pdc_map,
  909. .nwakeirq_map = ARRAY_SIZE(sdx65_pdc_map),
  910. };
  911. static int sdx65_pinctrl_probe(struct platform_device *pdev)
  912. {
  913. return msm_pinctrl_probe(pdev, &sdx65_pinctrl);
  914. }
  915. static const struct of_device_id sdx65_pinctrl_of_match[] = {
  916. { .compatible = "qcom,sdx65-tlmm", },
  917. { },
  918. };
  919. static struct platform_driver sdx65_pinctrl_driver = {
  920. .driver = {
  921. .name = "sdx65-tlmm",
  922. .of_match_table = sdx65_pinctrl_of_match,
  923. },
  924. .probe = sdx65_pinctrl_probe,
  925. .remove_new = msm_pinctrl_remove,
  926. };
  927. static int __init sdx65_pinctrl_init(void)
  928. {
  929. return platform_driver_register(&sdx65_pinctrl_driver);
  930. }
  931. arch_initcall(sdx65_pinctrl_init);
  932. static void __exit sdx65_pinctrl_exit(void)
  933. {
  934. platform_driver_unregister(&sdx65_pinctrl_driver);
  935. }
  936. module_exit(sdx65_pinctrl_exit);
  937. MODULE_DESCRIPTION("QTI sdx65 pinctrl driver");
  938. MODULE_LICENSE("GPL v2");
  939. MODULE_DEVICE_TABLE(of, sdx65_pinctrl_of_match);