pinctrl-sun8i-a83t.c 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  1. /*
  2. * Allwinner a83t SoCs pinctrl driver.
  3. *
  4. * Copyright (C) 2015 Vishnu Patekar <vishnupatekar0510@gmail.com>
  5. *
  6. * Based on pinctrl-sun8i-a23.c, which is:
  7. * Copyright (C) 2014 Chen-Yu Tsai <wens@csie.org>
  8. * Copyright (C) 2014 Maxime Ripard <maxime.ripard@free-electrons.com>
  9. *
  10. * This file is licensed under the terms of the GNU General Public
  11. * License version 2. This program is licensed "as is" without any
  12. * warranty of any kind, whether express or implied.
  13. */
  14. #include <linux/module.h>
  15. #include <linux/platform_device.h>
  16. #include <linux/of.h>
  17. #include <linux/of_device.h>
  18. #include <linux/pinctrl/pinctrl.h>
  19. #include "pinctrl-sunxi.h"
  20. static const struct sunxi_desc_pin sun8i_a83t_pins[] = {
  21. /* Hole */
  22. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 0),
  23. SUNXI_FUNCTION(0x0, "gpio_in"),
  24. SUNXI_FUNCTION(0x1, "gpio_out"),
  25. SUNXI_FUNCTION(0x2, "uart2"), /* TX */
  26. SUNXI_FUNCTION(0x3, "jtag"), /* MS0 */
  27. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)), /* PB_EINT0 */
  28. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 1),
  29. SUNXI_FUNCTION(0x0, "gpio_in"),
  30. SUNXI_FUNCTION(0x1, "gpio_out"),
  31. SUNXI_FUNCTION(0x2, "uart2"), /* RX */
  32. SUNXI_FUNCTION(0x3, "jtag"), /* CK0 */
  33. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)), /* PB_EINT1 */
  34. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 2),
  35. SUNXI_FUNCTION(0x0, "gpio_in"),
  36. SUNXI_FUNCTION(0x1, "gpio_out"),
  37. SUNXI_FUNCTION(0x2, "uart2"), /* RTS */
  38. SUNXI_FUNCTION(0x3, "jtag"), /* DO0 */
  39. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 2)), /* PB_EINT2 */
  40. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 3),
  41. SUNXI_FUNCTION(0x0, "gpio_in"),
  42. SUNXI_FUNCTION(0x1, "gpio_out"),
  43. SUNXI_FUNCTION(0x2, "uart2"), /* CTS */
  44. SUNXI_FUNCTION(0x3, "jtag"), /* DI0 */
  45. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 3)), /* PB_EINT3 */
  46. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 4),
  47. SUNXI_FUNCTION(0x0, "gpio_in"),
  48. SUNXI_FUNCTION(0x1, "gpio_out"),
  49. SUNXI_FUNCTION(0x2, "i2s0"), /* LRCK */
  50. SUNXI_FUNCTION(0x3, "tdm"), /* LRCK */
  51. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 4)), /* PB_EINT4 */
  52. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 5),
  53. SUNXI_FUNCTION(0x0, "gpio_in"),
  54. SUNXI_FUNCTION(0x1, "gpio_out"),
  55. SUNXI_FUNCTION(0x2, "i2s0"), /* BCLK */
  56. SUNXI_FUNCTION(0x3, "tdm"), /* BCLK */
  57. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 5)), /* PB_EINT5 */
  58. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 6),
  59. SUNXI_FUNCTION(0x0, "gpio_in"),
  60. SUNXI_FUNCTION(0x1, "gpio_out"),
  61. SUNXI_FUNCTION(0x2, "i2s0"), /* DOUT */
  62. SUNXI_FUNCTION(0x3, "tdm"), /* DOUT */
  63. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 6)), /* PB_EINT6 */
  64. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 7),
  65. SUNXI_FUNCTION(0x0, "gpio_in"),
  66. SUNXI_FUNCTION(0x1, "gpio_out"),
  67. SUNXI_FUNCTION(0x2, "i2s0"), /* DIN */
  68. SUNXI_FUNCTION(0x3, "tdm"), /* DIN */
  69. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 7)), /* PB_EINT7 */
  70. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 8),
  71. SUNXI_FUNCTION(0x0, "gpio_in"),
  72. SUNXI_FUNCTION(0x1, "gpio_out"),
  73. SUNXI_FUNCTION(0x2, "i2s0"), /* MCLK */
  74. SUNXI_FUNCTION(0x3, "tdm"), /* MCLK */
  75. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 8)), /* PB_EINT8 */
  76. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 9),
  77. SUNXI_FUNCTION(0x0, "gpio_in"),
  78. SUNXI_FUNCTION(0x1, "gpio_out"),
  79. SUNXI_FUNCTION(0x2, "uart0"), /* TX */
  80. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 9)), /* PB_EINT9 */
  81. SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 10),
  82. SUNXI_FUNCTION(0x0, "gpio_in"),
  83. SUNXI_FUNCTION(0x1, "gpio_out"),
  84. SUNXI_FUNCTION(0x2, "uart0"), /* RX */
  85. SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 10)), /* PB_EINT10 */
  86. /* Hole */
  87. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0),
  88. SUNXI_FUNCTION(0x0, "gpio_in"),
  89. SUNXI_FUNCTION(0x1, "gpio_out"),
  90. SUNXI_FUNCTION(0x2, "nand0"), /* WE */
  91. SUNXI_FUNCTION(0x3, "spi0")), /* MOSI */
  92. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1),
  93. SUNXI_FUNCTION(0x0, "gpio_in"),
  94. SUNXI_FUNCTION(0x1, "gpio_out"),
  95. SUNXI_FUNCTION(0x2, "nand0"), /* ALE */
  96. SUNXI_FUNCTION(0x3, "spi0")), /* MISO */
  97. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2),
  98. SUNXI_FUNCTION(0x0, "gpio_in"),
  99. SUNXI_FUNCTION(0x1, "gpio_out"),
  100. SUNXI_FUNCTION(0x2, "nand0"), /* CLE */
  101. SUNXI_FUNCTION(0x3, "spi0")), /* CLK */
  102. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3),
  103. SUNXI_FUNCTION(0x0, "gpio_in"),
  104. SUNXI_FUNCTION(0x1, "gpio_out"),
  105. SUNXI_FUNCTION(0x2, "nand0"), /* CE1 */
  106. SUNXI_FUNCTION(0x3, "spi0")), /* CS */
  107. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 4),
  108. SUNXI_FUNCTION(0x0, "gpio_in"),
  109. SUNXI_FUNCTION(0x1, "gpio_out"),
  110. SUNXI_FUNCTION(0x2, "nand0")), /* CE0 */
  111. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 5),
  112. SUNXI_FUNCTION(0x0, "gpio_in"),
  113. SUNXI_FUNCTION(0x1, "gpio_out"),
  114. SUNXI_FUNCTION(0x2, "nand0"), /* RE */
  115. SUNXI_FUNCTION(0x3, "mmc2")), /* CLK */
  116. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 6),
  117. SUNXI_FUNCTION(0x0, "gpio_in"),
  118. SUNXI_FUNCTION(0x1, "gpio_out"),
  119. SUNXI_FUNCTION(0x2, "nand0"), /* RB0 */
  120. SUNXI_FUNCTION(0x3, "mmc2")), /* CMD */
  121. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 7),
  122. SUNXI_FUNCTION(0x0, "gpio_in"),
  123. SUNXI_FUNCTION(0x1, "gpio_out"),
  124. SUNXI_FUNCTION(0x2, "nand0")), /* RB1 */
  125. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 8),
  126. SUNXI_FUNCTION(0x0, "gpio_in"),
  127. SUNXI_FUNCTION(0x1, "gpio_out"),
  128. SUNXI_FUNCTION(0x2, "nand0"), /* DQ0 */
  129. SUNXI_FUNCTION(0x3, "mmc2")), /* D0 */
  130. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 9),
  131. SUNXI_FUNCTION(0x0, "gpio_in"),
  132. SUNXI_FUNCTION(0x1, "gpio_out"),
  133. SUNXI_FUNCTION(0x2, "nand0"), /* DQ1 */
  134. SUNXI_FUNCTION(0x3, "mmc2")), /* D1 */
  135. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 10),
  136. SUNXI_FUNCTION(0x0, "gpio_in"),
  137. SUNXI_FUNCTION(0x1, "gpio_out"),
  138. SUNXI_FUNCTION(0x2, "nand0"), /* DQ2 */
  139. SUNXI_FUNCTION(0x3, "mmc2")), /* D2 */
  140. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 11),
  141. SUNXI_FUNCTION(0x0, "gpio_in"),
  142. SUNXI_FUNCTION(0x1, "gpio_out"),
  143. SUNXI_FUNCTION(0x2, "nand0"), /* DQ3 */
  144. SUNXI_FUNCTION(0x3, "mmc2")), /* D3 */
  145. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 12),
  146. SUNXI_FUNCTION(0x0, "gpio_in"),
  147. SUNXI_FUNCTION(0x1, "gpio_out"),
  148. SUNXI_FUNCTION(0x2, "nand0"), /* DQ4 */
  149. SUNXI_FUNCTION(0x3, "mmc2")), /* D4 */
  150. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 13),
  151. SUNXI_FUNCTION(0x0, "gpio_in"),
  152. SUNXI_FUNCTION(0x1, "gpio_out"),
  153. SUNXI_FUNCTION(0x2, "nand0"), /* DQ5 */
  154. SUNXI_FUNCTION(0x3, "mmc2")), /* D5 */
  155. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 14),
  156. SUNXI_FUNCTION(0x0, "gpio_in"),
  157. SUNXI_FUNCTION(0x1, "gpio_out"),
  158. SUNXI_FUNCTION(0x2, "nand"), /* DQ6 */
  159. SUNXI_FUNCTION(0x3, "mmc2")), /* D6 */
  160. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 15),
  161. SUNXI_FUNCTION(0x0, "gpio_in"),
  162. SUNXI_FUNCTION(0x1, "gpio_out"),
  163. SUNXI_FUNCTION(0x2, "nand"), /* DQ7 */
  164. SUNXI_FUNCTION(0x3, "mmc2")), /* D7 */
  165. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 16),
  166. SUNXI_FUNCTION(0x0, "gpio_in"),
  167. SUNXI_FUNCTION(0x1, "gpio_out"),
  168. SUNXI_FUNCTION(0x2, "nand"), /* DQS */
  169. SUNXI_FUNCTION(0x3, "mmc2")), /* RST */
  170. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 17),
  171. SUNXI_FUNCTION(0x0, "gpio_in"),
  172. SUNXI_FUNCTION(0x1, "gpio_out"),
  173. SUNXI_FUNCTION(0x2, "nand")), /* CE2 */
  174. SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 18),
  175. SUNXI_FUNCTION(0x0, "gpio_in"),
  176. SUNXI_FUNCTION(0x1, "gpio_out"),
  177. SUNXI_FUNCTION(0x2, "nand")), /* CE3 */
  178. /* Hole */
  179. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 2),
  180. SUNXI_FUNCTION(0x0, "gpio_in"),
  181. SUNXI_FUNCTION(0x1, "gpio_out"),
  182. SUNXI_FUNCTION(0x2, "lcd0"), /* D2 */
  183. SUNXI_FUNCTION(0x4, "gmac")), /* RGMII / MII RXD3 */
  184. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 3),
  185. SUNXI_FUNCTION(0x0, "gpio_in"),
  186. SUNXI_FUNCTION(0x1, "gpio_out"),
  187. SUNXI_FUNCTION(0x2, "lcd0"), /* D3 */
  188. SUNXI_FUNCTION(0x4, "gmac")), /* RGMII / MII RXD2 */
  189. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 4),
  190. SUNXI_FUNCTION(0x0, "gpio_in"),
  191. SUNXI_FUNCTION(0x1, "gpio_out"),
  192. SUNXI_FUNCTION(0x2, "lcd0"), /* D4 */
  193. SUNXI_FUNCTION(0x4, "gmac")), /* RGMII / MII RXD1 */
  194. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 5),
  195. SUNXI_FUNCTION(0x0, "gpio_in"),
  196. SUNXI_FUNCTION(0x1, "gpio_out"),
  197. SUNXI_FUNCTION(0x2, "lcd0"), /* D5 */
  198. SUNXI_FUNCTION(0x4, "gmac")), /* RGMII / MII RXD0 */
  199. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 6),
  200. SUNXI_FUNCTION(0x0, "gpio_in"),
  201. SUNXI_FUNCTION(0x1, "gpio_out"),
  202. SUNXI_FUNCTION(0x2, "lcd0"), /* D6 */
  203. SUNXI_FUNCTION(0x4, "gmac")), /* RGMII / MII RXCK */
  204. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 7),
  205. SUNXI_FUNCTION(0x0, "gpio_in"),
  206. SUNXI_FUNCTION(0x1, "gpio_out"),
  207. SUNXI_FUNCTION(0x2, "lcd0"), /* D7 */
  208. SUNXI_FUNCTION(0x4, "gmac")), /* RGMII / MII RXDV */
  209. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 10),
  210. SUNXI_FUNCTION(0x0, "gpio_in"),
  211. SUNXI_FUNCTION(0x1, "gpio_out"),
  212. SUNXI_FUNCTION(0x2, "lcd0"), /* D10 */
  213. SUNXI_FUNCTION(0x4, "gmac")), /* RGMII / MII RXERR */
  214. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 11),
  215. SUNXI_FUNCTION(0x0, "gpio_in"),
  216. SUNXI_FUNCTION(0x1, "gpio_out"),
  217. SUNXI_FUNCTION(0x2, "lcd0"), /* D11 */
  218. SUNXI_FUNCTION(0x4, "gmac")), /* RGMII / MII TXD3 */
  219. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 12),
  220. SUNXI_FUNCTION(0x0, "gpio_in"),
  221. SUNXI_FUNCTION(0x1, "gpio_out"),
  222. SUNXI_FUNCTION(0x2, "lcd0"), /* D12 */
  223. SUNXI_FUNCTION(0x4, "gmac")), /* RGMII / MII TXD2 */
  224. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 13),
  225. SUNXI_FUNCTION(0x0, "gpio_in"),
  226. SUNXI_FUNCTION(0x1, "gpio_out"),
  227. SUNXI_FUNCTION(0x2, "lcd0"), /* D13 */
  228. SUNXI_FUNCTION(0x4, "gmac")), /* RGMII / MII TXD1 */
  229. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 14),
  230. SUNXI_FUNCTION(0x0, "gpio_in"),
  231. SUNXI_FUNCTION(0x1, "gpio_out"),
  232. SUNXI_FUNCTION(0x2, "lcd0"), /* D14 */
  233. SUNXI_FUNCTION(0x4, "gmac")), /* RGMII / MII TXD0 */
  234. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 15),
  235. SUNXI_FUNCTION(0x0, "gpio_in"),
  236. SUNXI_FUNCTION(0x1, "gpio_out"),
  237. SUNXI_FUNCTION(0x2, "lcd0"), /* D15 */
  238. SUNXI_FUNCTION(0x4, "gmac")), /* RGMII-NULL / MII-CRS */
  239. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 18),
  240. SUNXI_FUNCTION(0x0, "gpio_in"),
  241. SUNXI_FUNCTION(0x1, "gpio_out"),
  242. SUNXI_FUNCTION(0x2, "lcd0"), /* D18 */
  243. SUNXI_FUNCTION(0x3, "lvds0"), /* VP0 */
  244. SUNXI_FUNCTION(0x4, "gmac")), /* GTXCK / ETXCK */
  245. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 19),
  246. SUNXI_FUNCTION(0x0, "gpio_in"),
  247. SUNXI_FUNCTION(0x1, "gpio_out"),
  248. SUNXI_FUNCTION(0x2, "lcd0"), /* D19 */
  249. SUNXI_FUNCTION(0x3, "lvds0"), /* VN0 */
  250. SUNXI_FUNCTION(0x4, "gmac")), /* GTXCTL / ETXEL */
  251. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 20),
  252. SUNXI_FUNCTION(0x0, "gpio_in"),
  253. SUNXI_FUNCTION(0x1, "gpio_out"),
  254. SUNXI_FUNCTION(0x2, "lcd0"), /* D20 */
  255. SUNXI_FUNCTION(0x3, "lvds0"), /* VP1 */
  256. SUNXI_FUNCTION(0x4, "gmac")), /* GNULL / ETXERR */
  257. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 21),
  258. SUNXI_FUNCTION(0x0, "gpio_in"),
  259. SUNXI_FUNCTION(0x1, "gpio_out"),
  260. SUNXI_FUNCTION(0x2, "lcd0"), /* D21 */
  261. SUNXI_FUNCTION(0x3, "lvds0"), /* VN1 */
  262. SUNXI_FUNCTION(0x4, "gmac")), /* GCLKIN / ECOL */
  263. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 22),
  264. SUNXI_FUNCTION(0x0, "gpio_in"),
  265. SUNXI_FUNCTION(0x1, "gpio_out"),
  266. SUNXI_FUNCTION(0x2, "lcd0"), /* D22 */
  267. SUNXI_FUNCTION(0x3, "lvds0"), /* VP2 */
  268. SUNXI_FUNCTION(0x4, "gmac")), /* GMDC */
  269. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 23),
  270. SUNXI_FUNCTION(0x0, "gpio_in"),
  271. SUNXI_FUNCTION(0x1, "gpio_out"),
  272. SUNXI_FUNCTION(0x2, "lcd0"), /* D23 */
  273. SUNXI_FUNCTION(0x3, "lvds0"), /* VN2 */
  274. SUNXI_FUNCTION(0x4, "gmac")), /* GMDIO */
  275. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 24),
  276. SUNXI_FUNCTION(0x0, "gpio_in"),
  277. SUNXI_FUNCTION(0x1, "gpio_out"),
  278. SUNXI_FUNCTION(0x2, "lcd0"), /* CLK */
  279. SUNXI_FUNCTION(0x3, "lvds0")), /* VPC */
  280. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 25),
  281. SUNXI_FUNCTION(0x0, "gpio_in"),
  282. SUNXI_FUNCTION(0x1, "gpio_out"),
  283. SUNXI_FUNCTION(0x2, "lcd0"), /* DE */
  284. SUNXI_FUNCTION(0x3, "lvds0")), /* VNC */
  285. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 26),
  286. SUNXI_FUNCTION(0x0, "gpio_in"),
  287. SUNXI_FUNCTION(0x1, "gpio_out"),
  288. SUNXI_FUNCTION(0x2, "lcd0"), /* HSYNC */
  289. SUNXI_FUNCTION(0x3, "lvds0")), /* VP3 */
  290. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 27),
  291. SUNXI_FUNCTION(0x0, "gpio_in"),
  292. SUNXI_FUNCTION(0x1, "gpio_out"),
  293. SUNXI_FUNCTION(0x2, "lcd0"), /* VSYNC */
  294. SUNXI_FUNCTION(0x3, "lvds0")), /* VN3 */
  295. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 28),
  296. SUNXI_FUNCTION(0x0, "gpio_in"),
  297. SUNXI_FUNCTION(0x1, "gpio_out"),
  298. SUNXI_FUNCTION(0x2, "pwm")), /* PWM */
  299. SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 29),
  300. SUNXI_FUNCTION(0x0, "gpio_in"),
  301. SUNXI_FUNCTION(0x1, "gpio_out")),
  302. /* Hole */
  303. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 0),
  304. SUNXI_FUNCTION(0x0, "gpio_in"),
  305. SUNXI_FUNCTION(0x1, "gpio_out"),
  306. SUNXI_FUNCTION(0x2, "csi"), /* PCLK */
  307. SUNXI_FUNCTION(0x4, "ccir")), /* CLK */
  308. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 1),
  309. SUNXI_FUNCTION(0x0, "gpio_in"),
  310. SUNXI_FUNCTION(0x1, "gpio_out"),
  311. SUNXI_FUNCTION(0x2, "csi"), /* MCLK */
  312. SUNXI_FUNCTION(0x4, "ccir")), /* DE */
  313. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 2),
  314. SUNXI_FUNCTION(0x0, "gpio_in"),
  315. SUNXI_FUNCTION(0x1, "gpio_out"),
  316. SUNXI_FUNCTION(0x2, "csi"), /* HSYNC */
  317. SUNXI_FUNCTION(0x4, "ccir")), /* HSYNC */
  318. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 3),
  319. SUNXI_FUNCTION(0x0, "gpio_in"),
  320. SUNXI_FUNCTION(0x1, "gpio_out"),
  321. SUNXI_FUNCTION(0x2, "csi"), /* VSYNC */
  322. SUNXI_FUNCTION(0x4, "ccir")), /* VSYNC */
  323. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 4),
  324. SUNXI_FUNCTION(0x0, "gpio_in"),
  325. SUNXI_FUNCTION(0x1, "gpio_out"),
  326. SUNXI_FUNCTION(0x2, "csi")), /* D0 */
  327. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 5),
  328. SUNXI_FUNCTION(0x0, "gpio_in"),
  329. SUNXI_FUNCTION(0x1, "gpio_out"),
  330. SUNXI_FUNCTION(0x2, "csi")), /* D1 */
  331. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 6),
  332. SUNXI_FUNCTION(0x0, "gpio_in"),
  333. SUNXI_FUNCTION(0x1, "gpio_out"),
  334. SUNXI_FUNCTION(0x2, "csi"), /* D2 */
  335. SUNXI_FUNCTION(0x4, "ccir")), /* D0 */
  336. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 7),
  337. SUNXI_FUNCTION(0x0, "gpio_in"),
  338. SUNXI_FUNCTION(0x1, "gpio_out"),
  339. SUNXI_FUNCTION(0x2, "csi"), /* D3 */
  340. SUNXI_FUNCTION(0x4, "ccir")), /* D1 */
  341. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 8),
  342. SUNXI_FUNCTION(0x0, "gpio_in"),
  343. SUNXI_FUNCTION(0x1, "gpio_out"),
  344. SUNXI_FUNCTION(0x2, "csi"), /* D4 */
  345. SUNXI_FUNCTION(0x4, "ccir")), /* D2 */
  346. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 9),
  347. SUNXI_FUNCTION(0x0, "gpio_in"),
  348. SUNXI_FUNCTION(0x1, "gpio_out"),
  349. SUNXI_FUNCTION(0x2, "csi"), /* D5 */
  350. SUNXI_FUNCTION(0x4, "ccir")), /* D3 */
  351. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 10),
  352. SUNXI_FUNCTION(0x0, "gpio_in"),
  353. SUNXI_FUNCTION(0x1, "gpio_out"),
  354. SUNXI_FUNCTION(0x2, "csi"), /* D6 */
  355. SUNXI_FUNCTION(0x3, "uart4"), /* TX */
  356. SUNXI_FUNCTION(0x4, "ccir")), /* D4 */
  357. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 11),
  358. SUNXI_FUNCTION(0x0, "gpio_in"),
  359. SUNXI_FUNCTION(0x1, "gpio_out"),
  360. SUNXI_FUNCTION(0x2, "csi"), /* D7 */
  361. SUNXI_FUNCTION(0x3, "uart4"), /* RX */
  362. SUNXI_FUNCTION(0x4, "ccir")), /* D5 */
  363. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 12),
  364. SUNXI_FUNCTION(0x0, "gpio_in"),
  365. SUNXI_FUNCTION(0x1, "gpio_out"),
  366. SUNXI_FUNCTION(0x2, "csi"), /* D8 */
  367. SUNXI_FUNCTION(0x3, "uart4"), /* RTS */
  368. SUNXI_FUNCTION(0x4, "ccir")), /* D6 */
  369. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 13),
  370. SUNXI_FUNCTION(0x0, "gpio_in"),
  371. SUNXI_FUNCTION(0x1, "gpio_out"),
  372. SUNXI_FUNCTION(0x2, "csi"), /* D9 */
  373. SUNXI_FUNCTION(0x3, "uart4"), /* CTS */
  374. SUNXI_FUNCTION(0x4, "ccir")), /* D7 */
  375. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 14),
  376. SUNXI_FUNCTION(0x0, "gpio_in"),
  377. SUNXI_FUNCTION(0x1, "gpio_out"),
  378. SUNXI_FUNCTION(0x2, "csi"), /* SCK */
  379. SUNXI_FUNCTION(0x3, "i2c2")), /* SCK */
  380. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 15),
  381. SUNXI_FUNCTION(0x0, "gpio_in"),
  382. SUNXI_FUNCTION(0x1, "gpio_out"),
  383. SUNXI_FUNCTION(0x2, "csi"), /* SDA */
  384. SUNXI_FUNCTION(0x3, "i2c2")), /* SDA */
  385. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 16),
  386. SUNXI_FUNCTION(0x0, "gpio_in"),
  387. SUNXI_FUNCTION(0x1, "gpio_out")),
  388. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 17),
  389. SUNXI_FUNCTION(0x0, "gpio_in"),
  390. SUNXI_FUNCTION(0x1, "gpio_out")),
  391. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 18),
  392. SUNXI_FUNCTION(0x0, "gpio_in"),
  393. SUNXI_FUNCTION(0x1, "gpio_out"),
  394. SUNXI_FUNCTION(0x3, "spdif")), /* DOUT */
  395. SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 19),
  396. SUNXI_FUNCTION(0x0, "gpio_in"),
  397. SUNXI_FUNCTION(0x1, "gpio_out")),
  398. /* Hole */
  399. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0),
  400. SUNXI_FUNCTION(0x0, "gpio_in"),
  401. SUNXI_FUNCTION(0x1, "gpio_out"),
  402. SUNXI_FUNCTION(0x2, "mmc0"), /* D1 */
  403. SUNXI_FUNCTION(0x3, "jtag")), /* MS1 */
  404. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1),
  405. SUNXI_FUNCTION(0x0, "gpio_in"),
  406. SUNXI_FUNCTION(0x1, "gpio_out"),
  407. SUNXI_FUNCTION(0x2, "mmc0"), /* D0 */
  408. SUNXI_FUNCTION(0x3, "jtag")), /* DI1 */
  409. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2),
  410. SUNXI_FUNCTION(0x0, "gpio_in"),
  411. SUNXI_FUNCTION(0x1, "gpio_out"),
  412. SUNXI_FUNCTION(0x2, "mmc0"), /* CLK */
  413. SUNXI_FUNCTION(0x3, "uart0")), /* TX */
  414. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3),
  415. SUNXI_FUNCTION(0x0, "gpio_in"),
  416. SUNXI_FUNCTION(0x1, "gpio_out"),
  417. SUNXI_FUNCTION(0x2, "mmc0"), /* CMD */
  418. SUNXI_FUNCTION(0x3, "jtag")), /* DO1 */
  419. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4),
  420. SUNXI_FUNCTION(0x0, "gpio_in"),
  421. SUNXI_FUNCTION(0x1, "gpio_out"),
  422. SUNXI_FUNCTION(0x2, "mmc0"), /* D3 */
  423. SUNXI_FUNCTION(0x3, "uart0")), /* RX */
  424. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5),
  425. SUNXI_FUNCTION(0x0, "gpio_in"),
  426. SUNXI_FUNCTION(0x1, "gpio_out"),
  427. SUNXI_FUNCTION(0x2, "mmc0"), /* D2 */
  428. SUNXI_FUNCTION(0x3, "jtag")), /* CK1 */
  429. SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 6),
  430. SUNXI_FUNCTION(0x0, "gpio_in"),
  431. SUNXI_FUNCTION(0x1, "gpio_out")),
  432. /* Hole */
  433. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0),
  434. SUNXI_FUNCTION(0x0, "gpio_in"),
  435. SUNXI_FUNCTION(0x1, "gpio_out"),
  436. SUNXI_FUNCTION(0x2, "mmc1"), /* CLK */
  437. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 0)), /* PG_EINT0 */
  438. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1),
  439. SUNXI_FUNCTION(0x0, "gpio_in"),
  440. SUNXI_FUNCTION(0x1, "gpio_out"),
  441. SUNXI_FUNCTION(0x2, "mmc1"), /* CMD */
  442. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 1)), /* PG_EINT1 */
  443. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2),
  444. SUNXI_FUNCTION(0x0, "gpio_in"),
  445. SUNXI_FUNCTION(0x1, "gpio_out"),
  446. SUNXI_FUNCTION(0x2, "mmc1"), /* D0 */
  447. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 2)), /* PG_EINT2 */
  448. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3),
  449. SUNXI_FUNCTION(0x0, "gpio_in"),
  450. SUNXI_FUNCTION(0x1, "gpio_out"),
  451. SUNXI_FUNCTION(0x2, "mmc1"), /* D1 */
  452. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 3)), /* PG_EINT3 */
  453. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4),
  454. SUNXI_FUNCTION(0x0, "gpio_in"),
  455. SUNXI_FUNCTION(0x1, "gpio_out"),
  456. SUNXI_FUNCTION(0x2, "mmc1"), /* D2 */
  457. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 4)), /* PG_EINT4 */
  458. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 5),
  459. SUNXI_FUNCTION(0x0, "gpio_in"),
  460. SUNXI_FUNCTION(0x1, "gpio_out"),
  461. SUNXI_FUNCTION(0x2, "mmc1"), /* D3 */
  462. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 5)), /* PG_EINT5 */
  463. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 6),
  464. SUNXI_FUNCTION(0x0, "gpio_in"),
  465. SUNXI_FUNCTION(0x1, "gpio_out"),
  466. SUNXI_FUNCTION(0x2, "uart1"), /* TX */
  467. SUNXI_FUNCTION(0x3, "spi1"), /* CS */
  468. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 6)), /* PG_EINT6 */
  469. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 7),
  470. SUNXI_FUNCTION(0x0, "gpio_in"),
  471. SUNXI_FUNCTION(0x1, "gpio_out"),
  472. SUNXI_FUNCTION(0x2, "uart1"), /* RX */
  473. SUNXI_FUNCTION(0x3, "spi1"), /* CLK */
  474. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 7)), /* PG_EINT7 */
  475. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 8),
  476. SUNXI_FUNCTION(0x0, "gpio_in"),
  477. SUNXI_FUNCTION(0x1, "gpio_out"),
  478. SUNXI_FUNCTION(0x2, "uart1"), /* RTS */
  479. SUNXI_FUNCTION(0x3, "spi1"), /* MOSI */
  480. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 8)), /* PG_EINT8 */
  481. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 9),
  482. SUNXI_FUNCTION(0x0, "gpio_in"),
  483. SUNXI_FUNCTION(0x1, "gpio_out"),
  484. SUNXI_FUNCTION(0x2, "uart1"), /* CTS */
  485. SUNXI_FUNCTION(0x3, "spi1"), /* MISO */
  486. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 9)), /* PG_EINT9 */
  487. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10),
  488. SUNXI_FUNCTION(0x0, "gpio_in"),
  489. SUNXI_FUNCTION(0x1, "gpio_out"),
  490. SUNXI_FUNCTION(0x2, "i2s1"), /* BCLK */
  491. SUNXI_FUNCTION(0x3, "uart3"), /* TX */
  492. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 10)), /* PG_EINT10 */
  493. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 11),
  494. SUNXI_FUNCTION(0x0, "gpio_in"),
  495. SUNXI_FUNCTION(0x1, "gpio_out"),
  496. SUNXI_FUNCTION(0x2, "i2s1"), /* LRCK */
  497. SUNXI_FUNCTION(0x3, "uart3"), /* RX */
  498. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 11)), /* PG_EINT11 */
  499. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 12),
  500. SUNXI_FUNCTION(0x0, "gpio_in"),
  501. SUNXI_FUNCTION(0x1, "gpio_out"),
  502. SUNXI_FUNCTION(0x2, "i2s1"), /* DOUT */
  503. SUNXI_FUNCTION(0x3, "uart3"), /* RTS */
  504. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 12)), /* PG_EINT12 */
  505. SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 13),
  506. SUNXI_FUNCTION(0x0, "gpio_in"),
  507. SUNXI_FUNCTION(0x1, "gpio_out"),
  508. SUNXI_FUNCTION(0x2, "i2s1"), /* DIN */
  509. SUNXI_FUNCTION(0x3, "uart3"), /* CTS */
  510. SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 13)), /* PG_EINT13 */
  511. /* Hole */
  512. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 0),
  513. SUNXI_FUNCTION(0x0, "gpio_in"),
  514. SUNXI_FUNCTION(0x1, "gpio_out"),
  515. SUNXI_FUNCTION(0x2, "i2c0"), /* SCK */
  516. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 0)), /* PH_EINT0 */
  517. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 1),
  518. SUNXI_FUNCTION(0x0, "gpio_in"),
  519. SUNXI_FUNCTION(0x1, "gpio_out"),
  520. SUNXI_FUNCTION(0x2, "i2c0"), /* SDA */
  521. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 1)), /* PH_EINT1 */
  522. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 2),
  523. SUNXI_FUNCTION(0x0, "gpio_in"),
  524. SUNXI_FUNCTION(0x1, "gpio_out"),
  525. SUNXI_FUNCTION(0x2, "i2c1"), /* SCK */
  526. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 2)), /* PH_EINT2 */
  527. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 3),
  528. SUNXI_FUNCTION(0x0, "gpio_in"),
  529. SUNXI_FUNCTION(0x1, "gpio_out"),
  530. SUNXI_FUNCTION(0x2, "i2c1"), /* SDA */
  531. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 3)), /* PH_EINT3 */
  532. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 4),
  533. SUNXI_FUNCTION(0x0, "gpio_in"),
  534. SUNXI_FUNCTION(0x1, "gpio_out"),
  535. SUNXI_FUNCTION(0x2, "i2c2"), /* SCK */
  536. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 4)), /* PH_EINT4 */
  537. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 5),
  538. SUNXI_FUNCTION(0x0, "gpio_in"),
  539. SUNXI_FUNCTION(0x1, "gpio_out"),
  540. SUNXI_FUNCTION(0x2, "i2c2"), /* SDA */
  541. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 5)), /* PH_EINT5 */
  542. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 6),
  543. SUNXI_FUNCTION(0x0, "gpio_in"),
  544. SUNXI_FUNCTION(0x1, "gpio_out"),
  545. SUNXI_FUNCTION(0x2, "hdmi"), /* HSCL */
  546. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 6)), /* PH_EINT6 */
  547. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 7),
  548. SUNXI_FUNCTION(0x0, "gpio_in"),
  549. SUNXI_FUNCTION(0x1, "gpio_out"),
  550. SUNXI_FUNCTION(0x2, "hdmi"), /* HSDA */
  551. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 7)), /* PH_EINT7 */
  552. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 8),
  553. SUNXI_FUNCTION(0x0, "gpio_in"),
  554. SUNXI_FUNCTION(0x1, "gpio_out"),
  555. SUNXI_FUNCTION(0x2, "hdmi"), /* HCEC */
  556. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 8)), /* PH_EINT8 */
  557. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 9),
  558. SUNXI_FUNCTION(0x0, "gpio_in"),
  559. SUNXI_FUNCTION(0x1, "gpio_out"),
  560. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 9)), /* PH_EINT9 */
  561. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 10),
  562. SUNXI_FUNCTION(0x0, "gpio_in"),
  563. SUNXI_FUNCTION(0x1, "gpio_out"),
  564. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 10)), /* PH_EINT10 */
  565. SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 11),
  566. SUNXI_FUNCTION(0x0, "gpio_in"),
  567. SUNXI_FUNCTION(0x1, "gpio_out"),
  568. SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 11)), /* PH_EINT11 */
  569. };
  570. static const struct sunxi_pinctrl_desc sun8i_a83t_pinctrl_data = {
  571. .pins = sun8i_a83t_pins,
  572. .npins = ARRAY_SIZE(sun8i_a83t_pins),
  573. .irq_banks = 3,
  574. };
  575. static int sun8i_a83t_pinctrl_probe(struct platform_device *pdev)
  576. {
  577. return sunxi_pinctrl_init(pdev,
  578. &sun8i_a83t_pinctrl_data);
  579. }
  580. static const struct of_device_id sun8i_a83t_pinctrl_match[] = {
  581. { .compatible = "allwinner,sun8i-a83t-pinctrl", },
  582. {}
  583. };
  584. MODULE_DEVICE_TABLE(of, sun8i_a83t_pinctrl_match);
  585. static struct platform_driver sun8i_a83t_pinctrl_driver = {
  586. .probe = sun8i_a83t_pinctrl_probe,
  587. .driver = {
  588. .name = "sun8i-a83t-pinctrl",
  589. .of_match_table = sun8i_a83t_pinctrl_match,
  590. },
  591. };
  592. module_platform_driver(sun8i_a83t_pinctrl_driver);
  593. MODULE_AUTHOR("Vishnu Patekar <vishnupatekar0510@gmail.com>");
  594. MODULE_DESCRIPTION("Allwinner a83t pinctrl driver");
  595. MODULE_LICENSE("GPL");