pinctrl-lemans.c 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2022-2024, Qualcomm Innovation Center, Inc. All rights reserved.
  4. */
  5. #include <linux/module.h>
  6. #include <linux/of.h>
  7. #include <linux/platform_device.h>
  8. #include <linux/pinctrl/pinctrl.h>
  9. #include "pinctrl-msm.h"
  10. #define FUNCTION(fname) \
  11. [msm_mux_##fname] = { \
  12. .name = #fname, \
  13. .groups = fname##_groups, \
  14. .ngroups = ARRAY_SIZE(fname##_groups), \
  15. }
  16. #define REG_BASE 0x100000
  17. #define REG_SIZE 0x1000
  18. #define REG_DIRCONN 0xb8000
  19. #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9, wake_off, bit) \
  20. { \
  21. .name = "gpio" #id, \
  22. .pins = gpio##id##_pins, \
  23. .npins = (unsigned int)ARRAY_SIZE(gpio##id##_pins), \
  24. .funcs = (int[]){ \
  25. msm_mux_gpio, /* gpio mode */ \
  26. msm_mux_##f1, \
  27. msm_mux_##f2, \
  28. msm_mux_##f3, \
  29. msm_mux_##f4, \
  30. msm_mux_##f5, \
  31. msm_mux_##f6, \
  32. msm_mux_##f7, \
  33. msm_mux_##f8, \
  34. msm_mux_##f9 \
  35. }, \
  36. .nfuncs = 10, \
  37. .ctl_reg = REG_BASE + REG_SIZE * id, \
  38. .io_reg = REG_BASE + 0x4 + REG_SIZE * id, \
  39. .intr_cfg_reg = REG_BASE + 0x8 + REG_SIZE * id, \
  40. .intr_status_reg = REG_BASE + 0xc + REG_SIZE * id, \
  41. .intr_target_reg = REG_BASE + 0x8 + REG_SIZE * id, \
  42. .dir_conn_reg = REG_BASE + REG_DIRCONN, \
  43. .mux_bit = 2, \
  44. .pull_bit = 0, \
  45. .drv_bit = 6, \
  46. .oe_bit = 9, \
  47. .in_bit = 0, \
  48. .out_bit = 1, \
  49. .intr_enable_bit = 0, \
  50. .intr_status_bit = 0, \
  51. .intr_target_bit = 5, \
  52. .intr_target_width = 4, \
  53. .intr_target_kpss_val = 3, \
  54. .intr_raw_status_bit = 4, \
  55. .intr_polarity_bit = 1, \
  56. .intr_detection_bit = 2, \
  57. .intr_detection_width = 2, \
  58. .dir_conn_en_bit = 9, \
  59. .wake_reg = REG_BASE + wake_off, \
  60. .wake_bit = bit, \
  61. }
  62. #define SDC_QDSD_PINGROUP(pg_name, ctl, pull, drv) \
  63. { \
  64. .name = #pg_name, \
  65. .pins = pg_name##_pins, \
  66. .npins = (unsigned int)ARRAY_SIZE(pg_name##_pins), \
  67. .ctl_reg = ctl, \
  68. .io_reg = 0, \
  69. .intr_cfg_reg = 0, \
  70. .intr_status_reg = 0, \
  71. .intr_target_reg = 0, \
  72. .mux_bit = -1, \
  73. .pull_bit = pull, \
  74. .drv_bit = drv, \
  75. .oe_bit = -1, \
  76. .in_bit = -1, \
  77. .out_bit = -1, \
  78. .intr_enable_bit = -1, \
  79. .intr_status_bit = -1, \
  80. .intr_target_bit = -1, \
  81. .intr_raw_status_bit = -1, \
  82. .intr_polarity_bit = -1, \
  83. .intr_detection_bit = -1, \
  84. .intr_detection_width = -1, \
  85. }
  86. #define UFS_RESET(pg_name, offset) \
  87. { \
  88. .name = #pg_name, \
  89. .pins = pg_name##_pins, \
  90. .npins = (unsigned int)ARRAY_SIZE(pg_name##_pins), \
  91. .ctl_reg = offset, \
  92. .io_reg = offset + 0x4, \
  93. .intr_cfg_reg = 0, \
  94. .intr_status_reg = 0, \
  95. .intr_target_reg = 0, \
  96. .mux_bit = -1, \
  97. .pull_bit = 3, \
  98. .drv_bit = 0, \
  99. .oe_bit = -1, \
  100. .in_bit = -1, \
  101. .out_bit = 0, \
  102. .intr_enable_bit = -1, \
  103. .intr_status_bit = -1, \
  104. .intr_target_bit = -1, \
  105. .intr_raw_status_bit = -1, \
  106. .intr_polarity_bit = -1, \
  107. .intr_detection_bit = -1, \
  108. .intr_detection_width = -1, \
  109. }
  110. #define QUP_I3C(qup_mode, qup_offset) \
  111. { \
  112. .mode = qup_mode, \
  113. .offset = qup_offset, \
  114. }
  115. #define QUP_I3C_6_MODE_OFFSET 0xAF000
  116. #define QUP_I3C_7_MODE_OFFSET 0xB0000
  117. #define QUP_I3C_13_MODE_OFFSET 0xB1000
  118. #define QUP_I3C_14_MODE_OFFSET 0xB2000
  119. static const struct pinctrl_pin_desc lemans_pins[] = {
  120. PINCTRL_PIN(0, "GPIO_0"),
  121. PINCTRL_PIN(1, "GPIO_1"),
  122. PINCTRL_PIN(2, "GPIO_2"),
  123. PINCTRL_PIN(3, "GPIO_3"),
  124. PINCTRL_PIN(4, "GPIO_4"),
  125. PINCTRL_PIN(5, "GPIO_5"),
  126. PINCTRL_PIN(6, "GPIO_6"),
  127. PINCTRL_PIN(7, "GPIO_7"),
  128. PINCTRL_PIN(8, "GPIO_8"),
  129. PINCTRL_PIN(9, "GPIO_9"),
  130. PINCTRL_PIN(10, "GPIO_10"),
  131. PINCTRL_PIN(11, "GPIO_11"),
  132. PINCTRL_PIN(12, "GPIO_12"),
  133. PINCTRL_PIN(13, "GPIO_13"),
  134. PINCTRL_PIN(14, "GPIO_14"),
  135. PINCTRL_PIN(15, "GPIO_15"),
  136. PINCTRL_PIN(16, "GPIO_16"),
  137. PINCTRL_PIN(17, "GPIO_17"),
  138. PINCTRL_PIN(18, "GPIO_18"),
  139. PINCTRL_PIN(19, "GPIO_19"),
  140. PINCTRL_PIN(20, "GPIO_20"),
  141. PINCTRL_PIN(21, "GPIO_21"),
  142. PINCTRL_PIN(22, "GPIO_22"),
  143. PINCTRL_PIN(23, "GPIO_23"),
  144. PINCTRL_PIN(24, "GPIO_24"),
  145. PINCTRL_PIN(25, "GPIO_25"),
  146. PINCTRL_PIN(26, "GPIO_26"),
  147. PINCTRL_PIN(27, "GPIO_27"),
  148. PINCTRL_PIN(28, "GPIO_28"),
  149. PINCTRL_PIN(29, "GPIO_29"),
  150. PINCTRL_PIN(30, "GPIO_30"),
  151. PINCTRL_PIN(31, "GPIO_31"),
  152. PINCTRL_PIN(32, "GPIO_32"),
  153. PINCTRL_PIN(33, "GPIO_33"),
  154. PINCTRL_PIN(34, "GPIO_34"),
  155. PINCTRL_PIN(35, "GPIO_35"),
  156. PINCTRL_PIN(36, "GPIO_36"),
  157. PINCTRL_PIN(37, "GPIO_37"),
  158. PINCTRL_PIN(38, "GPIO_38"),
  159. PINCTRL_PIN(39, "GPIO_39"),
  160. PINCTRL_PIN(40, "GPIO_40"),
  161. PINCTRL_PIN(41, "GPIO_41"),
  162. PINCTRL_PIN(42, "GPIO_42"),
  163. PINCTRL_PIN(43, "GPIO_43"),
  164. PINCTRL_PIN(44, "GPIO_44"),
  165. PINCTRL_PIN(45, "GPIO_45"),
  166. PINCTRL_PIN(46, "GPIO_46"),
  167. PINCTRL_PIN(47, "GPIO_47"),
  168. PINCTRL_PIN(48, "GPIO_48"),
  169. PINCTRL_PIN(49, "GPIO_49"),
  170. PINCTRL_PIN(50, "GPIO_50"),
  171. PINCTRL_PIN(51, "GPIO_51"),
  172. PINCTRL_PIN(52, "GPIO_52"),
  173. PINCTRL_PIN(53, "GPIO_53"),
  174. PINCTRL_PIN(54, "GPIO_54"),
  175. PINCTRL_PIN(55, "GPIO_55"),
  176. PINCTRL_PIN(56, "GPIO_56"),
  177. PINCTRL_PIN(57, "GPIO_57"),
  178. PINCTRL_PIN(58, "GPIO_58"),
  179. PINCTRL_PIN(59, "GPIO_59"),
  180. PINCTRL_PIN(60, "GPIO_60"),
  181. PINCTRL_PIN(61, "GPIO_61"),
  182. PINCTRL_PIN(62, "GPIO_62"),
  183. PINCTRL_PIN(63, "GPIO_63"),
  184. PINCTRL_PIN(64, "GPIO_64"),
  185. PINCTRL_PIN(65, "GPIO_65"),
  186. PINCTRL_PIN(66, "GPIO_66"),
  187. PINCTRL_PIN(67, "GPIO_67"),
  188. PINCTRL_PIN(68, "GPIO_68"),
  189. PINCTRL_PIN(69, "GPIO_69"),
  190. PINCTRL_PIN(70, "GPIO_70"),
  191. PINCTRL_PIN(71, "GPIO_71"),
  192. PINCTRL_PIN(72, "GPIO_72"),
  193. PINCTRL_PIN(73, "GPIO_73"),
  194. PINCTRL_PIN(74, "GPIO_74"),
  195. PINCTRL_PIN(75, "GPIO_75"),
  196. PINCTRL_PIN(76, "GPIO_76"),
  197. PINCTRL_PIN(77, "GPIO_77"),
  198. PINCTRL_PIN(78, "GPIO_78"),
  199. PINCTRL_PIN(79, "GPIO_79"),
  200. PINCTRL_PIN(80, "GPIO_80"),
  201. PINCTRL_PIN(81, "GPIO_81"),
  202. PINCTRL_PIN(82, "GPIO_82"),
  203. PINCTRL_PIN(83, "GPIO_83"),
  204. PINCTRL_PIN(84, "GPIO_84"),
  205. PINCTRL_PIN(85, "GPIO_85"),
  206. PINCTRL_PIN(86, "GPIO_86"),
  207. PINCTRL_PIN(87, "GPIO_87"),
  208. PINCTRL_PIN(88, "GPIO_88"),
  209. PINCTRL_PIN(89, "GPIO_89"),
  210. PINCTRL_PIN(90, "GPIO_90"),
  211. PINCTRL_PIN(91, "GPIO_91"),
  212. PINCTRL_PIN(92, "GPIO_92"),
  213. PINCTRL_PIN(93, "GPIO_93"),
  214. PINCTRL_PIN(94, "GPIO_94"),
  215. PINCTRL_PIN(95, "GPIO_95"),
  216. PINCTRL_PIN(96, "GPIO_96"),
  217. PINCTRL_PIN(97, "GPIO_97"),
  218. PINCTRL_PIN(98, "GPIO_98"),
  219. PINCTRL_PIN(99, "GPIO_99"),
  220. PINCTRL_PIN(100, "GPIO_100"),
  221. PINCTRL_PIN(101, "GPIO_101"),
  222. PINCTRL_PIN(102, "GPIO_102"),
  223. PINCTRL_PIN(103, "GPIO_103"),
  224. PINCTRL_PIN(104, "GPIO_104"),
  225. PINCTRL_PIN(105, "GPIO_105"),
  226. PINCTRL_PIN(106, "GPIO_106"),
  227. PINCTRL_PIN(107, "GPIO_107"),
  228. PINCTRL_PIN(108, "GPIO_108"),
  229. PINCTRL_PIN(109, "GPIO_109"),
  230. PINCTRL_PIN(110, "GPIO_110"),
  231. PINCTRL_PIN(111, "GPIO_111"),
  232. PINCTRL_PIN(112, "GPIO_112"),
  233. PINCTRL_PIN(113, "GPIO_113"),
  234. PINCTRL_PIN(114, "GPIO_114"),
  235. PINCTRL_PIN(115, "GPIO_115"),
  236. PINCTRL_PIN(116, "GPIO_116"),
  237. PINCTRL_PIN(117, "GPIO_117"),
  238. PINCTRL_PIN(118, "GPIO_118"),
  239. PINCTRL_PIN(119, "GPIO_119"),
  240. PINCTRL_PIN(120, "GPIO_120"),
  241. PINCTRL_PIN(121, "GPIO_121"),
  242. PINCTRL_PIN(122, "GPIO_122"),
  243. PINCTRL_PIN(123, "GPIO_123"),
  244. PINCTRL_PIN(124, "GPIO_124"),
  245. PINCTRL_PIN(125, "GPIO_125"),
  246. PINCTRL_PIN(126, "GPIO_126"),
  247. PINCTRL_PIN(127, "GPIO_127"),
  248. PINCTRL_PIN(128, "GPIO_128"),
  249. PINCTRL_PIN(129, "GPIO_129"),
  250. PINCTRL_PIN(130, "GPIO_130"),
  251. PINCTRL_PIN(131, "GPIO_131"),
  252. PINCTRL_PIN(132, "GPIO_132"),
  253. PINCTRL_PIN(133, "GPIO_133"),
  254. PINCTRL_PIN(134, "GPIO_134"),
  255. PINCTRL_PIN(135, "GPIO_135"),
  256. PINCTRL_PIN(136, "GPIO_136"),
  257. PINCTRL_PIN(137, "GPIO_137"),
  258. PINCTRL_PIN(138, "GPIO_138"),
  259. PINCTRL_PIN(139, "GPIO_139"),
  260. PINCTRL_PIN(140, "GPIO_140"),
  261. PINCTRL_PIN(141, "GPIO_141"),
  262. PINCTRL_PIN(142, "GPIO_142"),
  263. PINCTRL_PIN(143, "GPIO_143"),
  264. PINCTRL_PIN(144, "GPIO_144"),
  265. PINCTRL_PIN(145, "GPIO_145"),
  266. PINCTRL_PIN(146, "GPIO_146"),
  267. PINCTRL_PIN(147, "GPIO_147"),
  268. PINCTRL_PIN(148, "GPIO_148"),
  269. PINCTRL_PIN(149, "UFS_RESET"),
  270. PINCTRL_PIN(150, "UFS1_RESET"),
  271. PINCTRL_PIN(151, "SDC1_RCLK"),
  272. PINCTRL_PIN(152, "SDC1_CLK"),
  273. PINCTRL_PIN(153, "SDC1_CMD"),
  274. PINCTRL_PIN(154, "SDC1_DATA"),
  275. };
  276. #define DECLARE_MSM_GPIO_PINS(pin) \
  277. static const unsigned int gpio##pin##_pins[] = { pin }
  278. DECLARE_MSM_GPIO_PINS(0);
  279. DECLARE_MSM_GPIO_PINS(1);
  280. DECLARE_MSM_GPIO_PINS(2);
  281. DECLARE_MSM_GPIO_PINS(3);
  282. DECLARE_MSM_GPIO_PINS(4);
  283. DECLARE_MSM_GPIO_PINS(5);
  284. DECLARE_MSM_GPIO_PINS(6);
  285. DECLARE_MSM_GPIO_PINS(7);
  286. DECLARE_MSM_GPIO_PINS(8);
  287. DECLARE_MSM_GPIO_PINS(9);
  288. DECLARE_MSM_GPIO_PINS(10);
  289. DECLARE_MSM_GPIO_PINS(11);
  290. DECLARE_MSM_GPIO_PINS(12);
  291. DECLARE_MSM_GPIO_PINS(13);
  292. DECLARE_MSM_GPIO_PINS(14);
  293. DECLARE_MSM_GPIO_PINS(15);
  294. DECLARE_MSM_GPIO_PINS(16);
  295. DECLARE_MSM_GPIO_PINS(17);
  296. DECLARE_MSM_GPIO_PINS(18);
  297. DECLARE_MSM_GPIO_PINS(19);
  298. DECLARE_MSM_GPIO_PINS(20);
  299. DECLARE_MSM_GPIO_PINS(21);
  300. DECLARE_MSM_GPIO_PINS(22);
  301. DECLARE_MSM_GPIO_PINS(23);
  302. DECLARE_MSM_GPIO_PINS(24);
  303. DECLARE_MSM_GPIO_PINS(25);
  304. DECLARE_MSM_GPIO_PINS(26);
  305. DECLARE_MSM_GPIO_PINS(27);
  306. DECLARE_MSM_GPIO_PINS(28);
  307. DECLARE_MSM_GPIO_PINS(29);
  308. DECLARE_MSM_GPIO_PINS(30);
  309. DECLARE_MSM_GPIO_PINS(31);
  310. DECLARE_MSM_GPIO_PINS(32);
  311. DECLARE_MSM_GPIO_PINS(33);
  312. DECLARE_MSM_GPIO_PINS(34);
  313. DECLARE_MSM_GPIO_PINS(35);
  314. DECLARE_MSM_GPIO_PINS(36);
  315. DECLARE_MSM_GPIO_PINS(37);
  316. DECLARE_MSM_GPIO_PINS(38);
  317. DECLARE_MSM_GPIO_PINS(39);
  318. DECLARE_MSM_GPIO_PINS(40);
  319. DECLARE_MSM_GPIO_PINS(41);
  320. DECLARE_MSM_GPIO_PINS(42);
  321. DECLARE_MSM_GPIO_PINS(43);
  322. DECLARE_MSM_GPIO_PINS(44);
  323. DECLARE_MSM_GPIO_PINS(45);
  324. DECLARE_MSM_GPIO_PINS(46);
  325. DECLARE_MSM_GPIO_PINS(47);
  326. DECLARE_MSM_GPIO_PINS(48);
  327. DECLARE_MSM_GPIO_PINS(49);
  328. DECLARE_MSM_GPIO_PINS(50);
  329. DECLARE_MSM_GPIO_PINS(51);
  330. DECLARE_MSM_GPIO_PINS(52);
  331. DECLARE_MSM_GPIO_PINS(53);
  332. DECLARE_MSM_GPIO_PINS(54);
  333. DECLARE_MSM_GPIO_PINS(55);
  334. DECLARE_MSM_GPIO_PINS(56);
  335. DECLARE_MSM_GPIO_PINS(57);
  336. DECLARE_MSM_GPIO_PINS(58);
  337. DECLARE_MSM_GPIO_PINS(59);
  338. DECLARE_MSM_GPIO_PINS(60);
  339. DECLARE_MSM_GPIO_PINS(61);
  340. DECLARE_MSM_GPIO_PINS(62);
  341. DECLARE_MSM_GPIO_PINS(63);
  342. DECLARE_MSM_GPIO_PINS(64);
  343. DECLARE_MSM_GPIO_PINS(65);
  344. DECLARE_MSM_GPIO_PINS(66);
  345. DECLARE_MSM_GPIO_PINS(67);
  346. DECLARE_MSM_GPIO_PINS(68);
  347. DECLARE_MSM_GPIO_PINS(69);
  348. DECLARE_MSM_GPIO_PINS(70);
  349. DECLARE_MSM_GPIO_PINS(71);
  350. DECLARE_MSM_GPIO_PINS(72);
  351. DECLARE_MSM_GPIO_PINS(73);
  352. DECLARE_MSM_GPIO_PINS(74);
  353. DECLARE_MSM_GPIO_PINS(75);
  354. DECLARE_MSM_GPIO_PINS(76);
  355. DECLARE_MSM_GPIO_PINS(77);
  356. DECLARE_MSM_GPIO_PINS(78);
  357. DECLARE_MSM_GPIO_PINS(79);
  358. DECLARE_MSM_GPIO_PINS(80);
  359. DECLARE_MSM_GPIO_PINS(81);
  360. DECLARE_MSM_GPIO_PINS(82);
  361. DECLARE_MSM_GPIO_PINS(83);
  362. DECLARE_MSM_GPIO_PINS(84);
  363. DECLARE_MSM_GPIO_PINS(85);
  364. DECLARE_MSM_GPIO_PINS(86);
  365. DECLARE_MSM_GPIO_PINS(87);
  366. DECLARE_MSM_GPIO_PINS(88);
  367. DECLARE_MSM_GPIO_PINS(89);
  368. DECLARE_MSM_GPIO_PINS(90);
  369. DECLARE_MSM_GPIO_PINS(91);
  370. DECLARE_MSM_GPIO_PINS(92);
  371. DECLARE_MSM_GPIO_PINS(93);
  372. DECLARE_MSM_GPIO_PINS(94);
  373. DECLARE_MSM_GPIO_PINS(95);
  374. DECLARE_MSM_GPIO_PINS(96);
  375. DECLARE_MSM_GPIO_PINS(97);
  376. DECLARE_MSM_GPIO_PINS(98);
  377. DECLARE_MSM_GPIO_PINS(99);
  378. DECLARE_MSM_GPIO_PINS(100);
  379. DECLARE_MSM_GPIO_PINS(101);
  380. DECLARE_MSM_GPIO_PINS(102);
  381. DECLARE_MSM_GPIO_PINS(103);
  382. DECLARE_MSM_GPIO_PINS(104);
  383. DECLARE_MSM_GPIO_PINS(105);
  384. DECLARE_MSM_GPIO_PINS(106);
  385. DECLARE_MSM_GPIO_PINS(107);
  386. DECLARE_MSM_GPIO_PINS(108);
  387. DECLARE_MSM_GPIO_PINS(109);
  388. DECLARE_MSM_GPIO_PINS(110);
  389. DECLARE_MSM_GPIO_PINS(111);
  390. DECLARE_MSM_GPIO_PINS(112);
  391. DECLARE_MSM_GPIO_PINS(113);
  392. DECLARE_MSM_GPIO_PINS(114);
  393. DECLARE_MSM_GPIO_PINS(115);
  394. DECLARE_MSM_GPIO_PINS(116);
  395. DECLARE_MSM_GPIO_PINS(117);
  396. DECLARE_MSM_GPIO_PINS(118);
  397. DECLARE_MSM_GPIO_PINS(119);
  398. DECLARE_MSM_GPIO_PINS(120);
  399. DECLARE_MSM_GPIO_PINS(121);
  400. DECLARE_MSM_GPIO_PINS(122);
  401. DECLARE_MSM_GPIO_PINS(123);
  402. DECLARE_MSM_GPIO_PINS(124);
  403. DECLARE_MSM_GPIO_PINS(125);
  404. DECLARE_MSM_GPIO_PINS(126);
  405. DECLARE_MSM_GPIO_PINS(127);
  406. DECLARE_MSM_GPIO_PINS(128);
  407. DECLARE_MSM_GPIO_PINS(129);
  408. DECLARE_MSM_GPIO_PINS(130);
  409. DECLARE_MSM_GPIO_PINS(131);
  410. DECLARE_MSM_GPIO_PINS(132);
  411. DECLARE_MSM_GPIO_PINS(133);
  412. DECLARE_MSM_GPIO_PINS(134);
  413. DECLARE_MSM_GPIO_PINS(135);
  414. DECLARE_MSM_GPIO_PINS(136);
  415. DECLARE_MSM_GPIO_PINS(137);
  416. DECLARE_MSM_GPIO_PINS(138);
  417. DECLARE_MSM_GPIO_PINS(139);
  418. DECLARE_MSM_GPIO_PINS(140);
  419. DECLARE_MSM_GPIO_PINS(141);
  420. DECLARE_MSM_GPIO_PINS(142);
  421. DECLARE_MSM_GPIO_PINS(143);
  422. DECLARE_MSM_GPIO_PINS(144);
  423. DECLARE_MSM_GPIO_PINS(145);
  424. DECLARE_MSM_GPIO_PINS(146);
  425. DECLARE_MSM_GPIO_PINS(147);
  426. DECLARE_MSM_GPIO_PINS(148);
  427. static const unsigned int ufs_reset_pins[] = { 149 };
  428. static const unsigned int ufs1_reset_pins[] = { 150 };
  429. static const unsigned int sdc1_rclk_pins[] = { 151 };
  430. static const unsigned int sdc1_clk_pins[] = { 152 };
  431. static const unsigned int sdc1_cmd_pins[] = { 153 };
  432. static const unsigned int sdc1_data_pins[] = { 154 };
  433. enum lemans_functions {
  434. msm_mux_gpio,
  435. msm_mux_atest_char,
  436. msm_mux_atest_char0,
  437. msm_mux_atest_char1,
  438. msm_mux_atest_char2,
  439. msm_mux_atest_char3,
  440. msm_mux_atest_usb2,
  441. msm_mux_atest_usb20,
  442. msm_mux_atest_usb21,
  443. msm_mux_atest_usb22,
  444. msm_mux_atest_usb23,
  445. msm_mux_audio_ref,
  446. msm_mux_cam_mclk,
  447. msm_mux_cci_async,
  448. msm_mux_cci_i2c,
  449. msm_mux_cci_timer0,
  450. msm_mux_cci_timer1,
  451. msm_mux_cci_timer2,
  452. msm_mux_cci_timer3,
  453. msm_mux_cci_timer4,
  454. msm_mux_cci_timer5,
  455. msm_mux_cci_timer6,
  456. msm_mux_cci_timer7,
  457. msm_mux_cci_timer8,
  458. msm_mux_cci_timer9,
  459. msm_mux_cri_trng,
  460. msm_mux_cri_trng0,
  461. msm_mux_cri_trng1,
  462. msm_mux_dbg_out,
  463. msm_mux_ddr_bist,
  464. msm_mux_ddr_pxi0,
  465. msm_mux_ddr_pxi1,
  466. msm_mux_ddr_pxi2,
  467. msm_mux_ddr_pxi3,
  468. msm_mux_ddr_pxi4,
  469. msm_mux_ddr_pxi5,
  470. msm_mux_edp0_hot,
  471. msm_mux_edp0_lcd,
  472. msm_mux_edp1_hot,
  473. msm_mux_edp1_lcd,
  474. msm_mux_edp2_hot,
  475. msm_mux_edp2_lcd,
  476. msm_mux_edp3_hot,
  477. msm_mux_edp3_lcd,
  478. msm_mux_emac0_mcg0,
  479. msm_mux_emac0_mcg1,
  480. msm_mux_emac0_mcg2,
  481. msm_mux_emac0_mcg3,
  482. msm_mux_emac0_mdc,
  483. msm_mux_emac0_mdio,
  484. msm_mux_emac0_ptp,
  485. msm_mux_emac1_mcg0,
  486. msm_mux_emac1_mcg1,
  487. msm_mux_emac1_mcg2,
  488. msm_mux_emac1_mcg3,
  489. msm_mux_emac1_mdc,
  490. msm_mux_emac1_mdio,
  491. msm_mux_emac1_ptp,
  492. msm_mux_gcc_gp1,
  493. msm_mux_gcc_gp2,
  494. msm_mux_gcc_gp3,
  495. msm_mux_gcc_gp4,
  496. msm_mux_gcc_gp5,
  497. msm_mux_hs0_mi2s,
  498. msm_mux_hs1_mi2s,
  499. msm_mux_hs2_mi2s,
  500. msm_mux_ibi_i3c,
  501. msm_mux_jitter_bist,
  502. msm_mux_mdp0_vsync0,
  503. msm_mux_mdp0_vsync1,
  504. msm_mux_mdp0_vsync2,
  505. msm_mux_mdp0_vsync3,
  506. msm_mux_mdp0_vsync4,
  507. msm_mux_mdp0_vsync5,
  508. msm_mux_mdp0_vsync6,
  509. msm_mux_mdp0_vsync7,
  510. msm_mux_mdp0_vsync8,
  511. msm_mux_mdp1_vsync0,
  512. msm_mux_mdp1_vsync1,
  513. msm_mux_mdp1_vsync2,
  514. msm_mux_mdp1_vsync3,
  515. msm_mux_mdp1_vsync4,
  516. msm_mux_mdp1_vsync5,
  517. msm_mux_mdp1_vsync6,
  518. msm_mux_mdp1_vsync7,
  519. msm_mux_mdp1_vsync8,
  520. msm_mux_mdp_vsync,
  521. msm_mux_mi2s1_data0,
  522. msm_mux_mi2s1_data1,
  523. msm_mux_mi2s1_sck,
  524. msm_mux_mi2s1_ws,
  525. msm_mux_mi2s2_data0,
  526. msm_mux_mi2s2_data1,
  527. msm_mux_mi2s2_sck,
  528. msm_mux_mi2s2_ws,
  529. msm_mux_mi2s_mclk0,
  530. msm_mux_mi2s_mclk1,
  531. msm_mux_pcie0_clkreq,
  532. msm_mux_pcie1_clkreq,
  533. msm_mux_phase_flag0,
  534. msm_mux_phase_flag1,
  535. msm_mux_phase_flag10,
  536. msm_mux_phase_flag11,
  537. msm_mux_phase_flag12,
  538. msm_mux_phase_flag13,
  539. msm_mux_phase_flag14,
  540. msm_mux_phase_flag15,
  541. msm_mux_phase_flag16,
  542. msm_mux_phase_flag17,
  543. msm_mux_phase_flag18,
  544. msm_mux_phase_flag19,
  545. msm_mux_phase_flag2,
  546. msm_mux_phase_flag20,
  547. msm_mux_phase_flag21,
  548. msm_mux_phase_flag22,
  549. msm_mux_phase_flag23,
  550. msm_mux_phase_flag24,
  551. msm_mux_phase_flag25,
  552. msm_mux_phase_flag26,
  553. msm_mux_phase_flag27,
  554. msm_mux_phase_flag28,
  555. msm_mux_phase_flag29,
  556. msm_mux_phase_flag3,
  557. msm_mux_phase_flag30,
  558. msm_mux_phase_flag31,
  559. msm_mux_phase_flag4,
  560. msm_mux_phase_flag5,
  561. msm_mux_phase_flag6,
  562. msm_mux_phase_flag7,
  563. msm_mux_phase_flag8,
  564. msm_mux_phase_flag9,
  565. msm_mux_pll_bist,
  566. msm_mux_pll_clk,
  567. msm_mux_prng_rosc0,
  568. msm_mux_prng_rosc1,
  569. msm_mux_prng_rosc2,
  570. msm_mux_prng_rosc3,
  571. msm_mux_qdss_cti,
  572. msm_mux_qdss_gpio,
  573. msm_mux_qdss_gpio0,
  574. msm_mux_qdss_gpio1,
  575. msm_mux_qdss_gpio10,
  576. msm_mux_qdss_gpio11,
  577. msm_mux_qdss_gpio12,
  578. msm_mux_qdss_gpio13,
  579. msm_mux_qdss_gpio14,
  580. msm_mux_qdss_gpio15,
  581. msm_mux_qdss_gpio2,
  582. msm_mux_qdss_gpio3,
  583. msm_mux_qdss_gpio4,
  584. msm_mux_qdss_gpio5,
  585. msm_mux_qdss_gpio6,
  586. msm_mux_qdss_gpio7,
  587. msm_mux_qdss_gpio8,
  588. msm_mux_qdss_gpio9,
  589. msm_mux_qup0_se0,
  590. msm_mux_qup0_se1,
  591. msm_mux_qup0_se2,
  592. msm_mux_qup0_se3,
  593. msm_mux_qup0_se4,
  594. msm_mux_qup0_se5,
  595. msm_mux_qup1_se0,
  596. msm_mux_qup1_se1,
  597. msm_mux_qup1_se2,
  598. msm_mux_qup1_se3,
  599. msm_mux_qup1_se4,
  600. msm_mux_qup1_se5,
  601. msm_mux_qup1_se6,
  602. msm_mux_qup2_se0,
  603. msm_mux_qup2_se1,
  604. msm_mux_qup2_se2,
  605. msm_mux_qup2_se3,
  606. msm_mux_qup2_se4,
  607. msm_mux_qup2_se5,
  608. msm_mux_qup2_se6,
  609. msm_mux_qup3_se0,
  610. msm_mux_sail_top,
  611. msm_mux_sailss_emac0,
  612. msm_mux_sailss_ospi,
  613. msm_mux_sgmii_phy,
  614. msm_mux_tb_trig,
  615. msm_mux_tgu_ch0,
  616. msm_mux_tgu_ch1,
  617. msm_mux_tgu_ch2,
  618. msm_mux_tgu_ch3,
  619. msm_mux_tgu_ch4,
  620. msm_mux_tgu_ch5,
  621. msm_mux_tsense_pwm1,
  622. msm_mux_tsense_pwm2,
  623. msm_mux_tsense_pwm3,
  624. msm_mux_tsense_pwm4,
  625. msm_mux_usb2phy_ac,
  626. msm_mux_vsense_trigger,
  627. msm_mux_NA,
  628. };
  629. static const char * const gpio_groups[] = {
  630. "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7",
  631. "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14",
  632. "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21",
  633. "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28",
  634. "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35",
  635. "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42",
  636. "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49",
  637. "gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56",
  638. "gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63",
  639. "gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70",
  640. "gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77",
  641. "gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84",
  642. "gpio85", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", "gpio91",
  643. "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98",
  644. "gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104",
  645. "gpio105", "gpio106", "gpio107", "gpio108", "gpio109", "gpio110",
  646. "gpio111", "gpio112", "gpio113", "gpio114", "gpio115", "gpio116",
  647. "gpio117", "gpio118", "gpio119", "gpio120", "gpio121", "gpio122",
  648. "gpio123", "gpio124", "gpio125", "gpio126", "gpio127", "gpio128",
  649. "gpio129", "gpio130", "gpio131", "gpio132", "gpio133", "gpio134",
  650. "gpio135", "gpio136", "gpio137", "gpio138", "gpio139", "gpio140",
  651. "gpio141", "gpio142", "gpio143", "gpio144", "gpio145", "gpio146",
  652. "gpio147", "gpio148",
  653. };
  654. static const char * const atest_char_groups[] = {
  655. "gpio27",
  656. };
  657. static const char * const atest_char0_groups[] = {
  658. "gpio59",
  659. };
  660. static const char * const atest_char1_groups[] = {
  661. "gpio58",
  662. };
  663. static const char * const atest_char2_groups[] = {
  664. "gpio90",
  665. };
  666. static const char * const atest_char3_groups[] = {
  667. "gpio89",
  668. };
  669. static const char * const atest_usb2_groups[] = {
  670. "gpio58", "gpio59", "gpio86",
  671. };
  672. static const char * const atest_usb20_groups[] = {
  673. "gpio87", "gpio91", "gpio95",
  674. };
  675. static const char * const atest_usb21_groups[] = {
  676. "gpio88", "gpio92", "gpio96",
  677. };
  678. static const char * const atest_usb22_groups[] = {
  679. "gpio89", "gpio93", "gpio97",
  680. };
  681. static const char * const atest_usb23_groups[] = {
  682. "gpio90", "gpio94", "gpio105",
  683. };
  684. static const char * const audio_ref_groups[] = {
  685. "gpio113",
  686. };
  687. static const char * const cam_mclk_groups[] = {
  688. "gpio72", "gpio73", "gpio74", "gpio75",
  689. };
  690. static const char * const cci_async_groups[] = {
  691. "gpio50", "gpio66", "gpio68", "gpio69", "gpio70", "gpio71",
  692. };
  693. static const char * const cci_i2c_groups[] = {
  694. "gpio52", "gpio53", "gpio54", "gpio55", "gpio56", "gpio57", "gpio58",
  695. "gpio59", "gpio60", "gpio61", "gpio62", "gpio63", "gpio64", "gpio65",
  696. "gpio66", "gpio67",
  697. };
  698. static const char * const cci_timer0_groups[] = {
  699. "gpio68",
  700. };
  701. static const char * const cci_timer1_groups[] = {
  702. "gpio69",
  703. };
  704. static const char * const cci_timer2_groups[] = {
  705. "gpio70",
  706. };
  707. static const char * const cci_timer3_groups[] = {
  708. "gpio71",
  709. };
  710. static const char * const cci_timer4_groups[] = {
  711. "gpio52",
  712. };
  713. static const char * const cci_timer5_groups[] = {
  714. "gpio53",
  715. };
  716. static const char * const cci_timer6_groups[] = {
  717. "gpio54",
  718. };
  719. static const char * const cci_timer7_groups[] = {
  720. "gpio55",
  721. };
  722. static const char * const cci_timer8_groups[] = {
  723. "gpio56",
  724. };
  725. static const char * const cci_timer9_groups[] = {
  726. "gpio57",
  727. };
  728. static const char * const cri_trng_groups[] = {
  729. "gpio99",
  730. };
  731. static const char * const cri_trng0_groups[] = {
  732. "gpio97",
  733. };
  734. static const char * const cri_trng1_groups[] = {
  735. "gpio98",
  736. };
  737. static const char * const dbg_out_groups[] = {
  738. "gpio144",
  739. };
  740. static const char * const ddr_bist_groups[] = {
  741. "gpio56", "gpio57", "gpio58", "gpio59",
  742. };
  743. static const char * const ddr_pxi0_groups[] = {
  744. "gpio33", "gpio34",
  745. };
  746. static const char * const ddr_pxi1_groups[] = {
  747. "gpio52", "gpio53",
  748. };
  749. static const char * const ddr_pxi2_groups[] = {
  750. "gpio55", "gpio86",
  751. };
  752. static const char * const ddr_pxi3_groups[] = {
  753. "gpio87", "gpio88",
  754. };
  755. static const char * const ddr_pxi4_groups[] = {
  756. "gpio89", "gpio90",
  757. };
  758. static const char * const ddr_pxi5_groups[] = {
  759. "gpio118", "gpio119",
  760. };
  761. static const char * const edp0_hot_groups[] = {
  762. "gpio101",
  763. };
  764. static const char * const edp0_lcd_groups[] = {
  765. "gpio44",
  766. };
  767. static const char * const edp1_hot_groups[] = {
  768. "gpio102",
  769. };
  770. static const char * const edp1_lcd_groups[] = {
  771. "gpio45",
  772. };
  773. static const char * const edp2_hot_groups[] = {
  774. "gpio104",
  775. };
  776. static const char * const edp2_lcd_groups[] = {
  777. "gpio48",
  778. };
  779. static const char * const edp3_hot_groups[] = {
  780. "gpio103",
  781. };
  782. static const char * const edp3_lcd_groups[] = {
  783. "gpio49",
  784. };
  785. static const char * const emac0_mcg0_groups[] = {
  786. "gpio12",
  787. };
  788. static const char * const emac0_mcg1_groups[] = {
  789. "gpio13",
  790. };
  791. static const char * const emac0_mcg2_groups[] = {
  792. "gpio14",
  793. };
  794. static const char * const emac0_mcg3_groups[] = {
  795. "gpio15",
  796. };
  797. static const char * const emac0_mdc_groups[] = {
  798. "gpio8",
  799. };
  800. static const char * const emac0_mdio_groups[] = {
  801. "gpio9",
  802. };
  803. static const char * const emac0_ptp_groups[] = {
  804. "gpio6", "gpio6", "gpio10", "gpio10", "gpio11", "gpio11", "gpio12",
  805. "gpio12",
  806. };
  807. static const char * const emac1_mcg0_groups[] = {
  808. "gpio16",
  809. };
  810. static const char * const emac1_mcg1_groups[] = {
  811. "gpio17",
  812. };
  813. static const char * const emac1_mcg2_groups[] = {
  814. "gpio18",
  815. };
  816. static const char * const emac1_mcg3_groups[] = {
  817. "gpio19",
  818. };
  819. static const char * const emac1_mdc_groups[] = {
  820. "gpio20",
  821. };
  822. static const char * const emac1_mdio_groups[] = {
  823. "gpio21",
  824. };
  825. static const char * const emac1_ptp_groups[] = {
  826. "gpio6", "gpio6", "gpio10", "gpio10", "gpio11", "gpio11", "gpio12",
  827. "gpio12",
  828. };
  829. static const char * const gcc_gp1_groups[] = {
  830. "gpio51", "gpio82",
  831. };
  832. static const char * const gcc_gp2_groups[] = {
  833. "gpio52", "gpio83",
  834. };
  835. static const char * const gcc_gp3_groups[] = {
  836. "gpio53", "gpio84",
  837. };
  838. static const char * const gcc_gp4_groups[] = {
  839. "gpio33", "gpio55",
  840. };
  841. static const char * const gcc_gp5_groups[] = {
  842. "gpio34", "gpio42",
  843. };
  844. static const char * const hs0_mi2s_groups[] = {
  845. "gpio114", "gpio115", "gpio116", "gpio117",
  846. };
  847. static const char * const hs1_mi2s_groups[] = {
  848. "gpio118", "gpio119", "gpio120", "gpio121",
  849. };
  850. static const char * const hs2_mi2s_groups[] = {
  851. "gpio122", "gpio123", "gpio124", "gpio125",
  852. };
  853. static const char * const ibi_i3c_groups[] = {
  854. "gpio40", "gpio41", "gpio42", "gpio43", "gpio80", "gpio81", "gpio84",
  855. "gpio85",
  856. };
  857. static const char * const jitter_bist_groups[] = {
  858. "gpio86",
  859. };
  860. static const char * const mdp0_vsync0_groups[] = {
  861. "gpio57",
  862. };
  863. static const char * const mdp0_vsync1_groups[] = {
  864. "gpio58",
  865. };
  866. static const char * const mdp0_vsync2_groups[] = {
  867. "gpio59",
  868. };
  869. static const char * const mdp0_vsync3_groups[] = {
  870. "gpio80",
  871. };
  872. static const char * const mdp0_vsync4_groups[] = {
  873. "gpio81",
  874. };
  875. static const char * const mdp0_vsync5_groups[] = {
  876. "gpio91",
  877. };
  878. static const char * const mdp0_vsync6_groups[] = {
  879. "gpio92",
  880. };
  881. static const char * const mdp0_vsync7_groups[] = {
  882. "gpio93",
  883. };
  884. static const char * const mdp0_vsync8_groups[] = {
  885. "gpio94",
  886. };
  887. static const char * const mdp1_vsync0_groups[] = {
  888. "gpio40",
  889. };
  890. static const char * const mdp1_vsync1_groups[] = {
  891. "gpio41",
  892. };
  893. static const char * const mdp1_vsync2_groups[] = {
  894. "gpio42",
  895. };
  896. static const char * const mdp1_vsync3_groups[] = {
  897. "gpio43",
  898. };
  899. static const char * const mdp1_vsync4_groups[] = {
  900. "gpio46",
  901. };
  902. static const char * const mdp1_vsync5_groups[] = {
  903. "gpio47",
  904. };
  905. static const char * const mdp1_vsync6_groups[] = {
  906. "gpio51",
  907. };
  908. static const char * const mdp1_vsync7_groups[] = {
  909. "gpio52",
  910. };
  911. static const char * const mdp1_vsync8_groups[] = {
  912. "gpio50",
  913. };
  914. static const char * const mdp_vsync_groups[] = {
  915. "gpio82", "gpio83", "gpio84",
  916. };
  917. static const char * const mi2s1_data0_groups[] = {
  918. "gpio108",
  919. };
  920. static const char * const mi2s1_data1_groups[] = {
  921. "gpio109",
  922. };
  923. static const char * const mi2s1_sck_groups[] = {
  924. "gpio106",
  925. };
  926. static const char * const mi2s1_ws_groups[] = {
  927. "gpio107",
  928. };
  929. static const char * const mi2s2_data0_groups[] = {
  930. "gpio112",
  931. };
  932. static const char * const mi2s2_data1_groups[] = {
  933. "gpio113",
  934. };
  935. static const char * const mi2s2_sck_groups[] = {
  936. "gpio110",
  937. };
  938. static const char * const mi2s2_ws_groups[] = {
  939. "gpio111",
  940. };
  941. static const char * const mi2s_mclk0_groups[] = {
  942. "gpio105",
  943. };
  944. static const char * const mi2s_mclk1_groups[] = {
  945. "gpio117",
  946. };
  947. static const char * const pcie0_clkreq_groups[] = {
  948. "gpio1",
  949. };
  950. static const char * const pcie1_clkreq_groups[] = {
  951. "gpio3",
  952. };
  953. static const char * const phase_flag0_groups[] = {
  954. "gpio125",
  955. };
  956. static const char * const phase_flag1_groups[] = {
  957. "gpio124",
  958. };
  959. static const char * const phase_flag10_groups[] = {
  960. "gpio110",
  961. };
  962. static const char * const phase_flag11_groups[] = {
  963. "gpio109",
  964. };
  965. static const char * const phase_flag12_groups[] = {
  966. "gpio108",
  967. };
  968. static const char * const phase_flag13_groups[] = {
  969. "gpio107",
  970. };
  971. static const char * const phase_flag14_groups[] = {
  972. "gpio106",
  973. };
  974. static const char * const phase_flag15_groups[] = {
  975. "gpio99",
  976. };
  977. static const char * const phase_flag16_groups[] = {
  978. "gpio98",
  979. };
  980. static const char * const phase_flag17_groups[] = {
  981. "gpio57",
  982. };
  983. static const char * const phase_flag18_groups[] = {
  984. "gpio56",
  985. };
  986. static const char * const phase_flag19_groups[] = {
  987. "gpio39",
  988. };
  989. static const char * const phase_flag2_groups[] = {
  990. "gpio123",
  991. };
  992. static const char * const phase_flag20_groups[] = {
  993. "gpio38",
  994. };
  995. static const char * const phase_flag21_groups[] = {
  996. "gpio37",
  997. };
  998. static const char * const phase_flag22_groups[] = {
  999. "gpio36",
  1000. };
  1001. static const char * const phase_flag23_groups[] = {
  1002. "gpio35",
  1003. };
  1004. static const char * const phase_flag24_groups[] = {
  1005. "gpio32",
  1006. };
  1007. static const char * const phase_flag25_groups[] = {
  1008. "gpio31",
  1009. };
  1010. static const char * const phase_flag26_groups[] = {
  1011. "gpio30",
  1012. };
  1013. static const char * const phase_flag27_groups[] = {
  1014. "gpio29",
  1015. };
  1016. static const char * const phase_flag28_groups[] = {
  1017. "gpio28",
  1018. };
  1019. static const char * const phase_flag29_groups[] = {
  1020. "gpio27",
  1021. };
  1022. static const char * const phase_flag3_groups[] = {
  1023. "gpio122",
  1024. };
  1025. static const char * const phase_flag30_groups[] = {
  1026. "gpio26",
  1027. };
  1028. static const char * const phase_flag31_groups[] = {
  1029. "gpio25",
  1030. };
  1031. static const char * const phase_flag4_groups[] = {
  1032. "gpio121",
  1033. };
  1034. static const char * const phase_flag5_groups[] = {
  1035. "gpio120",
  1036. };
  1037. static const char * const phase_flag6_groups[] = {
  1038. "gpio114",
  1039. };
  1040. static const char * const phase_flag7_groups[] = {
  1041. "gpio113",
  1042. };
  1043. static const char * const phase_flag8_groups[] = {
  1044. "gpio112",
  1045. };
  1046. static const char * const phase_flag9_groups[] = {
  1047. "gpio111",
  1048. };
  1049. static const char * const pll_bist_groups[] = {
  1050. "gpio114",
  1051. };
  1052. static const char * const pll_clk_groups[] = {
  1053. "gpio87",
  1054. };
  1055. static const char * const prng_rosc0_groups[] = {
  1056. "gpio101",
  1057. };
  1058. static const char * const prng_rosc1_groups[] = {
  1059. "gpio102",
  1060. };
  1061. static const char * const prng_rosc2_groups[] = {
  1062. "gpio103",
  1063. };
  1064. static const char * const prng_rosc3_groups[] = {
  1065. "gpio104",
  1066. };
  1067. static const char * const qdss_cti_groups[] = {
  1068. "gpio26", "gpio27", "gpio38", "gpio39", "gpio48", "gpio49", "gpio50",
  1069. "gpio51",
  1070. };
  1071. static const char * const qdss_gpio_groups[] = {
  1072. "gpio20", "gpio21", "gpio105", "gpio114",
  1073. };
  1074. static const char * const qdss_gpio0_groups[] = {
  1075. "gpio60", "gpio115",
  1076. };
  1077. static const char * const qdss_gpio1_groups[] = {
  1078. "gpio61", "gpio116",
  1079. };
  1080. static const char * const qdss_gpio10_groups[] = {
  1081. "gpio29", "gpio108",
  1082. };
  1083. static const char * const qdss_gpio11_groups[] = {
  1084. "gpio28", "gpio109",
  1085. };
  1086. static const char * const qdss_gpio12_groups[] = {
  1087. "gpio25", "gpio110",
  1088. };
  1089. static const char * const qdss_gpio13_groups[] = {
  1090. "gpio24", "gpio111",
  1091. };
  1092. static const char * const qdss_gpio14_groups[] = {
  1093. "gpio23", "gpio112",
  1094. };
  1095. static const char * const qdss_gpio15_groups[] = {
  1096. "gpio22", "gpio113",
  1097. };
  1098. static const char * const qdss_gpio2_groups[] = {
  1099. "gpio62", "gpio117",
  1100. };
  1101. static const char * const qdss_gpio3_groups[] = {
  1102. "gpio63", "gpio118",
  1103. };
  1104. static const char * const qdss_gpio4_groups[] = {
  1105. "gpio64", "gpio119",
  1106. };
  1107. static const char * const qdss_gpio5_groups[] = {
  1108. "gpio65", "gpio120",
  1109. };
  1110. static const char * const qdss_gpio6_groups[] = {
  1111. "gpio66", "gpio121",
  1112. };
  1113. static const char * const qdss_gpio7_groups[] = {
  1114. "gpio67", "gpio122",
  1115. };
  1116. static const char * const qdss_gpio8_groups[] = {
  1117. "gpio31", "gpio106",
  1118. };
  1119. static const char * const qdss_gpio9_groups[] = {
  1120. "gpio30", "gpio107",
  1121. };
  1122. static const char * const qup0_se0_groups[] = {
  1123. "gpio20", "gpio21", "gpio22", "gpio23",
  1124. };
  1125. static const char * const qup0_se1_groups[] = {
  1126. "gpio24", "gpio25", "gpio26", "gpio27",
  1127. };
  1128. static const char * const qup0_se2_groups[] = {
  1129. "gpio36", "gpio37", "gpio38", "gpio39",
  1130. };
  1131. static const char * const qup0_se3_groups[] = {
  1132. "gpio28", "gpio29", "gpio30", "gpio31",
  1133. };
  1134. static const char * const qup0_se4_groups[] = {
  1135. "gpio32", "gpio33", "gpio34", "gpio35",
  1136. };
  1137. static const char * const qup0_se5_groups[] = {
  1138. "gpio36", "gpio37", "gpio38", "gpio39",
  1139. };
  1140. static const char * const qup1_se0_groups[] = {
  1141. "gpio40", "gpio41", "gpio42", "gpio43",
  1142. };
  1143. static const char * const qup1_se1_groups[] = {
  1144. "gpio40", "gpio41", "gpio42", "gpio43",
  1145. };
  1146. static const char * const qup1_se2_groups[] = {
  1147. "gpio44", "gpio45", "gpio46", "gpio47",
  1148. };
  1149. static const char * const qup1_se3_groups[] = {
  1150. "gpio44", "gpio45", "gpio46", "gpio47",
  1151. };
  1152. static const char * const qup1_se4_groups[] = {
  1153. "gpio48", "gpio49", "gpio50", "gpio51",
  1154. };
  1155. static const char * const qup1_se5_groups[] = {
  1156. "gpio52", "gpio53", "gpio54", "gpio55",
  1157. };
  1158. static const char * const qup1_se6_groups[] = {
  1159. "gpio56", "gpio56", "gpio57", "gpio57",
  1160. };
  1161. static const char * const qup2_se0_groups[] = {
  1162. "gpio80", "gpio81", "gpio82", "gpio83",
  1163. };
  1164. static const char * const qup2_se1_groups[] = {
  1165. "gpio84", "gpio85", "gpio99", "gpio100",
  1166. };
  1167. static const char * const qup2_se2_groups[] = {
  1168. "gpio86", "gpio87", "gpio88", "gpio89", "gpio90",
  1169. };
  1170. static const char * const qup2_se3_groups[] = {
  1171. "gpio91", "gpio92", "gpio93", "gpio94",
  1172. };
  1173. static const char * const qup2_se4_groups[] = {
  1174. "gpio95", "gpio96", "gpio97", "gpio98",
  1175. };
  1176. static const char * const qup2_se5_groups[] = {
  1177. "gpio84", "gpio85", "gpio99", "gpio100",
  1178. };
  1179. static const char * const qup2_se6_groups[] = {
  1180. "gpio95", "gpio96", "gpio97", "gpio98",
  1181. };
  1182. static const char * const qup3_se0_groups[] = {
  1183. "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19",
  1184. };
  1185. static const char * const sail_top_groups[] = {
  1186. "gpio13", "gpio14", "gpio15", "gpio16",
  1187. };
  1188. static const char * const sailss_emac0_groups[] = {
  1189. "gpio18", "gpio19",
  1190. };
  1191. static const char * const sailss_ospi_groups[] = {
  1192. "gpio18", "gpio19",
  1193. };
  1194. static const char * const sgmii_phy_groups[] = {
  1195. "gpio7", "gpio26",
  1196. };
  1197. static const char * const tb_trig_groups[] = {
  1198. "gpio17", "gpio17",
  1199. };
  1200. static const char * const tgu_ch0_groups[] = {
  1201. "gpio46",
  1202. };
  1203. static const char * const tgu_ch1_groups[] = {
  1204. "gpio47",
  1205. };
  1206. static const char * const tgu_ch2_groups[] = {
  1207. "gpio36",
  1208. };
  1209. static const char * const tgu_ch3_groups[] = {
  1210. "gpio37",
  1211. };
  1212. static const char * const tgu_ch4_groups[] = {
  1213. "gpio38",
  1214. };
  1215. static const char * const tgu_ch5_groups[] = {
  1216. "gpio39",
  1217. };
  1218. static const char * const tsense_pwm1_groups[] = {
  1219. "gpio104",
  1220. };
  1221. static const char * const tsense_pwm2_groups[] = {
  1222. "gpio103",
  1223. };
  1224. static const char * const tsense_pwm3_groups[] = {
  1225. "gpio102",
  1226. };
  1227. static const char * const tsense_pwm4_groups[] = {
  1228. "gpio101",
  1229. };
  1230. static const char * const usb2phy_ac_groups[] = {
  1231. "gpio10", "gpio11", "gpio12",
  1232. };
  1233. static const char * const vsense_trigger_groups[] = {
  1234. "gpio111",
  1235. };
  1236. static const struct msm_function lemans_functions[] = {
  1237. FUNCTION(gpio),
  1238. FUNCTION(atest_char),
  1239. FUNCTION(atest_char0),
  1240. FUNCTION(atest_char1),
  1241. FUNCTION(atest_char2),
  1242. FUNCTION(atest_char3),
  1243. FUNCTION(atest_usb2),
  1244. FUNCTION(atest_usb20),
  1245. FUNCTION(atest_usb21),
  1246. FUNCTION(atest_usb22),
  1247. FUNCTION(atest_usb23),
  1248. FUNCTION(audio_ref),
  1249. FUNCTION(cam_mclk),
  1250. FUNCTION(cci_async),
  1251. FUNCTION(cci_i2c),
  1252. FUNCTION(cci_timer0),
  1253. FUNCTION(cci_timer1),
  1254. FUNCTION(cci_timer2),
  1255. FUNCTION(cci_timer3),
  1256. FUNCTION(cci_timer4),
  1257. FUNCTION(cci_timer5),
  1258. FUNCTION(cci_timer6),
  1259. FUNCTION(cci_timer7),
  1260. FUNCTION(cci_timer8),
  1261. FUNCTION(cci_timer9),
  1262. FUNCTION(cri_trng),
  1263. FUNCTION(cri_trng0),
  1264. FUNCTION(cri_trng1),
  1265. FUNCTION(dbg_out),
  1266. FUNCTION(ddr_bist),
  1267. FUNCTION(ddr_pxi0),
  1268. FUNCTION(ddr_pxi1),
  1269. FUNCTION(ddr_pxi2),
  1270. FUNCTION(ddr_pxi3),
  1271. FUNCTION(ddr_pxi4),
  1272. FUNCTION(ddr_pxi5),
  1273. FUNCTION(edp0_hot),
  1274. FUNCTION(edp0_lcd),
  1275. FUNCTION(edp1_hot),
  1276. FUNCTION(edp1_lcd),
  1277. FUNCTION(edp2_hot),
  1278. FUNCTION(edp2_lcd),
  1279. FUNCTION(edp3_hot),
  1280. FUNCTION(edp3_lcd),
  1281. FUNCTION(emac0_mcg0),
  1282. FUNCTION(emac0_mcg1),
  1283. FUNCTION(emac0_mcg2),
  1284. FUNCTION(emac0_mcg3),
  1285. FUNCTION(emac0_mdc),
  1286. FUNCTION(emac0_mdio),
  1287. FUNCTION(emac0_ptp),
  1288. FUNCTION(emac1_mcg0),
  1289. FUNCTION(emac1_mcg1),
  1290. FUNCTION(emac1_mcg2),
  1291. FUNCTION(emac1_mcg3),
  1292. FUNCTION(emac1_mdc),
  1293. FUNCTION(emac1_mdio),
  1294. FUNCTION(emac1_ptp),
  1295. FUNCTION(gcc_gp1),
  1296. FUNCTION(gcc_gp2),
  1297. FUNCTION(gcc_gp3),
  1298. FUNCTION(gcc_gp4),
  1299. FUNCTION(gcc_gp5),
  1300. FUNCTION(hs0_mi2s),
  1301. FUNCTION(hs1_mi2s),
  1302. FUNCTION(hs2_mi2s),
  1303. FUNCTION(ibi_i3c),
  1304. FUNCTION(jitter_bist),
  1305. FUNCTION(mdp0_vsync0),
  1306. FUNCTION(mdp0_vsync1),
  1307. FUNCTION(mdp0_vsync2),
  1308. FUNCTION(mdp0_vsync3),
  1309. FUNCTION(mdp0_vsync4),
  1310. FUNCTION(mdp0_vsync5),
  1311. FUNCTION(mdp0_vsync6),
  1312. FUNCTION(mdp0_vsync7),
  1313. FUNCTION(mdp0_vsync8),
  1314. FUNCTION(mdp1_vsync0),
  1315. FUNCTION(mdp1_vsync1),
  1316. FUNCTION(mdp1_vsync2),
  1317. FUNCTION(mdp1_vsync3),
  1318. FUNCTION(mdp1_vsync4),
  1319. FUNCTION(mdp1_vsync5),
  1320. FUNCTION(mdp1_vsync6),
  1321. FUNCTION(mdp1_vsync7),
  1322. FUNCTION(mdp1_vsync8),
  1323. FUNCTION(mdp_vsync),
  1324. FUNCTION(mi2s1_data0),
  1325. FUNCTION(mi2s1_data1),
  1326. FUNCTION(mi2s1_sck),
  1327. FUNCTION(mi2s1_ws),
  1328. FUNCTION(mi2s2_data0),
  1329. FUNCTION(mi2s2_data1),
  1330. FUNCTION(mi2s2_sck),
  1331. FUNCTION(mi2s2_ws),
  1332. FUNCTION(mi2s_mclk0),
  1333. FUNCTION(mi2s_mclk1),
  1334. FUNCTION(pcie0_clkreq),
  1335. FUNCTION(pcie1_clkreq),
  1336. FUNCTION(phase_flag0),
  1337. FUNCTION(phase_flag1),
  1338. FUNCTION(phase_flag10),
  1339. FUNCTION(phase_flag11),
  1340. FUNCTION(phase_flag12),
  1341. FUNCTION(phase_flag13),
  1342. FUNCTION(phase_flag14),
  1343. FUNCTION(phase_flag15),
  1344. FUNCTION(phase_flag16),
  1345. FUNCTION(phase_flag17),
  1346. FUNCTION(phase_flag18),
  1347. FUNCTION(phase_flag19),
  1348. FUNCTION(phase_flag2),
  1349. FUNCTION(phase_flag20),
  1350. FUNCTION(phase_flag21),
  1351. FUNCTION(phase_flag22),
  1352. FUNCTION(phase_flag23),
  1353. FUNCTION(phase_flag24),
  1354. FUNCTION(phase_flag25),
  1355. FUNCTION(phase_flag26),
  1356. FUNCTION(phase_flag27),
  1357. FUNCTION(phase_flag28),
  1358. FUNCTION(phase_flag29),
  1359. FUNCTION(phase_flag3),
  1360. FUNCTION(phase_flag30),
  1361. FUNCTION(phase_flag31),
  1362. FUNCTION(phase_flag4),
  1363. FUNCTION(phase_flag5),
  1364. FUNCTION(phase_flag6),
  1365. FUNCTION(phase_flag7),
  1366. FUNCTION(phase_flag8),
  1367. FUNCTION(phase_flag9),
  1368. FUNCTION(pll_bist),
  1369. FUNCTION(pll_clk),
  1370. FUNCTION(prng_rosc0),
  1371. FUNCTION(prng_rosc1),
  1372. FUNCTION(prng_rosc2),
  1373. FUNCTION(prng_rosc3),
  1374. FUNCTION(qdss_cti),
  1375. FUNCTION(qdss_gpio),
  1376. FUNCTION(qdss_gpio0),
  1377. FUNCTION(qdss_gpio1),
  1378. FUNCTION(qdss_gpio10),
  1379. FUNCTION(qdss_gpio11),
  1380. FUNCTION(qdss_gpio12),
  1381. FUNCTION(qdss_gpio13),
  1382. FUNCTION(qdss_gpio14),
  1383. FUNCTION(qdss_gpio15),
  1384. FUNCTION(qdss_gpio2),
  1385. FUNCTION(qdss_gpio3),
  1386. FUNCTION(qdss_gpio4),
  1387. FUNCTION(qdss_gpio5),
  1388. FUNCTION(qdss_gpio6),
  1389. FUNCTION(qdss_gpio7),
  1390. FUNCTION(qdss_gpio8),
  1391. FUNCTION(qdss_gpio9),
  1392. FUNCTION(qup0_se0),
  1393. FUNCTION(qup0_se1),
  1394. FUNCTION(qup0_se2),
  1395. FUNCTION(qup0_se3),
  1396. FUNCTION(qup0_se4),
  1397. FUNCTION(qup0_se5),
  1398. FUNCTION(qup1_se0),
  1399. FUNCTION(qup1_se1),
  1400. FUNCTION(qup1_se2),
  1401. FUNCTION(qup1_se3),
  1402. FUNCTION(qup1_se4),
  1403. FUNCTION(qup1_se5),
  1404. FUNCTION(qup1_se6),
  1405. FUNCTION(qup2_se0),
  1406. FUNCTION(qup2_se1),
  1407. FUNCTION(qup2_se2),
  1408. FUNCTION(qup2_se3),
  1409. FUNCTION(qup2_se4),
  1410. FUNCTION(qup2_se5),
  1411. FUNCTION(qup2_se6),
  1412. FUNCTION(qup3_se0),
  1413. FUNCTION(sail_top),
  1414. FUNCTION(sailss_emac0),
  1415. FUNCTION(sailss_ospi),
  1416. FUNCTION(sgmii_phy),
  1417. FUNCTION(tb_trig),
  1418. FUNCTION(tgu_ch0),
  1419. FUNCTION(tgu_ch1),
  1420. FUNCTION(tgu_ch2),
  1421. FUNCTION(tgu_ch3),
  1422. FUNCTION(tgu_ch4),
  1423. FUNCTION(tgu_ch5),
  1424. FUNCTION(tsense_pwm1),
  1425. FUNCTION(tsense_pwm2),
  1426. FUNCTION(tsense_pwm3),
  1427. FUNCTION(tsense_pwm4),
  1428. FUNCTION(usb2phy_ac),
  1429. FUNCTION(vsense_trigger),
  1430. };
  1431. /* Every pin is maintained as a single group, and missing or non-existing pin
  1432. * would be maintained as dummy group to synchronize pin group index with
  1433. * pin descriptor registered with pinctrl core.
  1434. * Clients would not be able to request these dummy pin groups.
  1435. */
  1436. static const struct msm_pingroup lemans_groups[] = {
  1437. [0] = PINGROUP(0, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0x95000, 0),
  1438. [1] = PINGROUP(1, pcie0_clkreq, NA, NA, NA, NA, NA, NA, NA, NA, 0x95000, 1),
  1439. [2] = PINGROUP(2, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0x95000, 2),
  1440. [3] = PINGROUP(3, pcie1_clkreq, NA, NA, NA, NA, NA, NA, NA, NA, 0x95000, 3),
  1441. [4] = PINGROUP(4, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0x95000, 4),
  1442. [5] = PINGROUP(5, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0x95000, 5),
  1443. [6] = PINGROUP(6, emac0_ptp, emac0_ptp, emac1_ptp, emac1_ptp, NA, NA,
  1444. NA, NA, NA, 0x95000, 6),
  1445. [7] = PINGROUP(7, sgmii_phy, NA, NA, NA, NA, NA, NA, NA, NA, 0x95000, 7),
  1446. [8] = PINGROUP(8, emac0_mdc, NA, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1447. [9] = PINGROUP(9, emac0_mdio, NA, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1448. [10] = PINGROUP(10, usb2phy_ac, emac0_ptp, emac0_ptp, emac1_ptp,
  1449. emac1_ptp, NA, NA, NA, NA, 0x95000, 8),
  1450. [11] = PINGROUP(11, usb2phy_ac, emac0_ptp, emac0_ptp, emac1_ptp,
  1451. emac1_ptp, NA, NA, NA, NA, 0x95000, 9),
  1452. [12] = PINGROUP(12, usb2phy_ac, emac0_ptp, emac0_ptp, emac1_ptp,
  1453. emac1_ptp, emac0_mcg0, NA, NA, NA, 0x95000, 10),
  1454. [13] = PINGROUP(13, qup3_se0, emac0_mcg1, NA, NA, sail_top, NA, NA, NA,
  1455. NA, 0, -1),
  1456. [14] = PINGROUP(14, qup3_se0, emac0_mcg2, NA, NA, sail_top, NA, NA, NA,
  1457. NA, 0, -1),
  1458. [15] = PINGROUP(15, qup3_se0, emac0_mcg3, NA, NA, sail_top, NA, NA, NA,
  1459. NA, 0, -1),
  1460. [16] = PINGROUP(16, qup3_se0, emac1_mcg0, NA, NA, sail_top, NA, NA, NA,
  1461. NA, 0x95014, 1),
  1462. [17] = PINGROUP(17, qup3_se0, tb_trig, tb_trig, emac1_mcg1, NA, NA, NA,
  1463. NA, NA, 0, -1),
  1464. [18] = PINGROUP(18, qup3_se0, emac1_mcg2, NA, NA, sailss_ospi,
  1465. sailss_emac0, NA, NA, NA, 0, -1),
  1466. [19] = PINGROUP(19, qup3_se0, emac1_mcg3, NA, NA, sailss_ospi,
  1467. sailss_emac0, NA, NA, NA, 0x95014, 2),
  1468. [20] = PINGROUP(20, qup0_se0, emac1_mdc, qdss_gpio, NA, NA, NA, NA, NA,
  1469. NA, 0x95000, 11),
  1470. [21] = PINGROUP(21, qup0_se0, emac1_mdio, qdss_gpio, NA, NA, NA, NA,
  1471. NA, NA, 0, -1),
  1472. [22] = PINGROUP(22, qup0_se0, qdss_gpio15, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1473. [23] = PINGROUP(23, qup0_se0, qdss_gpio14, NA, NA, NA, NA, NA, NA, NA, 0x95000, 12),
  1474. [24] = PINGROUP(24, qup0_se1, qdss_gpio13, NA, NA, NA, NA, NA, NA, NA, 0x95000, 13),
  1475. [25] = PINGROUP(25, qup0_se1, phase_flag31, NA, qdss_gpio12, NA, NA,
  1476. NA, NA, NA, 0, -1),
  1477. [26] = PINGROUP(26, sgmii_phy, qup0_se1, qdss_cti, phase_flag30, NA,
  1478. NA, NA, NA, NA, 0x95000, 14),
  1479. [27] = PINGROUP(27, qup0_se1, qdss_cti, phase_flag29, NA, atest_char,
  1480. NA, NA, NA, NA, 0x95000, 15),
  1481. [28] = PINGROUP(28, qup0_se3, phase_flag28, NA, qdss_gpio11, NA, NA,
  1482. NA, NA, NA, 0x95004, 0),
  1483. [29] = PINGROUP(29, qup0_se3, phase_flag27, NA, qdss_gpio10, NA, NA,
  1484. NA, NA, NA, 0x95004, 1),
  1485. [30] = PINGROUP(30, qup0_se3, phase_flag26, NA, qdss_gpio9, NA, NA, NA,
  1486. NA, NA, 0x95004, 2),
  1487. [31] = PINGROUP(31, qup0_se3, phase_flag25, NA, qdss_gpio8, NA, NA, NA,
  1488. NA, NA, 0x95004, 3),
  1489. [32] = PINGROUP(32, qup0_se4, phase_flag24, NA, NA, NA, NA, NA, NA, NA, 0x95004, 4),
  1490. [33] = PINGROUP(33, qup0_se4, gcc_gp4, NA, ddr_pxi0, NA, NA, NA, NA,
  1491. NA, 0, -1),
  1492. [34] = PINGROUP(34, qup0_se4, gcc_gp5, NA, ddr_pxi0, NA, NA, NA, NA,
  1493. NA, 0, -1),
  1494. [35] = PINGROUP(35, qup0_se4, phase_flag23, NA, NA, NA, NA, NA, NA, NA, 0x95004, 5),
  1495. [36] = PINGROUP(36, qup0_se2, qup0_se5, phase_flag22, tgu_ch2, NA, NA,
  1496. NA, NA, NA, 0x95004, 6),
  1497. [37] = PINGROUP(37, qup0_se2, qup0_se5, phase_flag21, tgu_ch3, NA, NA,
  1498. NA, NA, NA, 0, -1),
  1499. [38] = PINGROUP(38, qup0_se5, qup0_se2, qdss_cti, phase_flag20,
  1500. tgu_ch4, NA, NA, NA, NA, 0, -1),
  1501. [39] = PINGROUP(39, qup0_se5, qup0_se2, qdss_cti, phase_flag19,
  1502. tgu_ch5, NA, NA, NA, NA, 0x95004, 7),
  1503. [40] = PINGROUP(40, qup1_se0, qup1_se1, ibi_i3c, mdp1_vsync0, NA, NA,
  1504. NA, NA, NA, 0x95004, 8),
  1505. [41] = PINGROUP(41, qup1_se0, qup1_se1, ibi_i3c, mdp1_vsync1, NA, NA,
  1506. NA, NA, NA, 0x95004, 9),
  1507. [42] = PINGROUP(42, qup1_se1, qup1_se0, ibi_i3c, mdp1_vsync2, gcc_gp5,
  1508. NA, NA, NA, NA, 0x95004, 10),
  1509. [43] = PINGROUP(43, qup1_se1, qup1_se0, ibi_i3c, mdp1_vsync3, NA, NA,
  1510. NA, NA, NA, 0x95004, 11),
  1511. [44] = PINGROUP(44, qup1_se2, qup1_se3, edp0_lcd, NA, NA, NA, NA, NA,
  1512. NA, 0, -1),
  1513. [45] = PINGROUP(45, qup1_se2, qup1_se3, edp1_lcd, NA, NA, NA, NA, NA,
  1514. NA, 0x95004, 12),
  1515. [46] = PINGROUP(46, qup1_se3, qup1_se2, mdp1_vsync4, tgu_ch0, NA, NA,
  1516. NA, NA, NA, 0, -1),
  1517. [47] = PINGROUP(47, qup1_se3, qup1_se2, mdp1_vsync5, tgu_ch1, NA, NA,
  1518. NA, NA, NA, 0x95004, 13),
  1519. [48] = PINGROUP(48, qup1_se4, qdss_cti, edp2_lcd, NA, NA, NA, NA, NA,
  1520. NA, 0x95004, 14),
  1521. [49] = PINGROUP(49, qup1_se4, qdss_cti, edp3_lcd, NA, NA, NA, NA, NA,
  1522. NA, 0, -1),
  1523. [50] = PINGROUP(50, qup1_se4, cci_async, qdss_cti, mdp1_vsync8, NA, NA,
  1524. NA, NA, NA, 0, -1),
  1525. [51] = PINGROUP(51, qup1_se4, qdss_cti, mdp1_vsync6, gcc_gp1, NA, NA,
  1526. NA, NA, NA, 0x95004, 15),
  1527. [52] = PINGROUP(52, qup1_se5, cci_timer4, cci_i2c, mdp1_vsync7,
  1528. gcc_gp2, NA, ddr_pxi1, NA, NA, 0x95008, 0),
  1529. [53] = PINGROUP(53, qup1_se5, cci_timer5, cci_i2c, gcc_gp3, NA,
  1530. ddr_pxi1, NA, NA, NA, 0, -1),
  1531. [54] = PINGROUP(54, qup1_se5, cci_timer6, cci_i2c, NA, NA, NA, NA, NA,
  1532. NA, 0, -1),
  1533. [55] = PINGROUP(55, qup1_se5, cci_timer7, cci_i2c, gcc_gp4, NA,
  1534. ddr_pxi2, NA, NA, NA, 0x95008, 1),
  1535. [56] = PINGROUP(56, qup1_se6, qup1_se6, cci_timer8, cci_i2c,
  1536. phase_flag18, ddr_bist, NA, NA, NA, 0x95008, 2),
  1537. [57] = PINGROUP(57, qup1_se6, qup1_se6, cci_timer9, cci_i2c,
  1538. mdp0_vsync0, phase_flag17, ddr_bist, NA, NA, 0x95008, 3),
  1539. [58] = PINGROUP(58, cci_i2c, mdp0_vsync1, ddr_bist, NA, atest_usb2,
  1540. atest_char1, NA, NA, NA, 0x95008, 4),
  1541. [59] = PINGROUP(59, cci_i2c, mdp0_vsync2, ddr_bist, NA, atest_usb2,
  1542. atest_char0, NA, NA, NA, 0x95008, 5),
  1543. [60] = PINGROUP(60, cci_i2c, qdss_gpio0, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1544. [61] = PINGROUP(61, cci_i2c, qdss_gpio1, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1545. [62] = PINGROUP(62, cci_i2c, qdss_gpio2, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1546. [63] = PINGROUP(63, cci_i2c, qdss_gpio3, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1547. [64] = PINGROUP(64, cci_i2c, qdss_gpio4, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1548. [65] = PINGROUP(65, cci_i2c, qdss_gpio5, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1549. [66] = PINGROUP(66, cci_i2c, cci_async, qdss_gpio6, NA, NA, NA, NA, NA,
  1550. NA, 0, -1),
  1551. [67] = PINGROUP(67, cci_i2c, qdss_gpio7, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1552. [68] = PINGROUP(68, cci_timer0, cci_async, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1553. [69] = PINGROUP(69, cci_timer1, cci_async, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1554. [70] = PINGROUP(70, cci_timer2, cci_async, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1555. [71] = PINGROUP(71, cci_timer3, cci_async, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1556. [72] = PINGROUP(72, cam_mclk, NA, NA, NA, NA, NA, NA, NA, NA, 0x95008, 6),
  1557. [73] = PINGROUP(73, cam_mclk, NA, NA, NA, NA, NA, NA, NA, NA, 0x95008, 7),
  1558. [74] = PINGROUP(74, cam_mclk, NA, NA, NA, NA, NA, NA, NA, NA, 0x95008, 8),
  1559. [75] = PINGROUP(75, cam_mclk, NA, NA, NA, NA, NA, NA, NA, NA, 0x95008, 9),
  1560. [76] = PINGROUP(76, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0x95008, 10),
  1561. [77] = PINGROUP(77, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0x95008, 11),
  1562. [78] = PINGROUP(78, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0x95008, 12),
  1563. [79] = PINGROUP(79, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0x95008, 13),
  1564. [80] = PINGROUP(80, qup2_se0, ibi_i3c, mdp0_vsync3, NA, NA, NA, NA, NA,
  1565. NA, 0x95008, 14),
  1566. [81] = PINGROUP(81, qup2_se0, ibi_i3c, mdp0_vsync4, NA, NA, NA, NA, NA,
  1567. NA, 0, -1),
  1568. [82] = PINGROUP(82, qup2_se0, mdp_vsync, gcc_gp1, NA, NA, NA, NA, NA,
  1569. NA, 0, -1),
  1570. [83] = PINGROUP(83, qup2_se0, mdp_vsync, gcc_gp2, NA, NA, NA, NA, NA,
  1571. NA, 0x95008, 15),
  1572. [84] = PINGROUP(84, qup2_se1, qup2_se5, ibi_i3c, mdp_vsync, gcc_gp3,
  1573. NA, NA, NA, NA, 0x9500C, 0),
  1574. [85] = PINGROUP(85, qup2_se1, qup2_se5, ibi_i3c, NA, NA, NA, NA, NA,
  1575. NA, 0x9500C, 1),
  1576. [86] = PINGROUP(86, qup2_se2, jitter_bist, atest_usb2, ddr_pxi2, NA,
  1577. NA, NA, NA, NA, 0x9500C, 2),
  1578. [87] = PINGROUP(87, qup2_se2, pll_clk, atest_usb20, ddr_pxi3, NA, NA,
  1579. NA, NA, NA, 0, -1),
  1580. [88] = PINGROUP(88, qup2_se2, NA, atest_usb21, ddr_pxi3, NA, NA, NA,
  1581. NA, NA, 0, -1),
  1582. [89] = PINGROUP(89, qup2_se2, NA, atest_usb22, ddr_pxi4, atest_char3,
  1583. NA, NA, NA, NA, 0x9500C, 3),
  1584. [90] = PINGROUP(90, qup2_se2, NA, atest_usb23, ddr_pxi4, atest_char2,
  1585. NA, NA, NA, NA, 0, -1),
  1586. [91] = PINGROUP(91, qup2_se3, mdp0_vsync5, NA, atest_usb20, NA, NA, NA,
  1587. NA, NA, 0x9500C, 4),
  1588. [92] = PINGROUP(92, qup2_se3, mdp0_vsync6, NA, atest_usb21, NA, NA, NA,
  1589. NA, NA, 0, -1),
  1590. [93] = PINGROUP(93, qup2_se3, mdp0_vsync7, NA, atest_usb22, NA, NA, NA,
  1591. NA, NA, 0, -1),
  1592. [94] = PINGROUP(94, qup2_se3, mdp0_vsync8, NA, atest_usb23, NA, NA, NA,
  1593. NA, NA, 0x9500C, 5),
  1594. [95] = PINGROUP(95, qup2_se4, qup2_se6, NA, atest_usb20, NA, NA, NA,
  1595. NA, NA, 0x9500C, 6),
  1596. [96] = PINGROUP(96, qup2_se4, qup2_se6, NA, atest_usb21, NA, NA, NA,
  1597. NA, NA, 0x9500C, 7),
  1598. [97] = PINGROUP(97, qup2_se6, qup2_se4, cri_trng0, NA, atest_usb22, NA,
  1599. NA, NA, NA, 0x9500C, 8),
  1600. [98] = PINGROUP(98, qup2_se6, qup2_se4, phase_flag16, cri_trng1, NA,
  1601. NA, NA, NA, NA, 0x9500C, 9),
  1602. [99] = PINGROUP(99, qup2_se5, qup2_se1, phase_flag15, cri_trng, NA, NA,
  1603. NA, NA, NA, 0x9500C, 10),
  1604. [100] = PINGROUP(100, qup2_se5, qup2_se1, NA, NA, NA, NA, NA, NA, NA, 0x9500C, 11),
  1605. [101] = PINGROUP(101, edp0_hot, prng_rosc0, tsense_pwm4, NA, NA, NA,
  1606. NA, NA, NA, 0, -1),
  1607. [102] = PINGROUP(102, edp1_hot, prng_rosc1, tsense_pwm3, NA, NA, NA,
  1608. NA, NA, NA, 0, -1),
  1609. [103] = PINGROUP(103, edp3_hot, prng_rosc2, tsense_pwm2, NA, NA, NA,
  1610. NA, NA, NA, 0, -1),
  1611. [104] = PINGROUP(104, edp2_hot, prng_rosc3, tsense_pwm1, NA, NA, NA,
  1612. NA, NA, NA, 0, -1),
  1613. [105] = PINGROUP(105, mi2s_mclk0, NA, qdss_gpio, atest_usb23, NA, NA,
  1614. NA, NA, NA, 0x95010, 0),
  1615. [106] = PINGROUP(106, mi2s1_sck, phase_flag14, NA, qdss_gpio8, NA, NA,
  1616. NA, NA, NA, 0x95010, 1),
  1617. [107] = PINGROUP(107, mi2s1_ws, phase_flag13, NA, qdss_gpio9, NA, NA,
  1618. NA, NA, NA, 0x95010, 2),
  1619. [108] = PINGROUP(108, mi2s1_data0, phase_flag12, NA, qdss_gpio10, NA,
  1620. NA, NA, NA, NA, 0x95010, 3),
  1621. [109] = PINGROUP(109, mi2s1_data1, phase_flag11, NA, qdss_gpio11, NA,
  1622. NA, NA, NA, NA, 0x95010, 4),
  1623. [110] = PINGROUP(110, mi2s2_sck, phase_flag10, NA, qdss_gpio12, NA, NA,
  1624. NA, NA, NA, 0, -1),
  1625. [111] = PINGROUP(111, mi2s2_ws, phase_flag9, NA, qdss_gpio13,
  1626. vsense_trigger, NA, NA, NA, NA, 0, -1),
  1627. [112] = PINGROUP(112, mi2s2_data0, phase_flag8, NA, qdss_gpio14, NA,
  1628. NA, NA, NA, NA, 0, -1),
  1629. [113] = PINGROUP(113, mi2s2_data1, audio_ref, phase_flag7, NA,
  1630. qdss_gpio15, NA, NA, NA, NA, 0, -1),
  1631. [114] = PINGROUP(114, hs0_mi2s, pll_bist, phase_flag6, NA, qdss_gpio,
  1632. NA, NA, NA, NA, 0, -1),
  1633. [115] = PINGROUP(115, hs0_mi2s, NA, qdss_gpio0, NA, NA, NA, NA, NA, NA, 0, -1),
  1634. [116] = PINGROUP(116, hs0_mi2s, NA, qdss_gpio1, NA, NA, NA, NA, NA, NA, 0, -1),
  1635. [117] = PINGROUP(117, hs0_mi2s, mi2s_mclk1, NA, qdss_gpio2, NA, NA, NA,
  1636. NA, NA, 0, -1),
  1637. [118] = PINGROUP(118, hs1_mi2s, NA, qdss_gpio3, ddr_pxi5, NA, NA, NA,
  1638. NA, NA, 0, -1),
  1639. [119] = PINGROUP(119, hs1_mi2s, NA, qdss_gpio4, ddr_pxi5, NA, NA, NA,
  1640. NA, NA, 0, -1),
  1641. [120] = PINGROUP(120, hs1_mi2s, phase_flag5, NA, qdss_gpio5, NA, NA,
  1642. NA, NA, NA, 0, -1),
  1643. [121] = PINGROUP(121, hs1_mi2s, phase_flag4, NA, qdss_gpio6, NA, NA,
  1644. NA, NA, NA, 0, -1),
  1645. [122] = PINGROUP(122, hs2_mi2s, phase_flag3, NA, qdss_gpio7, NA, NA,
  1646. NA, NA, NA, 0, -1),
  1647. [123] = PINGROUP(123, hs2_mi2s, phase_flag2, NA, NA, NA, NA, NA, NA,
  1648. NA, 0, -1),
  1649. [124] = PINGROUP(124, hs2_mi2s, phase_flag1, NA, NA, NA, NA, NA, NA,
  1650. NA, 0, -1),
  1651. [125] = PINGROUP(125, hs2_mi2s, phase_flag0, NA, NA, NA, NA, NA, NA,
  1652. NA, 0, -1),
  1653. [126] = PINGROUP(126, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1654. [127] = PINGROUP(127, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1655. [128] = PINGROUP(128, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1656. [129] = PINGROUP(129, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1657. [130] = PINGROUP(130, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1658. [131] = PINGROUP(131, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1659. [132] = PINGROUP(132, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1660. [133] = PINGROUP(133, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1661. [134] = PINGROUP(134, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1662. [135] = PINGROUP(135, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1663. [136] = PINGROUP(136, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1664. [137] = PINGROUP(137, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1665. [138] = PINGROUP(138, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1666. [139] = PINGROUP(139, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1667. [140] = PINGROUP(140, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1668. [141] = PINGROUP(141, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1669. [142] = PINGROUP(142, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1670. [143] = PINGROUP(143, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1671. [144] = PINGROUP(144, dbg_out, NA, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1672. [145] = PINGROUP(145, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0x95010, 5),
  1673. [146] = PINGROUP(146, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0x95010, 6),
  1674. [147] = PINGROUP(147, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1675. [148] = PINGROUP(148, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, -1),
  1676. [149] = UFS_RESET(ufs_reset, 0x1a2000),
  1677. [150] = UFS_RESET(ufs1_reset, 0x1a4000),
  1678. [151] = SDC_QDSD_PINGROUP(sdc1_rclk, 0x199000, 15, 0),
  1679. [152] = SDC_QDSD_PINGROUP(sdc1_clk, 0x199000, 13, 6),
  1680. [153] = SDC_QDSD_PINGROUP(sdc1_cmd, 0x199000, 11, 3),
  1681. [154] = SDC_QDSD_PINGROUP(sdc1_data, 0x199000, 9, 0),
  1682. };
  1683. static struct pinctrl_qup lemans_qup_regs[] = {
  1684. QUP_I3C(6, QUP_I3C_6_MODE_OFFSET),
  1685. QUP_I3C(7, QUP_I3C_7_MODE_OFFSET),
  1686. QUP_I3C(13, QUP_I3C_13_MODE_OFFSET),
  1687. QUP_I3C(14, QUP_I3C_14_MODE_OFFSET),
  1688. };
  1689. static const struct msm_gpio_wakeirq_map lemans_pdc_map[] = {
  1690. { 0, 169 }, { 1, 174 }, { 2, 170 }, { 3, 175 }, { 4, 171 }, { 5, 173 },
  1691. { 6, 172 }, { 7, 182 }, { 10, 220 }, { 11, 213 }, { 12, 221 }, { 16, 230 },
  1692. { 19, 231 }, { 20, 232 }, { 23, 233 }, { 24, 234 }, { 26, 223 }, { 27, 235 },
  1693. { 28, 209 }, { 29, 176 }, { 30, 200 }, { 31, 201 }, { 32, 212 }, { 35, 177 },
  1694. { 36, 178 }, { 39, 184 }, { 40, 185 }, { 41, 227 }, { 42, 186 }, { 43, 228 },
  1695. { 45, 187 }, { 47, 188 }, { 48, 194 }, { 51, 195 }, { 52, 196 }, { 55, 197 },
  1696. { 56, 198 }, { 57, 236 }, { 58, 192 }, { 59, 193 }, { 72, 179 }, { 73, 180 },
  1697. { 74, 181 }, { 75, 202 }, { 76, 183 }, { 77, 189 }, { 78, 190 }, { 79, 191 },
  1698. { 80, 199 }, { 83, 204 }, { 84, 205 }, { 85, 229 }, { 86, 206 }, { 89, 207 },
  1699. { 91, 208 }, { 94, 214 }, { 95, 215 }, { 96, 237 }, { 97, 216 }, { 98, 238 },
  1700. { 99, 217 }, { 100, 239 }, { 105, 219 }, { 106, 210 }, { 107, 211 }, { 108, 222 },
  1701. { 109, 203 }, { 145, 225 }, { 146, 226 },
  1702. };
  1703. static struct msm_dir_conn lemans_dir_conn[] = {
  1704. {-1, 0}, {-1, 0}, {-1, 0}, {-1, 0}, {-1, 0},
  1705. {-1, 0}, {-1, 0}, {-1, 0}, {-1, 0}
  1706. };
  1707. static const struct msm_pinctrl_soc_data lemans_pinctrl = {
  1708. .pins = lemans_pins,
  1709. .npins = ARRAY_SIZE(lemans_pins),
  1710. .functions = lemans_functions,
  1711. .nfunctions = ARRAY_SIZE(lemans_functions),
  1712. .groups = lemans_groups,
  1713. .ngroups = ARRAY_SIZE(lemans_groups),
  1714. .ngpios = 151,
  1715. .qup_regs = lemans_qup_regs,
  1716. .nqup_regs = ARRAY_SIZE(lemans_qup_regs),
  1717. .wakeirq_map = lemans_pdc_map,
  1718. .nwakeirq_map = ARRAY_SIZE(lemans_pdc_map),
  1719. .dir_conn = lemans_dir_conn,
  1720. };
  1721. static int lemans_pinctrl_dirconn_list_probe(struct platform_device *pdev)
  1722. {
  1723. int ret, n, dirconn_list_count, m;
  1724. struct device_node *np = pdev->dev.of_node;
  1725. n = of_property_count_elems_of_size(np, "qcom,dirconn-list", sizeof(u32));
  1726. if (n <= 0 || n % 2)
  1727. return -EINVAL;
  1728. m = ARRAY_SIZE(lemans_dir_conn) - 1;
  1729. dirconn_list_count = n / 2;
  1730. for (n = 0; n < dirconn_list_count; n++) {
  1731. ret = of_property_read_u32_index(np, "qcom,dirconn-list",
  1732. n * 2 + 0, &lemans_dir_conn[m].gpio);
  1733. if (ret)
  1734. return ret;
  1735. ret = of_property_read_u32_index(np, "qcom,dirconn-list",
  1736. n * 2 + 1, &lemans_dir_conn[m].irq);
  1737. if (ret)
  1738. return ret;
  1739. m--;
  1740. }
  1741. return 0;
  1742. }
  1743. static int lemans_pinctrl_probe(struct platform_device *pdev)
  1744. {
  1745. int len, ret;
  1746. if (of_find_property(pdev->dev.of_node, "qcom,dirconn-list", &len)) {
  1747. ret = lemans_pinctrl_dirconn_list_probe(pdev);
  1748. if (ret) {
  1749. dev_err(&pdev->dev, "Unable to parse Direct Connect List\n");
  1750. return ret;
  1751. }
  1752. }
  1753. return msm_pinctrl_probe(pdev, &lemans_pinctrl);
  1754. }
  1755. static const struct of_device_id lemans_pinctrl_of_match[] = {
  1756. { .compatible = "qcom,lemans-pinctrl", },
  1757. { },
  1758. };
  1759. static struct platform_driver lemans_pinctrl_driver = {
  1760. .driver = {
  1761. .name = "lemans-pinctrl",
  1762. .of_match_table = lemans_pinctrl_of_match,
  1763. },
  1764. .probe = lemans_pinctrl_probe,
  1765. .remove = msm_pinctrl_remove,
  1766. };
  1767. static int __init lemans_pinctrl_init(void)
  1768. {
  1769. return platform_driver_register(&lemans_pinctrl_driver);
  1770. }
  1771. arch_initcall(lemans_pinctrl_init);
  1772. static void __exit lemans_pinctrl_exit(void)
  1773. {
  1774. platform_driver_unregister(&lemans_pinctrl_driver);
  1775. }
  1776. module_exit(lemans_pinctrl_exit);
  1777. MODULE_DESCRIPTION("QTI lemans pinctrl driver");
  1778. MODULE_LICENSE("GPL");
  1779. MODULE_DEVICE_TABLE(of, lemans_pinctrl_of_match);