pinctrl-sun9i-a80.c 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750
  1. /*
  2. * Allwinner A80 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 sun9i_a80_pins[] = {
  19. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 0),
  20. SUNXI_FUNCTION(0x0, "gpio_in"),
  21. SUNXI_FUNCTION(0x1, "gpio_out"),
  22. SUNXI_FUNCTION(0x2, "gmac"), /* RXD3 */
  23. SUNXI_FUNCTION(0x4, "uart1"), /* TX */
  24. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)), /* PA_EINT0 */
  25. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 1),
  26. SUNXI_FUNCTION(0x0, "gpio_in"),
  27. SUNXI_FUNCTION(0x1, "gpio_out"),
  28. SUNXI_FUNCTION(0x2, "gmac"), /* RXD2 */
  29. SUNXI_FUNCTION(0x4, "uart1"), /* RX */
  30. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)), /* PA_EINT1 */
  31. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 2),
  32. SUNXI_FUNCTION(0x0, "gpio_in"),
  33. SUNXI_FUNCTION(0x1, "gpio_out"),
  34. SUNXI_FUNCTION(0x2, "gmac"), /* RXD1 */
  35. SUNXI_FUNCTION(0x4, "uart1"), /* RTS */
  36. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 2)), /* PA_EINT2 */
  37. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 3),
  38. SUNXI_FUNCTION(0x0, "gpio_in"),
  39. SUNXI_FUNCTION(0x1, "gpio_out"),
  40. SUNXI_FUNCTION(0x2, "gmac"), /* RXD0 */
  41. SUNXI_FUNCTION(0x4, "uart1"), /* CTS */
  42. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 3)), /* PA_EINT3 */
  43. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 4),
  44. SUNXI_FUNCTION(0x0, "gpio_in"),
  45. SUNXI_FUNCTION(0x1, "gpio_out"),
  46. SUNXI_FUNCTION(0x2, "gmac"), /* RXCK */
  47. SUNXI_FUNCTION(0x4, "uart1"), /* DTR */
  48. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 4)), /* PA_EINT4 */
  49. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 5),
  50. SUNXI_FUNCTION(0x0, "gpio_in"),
  51. SUNXI_FUNCTION(0x1, "gpio_out"),
  52. SUNXI_FUNCTION(0x2, "gmac"), /* RXCTL */
  53. SUNXI_FUNCTION(0x4, "uart1"), /* DSR */
  54. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 5)), /* PA_EINT5 */
  55. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 6),
  56. SUNXI_FUNCTION(0x0, "gpio_in"),
  57. SUNXI_FUNCTION(0x1, "gpio_out"),
  58. SUNXI_FUNCTION(0x2, "gmac"), /* RXERR */
  59. SUNXI_FUNCTION(0x4, "uart1"), /* DCD */
  60. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 6)), /* PA_EINT6 */
  61. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 7),
  62. SUNXI_FUNCTION(0x0, "gpio_in"),
  63. SUNXI_FUNCTION(0x1, "gpio_out"),
  64. SUNXI_FUNCTION(0x2, "gmac"), /* TXD3 */
  65. SUNXI_FUNCTION(0x4, "uart1"), /* RING */
  66. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 7)), /* PA_EINT7 */
  67. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 8),
  68. SUNXI_FUNCTION(0x0, "gpio_in"),
  69. SUNXI_FUNCTION(0x1, "gpio_out"),
  70. SUNXI_FUNCTION(0x2, "gmac"), /* TXD2 */
  71. SUNXI_FUNCTION(0x4, "eclk"), /* IN0 */
  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, "eclk"), /* IN1 */
  78. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 9)), /* PA_EINT9 */
  79. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 10),
  80. SUNXI_FUNCTION(0x0, "gpio_in"),
  81. SUNXI_FUNCTION(0x1, "gpio_out"),
  82. SUNXI_FUNCTION(0x2, "gmac"), /* TXD0 */
  83. SUNXI_FUNCTION(0x4, "clk_out_a"),
  84. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 10)), /* PA_EINT10 */
  85. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 11),
  86. SUNXI_FUNCTION(0x0, "gpio_in"),
  87. SUNXI_FUNCTION(0x1, "gpio_out"),
  88. SUNXI_FUNCTION(0x2, "gmac"), /* MII-CRS */
  89. SUNXI_FUNCTION(0x4, "clk_out_b"),
  90. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 11)), /* PA_EINT11 */
  91. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 12),
  92. SUNXI_FUNCTION(0x0, "gpio_in"),
  93. SUNXI_FUNCTION(0x1, "gpio_out"),
  94. SUNXI_FUNCTION(0x2, "gmac"), /* TXCK */
  95. SUNXI_FUNCTION(0x4, "pwm3"), /* PWM_P */
  96. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 12)), /* PA_EINT12 */
  97. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 13),
  98. SUNXI_FUNCTION(0x0, "gpio_in"),
  99. SUNXI_FUNCTION(0x1, "gpio_out"),
  100. SUNXI_FUNCTION(0x2, "gmac"), /* RGMII-TXCK / GMII-TXEN */
  101. SUNXI_FUNCTION(0x4, "pwm3"), /* PWM_N */
  102. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 13)), /* PA_EINT13 */
  103. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 14),
  104. SUNXI_FUNCTION(0x0, "gpio_in"),
  105. SUNXI_FUNCTION(0x1, "gpio_out"),
  106. SUNXI_FUNCTION(0x2, "gmac"), /* MII-TXERR */
  107. SUNXI_FUNCTION(0x4, "spi1"), /* CS0 */
  108. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 14)), /* PA_EINT14 */
  109. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 15),
  110. SUNXI_FUNCTION(0x0, "gpio_in"),
  111. SUNXI_FUNCTION(0x1, "gpio_out"),
  112. SUNXI_FUNCTION(0x2, "gmac"), /* RGMII-CLKIN / MII-COL */
  113. SUNXI_FUNCTION(0x4, "spi1"), /* CLK */
  114. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 15)), /* PA_EINT15 */
  115. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 16),
  116. SUNXI_FUNCTION(0x0, "gpio_in"),
  117. SUNXI_FUNCTION(0x1, "gpio_out"),
  118. SUNXI_FUNCTION(0x2, "gmac"), /* EMDC */
  119. SUNXI_FUNCTION(0x4, "spi1"), /* MOSI */
  120. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 16)), /* PA_EINT16 */
  121. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 17),
  122. SUNXI_FUNCTION(0x0, "gpio_in"),
  123. SUNXI_FUNCTION(0x1, "gpio_out"),
  124. SUNXI_FUNCTION(0x2, "gmac"), /* EMDIO */
  125. SUNXI_FUNCTION(0x4, "spi1"), /* MISO */
  126. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 17)), /* PA_EINT17 */
  127. /* Hole */
  128. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 5),
  129. SUNXI_FUNCTION(0x0, "gpio_in"),
  130. SUNXI_FUNCTION(0x1, "gpio_out"),
  131. SUNXI_FUNCTION(0x3, "uart3"), /* TX */
  132. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 5)), /* PB_EINT5 */
  133. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 6),
  134. SUNXI_FUNCTION(0x0, "gpio_in"),
  135. SUNXI_FUNCTION(0x1, "gpio_out"),
  136. SUNXI_FUNCTION(0x3, "uart3"), /* RX */
  137. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 6)), /* PB_EINT6 */
  138. /* Hole */
  139. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 14),
  140. SUNXI_FUNCTION(0x0, "gpio_in"),
  141. SUNXI_FUNCTION(0x1, "gpio_out"),
  142. SUNXI_FUNCTION(0x3, "mcsi"), /* MCLK */
  143. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 14)), /* PB_EINT14 */
  144. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 15),
  145. SUNXI_FUNCTION(0x0, "gpio_in"),
  146. SUNXI_FUNCTION(0x1, "gpio_out"),
  147. SUNXI_FUNCTION(0x3, "mcsi"), /* SCK */
  148. SUNXI_FUNCTION(0x4, "i2c4"), /* SCK */
  149. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 15)), /* PB_EINT15 */
  150. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 16),
  151. SUNXI_FUNCTION(0x0, "gpio_in"),
  152. SUNXI_FUNCTION(0x1, "gpio_out"),
  153. SUNXI_FUNCTION(0x3, "mcsi"), /* SDA */
  154. SUNXI_FUNCTION(0x4, "i2c4"), /* SDA */
  155. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 16)), /* PB_EINT16 */
  156. /* Hole */
  157. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0),
  158. SUNXI_FUNCTION(0x0, "gpio_in"),
  159. SUNXI_FUNCTION(0x1, "gpio_out"),
  160. SUNXI_FUNCTION(0x2, "nand0"), /* WE */
  161. SUNXI_FUNCTION(0x3, "spi0")), /* MOSI */
  162. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1),
  163. SUNXI_FUNCTION(0x0, "gpio_in"),
  164. SUNXI_FUNCTION(0x1, "gpio_out"),
  165. SUNXI_FUNCTION(0x2, "nand0"), /* ALE */
  166. SUNXI_FUNCTION(0x3, "spi0")), /* MISO */
  167. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2),
  168. SUNXI_FUNCTION(0x0, "gpio_in"),
  169. SUNXI_FUNCTION(0x1, "gpio_out"),
  170. SUNXI_FUNCTION(0x2, "nand0"), /* CLE */
  171. SUNXI_FUNCTION(0x3, "spi0")), /* CLK */
  172. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3),
  173. SUNXI_FUNCTION(0x0, "gpio_in"),
  174. SUNXI_FUNCTION(0x1, "gpio_out"),
  175. SUNXI_FUNCTION(0x2, "nand0")), /* CE1 */
  176. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 4),
  177. SUNXI_FUNCTION(0x0, "gpio_in"),
  178. SUNXI_FUNCTION(0x1, "gpio_out"),
  179. SUNXI_FUNCTION(0x2, "nand0")), /* CE0 */
  180. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 5),
  181. SUNXI_FUNCTION(0x0, "gpio_in"),
  182. SUNXI_FUNCTION(0x1, "gpio_out"),
  183. SUNXI_FUNCTION(0x2, "nand0")), /* RE */
  184. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 6),
  185. SUNXI_FUNCTION(0x0, "gpio_in"),
  186. SUNXI_FUNCTION(0x1, "gpio_out"),
  187. SUNXI_FUNCTION(0x2, "nand0"), /* RB0 */
  188. SUNXI_FUNCTION(0x3, "mmc2")), /* CMD */
  189. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 7),
  190. SUNXI_FUNCTION(0x0, "gpio_in"),
  191. SUNXI_FUNCTION(0x1, "gpio_out"),
  192. SUNXI_FUNCTION(0x2, "nand0"), /* RB1 */
  193. SUNXI_FUNCTION(0x3, "mmc2")), /* CLK */
  194. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 8),
  195. SUNXI_FUNCTION(0x0, "gpio_in"),
  196. SUNXI_FUNCTION(0x1, "gpio_out"),
  197. SUNXI_FUNCTION(0x2, "nand0"), /* DQ0 */
  198. SUNXI_FUNCTION(0x3, "mmc2")), /* D0 */
  199. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 9),
  200. SUNXI_FUNCTION(0x0, "gpio_in"),
  201. SUNXI_FUNCTION(0x1, "gpio_out"),
  202. SUNXI_FUNCTION(0x2, "nand0"), /* DQ1 */
  203. SUNXI_FUNCTION(0x3, "mmc2")), /* D1 */
  204. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 10),
  205. SUNXI_FUNCTION(0x0, "gpio_in"),
  206. SUNXI_FUNCTION(0x1, "gpio_out"),
  207. SUNXI_FUNCTION(0x2, "nand0"), /* DQ2 */
  208. SUNXI_FUNCTION(0x3, "mmc2")), /* D2 */
  209. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 11),
  210. SUNXI_FUNCTION(0x0, "gpio_in"),
  211. SUNXI_FUNCTION(0x1, "gpio_out"),
  212. SUNXI_FUNCTION(0x2, "nand0"), /* DQ3 */
  213. SUNXI_FUNCTION(0x3, "mmc2")), /* D3 */
  214. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 12),
  215. SUNXI_FUNCTION(0x0, "gpio_in"),
  216. SUNXI_FUNCTION(0x1, "gpio_out"),
  217. SUNXI_FUNCTION(0x2, "nand0"), /* DQ4 */
  218. SUNXI_FUNCTION(0x3, "mmc2")), /* D4 */
  219. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 13),
  220. SUNXI_FUNCTION(0x0, "gpio_in"),
  221. SUNXI_FUNCTION(0x1, "gpio_out"),
  222. SUNXI_FUNCTION(0x2, "nand0"), /* DQ5 */
  223. SUNXI_FUNCTION(0x3, "mmc2")), /* D5 */
  224. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 14),
  225. SUNXI_FUNCTION(0x0, "gpio_in"),
  226. SUNXI_FUNCTION(0x1, "gpio_out"),
  227. SUNXI_FUNCTION(0x2, "nand0"), /* DQ6 */
  228. SUNXI_FUNCTION(0x3, "mmc2")), /* D6 */
  229. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 15),
  230. SUNXI_FUNCTION(0x0, "gpio_in"),
  231. SUNXI_FUNCTION(0x1, "gpio_out"),
  232. SUNXI_FUNCTION(0x2, "nand0"), /* DQ7 */
  233. SUNXI_FUNCTION(0x3, "mmc2")), /* D7 */
  234. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 16),
  235. SUNXI_FUNCTION(0x0, "gpio_in"),
  236. SUNXI_FUNCTION(0x1, "gpio_out"),
  237. SUNXI_FUNCTION(0x2, "nand0"), /* DQS */
  238. SUNXI_FUNCTION(0x3, "mmc2")), /* RST */
  239. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 17),
  240. SUNXI_FUNCTION(0x0, "gpio_in"),
  241. SUNXI_FUNCTION(0x1, "gpio_out"),
  242. SUNXI_FUNCTION(0x2, "nand0"), /* CE2 */
  243. SUNXI_FUNCTION(0x3, "nand0_b")), /* RE */
  244. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 18),
  245. SUNXI_FUNCTION(0x0, "gpio_in"),
  246. SUNXI_FUNCTION(0x1, "gpio_out"),
  247. SUNXI_FUNCTION(0x2, "nand0"), /* CE3 */
  248. SUNXI_FUNCTION(0x3, "nand0_b")), /* DQS */
  249. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 19),
  250. SUNXI_FUNCTION(0x0, "gpio_in"),
  251. SUNXI_FUNCTION(0x1, "gpio_out"),
  252. SUNXI_FUNCTION(0x3, "spi0")), /* CS0 */
  253. /* Hole */
  254. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 0),
  255. SUNXI_FUNCTION(0x0, "gpio_in"),
  256. SUNXI_FUNCTION(0x1, "gpio_out"),
  257. SUNXI_FUNCTION(0x2, "lcd0"), /* D0 */
  258. SUNXI_FUNCTION(0x3, "lvds0")), /* VP0 */
  259. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 1),
  260. SUNXI_FUNCTION(0x0, "gpio_in"),
  261. SUNXI_FUNCTION(0x1, "gpio_out"),
  262. SUNXI_FUNCTION(0x2, "lcd0"), /* D1 */
  263. SUNXI_FUNCTION(0x3, "lvds0")), /* VN0 */
  264. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 2),
  265. SUNXI_FUNCTION(0x0, "gpio_in"),
  266. SUNXI_FUNCTION(0x1, "gpio_out"),
  267. SUNXI_FUNCTION(0x2, "lcd0"), /* D2 */
  268. SUNXI_FUNCTION(0x3, "lvds0")), /* VP1 */
  269. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 3),
  270. SUNXI_FUNCTION(0x0, "gpio_in"),
  271. SUNXI_FUNCTION(0x1, "gpio_out"),
  272. SUNXI_FUNCTION(0x2, "lcd0"), /* D3 */
  273. SUNXI_FUNCTION(0x3, "lvds0")), /* VN1 */
  274. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 4),
  275. SUNXI_FUNCTION(0x0, "gpio_in"),
  276. SUNXI_FUNCTION(0x1, "gpio_out"),
  277. SUNXI_FUNCTION(0x2, "lcd0"), /* D4 */
  278. SUNXI_FUNCTION(0x3, "lvds0")), /* VP2 */
  279. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 5),
  280. SUNXI_FUNCTION(0x0, "gpio_in"),
  281. SUNXI_FUNCTION(0x1, "gpio_out"),
  282. SUNXI_FUNCTION(0x2, "lcd0"), /* D5 */
  283. SUNXI_FUNCTION(0x3, "lvds0")), /* VN2 */
  284. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 6),
  285. SUNXI_FUNCTION(0x0, "gpio_in"),
  286. SUNXI_FUNCTION(0x1, "gpio_out"),
  287. SUNXI_FUNCTION(0x2, "lcd0"), /* D6 */
  288. SUNXI_FUNCTION(0x3, "lvds0")), /* VPC */
  289. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 7),
  290. SUNXI_FUNCTION(0x0, "gpio_in"),
  291. SUNXI_FUNCTION(0x1, "gpio_out"),
  292. SUNXI_FUNCTION(0x2, "lcd0"), /* D7 */
  293. SUNXI_FUNCTION(0x3, "lvds0")), /* VNC */
  294. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 8),
  295. SUNXI_FUNCTION(0x0, "gpio_in"),
  296. SUNXI_FUNCTION(0x1, "gpio_out"),
  297. SUNXI_FUNCTION(0x2, "lcd0"), /* D8 */
  298. SUNXI_FUNCTION(0x3, "lvds0")), /* VP3 */
  299. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 9),
  300. SUNXI_FUNCTION(0x0, "gpio_in"),
  301. SUNXI_FUNCTION(0x1, "gpio_out"),
  302. SUNXI_FUNCTION(0x2, "lcd0"), /* D9 */
  303. SUNXI_FUNCTION(0x3, "lvds0")), /* VN3 */
  304. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 10),
  305. SUNXI_FUNCTION(0x0, "gpio_in"),
  306. SUNXI_FUNCTION(0x1, "gpio_out"),
  307. SUNXI_FUNCTION(0x2, "lcd0"), /* D10 */
  308. SUNXI_FUNCTION(0x3, "lvds1")), /* VP0 */
  309. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 11),
  310. SUNXI_FUNCTION(0x0, "gpio_in"),
  311. SUNXI_FUNCTION(0x1, "gpio_out"),
  312. SUNXI_FUNCTION(0x2, "lcd0"), /* D11 */
  313. SUNXI_FUNCTION(0x3, "lvds1")), /* VN0 */
  314. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 12),
  315. SUNXI_FUNCTION(0x0, "gpio_in"),
  316. SUNXI_FUNCTION(0x1, "gpio_out"),
  317. SUNXI_FUNCTION(0x2, "lcd0"), /* D12 */
  318. SUNXI_FUNCTION(0x3, "lvds1")), /* VP1 */
  319. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 13),
  320. SUNXI_FUNCTION(0x0, "gpio_in"),
  321. SUNXI_FUNCTION(0x1, "gpio_out"),
  322. SUNXI_FUNCTION(0x2, "lcd0"), /* D13 */
  323. SUNXI_FUNCTION(0x3, "lvds1")), /* VN1 */
  324. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 14),
  325. SUNXI_FUNCTION(0x0, "gpio_in"),
  326. SUNXI_FUNCTION(0x1, "gpio_out"),
  327. SUNXI_FUNCTION(0x2, "lcd0"), /* D14 */
  328. SUNXI_FUNCTION(0x3, "lvds1")), /* VP2 */
  329. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 15),
  330. SUNXI_FUNCTION(0x0, "gpio_in"),
  331. SUNXI_FUNCTION(0x1, "gpio_out"),
  332. SUNXI_FUNCTION(0x2, "lcd0"), /* D15 */
  333. SUNXI_FUNCTION(0x3, "lvds1")), /* VN2 */
  334. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 16),
  335. SUNXI_FUNCTION(0x0, "gpio_in"),
  336. SUNXI_FUNCTION(0x1, "gpio_out"),
  337. SUNXI_FUNCTION(0x2, "lcd0"), /* D16 */
  338. SUNXI_FUNCTION(0x3, "lvds1")), /* VPC */
  339. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 17),
  340. SUNXI_FUNCTION(0x0, "gpio_in"),
  341. SUNXI_FUNCTION(0x1, "gpio_out"),
  342. SUNXI_FUNCTION(0x2, "lcd0"), /* D17 */
  343. SUNXI_FUNCTION(0x3, "lvds1")), /* VNC */
  344. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 18),
  345. SUNXI_FUNCTION(0x0, "gpio_in"),
  346. SUNXI_FUNCTION(0x1, "gpio_out"),
  347. SUNXI_FUNCTION(0x2, "lcd0"), /* D18 */
  348. SUNXI_FUNCTION(0x3, "lvds1")), /* VP3 */
  349. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 19),
  350. SUNXI_FUNCTION(0x0, "gpio_in"),
  351. SUNXI_FUNCTION(0x1, "gpio_out"),
  352. SUNXI_FUNCTION(0x2, "lcd0"), /* D19 */
  353. SUNXI_FUNCTION(0x3, "lvds1")), /* VN3 */
  354. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 20),
  355. SUNXI_FUNCTION(0x0, "gpio_in"),
  356. SUNXI_FUNCTION(0x1, "gpio_out"),
  357. SUNXI_FUNCTION(0x2, "lcd0")), /* D20 */
  358. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 21),
  359. SUNXI_FUNCTION(0x0, "gpio_in"),
  360. SUNXI_FUNCTION(0x1, "gpio_out"),
  361. SUNXI_FUNCTION(0x2, "lcd0")), /* D21 */
  362. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 22),
  363. SUNXI_FUNCTION(0x0, "gpio_in"),
  364. SUNXI_FUNCTION(0x1, "gpio_out"),
  365. SUNXI_FUNCTION(0x2, "lcd0")), /* D22 */
  366. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 23),
  367. SUNXI_FUNCTION(0x0, "gpio_in"),
  368. SUNXI_FUNCTION(0x1, "gpio_out"),
  369. SUNXI_FUNCTION(0x2, "lcd0")), /* D23 */
  370. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 24),
  371. SUNXI_FUNCTION(0x0, "gpio_in"),
  372. SUNXI_FUNCTION(0x1, "gpio_out"),
  373. SUNXI_FUNCTION(0x2, "lcd0")), /* CLK */
  374. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 25),
  375. SUNXI_FUNCTION(0x0, "gpio_in"),
  376. SUNXI_FUNCTION(0x1, "gpio_out"),
  377. SUNXI_FUNCTION(0x2, "lcd0")), /* DE */
  378. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 26),
  379. SUNXI_FUNCTION(0x0, "gpio_in"),
  380. SUNXI_FUNCTION(0x1, "gpio_out"),
  381. SUNXI_FUNCTION(0x2, "lcd0")), /* HSYNC */
  382. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 27),
  383. SUNXI_FUNCTION(0x0, "gpio_in"),
  384. SUNXI_FUNCTION(0x1, "gpio_out"),
  385. SUNXI_FUNCTION(0x2, "lcd0")), /* VSYNC */
  386. /* Hole */
  387. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 0),
  388. SUNXI_FUNCTION(0x0, "gpio_in"),
  389. SUNXI_FUNCTION(0x1, "gpio_out"),
  390. SUNXI_FUNCTION(0x2, "csi"), /* PCLK */
  391. SUNXI_FUNCTION(0x3, "ts"), /* CLK */
  392. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 0)), /* PE_EINT0 */
  393. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 1),
  394. SUNXI_FUNCTION(0x0, "gpio_in"),
  395. SUNXI_FUNCTION(0x1, "gpio_out"),
  396. SUNXI_FUNCTION(0x2, "csi"), /* MCLK */
  397. SUNXI_FUNCTION(0x3, "ts"), /* ERR */
  398. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 1)), /* PE_EINT1 */
  399. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 2),
  400. SUNXI_FUNCTION(0x0, "gpio_in"),
  401. SUNXI_FUNCTION(0x1, "gpio_out"),
  402. SUNXI_FUNCTION(0x2, "csi"), /* HSYNC */
  403. SUNXI_FUNCTION(0x3, "ts"), /* SYNC */
  404. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 2)), /* PE_EINT2 */
  405. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 3),
  406. SUNXI_FUNCTION(0x0, "gpio_in"),
  407. SUNXI_FUNCTION(0x1, "gpio_out"),
  408. SUNXI_FUNCTION(0x2, "csi"), /* VSYNC */
  409. SUNXI_FUNCTION(0x3, "ts"), /* DVLD */
  410. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 3)), /* PE_EINT3 */
  411. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 4),
  412. SUNXI_FUNCTION(0x0, "gpio_in"),
  413. SUNXI_FUNCTION(0x1, "gpio_out"),
  414. SUNXI_FUNCTION(0x2, "csi"), /* D0 */
  415. SUNXI_FUNCTION(0x3, "spi2"), /* CS0 */
  416. SUNXI_FUNCTION(0x4, "uart5"), /* TX */
  417. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 4)), /* PE_EINT4 */
  418. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 5),
  419. SUNXI_FUNCTION(0x0, "gpio_in"),
  420. SUNXI_FUNCTION(0x1, "gpio_out"),
  421. SUNXI_FUNCTION(0x2, "csi"), /* D1 */
  422. SUNXI_FUNCTION(0x3, "spi2"), /* CLK */
  423. SUNXI_FUNCTION(0x4, "uart5"), /* RX */
  424. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 5)), /* PE_EINT5 */
  425. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 6),
  426. SUNXI_FUNCTION(0x0, "gpio_in"),
  427. SUNXI_FUNCTION(0x1, "gpio_out"),
  428. SUNXI_FUNCTION(0x2, "csi"), /* D2 */
  429. SUNXI_FUNCTION(0x3, "spi2"), /* MOSI */
  430. SUNXI_FUNCTION(0x4, "uart5"), /* RTS */
  431. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 6)), /* PE_EINT6 */
  432. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 7),
  433. SUNXI_FUNCTION(0x0, "gpio_in"),
  434. SUNXI_FUNCTION(0x1, "gpio_out"),
  435. SUNXI_FUNCTION(0x2, "csi"), /* D3 */
  436. SUNXI_FUNCTION(0x3, "spi2"), /* MISO */
  437. SUNXI_FUNCTION(0x4, "uart5"), /* CTS */
  438. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 7)), /* PE_EINT7 */
  439. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 8),
  440. SUNXI_FUNCTION(0x0, "gpio_in"),
  441. SUNXI_FUNCTION(0x1, "gpio_out"),
  442. SUNXI_FUNCTION(0x2, "csi"), /* D4 */
  443. SUNXI_FUNCTION(0x3, "ts"), /* D0 */
  444. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 8)), /* PE_EINT8 */
  445. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 9),
  446. SUNXI_FUNCTION(0x0, "gpio_in"),
  447. SUNXI_FUNCTION(0x1, "gpio_out"),
  448. SUNXI_FUNCTION(0x2, "csi"), /* D5 */
  449. SUNXI_FUNCTION(0x3, "ts"), /* D1 */
  450. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 9)), /* PE_EINT9 */
  451. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 10),
  452. SUNXI_FUNCTION(0x0, "gpio_in"),
  453. SUNXI_FUNCTION(0x1, "gpio_out"),
  454. SUNXI_FUNCTION(0x2, "csi"), /* D6 */
  455. SUNXI_FUNCTION(0x3, "ts"), /* D2 */
  456. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 10)), /* PE_EINT10 */
  457. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 11),
  458. SUNXI_FUNCTION(0x0, "gpio_in"),
  459. SUNXI_FUNCTION(0x1, "gpio_out"),
  460. SUNXI_FUNCTION(0x2, "csi"), /* D7 */
  461. SUNXI_FUNCTION(0x3, "ts"), /* D3 */
  462. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 11)), /* PE_EINT11 */
  463. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 12),
  464. SUNXI_FUNCTION(0x0, "gpio_in"),
  465. SUNXI_FUNCTION(0x1, "gpio_out"),
  466. SUNXI_FUNCTION(0x2, "csi"), /* D8 */
  467. SUNXI_FUNCTION(0x3, "ts"), /* D4 */
  468. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 12)), /* PE_EINT12 */
  469. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 13),
  470. SUNXI_FUNCTION(0x0, "gpio_in"),
  471. SUNXI_FUNCTION(0x1, "gpio_out"),
  472. SUNXI_FUNCTION(0x2, "csi"), /* D9 */
  473. SUNXI_FUNCTION(0x3, "ts"), /* D5 */
  474. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 13)), /* PE_EINT13 */
  475. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 14),
  476. SUNXI_FUNCTION(0x0, "gpio_in"),
  477. SUNXI_FUNCTION(0x1, "gpio_out"),
  478. SUNXI_FUNCTION(0x2, "csi"), /* D10 */
  479. SUNXI_FUNCTION(0x3, "ts"), /* D6 */
  480. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 14)), /* PE_EINT14 */
  481. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 15),
  482. SUNXI_FUNCTION(0x0, "gpio_in"),
  483. SUNXI_FUNCTION(0x1, "gpio_out"),
  484. SUNXI_FUNCTION(0x2, "csi"), /* D11 */
  485. SUNXI_FUNCTION(0x3, "ts"), /* D7 */
  486. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 15)), /* PE_EINT15 */
  487. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 16),
  488. SUNXI_FUNCTION(0x0, "gpio_in"),
  489. SUNXI_FUNCTION(0x1, "gpio_out"),
  490. SUNXI_FUNCTION(0x2, "csi"), /* SCK */
  491. SUNXI_FUNCTION(0x3, "i2c4"), /* SCK */
  492. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 16)), /* PE_EINT16 */
  493. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 17),
  494. SUNXI_FUNCTION(0x0, "gpio_in"),
  495. SUNXI_FUNCTION(0x1, "gpio_out"),
  496. SUNXI_FUNCTION(0x2, "csi"), /* SDA */
  497. SUNXI_FUNCTION(0x3, "i2c4"), /* SDA */
  498. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 17)), /* PE_EINT17 */
  499. /* Hole */
  500. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0),
  501. SUNXI_FUNCTION(0x0, "gpio_in"),
  502. SUNXI_FUNCTION(0x1, "gpio_out"),
  503. SUNXI_FUNCTION(0x2, "mmc0")), /* D1 */
  504. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1),
  505. SUNXI_FUNCTION(0x0, "gpio_in"),
  506. SUNXI_FUNCTION(0x1, "gpio_out"),
  507. SUNXI_FUNCTION(0x2, "mmc0")), /* D0 */
  508. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2),
  509. SUNXI_FUNCTION(0x0, "gpio_in"),
  510. SUNXI_FUNCTION(0x1, "gpio_out"),
  511. SUNXI_FUNCTION(0x2, "mmc0"), /* CLK */
  512. SUNXI_FUNCTION(0x4, "uart0")), /* TX */
  513. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3),
  514. SUNXI_FUNCTION(0x0, "gpio_in"),
  515. SUNXI_FUNCTION(0x1, "gpio_out"),
  516. SUNXI_FUNCTION(0x2, "mmc0")), /* CMD */
  517. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4),
  518. SUNXI_FUNCTION(0x0, "gpio_in"),
  519. SUNXI_FUNCTION(0x1, "gpio_out"),
  520. SUNXI_FUNCTION(0x2, "mmc0"), /* D3 */
  521. SUNXI_FUNCTION(0x4, "uart0")), /* RX */
  522. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5),
  523. SUNXI_FUNCTION(0x0, "gpio_in"),
  524. SUNXI_FUNCTION(0x1, "gpio_out"),
  525. SUNXI_FUNCTION(0x2, "mmc0")), /* D2 */
  526. /* Hole */
  527. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0),
  528. SUNXI_FUNCTION(0x0, "gpio_in"),
  529. SUNXI_FUNCTION(0x1, "gpio_out"),
  530. SUNXI_FUNCTION(0x2, "mmc1"), /* CLK */
  531. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 0)), /* PG_EINT0 */
  532. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1),
  533. SUNXI_FUNCTION(0x0, "gpio_in"),
  534. SUNXI_FUNCTION(0x1, "gpio_out"),
  535. SUNXI_FUNCTION(0x2, "mmc1"), /* CMD */
  536. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 1)), /* PG_EINT1 */
  537. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2),
  538. SUNXI_FUNCTION(0x0, "gpio_in"),
  539. SUNXI_FUNCTION(0x1, "gpio_out"),
  540. SUNXI_FUNCTION(0x2, "mmc1"), /* D0 */
  541. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 2)), /* PG_EINT2 */
  542. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3),
  543. SUNXI_FUNCTION(0x0, "gpio_in"),
  544. SUNXI_FUNCTION(0x1, "gpio_out"),
  545. SUNXI_FUNCTION(0x2, "mmc1"), /* D1 */
  546. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 3)), /* PG_EINT3 */
  547. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4),
  548. SUNXI_FUNCTION(0x0, "gpio_in"),
  549. SUNXI_FUNCTION(0x1, "gpio_out"),
  550. SUNXI_FUNCTION(0x2, "mmc1"), /* D2 */
  551. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 4)), /* PG_EINT4 */
  552. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 5),
  553. SUNXI_FUNCTION(0x0, "gpio_in"),
  554. SUNXI_FUNCTION(0x1, "gpio_out"),
  555. SUNXI_FUNCTION(0x2, "mmc1"), /* D3 */
  556. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 5)), /* PG_EINT5 */
  557. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 6),
  558. SUNXI_FUNCTION(0x0, "gpio_in"),
  559. SUNXI_FUNCTION(0x1, "gpio_out"),
  560. SUNXI_FUNCTION(0x2, "uart2"), /* TX */
  561. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 6)), /* PG_EINT6 */
  562. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 7),
  563. SUNXI_FUNCTION(0x0, "gpio_in"),
  564. SUNXI_FUNCTION(0x1, "gpio_out"),
  565. SUNXI_FUNCTION(0x2, "uart2"), /* RX */
  566. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 7)), /* PG_EINT7 */
  567. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 8),
  568. SUNXI_FUNCTION(0x0, "gpio_in"),
  569. SUNXI_FUNCTION(0x1, "gpio_out"),
  570. SUNXI_FUNCTION(0x2, "uart2"), /* RTS */
  571. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 8)), /* PG_EINT8 */
  572. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 9),
  573. SUNXI_FUNCTION(0x0, "gpio_in"),
  574. SUNXI_FUNCTION(0x1, "gpio_out"),
  575. SUNXI_FUNCTION(0x2, "uart2"), /* CTS */
  576. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 9)), /* PG_EINT9 */
  577. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10),
  578. SUNXI_FUNCTION(0x0, "gpio_in"),
  579. SUNXI_FUNCTION(0x1, "gpio_out"),
  580. SUNXI_FUNCTION(0x2, "i2c3"), /* SCK */
  581. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 10)), /* PG_EINT10 */
  582. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 11),
  583. SUNXI_FUNCTION(0x0, "gpio_in"),
  584. SUNXI_FUNCTION(0x1, "gpio_out"),
  585. SUNXI_FUNCTION(0x2, "i2c3"), /* SDA */
  586. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 11)), /* PG_EINT11 */
  587. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 12),
  588. SUNXI_FUNCTION(0x0, "gpio_in"),
  589. SUNXI_FUNCTION(0x1, "gpio_out"),
  590. SUNXI_FUNCTION(0x2, "uart4"), /* TX */
  591. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 12)), /* PG_EINT12 */
  592. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 13),
  593. SUNXI_FUNCTION(0x0, "gpio_in"),
  594. SUNXI_FUNCTION(0x1, "gpio_out"),
  595. SUNXI_FUNCTION(0x2, "uart4"), /* RX */
  596. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 13)), /* PG_EINT13 */
  597. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 14),
  598. SUNXI_FUNCTION(0x0, "gpio_in"),
  599. SUNXI_FUNCTION(0x1, "gpio_out"),
  600. SUNXI_FUNCTION(0x2, "uart4"), /* RTS */
  601. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 14)), /* PG_EINT14 */
  602. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 15),
  603. SUNXI_FUNCTION(0x0, "gpio_in"),
  604. SUNXI_FUNCTION(0x1, "gpio_out"),
  605. SUNXI_FUNCTION(0x2, "uart4"), /* CTS */
  606. SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 15)), /* PG_EINT15 */
  607. /* Hole */
  608. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 0),
  609. SUNXI_FUNCTION(0x0, "gpio_in"),
  610. SUNXI_FUNCTION(0x1, "gpio_out"),
  611. SUNXI_FUNCTION(0x2, "i2c0")), /* SCK */
  612. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 1),
  613. SUNXI_FUNCTION(0x0, "gpio_in"),
  614. SUNXI_FUNCTION(0x1, "gpio_out"),
  615. SUNXI_FUNCTION(0x2, "i2c0")), /* SDA */
  616. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 2),
  617. SUNXI_FUNCTION(0x0, "gpio_in"),
  618. SUNXI_FUNCTION(0x1, "gpio_out"),
  619. SUNXI_FUNCTION(0x2, "i2c1")), /* SCK */
  620. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 3),
  621. SUNXI_FUNCTION(0x0, "gpio_in"),
  622. SUNXI_FUNCTION(0x1, "gpio_out"),
  623. SUNXI_FUNCTION(0x2, "i2c1")), /* SDA */
  624. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 4),
  625. SUNXI_FUNCTION(0x0, "gpio_in"),
  626. SUNXI_FUNCTION(0x1, "gpio_out"),
  627. SUNXI_FUNCTION(0x2, "i2c2")), /* SCK */
  628. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 5),
  629. SUNXI_FUNCTION(0x0, "gpio_in"),
  630. SUNXI_FUNCTION(0x1, "gpio_out"),
  631. SUNXI_FUNCTION(0x2, "i2c2")), /* SDA */
  632. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 6),
  633. SUNXI_FUNCTION(0x0, "gpio_in"),
  634. SUNXI_FUNCTION(0x1, "gpio_out"),
  635. SUNXI_FUNCTION(0x2, "pwm0")),
  636. /* Hole */
  637. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 8),
  638. SUNXI_FUNCTION(0x0, "gpio_in"),
  639. SUNXI_FUNCTION(0x1, "gpio_out"),
  640. SUNXI_FUNCTION(0x3, "pwm1"), /* Positive */
  641. SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 8)), /* PH_EINT8 */
  642. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 9),
  643. SUNXI_FUNCTION(0x0, "gpio_in"),
  644. SUNXI_FUNCTION(0x1, "gpio_out"),
  645. SUNXI_FUNCTION(0x3, "pwm1"), /* Negative */
  646. SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 9)), /* PH_EINT9 */
  647. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 10),
  648. SUNXI_FUNCTION(0x0, "gpio_in"),
  649. SUNXI_FUNCTION(0x1, "gpio_out"),
  650. SUNXI_FUNCTION(0x3, "pwm2"), /* Positive */
  651. SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 10)), /* PH_EINT10 */
  652. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 11),
  653. SUNXI_FUNCTION(0x0, "gpio_in"),
  654. SUNXI_FUNCTION(0x1, "gpio_out"),
  655. SUNXI_FUNCTION(0x3, "pwm2"), /* Negative */
  656. SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 11)), /* PH_EINT12 */
  657. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 12),
  658. SUNXI_FUNCTION(0x0, "gpio_in"),
  659. SUNXI_FUNCTION(0x1, "gpio_out"),
  660. SUNXI_FUNCTION(0x2, "uart0"), /* TX */
  661. SUNXI_FUNCTION(0x3, "spi3"), /* CS2 */
  662. SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 12)), /* PH_EINT12 */
  663. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 13),
  664. SUNXI_FUNCTION(0x0, "gpio_in"),
  665. SUNXI_FUNCTION(0x1, "gpio_out"),
  666. SUNXI_FUNCTION(0x2, "uart0"), /* RX */
  667. SUNXI_FUNCTION(0x3, "spi3"), /* CS2 */
  668. SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 13)), /* PH_EINT13 */
  669. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 14),
  670. SUNXI_FUNCTION(0x0, "gpio_in"),
  671. SUNXI_FUNCTION(0x1, "gpio_out"),
  672. SUNXI_FUNCTION(0x2, "spi3"), /* CLK */
  673. SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 14)), /* PH_EINT14 */
  674. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 15),
  675. SUNXI_FUNCTION(0x0, "gpio_in"),
  676. SUNXI_FUNCTION(0x1, "gpio_out"),
  677. SUNXI_FUNCTION(0x2, "spi3"), /* MOSI */
  678. SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 15)), /* PH_EINT15 */
  679. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 16),
  680. SUNXI_FUNCTION(0x0, "gpio_in"),
  681. SUNXI_FUNCTION(0x1, "gpio_out"),
  682. SUNXI_FUNCTION(0x2, "spi3"), /* MISO */
  683. SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 16)), /* PH_EINT16 */
  684. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 17),
  685. SUNXI_FUNCTION(0x0, "gpio_in"),
  686. SUNXI_FUNCTION(0x1, "gpio_out"),
  687. SUNXI_FUNCTION(0x2, "spi3"), /* CS0 */
  688. SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 17)), /* PH_EINT17 */
  689. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 18),
  690. SUNXI_FUNCTION(0x0, "gpio_in"),
  691. SUNXI_FUNCTION(0x1, "gpio_out"),
  692. SUNXI_FUNCTION(0x2, "spi3"), /* CS1 */
  693. SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 18)), /* PH_EINT18 */
  694. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 19),
  695. SUNXI_FUNCTION(0x0, "gpio_in"),
  696. SUNXI_FUNCTION(0x1, "gpio_out"),
  697. SUNXI_FUNCTION(0x2, "hdmi")), /* SCL */
  698. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 20),
  699. SUNXI_FUNCTION(0x0, "gpio_in"),
  700. SUNXI_FUNCTION(0x1, "gpio_out"),
  701. SUNXI_FUNCTION(0x2, "hdmi")), /* SDA */
  702. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 21),
  703. SUNXI_FUNCTION(0x0, "gpio_in"),
  704. SUNXI_FUNCTION(0x1, "gpio_out"),
  705. SUNXI_FUNCTION(0x2, "hdmi")), /* CEC */
  706. };
  707. static const struct sunxi_pinctrl_desc sun9i_a80_pinctrl_data = {
  708. .pins = sun9i_a80_pins,
  709. .npins = ARRAY_SIZE(sun9i_a80_pins),
  710. .irq_banks = 5,
  711. };
  712. static int sun9i_a80_pinctrl_probe(struct platform_device *pdev)
  713. {
  714. return sunxi_pinctrl_init(pdev,
  715. &sun9i_a80_pinctrl_data);
  716. }
  717. static const struct of_device_id sun9i_a80_pinctrl_match[] = {
  718. { .compatible = "allwinner,sun9i-a80-pinctrl", },
  719. {}
  720. };
  721. MODULE_DEVICE_TABLE(of, sun9i_a80_pinctrl_match);
  722. static struct platform_driver sun9i_a80_pinctrl_driver = {
  723. .probe = sun9i_a80_pinctrl_probe,
  724. .driver = {
  725. .name = "sun9i-a80-pinctrl",
  726. .of_match_table = sun9i_a80_pinctrl_match,
  727. },
  728. };
  729. module_platform_driver(sun9i_a80_pinctrl_driver);
  730. MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com>");
  731. MODULE_DESCRIPTION("Allwinner A80 pinctrl driver");
  732. MODULE_LICENSE("GPL");