pinctrl-meson-s4.c 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233
  1. // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2. /*
  3. * Pin controller and GPIO driver for Amlogic Meson S4 SoC.
  4. *
  5. * Copyright (c) 2021 Amlogic, Inc. All rights reserved.
  6. * Author: Qianggui Song <[email protected]>
  7. */
  8. #include <dt-bindings/gpio/meson-s4-gpio.h>
  9. #include "pinctrl-meson.h"
  10. #include "pinctrl-meson-axg-pmx.h"
  11. static const struct pinctrl_pin_desc meson_s4_periphs_pins[] = {
  12. MESON_PIN(GPIOE_0),
  13. MESON_PIN(GPIOE_1),
  14. MESON_PIN(GPIOB_0),
  15. MESON_PIN(GPIOB_1),
  16. MESON_PIN(GPIOB_2),
  17. MESON_PIN(GPIOB_3),
  18. MESON_PIN(GPIOB_4),
  19. MESON_PIN(GPIOB_5),
  20. MESON_PIN(GPIOB_6),
  21. MESON_PIN(GPIOB_7),
  22. MESON_PIN(GPIOB_8),
  23. MESON_PIN(GPIOB_9),
  24. MESON_PIN(GPIOB_10),
  25. MESON_PIN(GPIOB_11),
  26. MESON_PIN(GPIOB_12),
  27. MESON_PIN(GPIOB_13),
  28. MESON_PIN(GPIOC_0),
  29. MESON_PIN(GPIOC_1),
  30. MESON_PIN(GPIOC_2),
  31. MESON_PIN(GPIOC_3),
  32. MESON_PIN(GPIOC_4),
  33. MESON_PIN(GPIOC_5),
  34. MESON_PIN(GPIOC_6),
  35. MESON_PIN(GPIOC_7),
  36. MESON_PIN(GPIOD_0),
  37. MESON_PIN(GPIOD_1),
  38. MESON_PIN(GPIOD_2),
  39. MESON_PIN(GPIOD_3),
  40. MESON_PIN(GPIOD_4),
  41. MESON_PIN(GPIOD_5),
  42. MESON_PIN(GPIOD_6),
  43. MESON_PIN(GPIOD_7),
  44. MESON_PIN(GPIOD_8),
  45. MESON_PIN(GPIOD_9),
  46. MESON_PIN(GPIOD_10),
  47. MESON_PIN(GPIOD_11),
  48. MESON_PIN(GPIOH_0),
  49. MESON_PIN(GPIOH_1),
  50. MESON_PIN(GPIOH_2),
  51. MESON_PIN(GPIOH_3),
  52. MESON_PIN(GPIOH_4),
  53. MESON_PIN(GPIOH_5),
  54. MESON_PIN(GPIOH_6),
  55. MESON_PIN(GPIOH_7),
  56. MESON_PIN(GPIOH_8),
  57. MESON_PIN(GPIOH_9),
  58. MESON_PIN(GPIOH_10),
  59. MESON_PIN(GPIOH_11),
  60. MESON_PIN(GPIOX_0),
  61. MESON_PIN(GPIOX_1),
  62. MESON_PIN(GPIOX_2),
  63. MESON_PIN(GPIOX_3),
  64. MESON_PIN(GPIOX_4),
  65. MESON_PIN(GPIOX_5),
  66. MESON_PIN(GPIOX_6),
  67. MESON_PIN(GPIOX_7),
  68. MESON_PIN(GPIOX_8),
  69. MESON_PIN(GPIOX_9),
  70. MESON_PIN(GPIOX_10),
  71. MESON_PIN(GPIOX_11),
  72. MESON_PIN(GPIOX_12),
  73. MESON_PIN(GPIOX_13),
  74. MESON_PIN(GPIOX_14),
  75. MESON_PIN(GPIOX_15),
  76. MESON_PIN(GPIOX_16),
  77. MESON_PIN(GPIOX_17),
  78. MESON_PIN(GPIOX_18),
  79. MESON_PIN(GPIOX_19),
  80. MESON_PIN(GPIOZ_0),
  81. MESON_PIN(GPIOZ_1),
  82. MESON_PIN(GPIOZ_2),
  83. MESON_PIN(GPIOZ_3),
  84. MESON_PIN(GPIOZ_4),
  85. MESON_PIN(GPIOZ_5),
  86. MESON_PIN(GPIOZ_6),
  87. MESON_PIN(GPIOZ_7),
  88. MESON_PIN(GPIOZ_8),
  89. MESON_PIN(GPIOZ_9),
  90. MESON_PIN(GPIOZ_10),
  91. MESON_PIN(GPIOZ_11),
  92. MESON_PIN(GPIOZ_12),
  93. MESON_PIN(GPIO_TEST_N),
  94. };
  95. /* BANK E func1 */
  96. static const unsigned int i2c0_sda_pins[] = { GPIOE_0 };
  97. static const unsigned int i2c0_scl_pins[] = { GPIOE_1 };
  98. /* BANK E func2 */
  99. static const unsigned int uart_b_tx_e_pins[] = { GPIOE_0 };
  100. static const unsigned int uart_b_rx_e_pins[] = { GPIOE_1 };
  101. /* BANK E func3 */
  102. static const unsigned int pwm_h_pins[] = { GPIOE_0 };
  103. static const unsigned int pwm_j_pins[] = { GPIOE_1 };
  104. /* BANK B func1 */
  105. static const unsigned int emmc_nand_d0_pins[] = { GPIOB_0 };
  106. static const unsigned int emmc_nand_d1_pins[] = { GPIOB_1 };
  107. static const unsigned int emmc_nand_d2_pins[] = { GPIOB_2 };
  108. static const unsigned int emmc_nand_d3_pins[] = { GPIOB_3 };
  109. static const unsigned int emmc_nand_d4_pins[] = { GPIOB_4 };
  110. static const unsigned int emmc_nand_d5_pins[] = { GPIOB_5 };
  111. static const unsigned int emmc_nand_d6_pins[] = { GPIOB_6 };
  112. static const unsigned int emmc_nand_d7_pins[] = { GPIOB_7 };
  113. static const unsigned int emmc_clk_pins[] = { GPIOB_8 };
  114. static const unsigned int emmc_rst_pins[] = { GPIOB_9 };
  115. static const unsigned int emmc_cmd_pins[] = { GPIOB_10 };
  116. static const unsigned int emmc_nand_ds_pins[] = { GPIOB_11 };
  117. /* Bank B func2 */
  118. static const unsigned int nand_wen_clk_pins[] = { GPIOB_8 };
  119. static const unsigned int nand_ale_pins[] = { GPIOB_9 };
  120. static const unsigned int nand_ren_wr_pins[] = { GPIOB_10 };
  121. static const unsigned int nand_cle_pins[] = { GPIOB_11 };
  122. static const unsigned int nand_ce0_pins[] = { GPIOB_12 };
  123. /* Bank B func3 */
  124. static const unsigned int spif_hold_pins[] = { GPIOB_3 };
  125. static const unsigned int spif_mo_pins[] = { GPIOB_4 };
  126. static const unsigned int spif_mi_pins[] = { GPIOB_5 };
  127. static const unsigned int spif_clk_pins[] = { GPIOB_6 };
  128. static const unsigned int spif_wp_pins[] = { GPIOB_7 };
  129. static const unsigned int spif_cs_pins[] = { GPIOB_13 };
  130. /* Bank C func1 */
  131. static const unsigned int sdcard_d0_c_pins[] = { GPIOC_0 };
  132. static const unsigned int sdcard_d1_c_pins[] = { GPIOC_1 };
  133. static const unsigned int sdcard_d2_c_pins[] = { GPIOC_2 };
  134. static const unsigned int sdcard_d3_c_pins[] = { GPIOC_3 };
  135. static const unsigned int sdcard_clk_c_pins[] = { GPIOC_4 };
  136. static const unsigned int sdcard_cmd_c_pins[] = { GPIOC_5 };
  137. static const unsigned int sdcard_cd_pins[] = { GPIOC_6 };
  138. /* Bank C func2 */
  139. static const unsigned int jtag_2_tdo_pins[] = { GPIOC_0 };
  140. static const unsigned int jtag_2_tdi_pins[] = { GPIOC_1 };
  141. static const unsigned int uart_b_rx_c_pins[] = { GPIOC_2 };
  142. static const unsigned int uart_b_tx_c_pins[] = { GPIOC_3 };
  143. static const unsigned int jtag_2_clk_pins[] = { GPIOC_4 };
  144. static const unsigned int jtag_2_tms_pins[] = { GPIOC_5 };
  145. static const unsigned int i2c1_sda_c_pins[] = { GPIOC_6 };
  146. static const unsigned int i2c1_scl_c_pins[] = { GPIOC_7 };
  147. /* Bank C func3 */
  148. static const unsigned int pdm_din1_c_pins[] = { GPIOC_0 };
  149. static const unsigned int pdm_din0_c_pins[] = { GPIOC_1 };
  150. static const unsigned int i2c4_sda_c_pins[] = { GPIOC_2 };
  151. static const unsigned int i2c4_scl_c_pins[] = { GPIOC_3 };
  152. static const unsigned int pdm_dclk_c_pins[] = { GPIOC_4 };
  153. static const unsigned int iso7816_clk_c_pins[] = { GPIOC_5 };
  154. static const unsigned int iso7816_data_c_pins[] = { GPIOC_6 };
  155. /* Bank C func4 */
  156. static const unsigned int tdm_d2_c_pins[] = { GPIOC_0 };
  157. static const unsigned int tdm_d3_c_pins[] = { GPIOC_1 };
  158. static const unsigned int tdm_fs1_c_pins[] = { GPIOC_2 };
  159. static const unsigned int tdm_sclk1_c_pins[] = { GPIOC_3 };
  160. static const unsigned int mclk_1_c_pins[] = { GPIOC_4 };
  161. static const unsigned int tdm_d4_c_pins[] = { GPIOC_5 };
  162. static const unsigned int tdm_d5_c_pins[] = { GPIOC_6 };
  163. /* Bank D func1 */
  164. static const unsigned int uart_b_tx_d_pins[] = { GPIOD_0 };
  165. static const unsigned int uart_b_rx_d_pins[] = { GPIOD_1 };
  166. static const unsigned int uart_b_cts_d_pins[] = { GPIOD_2 };
  167. static const unsigned int uart_b_rts_d_pins[] = { GPIOD_3 };
  168. static const unsigned int remote_out_pins[] = { GPIOD_4 };
  169. static const unsigned int remote_in_pins[] = { GPIOD_5 };
  170. static const unsigned int jtag_1_clk_pins[] = { GPIOD_6 };
  171. static const unsigned int jtag_1_tms_pins[] = { GPIOD_7 };
  172. static const unsigned int jtag_1_tdi_pins[] = { GPIOD_8 };
  173. static const unsigned int jtag_1_tdo_pins[] = { GPIOD_9 };
  174. static const unsigned int clk12_24_pins[] = { GPIOD_10 };
  175. static const unsigned int pwm_g_hiz_pins[] = { GPIOD_11 };
  176. /* Bank D func2 */
  177. static const unsigned int i2c4_sda_d_pins[] = { GPIOD_2 };
  178. static const unsigned int i2c4_scl_d_pins[] = { GPIOD_3 };
  179. static const unsigned int mclk_1_d_pins[] = { GPIOD_4 };
  180. static const unsigned int tdm_sclk1_d_pins[] = { GPIOD_6 };
  181. static const unsigned int tdm_fs1_d_pins[] = { GPIOD_7 };
  182. static const unsigned int tdm_d4_d_pins[] = { GPIOD_8 };
  183. static const unsigned int tdm_d3_d_pins[] = { GPIOD_9 };
  184. static const unsigned int tdm_d2_d_pins[] = { GPIOD_10 };
  185. static const unsigned int pwm_g_d_pins[] = { GPIOD_11 };
  186. /* Bank D func3 */
  187. static const unsigned int uart_c_tx_pins[] = { GPIOD_2 };
  188. static const unsigned int uart_c_rx_pins[] = { GPIOD_3 };
  189. static const unsigned int pwm_b_d_pins[] = { GPIOD_4 };
  190. static const unsigned int pwm_a_d_pins[] = { GPIOD_6 };
  191. static const unsigned int pwm_c_d_pins[] = { GPIOD_7 };
  192. static const unsigned int pwm_d_d_pins[] = { GPIOD_8 };
  193. static const unsigned int pwm_i_d_pins[] = { GPIOD_9 };
  194. /* Bank D func4 */
  195. static const unsigned int clk_32k_in_pins[] = { GPIOD_2 };
  196. static const unsigned int pwm_b_hiz_pins[] = { GPIOD_4 };
  197. static const unsigned int pwm_a_hiz_pins[] = { GPIOD_6 };
  198. static const unsigned int pwm_c_hiz_pins[] = { GPIOD_7 };
  199. static const unsigned int pdm_dclk_d_pins[] = { GPIOD_8 };
  200. static const unsigned int pdm_din0_d_pins[] = { GPIOD_9 };
  201. static const unsigned int pdm_din1_d_pins[] = { GPIOD_10 };
  202. /* Bank D func5 */
  203. static const unsigned int mic_mute_en_pins[] = { GPIOD_2 };
  204. static const unsigned int mic_mute_key_pins[] = { GPIOD_3 };
  205. static const unsigned int i2c1_sda_d_pins[] = { GPIOD_6 };
  206. static const unsigned int i2c1_scl_d_pins[] = { GPIOD_7 };
  207. static const unsigned int i2c2_sda_d_pins[] = { GPIOD_10 };
  208. static const unsigned int i2c2_scl_d_pins[] = { GPIOD_11 };
  209. /* Bank D func6 */
  210. static const unsigned int gen_clk_d_pins[] = { GPIOD_10 };
  211. static const unsigned int tsin_b_clk_c_pins[] = { GPIOD_6 };
  212. static const unsigned int tsin_b_sop_c_pins[] = { GPIOD_7 };
  213. static const unsigned int tsin_b_valid_c_pins[] = { GPIOD_8 };
  214. static const unsigned int tsin_b_d0_c_pins[] = { GPIOD_9 };
  215. /* Bank H func1 */
  216. static const unsigned int hdmitx_sda_pins[] = { GPIOH_0 };
  217. static const unsigned int hdmitx_sck_pins[] = { GPIOH_1 };
  218. static const unsigned int hdmitx_hpd_in_pins[] = { GPIOH_2 };
  219. static const unsigned int ao_cec_a_pins[] = { GPIOH_3 };
  220. static const unsigned int spdif_out_h_pins[] = { GPIOH_4 };
  221. static const unsigned int spdif_in_pins[] = { GPIOH_5 };
  222. static const unsigned int i2c1_sda_h_pins[] = { GPIOH_6 };
  223. static const unsigned int i2c1_scl_h_pins[] = { GPIOH_7 };
  224. static const unsigned int i2c2_sda_h8_pins[] = { GPIOH_8 };
  225. static const unsigned int i2c2_scl_h9_pins[] = { GPIOH_9 };
  226. static const unsigned int eth_link_led_pins[] = { GPIOH_10 };
  227. static const unsigned int eth_act_led_pins[] = { GPIOH_11 };
  228. /* Bank H func2 */
  229. static const unsigned int i2c2_sda_h0_pins[] = { GPIOH_0 };
  230. static const unsigned int i2c2_scl_h1_pins[] = { GPIOH_1 };
  231. static const unsigned int ao_cec_b_pins[] = { GPIOH_3 };
  232. static const unsigned int uart_d_tx_h_pins[] = { GPIOH_4 };
  233. static const unsigned int uart_d_rx_h_pins[] = { GPIOH_5 };
  234. static const unsigned int uart_d_cts_h_pins[] = { GPIOH_6 };
  235. static const unsigned int uart_d_rts_h_pins[] = { GPIOH_7 };
  236. static const unsigned int iso7816_clk_h_pins[] = { GPIOH_8 };
  237. static const unsigned int iso7816_data_h_pins[] = { GPIOH_9 };
  238. static const unsigned int uart_e_tx_h_pins[] = { GPIOH_10 };
  239. static const unsigned int uart_e_rx_h_pins[] = { GPIOH_11 };
  240. /* Bank H func3 */
  241. static const unsigned int pwm_d_h_pins[] = { GPIOH_6 };
  242. static const unsigned int pwm_i_h_pins[] = { GPIOH_7 };
  243. static const unsigned int pdm_dclk_h_pins[] = { GPIOH_8 };
  244. static const unsigned int pdm_din0_h_pins[] = { GPIOH_9 };
  245. static const unsigned int pdm_din1_h_pins[] = { GPIOH_10 };
  246. /* Bank H func4 */
  247. static const unsigned int mclk_1_h_pins[] = { GPIOH_4 };
  248. static const unsigned int tdm_sclk1_h_pins[] = { GPIOH_5 };
  249. static const unsigned int tdm_fs1_h_pins[] = { GPIOH_6 };
  250. static const unsigned int tdm_d2_h_pins[] = { GPIOH_7 };
  251. static const unsigned int tdm_d3_h_pins[] = { GPIOH_8 };
  252. static const unsigned int tdm_d4_h_pins[] = { GPIOH_9 };
  253. /* Bank H func5 */
  254. static const unsigned int spi_a_miso_h_pins[] = { GPIOH_4 };
  255. static const unsigned int spi_a_mosi_h_pins[] = { GPIOH_5 };
  256. static const unsigned int spi_a_clk_h_pins[] = { GPIOH_6 };
  257. static const unsigned int spi_a_ss0_h_pins[] = { GPIOH_7 };
  258. /* Bank H func6 */
  259. static const unsigned int gen_clk_h_pins[] = { GPIOH_11 };
  260. static const unsigned int tsin_b1_clk_pins[] = { GPIOH_4 };
  261. static const unsigned int tsin_b1_sop_pins[] = { GPIOH_5 };
  262. static const unsigned int tsin_b1_valid_pins[] = { GPIOH_6 };
  263. static const unsigned int tsin_b1_d0_pins[] = { GPIOH_7 };
  264. /* Bank X func1 */
  265. static const unsigned int sdio_d0_pins[] = { GPIOX_0 };
  266. static const unsigned int sdio_d1_pins[] = { GPIOX_1 };
  267. static const unsigned int sdio_d2_pins[] = { GPIOX_2 };
  268. static const unsigned int sdio_d3_pins[] = { GPIOX_3 };
  269. static const unsigned int sdio_clk_pins[] = { GPIOX_4 };
  270. static const unsigned int sdio_cmd_pins[] = { GPIOX_5 };
  271. static const unsigned int pwm_a_x_pins[] = { GPIOX_6 };
  272. static const unsigned int pwm_f_x_pins[] = { GPIOX_7 };
  273. static const unsigned int tdm_d1_pins[] = { GPIOX_8 };
  274. static const unsigned int tdm_d0_pins[] = { GPIOX_9 };
  275. static const unsigned int tdm_fs0_pins[] = { GPIOX_10 };
  276. static const unsigned int tdm_sclk0_pins[] = { GPIOX_11 };
  277. static const unsigned int uart_a_tx_pins[] = { GPIOX_12 };
  278. static const unsigned int uart_a_rx_pins[] = { GPIOX_13 };
  279. static const unsigned int uart_a_cts_pins[] = { GPIOX_14 };
  280. static const unsigned int uart_a_rts_pins[] = { GPIOX_15 };
  281. static const unsigned int pwm_e_x_pins[] = { GPIOX_16 };
  282. static const unsigned int i2c1_sda_x_pins[] = { GPIOX_17 };
  283. static const unsigned int i2c1_scl_x_pins[] = { GPIOX_18 };
  284. static const unsigned int pwm_b_x_pins[] = { GPIOX_19 };
  285. /* Bank X func2 */
  286. static const unsigned int pdm_din0_x_pins[] = { GPIOX_8 };
  287. static const unsigned int pdm_din1_x_pins[] = { GPIOX_9 };
  288. static const unsigned int pdm_dclk_x_pins[] = { GPIOX_11 };
  289. /* Bank X func3 */
  290. static const unsigned int spi_a_mosi_x_pins[] = { GPIOX_8 };
  291. static const unsigned int spi_a_miso_x_pins[] = { GPIOX_9 };
  292. static const unsigned int spi_a_ss0_x_pins[] = { GPIOX_10 };
  293. static const unsigned int spi_a_clk_x_pins[] = { GPIOX_11 };
  294. /* Bank X func4 */
  295. static const unsigned int pwm_c_x_pins[] = { GPIOX_8 };
  296. static const unsigned int i2c_slave_scl_pins[] = { GPIOX_10 };
  297. static const unsigned int i2c_slave_sda_pins[] = { GPIOX_11 };
  298. /* Bank X func5 */
  299. static const unsigned int i2c3_sda_x_pins[] = { GPIOX_10 };
  300. static const unsigned int i2c3_scl_x_pins[] = { GPIOX_11 };
  301. /* Bank Z func1 */
  302. static const unsigned int tdm_fs2_pins[] = { GPIOZ_0 };
  303. static const unsigned int tdm_sclk2_pins[] = { GPIOZ_1 };
  304. static const unsigned int tdm_d4_z_pins[] = { GPIOZ_2 };
  305. static const unsigned int tdm_d5_z_pins[] = { GPIOZ_3 };
  306. static const unsigned int tdm_d6_pins[] = { GPIOZ_4 };
  307. static const unsigned int tdm_d7_pins[] = { GPIOZ_5 };
  308. static const unsigned int mclk_2_pins[] = { GPIOZ_6 };
  309. static const unsigned int spdif_out_z_pins[] = { GPIOZ_9 };
  310. static const unsigned int dtv_a_if_agc_z10_pins[] = { GPIOZ_10 };
  311. static const unsigned int uart_e_tx_z11_pins[] = { GPIOZ_11 };
  312. static const unsigned int uart_e_rx_z12_pins[] = { GPIOZ_12 };
  313. /* Bank Z func2 */
  314. static const unsigned int tsin_a_clk_pins[] = { GPIOZ_0 };
  315. static const unsigned int tsin_a_sop_pins[] = { GPIOZ_1 };
  316. static const unsigned int tsin_a_valid_pins[] = { GPIOZ_2 };
  317. static const unsigned int tsin_a_din0_pins[] = { GPIOZ_3 };
  318. static const unsigned int dtv_a_if_agc_z6_pins[] = { GPIOZ_6 };
  319. static const unsigned int dtv_b_if_agc_pins[] = { GPIOZ_7 };
  320. static const unsigned int i2c3_sda_z_pins[] = { GPIOZ_8 };
  321. static const unsigned int i2c3_scl_z_pins[] = { GPIOZ_9 };
  322. static const unsigned int dtv_a_rf_agc_pins[] = { GPIOZ_10 };
  323. static const unsigned int dtv_b_rf_agc_pins[] = { GPIOZ_11 };
  324. /* Bank Z func3 */
  325. static const unsigned int sdcard_d0_z_pins[] = { GPIOZ_0 };
  326. static const unsigned int sdcard_d1_z_pins[] = { GPIOZ_1 };
  327. static const unsigned int sdcard_d2_z_pins[] = { GPIOZ_2 };
  328. static const unsigned int sdcard_d3_z_pins[] = { GPIOZ_3 };
  329. static const unsigned int sdcard_clk_z_pins[] = { GPIOZ_4 };
  330. static const unsigned int sdcard_cmd_z_pins[] = { GPIOZ_5 };
  331. static const unsigned int uart_e_tx_z8_pins[] = { GPIOZ_8 };
  332. static const unsigned int uart_e_rx_z9_pins[] = { GPIOZ_9 };
  333. static const unsigned int pdm_din1_z_pins[] = { GPIOZ_10 };
  334. static const unsigned int pdm_din0_z_pins[] = { GPIOZ_11 };
  335. static const unsigned int pdm_dclk_z_pins[] = { GPIOZ_12 };
  336. /* Bank Z func4 */
  337. static const unsigned int spi_a_miso_z_pins[] = { GPIOZ_0 };
  338. static const unsigned int spi_a_mosi_z_pins[] = { GPIOZ_1 };
  339. static const unsigned int spi_a_clk_z_pins[] = { GPIOZ_2 };
  340. static const unsigned int spi_a_ss0_z_pins[] = { GPIOZ_3 };
  341. static const unsigned int spi_a_ss1_z_pins[] = { GPIOZ_4 };
  342. static const unsigned int spi_a_ss2_z_pins[] = { GPIOZ_5 };
  343. static const unsigned int i2c4_scl_z_pins[] = { GPIOZ_11 };
  344. static const unsigned int i2c4_sda_z_pins[] = { GPIOZ_12 };
  345. /* Bank Z func5 */
  346. static const unsigned int uart_d_tx_z_pins[] = { GPIOZ_0 };
  347. static const unsigned int uart_d_rx_z_pins[] = { GPIOZ_1 };
  348. static const unsigned int uart_d_cts_z_pins[] = { GPIOZ_2 };
  349. static const unsigned int uart_d_rts_z_pins[] = { GPIOZ_3 };
  350. static const unsigned int pwm_g_z_pins[] = { GPIOZ_4 };
  351. static const unsigned int pwm_f_z_pins[] = { GPIOZ_5 };
  352. static const unsigned int pwm_e_z_pins[] = { GPIOZ_6 };
  353. static const unsigned int tsin_b_clk_z_pins[] = { GPIOZ_7 };
  354. static const unsigned int tsin_b_sop_z_pins[] = { GPIOZ_10 };
  355. static const unsigned int tsin_b_valid_z_pins[] = { GPIOZ_11 };
  356. static const unsigned int tsin_b_d0_z_pins[] = { GPIOZ_12 };
  357. /* Bank Z func6 */
  358. static const unsigned int s2_demod_gpio7_pins[] = { GPIOZ_0 };
  359. static const unsigned int s2_demod_gpio6_pins[] = { GPIOZ_1 };
  360. static const unsigned int s2_demod_gpio5_pins[] = { GPIOZ_2 };
  361. static const unsigned int s2_demod_gpio4_pins[] = { GPIOZ_3 };
  362. static const unsigned int s2_demod_gpio3_pins[] = { GPIOZ_4 };
  363. static const unsigned int s2_demod_gpio2_pins[] = { GPIOZ_5 };
  364. static const unsigned int diseqc_out_pins[] = { GPIOZ_7 };
  365. static const unsigned int s2_demod_gpio1_pins[] = { GPIOZ_8 };
  366. static const unsigned int s2_demod_gpio0_pins[] = { GPIOZ_12 };
  367. /* Bank Z func7 */
  368. static const unsigned int gen_clk_z9_pins[] = { GPIOZ_9 };
  369. static const unsigned int gen_clk_z12_pins[] = { GPIOZ_12 };
  370. static struct meson_pmx_group meson_s4_periphs_groups[] = {
  371. GPIO_GROUP(GPIOE_0),
  372. GPIO_GROUP(GPIOE_1),
  373. GPIO_GROUP(GPIOB_0),
  374. GPIO_GROUP(GPIOB_1),
  375. GPIO_GROUP(GPIOB_2),
  376. GPIO_GROUP(GPIOB_3),
  377. GPIO_GROUP(GPIOB_4),
  378. GPIO_GROUP(GPIOB_5),
  379. GPIO_GROUP(GPIOB_6),
  380. GPIO_GROUP(GPIOB_7),
  381. GPIO_GROUP(GPIOB_8),
  382. GPIO_GROUP(GPIOB_9),
  383. GPIO_GROUP(GPIOB_10),
  384. GPIO_GROUP(GPIOB_11),
  385. GPIO_GROUP(GPIOB_12),
  386. GPIO_GROUP(GPIOB_13),
  387. GPIO_GROUP(GPIOC_0),
  388. GPIO_GROUP(GPIOC_1),
  389. GPIO_GROUP(GPIOC_2),
  390. GPIO_GROUP(GPIOC_3),
  391. GPIO_GROUP(GPIOC_4),
  392. GPIO_GROUP(GPIOC_5),
  393. GPIO_GROUP(GPIOC_6),
  394. GPIO_GROUP(GPIOC_7),
  395. GPIO_GROUP(GPIOD_0),
  396. GPIO_GROUP(GPIOD_1),
  397. GPIO_GROUP(GPIOD_2),
  398. GPIO_GROUP(GPIOD_3),
  399. GPIO_GROUP(GPIOD_4),
  400. GPIO_GROUP(GPIOD_5),
  401. GPIO_GROUP(GPIOD_6),
  402. GPIO_GROUP(GPIOD_7),
  403. GPIO_GROUP(GPIOD_8),
  404. GPIO_GROUP(GPIOD_9),
  405. GPIO_GROUP(GPIOD_10),
  406. GPIO_GROUP(GPIOD_11),
  407. GPIO_GROUP(GPIOH_0),
  408. GPIO_GROUP(GPIOH_1),
  409. GPIO_GROUP(GPIOH_2),
  410. GPIO_GROUP(GPIOH_3),
  411. GPIO_GROUP(GPIOH_4),
  412. GPIO_GROUP(GPIOH_5),
  413. GPIO_GROUP(GPIOH_6),
  414. GPIO_GROUP(GPIOH_7),
  415. GPIO_GROUP(GPIOH_8),
  416. GPIO_GROUP(GPIOH_9),
  417. GPIO_GROUP(GPIOH_10),
  418. GPIO_GROUP(GPIOH_11),
  419. GPIO_GROUP(GPIOX_0),
  420. GPIO_GROUP(GPIOX_1),
  421. GPIO_GROUP(GPIOX_2),
  422. GPIO_GROUP(GPIOX_3),
  423. GPIO_GROUP(GPIOX_4),
  424. GPIO_GROUP(GPIOX_5),
  425. GPIO_GROUP(GPIOX_6),
  426. GPIO_GROUP(GPIOX_7),
  427. GPIO_GROUP(GPIOX_8),
  428. GPIO_GROUP(GPIOX_9),
  429. GPIO_GROUP(GPIOX_10),
  430. GPIO_GROUP(GPIOX_11),
  431. GPIO_GROUP(GPIOX_12),
  432. GPIO_GROUP(GPIOX_13),
  433. GPIO_GROUP(GPIOX_14),
  434. GPIO_GROUP(GPIOX_15),
  435. GPIO_GROUP(GPIOX_16),
  436. GPIO_GROUP(GPIOX_17),
  437. GPIO_GROUP(GPIOX_18),
  438. GPIO_GROUP(GPIOX_19),
  439. GPIO_GROUP(GPIOZ_0),
  440. GPIO_GROUP(GPIOZ_1),
  441. GPIO_GROUP(GPIOZ_2),
  442. GPIO_GROUP(GPIOZ_3),
  443. GPIO_GROUP(GPIOZ_4),
  444. GPIO_GROUP(GPIOZ_5),
  445. GPIO_GROUP(GPIOZ_6),
  446. GPIO_GROUP(GPIOZ_7),
  447. GPIO_GROUP(GPIOZ_8),
  448. GPIO_GROUP(GPIOZ_9),
  449. GPIO_GROUP(GPIOZ_10),
  450. GPIO_GROUP(GPIOZ_11),
  451. GPIO_GROUP(GPIOZ_12),
  452. GPIO_GROUP(GPIO_TEST_N),
  453. /* BANK E func1 */
  454. GROUP(i2c0_sda, 1),
  455. GROUP(i2c0_scl, 1),
  456. /* BANK E func2 */
  457. GROUP(uart_b_tx_e, 2),
  458. GROUP(uart_b_rx_e, 2),
  459. /* BANK E func3 */
  460. GROUP(pwm_h, 3),
  461. GROUP(pwm_j, 3),
  462. /* BANK B func1 */
  463. GROUP(emmc_nand_d0, 1),
  464. GROUP(emmc_nand_d1, 1),
  465. GROUP(emmc_nand_d2, 1),
  466. GROUP(emmc_nand_d3, 1),
  467. GROUP(emmc_nand_d4, 1),
  468. GROUP(emmc_nand_d5, 1),
  469. GROUP(emmc_nand_d6, 1),
  470. GROUP(emmc_nand_d7, 1),
  471. GROUP(emmc_clk, 1),
  472. GROUP(emmc_rst, 1),
  473. GROUP(emmc_cmd, 1),
  474. GROUP(emmc_nand_ds, 1),
  475. /* Bank B func2 */
  476. GROUP(nand_wen_clk, 2),
  477. GROUP(nand_ale, 2),
  478. GROUP(nand_ren_wr, 2),
  479. GROUP(nand_cle, 2),
  480. GROUP(nand_ce0, 2),
  481. /* Bank B func3 */
  482. GROUP(spif_hold, 3),
  483. GROUP(spif_mo, 3),
  484. GROUP(spif_mi, 3),
  485. GROUP(spif_clk, 3),
  486. GROUP(spif_wp, 3),
  487. GROUP(spif_cs, 3),
  488. /* Bank C func1 */
  489. GROUP(sdcard_d0_c, 1),
  490. GROUP(sdcard_d1_c, 1),
  491. GROUP(sdcard_d2_c, 1),
  492. GROUP(sdcard_d3_c, 1),
  493. GROUP(sdcard_clk_c, 1),
  494. GROUP(sdcard_cmd_c, 1),
  495. GROUP(sdcard_cd, 1),
  496. /* Bank C func2 */
  497. GROUP(jtag_2_tdo, 2),
  498. GROUP(jtag_2_tdi, 2),
  499. GROUP(uart_b_rx_c, 2),
  500. GROUP(uart_b_tx_c, 2),
  501. GROUP(jtag_2_clk, 2),
  502. GROUP(jtag_2_tms, 2),
  503. GROUP(i2c1_sda_c, 2),
  504. GROUP(i2c1_scl_c, 2),
  505. /* Bank C func3 */
  506. GROUP(pdm_din1_c, 3),
  507. GROUP(pdm_din0_c, 3),
  508. GROUP(i2c4_sda_c, 3),
  509. GROUP(i2c4_scl_c, 3),
  510. GROUP(pdm_dclk_c, 3),
  511. GROUP(iso7816_clk_c, 3),
  512. GROUP(iso7816_data_c, 3),
  513. /* Bank C func4 */
  514. GROUP(tdm_d2_c, 4),
  515. GROUP(tdm_d3_c, 4),
  516. GROUP(tdm_fs1_c, 4),
  517. GROUP(tdm_sclk1_c, 4),
  518. GROUP(mclk_1_c, 4),
  519. GROUP(tdm_d4_c, 4),
  520. GROUP(tdm_d5_c, 4),
  521. /* Bank D func1 */
  522. GROUP(uart_b_tx_d, 1),
  523. GROUP(uart_b_rx_d, 1),
  524. GROUP(uart_b_cts_d, 1),
  525. GROUP(uart_b_rts_d, 1),
  526. GROUP(remote_out, 1),
  527. GROUP(remote_in, 1),
  528. GROUP(jtag_1_clk, 1),
  529. GROUP(jtag_1_tms, 1),
  530. GROUP(jtag_1_tdi, 1),
  531. GROUP(jtag_1_tdo, 1),
  532. GROUP(clk12_24, 1),
  533. GROUP(pwm_g_hiz, 1),
  534. /* Bank D func2 */
  535. GROUP(i2c4_sda_d, 2),
  536. GROUP(i2c4_scl_d, 2),
  537. GROUP(mclk_1_d, 2),
  538. GROUP(tdm_sclk1_d, 2),
  539. GROUP(tdm_fs1_d, 2),
  540. GROUP(tdm_d4_d, 2),
  541. GROUP(tdm_d3_d, 2),
  542. GROUP(tdm_d2_d, 2),
  543. GROUP(pwm_g_d, 2),
  544. /* Bank D func3 */
  545. GROUP(uart_c_tx, 3),
  546. GROUP(uart_c_rx, 3),
  547. GROUP(pwm_b_d, 3),
  548. GROUP(pwm_a_d, 3),
  549. GROUP(pwm_c_d, 3),
  550. GROUP(pwm_d_d, 3),
  551. GROUP(pwm_i_d, 3),
  552. /* Bank D func4 */
  553. GROUP(clk_32k_in, 4),
  554. GROUP(pwm_b_hiz, 4),
  555. GROUP(pwm_a_hiz, 4),
  556. GROUP(pwm_c_hiz, 4),
  557. GROUP(pdm_dclk_d, 4),
  558. GROUP(pdm_din0_d, 4),
  559. GROUP(pdm_din1_d, 4),
  560. /* Bank D func5 */
  561. GROUP(mic_mute_en, 5),
  562. GROUP(mic_mute_key, 5),
  563. GROUP(i2c1_sda_d, 5),
  564. GROUP(i2c1_scl_d, 5),
  565. GROUP(i2c2_sda_d, 5),
  566. GROUP(i2c2_scl_d, 5),
  567. /* Bank D func6 */
  568. GROUP(gen_clk_d, 6),
  569. GROUP(tsin_b_clk_c, 6),
  570. GROUP(tsin_b_sop_c, 6),
  571. GROUP(tsin_b_valid_c, 6),
  572. GROUP(tsin_b_d0_c, 6),
  573. /* Bank H func1 */
  574. GROUP(hdmitx_sda, 1),
  575. GROUP(hdmitx_sck, 1),
  576. GROUP(hdmitx_hpd_in, 1),
  577. GROUP(ao_cec_a, 1),
  578. GROUP(spdif_out_h, 1),
  579. GROUP(spdif_in, 1),
  580. GROUP(i2c1_sda_h, 1),
  581. GROUP(i2c1_scl_h, 1),
  582. GROUP(i2c2_sda_h8, 1),
  583. GROUP(i2c2_scl_h9, 1),
  584. GROUP(eth_link_led, 1),
  585. GROUP(eth_act_led, 1),
  586. /* Bank H func2 */
  587. GROUP(i2c2_sda_h0, 2),
  588. GROUP(i2c2_scl_h1, 2),
  589. GROUP(ao_cec_b, 2),
  590. GROUP(uart_d_tx_h, 2),
  591. GROUP(uart_d_rx_h, 2),
  592. GROUP(uart_d_cts_h, 2),
  593. GROUP(uart_d_rts_h, 2),
  594. GROUP(iso7816_clk_h, 2),
  595. GROUP(iso7816_data_h, 2),
  596. GROUP(uart_e_tx_h, 2),
  597. GROUP(uart_e_rx_h, 2),
  598. /* Bank H func3 */
  599. GROUP(pwm_d_h, 3),
  600. GROUP(pwm_i_h, 3),
  601. GROUP(pdm_dclk_h, 3),
  602. GROUP(pdm_din0_h, 3),
  603. GROUP(pdm_din1_h, 3),
  604. /* Bank H func4 */
  605. GROUP(mclk_1_h, 4),
  606. GROUP(tdm_sclk1_h, 4),
  607. GROUP(tdm_fs1_h, 4),
  608. GROUP(tdm_d2_h, 4),
  609. GROUP(tdm_d3_h, 4),
  610. GROUP(tdm_d4_h, 4),
  611. /* Bank H func5 */
  612. GROUP(spi_a_miso_h, 5),
  613. GROUP(spi_a_mosi_h, 5),
  614. GROUP(spi_a_clk_h, 5),
  615. GROUP(spi_a_ss0_h, 5),
  616. /* Bank H func6 */
  617. GROUP(gen_clk_h, 6),
  618. GROUP(tsin_b1_clk, 6),
  619. GROUP(tsin_b1_sop, 6),
  620. GROUP(tsin_b1_valid, 6),
  621. GROUP(tsin_b1_d0, 6),
  622. /* Bank X func1 */
  623. GROUP(sdio_d0, 1),
  624. GROUP(sdio_d1, 1),
  625. GROUP(sdio_d2, 1),
  626. GROUP(sdio_d3, 1),
  627. GROUP(sdio_clk, 1),
  628. GROUP(sdio_cmd, 1),
  629. GROUP(pwm_a_x, 1),
  630. GROUP(pwm_f_x, 1),
  631. GROUP(tdm_d1, 1),
  632. GROUP(tdm_d0, 1),
  633. GROUP(tdm_fs0, 1),
  634. GROUP(tdm_sclk0, 1),
  635. GROUP(uart_a_tx, 1),
  636. GROUP(uart_a_rx, 1),
  637. GROUP(uart_a_cts, 1),
  638. GROUP(uart_a_rts, 1),
  639. GROUP(pwm_e_x, 1),
  640. GROUP(i2c1_sda_x, 1),
  641. GROUP(i2c1_scl_x, 1),
  642. GROUP(pwm_b_x, 1),
  643. /* Bank X func2 */
  644. GROUP(pdm_din0_x, 2),
  645. GROUP(pdm_din1_x, 2),
  646. GROUP(pdm_dclk_x, 2),
  647. /* Bank X func3 */
  648. GROUP(spi_a_mosi_x, 3),
  649. GROUP(spi_a_miso_x, 3),
  650. GROUP(spi_a_ss0_x, 3),
  651. GROUP(spi_a_clk_x, 3),
  652. /* Bank X func4 */
  653. GROUP(pwm_c_x, 4),
  654. GROUP(i2c_slave_scl, 4),
  655. GROUP(i2c_slave_sda, 4),
  656. /* Bank X func5 */
  657. GROUP(i2c3_sda_x, 5),
  658. GROUP(i2c3_scl_x, 5),
  659. /* Bank Z func1 */
  660. GROUP(tdm_fs2, 1),
  661. GROUP(tdm_sclk2, 1),
  662. GROUP(tdm_d4_z, 1),
  663. GROUP(tdm_d5_z, 1),
  664. GROUP(tdm_d6, 1),
  665. GROUP(tdm_d7, 1),
  666. GROUP(mclk_2, 1),
  667. GROUP(spdif_out_z, 1),
  668. GROUP(dtv_a_if_agc_z10, 1),
  669. GROUP(uart_e_tx_z11, 1),
  670. GROUP(uart_e_rx_z12, 1),
  671. /* Bank Z func2 */
  672. GROUP(tsin_a_clk, 2),
  673. GROUP(tsin_a_sop, 2),
  674. GROUP(tsin_a_valid, 2),
  675. GROUP(tsin_a_din0, 2),
  676. GROUP(dtv_a_if_agc_z6, 2),
  677. GROUP(dtv_b_if_agc, 2),
  678. GROUP(i2c3_sda_z, 2),
  679. GROUP(i2c3_scl_z, 2),
  680. GROUP(dtv_a_rf_agc, 2),
  681. GROUP(dtv_b_rf_agc, 2),
  682. /* Bank Z func3 */
  683. GROUP(sdcard_d0_z, 3),
  684. GROUP(sdcard_d1_z, 3),
  685. GROUP(sdcard_d2_z, 3),
  686. GROUP(sdcard_d3_z, 3),
  687. GROUP(sdcard_clk_z, 3),
  688. GROUP(sdcard_cmd_z, 3),
  689. GROUP(uart_e_tx_z8, 3),
  690. GROUP(uart_e_rx_z9, 3),
  691. GROUP(pdm_din1_z, 3),
  692. GROUP(pdm_din0_z, 3),
  693. GROUP(pdm_dclk_z, 3),
  694. /* Bank Z func4 */
  695. GROUP(spi_a_miso_z, 4),
  696. GROUP(spi_a_mosi_z, 4),
  697. GROUP(spi_a_clk_z, 4),
  698. GROUP(spi_a_ss0_z, 4),
  699. GROUP(spi_a_ss1_z, 4),
  700. GROUP(spi_a_ss2_z, 4),
  701. GROUP(i2c4_scl_z, 4),
  702. GROUP(i2c4_sda_z, 4),
  703. /* Bank Z func5 */
  704. GROUP(uart_d_tx_z, 5),
  705. GROUP(uart_d_rx_z, 5),
  706. GROUP(uart_d_cts_z, 5),
  707. GROUP(uart_d_rts_z, 5),
  708. GROUP(pwm_g_z, 5),
  709. GROUP(pwm_f_z, 5),
  710. GROUP(pwm_e_z, 5),
  711. GROUP(tsin_b_clk_z, 5),
  712. GROUP(tsin_b_sop_z, 5),
  713. GROUP(tsin_b_valid_z, 5),
  714. GROUP(tsin_b_d0_z, 5),
  715. /* Bank Z func6 */
  716. GROUP(s2_demod_gpio7, 6),
  717. GROUP(s2_demod_gpio6, 6),
  718. GROUP(s2_demod_gpio5, 6),
  719. GROUP(s2_demod_gpio4, 6),
  720. GROUP(s2_demod_gpio3, 6),
  721. GROUP(s2_demod_gpio2, 6),
  722. GROUP(diseqc_out, 6),
  723. GROUP(s2_demod_gpio1, 6),
  724. GROUP(s2_demod_gpio0, 6),
  725. /* Bank Z func7 */
  726. GROUP(gen_clk_z9, 7),
  727. GROUP(gen_clk_z12, 7),
  728. };
  729. static const char * const gpio_periphs_groups[] = {
  730. "GPIOE_0", "GPIOE_1",
  731. "GPIOB_0", "GPIOB_1", "GPIOB_2", "GPIOB_3", "GPIOB_4", "GPIOB_5",
  732. "GPIOB_6", "GPIOB_7", "GPIOB_8", "GPIOB_9", "GPIOB_10", "GPIOB_11",
  733. "GPIOB_12", "GPIOB_13",
  734. "GPIOC_0", "GPIOC_1", "GPIOC_2", "GPIOC_3", "GPIOC_4", "GPIOC_5",
  735. "GPIOC_6", "GPIOC_7",
  736. "GPIOD_0", "GPIOD_1", "GPIOD_2", "GPIOD_3", "GPIOD_4", "GPIOD_5",
  737. "GPIOD_6", "GPIOD_7", "GPIOD_8", "GPIOD_9", "GPIOD_10", "GPIOD_11",
  738. "GPIOH_0", "GPIOH_1", "GPIOH_2", "GPIOH_3", "GPIOH_4", "GPIOH_5",
  739. "GPIOH_6", "GPIOH_7", "GPIOH_8", "GPIOH_9", "GPIOH_10", "GPIOH_11",
  740. "GPIOX_0", "GPIOX_1", "GPIOX_2", "GPIOX_3", "GPIOX_4", "GPIOX_5",
  741. "GPIOX_6", "GPIOX_7", "GPIOX_8", "GPIOX_9", "GPIOX_10", "GPIOX_11",
  742. "GPIOX_12", "GPIOX_13", "GPIOX_14", "GPIOX_15", "GPIOX_16", "GPIOX_17",
  743. "GPIOX_18", "GPIOX_19",
  744. "GPIOZ_0", "GPIOZ_1", "GPIOZ_2", "GPIOZ_3", "GPIOZ_4", "GPIOZ_5",
  745. "GPIOZ_6", "GPIOZ_7", "GPIOZ_8", "GPIOZ_9", "GPIOZ_10",
  746. "GPIOZ_11", "GPIOZ_12",
  747. "GPIO_TEST_N",
  748. };
  749. static const char * const i2c0_groups[] = {
  750. "i2c0_sda", "i2c0_scl",
  751. };
  752. static const char * const i2c1_groups[] = {
  753. "i2c1_sda_c", "i2c1_scl_c",
  754. "i2c1_sda_d", "i2c1_scl_d",
  755. "i2c1_sda_h", "i2c1_scl_h",
  756. "i2c1_sda_x", "i2c1_scl_x",
  757. };
  758. static const char * const i2c2_groups[] = {
  759. "i2c2_sda_d", "i2c2_scl_d",
  760. "i2c2_sda_h8", "i2c2_scl_h9",
  761. "i2c2_sda_h0", "i2c2_scl_h1l,"
  762. };
  763. static const char * const i2c3_groups[] = {
  764. "i2c3_sda_x", "i2c3_scl_x",
  765. "i2c3_sda_z", "i2c3_scl_z",
  766. };
  767. static const char * const i2c4_groups[] = {
  768. "i2c4_sda_c", "i2c4_scl_c",
  769. "i2c4_sda_d", "i2c4_scl_d",
  770. "i2c4_scl_z", "i2c4_sda_z",
  771. };
  772. static const char * const uart_a_groups[] = {
  773. "uart_a_tx", "uart_a_rx", "uart_a_cts", "uart_a_rts",
  774. };
  775. static const char * const uart_b_groups[] = {
  776. "uart_b_tx_e", "uart_b_rx_e", "uart_b_rx_c", "uart_b_tx_c",
  777. "uart_b_tx_d", "uart_b_rx_d", "uart_b_cts_d", "uart_b_rts_d",
  778. };
  779. static const char * const uart_c_groups[] = {
  780. "uart_c_tx", "uart_c_rx",
  781. };
  782. static const char * const uart_d_groups[] = {
  783. "uart_d_tx_h", "uart_d_rx_h", "uart_d_cts_h", "uart_d_rts_h",
  784. "uart_d_tx_z", "uart_d_rx_z", "uart_d_cts_z", "uart_d_rts_z",
  785. };
  786. static const char * const uart_e_groups[] = {
  787. "uart_e_tx_h", "uart_e_rx_h", "uart_e_tx_z11", "uart_e_rx_z12",
  788. "uart_e_tx_z8", "uart_e_rx_z9",
  789. };
  790. static const char * const emmc_groups[] = {
  791. "emmc_nand_d0", "emmc_nand_d1", "emmc_nand_d2", "emmc_nand_d3",
  792. "emmc_nand_d4", "emmc_nand_d5", "emmc_nand_d6", "emmc_nand_d7",
  793. "emmc_clk", "emmc_rst", "emmc_cmd", "emmc_nand_ds",
  794. };
  795. static const char * const nand_groups[] = {
  796. "emmc_nand_d0", "emmc_nand_d1", "emmc_nand_d2", "emmc_nand_d3",
  797. "emmc_nand_d4", "emmc_nand_d5", "emmc_nand_d6", "emmc_nand_d7",
  798. "nand_wen_clk", "nand_ale", "nand_ren_wr", "nand_cle", "nand_ce0",
  799. };
  800. static const char * const spif_groups[] = {
  801. "spif_hold", "spif_mo", "spif_mi", "spif_clk", "spif_wp",
  802. "spif_cs",
  803. };
  804. static const char * const sdcard_groups[] = {
  805. "sdcard_d0_c", "sdcard_d1_c", "sdcard_d2_c", "sdcard_d3_c",
  806. "sdcard_clk_c", "sdcard_cmd_c", "sdcard_cd",
  807. "sdcard_d0_z", "sdcard_d1_z", "sdcard_d2_z", "sdcard_d3_z",
  808. "sdcard_clk_z", "sdcard_cmd_z",
  809. };
  810. static const char * const jtag_1_groups[] = {
  811. "jtag_1_clk", "jtag_1_tms", "jtag_1_tdi", "jtag_1_tdo",
  812. };
  813. static const char * const jtag_2_groups[] = {
  814. "jtag_2_tdo", "jtag_2_tdi", "jtag_2_clk", "jtag_2_tms",
  815. };
  816. static const char * const pdm_groups[] = {
  817. "pdm_din1_c", "pdm_din0_c", "pdm_dclk_c",
  818. "pdm_dclk_d", "pdm_din0_d", "pdm_din1_d",
  819. "pdm_dclk_h", "pdm_din0_h", "pdm_din1_h",
  820. "pdm_din0_x", "pdm_din1_x", "pdm_dclk_x",
  821. "pdm_din1_z", "pdm_din0_z", "pdm_dclk_z",
  822. };
  823. static const char * const iso7816_groups[] = {
  824. "iso7816_clk_c", "iso7816_data_c",
  825. "iso7816_clk_h", "iso7816_data_h",
  826. };
  827. static const char * const tdm_groups[] = {
  828. "tdm_d2_c", "tdm_d3_c", "tdm_fs1_c", "tdm_d4_c", "tdm_d5_c", "tdm_sclk1_c",
  829. "tdm_fs1_d", "tdm_d4_d", "tdm_d3_d", "tdm_d2_d", "tdm_sclk1_d",
  830. "tdm_sclk1_h", "tdm_fs1_h", "tdm_d2_h", "tdm_d3_h", "tdm_d4_h",
  831. "tdm_d1", "tdm_d0", "tdm_fs0", "tdm_sclk0", "tdm_fs2", "tdm_sclk2",
  832. "tdm_d4_z", "tdm_d5_z", "tdm_d6", "tdm_d7",
  833. };
  834. static const char * const mclk_1_groups[] = {
  835. "mclk_1_c", "mclk_1_d", "mclk_1_h", "mclk_2",
  836. };
  837. static const char * const mclk_2_groups[] = {
  838. "mclk_2",
  839. };
  840. static const char * const remote_out_groups[] = {
  841. "remote_out",
  842. };
  843. static const char * const remote_in_groups[] = {
  844. "remote_in",
  845. };
  846. static const char * const clk12_24_groups[] = {
  847. "clk12_24",
  848. };
  849. static const char * const clk_32k_in_groups[] = {
  850. "clk_32k_in",
  851. };
  852. static const char * const pwm_a_hiz_groups[] = {
  853. "pwm_a_hiz",
  854. };
  855. static const char * const pwm_b_hiz_groups[] = {
  856. "pwm_b_hiz",
  857. };
  858. static const char * const pwm_c_hiz_groups[] = {
  859. "pwm_c_hiz",
  860. };
  861. static const char * const pwm_g_hiz_groups[] = {
  862. "pwm_g_hiz",
  863. };
  864. static const char * const pwm_a_groups[] = {
  865. "pwm_a_d",
  866. };
  867. static const char * const pwm_b_groups[] = {
  868. "pwm_b_d", "pwm_b_x",
  869. };
  870. static const char * const pwm_c_groups[] = {
  871. "pwm_c_d", "pwm_c_x",
  872. };
  873. static const char * const pwm_d_groups[] = {
  874. "pwm_d_d", "pwm_d_h",
  875. };
  876. static const char * const pwm_e_groups[] = {
  877. "pwm_e_x", "pwm_e_z",
  878. };
  879. static const char * const pwm_f_groups[] = {
  880. "pwm_f_x", "pwm_f_z",
  881. };
  882. static const char * const pwm_g_groups[] = {
  883. "pwm_g_d", "pwm_g_z",
  884. };
  885. static const char * const pwm_h_groups[] = {
  886. "pwm_h",
  887. };
  888. static const char * const pwm_i_groups[] = {
  889. "pwm_i_d", "pwm_i_h"
  890. };
  891. static const char * const pwm_j_groups[] = {
  892. "pwm_j",
  893. };
  894. static const char * const mic_mute_groups[] = {
  895. "mic_mute_en", "mic_mute_key",
  896. };
  897. static const char * const hdmitx_groups[] = {
  898. "hdmitx_sda", "hdmitx_sck", "hdmitx_hpd_in",
  899. };
  900. static const char * const ao_cec_a_groups[] = {
  901. "ao_cec_a",
  902. };
  903. static const char * const ao_cec_b_groups[] = {
  904. "ao_cec_b",
  905. };
  906. static const char * const spdif_out_groups[] = {
  907. "spdif_out_h", "spdif_out_z",
  908. };
  909. static const char * const spdif_in_groups[] = {
  910. "spdif_in",
  911. };
  912. static const char * const eth_groups[] = {
  913. "eth_link_led", "eth_act_led",
  914. };
  915. static const char * const spi_a_groups[] = {
  916. "spi_a_miso_h", "spi_a_mosi_h", "spi_a_clk_h", "spi_a_ss0_h",
  917. "spi_a_mosi_x", "spi_a_miso_x", "spi_a_ss0_x", "spi_a_clk_x",
  918. "spi_a_miso_z", "spi_a_mosi_z", "spi_a_clk_z", "spi_a_ss0_z",
  919. "spi_a_ss1_z", "spi_a_ss2_z",
  920. };
  921. static const char * const gen_clk_groups[] = {
  922. "gen_clk_h", "gen_clk_z9", "gen_clk_z12",
  923. };
  924. static const char * const sdio_groups[] = {
  925. "sdio_d0", "sdio_d1", "sdio_d2", "sdio_d3", "sdio_clk", "sdio_cmd",
  926. };
  927. static const char * const i2c_slave_groups[] = {
  928. "i2c_slave_scl", "i2c_slave_sda",
  929. };
  930. static const char * const dtv_groups[] = {
  931. "dtv_a_if_agc_z10", "dtv_a_if_agc_z6", "dtv_b_if_agc",
  932. "dtv_a_rf_agc", "dtv_b_rf_agc",
  933. };
  934. static const char * const tsin_a_groups[] = {
  935. "tsin_a_clk", "tsin_a_sop", "tsin_a_valid", "tsin_a_din0",
  936. };
  937. static const char * const tsin_b_groups[] = {
  938. "tsin_b_clk_c", "tsin_b_sop_c", "tsin_b_valid_c", "tsin_b_d0_c",
  939. "tsin_b_clk_z", "tsin_b_sop_z", "tsin_b_valid_z", "tsin_b_d0_z",
  940. };
  941. static const char * const tsin_b1_groups[] = {
  942. "tsin_b1_clk", "tsin_b1_sop", "tsin_b1_valid", "tsin_b1_d0",
  943. };
  944. static const char * const diseqc_out_groups[] = {
  945. "diseqc_out",
  946. };
  947. static const char * const s2_demod_groups[] = {
  948. "s2_demod_gpio7", "s2_demod_gpio6", "s2_demod_gpio5", "s2_demod_gpio4",
  949. "s2_demod_gpio3", "s2_demod_gpio2", "s2_demod_gpio1", "s2_demod_gpio0",
  950. };
  951. static struct meson_pmx_func meson_s4_periphs_functions[] = {
  952. FUNCTION(gpio_periphs),
  953. FUNCTION(i2c0),
  954. FUNCTION(i2c1),
  955. FUNCTION(i2c2),
  956. FUNCTION(i2c3),
  957. FUNCTION(i2c4),
  958. FUNCTION(uart_a),
  959. FUNCTION(uart_b),
  960. FUNCTION(uart_c),
  961. FUNCTION(uart_d),
  962. FUNCTION(uart_e),
  963. FUNCTION(emmc),
  964. FUNCTION(nand),
  965. FUNCTION(spif),
  966. FUNCTION(sdcard),
  967. FUNCTION(jtag_1),
  968. FUNCTION(jtag_2),
  969. FUNCTION(pdm),
  970. FUNCTION(iso7816),
  971. FUNCTION(tdm),
  972. FUNCTION(mclk_1),
  973. FUNCTION(mclk_2),
  974. FUNCTION(remote_out),
  975. FUNCTION(remote_in),
  976. FUNCTION(clk12_24),
  977. FUNCTION(clk_32k_in),
  978. FUNCTION(pwm_a_hiz),
  979. FUNCTION(pwm_b_hiz),
  980. FUNCTION(pwm_c_hiz),
  981. FUNCTION(pwm_g_hiz),
  982. FUNCTION(pwm_a),
  983. FUNCTION(pwm_b),
  984. FUNCTION(pwm_c),
  985. FUNCTION(pwm_d),
  986. FUNCTION(pwm_e),
  987. FUNCTION(pwm_f),
  988. FUNCTION(pwm_g),
  989. FUNCTION(pwm_h),
  990. FUNCTION(pwm_i),
  991. FUNCTION(pwm_j),
  992. FUNCTION(mic_mute),
  993. FUNCTION(hdmitx),
  994. FUNCTION(ao_cec_a),
  995. FUNCTION(ao_cec_b),
  996. FUNCTION(spdif_out),
  997. FUNCTION(spdif_in),
  998. FUNCTION(eth),
  999. FUNCTION(spi_a),
  1000. FUNCTION(gen_clk),
  1001. FUNCTION(sdio),
  1002. FUNCTION(i2c_slave),
  1003. FUNCTION(dtv),
  1004. FUNCTION(tsin_a),
  1005. FUNCTION(tsin_b),
  1006. FUNCTION(tsin_b1),
  1007. FUNCTION(diseqc_out),
  1008. FUNCTION(s2_demod),
  1009. };
  1010. static struct meson_bank meson_s4_periphs_banks[] = {
  1011. /* name first last irq pullen pull dir out in */
  1012. BANK_DS("B", GPIOB_0, GPIOB_13, 0, 13,
  1013. 0x63, 0, 0x64, 0, 0x62, 0, 0x61, 0, 0x60, 0, 0x67, 0),
  1014. BANK_DS("C", GPIOC_0, GPIOC_7, 14, 21,
  1015. 0x53, 0, 0x54, 0, 0x52, 0, 0x51, 0, 0x50, 0, 0x57, 0),
  1016. BANK_DS("E", GPIOE_0, GPIOE_1, 22, 23,
  1017. 0x43, 0, 0x44, 0, 0x42, 0, 0x41, 0, 0x40, 0, 0x47, 0),
  1018. BANK_DS("D", GPIOD_0, GPIOD_11, 24, 35,
  1019. 0x33, 0, 0x34, 0, 0x32, 0, 0x31, 0, 0x30, 0, 0x37, 0),
  1020. BANK_DS("H", GPIOH_0, GPIOH_11, 36, 47,
  1021. 0x23, 0, 0x24, 0, 0x22, 0, 0x21, 0, 0x20, 0, 0x27, 0),
  1022. BANK_DS("X", GPIOX_0, GPIOX_19, 48, 67,
  1023. 0x13, 0, 0x14, 0, 0x12, 0, 0x11, 0, 0x10, 0, 0x17, 0),
  1024. BANK_DS("Z", GPIOZ_0, GPIOZ_12, 68, 80,
  1025. 0x03, 0, 0x04, 0, 0x02, 0, 0x01, 0, 0x00, 0, 0x07, 0),
  1026. BANK_DS("TEST_N", GPIO_TEST_N, GPIO_TEST_N, -1, -1,
  1027. 0x83, 0, 0x84, 0, 0x82, 0, 0x81, 0, 0x80, 0, 0x87, 0),
  1028. };
  1029. static struct meson_pmx_bank meson_s4_periphs_pmx_banks[] = {
  1030. /*name first lask reg offset*/
  1031. BANK_PMX("B", GPIOB_0, GPIOB_13, 0x00, 0),
  1032. BANK_PMX("C", GPIOC_0, GPIOC_7, 0x9, 0),
  1033. BANK_PMX("E", GPIOE_0, GPIOE_1, 0x12, 0),
  1034. BANK_PMX("D", GPIOD_0, GPIOD_11, 0x10, 0),
  1035. BANK_PMX("H", GPIOH_0, GPIOH_11, 0xb, 0),
  1036. BANK_PMX("X", GPIOX_0, GPIOX_19, 0x3, 0),
  1037. BANK_PMX("Z", GPIOZ_0, GPIOZ_12, 0x6, 0),
  1038. BANK_PMX("TEST_N", GPIO_TEST_N, GPIO_TEST_N, 0xf, 0)
  1039. };
  1040. static struct meson_axg_pmx_data meson_s4_periphs_pmx_banks_data = {
  1041. .pmx_banks = meson_s4_periphs_pmx_banks,
  1042. .num_pmx_banks = ARRAY_SIZE(meson_s4_periphs_pmx_banks),
  1043. };
  1044. static struct meson_pinctrl_data meson_s4_periphs_pinctrl_data = {
  1045. .name = "periphs-banks",
  1046. .pins = meson_s4_periphs_pins,
  1047. .groups = meson_s4_periphs_groups,
  1048. .funcs = meson_s4_periphs_functions,
  1049. .banks = meson_s4_periphs_banks,
  1050. .num_pins = ARRAY_SIZE(meson_s4_periphs_pins),
  1051. .num_groups = ARRAY_SIZE(meson_s4_periphs_groups),
  1052. .num_funcs = ARRAY_SIZE(meson_s4_periphs_functions),
  1053. .num_banks = ARRAY_SIZE(meson_s4_periphs_banks),
  1054. .pmx_ops = &meson_axg_pmx_ops,
  1055. .pmx_data = &meson_s4_periphs_pmx_banks_data,
  1056. .parse_dt = &meson_a1_parse_dt_extra,
  1057. };
  1058. static const struct of_device_id meson_s4_pinctrl_dt_match[] = {
  1059. {
  1060. .compatible = "amlogic,meson-s4-periphs-pinctrl",
  1061. .data = &meson_s4_periphs_pinctrl_data,
  1062. },
  1063. { }
  1064. };
  1065. MODULE_DEVICE_TABLE(of, meson_s4_pinctrl_dt_match);
  1066. static struct platform_driver meson_s4_pinctrl_driver = {
  1067. .probe = meson_pinctrl_probe,
  1068. .driver = {
  1069. .name = "meson-s4-pinctrl",
  1070. .of_match_table = meson_s4_pinctrl_dt_match,
  1071. },
  1072. };
  1073. module_platform_driver(meson_s4_pinctrl_driver);
  1074. MODULE_LICENSE("Dual BSD/GPL");