pinctrl-sunxi.c 61 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914
  1. /*
  2. * Allwinner A1X SoCs pinctrl driver.
  3. *
  4. * Copyright (C) 2012 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/io.h>
  13. #include <linux/gpio.h>
  14. #include <linux/module.h>
  15. #include <linux/of.h>
  16. #include <linux/of_address.h>
  17. #include <linux/of_device.h>
  18. #include <linux/pinctrl/consumer.h>
  19. #include <linux/pinctrl/machine.h>
  20. #include <linux/pinctrl/pinctrl.h>
  21. #include <linux/pinctrl/pinconf-generic.h>
  22. #include <linux/pinctrl/pinmux.h>
  23. #include <linux/platform_device.h>
  24. #include <linux/slab.h>
  25. #include "core.h"
  26. #include "pinctrl-sunxi.h"
  27. static const struct sunxi_desc_pin sun4i_a10_pins[] = {
  28. SUNXI_PIN(SUNXI_PINCTRL_PIN_PA0,
  29. SUNXI_FUNCTION(0x0, "gpio_in"),
  30. SUNXI_FUNCTION(0x1, "gpio_out"),
  31. SUNXI_FUNCTION(0x2, "wemac"), /* ERXD3 */
  32. SUNXI_FUNCTION(0x3, "spi1"), /* CS0 */
  33. SUNXI_FUNCTION(0x4, "uart2")), /* RTS */
  34. SUNXI_PIN(SUNXI_PINCTRL_PIN_PA1,
  35. SUNXI_FUNCTION(0x0, "gpio_in"),
  36. SUNXI_FUNCTION(0x1, "gpio_out"),
  37. SUNXI_FUNCTION(0x2, "wemac"), /* ERXD2 */
  38. SUNXI_FUNCTION(0x3, "spi1"), /* CLK */
  39. SUNXI_FUNCTION(0x4, "uart2")), /* CTS */
  40. SUNXI_PIN(SUNXI_PINCTRL_PIN_PA2,
  41. SUNXI_FUNCTION(0x0, "gpio_in"),
  42. SUNXI_FUNCTION(0x1, "gpio_out"),
  43. SUNXI_FUNCTION(0x2, "wemac"), /* ERXD1 */
  44. SUNXI_FUNCTION(0x3, "spi1"), /* MOSI */
  45. SUNXI_FUNCTION(0x4, "uart2")), /* TX */
  46. SUNXI_PIN(SUNXI_PINCTRL_PIN_PA3,
  47. SUNXI_FUNCTION(0x0, "gpio_in"),
  48. SUNXI_FUNCTION(0x1, "gpio_out"),
  49. SUNXI_FUNCTION(0x2, "wemac"), /* ERXD0 */
  50. SUNXI_FUNCTION(0x3, "spi1"), /* MISO */
  51. SUNXI_FUNCTION(0x4, "uart2")), /* RX */
  52. SUNXI_PIN(SUNXI_PINCTRL_PIN_PA4,
  53. SUNXI_FUNCTION(0x0, "gpio_in"),
  54. SUNXI_FUNCTION(0x1, "gpio_out"),
  55. SUNXI_FUNCTION(0x2, "wemac"), /* ETXD3 */
  56. SUNXI_FUNCTION(0x3, "spi1")), /* CS1 */
  57. SUNXI_PIN(SUNXI_PINCTRL_PIN_PA5,
  58. SUNXI_FUNCTION(0x0, "gpio_in"),
  59. SUNXI_FUNCTION(0x1, "gpio_out"),
  60. SUNXI_FUNCTION(0x2, "wemac"), /* ETXD2 */
  61. SUNXI_FUNCTION(0x3, "spi3")), /* CS0 */
  62. SUNXI_PIN(SUNXI_PINCTRL_PIN_PA6,
  63. SUNXI_FUNCTION(0x0, "gpio_in"),
  64. SUNXI_FUNCTION(0x1, "gpio_out"),
  65. SUNXI_FUNCTION(0x2, "wemac"), /* ETXD1 */
  66. SUNXI_FUNCTION(0x3, "spi3")), /* CLK */
  67. SUNXI_PIN(SUNXI_PINCTRL_PIN_PA7,
  68. SUNXI_FUNCTION(0x0, "gpio_in"),
  69. SUNXI_FUNCTION(0x1, "gpio_out"),
  70. SUNXI_FUNCTION(0x2, "wemac"), /* ETXD0 */
  71. SUNXI_FUNCTION(0x3, "spi3")), /* MOSI */
  72. SUNXI_PIN(SUNXI_PINCTRL_PIN_PA8,
  73. SUNXI_FUNCTION(0x0, "gpio_in"),
  74. SUNXI_FUNCTION(0x1, "gpio_out"),
  75. SUNXI_FUNCTION(0x2, "wemac"), /* ERXCK */
  76. SUNXI_FUNCTION(0x3, "spi3")), /* MISO */
  77. SUNXI_PIN(SUNXI_PINCTRL_PIN_PA9,
  78. SUNXI_FUNCTION(0x0, "gpio_in"),
  79. SUNXI_FUNCTION(0x1, "gpio_out"),
  80. SUNXI_FUNCTION(0x2, "wemac"), /* ERXERR */
  81. SUNXI_FUNCTION(0x3, "spi3")), /* CS1 */
  82. SUNXI_PIN(SUNXI_PINCTRL_PIN_PA10,
  83. SUNXI_FUNCTION(0x0, "gpio_in"),
  84. SUNXI_FUNCTION(0x1, "gpio_out"),
  85. SUNXI_FUNCTION(0x2, "wemac"), /* ERXDV */
  86. SUNXI_FUNCTION(0x4, "uart1")), /* TX */
  87. SUNXI_PIN(SUNXI_PINCTRL_PIN_PA11,
  88. SUNXI_FUNCTION(0x0, "gpio_in"),
  89. SUNXI_FUNCTION(0x1, "gpio_out"),
  90. SUNXI_FUNCTION(0x2, "wemac"), /* EMDC */
  91. SUNXI_FUNCTION(0x4, "uart1")), /* RX */
  92. SUNXI_PIN(SUNXI_PINCTRL_PIN_PA12,
  93. SUNXI_FUNCTION(0x0, "gpio_in"),
  94. SUNXI_FUNCTION(0x1, "gpio_out"),
  95. SUNXI_FUNCTION(0x2, "wemac"), /* EMDIO */
  96. SUNXI_FUNCTION(0x3, "uart6"), /* TX */
  97. SUNXI_FUNCTION(0x4, "uart1")), /* RTS */
  98. SUNXI_PIN(SUNXI_PINCTRL_PIN_PA13,
  99. SUNXI_FUNCTION(0x0, "gpio_in"),
  100. SUNXI_FUNCTION(0x1, "gpio_out"),
  101. SUNXI_FUNCTION(0x2, "wemac"), /* ETXEN */
  102. SUNXI_FUNCTION(0x3, "uart6"), /* RX */
  103. SUNXI_FUNCTION(0x4, "uart1")), /* CTS */
  104. SUNXI_PIN(SUNXI_PINCTRL_PIN_PA14,
  105. SUNXI_FUNCTION(0x0, "gpio_in"),
  106. SUNXI_FUNCTION(0x1, "gpio_out"),
  107. SUNXI_FUNCTION(0x2, "wemac"), /* ETXCK */
  108. SUNXI_FUNCTION(0x3, "uart7"), /* TX */
  109. SUNXI_FUNCTION(0x4, "uart1")), /* DTR */
  110. SUNXI_PIN(SUNXI_PINCTRL_PIN_PA15,
  111. SUNXI_FUNCTION(0x0, "gpio_in"),
  112. SUNXI_FUNCTION(0x1, "gpio_out"),
  113. SUNXI_FUNCTION(0x2, "wemac"), /* ECRS */
  114. SUNXI_FUNCTION(0x3, "uart7"), /* RX */
  115. SUNXI_FUNCTION(0x4, "uart1")), /* DSR */
  116. SUNXI_PIN(SUNXI_PINCTRL_PIN_PA16,
  117. SUNXI_FUNCTION(0x0, "gpio_in"),
  118. SUNXI_FUNCTION(0x1, "gpio_out"),
  119. SUNXI_FUNCTION(0x2, "wemac"), /* ECOL */
  120. SUNXI_FUNCTION(0x3, "can"), /* TX */
  121. SUNXI_FUNCTION(0x4, "uart1")), /* DCD */
  122. SUNXI_PIN(SUNXI_PINCTRL_PIN_PA17,
  123. SUNXI_FUNCTION(0x0, "gpio_in"),
  124. SUNXI_FUNCTION(0x1, "gpio_out"),
  125. SUNXI_FUNCTION(0x2, "wemac"), /* ETXERR */
  126. SUNXI_FUNCTION(0x3, "can"), /* RX */
  127. SUNXI_FUNCTION(0x4, "uart1")), /* RING */
  128. /* Hole */
  129. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB0,
  130. SUNXI_FUNCTION(0x0, "gpio_in"),
  131. SUNXI_FUNCTION(0x1, "gpio_out"),
  132. SUNXI_FUNCTION(0x2, "i2c0")), /* SCK */
  133. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB1,
  134. SUNXI_FUNCTION(0x0, "gpio_in"),
  135. SUNXI_FUNCTION(0x1, "gpio_out"),
  136. SUNXI_FUNCTION(0x2, "i2c0")), /* SDA */
  137. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB2,
  138. SUNXI_FUNCTION(0x0, "gpio_in"),
  139. SUNXI_FUNCTION(0x1, "gpio_out"),
  140. SUNXI_FUNCTION(0x2, "pwm")), /* PWM0 */
  141. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB3,
  142. SUNXI_FUNCTION(0x0, "gpio_in"),
  143. SUNXI_FUNCTION(0x1, "gpio_out"),
  144. SUNXI_FUNCTION(0x2, "ir0")), /* TX */
  145. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB4,
  146. SUNXI_FUNCTION(0x0, "gpio_in"),
  147. SUNXI_FUNCTION(0x1, "gpio_out"),
  148. SUNXI_FUNCTION(0x2, "ir0")), /* RX */
  149. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB5,
  150. SUNXI_FUNCTION(0x0, "gpio_in"),
  151. SUNXI_FUNCTION(0x1, "gpio_out"),
  152. SUNXI_FUNCTION(0x2, "i2s"), /* MCLK */
  153. SUNXI_FUNCTION(0x3, "ac97")), /* MCLK */
  154. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB6,
  155. SUNXI_FUNCTION(0x0, "gpio_in"),
  156. SUNXI_FUNCTION(0x1, "gpio_out"),
  157. SUNXI_FUNCTION(0x2, "i2s"), /* BCLK */
  158. SUNXI_FUNCTION(0x3, "ac97")), /* BCLK */
  159. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB7,
  160. SUNXI_FUNCTION(0x0, "gpio_in"),
  161. SUNXI_FUNCTION(0x1, "gpio_out"),
  162. SUNXI_FUNCTION(0x2, "i2s"), /* LRCK */
  163. SUNXI_FUNCTION(0x3, "ac97")), /* SYNC */
  164. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB8,
  165. SUNXI_FUNCTION(0x0, "gpio_in"),
  166. SUNXI_FUNCTION(0x1, "gpio_out"),
  167. SUNXI_FUNCTION(0x2, "i2s"), /* DO0 */
  168. SUNXI_FUNCTION(0x3, "ac97")), /* DO */
  169. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB9,
  170. SUNXI_FUNCTION(0x0, "gpio_in"),
  171. SUNXI_FUNCTION(0x1, "gpio_out"),
  172. SUNXI_FUNCTION(0x2, "i2s")), /* DO1 */
  173. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB10,
  174. SUNXI_FUNCTION(0x0, "gpio_in"),
  175. SUNXI_FUNCTION(0x1, "gpio_out"),
  176. SUNXI_FUNCTION(0x2, "i2s")), /* DO2 */
  177. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB11,
  178. SUNXI_FUNCTION(0x0, "gpio_in"),
  179. SUNXI_FUNCTION(0x1, "gpio_out"),
  180. SUNXI_FUNCTION(0x2, "i2s")), /* DO3 */
  181. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB12,
  182. SUNXI_FUNCTION(0x0, "gpio_in"),
  183. SUNXI_FUNCTION(0x1, "gpio_out"),
  184. SUNXI_FUNCTION(0x2, "i2s"), /* DI */
  185. SUNXI_FUNCTION(0x3, "ac97")), /* DI */
  186. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB13,
  187. SUNXI_FUNCTION(0x0, "gpio_in"),
  188. SUNXI_FUNCTION(0x1, "gpio_out"),
  189. SUNXI_FUNCTION(0x2, "spi2")), /* CS1 */
  190. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB14,
  191. SUNXI_FUNCTION(0x0, "gpio_in"),
  192. SUNXI_FUNCTION(0x1, "gpio_out"),
  193. SUNXI_FUNCTION(0x2, "spi2"), /* CS0 */
  194. SUNXI_FUNCTION(0x3, "jtag")), /* MS0 */
  195. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB15,
  196. SUNXI_FUNCTION(0x0, "gpio_in"),
  197. SUNXI_FUNCTION(0x1, "gpio_out"),
  198. SUNXI_FUNCTION(0x2, "spi2"), /* CLK */
  199. SUNXI_FUNCTION(0x3, "jtag")), /* CK0 */
  200. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB16,
  201. SUNXI_FUNCTION(0x0, "gpio_in"),
  202. SUNXI_FUNCTION(0x1, "gpio_out"),
  203. SUNXI_FUNCTION(0x2, "spi2"), /* MOSI */
  204. SUNXI_FUNCTION(0x3, "jtag")), /* DO0 */
  205. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB17,
  206. SUNXI_FUNCTION(0x0, "gpio_in"),
  207. SUNXI_FUNCTION(0x1, "gpio_out"),
  208. SUNXI_FUNCTION(0x2, "spi2"), /* MISO */
  209. SUNXI_FUNCTION(0x3, "jtag")), /* DI0 */
  210. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB18,
  211. SUNXI_FUNCTION(0x0, "gpio_in"),
  212. SUNXI_FUNCTION(0x1, "gpio_out"),
  213. SUNXI_FUNCTION(0x2, "i2c1")), /* SCK */
  214. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB19,
  215. SUNXI_FUNCTION(0x0, "gpio_in"),
  216. SUNXI_FUNCTION(0x1, "gpio_out"),
  217. SUNXI_FUNCTION(0x2, "i2c1")), /* SDA */
  218. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB20,
  219. SUNXI_FUNCTION(0x0, "gpio_in"),
  220. SUNXI_FUNCTION(0x1, "gpio_out"),
  221. SUNXI_FUNCTION(0x2, "i2c2")), /* SCK */
  222. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB21,
  223. SUNXI_FUNCTION(0x0, "gpio_in"),
  224. SUNXI_FUNCTION(0x1, "gpio_out"),
  225. SUNXI_FUNCTION(0x2, "i2c2")), /* SDA */
  226. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB22,
  227. SUNXI_FUNCTION(0x0, "gpio_in"),
  228. SUNXI_FUNCTION(0x1, "gpio_out"),
  229. SUNXI_FUNCTION(0x2, "uart0"), /* TX */
  230. SUNXI_FUNCTION(0x3, "ir1")), /* TX */
  231. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB23,
  232. SUNXI_FUNCTION(0x0, "gpio_in"),
  233. SUNXI_FUNCTION(0x1, "gpio_out"),
  234. SUNXI_FUNCTION(0x2, "uart0"), /* RX */
  235. SUNXI_FUNCTION(0x3, "ir1")), /* RX */
  236. /* Hole */
  237. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC0,
  238. SUNXI_FUNCTION(0x0, "gpio_in"),
  239. SUNXI_FUNCTION(0x1, "gpio_out"),
  240. SUNXI_FUNCTION(0x2, "nand0"), /* NWE */
  241. SUNXI_FUNCTION(0x3, "spi0")), /* MOSI */
  242. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC1,
  243. SUNXI_FUNCTION(0x0, "gpio_in"),
  244. SUNXI_FUNCTION(0x1, "gpio_out"),
  245. SUNXI_FUNCTION(0x2, "nand0"), /* NALE */
  246. SUNXI_FUNCTION(0x3, "spi0")), /* MISO */
  247. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC2,
  248. SUNXI_FUNCTION(0x0, "gpio_in"),
  249. SUNXI_FUNCTION(0x1, "gpio_out"),
  250. SUNXI_FUNCTION(0x2, "nand0"), /* NCLE */
  251. SUNXI_FUNCTION(0x3, "spi0")), /* SCK */
  252. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC3,
  253. SUNXI_FUNCTION(0x0, "gpio_in"),
  254. SUNXI_FUNCTION(0x1, "gpio_out"),
  255. SUNXI_FUNCTION(0x2, "nand0")), /* NCE1 */
  256. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC4,
  257. SUNXI_FUNCTION(0x0, "gpio_in"),
  258. SUNXI_FUNCTION(0x1, "gpio_out"),
  259. SUNXI_FUNCTION(0x2, "nand0")), /* NCE0 */
  260. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC5,
  261. SUNXI_FUNCTION(0x0, "gpio_in"),
  262. SUNXI_FUNCTION(0x1, "gpio_out"),
  263. SUNXI_FUNCTION(0x2, "nand0")), /* NRE# */
  264. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC6,
  265. SUNXI_FUNCTION(0x0, "gpio_in"),
  266. SUNXI_FUNCTION(0x1, "gpio_out"),
  267. SUNXI_FUNCTION(0x2, "nand0"), /* NRB0 */
  268. SUNXI_FUNCTION(0x3, "mmc2")), /* CMD */
  269. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC7,
  270. SUNXI_FUNCTION(0x0, "gpio_in"),
  271. SUNXI_FUNCTION(0x1, "gpio_out"),
  272. SUNXI_FUNCTION(0x2, "nand0"), /* NRB1 */
  273. SUNXI_FUNCTION(0x3, "mmc2")), /* CLK */
  274. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC8,
  275. SUNXI_FUNCTION(0x0, "gpio_in"),
  276. SUNXI_FUNCTION(0x1, "gpio_out"),
  277. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ0 */
  278. SUNXI_FUNCTION(0x3, "mmc2")), /* D0 */
  279. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC9,
  280. SUNXI_FUNCTION(0x0, "gpio_in"),
  281. SUNXI_FUNCTION(0x1, "gpio_out"),
  282. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ1 */
  283. SUNXI_FUNCTION(0x3, "mmc2")), /* D1 */
  284. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC10,
  285. SUNXI_FUNCTION(0x0, "gpio_in"),
  286. SUNXI_FUNCTION(0x1, "gpio_out"),
  287. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ2 */
  288. SUNXI_FUNCTION(0x3, "mmc2")), /* D2 */
  289. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC11,
  290. SUNXI_FUNCTION(0x0, "gpio_in"),
  291. SUNXI_FUNCTION(0x1, "gpio_out"),
  292. SUNXI_FUNCTION(0x2, "nand0"), /* NDQ3 */
  293. SUNXI_FUNCTION(0x3, "mmc2")), /* D3 */
  294. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC12,
  295. SUNXI_FUNCTION(0x0, "gpio_in"),
  296. SUNXI_FUNCTION(0x1, "gpio_out"),
  297. SUNXI_FUNCTION(0x2, "nand0")), /* NDQ4 */
  298. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC13,
  299. SUNXI_FUNCTION(0x0, "gpio_in"),
  300. SUNXI_FUNCTION(0x1, "gpio_out"),
  301. SUNXI_FUNCTION(0x2, "nand0")), /* NDQ5 */
  302. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC14,
  303. SUNXI_FUNCTION(0x0, "gpio_in"),
  304. SUNXI_FUNCTION(0x1, "gpio_out"),
  305. SUNXI_FUNCTION(0x2, "nand0")), /* NDQ6 */
  306. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC15,
  307. SUNXI_FUNCTION(0x0, "gpio_in"),
  308. SUNXI_FUNCTION(0x1, "gpio_out"),
  309. SUNXI_FUNCTION(0x2, "nand0")), /* NDQ7 */
  310. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC16,
  311. SUNXI_FUNCTION(0x0, "gpio_in"),
  312. SUNXI_FUNCTION(0x1, "gpio_out"),
  313. SUNXI_FUNCTION(0x2, "nand0")), /* NWP */
  314. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC17,
  315. SUNXI_FUNCTION(0x0, "gpio_in"),
  316. SUNXI_FUNCTION(0x1, "gpio_out"),
  317. SUNXI_FUNCTION(0x2, "nand0")), /* NCE2 */
  318. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC18,
  319. SUNXI_FUNCTION(0x0, "gpio_in"),
  320. SUNXI_FUNCTION(0x1, "gpio_out"),
  321. SUNXI_FUNCTION(0x2, "nand0")), /* NCE3 */
  322. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC19,
  323. SUNXI_FUNCTION(0x0, "gpio_in"),
  324. SUNXI_FUNCTION(0x1, "gpio_out"),
  325. SUNXI_FUNCTION(0x2, "nand0"), /* NCE4 */
  326. SUNXI_FUNCTION(0x3, "spi2")), /* CS0 */
  327. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC20,
  328. SUNXI_FUNCTION(0x0, "gpio_in"),
  329. SUNXI_FUNCTION(0x1, "gpio_out"),
  330. SUNXI_FUNCTION(0x2, "nand0"), /* NCE5 */
  331. SUNXI_FUNCTION(0x3, "spi2")), /* CLK */
  332. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC21,
  333. SUNXI_FUNCTION(0x0, "gpio_in"),
  334. SUNXI_FUNCTION(0x1, "gpio_out"),
  335. SUNXI_FUNCTION(0x2, "nand0"), /* NCE6 */
  336. SUNXI_FUNCTION(0x3, "spi2")), /* MOSI */
  337. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC22,
  338. SUNXI_FUNCTION(0x0, "gpio_in"),
  339. SUNXI_FUNCTION(0x1, "gpio_out"),
  340. SUNXI_FUNCTION(0x2, "nand0"), /* NCE7 */
  341. SUNXI_FUNCTION(0x3, "spi2")), /* MISO */
  342. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC23,
  343. SUNXI_FUNCTION(0x0, "gpio_in"),
  344. SUNXI_FUNCTION(0x1, "gpio_out"),
  345. SUNXI_FUNCTION(0x3, "spi0")), /* CS0 */
  346. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC24,
  347. SUNXI_FUNCTION(0x0, "gpio_in"),
  348. SUNXI_FUNCTION(0x1, "gpio_out"),
  349. SUNXI_FUNCTION(0x2, "nand0")), /* NDQS */
  350. /* Hole */
  351. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD0,
  352. SUNXI_FUNCTION(0x0, "gpio_in"),
  353. SUNXI_FUNCTION(0x1, "gpio_out"),
  354. SUNXI_FUNCTION(0x2, "lcd0"), /* D0 */
  355. SUNXI_FUNCTION(0x3, "lvds0")), /* VP0 */
  356. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD1,
  357. SUNXI_FUNCTION(0x0, "gpio_in"),
  358. SUNXI_FUNCTION(0x1, "gpio_out"),
  359. SUNXI_FUNCTION(0x2, "lcd0"), /* D1 */
  360. SUNXI_FUNCTION(0x3, "lvds0")), /* VN0 */
  361. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD2,
  362. SUNXI_FUNCTION(0x0, "gpio_in"),
  363. SUNXI_FUNCTION(0x1, "gpio_out"),
  364. SUNXI_FUNCTION(0x2, "lcd0"), /* D2 */
  365. SUNXI_FUNCTION(0x3, "lvds0")), /* VP1 */
  366. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD3,
  367. SUNXI_FUNCTION(0x0, "gpio_in"),
  368. SUNXI_FUNCTION(0x1, "gpio_out"),
  369. SUNXI_FUNCTION(0x2, "lcd0"), /* D3 */
  370. SUNXI_FUNCTION(0x3, "lvds0")), /* VN1 */
  371. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD4,
  372. SUNXI_FUNCTION(0x0, "gpio_in"),
  373. SUNXI_FUNCTION(0x1, "gpio_out"),
  374. SUNXI_FUNCTION(0x2, "lcd0"), /* D4 */
  375. SUNXI_FUNCTION(0x3, "lvds0")), /* VP2 */
  376. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD5,
  377. SUNXI_FUNCTION(0x0, "gpio_in"),
  378. SUNXI_FUNCTION(0x1, "gpio_out"),
  379. SUNXI_FUNCTION(0x2, "lcd0"), /* D5 */
  380. SUNXI_FUNCTION(0x3, "lvds0")), /* VN2 */
  381. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD6,
  382. SUNXI_FUNCTION(0x0, "gpio_in"),
  383. SUNXI_FUNCTION(0x1, "gpio_out"),
  384. SUNXI_FUNCTION(0x2, "lcd0"), /* D6 */
  385. SUNXI_FUNCTION(0x3, "lvds0")), /* VPC */
  386. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD7,
  387. SUNXI_FUNCTION(0x0, "gpio_in"),
  388. SUNXI_FUNCTION(0x1, "gpio_out"),
  389. SUNXI_FUNCTION(0x2, "lcd0"), /* D7 */
  390. SUNXI_FUNCTION(0x3, "lvds0")), /* VNC */
  391. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD8,
  392. SUNXI_FUNCTION(0x0, "gpio_in"),
  393. SUNXI_FUNCTION(0x1, "gpio_out"),
  394. SUNXI_FUNCTION(0x2, "lcd0"), /* D8 */
  395. SUNXI_FUNCTION(0x3, "lvds0")), /* VP3 */
  396. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD9,
  397. SUNXI_FUNCTION(0x0, "gpio_in"),
  398. SUNXI_FUNCTION(0x1, "gpio_out"),
  399. SUNXI_FUNCTION(0x2, "lcd0"), /* D9 */
  400. SUNXI_FUNCTION(0x3, "lvds0")), /* VM3 */
  401. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD10,
  402. SUNXI_FUNCTION(0x0, "gpio_in"),
  403. SUNXI_FUNCTION(0x1, "gpio_out"),
  404. SUNXI_FUNCTION(0x2, "lcd0"), /* D10 */
  405. SUNXI_FUNCTION(0x3, "lvds1")), /* VP0 */
  406. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD11,
  407. SUNXI_FUNCTION(0x0, "gpio_in"),
  408. SUNXI_FUNCTION(0x1, "gpio_out"),
  409. SUNXI_FUNCTION(0x2, "lcd0"), /* D11 */
  410. SUNXI_FUNCTION(0x3, "lvds1")), /* VN0 */
  411. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD12,
  412. SUNXI_FUNCTION(0x0, "gpio_in"),
  413. SUNXI_FUNCTION(0x1, "gpio_out"),
  414. SUNXI_FUNCTION(0x2, "lcd0"), /* D12 */
  415. SUNXI_FUNCTION(0x3, "lvds1")), /* VP1 */
  416. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD13,
  417. SUNXI_FUNCTION(0x0, "gpio_in"),
  418. SUNXI_FUNCTION(0x1, "gpio_out"),
  419. SUNXI_FUNCTION(0x2, "lcd0"), /* D13 */
  420. SUNXI_FUNCTION(0x3, "lvds1")), /* VN1 */
  421. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD14,
  422. SUNXI_FUNCTION(0x0, "gpio_in"),
  423. SUNXI_FUNCTION(0x1, "gpio_out"),
  424. SUNXI_FUNCTION(0x2, "lcd0"), /* D14 */
  425. SUNXI_FUNCTION(0x3, "lvds1")), /* VP2 */
  426. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD15,
  427. SUNXI_FUNCTION(0x0, "gpio_in"),
  428. SUNXI_FUNCTION(0x1, "gpio_out"),
  429. SUNXI_FUNCTION(0x2, "lcd0"), /* D15 */
  430. SUNXI_FUNCTION(0x3, "lvds1")), /* VN2 */
  431. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD16,
  432. SUNXI_FUNCTION(0x0, "gpio_in"),
  433. SUNXI_FUNCTION(0x1, "gpio_out"),
  434. SUNXI_FUNCTION(0x2, "lcd0"), /* D16 */
  435. SUNXI_FUNCTION(0x3, "lvds1")), /* VPC */
  436. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD17,
  437. SUNXI_FUNCTION(0x0, "gpio_in"),
  438. SUNXI_FUNCTION(0x1, "gpio_out"),
  439. SUNXI_FUNCTION(0x2, "lcd0"), /* D17 */
  440. SUNXI_FUNCTION(0x3, "lvds1")), /* VNC */
  441. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD18,
  442. SUNXI_FUNCTION(0x0, "gpio_in"),
  443. SUNXI_FUNCTION(0x1, "gpio_out"),
  444. SUNXI_FUNCTION(0x2, "lcd0"), /* D18 */
  445. SUNXI_FUNCTION(0x3, "lvds1")), /* VP3 */
  446. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD19,
  447. SUNXI_FUNCTION(0x0, "gpio_in"),
  448. SUNXI_FUNCTION(0x1, "gpio_out"),
  449. SUNXI_FUNCTION(0x2, "lcd0"), /* D19 */
  450. SUNXI_FUNCTION(0x3, "lvds1")), /* VN3 */
  451. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD20,
  452. SUNXI_FUNCTION(0x0, "gpio_in"),
  453. SUNXI_FUNCTION(0x1, "gpio_out"),
  454. SUNXI_FUNCTION(0x2, "lcd0"), /* D20 */
  455. SUNXI_FUNCTION(0x3, "csi1")), /* MCLK */
  456. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD21,
  457. SUNXI_FUNCTION(0x0, "gpio_in"),
  458. SUNXI_FUNCTION(0x1, "gpio_out"),
  459. SUNXI_FUNCTION(0x2, "lcd0"), /* D21 */
  460. SUNXI_FUNCTION(0x3, "sim")), /* VPPEN */
  461. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD22,
  462. SUNXI_FUNCTION(0x0, "gpio_in"),
  463. SUNXI_FUNCTION(0x1, "gpio_out"),
  464. SUNXI_FUNCTION(0x2, "lcd0"), /* D22 */
  465. SUNXI_FUNCTION(0x3, "sim")), /* VPPPP */
  466. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD23,
  467. SUNXI_FUNCTION(0x0, "gpio_in"),
  468. SUNXI_FUNCTION(0x1, "gpio_out"),
  469. SUNXI_FUNCTION(0x2, "lcd0"), /* D23 */
  470. SUNXI_FUNCTION(0x3, "sim")), /* DET */
  471. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD24,
  472. SUNXI_FUNCTION(0x0, "gpio_in"),
  473. SUNXI_FUNCTION(0x1, "gpio_out"),
  474. SUNXI_FUNCTION(0x2, "lcd0"), /* CLK */
  475. SUNXI_FUNCTION(0x3, "sim")), /* VCCEN */
  476. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD25,
  477. SUNXI_FUNCTION(0x0, "gpio_in"),
  478. SUNXI_FUNCTION(0x1, "gpio_out"),
  479. SUNXI_FUNCTION(0x2, "lcd0"), /* DE */
  480. SUNXI_FUNCTION(0x3, "sim")), /* RST */
  481. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD26,
  482. SUNXI_FUNCTION(0x0, "gpio_in"),
  483. SUNXI_FUNCTION(0x1, "gpio_out"),
  484. SUNXI_FUNCTION(0x2, "lcd0"), /* HSYNC */
  485. SUNXI_FUNCTION(0x3, "sim")), /* SCK */
  486. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD27,
  487. SUNXI_FUNCTION(0x0, "gpio_in"),
  488. SUNXI_FUNCTION(0x1, "gpio_out"),
  489. SUNXI_FUNCTION(0x2, "lcd0"), /* VSYNC */
  490. SUNXI_FUNCTION(0x3, "sim")), /* SDA */
  491. /* Hole */
  492. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE0,
  493. SUNXI_FUNCTION(0x0, "gpio_in"),
  494. SUNXI_FUNCTION(0x1, "gpio_out"),
  495. SUNXI_FUNCTION(0x2, "ts0"), /* CLK */
  496. SUNXI_FUNCTION(0x3, "csi0")), /* PCK */
  497. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE1,
  498. SUNXI_FUNCTION(0x0, "gpio_in"),
  499. SUNXI_FUNCTION(0x1, "gpio_out"),
  500. SUNXI_FUNCTION(0x2, "ts0"), /* ERR */
  501. SUNXI_FUNCTION(0x3, "csi0")), /* CK */
  502. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE2,
  503. SUNXI_FUNCTION(0x0, "gpio_in"),
  504. SUNXI_FUNCTION(0x1, "gpio_out"),
  505. SUNXI_FUNCTION(0x2, "ts0"), /* SYNC */
  506. SUNXI_FUNCTION(0x3, "csi0")), /* HSYNC */
  507. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE3,
  508. SUNXI_FUNCTION(0x0, "gpio_in"),
  509. SUNXI_FUNCTION(0x1, "gpio_out"),
  510. SUNXI_FUNCTION(0x2, "ts0"), /* DVLD */
  511. SUNXI_FUNCTION(0x3, "csi0")), /* VSYNC */
  512. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE4,
  513. SUNXI_FUNCTION(0x0, "gpio_in"),
  514. SUNXI_FUNCTION(0x1, "gpio_out"),
  515. SUNXI_FUNCTION(0x2, "ts0"), /* D0 */
  516. SUNXI_FUNCTION(0x3, "csi0")), /* D0 */
  517. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE5,
  518. SUNXI_FUNCTION(0x0, "gpio_in"),
  519. SUNXI_FUNCTION(0x1, "gpio_out"),
  520. SUNXI_FUNCTION(0x2, "ts0"), /* D1 */
  521. SUNXI_FUNCTION(0x3, "csi0"), /* D1 */
  522. SUNXI_FUNCTION(0x4, "sim")), /* VPPEN */
  523. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE6,
  524. SUNXI_FUNCTION(0x0, "gpio_in"),
  525. SUNXI_FUNCTION(0x1, "gpio_out"),
  526. SUNXI_FUNCTION(0x2, "ts0"), /* D2 */
  527. SUNXI_FUNCTION(0x3, "csi0")), /* D2 */
  528. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE7,
  529. SUNXI_FUNCTION(0x0, "gpio_in"),
  530. SUNXI_FUNCTION(0x1, "gpio_out"),
  531. SUNXI_FUNCTION(0x2, "ts0"), /* D3 */
  532. SUNXI_FUNCTION(0x3, "csi0")), /* D3 */
  533. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE8,
  534. SUNXI_FUNCTION(0x0, "gpio_in"),
  535. SUNXI_FUNCTION(0x1, "gpio_out"),
  536. SUNXI_FUNCTION(0x2, "ts0"), /* D4 */
  537. SUNXI_FUNCTION(0x3, "csi0")), /* D4 */
  538. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE9,
  539. SUNXI_FUNCTION(0x0, "gpio_in"),
  540. SUNXI_FUNCTION(0x1, "gpio_out"),
  541. SUNXI_FUNCTION(0x2, "ts0"), /* D5 */
  542. SUNXI_FUNCTION(0x3, "csi0")), /* D5 */
  543. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE10,
  544. SUNXI_FUNCTION(0x0, "gpio_in"),
  545. SUNXI_FUNCTION(0x1, "gpio_out"),
  546. SUNXI_FUNCTION(0x2, "ts0"), /* D6 */
  547. SUNXI_FUNCTION(0x3, "csi0")), /* D6 */
  548. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE11,
  549. SUNXI_FUNCTION(0x0, "gpio_in"),
  550. SUNXI_FUNCTION(0x1, "gpio_out"),
  551. SUNXI_FUNCTION(0x2, "ts0"), /* D7 */
  552. SUNXI_FUNCTION(0x3, "csi0")), /* D7 */
  553. /* Hole */
  554. SUNXI_PIN(SUNXI_PINCTRL_PIN_PF0,
  555. SUNXI_FUNCTION(0x0, "gpio_in"),
  556. SUNXI_FUNCTION(0x1, "gpio_out"),
  557. SUNXI_FUNCTION(0x2, "mmc0"), /* D1 */
  558. SUNXI_FUNCTION(0x4, "jtag")), /* MSI */
  559. SUNXI_PIN(SUNXI_PINCTRL_PIN_PF1,
  560. SUNXI_FUNCTION(0x0, "gpio_in"),
  561. SUNXI_FUNCTION(0x1, "gpio_out"),
  562. SUNXI_FUNCTION(0x2, "mmc0"), /* D0 */
  563. SUNXI_FUNCTION(0x4, "jtag")), /* DI1 */
  564. SUNXI_PIN(SUNXI_PINCTRL_PIN_PF2,
  565. SUNXI_FUNCTION(0x0, "gpio_in"),
  566. SUNXI_FUNCTION(0x1, "gpio_out"),
  567. SUNXI_FUNCTION(0x2, "mmc0"), /* CLK */
  568. SUNXI_FUNCTION(0x4, "uart0")), /* TX */
  569. SUNXI_PIN(SUNXI_PINCTRL_PIN_PF3,
  570. SUNXI_FUNCTION(0x0, "gpio_in"),
  571. SUNXI_FUNCTION(0x1, "gpio_out"),
  572. SUNXI_FUNCTION(0x2, "mmc0"), /* CMD */
  573. SUNXI_FUNCTION(0x4, "jtag")), /* DO1 */
  574. SUNXI_PIN(SUNXI_PINCTRL_PIN_PF4,
  575. SUNXI_FUNCTION(0x0, "gpio_in"),
  576. SUNXI_FUNCTION(0x1, "gpio_out"),
  577. SUNXI_FUNCTION(0x2, "mmc0"), /* D3 */
  578. SUNXI_FUNCTION(0x4, "uart0")), /* RX */
  579. SUNXI_PIN(SUNXI_PINCTRL_PIN_PF5,
  580. SUNXI_FUNCTION(0x0, "gpio_in"),
  581. SUNXI_FUNCTION(0x1, "gpio_out"),
  582. SUNXI_FUNCTION(0x2, "mmc0"), /* D2 */
  583. SUNXI_FUNCTION(0x4, "jtag")), /* CK1 */
  584. /* Hole */
  585. SUNXI_PIN(SUNXI_PINCTRL_PIN_PG0,
  586. SUNXI_FUNCTION(0x0, "gpio_in"),
  587. SUNXI_FUNCTION(0x1, "gpio_out"),
  588. SUNXI_FUNCTION(0x2, "ts1"), /* CLK */
  589. SUNXI_FUNCTION(0x3, "csi1"), /* PCK */
  590. SUNXI_FUNCTION(0x4, "mmc1")), /* CMD */
  591. SUNXI_PIN(SUNXI_PINCTRL_PIN_PG1,
  592. SUNXI_FUNCTION(0x0, "gpio_in"),
  593. SUNXI_FUNCTION(0x1, "gpio_out"),
  594. SUNXI_FUNCTION(0x2, "ts1"), /* ERR */
  595. SUNXI_FUNCTION(0x3, "csi1"), /* CK */
  596. SUNXI_FUNCTION(0x4, "mmc1")), /* CLK */
  597. SUNXI_PIN(SUNXI_PINCTRL_PIN_PG2,
  598. SUNXI_FUNCTION(0x0, "gpio_in"),
  599. SUNXI_FUNCTION(0x1, "gpio_out"),
  600. SUNXI_FUNCTION(0x2, "ts1"), /* SYNC */
  601. SUNXI_FUNCTION(0x3, "csi1"), /* HSYNC */
  602. SUNXI_FUNCTION(0x4, "mmc1")), /* D0 */
  603. SUNXI_PIN(SUNXI_PINCTRL_PIN_PG3,
  604. SUNXI_FUNCTION(0x0, "gpio_in"),
  605. SUNXI_FUNCTION(0x1, "gpio_out"),
  606. SUNXI_FUNCTION(0x2, "ts1"), /* DVLD */
  607. SUNXI_FUNCTION(0x3, "csi1"), /* VSYNC */
  608. SUNXI_FUNCTION(0x4, "mmc1")), /* D1 */
  609. SUNXI_PIN(SUNXI_PINCTRL_PIN_PG4,
  610. SUNXI_FUNCTION(0x0, "gpio_in"),
  611. SUNXI_FUNCTION(0x1, "gpio_out"),
  612. SUNXI_FUNCTION(0x2, "ts1"), /* D0 */
  613. SUNXI_FUNCTION(0x3, "csi1"), /* D0 */
  614. SUNXI_FUNCTION(0x4, "mmc1"), /* D2 */
  615. SUNXI_FUNCTION(0x5, "csi0")), /* D8 */
  616. SUNXI_PIN(SUNXI_PINCTRL_PIN_PG5,
  617. SUNXI_FUNCTION(0x0, "gpio_in"),
  618. SUNXI_FUNCTION(0x1, "gpio_out"),
  619. SUNXI_FUNCTION(0x2, "ts1"), /* D1 */
  620. SUNXI_FUNCTION(0x3, "csi1"), /* D1 */
  621. SUNXI_FUNCTION(0x4, "mmc1"), /* D3 */
  622. SUNXI_FUNCTION(0x5, "csi0")), /* D9 */
  623. SUNXI_PIN(SUNXI_PINCTRL_PIN_PG6,
  624. SUNXI_FUNCTION(0x0, "gpio_in"),
  625. SUNXI_FUNCTION(0x1, "gpio_out"),
  626. SUNXI_FUNCTION(0x2, "ts1"), /* D2 */
  627. SUNXI_FUNCTION(0x3, "csi1"), /* D2 */
  628. SUNXI_FUNCTION(0x4, "uart3"), /* TX */
  629. SUNXI_FUNCTION(0x5, "csi0")), /* D10 */
  630. SUNXI_PIN(SUNXI_PINCTRL_PIN_PG7,
  631. SUNXI_FUNCTION(0x0, "gpio_in"),
  632. SUNXI_FUNCTION(0x1, "gpio_out"),
  633. SUNXI_FUNCTION(0x2, "ts1"), /* D3 */
  634. SUNXI_FUNCTION(0x3, "csi1"), /* D3 */
  635. SUNXI_FUNCTION(0x4, "uart3"), /* RX */
  636. SUNXI_FUNCTION(0x5, "csi0")), /* D11 */
  637. SUNXI_PIN(SUNXI_PINCTRL_PIN_PG8,
  638. SUNXI_FUNCTION(0x0, "gpio_in"),
  639. SUNXI_FUNCTION(0x1, "gpio_out"),
  640. SUNXI_FUNCTION(0x2, "ts1"), /* D4 */
  641. SUNXI_FUNCTION(0x3, "csi1"), /* D4 */
  642. SUNXI_FUNCTION(0x4, "uart3"), /* RTS */
  643. SUNXI_FUNCTION(0x5, "csi0")), /* D12 */
  644. SUNXI_PIN(SUNXI_PINCTRL_PIN_PG9,
  645. SUNXI_FUNCTION(0x0, "gpio_in"),
  646. SUNXI_FUNCTION(0x1, "gpio_out"),
  647. SUNXI_FUNCTION(0x2, "ts1"), /* D5 */
  648. SUNXI_FUNCTION(0x3, "csi1"), /* D5 */
  649. SUNXI_FUNCTION(0x4, "uart3"), /* CTS */
  650. SUNXI_FUNCTION(0x5, "csi0")), /* D13 */
  651. SUNXI_PIN(SUNXI_PINCTRL_PIN_PG10,
  652. SUNXI_FUNCTION(0x0, "gpio_in"),
  653. SUNXI_FUNCTION(0x1, "gpio_out"),
  654. SUNXI_FUNCTION(0x2, "ts1"), /* D6 */
  655. SUNXI_FUNCTION(0x3, "csi1"), /* D6 */
  656. SUNXI_FUNCTION(0x4, "uart4"), /* TX */
  657. SUNXI_FUNCTION(0x5, "csi0")), /* D14 */
  658. SUNXI_PIN(SUNXI_PINCTRL_PIN_PG11,
  659. SUNXI_FUNCTION(0x0, "gpio_in"),
  660. SUNXI_FUNCTION(0x1, "gpio_out"),
  661. SUNXI_FUNCTION(0x2, "ts1"), /* D7 */
  662. SUNXI_FUNCTION(0x3, "csi1"), /* D7 */
  663. SUNXI_FUNCTION(0x4, "uart4"), /* RX */
  664. SUNXI_FUNCTION(0x5, "csi0")), /* D15 */
  665. /* Hole */
  666. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH0,
  667. SUNXI_FUNCTION(0x0, "gpio_in"),
  668. SUNXI_FUNCTION(0x1, "gpio_out"),
  669. SUNXI_FUNCTION(0x2, "lcd1"), /* D0 */
  670. SUNXI_FUNCTION(0x3, "pata"), /* ATAA0 */
  671. SUNXI_FUNCTION(0x4, "uart3"), /* TX */
  672. SUNXI_FUNCTION(0x7, "csi1")), /* D0 */
  673. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH1,
  674. SUNXI_FUNCTION(0x0, "gpio_in"),
  675. SUNXI_FUNCTION(0x1, "gpio_out"),
  676. SUNXI_FUNCTION(0x2, "lcd1"), /* D1 */
  677. SUNXI_FUNCTION(0x3, "pata"), /* ATAA1 */
  678. SUNXI_FUNCTION(0x4, "uart3"), /* RX */
  679. SUNXI_FUNCTION(0x7, "csi1")), /* D1 */
  680. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH2,
  681. SUNXI_FUNCTION(0x0, "gpio_in"),
  682. SUNXI_FUNCTION(0x1, "gpio_out"),
  683. SUNXI_FUNCTION(0x2, "lcd1"), /* D2 */
  684. SUNXI_FUNCTION(0x3, "pata"), /* ATAA2 */
  685. SUNXI_FUNCTION(0x4, "uart3"), /* RTS */
  686. SUNXI_FUNCTION(0x7, "csi1")), /* D2 */
  687. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH3,
  688. SUNXI_FUNCTION(0x0, "gpio_in"),
  689. SUNXI_FUNCTION(0x1, "gpio_out"),
  690. SUNXI_FUNCTION(0x2, "lcd1"), /* D3 */
  691. SUNXI_FUNCTION(0x3, "pata"), /* ATAIRQ */
  692. SUNXI_FUNCTION(0x4, "uart3"), /* CTS */
  693. SUNXI_FUNCTION(0x7, "csi1")), /* D3 */
  694. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH4,
  695. SUNXI_FUNCTION(0x0, "gpio_in"),
  696. SUNXI_FUNCTION(0x1, "gpio_out"),
  697. SUNXI_FUNCTION(0x2, "lcd1"), /* D4 */
  698. SUNXI_FUNCTION(0x3, "pata"), /* ATAD0 */
  699. SUNXI_FUNCTION(0x4, "uart4"), /* TX */
  700. SUNXI_FUNCTION(0x7, "csi1")), /* D4 */
  701. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH5,
  702. SUNXI_FUNCTION(0x0, "gpio_in"),
  703. SUNXI_FUNCTION(0x1, "gpio_out"),
  704. SUNXI_FUNCTION(0x2, "lcd1"), /* D5 */
  705. SUNXI_FUNCTION(0x3, "pata"), /* ATAD1 */
  706. SUNXI_FUNCTION(0x4, "uart4"), /* RX */
  707. SUNXI_FUNCTION(0x7, "csi1")), /* D5 */
  708. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH6,
  709. SUNXI_FUNCTION(0x0, "gpio_in"),
  710. SUNXI_FUNCTION(0x1, "gpio_out"),
  711. SUNXI_FUNCTION(0x2, "lcd1"), /* D6 */
  712. SUNXI_FUNCTION(0x3, "pata"), /* ATAD2 */
  713. SUNXI_FUNCTION(0x4, "uart5"), /* TX */
  714. SUNXI_FUNCTION(0x5, "ms"), /* BS */
  715. SUNXI_FUNCTION(0x7, "csi1")), /* D6 */
  716. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH7,
  717. SUNXI_FUNCTION(0x0, "gpio_in"),
  718. SUNXI_FUNCTION(0x1, "gpio_out"),
  719. SUNXI_FUNCTION(0x2, "lcd1"), /* D7 */
  720. SUNXI_FUNCTION(0x3, "pata"), /* ATAD3 */
  721. SUNXI_FUNCTION(0x4, "uart5"), /* RX */
  722. SUNXI_FUNCTION(0x5, "ms"), /* CLK */
  723. SUNXI_FUNCTION(0x7, "csi1")), /* D7 */
  724. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH8,
  725. SUNXI_FUNCTION(0x0, "gpio_in"),
  726. SUNXI_FUNCTION(0x1, "gpio_out"),
  727. SUNXI_FUNCTION(0x2, "lcd1"), /* D8 */
  728. SUNXI_FUNCTION(0x3, "pata"), /* ATAD4 */
  729. SUNXI_FUNCTION(0x4, "keypad"), /* IN0 */
  730. SUNXI_FUNCTION(0x5, "ms"), /* D0 */
  731. SUNXI_FUNCTION(0x7, "csi1")), /* D8 */
  732. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH9,
  733. SUNXI_FUNCTION(0x0, "gpio_in"),
  734. SUNXI_FUNCTION(0x1, "gpio_out"),
  735. SUNXI_FUNCTION(0x2, "lcd1"), /* D9 */
  736. SUNXI_FUNCTION(0x3, "pata"), /* ATAD5 */
  737. SUNXI_FUNCTION(0x4, "keypad"), /* IN1 */
  738. SUNXI_FUNCTION(0x5, "ms"), /* D1 */
  739. SUNXI_FUNCTION(0x7, "csi1")), /* D9 */
  740. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH10,
  741. SUNXI_FUNCTION(0x0, "gpio_in"),
  742. SUNXI_FUNCTION(0x1, "gpio_out"),
  743. SUNXI_FUNCTION(0x2, "lcd1"), /* D10 */
  744. SUNXI_FUNCTION(0x3, "pata"), /* ATAD6 */
  745. SUNXI_FUNCTION(0x4, "keypad"), /* IN2 */
  746. SUNXI_FUNCTION(0x5, "ms"), /* D2 */
  747. SUNXI_FUNCTION(0x7, "csi1")), /* D10 */
  748. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH11,
  749. SUNXI_FUNCTION(0x0, "gpio_in"),
  750. SUNXI_FUNCTION(0x1, "gpio_out"),
  751. SUNXI_FUNCTION(0x2, "lcd1"), /* D11 */
  752. SUNXI_FUNCTION(0x3, "pata"), /* ATAD7 */
  753. SUNXI_FUNCTION(0x4, "keypad"), /* IN3 */
  754. SUNXI_FUNCTION(0x5, "ms"), /* D3 */
  755. SUNXI_FUNCTION(0x7, "csi1")), /* D11 */
  756. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH12,
  757. SUNXI_FUNCTION(0x0, "gpio_in"),
  758. SUNXI_FUNCTION(0x1, "gpio_out"),
  759. SUNXI_FUNCTION(0x2, "lcd1"), /* D12 */
  760. SUNXI_FUNCTION(0x3, "pata"), /* ATAD8 */
  761. SUNXI_FUNCTION(0x4, "ps2"), /* SCK1 */
  762. SUNXI_FUNCTION(0x7, "csi1")), /* D12 */
  763. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH13,
  764. SUNXI_FUNCTION(0x0, "gpio_in"),
  765. SUNXI_FUNCTION(0x1, "gpio_out"),
  766. SUNXI_FUNCTION(0x2, "lcd1"), /* D13 */
  767. SUNXI_FUNCTION(0x3, "pata"), /* ATAD9 */
  768. SUNXI_FUNCTION(0x4, "ps2"), /* SDA1 */
  769. SUNXI_FUNCTION(0x5, "sim"), /* RST */
  770. SUNXI_FUNCTION(0x7, "csi1")), /* D13 */
  771. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH14,
  772. SUNXI_FUNCTION(0x0, "gpio_in"),
  773. SUNXI_FUNCTION(0x1, "gpio_out"),
  774. SUNXI_FUNCTION(0x2, "lcd1"), /* D14 */
  775. SUNXI_FUNCTION(0x3, "pata"), /* ATAD10 */
  776. SUNXI_FUNCTION(0x4, "keypad"), /* IN4 */
  777. SUNXI_FUNCTION(0x5, "sim"), /* VPPEN */
  778. SUNXI_FUNCTION(0x7, "csi1")), /* D14 */
  779. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH15,
  780. SUNXI_FUNCTION(0x0, "gpio_in"),
  781. SUNXI_FUNCTION(0x1, "gpio_out"),
  782. SUNXI_FUNCTION(0x2, "lcd1"), /* D15 */
  783. SUNXI_FUNCTION(0x3, "pata"), /* ATAD11 */
  784. SUNXI_FUNCTION(0x4, "keypad"), /* IN5 */
  785. SUNXI_FUNCTION(0x5, "sim"), /* VPPPP */
  786. SUNXI_FUNCTION(0x7, "csi1")), /* D15 */
  787. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH16,
  788. SUNXI_FUNCTION(0x0, "gpio_in"),
  789. SUNXI_FUNCTION(0x1, "gpio_out"),
  790. SUNXI_FUNCTION(0x2, "lcd1"), /* D16 */
  791. SUNXI_FUNCTION(0x3, "pata"), /* ATAD12 */
  792. SUNXI_FUNCTION(0x4, "keypad"), /* IN6 */
  793. SUNXI_FUNCTION(0x7, "csi1")), /* D16 */
  794. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH17,
  795. SUNXI_FUNCTION(0x0, "gpio_in"),
  796. SUNXI_FUNCTION(0x1, "gpio_out"),
  797. SUNXI_FUNCTION(0x2, "lcd1"), /* D17 */
  798. SUNXI_FUNCTION(0x3, "pata"), /* ATAD13 */
  799. SUNXI_FUNCTION(0x4, "keypad"), /* IN7 */
  800. SUNXI_FUNCTION(0x5, "sim"), /* VCCEN */
  801. SUNXI_FUNCTION(0x7, "csi1")), /* D17 */
  802. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH18,
  803. SUNXI_FUNCTION(0x0, "gpio_in"),
  804. SUNXI_FUNCTION(0x1, "gpio_out"),
  805. SUNXI_FUNCTION(0x2, "lcd1"), /* D18 */
  806. SUNXI_FUNCTION(0x3, "pata"), /* ATAD14 */
  807. SUNXI_FUNCTION(0x4, "keypad"), /* OUT0 */
  808. SUNXI_FUNCTION(0x5, "sim"), /* SCK */
  809. SUNXI_FUNCTION(0x7, "csi1")), /* D18 */
  810. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH19,
  811. SUNXI_FUNCTION(0x0, "gpio_in"),
  812. SUNXI_FUNCTION(0x1, "gpio_out"),
  813. SUNXI_FUNCTION(0x2, "lcd1"), /* D19 */
  814. SUNXI_FUNCTION(0x3, "pata"), /* ATAD15 */
  815. SUNXI_FUNCTION(0x4, "keypad"), /* OUT1 */
  816. SUNXI_FUNCTION(0x5, "sim"), /* SDA */
  817. SUNXI_FUNCTION(0x7, "csi1")), /* D19 */
  818. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH20,
  819. SUNXI_FUNCTION(0x0, "gpio_in"),
  820. SUNXI_FUNCTION(0x1, "gpio_out"),
  821. SUNXI_FUNCTION(0x2, "lcd1"), /* D20 */
  822. SUNXI_FUNCTION(0x3, "pata"), /* ATAOE */
  823. SUNXI_FUNCTION(0x4, "can"), /* TX */
  824. SUNXI_FUNCTION(0x7, "csi1")), /* D20 */
  825. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH21,
  826. SUNXI_FUNCTION(0x0, "gpio_in"),
  827. SUNXI_FUNCTION(0x1, "gpio_out"),
  828. SUNXI_FUNCTION(0x2, "lcd1"), /* D21 */
  829. SUNXI_FUNCTION(0x3, "pata"), /* ATADREQ */
  830. SUNXI_FUNCTION(0x4, "can"), /* RX */
  831. SUNXI_FUNCTION(0x7, "csi1")), /* D21 */
  832. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH22,
  833. SUNXI_FUNCTION(0x0, "gpio_in"),
  834. SUNXI_FUNCTION(0x1, "gpio_out"),
  835. SUNXI_FUNCTION(0x2, "lcd1"), /* D22 */
  836. SUNXI_FUNCTION(0x3, "pata"), /* ATADACK */
  837. SUNXI_FUNCTION(0x4, "keypad"), /* OUT2 */
  838. SUNXI_FUNCTION(0x5, "mmc1"), /* CMD */
  839. SUNXI_FUNCTION(0x7, "csi1")), /* D22 */
  840. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH23,
  841. SUNXI_FUNCTION(0x0, "gpio_in"),
  842. SUNXI_FUNCTION(0x1, "gpio_out"),
  843. SUNXI_FUNCTION(0x2, "lcd1"), /* D23 */
  844. SUNXI_FUNCTION(0x3, "pata"), /* ATACS0 */
  845. SUNXI_FUNCTION(0x4, "keypad"), /* OUT3 */
  846. SUNXI_FUNCTION(0x5, "mmc1"), /* CLK */
  847. SUNXI_FUNCTION(0x7, "csi1")), /* D23 */
  848. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH24,
  849. SUNXI_FUNCTION(0x0, "gpio_in"),
  850. SUNXI_FUNCTION(0x1, "gpio_out"),
  851. SUNXI_FUNCTION(0x2, "lcd1"), /* CLK */
  852. SUNXI_FUNCTION(0x3, "pata"), /* ATACS1 */
  853. SUNXI_FUNCTION(0x4, "keypad"), /* OUT4 */
  854. SUNXI_FUNCTION(0x5, "mmc1"), /* D0 */
  855. SUNXI_FUNCTION(0x7, "csi1")), /* PCLK */
  856. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH25,
  857. SUNXI_FUNCTION(0x0, "gpio_in"),
  858. SUNXI_FUNCTION(0x1, "gpio_out"),
  859. SUNXI_FUNCTION(0x2, "lcd1"), /* DE */
  860. SUNXI_FUNCTION(0x3, "pata"), /* ATAIORDY */
  861. SUNXI_FUNCTION(0x4, "keypad"), /* OUT5 */
  862. SUNXI_FUNCTION(0x5, "mmc1"), /* D1 */
  863. SUNXI_FUNCTION(0x7, "csi1")), /* FIELD */
  864. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH26,
  865. SUNXI_FUNCTION(0x0, "gpio_in"),
  866. SUNXI_FUNCTION(0x1, "gpio_out"),
  867. SUNXI_FUNCTION(0x2, "lcd1"), /* HSYNC */
  868. SUNXI_FUNCTION(0x3, "pata"), /* ATAIOR */
  869. SUNXI_FUNCTION(0x4, "keypad"), /* OUT6 */
  870. SUNXI_FUNCTION(0x5, "mmc1"), /* D2 */
  871. SUNXI_FUNCTION(0x7, "csi1")), /* HSYNC */
  872. SUNXI_PIN(SUNXI_PINCTRL_PIN_PH27,
  873. SUNXI_FUNCTION(0x0, "gpio_in"),
  874. SUNXI_FUNCTION(0x1, "gpio_out"),
  875. SUNXI_FUNCTION(0x2, "lcd1"), /* VSYNC */
  876. SUNXI_FUNCTION(0x3, "pata"), /* ATAIOW */
  877. SUNXI_FUNCTION(0x4, "keypad"), /* OUT7 */
  878. SUNXI_FUNCTION(0x5, "mmc1"), /* D3 */
  879. SUNXI_FUNCTION(0x7, "csi1")), /* VSYNC */
  880. /* Hole */
  881. SUNXI_PIN(SUNXI_PINCTRL_PIN_PI0,
  882. SUNXI_FUNCTION(0x0, "gpio_in"),
  883. SUNXI_FUNCTION(0x1, "gpio_out")),
  884. SUNXI_PIN(SUNXI_PINCTRL_PIN_PI1,
  885. SUNXI_FUNCTION(0x0, "gpio_in"),
  886. SUNXI_FUNCTION(0x1, "gpio_out")),
  887. SUNXI_PIN(SUNXI_PINCTRL_PIN_PI2,
  888. SUNXI_FUNCTION(0x0, "gpio_in"),
  889. SUNXI_FUNCTION(0x1, "gpio_out")),
  890. SUNXI_PIN(SUNXI_PINCTRL_PIN_PI3,
  891. SUNXI_FUNCTION(0x0, "gpio_in"),
  892. SUNXI_FUNCTION(0x1, "gpio_out"),
  893. SUNXI_FUNCTION(0x2, "pwm")), /* PWM1 */
  894. SUNXI_PIN(SUNXI_PINCTRL_PIN_PI4,
  895. SUNXI_FUNCTION(0x0, "gpio_in"),
  896. SUNXI_FUNCTION(0x1, "gpio_out"),
  897. SUNXI_FUNCTION(0x2, "mmc3")), /* CMD */
  898. SUNXI_PIN(SUNXI_PINCTRL_PIN_PI5,
  899. SUNXI_FUNCTION(0x0, "gpio_in"),
  900. SUNXI_FUNCTION(0x1, "gpio_out"),
  901. SUNXI_FUNCTION(0x2, "mmc3")), /* CLK */
  902. SUNXI_PIN(SUNXI_PINCTRL_PIN_PI6,
  903. SUNXI_FUNCTION(0x0, "gpio_in"),
  904. SUNXI_FUNCTION(0x1, "gpio_out"),
  905. SUNXI_FUNCTION(0x2, "mmc3")), /* D0 */
  906. SUNXI_PIN(SUNXI_PINCTRL_PIN_PI7,
  907. SUNXI_FUNCTION(0x0, "gpio_in"),
  908. SUNXI_FUNCTION(0x1, "gpio_out"),
  909. SUNXI_FUNCTION(0x2, "mmc3")), /* D1 */
  910. SUNXI_PIN(SUNXI_PINCTRL_PIN_PI8,
  911. SUNXI_FUNCTION(0x0, "gpio_in"),
  912. SUNXI_FUNCTION(0x1, "gpio_out"),
  913. SUNXI_FUNCTION(0x2, "mmc3")), /* D2 */
  914. SUNXI_PIN(SUNXI_PINCTRL_PIN_PI9,
  915. SUNXI_FUNCTION(0x0, "gpio_in"),
  916. SUNXI_FUNCTION(0x1, "gpio_out"),
  917. SUNXI_FUNCTION(0x2, "mmc3")), /* D3 */
  918. SUNXI_PIN(SUNXI_PINCTRL_PIN_PI10,
  919. SUNXI_FUNCTION(0x0, "gpio_in"),
  920. SUNXI_FUNCTION(0x1, "gpio_out"),
  921. SUNXI_FUNCTION(0x2, "spi0"), /* CS0 */
  922. SUNXI_FUNCTION(0x3, "uart5")), /* TX */
  923. SUNXI_PIN(SUNXI_PINCTRL_PIN_PI11,
  924. SUNXI_FUNCTION(0x0, "gpio_in"),
  925. SUNXI_FUNCTION(0x1, "gpio_out"),
  926. SUNXI_FUNCTION(0x2, "spi0"), /* CLK */
  927. SUNXI_FUNCTION(0x3, "uart5")), /* RX */
  928. SUNXI_PIN(SUNXI_PINCTRL_PIN_PI12,
  929. SUNXI_FUNCTION(0x0, "gpio_in"),
  930. SUNXI_FUNCTION(0x1, "gpio_out"),
  931. SUNXI_FUNCTION(0x2, "spi0"), /* MOSI */
  932. SUNXI_FUNCTION(0x3, "uart6")), /* TX */
  933. SUNXI_PIN(SUNXI_PINCTRL_PIN_PI13,
  934. SUNXI_FUNCTION(0x0, "gpio_in"),
  935. SUNXI_FUNCTION(0x1, "gpio_out"),
  936. SUNXI_FUNCTION(0x2, "spi0"), /* MISO */
  937. SUNXI_FUNCTION(0x3, "uart6")), /* RX */
  938. SUNXI_PIN(SUNXI_PINCTRL_PIN_PI14,
  939. SUNXI_FUNCTION(0x0, "gpio_in"),
  940. SUNXI_FUNCTION(0x1, "gpio_out"),
  941. SUNXI_FUNCTION(0x2, "spi0"), /* CS1 */
  942. SUNXI_FUNCTION(0x3, "ps2"), /* SCK1 */
  943. SUNXI_FUNCTION(0x4, "timer4")), /* TCLKIN0 */
  944. SUNXI_PIN(SUNXI_PINCTRL_PIN_PI15,
  945. SUNXI_FUNCTION(0x0, "gpio_in"),
  946. SUNXI_FUNCTION(0x1, "gpio_out"),
  947. SUNXI_FUNCTION(0x2, "spi1"), /* CS1 */
  948. SUNXI_FUNCTION(0x3, "ps2"), /* SDA1 */
  949. SUNXI_FUNCTION(0x4, "timer5")), /* TCLKIN1 */
  950. SUNXI_PIN(SUNXI_PINCTRL_PIN_PI16,
  951. SUNXI_FUNCTION(0x0, "gpio_in"),
  952. SUNXI_FUNCTION(0x1, "gpio_out"),
  953. SUNXI_FUNCTION(0x2, "spi1"), /* CS0 */
  954. SUNXI_FUNCTION(0x3, "uart2")), /* RTS */
  955. SUNXI_PIN(SUNXI_PINCTRL_PIN_PI17,
  956. SUNXI_FUNCTION(0x0, "gpio_in"),
  957. SUNXI_FUNCTION(0x1, "gpio_out"),
  958. SUNXI_FUNCTION(0x2, "spi1"), /* CLK */
  959. SUNXI_FUNCTION(0x3, "uart2")), /* CTS */
  960. SUNXI_PIN(SUNXI_PINCTRL_PIN_PI18,
  961. SUNXI_FUNCTION(0x0, "gpio_in"),
  962. SUNXI_FUNCTION(0x1, "gpio_out"),
  963. SUNXI_FUNCTION(0x2, "spi1"), /* MOSI */
  964. SUNXI_FUNCTION(0x3, "uart2")), /* TX */
  965. SUNXI_PIN(SUNXI_PINCTRL_PIN_PI19,
  966. SUNXI_FUNCTION(0x0, "gpio_in"),
  967. SUNXI_FUNCTION(0x1, "gpio_out"),
  968. SUNXI_FUNCTION(0x2, "spi1"), /* MISO */
  969. SUNXI_FUNCTION(0x3, "uart2")), /* RX */
  970. SUNXI_PIN(SUNXI_PINCTRL_PIN_PI20,
  971. SUNXI_FUNCTION(0x0, "gpio_in"),
  972. SUNXI_FUNCTION(0x1, "gpio_out"),
  973. SUNXI_FUNCTION(0x2, "ps2"), /* SCK0 */
  974. SUNXI_FUNCTION(0x3, "uart7"), /* TX */
  975. SUNXI_FUNCTION(0x4, "hdmi")), /* HSCL */
  976. SUNXI_PIN(SUNXI_PINCTRL_PIN_PI21,
  977. SUNXI_FUNCTION(0x0, "gpio_in"),
  978. SUNXI_FUNCTION(0x1, "gpio_out"),
  979. SUNXI_FUNCTION(0x2, "ps2"), /* SDA0 */
  980. SUNXI_FUNCTION(0x3, "uart7"), /* RX */
  981. SUNXI_FUNCTION(0x4, "hdmi")), /* HSDA */
  982. };
  983. static const struct sunxi_desc_pin sun5i_a13_pins[] = {
  984. /* Hole */
  985. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB0,
  986. SUNXI_FUNCTION(0x0, "gpio_in"),
  987. SUNXI_FUNCTION(0x1, "gpio_out")),
  988. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB1,
  989. SUNXI_FUNCTION(0x0, "gpio_in"),
  990. SUNXI_FUNCTION(0x1, "gpio_out")),
  991. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB2,
  992. SUNXI_FUNCTION(0x0, "gpio_in"),
  993. SUNXI_FUNCTION(0x1, "gpio_out")),
  994. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB3,
  995. SUNXI_FUNCTION(0x0, "gpio_in"),
  996. SUNXI_FUNCTION(0x1, "gpio_out")),
  997. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB4,
  998. SUNXI_FUNCTION(0x0, "gpio_in"),
  999. SUNXI_FUNCTION(0x1, "gpio_out")),
  1000. /* Hole */
  1001. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB10,
  1002. SUNXI_FUNCTION(0x0, "gpio_in"),
  1003. SUNXI_FUNCTION(0x1, "gpio_out")),
  1004. /* Hole */
  1005. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB15,
  1006. SUNXI_FUNCTION(0x0, "gpio_in"),
  1007. SUNXI_FUNCTION(0x1, "gpio_out")),
  1008. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB16,
  1009. SUNXI_FUNCTION(0x0, "gpio_in"),
  1010. SUNXI_FUNCTION(0x1, "gpio_out")),
  1011. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB17,
  1012. SUNXI_FUNCTION(0x0, "gpio_in"),
  1013. SUNXI_FUNCTION(0x1, "gpio_out")),
  1014. SUNXI_PIN(SUNXI_PINCTRL_PIN_PB18,
  1015. SUNXI_FUNCTION(0x0, "gpio_in"),
  1016. SUNXI_FUNCTION(0x1, "gpio_out")),
  1017. /* Hole */
  1018. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC0,
  1019. SUNXI_FUNCTION(0x0, "gpio_in"),
  1020. SUNXI_FUNCTION(0x1, "gpio_out")),
  1021. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC1,
  1022. SUNXI_FUNCTION(0x0, "gpio_in"),
  1023. SUNXI_FUNCTION(0x1, "gpio_out")),
  1024. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC2,
  1025. SUNXI_FUNCTION(0x0, "gpio_in"),
  1026. SUNXI_FUNCTION(0x1, "gpio_out")),
  1027. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC3,
  1028. SUNXI_FUNCTION(0x0, "gpio_in"),
  1029. SUNXI_FUNCTION(0x1, "gpio_out")),
  1030. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC4,
  1031. SUNXI_FUNCTION(0x0, "gpio_in"),
  1032. SUNXI_FUNCTION(0x1, "gpio_out")),
  1033. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC5,
  1034. SUNXI_FUNCTION(0x0, "gpio_in"),
  1035. SUNXI_FUNCTION(0x1, "gpio_out")),
  1036. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC6,
  1037. SUNXI_FUNCTION(0x0, "gpio_in"),
  1038. SUNXI_FUNCTION(0x1, "gpio_out")),
  1039. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC7,
  1040. SUNXI_FUNCTION(0x0, "gpio_in"),
  1041. SUNXI_FUNCTION(0x1, "gpio_out")),
  1042. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC8,
  1043. SUNXI_FUNCTION(0x0, "gpio_in"),
  1044. SUNXI_FUNCTION(0x1, "gpio_out")),
  1045. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC9,
  1046. SUNXI_FUNCTION(0x0, "gpio_in"),
  1047. SUNXI_FUNCTION(0x1, "gpio_out")),
  1048. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC10,
  1049. SUNXI_FUNCTION(0x0, "gpio_in"),
  1050. SUNXI_FUNCTION(0x1, "gpio_out")),
  1051. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC11,
  1052. SUNXI_FUNCTION(0x0, "gpio_in"),
  1053. SUNXI_FUNCTION(0x1, "gpio_out")),
  1054. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC12,
  1055. SUNXI_FUNCTION(0x0, "gpio_in"),
  1056. SUNXI_FUNCTION(0x1, "gpio_out")),
  1057. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC13,
  1058. SUNXI_FUNCTION(0x0, "gpio_in"),
  1059. SUNXI_FUNCTION(0x1, "gpio_out")),
  1060. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC14,
  1061. SUNXI_FUNCTION(0x0, "gpio_in"),
  1062. SUNXI_FUNCTION(0x1, "gpio_out")),
  1063. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC15,
  1064. SUNXI_FUNCTION(0x0, "gpio_in"),
  1065. SUNXI_FUNCTION(0x1, "gpio_out")),
  1066. /* Hole */
  1067. SUNXI_PIN(SUNXI_PINCTRL_PIN_PC19,
  1068. SUNXI_FUNCTION(0x0, "gpio_in"),
  1069. SUNXI_FUNCTION(0x1, "gpio_out")),
  1070. /* Hole */
  1071. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD2,
  1072. SUNXI_FUNCTION(0x0, "gpio_in"),
  1073. SUNXI_FUNCTION(0x1, "gpio_out")),
  1074. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD3,
  1075. SUNXI_FUNCTION(0x0, "gpio_in"),
  1076. SUNXI_FUNCTION(0x1, "gpio_out")),
  1077. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD4,
  1078. SUNXI_FUNCTION(0x0, "gpio_in"),
  1079. SUNXI_FUNCTION(0x1, "gpio_out")),
  1080. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD5,
  1081. SUNXI_FUNCTION(0x0, "gpio_in"),
  1082. SUNXI_FUNCTION(0x1, "gpio_out")),
  1083. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD6,
  1084. SUNXI_FUNCTION(0x0, "gpio_in"),
  1085. SUNXI_FUNCTION(0x1, "gpio_out")),
  1086. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD7,
  1087. SUNXI_FUNCTION(0x0, "gpio_in"),
  1088. SUNXI_FUNCTION(0x1, "gpio_out")),
  1089. /* Hole */
  1090. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD10,
  1091. SUNXI_FUNCTION(0x0, "gpio_in"),
  1092. SUNXI_FUNCTION(0x1, "gpio_out")),
  1093. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD11,
  1094. SUNXI_FUNCTION(0x0, "gpio_in"),
  1095. SUNXI_FUNCTION(0x1, "gpio_out")),
  1096. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD12,
  1097. SUNXI_FUNCTION(0x0, "gpio_in"),
  1098. SUNXI_FUNCTION(0x1, "gpio_out")),
  1099. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD13,
  1100. SUNXI_FUNCTION(0x0, "gpio_in"),
  1101. SUNXI_FUNCTION(0x1, "gpio_out")),
  1102. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD14,
  1103. SUNXI_FUNCTION(0x0, "gpio_in"),
  1104. SUNXI_FUNCTION(0x1, "gpio_out")),
  1105. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD15,
  1106. SUNXI_FUNCTION(0x0, "gpio_in"),
  1107. SUNXI_FUNCTION(0x1, "gpio_out")),
  1108. /* Hole */
  1109. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD18,
  1110. SUNXI_FUNCTION(0x0, "gpio_in"),
  1111. SUNXI_FUNCTION(0x1, "gpio_out")),
  1112. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD19,
  1113. SUNXI_FUNCTION(0x0, "gpio_in"),
  1114. SUNXI_FUNCTION(0x1, "gpio_out")),
  1115. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD20,
  1116. SUNXI_FUNCTION(0x0, "gpio_in"),
  1117. SUNXI_FUNCTION(0x1, "gpio_out")),
  1118. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD21,
  1119. SUNXI_FUNCTION(0x0, "gpio_in"),
  1120. SUNXI_FUNCTION(0x1, "gpio_out")),
  1121. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD22,
  1122. SUNXI_FUNCTION(0x0, "gpio_in"),
  1123. SUNXI_FUNCTION(0x1, "gpio_out")),
  1124. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD23,
  1125. SUNXI_FUNCTION(0x0, "gpio_in"),
  1126. SUNXI_FUNCTION(0x1, "gpio_out")),
  1127. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD24,
  1128. SUNXI_FUNCTION(0x0, "gpio_in"),
  1129. SUNXI_FUNCTION(0x1, "gpio_out")),
  1130. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD25,
  1131. SUNXI_FUNCTION(0x0, "gpio_in"),
  1132. SUNXI_FUNCTION(0x1, "gpio_out")),
  1133. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD26,
  1134. SUNXI_FUNCTION(0x0, "gpio_in"),
  1135. SUNXI_FUNCTION(0x1, "gpio_out")),
  1136. SUNXI_PIN(SUNXI_PINCTRL_PIN_PD27,
  1137. SUNXI_FUNCTION(0x0, "gpio_in"),
  1138. SUNXI_FUNCTION(0x1, "gpio_out")),
  1139. /* Hole */
  1140. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE0,
  1141. SUNXI_FUNCTION(0x0, "gpio_in"),
  1142. SUNXI_FUNCTION(0x1, "gpio_out")),
  1143. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE1,
  1144. SUNXI_FUNCTION(0x0, "gpio_in"),
  1145. SUNXI_FUNCTION(0x1, "gpio_out")),
  1146. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE2,
  1147. SUNXI_FUNCTION(0x0, "gpio_in"),
  1148. SUNXI_FUNCTION(0x1, "gpio_out")),
  1149. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE3,
  1150. SUNXI_FUNCTION(0x0, "gpio_in"),
  1151. SUNXI_FUNCTION(0x1, "gpio_out")),
  1152. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE4,
  1153. SUNXI_FUNCTION(0x0, "gpio_in"),
  1154. SUNXI_FUNCTION(0x1, "gpio_out")),
  1155. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE5,
  1156. SUNXI_FUNCTION(0x0, "gpio_in"),
  1157. SUNXI_FUNCTION(0x1, "gpio_out")),
  1158. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE6,
  1159. SUNXI_FUNCTION(0x0, "gpio_in"),
  1160. SUNXI_FUNCTION(0x1, "gpio_out")),
  1161. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE7,
  1162. SUNXI_FUNCTION(0x0, "gpio_in"),
  1163. SUNXI_FUNCTION(0x1, "gpio_out")),
  1164. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE8,
  1165. SUNXI_FUNCTION(0x0, "gpio_in"),
  1166. SUNXI_FUNCTION(0x1, "gpio_out")),
  1167. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE9,
  1168. SUNXI_FUNCTION(0x0, "gpio_in"),
  1169. SUNXI_FUNCTION(0x1, "gpio_out")),
  1170. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE10,
  1171. SUNXI_FUNCTION(0x0, "gpio_in"),
  1172. SUNXI_FUNCTION(0x1, "gpio_out"),
  1173. SUNXI_FUNCTION(0x4, "uart1")), /* TX */
  1174. SUNXI_PIN(SUNXI_PINCTRL_PIN_PE11,
  1175. SUNXI_FUNCTION(0x0, "gpio_in"),
  1176. SUNXI_FUNCTION(0x1, "gpio_out"),
  1177. SUNXI_FUNCTION(0x4, "uart1")), /* RX */
  1178. /* Hole */
  1179. SUNXI_PIN(SUNXI_PINCTRL_PIN_PF0,
  1180. SUNXI_FUNCTION(0x0, "gpio_in"),
  1181. SUNXI_FUNCTION(0x1, "gpio_out")),
  1182. SUNXI_PIN(SUNXI_PINCTRL_PIN_PF1,
  1183. SUNXI_FUNCTION(0x0, "gpio_in"),
  1184. SUNXI_FUNCTION(0x1, "gpio_out")),
  1185. SUNXI_PIN(SUNXI_PINCTRL_PIN_PF2,
  1186. SUNXI_FUNCTION(0x0, "gpio_in"),
  1187. SUNXI_FUNCTION(0x1, "gpio_out")),
  1188. SUNXI_PIN(SUNXI_PINCTRL_PIN_PF3,
  1189. SUNXI_FUNCTION(0x0, "gpio_in"),
  1190. SUNXI_FUNCTION(0x1, "gpio_out")),
  1191. SUNXI_PIN(SUNXI_PINCTRL_PIN_PF4,
  1192. SUNXI_FUNCTION(0x0, "gpio_in"),
  1193. SUNXI_FUNCTION(0x1, "gpio_out")),
  1194. SUNXI_PIN(SUNXI_PINCTRL_PIN_PF5,
  1195. SUNXI_FUNCTION(0x0, "gpio_in"),
  1196. SUNXI_FUNCTION(0x1, "gpio_out")),
  1197. /* Hole */
  1198. SUNXI_PIN(SUNXI_PINCTRL_PIN_PG0,
  1199. SUNXI_FUNCTION(0x0, "gpio_in"),
  1200. SUNXI_FUNCTION(0x1, "gpio_out")),
  1201. SUNXI_PIN(SUNXI_PINCTRL_PIN_PG1,
  1202. SUNXI_FUNCTION(0x0, "gpio_in"),
  1203. SUNXI_FUNCTION(0x1, "gpio_out")),
  1204. SUNXI_PIN(SUNXI_PINCTRL_PIN_PG2,
  1205. SUNXI_FUNCTION(0x0, "gpio_in"),
  1206. SUNXI_FUNCTION(0x1, "gpio_out")),
  1207. SUNXI_PIN(SUNXI_PINCTRL_PIN_PG3,
  1208. SUNXI_FUNCTION(0x0, "gpio_in"),
  1209. SUNXI_FUNCTION(0x1, "gpio_out"),
  1210. SUNXI_FUNCTION(0x4, "uart1")), /* TX */
  1211. SUNXI_PIN(SUNXI_PINCTRL_PIN_PG4,
  1212. SUNXI_FUNCTION(0x0, "gpio_in"),
  1213. SUNXI_FUNCTION(0x1, "gpio_out"),
  1214. SUNXI_FUNCTION(0x4, "uart1")), /* RX */
  1215. /* Hole */
  1216. SUNXI_PIN(SUNXI_PINCTRL_PIN_PG9,
  1217. SUNXI_FUNCTION(0x0, "gpio_in"),
  1218. SUNXI_FUNCTION(0x1, "gpio_out")),
  1219. SUNXI_PIN(SUNXI_PINCTRL_PIN_PG10,
  1220. SUNXI_FUNCTION(0x0, "gpio_in"),
  1221. SUNXI_FUNCTION(0x1, "gpio_out")),
  1222. SUNXI_PIN(SUNXI_PINCTRL_PIN_PG11,
  1223. SUNXI_FUNCTION(0x0, "gpio_in"),
  1224. SUNXI_FUNCTION(0x1, "gpio_out")),
  1225. SUNXI_PIN(SUNXI_PINCTRL_PIN_PG12,
  1226. SUNXI_FUNCTION(0x0, "gpio_in"),
  1227. SUNXI_FUNCTION(0x1, "gpio_out")),
  1228. };
  1229. static const struct sunxi_pinctrl_desc sun4i_a10_pinctrl_data = {
  1230. .pins = sun4i_a10_pins,
  1231. .npins = ARRAY_SIZE(sun4i_a10_pins),
  1232. };
  1233. static const struct sunxi_pinctrl_desc sun5i_a13_pinctrl_data = {
  1234. .pins = sun5i_a13_pins,
  1235. .npins = ARRAY_SIZE(sun5i_a13_pins),
  1236. };
  1237. static struct sunxi_pinctrl_group *
  1238. sunxi_pinctrl_find_group_by_name(struct sunxi_pinctrl *pctl, const char *group)
  1239. {
  1240. int i;
  1241. for (i = 0; i < pctl->ngroups; i++) {
  1242. struct sunxi_pinctrl_group *grp = pctl->groups + i;
  1243. if (!strcmp(grp->name, group))
  1244. return grp;
  1245. }
  1246. return NULL;
  1247. }
  1248. static struct sunxi_pinctrl_function *
  1249. sunxi_pinctrl_find_function_by_name(struct sunxi_pinctrl *pctl,
  1250. const char *name)
  1251. {
  1252. struct sunxi_pinctrl_function *func = pctl->functions;
  1253. int i;
  1254. for (i = 0; i < pctl->nfunctions; i++) {
  1255. if (!func[i].name)
  1256. break;
  1257. if (!strcmp(func[i].name, name))
  1258. return func + i;
  1259. }
  1260. return NULL;
  1261. }
  1262. static struct sunxi_desc_function *
  1263. sunxi_pinctrl_desc_find_function_by_name(struct sunxi_pinctrl *pctl,
  1264. const char *pin_name,
  1265. const char *func_name)
  1266. {
  1267. int i;
  1268. for (i = 0; i < pctl->desc->npins; i++) {
  1269. const struct sunxi_desc_pin *pin = pctl->desc->pins + i;
  1270. if (!strcmp(pin->pin.name, pin_name)) {
  1271. struct sunxi_desc_function *func = pin->functions;
  1272. while (func->name) {
  1273. if (!strcmp(func->name, func_name))
  1274. return func;
  1275. func++;
  1276. }
  1277. }
  1278. }
  1279. return NULL;
  1280. }
  1281. static int sunxi_pctrl_get_groups_count(struct pinctrl_dev *pctldev)
  1282. {
  1283. struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
  1284. return pctl->ngroups;
  1285. }
  1286. static const char *sunxi_pctrl_get_group_name(struct pinctrl_dev *pctldev,
  1287. unsigned group)
  1288. {
  1289. struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
  1290. return pctl->groups[group].name;
  1291. }
  1292. static int sunxi_pctrl_get_group_pins(struct pinctrl_dev *pctldev,
  1293. unsigned group,
  1294. const unsigned **pins,
  1295. unsigned *num_pins)
  1296. {
  1297. struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
  1298. *pins = (unsigned *)&pctl->groups[group].pin;
  1299. *num_pins = 1;
  1300. return 0;
  1301. }
  1302. static int sunxi_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
  1303. struct device_node *node,
  1304. struct pinctrl_map **map,
  1305. unsigned *num_maps)
  1306. {
  1307. struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
  1308. unsigned long *pinconfig;
  1309. struct property *prop;
  1310. const char *function;
  1311. const char *group;
  1312. int ret, nmaps, i = 0;
  1313. u32 val;
  1314. *map = NULL;
  1315. *num_maps = 0;
  1316. ret = of_property_read_string(node, "allwinner,function", &function);
  1317. if (ret) {
  1318. dev_err(pctl->dev,
  1319. "missing allwinner,function property in node %s\n",
  1320. node->name);
  1321. return -EINVAL;
  1322. }
  1323. nmaps = of_property_count_strings(node, "allwinner,pins") * 2;
  1324. if (nmaps < 0) {
  1325. dev_err(pctl->dev,
  1326. "missing allwinner,pins property in node %s\n",
  1327. node->name);
  1328. return -EINVAL;
  1329. }
  1330. *map = kmalloc(nmaps * sizeof(struct pinctrl_map), GFP_KERNEL);
  1331. if (!map)
  1332. return -ENOMEM;
  1333. of_property_for_each_string(node, "allwinner,pins", prop, group) {
  1334. struct sunxi_pinctrl_group *grp =
  1335. sunxi_pinctrl_find_group_by_name(pctl, group);
  1336. int j = 0, configlen = 0;
  1337. if (!grp) {
  1338. dev_err(pctl->dev, "unknown pin %s", group);
  1339. continue;
  1340. }
  1341. if (!sunxi_pinctrl_desc_find_function_by_name(pctl,
  1342. grp->name,
  1343. function)) {
  1344. dev_err(pctl->dev, "unsupported function %s on pin %s",
  1345. function, group);
  1346. continue;
  1347. }
  1348. (*map)[i].type = PIN_MAP_TYPE_MUX_GROUP;
  1349. (*map)[i].data.mux.group = group;
  1350. (*map)[i].data.mux.function = function;
  1351. i++;
  1352. (*map)[i].type = PIN_MAP_TYPE_CONFIGS_GROUP;
  1353. (*map)[i].data.configs.group_or_pin = group;
  1354. if (of_find_property(node, "allwinner,drive", NULL))
  1355. configlen++;
  1356. if (of_find_property(node, "allwinner,pull", NULL))
  1357. configlen++;
  1358. pinconfig = kzalloc(configlen * sizeof(*pinconfig), GFP_KERNEL);
  1359. if (!of_property_read_u32(node, "allwinner,drive", &val)) {
  1360. u16 strength = (val + 1) * 10;
  1361. pinconfig[j++] =
  1362. pinconf_to_config_packed(PIN_CONFIG_DRIVE_STRENGTH,
  1363. strength);
  1364. }
  1365. if (!of_property_read_u32(node, "allwinner,pull", &val)) {
  1366. enum pin_config_param pull = PIN_CONFIG_END;
  1367. if (val == 1)
  1368. pull = PIN_CONFIG_BIAS_PULL_UP;
  1369. else if (val == 2)
  1370. pull = PIN_CONFIG_BIAS_PULL_DOWN;
  1371. pinconfig[j++] = pinconf_to_config_packed(pull, 0);
  1372. }
  1373. (*map)[i].data.configs.configs = pinconfig;
  1374. (*map)[i].data.configs.num_configs = configlen;
  1375. i++;
  1376. }
  1377. *num_maps = nmaps;
  1378. return 0;
  1379. }
  1380. static void sunxi_pctrl_dt_free_map(struct pinctrl_dev *pctldev,
  1381. struct pinctrl_map *map,
  1382. unsigned num_maps)
  1383. {
  1384. int i;
  1385. for (i = 0; i < num_maps; i++) {
  1386. if (map[i].type == PIN_MAP_TYPE_CONFIGS_GROUP)
  1387. kfree(map[i].data.configs.configs);
  1388. }
  1389. kfree(map);
  1390. }
  1391. static const struct pinctrl_ops sunxi_pctrl_ops = {
  1392. .dt_node_to_map = sunxi_pctrl_dt_node_to_map,
  1393. .dt_free_map = sunxi_pctrl_dt_free_map,
  1394. .get_groups_count = sunxi_pctrl_get_groups_count,
  1395. .get_group_name = sunxi_pctrl_get_group_name,
  1396. .get_group_pins = sunxi_pctrl_get_group_pins,
  1397. };
  1398. static int sunxi_pconf_group_get(struct pinctrl_dev *pctldev,
  1399. unsigned group,
  1400. unsigned long *config)
  1401. {
  1402. struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
  1403. *config = pctl->groups[group].config;
  1404. return 0;
  1405. }
  1406. static int sunxi_pconf_group_set(struct pinctrl_dev *pctldev,
  1407. unsigned group,
  1408. unsigned long config)
  1409. {
  1410. struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
  1411. struct sunxi_pinctrl_group *g = &pctl->groups[group];
  1412. u32 val, mask;
  1413. u16 strength;
  1414. u8 dlevel;
  1415. switch (pinconf_to_config_param(config)) {
  1416. case PIN_CONFIG_DRIVE_STRENGTH:
  1417. strength = pinconf_to_config_argument(config);
  1418. if (strength > 40)
  1419. return -EINVAL;
  1420. /*
  1421. * We convert from mA to what the register expects:
  1422. * 0: 10mA
  1423. * 1: 20mA
  1424. * 2: 30mA
  1425. * 3: 40mA
  1426. */
  1427. dlevel = strength / 10 - 1;
  1428. val = readl(pctl->membase + sunxi_dlevel_reg(g->pin));
  1429. mask = DLEVEL_PINS_MASK << sunxi_dlevel_offset(g->pin);
  1430. writel((val & ~mask) | dlevel << sunxi_dlevel_offset(g->pin),
  1431. pctl->membase + sunxi_dlevel_reg(g->pin));
  1432. break;
  1433. case PIN_CONFIG_BIAS_PULL_UP:
  1434. val = readl(pctl->membase + sunxi_pull_reg(g->pin));
  1435. mask = PULL_PINS_MASK << sunxi_pull_offset(g->pin);
  1436. writel((val & ~mask) | 1 << sunxi_pull_offset(g->pin),
  1437. pctl->membase + sunxi_pull_reg(g->pin));
  1438. break;
  1439. case PIN_CONFIG_BIAS_PULL_DOWN:
  1440. val = readl(pctl->membase + sunxi_pull_reg(g->pin));
  1441. mask = PULL_PINS_MASK << sunxi_pull_offset(g->pin);
  1442. writel((val & ~mask) | 2 << sunxi_pull_offset(g->pin),
  1443. pctl->membase + sunxi_pull_reg(g->pin));
  1444. break;
  1445. default:
  1446. break;
  1447. }
  1448. /* cache the config value */
  1449. g->config = config;
  1450. return 0;
  1451. }
  1452. static const struct pinconf_ops sunxi_pconf_ops = {
  1453. .pin_config_group_get = sunxi_pconf_group_get,
  1454. .pin_config_group_set = sunxi_pconf_group_set,
  1455. };
  1456. static int sunxi_pmx_get_funcs_cnt(struct pinctrl_dev *pctldev)
  1457. {
  1458. struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
  1459. return pctl->nfunctions;
  1460. }
  1461. static const char *sunxi_pmx_get_func_name(struct pinctrl_dev *pctldev,
  1462. unsigned function)
  1463. {
  1464. struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
  1465. return pctl->functions[function].name;
  1466. }
  1467. static int sunxi_pmx_get_func_groups(struct pinctrl_dev *pctldev,
  1468. unsigned function,
  1469. const char * const **groups,
  1470. unsigned * const num_groups)
  1471. {
  1472. struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
  1473. *groups = pctl->functions[function].groups;
  1474. *num_groups = pctl->functions[function].ngroups;
  1475. return 0;
  1476. }
  1477. static void sunxi_pmx_set(struct pinctrl_dev *pctldev,
  1478. unsigned pin,
  1479. u8 config)
  1480. {
  1481. struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
  1482. u32 val = readl(pctl->membase + sunxi_mux_reg(pin));
  1483. u32 mask = MUX_PINS_MASK << sunxi_mux_offset(pin);
  1484. writel((val & ~mask) | config << sunxi_mux_offset(pin),
  1485. pctl->membase + sunxi_mux_reg(pin));
  1486. }
  1487. static int sunxi_pmx_enable(struct pinctrl_dev *pctldev,
  1488. unsigned function,
  1489. unsigned group)
  1490. {
  1491. struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
  1492. struct sunxi_pinctrl_group *g = pctl->groups + group;
  1493. struct sunxi_pinctrl_function *func = pctl->functions + function;
  1494. struct sunxi_desc_function *desc =
  1495. sunxi_pinctrl_desc_find_function_by_name(pctl,
  1496. g->name,
  1497. func->name);
  1498. if (!desc)
  1499. return -EINVAL;
  1500. sunxi_pmx_set(pctldev, g->pin, desc->muxval);
  1501. return 0;
  1502. }
  1503. static int
  1504. sunxi_pmx_gpio_set_direction(struct pinctrl_dev *pctldev,
  1505. struct pinctrl_gpio_range *range,
  1506. unsigned offset,
  1507. bool input)
  1508. {
  1509. struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
  1510. struct sunxi_desc_function *desc;
  1511. char pin_name[SUNXI_PIN_NAME_MAX_LEN];
  1512. const char *func;
  1513. u8 bank, pin;
  1514. int ret;
  1515. bank = (offset) / PINS_PER_BANK;
  1516. pin = (offset) % PINS_PER_BANK;
  1517. ret = sprintf(pin_name, "P%c%d", 'A' + bank, pin);
  1518. if (!ret)
  1519. goto error;
  1520. if (input)
  1521. func = "gpio_in";
  1522. else
  1523. func = "gpio_out";
  1524. desc = sunxi_pinctrl_desc_find_function_by_name(pctl,
  1525. pin_name,
  1526. func);
  1527. if (!desc) {
  1528. ret = -EINVAL;
  1529. goto error;
  1530. }
  1531. sunxi_pmx_set(pctldev, offset, desc->muxval);
  1532. ret = 0;
  1533. error:
  1534. return ret;
  1535. }
  1536. static const struct pinmux_ops sunxi_pmx_ops = {
  1537. .get_functions_count = sunxi_pmx_get_funcs_cnt,
  1538. .get_function_name = sunxi_pmx_get_func_name,
  1539. .get_function_groups = sunxi_pmx_get_func_groups,
  1540. .enable = sunxi_pmx_enable,
  1541. .gpio_set_direction = sunxi_pmx_gpio_set_direction,
  1542. };
  1543. static struct pinctrl_desc sunxi_pctrl_desc = {
  1544. .confops = &sunxi_pconf_ops,
  1545. .pctlops = &sunxi_pctrl_ops,
  1546. .pmxops = &sunxi_pmx_ops,
  1547. };
  1548. static int sunxi_pinctrl_gpio_request(struct gpio_chip *chip, unsigned offset)
  1549. {
  1550. return pinctrl_request_gpio(chip->base + offset);
  1551. }
  1552. static void sunxi_pinctrl_gpio_free(struct gpio_chip *chip, unsigned offset)
  1553. {
  1554. pinctrl_free_gpio(chip->base + offset);
  1555. }
  1556. static int sunxi_pinctrl_gpio_direction_input(struct gpio_chip *chip,
  1557. unsigned offset)
  1558. {
  1559. return pinctrl_gpio_direction_input(chip->base + offset);
  1560. }
  1561. static int sunxi_pinctrl_gpio_get(struct gpio_chip *chip, unsigned offset)
  1562. {
  1563. struct sunxi_pinctrl *pctl = dev_get_drvdata(chip->dev);
  1564. u32 reg = sunxi_data_reg(offset);
  1565. u8 index = sunxi_data_offset(offset);
  1566. u32 val = (readl(pctl->membase + reg) >> index) & DATA_PINS_MASK;
  1567. return val;
  1568. }
  1569. static int sunxi_pinctrl_gpio_direction_output(struct gpio_chip *chip,
  1570. unsigned offset, int value)
  1571. {
  1572. return pinctrl_gpio_direction_output(chip->base + offset);
  1573. }
  1574. static void sunxi_pinctrl_gpio_set(struct gpio_chip *chip,
  1575. unsigned offset, int value)
  1576. {
  1577. struct sunxi_pinctrl *pctl = dev_get_drvdata(chip->dev);
  1578. u32 reg = sunxi_data_reg(offset);
  1579. u8 index = sunxi_data_offset(offset);
  1580. writel((value & DATA_PINS_MASK) << index, pctl->membase + reg);
  1581. }
  1582. static int sunxi_pinctrl_gpio_of_xlate(struct gpio_chip *gc,
  1583. const struct of_phandle_args *gpiospec,
  1584. u32 *flags)
  1585. {
  1586. int pin, base;
  1587. base = PINS_PER_BANK * gpiospec->args[0];
  1588. pin = base + gpiospec->args[1];
  1589. if (pin > (gc->base + gc->ngpio))
  1590. return -EINVAL;
  1591. if (flags)
  1592. *flags = gpiospec->args[2];
  1593. return pin;
  1594. }
  1595. static struct gpio_chip sunxi_pinctrl_gpio_chip = {
  1596. .owner = THIS_MODULE,
  1597. .request = sunxi_pinctrl_gpio_request,
  1598. .free = sunxi_pinctrl_gpio_free,
  1599. .direction_input = sunxi_pinctrl_gpio_direction_input,
  1600. .direction_output = sunxi_pinctrl_gpio_direction_output,
  1601. .get = sunxi_pinctrl_gpio_get,
  1602. .set = sunxi_pinctrl_gpio_set,
  1603. .of_xlate = sunxi_pinctrl_gpio_of_xlate,
  1604. .of_gpio_n_cells = 3,
  1605. .can_sleep = 0,
  1606. };
  1607. static struct of_device_id sunxi_pinctrl_match[] = {
  1608. { .compatible = "allwinner,sun4i-a10-pinctrl", .data = (void *)&sun4i_a10_pinctrl_data },
  1609. { .compatible = "allwinner,sun5i-a13-pinctrl", .data = (void *)&sun5i_a13_pinctrl_data },
  1610. {}
  1611. };
  1612. MODULE_DEVICE_TABLE(of, sunxi_pinctrl_match);
  1613. static int sunxi_pinctrl_add_function(struct sunxi_pinctrl *pctl,
  1614. const char *name)
  1615. {
  1616. struct sunxi_pinctrl_function *func = pctl->functions;
  1617. while (func->name) {
  1618. /* function already there */
  1619. if (strcmp(func->name, name) == 0) {
  1620. func->ngroups++;
  1621. return -EEXIST;
  1622. }
  1623. func++;
  1624. }
  1625. func->name = name;
  1626. func->ngroups = 1;
  1627. pctl->nfunctions++;
  1628. return 0;
  1629. }
  1630. static int sunxi_pinctrl_build_state(struct platform_device *pdev)
  1631. {
  1632. struct sunxi_pinctrl *pctl = platform_get_drvdata(pdev);
  1633. int i;
  1634. pctl->ngroups = pctl->desc->npins;
  1635. /* Allocate groups */
  1636. pctl->groups = devm_kzalloc(&pdev->dev,
  1637. pctl->ngroups * sizeof(*pctl->groups),
  1638. GFP_KERNEL);
  1639. if (!pctl->groups)
  1640. return -ENOMEM;
  1641. for (i = 0; i < pctl->desc->npins; i++) {
  1642. const struct sunxi_desc_pin *pin = pctl->desc->pins + i;
  1643. struct sunxi_pinctrl_group *group = pctl->groups + i;
  1644. group->name = pin->pin.name;
  1645. group->pin = pin->pin.number;
  1646. }
  1647. /*
  1648. * We suppose that we won't have any more functions than pins,
  1649. * we'll reallocate that later anyway
  1650. */
  1651. pctl->functions = devm_kzalloc(&pdev->dev,
  1652. pctl->desc->npins * sizeof(*pctl->functions),
  1653. GFP_KERNEL);
  1654. if (!pctl->functions)
  1655. return -ENOMEM;
  1656. /* Count functions and their associated groups */
  1657. for (i = 0; i < pctl->desc->npins; i++) {
  1658. const struct sunxi_desc_pin *pin = pctl->desc->pins + i;
  1659. struct sunxi_desc_function *func = pin->functions;
  1660. while (func->name) {
  1661. sunxi_pinctrl_add_function(pctl, func->name);
  1662. func++;
  1663. }
  1664. }
  1665. pctl->functions = krealloc(pctl->functions,
  1666. pctl->nfunctions * sizeof(*pctl->functions),
  1667. GFP_KERNEL);
  1668. for (i = 0; i < pctl->desc->npins; i++) {
  1669. const struct sunxi_desc_pin *pin = pctl->desc->pins + i;
  1670. struct sunxi_desc_function *func = pin->functions;
  1671. while (func->name) {
  1672. struct sunxi_pinctrl_function *func_item;
  1673. const char **func_grp;
  1674. func_item = sunxi_pinctrl_find_function_by_name(pctl,
  1675. func->name);
  1676. if (!func_item)
  1677. return -EINVAL;
  1678. if (!func_item->groups) {
  1679. func_item->groups =
  1680. devm_kzalloc(&pdev->dev,
  1681. func_item->ngroups * sizeof(*func_item->groups),
  1682. GFP_KERNEL);
  1683. if (!func_item->groups)
  1684. return -ENOMEM;
  1685. }
  1686. func_grp = func_item->groups;
  1687. while (*func_grp)
  1688. func_grp++;
  1689. *func_grp = pin->pin.name;
  1690. func++;
  1691. }
  1692. }
  1693. return 0;
  1694. }
  1695. static int sunxi_pinctrl_probe(struct platform_device *pdev)
  1696. {
  1697. struct device_node *node = pdev->dev.of_node;
  1698. const struct of_device_id *device;
  1699. struct pinctrl_pin_desc *pins;
  1700. struct sunxi_pinctrl *pctl;
  1701. int i, ret, last_pin;
  1702. pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL);
  1703. if (!pctl)
  1704. return -ENOMEM;
  1705. platform_set_drvdata(pdev, pctl);
  1706. pctl->membase = of_iomap(node, 0);
  1707. if (!pctl->membase)
  1708. return -ENOMEM;
  1709. device = of_match_device(sunxi_pinctrl_match, &pdev->dev);
  1710. if (!device)
  1711. return -ENODEV;
  1712. pctl->desc = (struct sunxi_pinctrl_desc *)device->data;
  1713. ret = sunxi_pinctrl_build_state(pdev);
  1714. if (ret) {
  1715. dev_err(&pdev->dev, "dt probe failed: %d\n", ret);
  1716. return ret;
  1717. }
  1718. pins = devm_kzalloc(&pdev->dev,
  1719. pctl->desc->npins * sizeof(*pins),
  1720. GFP_KERNEL);
  1721. if (!pins)
  1722. return -ENOMEM;
  1723. for (i = 0; i < pctl->desc->npins; i++)
  1724. pins[i] = pctl->desc->pins[i].pin;
  1725. sunxi_pctrl_desc.name = dev_name(&pdev->dev);
  1726. sunxi_pctrl_desc.owner = THIS_MODULE;
  1727. sunxi_pctrl_desc.pins = pins;
  1728. sunxi_pctrl_desc.npins = pctl->desc->npins;
  1729. pctl->dev = &pdev->dev;
  1730. pctl->pctl_dev = pinctrl_register(&sunxi_pctrl_desc,
  1731. &pdev->dev, pctl);
  1732. if (!pctl->pctl_dev) {
  1733. dev_err(&pdev->dev, "couldn't register pinctrl driver\n");
  1734. return -EINVAL;
  1735. }
  1736. pctl->chip = devm_kzalloc(&pdev->dev, sizeof(*pctl->chip), GFP_KERNEL);
  1737. if (!pctl->chip) {
  1738. ret = -ENOMEM;
  1739. goto pinctrl_error;
  1740. }
  1741. last_pin = pctl->desc->pins[pctl->desc->npins - 1].pin.number;
  1742. pctl->chip = &sunxi_pinctrl_gpio_chip;
  1743. pctl->chip->ngpio = round_up(last_pin, PINS_PER_BANK);
  1744. pctl->chip->label = dev_name(&pdev->dev);
  1745. pctl->chip->dev = &pdev->dev;
  1746. pctl->chip->base = 0;
  1747. ret = gpiochip_add(pctl->chip);
  1748. if (ret)
  1749. goto pinctrl_error;
  1750. for (i = 0; i < pctl->desc->npins; i++) {
  1751. const struct sunxi_desc_pin *pin = pctl->desc->pins + i;
  1752. ret = gpiochip_add_pin_range(pctl->chip, dev_name(&pdev->dev),
  1753. pin->pin.number,
  1754. pin->pin.number, 1);
  1755. if (ret)
  1756. goto gpiochip_error;
  1757. }
  1758. dev_info(&pdev->dev, "initialized sunXi PIO driver\n");
  1759. return 0;
  1760. gpiochip_error:
  1761. ret = gpiochip_remove(pctl->chip);
  1762. pinctrl_error:
  1763. pinctrl_unregister(pctl->pctl_dev);
  1764. return ret;
  1765. }
  1766. static struct platform_driver sunxi_pinctrl_driver = {
  1767. .probe = sunxi_pinctrl_probe,
  1768. .driver = {
  1769. .name = "sunxi-pinctrl",
  1770. .owner = THIS_MODULE,
  1771. .of_match_table = sunxi_pinctrl_match,
  1772. },
  1773. };
  1774. module_platform_driver(sunxi_pinctrl_driver);
  1775. MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com");
  1776. MODULE_DESCRIPTION("Allwinner A1X pinctrl driver");
  1777. MODULE_LICENSE("GPL");