pinctrl-sun4i-a10.c 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326
  1. /*
  2. * Allwinner A10 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/init.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 sun4i_a10_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_VARIANT(0x5, "gmac", /* GRXD3 */
  26. PINCTRL_SUN7I_A20 |
  27. PINCTRL_SUN8I_R40)),
  28. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 1),
  29. SUNXI_FUNCTION(0x0, "gpio_in"),
  30. SUNXI_FUNCTION(0x1, "gpio_out"),
  31. SUNXI_FUNCTION(0x2, "emac"), /* ERXD2 */
  32. SUNXI_FUNCTION(0x3, "spi1"), /* CLK */
  33. SUNXI_FUNCTION(0x4, "uart2"), /* CTS */
  34. SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GRXD2 */
  35. PINCTRL_SUN7I_A20 |
  36. PINCTRL_SUN8I_R40)),
  37. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 2),
  38. SUNXI_FUNCTION(0x0, "gpio_in"),
  39. SUNXI_FUNCTION(0x1, "gpio_out"),
  40. SUNXI_FUNCTION(0x2, "emac"), /* ERXD1 */
  41. SUNXI_FUNCTION(0x3, "spi1"), /* MOSI */
  42. SUNXI_FUNCTION(0x4, "uart2"), /* TX */
  43. SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GRXD1 */
  44. PINCTRL_SUN7I_A20 |
  45. PINCTRL_SUN8I_R40)),
  46. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 3),
  47. SUNXI_FUNCTION(0x0, "gpio_in"),
  48. SUNXI_FUNCTION(0x1, "gpio_out"),
  49. SUNXI_FUNCTION(0x2, "emac"), /* ERXD0 */
  50. SUNXI_FUNCTION(0x3, "spi1"), /* MISO */
  51. SUNXI_FUNCTION(0x4, "uart2"), /* RX */
  52. SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GRXD0 */
  53. PINCTRL_SUN7I_A20 |
  54. PINCTRL_SUN8I_R40)),
  55. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 4),
  56. SUNXI_FUNCTION(0x0, "gpio_in"),
  57. SUNXI_FUNCTION(0x1, "gpio_out"),
  58. SUNXI_FUNCTION(0x2, "emac"), /* ETXD3 */
  59. SUNXI_FUNCTION(0x3, "spi1"), /* CS1 */
  60. SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GTXD3 */
  61. PINCTRL_SUN7I_A20 |
  62. PINCTRL_SUN8I_R40)),
  63. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 5),
  64. SUNXI_FUNCTION(0x0, "gpio_in"),
  65. SUNXI_FUNCTION(0x1, "gpio_out"),
  66. SUNXI_FUNCTION(0x2, "emac"), /* ETXD2 */
  67. SUNXI_FUNCTION(0x3, "spi3"), /* CS0 */
  68. SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GTXD2 */
  69. PINCTRL_SUN7I_A20 |
  70. PINCTRL_SUN8I_R40)),
  71. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 6),
  72. SUNXI_FUNCTION(0x0, "gpio_in"),
  73. SUNXI_FUNCTION(0x1, "gpio_out"),
  74. SUNXI_FUNCTION(0x2, "emac"), /* ETXD1 */
  75. SUNXI_FUNCTION(0x3, "spi3"), /* CLK */
  76. SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GTXD1 */
  77. PINCTRL_SUN7I_A20 |
  78. PINCTRL_SUN8I_R40)),
  79. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 7),
  80. SUNXI_FUNCTION(0x0, "gpio_in"),
  81. SUNXI_FUNCTION(0x1, "gpio_out"),
  82. SUNXI_FUNCTION(0x2, "emac"), /* ETXD0 */
  83. SUNXI_FUNCTION(0x3, "spi3"), /* MOSI */
  84. SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GTXD0 */
  85. PINCTRL_SUN7I_A20 |
  86. PINCTRL_SUN8I_R40)),
  87. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 8),
  88. SUNXI_FUNCTION(0x0, "gpio_in"),
  89. SUNXI_FUNCTION(0x1, "gpio_out"),
  90. SUNXI_FUNCTION(0x2, "emac"), /* ERXCK */
  91. SUNXI_FUNCTION(0x3, "spi3"), /* MISO */
  92. SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GRXCK */
  93. PINCTRL_SUN7I_A20 |
  94. PINCTRL_SUN8I_R40)),
  95. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 9),
  96. SUNXI_FUNCTION(0x0, "gpio_in"),
  97. SUNXI_FUNCTION(0x1, "gpio_out"),
  98. SUNXI_FUNCTION(0x2, "emac"), /* ERXERR */
  99. SUNXI_FUNCTION(0x3, "spi3"), /* CS1 */
  100. SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GNULL / ERXERR */
  101. PINCTRL_SUN7I_A20 |
  102. PINCTRL_SUN8I_R40),
  103. SUNXI_FUNCTION_VARIANT(0x6, "i2s1", /* MCLK */
  104. PINCTRL_SUN7I_A20 |
  105. PINCTRL_SUN8I_R40)),
  106. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 10),
  107. SUNXI_FUNCTION(0x0, "gpio_in"),
  108. SUNXI_FUNCTION(0x1, "gpio_out"),
  109. SUNXI_FUNCTION(0x2, "emac"), /* ERXDV */
  110. SUNXI_FUNCTION(0x4, "uart1"), /* TX */
  111. SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GRXDV */
  112. PINCTRL_SUN7I_A20 |
  113. PINCTRL_SUN8I_R40)),
  114. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 11),
  115. SUNXI_FUNCTION(0x0, "gpio_in"),
  116. SUNXI_FUNCTION(0x1, "gpio_out"),
  117. SUNXI_FUNCTION(0x2, "emac"), /* EMDC */
  118. SUNXI_FUNCTION(0x4, "uart1"), /* RX */
  119. SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* EMDC */
  120. PINCTRL_SUN7I_A20 |
  121. PINCTRL_SUN8I_R40)),
  122. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 12),
  123. SUNXI_FUNCTION(0x0, "gpio_in"),
  124. SUNXI_FUNCTION(0x1, "gpio_out"),
  125. SUNXI_FUNCTION(0x2, "emac"), /* EMDIO */
  126. SUNXI_FUNCTION(0x3, "uart6"), /* TX */
  127. SUNXI_FUNCTION(0x4, "uart1"), /* RTS */
  128. SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* EMDIO */
  129. PINCTRL_SUN7I_A20 |
  130. PINCTRL_SUN8I_R40)),
  131. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 13),
  132. SUNXI_FUNCTION(0x0, "gpio_in"),
  133. SUNXI_FUNCTION(0x1, "gpio_out"),
  134. SUNXI_FUNCTION(0x2, "emac"), /* ETXEN */
  135. SUNXI_FUNCTION(0x3, "uart6"), /* RX */
  136. SUNXI_FUNCTION(0x4, "uart1"), /* CTS */
  137. SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GTXCTL / ETXEN */
  138. PINCTRL_SUN7I_A20 |
  139. PINCTRL_SUN8I_R40)),
  140. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 14),
  141. SUNXI_FUNCTION(0x0, "gpio_in"),
  142. SUNXI_FUNCTION(0x1, "gpio_out"),
  143. SUNXI_FUNCTION(0x2, "emac"), /* ETXCK */
  144. SUNXI_FUNCTION(0x3, "uart7"), /* TX */
  145. SUNXI_FUNCTION(0x4, "uart1"), /* DTR */
  146. SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GNULL / ETXCK */
  147. PINCTRL_SUN7I_A20 |
  148. PINCTRL_SUN8I_R40),
  149. SUNXI_FUNCTION_VARIANT(0x6, "i2s1", /* BCLK */
  150. PINCTRL_SUN7I_A20 |
  151. PINCTRL_SUN8I_R40)),
  152. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 15),
  153. SUNXI_FUNCTION(0x0, "gpio_in"),
  154. SUNXI_FUNCTION(0x1, "gpio_out"),
  155. SUNXI_FUNCTION(0x2, "emac"), /* ECRS */
  156. SUNXI_FUNCTION(0x3, "uart7"), /* RX */
  157. SUNXI_FUNCTION(0x4, "uart1"), /* DSR */
  158. SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GTXCK / ECRS */
  159. PINCTRL_SUN7I_A20 |
  160. PINCTRL_SUN8I_R40),
  161. SUNXI_FUNCTION_VARIANT(0x6, "i2s1", /* LRCK */
  162. PINCTRL_SUN7I_A20 |
  163. PINCTRL_SUN8I_R40)),
  164. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 16),
  165. SUNXI_FUNCTION(0x0, "gpio_in"),
  166. SUNXI_FUNCTION(0x1, "gpio_out"),
  167. SUNXI_FUNCTION(0x2, "emac"), /* ECOL */
  168. SUNXI_FUNCTION(0x3, "can"), /* TX */
  169. SUNXI_FUNCTION(0x4, "uart1"), /* DCD */
  170. SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GCLKIN / ECOL */
  171. PINCTRL_SUN7I_A20 |
  172. PINCTRL_SUN8I_R40),
  173. SUNXI_FUNCTION_VARIANT(0x6, "i2s1", /* DO */
  174. PINCTRL_SUN7I_A20 |
  175. PINCTRL_SUN8I_R40)),
  176. SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 17),
  177. SUNXI_FUNCTION(0x0, "gpio_in"),
  178. SUNXI_FUNCTION(0x1, "gpio_out"),
  179. SUNXI_FUNCTION(0x2, "emac"), /* ETXERR */
  180. SUNXI_FUNCTION(0x3, "can"), /* RX */
  181. SUNXI_FUNCTION(0x4, "uart1"), /* RING */
  182. SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GNULL / ETXERR */
  183. PINCTRL_SUN7I_A20 |
  184. PINCTRL_SUN8I_R40),
  185. SUNXI_FUNCTION_VARIANT(0x6, "i2s1", /* DI */
  186. PINCTRL_SUN7I_A20 |
  187. PINCTRL_SUN8I_R40)),
  188. /* Hole */
  189. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 0),
  190. SUNXI_FUNCTION(0x0, "gpio_in"),
  191. SUNXI_FUNCTION(0x1, "gpio_out"),
  192. SUNXI_FUNCTION(0x2, "i2c0"), /* SCK */
  193. SUNXI_FUNCTION_VARIANT(0x3, "pll_lock_dbg",
  194. PINCTRL_SUN8I_R40)),
  195. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 1),
  196. SUNXI_FUNCTION(0x0, "gpio_in"),
  197. SUNXI_FUNCTION(0x1, "gpio_out"),
  198. SUNXI_FUNCTION(0x2, "i2c0")), /* SDA */
  199. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 2),
  200. SUNXI_FUNCTION(0x0, "gpio_in"),
  201. SUNXI_FUNCTION(0x1, "gpio_out"),
  202. SUNXI_FUNCTION_VARIANT(0x2, "pwm", /* PWM0 */
  203. PINCTRL_SUN4I_A10 |
  204. PINCTRL_SUN7I_A20),
  205. SUNXI_FUNCTION_VARIANT(0x3, "pwm", /* PWM0 */
  206. PINCTRL_SUN8I_R40)),
  207. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 3),
  208. SUNXI_FUNCTION(0x0, "gpio_in"),
  209. SUNXI_FUNCTION(0x1, "gpio_out"),
  210. SUNXI_FUNCTION_VARIANT(0x2, "ir0", /* TX */
  211. PINCTRL_SUN4I_A10 |
  212. PINCTRL_SUN7I_A20),
  213. SUNXI_FUNCTION_VARIANT(0x3, "pwm", /* PWM1 */
  214. PINCTRL_SUN8I_R40),
  215. /*
  216. * The SPDIF block is not referenced at all in the A10 user
  217. * manual. However it is described in the code leaked and the
  218. * pin descriptions are declared in the A20 user manual which
  219. * is pin compatible with this device.
  220. */
  221. SUNXI_FUNCTION(0x4, "spdif")), /* SPDIF MCLK */
  222. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 4),
  223. SUNXI_FUNCTION(0x0, "gpio_in"),
  224. SUNXI_FUNCTION(0x1, "gpio_out"),
  225. SUNXI_FUNCTION(0x2, "ir0")), /* RX */
  226. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 5),
  227. SUNXI_FUNCTION(0x0, "gpio_in"),
  228. SUNXI_FUNCTION(0x1, "gpio_out"),
  229. /*
  230. * On A10 there's only one I2S controller and the pin group
  231. * is simply named "i2s". On A20 there's two and thus it's
  232. * renamed to "i2s0". Deal with these name here, in order
  233. * to satisfy existing device trees.
  234. */
  235. SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* MCLK */
  236. PINCTRL_SUN4I_A10),
  237. SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* MCLK */
  238. PINCTRL_SUN7I_A20 |
  239. PINCTRL_SUN8I_R40),
  240. SUNXI_FUNCTION(0x3, "ac97")), /* MCLK */
  241. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 6),
  242. SUNXI_FUNCTION(0x0, "gpio_in"),
  243. SUNXI_FUNCTION(0x1, "gpio_out"),
  244. SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* BCLK */
  245. PINCTRL_SUN4I_A10),
  246. SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* BCLK */
  247. PINCTRL_SUN7I_A20 |
  248. PINCTRL_SUN8I_R40),
  249. SUNXI_FUNCTION(0x3, "ac97")), /* BCLK */
  250. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 7),
  251. SUNXI_FUNCTION(0x0, "gpio_in"),
  252. SUNXI_FUNCTION(0x1, "gpio_out"),
  253. SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* LRCK */
  254. PINCTRL_SUN4I_A10),
  255. SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* LRCK */
  256. PINCTRL_SUN7I_A20 |
  257. PINCTRL_SUN8I_R40),
  258. SUNXI_FUNCTION(0x3, "ac97")), /* SYNC */
  259. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 8),
  260. SUNXI_FUNCTION(0x0, "gpio_in"),
  261. SUNXI_FUNCTION(0x1, "gpio_out"),
  262. SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* DO0 */
  263. PINCTRL_SUN4I_A10),
  264. SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* DO0 */
  265. PINCTRL_SUN7I_A20 |
  266. PINCTRL_SUN8I_R40),
  267. SUNXI_FUNCTION(0x3, "ac97")), /* DO */
  268. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 9),
  269. SUNXI_FUNCTION(0x0, "gpio_in"),
  270. SUNXI_FUNCTION(0x1, "gpio_out"),
  271. SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* DO1 */
  272. PINCTRL_SUN4I_A10),
  273. SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* DO1 */
  274. PINCTRL_SUN7I_A20 |
  275. PINCTRL_SUN8I_R40),
  276. SUNXI_FUNCTION_VARIANT(0x4, "pwm", /* PWM6 */
  277. PINCTRL_SUN8I_R40)),
  278. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 10),
  279. SUNXI_FUNCTION(0x0, "gpio_in"),
  280. SUNXI_FUNCTION(0x1, "gpio_out"),
  281. SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* DO2 */
  282. PINCTRL_SUN4I_A10),
  283. SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* DO2 */
  284. PINCTRL_SUN7I_A20 |
  285. PINCTRL_SUN8I_R40),
  286. SUNXI_FUNCTION_VARIANT(0x4, "pwm", /* PWM7 */
  287. PINCTRL_SUN8I_R40)),
  288. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 11),
  289. SUNXI_FUNCTION(0x0, "gpio_in"),
  290. SUNXI_FUNCTION(0x1, "gpio_out"),
  291. SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* DO3 */
  292. PINCTRL_SUN4I_A10),
  293. SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* DO3 */
  294. PINCTRL_SUN7I_A20 |
  295. PINCTRL_SUN8I_R40)),
  296. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 12),
  297. SUNXI_FUNCTION(0x0, "gpio_in"),
  298. SUNXI_FUNCTION(0x1, "gpio_out"),
  299. SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* DI */
  300. PINCTRL_SUN4I_A10),
  301. SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* DI */
  302. PINCTRL_SUN7I_A20 |
  303. PINCTRL_SUN8I_R40),
  304. SUNXI_FUNCTION(0x3, "ac97"), /* DI */
  305. /* Undocumented mux function on A10 - See SPDIF MCLK above */
  306. SUNXI_FUNCTION_VARIANT(0x4, "spdif", /* SPDIF IN */
  307. PINCTRL_SUN4I_A10 |
  308. PINCTRL_SUN7I_A20)),
  309. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 13),
  310. SUNXI_FUNCTION(0x0, "gpio_in"),
  311. SUNXI_FUNCTION(0x1, "gpio_out"),
  312. SUNXI_FUNCTION(0x2, "spi2"), /* CS1 */
  313. /* Undocumented mux function on A10 - See SPDIF MCLK above */
  314. SUNXI_FUNCTION(0x4, "spdif")), /* SPDIF OUT */
  315. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 14),
  316. SUNXI_FUNCTION(0x0, "gpio_in"),
  317. SUNXI_FUNCTION(0x1, "gpio_out"),
  318. SUNXI_FUNCTION(0x2, "spi2"), /* CS0 */
  319. SUNXI_FUNCTION(0x3, "jtag")), /* MS0 */
  320. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 15),
  321. SUNXI_FUNCTION(0x0, "gpio_in"),
  322. SUNXI_FUNCTION(0x1, "gpio_out"),
  323. SUNXI_FUNCTION(0x2, "spi2"), /* CLK */
  324. SUNXI_FUNCTION(0x3, "jtag")), /* CK0 */
  325. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 16),
  326. SUNXI_FUNCTION(0x0, "gpio_in"),
  327. SUNXI_FUNCTION(0x1, "gpio_out"),
  328. SUNXI_FUNCTION(0x2, "spi2"), /* MOSI */
  329. SUNXI_FUNCTION(0x3, "jtag")), /* DO0 */
  330. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 17),
  331. SUNXI_FUNCTION(0x0, "gpio_in"),
  332. SUNXI_FUNCTION(0x1, "gpio_out"),
  333. SUNXI_FUNCTION(0x2, "spi2"), /* MISO */
  334. SUNXI_FUNCTION(0x3, "jtag")), /* DI0 */
  335. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 18),
  336. SUNXI_FUNCTION(0x0, "gpio_in"),
  337. SUNXI_FUNCTION(0x1, "gpio_out"),
  338. SUNXI_FUNCTION(0x2, "i2c1")), /* SCK */
  339. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 19),
  340. SUNXI_FUNCTION(0x0, "gpio_in"),
  341. SUNXI_FUNCTION(0x1, "gpio_out"),
  342. SUNXI_FUNCTION(0x2, "i2c1")), /* SDA */
  343. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 20),
  344. SUNXI_FUNCTION(0x0, "gpio_in"),
  345. SUNXI_FUNCTION(0x1, "gpio_out"),
  346. SUNXI_FUNCTION(0x2, "i2c2"), /* SCK */
  347. SUNXI_FUNCTION_VARIANT(0x4, "pwm", /* PWM4 */
  348. PINCTRL_SUN8I_R40)),
  349. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 21),
  350. SUNXI_FUNCTION(0x0, "gpio_in"),
  351. SUNXI_FUNCTION(0x1, "gpio_out"),
  352. SUNXI_FUNCTION(0x2, "i2c2"), /* SDA */
  353. SUNXI_FUNCTION_VARIANT(0x4, "pwm", /* PWM5 */
  354. PINCTRL_SUN8I_R40)),
  355. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 22),
  356. SUNXI_FUNCTION(0x0, "gpio_in"),
  357. SUNXI_FUNCTION(0x1, "gpio_out"),
  358. SUNXI_FUNCTION(0x2, "uart0"), /* TX */
  359. SUNXI_FUNCTION_VARIANT(0x3, "ir1", /* TX */
  360. PINCTRL_SUN4I_A10 |
  361. PINCTRL_SUN7I_A20)),
  362. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 23),
  363. SUNXI_FUNCTION(0x0, "gpio_in"),
  364. SUNXI_FUNCTION(0x1, "gpio_out"),
  365. SUNXI_FUNCTION(0x2, "uart0"), /* RX */
  366. SUNXI_FUNCTION(0x3, "ir1")), /* RX */
  367. /* Hole */
  368. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0),
  369. SUNXI_FUNCTION(0x0, "gpio_in"),
  370. SUNXI_FUNCTION(0x1, "gpio_out"),
  371. SUNXI_FUNCTION(0x2, "nand0"), /* NWE */
  372. SUNXI_FUNCTION(0x3, "spi0")), /* MOSI */
  373. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1),
  374. SUNXI_FUNCTION(0x0, "gpio_in"),
  375. SUNXI_FUNCTION(0x1, "gpio_out"),
  376. SUNXI_FUNCTION(0x2, "nand0"), /* NALE */
  377. SUNXI_FUNCTION(0x3, "spi0")), /* MISO */
  378. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2),
  379. SUNXI_FUNCTION(0x0, "gpio_in"),
  380. SUNXI_FUNCTION(0x1, "gpio_out"),
  381. SUNXI_FUNCTION(0x2, "nand0"), /* NCLE */
  382. SUNXI_FUNCTION(0x3, "spi0")), /* SCK */
  383. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3),
  384. SUNXI_FUNCTION(0x0, "gpio_in"),
  385. SUNXI_FUNCTION(0x1, "gpio_out"),
  386. SUNXI_FUNCTION(0x2, "nand0")), /* NCE1 */
  387. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 4),
  388. SUNXI_FUNCTION(0x0, "gpio_in"),
  389. SUNXI_FUNCTION(0x1, "gpio_out"),
  390. SUNXI_FUNCTION(0x2, "nand0")), /* NCE0 */
  391. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 5),
  392. SUNXI_FUNCTION(0x0, "gpio_in"),
  393. SUNXI_FUNCTION(0x1, "gpio_out"),
  394. SUNXI_FUNCTION(0x2, "nand0"), /* NRE# */
  395. SUNXI_FUNCTION_VARIANT(0x3, "mmc2", /* DS */
  396. PINCTRL_SUN8I_R40)),
  397. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 6),
  398. SUNXI_FUNCTION(0x0, "gpio_in"),
  399. SUNXI_FUNCTION(0x1, "gpio_out"),
  400. SUNXI_FUNCTION(0x2, "nand0"), /* NRB0 */
  401. SUNXI_FUNCTION(0x3, "mmc2")), /* CMD */
  402. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 7),
  403. SUNXI_FUNCTION(0x0, "gpio_in"),
  404. SUNXI_FUNCTION(0x1, "gpio_out"),
  405. SUNXI_FUNCTION(0x2, "nand0"), /* NRB1 */
  406. SUNXI_FUNCTION(0x3, "mmc2")), /* CLK */
  407. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 8),
  408. SUNXI_FUNCTION(0x0, "gpio_in"),
  409. SUNXI_FUNCTION(0x1, "gpio_out"),
  410. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ0 */
  411. SUNXI_FUNCTION(0x3, "mmc2")), /* D0 */
  412. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 9),
  413. SUNXI_FUNCTION(0x0, "gpio_in"),
  414. SUNXI_FUNCTION(0x1, "gpio_out"),
  415. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ1 */
  416. SUNXI_FUNCTION(0x3, "mmc2")), /* D1 */
  417. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 10),
  418. SUNXI_FUNCTION(0x0, "gpio_in"),
  419. SUNXI_FUNCTION(0x1, "gpio_out"),
  420. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ2 */
  421. SUNXI_FUNCTION(0x3, "mmc2")), /* D2 */
  422. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 11),
  423. SUNXI_FUNCTION(0x0, "gpio_in"),
  424. SUNXI_FUNCTION(0x1, "gpio_out"),
  425. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ3 */
  426. SUNXI_FUNCTION(0x3, "mmc2")), /* D3 */
  427. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 12),
  428. SUNXI_FUNCTION(0x0, "gpio_in"),
  429. SUNXI_FUNCTION(0x1, "gpio_out"),
  430. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ4 */
  431. SUNXI_FUNCTION_VARIANT(0x3, "mmc2", /* D4 */
  432. PINCTRL_SUN8I_R40)),
  433. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 13),
  434. SUNXI_FUNCTION(0x0, "gpio_in"),
  435. SUNXI_FUNCTION(0x1, "gpio_out"),
  436. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ5 */
  437. SUNXI_FUNCTION_VARIANT(0x3, "mmc2", /* D5 */
  438. PINCTRL_SUN8I_R40)),
  439. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 14),
  440. SUNXI_FUNCTION(0x0, "gpio_in"),
  441. SUNXI_FUNCTION(0x1, "gpio_out"),
  442. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ6 */
  443. SUNXI_FUNCTION_VARIANT(0x3, "mmc2", /* D6 */
  444. PINCTRL_SUN8I_R40)),
  445. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 15),
  446. SUNXI_FUNCTION(0x0, "gpio_in"),
  447. SUNXI_FUNCTION(0x1, "gpio_out"),
  448. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ7 */
  449. SUNXI_FUNCTION_VARIANT(0x3, "mmc2", /* D7 */
  450. PINCTRL_SUN8I_R40)),
  451. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 16),
  452. SUNXI_FUNCTION(0x0, "gpio_in"),
  453. SUNXI_FUNCTION(0x1, "gpio_out"),
  454. SUNXI_FUNCTION(0x2, "nand0")), /* NWP */
  455. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 17),
  456. SUNXI_FUNCTION(0x0, "gpio_in"),
  457. SUNXI_FUNCTION(0x1, "gpio_out"),
  458. SUNXI_FUNCTION(0x2, "nand0")), /* NCE2 */
  459. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 18),
  460. SUNXI_FUNCTION(0x0, "gpio_in"),
  461. SUNXI_FUNCTION(0x1, "gpio_out"),
  462. SUNXI_FUNCTION(0x2, "nand0")), /* NCE3 */
  463. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 19),
  464. SUNXI_FUNCTION(0x0, "gpio_in"),
  465. SUNXI_FUNCTION(0x1, "gpio_out"),
  466. SUNXI_FUNCTION(0x2, "nand0"), /* NCE4 */
  467. SUNXI_FUNCTION(0x3, "spi2")), /* CS0 */
  468. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 20),
  469. SUNXI_FUNCTION(0x0, "gpio_in"),
  470. SUNXI_FUNCTION(0x1, "gpio_out"),
  471. SUNXI_FUNCTION(0x2, "nand0"), /* NCE5 */
  472. SUNXI_FUNCTION(0x3, "spi2")), /* CLK */
  473. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 21),
  474. SUNXI_FUNCTION(0x0, "gpio_in"),
  475. SUNXI_FUNCTION(0x1, "gpio_out"),
  476. SUNXI_FUNCTION(0x2, "nand0"), /* NCE6 */
  477. SUNXI_FUNCTION(0x3, "spi2")), /* MOSI */
  478. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 22),
  479. SUNXI_FUNCTION(0x0, "gpio_in"),
  480. SUNXI_FUNCTION(0x1, "gpio_out"),
  481. SUNXI_FUNCTION(0x2, "nand0"), /* NCE7 */
  482. SUNXI_FUNCTION(0x3, "spi2")), /* MISO */
  483. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 23),
  484. SUNXI_FUNCTION(0x0, "gpio_in"),
  485. SUNXI_FUNCTION(0x1, "gpio_out"),
  486. SUNXI_FUNCTION(0x3, "spi0")), /* CS0 */
  487. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 24),
  488. SUNXI_FUNCTION(0x0, "gpio_in"),
  489. SUNXI_FUNCTION(0x1, "gpio_out"),
  490. SUNXI_FUNCTION(0x2, "nand0"), /* NDQS */
  491. SUNXI_FUNCTION_VARIANT(0x3, "mmc2", /* RST */
  492. PINCTRL_SUN8I_R40)),
  493. /* Hole */
  494. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 0),
  495. SUNXI_FUNCTION(0x0, "gpio_in"),
  496. SUNXI_FUNCTION(0x1, "gpio_out"),
  497. SUNXI_FUNCTION(0x2, "lcd0"), /* D0 */
  498. SUNXI_FUNCTION(0x3, "lvds0")), /* VP0 */
  499. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 1),
  500. SUNXI_FUNCTION(0x0, "gpio_in"),
  501. SUNXI_FUNCTION(0x1, "gpio_out"),
  502. SUNXI_FUNCTION(0x2, "lcd0"), /* D1 */
  503. SUNXI_FUNCTION(0x3, "lvds0")), /* VN0 */
  504. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 2),
  505. SUNXI_FUNCTION(0x0, "gpio_in"),
  506. SUNXI_FUNCTION(0x1, "gpio_out"),
  507. SUNXI_FUNCTION(0x2, "lcd0"), /* D2 */
  508. SUNXI_FUNCTION(0x3, "lvds0")), /* VP1 */
  509. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 3),
  510. SUNXI_FUNCTION(0x0, "gpio_in"),
  511. SUNXI_FUNCTION(0x1, "gpio_out"),
  512. SUNXI_FUNCTION(0x2, "lcd0"), /* D3 */
  513. SUNXI_FUNCTION(0x3, "lvds0")), /* VN1 */
  514. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 4),
  515. SUNXI_FUNCTION(0x0, "gpio_in"),
  516. SUNXI_FUNCTION(0x1, "gpio_out"),
  517. SUNXI_FUNCTION(0x2, "lcd0"), /* D4 */
  518. SUNXI_FUNCTION(0x3, "lvds0")), /* VP2 */
  519. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 5),
  520. SUNXI_FUNCTION(0x0, "gpio_in"),
  521. SUNXI_FUNCTION(0x1, "gpio_out"),
  522. SUNXI_FUNCTION(0x2, "lcd0"), /* D5 */
  523. SUNXI_FUNCTION(0x3, "lvds0")), /* VN2 */
  524. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 6),
  525. SUNXI_FUNCTION(0x0, "gpio_in"),
  526. SUNXI_FUNCTION(0x1, "gpio_out"),
  527. SUNXI_FUNCTION(0x2, "lcd0"), /* D6 */
  528. SUNXI_FUNCTION(0x3, "lvds0")), /* VPC */
  529. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 7),
  530. SUNXI_FUNCTION(0x0, "gpio_in"),
  531. SUNXI_FUNCTION(0x1, "gpio_out"),
  532. SUNXI_FUNCTION(0x2, "lcd0"), /* D7 */
  533. SUNXI_FUNCTION(0x3, "lvds0")), /* VNC */
  534. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 8),
  535. SUNXI_FUNCTION(0x0, "gpio_in"),
  536. SUNXI_FUNCTION(0x1, "gpio_out"),
  537. SUNXI_FUNCTION(0x2, "lcd0"), /* D8 */
  538. SUNXI_FUNCTION(0x3, "lvds0")), /* VP3 */
  539. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 9),
  540. SUNXI_FUNCTION(0x0, "gpio_in"),
  541. SUNXI_FUNCTION(0x1, "gpio_out"),
  542. SUNXI_FUNCTION(0x2, "lcd0"), /* D9 */
  543. SUNXI_FUNCTION(0x3, "lvds0")), /* VM3 */
  544. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 10),
  545. SUNXI_FUNCTION(0x0, "gpio_in"),
  546. SUNXI_FUNCTION(0x1, "gpio_out"),
  547. SUNXI_FUNCTION(0x2, "lcd0"), /* D10 */
  548. SUNXI_FUNCTION(0x3, "lvds1")), /* VP0 */
  549. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 11),
  550. SUNXI_FUNCTION(0x0, "gpio_in"),
  551. SUNXI_FUNCTION(0x1, "gpio_out"),
  552. SUNXI_FUNCTION(0x2, "lcd0"), /* D11 */
  553. SUNXI_FUNCTION(0x3, "lvds1")), /* VN0 */
  554. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 12),
  555. SUNXI_FUNCTION(0x0, "gpio_in"),
  556. SUNXI_FUNCTION(0x1, "gpio_out"),
  557. SUNXI_FUNCTION(0x2, "lcd0"), /* D12 */
  558. SUNXI_FUNCTION(0x3, "lvds1")), /* VP1 */
  559. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 13),
  560. SUNXI_FUNCTION(0x0, "gpio_in"),
  561. SUNXI_FUNCTION(0x1, "gpio_out"),
  562. SUNXI_FUNCTION(0x2, "lcd0"), /* D13 */
  563. SUNXI_FUNCTION(0x3, "lvds1")), /* VN1 */
  564. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 14),
  565. SUNXI_FUNCTION(0x0, "gpio_in"),
  566. SUNXI_FUNCTION(0x1, "gpio_out"),
  567. SUNXI_FUNCTION(0x2, "lcd0"), /* D14 */
  568. SUNXI_FUNCTION(0x3, "lvds1")), /* VP2 */
  569. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 15),
  570. SUNXI_FUNCTION(0x0, "gpio_in"),
  571. SUNXI_FUNCTION(0x1, "gpio_out"),
  572. SUNXI_FUNCTION(0x2, "lcd0"), /* D15 */
  573. SUNXI_FUNCTION(0x3, "lvds1")), /* VN2 */
  574. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 16),
  575. SUNXI_FUNCTION(0x0, "gpio_in"),
  576. SUNXI_FUNCTION(0x1, "gpio_out"),
  577. SUNXI_FUNCTION(0x2, "lcd0"), /* D16 */
  578. SUNXI_FUNCTION(0x3, "lvds1")), /* VPC */
  579. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 17),
  580. SUNXI_FUNCTION(0x0, "gpio_in"),
  581. SUNXI_FUNCTION(0x1, "gpio_out"),
  582. SUNXI_FUNCTION(0x2, "lcd0"), /* D17 */
  583. SUNXI_FUNCTION(0x3, "lvds1")), /* VNC */
  584. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 18),
  585. SUNXI_FUNCTION(0x0, "gpio_in"),
  586. SUNXI_FUNCTION(0x1, "gpio_out"),
  587. SUNXI_FUNCTION(0x2, "lcd0"), /* D18 */
  588. SUNXI_FUNCTION(0x3, "lvds1")), /* VP3 */
  589. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 19),
  590. SUNXI_FUNCTION(0x0, "gpio_in"),
  591. SUNXI_FUNCTION(0x1, "gpio_out"),
  592. SUNXI_FUNCTION(0x2, "lcd0"), /* D19 */
  593. SUNXI_FUNCTION(0x3, "lvds1")), /* VN3 */
  594. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 20),
  595. SUNXI_FUNCTION(0x0, "gpio_in"),
  596. SUNXI_FUNCTION(0x1, "gpio_out"),
  597. SUNXI_FUNCTION(0x2, "lcd0"), /* D20 */
  598. SUNXI_FUNCTION(0x3, "csi1")), /* MCLK */
  599. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 21),
  600. SUNXI_FUNCTION(0x0, "gpio_in"),
  601. SUNXI_FUNCTION(0x1, "gpio_out"),
  602. SUNXI_FUNCTION(0x2, "lcd0"), /* D21 */
  603. SUNXI_FUNCTION(0x3, "sim")), /* VPPEN */
  604. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 22),
  605. SUNXI_FUNCTION(0x0, "gpio_in"),
  606. SUNXI_FUNCTION(0x1, "gpio_out"),
  607. SUNXI_FUNCTION(0x2, "lcd0"), /* D22 */
  608. SUNXI_FUNCTION(0x3, "sim")), /* VPPPP */
  609. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 23),
  610. SUNXI_FUNCTION(0x0, "gpio_in"),
  611. SUNXI_FUNCTION(0x1, "gpio_out"),
  612. SUNXI_FUNCTION(0x2, "lcd0"), /* D23 */
  613. SUNXI_FUNCTION(0x3, "sim")), /* DET */
  614. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 24),
  615. SUNXI_FUNCTION(0x0, "gpio_in"),
  616. SUNXI_FUNCTION(0x1, "gpio_out"),
  617. SUNXI_FUNCTION(0x2, "lcd0"), /* CLK */
  618. SUNXI_FUNCTION(0x3, "sim")), /* VCCEN */
  619. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 25),
  620. SUNXI_FUNCTION(0x0, "gpio_in"),
  621. SUNXI_FUNCTION(0x1, "gpio_out"),
  622. SUNXI_FUNCTION(0x2, "lcd0"), /* DE */
  623. SUNXI_FUNCTION(0x3, "sim")), /* RST */
  624. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 26),
  625. SUNXI_FUNCTION(0x0, "gpio_in"),
  626. SUNXI_FUNCTION(0x1, "gpio_out"),
  627. SUNXI_FUNCTION(0x2, "lcd0"), /* HSYNC */
  628. SUNXI_FUNCTION(0x3, "sim")), /* SCK */
  629. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 27),
  630. SUNXI_FUNCTION(0x0, "gpio_in"),
  631. SUNXI_FUNCTION(0x1, "gpio_out"),
  632. SUNXI_FUNCTION(0x2, "lcd0"), /* VSYNC */
  633. SUNXI_FUNCTION(0x3, "sim")), /* SDA */
  634. /* Hole */
  635. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 0),
  636. SUNXI_FUNCTION(0x0, "gpio_in"),
  637. SUNXI_FUNCTION(0x1, "gpio_out"),
  638. SUNXI_FUNCTION(0x2, "ts0"), /* CLK */
  639. SUNXI_FUNCTION(0x3, "csi0")), /* PCK */
  640. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 1),
  641. SUNXI_FUNCTION(0x0, "gpio_in"),
  642. SUNXI_FUNCTION(0x1, "gpio_out"),
  643. SUNXI_FUNCTION(0x2, "ts0"), /* ERR */
  644. SUNXI_FUNCTION(0x3, "csi0")), /* CK */
  645. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 2),
  646. SUNXI_FUNCTION(0x0, "gpio_in"),
  647. SUNXI_FUNCTION(0x1, "gpio_out"),
  648. SUNXI_FUNCTION(0x2, "ts0"), /* SYNC */
  649. SUNXI_FUNCTION(0x3, "csi0")), /* HSYNC */
  650. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 3),
  651. SUNXI_FUNCTION(0x0, "gpio_in"),
  652. SUNXI_FUNCTION(0x1, "gpio_out"),
  653. SUNXI_FUNCTION(0x2, "ts0"), /* DVLD */
  654. SUNXI_FUNCTION(0x3, "csi0")), /* VSYNC */
  655. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 4),
  656. SUNXI_FUNCTION(0x0, "gpio_in"),
  657. SUNXI_FUNCTION(0x1, "gpio_out"),
  658. SUNXI_FUNCTION(0x2, "ts0"), /* D0 */
  659. SUNXI_FUNCTION(0x3, "csi0")), /* D0 */
  660. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 5),
  661. SUNXI_FUNCTION(0x0, "gpio_in"),
  662. SUNXI_FUNCTION(0x1, "gpio_out"),
  663. SUNXI_FUNCTION(0x2, "ts0"), /* D1 */
  664. SUNXI_FUNCTION(0x3, "csi0"), /* D1 */
  665. SUNXI_FUNCTION(0x4, "sim")), /* VPPEN */
  666. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 6),
  667. SUNXI_FUNCTION(0x0, "gpio_in"),
  668. SUNXI_FUNCTION(0x1, "gpio_out"),
  669. SUNXI_FUNCTION(0x2, "ts0"), /* D2 */
  670. SUNXI_FUNCTION(0x3, "csi0")), /* D2 */
  671. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 7),
  672. SUNXI_FUNCTION(0x0, "gpio_in"),
  673. SUNXI_FUNCTION(0x1, "gpio_out"),
  674. SUNXI_FUNCTION(0x2, "ts0"), /* D3 */
  675. SUNXI_FUNCTION(0x3, "csi0")), /* D3 */
  676. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 8),
  677. SUNXI_FUNCTION(0x0, "gpio_in"),
  678. SUNXI_FUNCTION(0x1, "gpio_out"),
  679. SUNXI_FUNCTION(0x2, "ts0"), /* D4 */
  680. SUNXI_FUNCTION(0x3, "csi0")), /* D4 */
  681. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 9),
  682. SUNXI_FUNCTION(0x0, "gpio_in"),
  683. SUNXI_FUNCTION(0x1, "gpio_out"),
  684. SUNXI_FUNCTION(0x2, "ts0"), /* D5 */
  685. SUNXI_FUNCTION(0x3, "csi0")), /* D5 */
  686. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 10),
  687. SUNXI_FUNCTION(0x0, "gpio_in"),
  688. SUNXI_FUNCTION(0x1, "gpio_out"),
  689. SUNXI_FUNCTION(0x2, "ts0"), /* D6 */
  690. SUNXI_FUNCTION(0x3, "csi0")), /* D6 */
  691. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 11),
  692. SUNXI_FUNCTION(0x0, "gpio_in"),
  693. SUNXI_FUNCTION(0x1, "gpio_out"),
  694. SUNXI_FUNCTION(0x2, "ts0"), /* D7 */
  695. SUNXI_FUNCTION(0x3, "csi0")), /* D7 */
  696. /* Hole */
  697. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0),
  698. SUNXI_FUNCTION(0x0, "gpio_in"),
  699. SUNXI_FUNCTION(0x1, "gpio_out"),
  700. SUNXI_FUNCTION(0x2, "mmc0"), /* D1 */
  701. SUNXI_FUNCTION(0x4, "jtag")), /* MSI */
  702. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1),
  703. SUNXI_FUNCTION(0x0, "gpio_in"),
  704. SUNXI_FUNCTION(0x1, "gpio_out"),
  705. SUNXI_FUNCTION(0x2, "mmc0"), /* D0 */
  706. SUNXI_FUNCTION(0x4, "jtag")), /* DI1 */
  707. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2),
  708. SUNXI_FUNCTION(0x0, "gpio_in"),
  709. SUNXI_FUNCTION(0x1, "gpio_out"),
  710. SUNXI_FUNCTION(0x2, "mmc0"), /* CLK */
  711. SUNXI_FUNCTION(0x4, "uart0")), /* TX */
  712. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3),
  713. SUNXI_FUNCTION(0x0, "gpio_in"),
  714. SUNXI_FUNCTION(0x1, "gpio_out"),
  715. SUNXI_FUNCTION(0x2, "mmc0"), /* CMD */
  716. SUNXI_FUNCTION(0x4, "jtag")), /* DO1 */
  717. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4),
  718. SUNXI_FUNCTION(0x0, "gpio_in"),
  719. SUNXI_FUNCTION(0x1, "gpio_out"),
  720. SUNXI_FUNCTION(0x2, "mmc0"), /* D3 */
  721. SUNXI_FUNCTION(0x4, "uart0")), /* RX */
  722. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5),
  723. SUNXI_FUNCTION(0x0, "gpio_in"),
  724. SUNXI_FUNCTION(0x1, "gpio_out"),
  725. SUNXI_FUNCTION(0x2, "mmc0"), /* D2 */
  726. SUNXI_FUNCTION(0x4, "jtag")), /* CK1 */
  727. /* Hole */
  728. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0),
  729. SUNXI_FUNCTION(0x0, "gpio_in"),
  730. SUNXI_FUNCTION(0x1, "gpio_out"),
  731. SUNXI_FUNCTION(0x2, "ts1"), /* CLK */
  732. SUNXI_FUNCTION(0x3, "csi1"), /* PCK */
  733. SUNXI_FUNCTION(0x4, "mmc1")), /* CMD */
  734. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1),
  735. SUNXI_FUNCTION(0x0, "gpio_in"),
  736. SUNXI_FUNCTION(0x1, "gpio_out"),
  737. SUNXI_FUNCTION(0x2, "ts1"), /* ERR */
  738. SUNXI_FUNCTION(0x3, "csi1"), /* CK */
  739. SUNXI_FUNCTION(0x4, "mmc1")), /* CLK */
  740. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2),
  741. SUNXI_FUNCTION(0x0, "gpio_in"),
  742. SUNXI_FUNCTION(0x1, "gpio_out"),
  743. SUNXI_FUNCTION(0x2, "ts1"), /* SYNC */
  744. SUNXI_FUNCTION(0x3, "csi1"), /* HSYNC */
  745. SUNXI_FUNCTION(0x4, "mmc1")), /* D0 */
  746. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3),
  747. SUNXI_FUNCTION(0x0, "gpio_in"),
  748. SUNXI_FUNCTION(0x1, "gpio_out"),
  749. SUNXI_FUNCTION(0x2, "ts1"), /* DVLD */
  750. SUNXI_FUNCTION(0x3, "csi1"), /* VSYNC */
  751. SUNXI_FUNCTION(0x4, "mmc1")), /* D1 */
  752. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4),
  753. SUNXI_FUNCTION(0x0, "gpio_in"),
  754. SUNXI_FUNCTION(0x1, "gpio_out"),
  755. SUNXI_FUNCTION(0x2, "ts1"), /* D0 */
  756. SUNXI_FUNCTION(0x3, "csi1"), /* D0 */
  757. SUNXI_FUNCTION(0x4, "mmc1"), /* D2 */
  758. SUNXI_FUNCTION(0x5, "csi0")), /* D8 */
  759. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 5),
  760. SUNXI_FUNCTION(0x0, "gpio_in"),
  761. SUNXI_FUNCTION(0x1, "gpio_out"),
  762. SUNXI_FUNCTION(0x2, "ts1"), /* D1 */
  763. SUNXI_FUNCTION(0x3, "csi1"), /* D1 */
  764. SUNXI_FUNCTION(0x4, "mmc1"), /* D3 */
  765. SUNXI_FUNCTION(0x5, "csi0")), /* D9 */
  766. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 6),
  767. SUNXI_FUNCTION(0x0, "gpio_in"),
  768. SUNXI_FUNCTION(0x1, "gpio_out"),
  769. SUNXI_FUNCTION(0x2, "ts1"), /* D2 */
  770. SUNXI_FUNCTION(0x3, "csi1"), /* D2 */
  771. SUNXI_FUNCTION(0x4, "uart3"), /* TX */
  772. SUNXI_FUNCTION(0x5, "csi0")), /* D10 */
  773. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 7),
  774. SUNXI_FUNCTION(0x0, "gpio_in"),
  775. SUNXI_FUNCTION(0x1, "gpio_out"),
  776. SUNXI_FUNCTION(0x2, "ts1"), /* D3 */
  777. SUNXI_FUNCTION(0x3, "csi1"), /* D3 */
  778. SUNXI_FUNCTION(0x4, "uart3"), /* RX */
  779. SUNXI_FUNCTION(0x5, "csi0")), /* D11 */
  780. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 8),
  781. SUNXI_FUNCTION(0x0, "gpio_in"),
  782. SUNXI_FUNCTION(0x1, "gpio_out"),
  783. SUNXI_FUNCTION(0x2, "ts1"), /* D4 */
  784. SUNXI_FUNCTION(0x3, "csi1"), /* D4 */
  785. SUNXI_FUNCTION(0x4, "uart3"), /* RTS */
  786. SUNXI_FUNCTION(0x5, "csi0")), /* D12 */
  787. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 9),
  788. SUNXI_FUNCTION(0x0, "gpio_in"),
  789. SUNXI_FUNCTION(0x1, "gpio_out"),
  790. SUNXI_FUNCTION(0x2, "ts1"), /* D5 */
  791. SUNXI_FUNCTION(0x3, "csi1"), /* D5 */
  792. SUNXI_FUNCTION(0x4, "uart3"), /* CTS */
  793. SUNXI_FUNCTION(0x5, "csi0"), /* D13 */
  794. SUNXI_FUNCTION_VARIANT(0x6, "bist", /* RESULT0 */
  795. PINCTRL_SUN8I_R40)),
  796. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10),
  797. SUNXI_FUNCTION(0x0, "gpio_in"),
  798. SUNXI_FUNCTION(0x1, "gpio_out"),
  799. SUNXI_FUNCTION(0x2, "ts1"), /* D6 */
  800. SUNXI_FUNCTION(0x3, "csi1"), /* D6 */
  801. SUNXI_FUNCTION(0x4, "uart4"), /* TX */
  802. SUNXI_FUNCTION(0x5, "csi0"), /* D14 */
  803. SUNXI_FUNCTION_VARIANT(0x6, "bist", /* RESULT1 */
  804. PINCTRL_SUN8I_R40)),
  805. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 11),
  806. SUNXI_FUNCTION(0x0, "gpio_in"),
  807. SUNXI_FUNCTION(0x1, "gpio_out"),
  808. SUNXI_FUNCTION(0x2, "ts1"), /* D7 */
  809. SUNXI_FUNCTION(0x3, "csi1"), /* D7 */
  810. SUNXI_FUNCTION(0x4, "uart4"), /* RX */
  811. SUNXI_FUNCTION(0x5, "csi0")), /* D15 */
  812. /* Hole */
  813. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 0),
  814. SUNXI_FUNCTION(0x0, "gpio_in"),
  815. SUNXI_FUNCTION(0x1, "gpio_out"),
  816. SUNXI_FUNCTION(0x2, "lcd1"), /* D0 */
  817. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAA0 */
  818. PINCTRL_SUN4I_A10),
  819. SUNXI_FUNCTION(0x4, "uart3"), /* TX */
  820. SUNXI_FUNCTION_IRQ(0x6, 0), /* EINT0 */
  821. SUNXI_FUNCTION(0x7, "csi1")), /* D0 */
  822. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 1),
  823. SUNXI_FUNCTION(0x0, "gpio_in"),
  824. SUNXI_FUNCTION(0x1, "gpio_out"),
  825. SUNXI_FUNCTION(0x2, "lcd1"), /* D1 */
  826. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAA1 */
  827. PINCTRL_SUN4I_A10),
  828. SUNXI_FUNCTION(0x4, "uart3"), /* RX */
  829. SUNXI_FUNCTION_IRQ(0x6, 1), /* EINT1 */
  830. SUNXI_FUNCTION(0x7, "csi1")), /* D1 */
  831. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 2),
  832. SUNXI_FUNCTION(0x0, "gpio_in"),
  833. SUNXI_FUNCTION(0x1, "gpio_out"),
  834. SUNXI_FUNCTION(0x2, "lcd1"), /* D2 */
  835. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAA2 */
  836. PINCTRL_SUN4I_A10),
  837. SUNXI_FUNCTION(0x4, "uart3"), /* RTS */
  838. SUNXI_FUNCTION_IRQ(0x6, 2), /* EINT2 */
  839. SUNXI_FUNCTION(0x7, "csi1")), /* D2 */
  840. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 3),
  841. SUNXI_FUNCTION(0x0, "gpio_in"),
  842. SUNXI_FUNCTION(0x1, "gpio_out"),
  843. SUNXI_FUNCTION(0x2, "lcd1"), /* D3 */
  844. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAIRQ */
  845. PINCTRL_SUN4I_A10),
  846. SUNXI_FUNCTION(0x4, "uart3"), /* CTS */
  847. SUNXI_FUNCTION_IRQ(0x6, 3), /* EINT3 */
  848. SUNXI_FUNCTION(0x7, "csi1")), /* D3 */
  849. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 4),
  850. SUNXI_FUNCTION(0x0, "gpio_in"),
  851. SUNXI_FUNCTION(0x1, "gpio_out"),
  852. SUNXI_FUNCTION(0x2, "lcd1"), /* D4 */
  853. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD0 */
  854. PINCTRL_SUN4I_A10),
  855. SUNXI_FUNCTION(0x4, "uart4"), /* TX */
  856. SUNXI_FUNCTION_IRQ(0x6, 4), /* EINT4 */
  857. SUNXI_FUNCTION(0x7, "csi1")), /* D4 */
  858. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 5),
  859. SUNXI_FUNCTION(0x0, "gpio_in"),
  860. SUNXI_FUNCTION(0x1, "gpio_out"),
  861. SUNXI_FUNCTION(0x2, "lcd1"), /* D5 */
  862. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD1 */
  863. PINCTRL_SUN4I_A10),
  864. SUNXI_FUNCTION(0x4, "uart4"), /* RX */
  865. SUNXI_FUNCTION_IRQ(0x6, 5), /* EINT5 */
  866. SUNXI_FUNCTION(0x7, "csi1")), /* D5 */
  867. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 6),
  868. SUNXI_FUNCTION(0x0, "gpio_in"),
  869. SUNXI_FUNCTION(0x1, "gpio_out"),
  870. SUNXI_FUNCTION(0x2, "lcd1"), /* D6 */
  871. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD2 */
  872. PINCTRL_SUN4I_A10),
  873. SUNXI_FUNCTION(0x4, "uart5"), /* TX */
  874. SUNXI_FUNCTION_VARIANT(0x5, "ms", /* BS */
  875. PINCTRL_SUN4I_A10 |
  876. PINCTRL_SUN7I_A20),
  877. SUNXI_FUNCTION_IRQ(0x6, 6), /* EINT6 */
  878. SUNXI_FUNCTION(0x7, "csi1")), /* D6 */
  879. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 7),
  880. SUNXI_FUNCTION(0x0, "gpio_in"),
  881. SUNXI_FUNCTION(0x1, "gpio_out"),
  882. SUNXI_FUNCTION(0x2, "lcd1"), /* D7 */
  883. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD3 */
  884. PINCTRL_SUN4I_A10),
  885. SUNXI_FUNCTION(0x4, "uart5"), /* RX */
  886. SUNXI_FUNCTION_VARIANT(0x5, "ms", /* CLK */
  887. PINCTRL_SUN4I_A10 |
  888. PINCTRL_SUN7I_A20),
  889. SUNXI_FUNCTION_IRQ(0x6, 7), /* EINT7 */
  890. SUNXI_FUNCTION(0x7, "csi1")), /* D7 */
  891. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 8),
  892. SUNXI_FUNCTION(0x0, "gpio_in"),
  893. SUNXI_FUNCTION(0x1, "gpio_out"),
  894. SUNXI_FUNCTION(0x2, "lcd1"), /* D8 */
  895. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD4 */
  896. PINCTRL_SUN4I_A10),
  897. SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ERXD3 */
  898. PINCTRL_SUN7I_A20 |
  899. PINCTRL_SUN8I_R40),
  900. SUNXI_FUNCTION(0x4, "keypad"), /* IN0 */
  901. SUNXI_FUNCTION_VARIANT(0x5, "ms", /* D0 */
  902. PINCTRL_SUN4I_A10 |
  903. PINCTRL_SUN7I_A20),
  904. SUNXI_FUNCTION_IRQ(0x6, 8), /* EINT8 */
  905. SUNXI_FUNCTION(0x7, "csi1")), /* D8 */
  906. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 9),
  907. SUNXI_FUNCTION(0x0, "gpio_in"),
  908. SUNXI_FUNCTION(0x1, "gpio_out"),
  909. SUNXI_FUNCTION(0x2, "lcd1"), /* D9 */
  910. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD5 */
  911. PINCTRL_SUN4I_A10),
  912. SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ERXD2 */
  913. PINCTRL_SUN7I_A20 |
  914. PINCTRL_SUN8I_R40),
  915. SUNXI_FUNCTION(0x4, "keypad"), /* IN1 */
  916. SUNXI_FUNCTION_VARIANT(0x5, "ms", /* D1 */
  917. PINCTRL_SUN4I_A10 |
  918. PINCTRL_SUN7I_A20),
  919. SUNXI_FUNCTION_IRQ(0x6, 9), /* EINT9 */
  920. SUNXI_FUNCTION(0x7, "csi1")), /* D9 */
  921. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 10),
  922. SUNXI_FUNCTION(0x0, "gpio_in"),
  923. SUNXI_FUNCTION(0x1, "gpio_out"),
  924. SUNXI_FUNCTION(0x2, "lcd1"), /* D10 */
  925. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD6 */
  926. PINCTRL_SUN4I_A10),
  927. SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ERXD1 */
  928. PINCTRL_SUN7I_A20 |
  929. PINCTRL_SUN8I_R40),
  930. SUNXI_FUNCTION(0x4, "keypad"), /* IN2 */
  931. SUNXI_FUNCTION_VARIANT(0x5, "ms", /* D2 */
  932. PINCTRL_SUN4I_A10 |
  933. PINCTRL_SUN7I_A20),
  934. SUNXI_FUNCTION_IRQ(0x6, 10), /* EINT10 */
  935. SUNXI_FUNCTION(0x7, "csi1")), /* D10 */
  936. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 11),
  937. SUNXI_FUNCTION(0x0, "gpio_in"),
  938. SUNXI_FUNCTION(0x1, "gpio_out"),
  939. SUNXI_FUNCTION(0x2, "lcd1"), /* D11 */
  940. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD7 */
  941. PINCTRL_SUN4I_A10),
  942. SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ERXD0 */
  943. PINCTRL_SUN7I_A20 |
  944. PINCTRL_SUN8I_R40),
  945. SUNXI_FUNCTION(0x4, "keypad"), /* IN3 */
  946. SUNXI_FUNCTION_VARIANT(0x5, "ms", /* D3 */
  947. PINCTRL_SUN4I_A10 |
  948. PINCTRL_SUN7I_A20),
  949. SUNXI_FUNCTION_IRQ(0x6, 11), /* EINT11 */
  950. SUNXI_FUNCTION(0x7, "csi1")), /* D11 */
  951. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 12),
  952. SUNXI_FUNCTION(0x0, "gpio_in"),
  953. SUNXI_FUNCTION(0x1, "gpio_out"),
  954. SUNXI_FUNCTION(0x2, "lcd1"), /* D12 */
  955. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD8 */
  956. PINCTRL_SUN4I_A10),
  957. SUNXI_FUNCTION(0x4, "ps2"), /* SCK1 */
  958. SUNXI_FUNCTION_IRQ(0x6, 12), /* EINT12 */
  959. SUNXI_FUNCTION(0x7, "csi1")), /* D12 */
  960. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 13),
  961. SUNXI_FUNCTION(0x0, "gpio_in"),
  962. SUNXI_FUNCTION(0x1, "gpio_out"),
  963. SUNXI_FUNCTION(0x2, "lcd1"), /* D13 */
  964. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD9 */
  965. PINCTRL_SUN4I_A10),
  966. SUNXI_FUNCTION(0x4, "ps2"), /* SDA1 */
  967. SUNXI_FUNCTION(0x5, "sim"), /* RST */
  968. SUNXI_FUNCTION_IRQ(0x6, 13), /* EINT13 */
  969. SUNXI_FUNCTION(0x7, "csi1")), /* D13 */
  970. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 14),
  971. SUNXI_FUNCTION(0x0, "gpio_in"),
  972. SUNXI_FUNCTION(0x1, "gpio_out"),
  973. SUNXI_FUNCTION(0x2, "lcd1"), /* D14 */
  974. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD10 */
  975. PINCTRL_SUN4I_A10),
  976. SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXD3 */
  977. PINCTRL_SUN7I_A20 |
  978. PINCTRL_SUN8I_R40),
  979. SUNXI_FUNCTION(0x4, "keypad"), /* IN4 */
  980. SUNXI_FUNCTION(0x5, "sim"), /* VPPEN */
  981. SUNXI_FUNCTION_IRQ(0x6, 14), /* EINT14 */
  982. SUNXI_FUNCTION(0x7, "csi1")), /* D14 */
  983. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 15),
  984. SUNXI_FUNCTION(0x0, "gpio_in"),
  985. SUNXI_FUNCTION(0x1, "gpio_out"),
  986. SUNXI_FUNCTION(0x2, "lcd1"), /* D15 */
  987. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD11 */
  988. PINCTRL_SUN4I_A10),
  989. SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXD2 */
  990. PINCTRL_SUN7I_A20 |
  991. PINCTRL_SUN8I_R40),
  992. SUNXI_FUNCTION(0x4, "keypad"), /* IN5 */
  993. SUNXI_FUNCTION(0x5, "sim"), /* VPPPP */
  994. SUNXI_FUNCTION_IRQ(0x6, 15), /* EINT15 */
  995. SUNXI_FUNCTION(0x7, "csi1")), /* D15 */
  996. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 16),
  997. SUNXI_FUNCTION(0x0, "gpio_in"),
  998. SUNXI_FUNCTION(0x1, "gpio_out"),
  999. SUNXI_FUNCTION(0x2, "lcd1"), /* D16 */
  1000. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD12 */
  1001. PINCTRL_SUN4I_A10),
  1002. SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXD1 */
  1003. PINCTRL_SUN7I_A20 |
  1004. PINCTRL_SUN8I_R40),
  1005. SUNXI_FUNCTION(0x4, "keypad"), /* IN6 */
  1006. SUNXI_FUNCTION(0x5, "sim"), /* DET */
  1007. SUNXI_FUNCTION_IRQ(0x6, 16), /* EINT16 */
  1008. SUNXI_FUNCTION(0x7, "csi1")), /* D16 */
  1009. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 17),
  1010. SUNXI_FUNCTION(0x0, "gpio_in"),
  1011. SUNXI_FUNCTION(0x1, "gpio_out"),
  1012. SUNXI_FUNCTION(0x2, "lcd1"), /* D17 */
  1013. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD13 */
  1014. PINCTRL_SUN4I_A10),
  1015. SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXD0 */
  1016. PINCTRL_SUN7I_A20 |
  1017. PINCTRL_SUN8I_R40),
  1018. SUNXI_FUNCTION(0x4, "keypad"), /* IN7 */
  1019. SUNXI_FUNCTION(0x5, "sim"), /* VCCEN */
  1020. SUNXI_FUNCTION_IRQ(0x6, 17), /* EINT17 */
  1021. SUNXI_FUNCTION(0x7, "csi1")), /* D17 */
  1022. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 18),
  1023. SUNXI_FUNCTION(0x0, "gpio_in"),
  1024. SUNXI_FUNCTION(0x1, "gpio_out"),
  1025. SUNXI_FUNCTION(0x2, "lcd1"), /* D18 */
  1026. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD14 */
  1027. PINCTRL_SUN4I_A10),
  1028. SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ERXCK */
  1029. PINCTRL_SUN7I_A20 |
  1030. PINCTRL_SUN8I_R40),
  1031. SUNXI_FUNCTION(0x4, "keypad"), /* OUT0 */
  1032. SUNXI_FUNCTION(0x5, "sim"), /* SCK */
  1033. SUNXI_FUNCTION_IRQ(0x6, 18), /* EINT18 */
  1034. SUNXI_FUNCTION(0x7, "csi1")), /* D18 */
  1035. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 19),
  1036. SUNXI_FUNCTION(0x0, "gpio_in"),
  1037. SUNXI_FUNCTION(0x1, "gpio_out"),
  1038. SUNXI_FUNCTION(0x2, "lcd1"), /* D19 */
  1039. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD15 */
  1040. PINCTRL_SUN4I_A10),
  1041. SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ERXERR */
  1042. PINCTRL_SUN7I_A20 |
  1043. PINCTRL_SUN8I_R40),
  1044. SUNXI_FUNCTION(0x4, "keypad"), /* OUT1 */
  1045. SUNXI_FUNCTION(0x5, "sim"), /* SDA */
  1046. SUNXI_FUNCTION_IRQ(0x6, 19), /* EINT19 */
  1047. SUNXI_FUNCTION(0x7, "csi1")), /* D19 */
  1048. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 20),
  1049. SUNXI_FUNCTION(0x0, "gpio_in"),
  1050. SUNXI_FUNCTION(0x1, "gpio_out"),
  1051. SUNXI_FUNCTION(0x2, "lcd1"), /* D20 */
  1052. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAOE */
  1053. PINCTRL_SUN4I_A10),
  1054. SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ERXDV */
  1055. PINCTRL_SUN7I_A20 |
  1056. PINCTRL_SUN8I_R40),
  1057. SUNXI_FUNCTION(0x4, "can"), /* TX */
  1058. SUNXI_FUNCTION_IRQ(0x6, 20), /* EINT20 */
  1059. SUNXI_FUNCTION(0x7, "csi1")), /* D20 */
  1060. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 21),
  1061. SUNXI_FUNCTION(0x0, "gpio_in"),
  1062. SUNXI_FUNCTION(0x1, "gpio_out"),
  1063. SUNXI_FUNCTION(0x2, "lcd1"), /* D21 */
  1064. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATADREQ */
  1065. PINCTRL_SUN4I_A10),
  1066. SUNXI_FUNCTION_VARIANT(0x3, "emac", /* EMDC */
  1067. PINCTRL_SUN7I_A20 |
  1068. PINCTRL_SUN8I_R40),
  1069. SUNXI_FUNCTION(0x4, "can"), /* RX */
  1070. SUNXI_FUNCTION_IRQ(0x6, 21), /* EINT21 */
  1071. SUNXI_FUNCTION(0x7, "csi1")), /* D21 */
  1072. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 22),
  1073. SUNXI_FUNCTION(0x0, "gpio_in"),
  1074. SUNXI_FUNCTION(0x1, "gpio_out"),
  1075. SUNXI_FUNCTION(0x2, "lcd1"), /* D22 */
  1076. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATADACK */
  1077. PINCTRL_SUN4I_A10),
  1078. SUNXI_FUNCTION_VARIANT(0x3, "emac", /* EMDIO */
  1079. PINCTRL_SUN7I_A20 |
  1080. PINCTRL_SUN8I_R40),
  1081. SUNXI_FUNCTION(0x4, "keypad"), /* OUT2 */
  1082. SUNXI_FUNCTION(0x5, "mmc1"), /* CMD */
  1083. SUNXI_FUNCTION(0x7, "csi1")), /* D22 */
  1084. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 23),
  1085. SUNXI_FUNCTION(0x0, "gpio_in"),
  1086. SUNXI_FUNCTION(0x1, "gpio_out"),
  1087. SUNXI_FUNCTION(0x2, "lcd1"), /* D23 */
  1088. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATACS0 */
  1089. PINCTRL_SUN4I_A10),
  1090. SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXEN */
  1091. PINCTRL_SUN7I_A20 |
  1092. PINCTRL_SUN8I_R40),
  1093. SUNXI_FUNCTION(0x4, "keypad"), /* OUT3 */
  1094. SUNXI_FUNCTION(0x5, "mmc1"), /* CLK */
  1095. SUNXI_FUNCTION(0x7, "csi1")), /* D23 */
  1096. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 24),
  1097. SUNXI_FUNCTION(0x0, "gpio_in"),
  1098. SUNXI_FUNCTION(0x1, "gpio_out"),
  1099. SUNXI_FUNCTION(0x2, "lcd1"), /* CLK */
  1100. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATACS1 */
  1101. PINCTRL_SUN4I_A10),
  1102. SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXCK */
  1103. PINCTRL_SUN7I_A20 |
  1104. PINCTRL_SUN8I_R40),
  1105. SUNXI_FUNCTION(0x4, "keypad"), /* OUT4 */
  1106. SUNXI_FUNCTION(0x5, "mmc1"), /* D0 */
  1107. SUNXI_FUNCTION(0x7, "csi1")), /* PCLK */
  1108. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 25),
  1109. SUNXI_FUNCTION(0x0, "gpio_in"),
  1110. SUNXI_FUNCTION(0x1, "gpio_out"),
  1111. SUNXI_FUNCTION(0x2, "lcd1"), /* DE */
  1112. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAIORDY */
  1113. PINCTRL_SUN4I_A10),
  1114. SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ECRS */
  1115. PINCTRL_SUN7I_A20 |
  1116. PINCTRL_SUN8I_R40),
  1117. SUNXI_FUNCTION(0x4, "keypad"), /* OUT5 */
  1118. SUNXI_FUNCTION(0x5, "mmc1"), /* D1 */
  1119. SUNXI_FUNCTION(0x7, "csi1")), /* FIELD */
  1120. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 26),
  1121. SUNXI_FUNCTION(0x0, "gpio_in"),
  1122. SUNXI_FUNCTION(0x1, "gpio_out"),
  1123. SUNXI_FUNCTION(0x2, "lcd1"), /* HSYNC */
  1124. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAIOR */
  1125. PINCTRL_SUN4I_A10),
  1126. SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ECOL */
  1127. PINCTRL_SUN7I_A20 |
  1128. PINCTRL_SUN8I_R40),
  1129. SUNXI_FUNCTION(0x4, "keypad"), /* OUT6 */
  1130. SUNXI_FUNCTION(0x5, "mmc1"), /* D2 */
  1131. SUNXI_FUNCTION(0x7, "csi1")), /* HSYNC */
  1132. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 27),
  1133. SUNXI_FUNCTION(0x0, "gpio_in"),
  1134. SUNXI_FUNCTION(0x1, "gpio_out"),
  1135. SUNXI_FUNCTION(0x2, "lcd1"), /* VSYNC */
  1136. SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAIOW */
  1137. PINCTRL_SUN4I_A10),
  1138. SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXERR */
  1139. PINCTRL_SUN7I_A20 |
  1140. PINCTRL_SUN8I_R40),
  1141. SUNXI_FUNCTION(0x4, "keypad"), /* OUT7 */
  1142. SUNXI_FUNCTION(0x5, "mmc1"), /* D3 */
  1143. SUNXI_FUNCTION(0x7, "csi1")), /* VSYNC */
  1144. /* Hole */
  1145. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 0),
  1146. SUNXI_FUNCTION(0x0, "gpio_in"),
  1147. SUNXI_FUNCTION(0x1, "gpio_out"),
  1148. SUNXI_FUNCTION_VARIANT(0x3, "i2c3", /* SCK */
  1149. PINCTRL_SUN7I_A20 |
  1150. PINCTRL_SUN8I_R40)),
  1151. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 1),
  1152. SUNXI_FUNCTION(0x0, "gpio_in"),
  1153. SUNXI_FUNCTION(0x1, "gpio_out"),
  1154. SUNXI_FUNCTION_VARIANT(0x3, "i2c3", /* SDA */
  1155. PINCTRL_SUN7I_A20 |
  1156. PINCTRL_SUN8I_R40)),
  1157. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 2),
  1158. SUNXI_FUNCTION(0x0, "gpio_in"),
  1159. SUNXI_FUNCTION(0x1, "gpio_out"),
  1160. SUNXI_FUNCTION_VARIANT(0x3, "i2c4", /* SCK */
  1161. PINCTRL_SUN7I_A20 |
  1162. PINCTRL_SUN8I_R40)),
  1163. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 3),
  1164. SUNXI_FUNCTION(0x0, "gpio_in"),
  1165. SUNXI_FUNCTION(0x1, "gpio_out"),
  1166. SUNXI_FUNCTION(0x2, "pwm"), /* PWM1 */
  1167. SUNXI_FUNCTION_VARIANT(0x3, "i2c3", /* SDA */
  1168. PINCTRL_SUN7I_A20 |
  1169. PINCTRL_SUN8I_R40)),
  1170. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 4),
  1171. SUNXI_FUNCTION(0x0, "gpio_in"),
  1172. SUNXI_FUNCTION(0x1, "gpio_out"),
  1173. SUNXI_FUNCTION(0x2, "mmc3")), /* CMD */
  1174. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 5),
  1175. SUNXI_FUNCTION(0x0, "gpio_in"),
  1176. SUNXI_FUNCTION(0x1, "gpio_out"),
  1177. SUNXI_FUNCTION(0x2, "mmc3")), /* CLK */
  1178. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 6),
  1179. SUNXI_FUNCTION(0x0, "gpio_in"),
  1180. SUNXI_FUNCTION(0x1, "gpio_out"),
  1181. SUNXI_FUNCTION(0x2, "mmc3")), /* D0 */
  1182. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 7),
  1183. SUNXI_FUNCTION(0x0, "gpio_in"),
  1184. SUNXI_FUNCTION(0x1, "gpio_out"),
  1185. SUNXI_FUNCTION(0x2, "mmc3")), /* D1 */
  1186. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 8),
  1187. SUNXI_FUNCTION(0x0, "gpio_in"),
  1188. SUNXI_FUNCTION(0x1, "gpio_out"),
  1189. SUNXI_FUNCTION(0x2, "mmc3")), /* D2 */
  1190. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 9),
  1191. SUNXI_FUNCTION(0x0, "gpio_in"),
  1192. SUNXI_FUNCTION(0x1, "gpio_out"),
  1193. SUNXI_FUNCTION(0x2, "mmc3")), /* D3 */
  1194. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 10),
  1195. SUNXI_FUNCTION(0x0, "gpio_in"),
  1196. SUNXI_FUNCTION(0x1, "gpio_out"),
  1197. SUNXI_FUNCTION(0x2, "spi0"), /* CS0 */
  1198. SUNXI_FUNCTION(0x3, "uart5"), /* TX */
  1199. SUNXI_FUNCTION_IRQ(0x6, 22)), /* EINT22 */
  1200. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 11),
  1201. SUNXI_FUNCTION(0x0, "gpio_in"),
  1202. SUNXI_FUNCTION(0x1, "gpio_out"),
  1203. SUNXI_FUNCTION(0x2, "spi0"), /* CLK */
  1204. SUNXI_FUNCTION(0x3, "uart5"), /* RX */
  1205. SUNXI_FUNCTION_IRQ(0x6, 23)), /* EINT23 */
  1206. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 12),
  1207. SUNXI_FUNCTION(0x0, "gpio_in"),
  1208. SUNXI_FUNCTION(0x1, "gpio_out"),
  1209. SUNXI_FUNCTION(0x2, "spi0"), /* MOSI */
  1210. SUNXI_FUNCTION(0x3, "uart6"), /* TX */
  1211. SUNXI_FUNCTION_VARIANT(0x4, "clk_out_a",
  1212. PINCTRL_SUN7I_A20 |
  1213. PINCTRL_SUN8I_R40),
  1214. SUNXI_FUNCTION_IRQ(0x6, 24)), /* EINT24 */
  1215. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 13),
  1216. SUNXI_FUNCTION(0x0, "gpio_in"),
  1217. SUNXI_FUNCTION(0x1, "gpio_out"),
  1218. SUNXI_FUNCTION(0x2, "spi0"), /* MISO */
  1219. SUNXI_FUNCTION(0x3, "uart6"), /* RX */
  1220. SUNXI_FUNCTION_VARIANT(0x4, "clk_out_b",
  1221. PINCTRL_SUN7I_A20 |
  1222. PINCTRL_SUN8I_R40),
  1223. SUNXI_FUNCTION_IRQ(0x6, 25)), /* EINT25 */
  1224. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 14),
  1225. SUNXI_FUNCTION(0x0, "gpio_in"),
  1226. SUNXI_FUNCTION(0x1, "gpio_out"),
  1227. SUNXI_FUNCTION(0x2, "spi0"), /* CS1 */
  1228. SUNXI_FUNCTION(0x3, "ps2"), /* SCK1 */
  1229. SUNXI_FUNCTION(0x4, "timer4"), /* TCLKIN0 */
  1230. SUNXI_FUNCTION_IRQ(0x6, 26)), /* EINT26 */
  1231. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 15),
  1232. SUNXI_FUNCTION(0x0, "gpio_in"),
  1233. SUNXI_FUNCTION(0x1, "gpio_out"),
  1234. SUNXI_FUNCTION(0x2, "spi1"), /* CS1 */
  1235. SUNXI_FUNCTION(0x3, "ps2"), /* SDA1 */
  1236. SUNXI_FUNCTION(0x4, "timer5"), /* TCLKIN1 */
  1237. SUNXI_FUNCTION_IRQ(0x6, 27)), /* EINT27 */
  1238. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 16),
  1239. SUNXI_FUNCTION(0x0, "gpio_in"),
  1240. SUNXI_FUNCTION(0x1, "gpio_out"),
  1241. SUNXI_FUNCTION(0x2, "spi1"), /* CS0 */
  1242. SUNXI_FUNCTION(0x3, "uart2"), /* RTS */
  1243. SUNXI_FUNCTION_IRQ(0x6, 28)), /* EINT28 */
  1244. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 17),
  1245. SUNXI_FUNCTION(0x0, "gpio_in"),
  1246. SUNXI_FUNCTION(0x1, "gpio_out"),
  1247. SUNXI_FUNCTION(0x2, "spi1"), /* CLK */
  1248. SUNXI_FUNCTION(0x3, "uart2"), /* CTS */
  1249. SUNXI_FUNCTION_IRQ(0x6, 29)), /* EINT29 */
  1250. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 18),
  1251. SUNXI_FUNCTION(0x0, "gpio_in"),
  1252. SUNXI_FUNCTION(0x1, "gpio_out"),
  1253. SUNXI_FUNCTION(0x2, "spi1"), /* MOSI */
  1254. SUNXI_FUNCTION(0x3, "uart2"), /* TX */
  1255. SUNXI_FUNCTION_IRQ(0x6, 30)), /* EINT30 */
  1256. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 19),
  1257. SUNXI_FUNCTION(0x0, "gpio_in"),
  1258. SUNXI_FUNCTION(0x1, "gpio_out"),
  1259. SUNXI_FUNCTION(0x2, "spi1"), /* MISO */
  1260. SUNXI_FUNCTION(0x3, "uart2"), /* RX */
  1261. SUNXI_FUNCTION_IRQ(0x6, 31)), /* EINT31 */
  1262. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 20),
  1263. SUNXI_FUNCTION(0x0, "gpio_in"),
  1264. SUNXI_FUNCTION(0x1, "gpio_out"),
  1265. SUNXI_FUNCTION(0x2, "ps2"), /* SCK0 */
  1266. SUNXI_FUNCTION(0x3, "uart7"), /* TX */
  1267. SUNXI_FUNCTION_VARIANT(0x4, "hdmi", /* HSCL */
  1268. PINCTRL_SUN4I_A10 |
  1269. PINCTRL_SUN7I_A20),
  1270. SUNXI_FUNCTION_VARIANT(0x6, "pwm", /* PWM2 */
  1271. PINCTRL_SUN8I_R40)),
  1272. SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 21),
  1273. SUNXI_FUNCTION(0x0, "gpio_in"),
  1274. SUNXI_FUNCTION(0x1, "gpio_out"),
  1275. SUNXI_FUNCTION(0x2, "ps2"), /* SDA0 */
  1276. SUNXI_FUNCTION(0x3, "uart7"), /* RX */
  1277. SUNXI_FUNCTION_VARIANT(0x4, "hdmi", /* HSDA */
  1278. PINCTRL_SUN4I_A10 |
  1279. PINCTRL_SUN7I_A20),
  1280. SUNXI_FUNCTION_VARIANT(0x6, "pwm", /* PWM3 */
  1281. PINCTRL_SUN8I_R40)),
  1282. };
  1283. static const struct sunxi_pinctrl_desc sun4i_a10_pinctrl_data = {
  1284. .pins = sun4i_a10_pins,
  1285. .npins = ARRAY_SIZE(sun4i_a10_pins),
  1286. .irq_banks = 1,
  1287. .irq_read_needs_mux = true,
  1288. };
  1289. static int sun4i_a10_pinctrl_probe(struct platform_device *pdev)
  1290. {
  1291. unsigned long variant = (unsigned long)of_device_get_match_data(&pdev->dev);
  1292. return sunxi_pinctrl_init_with_variant(pdev, &sun4i_a10_pinctrl_data,
  1293. variant);
  1294. }
  1295. static const struct of_device_id sun4i_a10_pinctrl_match[] = {
  1296. {
  1297. .compatible = "allwinner,sun4i-a10-pinctrl",
  1298. .data = (void *)PINCTRL_SUN4I_A10
  1299. },
  1300. {
  1301. .compatible = "allwinner,sun7i-a20-pinctrl",
  1302. .data = (void *)PINCTRL_SUN7I_A20
  1303. },
  1304. {
  1305. .compatible = "allwinner,sun8i-r40-pinctrl",
  1306. .data = (void *)PINCTRL_SUN8I_R40
  1307. },
  1308. {}
  1309. };
  1310. static struct platform_driver sun4i_a10_pinctrl_driver = {
  1311. .probe = sun4i_a10_pinctrl_probe,
  1312. .driver = {
  1313. .name = "sun4i-pinctrl",
  1314. .of_match_table = sun4i_a10_pinctrl_match,
  1315. },
  1316. };
  1317. builtin_platform_driver(sun4i_a10_pinctrl_driver);