pinctrl-armada-375.c 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * Marvell Armada 375 pinctrl driver based on mvebu pinctrl core
  4. *
  5. * Copyright (C) 2012 Marvell
  6. *
  7. * Thomas Petazzoni <[email protected]>
  8. */
  9. #include <linux/err.h>
  10. #include <linux/init.h>
  11. #include <linux/io.h>
  12. #include <linux/platform_device.h>
  13. #include <linux/clk.h>
  14. #include <linux/of.h>
  15. #include <linux/of_device.h>
  16. #include <linux/pinctrl/pinctrl.h>
  17. #include "pinctrl-mvebu.h"
  18. static struct mvebu_mpp_mode mv88f6720_mpp_modes[] = {
  19. MPP_MODE(0,
  20. MPP_FUNCTION(0x0, "gpio", NULL),
  21. MPP_FUNCTION(0x1, "dev", "ad2"),
  22. MPP_FUNCTION(0x2, "spi0", "cs1"),
  23. MPP_FUNCTION(0x3, "spi1", "cs1"),
  24. MPP_FUNCTION(0x5, "nand", "io2")),
  25. MPP_MODE(1,
  26. MPP_FUNCTION(0x0, "gpio", NULL),
  27. MPP_FUNCTION(0x1, "dev", "ad3"),
  28. MPP_FUNCTION(0x2, "spi0", "mosi"),
  29. MPP_FUNCTION(0x3, "spi1", "mosi"),
  30. MPP_FUNCTION(0x5, "nand", "io3")),
  31. MPP_MODE(2,
  32. MPP_FUNCTION(0x0, "gpio", NULL),
  33. MPP_FUNCTION(0x1, "dev", "ad4"),
  34. MPP_FUNCTION(0x2, "ptp", "evreq"),
  35. MPP_FUNCTION(0x3, "led", "c0"),
  36. MPP_FUNCTION(0x4, "audio", "sdi"),
  37. MPP_FUNCTION(0x5, "nand", "io4"),
  38. MPP_FUNCTION(0x6, "spi1", "mosi")),
  39. MPP_MODE(3,
  40. MPP_FUNCTION(0x0, "gpio", NULL),
  41. MPP_FUNCTION(0x1, "dev", "ad5"),
  42. MPP_FUNCTION(0x2, "ptp", "trig"),
  43. MPP_FUNCTION(0x3, "led", "p3"),
  44. MPP_FUNCTION(0x4, "audio", "mclk"),
  45. MPP_FUNCTION(0x5, "nand", "io5"),
  46. MPP_FUNCTION(0x6, "spi1", "miso")),
  47. MPP_MODE(4,
  48. MPP_FUNCTION(0x0, "gpio", NULL),
  49. MPP_FUNCTION(0x1, "dev", "ad6"),
  50. MPP_FUNCTION(0x2, "spi0", "miso"),
  51. MPP_FUNCTION(0x3, "spi1", "miso"),
  52. MPP_FUNCTION(0x5, "nand", "io6")),
  53. MPP_MODE(5,
  54. MPP_FUNCTION(0x0, "gpio", NULL),
  55. MPP_FUNCTION(0x1, "dev", "ad7"),
  56. MPP_FUNCTION(0x2, "spi0", "cs2"),
  57. MPP_FUNCTION(0x3, "spi1", "cs2"),
  58. MPP_FUNCTION(0x5, "nand", "io7"),
  59. MPP_FUNCTION(0x6, "spi1", "miso")),
  60. MPP_MODE(6,
  61. MPP_FUNCTION(0x0, "gpio", NULL),
  62. MPP_FUNCTION(0x1, "dev", "ad0"),
  63. MPP_FUNCTION(0x3, "led", "p1"),
  64. MPP_FUNCTION(0x4, "audio", "lrclk"),
  65. MPP_FUNCTION(0x5, "nand", "io0")),
  66. MPP_MODE(7,
  67. MPP_FUNCTION(0x0, "gpio", NULL),
  68. MPP_FUNCTION(0x1, "dev", "ad1"),
  69. MPP_FUNCTION(0x2, "ptp", "clk"),
  70. MPP_FUNCTION(0x3, "led", "p2"),
  71. MPP_FUNCTION(0x4, "audio", "extclk"),
  72. MPP_FUNCTION(0x5, "nand", "io1")),
  73. MPP_MODE(8,
  74. MPP_FUNCTION(0x0, "gpio", NULL),
  75. MPP_FUNCTION(0x1, "dev", "bootcs"),
  76. MPP_FUNCTION(0x2, "spi0", "cs0"),
  77. MPP_FUNCTION(0x3, "spi1", "cs0"),
  78. MPP_FUNCTION(0x5, "nand", "ce")),
  79. MPP_MODE(9,
  80. MPP_FUNCTION(0x0, "gpio", NULL),
  81. MPP_FUNCTION(0x2, "spi0", "sck"),
  82. MPP_FUNCTION(0x3, "spi1", "sck"),
  83. MPP_FUNCTION(0x5, "nand", "we")),
  84. MPP_MODE(10,
  85. MPP_FUNCTION(0x0, "gpio", NULL),
  86. MPP_FUNCTION(0x2, "dram", "vttctrl"),
  87. MPP_FUNCTION(0x3, "led", "c1"),
  88. MPP_FUNCTION(0x5, "nand", "re"),
  89. MPP_FUNCTION(0x6, "spi1", "sck")),
  90. MPP_MODE(11,
  91. MPP_FUNCTION(0x0, "gpio", NULL),
  92. MPP_FUNCTION(0x1, "dev", "a0"),
  93. MPP_FUNCTION(0x3, "led", "c2"),
  94. MPP_FUNCTION(0x4, "audio", "sdo"),
  95. MPP_FUNCTION(0x5, "nand", "cle")),
  96. MPP_MODE(12,
  97. MPP_FUNCTION(0x0, "gpio", NULL),
  98. MPP_FUNCTION(0x1, "dev", "a1"),
  99. MPP_FUNCTION(0x4, "audio", "bclk"),
  100. MPP_FUNCTION(0x5, "nand", "ale")),
  101. MPP_MODE(13,
  102. MPP_FUNCTION(0x0, "gpio", NULL),
  103. MPP_FUNCTION(0x1, "dev", "ready"),
  104. MPP_FUNCTION(0x2, "pcie0", "rstout"),
  105. MPP_FUNCTION(0x3, "pcie1", "rstout"),
  106. MPP_FUNCTION(0x5, "nand", "rb"),
  107. MPP_FUNCTION(0x6, "spi1", "mosi")),
  108. MPP_MODE(14,
  109. MPP_FUNCTION(0x0, "gpio", NULL),
  110. MPP_FUNCTION(0x2, "i2c0", "sda"),
  111. MPP_FUNCTION(0x3, "uart1", "txd")),
  112. MPP_MODE(15,
  113. MPP_FUNCTION(0x0, "gpio", NULL),
  114. MPP_FUNCTION(0x2, "i2c0", "sck"),
  115. MPP_FUNCTION(0x3, "uart1", "rxd")),
  116. MPP_MODE(16,
  117. MPP_FUNCTION(0x0, "gpio", NULL),
  118. MPP_FUNCTION(0x2, "uart0", "txd")),
  119. MPP_MODE(17,
  120. MPP_FUNCTION(0x0, "gpio", NULL),
  121. MPP_FUNCTION(0x2, "uart0", "rxd")),
  122. MPP_MODE(18,
  123. MPP_FUNCTION(0x0, "gpio", NULL),
  124. MPP_FUNCTION(0x2, "tdm", "int")),
  125. MPP_MODE(19,
  126. MPP_FUNCTION(0x0, "gpio", NULL),
  127. MPP_FUNCTION(0x2, "tdm", "rst")),
  128. MPP_MODE(20,
  129. MPP_FUNCTION(0x0, "gpio", NULL),
  130. MPP_FUNCTION(0x2, "tdm", "pclk")),
  131. MPP_MODE(21,
  132. MPP_FUNCTION(0x0, "gpio", NULL),
  133. MPP_FUNCTION(0x2, "tdm", "fsync")),
  134. MPP_MODE(22,
  135. MPP_FUNCTION(0x0, "gpio", NULL),
  136. MPP_FUNCTION(0x2, "tdm", "drx")),
  137. MPP_MODE(23,
  138. MPP_FUNCTION(0x0, "gpio", NULL),
  139. MPP_FUNCTION(0x2, "tdm", "dtx")),
  140. MPP_MODE(24,
  141. MPP_FUNCTION(0x0, "gpio", NULL),
  142. MPP_FUNCTION(0x1, "led", "p0"),
  143. MPP_FUNCTION(0x2, "ge1", "rxd0"),
  144. MPP_FUNCTION(0x3, "sd", "cmd"),
  145. MPP_FUNCTION(0x4, "uart0", "rts"),
  146. MPP_FUNCTION(0x5, "spi0", "cs0"),
  147. MPP_FUNCTION(0x6, "dev", "cs1")),
  148. MPP_MODE(25,
  149. MPP_FUNCTION(0x0, "gpio", NULL),
  150. MPP_FUNCTION(0x1, "led", "p2"),
  151. MPP_FUNCTION(0x2, "ge1", "rxd1"),
  152. MPP_FUNCTION(0x3, "sd", "d0"),
  153. MPP_FUNCTION(0x4, "uart0", "cts"),
  154. MPP_FUNCTION(0x5, "spi0", "mosi"),
  155. MPP_FUNCTION(0x6, "dev", "cs2")),
  156. MPP_MODE(26,
  157. MPP_FUNCTION(0x0, "gpio", NULL),
  158. MPP_FUNCTION(0x1, "pcie0", "clkreq"),
  159. MPP_FUNCTION(0x2, "ge1", "rxd2"),
  160. MPP_FUNCTION(0x3, "sd", "d2"),
  161. MPP_FUNCTION(0x4, "uart1", "rts"),
  162. MPP_FUNCTION(0x5, "spi0", "cs1"),
  163. MPP_FUNCTION(0x6, "led", "c1")),
  164. MPP_MODE(27,
  165. MPP_FUNCTION(0x0, "gpio", NULL),
  166. MPP_FUNCTION(0x1, "pcie1", "clkreq"),
  167. MPP_FUNCTION(0x2, "ge1", "rxd3"),
  168. MPP_FUNCTION(0x3, "sd", "d1"),
  169. MPP_FUNCTION(0x4, "uart1", "cts"),
  170. MPP_FUNCTION(0x5, "spi0", "miso"),
  171. MPP_FUNCTION(0x6, "led", "c2")),
  172. MPP_MODE(28,
  173. MPP_FUNCTION(0x0, "gpio", NULL),
  174. MPP_FUNCTION(0x1, "led", "p3"),
  175. MPP_FUNCTION(0x2, "ge1", "txctl"),
  176. MPP_FUNCTION(0x3, "sd", "clk"),
  177. MPP_FUNCTION(0x5, "dram", "vttctrl")),
  178. MPP_MODE(29,
  179. MPP_FUNCTION(0x0, "gpio", NULL),
  180. MPP_FUNCTION(0x1, "pcie1", "clkreq"),
  181. MPP_FUNCTION(0x2, "ge1", "rxclk"),
  182. MPP_FUNCTION(0x3, "sd", "d3"),
  183. MPP_FUNCTION(0x5, "spi0", "sck"),
  184. MPP_FUNCTION(0x6, "pcie0", "rstout")),
  185. MPP_MODE(30,
  186. MPP_FUNCTION(0x0, "gpio", NULL),
  187. MPP_FUNCTION(0x2, "ge1", "txd0"),
  188. MPP_FUNCTION(0x3, "spi1", "cs0"),
  189. MPP_FUNCTION(0x5, "led", "p3"),
  190. MPP_FUNCTION(0x6, "ptp", "evreq")),
  191. MPP_MODE(31,
  192. MPP_FUNCTION(0x0, "gpio", NULL),
  193. MPP_FUNCTION(0x2, "ge1", "txd1"),
  194. MPP_FUNCTION(0x3, "spi1", "mosi"),
  195. MPP_FUNCTION(0x5, "led", "p0")),
  196. MPP_MODE(32,
  197. MPP_FUNCTION(0x0, "gpio", NULL),
  198. MPP_FUNCTION(0x2, "ge1", "txd2"),
  199. MPP_FUNCTION(0x3, "spi1", "sck"),
  200. MPP_FUNCTION(0x4, "ptp", "trig"),
  201. MPP_FUNCTION(0x5, "led", "c0")),
  202. MPP_MODE(33,
  203. MPP_FUNCTION(0x0, "gpio", NULL),
  204. MPP_FUNCTION(0x2, "ge1", "txd3"),
  205. MPP_FUNCTION(0x3, "spi1", "miso"),
  206. MPP_FUNCTION(0x5, "led", "p2")),
  207. MPP_MODE(34,
  208. MPP_FUNCTION(0x0, "gpio", NULL),
  209. MPP_FUNCTION(0x2, "ge1", "txclkout"),
  210. MPP_FUNCTION(0x3, "spi1", "sck"),
  211. MPP_FUNCTION(0x5, "led", "c1")),
  212. MPP_MODE(35,
  213. MPP_FUNCTION(0x0, "gpio", NULL),
  214. MPP_FUNCTION(0x2, "ge1", "rxctl"),
  215. MPP_FUNCTION(0x3, "spi1", "cs1"),
  216. MPP_FUNCTION(0x4, "spi0", "cs2"),
  217. MPP_FUNCTION(0x5, "led", "p1")),
  218. MPP_MODE(36,
  219. MPP_FUNCTION(0x0, "gpio", NULL),
  220. MPP_FUNCTION(0x1, "pcie0", "clkreq"),
  221. MPP_FUNCTION(0x5, "led", "c2")),
  222. MPP_MODE(37,
  223. MPP_FUNCTION(0x0, "gpio", NULL),
  224. MPP_FUNCTION(0x1, "pcie0", "clkreq"),
  225. MPP_FUNCTION(0x2, "tdm", "int"),
  226. MPP_FUNCTION(0x4, "ge", "mdc")),
  227. MPP_MODE(38,
  228. MPP_FUNCTION(0x0, "gpio", NULL),
  229. MPP_FUNCTION(0x1, "pcie1", "clkreq"),
  230. MPP_FUNCTION(0x4, "ge", "mdio")),
  231. MPP_MODE(39,
  232. MPP_FUNCTION(0x0, "gpio", NULL),
  233. MPP_FUNCTION(0x4, "ref", "clkout"),
  234. MPP_FUNCTION(0x5, "led", "p3")),
  235. MPP_MODE(40,
  236. MPP_FUNCTION(0x0, "gpio", NULL),
  237. MPP_FUNCTION(0x4, "uart1", "txd"),
  238. MPP_FUNCTION(0x5, "led", "p0")),
  239. MPP_MODE(41,
  240. MPP_FUNCTION(0x0, "gpio", NULL),
  241. MPP_FUNCTION(0x4, "uart1", "rxd"),
  242. MPP_FUNCTION(0x5, "led", "p1")),
  243. MPP_MODE(42,
  244. MPP_FUNCTION(0x0, "gpio", NULL),
  245. MPP_FUNCTION(0x3, "spi1", "cs2"),
  246. MPP_FUNCTION(0x4, "led", "c0"),
  247. MPP_FUNCTION(0x6, "ptp", "clk")),
  248. MPP_MODE(43,
  249. MPP_FUNCTION(0x0, "gpio", NULL),
  250. MPP_FUNCTION(0x2, "sata0", "prsnt"),
  251. MPP_FUNCTION(0x4, "dram", "vttctrl"),
  252. MPP_FUNCTION(0x5, "led", "c1")),
  253. MPP_MODE(44,
  254. MPP_FUNCTION(0x0, "gpio", NULL),
  255. MPP_FUNCTION(0x4, "sata0", "prsnt")),
  256. MPP_MODE(45,
  257. MPP_FUNCTION(0x0, "gpio", NULL),
  258. MPP_FUNCTION(0x2, "spi0", "cs2"),
  259. MPP_FUNCTION(0x4, "pcie0", "rstout"),
  260. MPP_FUNCTION(0x5, "led", "c2"),
  261. MPP_FUNCTION(0x6, "spi1", "cs2")),
  262. MPP_MODE(46,
  263. MPP_FUNCTION(0x0, "gpio", NULL),
  264. MPP_FUNCTION(0x1, "led", "p0"),
  265. MPP_FUNCTION(0x2, "ge0", "txd0"),
  266. MPP_FUNCTION(0x3, "ge1", "txd0"),
  267. MPP_FUNCTION(0x6, "dev", "we1")),
  268. MPP_MODE(47,
  269. MPP_FUNCTION(0x0, "gpio", NULL),
  270. MPP_FUNCTION(0x1, "led", "p1"),
  271. MPP_FUNCTION(0x2, "ge0", "txd1"),
  272. MPP_FUNCTION(0x3, "ge1", "txd1"),
  273. MPP_FUNCTION(0x5, "ptp", "trig"),
  274. MPP_FUNCTION(0x6, "dev", "ale0")),
  275. MPP_MODE(48,
  276. MPP_FUNCTION(0x0, "gpio", NULL),
  277. MPP_FUNCTION(0x1, "led", "p2"),
  278. MPP_FUNCTION(0x2, "ge0", "txd2"),
  279. MPP_FUNCTION(0x3, "ge1", "txd2"),
  280. MPP_FUNCTION(0x6, "dev", "ale1")),
  281. MPP_MODE(49,
  282. MPP_FUNCTION(0x0, "gpio", NULL),
  283. MPP_FUNCTION(0x1, "led", "p3"),
  284. MPP_FUNCTION(0x2, "ge0", "txd3"),
  285. MPP_FUNCTION(0x3, "ge1", "txd3"),
  286. MPP_FUNCTION(0x6, "dev", "a2")),
  287. MPP_MODE(50,
  288. MPP_FUNCTION(0x0, "gpio", NULL),
  289. MPP_FUNCTION(0x1, "led", "c0"),
  290. MPP_FUNCTION(0x2, "ge0", "rxd0"),
  291. MPP_FUNCTION(0x3, "ge1", "rxd0"),
  292. MPP_FUNCTION(0x5, "ptp", "evreq"),
  293. MPP_FUNCTION(0x6, "dev", "ad12")),
  294. MPP_MODE(51,
  295. MPP_FUNCTION(0x0, "gpio", NULL),
  296. MPP_FUNCTION(0x1, "led", "c1"),
  297. MPP_FUNCTION(0x2, "ge0", "rxd1"),
  298. MPP_FUNCTION(0x3, "ge1", "rxd1"),
  299. MPP_FUNCTION(0x6, "dev", "ad8")),
  300. MPP_MODE(52,
  301. MPP_FUNCTION(0x0, "gpio", NULL),
  302. MPP_FUNCTION(0x1, "led", "c2"),
  303. MPP_FUNCTION(0x2, "ge0", "rxd2"),
  304. MPP_FUNCTION(0x3, "ge1", "rxd2"),
  305. MPP_FUNCTION(0x5, "i2c0", "sda"),
  306. MPP_FUNCTION(0x6, "dev", "ad9")),
  307. MPP_MODE(53,
  308. MPP_FUNCTION(0x0, "gpio", NULL),
  309. MPP_FUNCTION(0x1, "pcie1", "rstout"),
  310. MPP_FUNCTION(0x2, "ge0", "rxd3"),
  311. MPP_FUNCTION(0x3, "ge1", "rxd3"),
  312. MPP_FUNCTION(0x5, "i2c0", "sck"),
  313. MPP_FUNCTION(0x6, "dev", "ad10")),
  314. MPP_MODE(54,
  315. MPP_FUNCTION(0x0, "gpio", NULL),
  316. MPP_FUNCTION(0x1, "pcie0", "rstout"),
  317. MPP_FUNCTION(0x2, "ge0", "rxctl"),
  318. MPP_FUNCTION(0x3, "ge1", "rxctl"),
  319. MPP_FUNCTION(0x6, "dev", "ad11")),
  320. MPP_MODE(55,
  321. MPP_FUNCTION(0x0, "gpio", NULL),
  322. MPP_FUNCTION(0x2, "ge0", "rxclk"),
  323. MPP_FUNCTION(0x3, "ge1", "rxclk"),
  324. MPP_FUNCTION(0x6, "dev", "cs0")),
  325. MPP_MODE(56,
  326. MPP_FUNCTION(0x0, "gpio", NULL),
  327. MPP_FUNCTION(0x2, "ge0", "txclkout"),
  328. MPP_FUNCTION(0x3, "ge1", "txclkout"),
  329. MPP_FUNCTION(0x6, "dev", "oe")),
  330. MPP_MODE(57,
  331. MPP_FUNCTION(0x0, "gpio", NULL),
  332. MPP_FUNCTION(0x2, "ge0", "txctl"),
  333. MPP_FUNCTION(0x3, "ge1", "txctl"),
  334. MPP_FUNCTION(0x6, "dev", "we0")),
  335. MPP_MODE(58,
  336. MPP_FUNCTION(0x0, "gpio", NULL),
  337. MPP_FUNCTION(0x4, "led", "c0")),
  338. MPP_MODE(59,
  339. MPP_FUNCTION(0x0, "gpio", NULL),
  340. MPP_FUNCTION(0x4, "led", "c1")),
  341. MPP_MODE(60,
  342. MPP_FUNCTION(0x0, "gpio", NULL),
  343. MPP_FUNCTION(0x2, "uart1", "txd"),
  344. MPP_FUNCTION(0x4, "led", "c2"),
  345. MPP_FUNCTION(0x6, "dev", "ad13")),
  346. MPP_MODE(61,
  347. MPP_FUNCTION(0x0, "gpio", NULL),
  348. MPP_FUNCTION(0x1, "i2c1", "sda"),
  349. MPP_FUNCTION(0x2, "uart1", "rxd"),
  350. MPP_FUNCTION(0x3, "spi1", "cs2"),
  351. MPP_FUNCTION(0x4, "led", "p0"),
  352. MPP_FUNCTION(0x6, "dev", "ad14")),
  353. MPP_MODE(62,
  354. MPP_FUNCTION(0x0, "gpio", NULL),
  355. MPP_FUNCTION(0x1, "i2c1", "sck"),
  356. MPP_FUNCTION(0x4, "led", "p1"),
  357. MPP_FUNCTION(0x6, "dev", "ad15")),
  358. MPP_MODE(63,
  359. MPP_FUNCTION(0x0, "gpio", NULL),
  360. MPP_FUNCTION(0x2, "ptp", "trig"),
  361. MPP_FUNCTION(0x4, "led", "p2"),
  362. MPP_FUNCTION(0x6, "dev", "burst/last")),
  363. MPP_MODE(64,
  364. MPP_FUNCTION(0x0, "gpio", NULL),
  365. MPP_FUNCTION(0x2, "dram", "vttctrl"),
  366. MPP_FUNCTION(0x4, "led", "p3")),
  367. MPP_MODE(65,
  368. MPP_FUNCTION(0x0, "gpio", NULL),
  369. MPP_FUNCTION(0x1, "sata1", "prsnt")),
  370. MPP_MODE(66,
  371. MPP_FUNCTION(0x0, "gpio", NULL),
  372. MPP_FUNCTION(0x2, "ptp", "evreq"),
  373. MPP_FUNCTION(0x4, "spi1", "cs3"),
  374. MPP_FUNCTION(0x5, "pcie0", "rstout"),
  375. MPP_FUNCTION(0x6, "dev", "cs3")),
  376. };
  377. static struct mvebu_pinctrl_soc_info armada_375_pinctrl_info;
  378. static const struct of_device_id armada_375_pinctrl_of_match[] = {
  379. { .compatible = "marvell,mv88f6720-pinctrl" },
  380. { },
  381. };
  382. static const struct mvebu_mpp_ctrl mv88f6720_mpp_controls[] = {
  383. MPP_FUNC_CTRL(0, 69, NULL, mvebu_mmio_mpp_ctrl),
  384. };
  385. static struct pinctrl_gpio_range mv88f6720_mpp_gpio_ranges[] = {
  386. MPP_GPIO_RANGE(0, 0, 0, 32),
  387. MPP_GPIO_RANGE(1, 32, 32, 32),
  388. MPP_GPIO_RANGE(2, 64, 64, 3),
  389. };
  390. static int armada_375_pinctrl_probe(struct platform_device *pdev)
  391. {
  392. struct mvebu_pinctrl_soc_info *soc = &armada_375_pinctrl_info;
  393. soc->variant = 0; /* no variants for Armada 375 */
  394. soc->controls = mv88f6720_mpp_controls;
  395. soc->ncontrols = ARRAY_SIZE(mv88f6720_mpp_controls);
  396. soc->modes = mv88f6720_mpp_modes;
  397. soc->nmodes = ARRAY_SIZE(mv88f6720_mpp_modes);
  398. soc->gpioranges = mv88f6720_mpp_gpio_ranges;
  399. soc->ngpioranges = ARRAY_SIZE(mv88f6720_mpp_gpio_ranges);
  400. pdev->dev.platform_data = soc;
  401. return mvebu_pinctrl_simple_mmio_probe(pdev);
  402. }
  403. static struct platform_driver armada_375_pinctrl_driver = {
  404. .driver = {
  405. .name = "armada-375-pinctrl",
  406. .of_match_table = of_match_ptr(armada_375_pinctrl_of_match),
  407. },
  408. .probe = armada_375_pinctrl_probe,
  409. };
  410. builtin_platform_driver(armada_375_pinctrl_driver);