pinctrl-msm8x74.c 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2013, Sony Mobile Communications AB.
  4. */
  5. #include <linux/module.h>
  6. #include <linux/of.h>
  7. #include <linux/platform_device.h>
  8. #include "pinctrl-msm.h"
  9. static const struct pinctrl_pin_desc msm8x74_pins[] = {
  10. PINCTRL_PIN(0, "GPIO_0"),
  11. PINCTRL_PIN(1, "GPIO_1"),
  12. PINCTRL_PIN(2, "GPIO_2"),
  13. PINCTRL_PIN(3, "GPIO_3"),
  14. PINCTRL_PIN(4, "GPIO_4"),
  15. PINCTRL_PIN(5, "GPIO_5"),
  16. PINCTRL_PIN(6, "GPIO_6"),
  17. PINCTRL_PIN(7, "GPIO_7"),
  18. PINCTRL_PIN(8, "GPIO_8"),
  19. PINCTRL_PIN(9, "GPIO_9"),
  20. PINCTRL_PIN(10, "GPIO_10"),
  21. PINCTRL_PIN(11, "GPIO_11"),
  22. PINCTRL_PIN(12, "GPIO_12"),
  23. PINCTRL_PIN(13, "GPIO_13"),
  24. PINCTRL_PIN(14, "GPIO_14"),
  25. PINCTRL_PIN(15, "GPIO_15"),
  26. PINCTRL_PIN(16, "GPIO_16"),
  27. PINCTRL_PIN(17, "GPIO_17"),
  28. PINCTRL_PIN(18, "GPIO_18"),
  29. PINCTRL_PIN(19, "GPIO_19"),
  30. PINCTRL_PIN(20, "GPIO_20"),
  31. PINCTRL_PIN(21, "GPIO_21"),
  32. PINCTRL_PIN(22, "GPIO_22"),
  33. PINCTRL_PIN(23, "GPIO_23"),
  34. PINCTRL_PIN(24, "GPIO_24"),
  35. PINCTRL_PIN(25, "GPIO_25"),
  36. PINCTRL_PIN(26, "GPIO_26"),
  37. PINCTRL_PIN(27, "GPIO_27"),
  38. PINCTRL_PIN(28, "GPIO_28"),
  39. PINCTRL_PIN(29, "GPIO_29"),
  40. PINCTRL_PIN(30, "GPIO_30"),
  41. PINCTRL_PIN(31, "GPIO_31"),
  42. PINCTRL_PIN(32, "GPIO_32"),
  43. PINCTRL_PIN(33, "GPIO_33"),
  44. PINCTRL_PIN(34, "GPIO_34"),
  45. PINCTRL_PIN(35, "GPIO_35"),
  46. PINCTRL_PIN(36, "GPIO_36"),
  47. PINCTRL_PIN(37, "GPIO_37"),
  48. PINCTRL_PIN(38, "GPIO_38"),
  49. PINCTRL_PIN(39, "GPIO_39"),
  50. PINCTRL_PIN(40, "GPIO_40"),
  51. PINCTRL_PIN(41, "GPIO_41"),
  52. PINCTRL_PIN(42, "GPIO_42"),
  53. PINCTRL_PIN(43, "GPIO_43"),
  54. PINCTRL_PIN(44, "GPIO_44"),
  55. PINCTRL_PIN(45, "GPIO_45"),
  56. PINCTRL_PIN(46, "GPIO_46"),
  57. PINCTRL_PIN(47, "GPIO_47"),
  58. PINCTRL_PIN(48, "GPIO_48"),
  59. PINCTRL_PIN(49, "GPIO_49"),
  60. PINCTRL_PIN(50, "GPIO_50"),
  61. PINCTRL_PIN(51, "GPIO_51"),
  62. PINCTRL_PIN(52, "GPIO_52"),
  63. PINCTRL_PIN(53, "GPIO_53"),
  64. PINCTRL_PIN(54, "GPIO_54"),
  65. PINCTRL_PIN(55, "GPIO_55"),
  66. PINCTRL_PIN(56, "GPIO_56"),
  67. PINCTRL_PIN(57, "GPIO_57"),
  68. PINCTRL_PIN(58, "GPIO_58"),
  69. PINCTRL_PIN(59, "GPIO_59"),
  70. PINCTRL_PIN(60, "GPIO_60"),
  71. PINCTRL_PIN(61, "GPIO_61"),
  72. PINCTRL_PIN(62, "GPIO_62"),
  73. PINCTRL_PIN(63, "GPIO_63"),
  74. PINCTRL_PIN(64, "GPIO_64"),
  75. PINCTRL_PIN(65, "GPIO_65"),
  76. PINCTRL_PIN(66, "GPIO_66"),
  77. PINCTRL_PIN(67, "GPIO_67"),
  78. PINCTRL_PIN(68, "GPIO_68"),
  79. PINCTRL_PIN(69, "GPIO_69"),
  80. PINCTRL_PIN(70, "GPIO_70"),
  81. PINCTRL_PIN(71, "GPIO_71"),
  82. PINCTRL_PIN(72, "GPIO_72"),
  83. PINCTRL_PIN(73, "GPIO_73"),
  84. PINCTRL_PIN(74, "GPIO_74"),
  85. PINCTRL_PIN(75, "GPIO_75"),
  86. PINCTRL_PIN(76, "GPIO_76"),
  87. PINCTRL_PIN(77, "GPIO_77"),
  88. PINCTRL_PIN(78, "GPIO_78"),
  89. PINCTRL_PIN(79, "GPIO_79"),
  90. PINCTRL_PIN(80, "GPIO_80"),
  91. PINCTRL_PIN(81, "GPIO_81"),
  92. PINCTRL_PIN(82, "GPIO_82"),
  93. PINCTRL_PIN(83, "GPIO_83"),
  94. PINCTRL_PIN(84, "GPIO_84"),
  95. PINCTRL_PIN(85, "GPIO_85"),
  96. PINCTRL_PIN(86, "GPIO_86"),
  97. PINCTRL_PIN(87, "GPIO_87"),
  98. PINCTRL_PIN(88, "GPIO_88"),
  99. PINCTRL_PIN(89, "GPIO_89"),
  100. PINCTRL_PIN(90, "GPIO_90"),
  101. PINCTRL_PIN(91, "GPIO_91"),
  102. PINCTRL_PIN(92, "GPIO_92"),
  103. PINCTRL_PIN(93, "GPIO_93"),
  104. PINCTRL_PIN(94, "GPIO_94"),
  105. PINCTRL_PIN(95, "GPIO_95"),
  106. PINCTRL_PIN(96, "GPIO_96"),
  107. PINCTRL_PIN(97, "GPIO_97"),
  108. PINCTRL_PIN(98, "GPIO_98"),
  109. PINCTRL_PIN(99, "GPIO_99"),
  110. PINCTRL_PIN(100, "GPIO_100"),
  111. PINCTRL_PIN(101, "GPIO_101"),
  112. PINCTRL_PIN(102, "GPIO_102"),
  113. PINCTRL_PIN(103, "GPIO_103"),
  114. PINCTRL_PIN(104, "GPIO_104"),
  115. PINCTRL_PIN(105, "GPIO_105"),
  116. PINCTRL_PIN(106, "GPIO_106"),
  117. PINCTRL_PIN(107, "GPIO_107"),
  118. PINCTRL_PIN(108, "GPIO_108"),
  119. PINCTRL_PIN(109, "GPIO_109"),
  120. PINCTRL_PIN(110, "GPIO_110"),
  121. PINCTRL_PIN(111, "GPIO_111"),
  122. PINCTRL_PIN(112, "GPIO_112"),
  123. PINCTRL_PIN(113, "GPIO_113"),
  124. PINCTRL_PIN(114, "GPIO_114"),
  125. PINCTRL_PIN(115, "GPIO_115"),
  126. PINCTRL_PIN(116, "GPIO_116"),
  127. PINCTRL_PIN(117, "GPIO_117"),
  128. PINCTRL_PIN(118, "GPIO_118"),
  129. PINCTRL_PIN(119, "GPIO_119"),
  130. PINCTRL_PIN(120, "GPIO_120"),
  131. PINCTRL_PIN(121, "GPIO_121"),
  132. PINCTRL_PIN(122, "GPIO_122"),
  133. PINCTRL_PIN(123, "GPIO_123"),
  134. PINCTRL_PIN(124, "GPIO_124"),
  135. PINCTRL_PIN(125, "GPIO_125"),
  136. PINCTRL_PIN(126, "GPIO_126"),
  137. PINCTRL_PIN(127, "GPIO_127"),
  138. PINCTRL_PIN(128, "GPIO_128"),
  139. PINCTRL_PIN(129, "GPIO_129"),
  140. PINCTRL_PIN(130, "GPIO_130"),
  141. PINCTRL_PIN(131, "GPIO_131"),
  142. PINCTRL_PIN(132, "GPIO_132"),
  143. PINCTRL_PIN(133, "GPIO_133"),
  144. PINCTRL_PIN(134, "GPIO_134"),
  145. PINCTRL_PIN(135, "GPIO_135"),
  146. PINCTRL_PIN(136, "GPIO_136"),
  147. PINCTRL_PIN(137, "GPIO_137"),
  148. PINCTRL_PIN(138, "GPIO_138"),
  149. PINCTRL_PIN(139, "GPIO_139"),
  150. PINCTRL_PIN(140, "GPIO_140"),
  151. PINCTRL_PIN(141, "GPIO_141"),
  152. PINCTRL_PIN(142, "GPIO_142"),
  153. PINCTRL_PIN(143, "GPIO_143"),
  154. PINCTRL_PIN(144, "GPIO_144"),
  155. PINCTRL_PIN(145, "GPIO_145"),
  156. PINCTRL_PIN(146, "SDC1_CLK"),
  157. PINCTRL_PIN(147, "SDC1_CMD"),
  158. PINCTRL_PIN(148, "SDC1_DATA"),
  159. PINCTRL_PIN(149, "SDC2_CLK"),
  160. PINCTRL_PIN(150, "SDC2_CMD"),
  161. PINCTRL_PIN(151, "SDC2_DATA"),
  162. PINCTRL_PIN(152, "HSIC_STROBE"),
  163. PINCTRL_PIN(153, "HSIC_DATA"),
  164. };
  165. #define DECLARE_MSM_GPIO_PINS(pin) static const unsigned int gpio##pin##_pins[] = { pin }
  166. DECLARE_MSM_GPIO_PINS(0);
  167. DECLARE_MSM_GPIO_PINS(1);
  168. DECLARE_MSM_GPIO_PINS(2);
  169. DECLARE_MSM_GPIO_PINS(3);
  170. DECLARE_MSM_GPIO_PINS(4);
  171. DECLARE_MSM_GPIO_PINS(5);
  172. DECLARE_MSM_GPIO_PINS(6);
  173. DECLARE_MSM_GPIO_PINS(7);
  174. DECLARE_MSM_GPIO_PINS(8);
  175. DECLARE_MSM_GPIO_PINS(9);
  176. DECLARE_MSM_GPIO_PINS(10);
  177. DECLARE_MSM_GPIO_PINS(11);
  178. DECLARE_MSM_GPIO_PINS(12);
  179. DECLARE_MSM_GPIO_PINS(13);
  180. DECLARE_MSM_GPIO_PINS(14);
  181. DECLARE_MSM_GPIO_PINS(15);
  182. DECLARE_MSM_GPIO_PINS(16);
  183. DECLARE_MSM_GPIO_PINS(17);
  184. DECLARE_MSM_GPIO_PINS(18);
  185. DECLARE_MSM_GPIO_PINS(19);
  186. DECLARE_MSM_GPIO_PINS(20);
  187. DECLARE_MSM_GPIO_PINS(21);
  188. DECLARE_MSM_GPIO_PINS(22);
  189. DECLARE_MSM_GPIO_PINS(23);
  190. DECLARE_MSM_GPIO_PINS(24);
  191. DECLARE_MSM_GPIO_PINS(25);
  192. DECLARE_MSM_GPIO_PINS(26);
  193. DECLARE_MSM_GPIO_PINS(27);
  194. DECLARE_MSM_GPIO_PINS(28);
  195. DECLARE_MSM_GPIO_PINS(29);
  196. DECLARE_MSM_GPIO_PINS(30);
  197. DECLARE_MSM_GPIO_PINS(31);
  198. DECLARE_MSM_GPIO_PINS(32);
  199. DECLARE_MSM_GPIO_PINS(33);
  200. DECLARE_MSM_GPIO_PINS(34);
  201. DECLARE_MSM_GPIO_PINS(35);
  202. DECLARE_MSM_GPIO_PINS(36);
  203. DECLARE_MSM_GPIO_PINS(37);
  204. DECLARE_MSM_GPIO_PINS(38);
  205. DECLARE_MSM_GPIO_PINS(39);
  206. DECLARE_MSM_GPIO_PINS(40);
  207. DECLARE_MSM_GPIO_PINS(41);
  208. DECLARE_MSM_GPIO_PINS(42);
  209. DECLARE_MSM_GPIO_PINS(43);
  210. DECLARE_MSM_GPIO_PINS(44);
  211. DECLARE_MSM_GPIO_PINS(45);
  212. DECLARE_MSM_GPIO_PINS(46);
  213. DECLARE_MSM_GPIO_PINS(47);
  214. DECLARE_MSM_GPIO_PINS(48);
  215. DECLARE_MSM_GPIO_PINS(49);
  216. DECLARE_MSM_GPIO_PINS(50);
  217. DECLARE_MSM_GPIO_PINS(51);
  218. DECLARE_MSM_GPIO_PINS(52);
  219. DECLARE_MSM_GPIO_PINS(53);
  220. DECLARE_MSM_GPIO_PINS(54);
  221. DECLARE_MSM_GPIO_PINS(55);
  222. DECLARE_MSM_GPIO_PINS(56);
  223. DECLARE_MSM_GPIO_PINS(57);
  224. DECLARE_MSM_GPIO_PINS(58);
  225. DECLARE_MSM_GPIO_PINS(59);
  226. DECLARE_MSM_GPIO_PINS(60);
  227. DECLARE_MSM_GPIO_PINS(61);
  228. DECLARE_MSM_GPIO_PINS(62);
  229. DECLARE_MSM_GPIO_PINS(63);
  230. DECLARE_MSM_GPIO_PINS(64);
  231. DECLARE_MSM_GPIO_PINS(65);
  232. DECLARE_MSM_GPIO_PINS(66);
  233. DECLARE_MSM_GPIO_PINS(67);
  234. DECLARE_MSM_GPIO_PINS(68);
  235. DECLARE_MSM_GPIO_PINS(69);
  236. DECLARE_MSM_GPIO_PINS(70);
  237. DECLARE_MSM_GPIO_PINS(71);
  238. DECLARE_MSM_GPIO_PINS(72);
  239. DECLARE_MSM_GPIO_PINS(73);
  240. DECLARE_MSM_GPIO_PINS(74);
  241. DECLARE_MSM_GPIO_PINS(75);
  242. DECLARE_MSM_GPIO_PINS(76);
  243. DECLARE_MSM_GPIO_PINS(77);
  244. DECLARE_MSM_GPIO_PINS(78);
  245. DECLARE_MSM_GPIO_PINS(79);
  246. DECLARE_MSM_GPIO_PINS(80);
  247. DECLARE_MSM_GPIO_PINS(81);
  248. DECLARE_MSM_GPIO_PINS(82);
  249. DECLARE_MSM_GPIO_PINS(83);
  250. DECLARE_MSM_GPIO_PINS(84);
  251. DECLARE_MSM_GPIO_PINS(85);
  252. DECLARE_MSM_GPIO_PINS(86);
  253. DECLARE_MSM_GPIO_PINS(87);
  254. DECLARE_MSM_GPIO_PINS(88);
  255. DECLARE_MSM_GPIO_PINS(89);
  256. DECLARE_MSM_GPIO_PINS(90);
  257. DECLARE_MSM_GPIO_PINS(91);
  258. DECLARE_MSM_GPIO_PINS(92);
  259. DECLARE_MSM_GPIO_PINS(93);
  260. DECLARE_MSM_GPIO_PINS(94);
  261. DECLARE_MSM_GPIO_PINS(95);
  262. DECLARE_MSM_GPIO_PINS(96);
  263. DECLARE_MSM_GPIO_PINS(97);
  264. DECLARE_MSM_GPIO_PINS(98);
  265. DECLARE_MSM_GPIO_PINS(99);
  266. DECLARE_MSM_GPIO_PINS(100);
  267. DECLARE_MSM_GPIO_PINS(101);
  268. DECLARE_MSM_GPIO_PINS(102);
  269. DECLARE_MSM_GPIO_PINS(103);
  270. DECLARE_MSM_GPIO_PINS(104);
  271. DECLARE_MSM_GPIO_PINS(105);
  272. DECLARE_MSM_GPIO_PINS(106);
  273. DECLARE_MSM_GPIO_PINS(107);
  274. DECLARE_MSM_GPIO_PINS(108);
  275. DECLARE_MSM_GPIO_PINS(109);
  276. DECLARE_MSM_GPIO_PINS(110);
  277. DECLARE_MSM_GPIO_PINS(111);
  278. DECLARE_MSM_GPIO_PINS(112);
  279. DECLARE_MSM_GPIO_PINS(113);
  280. DECLARE_MSM_GPIO_PINS(114);
  281. DECLARE_MSM_GPIO_PINS(115);
  282. DECLARE_MSM_GPIO_PINS(116);
  283. DECLARE_MSM_GPIO_PINS(117);
  284. DECLARE_MSM_GPIO_PINS(118);
  285. DECLARE_MSM_GPIO_PINS(119);
  286. DECLARE_MSM_GPIO_PINS(120);
  287. DECLARE_MSM_GPIO_PINS(121);
  288. DECLARE_MSM_GPIO_PINS(122);
  289. DECLARE_MSM_GPIO_PINS(123);
  290. DECLARE_MSM_GPIO_PINS(124);
  291. DECLARE_MSM_GPIO_PINS(125);
  292. DECLARE_MSM_GPIO_PINS(126);
  293. DECLARE_MSM_GPIO_PINS(127);
  294. DECLARE_MSM_GPIO_PINS(128);
  295. DECLARE_MSM_GPIO_PINS(129);
  296. DECLARE_MSM_GPIO_PINS(130);
  297. DECLARE_MSM_GPIO_PINS(131);
  298. DECLARE_MSM_GPIO_PINS(132);
  299. DECLARE_MSM_GPIO_PINS(133);
  300. DECLARE_MSM_GPIO_PINS(134);
  301. DECLARE_MSM_GPIO_PINS(135);
  302. DECLARE_MSM_GPIO_PINS(136);
  303. DECLARE_MSM_GPIO_PINS(137);
  304. DECLARE_MSM_GPIO_PINS(138);
  305. DECLARE_MSM_GPIO_PINS(139);
  306. DECLARE_MSM_GPIO_PINS(140);
  307. DECLARE_MSM_GPIO_PINS(141);
  308. DECLARE_MSM_GPIO_PINS(142);
  309. DECLARE_MSM_GPIO_PINS(143);
  310. DECLARE_MSM_GPIO_PINS(144);
  311. DECLARE_MSM_GPIO_PINS(145);
  312. static const unsigned int sdc1_clk_pins[] = { 146 };
  313. static const unsigned int sdc1_cmd_pins[] = { 147 };
  314. static const unsigned int sdc1_data_pins[] = { 148 };
  315. static const unsigned int sdc2_clk_pins[] = { 149 };
  316. static const unsigned int sdc2_cmd_pins[] = { 150 };
  317. static const unsigned int sdc2_data_pins[] = { 151 };
  318. static const unsigned int hsic_strobe_pins[] = { 152 };
  319. static const unsigned int hsic_data_pins[] = { 153 };
  320. #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7) \
  321. { \
  322. .grp = PINCTRL_PINGROUP("gpio" #id, \
  323. gpio##id##_pins, \
  324. ARRAY_SIZE(gpio##id##_pins)), \
  325. .funcs = (int[]){ \
  326. msm_mux_gpio, \
  327. msm_mux_##f1, \
  328. msm_mux_##f2, \
  329. msm_mux_##f3, \
  330. msm_mux_##f4, \
  331. msm_mux_##f5, \
  332. msm_mux_##f6, \
  333. msm_mux_##f7 \
  334. }, \
  335. .nfuncs = 8, \
  336. .ctl_reg = 0x1000 + 0x10 * id, \
  337. .io_reg = 0x1004 + 0x10 * id, \
  338. .intr_cfg_reg = 0x1008 + 0x10 * id, \
  339. .intr_status_reg = 0x100c + 0x10 * id, \
  340. .intr_target_reg = 0x1008 + 0x10 * id, \
  341. .mux_bit = 2, \
  342. .pull_bit = 0, \
  343. .drv_bit = 6, \
  344. .oe_bit = 9, \
  345. .in_bit = 0, \
  346. .out_bit = 1, \
  347. .intr_enable_bit = 0, \
  348. .intr_status_bit = 0, \
  349. .intr_target_bit = 5, \
  350. .intr_target_kpss_val = 4, \
  351. .intr_raw_status_bit = 4, \
  352. .intr_polarity_bit = 1, \
  353. .intr_detection_bit = 2, \
  354. .intr_detection_width = 2, \
  355. }
  356. #define SDC_PINGROUP(pg_name, ctl, pull, drv) \
  357. { \
  358. .grp = PINCTRL_PINGROUP(#pg_name, \
  359. pg_name##_pins, \
  360. ARRAY_SIZE(pg_name##_pins)), \
  361. .ctl_reg = ctl, \
  362. .io_reg = 0, \
  363. .intr_cfg_reg = 0, \
  364. .intr_status_reg = 0, \
  365. .intr_target_reg = 0, \
  366. .mux_bit = -1, \
  367. .pull_bit = pull, \
  368. .drv_bit = drv, \
  369. .oe_bit = -1, \
  370. .in_bit = -1, \
  371. .out_bit = -1, \
  372. .intr_enable_bit = -1, \
  373. .intr_status_bit = -1, \
  374. .intr_target_bit = -1, \
  375. .intr_target_kpss_val = -1, \
  376. .intr_raw_status_bit = -1, \
  377. .intr_polarity_bit = -1, \
  378. .intr_detection_bit = -1, \
  379. .intr_detection_width = -1, \
  380. }
  381. #define HSIC_PINGROUP(pg_name, ctl) \
  382. { \
  383. .grp = PINCTRL_PINGROUP(#pg_name, \
  384. pg_name##_pins, \
  385. ARRAY_SIZE(pg_name##_pins)), \
  386. .funcs = (int[]){ \
  387. msm_mux_gpio, \
  388. msm_mux_hsic_ctl, \
  389. }, \
  390. .nfuncs = 2, \
  391. .ctl_reg = ctl, \
  392. .io_reg = 0, \
  393. .intr_cfg_reg = 0, \
  394. .intr_status_reg = 0, \
  395. .intr_target_reg = 0, \
  396. .mux_bit = 25, \
  397. .pull_bit = -1, \
  398. .drv_bit = -1, \
  399. .oe_bit = -1, \
  400. .in_bit = -1, \
  401. .out_bit = -1, \
  402. .intr_enable_bit = -1, \
  403. .intr_status_bit = -1, \
  404. .intr_target_bit = -1, \
  405. .intr_target_kpss_val = -1, \
  406. .intr_raw_status_bit = -1, \
  407. .intr_polarity_bit = -1, \
  408. .intr_detection_bit = -1, \
  409. .intr_detection_width = -1, \
  410. }
  411. /*
  412. * TODO: Add the rest of the possible functions and fill out
  413. * the pingroup table below.
  414. */
  415. enum msm8x74_functions {
  416. msm_mux_gpio,
  417. msm_mux_cci_i2c0,
  418. msm_mux_cci_i2c1,
  419. msm_mux_blsp_i2c1,
  420. msm_mux_blsp_i2c2,
  421. msm_mux_blsp_i2c3,
  422. msm_mux_blsp_i2c4,
  423. msm_mux_blsp_i2c5,
  424. msm_mux_blsp_i2c6,
  425. msm_mux_blsp_i2c7,
  426. msm_mux_blsp_i2c8,
  427. msm_mux_blsp_i2c9,
  428. msm_mux_blsp_i2c10,
  429. msm_mux_blsp_i2c11,
  430. msm_mux_blsp_i2c12,
  431. msm_mux_blsp_spi1,
  432. msm_mux_blsp_spi1_cs1,
  433. msm_mux_blsp_spi1_cs2,
  434. msm_mux_blsp_spi1_cs3,
  435. msm_mux_blsp_spi2,
  436. msm_mux_blsp_spi2_cs1,
  437. msm_mux_blsp_spi2_cs2,
  438. msm_mux_blsp_spi2_cs3,
  439. msm_mux_blsp_spi3,
  440. msm_mux_blsp_spi4,
  441. msm_mux_blsp_spi5,
  442. msm_mux_blsp_spi6,
  443. msm_mux_blsp_spi7,
  444. msm_mux_blsp_spi8,
  445. msm_mux_blsp_spi9,
  446. msm_mux_blsp_spi10,
  447. msm_mux_blsp_spi10_cs1,
  448. msm_mux_blsp_spi10_cs2,
  449. msm_mux_blsp_spi10_cs3,
  450. msm_mux_blsp_spi11,
  451. msm_mux_blsp_spi12,
  452. msm_mux_blsp_uart1,
  453. msm_mux_blsp_uart2,
  454. msm_mux_blsp_uart3,
  455. msm_mux_blsp_uart4,
  456. msm_mux_blsp_uart5,
  457. msm_mux_blsp_uart6,
  458. msm_mux_blsp_uart7,
  459. msm_mux_blsp_uart8,
  460. msm_mux_blsp_uart9,
  461. msm_mux_blsp_uart10,
  462. msm_mux_blsp_uart11,
  463. msm_mux_blsp_uart12,
  464. msm_mux_blsp_uim1,
  465. msm_mux_blsp_uim2,
  466. msm_mux_blsp_uim3,
  467. msm_mux_blsp_uim4,
  468. msm_mux_blsp_uim5,
  469. msm_mux_blsp_uim6,
  470. msm_mux_blsp_uim7,
  471. msm_mux_blsp_uim8,
  472. msm_mux_blsp_uim9,
  473. msm_mux_blsp_uim10,
  474. msm_mux_blsp_uim11,
  475. msm_mux_blsp_uim12,
  476. msm_mux_uim1,
  477. msm_mux_uim2,
  478. msm_mux_uim_batt_alarm,
  479. msm_mux_sdc3,
  480. msm_mux_sdc4,
  481. msm_mux_gcc_gp_clk1,
  482. msm_mux_gcc_gp_clk2,
  483. msm_mux_gcc_gp_clk3,
  484. msm_mux_qua_mi2s,
  485. msm_mux_pri_mi2s,
  486. msm_mux_spkr_mi2s,
  487. msm_mux_ter_mi2s,
  488. msm_mux_sec_mi2s,
  489. msm_mux_hdmi_cec,
  490. msm_mux_hdmi_ddc,
  491. msm_mux_hdmi_hpd,
  492. msm_mux_edp_hpd,
  493. msm_mux_mdp_vsync,
  494. msm_mux_cam_mclk0,
  495. msm_mux_cam_mclk1,
  496. msm_mux_cam_mclk2,
  497. msm_mux_cam_mclk3,
  498. msm_mux_cci_timer0,
  499. msm_mux_cci_timer1,
  500. msm_mux_cci_timer2,
  501. msm_mux_cci_timer3,
  502. msm_mux_cci_timer4,
  503. msm_mux_cci_async_in0,
  504. msm_mux_cci_async_in1,
  505. msm_mux_cci_async_in2,
  506. msm_mux_gp_pdm0,
  507. msm_mux_gp_pdm1,
  508. msm_mux_gp_pdm2,
  509. msm_mux_gp0_clk,
  510. msm_mux_gp1_clk,
  511. msm_mux_gp_mn,
  512. msm_mux_tsif1,
  513. msm_mux_tsif2,
  514. msm_mux_hsic,
  515. msm_mux_grfc,
  516. msm_mux_audio_ref_clk,
  517. msm_mux_bt,
  518. msm_mux_fm,
  519. msm_mux_wlan,
  520. msm_mux_slimbus,
  521. msm_mux_hsic_ctl,
  522. msm_mux_NA,
  523. };
  524. static const char * const gpio_groups[] = {
  525. "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7",
  526. "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14",
  527. "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21",
  528. "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28",
  529. "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35",
  530. "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42",
  531. "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49",
  532. "gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56",
  533. "gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63",
  534. "gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70",
  535. "gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77",
  536. "gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84",
  537. "gpio85", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", "gpio91",
  538. "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98",
  539. "gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104",
  540. "gpio105", "gpio106", "gpio107", "gpio108", "gpio109", "gpio110",
  541. "gpio111", "gpio112", "gpio113", "gpio114", "gpio115", "gpio116",
  542. "gpio117", "gpio118", "gpio119", "gpio120", "gpio121", "gpio122",
  543. "gpio123", "gpio124", "gpio125", "gpio126", "gpio127", "gpio128",
  544. "gpio129", "gpio130", "gpio131", "gpio132", "gpio133", "gpio134",
  545. "gpio135", "gpio136", "gpio137", "gpio138", "gpio139", "gpio140",
  546. "gpio141", "gpio142", "gpio143", "gpio144", "gpio145", "hsic_data",
  547. "hsic_strobe",
  548. };
  549. static const char * const blsp_uart1_groups[] = {
  550. "gpio0", "gpio1", "gpio2", "gpio3"
  551. };
  552. static const char * const blsp_uim1_groups[] = { "gpio0", "gpio1" };
  553. static const char * const blsp_i2c1_groups[] = { "gpio2", "gpio3" };
  554. static const char * const blsp_spi1_groups[] = {
  555. "gpio0", "gpio1", "gpio2", "gpio3"
  556. };
  557. static const char * const blsp_spi1_cs1_groups[] = { "gpio8" };
  558. static const char * const blsp_spi1_cs2_groups[] = { "gpio9", "gpio11" };
  559. static const char * const blsp_spi1_cs3_groups[] = { "gpio10" };
  560. static const char * const blsp_uart2_groups[] = {
  561. "gpio4", "gpio5", "gpio6", "gpio7"
  562. };
  563. static const char * const blsp_uim2_groups[] = { "gpio4", "gpio5" };
  564. static const char * const blsp_i2c2_groups[] = { "gpio6", "gpio7" };
  565. static const char * const blsp_spi2_groups[] = {
  566. "gpio4", "gpio5", "gpio6", "gpio7"
  567. };
  568. static const char * const blsp_spi2_cs1_groups[] = { "gpio53", "gpio62" };
  569. static const char * const blsp_spi2_cs2_groups[] = { "gpio54", "gpio63" };
  570. static const char * const blsp_spi2_cs3_groups[] = { "gpio66" };
  571. static const char * const blsp_uart3_groups[] = {
  572. "gpio8", "gpio9", "gpio10", "gpio11"
  573. };
  574. static const char * const blsp_uim3_groups[] = { "gpio8", "gpio9" };
  575. static const char * const blsp_i2c3_groups[] = { "gpio10", "gpio11" };
  576. static const char * const blsp_spi3_groups[] = {
  577. "gpio8", "gpio9", "gpio10", "gpio11"
  578. };
  579. static const char * const cci_i2c0_groups[] = { "gpio19", "gpio20" };
  580. static const char * const cci_i2c1_groups[] = { "gpio21", "gpio22" };
  581. static const char * const blsp_uart4_groups[] = {
  582. "gpio19", "gpio20", "gpio21", "gpio22"
  583. };
  584. static const char * const blsp_uim4_groups[] = { "gpio19", "gpio20" };
  585. static const char * const blsp_i2c4_groups[] = { "gpio21", "gpio22" };
  586. static const char * const blsp_spi4_groups[] = {
  587. "gpio19", "gpio20", "gpio21", "gpio22"
  588. };
  589. static const char * const blsp_uart5_groups[] = {
  590. "gpio23", "gpio24", "gpio25", "gpio26"
  591. };
  592. static const char * const blsp_uim5_groups[] = { "gpio23", "gpio24" };
  593. static const char * const blsp_i2c5_groups[] = { "gpio25", "gpio26" };
  594. static const char * const blsp_spi5_groups[] = {
  595. "gpio23", "gpio24", "gpio25", "gpio26"
  596. };
  597. static const char * const blsp_uart6_groups[] = {
  598. "gpio27", "gpio28", "gpio29", "gpio30"
  599. };
  600. static const char * const blsp_uim6_groups[] = { "gpio27", "gpio28" };
  601. static const char * const blsp_i2c6_groups[] = { "gpio29", "gpio30" };
  602. static const char * const blsp_spi6_groups[] = {
  603. "gpio27", "gpio28", "gpio29", "gpio30"
  604. };
  605. static const char * const blsp_uart7_groups[] = {
  606. "gpio41", "gpio42", "gpio43", "gpio44"
  607. };
  608. static const char * const blsp_uim7_groups[] = { "gpio41", "gpio42" };
  609. static const char * const blsp_i2c7_groups[] = { "gpio43", "gpio44" };
  610. static const char * const blsp_spi7_groups[] = {
  611. "gpio41", "gpio42", "gpio43", "gpio44"
  612. };
  613. static const char * const blsp_uart8_groups[] = {
  614. "gpio45", "gpio46", "gpio47", "gpio48"
  615. };
  616. static const char * const blsp_uim8_groups[] = { "gpio45", "gpio46" };
  617. static const char * const blsp_i2c8_groups[] = { "gpio47", "gpio48" };
  618. static const char * const blsp_spi8_groups[] = {
  619. "gpio45", "gpio46", "gpio47", "gpio48"
  620. };
  621. static const char * const blsp_uart9_groups[] = {
  622. "gpio49", "gpio50", "gpio51", "gpio52"
  623. };
  624. static const char * const blsp_uim9_groups[] = { "gpio49", "gpio50" };
  625. static const char * const blsp_i2c9_groups[] = { "gpio51", "gpio52" };
  626. static const char * const blsp_spi9_groups[] = {
  627. "gpio49", "gpio50", "gpio51", "gpio52"
  628. };
  629. static const char * const blsp_uart10_groups[] = {
  630. "gpio53", "gpio54", "gpio55", "gpio56"
  631. };
  632. static const char * const blsp_uim10_groups[] = { "gpio53", "gpio54" };
  633. static const char * const blsp_i2c10_groups[] = { "gpio55", "gpio56" };
  634. static const char * const blsp_spi10_groups[] = {
  635. "gpio53", "gpio54", "gpio55", "gpio56"
  636. };
  637. static const char * const blsp_spi10_cs1_groups[] = { "gpio47", "gpio67" };
  638. static const char * const blsp_spi10_cs2_groups[] = { "gpio48", "gpio68" };
  639. static const char * const blsp_spi10_cs3_groups[] = { "gpio90" };
  640. static const char * const blsp_uart11_groups[] = {
  641. "gpio81", "gpio82", "gpio83", "gpio84"
  642. };
  643. static const char * const blsp_uim11_groups[] = { "gpio81", "gpio82" };
  644. static const char * const blsp_i2c11_groups[] = { "gpio83", "gpio84" };
  645. static const char * const blsp_spi11_groups[] = {
  646. "gpio81", "gpio82", "gpio83", "gpio84"
  647. };
  648. static const char * const blsp_uart12_groups[] = {
  649. "gpio85", "gpio86", "gpio87", "gpio88"
  650. };
  651. static const char * const blsp_uim12_groups[] = { "gpio85", "gpio86" };
  652. static const char * const blsp_i2c12_groups[] = { "gpio87", "gpio88" };
  653. static const char * const blsp_spi12_groups[] = {
  654. "gpio85", "gpio86", "gpio87", "gpio88"
  655. };
  656. static const char * const uim1_groups[] = {
  657. "gpio97", "gpio98", "gpio99", "gpio100"
  658. };
  659. static const char * const uim2_groups[] = {
  660. "gpio49", "gpio50", "gpio51", "gpio52"
  661. };
  662. static const char * const uim_batt_alarm_groups[] = { "gpio101" };
  663. static const char * const sdc3_groups[] = {
  664. "gpio35", "gpio36", "gpio37", "gpio38", "gpio39", "gpio40"
  665. };
  666. static const char * const sdc4_groups[] = {
  667. "gpio91", "gpio92", "gpio93", "gpio94", "gpio95", "gpio96"
  668. };
  669. static const char * const gp0_clk_groups[] = { "gpio26" };
  670. static const char * const gp1_clk_groups[] = { "gpio27", "gpio57", "gpio78" };
  671. static const char * const gp_mn_groups[] = { "gpio29" };
  672. static const char * const gcc_gp_clk1_groups[] = { "gpio57", "gpio78" };
  673. static const char * const gcc_gp_clk2_groups[] = { "gpio58", "gpio81" };
  674. static const char * const gcc_gp_clk3_groups[] = { "gpio59", "gpio82" };
  675. static const char * const qua_mi2s_groups[] = {
  676. "gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63",
  677. };
  678. static const char * const pri_mi2s_groups[] = {
  679. "gpio64", "gpio65", "gpio66", "gpio67", "gpio68"
  680. };
  681. static const char * const spkr_mi2s_groups[] = {
  682. "gpio69", "gpio70", "gpio71", "gpio72"
  683. };
  684. static const char * const ter_mi2s_groups[] = {
  685. "gpio73", "gpio74", "gpio75", "gpio76", "gpio77"
  686. };
  687. static const char * const sec_mi2s_groups[] = {
  688. "gpio78", "gpio79", "gpio80", "gpio81", "gpio82"
  689. };
  690. static const char * const hdmi_cec_groups[] = { "gpio31" };
  691. static const char * const hdmi_ddc_groups[] = { "gpio32", "gpio33" };
  692. static const char * const hdmi_hpd_groups[] = { "gpio34" };
  693. static const char * const edp_hpd_groups[] = { "gpio102" };
  694. static const char * const mdp_vsync_groups[] = { "gpio12", "gpio13", "gpio14" };
  695. static const char * const cam_mclk0_groups[] = { "gpio15" };
  696. static const char * const cam_mclk1_groups[] = { "gpio16" };
  697. static const char * const cam_mclk2_groups[] = { "gpio17" };
  698. static const char * const cam_mclk3_groups[] = { "gpio18" };
  699. static const char * const cci_timer0_groups[] = { "gpio23" };
  700. static const char * const cci_timer1_groups[] = { "gpio24" };
  701. static const char * const cci_timer2_groups[] = { "gpio25" };
  702. static const char * const cci_timer3_groups[] = { "gpio26" };
  703. static const char * const cci_timer4_groups[] = { "gpio27" };
  704. static const char * const cci_async_in0_groups[] = { "gpio28" };
  705. static const char * const cci_async_in1_groups[] = { "gpio26" };
  706. static const char * const cci_async_in2_groups[] = { "gpio27" };
  707. static const char * const gp_pdm0_groups[] = { "gpio54", "gpio68" };
  708. static const char * const gp_pdm1_groups[] = { "gpio74", "gpio86" };
  709. static const char * const gp_pdm2_groups[] = { "gpio63", "gpio79" };
  710. static const char * const tsif1_groups[] = {
  711. "gpio89", "gpio90", "gpio91", "gpio92"
  712. };
  713. static const char * const tsif2_groups[] = {
  714. "gpio93", "gpio94", "gpio95", "gpio96"
  715. };
  716. static const char * const hsic_groups[] = { "gpio144", "gpio145" };
  717. static const char * const grfc_groups[] = {
  718. "gpio104", "gpio105", "gpio106", "gpio107", "gpio108", "gpio109",
  719. "gpio110", "gpio111", "gpio112", "gpio113", "gpio114", "gpio115",
  720. "gpio116", "gpio117", "gpio118", "gpio119", "gpio120", "gpio121",
  721. "gpio122", "gpio123", "gpio124", "gpio125", "gpio126", "gpio127",
  722. "gpio128", "gpio136", "gpio137", "gpio141", "gpio143"
  723. };
  724. static const char * const audio_ref_clk_groups[] = { "gpio69" };
  725. static const char * const bt_groups[] = { "gpio35", "gpio43", "gpio44" };
  726. static const char * const fm_groups[] = { "gpio41", "gpio42" };
  727. static const char * const wlan_groups[] = {
  728. "gpio36", "gpio37", "gpio38", "gpio39", "gpio40"
  729. };
  730. static const char * const slimbus_groups[] = { "gpio70", "gpio71" };
  731. static const char * const hsic_ctl_groups[] = { "hsic_strobe", "hsic_data" };
  732. static const struct pinfunction msm8x74_functions[] = {
  733. MSM_PIN_FUNCTION(gpio),
  734. MSM_PIN_FUNCTION(cci_i2c0),
  735. MSM_PIN_FUNCTION(cci_i2c1),
  736. MSM_PIN_FUNCTION(uim1),
  737. MSM_PIN_FUNCTION(uim2),
  738. MSM_PIN_FUNCTION(uim_batt_alarm),
  739. MSM_PIN_FUNCTION(blsp_uim1),
  740. MSM_PIN_FUNCTION(blsp_uim2),
  741. MSM_PIN_FUNCTION(blsp_uim3),
  742. MSM_PIN_FUNCTION(blsp_uim4),
  743. MSM_PIN_FUNCTION(blsp_uim5),
  744. MSM_PIN_FUNCTION(blsp_uim6),
  745. MSM_PIN_FUNCTION(blsp_uim7),
  746. MSM_PIN_FUNCTION(blsp_uim8),
  747. MSM_PIN_FUNCTION(blsp_uim9),
  748. MSM_PIN_FUNCTION(blsp_uim10),
  749. MSM_PIN_FUNCTION(blsp_uim11),
  750. MSM_PIN_FUNCTION(blsp_uim12),
  751. MSM_PIN_FUNCTION(blsp_i2c1),
  752. MSM_PIN_FUNCTION(blsp_i2c2),
  753. MSM_PIN_FUNCTION(blsp_i2c3),
  754. MSM_PIN_FUNCTION(blsp_i2c4),
  755. MSM_PIN_FUNCTION(blsp_i2c5),
  756. MSM_PIN_FUNCTION(blsp_i2c6),
  757. MSM_PIN_FUNCTION(blsp_i2c7),
  758. MSM_PIN_FUNCTION(blsp_i2c8),
  759. MSM_PIN_FUNCTION(blsp_i2c9),
  760. MSM_PIN_FUNCTION(blsp_i2c10),
  761. MSM_PIN_FUNCTION(blsp_i2c11),
  762. MSM_PIN_FUNCTION(blsp_i2c12),
  763. MSM_PIN_FUNCTION(blsp_spi1),
  764. MSM_PIN_FUNCTION(blsp_spi1_cs1),
  765. MSM_PIN_FUNCTION(blsp_spi1_cs2),
  766. MSM_PIN_FUNCTION(blsp_spi1_cs3),
  767. MSM_PIN_FUNCTION(blsp_spi2),
  768. MSM_PIN_FUNCTION(blsp_spi2_cs1),
  769. MSM_PIN_FUNCTION(blsp_spi2_cs2),
  770. MSM_PIN_FUNCTION(blsp_spi2_cs3),
  771. MSM_PIN_FUNCTION(blsp_spi3),
  772. MSM_PIN_FUNCTION(blsp_spi4),
  773. MSM_PIN_FUNCTION(blsp_spi5),
  774. MSM_PIN_FUNCTION(blsp_spi6),
  775. MSM_PIN_FUNCTION(blsp_spi7),
  776. MSM_PIN_FUNCTION(blsp_spi8),
  777. MSM_PIN_FUNCTION(blsp_spi9),
  778. MSM_PIN_FUNCTION(blsp_spi10),
  779. MSM_PIN_FUNCTION(blsp_spi10_cs1),
  780. MSM_PIN_FUNCTION(blsp_spi10_cs2),
  781. MSM_PIN_FUNCTION(blsp_spi10_cs3),
  782. MSM_PIN_FUNCTION(blsp_spi11),
  783. MSM_PIN_FUNCTION(blsp_spi12),
  784. MSM_PIN_FUNCTION(blsp_uart1),
  785. MSM_PIN_FUNCTION(blsp_uart2),
  786. MSM_PIN_FUNCTION(blsp_uart3),
  787. MSM_PIN_FUNCTION(blsp_uart4),
  788. MSM_PIN_FUNCTION(blsp_uart5),
  789. MSM_PIN_FUNCTION(blsp_uart6),
  790. MSM_PIN_FUNCTION(blsp_uart7),
  791. MSM_PIN_FUNCTION(blsp_uart8),
  792. MSM_PIN_FUNCTION(blsp_uart9),
  793. MSM_PIN_FUNCTION(blsp_uart10),
  794. MSM_PIN_FUNCTION(blsp_uart11),
  795. MSM_PIN_FUNCTION(blsp_uart12),
  796. MSM_PIN_FUNCTION(sdc3),
  797. MSM_PIN_FUNCTION(sdc4),
  798. MSM_PIN_FUNCTION(gcc_gp_clk1),
  799. MSM_PIN_FUNCTION(gcc_gp_clk2),
  800. MSM_PIN_FUNCTION(gcc_gp_clk3),
  801. MSM_PIN_FUNCTION(qua_mi2s),
  802. MSM_PIN_FUNCTION(pri_mi2s),
  803. MSM_PIN_FUNCTION(spkr_mi2s),
  804. MSM_PIN_FUNCTION(ter_mi2s),
  805. MSM_PIN_FUNCTION(sec_mi2s),
  806. MSM_PIN_FUNCTION(mdp_vsync),
  807. MSM_PIN_FUNCTION(cam_mclk0),
  808. MSM_PIN_FUNCTION(cam_mclk1),
  809. MSM_PIN_FUNCTION(cam_mclk2),
  810. MSM_PIN_FUNCTION(cam_mclk3),
  811. MSM_PIN_FUNCTION(cci_timer0),
  812. MSM_PIN_FUNCTION(cci_timer1),
  813. MSM_PIN_FUNCTION(cci_timer2),
  814. MSM_PIN_FUNCTION(cci_timer3),
  815. MSM_PIN_FUNCTION(cci_timer4),
  816. MSM_PIN_FUNCTION(cci_async_in0),
  817. MSM_PIN_FUNCTION(cci_async_in1),
  818. MSM_PIN_FUNCTION(cci_async_in2),
  819. MSM_PIN_FUNCTION(hdmi_cec),
  820. MSM_PIN_FUNCTION(hdmi_ddc),
  821. MSM_PIN_FUNCTION(hdmi_hpd),
  822. MSM_PIN_FUNCTION(edp_hpd),
  823. MSM_PIN_FUNCTION(gp_pdm0),
  824. MSM_PIN_FUNCTION(gp_pdm1),
  825. MSM_PIN_FUNCTION(gp_pdm2),
  826. MSM_PIN_FUNCTION(gp0_clk),
  827. MSM_PIN_FUNCTION(gp1_clk),
  828. MSM_PIN_FUNCTION(gp_mn),
  829. MSM_PIN_FUNCTION(tsif1),
  830. MSM_PIN_FUNCTION(tsif2),
  831. MSM_PIN_FUNCTION(hsic),
  832. MSM_PIN_FUNCTION(grfc),
  833. MSM_PIN_FUNCTION(audio_ref_clk),
  834. MSM_PIN_FUNCTION(bt),
  835. MSM_PIN_FUNCTION(fm),
  836. MSM_PIN_FUNCTION(wlan),
  837. MSM_PIN_FUNCTION(slimbus),
  838. MSM_PIN_FUNCTION(hsic_ctl),
  839. };
  840. static const struct msm_pingroup msm8x74_groups[] = {
  841. PINGROUP(0, blsp_spi1, blsp_uart1, blsp_uim1, NA, NA, NA, NA),
  842. PINGROUP(1, blsp_spi1, blsp_uart1, blsp_uim1, NA, NA, NA, NA),
  843. PINGROUP(2, blsp_spi1, blsp_uart1, blsp_i2c1, NA, NA, NA, NA),
  844. PINGROUP(3, blsp_spi1, blsp_uart1, blsp_i2c1, NA, NA, NA, NA),
  845. PINGROUP(4, blsp_spi2, blsp_uart2, blsp_uim2, NA, NA, NA, NA),
  846. PINGROUP(5, blsp_spi2, blsp_uart2, blsp_uim2, NA, NA, NA, NA),
  847. PINGROUP(6, blsp_spi2, blsp_uart2, blsp_i2c2, NA, NA, NA, NA),
  848. PINGROUP(7, blsp_spi2, blsp_uart2, blsp_i2c2, NA, NA, NA, NA),
  849. PINGROUP(8, blsp_spi3, blsp_uart3, blsp_uim3, blsp_spi1_cs1, NA, NA, NA),
  850. PINGROUP(9, blsp_spi3, blsp_uart3, blsp_uim3, blsp_spi1_cs2, NA, NA, NA),
  851. PINGROUP(10, blsp_spi3, blsp_uart3, blsp_i2c3, blsp_spi1_cs3, NA, NA, NA),
  852. PINGROUP(11, blsp_spi3, blsp_uart3, blsp_i2c3, blsp_spi1_cs2, NA, NA, NA),
  853. PINGROUP(12, mdp_vsync, NA, NA, NA, NA, NA, NA),
  854. PINGROUP(13, mdp_vsync, NA, NA, NA, NA, NA, NA),
  855. PINGROUP(14, mdp_vsync, NA, NA, NA, NA, NA, NA),
  856. PINGROUP(15, cam_mclk0, NA, NA, NA, NA, NA, NA),
  857. PINGROUP(16, cam_mclk1, NA, NA, NA, NA, NA, NA),
  858. PINGROUP(17, cam_mclk2, NA, NA, NA, NA, NA, NA),
  859. PINGROUP(18, cam_mclk3, NA, NA, NA, NA, NA, NA),
  860. PINGROUP(19, cci_i2c0, blsp_spi4, blsp_uart4, blsp_uim4, NA, NA, NA),
  861. PINGROUP(20, cci_i2c0, blsp_spi4, blsp_uart4, blsp_uim4, NA, NA, NA),
  862. PINGROUP(21, cci_i2c1, blsp_spi4, blsp_uart4, blsp_i2c4, NA, NA, NA),
  863. PINGROUP(22, cci_i2c1, blsp_spi4, blsp_uart4, blsp_i2c4, NA, NA, NA),
  864. PINGROUP(23, cci_timer0, blsp_spi5, blsp_uart5, blsp_uim5, NA, NA, NA),
  865. PINGROUP(24, cci_timer1, blsp_spi5, blsp_uart5, blsp_uim5, NA, NA, NA),
  866. PINGROUP(25, cci_timer2, blsp_spi5, blsp_uart5, blsp_i2c5, NA, NA, NA),
  867. PINGROUP(26, cci_timer3, cci_async_in1, blsp_spi5, blsp_uart5, blsp_i2c5, gp0_clk, NA),
  868. PINGROUP(27, cci_timer4, cci_async_in2, blsp_spi6, blsp_uart6, blsp_i2c6, gp1_clk, NA),
  869. PINGROUP(28, cci_async_in0, blsp_spi6, blsp_uart6, blsp_uim6, NA, NA, NA),
  870. PINGROUP(29, blsp_spi6, blsp_uart6, blsp_i2c6, gp_mn, NA, NA, NA),
  871. PINGROUP(30, blsp_spi6, blsp_uart6, blsp_i2c6, NA, NA, NA, NA),
  872. PINGROUP(31, hdmi_cec, NA, NA, NA, NA, NA, NA),
  873. PINGROUP(32, hdmi_ddc, NA, NA, NA, NA, NA, NA),
  874. PINGROUP(33, hdmi_ddc, NA, NA, NA, NA, NA, NA),
  875. PINGROUP(34, hdmi_hpd, NA, NA, NA, NA, NA, NA),
  876. PINGROUP(35, bt, sdc3, NA, NA, NA, NA, NA),
  877. PINGROUP(36, wlan, sdc3, NA, NA, NA, NA, NA),
  878. PINGROUP(37, wlan, sdc3, NA, NA, NA, NA, NA),
  879. PINGROUP(38, wlan, sdc3, NA, NA, NA, NA, NA),
  880. PINGROUP(39, wlan, sdc3, NA, NA, NA, NA, NA),
  881. PINGROUP(40, wlan, sdc3, NA, NA, NA, NA, NA),
  882. PINGROUP(41, fm, blsp_spi7, blsp_uart7, blsp_uim7, NA, NA, NA),
  883. PINGROUP(42, fm, blsp_spi7, blsp_uart7, blsp_uim7, NA, NA, NA),
  884. PINGROUP(43, bt, blsp_spi7, blsp_uart7, blsp_i2c7, NA, NA, NA),
  885. PINGROUP(44, bt, blsp_spi7, blsp_uart7, blsp_i2c7, NA, NA, NA),
  886. PINGROUP(45, blsp_spi8, blsp_uart8, blsp_uim8, NA, NA, NA, NA),
  887. PINGROUP(46, blsp_spi8, blsp_uart8, blsp_uim8, NA, NA, NA, NA),
  888. PINGROUP(47, blsp_spi8, blsp_uart8, blsp_i2c8, blsp_spi10_cs1, NA, NA, NA),
  889. PINGROUP(48, blsp_spi8, blsp_uart8, blsp_i2c8, blsp_spi10_cs2, NA, NA, NA),
  890. PINGROUP(49, uim2, blsp_spi9, blsp_uart9, blsp_uim9, NA, NA, NA),
  891. PINGROUP(50, uim2, blsp_spi9, blsp_uart9, blsp_uim9, NA, NA, NA),
  892. PINGROUP(51, uim2, blsp_spi9, blsp_uart9, blsp_i2c9, NA, NA, NA),
  893. PINGROUP(52, uim2, blsp_spi9, blsp_uart9, blsp_i2c9, NA, NA, NA),
  894. PINGROUP(53, blsp_spi10, blsp_uart10, blsp_uim10, blsp_spi2_cs1, NA, NA, NA),
  895. PINGROUP(54, blsp_spi10, blsp_uart10, blsp_uim10, blsp_spi2_cs2, gp_pdm0, NA, NA),
  896. PINGROUP(55, blsp_spi10, blsp_uart10, blsp_i2c10, NA, NA, NA, NA),
  897. PINGROUP(56, blsp_spi10, blsp_uart10, blsp_i2c10, NA, NA, NA, NA),
  898. PINGROUP(57, qua_mi2s, gcc_gp_clk1, NA, NA, NA, NA, NA),
  899. PINGROUP(58, qua_mi2s, gcc_gp_clk2, NA, NA, NA, NA, NA),
  900. PINGROUP(59, qua_mi2s, gcc_gp_clk3, NA, NA, NA, NA, NA),
  901. PINGROUP(60, qua_mi2s, NA, NA, NA, NA, NA, NA),
  902. PINGROUP(61, qua_mi2s, NA, NA, NA, NA, NA, NA),
  903. PINGROUP(62, qua_mi2s, blsp_spi2_cs1, NA, NA, NA, NA, NA),
  904. PINGROUP(63, qua_mi2s, blsp_spi2_cs2, gp_pdm2, NA, NA, NA, NA),
  905. PINGROUP(64, pri_mi2s, NA, NA, NA, NA, NA, NA),
  906. PINGROUP(65, pri_mi2s, NA, NA, NA, NA, NA, NA),
  907. PINGROUP(66, pri_mi2s, blsp_spi2_cs3, NA, NA, NA, NA, NA),
  908. PINGROUP(67, pri_mi2s, blsp_spi10_cs1, NA, NA, NA, NA, NA),
  909. PINGROUP(68, pri_mi2s, blsp_spi10_cs2, gp_pdm0, NA, NA, NA, NA),
  910. PINGROUP(69, spkr_mi2s, audio_ref_clk, NA, NA, NA, NA, NA),
  911. PINGROUP(70, slimbus, spkr_mi2s, NA, NA, NA, NA, NA),
  912. PINGROUP(71, slimbus, spkr_mi2s, NA, NA, NA, NA, NA),
  913. PINGROUP(72, spkr_mi2s, NA, NA, NA, NA, NA, NA),
  914. PINGROUP(73, ter_mi2s, NA, NA, NA, NA, NA, NA),
  915. PINGROUP(74, ter_mi2s, gp_pdm1, NA, NA, NA, NA, NA),
  916. PINGROUP(75, ter_mi2s, NA, NA, NA, NA, NA, NA),
  917. PINGROUP(76, ter_mi2s, NA, NA, NA, NA, NA, NA),
  918. PINGROUP(77, ter_mi2s, NA, NA, NA, NA, NA, NA),
  919. PINGROUP(78, sec_mi2s, gcc_gp_clk1, NA, NA, NA, NA, NA),
  920. PINGROUP(79, sec_mi2s, gp_pdm2, NA, NA, NA, NA, NA),
  921. PINGROUP(80, sec_mi2s, NA, NA, NA, NA, NA, NA),
  922. PINGROUP(81, sec_mi2s, blsp_spi11, blsp_uart11, blsp_uim11, gcc_gp_clk2, NA, NA),
  923. PINGROUP(82, sec_mi2s, blsp_spi11, blsp_uart11, blsp_uim11, gcc_gp_clk3, NA, NA),
  924. PINGROUP(83, blsp_spi11, blsp_uart11, blsp_i2c11, NA, NA, NA, NA),
  925. PINGROUP(84, blsp_spi11, blsp_uart11, blsp_i2c11, NA, NA, NA, NA),
  926. PINGROUP(85, blsp_spi12, blsp_uart12, blsp_uim12, NA, NA, NA, NA),
  927. PINGROUP(86, blsp_spi12, blsp_uart12, blsp_uim12, gp_pdm1, NA, NA, NA),
  928. PINGROUP(87, blsp_spi12, blsp_uart12, blsp_i2c12, NA, NA, NA, NA),
  929. PINGROUP(88, blsp_spi12, blsp_uart12, blsp_i2c12, NA, NA, NA, NA),
  930. PINGROUP(89, tsif1, NA, NA, NA, NA, NA, NA),
  931. PINGROUP(90, tsif1, blsp_spi10_cs3, NA, NA, NA, NA, NA),
  932. PINGROUP(91, tsif1, sdc4, NA, NA, NA, NA, NA),
  933. PINGROUP(92, tsif1, sdc4, NA, NA, NA, NA, NA),
  934. PINGROUP(93, tsif2, sdc4, NA, NA, NA, NA, NA),
  935. PINGROUP(94, tsif2, sdc4, NA, NA, NA, NA, NA),
  936. PINGROUP(95, tsif2, sdc4, NA, NA, NA, NA, NA),
  937. PINGROUP(96, tsif2, sdc4, NA, NA, NA, NA, NA),
  938. PINGROUP(97, uim1, NA, NA, NA, NA, NA, NA),
  939. PINGROUP(98, uim1, NA, NA, NA, NA, NA, NA),
  940. PINGROUP(99, uim1, NA, NA, NA, NA, NA, NA),
  941. PINGROUP(100, uim1, NA, NA, NA, NA, NA, NA),
  942. PINGROUP(101, uim_batt_alarm, NA, NA, NA, NA, NA, NA),
  943. PINGROUP(102, edp_hpd, NA, NA, NA, NA, NA, NA),
  944. PINGROUP(103, NA, NA, NA, NA, NA, NA, NA),
  945. PINGROUP(104, grfc, NA, NA, NA, NA, NA, NA),
  946. PINGROUP(105, grfc, NA, NA, NA, NA, NA, NA),
  947. PINGROUP(106, grfc, NA, NA, NA, NA, NA, NA),
  948. PINGROUP(107, grfc, NA, NA, NA, NA, NA, NA),
  949. PINGROUP(108, grfc, NA, NA, NA, NA, NA, NA),
  950. PINGROUP(109, grfc, NA, NA, NA, NA, NA, NA),
  951. PINGROUP(110, grfc, NA, NA, NA, NA, NA, NA),
  952. PINGROUP(111, grfc, NA, NA, NA, NA, NA, NA),
  953. PINGROUP(112, grfc, NA, NA, NA, NA, NA, NA),
  954. PINGROUP(113, grfc, NA, NA, NA, NA, NA, NA),
  955. PINGROUP(114, grfc, NA, NA, NA, NA, NA, NA),
  956. PINGROUP(115, grfc, NA, NA, NA, NA, NA, NA),
  957. PINGROUP(116, grfc, NA, NA, NA, NA, NA, NA),
  958. PINGROUP(117, grfc, NA, NA, NA, NA, NA, NA),
  959. PINGROUP(118, grfc, NA, NA, NA, NA, NA, NA),
  960. PINGROUP(119, grfc, NA, NA, NA, NA, NA, NA),
  961. PINGROUP(120, grfc, NA, NA, NA, NA, NA, NA),
  962. PINGROUP(121, grfc, NA, NA, NA, NA, NA, NA),
  963. PINGROUP(122, grfc, NA, NA, NA, NA, NA, NA),
  964. PINGROUP(123, grfc, NA, NA, NA, NA, NA, NA),
  965. PINGROUP(124, grfc, NA, NA, NA, NA, NA, NA),
  966. PINGROUP(125, grfc, NA, NA, NA, NA, NA, NA),
  967. PINGROUP(126, grfc, NA, NA, NA, NA, NA, NA),
  968. PINGROUP(127, grfc, NA, NA, NA, NA, NA, NA),
  969. PINGROUP(128, NA, grfc, NA, NA, NA, NA, NA),
  970. PINGROUP(129, NA, NA, NA, NA, NA, NA, NA),
  971. PINGROUP(130, NA, NA, NA, NA, NA, NA, NA),
  972. PINGROUP(131, NA, NA, NA, NA, NA, NA, NA),
  973. PINGROUP(132, NA, NA, NA, NA, NA, NA, NA),
  974. PINGROUP(133, NA, NA, NA, NA, NA, NA, NA),
  975. PINGROUP(134, NA, NA, NA, NA, NA, NA, NA),
  976. PINGROUP(135, NA, NA, NA, NA, NA, NA, NA),
  977. PINGROUP(136, NA, grfc, NA, NA, NA, NA, NA),
  978. PINGROUP(137, NA, grfc, NA, NA, NA, NA, NA),
  979. PINGROUP(138, NA, NA, NA, NA, NA, NA, NA),
  980. PINGROUP(139, NA, NA, NA, NA, NA, NA, NA),
  981. PINGROUP(140, NA, NA, NA, NA, NA, NA, NA),
  982. PINGROUP(141, NA, grfc, NA, NA, NA, NA, NA),
  983. PINGROUP(142, NA, NA, NA, NA, NA, NA, NA),
  984. PINGROUP(143, NA, grfc, NA, NA, NA, NA, NA),
  985. PINGROUP(144, hsic, NA, NA, NA, NA, NA, NA),
  986. PINGROUP(145, hsic, NA, NA, NA, NA, NA, NA),
  987. SDC_PINGROUP(sdc1_clk, 0x2044, 13, 6),
  988. SDC_PINGROUP(sdc1_cmd, 0x2044, 11, 3),
  989. SDC_PINGROUP(sdc1_data, 0x2044, 9, 0),
  990. SDC_PINGROUP(sdc2_clk, 0x2048, 14, 6),
  991. SDC_PINGROUP(sdc2_cmd, 0x2048, 11, 3),
  992. SDC_PINGROUP(sdc2_data, 0x2048, 9, 0),
  993. HSIC_PINGROUP(hsic_strobe, 0x2050),
  994. HSIC_PINGROUP(hsic_data, 0x2054),
  995. };
  996. #define NUM_GPIO_PINGROUPS 146
  997. static const struct msm_gpio_wakeirq_map msm8x74_mpm_map[] = {
  998. { 1, 4 }, { 5, 5 }, { 9, 6 }, { 18, 7 }, { 20, 8 }, { 24, 9 },
  999. { 27, 10 }, { 28, 11 }, { 34, 12 }, { 35, 13 }, { 37, 14 }, { 42, 15 },
  1000. { 44, 16 }, { 46, 17 }, { 50, 18 }, { 54, 19 }, { 59, 20 }, { 61, 21 },
  1001. { 62, 22 }, { 64, 23 }, { 65, 24 }, { 66, 25 }, { 67, 26 }, { 68, 27 },
  1002. { 71, 28 }, { 72, 29 }, { 73, 30 }, { 74, 31 }, { 75, 32 }, { 77, 33 },
  1003. { 79, 34 }, { 80, 35 }, { 82, 36 }, { 86, 37 }, { 92, 38 }, { 93, 39 },
  1004. { 95, 40 }, { 102, 3 }, { 144, 41 },
  1005. };
  1006. static const struct msm_pinctrl_soc_data msm8x74_pinctrl = {
  1007. .pins = msm8x74_pins,
  1008. .npins = ARRAY_SIZE(msm8x74_pins),
  1009. .functions = msm8x74_functions,
  1010. .nfunctions = ARRAY_SIZE(msm8x74_functions),
  1011. .groups = msm8x74_groups,
  1012. .ngroups = ARRAY_SIZE(msm8x74_groups),
  1013. .ngpios = NUM_GPIO_PINGROUPS,
  1014. .wakeirq_map = msm8x74_mpm_map,
  1015. .nwakeirq_map = ARRAY_SIZE(msm8x74_mpm_map),
  1016. };
  1017. static int msm8x74_pinctrl_probe(struct platform_device *pdev)
  1018. {
  1019. return msm_pinctrl_probe(pdev, &msm8x74_pinctrl);
  1020. }
  1021. static const struct of_device_id msm8x74_pinctrl_of_match[] = {
  1022. { .compatible = "qcom,msm8974-pinctrl", },
  1023. { },
  1024. };
  1025. static struct platform_driver msm8x74_pinctrl_driver = {
  1026. .driver = {
  1027. .name = "msm8x74-pinctrl",
  1028. .of_match_table = msm8x74_pinctrl_of_match,
  1029. },
  1030. .probe = msm8x74_pinctrl_probe,
  1031. .remove_new = msm_pinctrl_remove,
  1032. };
  1033. static int __init msm8x74_pinctrl_init(void)
  1034. {
  1035. return platform_driver_register(&msm8x74_pinctrl_driver);
  1036. }
  1037. arch_initcall(msm8x74_pinctrl_init);
  1038. static void __exit msm8x74_pinctrl_exit(void)
  1039. {
  1040. platform_driver_unregister(&msm8x74_pinctrl_driver);
  1041. }
  1042. module_exit(msm8x74_pinctrl_exit);
  1043. MODULE_AUTHOR("Bjorn Andersson <bjorn.andersson@sonymobile.com>");
  1044. MODULE_DESCRIPTION("Qualcomm MSM8x74 pinctrl driver");
  1045. MODULE_LICENSE("GPL v2");
  1046. MODULE_DEVICE_TABLE(of, msm8x74_pinctrl_of_match);