pinctrl-sun5i-a13.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  1. /*
  2. * Allwinner A13 SoCs pinctrl driver.
  3. *
  4. * Copyright (C) 2014 Maxime Ripard
  5. *
  6. * Maxime Ripard <maxime.ripard@free-electrons.com>
  7. *
  8. * This file is licensed under the terms of the GNU General Public
  9. * License version 2. This program is licensed "as is" without any
  10. * warranty of any kind, whether express or implied.
  11. */
  12. #include <linux/module.h>
  13. #include <linux/platform_device.h>
  14. #include <linux/of.h>
  15. #include <linux/of_device.h>
  16. #include <linux/pinctrl/pinctrl.h>
  17. #include "pinctrl-sunxi.h"
  18. static const struct sunxi_desc_pin sun5i_a13_pins[] = {
  19. /* Hole */
  20. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 0),
  21. SUNXI_FUNCTION(0x0, "gpio_in"),
  22. SUNXI_FUNCTION(0x1, "gpio_out"),
  23. SUNXI_FUNCTION(0x2, "i2c0")), /* SCK */
  24. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 1),
  25. SUNXI_FUNCTION(0x0, "gpio_in"),
  26. SUNXI_FUNCTION(0x1, "gpio_out"),
  27. SUNXI_FUNCTION(0x2, "i2c0")), /* SDA */
  28. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 2),
  29. SUNXI_FUNCTION(0x0, "gpio_in"),
  30. SUNXI_FUNCTION(0x1, "gpio_out"),
  31. SUNXI_FUNCTION(0x2, "pwm"),
  32. SUNXI_FUNCTION_IRQ(0x6, 16)), /* EINT16 */
  33. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 3),
  34. SUNXI_FUNCTION(0x0, "gpio_in"),
  35. SUNXI_FUNCTION(0x1, "gpio_out"),
  36. SUNXI_FUNCTION(0x2, "ir0"), /* TX */
  37. SUNXI_FUNCTION_IRQ(0x6, 17)), /* EINT17 */
  38. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 4),
  39. SUNXI_FUNCTION(0x0, "gpio_in"),
  40. SUNXI_FUNCTION(0x1, "gpio_out"),
  41. SUNXI_FUNCTION(0x2, "ir0"), /* RX */
  42. SUNXI_FUNCTION_IRQ(0x6, 18)), /* EINT18 */
  43. /* Hole */
  44. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 10),
  45. SUNXI_FUNCTION(0x0, "gpio_in"),
  46. SUNXI_FUNCTION(0x1, "gpio_out"),
  47. SUNXI_FUNCTION(0x2, "spi2"), /* CS1 */
  48. SUNXI_FUNCTION_IRQ(0x6, 24)), /* EINT24 */
  49. /* Hole */
  50. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 15),
  51. SUNXI_FUNCTION(0x0, "gpio_in"),
  52. SUNXI_FUNCTION(0x1, "gpio_out"),
  53. SUNXI_FUNCTION(0x2, "i2c1")), /* SCK */
  54. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 16),
  55. SUNXI_FUNCTION(0x0, "gpio_in"),
  56. SUNXI_FUNCTION(0x1, "gpio_out"),
  57. SUNXI_FUNCTION(0x2, "i2c1")), /* SDA */
  58. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 17),
  59. SUNXI_FUNCTION(0x0, "gpio_in"),
  60. SUNXI_FUNCTION(0x1, "gpio_out"),
  61. SUNXI_FUNCTION(0x2, "i2c2")), /* SCK */
  62. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 18),
  63. SUNXI_FUNCTION(0x0, "gpio_in"),
  64. SUNXI_FUNCTION(0x1, "gpio_out"),
  65. SUNXI_FUNCTION(0x2, "i2c2")), /* SDA */
  66. /* Hole */
  67. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0),
  68. SUNXI_FUNCTION(0x0, "gpio_in"),
  69. SUNXI_FUNCTION(0x1, "gpio_out"),
  70. SUNXI_FUNCTION(0x2, "nand0"), /* NWE */
  71. SUNXI_FUNCTION(0x3, "spi0")), /* MOSI */
  72. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1),
  73. SUNXI_FUNCTION(0x0, "gpio_in"),
  74. SUNXI_FUNCTION(0x1, "gpio_out"),
  75. SUNXI_FUNCTION(0x2, "nand0"), /* NALE */
  76. SUNXI_FUNCTION(0x3, "spi0")), /* MISO */
  77. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2),
  78. SUNXI_FUNCTION(0x0, "gpio_in"),
  79. SUNXI_FUNCTION(0x1, "gpio_out"),
  80. SUNXI_FUNCTION(0x2, "nand0"), /* NCLE */
  81. SUNXI_FUNCTION(0x3, "spi0")), /* CLK */
  82. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3),
  83. SUNXI_FUNCTION(0x0, "gpio_in"),
  84. SUNXI_FUNCTION(0x1, "gpio_out"),
  85. SUNXI_FUNCTION(0x2, "nand0"), /* NCE1 */
  86. SUNXI_FUNCTION(0x3, "spi0")), /* CS0 */
  87. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 4),
  88. SUNXI_FUNCTION(0x0, "gpio_in"),
  89. SUNXI_FUNCTION(0x1, "gpio_out"),
  90. SUNXI_FUNCTION(0x2, "nand0")), /* NCE0 */
  91. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 5),
  92. SUNXI_FUNCTION(0x0, "gpio_in"),
  93. SUNXI_FUNCTION(0x1, "gpio_out"),
  94. SUNXI_FUNCTION(0x2, "nand0")), /* NRE */
  95. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 6),
  96. SUNXI_FUNCTION(0x0, "gpio_in"),
  97. SUNXI_FUNCTION(0x1, "gpio_out"),
  98. SUNXI_FUNCTION(0x2, "nand0"), /* NRB0 */
  99. SUNXI_FUNCTION(0x3, "mmc2")), /* CMD */
  100. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 7),
  101. SUNXI_FUNCTION(0x0, "gpio_in"),
  102. SUNXI_FUNCTION(0x1, "gpio_out"),
  103. SUNXI_FUNCTION(0x2, "nand0"), /* NRB1 */
  104. SUNXI_FUNCTION(0x3, "mmc2")), /* CLK */
  105. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 8),
  106. SUNXI_FUNCTION(0x0, "gpio_in"),
  107. SUNXI_FUNCTION(0x1, "gpio_out"),
  108. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ0 */
  109. SUNXI_FUNCTION(0x3, "mmc2")), /* D0 */
  110. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 9),
  111. SUNXI_FUNCTION(0x0, "gpio_in"),
  112. SUNXI_FUNCTION(0x1, "gpio_out"),
  113. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ1 */
  114. SUNXI_FUNCTION(0x3, "mmc2")), /* D1 */
  115. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 10),
  116. SUNXI_FUNCTION(0x0, "gpio_in"),
  117. SUNXI_FUNCTION(0x1, "gpio_out"),
  118. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ2 */
  119. SUNXI_FUNCTION(0x3, "mmc2")), /* D2 */
  120. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 11),
  121. SUNXI_FUNCTION(0x0, "gpio_in"),
  122. SUNXI_FUNCTION(0x1, "gpio_out"),
  123. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ3 */
  124. SUNXI_FUNCTION(0x3, "mmc2")), /* D3 */
  125. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 12),
  126. SUNXI_FUNCTION(0x0, "gpio_in"),
  127. SUNXI_FUNCTION(0x1, "gpio_out"),
  128. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ4 */
  129. SUNXI_FUNCTION(0x3, "mmc2")), /* D4 */
  130. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 13),
  131. SUNXI_FUNCTION(0x0, "gpio_in"),
  132. SUNXI_FUNCTION(0x1, "gpio_out"),
  133. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ5 */
  134. SUNXI_FUNCTION(0x3, "mmc2")), /* D5 */
  135. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 14),
  136. SUNXI_FUNCTION(0x0, "gpio_in"),
  137. SUNXI_FUNCTION(0x1, "gpio_out"),
  138. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ6 */
  139. SUNXI_FUNCTION(0x3, "mmc2")), /* D6 */
  140. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 15),
  141. SUNXI_FUNCTION(0x0, "gpio_in"),
  142. SUNXI_FUNCTION(0x1, "gpio_out"),
  143. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ7 */
  144. SUNXI_FUNCTION(0x3, "mmc2")), /* D7 */
  145. /* Hole */
  146. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 19),
  147. SUNXI_FUNCTION(0x0, "gpio_in"),
  148. SUNXI_FUNCTION(0x1, "gpio_out"),
  149. SUNXI_FUNCTION(0x2, "nand0"), /* NDQS */
  150. SUNXI_FUNCTION(0x4, "uart3")), /* RTS */
  151. /* Hole */
  152. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 2),
  153. SUNXI_FUNCTION(0x0, "gpio_in"),
  154. SUNXI_FUNCTION(0x1, "gpio_out"),
  155. SUNXI_FUNCTION(0x2, "lcd0")), /* D2 */
  156. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 3),
  157. SUNXI_FUNCTION(0x0, "gpio_in"),
  158. SUNXI_FUNCTION(0x1, "gpio_out"),
  159. SUNXI_FUNCTION(0x2, "lcd0")), /* D3 */
  160. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 4),
  161. SUNXI_FUNCTION(0x0, "gpio_in"),
  162. SUNXI_FUNCTION(0x1, "gpio_out"),
  163. SUNXI_FUNCTION(0x2, "lcd0")), /* D4 */
  164. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 5),
  165. SUNXI_FUNCTION(0x0, "gpio_in"),
  166. SUNXI_FUNCTION(0x1, "gpio_out"),
  167. SUNXI_FUNCTION(0x2, "lcd0")), /* D5 */
  168. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 6),
  169. SUNXI_FUNCTION(0x0, "gpio_in"),
  170. SUNXI_FUNCTION(0x1, "gpio_out"),
  171. SUNXI_FUNCTION(0x2, "lcd0")), /* D6 */
  172. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 7),
  173. SUNXI_FUNCTION(0x0, "gpio_in"),
  174. SUNXI_FUNCTION(0x1, "gpio_out"),
  175. SUNXI_FUNCTION(0x2, "lcd0")), /* D7 */
  176. /* Hole */
  177. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 10),
  178. SUNXI_FUNCTION(0x0, "gpio_in"),
  179. SUNXI_FUNCTION(0x1, "gpio_out"),
  180. SUNXI_FUNCTION(0x2, "lcd0")), /* D10 */
  181. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 11),
  182. SUNXI_FUNCTION(0x0, "gpio_in"),
  183. SUNXI_FUNCTION(0x1, "gpio_out"),
  184. SUNXI_FUNCTION(0x2, "lcd0")), /* D11 */
  185. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 12),
  186. SUNXI_FUNCTION(0x0, "gpio_in"),
  187. SUNXI_FUNCTION(0x1, "gpio_out"),
  188. SUNXI_FUNCTION(0x2, "lcd0")), /* D12 */
  189. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 13),
  190. SUNXI_FUNCTION(0x0, "gpio_in"),
  191. SUNXI_FUNCTION(0x1, "gpio_out"),
  192. SUNXI_FUNCTION(0x2, "lcd0")), /* D13 */
  193. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 14),
  194. SUNXI_FUNCTION(0x0, "gpio_in"),
  195. SUNXI_FUNCTION(0x1, "gpio_out"),
  196. SUNXI_FUNCTION(0x2, "lcd0")), /* D14 */
  197. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 15),
  198. SUNXI_FUNCTION(0x0, "gpio_in"),
  199. SUNXI_FUNCTION(0x1, "gpio_out"),
  200. SUNXI_FUNCTION(0x2, "lcd0")), /* D15 */
  201. /* Hole */
  202. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 18),
  203. SUNXI_FUNCTION(0x0, "gpio_in"),
  204. SUNXI_FUNCTION(0x1, "gpio_out"),
  205. SUNXI_FUNCTION(0x2, "lcd0")), /* D18 */
  206. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 19),
  207. SUNXI_FUNCTION(0x0, "gpio_in"),
  208. SUNXI_FUNCTION(0x1, "gpio_out"),
  209. SUNXI_FUNCTION(0x2, "lcd0")), /* D19 */
  210. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 20),
  211. SUNXI_FUNCTION(0x0, "gpio_in"),
  212. SUNXI_FUNCTION(0x1, "gpio_out"),
  213. SUNXI_FUNCTION(0x2, "lcd0")), /* D20 */
  214. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 21),
  215. SUNXI_FUNCTION(0x0, "gpio_in"),
  216. SUNXI_FUNCTION(0x1, "gpio_out"),
  217. SUNXI_FUNCTION(0x2, "lcd0")), /* D21 */
  218. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 22),
  219. SUNXI_FUNCTION(0x0, "gpio_in"),
  220. SUNXI_FUNCTION(0x1, "gpio_out"),
  221. SUNXI_FUNCTION(0x2, "lcd0")), /* D22 */
  222. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 23),
  223. SUNXI_FUNCTION(0x0, "gpio_in"),
  224. SUNXI_FUNCTION(0x1, "gpio_out"),
  225. SUNXI_FUNCTION(0x2, "lcd0")), /* D23 */
  226. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 24),
  227. SUNXI_FUNCTION(0x0, "gpio_in"),
  228. SUNXI_FUNCTION(0x1, "gpio_out"),
  229. SUNXI_FUNCTION(0x2, "lcd0")), /* CLK */
  230. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 25),
  231. SUNXI_FUNCTION(0x0, "gpio_in"),
  232. SUNXI_FUNCTION(0x1, "gpio_out"),
  233. SUNXI_FUNCTION(0x2, "lcd0")), /* DE */
  234. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 26),
  235. SUNXI_FUNCTION(0x0, "gpio_in"),
  236. SUNXI_FUNCTION(0x1, "gpio_out"),
  237. SUNXI_FUNCTION(0x2, "lcd0")), /* HSYNC */
  238. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 27),
  239. SUNXI_FUNCTION(0x0, "gpio_in"),
  240. SUNXI_FUNCTION(0x1, "gpio_out"),
  241. SUNXI_FUNCTION(0x2, "lcd0")), /* VSYNC */
  242. /* Hole */
  243. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 0),
  244. SUNXI_FUNCTION(0x0, "gpio_in"),
  245. SUNXI_FUNCTION(0x3, "csi0"), /* PCLK */
  246. SUNXI_FUNCTION(0x4, "spi2"), /* CS0 */
  247. SUNXI_FUNCTION_IRQ(0x6, 14)), /* EINT14 */
  248. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 1),
  249. SUNXI_FUNCTION(0x0, "gpio_in"),
  250. SUNXI_FUNCTION(0x3, "csi0"), /* MCLK */
  251. SUNXI_FUNCTION(0x4, "spi2"), /* CLK */
  252. SUNXI_FUNCTION_IRQ(0x6, 15)), /* EINT15 */
  253. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 2),
  254. SUNXI_FUNCTION(0x0, "gpio_in"),
  255. SUNXI_FUNCTION(0x3, "csi0"), /* HSYNC */
  256. SUNXI_FUNCTION(0x4, "spi2")), /* MOSI */
  257. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 3),
  258. SUNXI_FUNCTION(0x0, "gpio_in"),
  259. SUNXI_FUNCTION(0x1, "gpio_out"),
  260. SUNXI_FUNCTION(0x3, "csi0"), /* VSYNC */
  261. SUNXI_FUNCTION(0x4, "spi2")), /* MISO */
  262. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 4),
  263. SUNXI_FUNCTION(0x0, "gpio_in"),
  264. SUNXI_FUNCTION(0x1, "gpio_out"),
  265. SUNXI_FUNCTION(0x3, "csi0"), /* D0 */
  266. SUNXI_FUNCTION(0x4, "mmc2")), /* D0 */
  267. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 5),
  268. SUNXI_FUNCTION(0x0, "gpio_in"),
  269. SUNXI_FUNCTION(0x1, "gpio_out"),
  270. SUNXI_FUNCTION(0x3, "csi0"), /* D1 */
  271. SUNXI_FUNCTION(0x4, "mmc2")), /* D1 */
  272. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 6),
  273. SUNXI_FUNCTION(0x0, "gpio_in"),
  274. SUNXI_FUNCTION(0x1, "gpio_out"),
  275. SUNXI_FUNCTION(0x3, "csi0"), /* D2 */
  276. SUNXI_FUNCTION(0x4, "mmc2")), /* D2 */
  277. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 7),
  278. SUNXI_FUNCTION(0x0, "gpio_in"),
  279. SUNXI_FUNCTION(0x1, "gpio_out"),
  280. SUNXI_FUNCTION(0x3, "csi0"), /* D3 */
  281. SUNXI_FUNCTION(0x4, "mmc2")), /* D3 */
  282. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 8),
  283. SUNXI_FUNCTION(0x0, "gpio_in"),
  284. SUNXI_FUNCTION(0x1, "gpio_out"),
  285. SUNXI_FUNCTION(0x3, "csi0"), /* D4 */
  286. SUNXI_FUNCTION(0x4, "mmc2")), /* CMD */
  287. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 9),
  288. SUNXI_FUNCTION(0x0, "gpio_in"),
  289. SUNXI_FUNCTION(0x1, "gpio_out"),
  290. SUNXI_FUNCTION(0x3, "csi0"), /* D5 */
  291. SUNXI_FUNCTION(0x4, "mmc2")), /* CLK */
  292. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 10),
  293. SUNXI_FUNCTION(0x0, "gpio_in"),
  294. SUNXI_FUNCTION(0x1, "gpio_out"),
  295. SUNXI_FUNCTION(0x3, "csi0"), /* D6 */
  296. SUNXI_FUNCTION(0x4, "uart1")), /* TX */
  297. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 11),
  298. SUNXI_FUNCTION(0x0, "gpio_in"),
  299. SUNXI_FUNCTION(0x1, "gpio_out"),
  300. SUNXI_FUNCTION(0x3, "csi0"), /* D7 */
  301. SUNXI_FUNCTION(0x4, "uart1")), /* RX */
  302. /* Hole */
  303. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0),
  304. SUNXI_FUNCTION(0x0, "gpio_in"),
  305. SUNXI_FUNCTION(0x1, "gpio_out"),
  306. SUNXI_FUNCTION(0x2, "mmc0")), /* D1 */
  307. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1),
  308. SUNXI_FUNCTION(0x0, "gpio_in"),
  309. SUNXI_FUNCTION(0x1, "gpio_out"),
  310. SUNXI_FUNCTION(0x2, "mmc0")), /* D0 */
  311. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2),
  312. SUNXI_FUNCTION(0x0, "gpio_in"),
  313. SUNXI_FUNCTION(0x1, "gpio_out"),
  314. SUNXI_FUNCTION(0x2, "mmc0")), /* CLK */
  315. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3),
  316. SUNXI_FUNCTION(0x0, "gpio_in"),
  317. SUNXI_FUNCTION(0x1, "gpio_out"),
  318. SUNXI_FUNCTION(0x2, "mmc0")), /* CMD */
  319. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4),
  320. SUNXI_FUNCTION(0x0, "gpio_in"),
  321. SUNXI_FUNCTION(0x1, "gpio_out"),
  322. SUNXI_FUNCTION(0x2, "mmc0")), /* D3 */
  323. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5),
  324. SUNXI_FUNCTION(0x0, "gpio_in"),
  325. SUNXI_FUNCTION(0x1, "gpio_out"),
  326. SUNXI_FUNCTION(0x2, "mmc0")), /* D2 */
  327. /* Hole */
  328. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0),
  329. SUNXI_FUNCTION(0x0, "gpio_in"),
  330. SUNXI_FUNCTION_IRQ(0x6, 0)), /* EINT0 */
  331. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1),
  332. SUNXI_FUNCTION(0x0, "gpio_in"),
  333. SUNXI_FUNCTION_IRQ(0x6, 1)), /* EINT1 */
  334. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2),
  335. SUNXI_FUNCTION(0x0, "gpio_in"),
  336. SUNXI_FUNCTION_IRQ(0x6, 2)), /* EINT2 */
  337. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3),
  338. SUNXI_FUNCTION(0x0, "gpio_in"),
  339. SUNXI_FUNCTION(0x1, "gpio_out"),
  340. SUNXI_FUNCTION(0x2, "mmc1"), /* CMD */
  341. SUNXI_FUNCTION(0x4, "uart1"), /* TX */
  342. SUNXI_FUNCTION_IRQ(0x6, 3)), /* EINT3 */
  343. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4),
  344. SUNXI_FUNCTION(0x0, "gpio_in"),
  345. SUNXI_FUNCTION(0x1, "gpio_out"),
  346. SUNXI_FUNCTION(0x2, "mmc1"), /* CLK */
  347. SUNXI_FUNCTION(0x4, "uart1"), /* RX */
  348. SUNXI_FUNCTION_IRQ(0x6, 4)), /* EINT4 */
  349. /* Hole */
  350. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 9),
  351. SUNXI_FUNCTION(0x0, "gpio_in"),
  352. SUNXI_FUNCTION(0x1, "gpio_out"),
  353. SUNXI_FUNCTION(0x2, "spi1"), /* CS0 */
  354. SUNXI_FUNCTION(0x3, "uart3"), /* TX */
  355. SUNXI_FUNCTION_IRQ(0x6, 9)), /* EINT9 */
  356. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10),
  357. SUNXI_FUNCTION(0x0, "gpio_in"),
  358. SUNXI_FUNCTION(0x1, "gpio_out"),
  359. SUNXI_FUNCTION(0x2, "spi1"), /* CLK */
  360. SUNXI_FUNCTION(0x3, "uart3"), /* RX */
  361. SUNXI_FUNCTION_IRQ(0x6, 10)), /* EINT10 */
  362. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 11),
  363. SUNXI_FUNCTION(0x0, "gpio_in"),
  364. SUNXI_FUNCTION(0x1, "gpio_out"),
  365. SUNXI_FUNCTION(0x2, "spi1"), /* MOSI */
  366. SUNXI_FUNCTION(0x3, "uart3"), /* CTS */
  367. SUNXI_FUNCTION_IRQ(0x6, 11)), /* EINT11 */
  368. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 12),
  369. SUNXI_FUNCTION(0x0, "gpio_in"),
  370. SUNXI_FUNCTION(0x1, "gpio_out"),
  371. SUNXI_FUNCTION(0x2, "spi1"), /* MISO */
  372. SUNXI_FUNCTION(0x3, "uart3"), /* RTS */
  373. SUNXI_FUNCTION_IRQ(0x6, 12)), /* EINT12 */
  374. };
  375. static const struct sunxi_pinctrl_desc sun5i_a13_pinctrl_data = {
  376. .pins = sun5i_a13_pins,
  377. .npins = ARRAY_SIZE(sun5i_a13_pins),
  378. .irq_banks = 1,
  379. };
  380. static int sun5i_a13_pinctrl_probe(struct platform_device *pdev)
  381. {
  382. return sunxi_pinctrl_init(pdev,
  383. &sun5i_a13_pinctrl_data);
  384. }
  385. static const struct of_device_id sun5i_a13_pinctrl_match[] = {
  386. { .compatible = "allwinner,sun5i-a13-pinctrl", },
  387. {}
  388. };
  389. MODULE_DEVICE_TABLE(of, sun5i_a13_pinctrl_match);
  390. static struct platform_driver sun5i_a13_pinctrl_driver = {
  391. .probe = sun5i_a13_pinctrl_probe,
  392. .driver = {
  393. .name = "sun5i-a13-pinctrl",
  394. .of_match_table = sun5i_a13_pinctrl_match,
  395. },
  396. };
  397. module_platform_driver(sun5i_a13_pinctrl_driver);
  398. MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com");
  399. MODULE_DESCRIPTION("Allwinner A13 pinctrl driver");
  400. MODULE_LICENSE("GPL");