pinctrl-sun6i-a31s.c 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814
  1. /*
  2. * Allwinner A31s SoCs pinctrl driver.
  3. *
  4. * Copyright (C) 2014 Hans de Goede <hdegoede@redhat.com>
  5. *
  6. * Based on pinctrl-sun6i-a31.c, which is:
  7. * Copyright (C) 2014 Maxime Ripard <maxime.ripard@free-electrons.com>
  8. *
  9. * This file is licensed under the terms of the GNU General Public
  10. * License version 2. This program is licensed "as is" without any
  11. * warranty of any kind, whether express or implied.
  12. */
  13. #include <linux/module.h>
  14. #include <linux/platform_device.h>
  15. #include <linux/of.h>
  16. #include <linux/of_device.h>
  17. #include <linux/pinctrl/pinctrl.h>
  18. #include "pinctrl-sunxi.h"
  19. static const struct sunxi_desc_pin sun6i_a31s_pins[] = {
  20. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 0),
  21. SUNXI_FUNCTION(0x0, "gpio_in"),
  22. SUNXI_FUNCTION(0x1, "gpio_out"),
  23. SUNXI_FUNCTION(0x2, "gmac"), /* TXD0 */
  24. SUNXI_FUNCTION(0x4, "uart1"), /* DTR */
  25. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)), /* PA_EINT0 */
  26. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 1),
  27. SUNXI_FUNCTION(0x0, "gpio_in"),
  28. SUNXI_FUNCTION(0x1, "gpio_out"),
  29. SUNXI_FUNCTION(0x2, "gmac"), /* TXD1 */
  30. SUNXI_FUNCTION(0x4, "uart1"), /* DSR */
  31. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)), /* PA_EINT1 */
  32. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 2),
  33. SUNXI_FUNCTION(0x0, "gpio_in"),
  34. SUNXI_FUNCTION(0x1, "gpio_out"),
  35. SUNXI_FUNCTION(0x2, "gmac"), /* TXD2 */
  36. SUNXI_FUNCTION(0x4, "uart1"), /* DCD */
  37. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 2)), /* PA_EINT2 */
  38. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 3),
  39. SUNXI_FUNCTION(0x0, "gpio_in"),
  40. SUNXI_FUNCTION(0x1, "gpio_out"),
  41. SUNXI_FUNCTION(0x2, "gmac"), /* TXD3 */
  42. SUNXI_FUNCTION(0x4, "uart1"), /* RING */
  43. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 3)), /* PA_EINT3 */
  44. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 4),
  45. SUNXI_FUNCTION(0x0, "gpio_in"),
  46. SUNXI_FUNCTION(0x1, "gpio_out"),
  47. SUNXI_FUNCTION(0x2, "gmac"), /* TXD4 */
  48. SUNXI_FUNCTION(0x4, "uart1"), /* TX */
  49. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 4)), /* PA_EINT4 */
  50. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 5),
  51. SUNXI_FUNCTION(0x0, "gpio_in"),
  52. SUNXI_FUNCTION(0x1, "gpio_out"),
  53. SUNXI_FUNCTION(0x2, "gmac"), /* TXD5 */
  54. SUNXI_FUNCTION(0x4, "uart1"), /* RX */
  55. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 5)), /* PA_EINT5 */
  56. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 6),
  57. SUNXI_FUNCTION(0x0, "gpio_in"),
  58. SUNXI_FUNCTION(0x1, "gpio_out"),
  59. SUNXI_FUNCTION(0x2, "gmac"), /* TXD6 */
  60. SUNXI_FUNCTION(0x4, "uart1"), /* RTS */
  61. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 6)), /* PA_EINT6 */
  62. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 7),
  63. SUNXI_FUNCTION(0x0, "gpio_in"),
  64. SUNXI_FUNCTION(0x1, "gpio_out"),
  65. SUNXI_FUNCTION(0x2, "gmac"), /* TXD7 */
  66. SUNXI_FUNCTION(0x4, "uart1"), /* CTS */
  67. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 7)), /* PA_EINT7 */
  68. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 8),
  69. SUNXI_FUNCTION(0x0, "gpio_in"),
  70. SUNXI_FUNCTION(0x1, "gpio_out"),
  71. SUNXI_FUNCTION(0x2, "gmac"), /* TXCLK */
  72. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 8)), /* PA_EINT8 */
  73. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 9),
  74. SUNXI_FUNCTION(0x0, "gpio_in"),
  75. SUNXI_FUNCTION(0x1, "gpio_out"),
  76. SUNXI_FUNCTION(0x2, "gmac"), /* TXEN */
  77. SUNXI_FUNCTION(0x4, "mmc3"), /* CMD */
  78. SUNXI_FUNCTION(0x5, "mmc2"), /* CMD */
  79. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 9)), /* PA_EINT9 */
  80. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 10),
  81. SUNXI_FUNCTION(0x0, "gpio_in"),
  82. SUNXI_FUNCTION(0x1, "gpio_out"),
  83. SUNXI_FUNCTION(0x2, "gmac"), /* GTXCLK */
  84. SUNXI_FUNCTION(0x4, "mmc3"), /* CLK */
  85. SUNXI_FUNCTION(0x5, "mmc2"), /* CLK */
  86. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 10)), /* PA_EINT10 */
  87. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 11),
  88. SUNXI_FUNCTION(0x0, "gpio_in"),
  89. SUNXI_FUNCTION(0x1, "gpio_out"),
  90. SUNXI_FUNCTION(0x2, "gmac"), /* RXD0 */
  91. SUNXI_FUNCTION(0x4, "mmc3"), /* D0 */
  92. SUNXI_FUNCTION(0x5, "mmc2"), /* D0 */
  93. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 11)), /* PA_EINT11 */
  94. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 12),
  95. SUNXI_FUNCTION(0x0, "gpio_in"),
  96. SUNXI_FUNCTION(0x1, "gpio_out"),
  97. SUNXI_FUNCTION(0x2, "gmac"), /* RXD1 */
  98. SUNXI_FUNCTION(0x4, "mmc3"), /* D1 */
  99. SUNXI_FUNCTION(0x5, "mmc2"), /* D1 */
  100. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 12)), /* PA_EINT12 */
  101. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 13),
  102. SUNXI_FUNCTION(0x0, "gpio_in"),
  103. SUNXI_FUNCTION(0x1, "gpio_out"),
  104. SUNXI_FUNCTION(0x2, "gmac"), /* RXD2 */
  105. SUNXI_FUNCTION(0x4, "mmc3"), /* D2 */
  106. SUNXI_FUNCTION(0x5, "mmc2"), /* D2 */
  107. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 13)), /* PA_EINT13 */
  108. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 14),
  109. SUNXI_FUNCTION(0x0, "gpio_in"),
  110. SUNXI_FUNCTION(0x1, "gpio_out"),
  111. SUNXI_FUNCTION(0x2, "gmac"), /* RXD3 */
  112. SUNXI_FUNCTION(0x4, "mmc3"), /* D3 */
  113. SUNXI_FUNCTION(0x5, "mmc2"), /* D3 */
  114. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 14)), /* PA_EINT14 */
  115. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 15),
  116. SUNXI_FUNCTION(0x0, "gpio_in"),
  117. SUNXI_FUNCTION(0x1, "gpio_out"),
  118. SUNXI_FUNCTION(0x2, "gmac"), /* RXD4 */
  119. SUNXI_FUNCTION(0x4, "clk_out_a"),
  120. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 15)), /* PA_EINT15 */
  121. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 16),
  122. SUNXI_FUNCTION(0x0, "gpio_in"),
  123. SUNXI_FUNCTION(0x1, "gpio_out"),
  124. SUNXI_FUNCTION(0x2, "gmac"), /* RXD5 */
  125. SUNXI_FUNCTION(0x4, "dmic"), /* CLK */
  126. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 16)), /* PA_EINT16 */
  127. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 17),
  128. SUNXI_FUNCTION(0x0, "gpio_in"),
  129. SUNXI_FUNCTION(0x1, "gpio_out"),
  130. SUNXI_FUNCTION(0x2, "gmac"), /* RXD6 */
  131. SUNXI_FUNCTION(0x4, "dmic"), /* DIN */
  132. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 17)), /* PA_EINT17 */
  133. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 18),
  134. SUNXI_FUNCTION(0x0, "gpio_in"),
  135. SUNXI_FUNCTION(0x1, "gpio_out"),
  136. SUNXI_FUNCTION(0x2, "gmac"), /* RXD7 */
  137. SUNXI_FUNCTION(0x4, "clk_out_b"),
  138. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 18)), /* PA_EINT18 */
  139. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 19),
  140. SUNXI_FUNCTION(0x0, "gpio_in"),
  141. SUNXI_FUNCTION(0x1, "gpio_out"),
  142. SUNXI_FUNCTION(0x2, "gmac"), /* RXDV */
  143. SUNXI_FUNCTION(0x4, "pwm3"), /* Positive */
  144. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 19)), /* PA_EINT19 */
  145. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 20),
  146. SUNXI_FUNCTION(0x0, "gpio_in"),
  147. SUNXI_FUNCTION(0x1, "gpio_out"),
  148. SUNXI_FUNCTION(0x2, "gmac"), /* RXCLK */
  149. SUNXI_FUNCTION(0x4, "pwm3"), /* Negative */
  150. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 20)), /* PA_EINT20 */
  151. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 21),
  152. SUNXI_FUNCTION(0x0, "gpio_in"),
  153. SUNXI_FUNCTION(0x1, "gpio_out"),
  154. SUNXI_FUNCTION(0x2, "gmac"), /* TXERR */
  155. SUNXI_FUNCTION(0x4, "spi3"), /* CS0 */
  156. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 21)), /* PA_EINT21 */
  157. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 22),
  158. SUNXI_FUNCTION(0x0, "gpio_in"),
  159. SUNXI_FUNCTION(0x1, "gpio_out"),
  160. SUNXI_FUNCTION(0x2, "gmac"), /* RXERR */
  161. SUNXI_FUNCTION(0x4, "spi3"), /* CLK */
  162. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 22)), /* PA_EINT22 */
  163. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 23),
  164. SUNXI_FUNCTION(0x0, "gpio_in"),
  165. SUNXI_FUNCTION(0x1, "gpio_out"),
  166. SUNXI_FUNCTION(0x2, "gmac"), /* COL */
  167. SUNXI_FUNCTION(0x4, "spi3"), /* MOSI */
  168. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 23)), /* PA_EINT23 */
  169. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 24),
  170. SUNXI_FUNCTION(0x0, "gpio_in"),
  171. SUNXI_FUNCTION(0x1, "gpio_out"),
  172. SUNXI_FUNCTION(0x2, "gmac"), /* CRS */
  173. SUNXI_FUNCTION(0x4, "spi3"), /* MISO */
  174. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 24)), /* PA_EINT24 */
  175. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 25),
  176. SUNXI_FUNCTION(0x0, "gpio_in"),
  177. SUNXI_FUNCTION(0x1, "gpio_out"),
  178. SUNXI_FUNCTION(0x2, "gmac"), /* CLKIN */
  179. SUNXI_FUNCTION(0x4, "spi3"), /* CS1 */
  180. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 25)), /* PA_EINT25 */
  181. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 26),
  182. SUNXI_FUNCTION(0x0, "gpio_in"),
  183. SUNXI_FUNCTION(0x1, "gpio_out"),
  184. SUNXI_FUNCTION(0x2, "gmac"), /* MDC */
  185. SUNXI_FUNCTION(0x4, "clk_out_c"),
  186. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 26)), /* PA_EINT26 */
  187. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 27),
  188. SUNXI_FUNCTION(0x0, "gpio_in"),
  189. SUNXI_FUNCTION(0x1, "gpio_out"),
  190. SUNXI_FUNCTION(0x2, "gmac"), /* MDIO */
  191. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 27)), /* PA_EINT27 */
  192. /* Hole */
  193. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 0),
  194. SUNXI_FUNCTION(0x0, "gpio_in"),
  195. SUNXI_FUNCTION(0x1, "gpio_out"),
  196. SUNXI_FUNCTION(0x2, "i2s0"), /* MCLK */
  197. SUNXI_FUNCTION(0x3, "uart3"), /* CTS */
  198. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 0)), /* PB_EINT0 */
  199. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 1),
  200. SUNXI_FUNCTION(0x0, "gpio_in"),
  201. SUNXI_FUNCTION(0x1, "gpio_out"),
  202. SUNXI_FUNCTION(0x2, "i2s0"), /* BCLK */
  203. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 1)), /* PB_EINT1 */
  204. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 2),
  205. SUNXI_FUNCTION(0x0, "gpio_in"),
  206. SUNXI_FUNCTION(0x1, "gpio_out"),
  207. SUNXI_FUNCTION(0x2, "i2s0"), /* LRCK */
  208. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 2)), /* PB_EINT2 */
  209. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 3),
  210. SUNXI_FUNCTION(0x0, "gpio_in"),
  211. SUNXI_FUNCTION(0x1, "gpio_out"),
  212. SUNXI_FUNCTION(0x2, "i2s0"), /* DO0 */
  213. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 3)), /* PB_EINT3 */
  214. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 4),
  215. SUNXI_FUNCTION(0x0, "gpio_in"),
  216. SUNXI_FUNCTION(0x1, "gpio_out"),
  217. SUNXI_FUNCTION(0x2, "i2s0"), /* DO1 */
  218. SUNXI_FUNCTION(0x3, "uart3"), /* RTS */
  219. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 4)), /* PB_EINT4 */
  220. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 5),
  221. SUNXI_FUNCTION(0x0, "gpio_in"),
  222. SUNXI_FUNCTION(0x1, "gpio_out"),
  223. SUNXI_FUNCTION(0x2, "i2s0"), /* DO2 */
  224. SUNXI_FUNCTION(0x3, "uart3"), /* TX */
  225. SUNXI_FUNCTION(0x4, "i2c3"), /* SCK */
  226. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 5)), /* PB_EINT5 */
  227. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 6),
  228. SUNXI_FUNCTION(0x0, "gpio_in"),
  229. SUNXI_FUNCTION(0x1, "gpio_out"),
  230. SUNXI_FUNCTION(0x2, "i2s0"), /* DO3 */
  231. SUNXI_FUNCTION(0x3, "uart3"), /* RX */
  232. SUNXI_FUNCTION(0x4, "i2c3"), /* SDA */
  233. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 6)), /* PB_EINT6 */
  234. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 7),
  235. SUNXI_FUNCTION(0x0, "gpio_in"),
  236. SUNXI_FUNCTION(0x1, "gpio_out"),
  237. SUNXI_FUNCTION(0x3, "i2s0"), /* DI */
  238. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 7)), /* PB_EINT7 */
  239. /* Hole */
  240. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0),
  241. SUNXI_FUNCTION(0x0, "gpio_in"),
  242. SUNXI_FUNCTION(0x1, "gpio_out"),
  243. SUNXI_FUNCTION(0x2, "nand0"), /* WE */
  244. SUNXI_FUNCTION(0x3, "spi0")), /* MOSI */
  245. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1),
  246. SUNXI_FUNCTION(0x0, "gpio_in"),
  247. SUNXI_FUNCTION(0x1, "gpio_out"),
  248. SUNXI_FUNCTION(0x2, "nand0"), /* ALE */
  249. SUNXI_FUNCTION(0x3, "spi0")), /* MISO */
  250. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2),
  251. SUNXI_FUNCTION(0x0, "gpio_in"),
  252. SUNXI_FUNCTION(0x1, "gpio_out"),
  253. SUNXI_FUNCTION(0x2, "nand0"), /* CLE */
  254. SUNXI_FUNCTION(0x3, "spi0")), /* CLK */
  255. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3),
  256. SUNXI_FUNCTION(0x0, "gpio_in"),
  257. SUNXI_FUNCTION(0x1, "gpio_out"),
  258. SUNXI_FUNCTION(0x2, "nand0")), /* CE1 */
  259. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 4),
  260. SUNXI_FUNCTION(0x0, "gpio_in"),
  261. SUNXI_FUNCTION(0x1, "gpio_out"),
  262. SUNXI_FUNCTION(0x2, "nand0")), /* CE0 */
  263. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 5),
  264. SUNXI_FUNCTION(0x0, "gpio_in"),
  265. SUNXI_FUNCTION(0x1, "gpio_out"),
  266. SUNXI_FUNCTION(0x2, "nand0")), /* RE */
  267. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 6),
  268. SUNXI_FUNCTION(0x0, "gpio_in"),
  269. SUNXI_FUNCTION(0x1, "gpio_out"),
  270. SUNXI_FUNCTION(0x2, "nand0"), /* RB0 */
  271. SUNXI_FUNCTION(0x3, "mmc2"), /* CMD */
  272. SUNXI_FUNCTION(0x4, "mmc3")), /* CMD */
  273. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 7),
  274. SUNXI_FUNCTION(0x0, "gpio_in"),
  275. SUNXI_FUNCTION(0x1, "gpio_out"),
  276. SUNXI_FUNCTION(0x2, "nand0"), /* RB1 */
  277. SUNXI_FUNCTION(0x3, "mmc2"), /* CLK */
  278. SUNXI_FUNCTION(0x4, "mmc3")), /* CLK */
  279. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 8),
  280. SUNXI_FUNCTION(0x0, "gpio_in"),
  281. SUNXI_FUNCTION(0x1, "gpio_out"),
  282. SUNXI_FUNCTION(0x2, "nand0"), /* DQ0 */
  283. SUNXI_FUNCTION(0x3, "mmc2"), /* D0 */
  284. SUNXI_FUNCTION(0x4, "mmc3")), /* D0 */
  285. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 9),
  286. SUNXI_FUNCTION(0x0, "gpio_in"),
  287. SUNXI_FUNCTION(0x1, "gpio_out"),
  288. SUNXI_FUNCTION(0x2, "nand0"), /* DQ1 */
  289. SUNXI_FUNCTION(0x3, "mmc2"), /* D1 */
  290. SUNXI_FUNCTION(0x4, "mmc3")), /* D1 */
  291. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 10),
  292. SUNXI_FUNCTION(0x0, "gpio_in"),
  293. SUNXI_FUNCTION(0x1, "gpio_out"),
  294. SUNXI_FUNCTION(0x2, "nand0"), /* DQ2 */
  295. SUNXI_FUNCTION(0x3, "mmc2"), /* D2 */
  296. SUNXI_FUNCTION(0x4, "mmc3")), /* D2 */
  297. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 11),
  298. SUNXI_FUNCTION(0x0, "gpio_in"),
  299. SUNXI_FUNCTION(0x1, "gpio_out"),
  300. SUNXI_FUNCTION(0x2, "nand0"), /* DQ3 */
  301. SUNXI_FUNCTION(0x3, "mmc2"), /* D3 */
  302. SUNXI_FUNCTION(0x4, "mmc3")), /* D3 */
  303. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 12),
  304. SUNXI_FUNCTION(0x0, "gpio_in"),
  305. SUNXI_FUNCTION(0x1, "gpio_out"),
  306. SUNXI_FUNCTION(0x2, "nand0"), /* DQ4 */
  307. SUNXI_FUNCTION(0x3, "mmc2"), /* D4 */
  308. SUNXI_FUNCTION(0x4, "mmc3")), /* D4 */
  309. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 13),
  310. SUNXI_FUNCTION(0x0, "gpio_in"),
  311. SUNXI_FUNCTION(0x1, "gpio_out"),
  312. SUNXI_FUNCTION(0x2, "nand0"), /* DQ5 */
  313. SUNXI_FUNCTION(0x3, "mmc2"), /* D5 */
  314. SUNXI_FUNCTION(0x4, "mmc3")), /* D5 */
  315. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 14),
  316. SUNXI_FUNCTION(0x0, "gpio_in"),
  317. SUNXI_FUNCTION(0x1, "gpio_out"),
  318. SUNXI_FUNCTION(0x2, "nand0"), /* DQ6 */
  319. SUNXI_FUNCTION(0x3, "mmc2"), /* D6 */
  320. SUNXI_FUNCTION(0x4, "mmc3")), /* D6 */
  321. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 15),
  322. SUNXI_FUNCTION(0x0, "gpio_in"),
  323. SUNXI_FUNCTION(0x1, "gpio_out"),
  324. SUNXI_FUNCTION(0x2, "nand0"), /* DQ7 */
  325. SUNXI_FUNCTION(0x3, "mmc2"), /* D7 */
  326. SUNXI_FUNCTION(0x4, "mmc3")), /* D7 */
  327. /* Hole in pin numbering ! */
  328. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 24),
  329. SUNXI_FUNCTION(0x0, "gpio_in"),
  330. SUNXI_FUNCTION(0x1, "gpio_out"),
  331. SUNXI_FUNCTION(0x2, "nand0"), /* DQS */
  332. SUNXI_FUNCTION(0x3, "mmc2"), /* RST */
  333. SUNXI_FUNCTION(0x4, "mmc3")), /* RST */
  334. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 25),
  335. SUNXI_FUNCTION(0x0, "gpio_in"),
  336. SUNXI_FUNCTION(0x1, "gpio_out"),
  337. SUNXI_FUNCTION(0x2, "nand0")), /* CE2 */
  338. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 26),
  339. SUNXI_FUNCTION(0x0, "gpio_in"),
  340. SUNXI_FUNCTION(0x1, "gpio_out"),
  341. SUNXI_FUNCTION(0x2, "nand0")), /* CE3 */
  342. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 27),
  343. SUNXI_FUNCTION(0x0, "gpio_in"),
  344. SUNXI_FUNCTION(0x1, "gpio_out"),
  345. SUNXI_FUNCTION(0x3, "spi0")), /* CS0 */
  346. /* Hole */
  347. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 0),
  348. SUNXI_FUNCTION(0x0, "gpio_in"),
  349. SUNXI_FUNCTION(0x1, "gpio_out"),
  350. SUNXI_FUNCTION(0x2, "lcd0"), /* D0 */
  351. SUNXI_FUNCTION(0x3, "lvds0")), /* VP0 */
  352. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 1),
  353. SUNXI_FUNCTION(0x0, "gpio_in"),
  354. SUNXI_FUNCTION(0x1, "gpio_out"),
  355. SUNXI_FUNCTION(0x2, "lcd0"), /* D1 */
  356. SUNXI_FUNCTION(0x3, "lvds0")), /* VN0 */
  357. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 2),
  358. SUNXI_FUNCTION(0x0, "gpio_in"),
  359. SUNXI_FUNCTION(0x1, "gpio_out"),
  360. SUNXI_FUNCTION(0x2, "lcd0"), /* D2 */
  361. SUNXI_FUNCTION(0x3, "lvds0")), /* VP1 */
  362. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 3),
  363. SUNXI_FUNCTION(0x0, "gpio_in"),
  364. SUNXI_FUNCTION(0x1, "gpio_out"),
  365. SUNXI_FUNCTION(0x2, "lcd0"), /* D3 */
  366. SUNXI_FUNCTION(0x3, "lvds0")), /* VN1 */
  367. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 4),
  368. SUNXI_FUNCTION(0x0, "gpio_in"),
  369. SUNXI_FUNCTION(0x1, "gpio_out"),
  370. SUNXI_FUNCTION(0x2, "lcd0"), /* D4 */
  371. SUNXI_FUNCTION(0x3, "lvds0")), /* VP2 */
  372. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 5),
  373. SUNXI_FUNCTION(0x0, "gpio_in"),
  374. SUNXI_FUNCTION(0x1, "gpio_out"),
  375. SUNXI_FUNCTION(0x2, "lcd0"), /* D5 */
  376. SUNXI_FUNCTION(0x3, "lvds0")), /* VN2 */
  377. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 6),
  378. SUNXI_FUNCTION(0x0, "gpio_in"),
  379. SUNXI_FUNCTION(0x1, "gpio_out"),
  380. SUNXI_FUNCTION(0x2, "lcd0"), /* D6 */
  381. SUNXI_FUNCTION(0x3, "lvds0")), /* VPC */
  382. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 7),
  383. SUNXI_FUNCTION(0x0, "gpio_in"),
  384. SUNXI_FUNCTION(0x1, "gpio_out"),
  385. SUNXI_FUNCTION(0x2, "lcd0"), /* D7 */
  386. SUNXI_FUNCTION(0x3, "lvds0")), /* VNC */
  387. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 8),
  388. SUNXI_FUNCTION(0x0, "gpio_in"),
  389. SUNXI_FUNCTION(0x1, "gpio_out"),
  390. SUNXI_FUNCTION(0x2, "lcd0"), /* D8 */
  391. SUNXI_FUNCTION(0x3, "lvds0")), /* VP3 */
  392. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 9),
  393. SUNXI_FUNCTION(0x0, "gpio_in"),
  394. SUNXI_FUNCTION(0x1, "gpio_out"),
  395. SUNXI_FUNCTION(0x2, "lcd0"), /* D9 */
  396. SUNXI_FUNCTION(0x3, "lvds0")), /* VN3 */
  397. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 10),
  398. SUNXI_FUNCTION(0x0, "gpio_in"),
  399. SUNXI_FUNCTION(0x1, "gpio_out"),
  400. SUNXI_FUNCTION(0x2, "lcd0")), /* D10 */
  401. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 11),
  402. SUNXI_FUNCTION(0x0, "gpio_in"),
  403. SUNXI_FUNCTION(0x1, "gpio_out"),
  404. SUNXI_FUNCTION(0x2, "lcd0")), /* D11 */
  405. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 12),
  406. SUNXI_FUNCTION(0x0, "gpio_in"),
  407. SUNXI_FUNCTION(0x1, "gpio_out"),
  408. SUNXI_FUNCTION(0x2, "lcd0")), /* D12 */
  409. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 13),
  410. SUNXI_FUNCTION(0x0, "gpio_in"),
  411. SUNXI_FUNCTION(0x1, "gpio_out"),
  412. SUNXI_FUNCTION(0x2, "lcd0")), /* D13 */
  413. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 14),
  414. SUNXI_FUNCTION(0x0, "gpio_in"),
  415. SUNXI_FUNCTION(0x1, "gpio_out"),
  416. SUNXI_FUNCTION(0x2, "lcd0")), /* D14 */
  417. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 15),
  418. SUNXI_FUNCTION(0x0, "gpio_in"),
  419. SUNXI_FUNCTION(0x1, "gpio_out"),
  420. SUNXI_FUNCTION(0x2, "lcd0")), /* D15 */
  421. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 16),
  422. SUNXI_FUNCTION(0x0, "gpio_in"),
  423. SUNXI_FUNCTION(0x1, "gpio_out"),
  424. SUNXI_FUNCTION(0x2, "lcd0")), /* D16 */
  425. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 17),
  426. SUNXI_FUNCTION(0x0, "gpio_in"),
  427. SUNXI_FUNCTION(0x1, "gpio_out"),
  428. SUNXI_FUNCTION(0x2, "lcd0")), /* D17 */
  429. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 18),
  430. SUNXI_FUNCTION(0x0, "gpio_in"),
  431. SUNXI_FUNCTION(0x1, "gpio_out"),
  432. SUNXI_FUNCTION(0x2, "lcd0")), /* D18 */
  433. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 19),
  434. SUNXI_FUNCTION(0x0, "gpio_in"),
  435. SUNXI_FUNCTION(0x1, "gpio_out"),
  436. SUNXI_FUNCTION(0x2, "lcd0")), /* D19 */
  437. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 20),
  438. SUNXI_FUNCTION(0x0, "gpio_in"),
  439. SUNXI_FUNCTION(0x1, "gpio_out"),
  440. SUNXI_FUNCTION(0x2, "lcd0")), /* D20 */
  441. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 21),
  442. SUNXI_FUNCTION(0x0, "gpio_in"),
  443. SUNXI_FUNCTION(0x1, "gpio_out"),
  444. SUNXI_FUNCTION(0x2, "lcd0")), /* D21 */
  445. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 22),
  446. SUNXI_FUNCTION(0x0, "gpio_in"),
  447. SUNXI_FUNCTION(0x1, "gpio_out"),
  448. SUNXI_FUNCTION(0x2, "lcd0")), /* D22 */
  449. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 23),
  450. SUNXI_FUNCTION(0x0, "gpio_in"),
  451. SUNXI_FUNCTION(0x1, "gpio_out"),
  452. SUNXI_FUNCTION(0x2, "lcd0")), /* D23 */
  453. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 24),
  454. SUNXI_FUNCTION(0x0, "gpio_in"),
  455. SUNXI_FUNCTION(0x1, "gpio_out"),
  456. SUNXI_FUNCTION(0x2, "lcd0")), /* CLK */
  457. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 25),
  458. SUNXI_FUNCTION(0x0, "gpio_in"),
  459. SUNXI_FUNCTION(0x1, "gpio_out"),
  460. SUNXI_FUNCTION(0x2, "lcd0")), /* DE */
  461. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 26),
  462. SUNXI_FUNCTION(0x0, "gpio_in"),
  463. SUNXI_FUNCTION(0x1, "gpio_out"),
  464. SUNXI_FUNCTION(0x2, "lcd0")), /* HSYNC */
  465. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 27),
  466. SUNXI_FUNCTION(0x0, "gpio_in"),
  467. SUNXI_FUNCTION(0x1, "gpio_out"),
  468. SUNXI_FUNCTION(0x2, "lcd0")), /* VSYNC */
  469. /* Hole */
  470. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 0),
  471. SUNXI_FUNCTION(0x0, "gpio_in"),
  472. SUNXI_FUNCTION(0x1, "gpio_out"),
  473. SUNXI_FUNCTION(0x2, "csi"), /* PCLK */
  474. SUNXI_FUNCTION(0x3, "ts"), /* CLK */
  475. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 0)), /* PE_EINT0 */
  476. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 1),
  477. SUNXI_FUNCTION(0x0, "gpio_in"),
  478. SUNXI_FUNCTION(0x1, "gpio_out"),
  479. SUNXI_FUNCTION(0x2, "csi"), /* MCLK */
  480. SUNXI_FUNCTION(0x3, "ts"), /* ERR */
  481. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 1)), /* PE_EINT1 */
  482. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 2),
  483. SUNXI_FUNCTION(0x0, "gpio_in"),
  484. SUNXI_FUNCTION(0x1, "gpio_out"),
  485. SUNXI_FUNCTION(0x2, "csi"), /* HSYNC */
  486. SUNXI_FUNCTION(0x3, "ts"), /* SYNC */
  487. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 2)), /* PE_EINT2 */
  488. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 3),
  489. SUNXI_FUNCTION(0x0, "gpio_in"),
  490. SUNXI_FUNCTION(0x1, "gpio_out"),
  491. SUNXI_FUNCTION(0x2, "csi"), /* VSYNC */
  492. SUNXI_FUNCTION(0x3, "ts"), /* DVLD */
  493. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 3)), /* PE_EINT3 */
  494. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 4),
  495. SUNXI_FUNCTION(0x0, "gpio_in"),
  496. SUNXI_FUNCTION(0x1, "gpio_out"),
  497. SUNXI_FUNCTION(0x2, "csi"), /* D0 */
  498. SUNXI_FUNCTION(0x3, "uart5"), /* TX */
  499. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 4)), /* PE_EINT4 */
  500. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 5),
  501. SUNXI_FUNCTION(0x0, "gpio_in"),
  502. SUNXI_FUNCTION(0x1, "gpio_out"),
  503. SUNXI_FUNCTION(0x2, "csi"), /* D1 */
  504. SUNXI_FUNCTION(0x3, "uart5"), /* RX */
  505. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 5)), /* PE_EINT5 */
  506. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 6),
  507. SUNXI_FUNCTION(0x0, "gpio_in"),
  508. SUNXI_FUNCTION(0x1, "gpio_out"),
  509. SUNXI_FUNCTION(0x2, "csi"), /* D2 */
  510. SUNXI_FUNCTION(0x3, "uart5"), /* RTS */
  511. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 6)), /* PE_EINT6 */
  512. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 7),
  513. SUNXI_FUNCTION(0x0, "gpio_in"),
  514. SUNXI_FUNCTION(0x1, "gpio_out"),
  515. SUNXI_FUNCTION(0x2, "csi"), /* D3 */
  516. SUNXI_FUNCTION(0x3, "uart5"), /* CTS */
  517. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 7)), /* PE_EINT7 */
  518. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 8),
  519. SUNXI_FUNCTION(0x0, "gpio_in"),
  520. SUNXI_FUNCTION(0x1, "gpio_out"),
  521. SUNXI_FUNCTION(0x2, "csi"), /* D4 */
  522. SUNXI_FUNCTION(0x3, "ts"), /* D0 */
  523. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 8)), /* PE_EINT8 */
  524. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 9),
  525. SUNXI_FUNCTION(0x0, "gpio_in"),
  526. SUNXI_FUNCTION(0x1, "gpio_out"),
  527. SUNXI_FUNCTION(0x2, "csi"), /* D5 */
  528. SUNXI_FUNCTION(0x3, "ts"), /* D1 */
  529. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 9)), /* PE_EINT9 */
  530. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 10),
  531. SUNXI_FUNCTION(0x0, "gpio_in"),
  532. SUNXI_FUNCTION(0x1, "gpio_out"),
  533. SUNXI_FUNCTION(0x2, "csi"), /* D6 */
  534. SUNXI_FUNCTION(0x3, "ts"), /* D2 */
  535. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 10)), /* PE_EINT10 */
  536. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 11),
  537. SUNXI_FUNCTION(0x0, "gpio_in"),
  538. SUNXI_FUNCTION(0x1, "gpio_out"),
  539. SUNXI_FUNCTION(0x2, "csi"), /* D7 */
  540. SUNXI_FUNCTION(0x3, "ts"), /* D3 */
  541. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 11)), /* PE_EINT11 */
  542. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 12),
  543. SUNXI_FUNCTION(0x0, "gpio_in"),
  544. SUNXI_FUNCTION(0x1, "gpio_out"),
  545. SUNXI_FUNCTION(0x2, "csi"), /* D8 */
  546. SUNXI_FUNCTION(0x3, "ts"), /* D4 */
  547. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 12)), /* PE_EINT12 */
  548. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 13),
  549. SUNXI_FUNCTION(0x0, "gpio_in"),
  550. SUNXI_FUNCTION(0x1, "gpio_out"),
  551. SUNXI_FUNCTION(0x2, "csi"), /* D9 */
  552. SUNXI_FUNCTION(0x3, "ts"), /* D5 */
  553. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 13)), /* PE_EINT13 */
  554. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 14),
  555. SUNXI_FUNCTION(0x0, "gpio_in"),
  556. SUNXI_FUNCTION(0x1, "gpio_out"),
  557. SUNXI_FUNCTION(0x2, "csi"), /* D10 */
  558. SUNXI_FUNCTION(0x3, "ts"), /* D6 */
  559. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 14)), /* PE_EINT14 */
  560. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 15),
  561. SUNXI_FUNCTION(0x0, "gpio_in"),
  562. SUNXI_FUNCTION(0x1, "gpio_out"),
  563. SUNXI_FUNCTION(0x2, "csi"), /* D11 */
  564. SUNXI_FUNCTION(0x3, "ts"), /* D7 */
  565. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 15)), /* PE_EINT15 */
  566. /* Hole */
  567. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0),
  568. SUNXI_FUNCTION(0x0, "gpio_in"),
  569. SUNXI_FUNCTION(0x1, "gpio_out"),
  570. SUNXI_FUNCTION(0x2, "mmc0"), /* D1 */
  571. SUNXI_FUNCTION(0x4, "jtag")), /* MS1 */
  572. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1),
  573. SUNXI_FUNCTION(0x0, "gpio_in"),
  574. SUNXI_FUNCTION(0x1, "gpio_out"),
  575. SUNXI_FUNCTION(0x2, "mmc0"), /* D0 */
  576. SUNXI_FUNCTION(0x4, "jtag")), /* DI1 */
  577. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2),
  578. SUNXI_FUNCTION(0x0, "gpio_in"),
  579. SUNXI_FUNCTION(0x1, "gpio_out"),
  580. SUNXI_FUNCTION(0x2, "mmc0"), /* CLK */
  581. SUNXI_FUNCTION(0x4, "uart0")), /* TX */
  582. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3),
  583. SUNXI_FUNCTION(0x0, "gpio_in"),
  584. SUNXI_FUNCTION(0x1, "gpio_out"),
  585. SUNXI_FUNCTION(0x2, "mmc0"), /* CMD */
  586. SUNXI_FUNCTION(0x4, "jtag")), /* DO1 */
  587. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4),
  588. SUNXI_FUNCTION(0x0, "gpio_in"),
  589. SUNXI_FUNCTION(0x1, "gpio_out"),
  590. SUNXI_FUNCTION(0x2, "mmc0"), /* D3 */
  591. SUNXI_FUNCTION(0x4, "uart0")), /* RX */
  592. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5),
  593. SUNXI_FUNCTION(0x0, "gpio_in"),
  594. SUNXI_FUNCTION(0x1, "gpio_out"),
  595. SUNXI_FUNCTION(0x2, "mmc0"), /* D2 */
  596. SUNXI_FUNCTION(0x4, "jtag")), /* CK1 */
  597. /* Hole */
  598. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0),
  599. SUNXI_FUNCTION(0x0, "gpio_in"),
  600. SUNXI_FUNCTION(0x1, "gpio_out"),
  601. SUNXI_FUNCTION(0x2, "mmc1"), /* CLK */
  602. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 0)), /* PG_EINT0 */
  603. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1),
  604. SUNXI_FUNCTION(0x0, "gpio_in"),
  605. SUNXI_FUNCTION(0x1, "gpio_out"),
  606. SUNXI_FUNCTION(0x2, "mmc1"), /* CMD */
  607. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 1)), /* PG_EINT1 */
  608. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2),
  609. SUNXI_FUNCTION(0x0, "gpio_in"),
  610. SUNXI_FUNCTION(0x1, "gpio_out"),
  611. SUNXI_FUNCTION(0x2, "mmc1"), /* D0 */
  612. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 2)), /* PG_EINT2 */
  613. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3),
  614. SUNXI_FUNCTION(0x0, "gpio_in"),
  615. SUNXI_FUNCTION(0x1, "gpio_out"),
  616. SUNXI_FUNCTION(0x2, "mmc1"), /* D1 */
  617. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 3)), /* PG_EINT3 */
  618. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4),
  619. SUNXI_FUNCTION(0x0, "gpio_in"),
  620. SUNXI_FUNCTION(0x1, "gpio_out"),
  621. SUNXI_FUNCTION(0x2, "mmc1"), /* D2 */
  622. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 4)), /* PG_EINT4 */
  623. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 5),
  624. SUNXI_FUNCTION(0x0, "gpio_in"),
  625. SUNXI_FUNCTION(0x1, "gpio_out"),
  626. SUNXI_FUNCTION(0x2, "mmc1"), /* D3 */
  627. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 5)), /* PG_EINT5 */
  628. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 6),
  629. SUNXI_FUNCTION(0x0, "gpio_in"),
  630. SUNXI_FUNCTION(0x1, "gpio_out"),
  631. SUNXI_FUNCTION(0x2, "uart2"), /* TX */
  632. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 6)), /* PG_EINT6 */
  633. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 7),
  634. SUNXI_FUNCTION(0x0, "gpio_in"),
  635. SUNXI_FUNCTION(0x1, "gpio_out"),
  636. SUNXI_FUNCTION(0x2, "uart2"), /* RX */
  637. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 7)), /* PG_EINT7 */
  638. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 8),
  639. SUNXI_FUNCTION(0x0, "gpio_in"),
  640. SUNXI_FUNCTION(0x1, "gpio_out"),
  641. SUNXI_FUNCTION(0x2, "uart2"), /* RTS */
  642. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 8)), /* PG_EINT8 */
  643. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 9),
  644. SUNXI_FUNCTION(0x0, "gpio_in"),
  645. SUNXI_FUNCTION(0x1, "gpio_out"),
  646. SUNXI_FUNCTION(0x2, "uart2"), /* CTS */
  647. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 9)), /* PG_EINT9 */
  648. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10),
  649. SUNXI_FUNCTION(0x0, "gpio_in"),
  650. SUNXI_FUNCTION(0x1, "gpio_out"),
  651. SUNXI_FUNCTION(0x2, "i2c3"), /* SCK */
  652. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 10)), /* PG_EINT10 */
  653. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 11),
  654. SUNXI_FUNCTION(0x0, "gpio_in"),
  655. SUNXI_FUNCTION(0x1, "gpio_out"),
  656. SUNXI_FUNCTION(0x2, "i2c3"), /* SDA */
  657. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 11)), /* PG_EINT11 */
  658. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 12),
  659. SUNXI_FUNCTION(0x0, "gpio_in"),
  660. SUNXI_FUNCTION(0x1, "gpio_out"),
  661. SUNXI_FUNCTION(0x2, "spi1"), /* CS1 */
  662. SUNXI_FUNCTION(0x3, "i2s1"), /* MCLK */
  663. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 12)), /* PG_EINT12 */
  664. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 13),
  665. SUNXI_FUNCTION(0x0, "gpio_in"),
  666. SUNXI_FUNCTION(0x1, "gpio_out"),
  667. SUNXI_FUNCTION(0x2, "spi1"), /* CS0 */
  668. SUNXI_FUNCTION(0x3, "i2s1"), /* BCLK */
  669. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 13)), /* PG_EINT13 */
  670. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 14),
  671. SUNXI_FUNCTION(0x0, "gpio_in"),
  672. SUNXI_FUNCTION(0x1, "gpio_out"),
  673. SUNXI_FUNCTION(0x2, "spi1"), /* CLK */
  674. SUNXI_FUNCTION(0x3, "i2s1"), /* LRCK */
  675. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 14)), /* PG_EINT14 */
  676. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 15),
  677. SUNXI_FUNCTION(0x0, "gpio_in"),
  678. SUNXI_FUNCTION(0x1, "gpio_out"),
  679. SUNXI_FUNCTION(0x2, "spi1"), /* MOSI */
  680. SUNXI_FUNCTION(0x3, "i2s1"), /* DIN */
  681. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 15)), /* PG_EINT15 */
  682. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 16),
  683. SUNXI_FUNCTION(0x0, "gpio_in"),
  684. SUNXI_FUNCTION(0x1, "gpio_out"),
  685. SUNXI_FUNCTION(0x2, "spi1"), /* MISO */
  686. SUNXI_FUNCTION(0x3, "i2s1"), /* DOUT */
  687. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 16)), /* PG_EINT16 */
  688. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 17),
  689. SUNXI_FUNCTION(0x0, "gpio_in"),
  690. SUNXI_FUNCTION(0x1, "gpio_out"),
  691. SUNXI_FUNCTION(0x2, "uart4"), /* TX */
  692. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 17)), /* PG_EINT17 */
  693. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 18),
  694. SUNXI_FUNCTION(0x0, "gpio_in"),
  695. SUNXI_FUNCTION(0x1, "gpio_out"),
  696. SUNXI_FUNCTION(0x2, "uart4"), /* RX */
  697. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 18)), /* PG_EINT18 */
  698. /* Hole, note H starts at pin 9 */
  699. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 9),
  700. SUNXI_FUNCTION(0x0, "gpio_in"),
  701. SUNXI_FUNCTION(0x1, "gpio_out"),
  702. SUNXI_FUNCTION(0x2, "spi2"), /* CS0 */
  703. SUNXI_FUNCTION(0x3, "jtag"), /* MS0 */
  704. SUNXI_FUNCTION(0x4, "pwm1")), /* Positive */
  705. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 10),
  706. SUNXI_FUNCTION(0x0, "gpio_in"),
  707. SUNXI_FUNCTION(0x1, "gpio_out"),
  708. SUNXI_FUNCTION(0x2, "spi2"), /* CLK */
  709. SUNXI_FUNCTION(0x3, "jtag"), /* CK0 */
  710. SUNXI_FUNCTION(0x4, "pwm1")), /* Negative */
  711. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 11),
  712. SUNXI_FUNCTION(0x0, "gpio_in"),
  713. SUNXI_FUNCTION(0x1, "gpio_out"),
  714. SUNXI_FUNCTION(0x2, "spi2"), /* MOSI */
  715. SUNXI_FUNCTION(0x3, "jtag"), /* DO0 */
  716. SUNXI_FUNCTION(0x4, "pwm2")), /* Positive */
  717. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 12),
  718. SUNXI_FUNCTION(0x0, "gpio_in"),
  719. SUNXI_FUNCTION(0x1, "gpio_out"),
  720. SUNXI_FUNCTION(0x2, "spi2"), /* MISO */
  721. SUNXI_FUNCTION(0x3, "jtag"), /* DI0 */
  722. SUNXI_FUNCTION(0x4, "pwm2")), /* Negative */
  723. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 13),
  724. SUNXI_FUNCTION(0x0, "gpio_in"),
  725. SUNXI_FUNCTION(0x1, "gpio_out"),
  726. SUNXI_FUNCTION(0x2, "pwm0")),
  727. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 14),
  728. SUNXI_FUNCTION(0x0, "gpio_in"),
  729. SUNXI_FUNCTION(0x1, "gpio_out"),
  730. SUNXI_FUNCTION(0x2, "i2c0")), /* SCK */
  731. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 15),
  732. SUNXI_FUNCTION(0x0, "gpio_in"),
  733. SUNXI_FUNCTION(0x1, "gpio_out"),
  734. SUNXI_FUNCTION(0x2, "i2c0")), /* SDA */
  735. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 16),
  736. SUNXI_FUNCTION(0x0, "gpio_in"),
  737. SUNXI_FUNCTION(0x1, "gpio_out"),
  738. SUNXI_FUNCTION(0x2, "i2c1")), /* SCK */
  739. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 17),
  740. SUNXI_FUNCTION(0x0, "gpio_in"),
  741. SUNXI_FUNCTION(0x1, "gpio_out"),
  742. SUNXI_FUNCTION(0x2, "i2c1")), /* SDA */
  743. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 18),
  744. SUNXI_FUNCTION(0x0, "gpio_in"),
  745. SUNXI_FUNCTION(0x1, "gpio_out"),
  746. SUNXI_FUNCTION(0x2, "i2c2")), /* SCK */
  747. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 19),
  748. SUNXI_FUNCTION(0x0, "gpio_in"),
  749. SUNXI_FUNCTION(0x1, "gpio_out"),
  750. SUNXI_FUNCTION(0x2, "i2c2")), /* SDA */
  751. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 20),
  752. SUNXI_FUNCTION(0x0, "gpio_in"),
  753. SUNXI_FUNCTION(0x1, "gpio_out"),
  754. SUNXI_FUNCTION(0x2, "uart0")), /* TX */
  755. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 21),
  756. SUNXI_FUNCTION(0x0, "gpio_in"),
  757. SUNXI_FUNCTION(0x1, "gpio_out"),
  758. SUNXI_FUNCTION(0x2, "uart0")), /* RX */
  759. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 22),
  760. SUNXI_FUNCTION(0x0, "gpio_in"),
  761. SUNXI_FUNCTION(0x1, "gpio_out")),
  762. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 23),
  763. SUNXI_FUNCTION(0x0, "gpio_in"),
  764. SUNXI_FUNCTION(0x1, "gpio_out")),
  765. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 24),
  766. SUNXI_FUNCTION(0x0, "gpio_in"),
  767. SUNXI_FUNCTION(0x1, "gpio_out")),
  768. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 25),
  769. SUNXI_FUNCTION(0x0, "gpio_in"),
  770. SUNXI_FUNCTION(0x1, "gpio_out")),
  771. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 26),
  772. SUNXI_FUNCTION(0x0, "gpio_in"),
  773. SUNXI_FUNCTION(0x1, "gpio_out")),
  774. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 27),
  775. SUNXI_FUNCTION(0x0, "gpio_in"),
  776. SUNXI_FUNCTION(0x1, "gpio_out")),
  777. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 28),
  778. SUNXI_FUNCTION(0x0, "gpio_in"),
  779. SUNXI_FUNCTION(0x1, "gpio_out")),
  780. };
  781. static const struct sunxi_pinctrl_desc sun6i_a31s_pinctrl_data = {
  782. .pins = sun6i_a31s_pins,
  783. .npins = ARRAY_SIZE(sun6i_a31s_pins),
  784. .irq_banks = 4,
  785. };
  786. static int sun6i_a31s_pinctrl_probe(struct platform_device *pdev)
  787. {
  788. return sunxi_pinctrl_init(pdev,
  789. &sun6i_a31s_pinctrl_data);
  790. }
  791. static const struct of_device_id sun6i_a31s_pinctrl_match[] = {
  792. { .compatible = "allwinner,sun6i-a31s-pinctrl", },
  793. {}
  794. };
  795. MODULE_DEVICE_TABLE(of, sun6i_a31s_pinctrl_match);
  796. static struct platform_driver sun6i_a31s_pinctrl_driver = {
  797. .probe = sun6i_a31s_pinctrl_probe,
  798. .driver = {
  799. .name = "sun6i-a31s-pinctrl",
  800. .of_match_table = sun6i_a31s_pinctrl_match,
  801. },
  802. };
  803. module_platform_driver(sun6i_a31s_pinctrl_driver);
  804. MODULE_AUTHOR("Hans de Goede <hdegoede@redhat.com>");
  805. MODULE_DESCRIPTION("Allwinner A31s pinctrl driver");
  806. MODULE_LICENSE("GPL");