pinctrl-mdm9615.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  1. /*
  2. * Copyright (c) 2014, Sony Mobile Communications AB.
  3. * Copyright (c) 2016 BayLibre, SAS.
  4. * Author : Neil Armstrong <narmstrong@baylibre.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 and
  8. * only version 2 as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #include <linux/module.h>
  16. #include <linux/of.h>
  17. #include <linux/platform_device.h>
  18. #include <linux/pinctrl/pinctrl.h>
  19. #include <linux/pinctrl/pinmux.h>
  20. #include "pinctrl-msm.h"
  21. static const struct pinctrl_pin_desc mdm9615_pins[] = {
  22. PINCTRL_PIN(0, "GPIO_0"),
  23. PINCTRL_PIN(1, "GPIO_1"),
  24. PINCTRL_PIN(2, "GPIO_2"),
  25. PINCTRL_PIN(3, "GPIO_3"),
  26. PINCTRL_PIN(4, "GPIO_4"),
  27. PINCTRL_PIN(5, "GPIO_5"),
  28. PINCTRL_PIN(6, "GPIO_6"),
  29. PINCTRL_PIN(7, "GPIO_7"),
  30. PINCTRL_PIN(8, "GPIO_8"),
  31. PINCTRL_PIN(9, "GPIO_9"),
  32. PINCTRL_PIN(10, "GPIO_10"),
  33. PINCTRL_PIN(11, "GPIO_11"),
  34. PINCTRL_PIN(12, "GPIO_12"),
  35. PINCTRL_PIN(13, "GPIO_13"),
  36. PINCTRL_PIN(14, "GPIO_14"),
  37. PINCTRL_PIN(15, "GPIO_15"),
  38. PINCTRL_PIN(16, "GPIO_16"),
  39. PINCTRL_PIN(17, "GPIO_17"),
  40. PINCTRL_PIN(18, "GPIO_18"),
  41. PINCTRL_PIN(19, "GPIO_19"),
  42. PINCTRL_PIN(20, "GPIO_20"),
  43. PINCTRL_PIN(21, "GPIO_21"),
  44. PINCTRL_PIN(22, "GPIO_22"),
  45. PINCTRL_PIN(23, "GPIO_23"),
  46. PINCTRL_PIN(24, "GPIO_24"),
  47. PINCTRL_PIN(25, "GPIO_25"),
  48. PINCTRL_PIN(26, "GPIO_26"),
  49. PINCTRL_PIN(27, "GPIO_27"),
  50. PINCTRL_PIN(28, "GPIO_28"),
  51. PINCTRL_PIN(29, "GPIO_29"),
  52. PINCTRL_PIN(30, "GPIO_30"),
  53. PINCTRL_PIN(31, "GPIO_31"),
  54. PINCTRL_PIN(32, "GPIO_32"),
  55. PINCTRL_PIN(33, "GPIO_33"),
  56. PINCTRL_PIN(34, "GPIO_34"),
  57. PINCTRL_PIN(35, "GPIO_35"),
  58. PINCTRL_PIN(36, "GPIO_36"),
  59. PINCTRL_PIN(37, "GPIO_37"),
  60. PINCTRL_PIN(38, "GPIO_38"),
  61. PINCTRL_PIN(39, "GPIO_39"),
  62. PINCTRL_PIN(40, "GPIO_40"),
  63. PINCTRL_PIN(41, "GPIO_41"),
  64. PINCTRL_PIN(42, "GPIO_42"),
  65. PINCTRL_PIN(43, "GPIO_43"),
  66. PINCTRL_PIN(44, "GPIO_44"),
  67. PINCTRL_PIN(45, "GPIO_45"),
  68. PINCTRL_PIN(46, "GPIO_46"),
  69. PINCTRL_PIN(47, "GPIO_47"),
  70. PINCTRL_PIN(48, "GPIO_48"),
  71. PINCTRL_PIN(49, "GPIO_49"),
  72. PINCTRL_PIN(50, "GPIO_50"),
  73. PINCTRL_PIN(51, "GPIO_51"),
  74. PINCTRL_PIN(52, "GPIO_52"),
  75. PINCTRL_PIN(53, "GPIO_53"),
  76. PINCTRL_PIN(54, "GPIO_54"),
  77. PINCTRL_PIN(55, "GPIO_55"),
  78. PINCTRL_PIN(56, "GPIO_56"),
  79. PINCTRL_PIN(57, "GPIO_57"),
  80. PINCTRL_PIN(58, "GPIO_58"),
  81. PINCTRL_PIN(59, "GPIO_59"),
  82. PINCTRL_PIN(60, "GPIO_60"),
  83. PINCTRL_PIN(61, "GPIO_61"),
  84. PINCTRL_PIN(62, "GPIO_62"),
  85. PINCTRL_PIN(63, "GPIO_63"),
  86. PINCTRL_PIN(64, "GPIO_64"),
  87. PINCTRL_PIN(65, "GPIO_65"),
  88. PINCTRL_PIN(66, "GPIO_66"),
  89. PINCTRL_PIN(67, "GPIO_67"),
  90. PINCTRL_PIN(68, "GPIO_68"),
  91. PINCTRL_PIN(69, "GPIO_69"),
  92. PINCTRL_PIN(70, "GPIO_70"),
  93. PINCTRL_PIN(71, "GPIO_71"),
  94. PINCTRL_PIN(72, "GPIO_72"),
  95. PINCTRL_PIN(73, "GPIO_73"),
  96. PINCTRL_PIN(74, "GPIO_74"),
  97. PINCTRL_PIN(75, "GPIO_75"),
  98. PINCTRL_PIN(76, "GPIO_76"),
  99. PINCTRL_PIN(77, "GPIO_77"),
  100. PINCTRL_PIN(78, "GPIO_78"),
  101. PINCTRL_PIN(79, "GPIO_79"),
  102. PINCTRL_PIN(80, "GPIO_80"),
  103. PINCTRL_PIN(81, "GPIO_81"),
  104. PINCTRL_PIN(82, "GPIO_82"),
  105. PINCTRL_PIN(83, "GPIO_83"),
  106. PINCTRL_PIN(84, "GPIO_84"),
  107. PINCTRL_PIN(85, "GPIO_85"),
  108. PINCTRL_PIN(86, "GPIO_86"),
  109. PINCTRL_PIN(87, "GPIO_87"),
  110. };
  111. #define DECLARE_MSM_GPIO_PINS(pin) \
  112. static const unsigned int gpio##pin##_pins[] = { pin }
  113. DECLARE_MSM_GPIO_PINS(0);
  114. DECLARE_MSM_GPIO_PINS(1);
  115. DECLARE_MSM_GPIO_PINS(2);
  116. DECLARE_MSM_GPIO_PINS(3);
  117. DECLARE_MSM_GPIO_PINS(4);
  118. DECLARE_MSM_GPIO_PINS(5);
  119. DECLARE_MSM_GPIO_PINS(6);
  120. DECLARE_MSM_GPIO_PINS(7);
  121. DECLARE_MSM_GPIO_PINS(8);
  122. DECLARE_MSM_GPIO_PINS(9);
  123. DECLARE_MSM_GPIO_PINS(10);
  124. DECLARE_MSM_GPIO_PINS(11);
  125. DECLARE_MSM_GPIO_PINS(12);
  126. DECLARE_MSM_GPIO_PINS(13);
  127. DECLARE_MSM_GPIO_PINS(14);
  128. DECLARE_MSM_GPIO_PINS(15);
  129. DECLARE_MSM_GPIO_PINS(16);
  130. DECLARE_MSM_GPIO_PINS(17);
  131. DECLARE_MSM_GPIO_PINS(18);
  132. DECLARE_MSM_GPIO_PINS(19);
  133. DECLARE_MSM_GPIO_PINS(20);
  134. DECLARE_MSM_GPIO_PINS(21);
  135. DECLARE_MSM_GPIO_PINS(22);
  136. DECLARE_MSM_GPIO_PINS(23);
  137. DECLARE_MSM_GPIO_PINS(24);
  138. DECLARE_MSM_GPIO_PINS(25);
  139. DECLARE_MSM_GPIO_PINS(26);
  140. DECLARE_MSM_GPIO_PINS(27);
  141. DECLARE_MSM_GPIO_PINS(28);
  142. DECLARE_MSM_GPIO_PINS(29);
  143. DECLARE_MSM_GPIO_PINS(30);
  144. DECLARE_MSM_GPIO_PINS(31);
  145. DECLARE_MSM_GPIO_PINS(32);
  146. DECLARE_MSM_GPIO_PINS(33);
  147. DECLARE_MSM_GPIO_PINS(34);
  148. DECLARE_MSM_GPIO_PINS(35);
  149. DECLARE_MSM_GPIO_PINS(36);
  150. DECLARE_MSM_GPIO_PINS(37);
  151. DECLARE_MSM_GPIO_PINS(38);
  152. DECLARE_MSM_GPIO_PINS(39);
  153. DECLARE_MSM_GPIO_PINS(40);
  154. DECLARE_MSM_GPIO_PINS(41);
  155. DECLARE_MSM_GPIO_PINS(42);
  156. DECLARE_MSM_GPIO_PINS(43);
  157. DECLARE_MSM_GPIO_PINS(44);
  158. DECLARE_MSM_GPIO_PINS(45);
  159. DECLARE_MSM_GPIO_PINS(46);
  160. DECLARE_MSM_GPIO_PINS(47);
  161. DECLARE_MSM_GPIO_PINS(48);
  162. DECLARE_MSM_GPIO_PINS(49);
  163. DECLARE_MSM_GPIO_PINS(50);
  164. DECLARE_MSM_GPIO_PINS(51);
  165. DECLARE_MSM_GPIO_PINS(52);
  166. DECLARE_MSM_GPIO_PINS(53);
  167. DECLARE_MSM_GPIO_PINS(54);
  168. DECLARE_MSM_GPIO_PINS(55);
  169. DECLARE_MSM_GPIO_PINS(56);
  170. DECLARE_MSM_GPIO_PINS(57);
  171. DECLARE_MSM_GPIO_PINS(58);
  172. DECLARE_MSM_GPIO_PINS(59);
  173. DECLARE_MSM_GPIO_PINS(60);
  174. DECLARE_MSM_GPIO_PINS(61);
  175. DECLARE_MSM_GPIO_PINS(62);
  176. DECLARE_MSM_GPIO_PINS(63);
  177. DECLARE_MSM_GPIO_PINS(64);
  178. DECLARE_MSM_GPIO_PINS(65);
  179. DECLARE_MSM_GPIO_PINS(66);
  180. DECLARE_MSM_GPIO_PINS(67);
  181. DECLARE_MSM_GPIO_PINS(68);
  182. DECLARE_MSM_GPIO_PINS(69);
  183. DECLARE_MSM_GPIO_PINS(70);
  184. DECLARE_MSM_GPIO_PINS(71);
  185. DECLARE_MSM_GPIO_PINS(72);
  186. DECLARE_MSM_GPIO_PINS(73);
  187. DECLARE_MSM_GPIO_PINS(74);
  188. DECLARE_MSM_GPIO_PINS(75);
  189. DECLARE_MSM_GPIO_PINS(76);
  190. DECLARE_MSM_GPIO_PINS(77);
  191. DECLARE_MSM_GPIO_PINS(78);
  192. DECLARE_MSM_GPIO_PINS(79);
  193. DECLARE_MSM_GPIO_PINS(80);
  194. DECLARE_MSM_GPIO_PINS(81);
  195. DECLARE_MSM_GPIO_PINS(82);
  196. DECLARE_MSM_GPIO_PINS(83);
  197. DECLARE_MSM_GPIO_PINS(84);
  198. DECLARE_MSM_GPIO_PINS(85);
  199. DECLARE_MSM_GPIO_PINS(86);
  200. DECLARE_MSM_GPIO_PINS(87);
  201. #define FUNCTION(fname) \
  202. [MSM_MUX_##fname] = { \
  203. .name = #fname, \
  204. .groups = fname##_groups, \
  205. .ngroups = ARRAY_SIZE(fname##_groups), \
  206. }
  207. #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11) \
  208. { \
  209. .name = "gpio" #id, \
  210. .pins = gpio##id##_pins, \
  211. .npins = ARRAY_SIZE(gpio##id##_pins), \
  212. .funcs = (int[]){ \
  213. MSM_MUX_gpio, \
  214. MSM_MUX_##f1, \
  215. MSM_MUX_##f2, \
  216. MSM_MUX_##f3, \
  217. MSM_MUX_##f4, \
  218. MSM_MUX_##f5, \
  219. MSM_MUX_##f6, \
  220. MSM_MUX_##f7, \
  221. MSM_MUX_##f8, \
  222. MSM_MUX_##f9, \
  223. MSM_MUX_##f10, \
  224. MSM_MUX_##f11 \
  225. }, \
  226. .nfuncs = 12, \
  227. .ctl_reg = 0x1000 + 0x10 * id, \
  228. .io_reg = 0x1004 + 0x10 * id, \
  229. .intr_cfg_reg = 0x1008 + 0x10 * id, \
  230. .intr_status_reg = 0x100c + 0x10 * id, \
  231. .intr_target_reg = 0x400 + 0x4 * id, \
  232. .mux_bit = 2, \
  233. .pull_bit = 0, \
  234. .drv_bit = 6, \
  235. .oe_bit = 9, \
  236. .in_bit = 0, \
  237. .out_bit = 1, \
  238. .intr_enable_bit = 0, \
  239. .intr_status_bit = 0, \
  240. .intr_ack_high = 1, \
  241. .intr_target_bit = 0, \
  242. .intr_target_kpss_val = 4, \
  243. .intr_raw_status_bit = 3, \
  244. .intr_polarity_bit = 1, \
  245. .intr_detection_bit = 2, \
  246. .intr_detection_width = 1, \
  247. }
  248. enum mdm9615_functions {
  249. MSM_MUX_gpio,
  250. MSM_MUX_gsbi2_i2c,
  251. MSM_MUX_gsbi3,
  252. MSM_MUX_gsbi4,
  253. MSM_MUX_gsbi5_i2c,
  254. MSM_MUX_gsbi5_uart,
  255. MSM_MUX_sdc2,
  256. MSM_MUX_ebi2_lcdc,
  257. MSM_MUX_ps_hold,
  258. MSM_MUX_prim_audio,
  259. MSM_MUX_sec_audio,
  260. MSM_MUX_cdc_mclk,
  261. MSM_MUX_NA,
  262. };
  263. static const char * const gpio_groups[] = {
  264. "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7",
  265. "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14",
  266. "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21",
  267. "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28",
  268. "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35",
  269. "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42",
  270. "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49",
  271. "gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56",
  272. "gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63",
  273. "gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70",
  274. "gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77",
  275. "gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84",
  276. "gpio85", "gpio86", "gpio87"
  277. };
  278. static const char * const gsbi2_i2c_groups[] = {
  279. "gpio4", "gpio5"
  280. };
  281. static const char * const gsbi3_groups[] = {
  282. "gpio8", "gpio9", "gpio10", "gpio11"
  283. };
  284. static const char * const gsbi4_groups[] = {
  285. "gpio12", "gpio13", "gpio14", "gpio15"
  286. };
  287. static const char * const gsbi5_i2c_groups[] = {
  288. "gpio16", "gpio17"
  289. };
  290. static const char * const gsbi5_uart_groups[] = {
  291. "gpio18", "gpio19"
  292. };
  293. static const char * const sdc2_groups[] = {
  294. "gpio25", "gpio26", "gpio27", "gpio28", "gpio29", "gpio30",
  295. };
  296. static const char * const ebi2_lcdc_groups[] = {
  297. "gpio21", "gpio22", "gpio24",
  298. };
  299. static const char * const ps_hold_groups[] = {
  300. "gpio83",
  301. };
  302. static const char * const prim_audio_groups[] = {
  303. "gpio20", "gpio21", "gpio22", "gpio23",
  304. };
  305. static const char * const sec_audio_groups[] = {
  306. "gpio25", "gpio26", "gpio27", "gpio28",
  307. };
  308. static const char * const cdc_mclk_groups[] = {
  309. "gpio24",
  310. };
  311. static const struct msm_function mdm9615_functions[] = {
  312. FUNCTION(gpio),
  313. FUNCTION(gsbi2_i2c),
  314. FUNCTION(gsbi3),
  315. FUNCTION(gsbi4),
  316. FUNCTION(gsbi5_i2c),
  317. FUNCTION(gsbi5_uart),
  318. FUNCTION(sdc2),
  319. FUNCTION(ebi2_lcdc),
  320. FUNCTION(ps_hold),
  321. FUNCTION(prim_audio),
  322. FUNCTION(sec_audio),
  323. FUNCTION(cdc_mclk),
  324. };
  325. static const struct msm_pingroup mdm9615_groups[] = {
  326. PINGROUP(0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  327. PINGROUP(1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  328. PINGROUP(2, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  329. PINGROUP(3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  330. PINGROUP(4, gsbi2_i2c, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  331. PINGROUP(5, gsbi2_i2c, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  332. PINGROUP(6, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  333. PINGROUP(7, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  334. PINGROUP(8, gsbi3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  335. PINGROUP(9, gsbi3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  336. PINGROUP(10, gsbi3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  337. PINGROUP(11, gsbi3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  338. PINGROUP(12, gsbi4, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  339. PINGROUP(13, gsbi4, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  340. PINGROUP(14, gsbi4, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  341. PINGROUP(15, gsbi4, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  342. PINGROUP(16, gsbi5_i2c, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  343. PINGROUP(17, gsbi5_i2c, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  344. PINGROUP(18, gsbi5_uart, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  345. PINGROUP(19, gsbi5_uart, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  346. PINGROUP(20, prim_audio, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  347. PINGROUP(21, prim_audio, ebi2_lcdc, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  348. PINGROUP(22, prim_audio, ebi2_lcdc, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  349. PINGROUP(23, prim_audio, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  350. PINGROUP(24, cdc_mclk, NA, ebi2_lcdc, NA, NA, NA, NA, NA, NA, NA, NA),
  351. PINGROUP(25, sdc2, sec_audio, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  352. PINGROUP(26, sdc2, sec_audio, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  353. PINGROUP(27, sdc2, sec_audio, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  354. PINGROUP(28, sdc2, sec_audio, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  355. PINGROUP(29, sdc2, sec_audio, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  356. PINGROUP(30, sdc2, sec_audio, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  357. PINGROUP(31, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  358. PINGROUP(32, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  359. PINGROUP(33, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  360. PINGROUP(34, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  361. PINGROUP(35, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  362. PINGROUP(36, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  363. PINGROUP(37, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  364. PINGROUP(38, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  365. PINGROUP(39, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  366. PINGROUP(40, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  367. PINGROUP(41, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  368. PINGROUP(42, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  369. PINGROUP(43, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  370. PINGROUP(44, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  371. PINGROUP(45, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  372. PINGROUP(46, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  373. PINGROUP(47, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  374. PINGROUP(48, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  375. PINGROUP(49, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  376. PINGROUP(50, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  377. PINGROUP(51, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  378. PINGROUP(52, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  379. PINGROUP(53, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  380. PINGROUP(54, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  381. PINGROUP(55, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  382. PINGROUP(56, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  383. PINGROUP(57, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  384. PINGROUP(58, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  385. PINGROUP(59, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  386. PINGROUP(60, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  387. PINGROUP(61, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  388. PINGROUP(62, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  389. PINGROUP(63, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  390. PINGROUP(64, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  391. PINGROUP(65, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  392. PINGROUP(66, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  393. PINGROUP(67, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  394. PINGROUP(68, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  395. PINGROUP(69, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  396. PINGROUP(70, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  397. PINGROUP(71, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  398. PINGROUP(72, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  399. PINGROUP(73, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  400. PINGROUP(74, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  401. PINGROUP(75, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  402. PINGROUP(76, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  403. PINGROUP(77, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  404. PINGROUP(78, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  405. PINGROUP(79, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  406. PINGROUP(80, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  407. PINGROUP(81, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  408. PINGROUP(82, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  409. PINGROUP(83, ps_hold, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  410. PINGROUP(84, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  411. PINGROUP(85, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  412. PINGROUP(86, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  413. PINGROUP(87, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
  414. };
  415. #define NUM_GPIO_PINGROUPS 88
  416. static const struct msm_pinctrl_soc_data mdm9615_pinctrl = {
  417. .pins = mdm9615_pins,
  418. .npins = ARRAY_SIZE(mdm9615_pins),
  419. .functions = mdm9615_functions,
  420. .nfunctions = ARRAY_SIZE(mdm9615_functions),
  421. .groups = mdm9615_groups,
  422. .ngroups = ARRAY_SIZE(mdm9615_groups),
  423. .ngpios = NUM_GPIO_PINGROUPS,
  424. };
  425. static int mdm9615_pinctrl_probe(struct platform_device *pdev)
  426. {
  427. return msm_pinctrl_probe(pdev, &mdm9615_pinctrl);
  428. }
  429. static const struct of_device_id mdm9615_pinctrl_of_match[] = {
  430. { .compatible = "qcom,mdm9615-pinctrl", },
  431. { },
  432. };
  433. static struct platform_driver mdm9615_pinctrl_driver = {
  434. .driver = {
  435. .name = "mdm9615-pinctrl",
  436. .of_match_table = mdm9615_pinctrl_of_match,
  437. },
  438. .probe = mdm9615_pinctrl_probe,
  439. .remove = msm_pinctrl_remove,
  440. };
  441. static int __init mdm9615_pinctrl_init(void)
  442. {
  443. return platform_driver_register(&mdm9615_pinctrl_driver);
  444. }
  445. arch_initcall(mdm9615_pinctrl_init);
  446. static void __exit mdm9615_pinctrl_exit(void)
  447. {
  448. platform_driver_unregister(&mdm9615_pinctrl_driver);
  449. }
  450. module_exit(mdm9615_pinctrl_exit);
  451. MODULE_AUTHOR("Neil Armstrong <narmstrong@baylibre.com>");
  452. MODULE_DESCRIPTION("Qualcomm MDM9615 pinctrl driver");
  453. MODULE_LICENSE("GPL v2");
  454. MODULE_DEVICE_TABLE(of, mdm9615_pinctrl_of_match);