pinctrl-sm4450.c 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2023 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_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. .egpio_enable = 12, \
  37. .egpio_present = 11, \
  38. .oe_bit = 9, \
  39. .in_bit = 0, \
  40. .out_bit = 1, \
  41. .intr_enable_bit = 0, \
  42. .intr_status_bit = 0, \
  43. .intr_target_bit = 5, \
  44. .intr_target_kpss_val = 3, \
  45. .intr_raw_status_bit = 4, \
  46. .intr_polarity_bit = 1, \
  47. .intr_detection_bit = 2, \
  48. .intr_detection_width = 2, \
  49. }
  50. #define SDC_QDSD_PINGROUP(pg_name, ctl, pull, drv) \
  51. { \
  52. .grp = PINCTRL_PINGROUP(#pg_name, \
  53. pg_name##_pins, \
  54. ARRAY_SIZE(pg_name##_pins)), \
  55. .ctl_reg = ctl, \
  56. .io_reg = 0, \
  57. .intr_cfg_reg = 0, \
  58. .intr_status_reg = 0, \
  59. .intr_target_reg = 0, \
  60. .mux_bit = -1, \
  61. .pull_bit = pull, \
  62. .drv_bit = drv, \
  63. .oe_bit = -1, \
  64. .in_bit = -1, \
  65. .out_bit = -1, \
  66. .intr_enable_bit = -1, \
  67. .intr_status_bit = -1, \
  68. .intr_target_bit = -1, \
  69. .intr_raw_status_bit = -1, \
  70. .intr_polarity_bit = -1, \
  71. .intr_detection_bit = -1, \
  72. .intr_detection_width = -1, \
  73. }
  74. #define UFS_RESET(pg_name, offset) \
  75. { \
  76. .grp = PINCTRL_PINGROUP(#pg_name, \
  77. pg_name##_pins, \
  78. ARRAY_SIZE(pg_name##_pins)), \
  79. .ctl_reg = offset, \
  80. .io_reg = offset + 0x4, \
  81. .intr_cfg_reg = 0, \
  82. .intr_status_reg = 0, \
  83. .intr_target_reg = 0, \
  84. .mux_bit = -1, \
  85. .pull_bit = 3, \
  86. .drv_bit = 0, \
  87. .oe_bit = -1, \
  88. .in_bit = -1, \
  89. .out_bit = 0, \
  90. .intr_enable_bit = -1, \
  91. .intr_status_bit = -1, \
  92. .intr_target_bit = -1, \
  93. .intr_raw_status_bit = -1, \
  94. .intr_polarity_bit = -1, \
  95. .intr_detection_bit = -1, \
  96. .intr_detection_width = -1, \
  97. }
  98. #define QUP_I3C(qup_mode, qup_offset) \
  99. { \
  100. .mode = qup_mode, \
  101. .offset = qup_offset, \
  102. }
  103. static const struct pinctrl_pin_desc sm4450_pins[] = {
  104. PINCTRL_PIN(0, "GPIO_0"),
  105. PINCTRL_PIN(1, "GPIO_1"),
  106. PINCTRL_PIN(2, "GPIO_2"),
  107. PINCTRL_PIN(3, "GPIO_3"),
  108. PINCTRL_PIN(4, "GPIO_4"),
  109. PINCTRL_PIN(5, "GPIO_5"),
  110. PINCTRL_PIN(6, "GPIO_6"),
  111. PINCTRL_PIN(7, "GPIO_7"),
  112. PINCTRL_PIN(8, "GPIO_8"),
  113. PINCTRL_PIN(9, "GPIO_9"),
  114. PINCTRL_PIN(10, "GPIO_10"),
  115. PINCTRL_PIN(11, "GPIO_11"),
  116. PINCTRL_PIN(12, "GPIO_12"),
  117. PINCTRL_PIN(13, "GPIO_13"),
  118. PINCTRL_PIN(14, "GPIO_14"),
  119. PINCTRL_PIN(15, "GPIO_15"),
  120. PINCTRL_PIN(16, "GPIO_16"),
  121. PINCTRL_PIN(17, "GPIO_17"),
  122. PINCTRL_PIN(18, "GPIO_18"),
  123. PINCTRL_PIN(19, "GPIO_19"),
  124. PINCTRL_PIN(20, "GPIO_20"),
  125. PINCTRL_PIN(21, "GPIO_21"),
  126. PINCTRL_PIN(22, "GPIO_22"),
  127. PINCTRL_PIN(23, "GPIO_23"),
  128. PINCTRL_PIN(24, "GPIO_24"),
  129. PINCTRL_PIN(25, "GPIO_25"),
  130. PINCTRL_PIN(26, "GPIO_26"),
  131. PINCTRL_PIN(27, "GPIO_27"),
  132. PINCTRL_PIN(28, "GPIO_28"),
  133. PINCTRL_PIN(29, "GPIO_29"),
  134. PINCTRL_PIN(30, "GPIO_30"),
  135. PINCTRL_PIN(31, "GPIO_31"),
  136. PINCTRL_PIN(32, "GPIO_32"),
  137. PINCTRL_PIN(33, "GPIO_33"),
  138. PINCTRL_PIN(34, "GPIO_34"),
  139. PINCTRL_PIN(35, "GPIO_35"),
  140. PINCTRL_PIN(36, "GPIO_36"),
  141. PINCTRL_PIN(37, "GPIO_37"),
  142. PINCTRL_PIN(38, "GPIO_38"),
  143. PINCTRL_PIN(39, "GPIO_39"),
  144. PINCTRL_PIN(40, "GPIO_40"),
  145. PINCTRL_PIN(41, "GPIO_41"),
  146. PINCTRL_PIN(42, "GPIO_42"),
  147. PINCTRL_PIN(43, "GPIO_43"),
  148. PINCTRL_PIN(44, "GPIO_44"),
  149. PINCTRL_PIN(45, "GPIO_45"),
  150. PINCTRL_PIN(46, "GPIO_46"),
  151. PINCTRL_PIN(47, "GPIO_47"),
  152. PINCTRL_PIN(48, "GPIO_48"),
  153. PINCTRL_PIN(49, "GPIO_49"),
  154. PINCTRL_PIN(50, "GPIO_50"),
  155. PINCTRL_PIN(51, "GPIO_51"),
  156. PINCTRL_PIN(52, "GPIO_52"),
  157. PINCTRL_PIN(53, "GPIO_53"),
  158. PINCTRL_PIN(54, "GPIO_54"),
  159. PINCTRL_PIN(55, "GPIO_55"),
  160. PINCTRL_PIN(56, "GPIO_56"),
  161. PINCTRL_PIN(57, "GPIO_57"),
  162. PINCTRL_PIN(58, "GPIO_58"),
  163. PINCTRL_PIN(59, "GPIO_59"),
  164. PINCTRL_PIN(60, "GPIO_60"),
  165. PINCTRL_PIN(61, "GPIO_61"),
  166. PINCTRL_PIN(62, "GPIO_62"),
  167. PINCTRL_PIN(63, "GPIO_63"),
  168. PINCTRL_PIN(64, "GPIO_64"),
  169. PINCTRL_PIN(65, "GPIO_65"),
  170. PINCTRL_PIN(66, "GPIO_66"),
  171. PINCTRL_PIN(67, "GPIO_67"),
  172. PINCTRL_PIN(68, "GPIO_68"),
  173. PINCTRL_PIN(69, "GPIO_69"),
  174. PINCTRL_PIN(70, "GPIO_70"),
  175. PINCTRL_PIN(71, "GPIO_71"),
  176. PINCTRL_PIN(72, "GPIO_72"),
  177. PINCTRL_PIN(73, "GPIO_73"),
  178. PINCTRL_PIN(74, "GPIO_74"),
  179. PINCTRL_PIN(75, "GPIO_75"),
  180. PINCTRL_PIN(76, "GPIO_76"),
  181. PINCTRL_PIN(77, "GPIO_77"),
  182. PINCTRL_PIN(78, "GPIO_78"),
  183. PINCTRL_PIN(79, "GPIO_79"),
  184. PINCTRL_PIN(80, "GPIO_80"),
  185. PINCTRL_PIN(81, "GPIO_81"),
  186. PINCTRL_PIN(82, "GPIO_82"),
  187. PINCTRL_PIN(83, "GPIO_83"),
  188. PINCTRL_PIN(84, "GPIO_84"),
  189. PINCTRL_PIN(85, "GPIO_85"),
  190. PINCTRL_PIN(86, "GPIO_86"),
  191. PINCTRL_PIN(87, "GPIO_87"),
  192. PINCTRL_PIN(88, "GPIO_88"),
  193. PINCTRL_PIN(89, "GPIO_89"),
  194. PINCTRL_PIN(90, "GPIO_90"),
  195. PINCTRL_PIN(91, "GPIO_91"),
  196. PINCTRL_PIN(92, "GPIO_92"),
  197. PINCTRL_PIN(93, "GPIO_93"),
  198. PINCTRL_PIN(94, "GPIO_94"),
  199. PINCTRL_PIN(95, "GPIO_95"),
  200. PINCTRL_PIN(96, "GPIO_96"),
  201. PINCTRL_PIN(97, "GPIO_97"),
  202. PINCTRL_PIN(98, "GPIO_98"),
  203. PINCTRL_PIN(99, "GPIO_99"),
  204. PINCTRL_PIN(100, "GPIO_100"),
  205. PINCTRL_PIN(101, "GPIO_101"),
  206. PINCTRL_PIN(102, "GPIO_102"),
  207. PINCTRL_PIN(103, "GPIO_103"),
  208. PINCTRL_PIN(104, "GPIO_104"),
  209. PINCTRL_PIN(105, "GPIO_105"),
  210. PINCTRL_PIN(106, "GPIO_106"),
  211. PINCTRL_PIN(107, "GPIO_107"),
  212. PINCTRL_PIN(108, "GPIO_108"),
  213. PINCTRL_PIN(109, "GPIO_109"),
  214. PINCTRL_PIN(110, "GPIO_110"),
  215. PINCTRL_PIN(111, "GPIO_111"),
  216. PINCTRL_PIN(112, "GPIO_112"),
  217. PINCTRL_PIN(113, "GPIO_113"),
  218. PINCTRL_PIN(114, "GPIO_114"),
  219. PINCTRL_PIN(115, "GPIO_115"),
  220. PINCTRL_PIN(116, "GPIO_116"),
  221. PINCTRL_PIN(117, "GPIO_117"),
  222. PINCTRL_PIN(118, "GPIO_118"),
  223. PINCTRL_PIN(119, "GPIO_119"),
  224. PINCTRL_PIN(120, "GPIO_120"),
  225. PINCTRL_PIN(121, "GPIO_121"),
  226. PINCTRL_PIN(122, "GPIO_122"),
  227. PINCTRL_PIN(123, "GPIO_123"),
  228. PINCTRL_PIN(124, "GPIO_124"),
  229. PINCTRL_PIN(125, "GPIO_125"),
  230. PINCTRL_PIN(126, "GPIO_126"),
  231. PINCTRL_PIN(127, "GPIO_127"),
  232. PINCTRL_PIN(128, "GPIO_128"),
  233. PINCTRL_PIN(129, "GPIO_129"),
  234. PINCTRL_PIN(130, "GPIO_130"),
  235. PINCTRL_PIN(131, "GPIO_131"),
  236. PINCTRL_PIN(132, "GPIO_132"),
  237. PINCTRL_PIN(133, "GPIO_133"),
  238. PINCTRL_PIN(134, "GPIO_134"),
  239. PINCTRL_PIN(135, "GPIO_135"),
  240. PINCTRL_PIN(136, "UFS_RESET"),
  241. PINCTRL_PIN(137, "SDC1_RCLK"),
  242. PINCTRL_PIN(138, "SDC1_CLK"),
  243. PINCTRL_PIN(139, "SDC1_CMD"),
  244. PINCTRL_PIN(140, "SDC1_DATA"),
  245. PINCTRL_PIN(141, "SDC2_CLK"),
  246. PINCTRL_PIN(142, "SDC2_CMD"),
  247. PINCTRL_PIN(143, "SDC2_DATA"),
  248. };
  249. #define DECLARE_MSM_GPIO_PINS(pin) \
  250. static const unsigned int gpio##pin##_pins[] = { pin }
  251. DECLARE_MSM_GPIO_PINS(0);
  252. DECLARE_MSM_GPIO_PINS(1);
  253. DECLARE_MSM_GPIO_PINS(2);
  254. DECLARE_MSM_GPIO_PINS(3);
  255. DECLARE_MSM_GPIO_PINS(4);
  256. DECLARE_MSM_GPIO_PINS(5);
  257. DECLARE_MSM_GPIO_PINS(6);
  258. DECLARE_MSM_GPIO_PINS(7);
  259. DECLARE_MSM_GPIO_PINS(8);
  260. DECLARE_MSM_GPIO_PINS(9);
  261. DECLARE_MSM_GPIO_PINS(10);
  262. DECLARE_MSM_GPIO_PINS(11);
  263. DECLARE_MSM_GPIO_PINS(12);
  264. DECLARE_MSM_GPIO_PINS(13);
  265. DECLARE_MSM_GPIO_PINS(14);
  266. DECLARE_MSM_GPIO_PINS(15);
  267. DECLARE_MSM_GPIO_PINS(16);
  268. DECLARE_MSM_GPIO_PINS(17);
  269. DECLARE_MSM_GPIO_PINS(18);
  270. DECLARE_MSM_GPIO_PINS(19);
  271. DECLARE_MSM_GPIO_PINS(20);
  272. DECLARE_MSM_GPIO_PINS(21);
  273. DECLARE_MSM_GPIO_PINS(22);
  274. DECLARE_MSM_GPIO_PINS(23);
  275. DECLARE_MSM_GPIO_PINS(24);
  276. DECLARE_MSM_GPIO_PINS(25);
  277. DECLARE_MSM_GPIO_PINS(26);
  278. DECLARE_MSM_GPIO_PINS(27);
  279. DECLARE_MSM_GPIO_PINS(28);
  280. DECLARE_MSM_GPIO_PINS(29);
  281. DECLARE_MSM_GPIO_PINS(30);
  282. DECLARE_MSM_GPIO_PINS(31);
  283. DECLARE_MSM_GPIO_PINS(32);
  284. DECLARE_MSM_GPIO_PINS(33);
  285. DECLARE_MSM_GPIO_PINS(34);
  286. DECLARE_MSM_GPIO_PINS(35);
  287. DECLARE_MSM_GPIO_PINS(36);
  288. DECLARE_MSM_GPIO_PINS(37);
  289. DECLARE_MSM_GPIO_PINS(38);
  290. DECLARE_MSM_GPIO_PINS(39);
  291. DECLARE_MSM_GPIO_PINS(40);
  292. DECLARE_MSM_GPIO_PINS(41);
  293. DECLARE_MSM_GPIO_PINS(42);
  294. DECLARE_MSM_GPIO_PINS(43);
  295. DECLARE_MSM_GPIO_PINS(44);
  296. DECLARE_MSM_GPIO_PINS(45);
  297. DECLARE_MSM_GPIO_PINS(46);
  298. DECLARE_MSM_GPIO_PINS(47);
  299. DECLARE_MSM_GPIO_PINS(48);
  300. DECLARE_MSM_GPIO_PINS(49);
  301. DECLARE_MSM_GPIO_PINS(50);
  302. DECLARE_MSM_GPIO_PINS(51);
  303. DECLARE_MSM_GPIO_PINS(52);
  304. DECLARE_MSM_GPIO_PINS(53);
  305. DECLARE_MSM_GPIO_PINS(54);
  306. DECLARE_MSM_GPIO_PINS(55);
  307. DECLARE_MSM_GPIO_PINS(56);
  308. DECLARE_MSM_GPIO_PINS(57);
  309. DECLARE_MSM_GPIO_PINS(58);
  310. DECLARE_MSM_GPIO_PINS(59);
  311. DECLARE_MSM_GPIO_PINS(60);
  312. DECLARE_MSM_GPIO_PINS(61);
  313. DECLARE_MSM_GPIO_PINS(62);
  314. DECLARE_MSM_GPIO_PINS(63);
  315. DECLARE_MSM_GPIO_PINS(64);
  316. DECLARE_MSM_GPIO_PINS(65);
  317. DECLARE_MSM_GPIO_PINS(66);
  318. DECLARE_MSM_GPIO_PINS(67);
  319. DECLARE_MSM_GPIO_PINS(68);
  320. DECLARE_MSM_GPIO_PINS(69);
  321. DECLARE_MSM_GPIO_PINS(70);
  322. DECLARE_MSM_GPIO_PINS(71);
  323. DECLARE_MSM_GPIO_PINS(72);
  324. DECLARE_MSM_GPIO_PINS(73);
  325. DECLARE_MSM_GPIO_PINS(74);
  326. DECLARE_MSM_GPIO_PINS(75);
  327. DECLARE_MSM_GPIO_PINS(76);
  328. DECLARE_MSM_GPIO_PINS(77);
  329. DECLARE_MSM_GPIO_PINS(78);
  330. DECLARE_MSM_GPIO_PINS(79);
  331. DECLARE_MSM_GPIO_PINS(80);
  332. DECLARE_MSM_GPIO_PINS(81);
  333. DECLARE_MSM_GPIO_PINS(82);
  334. DECLARE_MSM_GPIO_PINS(83);
  335. DECLARE_MSM_GPIO_PINS(84);
  336. DECLARE_MSM_GPIO_PINS(85);
  337. DECLARE_MSM_GPIO_PINS(86);
  338. DECLARE_MSM_GPIO_PINS(87);
  339. DECLARE_MSM_GPIO_PINS(88);
  340. DECLARE_MSM_GPIO_PINS(89);
  341. DECLARE_MSM_GPIO_PINS(90);
  342. DECLARE_MSM_GPIO_PINS(91);
  343. DECLARE_MSM_GPIO_PINS(92);
  344. DECLARE_MSM_GPIO_PINS(93);
  345. DECLARE_MSM_GPIO_PINS(94);
  346. DECLARE_MSM_GPIO_PINS(95);
  347. DECLARE_MSM_GPIO_PINS(96);
  348. DECLARE_MSM_GPIO_PINS(97);
  349. DECLARE_MSM_GPIO_PINS(98);
  350. DECLARE_MSM_GPIO_PINS(99);
  351. DECLARE_MSM_GPIO_PINS(100);
  352. DECLARE_MSM_GPIO_PINS(101);
  353. DECLARE_MSM_GPIO_PINS(102);
  354. DECLARE_MSM_GPIO_PINS(103);
  355. DECLARE_MSM_GPIO_PINS(104);
  356. DECLARE_MSM_GPIO_PINS(105);
  357. DECLARE_MSM_GPIO_PINS(106);
  358. DECLARE_MSM_GPIO_PINS(107);
  359. DECLARE_MSM_GPIO_PINS(108);
  360. DECLARE_MSM_GPIO_PINS(109);
  361. DECLARE_MSM_GPIO_PINS(110);
  362. DECLARE_MSM_GPIO_PINS(111);
  363. DECLARE_MSM_GPIO_PINS(112);
  364. DECLARE_MSM_GPIO_PINS(113);
  365. DECLARE_MSM_GPIO_PINS(114);
  366. DECLARE_MSM_GPIO_PINS(115);
  367. DECLARE_MSM_GPIO_PINS(116);
  368. DECLARE_MSM_GPIO_PINS(117);
  369. DECLARE_MSM_GPIO_PINS(118);
  370. DECLARE_MSM_GPIO_PINS(119);
  371. DECLARE_MSM_GPIO_PINS(120);
  372. DECLARE_MSM_GPIO_PINS(121);
  373. DECLARE_MSM_GPIO_PINS(122);
  374. DECLARE_MSM_GPIO_PINS(123);
  375. DECLARE_MSM_GPIO_PINS(124);
  376. DECLARE_MSM_GPIO_PINS(125);
  377. DECLARE_MSM_GPIO_PINS(126);
  378. DECLARE_MSM_GPIO_PINS(127);
  379. DECLARE_MSM_GPIO_PINS(128);
  380. DECLARE_MSM_GPIO_PINS(129);
  381. DECLARE_MSM_GPIO_PINS(130);
  382. DECLARE_MSM_GPIO_PINS(131);
  383. DECLARE_MSM_GPIO_PINS(132);
  384. DECLARE_MSM_GPIO_PINS(133);
  385. DECLARE_MSM_GPIO_PINS(134);
  386. DECLARE_MSM_GPIO_PINS(135);
  387. static const unsigned int ufs_reset_pins[] = { 136 };
  388. static const unsigned int sdc1_rclk_pins[] = { 137 };
  389. static const unsigned int sdc1_clk_pins[] = { 138 };
  390. static const unsigned int sdc1_cmd_pins[] = { 139 };
  391. static const unsigned int sdc1_data_pins[] = { 140 };
  392. static const unsigned int sdc2_clk_pins[] = { 141 };
  393. static const unsigned int sdc2_cmd_pins[] = { 142 };
  394. static const unsigned int sdc2_data_pins[] = { 143 };
  395. enum sm4450_functions {
  396. msm_mux_gpio,
  397. msm_mux_atest_char,
  398. msm_mux_atest_usb0,
  399. msm_mux_audio_ref_clk,
  400. msm_mux_cam_mclk,
  401. msm_mux_cci_async_in0,
  402. msm_mux_cci_i2c,
  403. msm_mux_cci,
  404. msm_mux_cmu_rng,
  405. msm_mux_coex_uart1_rx,
  406. msm_mux_coex_uart1_tx,
  407. msm_mux_cri_trng,
  408. msm_mux_dbg_out_clk,
  409. msm_mux_ddr_bist,
  410. msm_mux_ddr_pxi0_test,
  411. msm_mux_ddr_pxi1_test,
  412. msm_mux_gcc_gp1_clk,
  413. msm_mux_gcc_gp2_clk,
  414. msm_mux_gcc_gp3_clk,
  415. msm_mux_host2wlan_sol,
  416. msm_mux_ibi_i3c_qup0,
  417. msm_mux_ibi_i3c_qup1,
  418. msm_mux_jitter_bist_ref,
  419. msm_mux_mdp_vsync0_out,
  420. msm_mux_mdp_vsync1_out,
  421. msm_mux_mdp_vsync2_out,
  422. msm_mux_mdp_vsync3_out,
  423. msm_mux_mdp_vsync,
  424. msm_mux_nav,
  425. msm_mux_pcie0_clk_req,
  426. msm_mux_phase_flag,
  427. msm_mux_pll_bist_sync,
  428. msm_mux_pll_clk_aux,
  429. msm_mux_prng_rosc,
  430. msm_mux_qdss_cti_trig0,
  431. msm_mux_qdss_cti_trig1,
  432. msm_mux_qdss_gpio,
  433. msm_mux_qlink0_enable,
  434. msm_mux_qlink0_request,
  435. msm_mux_qlink0_wmss_reset,
  436. msm_mux_qup0_se0,
  437. msm_mux_qup0_se1,
  438. msm_mux_qup0_se2,
  439. msm_mux_qup0_se3,
  440. msm_mux_qup0_se4,
  441. msm_mux_qup1_se0,
  442. msm_mux_qup1_se1,
  443. msm_mux_qup1_se2,
  444. msm_mux_qup1_se3,
  445. msm_mux_qup1_se4,
  446. msm_mux_sd_write_protect,
  447. msm_mux_tb_trig_sdc1,
  448. msm_mux_tb_trig_sdc2,
  449. msm_mux_tgu_ch0_trigout,
  450. msm_mux_tgu_ch1_trigout,
  451. msm_mux_tgu_ch2_trigout,
  452. msm_mux_tgu_ch3_trigout,
  453. msm_mux_tmess_prng,
  454. msm_mux_tsense_pwm1_out,
  455. msm_mux_tsense_pwm2_out,
  456. msm_mux_uim0,
  457. msm_mux_uim1,
  458. msm_mux_usb0_hs_ac,
  459. msm_mux_usb0_phy_ps,
  460. msm_mux_vfr_0_mira,
  461. msm_mux_vfr_0_mirb,
  462. msm_mux_vfr_1,
  463. msm_mux_vsense_trigger_mirnat,
  464. msm_mux_wlan1_adc_dtest0,
  465. msm_mux_wlan1_adc_dtest1,
  466. msm_mux__,
  467. };
  468. static const char * const gpio_groups[] = {
  469. "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7",
  470. "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14",
  471. "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21",
  472. "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28",
  473. "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35",
  474. "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42",
  475. "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49",
  476. "gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56",
  477. "gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63",
  478. "gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70",
  479. "gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77",
  480. "gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84",
  481. "gpio85", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", "gpio91",
  482. "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98",
  483. "gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104",
  484. "gpio105", "gpio106", "gpio107", "gpio108", "gpio109", "gpio110",
  485. "gpio111", "gpio112", "gpio113", "gpio114", "gpio115", "gpio116",
  486. "gpio117", "gpio118", "gpio119", "gpio120", "gpio121", "gpio122",
  487. "gpio123", "gpio124", "gpio125", "gpio126", "gpio127", "gpio128",
  488. "gpio129", "gpio130", "gpio131", "gpio132", "gpio133", "gpio134",
  489. "gpio135",
  490. };
  491. static const char * const atest_char_groups[] = {
  492. "gpio95", "gpio97", "gpio98", "gpio99", "gpio100",
  493. };
  494. static const char * const atest_usb0_groups[] = {
  495. "gpio75", "gpio10", "gpio78", "gpio79", "gpio80",
  496. };
  497. static const char * const audio_ref_clk_groups[] = {
  498. "gpio71",
  499. };
  500. static const char * const cam_mclk_groups[] = {
  501. "gpio36", "gpio37", "gpio38", "gpio39",
  502. };
  503. static const char * const cci_async_in0_groups[] = {
  504. "gpio40",
  505. };
  506. static const char * const cci_i2c_groups[] = {
  507. "gpio45", "gpio47", "gpio49", "gpio44",
  508. "gpio46", "gpio48",
  509. };
  510. static const char * const cci_groups[] = {
  511. "gpio40", "gpio41", "gpio42", "gpio43",
  512. };
  513. static const char * const cmu_rng_groups[] = {
  514. "gpio28", "gpio3", "gpio1", "gpio0",
  515. };
  516. static const char * const coex_uart1_rx_groups[] = {
  517. "gpio54",
  518. };
  519. static const char * const coex_uart1_tx_groups[] = {
  520. "gpio55",
  521. };
  522. static const char * const cri_trng_groups[] = {
  523. "gpio42", "gpio40", "gpio41",
  524. };
  525. static const char * const dbg_out_clk_groups[] = {
  526. "gpio80",
  527. };
  528. static const char * const ddr_bist_groups[] = {
  529. "gpio32", "gpio29", "gpio30", "gpio31",
  530. };
  531. static const char * const ddr_pxi0_test_groups[] = {
  532. "gpio90", "gpio127",
  533. };
  534. static const char * const ddr_pxi1_test_groups[] = {
  535. "gpio118", "gpio122",
  536. };
  537. static const char * const gcc_gp1_clk_groups[] = {
  538. "gpio37", "gpio48",
  539. };
  540. static const char * const gcc_gp2_clk_groups[] = {
  541. "gpio30", "gpio49",
  542. };
  543. static const char * const gcc_gp3_clk_groups[] = {
  544. "gpio3", "gpio50",
  545. };
  546. static const char * const host2wlan_sol_groups[] = {
  547. "gpio106",
  548. };
  549. static const char * const ibi_i3c_qup0_groups[] = {
  550. "gpio4", "gpio5",
  551. };
  552. static const char * const ibi_i3c_qup1_groups[] = {
  553. "gpio0", "gpio1",
  554. };
  555. static const char * const jitter_bist_ref_groups[] = {
  556. "gpio90",
  557. };
  558. static const char * const mdp_vsync0_out_groups[] = {
  559. "gpio93",
  560. };
  561. static const char * const mdp_vsync1_out_groups[] = {
  562. "gpio93",
  563. };
  564. static const char * const mdp_vsync2_out_groups[] = {
  565. "gpio22",
  566. };
  567. static const char * const mdp_vsync3_out_groups[] = {
  568. "gpio22",
  569. };
  570. static const char * const mdp_vsync_groups[] = {
  571. "gpio26", "gpio22", "gpio30", "gpio34", "gpio93", "gpio97",
  572. };
  573. static const char * const nav_groups[] = {
  574. "gpio81", "gpio83", "gpio84",
  575. };
  576. static const char * const pcie0_clk_req_groups[] = {
  577. "gpio107",
  578. };
  579. static const char * const phase_flag_groups[] = {
  580. "gpio7", "gpio8", "gpio9", "gpio11", "gpio13", "gpio14", "gpio15",
  581. "gpio17", "gpio18", "gpio19", "gpio21", "gpio24", "gpio25", "gpio31",
  582. "gpio32", "gpio33", "gpio35", "gpio61", "gpio72", "gpio82", "gpio91",
  583. "gpio95", "gpio97", "gpio98", "gpio99", "gpio100", "gpio105", "gpio115",
  584. "gpio116", "gpio117", "gpio133", "gpio135",
  585. };
  586. static const char * const pll_bist_sync_groups[] = {
  587. "gpio73",
  588. };
  589. static const char * const pll_clk_aux_groups[] = {
  590. "gpio108",
  591. };
  592. static const char * const prng_rosc_groups[] = {
  593. "gpio36", "gpio37", "gpio38", "gpio39",
  594. };
  595. static const char * const qdss_cti_trig0_groups[] = {
  596. "gpio26", "gpio60", "gpio113", "gpio114",
  597. };
  598. static const char * const qdss_cti_trig1_groups[] = {
  599. "gpio6", "gpio27", "gpio57", "gpio58",
  600. };
  601. static const char * const qdss_gpio_groups[] = {
  602. "gpio0", "gpio1", "gpio3", "gpio4", "gpio5", "gpio7", "gpio8",
  603. "gpio9", "gpio14", "gpio15", "gpio17", "gpio23", "gpio31", "gpio32",
  604. "gpio33", "gpio35", "gpio36", "gpio37", "gpio38", "gpio39", "gpio40",
  605. "gpio41", "gpio42", "gpio43", "gpio44", "gpio45", "gpio46", "gpio47",
  606. "gpio49", "gpio59", "gpio62", "gpio118", "gpio121", "gpio122", "gpio126",
  607. "gpio127",
  608. };
  609. static const char * const qlink0_enable_groups[] = {
  610. "gpio88",
  611. };
  612. static const char * const qlink0_request_groups[] = {
  613. "gpio87",
  614. };
  615. static const char * const qlink0_wmss_reset_groups[] = {
  616. "gpio89",
  617. };
  618. static const char * const qup0_se0_groups[] = {
  619. "gpio4", "gpio5", "gpio34", "gpio35",
  620. };
  621. static const char * const qup0_se1_groups[] = {
  622. "gpio10", "gpio11", "gpio12", "gpio13",
  623. };
  624. static const char * const qup0_se2_groups[] = {
  625. "gpio14", "gpio15", "gpio16", "gpio17",
  626. };
  627. static const char * const qup0_se3_groups[] = {
  628. "gpio18", "gpio19", "gpio20", "gpio21",
  629. };
  630. static const char * const qup0_se4_groups[] = {
  631. "gpio6", "gpio7", "gpio8", "gpio9",
  632. "gpio26", "gpio27", "gpio34",
  633. };
  634. static const char * const qup1_se0_groups[] = {
  635. "gpio0", "gpio1", "gpio2", "gpio3",
  636. };
  637. static const char * const qup1_se1_groups[] = {
  638. "gpio26", "gpio27", "gpio50", "gpio51",
  639. };
  640. static const char * const qup1_se2_groups[] = {
  641. "gpio22", "gpio23", "gpio31", "gpio32",
  642. };
  643. static const char * const qup1_se3_groups[] = {
  644. "gpio24", "gpio25", "gpio51", "gpio50",
  645. };
  646. static const char * const qup1_se4_groups[] = {
  647. "gpio43", "gpio48", "gpio49", "gpio90",
  648. "gpio91",
  649. };
  650. static const char * const sd_write_protect_groups[] = {
  651. "gpio102",
  652. };
  653. static const char * const tb_trig_sdc1_groups[] = {
  654. "gpio128",
  655. };
  656. static const char * const tb_trig_sdc2_groups[] = {
  657. "gpio51",
  658. };
  659. static const char * const tgu_ch0_trigout_groups[] = {
  660. "gpio20",
  661. };
  662. static const char * const tgu_ch1_trigout_groups[] = {
  663. "gpio21",
  664. };
  665. static const char * const tgu_ch2_trigout_groups[] = {
  666. "gpio22",
  667. };
  668. static const char * const tgu_ch3_trigout_groups[] = {
  669. "gpio23",
  670. };
  671. static const char * const tmess_prng_groups[] = {
  672. "gpio57", "gpio58", "gpio59", "gpio60",
  673. };
  674. static const char * const tsense_pwm1_out_groups[] = {
  675. "gpio134",
  676. };
  677. static const char * const tsense_pwm2_out_groups[] = {
  678. "gpio134",
  679. };
  680. static const char * const uim0_groups[] = {
  681. "gpio64", "gpio63", "gpio66", "gpio65",
  682. };
  683. static const char * const uim1_groups[] = {
  684. "gpio68", "gpio67", "gpio69", "gpio70",
  685. };
  686. static const char * const usb0_hs_ac_groups[] = {
  687. "gpio99",
  688. };
  689. static const char * const usb0_phy_ps_groups[] = {
  690. "gpio94",
  691. };
  692. static const char * const vfr_0_mira_groups[] = {
  693. "gpio19",
  694. };
  695. static const char * const vfr_0_mirb_groups[] = {
  696. "gpio100",
  697. };
  698. static const char * const vfr_1_groups[] = {
  699. "gpio84",
  700. };
  701. static const char * const vsense_trigger_mirnat_groups[] = {
  702. "gpio75",
  703. };
  704. static const char * const wlan1_adc_dtest0_groups[] = {
  705. "gpio79",
  706. };
  707. static const char * const wlan1_adc_dtest1_groups[] = {
  708. "gpio80",
  709. };
  710. static const struct pinfunction sm4450_functions[] = {
  711. MSM_PIN_FUNCTION(gpio),
  712. MSM_PIN_FUNCTION(atest_char),
  713. MSM_PIN_FUNCTION(atest_usb0),
  714. MSM_PIN_FUNCTION(audio_ref_clk),
  715. MSM_PIN_FUNCTION(cam_mclk),
  716. MSM_PIN_FUNCTION(cci_async_in0),
  717. MSM_PIN_FUNCTION(cci_i2c),
  718. MSM_PIN_FUNCTION(cci),
  719. MSM_PIN_FUNCTION(cmu_rng),
  720. MSM_PIN_FUNCTION(coex_uart1_rx),
  721. MSM_PIN_FUNCTION(coex_uart1_tx),
  722. MSM_PIN_FUNCTION(cri_trng),
  723. MSM_PIN_FUNCTION(dbg_out_clk),
  724. MSM_PIN_FUNCTION(ddr_bist),
  725. MSM_PIN_FUNCTION(ddr_pxi0_test),
  726. MSM_PIN_FUNCTION(ddr_pxi1_test),
  727. MSM_PIN_FUNCTION(gcc_gp1_clk),
  728. MSM_PIN_FUNCTION(gcc_gp2_clk),
  729. MSM_PIN_FUNCTION(gcc_gp3_clk),
  730. MSM_PIN_FUNCTION(host2wlan_sol),
  731. MSM_PIN_FUNCTION(ibi_i3c_qup0),
  732. MSM_PIN_FUNCTION(ibi_i3c_qup1),
  733. MSM_PIN_FUNCTION(jitter_bist_ref),
  734. MSM_PIN_FUNCTION(mdp_vsync0_out),
  735. MSM_PIN_FUNCTION(mdp_vsync1_out),
  736. MSM_PIN_FUNCTION(mdp_vsync2_out),
  737. MSM_PIN_FUNCTION(mdp_vsync3_out),
  738. MSM_PIN_FUNCTION(mdp_vsync),
  739. MSM_PIN_FUNCTION(nav),
  740. MSM_PIN_FUNCTION(pcie0_clk_req),
  741. MSM_PIN_FUNCTION(phase_flag),
  742. MSM_PIN_FUNCTION(pll_bist_sync),
  743. MSM_PIN_FUNCTION(pll_clk_aux),
  744. MSM_PIN_FUNCTION(prng_rosc),
  745. MSM_PIN_FUNCTION(qdss_cti_trig0),
  746. MSM_PIN_FUNCTION(qdss_cti_trig1),
  747. MSM_PIN_FUNCTION(qdss_gpio),
  748. MSM_PIN_FUNCTION(qlink0_enable),
  749. MSM_PIN_FUNCTION(qlink0_request),
  750. MSM_PIN_FUNCTION(qlink0_wmss_reset),
  751. MSM_PIN_FUNCTION(qup0_se0),
  752. MSM_PIN_FUNCTION(qup0_se1),
  753. MSM_PIN_FUNCTION(qup0_se2),
  754. MSM_PIN_FUNCTION(qup0_se3),
  755. MSM_PIN_FUNCTION(qup0_se4),
  756. MSM_PIN_FUNCTION(qup1_se0),
  757. MSM_PIN_FUNCTION(qup1_se1),
  758. MSM_PIN_FUNCTION(qup1_se2),
  759. MSM_PIN_FUNCTION(qup1_se3),
  760. MSM_PIN_FUNCTION(qup1_se4),
  761. MSM_PIN_FUNCTION(sd_write_protect),
  762. MSM_PIN_FUNCTION(tb_trig_sdc1),
  763. MSM_PIN_FUNCTION(tb_trig_sdc2),
  764. MSM_PIN_FUNCTION(tgu_ch0_trigout),
  765. MSM_PIN_FUNCTION(tgu_ch1_trigout),
  766. MSM_PIN_FUNCTION(tgu_ch2_trigout),
  767. MSM_PIN_FUNCTION(tgu_ch3_trigout),
  768. MSM_PIN_FUNCTION(tmess_prng),
  769. MSM_PIN_FUNCTION(tsense_pwm1_out),
  770. MSM_PIN_FUNCTION(tsense_pwm2_out),
  771. MSM_PIN_FUNCTION(uim0),
  772. MSM_PIN_FUNCTION(uim1),
  773. MSM_PIN_FUNCTION(usb0_hs_ac),
  774. MSM_PIN_FUNCTION(usb0_phy_ps),
  775. MSM_PIN_FUNCTION(vfr_0_mira),
  776. MSM_PIN_FUNCTION(vfr_0_mirb),
  777. MSM_PIN_FUNCTION(vfr_1),
  778. MSM_PIN_FUNCTION(vsense_trigger_mirnat),
  779. MSM_PIN_FUNCTION(wlan1_adc_dtest0),
  780. MSM_PIN_FUNCTION(wlan1_adc_dtest1),
  781. };
  782. /*
  783. * Every pin is maintained as a single group, and missing or non-existing pin
  784. * would be maintained as dummy group to synchronize pin group index with
  785. * pin descriptor registered with pinctrl core.
  786. * Clients would not be able to request these dummy pin groups.
  787. */
  788. static const struct msm_pingroup sm4450_groups[] = {
  789. [0] = PINGROUP(0, qup1_se0, ibi_i3c_qup1, cmu_rng, qdss_gpio, _, _, _, _, _),
  790. [1] = PINGROUP(1, qup1_se0, ibi_i3c_qup1, cmu_rng, qdss_gpio, _, _, _, _, _),
  791. [2] = PINGROUP(2, qup1_se0, _, _, _, _, _, _, _, _),
  792. [3] = PINGROUP(3, qup1_se0, gcc_gp3_clk, cmu_rng, qdss_gpio, _, _, _, _, _),
  793. [4] = PINGROUP(4, qup0_se0, ibi_i3c_qup0, qdss_gpio, _, _, _, _, _, _),
  794. [5] = PINGROUP(5, qup0_se0, ibi_i3c_qup0, qdss_gpio, _, _, _, _, _, _),
  795. [6] = PINGROUP(6, qup0_se4, qdss_cti_trig1, _, _, _, _, _, _, _),
  796. [7] = PINGROUP(7, qup0_se4, _, phase_flag, qdss_gpio, _, _, _, _, _),
  797. [8] = PINGROUP(8, qup0_se4, _, phase_flag, qdss_gpio, _, _, _, _, _),
  798. [9] = PINGROUP(9, qup0_se4, _, phase_flag, qdss_gpio, _, _, _, _, _),
  799. [10] = PINGROUP(10, qup0_se1, _, atest_usb0, _, _, _, _, _, _),
  800. [11] = PINGROUP(11, qup0_se1, _, phase_flag, _, _, _, _, _, _),
  801. [12] = PINGROUP(12, qup0_se1, _, _, _, _, _, _, _, _),
  802. [13] = PINGROUP(13, qup0_se1, _, phase_flag, _, _, _, _, _, _),
  803. [14] = PINGROUP(14, qup0_se2, _, phase_flag, _, qdss_gpio, _, _, _, _),
  804. [15] = PINGROUP(15, qup0_se2, _, phase_flag, _, qdss_gpio, _, _, _, _),
  805. [16] = PINGROUP(16, qup0_se2, _, _, _, _, _, _, _, _),
  806. [17] = PINGROUP(17, qup0_se2, _, phase_flag, _, qdss_gpio, _, _, _, _),
  807. [18] = PINGROUP(18, qup0_se3, _, phase_flag, _, _, _, _, _, _),
  808. [19] = PINGROUP(19, qup0_se3, vfr_0_mira, _, phase_flag, _, _, _, _, _),
  809. [20] = PINGROUP(20, qup0_se3, tgu_ch0_trigout, _, _, _, _, _, _, _),
  810. [21] = PINGROUP(21, qup0_se3, _, phase_flag, tgu_ch1_trigout, _, _, _, _, _),
  811. [22] = PINGROUP(22, qup1_se2, mdp_vsync, mdp_vsync2_out, mdp_vsync3_out, tgu_ch2_trigout, _, _, _, _),
  812. [23] = PINGROUP(23, qup1_se2, tgu_ch3_trigout, qdss_gpio, _, _, _, _, _, _),
  813. [24] = PINGROUP(24, qup1_se3, _, phase_flag, _, _, _, _, _, _),
  814. [25] = PINGROUP(25, qup1_se3, _, phase_flag, _, _, _, _, _, _),
  815. [26] = PINGROUP(26, qup1_se1, mdp_vsync, qup0_se4, qdss_cti_trig0, _, _, _, _, _),
  816. [27] = PINGROUP(27, qup1_se1, qup0_se4, qdss_cti_trig1, _, _, _, _, _, _),
  817. [28] = PINGROUP(28, cmu_rng, _, _, _, _, _, _, _, _),
  818. [29] = PINGROUP(29, ddr_bist, _, _, _, _, _, _, _, _),
  819. [30] = PINGROUP(30, mdp_vsync, gcc_gp2_clk, ddr_bist, _, _, _, _, _, _),
  820. [31] = PINGROUP(31, qup1_se2, _, phase_flag, ddr_bist, qdss_gpio, _, _, _, _),
  821. [32] = PINGROUP(32, qup1_se2, _, phase_flag, ddr_bist, qdss_gpio, _, _, _, _),
  822. [33] = PINGROUP(33, _, phase_flag, qdss_gpio, _, _, _, _, _, _),
  823. [34] = PINGROUP(34, qup0_se0, qup0_se4, mdp_vsync, _, _, _, _, _, _),
  824. [35] = PINGROUP(35, qup0_se0, _, phase_flag, qdss_gpio, _, _, _, _, _),
  825. [36] = PINGROUP(36, cam_mclk, prng_rosc, qdss_gpio, _, _, _, _, _, _),
  826. [37] = PINGROUP(37, cam_mclk, gcc_gp1_clk, prng_rosc, qdss_gpio, _, _, _, _, _),
  827. [38] = PINGROUP(38, cam_mclk, prng_rosc, qdss_gpio, _, _, _, _, _, _),
  828. [39] = PINGROUP(39, cam_mclk, prng_rosc, qdss_gpio, _, _, _, _, _, _),
  829. [40] = PINGROUP(40, cci, cci_async_in0, cri_trng, qdss_gpio, _, _, _, _, _),
  830. [41] = PINGROUP(41, cci, cri_trng, qdss_gpio, _, _, _, _, _, _),
  831. [42] = PINGROUP(42, cci, cri_trng, qdss_gpio, _, _, _, _, _, _),
  832. [43] = PINGROUP(43, cci, qup1_se4, qdss_gpio, _, _, _, _, _, _),
  833. [44] = PINGROUP(44, cci_i2c, qdss_gpio, _, _, _, _, _, _, _),
  834. [45] = PINGROUP(45, cci_i2c, qdss_gpio, _, _, _, _, _, _, _),
  835. [46] = PINGROUP(46, cci_i2c, qdss_gpio, _, _, _, _, _, _, _),
  836. [47] = PINGROUP(47, cci_i2c, qdss_gpio, _, _, _, _, _, _, _),
  837. [48] = PINGROUP(48, cci_i2c, qup1_se4, gcc_gp1_clk, _, _, _, _, _, _),
  838. [49] = PINGROUP(49, cci_i2c, qup1_se4, gcc_gp2_clk, qdss_gpio, _, _, _, _, _),
  839. [50] = PINGROUP(50, qup1_se1, qup1_se3, _, gcc_gp3_clk, _, _, _, _, _),
  840. [51] = PINGROUP(51, qup1_se1, qup1_se3, _, tb_trig_sdc2, _, _, _, _, _),
  841. [52] = PINGROUP(52, _, _, _, _, _, _, _, _, _),
  842. [53] = PINGROUP(53, _, _, _, _, _, _, _, _, _),
  843. [54] = PINGROUP(54, coex_uart1_rx, _, _, _, _, _, _, _, _),
  844. [55] = PINGROUP(55, coex_uart1_tx, _, _, _, _, _, _, _, _),
  845. [56] = PINGROUP(56, _, _, _, _, _, _, _, _, _),
  846. [57] = PINGROUP(57, tmess_prng, qdss_cti_trig1, _, _, _, _, _, _, _),
  847. [58] = PINGROUP(58, tmess_prng, qdss_cti_trig1, _, _, _, _, _, _, _),
  848. [59] = PINGROUP(59, tmess_prng, qdss_gpio, _, _, _, _, _, _, _),
  849. [60] = PINGROUP(60, tmess_prng, qdss_cti_trig0, _, _, _, _, _, _, _),
  850. [61] = PINGROUP(61, _, phase_flag, _, _, _, _, _, _, _),
  851. [62] = PINGROUP(62, qdss_gpio, _, _, _, _, _, _, _, _),
  852. [63] = PINGROUP(63, uim0, _, _, _, _, _, _, _, _),
  853. [64] = PINGROUP(64, uim0, _, _, _, _, _, _, _, _),
  854. [65] = PINGROUP(65, uim0, _, _, _, _, _, _, _, _),
  855. [66] = PINGROUP(66, uim0, _, _, _, _, _, _, _, _),
  856. [67] = PINGROUP(67, uim1, _, _, _, _, _, _, _, _),
  857. [68] = PINGROUP(68, uim1, _, _, _, _, _, _, _, _),
  858. [69] = PINGROUP(69, uim1, _, _, _, _, _, _, _, _),
  859. [70] = PINGROUP(70, uim1, _, _, _, _, _, _, _, _),
  860. [71] = PINGROUP(71, _, _, _, audio_ref_clk, _, _, _, _, _),
  861. [72] = PINGROUP(72, _, _, _, phase_flag, _, _, _, _, _),
  862. [73] = PINGROUP(73, _, _, _, pll_bist_sync, _, _, _, _, _),
  863. [74] = PINGROUP(74, _, _, _, _, _, _, _, _, _),
  864. [75] = PINGROUP(75, _, _, _, vsense_trigger_mirnat, atest_usb0, _, _, _, _),
  865. [76] = PINGROUP(76, _, _, _, _, _, _, _, _, _),
  866. [77] = PINGROUP(77, _, _, _, _, _, _, _, _, _),
  867. [78] = PINGROUP(78, _, _, _, atest_usb0, _, _, _, _, _),
  868. [79] = PINGROUP(79, _, _, _, wlan1_adc_dtest0, atest_usb0, _, _, _, _),
  869. [80] = PINGROUP(80, _, _, dbg_out_clk, wlan1_adc_dtest1, atest_usb0, _, _, _, _),
  870. [81] = PINGROUP(81, _, nav, _, _, _, _, _, _, _),
  871. [82] = PINGROUP(82, _, _, phase_flag, _, _, _, _, _, _),
  872. [83] = PINGROUP(83, nav, _, _, _, _, _, _, _, _),
  873. [84] = PINGROUP(84, nav, vfr_1, _, _, _, _, _, _, _),
  874. [85] = PINGROUP(85, _, _, _, _, _, _, _, _, _),
  875. [86] = PINGROUP(86, _, _, _, _, _, _, _, _, _),
  876. [87] = PINGROUP(87, qlink0_request, _, _, _, _, _, _, _, _),
  877. [88] = PINGROUP(88, qlink0_enable, _, _, _, _, _, _, _, _),
  878. [89] = PINGROUP(89, qlink0_wmss_reset, _, _, _, _, _, _, _, _),
  879. [90] = PINGROUP(90, qup1_se4, jitter_bist_ref, ddr_pxi0_test, _, _, _, _, _, _),
  880. [91] = PINGROUP(91, qup1_se4, _, phase_flag, _, _, _, _, _, _),
  881. [92] = PINGROUP(92, _, _, _, _, _, _, _, _, _),
  882. [93] = PINGROUP(93, mdp_vsync, mdp_vsync0_out, mdp_vsync1_out, _, _, _, _, _, _),
  883. [94] = PINGROUP(94, usb0_phy_ps, _, _, _, _, _, _, _, _),
  884. [95] = PINGROUP(95, _, phase_flag, atest_char, _, _, _, _, _, _),
  885. [96] = PINGROUP(96, _, _, _, _, _, _, _, _, _),
  886. [97] = PINGROUP(97, mdp_vsync, _, phase_flag, atest_char, _, _, _, _, _),
  887. [98] = PINGROUP(98, _, phase_flag, atest_char, _, _, _, _, _, _),
  888. [99] = PINGROUP(99, usb0_hs_ac, _, phase_flag, atest_char, _, _, _, _, _),
  889. [100] = PINGROUP(100, vfr_0_mirb, _, phase_flag, atest_char, _, _, _, _, _),
  890. [101] = PINGROUP(101, _, _, _, _, _, _, _, _, _),
  891. [102] = PINGROUP(102, sd_write_protect, _, _, _, _, _, _, _, _),
  892. [103] = PINGROUP(103, _, _, _, _, _, _, _, _, _),
  893. [104] = PINGROUP(104, _, _, _, _, _, _, _, _, _),
  894. [105] = PINGROUP(105, _, phase_flag, _, _, _, _, _, _, _),
  895. [106] = PINGROUP(106, host2wlan_sol, _, _, _, _, _, _, _, _),
  896. [107] = PINGROUP(107, pcie0_clk_req, _, _, _, _, _, _, _, _),
  897. [108] = PINGROUP(108, pll_clk_aux, _, _, _, _, _, _, _, _),
  898. [109] = PINGROUP(109, _, _, _, _, _, _, _, _, _),
  899. [110] = PINGROUP(110, _, _, _, _, _, _, _, _, _),
  900. [111] = PINGROUP(111, _, _, _, _, _, _, _, _, _),
  901. [112] = PINGROUP(112, _, _, _, _, _, _, _, _, _),
  902. [113] = PINGROUP(113, qdss_cti_trig0, _, _, _, _, _, _, _, _),
  903. [114] = PINGROUP(114, qdss_cti_trig0, _, _, _, _, _, _, _, _),
  904. [115] = PINGROUP(115, _, phase_flag, _, _, _, _, _, _, _),
  905. [116] = PINGROUP(116, _, phase_flag, _, _, _, _, _, _, _),
  906. [117] = PINGROUP(117, _, phase_flag, _, _, _, _, _, _, _),
  907. [118] = PINGROUP(118, qdss_gpio, _, ddr_pxi1_test, _, _, _, _, _, _),
  908. [119] = PINGROUP(119, _, _, _, _, _, _, _, _, _),
  909. [120] = PINGROUP(120, _, _, _, _, _, _, _, _, _),
  910. [121] = PINGROUP(121, qdss_gpio, _, _, _, _, _, _, _, _),
  911. [122] = PINGROUP(122, qdss_gpio, _, ddr_pxi1_test, _, _, _, _, _, _),
  912. [123] = PINGROUP(123, _, _, _, _, _, _, _, _, _),
  913. [124] = PINGROUP(124, _, _, _, _, _, _, _, _, _),
  914. [125] = PINGROUP(125, _, _, _, _, _, _, _, _, _),
  915. [126] = PINGROUP(126, qdss_gpio, _, _, _, _, _, _, _, _),
  916. [127] = PINGROUP(127, qdss_gpio, ddr_pxi0_test, _, _, _, _, _, _, _),
  917. [128] = PINGROUP(128, tb_trig_sdc1, _, _, _, _, _, _, _, _),
  918. [129] = PINGROUP(129, _, _, _, _, _, _, _, _, _),
  919. [130] = PINGROUP(130, _, _, _, _, _, _, _, _, _),
  920. [131] = PINGROUP(131, _, _, _, _, _, _, _, _, _),
  921. [132] = PINGROUP(132, _, _, _, _, _, _, _, _, _),
  922. [133] = PINGROUP(133, _, phase_flag, _, _, _, _, _, _, _),
  923. [134] = PINGROUP(134, tsense_pwm1_out, tsense_pwm2_out, _, _, _, _, _, _, _),
  924. [135] = PINGROUP(135, _, phase_flag, _, _, _, _, _, _, _),
  925. [136] = UFS_RESET(ufs_reset, 0x97000),
  926. [137] = SDC_QDSD_PINGROUP(sdc1_rclk, 0x8c004, 0, 0),
  927. [138] = SDC_QDSD_PINGROUP(sdc1_clk, 0x8c000, 13, 6),
  928. [139] = SDC_QDSD_PINGROUP(sdc1_cmd, 0x8c000, 11, 3),
  929. [140] = SDC_QDSD_PINGROUP(sdc1_data, 0x8c000, 9, 0),
  930. [141] = SDC_QDSD_PINGROUP(sdc2_clk, 0x8f000, 14, 6),
  931. [142] = SDC_QDSD_PINGROUP(sdc2_cmd, 0x8f000, 11, 3),
  932. [143] = SDC_QDSD_PINGROUP(sdc2_data, 0x8f000, 9, 0),
  933. };
  934. static const struct msm_gpio_wakeirq_map sm4450_pdc_map[] = {
  935. { 0, 67 }, { 3, 82 }, { 4, 69 }, { 5, 70 }, { 6, 44 }, { 7, 43 },
  936. { 8, 71 }, { 9, 86 }, { 10, 48 }, { 11, 77 }, { 12, 90 },
  937. { 13, 54 }, { 14, 91 }, { 17, 97 }, { 18, 102 }, { 21, 103 },
  938. { 22, 104 }, { 23, 105 }, { 24, 53 }, { 25, 106 }, { 26, 65 },
  939. { 27, 55 }, { 28, 89 }, { 30, 80 }, { 31, 109 }, { 33, 87 },
  940. { 34, 81 }, { 35, 75 }, { 40, 88 }, { 41, 98 }, { 42, 110 },
  941. { 43, 95 }, { 47, 118 }, { 50, 111 }, { 52, 52 }, { 53, 114 },
  942. { 54, 115 }, { 55, 99 }, { 56, 45 }, { 57, 85 }, { 58, 56 },
  943. { 59, 84 }, { 60, 83 }, { 61, 96 }, { 62, 93 }, { 66, 116 },
  944. { 67, 113 }, { 70, 42 }, { 71, 122 }, { 73, 119 }, { 75, 121 },
  945. { 77, 120 }, { 79, 123 }, { 81, 124 }, { 83, 64 }, { 84, 128 },
  946. { 86, 129 }, { 87, 63 }, { 91, 92 }, { 92, 66 }, { 93, 125 },
  947. { 94, 76 }, { 95, 62 }, { 96, 132 }, { 97, 135 }, { 98, 73 },
  948. { 99, 133 }, { 101, 46 }, { 102, 134 }, { 103, 49 }, { 105, 58 },
  949. { 107, 94 }, { 110, 59 }, { 113, 57 }, { 114, 60 }, { 118, 107 },
  950. { 120, 61 }, { 121, 108 }, { 123, 68 }, { 125, 72 }, { 128, 112 },
  951. };
  952. static const struct msm_pinctrl_soc_data sm4450_tlmm = {
  953. .pins = sm4450_pins,
  954. .npins = ARRAY_SIZE(sm4450_pins),
  955. .functions = sm4450_functions,
  956. .nfunctions = ARRAY_SIZE(sm4450_functions),
  957. .groups = sm4450_groups,
  958. .ngroups = ARRAY_SIZE(sm4450_groups),
  959. .ngpios = 137,
  960. .wakeirq_map = sm4450_pdc_map,
  961. .nwakeirq_map = ARRAY_SIZE(sm4450_pdc_map),
  962. };
  963. static int sm4450_tlmm_probe(struct platform_device *pdev)
  964. {
  965. return msm_pinctrl_probe(pdev, &sm4450_tlmm);
  966. }
  967. static const struct of_device_id sm4450_tlmm_of_match[] = {
  968. { .compatible = "qcom,sm4450-tlmm", },
  969. { }
  970. };
  971. static struct platform_driver sm4450_tlmm_driver = {
  972. .driver = {
  973. .name = "sm4450-tlmm",
  974. .of_match_table = sm4450_tlmm_of_match,
  975. },
  976. .probe = sm4450_tlmm_probe,
  977. .remove_new = msm_pinctrl_remove,
  978. };
  979. MODULE_DEVICE_TABLE(of, sm4450_tlmm_of_match);
  980. static int __init sm4450_tlmm_init(void)
  981. {
  982. return platform_driver_register(&sm4450_tlmm_driver);
  983. }
  984. arch_initcall(sm4450_tlmm_init);
  985. static void __exit sm4450_tlmm_exit(void)
  986. {
  987. platform_driver_unregister(&sm4450_tlmm_driver);
  988. }
  989. module_exit(sm4450_tlmm_exit);
  990. MODULE_DESCRIPTION("QTI SM4450 TLMM driver");
  991. MODULE_LICENSE("GPL");