pinctrl-sun7i-a20.c 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062
  1. /*
  2. * Allwinner A20 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 sun7i_a20_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, "emac"), /* ERXD3 */
  23. SUNXI_FUNCTION(0x3, "spi1"), /* CS0 */
  24. SUNXI_FUNCTION(0x4, "uart2"), /* RTS */
  25. SUNXI_FUNCTION(0x5, "gmac")), /* GRXD3 */
  26. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 1),
  27. SUNXI_FUNCTION(0x0, "gpio_in"),
  28. SUNXI_FUNCTION(0x1, "gpio_out"),
  29. SUNXI_FUNCTION(0x2, "emac"), /* ERXD2 */
  30. SUNXI_FUNCTION(0x3, "spi1"), /* CLK */
  31. SUNXI_FUNCTION(0x4, "uart2"), /* CTS */
  32. SUNXI_FUNCTION(0x5, "gmac")), /* GRXD2 */
  33. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 2),
  34. SUNXI_FUNCTION(0x0, "gpio_in"),
  35. SUNXI_FUNCTION(0x1, "gpio_out"),
  36. SUNXI_FUNCTION(0x2, "emac"), /* ERXD1 */
  37. SUNXI_FUNCTION(0x3, "spi1"), /* MOSI */
  38. SUNXI_FUNCTION(0x4, "uart2"), /* TX */
  39. SUNXI_FUNCTION(0x5, "gmac")), /* GRXD1 */
  40. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 3),
  41. SUNXI_FUNCTION(0x0, "gpio_in"),
  42. SUNXI_FUNCTION(0x1, "gpio_out"),
  43. SUNXI_FUNCTION(0x2, "emac"), /* ERXD0 */
  44. SUNXI_FUNCTION(0x3, "spi1"), /* MISO */
  45. SUNXI_FUNCTION(0x4, "uart2"), /* RX */
  46. SUNXI_FUNCTION(0x5, "gmac")), /* GRXD0 */
  47. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 4),
  48. SUNXI_FUNCTION(0x0, "gpio_in"),
  49. SUNXI_FUNCTION(0x1, "gpio_out"),
  50. SUNXI_FUNCTION(0x2, "emac"), /* ETXD3 */
  51. SUNXI_FUNCTION(0x3, "spi1"), /* CS1 */
  52. SUNXI_FUNCTION(0x5, "gmac")), /* GTXD3 */
  53. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 5),
  54. SUNXI_FUNCTION(0x0, "gpio_in"),
  55. SUNXI_FUNCTION(0x1, "gpio_out"),
  56. SUNXI_FUNCTION(0x2, "emac"), /* ETXD2 */
  57. SUNXI_FUNCTION(0x3, "spi3"), /* CS0 */
  58. SUNXI_FUNCTION(0x5, "gmac")), /* GTXD2 */
  59. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 6),
  60. SUNXI_FUNCTION(0x0, "gpio_in"),
  61. SUNXI_FUNCTION(0x1, "gpio_out"),
  62. SUNXI_FUNCTION(0x2, "emac"), /* ETXD1 */
  63. SUNXI_FUNCTION(0x3, "spi3"), /* CLK */
  64. SUNXI_FUNCTION(0x5, "gmac")), /* GTXD1 */
  65. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 7),
  66. SUNXI_FUNCTION(0x0, "gpio_in"),
  67. SUNXI_FUNCTION(0x1, "gpio_out"),
  68. SUNXI_FUNCTION(0x2, "emac"), /* ETXD0 */
  69. SUNXI_FUNCTION(0x3, "spi3"), /* MOSI */
  70. SUNXI_FUNCTION(0x5, "gmac")), /* GTXD0 */
  71. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 8),
  72. SUNXI_FUNCTION(0x0, "gpio_in"),
  73. SUNXI_FUNCTION(0x1, "gpio_out"),
  74. SUNXI_FUNCTION(0x2, "emac"), /* ERXCK */
  75. SUNXI_FUNCTION(0x3, "spi3"), /* MISO */
  76. SUNXI_FUNCTION(0x5, "gmac")), /* GRXCK */
  77. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 9),
  78. SUNXI_FUNCTION(0x0, "gpio_in"),
  79. SUNXI_FUNCTION(0x1, "gpio_out"),
  80. SUNXI_FUNCTION(0x2, "emac"), /* ERXERR */
  81. SUNXI_FUNCTION(0x3, "spi3"), /* CS1 */
  82. SUNXI_FUNCTION(0x5, "gmac"), /* GNULL / ERXERR */
  83. SUNXI_FUNCTION(0x6, "i2s1")), /* MCLK */
  84. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 10),
  85. SUNXI_FUNCTION(0x0, "gpio_in"),
  86. SUNXI_FUNCTION(0x1, "gpio_out"),
  87. SUNXI_FUNCTION(0x2, "emac"), /* ERXDV */
  88. SUNXI_FUNCTION(0x4, "uart1"), /* TX */
  89. SUNXI_FUNCTION(0x5, "gmac")), /* GRXCTL / ERXDV */
  90. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 11),
  91. SUNXI_FUNCTION(0x0, "gpio_in"),
  92. SUNXI_FUNCTION(0x1, "gpio_out"),
  93. SUNXI_FUNCTION(0x2, "emac"), /* EMDC */
  94. SUNXI_FUNCTION(0x4, "uart1"), /* RX */
  95. SUNXI_FUNCTION(0x5, "gmac")), /* EMDC */
  96. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 12),
  97. SUNXI_FUNCTION(0x0, "gpio_in"),
  98. SUNXI_FUNCTION(0x1, "gpio_out"),
  99. SUNXI_FUNCTION(0x2, "emac"), /* EMDIO */
  100. SUNXI_FUNCTION(0x3, "uart6"), /* TX */
  101. SUNXI_FUNCTION(0x4, "uart1"), /* RTS */
  102. SUNXI_FUNCTION(0x5, "gmac")), /* EMDIO */
  103. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 13),
  104. SUNXI_FUNCTION(0x0, "gpio_in"),
  105. SUNXI_FUNCTION(0x1, "gpio_out"),
  106. SUNXI_FUNCTION(0x2, "emac"), /* ETXEN */
  107. SUNXI_FUNCTION(0x3, "uart6"), /* RX */
  108. SUNXI_FUNCTION(0x4, "uart1"), /* CTS */
  109. SUNXI_FUNCTION(0x5, "gmac")), /* GTXCTL / ETXEN */
  110. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 14),
  111. SUNXI_FUNCTION(0x0, "gpio_in"),
  112. SUNXI_FUNCTION(0x1, "gpio_out"),
  113. SUNXI_FUNCTION(0x2, "emac"), /* ETXCK */
  114. SUNXI_FUNCTION(0x3, "uart7"), /* TX */
  115. SUNXI_FUNCTION(0x4, "uart1"), /* DTR */
  116. SUNXI_FUNCTION(0x5, "gmac"), /* GNULL / ETXCK */
  117. SUNXI_FUNCTION(0x6, "i2s1")), /* BCLK */
  118. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 15),
  119. SUNXI_FUNCTION(0x0, "gpio_in"),
  120. SUNXI_FUNCTION(0x1, "gpio_out"),
  121. SUNXI_FUNCTION(0x2, "emac"), /* ECRS */
  122. SUNXI_FUNCTION(0x3, "uart7"), /* RX */
  123. SUNXI_FUNCTION(0x4, "uart1"), /* DSR */
  124. SUNXI_FUNCTION(0x5, "gmac"), /* GTXCK / ECRS */
  125. SUNXI_FUNCTION(0x6, "i2s1")), /* LRCK */
  126. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 16),
  127. SUNXI_FUNCTION(0x0, "gpio_in"),
  128. SUNXI_FUNCTION(0x1, "gpio_out"),
  129. SUNXI_FUNCTION(0x2, "emac"), /* ECOL */
  130. SUNXI_FUNCTION(0x3, "can"), /* TX */
  131. SUNXI_FUNCTION(0x4, "uart1"), /* DCD */
  132. SUNXI_FUNCTION(0x5, "gmac"), /* GCLKIN / ECOL */
  133. SUNXI_FUNCTION(0x6, "i2s1")), /* DO */
  134. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 17),
  135. SUNXI_FUNCTION(0x0, "gpio_in"),
  136. SUNXI_FUNCTION(0x1, "gpio_out"),
  137. SUNXI_FUNCTION(0x2, "emac"), /* ETXERR */
  138. SUNXI_FUNCTION(0x3, "can"), /* RX */
  139. SUNXI_FUNCTION(0x4, "uart1"), /* RING */
  140. SUNXI_FUNCTION(0x5, "gmac"), /* GNULL / ETXERR */
  141. SUNXI_FUNCTION(0x6, "i2s1")), /* LRCK */
  142. /* Hole */
  143. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 0),
  144. SUNXI_FUNCTION(0x0, "gpio_in"),
  145. SUNXI_FUNCTION(0x1, "gpio_out"),
  146. SUNXI_FUNCTION(0x2, "i2c0")), /* SCK */
  147. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 1),
  148. SUNXI_FUNCTION(0x0, "gpio_in"),
  149. SUNXI_FUNCTION(0x1, "gpio_out"),
  150. SUNXI_FUNCTION(0x2, "i2c0")), /* SDA */
  151. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 2),
  152. SUNXI_FUNCTION(0x0, "gpio_in"),
  153. SUNXI_FUNCTION(0x1, "gpio_out"),
  154. SUNXI_FUNCTION(0x2, "pwm")), /* PWM0 */
  155. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 3),
  156. SUNXI_FUNCTION(0x0, "gpio_in"),
  157. SUNXI_FUNCTION(0x1, "gpio_out"),
  158. SUNXI_FUNCTION(0x2, "ir0"), /* TX */
  159. SUNXI_FUNCTION(0x4, "spdif")), /* MCLK */
  160. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 4),
  161. SUNXI_FUNCTION(0x0, "gpio_in"),
  162. SUNXI_FUNCTION(0x1, "gpio_out"),
  163. SUNXI_FUNCTION(0x2, "ir0")), /* RX */
  164. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 5),
  165. SUNXI_FUNCTION(0x0, "gpio_in"),
  166. SUNXI_FUNCTION(0x1, "gpio_out"),
  167. SUNXI_FUNCTION(0x2, "i2s0"), /* MCLK */
  168. SUNXI_FUNCTION(0x3, "ac97")), /* MCLK */
  169. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 6),
  170. SUNXI_FUNCTION(0x0, "gpio_in"),
  171. SUNXI_FUNCTION(0x1, "gpio_out"),
  172. SUNXI_FUNCTION(0x2, "i2s0"), /* BCLK */
  173. SUNXI_FUNCTION(0x3, "ac97")), /* BCLK */
  174. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 7),
  175. SUNXI_FUNCTION(0x0, "gpio_in"),
  176. SUNXI_FUNCTION(0x1, "gpio_out"),
  177. SUNXI_FUNCTION(0x2, "i2s0"), /* LRCK */
  178. SUNXI_FUNCTION(0x3, "ac97")), /* SYNC */
  179. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 8),
  180. SUNXI_FUNCTION(0x0, "gpio_in"),
  181. SUNXI_FUNCTION(0x1, "gpio_out"),
  182. SUNXI_FUNCTION(0x2, "i2s0"), /* DO0 */
  183. SUNXI_FUNCTION(0x3, "ac97")), /* DO */
  184. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 9),
  185. SUNXI_FUNCTION(0x0, "gpio_in"),
  186. SUNXI_FUNCTION(0x1, "gpio_out"),
  187. SUNXI_FUNCTION(0x2, "i2s0")), /* DO1 */
  188. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 10),
  189. SUNXI_FUNCTION(0x0, "gpio_in"),
  190. SUNXI_FUNCTION(0x1, "gpio_out"),
  191. SUNXI_FUNCTION(0x2, "i2s0")), /* DO2 */
  192. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 11),
  193. SUNXI_FUNCTION(0x0, "gpio_in"),
  194. SUNXI_FUNCTION(0x1, "gpio_out"),
  195. SUNXI_FUNCTION(0x2, "i2s0")), /* DO3 */
  196. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 12),
  197. SUNXI_FUNCTION(0x0, "gpio_in"),
  198. SUNXI_FUNCTION(0x1, "gpio_out"),
  199. SUNXI_FUNCTION(0x2, "i2s0"), /* DI */
  200. SUNXI_FUNCTION(0x3, "ac97"), /* DI */
  201. SUNXI_FUNCTION(0x4, "spdif")), /* DI */
  202. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 13),
  203. SUNXI_FUNCTION(0x0, "gpio_in"),
  204. SUNXI_FUNCTION(0x1, "gpio_out"),
  205. SUNXI_FUNCTION(0x2, "spi2"), /* CS1 */
  206. SUNXI_FUNCTION(0x4, "spdif")), /* DO */
  207. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 14),
  208. SUNXI_FUNCTION(0x0, "gpio_in"),
  209. SUNXI_FUNCTION(0x1, "gpio_out"),
  210. SUNXI_FUNCTION(0x2, "spi2"), /* CS0 */
  211. SUNXI_FUNCTION(0x3, "jtag")), /* MS0 */
  212. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 15),
  213. SUNXI_FUNCTION(0x0, "gpio_in"),
  214. SUNXI_FUNCTION(0x1, "gpio_out"),
  215. SUNXI_FUNCTION(0x2, "spi2"), /* CLK */
  216. SUNXI_FUNCTION(0x3, "jtag")), /* CK0 */
  217. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 16),
  218. SUNXI_FUNCTION(0x0, "gpio_in"),
  219. SUNXI_FUNCTION(0x1, "gpio_out"),
  220. SUNXI_FUNCTION(0x2, "spi2"), /* MOSI */
  221. SUNXI_FUNCTION(0x3, "jtag")), /* DO0 */
  222. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 17),
  223. SUNXI_FUNCTION(0x0, "gpio_in"),
  224. SUNXI_FUNCTION(0x1, "gpio_out"),
  225. SUNXI_FUNCTION(0x2, "spi2"), /* MISO */
  226. SUNXI_FUNCTION(0x3, "jtag")), /* DI0 */
  227. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 18),
  228. SUNXI_FUNCTION(0x0, "gpio_in"),
  229. SUNXI_FUNCTION(0x1, "gpio_out"),
  230. SUNXI_FUNCTION(0x2, "i2c1")), /* SCK */
  231. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 19),
  232. SUNXI_FUNCTION(0x0, "gpio_in"),
  233. SUNXI_FUNCTION(0x1, "gpio_out"),
  234. SUNXI_FUNCTION(0x2, "i2c1")), /* SDA */
  235. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 20),
  236. SUNXI_FUNCTION(0x0, "gpio_in"),
  237. SUNXI_FUNCTION(0x1, "gpio_out"),
  238. SUNXI_FUNCTION(0x2, "i2c2")), /* SCK */
  239. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 21),
  240. SUNXI_FUNCTION(0x0, "gpio_in"),
  241. SUNXI_FUNCTION(0x1, "gpio_out"),
  242. SUNXI_FUNCTION(0x2, "i2c2")), /* SDA */
  243. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 22),
  244. SUNXI_FUNCTION(0x0, "gpio_in"),
  245. SUNXI_FUNCTION(0x1, "gpio_out"),
  246. SUNXI_FUNCTION(0x2, "uart0"), /* TX */
  247. SUNXI_FUNCTION(0x3, "ir1")), /* TX */
  248. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 23),
  249. SUNXI_FUNCTION(0x0, "gpio_in"),
  250. SUNXI_FUNCTION(0x1, "gpio_out"),
  251. SUNXI_FUNCTION(0x2, "uart0"), /* RX */
  252. SUNXI_FUNCTION(0x3, "ir1")), /* RX */
  253. /* Hole */
  254. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0),
  255. SUNXI_FUNCTION(0x0, "gpio_in"),
  256. SUNXI_FUNCTION(0x1, "gpio_out"),
  257. SUNXI_FUNCTION(0x2, "nand0"), /* NWE */
  258. SUNXI_FUNCTION(0x3, "spi0")), /* MOSI */
  259. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1),
  260. SUNXI_FUNCTION(0x0, "gpio_in"),
  261. SUNXI_FUNCTION(0x1, "gpio_out"),
  262. SUNXI_FUNCTION(0x2, "nand0"), /* NALE */
  263. SUNXI_FUNCTION(0x3, "spi0")), /* MISO */
  264. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2),
  265. SUNXI_FUNCTION(0x0, "gpio_in"),
  266. SUNXI_FUNCTION(0x1, "gpio_out"),
  267. SUNXI_FUNCTION(0x2, "nand0"), /* NCLE */
  268. SUNXI_FUNCTION(0x3, "spi0")), /* SCK */
  269. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3),
  270. SUNXI_FUNCTION(0x0, "gpio_in"),
  271. SUNXI_FUNCTION(0x1, "gpio_out"),
  272. SUNXI_FUNCTION(0x2, "nand0")), /* NCE1 */
  273. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 4),
  274. SUNXI_FUNCTION(0x0, "gpio_in"),
  275. SUNXI_FUNCTION(0x1, "gpio_out"),
  276. SUNXI_FUNCTION(0x2, "nand0")), /* NCE0 */
  277. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 5),
  278. SUNXI_FUNCTION(0x0, "gpio_in"),
  279. SUNXI_FUNCTION(0x1, "gpio_out"),
  280. SUNXI_FUNCTION(0x2, "nand0")), /* NRE# */
  281. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 6),
  282. SUNXI_FUNCTION(0x0, "gpio_in"),
  283. SUNXI_FUNCTION(0x1, "gpio_out"),
  284. SUNXI_FUNCTION(0x2, "nand0"), /* NRB0 */
  285. SUNXI_FUNCTION(0x3, "mmc2")), /* CMD */
  286. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 7),
  287. SUNXI_FUNCTION(0x0, "gpio_in"),
  288. SUNXI_FUNCTION(0x1, "gpio_out"),
  289. SUNXI_FUNCTION(0x2, "nand0"), /* NRB1 */
  290. SUNXI_FUNCTION(0x3, "mmc2")), /* CLK */
  291. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 8),
  292. SUNXI_FUNCTION(0x0, "gpio_in"),
  293. SUNXI_FUNCTION(0x1, "gpio_out"),
  294. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ0 */
  295. SUNXI_FUNCTION(0x3, "mmc2")), /* D0 */
  296. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 9),
  297. SUNXI_FUNCTION(0x0, "gpio_in"),
  298. SUNXI_FUNCTION(0x1, "gpio_out"),
  299. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ1 */
  300. SUNXI_FUNCTION(0x3, "mmc2")), /* D1 */
  301. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 10),
  302. SUNXI_FUNCTION(0x0, "gpio_in"),
  303. SUNXI_FUNCTION(0x1, "gpio_out"),
  304. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ2 */
  305. SUNXI_FUNCTION(0x3, "mmc2")), /* D2 */
  306. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 11),
  307. SUNXI_FUNCTION(0x0, "gpio_in"),
  308. SUNXI_FUNCTION(0x1, "gpio_out"),
  309. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ3 */
  310. SUNXI_FUNCTION(0x3, "mmc2")), /* D3 */
  311. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 12),
  312. SUNXI_FUNCTION(0x0, "gpio_in"),
  313. SUNXI_FUNCTION(0x1, "gpio_out"),
  314. SUNXI_FUNCTION(0x2, "nand0")), /* NDQ4 */
  315. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 13),
  316. SUNXI_FUNCTION(0x0, "gpio_in"),
  317. SUNXI_FUNCTION(0x1, "gpio_out"),
  318. SUNXI_FUNCTION(0x2, "nand0")), /* NDQ5 */
  319. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 14),
  320. SUNXI_FUNCTION(0x0, "gpio_in"),
  321. SUNXI_FUNCTION(0x1, "gpio_out"),
  322. SUNXI_FUNCTION(0x2, "nand0")), /* NDQ6 */
  323. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 15),
  324. SUNXI_FUNCTION(0x0, "gpio_in"),
  325. SUNXI_FUNCTION(0x1, "gpio_out"),
  326. SUNXI_FUNCTION(0x2, "nand0")), /* NDQ7 */
  327. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 16),
  328. SUNXI_FUNCTION(0x0, "gpio_in"),
  329. SUNXI_FUNCTION(0x1, "gpio_out"),
  330. SUNXI_FUNCTION(0x2, "nand0")), /* NWP */
  331. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 17),
  332. SUNXI_FUNCTION(0x0, "gpio_in"),
  333. SUNXI_FUNCTION(0x1, "gpio_out"),
  334. SUNXI_FUNCTION(0x2, "nand0")), /* NCE2 */
  335. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 18),
  336. SUNXI_FUNCTION(0x0, "gpio_in"),
  337. SUNXI_FUNCTION(0x1, "gpio_out"),
  338. SUNXI_FUNCTION(0x2, "nand0")), /* NCE3 */
  339. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 19),
  340. SUNXI_FUNCTION(0x0, "gpio_in"),
  341. SUNXI_FUNCTION(0x1, "gpio_out"),
  342. SUNXI_FUNCTION(0x2, "nand0"), /* NCE4 */
  343. SUNXI_FUNCTION(0x3, "spi2")), /* CS0 */
  344. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 20),
  345. SUNXI_FUNCTION(0x0, "gpio_in"),
  346. SUNXI_FUNCTION(0x1, "gpio_out"),
  347. SUNXI_FUNCTION(0x2, "nand0"), /* NCE5 */
  348. SUNXI_FUNCTION(0x3, "spi2")), /* CLK */
  349. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 21),
  350. SUNXI_FUNCTION(0x0, "gpio_in"),
  351. SUNXI_FUNCTION(0x1, "gpio_out"),
  352. SUNXI_FUNCTION(0x2, "nand0"), /* NCE6 */
  353. SUNXI_FUNCTION(0x3, "spi2")), /* MOSI */
  354. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 22),
  355. SUNXI_FUNCTION(0x0, "gpio_in"),
  356. SUNXI_FUNCTION(0x1, "gpio_out"),
  357. SUNXI_FUNCTION(0x2, "nand0"), /* NCE7 */
  358. SUNXI_FUNCTION(0x3, "spi2")), /* MISO */
  359. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 23),
  360. SUNXI_FUNCTION(0x0, "gpio_in"),
  361. SUNXI_FUNCTION(0x1, "gpio_out"),
  362. SUNXI_FUNCTION(0x3, "spi0")), /* CS0 */
  363. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 24),
  364. SUNXI_FUNCTION(0x0, "gpio_in"),
  365. SUNXI_FUNCTION(0x1, "gpio_out"),
  366. SUNXI_FUNCTION(0x2, "nand0")), /* NDQS */
  367. /* Hole */
  368. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 0),
  369. SUNXI_FUNCTION(0x0, "gpio_in"),
  370. SUNXI_FUNCTION(0x1, "gpio_out"),
  371. SUNXI_FUNCTION(0x2, "lcd0"), /* D0 */
  372. SUNXI_FUNCTION(0x3, "lvds0")), /* VP0 */
  373. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 1),
  374. SUNXI_FUNCTION(0x0, "gpio_in"),
  375. SUNXI_FUNCTION(0x1, "gpio_out"),
  376. SUNXI_FUNCTION(0x2, "lcd0"), /* D1 */
  377. SUNXI_FUNCTION(0x3, "lvds0")), /* VN0 */
  378. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 2),
  379. SUNXI_FUNCTION(0x0, "gpio_in"),
  380. SUNXI_FUNCTION(0x1, "gpio_out"),
  381. SUNXI_FUNCTION(0x2, "lcd0"), /* D2 */
  382. SUNXI_FUNCTION(0x3, "lvds0")), /* VP1 */
  383. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 3),
  384. SUNXI_FUNCTION(0x0, "gpio_in"),
  385. SUNXI_FUNCTION(0x1, "gpio_out"),
  386. SUNXI_FUNCTION(0x2, "lcd0"), /* D3 */
  387. SUNXI_FUNCTION(0x3, "lvds0")), /* VN1 */
  388. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 4),
  389. SUNXI_FUNCTION(0x0, "gpio_in"),
  390. SUNXI_FUNCTION(0x1, "gpio_out"),
  391. SUNXI_FUNCTION(0x2, "lcd0"), /* D4 */
  392. SUNXI_FUNCTION(0x3, "lvds0")), /* VP2 */
  393. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 5),
  394. SUNXI_FUNCTION(0x0, "gpio_in"),
  395. SUNXI_FUNCTION(0x1, "gpio_out"),
  396. SUNXI_FUNCTION(0x2, "lcd0"), /* D5 */
  397. SUNXI_FUNCTION(0x3, "lvds0")), /* VN2 */
  398. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 6),
  399. SUNXI_FUNCTION(0x0, "gpio_in"),
  400. SUNXI_FUNCTION(0x1, "gpio_out"),
  401. SUNXI_FUNCTION(0x2, "lcd0"), /* D6 */
  402. SUNXI_FUNCTION(0x3, "lvds0")), /* VPC */
  403. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 7),
  404. SUNXI_FUNCTION(0x0, "gpio_in"),
  405. SUNXI_FUNCTION(0x1, "gpio_out"),
  406. SUNXI_FUNCTION(0x2, "lcd0"), /* D7 */
  407. SUNXI_FUNCTION(0x3, "lvds0")), /* VNC */
  408. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 8),
  409. SUNXI_FUNCTION(0x0, "gpio_in"),
  410. SUNXI_FUNCTION(0x1, "gpio_out"),
  411. SUNXI_FUNCTION(0x2, "lcd0"), /* D8 */
  412. SUNXI_FUNCTION(0x3, "lvds0")), /* VP3 */
  413. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 9),
  414. SUNXI_FUNCTION(0x0, "gpio_in"),
  415. SUNXI_FUNCTION(0x1, "gpio_out"),
  416. SUNXI_FUNCTION(0x2, "lcd0"), /* D9 */
  417. SUNXI_FUNCTION(0x3, "lvds0")), /* VM3 */
  418. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 10),
  419. SUNXI_FUNCTION(0x0, "gpio_in"),
  420. SUNXI_FUNCTION(0x1, "gpio_out"),
  421. SUNXI_FUNCTION(0x2, "lcd0"), /* D10 */
  422. SUNXI_FUNCTION(0x3, "lvds1")), /* VP0 */
  423. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 11),
  424. SUNXI_FUNCTION(0x0, "gpio_in"),
  425. SUNXI_FUNCTION(0x1, "gpio_out"),
  426. SUNXI_FUNCTION(0x2, "lcd0"), /* D11 */
  427. SUNXI_FUNCTION(0x3, "lvds1")), /* VN0 */
  428. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 12),
  429. SUNXI_FUNCTION(0x0, "gpio_in"),
  430. SUNXI_FUNCTION(0x1, "gpio_out"),
  431. SUNXI_FUNCTION(0x2, "lcd0"), /* D12 */
  432. SUNXI_FUNCTION(0x3, "lvds1")), /* VP1 */
  433. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 13),
  434. SUNXI_FUNCTION(0x0, "gpio_in"),
  435. SUNXI_FUNCTION(0x1, "gpio_out"),
  436. SUNXI_FUNCTION(0x2, "lcd0"), /* D13 */
  437. SUNXI_FUNCTION(0x3, "lvds1")), /* VN1 */
  438. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 14),
  439. SUNXI_FUNCTION(0x0, "gpio_in"),
  440. SUNXI_FUNCTION(0x1, "gpio_out"),
  441. SUNXI_FUNCTION(0x2, "lcd0"), /* D14 */
  442. SUNXI_FUNCTION(0x3, "lvds1")), /* VP2 */
  443. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 15),
  444. SUNXI_FUNCTION(0x0, "gpio_in"),
  445. SUNXI_FUNCTION(0x1, "gpio_out"),
  446. SUNXI_FUNCTION(0x2, "lcd0"), /* D15 */
  447. SUNXI_FUNCTION(0x3, "lvds1")), /* VN2 */
  448. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 16),
  449. SUNXI_FUNCTION(0x0, "gpio_in"),
  450. SUNXI_FUNCTION(0x1, "gpio_out"),
  451. SUNXI_FUNCTION(0x2, "lcd0"), /* D16 */
  452. SUNXI_FUNCTION(0x3, "lvds1")), /* VPC */
  453. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 17),
  454. SUNXI_FUNCTION(0x0, "gpio_in"),
  455. SUNXI_FUNCTION(0x1, "gpio_out"),
  456. SUNXI_FUNCTION(0x2, "lcd0"), /* D17 */
  457. SUNXI_FUNCTION(0x3, "lvds1")), /* VNC */
  458. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 18),
  459. SUNXI_FUNCTION(0x0, "gpio_in"),
  460. SUNXI_FUNCTION(0x1, "gpio_out"),
  461. SUNXI_FUNCTION(0x2, "lcd0"), /* D18 */
  462. SUNXI_FUNCTION(0x3, "lvds1")), /* VP3 */
  463. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 19),
  464. SUNXI_FUNCTION(0x0, "gpio_in"),
  465. SUNXI_FUNCTION(0x1, "gpio_out"),
  466. SUNXI_FUNCTION(0x2, "lcd0"), /* D19 */
  467. SUNXI_FUNCTION(0x3, "lvds1")), /* VN3 */
  468. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 20),
  469. SUNXI_FUNCTION(0x0, "gpio_in"),
  470. SUNXI_FUNCTION(0x1, "gpio_out"),
  471. SUNXI_FUNCTION(0x2, "lcd0"), /* D20 */
  472. SUNXI_FUNCTION(0x3, "csi1")), /* MCLK */
  473. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 21),
  474. SUNXI_FUNCTION(0x0, "gpio_in"),
  475. SUNXI_FUNCTION(0x1, "gpio_out"),
  476. SUNXI_FUNCTION(0x2, "lcd0"), /* D21 */
  477. SUNXI_FUNCTION(0x3, "sim")), /* VPPEN */
  478. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 22),
  479. SUNXI_FUNCTION(0x0, "gpio_in"),
  480. SUNXI_FUNCTION(0x1, "gpio_out"),
  481. SUNXI_FUNCTION(0x2, "lcd0"), /* D22 */
  482. SUNXI_FUNCTION(0x3, "sim")), /* VPPPP */
  483. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 23),
  484. SUNXI_FUNCTION(0x0, "gpio_in"),
  485. SUNXI_FUNCTION(0x1, "gpio_out"),
  486. SUNXI_FUNCTION(0x2, "lcd0"), /* D23 */
  487. SUNXI_FUNCTION(0x3, "sim")), /* DET */
  488. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 24),
  489. SUNXI_FUNCTION(0x0, "gpio_in"),
  490. SUNXI_FUNCTION(0x1, "gpio_out"),
  491. SUNXI_FUNCTION(0x2, "lcd0"), /* CLK */
  492. SUNXI_FUNCTION(0x3, "sim")), /* VCCEN */
  493. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 25),
  494. SUNXI_FUNCTION(0x0, "gpio_in"),
  495. SUNXI_FUNCTION(0x1, "gpio_out"),
  496. SUNXI_FUNCTION(0x2, "lcd0"), /* DE */
  497. SUNXI_FUNCTION(0x3, "sim")), /* RST */
  498. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 26),
  499. SUNXI_FUNCTION(0x0, "gpio_in"),
  500. SUNXI_FUNCTION(0x1, "gpio_out"),
  501. SUNXI_FUNCTION(0x2, "lcd0"), /* HSYNC */
  502. SUNXI_FUNCTION(0x3, "sim")), /* SCK */
  503. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 27),
  504. SUNXI_FUNCTION(0x0, "gpio_in"),
  505. SUNXI_FUNCTION(0x1, "gpio_out"),
  506. SUNXI_FUNCTION(0x2, "lcd0"), /* VSYNC */
  507. SUNXI_FUNCTION(0x3, "sim")), /* SDA */
  508. /* Hole */
  509. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 0),
  510. SUNXI_FUNCTION(0x0, "gpio_in"),
  511. SUNXI_FUNCTION(0x1, "gpio_out"),
  512. SUNXI_FUNCTION(0x2, "ts0"), /* CLK */
  513. SUNXI_FUNCTION(0x3, "csi0")), /* PCK */
  514. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 1),
  515. SUNXI_FUNCTION(0x0, "gpio_in"),
  516. SUNXI_FUNCTION(0x1, "gpio_out"),
  517. SUNXI_FUNCTION(0x2, "ts0"), /* ERR */
  518. SUNXI_FUNCTION(0x3, "csi0")), /* CK */
  519. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 2),
  520. SUNXI_FUNCTION(0x0, "gpio_in"),
  521. SUNXI_FUNCTION(0x1, "gpio_out"),
  522. SUNXI_FUNCTION(0x2, "ts0"), /* SYNC */
  523. SUNXI_FUNCTION(0x3, "csi0")), /* HSYNC */
  524. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 3),
  525. SUNXI_FUNCTION(0x0, "gpio_in"),
  526. SUNXI_FUNCTION(0x1, "gpio_out"),
  527. SUNXI_FUNCTION(0x2, "ts0"), /* DVLD */
  528. SUNXI_FUNCTION(0x3, "csi0")), /* VSYNC */
  529. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 4),
  530. SUNXI_FUNCTION(0x0, "gpio_in"),
  531. SUNXI_FUNCTION(0x1, "gpio_out"),
  532. SUNXI_FUNCTION(0x2, "ts0"), /* D0 */
  533. SUNXI_FUNCTION(0x3, "csi0")), /* D0 */
  534. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 5),
  535. SUNXI_FUNCTION(0x0, "gpio_in"),
  536. SUNXI_FUNCTION(0x1, "gpio_out"),
  537. SUNXI_FUNCTION(0x2, "ts0"), /* D1 */
  538. SUNXI_FUNCTION(0x3, "csi0"), /* D1 */
  539. SUNXI_FUNCTION(0x4, "sim")), /* VPPEN */
  540. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 6),
  541. SUNXI_FUNCTION(0x0, "gpio_in"),
  542. SUNXI_FUNCTION(0x1, "gpio_out"),
  543. SUNXI_FUNCTION(0x2, "ts0"), /* D2 */
  544. SUNXI_FUNCTION(0x3, "csi0")), /* D2 */
  545. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 7),
  546. SUNXI_FUNCTION(0x0, "gpio_in"),
  547. SUNXI_FUNCTION(0x1, "gpio_out"),
  548. SUNXI_FUNCTION(0x2, "ts0"), /* D3 */
  549. SUNXI_FUNCTION(0x3, "csi0")), /* D3 */
  550. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 8),
  551. SUNXI_FUNCTION(0x0, "gpio_in"),
  552. SUNXI_FUNCTION(0x1, "gpio_out"),
  553. SUNXI_FUNCTION(0x2, "ts0"), /* D4 */
  554. SUNXI_FUNCTION(0x3, "csi0")), /* D4 */
  555. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 9),
  556. SUNXI_FUNCTION(0x0, "gpio_in"),
  557. SUNXI_FUNCTION(0x1, "gpio_out"),
  558. SUNXI_FUNCTION(0x2, "ts0"), /* D5 */
  559. SUNXI_FUNCTION(0x3, "csi0")), /* D5 */
  560. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 10),
  561. SUNXI_FUNCTION(0x0, "gpio_in"),
  562. SUNXI_FUNCTION(0x1, "gpio_out"),
  563. SUNXI_FUNCTION(0x2, "ts0"), /* D6 */
  564. SUNXI_FUNCTION(0x3, "csi0")), /* D6 */
  565. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 11),
  566. SUNXI_FUNCTION(0x0, "gpio_in"),
  567. SUNXI_FUNCTION(0x1, "gpio_out"),
  568. SUNXI_FUNCTION(0x2, "ts0"), /* D7 */
  569. SUNXI_FUNCTION(0x3, "csi0")), /* D7 */
  570. /* Hole */
  571. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0),
  572. SUNXI_FUNCTION(0x0, "gpio_in"),
  573. SUNXI_FUNCTION(0x1, "gpio_out"),
  574. SUNXI_FUNCTION(0x2, "mmc0"), /* D1 */
  575. SUNXI_FUNCTION(0x4, "jtag")), /* MSI */
  576. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1),
  577. SUNXI_FUNCTION(0x0, "gpio_in"),
  578. SUNXI_FUNCTION(0x1, "gpio_out"),
  579. SUNXI_FUNCTION(0x2, "mmc0"), /* D0 */
  580. SUNXI_FUNCTION(0x4, "jtag")), /* DI1 */
  581. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2),
  582. SUNXI_FUNCTION(0x0, "gpio_in"),
  583. SUNXI_FUNCTION(0x1, "gpio_out"),
  584. SUNXI_FUNCTION(0x2, "mmc0"), /* CLK */
  585. SUNXI_FUNCTION(0x4, "uart0")), /* TX */
  586. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3),
  587. SUNXI_FUNCTION(0x0, "gpio_in"),
  588. SUNXI_FUNCTION(0x1, "gpio_out"),
  589. SUNXI_FUNCTION(0x2, "mmc0"), /* CMD */
  590. SUNXI_FUNCTION(0x4, "jtag")), /* DO1 */
  591. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4),
  592. SUNXI_FUNCTION(0x0, "gpio_in"),
  593. SUNXI_FUNCTION(0x1, "gpio_out"),
  594. SUNXI_FUNCTION(0x2, "mmc0"), /* D3 */
  595. SUNXI_FUNCTION(0x4, "uart0")), /* RX */
  596. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5),
  597. SUNXI_FUNCTION(0x0, "gpio_in"),
  598. SUNXI_FUNCTION(0x1, "gpio_out"),
  599. SUNXI_FUNCTION(0x2, "mmc0"), /* D2 */
  600. SUNXI_FUNCTION(0x4, "jtag")), /* CK1 */
  601. /* Hole */
  602. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0),
  603. SUNXI_FUNCTION(0x0, "gpio_in"),
  604. SUNXI_FUNCTION(0x1, "gpio_out"),
  605. SUNXI_FUNCTION(0x2, "ts1"), /* CLK */
  606. SUNXI_FUNCTION(0x3, "csi1"), /* PCK */
  607. SUNXI_FUNCTION(0x4, "mmc1")), /* CMD */
  608. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1),
  609. SUNXI_FUNCTION(0x0, "gpio_in"),
  610. SUNXI_FUNCTION(0x1, "gpio_out"),
  611. SUNXI_FUNCTION(0x2, "ts1"), /* ERR */
  612. SUNXI_FUNCTION(0x3, "csi1"), /* CK */
  613. SUNXI_FUNCTION(0x4, "mmc1")), /* CLK */
  614. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2),
  615. SUNXI_FUNCTION(0x0, "gpio_in"),
  616. SUNXI_FUNCTION(0x1, "gpio_out"),
  617. SUNXI_FUNCTION(0x2, "ts1"), /* SYNC */
  618. SUNXI_FUNCTION(0x3, "csi1"), /* HSYNC */
  619. SUNXI_FUNCTION(0x4, "mmc1")), /* D0 */
  620. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3),
  621. SUNXI_FUNCTION(0x0, "gpio_in"),
  622. SUNXI_FUNCTION(0x1, "gpio_out"),
  623. SUNXI_FUNCTION(0x2, "ts1"), /* DVLD */
  624. SUNXI_FUNCTION(0x3, "csi1"), /* VSYNC */
  625. SUNXI_FUNCTION(0x4, "mmc1")), /* D1 */
  626. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4),
  627. SUNXI_FUNCTION(0x0, "gpio_in"),
  628. SUNXI_FUNCTION(0x1, "gpio_out"),
  629. SUNXI_FUNCTION(0x2, "ts1"), /* D0 */
  630. SUNXI_FUNCTION(0x3, "csi1"), /* D0 */
  631. SUNXI_FUNCTION(0x4, "mmc1"), /* D2 */
  632. SUNXI_FUNCTION(0x5, "csi0")), /* D8 */
  633. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 5),
  634. SUNXI_FUNCTION(0x0, "gpio_in"),
  635. SUNXI_FUNCTION(0x1, "gpio_out"),
  636. SUNXI_FUNCTION(0x2, "ts1"), /* D1 */
  637. SUNXI_FUNCTION(0x3, "csi1"), /* D1 */
  638. SUNXI_FUNCTION(0x4, "mmc1"), /* D3 */
  639. SUNXI_FUNCTION(0x5, "csi0")), /* D9 */
  640. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 6),
  641. SUNXI_FUNCTION(0x0, "gpio_in"),
  642. SUNXI_FUNCTION(0x1, "gpio_out"),
  643. SUNXI_FUNCTION(0x2, "ts1"), /* D2 */
  644. SUNXI_FUNCTION(0x3, "csi1"), /* D2 */
  645. SUNXI_FUNCTION(0x4, "uart3"), /* TX */
  646. SUNXI_FUNCTION(0x5, "csi0")), /* D10 */
  647. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 7),
  648. SUNXI_FUNCTION(0x0, "gpio_in"),
  649. SUNXI_FUNCTION(0x1, "gpio_out"),
  650. SUNXI_FUNCTION(0x2, "ts1"), /* D3 */
  651. SUNXI_FUNCTION(0x3, "csi1"), /* D3 */
  652. SUNXI_FUNCTION(0x4, "uart3"), /* RX */
  653. SUNXI_FUNCTION(0x5, "csi0")), /* D11 */
  654. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 8),
  655. SUNXI_FUNCTION(0x0, "gpio_in"),
  656. SUNXI_FUNCTION(0x1, "gpio_out"),
  657. SUNXI_FUNCTION(0x2, "ts1"), /* D4 */
  658. SUNXI_FUNCTION(0x3, "csi1"), /* D4 */
  659. SUNXI_FUNCTION(0x4, "uart3"), /* RTS */
  660. SUNXI_FUNCTION(0x5, "csi0")), /* D12 */
  661. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 9),
  662. SUNXI_FUNCTION(0x0, "gpio_in"),
  663. SUNXI_FUNCTION(0x1, "gpio_out"),
  664. SUNXI_FUNCTION(0x2, "ts1"), /* D5 */
  665. SUNXI_FUNCTION(0x3, "csi1"), /* D5 */
  666. SUNXI_FUNCTION(0x4, "uart3"), /* CTS */
  667. SUNXI_FUNCTION(0x5, "csi0")), /* D13 */
  668. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10),
  669. SUNXI_FUNCTION(0x0, "gpio_in"),
  670. SUNXI_FUNCTION(0x1, "gpio_out"),
  671. SUNXI_FUNCTION(0x2, "ts1"), /* D6 */
  672. SUNXI_FUNCTION(0x3, "csi1"), /* D6 */
  673. SUNXI_FUNCTION(0x4, "uart4"), /* TX */
  674. SUNXI_FUNCTION(0x5, "csi0")), /* D14 */
  675. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 11),
  676. SUNXI_FUNCTION(0x0, "gpio_in"),
  677. SUNXI_FUNCTION(0x1, "gpio_out"),
  678. SUNXI_FUNCTION(0x2, "ts1"), /* D7 */
  679. SUNXI_FUNCTION(0x3, "csi1"), /* D7 */
  680. SUNXI_FUNCTION(0x4, "uart4"), /* RX */
  681. SUNXI_FUNCTION(0x5, "csi0")), /* D15 */
  682. /* Hole */
  683. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 0),
  684. SUNXI_FUNCTION(0x0, "gpio_in"),
  685. SUNXI_FUNCTION(0x1, "gpio_out"),
  686. SUNXI_FUNCTION(0x2, "lcd1"), /* D0 */
  687. SUNXI_FUNCTION(0x4, "uart3"), /* TX */
  688. SUNXI_FUNCTION_IRQ(0x6, 0), /* EINT0 */
  689. SUNXI_FUNCTION(0x7, "csi1")), /* D0 */
  690. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 1),
  691. SUNXI_FUNCTION(0x0, "gpio_in"),
  692. SUNXI_FUNCTION(0x1, "gpio_out"),
  693. SUNXI_FUNCTION(0x2, "lcd1"), /* D1 */
  694. SUNXI_FUNCTION(0x4, "uart3"), /* RX */
  695. SUNXI_FUNCTION_IRQ(0x6, 1), /* EINT1 */
  696. SUNXI_FUNCTION(0x7, "csi1")), /* D1 */
  697. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 2),
  698. SUNXI_FUNCTION(0x0, "gpio_in"),
  699. SUNXI_FUNCTION(0x1, "gpio_out"),
  700. SUNXI_FUNCTION(0x2, "lcd1"), /* D2 */
  701. SUNXI_FUNCTION(0x4, "uart3"), /* RTS */
  702. SUNXI_FUNCTION_IRQ(0x6, 2), /* EINT2 */
  703. SUNXI_FUNCTION(0x7, "csi1")), /* D2 */
  704. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 3),
  705. SUNXI_FUNCTION(0x0, "gpio_in"),
  706. SUNXI_FUNCTION(0x1, "gpio_out"),
  707. SUNXI_FUNCTION(0x2, "lcd1"), /* D3 */
  708. SUNXI_FUNCTION(0x4, "uart3"), /* CTS */
  709. SUNXI_FUNCTION_IRQ(0x6, 3), /* EINT3 */
  710. SUNXI_FUNCTION(0x7, "csi1")), /* D3 */
  711. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 4),
  712. SUNXI_FUNCTION(0x0, "gpio_in"),
  713. SUNXI_FUNCTION(0x1, "gpio_out"),
  714. SUNXI_FUNCTION(0x2, "lcd1"), /* D4 */
  715. SUNXI_FUNCTION(0x4, "uart4"), /* TX */
  716. SUNXI_FUNCTION_IRQ(0x6, 4), /* EINT4 */
  717. SUNXI_FUNCTION(0x7, "csi1")), /* D4 */
  718. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 5),
  719. SUNXI_FUNCTION(0x0, "gpio_in"),
  720. SUNXI_FUNCTION(0x1, "gpio_out"),
  721. SUNXI_FUNCTION(0x2, "lcd1"), /* D5 */
  722. SUNXI_FUNCTION(0x4, "uart4"), /* RX */
  723. SUNXI_FUNCTION_IRQ(0x6, 5), /* EINT5 */
  724. SUNXI_FUNCTION(0x7, "csi1")), /* D5 */
  725. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 6),
  726. SUNXI_FUNCTION(0x0, "gpio_in"),
  727. SUNXI_FUNCTION(0x1, "gpio_out"),
  728. SUNXI_FUNCTION(0x2, "lcd1"), /* D6 */
  729. SUNXI_FUNCTION(0x4, "uart5"), /* TX */
  730. SUNXI_FUNCTION(0x5, "ms"), /* BS */
  731. SUNXI_FUNCTION_IRQ(0x6, 6), /* EINT6 */
  732. SUNXI_FUNCTION(0x7, "csi1")), /* D6 */
  733. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 7),
  734. SUNXI_FUNCTION(0x0, "gpio_in"),
  735. SUNXI_FUNCTION(0x1, "gpio_out"),
  736. SUNXI_FUNCTION(0x2, "lcd1"), /* D7 */
  737. SUNXI_FUNCTION(0x4, "uart5"), /* RX */
  738. SUNXI_FUNCTION(0x5, "ms"), /* CLK */
  739. SUNXI_FUNCTION_IRQ(0x6, 7), /* EINT7 */
  740. SUNXI_FUNCTION(0x7, "csi1")), /* D7 */
  741. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 8),
  742. SUNXI_FUNCTION(0x0, "gpio_in"),
  743. SUNXI_FUNCTION(0x1, "gpio_out"),
  744. SUNXI_FUNCTION(0x2, "lcd1"), /* D8 */
  745. SUNXI_FUNCTION(0x3, "emac"), /* ERXD3 */
  746. SUNXI_FUNCTION(0x4, "keypad"), /* IN0 */
  747. SUNXI_FUNCTION(0x5, "ms"), /* D0 */
  748. SUNXI_FUNCTION_IRQ(0x6, 8), /* EINT8 */
  749. SUNXI_FUNCTION(0x7, "csi1")), /* D8 */
  750. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 9),
  751. SUNXI_FUNCTION(0x0, "gpio_in"),
  752. SUNXI_FUNCTION(0x1, "gpio_out"),
  753. SUNXI_FUNCTION(0x2, "lcd1"), /* D9 */
  754. SUNXI_FUNCTION(0x3, "emac"), /* ERXD2 */
  755. SUNXI_FUNCTION(0x4, "keypad"), /* IN1 */
  756. SUNXI_FUNCTION(0x5, "ms"), /* D1 */
  757. SUNXI_FUNCTION_IRQ(0x6, 9), /* EINT9 */
  758. SUNXI_FUNCTION(0x7, "csi1")), /* D9 */
  759. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 10),
  760. SUNXI_FUNCTION(0x0, "gpio_in"),
  761. SUNXI_FUNCTION(0x1, "gpio_out"),
  762. SUNXI_FUNCTION(0x2, "lcd1"), /* D10 */
  763. SUNXI_FUNCTION(0x3, "emac"), /* ERXD1 */
  764. SUNXI_FUNCTION(0x4, "keypad"), /* IN2 */
  765. SUNXI_FUNCTION(0x5, "ms"), /* D2 */
  766. SUNXI_FUNCTION_IRQ(0x6, 10), /* EINT10 */
  767. SUNXI_FUNCTION(0x7, "csi1")), /* D10 */
  768. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 11),
  769. SUNXI_FUNCTION(0x0, "gpio_in"),
  770. SUNXI_FUNCTION(0x1, "gpio_out"),
  771. SUNXI_FUNCTION(0x2, "lcd1"), /* D11 */
  772. SUNXI_FUNCTION(0x3, "emac"), /* ERXD0 */
  773. SUNXI_FUNCTION(0x4, "keypad"), /* IN3 */
  774. SUNXI_FUNCTION(0x5, "ms"), /* D3 */
  775. SUNXI_FUNCTION_IRQ(0x6, 11), /* EINT11 */
  776. SUNXI_FUNCTION(0x7, "csi1")), /* D11 */
  777. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 12),
  778. SUNXI_FUNCTION(0x0, "gpio_in"),
  779. SUNXI_FUNCTION(0x1, "gpio_out"),
  780. SUNXI_FUNCTION(0x2, "lcd1"), /* D12 */
  781. SUNXI_FUNCTION(0x4, "ps2"), /* SCK1 */
  782. SUNXI_FUNCTION_IRQ(0x6, 12), /* EINT12 */
  783. SUNXI_FUNCTION(0x7, "csi1")), /* D12 */
  784. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 13),
  785. SUNXI_FUNCTION(0x0, "gpio_in"),
  786. SUNXI_FUNCTION(0x1, "gpio_out"),
  787. SUNXI_FUNCTION(0x2, "lcd1"), /* D13 */
  788. SUNXI_FUNCTION(0x4, "ps2"), /* SDA1 */
  789. SUNXI_FUNCTION(0x5, "sim"), /* RST */
  790. SUNXI_FUNCTION_IRQ(0x6, 13), /* EINT13 */
  791. SUNXI_FUNCTION(0x7, "csi1")), /* D13 */
  792. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 14),
  793. SUNXI_FUNCTION(0x0, "gpio_in"),
  794. SUNXI_FUNCTION(0x1, "gpio_out"),
  795. SUNXI_FUNCTION(0x2, "lcd1"), /* D14 */
  796. SUNXI_FUNCTION(0x3, "emac"), /* ETXD3 */
  797. SUNXI_FUNCTION(0x4, "keypad"), /* IN4 */
  798. SUNXI_FUNCTION(0x5, "sim"), /* VPPEN */
  799. SUNXI_FUNCTION_IRQ(0x6, 14), /* EINT14 */
  800. SUNXI_FUNCTION(0x7, "csi1")), /* D14 */
  801. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 15),
  802. SUNXI_FUNCTION(0x0, "gpio_in"),
  803. SUNXI_FUNCTION(0x1, "gpio_out"),
  804. SUNXI_FUNCTION(0x2, "lcd1"), /* D15 */
  805. SUNXI_FUNCTION(0x3, "emac"), /* ETXD3 */
  806. SUNXI_FUNCTION(0x4, "keypad"), /* IN5 */
  807. SUNXI_FUNCTION(0x5, "sim"), /* VPPPP */
  808. SUNXI_FUNCTION_IRQ(0x6, 15), /* EINT15 */
  809. SUNXI_FUNCTION(0x7, "csi1")), /* D15 */
  810. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 16),
  811. SUNXI_FUNCTION(0x0, "gpio_in"),
  812. SUNXI_FUNCTION(0x1, "gpio_out"),
  813. SUNXI_FUNCTION(0x2, "lcd1"), /* D16 */
  814. SUNXI_FUNCTION(0x3, "emac"), /* ETXD2 */
  815. SUNXI_FUNCTION(0x4, "keypad"), /* IN6 */
  816. SUNXI_FUNCTION_IRQ(0x6, 16), /* EINT16 */
  817. SUNXI_FUNCTION(0x7, "csi1")), /* D16 */
  818. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 17),
  819. SUNXI_FUNCTION(0x0, "gpio_in"),
  820. SUNXI_FUNCTION(0x1, "gpio_out"),
  821. SUNXI_FUNCTION(0x2, "lcd1"), /* D17 */
  822. SUNXI_FUNCTION(0x3, "emac"), /* ETXD1 */
  823. SUNXI_FUNCTION(0x4, "keypad"), /* IN7 */
  824. SUNXI_FUNCTION(0x5, "sim"), /* VCCEN */
  825. SUNXI_FUNCTION_IRQ(0x6, 17), /* EINT17 */
  826. SUNXI_FUNCTION(0x7, "csi1")), /* D17 */
  827. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 18),
  828. SUNXI_FUNCTION(0x0, "gpio_in"),
  829. SUNXI_FUNCTION(0x1, "gpio_out"),
  830. SUNXI_FUNCTION(0x2, "lcd1"), /* D18 */
  831. SUNXI_FUNCTION(0x3, "emac"), /* ETXD0 */
  832. SUNXI_FUNCTION(0x4, "keypad"), /* OUT0 */
  833. SUNXI_FUNCTION(0x5, "sim"), /* SCK */
  834. SUNXI_FUNCTION_IRQ(0x6, 18), /* EINT18 */
  835. SUNXI_FUNCTION(0x7, "csi1")), /* D18 */
  836. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 19),
  837. SUNXI_FUNCTION(0x0, "gpio_in"),
  838. SUNXI_FUNCTION(0x1, "gpio_out"),
  839. SUNXI_FUNCTION(0x2, "lcd1"), /* D19 */
  840. SUNXI_FUNCTION(0x3, "emac"), /* ERXERR */
  841. SUNXI_FUNCTION(0x4, "keypad"), /* OUT1 */
  842. SUNXI_FUNCTION(0x5, "sim"), /* SDA */
  843. SUNXI_FUNCTION_IRQ(0x6, 19), /* EINT19 */
  844. SUNXI_FUNCTION(0x7, "csi1")), /* D19 */
  845. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 20),
  846. SUNXI_FUNCTION(0x0, "gpio_in"),
  847. SUNXI_FUNCTION(0x1, "gpio_out"),
  848. SUNXI_FUNCTION(0x2, "lcd1"), /* D20 */
  849. SUNXI_FUNCTION(0x3, "emac"), /* ERXDV */
  850. SUNXI_FUNCTION(0x4, "can"), /* TX */
  851. SUNXI_FUNCTION_IRQ(0x6, 20), /* EINT20 */
  852. SUNXI_FUNCTION(0x7, "csi1")), /* D20 */
  853. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 21),
  854. SUNXI_FUNCTION(0x0, "gpio_in"),
  855. SUNXI_FUNCTION(0x1, "gpio_out"),
  856. SUNXI_FUNCTION(0x2, "lcd1"), /* D21 */
  857. SUNXI_FUNCTION(0x3, "emac"), /* EMDC */
  858. SUNXI_FUNCTION(0x4, "can"), /* RX */
  859. SUNXI_FUNCTION_IRQ(0x6, 21), /* EINT21 */
  860. SUNXI_FUNCTION(0x7, "csi1")), /* D21 */
  861. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 22),
  862. SUNXI_FUNCTION(0x0, "gpio_in"),
  863. SUNXI_FUNCTION(0x1, "gpio_out"),
  864. SUNXI_FUNCTION(0x2, "lcd1"), /* D22 */
  865. SUNXI_FUNCTION(0x3, "emac"), /* EMDIO */
  866. SUNXI_FUNCTION(0x4, "keypad"), /* OUT2 */
  867. SUNXI_FUNCTION(0x5, "mmc1"), /* CMD */
  868. SUNXI_FUNCTION(0x7, "csi1")), /* D22 */
  869. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 23),
  870. SUNXI_FUNCTION(0x0, "gpio_in"),
  871. SUNXI_FUNCTION(0x1, "gpio_out"),
  872. SUNXI_FUNCTION(0x2, "lcd1"), /* D23 */
  873. SUNXI_FUNCTION(0x3, "emac"), /* ETXEN */
  874. SUNXI_FUNCTION(0x4, "keypad"), /* OUT3 */
  875. SUNXI_FUNCTION(0x5, "mmc1"), /* CLK */
  876. SUNXI_FUNCTION(0x7, "csi1")), /* D23 */
  877. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 24),
  878. SUNXI_FUNCTION(0x0, "gpio_in"),
  879. SUNXI_FUNCTION(0x1, "gpio_out"),
  880. SUNXI_FUNCTION(0x2, "lcd1"), /* CLK */
  881. SUNXI_FUNCTION(0x3, "emac"), /* ETXCK */
  882. SUNXI_FUNCTION(0x4, "keypad"), /* OUT4 */
  883. SUNXI_FUNCTION(0x5, "mmc1"), /* D0 */
  884. SUNXI_FUNCTION(0x7, "csi1")), /* PCLK */
  885. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 25),
  886. SUNXI_FUNCTION(0x0, "gpio_in"),
  887. SUNXI_FUNCTION(0x1, "gpio_out"),
  888. SUNXI_FUNCTION(0x2, "lcd1"), /* DE */
  889. SUNXI_FUNCTION(0x3, "emac"), /* ECRS */
  890. SUNXI_FUNCTION(0x4, "keypad"), /* OUT5 */
  891. SUNXI_FUNCTION(0x5, "mmc1"), /* D1 */
  892. SUNXI_FUNCTION(0x7, "csi1")), /* FIELD */
  893. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 26),
  894. SUNXI_FUNCTION(0x0, "gpio_in"),
  895. SUNXI_FUNCTION(0x1, "gpio_out"),
  896. SUNXI_FUNCTION(0x2, "lcd1"), /* HSYNC */
  897. SUNXI_FUNCTION(0x3, "emac"), /* ECOL */
  898. SUNXI_FUNCTION(0x4, "keypad"), /* OUT6 */
  899. SUNXI_FUNCTION(0x5, "mmc1"), /* D2 */
  900. SUNXI_FUNCTION(0x7, "csi1")), /* HSYNC */
  901. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 27),
  902. SUNXI_FUNCTION(0x0, "gpio_in"),
  903. SUNXI_FUNCTION(0x1, "gpio_out"),
  904. SUNXI_FUNCTION(0x2, "lcd1"), /* VSYNC */
  905. SUNXI_FUNCTION(0x3, "emac"), /* ETXERR */
  906. SUNXI_FUNCTION(0x4, "keypad"), /* OUT7 */
  907. SUNXI_FUNCTION(0x5, "mmc1"), /* D3 */
  908. SUNXI_FUNCTION(0x7, "csi1")), /* VSYNC */
  909. /* Hole */
  910. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 0),
  911. SUNXI_FUNCTION(0x0, "gpio_in"),
  912. SUNXI_FUNCTION(0x1, "gpio_out"),
  913. SUNXI_FUNCTION(0x3, "i2c3")), /* SCK */
  914. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 1),
  915. SUNXI_FUNCTION(0x0, "gpio_in"),
  916. SUNXI_FUNCTION(0x1, "gpio_out"),
  917. SUNXI_FUNCTION(0x3, "i2c3")), /* SDA */
  918. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 2),
  919. SUNXI_FUNCTION(0x0, "gpio_in"),
  920. SUNXI_FUNCTION(0x1, "gpio_out"),
  921. SUNXI_FUNCTION(0x3, "i2c4")), /* SCK */
  922. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 3),
  923. SUNXI_FUNCTION(0x0, "gpio_in"),
  924. SUNXI_FUNCTION(0x1, "gpio_out"),
  925. SUNXI_FUNCTION(0x2, "pwm"), /* PWM1 */
  926. SUNXI_FUNCTION(0x3, "i2c4")), /* SDA */
  927. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 4),
  928. SUNXI_FUNCTION(0x0, "gpio_in"),
  929. SUNXI_FUNCTION(0x1, "gpio_out"),
  930. SUNXI_FUNCTION(0x2, "mmc3")), /* CMD */
  931. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 5),
  932. SUNXI_FUNCTION(0x0, "gpio_in"),
  933. SUNXI_FUNCTION(0x1, "gpio_out"),
  934. SUNXI_FUNCTION(0x2, "mmc3")), /* CLK */
  935. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 6),
  936. SUNXI_FUNCTION(0x0, "gpio_in"),
  937. SUNXI_FUNCTION(0x1, "gpio_out"),
  938. SUNXI_FUNCTION(0x2, "mmc3")), /* D0 */
  939. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 7),
  940. SUNXI_FUNCTION(0x0, "gpio_in"),
  941. SUNXI_FUNCTION(0x1, "gpio_out"),
  942. SUNXI_FUNCTION(0x2, "mmc3")), /* D1 */
  943. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 8),
  944. SUNXI_FUNCTION(0x0, "gpio_in"),
  945. SUNXI_FUNCTION(0x1, "gpio_out"),
  946. SUNXI_FUNCTION(0x2, "mmc3")), /* D2 */
  947. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 9),
  948. SUNXI_FUNCTION(0x0, "gpio_in"),
  949. SUNXI_FUNCTION(0x1, "gpio_out"),
  950. SUNXI_FUNCTION(0x2, "mmc3")), /* D3 */
  951. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 10),
  952. SUNXI_FUNCTION(0x0, "gpio_in"),
  953. SUNXI_FUNCTION(0x1, "gpio_out"),
  954. SUNXI_FUNCTION(0x2, "spi0"), /* CS0 */
  955. SUNXI_FUNCTION(0x3, "uart5"), /* TX */
  956. SUNXI_FUNCTION_IRQ(0x6, 22)), /* EINT22 */
  957. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 11),
  958. SUNXI_FUNCTION(0x0, "gpio_in"),
  959. SUNXI_FUNCTION(0x1, "gpio_out"),
  960. SUNXI_FUNCTION(0x2, "spi0"), /* CLK */
  961. SUNXI_FUNCTION(0x3, "uart5"), /* RX */
  962. SUNXI_FUNCTION_IRQ(0x6, 23)), /* EINT23 */
  963. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 12),
  964. SUNXI_FUNCTION(0x0, "gpio_in"),
  965. SUNXI_FUNCTION(0x1, "gpio_out"),
  966. SUNXI_FUNCTION(0x2, "spi0"), /* MOSI */
  967. SUNXI_FUNCTION(0x3, "uart6"), /* TX */
  968. SUNXI_FUNCTION(0x4, "clk_out_a"), /* CLK_OUT_A */
  969. SUNXI_FUNCTION_IRQ(0x6, 24)), /* EINT24 */
  970. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 13),
  971. SUNXI_FUNCTION(0x0, "gpio_in"),
  972. SUNXI_FUNCTION(0x1, "gpio_out"),
  973. SUNXI_FUNCTION(0x2, "spi0"), /* MISO */
  974. SUNXI_FUNCTION(0x3, "uart6"), /* RX */
  975. SUNXI_FUNCTION(0x4, "clk_out_b"), /* CLK_OUT_B */
  976. SUNXI_FUNCTION_IRQ(0x6, 25)), /* EINT25 */
  977. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 14),
  978. SUNXI_FUNCTION(0x0, "gpio_in"),
  979. SUNXI_FUNCTION(0x1, "gpio_out"),
  980. SUNXI_FUNCTION(0x2, "spi0"), /* CS1 */
  981. SUNXI_FUNCTION(0x3, "ps2"), /* SCK1 */
  982. SUNXI_FUNCTION(0x4, "timer4"), /* TCLKIN0 */
  983. SUNXI_FUNCTION_IRQ(0x6, 26)), /* EINT26 */
  984. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 15),
  985. SUNXI_FUNCTION(0x0, "gpio_in"),
  986. SUNXI_FUNCTION(0x1, "gpio_out"),
  987. SUNXI_FUNCTION(0x2, "spi1"), /* CS1 */
  988. SUNXI_FUNCTION(0x3, "ps2"), /* SDA1 */
  989. SUNXI_FUNCTION(0x4, "timer5"), /* TCLKIN1 */
  990. SUNXI_FUNCTION_IRQ(0x6, 27)), /* EINT27 */
  991. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 16),
  992. SUNXI_FUNCTION(0x0, "gpio_in"),
  993. SUNXI_FUNCTION(0x1, "gpio_out"),
  994. SUNXI_FUNCTION(0x2, "spi1"), /* CS0 */
  995. SUNXI_FUNCTION(0x3, "uart2"), /* RTS */
  996. SUNXI_FUNCTION_IRQ(0x6, 28)), /* EINT28 */
  997. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 17),
  998. SUNXI_FUNCTION(0x0, "gpio_in"),
  999. SUNXI_FUNCTION(0x1, "gpio_out"),
  1000. SUNXI_FUNCTION(0x2, "spi1"), /* CLK */
  1001. SUNXI_FUNCTION(0x3, "uart2"), /* CTS */
  1002. SUNXI_FUNCTION_IRQ(0x6, 29)), /* EINT29 */
  1003. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 18),
  1004. SUNXI_FUNCTION(0x0, "gpio_in"),
  1005. SUNXI_FUNCTION(0x1, "gpio_out"),
  1006. SUNXI_FUNCTION(0x2, "spi1"), /* MOSI */
  1007. SUNXI_FUNCTION(0x3, "uart2"), /* TX */
  1008. SUNXI_FUNCTION_IRQ(0x6, 30)), /* EINT30 */
  1009. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 19),
  1010. SUNXI_FUNCTION(0x0, "gpio_in"),
  1011. SUNXI_FUNCTION(0x1, "gpio_out"),
  1012. SUNXI_FUNCTION(0x2, "spi1"), /* MISO */
  1013. SUNXI_FUNCTION(0x3, "uart2"), /* RX */
  1014. SUNXI_FUNCTION_IRQ(0x6, 31)), /* EINT31 */
  1015. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 20),
  1016. SUNXI_FUNCTION(0x0, "gpio_in"),
  1017. SUNXI_FUNCTION(0x1, "gpio_out"),
  1018. SUNXI_FUNCTION(0x2, "ps2"), /* SCK0 */
  1019. SUNXI_FUNCTION(0x3, "uart7"), /* TX */
  1020. SUNXI_FUNCTION(0x4, "hdmi")), /* HSCL */
  1021. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 21),
  1022. SUNXI_FUNCTION(0x0, "gpio_in"),
  1023. SUNXI_FUNCTION(0x1, "gpio_out"),
  1024. SUNXI_FUNCTION(0x2, "ps2"), /* SDA0 */
  1025. SUNXI_FUNCTION(0x3, "uart7"), /* RX */
  1026. SUNXI_FUNCTION(0x4, "hdmi")), /* HSDA */
  1027. };
  1028. static const struct sunxi_pinctrl_desc sun7i_a20_pinctrl_data = {
  1029. .pins = sun7i_a20_pins,
  1030. .npins = ARRAY_SIZE(sun7i_a20_pins),
  1031. .irq_banks = 1,
  1032. };
  1033. static int sun7i_a20_pinctrl_probe(struct platform_device *pdev)
  1034. {
  1035. return sunxi_pinctrl_init(pdev,
  1036. &sun7i_a20_pinctrl_data);
  1037. }
  1038. static const struct of_device_id sun7i_a20_pinctrl_match[] = {
  1039. { .compatible = "allwinner,sun7i-a20-pinctrl", },
  1040. {}
  1041. };
  1042. MODULE_DEVICE_TABLE(of, sun7i_a20_pinctrl_match);
  1043. static struct platform_driver sun7i_a20_pinctrl_driver = {
  1044. .probe = sun7i_a20_pinctrl_probe,
  1045. .driver = {
  1046. .name = "sun7i-a20-pinctrl",
  1047. .of_match_table = sun7i_a20_pinctrl_match,
  1048. },
  1049. };
  1050. module_platform_driver(sun7i_a20_pinctrl_driver);
  1051. MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com");
  1052. MODULE_DESCRIPTION("Allwinner A20 pinctrl driver");
  1053. MODULE_LICENSE("GPL");