pinctrl-sc7180.c 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187
  1. // SPDX-License-Identifier: GPL-2.0
  2. // Copyright (c) 2019, The Linux Foundation. All rights reserved.
  3. #include <linux/module.h>
  4. #include <linux/of.h>
  5. #include <linux/platform_device.h>
  6. #include <linux/pinctrl/pinctrl.h>
  7. #include "pinctrl-msm.h"
  8. static const char * const sc7180_tiles[] = {
  9. "north",
  10. "south",
  11. "west",
  12. };
  13. enum {
  14. NORTH,
  15. SOUTH,
  16. WEST
  17. };
  18. #define FUNCTION(fname) \
  19. [msm_mux_##fname] = { \
  20. .name = #fname, \
  21. .groups = fname##_groups, \
  22. .ngroups = ARRAY_SIZE(fname##_groups), \
  23. }
  24. #define PINGROUP(id, _tile, f1, f2, f3, f4, f5, f6, f7, f8, f9) \
  25. { \
  26. .name = "gpio" #id, \
  27. .pins = gpio##id##_pins, \
  28. .npins = ARRAY_SIZE(gpio##id##_pins), \
  29. .funcs = (int[]){ \
  30. msm_mux_gpio, /* gpio mode */ \
  31. msm_mux_##f1, \
  32. msm_mux_##f2, \
  33. msm_mux_##f3, \
  34. msm_mux_##f4, \
  35. msm_mux_##f5, \
  36. msm_mux_##f6, \
  37. msm_mux_##f7, \
  38. msm_mux_##f8, \
  39. msm_mux_##f9 \
  40. }, \
  41. .nfuncs = 10, \
  42. .ctl_reg = 0x1000 * id, \
  43. .io_reg = 0x1000 * id + 0x4, \
  44. .intr_cfg_reg = 0x1000 * id + 0x8, \
  45. .intr_status_reg = 0x1000 * id + 0xc, \
  46. .intr_target_reg = 0x1000 * id + 0x8, \
  47. .tile = _tile, \
  48. .mux_bit = 2, \
  49. .pull_bit = 0, \
  50. .drv_bit = 6, \
  51. .oe_bit = 9, \
  52. .in_bit = 0, \
  53. .out_bit = 1, \
  54. .intr_enable_bit = 0, \
  55. .intr_status_bit = 0, \
  56. .intr_target_bit = 5, \
  57. .intr_target_kpss_val = 3, \
  58. .intr_raw_status_bit = 4, \
  59. .intr_polarity_bit = 1, \
  60. .intr_detection_bit = 2, \
  61. .intr_detection_width = 2, \
  62. }
  63. #define SDC_QDSD_PINGROUP(pg_name, ctl, pull, drv) \
  64. { \
  65. .name = #pg_name, \
  66. .pins = pg_name##_pins, \
  67. .npins = ARRAY_SIZE(pg_name##_pins), \
  68. .ctl_reg = ctl, \
  69. .io_reg = 0, \
  70. .intr_cfg_reg = 0, \
  71. .intr_status_reg = 0, \
  72. .intr_target_reg = 0, \
  73. .tile = SOUTH, \
  74. .mux_bit = -1, \
  75. .pull_bit = pull, \
  76. .drv_bit = drv, \
  77. .oe_bit = -1, \
  78. .in_bit = -1, \
  79. .out_bit = -1, \
  80. .intr_enable_bit = -1, \
  81. .intr_status_bit = -1, \
  82. .intr_target_bit = -1, \
  83. .intr_raw_status_bit = -1, \
  84. .intr_polarity_bit = -1, \
  85. .intr_detection_bit = -1, \
  86. .intr_detection_width = -1, \
  87. }
  88. #define UFS_RESET(pg_name, offset) \
  89. { \
  90. .name = #pg_name, \
  91. .pins = pg_name##_pins, \
  92. .npins = ARRAY_SIZE(pg_name##_pins), \
  93. .ctl_reg = offset, \
  94. .io_reg = offset + 0x4, \
  95. .intr_cfg_reg = 0, \
  96. .intr_status_reg = 0, \
  97. .intr_target_reg = 0, \
  98. .tile = SOUTH, \
  99. .mux_bit = -1, \
  100. .pull_bit = 3, \
  101. .drv_bit = 0, \
  102. .oe_bit = -1, \
  103. .in_bit = -1, \
  104. .out_bit = 0, \
  105. .intr_enable_bit = -1, \
  106. .intr_status_bit = -1, \
  107. .intr_target_bit = -1, \
  108. .intr_raw_status_bit = -1, \
  109. .intr_polarity_bit = -1, \
  110. .intr_detection_bit = -1, \
  111. .intr_detection_width = -1, \
  112. }
  113. static const struct pinctrl_pin_desc sc7180_pins[] = {
  114. PINCTRL_PIN(0, "GPIO_0"),
  115. PINCTRL_PIN(1, "GPIO_1"),
  116. PINCTRL_PIN(2, "GPIO_2"),
  117. PINCTRL_PIN(3, "GPIO_3"),
  118. PINCTRL_PIN(4, "GPIO_4"),
  119. PINCTRL_PIN(5, "GPIO_5"),
  120. PINCTRL_PIN(6, "GPIO_6"),
  121. PINCTRL_PIN(7, "GPIO_7"),
  122. PINCTRL_PIN(8, "GPIO_8"),
  123. PINCTRL_PIN(9, "GPIO_9"),
  124. PINCTRL_PIN(10, "GPIO_10"),
  125. PINCTRL_PIN(11, "GPIO_11"),
  126. PINCTRL_PIN(12, "GPIO_12"),
  127. PINCTRL_PIN(13, "GPIO_13"),
  128. PINCTRL_PIN(14, "GPIO_14"),
  129. PINCTRL_PIN(15, "GPIO_15"),
  130. PINCTRL_PIN(16, "GPIO_16"),
  131. PINCTRL_PIN(17, "GPIO_17"),
  132. PINCTRL_PIN(18, "GPIO_18"),
  133. PINCTRL_PIN(19, "GPIO_19"),
  134. PINCTRL_PIN(20, "GPIO_20"),
  135. PINCTRL_PIN(21, "GPIO_21"),
  136. PINCTRL_PIN(22, "GPIO_22"),
  137. PINCTRL_PIN(23, "GPIO_23"),
  138. PINCTRL_PIN(24, "GPIO_24"),
  139. PINCTRL_PIN(25, "GPIO_25"),
  140. PINCTRL_PIN(26, "GPIO_26"),
  141. PINCTRL_PIN(27, "GPIO_27"),
  142. PINCTRL_PIN(28, "GPIO_28"),
  143. PINCTRL_PIN(29, "GPIO_29"),
  144. PINCTRL_PIN(30, "GPIO_30"),
  145. PINCTRL_PIN(31, "GPIO_31"),
  146. PINCTRL_PIN(32, "GPIO_32"),
  147. PINCTRL_PIN(33, "GPIO_33"),
  148. PINCTRL_PIN(34, "GPIO_34"),
  149. PINCTRL_PIN(35, "GPIO_35"),
  150. PINCTRL_PIN(36, "GPIO_36"),
  151. PINCTRL_PIN(37, "GPIO_37"),
  152. PINCTRL_PIN(38, "GPIO_38"),
  153. PINCTRL_PIN(39, "GPIO_39"),
  154. PINCTRL_PIN(40, "GPIO_40"),
  155. PINCTRL_PIN(41, "GPIO_41"),
  156. PINCTRL_PIN(42, "GPIO_42"),
  157. PINCTRL_PIN(43, "GPIO_43"),
  158. PINCTRL_PIN(44, "GPIO_44"),
  159. PINCTRL_PIN(45, "GPIO_45"),
  160. PINCTRL_PIN(46, "GPIO_46"),
  161. PINCTRL_PIN(47, "GPIO_47"),
  162. PINCTRL_PIN(48, "GPIO_48"),
  163. PINCTRL_PIN(49, "GPIO_49"),
  164. PINCTRL_PIN(50, "GPIO_50"),
  165. PINCTRL_PIN(51, "GPIO_51"),
  166. PINCTRL_PIN(52, "GPIO_52"),
  167. PINCTRL_PIN(53, "GPIO_53"),
  168. PINCTRL_PIN(54, "GPIO_54"),
  169. PINCTRL_PIN(55, "GPIO_55"),
  170. PINCTRL_PIN(56, "GPIO_56"),
  171. PINCTRL_PIN(57, "GPIO_57"),
  172. PINCTRL_PIN(58, "GPIO_58"),
  173. PINCTRL_PIN(59, "GPIO_59"),
  174. PINCTRL_PIN(60, "GPIO_60"),
  175. PINCTRL_PIN(61, "GPIO_61"),
  176. PINCTRL_PIN(62, "GPIO_62"),
  177. PINCTRL_PIN(63, "GPIO_63"),
  178. PINCTRL_PIN(64, "GPIO_64"),
  179. PINCTRL_PIN(65, "GPIO_65"),
  180. PINCTRL_PIN(66, "GPIO_66"),
  181. PINCTRL_PIN(67, "GPIO_67"),
  182. PINCTRL_PIN(68, "GPIO_68"),
  183. PINCTRL_PIN(69, "GPIO_69"),
  184. PINCTRL_PIN(70, "GPIO_70"),
  185. PINCTRL_PIN(71, "GPIO_71"),
  186. PINCTRL_PIN(72, "GPIO_72"),
  187. PINCTRL_PIN(73, "GPIO_73"),
  188. PINCTRL_PIN(74, "GPIO_74"),
  189. PINCTRL_PIN(75, "GPIO_75"),
  190. PINCTRL_PIN(76, "GPIO_76"),
  191. PINCTRL_PIN(77, "GPIO_77"),
  192. PINCTRL_PIN(78, "GPIO_78"),
  193. PINCTRL_PIN(79, "GPIO_79"),
  194. PINCTRL_PIN(80, "GPIO_80"),
  195. PINCTRL_PIN(81, "GPIO_81"),
  196. PINCTRL_PIN(82, "GPIO_82"),
  197. PINCTRL_PIN(83, "GPIO_83"),
  198. PINCTRL_PIN(84, "GPIO_84"),
  199. PINCTRL_PIN(85, "GPIO_85"),
  200. PINCTRL_PIN(86, "GPIO_86"),
  201. PINCTRL_PIN(87, "GPIO_87"),
  202. PINCTRL_PIN(88, "GPIO_88"),
  203. PINCTRL_PIN(89, "GPIO_89"),
  204. PINCTRL_PIN(90, "GPIO_90"),
  205. PINCTRL_PIN(91, "GPIO_91"),
  206. PINCTRL_PIN(92, "GPIO_92"),
  207. PINCTRL_PIN(93, "GPIO_93"),
  208. PINCTRL_PIN(94, "GPIO_94"),
  209. PINCTRL_PIN(95, "GPIO_95"),
  210. PINCTRL_PIN(96, "GPIO_96"),
  211. PINCTRL_PIN(97, "GPIO_97"),
  212. PINCTRL_PIN(98, "GPIO_98"),
  213. PINCTRL_PIN(99, "GPIO_99"),
  214. PINCTRL_PIN(100, "GPIO_100"),
  215. PINCTRL_PIN(101, "GPIO_101"),
  216. PINCTRL_PIN(102, "GPIO_102"),
  217. PINCTRL_PIN(103, "GPIO_103"),
  218. PINCTRL_PIN(104, "GPIO_104"),
  219. PINCTRL_PIN(105, "GPIO_105"),
  220. PINCTRL_PIN(106, "GPIO_106"),
  221. PINCTRL_PIN(107, "GPIO_107"),
  222. PINCTRL_PIN(108, "GPIO_108"),
  223. PINCTRL_PIN(109, "GPIO_109"),
  224. PINCTRL_PIN(110, "GPIO_110"),
  225. PINCTRL_PIN(111, "GPIO_111"),
  226. PINCTRL_PIN(112, "GPIO_112"),
  227. PINCTRL_PIN(113, "GPIO_113"),
  228. PINCTRL_PIN(114, "GPIO_114"),
  229. PINCTRL_PIN(115, "GPIO_115"),
  230. PINCTRL_PIN(116, "GPIO_116"),
  231. PINCTRL_PIN(117, "GPIO_117"),
  232. PINCTRL_PIN(118, "GPIO_118"),
  233. PINCTRL_PIN(119, "UFS_RESET"),
  234. PINCTRL_PIN(120, "SDC1_RCLK"),
  235. PINCTRL_PIN(121, "SDC1_CLK"),
  236. PINCTRL_PIN(122, "SDC1_CMD"),
  237. PINCTRL_PIN(123, "SDC1_DATA"),
  238. PINCTRL_PIN(124, "SDC2_CLK"),
  239. PINCTRL_PIN(125, "SDC2_CMD"),
  240. PINCTRL_PIN(126, "SDC2_DATA"),
  241. };
  242. #define DECLARE_MSM_GPIO_PINS(pin) \
  243. static const unsigned int gpio##pin##_pins[] = { pin }
  244. DECLARE_MSM_GPIO_PINS(0);
  245. DECLARE_MSM_GPIO_PINS(1);
  246. DECLARE_MSM_GPIO_PINS(2);
  247. DECLARE_MSM_GPIO_PINS(3);
  248. DECLARE_MSM_GPIO_PINS(4);
  249. DECLARE_MSM_GPIO_PINS(5);
  250. DECLARE_MSM_GPIO_PINS(6);
  251. DECLARE_MSM_GPIO_PINS(7);
  252. DECLARE_MSM_GPIO_PINS(8);
  253. DECLARE_MSM_GPIO_PINS(9);
  254. DECLARE_MSM_GPIO_PINS(10);
  255. DECLARE_MSM_GPIO_PINS(11);
  256. DECLARE_MSM_GPIO_PINS(12);
  257. DECLARE_MSM_GPIO_PINS(13);
  258. DECLARE_MSM_GPIO_PINS(14);
  259. DECLARE_MSM_GPIO_PINS(15);
  260. DECLARE_MSM_GPIO_PINS(16);
  261. DECLARE_MSM_GPIO_PINS(17);
  262. DECLARE_MSM_GPIO_PINS(18);
  263. DECLARE_MSM_GPIO_PINS(19);
  264. DECLARE_MSM_GPIO_PINS(20);
  265. DECLARE_MSM_GPIO_PINS(21);
  266. DECLARE_MSM_GPIO_PINS(22);
  267. DECLARE_MSM_GPIO_PINS(23);
  268. DECLARE_MSM_GPIO_PINS(24);
  269. DECLARE_MSM_GPIO_PINS(25);
  270. DECLARE_MSM_GPIO_PINS(26);
  271. DECLARE_MSM_GPIO_PINS(27);
  272. DECLARE_MSM_GPIO_PINS(28);
  273. DECLARE_MSM_GPIO_PINS(29);
  274. DECLARE_MSM_GPIO_PINS(30);
  275. DECLARE_MSM_GPIO_PINS(31);
  276. DECLARE_MSM_GPIO_PINS(32);
  277. DECLARE_MSM_GPIO_PINS(33);
  278. DECLARE_MSM_GPIO_PINS(34);
  279. DECLARE_MSM_GPIO_PINS(35);
  280. DECLARE_MSM_GPIO_PINS(36);
  281. DECLARE_MSM_GPIO_PINS(37);
  282. DECLARE_MSM_GPIO_PINS(38);
  283. DECLARE_MSM_GPIO_PINS(39);
  284. DECLARE_MSM_GPIO_PINS(40);
  285. DECLARE_MSM_GPIO_PINS(41);
  286. DECLARE_MSM_GPIO_PINS(42);
  287. DECLARE_MSM_GPIO_PINS(43);
  288. DECLARE_MSM_GPIO_PINS(44);
  289. DECLARE_MSM_GPIO_PINS(45);
  290. DECLARE_MSM_GPIO_PINS(46);
  291. DECLARE_MSM_GPIO_PINS(47);
  292. DECLARE_MSM_GPIO_PINS(48);
  293. DECLARE_MSM_GPIO_PINS(49);
  294. DECLARE_MSM_GPIO_PINS(50);
  295. DECLARE_MSM_GPIO_PINS(51);
  296. DECLARE_MSM_GPIO_PINS(52);
  297. DECLARE_MSM_GPIO_PINS(53);
  298. DECLARE_MSM_GPIO_PINS(54);
  299. DECLARE_MSM_GPIO_PINS(55);
  300. DECLARE_MSM_GPIO_PINS(56);
  301. DECLARE_MSM_GPIO_PINS(57);
  302. DECLARE_MSM_GPIO_PINS(58);
  303. DECLARE_MSM_GPIO_PINS(59);
  304. DECLARE_MSM_GPIO_PINS(60);
  305. DECLARE_MSM_GPIO_PINS(61);
  306. DECLARE_MSM_GPIO_PINS(62);
  307. DECLARE_MSM_GPIO_PINS(63);
  308. DECLARE_MSM_GPIO_PINS(64);
  309. DECLARE_MSM_GPIO_PINS(65);
  310. DECLARE_MSM_GPIO_PINS(66);
  311. DECLARE_MSM_GPIO_PINS(67);
  312. DECLARE_MSM_GPIO_PINS(68);
  313. DECLARE_MSM_GPIO_PINS(69);
  314. DECLARE_MSM_GPIO_PINS(70);
  315. DECLARE_MSM_GPIO_PINS(71);
  316. DECLARE_MSM_GPIO_PINS(72);
  317. DECLARE_MSM_GPIO_PINS(73);
  318. DECLARE_MSM_GPIO_PINS(74);
  319. DECLARE_MSM_GPIO_PINS(75);
  320. DECLARE_MSM_GPIO_PINS(76);
  321. DECLARE_MSM_GPIO_PINS(77);
  322. DECLARE_MSM_GPIO_PINS(78);
  323. DECLARE_MSM_GPIO_PINS(79);
  324. DECLARE_MSM_GPIO_PINS(80);
  325. DECLARE_MSM_GPIO_PINS(81);
  326. DECLARE_MSM_GPIO_PINS(82);
  327. DECLARE_MSM_GPIO_PINS(83);
  328. DECLARE_MSM_GPIO_PINS(84);
  329. DECLARE_MSM_GPIO_PINS(85);
  330. DECLARE_MSM_GPIO_PINS(86);
  331. DECLARE_MSM_GPIO_PINS(87);
  332. DECLARE_MSM_GPIO_PINS(88);
  333. DECLARE_MSM_GPIO_PINS(89);
  334. DECLARE_MSM_GPIO_PINS(90);
  335. DECLARE_MSM_GPIO_PINS(91);
  336. DECLARE_MSM_GPIO_PINS(92);
  337. DECLARE_MSM_GPIO_PINS(93);
  338. DECLARE_MSM_GPIO_PINS(94);
  339. DECLARE_MSM_GPIO_PINS(95);
  340. DECLARE_MSM_GPIO_PINS(96);
  341. DECLARE_MSM_GPIO_PINS(97);
  342. DECLARE_MSM_GPIO_PINS(98);
  343. DECLARE_MSM_GPIO_PINS(99);
  344. DECLARE_MSM_GPIO_PINS(100);
  345. DECLARE_MSM_GPIO_PINS(101);
  346. DECLARE_MSM_GPIO_PINS(102);
  347. DECLARE_MSM_GPIO_PINS(103);
  348. DECLARE_MSM_GPIO_PINS(104);
  349. DECLARE_MSM_GPIO_PINS(105);
  350. DECLARE_MSM_GPIO_PINS(106);
  351. DECLARE_MSM_GPIO_PINS(107);
  352. DECLARE_MSM_GPIO_PINS(108);
  353. DECLARE_MSM_GPIO_PINS(109);
  354. DECLARE_MSM_GPIO_PINS(110);
  355. DECLARE_MSM_GPIO_PINS(111);
  356. DECLARE_MSM_GPIO_PINS(112);
  357. DECLARE_MSM_GPIO_PINS(113);
  358. DECLARE_MSM_GPIO_PINS(114);
  359. DECLARE_MSM_GPIO_PINS(115);
  360. DECLARE_MSM_GPIO_PINS(116);
  361. DECLARE_MSM_GPIO_PINS(117);
  362. DECLARE_MSM_GPIO_PINS(118);
  363. static const unsigned int ufs_reset_pins[] = { 119 };
  364. static const unsigned int sdc1_rclk_pins[] = { 120 };
  365. static const unsigned int sdc1_clk_pins[] = { 121 };
  366. static const unsigned int sdc1_cmd_pins[] = { 122 };
  367. static const unsigned int sdc1_data_pins[] = { 123 };
  368. static const unsigned int sdc2_clk_pins[] = { 124 };
  369. static const unsigned int sdc2_cmd_pins[] = { 125 };
  370. static const unsigned int sdc2_data_pins[] = { 126 };
  371. enum sc7180_functions {
  372. msm_mux_adsp_ext,
  373. msm_mux_agera_pll,
  374. msm_mux_aoss_cti,
  375. msm_mux_atest_char,
  376. msm_mux_atest_char0,
  377. msm_mux_atest_char1,
  378. msm_mux_atest_char2,
  379. msm_mux_atest_char3,
  380. msm_mux_atest_tsens,
  381. msm_mux_atest_tsens2,
  382. msm_mux_atest_usb1,
  383. msm_mux_atest_usb2,
  384. msm_mux_atest_usb10,
  385. msm_mux_atest_usb11,
  386. msm_mux_atest_usb12,
  387. msm_mux_atest_usb13,
  388. msm_mux_atest_usb20,
  389. msm_mux_atest_usb21,
  390. msm_mux_atest_usb22,
  391. msm_mux_atest_usb23,
  392. msm_mux_audio_ref,
  393. msm_mux_btfm_slimbus,
  394. msm_mux_cam_mclk,
  395. msm_mux_cci_async,
  396. msm_mux_cci_i2c,
  397. msm_mux_cci_timer0,
  398. msm_mux_cci_timer1,
  399. msm_mux_cci_timer2,
  400. msm_mux_cci_timer3,
  401. msm_mux_cci_timer4,
  402. msm_mux_cri_trng,
  403. msm_mux_dbg_out,
  404. msm_mux_ddr_bist,
  405. msm_mux_ddr_pxi0,
  406. msm_mux_ddr_pxi1,
  407. msm_mux_ddr_pxi2,
  408. msm_mux_ddr_pxi3,
  409. msm_mux_dp_hot,
  410. msm_mux_edp_lcd,
  411. msm_mux_gcc_gp1,
  412. msm_mux_gcc_gp2,
  413. msm_mux_gcc_gp3,
  414. msm_mux_gpio,
  415. msm_mux_gp_pdm0,
  416. msm_mux_gp_pdm1,
  417. msm_mux_gp_pdm2,
  418. msm_mux_gps_tx,
  419. msm_mux_jitter_bist,
  420. msm_mux_ldo_en,
  421. msm_mux_ldo_update,
  422. msm_mux_lpass_ext,
  423. msm_mux_mdp_vsync,
  424. msm_mux_mdp_vsync0,
  425. msm_mux_mdp_vsync1,
  426. msm_mux_mdp_vsync2,
  427. msm_mux_mdp_vsync3,
  428. msm_mux_mi2s_1,
  429. msm_mux_mi2s_0,
  430. msm_mux_mi2s_2,
  431. msm_mux_mss_lte,
  432. msm_mux_m_voc,
  433. msm_mux_pa_indicator,
  434. msm_mux_phase_flag,
  435. msm_mux_PLL_BIST,
  436. msm_mux_pll_bypassnl,
  437. msm_mux_pll_reset,
  438. msm_mux_prng_rosc,
  439. msm_mux_qdss,
  440. msm_mux_qdss_cti,
  441. msm_mux_qlink_enable,
  442. msm_mux_qlink_request,
  443. msm_mux_qspi_clk,
  444. msm_mux_qspi_cs,
  445. msm_mux_qspi_data,
  446. msm_mux_qup00,
  447. msm_mux_qup01,
  448. msm_mux_qup02_i2c,
  449. msm_mux_qup02_uart,
  450. msm_mux_qup03,
  451. msm_mux_qup04_i2c,
  452. msm_mux_qup04_uart,
  453. msm_mux_qup05,
  454. msm_mux_qup10,
  455. msm_mux_qup11_i2c,
  456. msm_mux_qup11_uart,
  457. msm_mux_qup12,
  458. msm_mux_qup13_i2c,
  459. msm_mux_qup13_uart,
  460. msm_mux_qup14,
  461. msm_mux_qup15,
  462. msm_mux_sdc1_tb,
  463. msm_mux_sdc2_tb,
  464. msm_mux_sd_write,
  465. msm_mux_sp_cmu,
  466. msm_mux_tgu_ch0,
  467. msm_mux_tgu_ch1,
  468. msm_mux_tgu_ch2,
  469. msm_mux_tgu_ch3,
  470. msm_mux_tsense_pwm1,
  471. msm_mux_tsense_pwm2,
  472. msm_mux_uim1,
  473. msm_mux_uim2,
  474. msm_mux_uim_batt,
  475. msm_mux_usb_phy,
  476. msm_mux_vfr_1,
  477. msm_mux__V_GPIO,
  478. msm_mux__V_PPS_IN,
  479. msm_mux__V_PPS_OUT,
  480. msm_mux_vsense_trigger,
  481. msm_mux_wlan1_adc0,
  482. msm_mux_wlan1_adc1,
  483. msm_mux_wlan2_adc0,
  484. msm_mux_wlan2_adc1,
  485. msm_mux__,
  486. };
  487. static const char * const qup01_groups[] = {
  488. "gpio0", "gpio1", "gpio2", "gpio3", "gpio12", "gpio94",
  489. };
  490. static const char * const gpio_groups[] = {
  491. "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7",
  492. "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14",
  493. "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21",
  494. "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28",
  495. "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35",
  496. "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42",
  497. "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49",
  498. "gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56",
  499. "gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63",
  500. "gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70",
  501. "gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77",
  502. "gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84",
  503. "gpio85", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", "gpio91",
  504. "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98",
  505. "gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104",
  506. "gpio105", "gpio106", "gpio107", "gpio108", "gpio109", "gpio110",
  507. "gpio111", "gpio112", "gpio113", "gpio114", "gpio115", "gpio116",
  508. "gpio117", "gpio118",
  509. };
  510. static const char * const phase_flag_groups[] = {
  511. "gpio0", "gpio1", "gpio2", "gpio8", "gpio9",
  512. "gpio11", "gpio12", "gpio17", "gpio18", "gpio19",
  513. "gpio20", "gpio25", "gpio26", "gpio27", "gpio28",
  514. "gpio32", "gpio33", "gpio34", "gpio35", "gpio36",
  515. "gpio37", "gpio38", "gpio39", "gpio42", "gpio44",
  516. "gpio56", "gpio57", "gpio58", "gpio63", "gpio64",
  517. "gpio108", "gpio109",
  518. };
  519. static const char * const cri_trng_groups[] = {
  520. "gpio0", "gpio1", "gpio2",
  521. };
  522. static const char * const sp_cmu_groups[] = {
  523. "gpio3",
  524. };
  525. static const char * const dbg_out_groups[] = {
  526. "gpio3",
  527. };
  528. static const char * const qdss_cti_groups[] = {
  529. "gpio3", "gpio4", "gpio8", "gpio9", "gpio33", "gpio44", "gpio45",
  530. "gpio72",
  531. };
  532. static const char * const sdc1_tb_groups[] = {
  533. "gpio4",
  534. };
  535. static const char * const sdc2_tb_groups[] = {
  536. "gpio5",
  537. };
  538. static const char * const qup11_i2c_groups[] = {
  539. "gpio6", "gpio7",
  540. };
  541. static const char * const qup11_uart_groups[] = {
  542. "gpio6", "gpio7",
  543. };
  544. static const char * const ddr_bist_groups[] = {
  545. "gpio7", "gpio8", "gpio9", "gpio10",
  546. };
  547. static const char * const gp_pdm1_groups[] = {
  548. "gpio8", "gpio50",
  549. };
  550. static const char * const mdp_vsync_groups[] = {
  551. "gpio10", "gpio11", "gpio12", "gpio70", "gpio71",
  552. };
  553. static const char * const edp_lcd_groups[] = {
  554. "gpio11",
  555. };
  556. static const char * const ddr_pxi2_groups[] = {
  557. "gpio11", "gpio26",
  558. };
  559. static const char * const m_voc_groups[] = {
  560. "gpio12",
  561. };
  562. static const char * const wlan2_adc0_groups[] = {
  563. "gpio12",
  564. };
  565. static const char * const atest_usb10_groups[] = {
  566. "gpio12",
  567. };
  568. static const char * const ddr_pxi3_groups[] = {
  569. "gpio12", "gpio108",
  570. };
  571. static const char * const cam_mclk_groups[] = {
  572. "gpio13", "gpio14", "gpio15", "gpio16", "gpio23",
  573. };
  574. static const char * const pll_bypassnl_groups[] = {
  575. "gpio13",
  576. };
  577. static const char * const qdss_groups[] = {
  578. "gpio13", "gpio86", "gpio14", "gpio87",
  579. "gpio15", "gpio88", "gpio16", "gpio89",
  580. "gpio17", "gpio90", "gpio18", "gpio91",
  581. "gpio19", "gpio21", "gpio20", "gpio22",
  582. "gpio23", "gpio54", "gpio24", "gpio36",
  583. "gpio25", "gpio57", "gpio26", "gpio31",
  584. "gpio27", "gpio56", "gpio28", "gpio29",
  585. "gpio30", "gpio35", "gpio93", "gpio104",
  586. "gpio34", "gpio53", "gpio37", "gpio55",
  587. };
  588. static const char * const pll_reset_groups[] = {
  589. "gpio14",
  590. };
  591. static const char * const qup02_i2c_groups[] = {
  592. "gpio15", "gpio16",
  593. };
  594. static const char * const qup02_uart_groups[] = {
  595. "gpio15", "gpio16",
  596. };
  597. static const char * const cci_i2c_groups[] = {
  598. "gpio17", "gpio18", "gpio19", "gpio20", "gpio27", "gpio28",
  599. };
  600. static const char * const wlan1_adc0_groups[] = {
  601. "gpio17",
  602. };
  603. static const char * const atest_usb12_groups[] = {
  604. "gpio17",
  605. };
  606. static const char * const ddr_pxi1_groups[] = {
  607. "gpio17", "gpio44",
  608. };
  609. static const char * const atest_char_groups[] = {
  610. "gpio17",
  611. };
  612. static const char * const agera_pll_groups[] = {
  613. "gpio18",
  614. };
  615. static const char * const vsense_trigger_groups[] = {
  616. "gpio18",
  617. };
  618. static const char * const ddr_pxi0_groups[] = {
  619. "gpio18", "gpio27",
  620. };
  621. static const char * const atest_char3_groups[] = {
  622. "gpio18",
  623. };
  624. static const char * const atest_char2_groups[] = {
  625. "gpio19",
  626. };
  627. static const char * const atest_char1_groups[] = {
  628. "gpio20",
  629. };
  630. static const char * const cci_timer0_groups[] = {
  631. "gpio21",
  632. };
  633. static const char * const gcc_gp2_groups[] = {
  634. "gpio21",
  635. };
  636. static const char * const atest_char0_groups[] = {
  637. "gpio21",
  638. };
  639. static const char * const cci_timer1_groups[] = {
  640. "gpio22",
  641. };
  642. static const char * const gcc_gp3_groups[] = {
  643. "gpio22",
  644. };
  645. static const char * const cci_timer2_groups[] = {
  646. "gpio23",
  647. };
  648. static const char * const cci_timer3_groups[] = {
  649. "gpio24",
  650. };
  651. static const char * const cci_async_groups[] = {
  652. "gpio24", "gpio25", "gpio26",
  653. };
  654. static const char * const cci_timer4_groups[] = {
  655. "gpio25",
  656. };
  657. static const char * const qup05_groups[] = {
  658. "gpio25", "gpio26", "gpio27", "gpio28",
  659. };
  660. static const char * const atest_tsens_groups[] = {
  661. "gpio26",
  662. };
  663. static const char * const atest_usb11_groups[] = {
  664. "gpio26",
  665. };
  666. static const char * const PLL_BIST_groups[] = {
  667. "gpio27",
  668. };
  669. static const char * const sd_write_groups[] = {
  670. "gpio33",
  671. };
  672. static const char * const qup00_groups[] = {
  673. "gpio34", "gpio35", "gpio36", "gpio37",
  674. };
  675. static const char * const gp_pdm0_groups[] = {
  676. "gpio37", "gpio68",
  677. };
  678. static const char * const qup03_groups[] = {
  679. "gpio38", "gpio39", "gpio40", "gpio41",
  680. };
  681. static const char * const atest_tsens2_groups[] = {
  682. "gpio39",
  683. };
  684. static const char * const wlan2_adc1_groups[] = {
  685. "gpio39",
  686. };
  687. static const char * const atest_usb1_groups[] = {
  688. "gpio39",
  689. };
  690. static const char * const qup12_groups[] = {
  691. "gpio42", "gpio43", "gpio44", "gpio45",
  692. };
  693. static const char * const wlan1_adc1_groups[] = {
  694. "gpio44",
  695. };
  696. static const char * const atest_usb13_groups[] = {
  697. "gpio44",
  698. };
  699. static const char * const qup13_i2c_groups[] = {
  700. "gpio46", "gpio47",
  701. };
  702. static const char * const qup13_uart_groups[] = {
  703. "gpio46", "gpio47",
  704. };
  705. static const char * const gcc_gp1_groups[] = {
  706. "gpio48", "gpio56",
  707. };
  708. static const char * const mi2s_1_groups[] = {
  709. "gpio49", "gpio50", "gpio51", "gpio52",
  710. };
  711. static const char * const btfm_slimbus_groups[] = {
  712. "gpio49", "gpio50", "gpio51", "gpio52",
  713. };
  714. static const char * const atest_usb2_groups[] = {
  715. "gpio51",
  716. };
  717. static const char * const atest_usb23_groups[] = {
  718. "gpio52",
  719. };
  720. static const char * const mi2s_0_groups[] = {
  721. "gpio53", "gpio54", "gpio55", "gpio56",
  722. };
  723. static const char * const qup15_groups[] = {
  724. "gpio53", "gpio54", "gpio55", "gpio56",
  725. };
  726. static const char * const atest_usb22_groups[] = {
  727. "gpio53",
  728. };
  729. static const char * const atest_usb21_groups[] = {
  730. "gpio54",
  731. };
  732. static const char * const atest_usb20_groups[] = {
  733. "gpio55",
  734. };
  735. static const char * const lpass_ext_groups[] = {
  736. "gpio57", "gpio58",
  737. };
  738. static const char * const audio_ref_groups[] = {
  739. "gpio57",
  740. };
  741. static const char * const jitter_bist_groups[] = {
  742. "gpio57",
  743. };
  744. static const char * const gp_pdm2_groups[] = {
  745. "gpio57",
  746. };
  747. static const char * const qup10_groups[] = {
  748. "gpio59", "gpio60", "gpio61", "gpio62", "gpio68", "gpio72",
  749. };
  750. static const char * const tgu_ch3_groups[] = {
  751. "gpio62",
  752. };
  753. static const char * const qspi_clk_groups[] = {
  754. "gpio63",
  755. };
  756. static const char * const mdp_vsync0_groups[] = {
  757. "gpio63",
  758. };
  759. static const char * const mi2s_2_groups[] = {
  760. "gpio63", "gpio64", "gpio65", "gpio66",
  761. };
  762. static const char * const mdp_vsync1_groups[] = {
  763. "gpio63",
  764. };
  765. static const char * const mdp_vsync2_groups[] = {
  766. "gpio63",
  767. };
  768. static const char * const mdp_vsync3_groups[] = {
  769. "gpio63",
  770. };
  771. static const char * const tgu_ch0_groups[] = {
  772. "gpio63",
  773. };
  774. static const char * const qspi_data_groups[] = {
  775. "gpio64", "gpio65", "gpio66", "gpio67",
  776. };
  777. static const char * const tgu_ch1_groups[] = {
  778. "gpio64",
  779. };
  780. static const char * const vfr_1_groups[] = {
  781. "gpio65",
  782. };
  783. static const char * const tgu_ch2_groups[] = {
  784. "gpio65",
  785. };
  786. static const char * const qspi_cs_groups[] = {
  787. "gpio68", "gpio72",
  788. };
  789. static const char * const ldo_en_groups[] = {
  790. "gpio70",
  791. };
  792. static const char * const ldo_update_groups[] = {
  793. "gpio71",
  794. };
  795. static const char * const prng_rosc_groups[] = {
  796. "gpio72",
  797. };
  798. static const char * const uim2_groups[] = {
  799. "gpio75", "gpio76", "gpio77", "gpio78",
  800. };
  801. static const char * const uim1_groups[] = {
  802. "gpio79", "gpio80", "gpio81", "gpio82",
  803. };
  804. static const char * const _V_GPIO_groups[] = {
  805. "gpio83", "gpio84", "gpio107",
  806. };
  807. static const char * const _V_PPS_IN_groups[] = {
  808. "gpio83", "gpio84", "gpio107",
  809. };
  810. static const char * const _V_PPS_OUT_groups[] = {
  811. "gpio83", "gpio84", "gpio107",
  812. };
  813. static const char * const gps_tx_groups[] = {
  814. "gpio83", "gpio84", "gpio107", "gpio109",
  815. };
  816. static const char * const uim_batt_groups[] = {
  817. "gpio85",
  818. };
  819. static const char * const dp_hot_groups[] = {
  820. "gpio85", "gpio117",
  821. };
  822. static const char * const aoss_cti_groups[] = {
  823. "gpio85",
  824. };
  825. static const char * const qup14_groups[] = {
  826. "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", "gpio91",
  827. };
  828. static const char * const adsp_ext_groups[] = {
  829. "gpio87",
  830. };
  831. static const char * const tsense_pwm1_groups[] = {
  832. "gpio88",
  833. };
  834. static const char * const tsense_pwm2_groups[] = {
  835. "gpio88",
  836. };
  837. static const char * const qlink_request_groups[] = {
  838. "gpio96",
  839. };
  840. static const char * const qlink_enable_groups[] = {
  841. "gpio97",
  842. };
  843. static const char * const pa_indicator_groups[] = {
  844. "gpio99",
  845. };
  846. static const char * const usb_phy_groups[] = {
  847. "gpio104",
  848. };
  849. static const char * const mss_lte_groups[] = {
  850. "gpio108", "gpio109",
  851. };
  852. static const char * const qup04_i2c_groups[] = {
  853. "gpio115", "gpio116",
  854. };
  855. static const char * const qup04_uart_groups[] = {
  856. "gpio115", "gpio116",
  857. };
  858. static const struct msm_function sc7180_functions[] = {
  859. FUNCTION(adsp_ext),
  860. FUNCTION(agera_pll),
  861. FUNCTION(aoss_cti),
  862. FUNCTION(atest_char),
  863. FUNCTION(atest_char0),
  864. FUNCTION(atest_char1),
  865. FUNCTION(atest_char2),
  866. FUNCTION(atest_char3),
  867. FUNCTION(atest_tsens),
  868. FUNCTION(atest_tsens2),
  869. FUNCTION(atest_usb1),
  870. FUNCTION(atest_usb2),
  871. FUNCTION(atest_usb10),
  872. FUNCTION(atest_usb11),
  873. FUNCTION(atest_usb12),
  874. FUNCTION(atest_usb13),
  875. FUNCTION(atest_usb20),
  876. FUNCTION(atest_usb21),
  877. FUNCTION(atest_usb22),
  878. FUNCTION(atest_usb23),
  879. FUNCTION(audio_ref),
  880. FUNCTION(btfm_slimbus),
  881. FUNCTION(cam_mclk),
  882. FUNCTION(cci_async),
  883. FUNCTION(cci_i2c),
  884. FUNCTION(cci_timer0),
  885. FUNCTION(cci_timer1),
  886. FUNCTION(cci_timer2),
  887. FUNCTION(cci_timer3),
  888. FUNCTION(cci_timer4),
  889. FUNCTION(cri_trng),
  890. FUNCTION(dbg_out),
  891. FUNCTION(ddr_bist),
  892. FUNCTION(ddr_pxi0),
  893. FUNCTION(ddr_pxi1),
  894. FUNCTION(ddr_pxi2),
  895. FUNCTION(ddr_pxi3),
  896. FUNCTION(dp_hot),
  897. FUNCTION(edp_lcd),
  898. FUNCTION(gcc_gp1),
  899. FUNCTION(gcc_gp2),
  900. FUNCTION(gcc_gp3),
  901. FUNCTION(gpio),
  902. FUNCTION(gp_pdm0),
  903. FUNCTION(gp_pdm1),
  904. FUNCTION(gp_pdm2),
  905. FUNCTION(gps_tx),
  906. FUNCTION(jitter_bist),
  907. FUNCTION(ldo_en),
  908. FUNCTION(ldo_update),
  909. FUNCTION(lpass_ext),
  910. FUNCTION(mdp_vsync),
  911. FUNCTION(mdp_vsync0),
  912. FUNCTION(mdp_vsync1),
  913. FUNCTION(mdp_vsync2),
  914. FUNCTION(mdp_vsync3),
  915. FUNCTION(mi2s_0),
  916. FUNCTION(mi2s_1),
  917. FUNCTION(mi2s_2),
  918. FUNCTION(mss_lte),
  919. FUNCTION(m_voc),
  920. FUNCTION(pa_indicator),
  921. FUNCTION(phase_flag),
  922. FUNCTION(PLL_BIST),
  923. FUNCTION(pll_bypassnl),
  924. FUNCTION(pll_reset),
  925. FUNCTION(prng_rosc),
  926. FUNCTION(qdss),
  927. FUNCTION(qdss_cti),
  928. FUNCTION(qlink_enable),
  929. FUNCTION(qlink_request),
  930. FUNCTION(qspi_clk),
  931. FUNCTION(qspi_cs),
  932. FUNCTION(qspi_data),
  933. FUNCTION(qup00),
  934. FUNCTION(qup01),
  935. FUNCTION(qup02_i2c),
  936. FUNCTION(qup02_uart),
  937. FUNCTION(qup03),
  938. FUNCTION(qup04_i2c),
  939. FUNCTION(qup04_uart),
  940. FUNCTION(qup05),
  941. FUNCTION(qup10),
  942. FUNCTION(qup11_i2c),
  943. FUNCTION(qup11_uart),
  944. FUNCTION(qup12),
  945. FUNCTION(qup13_i2c),
  946. FUNCTION(qup13_uart),
  947. FUNCTION(qup14),
  948. FUNCTION(qup15),
  949. FUNCTION(sdc1_tb),
  950. FUNCTION(sdc2_tb),
  951. FUNCTION(sd_write),
  952. FUNCTION(sp_cmu),
  953. FUNCTION(tgu_ch0),
  954. FUNCTION(tgu_ch1),
  955. FUNCTION(tgu_ch2),
  956. FUNCTION(tgu_ch3),
  957. FUNCTION(tsense_pwm1),
  958. FUNCTION(tsense_pwm2),
  959. FUNCTION(uim1),
  960. FUNCTION(uim2),
  961. FUNCTION(uim_batt),
  962. FUNCTION(usb_phy),
  963. FUNCTION(vfr_1),
  964. FUNCTION(_V_GPIO),
  965. FUNCTION(_V_PPS_IN),
  966. FUNCTION(_V_PPS_OUT),
  967. FUNCTION(vsense_trigger),
  968. FUNCTION(wlan1_adc0),
  969. FUNCTION(wlan1_adc1),
  970. FUNCTION(wlan2_adc0),
  971. FUNCTION(wlan2_adc1),
  972. };
  973. /* Every pin is maintained as a single group, and missing or non-existing pin
  974. * would be maintained as dummy group to synchronize pin group index with
  975. * pin descriptor registered with pinctrl core.
  976. * Clients would not be able to request these dummy pin groups.
  977. */
  978. static const struct msm_pingroup sc7180_groups[] = {
  979. [0] = PINGROUP(0, SOUTH, qup01, cri_trng, _, phase_flag, _, _, _, _, _),
  980. [1] = PINGROUP(1, SOUTH, qup01, cri_trng, _, phase_flag, _, _, _, _, _),
  981. [2] = PINGROUP(2, SOUTH, qup01, cri_trng, _, phase_flag, _, _, _, _, _),
  982. [3] = PINGROUP(3, SOUTH, qup01, sp_cmu, dbg_out, qdss_cti, _, _, _, _, _),
  983. [4] = PINGROUP(4, NORTH, sdc1_tb, _, qdss_cti, _, _, _, _, _, _),
  984. [5] = PINGROUP(5, NORTH, sdc2_tb, _, _, _, _, _, _, _, _),
  985. [6] = PINGROUP(6, NORTH, qup11_i2c, qup11_uart, _, _, _, _, _, _, _),
  986. [7] = PINGROUP(7, NORTH, qup11_i2c, qup11_uart, ddr_bist, _, _, _, _, _, _),
  987. [8] = PINGROUP(8, NORTH, gp_pdm1, ddr_bist, _, phase_flag, qdss_cti, _, _, _, _),
  988. [9] = PINGROUP(9, NORTH, ddr_bist, _, phase_flag, qdss_cti, _, _, _, _, _),
  989. [10] = PINGROUP(10, NORTH, mdp_vsync, ddr_bist, _, _, _, _, _, _, _),
  990. [11] = PINGROUP(11, NORTH, mdp_vsync, edp_lcd, _, phase_flag, ddr_pxi2, _, _, _, _),
  991. [12] = PINGROUP(12, SOUTH, mdp_vsync, m_voc, qup01, _, phase_flag, wlan2_adc0, atest_usb10, ddr_pxi3, _),
  992. [13] = PINGROUP(13, SOUTH, cam_mclk, pll_bypassnl, qdss, _, _, _, _, _, _),
  993. [14] = PINGROUP(14, SOUTH, cam_mclk, pll_reset, qdss, _, _, _, _, _, _),
  994. [15] = PINGROUP(15, SOUTH, cam_mclk, qup02_i2c, qup02_uart, qdss, _, _, _, _, _),
  995. [16] = PINGROUP(16, SOUTH, cam_mclk, qup02_i2c, qup02_uart, qdss, _, _, _, _, _),
  996. [17] = PINGROUP(17, SOUTH, cci_i2c, _, phase_flag, qdss, _, wlan1_adc0, atest_usb12, ddr_pxi1, atest_char),
  997. [18] = PINGROUP(18, SOUTH, cci_i2c, agera_pll, _, phase_flag, qdss, vsense_trigger, ddr_pxi0, atest_char3, _),
  998. [19] = PINGROUP(19, SOUTH, cci_i2c, _, phase_flag, qdss, atest_char2, _, _, _, _),
  999. [20] = PINGROUP(20, SOUTH, cci_i2c, _, phase_flag, qdss, atest_char1, _, _, _, _),
  1000. [21] = PINGROUP(21, NORTH, cci_timer0, gcc_gp2, _, qdss, atest_char0, _, _, _, _),
  1001. [22] = PINGROUP(22, NORTH, cci_timer1, gcc_gp3, _, qdss, _, _, _, _, _),
  1002. [23] = PINGROUP(23, SOUTH, cci_timer2, cam_mclk, qdss, _, _, _, _, _, _),
  1003. [24] = PINGROUP(24, SOUTH, cci_timer3, cci_async, qdss, _, _, _, _, _, _),
  1004. [25] = PINGROUP(25, SOUTH, cci_timer4, cci_async, qup05, _, phase_flag, qdss, _, _, _),
  1005. [26] = PINGROUP(26, SOUTH, cci_async, qup05, _, phase_flag, qdss, atest_tsens, atest_usb11, ddr_pxi2, _),
  1006. [27] = PINGROUP(27, SOUTH, cci_i2c, qup05, PLL_BIST, _, phase_flag, qdss, ddr_pxi0, _, _),
  1007. [28] = PINGROUP(28, SOUTH, cci_i2c, qup05, _, phase_flag, qdss, _, _, _, _),
  1008. [29] = PINGROUP(29, NORTH, _, qdss, _, _, _, _, _, _, _),
  1009. [30] = PINGROUP(30, SOUTH, qdss, _, _, _, _, _, _, _, _),
  1010. [31] = PINGROUP(31, NORTH, _, qdss, _, _, _, _, _, _, _),
  1011. [32] = PINGROUP(32, NORTH, _, phase_flag, _, _, _, _, _, _, _),
  1012. [33] = PINGROUP(33, NORTH, sd_write, _, phase_flag, qdss_cti, _, _, _, _, _),
  1013. [34] = PINGROUP(34, SOUTH, qup00, _, phase_flag, qdss, _, _, _, _, _),
  1014. [35] = PINGROUP(35, SOUTH, qup00, _, phase_flag, qdss, _, _, _, _, _),
  1015. [36] = PINGROUP(36, SOUTH, qup00, _, phase_flag, qdss, _, _, _, _, _),
  1016. [37] = PINGROUP(37, SOUTH, qup00, gp_pdm0, _, phase_flag, qdss, _, _, _, _),
  1017. [38] = PINGROUP(38, SOUTH, qup03, _, phase_flag, _, _, _, _, _, _),
  1018. [39] = PINGROUP(39, SOUTH, qup03, _, phase_flag, atest_tsens2, wlan2_adc1, atest_usb1, _, _, _),
  1019. [40] = PINGROUP(40, SOUTH, qup03, _, _, _, _, _, _, _, _),
  1020. [41] = PINGROUP(41, SOUTH, qup03, _, _, _, _, _, _, _, _),
  1021. [42] = PINGROUP(42, NORTH, qup12, _, phase_flag, _, _, _, _, _, _),
  1022. [43] = PINGROUP(43, NORTH, qup12, _, _, _, _, _, _, _, _),
  1023. [44] = PINGROUP(44, NORTH, qup12, _, phase_flag, qdss_cti, wlan1_adc1, atest_usb13, ddr_pxi1, _, _),
  1024. [45] = PINGROUP(45, NORTH, qup12, qdss_cti, _, _, _, _, _, _, _),
  1025. [46] = PINGROUP(46, NORTH, qup13_i2c, qup13_uart, _, _, _, _, _, _, _),
  1026. [47] = PINGROUP(47, NORTH, qup13_i2c, qup13_uart, _, _, _, _, _, _, _),
  1027. [48] = PINGROUP(48, NORTH, gcc_gp1, _, _, _, _, _, _, _, _),
  1028. [49] = PINGROUP(49, WEST, mi2s_1, btfm_slimbus, _, _, _, _, _, _, _),
  1029. [50] = PINGROUP(50, WEST, mi2s_1, btfm_slimbus, gp_pdm1, _, _, _, _, _, _),
  1030. [51] = PINGROUP(51, WEST, mi2s_1, btfm_slimbus, atest_usb2, _, _, _, _, _, _),
  1031. [52] = PINGROUP(52, WEST, mi2s_1, btfm_slimbus, atest_usb23, _, _, _, _, _, _),
  1032. [53] = PINGROUP(53, WEST, mi2s_0, qup15, qdss, atest_usb22, _, _, _, _, _),
  1033. [54] = PINGROUP(54, WEST, mi2s_0, qup15, qdss, atest_usb21, _, _, _, _, _),
  1034. [55] = PINGROUP(55, WEST, mi2s_0, qup15, qdss, atest_usb20, _, _, _, _, _),
  1035. [56] = PINGROUP(56, WEST, mi2s_0, qup15, gcc_gp1, _, phase_flag, qdss, _, _, _),
  1036. [57] = PINGROUP(57, WEST, lpass_ext, audio_ref, jitter_bist, gp_pdm2, _, phase_flag, qdss, _, _),
  1037. [58] = PINGROUP(58, WEST, lpass_ext, _, phase_flag, _, _, _, _, _, _),
  1038. [59] = PINGROUP(59, NORTH, qup10, _, _, _, _, _, _, _, _),
  1039. [60] = PINGROUP(60, NORTH, qup10, _, _, _, _, _, _, _, _),
  1040. [61] = PINGROUP(61, NORTH, qup10, _, _, _, _, _, _, _, _),
  1041. [62] = PINGROUP(62, NORTH, qup10, tgu_ch3, _, _, _, _, _, _, _),
  1042. [63] = PINGROUP(63, NORTH, qspi_clk, mdp_vsync0, mi2s_2, mdp_vsync1, mdp_vsync2, mdp_vsync3, tgu_ch0, _, phase_flag),
  1043. [64] = PINGROUP(64, NORTH, qspi_data, mi2s_2, tgu_ch1, _, phase_flag, _, _, _, _),
  1044. [65] = PINGROUP(65, NORTH, qspi_data, mi2s_2, vfr_1, tgu_ch2, _, _, _, _, _),
  1045. [66] = PINGROUP(66, NORTH, qspi_data, mi2s_2, _, _, _, _, _, _, _),
  1046. [67] = PINGROUP(67, NORTH, qspi_data, _, _, _, _, _, _, _, _),
  1047. [68] = PINGROUP(68, NORTH, qspi_cs, qup10, gp_pdm0, _, _, _, _, _, _),
  1048. [69] = PINGROUP(69, WEST, _, _, _, _, _, _, _, _, _),
  1049. [70] = PINGROUP(70, NORTH, _, _, mdp_vsync, ldo_en, _, _, _, _, _),
  1050. [71] = PINGROUP(71, NORTH, _, mdp_vsync, ldo_update, _, _, _, _, _, _),
  1051. [72] = PINGROUP(72, NORTH, qspi_cs, qup10, prng_rosc, _, qdss_cti, _, _, _, _),
  1052. [73] = PINGROUP(73, WEST, _, _, _, _, _, _, _, _, _),
  1053. [74] = PINGROUP(74, WEST, _, _, _, _, _, _, _, _, _),
  1054. [75] = PINGROUP(75, WEST, uim2, _, _, _, _, _, _, _, _),
  1055. [76] = PINGROUP(76, WEST, uim2, _, _, _, _, _, _, _, _),
  1056. [77] = PINGROUP(77, WEST, uim2, _, _, _, _, _, _, _, _),
  1057. [78] = PINGROUP(78, WEST, uim2, _, _, _, _, _, _, _, _),
  1058. [79] = PINGROUP(79, WEST, uim1, _, _, _, _, _, _, _, _),
  1059. [80] = PINGROUP(80, WEST, uim1, _, _, _, _, _, _, _, _),
  1060. [81] = PINGROUP(81, WEST, uim1, _, _, _, _, _, _, _, _),
  1061. [82] = PINGROUP(82, WEST, uim1, _, _, _, _, _, _, _, _),
  1062. [83] = PINGROUP(83, WEST, _, _V_GPIO, _V_PPS_IN, _V_PPS_OUT, gps_tx, _, _, _, _),
  1063. [84] = PINGROUP(84, WEST, _, _V_GPIO, _V_PPS_IN, _V_PPS_OUT, gps_tx, _, _, _, _),
  1064. [85] = PINGROUP(85, WEST, uim_batt, dp_hot, aoss_cti, _, _, _, _, _, _),
  1065. [86] = PINGROUP(86, NORTH, qup14, qdss, _, _, _, _, _, _, _),
  1066. [87] = PINGROUP(87, NORTH, qup14, adsp_ext, qdss, _, _, _, _, _, _),
  1067. [88] = PINGROUP(88, NORTH, qup14, qdss, tsense_pwm1, tsense_pwm2, _, _, _, _, _),
  1068. [89] = PINGROUP(89, NORTH, qup14, qdss, _, _, _, _, _, _, _),
  1069. [90] = PINGROUP(90, NORTH, qup14, qdss, _, _, _, _, _, _, _),
  1070. [91] = PINGROUP(91, NORTH, qup14, qdss, _, _, _, _, _, _, _),
  1071. [92] = PINGROUP(92, NORTH, _, _, _, _, _, _, _, _, _),
  1072. [93] = PINGROUP(93, NORTH, qdss, _, _, _, _, _, _, _, _),
  1073. [94] = PINGROUP(94, SOUTH, qup01, _, _, _, _, _, _, _, _),
  1074. [95] = PINGROUP(95, WEST, _, _, _, _, _, _, _, _, _),
  1075. [96] = PINGROUP(96, WEST, qlink_request, _, _, _, _, _, _, _, _),
  1076. [97] = PINGROUP(97, WEST, qlink_enable, _, _, _, _, _, _, _, _),
  1077. [98] = PINGROUP(98, WEST, _, _, _, _, _, _, _, _, _),
  1078. [99] = PINGROUP(99, WEST, _, pa_indicator, _, _, _, _, _, _, _),
  1079. [100] = PINGROUP(100, WEST, _, _, _, _, _, _, _, _, _),
  1080. [101] = PINGROUP(101, NORTH, _, _, _, _, _, _, _, _, _),
  1081. [102] = PINGROUP(102, NORTH, _, _, _, _, _, _, _, _, _),
  1082. [103] = PINGROUP(103, NORTH, _, _, _, _, _, _, _, _, _),
  1083. [104] = PINGROUP(104, WEST, usb_phy, _, qdss, _, _, _, _, _, _),
  1084. [105] = PINGROUP(105, NORTH, _, _, _, _, _, _, _, _, _),
  1085. [106] = PINGROUP(106, NORTH, _, _, _, _, _, _, _, _, _),
  1086. [107] = PINGROUP(107, WEST, _, _V_GPIO, _V_PPS_IN, _V_PPS_OUT, gps_tx, _, _, _, _),
  1087. [108] = PINGROUP(108, SOUTH, mss_lte, _, phase_flag, ddr_pxi3, _, _, _, _, _),
  1088. [109] = PINGROUP(109, SOUTH, mss_lte, gps_tx, _, phase_flag, _, _, _, _, _),
  1089. [110] = PINGROUP(110, NORTH, _, _, _, _, _, _, _, _, _),
  1090. [111] = PINGROUP(111, NORTH, _, _, _, _, _, _, _, _, _),
  1091. [112] = PINGROUP(112, NORTH, _, _, _, _, _, _, _, _, _),
  1092. [113] = PINGROUP(113, NORTH, _, _, _, _, _, _, _, _, _),
  1093. [114] = PINGROUP(114, NORTH, _, _, _, _, _, _, _, _, _),
  1094. [115] = PINGROUP(115, WEST, qup04_i2c, qup04_uart, _, _, _, _, _, _, _),
  1095. [116] = PINGROUP(116, WEST, qup04_i2c, qup04_uart, _, _, _, _, _, _, _),
  1096. [117] = PINGROUP(117, WEST, dp_hot, _, _, _, _, _, _, _, _),
  1097. [118] = PINGROUP(118, WEST, _, _, _, _, _, _, _, _, _),
  1098. [119] = UFS_RESET(ufs_reset, 0x7f000),
  1099. [120] = SDC_QDSD_PINGROUP(sdc1_rclk, 0x7a000, 15, 0),
  1100. [121] = SDC_QDSD_PINGROUP(sdc1_clk, 0x7a000, 13, 6),
  1101. [122] = SDC_QDSD_PINGROUP(sdc1_cmd, 0x7a000, 11, 3),
  1102. [123] = SDC_QDSD_PINGROUP(sdc1_data, 0x7a000, 9, 0),
  1103. [124] = SDC_QDSD_PINGROUP(sdc2_clk, 0x7b000, 14, 6),
  1104. [125] = SDC_QDSD_PINGROUP(sdc2_cmd, 0x7b000, 11, 3),
  1105. [126] = SDC_QDSD_PINGROUP(sdc2_data, 0x7b000, 9, 0),
  1106. };
  1107. static const struct msm_gpio_wakeirq_map sc7180_pdc_map[] = {
  1108. {0, 40}, {3, 50}, {4, 42}, {5, 70}, {6, 41}, {9, 35},
  1109. {10, 80}, {11, 51}, {16, 20}, {21, 55}, {22, 90}, {23, 21},
  1110. {24, 61}, {26, 52}, {28, 36}, {30, 100}, {31, 33}, {32, 81},
  1111. {33, 62}, {34, 43}, {36, 91}, {37, 53}, {38, 63}, {39, 72},
  1112. {41, 101}, {42, 7}, {43, 34}, {45, 73}, {47, 82}, {49, 17},
  1113. {52, 109}, {53, 102}, {55, 92}, {56, 56}, {57, 57}, {58, 83},
  1114. {59, 37}, {62, 110}, {63, 111}, {64, 74}, {65, 44}, {66, 93},
  1115. {67, 58}, {68, 112}, {69, 32}, {70, 54}, {72, 59}, {73, 64},
  1116. {74, 71}, {78, 31}, {82, 30}, {85, 103}, {86, 38}, {87, 39},
  1117. {88, 45}, {89, 46}, {90, 47}, {91, 48}, {92, 60}, {93, 49},
  1118. {94, 84}, {95, 94}, {98, 65}, {101, 66}, {104, 67}, {109, 104},
  1119. {110, 68}, {113, 69}, {114, 113}, {115, 108}, {116, 121},
  1120. {117, 114}, {118, 119},
  1121. };
  1122. static const struct msm_pinctrl_soc_data sc7180_pinctrl = {
  1123. .pins = sc7180_pins,
  1124. .npins = ARRAY_SIZE(sc7180_pins),
  1125. .functions = sc7180_functions,
  1126. .nfunctions = ARRAY_SIZE(sc7180_functions),
  1127. .groups = sc7180_groups,
  1128. .ngroups = ARRAY_SIZE(sc7180_groups),
  1129. .ngpios = 120,
  1130. .tiles = sc7180_tiles,
  1131. .ntiles = ARRAY_SIZE(sc7180_tiles),
  1132. .wakeirq_map = sc7180_pdc_map,
  1133. .nwakeirq_map = ARRAY_SIZE(sc7180_pdc_map),
  1134. .wakeirq_dual_edge_errata = true,
  1135. };
  1136. static int sc7180_pinctrl_probe(struct platform_device *pdev)
  1137. {
  1138. return msm_pinctrl_probe(pdev, &sc7180_pinctrl);
  1139. }
  1140. static const struct of_device_id sc7180_pinctrl_of_match[] = {
  1141. { .compatible = "qcom,sc7180-pinctrl", },
  1142. { },
  1143. };
  1144. static struct platform_driver sc7180_pinctrl_driver = {
  1145. .driver = {
  1146. .name = "sc7180-pinctrl",
  1147. .pm = &msm_pinctrl_dev_pm_ops,
  1148. .of_match_table = sc7180_pinctrl_of_match,
  1149. },
  1150. .probe = sc7180_pinctrl_probe,
  1151. .remove = msm_pinctrl_remove,
  1152. };
  1153. static int __init sc7180_pinctrl_init(void)
  1154. {
  1155. return platform_driver_register(&sc7180_pinctrl_driver);
  1156. }
  1157. arch_initcall(sc7180_pinctrl_init);
  1158. static void __exit sc7180_pinctrl_exit(void)
  1159. {
  1160. platform_driver_unregister(&sc7180_pinctrl_driver);
  1161. }
  1162. module_exit(sc7180_pinctrl_exit);
  1163. MODULE_DESCRIPTION("QTI sc7180 pinctrl driver");
  1164. MODULE_LICENSE("GPL v2");
  1165. MODULE_DEVICE_TABLE(of, sc7180_pinctrl_of_match);