pinctrl-qdu1000.c 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2021, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #include <linux/module.h>
  7. #include <linux/of.h>
  8. #include <linux/platform_device.h>
  9. #include "pinctrl-msm.h"
  10. #define REG_BASE 0x100000
  11. #define REG_SIZE 0x1000
  12. #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9) \
  13. { \
  14. .grp = PINCTRL_PINGROUP("gpio" #id, \
  15. gpio##id##_pins, \
  16. ARRAY_SIZE(gpio##id##_pins)), \
  17. .funcs = (int[]){ \
  18. msm_mux_gpio, /* gpio mode */ \
  19. msm_mux_##f1, \
  20. msm_mux_##f2, \
  21. msm_mux_##f3, \
  22. msm_mux_##f4, \
  23. msm_mux_##f5, \
  24. msm_mux_##f6, \
  25. msm_mux_##f7, \
  26. msm_mux_##f8, \
  27. msm_mux_##f9 \
  28. }, \
  29. .nfuncs = 10, \
  30. .ctl_reg = REG_BASE + REG_SIZE * id, \
  31. .io_reg = REG_BASE + 0x4 + REG_SIZE * id, \
  32. .intr_cfg_reg = REG_BASE + 0x8 + REG_SIZE * id, \
  33. .intr_status_reg = REG_BASE + 0xc + REG_SIZE * id, \
  34. .intr_target_reg = REG_BASE + 0x8 + REG_SIZE * id, \
  35. .mux_bit = 2, \
  36. .pull_bit = 0, \
  37. .drv_bit = 6, \
  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 = REG_BASE + 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 qdu1000_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, "GPIO_136"),
  241. PINCTRL_PIN(137, "GPIO_137"),
  242. PINCTRL_PIN(138, "GPIO_138"),
  243. PINCTRL_PIN(139, "GPIO_139"),
  244. PINCTRL_PIN(140, "GPIO_140"),
  245. PINCTRL_PIN(141, "GPIO_141"),
  246. PINCTRL_PIN(142, "GPIO_142"),
  247. PINCTRL_PIN(143, "GPIO_143"),
  248. PINCTRL_PIN(144, "GPIO_144"),
  249. PINCTRL_PIN(145, "GPIO_145"),
  250. PINCTRL_PIN(146, "GPIO_146"),
  251. PINCTRL_PIN(147, "GPIO_147"),
  252. PINCTRL_PIN(148, "GPIO_148"),
  253. PINCTRL_PIN(149, "GPIO_149"),
  254. PINCTRL_PIN(150, "GPIO_150"),
  255. PINCTRL_PIN(151, "SDC1_RCLK"),
  256. PINCTRL_PIN(152, "SDC1_CLK"),
  257. PINCTRL_PIN(153, "SDC1_CMD"),
  258. PINCTRL_PIN(154, "SDC1_DATA"),
  259. };
  260. #define DECLARE_MSM_GPIO_PINS(pin) \
  261. static const unsigned int gpio##pin##_pins[] = { pin }
  262. DECLARE_MSM_GPIO_PINS(0);
  263. DECLARE_MSM_GPIO_PINS(1);
  264. DECLARE_MSM_GPIO_PINS(2);
  265. DECLARE_MSM_GPIO_PINS(3);
  266. DECLARE_MSM_GPIO_PINS(4);
  267. DECLARE_MSM_GPIO_PINS(5);
  268. DECLARE_MSM_GPIO_PINS(6);
  269. DECLARE_MSM_GPIO_PINS(7);
  270. DECLARE_MSM_GPIO_PINS(8);
  271. DECLARE_MSM_GPIO_PINS(9);
  272. DECLARE_MSM_GPIO_PINS(10);
  273. DECLARE_MSM_GPIO_PINS(11);
  274. DECLARE_MSM_GPIO_PINS(12);
  275. DECLARE_MSM_GPIO_PINS(13);
  276. DECLARE_MSM_GPIO_PINS(14);
  277. DECLARE_MSM_GPIO_PINS(15);
  278. DECLARE_MSM_GPIO_PINS(16);
  279. DECLARE_MSM_GPIO_PINS(17);
  280. DECLARE_MSM_GPIO_PINS(18);
  281. DECLARE_MSM_GPIO_PINS(19);
  282. DECLARE_MSM_GPIO_PINS(20);
  283. DECLARE_MSM_GPIO_PINS(21);
  284. DECLARE_MSM_GPIO_PINS(22);
  285. DECLARE_MSM_GPIO_PINS(23);
  286. DECLARE_MSM_GPIO_PINS(24);
  287. DECLARE_MSM_GPIO_PINS(25);
  288. DECLARE_MSM_GPIO_PINS(26);
  289. DECLARE_MSM_GPIO_PINS(27);
  290. DECLARE_MSM_GPIO_PINS(28);
  291. DECLARE_MSM_GPIO_PINS(29);
  292. DECLARE_MSM_GPIO_PINS(30);
  293. DECLARE_MSM_GPIO_PINS(31);
  294. DECLARE_MSM_GPIO_PINS(32);
  295. DECLARE_MSM_GPIO_PINS(33);
  296. DECLARE_MSM_GPIO_PINS(34);
  297. DECLARE_MSM_GPIO_PINS(35);
  298. DECLARE_MSM_GPIO_PINS(36);
  299. DECLARE_MSM_GPIO_PINS(37);
  300. DECLARE_MSM_GPIO_PINS(38);
  301. DECLARE_MSM_GPIO_PINS(39);
  302. DECLARE_MSM_GPIO_PINS(40);
  303. DECLARE_MSM_GPIO_PINS(41);
  304. DECLARE_MSM_GPIO_PINS(42);
  305. DECLARE_MSM_GPIO_PINS(43);
  306. DECLARE_MSM_GPIO_PINS(44);
  307. DECLARE_MSM_GPIO_PINS(45);
  308. DECLARE_MSM_GPIO_PINS(46);
  309. DECLARE_MSM_GPIO_PINS(47);
  310. DECLARE_MSM_GPIO_PINS(48);
  311. DECLARE_MSM_GPIO_PINS(49);
  312. DECLARE_MSM_GPIO_PINS(50);
  313. DECLARE_MSM_GPIO_PINS(51);
  314. DECLARE_MSM_GPIO_PINS(52);
  315. DECLARE_MSM_GPIO_PINS(53);
  316. DECLARE_MSM_GPIO_PINS(54);
  317. DECLARE_MSM_GPIO_PINS(55);
  318. DECLARE_MSM_GPIO_PINS(56);
  319. DECLARE_MSM_GPIO_PINS(57);
  320. DECLARE_MSM_GPIO_PINS(58);
  321. DECLARE_MSM_GPIO_PINS(59);
  322. DECLARE_MSM_GPIO_PINS(60);
  323. DECLARE_MSM_GPIO_PINS(61);
  324. DECLARE_MSM_GPIO_PINS(62);
  325. DECLARE_MSM_GPIO_PINS(63);
  326. DECLARE_MSM_GPIO_PINS(64);
  327. DECLARE_MSM_GPIO_PINS(65);
  328. DECLARE_MSM_GPIO_PINS(66);
  329. DECLARE_MSM_GPIO_PINS(67);
  330. DECLARE_MSM_GPIO_PINS(68);
  331. DECLARE_MSM_GPIO_PINS(69);
  332. DECLARE_MSM_GPIO_PINS(70);
  333. DECLARE_MSM_GPIO_PINS(71);
  334. DECLARE_MSM_GPIO_PINS(72);
  335. DECLARE_MSM_GPIO_PINS(73);
  336. DECLARE_MSM_GPIO_PINS(74);
  337. DECLARE_MSM_GPIO_PINS(75);
  338. DECLARE_MSM_GPIO_PINS(76);
  339. DECLARE_MSM_GPIO_PINS(77);
  340. DECLARE_MSM_GPIO_PINS(78);
  341. DECLARE_MSM_GPIO_PINS(79);
  342. DECLARE_MSM_GPIO_PINS(80);
  343. DECLARE_MSM_GPIO_PINS(81);
  344. DECLARE_MSM_GPIO_PINS(82);
  345. DECLARE_MSM_GPIO_PINS(83);
  346. DECLARE_MSM_GPIO_PINS(84);
  347. DECLARE_MSM_GPIO_PINS(85);
  348. DECLARE_MSM_GPIO_PINS(86);
  349. DECLARE_MSM_GPIO_PINS(87);
  350. DECLARE_MSM_GPIO_PINS(88);
  351. DECLARE_MSM_GPIO_PINS(89);
  352. DECLARE_MSM_GPIO_PINS(90);
  353. DECLARE_MSM_GPIO_PINS(91);
  354. DECLARE_MSM_GPIO_PINS(92);
  355. DECLARE_MSM_GPIO_PINS(93);
  356. DECLARE_MSM_GPIO_PINS(94);
  357. DECLARE_MSM_GPIO_PINS(95);
  358. DECLARE_MSM_GPIO_PINS(96);
  359. DECLARE_MSM_GPIO_PINS(97);
  360. DECLARE_MSM_GPIO_PINS(98);
  361. DECLARE_MSM_GPIO_PINS(99);
  362. DECLARE_MSM_GPIO_PINS(100);
  363. DECLARE_MSM_GPIO_PINS(101);
  364. DECLARE_MSM_GPIO_PINS(102);
  365. DECLARE_MSM_GPIO_PINS(103);
  366. DECLARE_MSM_GPIO_PINS(104);
  367. DECLARE_MSM_GPIO_PINS(105);
  368. DECLARE_MSM_GPIO_PINS(106);
  369. DECLARE_MSM_GPIO_PINS(107);
  370. DECLARE_MSM_GPIO_PINS(108);
  371. DECLARE_MSM_GPIO_PINS(109);
  372. DECLARE_MSM_GPIO_PINS(110);
  373. DECLARE_MSM_GPIO_PINS(111);
  374. DECLARE_MSM_GPIO_PINS(112);
  375. DECLARE_MSM_GPIO_PINS(113);
  376. DECLARE_MSM_GPIO_PINS(114);
  377. DECLARE_MSM_GPIO_PINS(115);
  378. DECLARE_MSM_GPIO_PINS(116);
  379. DECLARE_MSM_GPIO_PINS(117);
  380. DECLARE_MSM_GPIO_PINS(118);
  381. DECLARE_MSM_GPIO_PINS(119);
  382. DECLARE_MSM_GPIO_PINS(120);
  383. DECLARE_MSM_GPIO_PINS(121);
  384. DECLARE_MSM_GPIO_PINS(122);
  385. DECLARE_MSM_GPIO_PINS(123);
  386. DECLARE_MSM_GPIO_PINS(124);
  387. DECLARE_MSM_GPIO_PINS(125);
  388. DECLARE_MSM_GPIO_PINS(126);
  389. DECLARE_MSM_GPIO_PINS(127);
  390. DECLARE_MSM_GPIO_PINS(128);
  391. DECLARE_MSM_GPIO_PINS(129);
  392. DECLARE_MSM_GPIO_PINS(130);
  393. DECLARE_MSM_GPIO_PINS(131);
  394. DECLARE_MSM_GPIO_PINS(132);
  395. DECLARE_MSM_GPIO_PINS(133);
  396. DECLARE_MSM_GPIO_PINS(134);
  397. DECLARE_MSM_GPIO_PINS(135);
  398. DECLARE_MSM_GPIO_PINS(136);
  399. DECLARE_MSM_GPIO_PINS(137);
  400. DECLARE_MSM_GPIO_PINS(138);
  401. DECLARE_MSM_GPIO_PINS(139);
  402. DECLARE_MSM_GPIO_PINS(140);
  403. DECLARE_MSM_GPIO_PINS(141);
  404. DECLARE_MSM_GPIO_PINS(142);
  405. DECLARE_MSM_GPIO_PINS(143);
  406. DECLARE_MSM_GPIO_PINS(144);
  407. DECLARE_MSM_GPIO_PINS(145);
  408. DECLARE_MSM_GPIO_PINS(146);
  409. DECLARE_MSM_GPIO_PINS(147);
  410. DECLARE_MSM_GPIO_PINS(148);
  411. DECLARE_MSM_GPIO_PINS(149);
  412. DECLARE_MSM_GPIO_PINS(150);
  413. static const unsigned int sdc1_rclk_pins[] = { 151 };
  414. static const unsigned int sdc1_clk_pins[] = { 152 };
  415. static const unsigned int sdc1_cmd_pins[] = { 153 };
  416. static const unsigned int sdc1_data_pins[] = { 154 };
  417. enum qdu1000_functions {
  418. msm_mux_gpio,
  419. msm_mux_cmo_pri,
  420. msm_mux_si5518_int,
  421. msm_mux_atest_char,
  422. msm_mux_atest_usb,
  423. msm_mux_char_exec,
  424. msm_mux_cmu_rng,
  425. msm_mux_dbg_out_clk,
  426. msm_mux_ddr_bist,
  427. msm_mux_ddr_pxi0,
  428. msm_mux_ddr_pxi1,
  429. msm_mux_ddr_pxi2,
  430. msm_mux_ddr_pxi3,
  431. msm_mux_ddr_pxi4,
  432. msm_mux_ddr_pxi5,
  433. msm_mux_ddr_pxi6,
  434. msm_mux_ddr_pxi7,
  435. msm_mux_eth012_int_n,
  436. msm_mux_eth345_int_n,
  437. msm_mux_eth6_int_n,
  438. msm_mux_gcc_gp1,
  439. msm_mux_gcc_gp2,
  440. msm_mux_gcc_gp3,
  441. msm_mux_gps_pps_in,
  442. msm_mux_hardsync_pps_in,
  443. msm_mux_intr_c,
  444. msm_mux_jitter_bist_ref,
  445. msm_mux_pcie_clkreqn,
  446. msm_mux_phase_flag,
  447. msm_mux_pll_bist,
  448. msm_mux_pll_clk,
  449. msm_mux_prng_rosc,
  450. msm_mux_qdss_cti,
  451. msm_mux_qdss_gpio,
  452. msm_mux_qlink0_enable,
  453. msm_mux_qlink0_request,
  454. msm_mux_qlink0_wmss,
  455. msm_mux_qlink1_enable,
  456. msm_mux_qlink1_request,
  457. msm_mux_qlink1_wmss,
  458. msm_mux_qlink2_enable,
  459. msm_mux_qlink2_request,
  460. msm_mux_qlink2_wmss,
  461. msm_mux_qlink3_enable,
  462. msm_mux_qlink3_request,
  463. msm_mux_qlink3_wmss,
  464. msm_mux_qlink4_enable,
  465. msm_mux_qlink4_request,
  466. msm_mux_qlink4_wmss,
  467. msm_mux_qlink5_enable,
  468. msm_mux_qlink5_request,
  469. msm_mux_qlink5_wmss,
  470. msm_mux_qlink6_enable,
  471. msm_mux_qlink6_request,
  472. msm_mux_qlink6_wmss,
  473. msm_mux_qlink7_enable,
  474. msm_mux_qlink7_request,
  475. msm_mux_qlink7_wmss,
  476. msm_mux_qspi_clk,
  477. msm_mux_qspi_cs,
  478. msm_mux_qspi0,
  479. msm_mux_qspi1,
  480. msm_mux_qspi2,
  481. msm_mux_qspi3,
  482. msm_mux_qup00,
  483. msm_mux_qup01,
  484. msm_mux_qup02,
  485. msm_mux_qup03,
  486. msm_mux_qup04,
  487. msm_mux_qup05,
  488. msm_mux_qup06,
  489. msm_mux_qup07,
  490. msm_mux_qup08,
  491. msm_mux_qup10,
  492. msm_mux_qup11,
  493. msm_mux_qup12,
  494. msm_mux_qup13,
  495. msm_mux_qup14,
  496. msm_mux_qup15,
  497. msm_mux_qup16,
  498. msm_mux_qup17,
  499. msm_mux_qup20,
  500. msm_mux_qup21,
  501. msm_mux_qup22,
  502. msm_mux_smb_alert,
  503. msm_mux_smb_clk,
  504. msm_mux_smb_dat,
  505. msm_mux_tb_trig,
  506. msm_mux_tgu_ch0,
  507. msm_mux_tgu_ch1,
  508. msm_mux_tgu_ch2,
  509. msm_mux_tgu_ch3,
  510. msm_mux_tgu_ch4,
  511. msm_mux_tgu_ch5,
  512. msm_mux_tgu_ch6,
  513. msm_mux_tgu_ch7,
  514. msm_mux_tmess_prng0,
  515. msm_mux_tmess_prng1,
  516. msm_mux_tmess_prng2,
  517. msm_mux_tmess_prng3,
  518. msm_mux_tod_pps_in,
  519. msm_mux_tsense_pwm1,
  520. msm_mux_tsense_pwm2,
  521. msm_mux_usb2phy_ac,
  522. msm_mux_usb_con_det,
  523. msm_mux_usb_dfp_en,
  524. msm_mux_usb_phy,
  525. msm_mux_vfr_0,
  526. msm_mux_vfr_1,
  527. msm_mux_vsense_trigger,
  528. msm_mux__,
  529. };
  530. static const char * const gpio_groups[] = {
  531. "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7",
  532. "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14",
  533. "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21",
  534. "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28",
  535. "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35",
  536. "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42",
  537. "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49",
  538. "gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56",
  539. "gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63",
  540. "gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70",
  541. "gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77",
  542. "gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84",
  543. "gpio85", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", "gpio91",
  544. "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98",
  545. "gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104",
  546. "gpio105", "gpio106", "gpio107", "gpio108", "gpio109", "gpio110",
  547. "gpio111", "gpio112", "gpio113", "gpio114", "gpio115", "gpio116",
  548. "gpio117", "gpio118", "gpio119", "gpio120", "gpio121", "gpio122",
  549. "gpio123", "gpio124", "gpio125", "gpio126", "gpio127", "gpio128",
  550. "gpio129", "gpio130", "gpio131", "gpio132", "gpio133", "gpio134",
  551. "gpio135", "gpio136", "gpio137", "gpio138", "gpio139", "gpio140",
  552. "gpio141", "gpio142", "gpio143", "gpio144", "gpio145", "gpio146",
  553. "gpio147", "gpio148", "gpio149", "gpio150",
  554. };
  555. static const char * const cmo_pri_groups[] = {
  556. "gpio103",
  557. };
  558. static const char * const si5518_int_groups[] = {
  559. "gpio44",
  560. };
  561. static const char * const atest_char_groups[] = {
  562. "gpio89", "gpio90", "gpio91", "gpio92", "gpio95",
  563. };
  564. static const char * const atest_usb_groups[] = {
  565. "gpio114", "gpio115", "gpio116", "gpio117", "gpio118",
  566. };
  567. static const char * const char_exec_groups[] = {
  568. "gpio99", "gpio100",
  569. };
  570. static const char * const cmu_rng_groups[] = {
  571. "gpio89", "gpio90", "gpio91", "gpio92",
  572. };
  573. static const char * const dbg_out_clk_groups[] = {
  574. "gpio136",
  575. };
  576. static const char * const ddr_bist_groups[] = {
  577. "gpio0", "gpio1", "gpio2", "gpio3",
  578. };
  579. static const char * const ddr_pxi0_groups[] = {
  580. "gpio114", "gpio115",
  581. };
  582. static const char * const ddr_pxi1_groups[] = {
  583. "gpio116", "gpio117",
  584. };
  585. static const char * const ddr_pxi2_groups[] = {
  586. "gpio118", "gpio119",
  587. };
  588. static const char * const ddr_pxi3_groups[] = {
  589. "gpio120", "gpio121",
  590. };
  591. static const char * const ddr_pxi4_groups[] = {
  592. "gpio122", "gpio123",
  593. };
  594. static const char * const ddr_pxi5_groups[] = {
  595. "gpio124", "gpio125",
  596. };
  597. static const char * const ddr_pxi6_groups[] = {
  598. "gpio126", "gpio127",
  599. };
  600. static const char * const ddr_pxi7_groups[] = {
  601. "gpio128", "gpio129",
  602. };
  603. static const char * const eth012_int_n_groups[] = {
  604. "gpio86",
  605. };
  606. static const char * const eth345_int_n_groups[] = {
  607. "gpio87",
  608. };
  609. static const char * const eth6_int_n_groups[] = {
  610. "gpio88",
  611. };
  612. static const char * const gcc_gp1_groups[] = {
  613. "gpio86", "gpio134",
  614. };
  615. static const char * const gcc_gp2_groups[] = {
  616. "gpio87", "gpio135",
  617. };
  618. static const char * const gcc_gp3_groups[] = {
  619. "gpio88", "gpio136",
  620. };
  621. static const char * const gps_pps_in_groups[] = {
  622. "gpio49",
  623. };
  624. static const char * const hardsync_pps_in_groups[] = {
  625. "gpio47",
  626. };
  627. static const char * const intr_c_groups[] = {
  628. "gpio26", "gpio27", "gpio28", "gpio141", "gpio142", "gpio143",
  629. };
  630. static const char * const jitter_bist_ref_groups[] = {
  631. "gpio130",
  632. };
  633. static const char * const pcie_clkreqn_groups[] = {
  634. "gpio98", "gpio99", "gpio100",
  635. };
  636. static const char * const phase_flag_groups[] = {
  637. "gpio6", "gpio7", "gpio8", "gpio9", "gpio16", "gpio17", "gpio18",
  638. "gpio19", "gpio20", "gpio22", "gpio21", "gpio23", "gpio24", "gpio25",
  639. "gpio26", "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32",
  640. "gpio33", "gpio42", "gpio43", "gpio89", "gpio90", "gpio91", "gpio92",
  641. "gpio95", "gpio96", "gpio97", "gpio102",
  642. };
  643. static const char * const pll_bist_groups[] = {
  644. "gpio20",
  645. };
  646. static const char * const pll_clk_groups[] = {
  647. "gpio98",
  648. };
  649. static const char * const prng_rosc_groups[] = {
  650. "gpio18", "gpio19", "gpio20", "gpio21",
  651. };
  652. static const char * const qdss_cti_groups[] = {
  653. "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio48",
  654. "gpio49", "gpio86", "gpio87", "gpio93", "gpio94", "gpio130", "gpio131",
  655. "gpio132", "gpio133", "gpio134", "gpio135", "gpio144", "gpio145",
  656. };
  657. static const char * const qdss_gpio_groups[] = {
  658. "gpio6", "gpio7", "gpio8", "gpio9", "gpio16", "gpio17", "gpio18",
  659. "gpio19", "gpio20", "gpio21", "gpio22", "gpio23", "gpio25", "gpio26",
  660. "gpio27", "gpio28", "gpio24", "gpio29", "gpio30", "gpio31", "gpio32",
  661. "gpio33", "gpio34", "gpio35", "gpio42", "gpio43", "gpio88", "gpio89",
  662. "gpio90", "gpio91", "gpio92", "gpio95", "gpio96", "gpio97", "gpio102",
  663. "gpio103",
  664. };
  665. static const char * const qlink0_enable_groups[] = {
  666. "gpio67",
  667. };
  668. static const char * const qlink0_request_groups[] = {
  669. "gpio66",
  670. };
  671. static const char * const qlink0_wmss_groups[] = {
  672. "gpio82",
  673. };
  674. static const char * const qlink1_enable_groups[] = {
  675. "gpio69",
  676. };
  677. static const char * const qlink1_request_groups[] = {
  678. "gpio68",
  679. };
  680. static const char * const qlink1_wmss_groups[] = {
  681. "gpio83",
  682. };
  683. static const char * const qlink2_enable_groups[] = {
  684. "gpio71",
  685. };
  686. static const char * const qlink2_request_groups[] = {
  687. "gpio70",
  688. };
  689. static const char * const qlink2_wmss_groups[] = {
  690. "gpio138",
  691. };
  692. static const char * const qlink3_enable_groups[] = {
  693. "gpio73",
  694. };
  695. static const char * const qlink3_request_groups[] = {
  696. "gpio72",
  697. };
  698. static const char * const qlink3_wmss_groups[] = {
  699. "gpio139",
  700. };
  701. static const char * const qlink4_enable_groups[] = {
  702. "gpio75",
  703. };
  704. static const char * const qlink4_request_groups[] = {
  705. "gpio74",
  706. };
  707. static const char * const qlink4_wmss_groups[] = {
  708. "gpio84",
  709. };
  710. static const char * const qlink5_enable_groups[] = {
  711. "gpio77",
  712. };
  713. static const char * const qlink5_request_groups[] = {
  714. "gpio76",
  715. };
  716. static const char * const qlink5_wmss_groups[] = {
  717. "gpio85",
  718. };
  719. static const char * const qlink6_enable_groups[] = {
  720. "gpio79",
  721. };
  722. static const char * const qlink6_request_groups[] = {
  723. "gpio78",
  724. };
  725. static const char * const qlink6_wmss_groups[] = {
  726. "gpio56",
  727. };
  728. static const char * const qlink7_enable_groups[] = {
  729. "gpio81",
  730. };
  731. static const char * const qlink7_request_groups[] = {
  732. "gpio80",
  733. };
  734. static const char * const qlink7_wmss_groups[] = {
  735. "gpio57",
  736. };
  737. static const char * const qspi0_groups[] = {
  738. "gpio114",
  739. };
  740. static const char * const qspi1_groups[] = {
  741. "gpio115",
  742. };
  743. static const char * const qspi2_groups[] = {
  744. "gpio116",
  745. };
  746. static const char * const qspi3_groups[] = {
  747. "gpio117",
  748. };
  749. static const char * const qspi_clk_groups[] = {
  750. "gpio126",
  751. };
  752. static const char * const qspi_cs_groups[] = {
  753. "gpio125",
  754. };
  755. static const char * const qup00_groups[] = {
  756. "gpio6", "gpio7", "gpio8", "gpio9",
  757. };
  758. static const char * const qup01_groups[] = {
  759. "gpio10", "gpio11", "gpio12", "gpio13",
  760. };
  761. static const char * const qup02_groups[] = {
  762. "gpio10", "gpio11", "gpio12", "gpio13",
  763. };
  764. static const char * const qup03_groups[] = {
  765. "gpio14", "gpio15", "gpio16", "gpio17",
  766. };
  767. static const char * const qup04_groups[] = {
  768. "gpio14", "gpio15", "gpio16", "gpio17",
  769. };
  770. static const char * const qup05_groups[] = {
  771. "gpio130", "gpio131", "gpio132", "gpio133",
  772. };
  773. static const char * const qup06_groups[] = {
  774. "gpio130", "gpio131", "gpio132", "gpio133",
  775. };
  776. static const char * const qup07_groups[] = {
  777. "gpio134", "gpio135",
  778. };
  779. static const char * const qup08_groups[] = {
  780. "gpio134", "gpio135",
  781. };
  782. static const char * const qup10_groups[] = {
  783. "gpio18", "gpio19", "gpio20", "gpio21",
  784. };
  785. static const char * const qup11_groups[] = {
  786. "gpio22", "gpio23", "gpio24", "gpio25",
  787. };
  788. static const char * const qup12_groups[] = {
  789. "gpio22", "gpio23", "gpio24", "gpio25",
  790. };
  791. static const char * const qup13_groups[] = {
  792. "gpio26", "gpio27", "gpio28", "gpio29",
  793. };
  794. static const char * const qup14_groups[] = {
  795. "gpio26", "gpio27", "gpio28", "gpio29",
  796. };
  797. static const char * const qup15_groups[] = {
  798. "gpio30", "gpio31", "gpio32", "gpio33",
  799. };
  800. static const char * const qup16_groups[] = {
  801. "gpio29", "gpio34", "gpio35", "gpio36", "gpio37", "gpio38", "gpio39",
  802. };
  803. static const char * const qup17_groups[] = {
  804. "gpio12", "gpio13", "gpio14", "gpio30", "gpio31", "gpio40", "gpio41",
  805. };
  806. static const char * const qup20_groups[] = {
  807. "gpio0", "gpio1", "gpio2", "gpio3",
  808. };
  809. static const char * const qup21_groups[] = {
  810. "gpio0", "gpio1", "gpio2", "gpio3",
  811. };
  812. static const char * const qup22_groups[] = {
  813. "gpio4", "gpio5", "gpio128", "gpio129",
  814. };
  815. static const char * const smb_alert_groups[] = {
  816. "gpio88", "gpio101",
  817. };
  818. static const char * const smb_clk_groups[] = {
  819. "gpio133",
  820. };
  821. static const char * const smb_dat_groups[] = {
  822. "gpio132",
  823. };
  824. static const char * const tb_trig_groups[] = {
  825. "gpio114",
  826. };
  827. static const char * const tgu_ch0_groups[] = {
  828. "gpio6",
  829. };
  830. static const char * const tgu_ch1_groups[] = {
  831. "gpio7",
  832. };
  833. static const char * const tgu_ch2_groups[] = {
  834. "gpio8",
  835. };
  836. static const char * const tgu_ch3_groups[] = {
  837. "gpio9",
  838. };
  839. static const char * const tgu_ch4_groups[] = {
  840. "gpio44",
  841. };
  842. static const char * const tgu_ch5_groups[] = {
  843. "gpio45",
  844. };
  845. static const char * const tgu_ch6_groups[] = {
  846. "gpio46",
  847. };
  848. static const char * const tgu_ch7_groups[] = {
  849. "gpio47",
  850. };
  851. static const char * const tmess_prng0_groups[] = {
  852. "gpio33",
  853. };
  854. static const char * const tmess_prng1_groups[] = {
  855. "gpio32",
  856. };
  857. static const char * const tmess_prng2_groups[] = {
  858. "gpio31",
  859. };
  860. static const char * const tmess_prng3_groups[] = {
  861. "gpio30",
  862. };
  863. static const char * const tod_pps_in_groups[] = {
  864. "gpio48",
  865. };
  866. static const char * const tsense_pwm1_groups[] = {
  867. "gpio2",
  868. };
  869. static const char * const tsense_pwm2_groups[] = {
  870. "gpio3",
  871. };
  872. static const char * const usb2phy_ac_groups[] = {
  873. "gpio90",
  874. };
  875. static const char * const usb_con_det_groups[] = {
  876. "gpio42",
  877. };
  878. static const char * const usb_dfp_en_groups[] = {
  879. "gpio43",
  880. };
  881. static const char * const usb_phy_groups[] = {
  882. "gpio91",
  883. };
  884. static const char * const vfr_0_groups[] = {
  885. "gpio93",
  886. };
  887. static const char * const vfr_1_groups[] = {
  888. "gpio94",
  889. };
  890. static const char * const vsense_trigger_groups[] = {
  891. "gpio135",
  892. };
  893. static const struct pinfunction qdu1000_functions[] = {
  894. MSM_PIN_FUNCTION(gpio),
  895. MSM_PIN_FUNCTION(cmo_pri),
  896. MSM_PIN_FUNCTION(si5518_int),
  897. MSM_PIN_FUNCTION(atest_char),
  898. MSM_PIN_FUNCTION(atest_usb),
  899. MSM_PIN_FUNCTION(char_exec),
  900. MSM_PIN_FUNCTION(cmu_rng),
  901. MSM_PIN_FUNCTION(dbg_out_clk),
  902. MSM_PIN_FUNCTION(ddr_bist),
  903. MSM_PIN_FUNCTION(ddr_pxi0),
  904. MSM_PIN_FUNCTION(ddr_pxi1),
  905. MSM_PIN_FUNCTION(ddr_pxi2),
  906. MSM_PIN_FUNCTION(ddr_pxi3),
  907. MSM_PIN_FUNCTION(ddr_pxi4),
  908. MSM_PIN_FUNCTION(ddr_pxi5),
  909. MSM_PIN_FUNCTION(ddr_pxi6),
  910. MSM_PIN_FUNCTION(ddr_pxi7),
  911. MSM_PIN_FUNCTION(eth012_int_n),
  912. MSM_PIN_FUNCTION(eth345_int_n),
  913. MSM_PIN_FUNCTION(eth6_int_n),
  914. MSM_PIN_FUNCTION(gcc_gp1),
  915. MSM_PIN_FUNCTION(gcc_gp2),
  916. MSM_PIN_FUNCTION(gcc_gp3),
  917. MSM_PIN_FUNCTION(gps_pps_in),
  918. MSM_PIN_FUNCTION(hardsync_pps_in),
  919. MSM_PIN_FUNCTION(intr_c),
  920. MSM_PIN_FUNCTION(jitter_bist_ref),
  921. MSM_PIN_FUNCTION(pcie_clkreqn),
  922. MSM_PIN_FUNCTION(phase_flag),
  923. MSM_PIN_FUNCTION(pll_bist),
  924. MSM_PIN_FUNCTION(pll_clk),
  925. MSM_PIN_FUNCTION(prng_rosc),
  926. MSM_PIN_FUNCTION(qdss_cti),
  927. MSM_PIN_FUNCTION(qdss_gpio),
  928. MSM_PIN_FUNCTION(qlink0_enable),
  929. MSM_PIN_FUNCTION(qlink0_request),
  930. MSM_PIN_FUNCTION(qlink0_wmss),
  931. MSM_PIN_FUNCTION(qlink1_enable),
  932. MSM_PIN_FUNCTION(qlink1_request),
  933. MSM_PIN_FUNCTION(qlink1_wmss),
  934. MSM_PIN_FUNCTION(qlink2_enable),
  935. MSM_PIN_FUNCTION(qlink2_request),
  936. MSM_PIN_FUNCTION(qlink2_wmss),
  937. MSM_PIN_FUNCTION(qlink3_enable),
  938. MSM_PIN_FUNCTION(qlink3_request),
  939. MSM_PIN_FUNCTION(qlink3_wmss),
  940. MSM_PIN_FUNCTION(qlink4_enable),
  941. MSM_PIN_FUNCTION(qlink4_request),
  942. MSM_PIN_FUNCTION(qlink4_wmss),
  943. MSM_PIN_FUNCTION(qlink5_enable),
  944. MSM_PIN_FUNCTION(qlink5_request),
  945. MSM_PIN_FUNCTION(qlink5_wmss),
  946. MSM_PIN_FUNCTION(qlink6_enable),
  947. MSM_PIN_FUNCTION(qlink6_request),
  948. MSM_PIN_FUNCTION(qlink6_wmss),
  949. MSM_PIN_FUNCTION(qlink7_enable),
  950. MSM_PIN_FUNCTION(qlink7_request),
  951. MSM_PIN_FUNCTION(qlink7_wmss),
  952. MSM_PIN_FUNCTION(qspi0),
  953. MSM_PIN_FUNCTION(qspi1),
  954. MSM_PIN_FUNCTION(qspi2),
  955. MSM_PIN_FUNCTION(qspi3),
  956. MSM_PIN_FUNCTION(qspi_clk),
  957. MSM_PIN_FUNCTION(qspi_cs),
  958. MSM_PIN_FUNCTION(qup00),
  959. MSM_PIN_FUNCTION(qup01),
  960. MSM_PIN_FUNCTION(qup02),
  961. MSM_PIN_FUNCTION(qup03),
  962. MSM_PIN_FUNCTION(qup04),
  963. MSM_PIN_FUNCTION(qup05),
  964. MSM_PIN_FUNCTION(qup06),
  965. MSM_PIN_FUNCTION(qup07),
  966. MSM_PIN_FUNCTION(qup08),
  967. MSM_PIN_FUNCTION(qup10),
  968. MSM_PIN_FUNCTION(qup11),
  969. MSM_PIN_FUNCTION(qup12),
  970. MSM_PIN_FUNCTION(qup13),
  971. MSM_PIN_FUNCTION(qup14),
  972. MSM_PIN_FUNCTION(qup15),
  973. MSM_PIN_FUNCTION(qup16),
  974. MSM_PIN_FUNCTION(qup17),
  975. MSM_PIN_FUNCTION(qup20),
  976. MSM_PIN_FUNCTION(qup21),
  977. MSM_PIN_FUNCTION(qup22),
  978. MSM_PIN_FUNCTION(smb_alert),
  979. MSM_PIN_FUNCTION(smb_clk),
  980. MSM_PIN_FUNCTION(smb_dat),
  981. MSM_PIN_FUNCTION(tb_trig),
  982. MSM_PIN_FUNCTION(tgu_ch0),
  983. MSM_PIN_FUNCTION(tgu_ch1),
  984. MSM_PIN_FUNCTION(tgu_ch2),
  985. MSM_PIN_FUNCTION(tgu_ch3),
  986. MSM_PIN_FUNCTION(tgu_ch4),
  987. MSM_PIN_FUNCTION(tgu_ch5),
  988. MSM_PIN_FUNCTION(tgu_ch6),
  989. MSM_PIN_FUNCTION(tgu_ch7),
  990. MSM_PIN_FUNCTION(tmess_prng0),
  991. MSM_PIN_FUNCTION(tmess_prng1),
  992. MSM_PIN_FUNCTION(tmess_prng2),
  993. MSM_PIN_FUNCTION(tmess_prng3),
  994. MSM_PIN_FUNCTION(tod_pps_in),
  995. MSM_PIN_FUNCTION(tsense_pwm1),
  996. MSM_PIN_FUNCTION(tsense_pwm2),
  997. MSM_PIN_FUNCTION(usb2phy_ac),
  998. MSM_PIN_FUNCTION(usb_con_det),
  999. MSM_PIN_FUNCTION(usb_dfp_en),
  1000. MSM_PIN_FUNCTION(usb_phy),
  1001. MSM_PIN_FUNCTION(vfr_0),
  1002. MSM_PIN_FUNCTION(vfr_1),
  1003. MSM_PIN_FUNCTION(vsense_trigger),
  1004. };
  1005. /*
  1006. * Every pin is maintained as a single group, and missing or non-existing pin
  1007. * would be maintained as dummy group to synchronize pin group index with
  1008. * pin descriptor registered with pinctrl core.
  1009. * Clients would not be able to request these dummy pin groups.
  1010. */
  1011. static const struct msm_pingroup qdu1000_groups[] = {
  1012. [0] = PINGROUP(0, qup20, qup21, ddr_bist, _, _, _, _, _, _),
  1013. [1] = PINGROUP(1, qup20, qup21, ddr_bist, _, _, _, _, _, _),
  1014. [2] = PINGROUP(2, qup21, qup20, ddr_bist, _,
  1015. tsense_pwm1, _, _, _, _),
  1016. [3] = PINGROUP(3, qup21, qup20, ddr_bist, _,
  1017. tsense_pwm2, _, _, _, _),
  1018. [4] = PINGROUP(4, qup22, _, _, _, _, _, _, _, _),
  1019. [5] = PINGROUP(5, qup22, _, _, _, _, _, _, _, _),
  1020. [6] = PINGROUP(6, qup00, tgu_ch0, phase_flag, _,
  1021. qdss_gpio, _, _, _, _),
  1022. [7] = PINGROUP(7, qup00, tgu_ch1, phase_flag, _,
  1023. qdss_gpio, _, _, _, _),
  1024. [8] = PINGROUP(8, qup00, tgu_ch2, phase_flag, _,
  1025. qdss_gpio, _, _, _, _),
  1026. [9] = PINGROUP(9, qup00, tgu_ch3, phase_flag, _,
  1027. qdss_gpio, _, _, _, _),
  1028. [10] = PINGROUP(10, qup01, qup02, _, _, _, _, _, _, _),
  1029. [11] = PINGROUP(11, qup01, qup02, _, _, _, _, _, _, _),
  1030. [12] = PINGROUP(12, qup02, qup01, qup17, _, _, _, _, _, _),
  1031. [13] = PINGROUP(13, qup02, qup01, qup17, _, _, _, _, _, _),
  1032. [14] = PINGROUP(14, qup03, qup04, qup17, _, _, _, _, _, _),
  1033. [15] = PINGROUP(15, qup03, qup04, _, _, _, _, _, _, _),
  1034. [16] = PINGROUP(16, qup04, qup03, phase_flag, _,
  1035. qdss_gpio, _, _, _, _),
  1036. [17] = PINGROUP(17, qup04, qup03, phase_flag, _,
  1037. qdss_gpio, _, _, _, _),
  1038. [18] = PINGROUP(18, qup10, prng_rosc, phase_flag,
  1039. _, qdss_gpio, _, _, _, _),
  1040. [19] = PINGROUP(19, qup10, prng_rosc, phase_flag,
  1041. _, qdss_gpio, _, _, _, _),
  1042. [20] = PINGROUP(20, qup10, prng_rosc, pll_bist,
  1043. phase_flag, _, qdss_gpio, _, _, _),
  1044. [21] = PINGROUP(21, qup10, prng_rosc, phase_flag,
  1045. _, qdss_gpio, _, _, _, _),
  1046. [22] = PINGROUP(22, qup11, qup12, phase_flag, _,
  1047. qdss_gpio, _, _, _, _),
  1048. [23] = PINGROUP(23, qup11, qup12, phase_flag, _,
  1049. qdss_gpio, _, _, _, _),
  1050. [24] = PINGROUP(24, qup12, qup11, phase_flag, _,
  1051. qdss_gpio, _, _, _, _),
  1052. [25] = PINGROUP(25, qup12, qup11, phase_flag, _,
  1053. qdss_gpio, _, _, _, _),
  1054. [26] = PINGROUP(26, qup13, qup14, intr_c,
  1055. phase_flag, _, qdss_gpio, _, _, _),
  1056. [27] = PINGROUP(27, qup13, qup14, intr_c,
  1057. phase_flag, _, qdss_gpio, _, _, _),
  1058. [28] = PINGROUP(28, qup14, qup13, intr_c,
  1059. phase_flag, _, qdss_gpio, _, _, _),
  1060. [29] = PINGROUP(29, qup14, qup13, qup16,
  1061. phase_flag, _, qdss_gpio, _, _, _),
  1062. [30] = PINGROUP(30, qup17, qup15, tmess_prng3,
  1063. phase_flag, _, qdss_gpio, _, _, _),
  1064. [31] = PINGROUP(31, qup17, qup15, tmess_prng2,
  1065. phase_flag, _, qdss_gpio, _, _, _),
  1066. [32] = PINGROUP(32, qup15, tmess_prng1, phase_flag,
  1067. _, qdss_gpio, _, _, _, _),
  1068. [33] = PINGROUP(33, qup15, tmess_prng0, phase_flag,
  1069. _, qdss_gpio, _, _, _, _),
  1070. [34] = PINGROUP(34, qup16, qdss_gpio, _, _, _, _, _, _, _),
  1071. [35] = PINGROUP(35, qup16, qdss_gpio, _, _, _, _, _, _, _),
  1072. [36] = PINGROUP(36, qup16, qdss_cti, _, _, _, _, _, _, _),
  1073. [37] = PINGROUP(37, qup16, qdss_cti, _, _, _, _, _, _, _),
  1074. [38] = PINGROUP(38, qup16, qdss_cti, _, _, _, _, _, _, _),
  1075. [39] = PINGROUP(39, qup16, qdss_cti, _, _, _, _, _, _, _),
  1076. [40] = PINGROUP(40, qup17, qdss_cti, _, _, _, _, _, _, _),
  1077. [41] = PINGROUP(41, qup17, qdss_cti, _, _, _, _, _, _, _),
  1078. [42] = PINGROUP(42, usb_con_det, phase_flag, _,
  1079. qdss_gpio, _, _, _, _, _),
  1080. [43] = PINGROUP(43, usb_dfp_en, phase_flag, _,
  1081. qdss_gpio, _, _, _, _, _),
  1082. [44] = PINGROUP(44, si5518_int, tgu_ch4, _, _, _, _, _, _, _),
  1083. [45] = PINGROUP(45, tgu_ch5, _, _, _, _, _, _, _, _),
  1084. [46] = PINGROUP(46, tgu_ch6, _, _, _, _, _, _, _, _),
  1085. [47] = PINGROUP(47, hardsync_pps_in, tgu_ch7, _, _, _, _, _, _, _),
  1086. [48] = PINGROUP(48, tod_pps_in, qdss_cti, _, _, _, _, _, _, _),
  1087. [49] = PINGROUP(49, gps_pps_in, qdss_cti, _, _, _, _, _, _, _),
  1088. [50] = PINGROUP(50, _, _, _, _, _, _, _, _, _),
  1089. [51] = PINGROUP(51, _, _, _, _, _, _, _, _, _),
  1090. [52] = PINGROUP(52, _, _, _, _, _, _, _, _, _),
  1091. [53] = PINGROUP(53, _, _, _, _, _, _, _, _, _),
  1092. [54] = PINGROUP(54, _, _, _, _, _, _, _, _, _),
  1093. [55] = PINGROUP(55, _, _, _, _, _, _, _, _, _),
  1094. [56] = PINGROUP(56, _, qlink6_wmss, _, _, _, _, _, _, _),
  1095. [57] = PINGROUP(57, _, qlink7_wmss, _, _, _, _, _, _, _),
  1096. [58] = PINGROUP(58, _, _, _, _, _, _, _, _, _),
  1097. [59] = PINGROUP(59, _, _, _, _, _, _, _, _, _),
  1098. [60] = PINGROUP(60, _, _, _, _, _, _, _, _, _),
  1099. [61] = PINGROUP(61, _, _, _, _, _, _, _, _, _),
  1100. [62] = PINGROUP(62, _, _, _, _, _, _, _, _, _),
  1101. [63] = PINGROUP(63, _, _, _, _, _, _, _, _, _),
  1102. [64] = PINGROUP(64, _, _, _, _, _, _, _, _, _),
  1103. [65] = PINGROUP(65, _, _, _, _, _, _, _, _, _),
  1104. [66] = PINGROUP(66, qlink0_request, _, _, _, _, _, _, _, _),
  1105. [67] = PINGROUP(67, qlink0_enable, _, _, _, _, _, _, _, _),
  1106. [68] = PINGROUP(68, qlink1_request, _, _, _, _, _, _, _, _),
  1107. [69] = PINGROUP(69, qlink1_enable, _, _, _, _, _, _, _, _),
  1108. [70] = PINGROUP(70, qlink2_request, _, _, _, _, _, _, _, _),
  1109. [71] = PINGROUP(71, qlink2_enable, _, _, _, _, _, _, _, _),
  1110. [72] = PINGROUP(72, qlink3_request, _, _, _, _, _, _, _, _),
  1111. [73] = PINGROUP(73, qlink3_enable, _, _, _, _, _, _, _, _),
  1112. [74] = PINGROUP(74, qlink4_request, _, _, _, _, _, _, _, _),
  1113. [75] = PINGROUP(75, qlink4_enable, _, _, _, _, _, _, _, _),
  1114. [76] = PINGROUP(76, qlink5_request, _, _, _, _, _, _, _, _),
  1115. [77] = PINGROUP(77, qlink5_enable, _, _, _, _, _, _, _, _),
  1116. [78] = PINGROUP(78, qlink6_request, _, _, _, _, _, _, _, _),
  1117. [79] = PINGROUP(79, qlink6_enable, _, _, _, _, _, _, _, _),
  1118. [80] = PINGROUP(80, qlink7_request, _, _, _, _, _, _, _, _),
  1119. [81] = PINGROUP(81, qlink7_enable, _, _, _, _, _, _, _, _),
  1120. [82] = PINGROUP(82, qlink0_wmss, _, _, _, _, _, _, _, _),
  1121. [83] = PINGROUP(83, qlink1_wmss, _, _, _, _, _, _, _, _),
  1122. [84] = PINGROUP(84, qlink4_wmss, _, _, _, _, _, _, _, _),
  1123. [85] = PINGROUP(85, qlink5_wmss, _, _, _, _, _, _, _, _),
  1124. [86] = PINGROUP(86, eth012_int_n, gcc_gp1, _, qdss_cti, _, _, _, _, _),
  1125. [87] = PINGROUP(87, eth345_int_n, gcc_gp2, _, qdss_cti, _, _, _, _, _),
  1126. [88] = PINGROUP(88, eth6_int_n, smb_alert, gcc_gp3, _,
  1127. qdss_gpio, _, _, _, _),
  1128. [89] = PINGROUP(89, phase_flag, cmu_rng, _,
  1129. qdss_gpio, atest_char, _, _, _, _),
  1130. [90] = PINGROUP(90, usb2phy_ac, phase_flag,
  1131. cmu_rng, _, qdss_gpio,
  1132. atest_char, _, _, _),
  1133. [91] = PINGROUP(91, usb_phy, phase_flag, cmu_rng,
  1134. _, qdss_gpio, atest_char, _, _, _),
  1135. [92] = PINGROUP(92, phase_flag, cmu_rng, _,
  1136. qdss_gpio, atest_char, _, _, _, _),
  1137. [93] = PINGROUP(93, vfr_0, qdss_cti, _, _, _, _, _, _, _),
  1138. [94] = PINGROUP(94, vfr_1, qdss_cti, _, _, _, _, _, _, _),
  1139. [95] = PINGROUP(95, phase_flag, _, qdss_gpio,
  1140. atest_char, _, _, _, _, _),
  1141. [96] = PINGROUP(96, phase_flag, _, qdss_gpio, _, _, _, _, _, _),
  1142. [97] = PINGROUP(97, phase_flag, _, qdss_gpio, _, _, _, _, _, _),
  1143. [98] = PINGROUP(98, pll_clk, _, _, _, _, _, _, _, _),
  1144. [99] = PINGROUP(99, pcie_clkreqn, char_exec, _, _, _, _, _, _, _),
  1145. [100] = PINGROUP(100, char_exec, _, _, _, _, _, _, _, _),
  1146. [101] = PINGROUP(101, smb_alert, _, _, _, _, _, _, _, _),
  1147. [102] = PINGROUP(102, phase_flag, _, qdss_gpio, _, _, _, _, _, _),
  1148. [103] = PINGROUP(103, cmo_pri, qdss_gpio, _, _, _, _, _, _, _),
  1149. [104] = PINGROUP(104, _, _, _, _, _, _, _, _, _),
  1150. [105] = PINGROUP(105, _, _, _, _, _, _, _, _, _),
  1151. [106] = PINGROUP(106, _, _, _, _, _, _, _, _, _),
  1152. [107] = PINGROUP(107, _, _, _, _, _, _, _, _, _),
  1153. [108] = PINGROUP(108, _, _, _, _, _, _, _, _, _),
  1154. [109] = PINGROUP(109, _, _, _, _, _, _, _, _, _),
  1155. [110] = PINGROUP(110, _, _, _, _, _, _, _, _, _),
  1156. [111] = PINGROUP(111, _, _, _, _, _, _, _, _, _),
  1157. [112] = PINGROUP(112, _, _, _, _, _, _, _, _, _),
  1158. [113] = PINGROUP(113, _, _, _, _, _, _, _, _, _),
  1159. [114] = PINGROUP(114, qspi0, tb_trig, _,
  1160. atest_usb, ddr_pxi0, _, _, _, _),
  1161. [115] = PINGROUP(115, qspi1, _, atest_usb,
  1162. ddr_pxi0, _, _, _, _, _),
  1163. [116] = PINGROUP(116, qspi2, _, atest_usb,
  1164. ddr_pxi1, _, _, _, _, _),
  1165. [117] = PINGROUP(117, qspi3, _, atest_usb,
  1166. ddr_pxi1, _, _, _, _, _),
  1167. [118] = PINGROUP(118, _, atest_usb, ddr_pxi2, _, _, _, _, _, _),
  1168. [119] = PINGROUP(119, _, _, ddr_pxi2, _, _, _, _, _, _),
  1169. [120] = PINGROUP(120, _, _, ddr_pxi3, _, _, _, _, _, _),
  1170. [121] = PINGROUP(121, _, ddr_pxi3, _, _, _, _, _, _, _),
  1171. [122] = PINGROUP(122, _, ddr_pxi4, _, _, _, _, _, _, _),
  1172. [123] = PINGROUP(123, _, ddr_pxi4, _, _, _, _, _, _, _),
  1173. [124] = PINGROUP(124, _, ddr_pxi5, _, _, _, _, _, _, _),
  1174. [125] = PINGROUP(125, qspi_cs, _, ddr_pxi5, _, _, _, _, _, _),
  1175. [126] = PINGROUP(126, qspi_clk, _, ddr_pxi6, _, _, _, _, _, _),
  1176. [127] = PINGROUP(127, _, ddr_pxi6, _, _, _, _, _, _, _),
  1177. [128] = PINGROUP(128, qup22, _, ddr_pxi7, _, _, _, _, _, _),
  1178. [129] = PINGROUP(129, qup22, ddr_pxi7, _, _, _, _, _, _, _),
  1179. [130] = PINGROUP(130, qup05, qup06, jitter_bist_ref,
  1180. qdss_cti, _, _, _, _, _),
  1181. [131] = PINGROUP(131, qup05, qup06, qdss_cti, _, _, _, _, _, _),
  1182. [132] = PINGROUP(132, qup06, qup05, smb_dat,
  1183. qdss_cti, _, _, _, _, _),
  1184. [133] = PINGROUP(133, qup06, qup05, smb_clk,
  1185. qdss_cti, _, _, _, _, _),
  1186. [134] = PINGROUP(134, qup08, qup07, gcc_gp1, _,
  1187. qdss_cti, _, _, _, _),
  1188. [135] = PINGROUP(135, qup08, qup07, gcc_gp2, _,
  1189. qdss_cti, vsense_trigger, _, _, _),
  1190. [136] = PINGROUP(136, gcc_gp3, dbg_out_clk, _, _, _, _, _, _, _),
  1191. [137] = PINGROUP(137, _, _, _, _, _, _, _, _, _),
  1192. [138] = PINGROUP(138, qlink2_wmss, _, _, _, _, _, _, _, _),
  1193. [139] = PINGROUP(139, qlink3_wmss, _, _, _, _, _, _, _, _),
  1194. [140] = PINGROUP(140, _, _, _, _, _, _, _, _, _),
  1195. [141] = PINGROUP(141, intr_c, _, _, _, _, _, _, _, _),
  1196. [142] = PINGROUP(142, intr_c, _, _, _, _, _, _, _, _),
  1197. [143] = PINGROUP(143, intr_c, _, _, _, _, _, _, _, _),
  1198. [144] = PINGROUP(144, qdss_cti, _, _, _, _, _, _, _, _),
  1199. [145] = PINGROUP(145, qdss_cti, _, _, _, _, _, _, _, _),
  1200. [146] = PINGROUP(146, _, _, _, _, _, _, _, _, _),
  1201. [147] = PINGROUP(147, _, _, _, _, _, _, _, _, _),
  1202. [148] = PINGROUP(148, _, _, _, _, _, _, _, _, _),
  1203. [149] = PINGROUP(149, _, _, _, _, _, _, _, _, _),
  1204. [150] = PINGROUP(150, _, _, _, _, _, _, _, _, _),
  1205. [151] = SDC_QDSD_PINGROUP(sdc1_rclk, 0x9e000, 0, 0),
  1206. [152] = SDC_QDSD_PINGROUP(sdc1_clk, 0x9d000, 13, 6),
  1207. [153] = SDC_QDSD_PINGROUP(sdc1_cmd, 0x9d000, 11, 3),
  1208. [154] = SDC_QDSD_PINGROUP(sdc1_data, 0x9d000, 9, 0),
  1209. };
  1210. static const struct msm_pinctrl_soc_data qdu1000_tlmm = {
  1211. .pins = qdu1000_pins,
  1212. .npins = ARRAY_SIZE(qdu1000_pins),
  1213. .functions = qdu1000_functions,
  1214. .nfunctions = ARRAY_SIZE(qdu1000_functions),
  1215. .groups = qdu1000_groups,
  1216. .ngroups = ARRAY_SIZE(qdu1000_groups),
  1217. .ngpios = 151,
  1218. };
  1219. static int qdu1000_tlmm_probe(struct platform_device *pdev)
  1220. {
  1221. return msm_pinctrl_probe(pdev, &qdu1000_tlmm);
  1222. }
  1223. static const struct of_device_id qdu1000_tlmm_of_match[] = {
  1224. { .compatible = "qcom,qdu1000-tlmm", },
  1225. { },
  1226. };
  1227. MODULE_DEVICE_TABLE(of, qdu1000_tlmm_of_match);
  1228. static struct platform_driver qdu1000_tlmm_driver = {
  1229. .driver = {
  1230. .name = "qdu1000-tlmm",
  1231. .of_match_table = qdu1000_tlmm_of_match,
  1232. },
  1233. .probe = qdu1000_tlmm_probe,
  1234. .remove_new = msm_pinctrl_remove,
  1235. };
  1236. static int __init qdu1000_tlmm_init(void)
  1237. {
  1238. return platform_driver_register(&qdu1000_tlmm_driver);
  1239. }
  1240. arch_initcall(qdu1000_tlmm_init);
  1241. static void __exit qdu1000_tlmm_exit(void)
  1242. {
  1243. platform_driver_unregister(&qdu1000_tlmm_driver);
  1244. }
  1245. module_exit(qdu1000_tlmm_exit);
  1246. MODULE_DESCRIPTION("QTI QDU1000 TLMM driver");
  1247. MODULE_LICENSE("GPL");