pinctrl-armada-370.c 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. /*
  2. * Marvell Armada 370 pinctrl driver based on mvebu pinctrl core
  3. *
  4. * Copyright (C) 2012 Marvell
  5. *
  6. * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. */
  13. #include <linux/err.h>
  14. #include <linux/init.h>
  15. #include <linux/io.h>
  16. #include <linux/module.h>
  17. #include <linux/platform_device.h>
  18. #include <linux/clk.h>
  19. #include <linux/of.h>
  20. #include <linux/of_device.h>
  21. #include <linux/pinctrl/pinctrl.h>
  22. #include "pinctrl-mvebu.h"
  23. static struct mvebu_mpp_mode mv88f6710_mpp_modes[] = {
  24. MPP_MODE(0,
  25. MPP_FUNCTION(0x0, "gpio", NULL),
  26. MPP_FUNCTION(0x1, "uart0", "rxd")),
  27. MPP_MODE(1,
  28. MPP_FUNCTION(0x0, "gpo", NULL),
  29. MPP_FUNCTION(0x1, "uart0", "txd")),
  30. MPP_MODE(2,
  31. MPP_FUNCTION(0x0, "gpio", NULL),
  32. MPP_FUNCTION(0x1, "i2c0", "sck"),
  33. MPP_FUNCTION(0x2, "uart0", "txd")),
  34. MPP_MODE(3,
  35. MPP_FUNCTION(0x0, "gpio", NULL),
  36. MPP_FUNCTION(0x1, "i2c0", "sda"),
  37. MPP_FUNCTION(0x2, "uart0", "rxd")),
  38. MPP_MODE(4,
  39. MPP_FUNCTION(0x0, "gpio", NULL),
  40. MPP_FUNCTION(0x1, "cpu_pd", "vdd")),
  41. MPP_MODE(5,
  42. MPP_FUNCTION(0x0, "gpo", NULL),
  43. MPP_FUNCTION(0x1, "ge0", "txclko"),
  44. MPP_FUNCTION(0x2, "uart1", "txd"),
  45. MPP_FUNCTION(0x4, "spi1", "clk"),
  46. MPP_FUNCTION(0x5, "audio", "mclk")),
  47. MPP_MODE(6,
  48. MPP_FUNCTION(0x0, "gpio", NULL),
  49. MPP_FUNCTION(0x1, "ge0", "txd0"),
  50. MPP_FUNCTION(0x2, "sata0", "prsnt"),
  51. MPP_FUNCTION(0x4, "tdm", "rst"),
  52. MPP_FUNCTION(0x5, "audio", "sdo")),
  53. MPP_MODE(7,
  54. MPP_FUNCTION(0x0, "gpo", NULL),
  55. MPP_FUNCTION(0x1, "ge0", "txd1"),
  56. MPP_FUNCTION(0x4, "tdm", "tdx"),
  57. MPP_FUNCTION(0x5, "audio", "lrclk")),
  58. MPP_MODE(8,
  59. MPP_FUNCTION(0x0, "gpio", NULL),
  60. MPP_FUNCTION(0x1, "ge0", "txd2"),
  61. MPP_FUNCTION(0x2, "uart0", "rts"),
  62. MPP_FUNCTION(0x4, "tdm", "drx"),
  63. MPP_FUNCTION(0x5, "audio", "bclk")),
  64. MPP_MODE(9,
  65. MPP_FUNCTION(0x0, "gpo", NULL),
  66. MPP_FUNCTION(0x1, "ge0", "txd3"),
  67. MPP_FUNCTION(0x2, "uart1", "txd"),
  68. MPP_FUNCTION(0x3, "sd0", "clk"),
  69. MPP_FUNCTION(0x5, "audio", "spdifo")),
  70. MPP_MODE(10,
  71. MPP_FUNCTION(0x0, "gpio", NULL),
  72. MPP_FUNCTION(0x1, "ge0", "txctl"),
  73. MPP_FUNCTION(0x2, "uart0", "cts"),
  74. MPP_FUNCTION(0x4, "tdm", "fsync"),
  75. MPP_FUNCTION(0x5, "audio", "sdi")),
  76. MPP_MODE(11,
  77. MPP_FUNCTION(0x0, "gpio", NULL),
  78. MPP_FUNCTION(0x1, "ge0", "rxd0"),
  79. MPP_FUNCTION(0x2, "uart1", "rxd"),
  80. MPP_FUNCTION(0x3, "sd0", "cmd"),
  81. MPP_FUNCTION(0x4, "spi0", "cs1"),
  82. MPP_FUNCTION(0x5, "sata1", "prsnt"),
  83. MPP_FUNCTION(0x6, "spi1", "cs1")),
  84. MPP_MODE(12,
  85. MPP_FUNCTION(0x0, "gpio", NULL),
  86. MPP_FUNCTION(0x1, "ge0", "rxd1"),
  87. MPP_FUNCTION(0x2, "i2c1", "sda"),
  88. MPP_FUNCTION(0x3, "sd0", "d0"),
  89. MPP_FUNCTION(0x4, "spi1", "cs0"),
  90. MPP_FUNCTION(0x5, "audio", "spdifi")),
  91. MPP_MODE(13,
  92. MPP_FUNCTION(0x0, "gpio", NULL),
  93. MPP_FUNCTION(0x1, "ge0", "rxd2"),
  94. MPP_FUNCTION(0x2, "i2c1", "sck"),
  95. MPP_FUNCTION(0x3, "sd0", "d1"),
  96. MPP_FUNCTION(0x4, "tdm", "pclk"),
  97. MPP_FUNCTION(0x5, "audio", "rmclk")),
  98. MPP_MODE(14,
  99. MPP_FUNCTION(0x0, "gpio", NULL),
  100. MPP_FUNCTION(0x1, "ge0", "rxd3"),
  101. MPP_FUNCTION(0x2, "pcie", "clkreq0"),
  102. MPP_FUNCTION(0x3, "sd0", "d2"),
  103. MPP_FUNCTION(0x4, "spi1", "mosi"),
  104. MPP_FUNCTION(0x5, "spi0", "cs2")),
  105. MPP_MODE(15,
  106. MPP_FUNCTION(0x0, "gpio", NULL),
  107. MPP_FUNCTION(0x1, "ge0", "rxctl"),
  108. MPP_FUNCTION(0x2, "pcie", "clkreq1"),
  109. MPP_FUNCTION(0x3, "sd0", "d3"),
  110. MPP_FUNCTION(0x4, "spi1", "miso"),
  111. MPP_FUNCTION(0x5, "spi0", "cs3")),
  112. MPP_MODE(16,
  113. MPP_FUNCTION(0x0, "gpio", NULL),
  114. MPP_FUNCTION(0x1, "ge0", "rxclk"),
  115. MPP_FUNCTION(0x2, "uart1", "rxd"),
  116. MPP_FUNCTION(0x4, "tdm", "int"),
  117. MPP_FUNCTION(0x5, "audio", "extclk")),
  118. MPP_MODE(17,
  119. MPP_FUNCTION(0x0, "gpo", NULL),
  120. MPP_FUNCTION(0x1, "ge", "mdc")),
  121. MPP_MODE(18,
  122. MPP_FUNCTION(0x0, "gpio", NULL),
  123. MPP_FUNCTION(0x1, "ge", "mdio")),
  124. MPP_MODE(19,
  125. MPP_FUNCTION(0x0, "gpio", NULL),
  126. MPP_FUNCTION(0x1, "ge0", "txclk"),
  127. MPP_FUNCTION(0x2, "ge1", "txclkout"),
  128. MPP_FUNCTION(0x4, "tdm", "pclk")),
  129. MPP_MODE(20,
  130. MPP_FUNCTION(0x0, "gpo", NULL),
  131. MPP_FUNCTION(0x1, "ge0", "txd4"),
  132. MPP_FUNCTION(0x2, "ge1", "txd0")),
  133. MPP_MODE(21,
  134. MPP_FUNCTION(0x0, "gpo", NULL),
  135. MPP_FUNCTION(0x1, "ge0", "txd5"),
  136. MPP_FUNCTION(0x2, "ge1", "txd1"),
  137. MPP_FUNCTION(0x4, "uart1", "txd")),
  138. MPP_MODE(22,
  139. MPP_FUNCTION(0x0, "gpo", NULL),
  140. MPP_FUNCTION(0x1, "ge0", "txd6"),
  141. MPP_FUNCTION(0x2, "ge1", "txd2"),
  142. MPP_FUNCTION(0x4, "uart0", "rts")),
  143. MPP_MODE(23,
  144. MPP_FUNCTION(0x0, "gpo", NULL),
  145. MPP_FUNCTION(0x1, "ge0", "txd7"),
  146. MPP_FUNCTION(0x2, "ge1", "txd3"),
  147. MPP_FUNCTION(0x4, "spi1", "mosi")),
  148. MPP_MODE(24,
  149. MPP_FUNCTION(0x0, "gpio", NULL),
  150. MPP_FUNCTION(0x1, "ge0", "col"),
  151. MPP_FUNCTION(0x2, "ge1", "txctl"),
  152. MPP_FUNCTION(0x4, "spi1", "cs0")),
  153. MPP_MODE(25,
  154. MPP_FUNCTION(0x0, "gpio", NULL),
  155. MPP_FUNCTION(0x1, "ge0", "rxerr"),
  156. MPP_FUNCTION(0x2, "ge1", "rxd0"),
  157. MPP_FUNCTION(0x4, "uart1", "rxd")),
  158. MPP_MODE(26,
  159. MPP_FUNCTION(0x0, "gpio", NULL),
  160. MPP_FUNCTION(0x1, "ge0", "crs"),
  161. MPP_FUNCTION(0x2, "ge1", "rxd1"),
  162. MPP_FUNCTION(0x4, "spi1", "miso")),
  163. MPP_MODE(27,
  164. MPP_FUNCTION(0x0, "gpio", NULL),
  165. MPP_FUNCTION(0x1, "ge0", "rxd4"),
  166. MPP_FUNCTION(0x2, "ge1", "rxd2"),
  167. MPP_FUNCTION(0x4, "uart0", "cts")),
  168. MPP_MODE(28,
  169. MPP_FUNCTION(0x0, "gpio", NULL),
  170. MPP_FUNCTION(0x1, "ge0", "rxd5"),
  171. MPP_FUNCTION(0x2, "ge1", "rxd3")),
  172. MPP_MODE(29,
  173. MPP_FUNCTION(0x0, "gpio", NULL),
  174. MPP_FUNCTION(0x1, "ge0", "rxd6"),
  175. MPP_FUNCTION(0x2, "ge1", "rxctl"),
  176. MPP_FUNCTION(0x4, "i2c1", "sda")),
  177. MPP_MODE(30,
  178. MPP_FUNCTION(0x0, "gpio", NULL),
  179. MPP_FUNCTION(0x1, "ge0", "rxd7"),
  180. MPP_FUNCTION(0x2, "ge1", "rxclk"),
  181. MPP_FUNCTION(0x4, "i2c1", "sck")),
  182. MPP_MODE(31,
  183. MPP_FUNCTION(0x0, "gpio", NULL),
  184. MPP_FUNCTION(0x3, "tclk", NULL),
  185. MPP_FUNCTION(0x4, "ge0", "txerr")),
  186. MPP_MODE(32,
  187. MPP_FUNCTION(0x0, "gpio", NULL),
  188. MPP_FUNCTION(0x1, "spi0", "cs0")),
  189. MPP_MODE(33,
  190. MPP_FUNCTION(0x0, "gpio", NULL),
  191. MPP_FUNCTION(0x1, "dev", "bootcs"),
  192. MPP_FUNCTION(0x2, "spi0", "cs0")),
  193. MPP_MODE(34,
  194. MPP_FUNCTION(0x0, "gpo", NULL),
  195. MPP_FUNCTION(0x1, "dev", "wen0"),
  196. MPP_FUNCTION(0x2, "spi0", "mosi")),
  197. MPP_MODE(35,
  198. MPP_FUNCTION(0x0, "gpo", NULL),
  199. MPP_FUNCTION(0x1, "dev", "oen"),
  200. MPP_FUNCTION(0x2, "spi0", "sck")),
  201. MPP_MODE(36,
  202. MPP_FUNCTION(0x0, "gpo", NULL),
  203. MPP_FUNCTION(0x1, "dev", "a1"),
  204. MPP_FUNCTION(0x2, "spi0", "miso")),
  205. MPP_MODE(37,
  206. MPP_FUNCTION(0x0, "gpo", NULL),
  207. MPP_FUNCTION(0x1, "dev", "a0"),
  208. MPP_FUNCTION(0x2, "sata0", "prsnt")),
  209. MPP_MODE(38,
  210. MPP_FUNCTION(0x0, "gpio", NULL),
  211. MPP_FUNCTION(0x1, "dev", "ready"),
  212. MPP_FUNCTION(0x2, "uart1", "cts"),
  213. MPP_FUNCTION(0x3, "uart0", "cts")),
  214. MPP_MODE(39,
  215. MPP_FUNCTION(0x0, "gpo", NULL),
  216. MPP_FUNCTION(0x1, "dev", "ad0"),
  217. MPP_FUNCTION(0x2, "audio", "spdifo")),
  218. MPP_MODE(40,
  219. MPP_FUNCTION(0x0, "gpio", NULL),
  220. MPP_FUNCTION(0x1, "dev", "ad1"),
  221. MPP_FUNCTION(0x2, "uart1", "rts"),
  222. MPP_FUNCTION(0x3, "uart0", "rts")),
  223. MPP_MODE(41,
  224. MPP_FUNCTION(0x0, "gpio", NULL),
  225. MPP_FUNCTION(0x1, "dev", "ad2"),
  226. MPP_FUNCTION(0x2, "uart1", "rxd")),
  227. MPP_MODE(42,
  228. MPP_FUNCTION(0x0, "gpo", NULL),
  229. MPP_FUNCTION(0x1, "dev", "ad3"),
  230. MPP_FUNCTION(0x2, "uart1", "txd")),
  231. MPP_MODE(43,
  232. MPP_FUNCTION(0x0, "gpo", NULL),
  233. MPP_FUNCTION(0x1, "dev", "ad4"),
  234. MPP_FUNCTION(0x2, "audio", "bclk")),
  235. MPP_MODE(44,
  236. MPP_FUNCTION(0x0, "gpo", NULL),
  237. MPP_FUNCTION(0x1, "dev", "ad5"),
  238. MPP_FUNCTION(0x2, "audio", "mclk")),
  239. MPP_MODE(45,
  240. MPP_FUNCTION(0x0, "gpo", NULL),
  241. MPP_FUNCTION(0x1, "dev", "ad6"),
  242. MPP_FUNCTION(0x2, "audio", "lrclk")),
  243. MPP_MODE(46,
  244. MPP_FUNCTION(0x0, "gpo", NULL),
  245. MPP_FUNCTION(0x1, "dev", "ad7"),
  246. MPP_FUNCTION(0x2, "audio", "sdo")),
  247. MPP_MODE(47,
  248. MPP_FUNCTION(0x0, "gpo", NULL),
  249. MPP_FUNCTION(0x1, "dev", "ad8"),
  250. MPP_FUNCTION(0x3, "sd0", "clk"),
  251. MPP_FUNCTION(0x5, "audio", "spdifo")),
  252. MPP_MODE(48,
  253. MPP_FUNCTION(0x0, "gpio", NULL),
  254. MPP_FUNCTION(0x1, "dev", "ad9"),
  255. MPP_FUNCTION(0x2, "uart0", "rts"),
  256. MPP_FUNCTION(0x3, "sd0", "cmd"),
  257. MPP_FUNCTION(0x4, "sata1", "prsnt"),
  258. MPP_FUNCTION(0x5, "spi0", "cs1")),
  259. MPP_MODE(49,
  260. MPP_FUNCTION(0x0, "gpio", NULL),
  261. MPP_FUNCTION(0x1, "dev", "ad10"),
  262. MPP_FUNCTION(0x2, "pcie", "clkreq1"),
  263. MPP_FUNCTION(0x3, "sd0", "d0"),
  264. MPP_FUNCTION(0x4, "spi1", "cs0"),
  265. MPP_FUNCTION(0x5, "audio", "spdifi")),
  266. MPP_MODE(50,
  267. MPP_FUNCTION(0x0, "gpio", NULL),
  268. MPP_FUNCTION(0x1, "dev", "ad11"),
  269. MPP_FUNCTION(0x2, "uart0", "cts"),
  270. MPP_FUNCTION(0x3, "sd0", "d1"),
  271. MPP_FUNCTION(0x4, "spi1", "miso"),
  272. MPP_FUNCTION(0x5, "audio", "rmclk")),
  273. MPP_MODE(51,
  274. MPP_FUNCTION(0x0, "gpio", NULL),
  275. MPP_FUNCTION(0x1, "dev", "ad12"),
  276. MPP_FUNCTION(0x2, "i2c1", "sda"),
  277. MPP_FUNCTION(0x3, "sd0", "d2"),
  278. MPP_FUNCTION(0x4, "spi1", "mosi")),
  279. MPP_MODE(52,
  280. MPP_FUNCTION(0x0, "gpio", NULL),
  281. MPP_FUNCTION(0x1, "dev", "ad13"),
  282. MPP_FUNCTION(0x2, "i2c1", "sck"),
  283. MPP_FUNCTION(0x3, "sd0", "d3"),
  284. MPP_FUNCTION(0x4, "spi1", "sck")),
  285. MPP_MODE(53,
  286. MPP_FUNCTION(0x0, "gpio", NULL),
  287. MPP_FUNCTION(0x1, "dev", "ad14"),
  288. MPP_FUNCTION(0x2, "sd0", "clk"),
  289. MPP_FUNCTION(0x3, "tdm", "pclk"),
  290. MPP_FUNCTION(0x4, "spi0", "cs2"),
  291. MPP_FUNCTION(0x5, "pcie", "clkreq1")),
  292. MPP_MODE(54,
  293. MPP_FUNCTION(0x0, "gpo", NULL),
  294. MPP_FUNCTION(0x1, "dev", "ad15"),
  295. MPP_FUNCTION(0x3, "tdm", "dtx")),
  296. MPP_MODE(55,
  297. MPP_FUNCTION(0x0, "gpio", NULL),
  298. MPP_FUNCTION(0x1, "dev", "cs1"),
  299. MPP_FUNCTION(0x2, "uart1", "txd"),
  300. MPP_FUNCTION(0x3, "tdm", "rst"),
  301. MPP_FUNCTION(0x4, "sata1", "prsnt"),
  302. MPP_FUNCTION(0x5, "sata0", "prsnt")),
  303. MPP_MODE(56,
  304. MPP_FUNCTION(0x0, "gpio", NULL),
  305. MPP_FUNCTION(0x1, "dev", "cs2"),
  306. MPP_FUNCTION(0x2, "uart1", "cts"),
  307. MPP_FUNCTION(0x3, "uart0", "cts"),
  308. MPP_FUNCTION(0x4, "spi0", "cs3"),
  309. MPP_FUNCTION(0x5, "pcie", "clkreq0"),
  310. MPP_FUNCTION(0x6, "spi1", "cs1")),
  311. MPP_MODE(57,
  312. MPP_FUNCTION(0x0, "gpio", NULL),
  313. MPP_FUNCTION(0x1, "dev", "cs3"),
  314. MPP_FUNCTION(0x2, "uart1", "rxd"),
  315. MPP_FUNCTION(0x3, "tdm", "fsync"),
  316. MPP_FUNCTION(0x4, "sata0", "prsnt"),
  317. MPP_FUNCTION(0x5, "audio", "sdo")),
  318. MPP_MODE(58,
  319. MPP_FUNCTION(0x0, "gpio", NULL),
  320. MPP_FUNCTION(0x1, "dev", "cs0"),
  321. MPP_FUNCTION(0x2, "uart1", "rts"),
  322. MPP_FUNCTION(0x3, "tdm", "int"),
  323. MPP_FUNCTION(0x5, "audio", "extclk"),
  324. MPP_FUNCTION(0x6, "uart0", "rts")),
  325. MPP_MODE(59,
  326. MPP_FUNCTION(0x0, "gpo", NULL),
  327. MPP_FUNCTION(0x1, "dev", "ale0"),
  328. MPP_FUNCTION(0x2, "uart1", "rts"),
  329. MPP_FUNCTION(0x3, "uart0", "rts"),
  330. MPP_FUNCTION(0x5, "audio", "bclk")),
  331. MPP_MODE(60,
  332. MPP_FUNCTION(0x0, "gpio", NULL),
  333. MPP_FUNCTION(0x1, "dev", "ale1"),
  334. MPP_FUNCTION(0x2, "uart1", "rxd"),
  335. MPP_FUNCTION(0x3, "sata0", "prsnt"),
  336. MPP_FUNCTION(0x4, "pcie", "rst-out"),
  337. MPP_FUNCTION(0x5, "audio", "sdi")),
  338. MPP_MODE(61,
  339. MPP_FUNCTION(0x0, "gpo", NULL),
  340. MPP_FUNCTION(0x1, "dev", "wen1"),
  341. MPP_FUNCTION(0x2, "uart1", "txd"),
  342. MPP_FUNCTION(0x5, "audio", "rclk")),
  343. MPP_MODE(62,
  344. MPP_FUNCTION(0x0, "gpio", NULL),
  345. MPP_FUNCTION(0x1, "dev", "a2"),
  346. MPP_FUNCTION(0x2, "uart1", "cts"),
  347. MPP_FUNCTION(0x3, "tdm", "drx"),
  348. MPP_FUNCTION(0x4, "pcie", "clkreq0"),
  349. MPP_FUNCTION(0x5, "audio", "mclk"),
  350. MPP_FUNCTION(0x6, "uart0", "cts")),
  351. MPP_MODE(63,
  352. MPP_FUNCTION(0x0, "gpo", NULL),
  353. MPP_FUNCTION(0x1, "spi0", "sck"),
  354. MPP_FUNCTION(0x2, "tclk", NULL)),
  355. MPP_MODE(64,
  356. MPP_FUNCTION(0x0, "gpio", NULL),
  357. MPP_FUNCTION(0x1, "spi0", "miso"),
  358. MPP_FUNCTION(0x2, "spi0-1", "cs1")),
  359. MPP_MODE(65,
  360. MPP_FUNCTION(0x0, "gpio", NULL),
  361. MPP_FUNCTION(0x1, "spi0", "mosi"),
  362. MPP_FUNCTION(0x2, "spi0-1", "cs2")),
  363. };
  364. static struct mvebu_pinctrl_soc_info armada_370_pinctrl_info;
  365. static struct of_device_id armada_370_pinctrl_of_match[] = {
  366. { .compatible = "marvell,mv88f6710-pinctrl" },
  367. { },
  368. };
  369. static struct mvebu_mpp_ctrl mv88f6710_mpp_controls[] = {
  370. MPP_REG_CTRL(0, 65),
  371. };
  372. static struct pinctrl_gpio_range mv88f6710_mpp_gpio_ranges[] = {
  373. MPP_GPIO_RANGE(0, 0, 0, 32),
  374. MPP_GPIO_RANGE(1, 32, 32, 32),
  375. MPP_GPIO_RANGE(2, 64, 64, 2),
  376. };
  377. static int armada_370_pinctrl_probe(struct platform_device *pdev)
  378. {
  379. struct mvebu_pinctrl_soc_info *soc = &armada_370_pinctrl_info;
  380. soc->variant = 0; /* no variants for Armada 370 */
  381. soc->controls = mv88f6710_mpp_controls;
  382. soc->ncontrols = ARRAY_SIZE(mv88f6710_mpp_controls);
  383. soc->modes = mv88f6710_mpp_modes;
  384. soc->nmodes = ARRAY_SIZE(mv88f6710_mpp_modes);
  385. soc->gpioranges = mv88f6710_mpp_gpio_ranges;
  386. soc->ngpioranges = ARRAY_SIZE(mv88f6710_mpp_gpio_ranges);
  387. pdev->dev.platform_data = soc;
  388. return mvebu_pinctrl_probe(pdev);
  389. }
  390. static int armada_370_pinctrl_remove(struct platform_device *pdev)
  391. {
  392. return mvebu_pinctrl_remove(pdev);
  393. }
  394. static struct platform_driver armada_370_pinctrl_driver = {
  395. .driver = {
  396. .name = "armada-370-pinctrl",
  397. .owner = THIS_MODULE,
  398. .of_match_table = of_match_ptr(armada_370_pinctrl_of_match),
  399. },
  400. .probe = armada_370_pinctrl_probe,
  401. .remove = armada_370_pinctrl_remove,
  402. };
  403. module_platform_driver(armada_370_pinctrl_driver);
  404. MODULE_AUTHOR("Thomas Petazzoni <thomas.petazzoni@free-electrons.com>");
  405. MODULE_DESCRIPTION("Marvell Armada 370 pinctrl driver");
  406. MODULE_LICENSE("GPL v2");