pinctrl-ipq4019.c 18 KB

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