1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
3 * Pin controller and GPIO driver for Amlogic Meson A1 SoC.
5 * Copyright (c) 2019 Amlogic, Inc. All rights reserved.
6 * Author: Qianggui Song <qianggui.song@amlogic.com>
9 #include <dt-bindings/gpio/meson-a1-gpio.h>
10 #include "pinctrl-meson.h"
11 #include "pinctrl-meson-axg-pmx.h"
13 static const struct pinctrl_pin_desc meson_a1_periphs_pins[] = {
79 static const unsigned int psram_clkn_pins[] = { GPIOP_0 };
80 static const unsigned int psram_clkp_pins[] = { GPIOP_1 };
81 static const unsigned int psram_ce_n_pins[] = { GPIOP_2 };
82 static const unsigned int psram_rst_n_pins[] = { GPIOP_3 };
83 static const unsigned int psram_adq0_pins[] = { GPIOP_4 };
84 static const unsigned int psram_adq1_pins[] = { GPIOP_5 };
85 static const unsigned int psram_adq2_pins[] = { GPIOP_6 };
86 static const unsigned int psram_adq3_pins[] = { GPIOP_7 };
87 static const unsigned int psram_adq4_pins[] = { GPIOP_8 };
88 static const unsigned int psram_adq5_pins[] = { GPIOP_9 };
89 static const unsigned int psram_adq6_pins[] = { GPIOP_10 };
90 static const unsigned int psram_adq7_pins[] = { GPIOP_11 };
91 static const unsigned int psram_dqs_dm_pins[] = { GPIOP_12 };
94 static const unsigned int sdcard_d0_b_pins[] = { GPIOB_0 };
95 static const unsigned int sdcard_d1_b_pins[] = { GPIOB_1 };
96 static const unsigned int sdcard_d2_b_pins[] = { GPIOB_2 };
97 static const unsigned int sdcard_d3_b_pins[] = { GPIOB_3 };
98 static const unsigned int sdcard_clk_b_pins[] = { GPIOB_4 };
99 static const unsigned int sdcard_cmd_b_pins[] = { GPIOB_5 };
101 static const unsigned int sdcard_d0_x_pins[] = { GPIOX_0 };
102 static const unsigned int sdcard_d1_x_pins[] = { GPIOX_1 };
103 static const unsigned int sdcard_d2_x_pins[] = { GPIOX_2 };
104 static const unsigned int sdcard_d3_x_pins[] = { GPIOX_3 };
105 static const unsigned int sdcard_clk_x_pins[] = { GPIOX_4 };
106 static const unsigned int sdcard_cmd_x_pins[] = { GPIOX_5 };
109 static const unsigned int spif_mo_pins[] = { GPIOB_0 };
110 static const unsigned int spif_mi_pins[] = { GPIOB_1 };
111 static const unsigned int spif_wp_n_pins[] = { GPIOB_2 };
112 static const unsigned int spif_hold_n_pins[] = { GPIOB_3 };
113 static const unsigned int spif_clk_pins[] = { GPIOB_4 };
114 static const unsigned int spif_cs_pins[] = { GPIOB_5 };
117 static const unsigned int i2c0_sck_f9_pins[] = { GPIOF_9 };
118 static const unsigned int i2c0_sda_f10_pins[] = { GPIOF_10 };
119 static const unsigned int i2c0_sck_f11_pins[] = { GPIOF_11 };
120 static const unsigned int i2c0_sda_f12_pins[] = { GPIOF_12 };
123 static const unsigned int i2c1_sda_x_pins[] = { GPIOX_9 };
124 static const unsigned int i2c1_sck_x_pins[] = { GPIOX_10 };
125 static const unsigned int i2c1_sda_a_pins[] = { GPIOA_10 };
126 static const unsigned int i2c1_sck_a_pins[] = { GPIOA_11 };
129 static const unsigned int i2c2_sck_x0_pins[] = { GPIOX_0 };
130 static const unsigned int i2c2_sda_x1_pins[] = { GPIOX_1 };
131 static const unsigned int i2c2_sck_x15_pins[] = { GPIOX_15 };
132 static const unsigned int i2c2_sda_x16_pins[] = { GPIOX_16 };
133 static const unsigned int i2c2_sck_a4_pins[] = { GPIOA_4 };
134 static const unsigned int i2c2_sda_a5_pins[] = { GPIOA_5 };
135 static const unsigned int i2c2_sck_a8_pins[] = { GPIOA_8 };
136 static const unsigned int i2c2_sda_a9_pins[] = { GPIOA_9 };
139 static const unsigned int i2c3_sck_f_pins[] = { GPIOF_4 };
140 static const unsigned int i2c3_sda_f_pins[] = { GPIOF_5 };
141 static const unsigned int i2c3_sck_x_pins[] = { GPIOX_11 };
142 static const unsigned int i2c3_sda_x_pins[] = { GPIOX_12 };
145 static const unsigned int i2c_slave_sck_a_pins[] = { GPIOA_10 };
146 static const unsigned int i2c_slave_sda_a_pins[] = { GPIOA_11 };
147 static const unsigned int i2c_slave_sck_f_pins[] = { GPIOF_11 };
148 static const unsigned int i2c_slave_sda_f_pins[] = { GPIOF_12 };
151 static const unsigned int uart_a_tx_pins[] = { GPIOX_11 };
152 static const unsigned int uart_a_rx_pins[] = { GPIOX_12 };
153 static const unsigned int uart_a_cts_pins[] = { GPIOX_13 };
154 static const unsigned int uart_a_rts_pins[] = { GPIOX_14 };
157 static const unsigned int uart_b_tx_x_pins[] = { GPIOX_7 };
158 static const unsigned int uart_b_rx_x_pins[] = { GPIOX_8 };
159 static const unsigned int uart_b_tx_f_pins[] = { GPIOF_0 };
160 static const unsigned int uart_b_rx_f_pins[] = { GPIOF_1 };
163 static const unsigned int uart_c_tx_x0_pins[] = { GPIOX_0 };
164 static const unsigned int uart_c_rx_x1_pins[] = { GPIOX_1 };
165 static const unsigned int uart_c_cts_pins[] = { GPIOX_2 };
166 static const unsigned int uart_c_rts_pins[] = { GPIOX_3 };
167 static const unsigned int uart_c_tx_x15_pins[] = { GPIOX_15 };
168 static const unsigned int uart_c_rx_x16_pins[] = { GPIOX_16 };
171 static const unsigned int pwm_a_x6_pins[] = { GPIOX_6 };
172 static const unsigned int pwm_a_x7_pins[] = { GPIOX_7 };
173 static const unsigned int pwm_a_f6_pins[] = { GPIOF_6 };
174 static const unsigned int pwm_a_f10_pins[] = { GPIOF_10 };
175 static const unsigned int pwm_a_a_pins[] = { GPIOA_5 };
178 static const unsigned int pwm_b_x_pins[] = { GPIOX_8 };
179 static const unsigned int pwm_b_f_pins[] = { GPIOF_7 };
180 static const unsigned int pwm_b_a_pins[] = { GPIOA_11 };
183 static const unsigned int pwm_c_x_pins[] = { GPIOX_9 };
184 static const unsigned int pwm_c_f3_pins[] = { GPIOF_3 };
185 static const unsigned int pwm_c_f8_pins[] = { GPIOF_8 };
186 static const unsigned int pwm_c_a_pins[] = { GPIOA_10 };
189 static const unsigned int pwm_d_x10_pins[] = { GPIOX_10 };
190 static const unsigned int pwm_d_x13_pins[] = { GPIOX_13 };
191 static const unsigned int pwm_d_x15_pins[] = { GPIOX_15 };
192 static const unsigned int pwm_d_f_pins[] = { GPIOF_11 };
195 static const unsigned int pwm_e_p_pins[] = { GPIOP_3 };
196 static const unsigned int pwm_e_x2_pins[] = { GPIOX_2 };
197 static const unsigned int pwm_e_x14_pins[] = { GPIOX_14 };
198 static const unsigned int pwm_e_x16_pins[] = { GPIOX_16 };
199 static const unsigned int pwm_e_f_pins[] = { GPIOF_3 };
200 static const unsigned int pwm_e_a_pins[] = { GPIOA_0 };
203 static const unsigned int pwm_f_b_pins[] = { GPIOB_6 };
204 static const unsigned int pwm_f_x_pins[] = { GPIOX_3 };
205 static const unsigned int pwm_f_f4_pins[] = { GPIOF_4 };
206 static const unsigned int pwm_f_f12_pins[] = { GPIOF_12 };
209 static const unsigned int pwm_a_hiz_f8_pins[] = { GPIOF_8 };
210 static const unsigned int pwm_a_hiz_f10_pins[] = { GPIOF_10 };
211 static const unsigned int pmw_a_hiz_f6_pins[] = { GPIOF_6 };
214 static const unsigned int pwm_b_hiz_pins[] = { GPIOF_7 };
217 static const unsigned int pwm_c_hiz_pins[] = { GPIOF_8 };
220 static const unsigned int tdm_a_dout1_pins[] = { GPIOX_7 };
221 static const unsigned int tdm_a_dout0_pins[] = { GPIOX_8 };
222 static const unsigned int tdm_a_fs_pins[] = { GPIOX_9 };
223 static const unsigned int tdm_a_sclk_pins[] = { GPIOX_10 };
224 static const unsigned int tdm_a_din1_pins[] = { GPIOX_7 };
225 static const unsigned int tdm_a_din0_pins[] = { GPIOX_8 };
226 static const unsigned int tdm_a_slv_fs_pins[] = { GPIOX_9 };
227 static const unsigned int tdm_a_slv_sclk_pins[] = { GPIOX_10 };
230 static const unsigned int spi_a_mosi_x2_pins[] = { GPIOX_2 };
231 static const unsigned int spi_a_ss0_x3_pins[] = { GPIOX_3 };
232 static const unsigned int spi_a_sclk_x4_pins[] = { GPIOX_4 };
233 static const unsigned int spi_a_miso_x5_pins[] = { GPIOX_5 };
234 static const unsigned int spi_a_mosi_x7_pins[] = { GPIOX_7 };
235 static const unsigned int spi_a_miso_x8_pins[] = { GPIOX_8 };
236 static const unsigned int spi_a_ss0_x9_pins[] = { GPIOX_9 };
237 static const unsigned int spi_a_sclk_x10_pins[] = { GPIOX_10 };
239 static const unsigned int spi_a_mosi_a_pins[] = { GPIOA_6 };
240 static const unsigned int spi_a_miso_a_pins[] = { GPIOA_7 };
241 static const unsigned int spi_a_ss0_a_pins[] = { GPIOA_8 };
242 static const unsigned int spi_a_sclk_a_pins[] = { GPIOA_9 };
245 static const unsigned int pdm_din0_x_pins[] = { GPIOX_7 };
246 static const unsigned int pdm_din1_x_pins[] = { GPIOX_8 };
247 static const unsigned int pdm_din2_x_pins[] = { GPIOX_9 };
248 static const unsigned int pdm_dclk_x_pins[] = { GPIOX_10 };
250 static const unsigned int pdm_din2_a_pins[] = { GPIOA_6 };
251 static const unsigned int pdm_din1_a_pins[] = { GPIOA_7 };
252 static const unsigned int pdm_din0_a_pins[] = { GPIOA_8 };
253 static const unsigned int pdm_dclk_pins[] = { GPIOA_9 };
256 static const unsigned int gen_clk_x_pins[] = { GPIOX_7 };
257 static const unsigned int gen_clk_f8_pins[] = { GPIOF_8 };
258 static const unsigned int gen_clk_f10_pins[] = { GPIOF_10 };
259 static const unsigned int gen_clk_a_pins[] = { GPIOA_11 };
262 static const unsigned int jtag_a_clk_pins[] = { GPIOF_4 };
263 static const unsigned int jtag_a_tms_pins[] = { GPIOF_5 };
264 static const unsigned int jtag_a_tdi_pins[] = { GPIOF_6 };
265 static const unsigned int jtag_a_tdo_pins[] = { GPIOF_7 };
268 static const unsigned int clk_32k_in_pins[] = { GPIOF_2 };
271 static const unsigned int remote_input_f_pins[] = { GPIOF_3 };
272 static const unsigned int remote_input_a_pins[] = { GPIOA_11 };
275 static const unsigned int remote_out_pins[] = { GPIOF_5 };
278 static const unsigned int spdif_in_f6_pins[] = { GPIOF_6 };
279 static const unsigned int spdif_in_f7_pins[] = { GPIOF_7 };
282 static const unsigned int swclk_pins[] = { GPIOF_4 };
283 static const unsigned int swdio_pins[] = { GPIOF_5 };
286 static const unsigned int clk25_pins[] = { GPIOF_10 };
289 static const unsigned int cec_a_pins[] = { GPIOF_2 };
292 static const unsigned int cec_b_pins[] = { GPIOF_2 };
295 static const unsigned int clk12_24_pins[] = { GPIOF_10 };
298 static const unsigned int mclk_0_pins[] = { GPIOA_0 };
301 static const unsigned int tdm_b_sclk_pins[] = { GPIOA_1 };
302 static const unsigned int tdm_b_fs_pins[] = { GPIOA_2 };
303 static const unsigned int tdm_b_dout0_pins[] = { GPIOA_3 };
304 static const unsigned int tdm_b_dout1_pins[] = { GPIOA_4 };
305 static const unsigned int tdm_b_dout2_pins[] = { GPIOA_5 };
306 static const unsigned int tdm_b_dout3_pins[] = { GPIOA_6 };
307 static const unsigned int tdm_b_dout4_pins[] = { GPIOA_7 };
308 static const unsigned int tdm_b_dout5_pins[] = { GPIOA_8 };
309 static const unsigned int tdm_b_slv_sclk_pins[] = { GPIOA_5 };
310 static const unsigned int tdm_b_slv_fs_pins[] = { GPIOA_6 };
311 static const unsigned int tdm_b_din0_pins[] = { GPIOA_7 };
312 static const unsigned int tdm_b_din1_pins[] = { GPIOA_8 };
313 static const unsigned int tdm_b_din2_pins[] = { GPIOA_9 };
316 static const unsigned int mclk_vad_pins[] = { GPIOA_0 };
319 static const unsigned int tdm_vad_sclk_a1_pins[] = { GPIOA_1 };
320 static const unsigned int tdm_vad_fs_a2_pins[] = { GPIOA_2 };
321 static const unsigned int tdm_vad_sclk_a5_pins[] = { GPIOA_5 };
322 static const unsigned int tdm_vad_fs_a6_pins[] = { GPIOA_6 };
325 static const unsigned int tst_out0_pins[] = { GPIOA_0 };
326 static const unsigned int tst_out1_pins[] = { GPIOA_1 };
327 static const unsigned int tst_out2_pins[] = { GPIOA_2 };
328 static const unsigned int tst_out3_pins[] = { GPIOA_3 };
329 static const unsigned int tst_out4_pins[] = { GPIOA_4 };
330 static const unsigned int tst_out5_pins[] = { GPIOA_5 };
331 static const unsigned int tst_out6_pins[] = { GPIOA_6 };
332 static const unsigned int tst_out7_pins[] = { GPIOA_7 };
333 static const unsigned int tst_out8_pins[] = { GPIOA_8 };
334 static const unsigned int tst_out9_pins[] = { GPIOA_9 };
335 static const unsigned int tst_out10_pins[] = { GPIOA_10 };
336 static const unsigned int tst_out11_pins[] = { GPIOA_11 };
339 static const unsigned int mute_key_pins[] = { GPIOA_4 };
340 static const unsigned int mute_en_pins[] = { GPIOA_5 };
342 static struct meson_pmx_group meson_a1_periphs_groups[] = {
353 GPIO_GROUP(GPIOP_10),
354 GPIO_GROUP(GPIOP_11),
355 GPIO_GROUP(GPIOP_12),
373 GPIO_GROUP(GPIOX_10),
374 GPIO_GROUP(GPIOX_11),
375 GPIO_GROUP(GPIOX_12),
376 GPIO_GROUP(GPIOX_13),
377 GPIO_GROUP(GPIOX_14),
378 GPIO_GROUP(GPIOX_15),
379 GPIO_GROUP(GPIOX_16),
390 GPIO_GROUP(GPIOF_10),
391 GPIO_GROUP(GPIOF_11),
392 GPIO_GROUP(GPIOF_12),
403 GPIO_GROUP(GPIOA_10),
404 GPIO_GROUP(GPIOA_11),
407 GROUP(psram_clkn, 1),
408 GROUP(psram_clkp, 1),
409 GROUP(psram_ce_n, 1),
410 GROUP(psram_rst_n, 1),
411 GROUP(psram_adq0, 1),
412 GROUP(psram_adq1, 1),
413 GROUP(psram_adq2, 1),
414 GROUP(psram_adq3, 1),
415 GROUP(psram_adq4, 1),
416 GROUP(psram_adq5, 1),
417 GROUP(psram_adq6, 1),
418 GROUP(psram_adq7, 1),
419 GROUP(psram_dqs_dm, 1),
428 GROUP(spif_hold_n, 1),
434 GROUP(sdcard_d0_b, 2),
435 GROUP(sdcard_d1_b, 2),
436 GROUP(sdcard_d2_b, 2),
437 GROUP(sdcard_d3_b, 2),
438 GROUP(sdcard_clk_b, 2),
439 GROUP(sdcard_cmd_b, 2),
442 GROUP(sdcard_d0_x, 1),
443 GROUP(sdcard_d1_x, 1),
444 GROUP(sdcard_d2_x, 1),
445 GROUP(sdcard_d3_x, 1),
446 GROUP(sdcard_clk_x, 1),
447 GROUP(sdcard_cmd_x, 1),
449 GROUP(tdm_a_dout1, 1),
450 GROUP(tdm_a_dout0, 1),
452 GROUP(tdm_a_sclk, 1),
455 GROUP(uart_a_cts, 1),
456 GROUP(uart_a_rts, 1),
461 GROUP(i2c2_sck_x0, 2),
462 GROUP(i2c2_sda_x1, 2),
463 GROUP(spi_a_mosi_x2, 2),
464 GROUP(spi_a_ss0_x3, 2),
465 GROUP(spi_a_sclk_x4, 2),
466 GROUP(spi_a_miso_x5, 2),
467 GROUP(tdm_a_din1, 2),
468 GROUP(tdm_a_din0, 2),
469 GROUP(tdm_a_slv_fs, 2),
470 GROUP(tdm_a_slv_sclk, 2),
471 GROUP(i2c3_sck_x, 2),
472 GROUP(i2c3_sda_x, 2),
475 GROUP(i2c2_sck_x15, 2),
476 GROUP(i2c2_sda_x16, 2),
479 GROUP(uart_c_tx_x0, 3),
480 GROUP(uart_c_rx_x1, 3),
481 GROUP(uart_c_cts, 3),
482 GROUP(uart_c_rts, 3),
483 GROUP(pdm_din0_x, 3),
484 GROUP(pdm_din1_x, 3),
485 GROUP(pdm_din2_x, 3),
486 GROUP(pdm_dclk_x, 3),
487 GROUP(uart_c_tx_x15, 3),
488 GROUP(uart_c_rx_x16, 3),
493 GROUP(spi_a_mosi_x7, 4),
494 GROUP(spi_a_miso_x8, 4),
495 GROUP(spi_a_ss0_x9, 4),
496 GROUP(spi_a_sclk_x10, 4),
499 GROUP(uart_b_tx_x, 5),
500 GROUP(uart_b_rx_x, 5),
501 GROUP(i2c1_sda_x, 5),
502 GROUP(i2c1_sck_x, 5),
514 GROUP(uart_b_tx_f, 1),
515 GROUP(uart_b_rx_f, 1),
516 GROUP(remote_input_f, 1),
517 GROUP(jtag_a_clk, 1),
518 GROUP(jtag_a_tms, 1),
519 GROUP(jtag_a_tdi, 1),
520 GROUP(jtag_a_tdo, 1),
521 GROUP(gen_clk_f8, 1),
523 GROUP(i2c0_sck_f11, 1),
524 GROUP(i2c0_sda_f12, 1),
527 GROUP(clk_32k_in, 2),
530 GROUP(remote_out, 2),
531 GROUP(spdif_in_f6, 2),
532 GROUP(spdif_in_f7, 2),
533 GROUP(pwm_a_hiz_f8, 2),
534 GROUP(pwm_a_hiz_f10, 2),
546 GROUP(i2c_slave_sck_f, 3),
547 GROUP(i2c_slave_sda_f, 3),
551 GROUP(i2c3_sck_f, 4),
552 GROUP(i2c3_sda_f, 4),
553 GROUP(pmw_a_hiz_f6, 4),
556 GROUP(i2c0_sck_f9, 4),
557 GROUP(i2c0_sda_f10, 4),
564 GROUP(gen_clk_f10, 7),
568 GROUP(tdm_b_sclk, 1),
570 GROUP(tdm_b_dout0, 1),
571 GROUP(tdm_b_dout1, 1),
572 GROUP(tdm_b_dout2, 1),
573 GROUP(tdm_b_dout3, 1),
574 GROUP(tdm_b_dout4, 1),
575 GROUP(tdm_b_dout5, 1),
576 GROUP(remote_input_a, 1),
580 GROUP(tdm_b_slv_sclk, 2),
581 GROUP(tdm_b_slv_fs, 2),
582 GROUP(tdm_b_din0, 2),
583 GROUP(tdm_b_din1, 2),
584 GROUP(tdm_b_din2, 2),
585 GROUP(i2c1_sda_a, 2),
586 GROUP(i2c1_sck_a, 2),
589 GROUP(i2c2_sck_a4, 3),
590 GROUP(i2c2_sda_a5, 3),
591 GROUP(pdm_din2_a, 3),
592 GROUP(pdm_din1_a, 3),
593 GROUP(pdm_din0_a, 3),
600 GROUP(spi_a_mosi_a, 4),
601 GROUP(spi_a_miso_a, 4),
602 GROUP(spi_a_ss0_a, 4),
603 GROUP(spi_a_sclk_a, 4),
604 GROUP(i2c_slave_sck_a, 4),
605 GROUP(i2c_slave_sda_a, 4),
609 GROUP(tdm_vad_sclk_a1, 5),
610 GROUP(tdm_vad_fs_a2, 5),
611 GROUP(tdm_vad_sclk_a5, 5),
612 GROUP(tdm_vad_fs_a6, 5),
613 GROUP(i2c2_sck_a8, 5),
614 GROUP(i2c2_sda_a9, 5),
636 static const char * const gpio_periphs_groups[] = {
637 "GPIOP_0", "GPIOP_1", "GPIOP_2", "GPIOP_3", "GPIOP_4",
638 "GPIOP_5", "GPIOP_6", "GPIOP_7", "GPIOP_8", "GPIOP_9",
639 "GPIOP_10", "GPIOP_11", "GPIOP_12",
641 "GPIOB_0", "GPIOB_1", "GPIOB_2", "GPIOB_3", "GPIOB_4",
642 "GPIOB_5", "GPIOB_6",
644 "GPIOX_0", "GPIOX_1", "GPIOX_2", "GPIOX_3", "GPIOX_4",
645 "GPIOX_5", "GPIOX_6", "GPIOX_7", "GPIOX_8", "GPIOX_9",
646 "GPIOX_10", "GPIOX_11", "GPIOX_12", "GPIOX_13", "GPIOX_14",
647 "GPIOX_15", "GPIOX_16",
649 "GPIOF_0", "GPIOF_1", "GPIOF_2", "GPIOF_3", "GPIOF_4",
650 "GPIOF_5", "GPIOF_6", "GPIOF_7", "GPIOF_8", "GPIOF_9",
651 "GPIOF_10", "GPIOF_11", "GPIOF_12",
653 "GPIOA_0", "GPIOA_1", "GPIOA_2", "GPIOA_3", "GPIOA_4",
654 "GPIOA_5", "GPIOA_6", "GPIOA_7", "GPIOA_8", "GPIOA_9",
655 "GPIOA_10", "GPIOA_11",
658 static const char * const psram_groups[] = {
659 "psram_clkn", "psram_clkp", "psram_ce_n", "psram_rst_n", "psram_adq0",
660 "psram_adq1", "psram_adq2", "psram_adq3", "psram_adq4", "psram_adq5",
661 "psram_adq6", "psram_adq7", "psram_dqs_dm",
664 static const char * const pwm_a_groups[] = {
665 "pwm_a_x6", "pwm_a_x7", "pwm_a_f10", "pwm_a_f6", "pwm_a_a",
668 static const char * const pwm_b_groups[] = {
669 "pwm_b_x", "pwm_b_f", "pwm_b_a",
672 static const char * const pwm_c_groups[] = {
673 "pwm_c_x", "pwm_c_f3", "pwm_c_f8", "pwm_c_a",
676 static const char * const pwm_d_groups[] = {
677 "pwm_d_x15", "pwm_d_x13", "pwm_d_x10", "pwm_d_f",
680 static const char * const pwm_e_groups[] = {
681 "pwm_e_p", "pwm_e_x16", "pwm_e_x14", "pwm_e_x2", "pwm_e_f",
685 static const char * const pwm_f_groups[] = {
686 "pwm_f_b", "pwm_f_x", "pwm_f_f4", "pwm_f_f12",
689 static const char * const pwm_a_hiz_groups[] = {
690 "pwm_a_hiz_f8", "pwm_a_hiz_f10", "pwm_a_hiz_f6",
693 static const char * const pwm_b_hiz_groups[] = {
697 static const char * const pwm_c_hiz_groups[] = {
701 static const char * const spif_groups[] = {
702 "spif_mo", "spif_mi", "spif_wp_n", "spif_hold_n", "spif_clk",
706 static const char * const sdcard_groups[] = {
707 "sdcard_d0_b", "sdcard_d1_b", "sdcard_d2_b", "sdcard_d3_b",
708 "sdcard_clk_b", "sdcard_cmd_b",
710 "sdcard_d0_x", "sdcard_d1_x", "sdcard_d2_x", "sdcard_d3_x",
711 "sdcard_clk_x", "sdcard_cmd_x",
714 static const char * const tdm_a_groups[] = {
715 "tdm_a_din0", "tdm_a_din1", "tdm_a_fs", "tdm_a_sclk",
716 "tdm_a_slv_fs", "tdm_a_slv_sclk", "tdm_a_dout0", "tdm_a_dout1",
719 static const char * const uart_a_groups[] = {
720 "uart_a_tx", "uart_a_rx", "uart_a_cts", "uart_a_rts",
723 static const char * const uart_b_groups[] = {
724 "uart_b_tx_x", "uart_b_rx_x", "uart_b_tx_f", "uart_b_rx_f",
727 static const char * const uart_c_groups[] = {
728 "uart_c_tx_x0", "uart_c_rx_x1", "uart_c_cts", "uart_c_rts",
729 "uart_c_tx_x15", "uart_c_rx_x16",
732 static const char * const i2c0_groups[] = {
733 "i2c0_sck_f11", "i2c0_sda_f12", "i2c0_sck_f9", "i2c0_sda_f10",
736 static const char * const i2c1_groups[] = {
737 "i2c1_sda_x", "i2c1_sck_x", "i2c1_sda_a", "i2c1_sck_a",
740 static const char * const i2c2_groups[] = {
741 "i2c2_sck_x0", "i2c2_sda_x1", "i2c2_sck_x15", "i2c2_sda_x16",
742 "i2c2_sck_a4", "i2c2_sda_a5", "i2c2_sck_a8", "i2c2_sda_a9",
745 static const char * const i2c3_groups[] = {
746 "i2c3_sck_x", "i2c3_sda_x", "i2c3_sck_f", "i2c3_sda_f",
749 static const char * const spi_a_groups[] = {
750 "spi_a_mosi_x2", "spi_a_ss0_x3", "spi_a_sclk_x4", "spi_a_miso_x5",
751 "spi_a_mosi_x7", "spi_a_miso_x8", "spi_a_ss0_x9", "spi_a_sclk_x10",
753 "spi_a_mosi_a", "spi_a_miso_a", "spi_a_ss0_a", "spi_a_sclk_a",
756 static const char * const pdm_groups[] = {
757 "pdm_din0_x", "pdm_din1_x", "pdm_din2_x", "pdm_dclk_x", "pdm_din2_a",
758 "pdm_din1_a", "pdm_din0_a", "pdm_dclk",
761 static const char * const gen_clk_groups[] = {
762 "gen_clk_x", "gen_clk_f8", "gen_clk_f10", "gen_clk_a",
765 static const char * const remote_input_groups[] = {
770 static const char * const jtag_a_groups[] = {
771 "jtag_a_clk", "jtag_a_tms", "jtag_a_tdi", "jtag_a_tdo",
774 static const char * const clk_32k_in_groups[] = {
778 static const char * const remote_out_groups[] = {
782 static const char * const spdif_in_groups[] = {
783 "spdif_in_f6", "spdif_in_f7",
786 static const char * const sw_groups[] = {
790 static const char * const clk25_groups[] = {
794 static const char * const cec_a_groups[] = {
798 static const char * const cec_b_groups[] = {
802 static const char * const clk12_24_groups[] = {
806 static const char * const mclk_0_groups[] = {
810 static const char * const tdm_b_groups[] = {
811 "tdm_b_din0", "tdm_b_din1", "tdm_b_din2",
812 "tdm_b_sclk", "tdm_b_fs", "tdm_b_dout0", "tdm_b_dout1",
813 "tdm_b_dout2", "tdm_b_dout3", "tdm_b_dout4", "tdm_b_dout5",
814 "tdm_b_slv_sclk", "tdm_b_slv_fs",
817 static const char * const mclk_vad_groups[] = {
821 static const char * const tdm_vad_groups[] = {
822 "tdm_vad_sclk_a1", "tdm_vad_fs_a2", "tdm_vad_sclk_a5", "tdm_vad_fs_a6",
825 static const char * const tst_out_groups[] = {
826 "tst_out0", "tst_out1", "tst_out2", "tst_out3",
827 "tst_out4", "tst_out5", "tst_out6", "tst_out7",
828 "tst_out8", "tst_out9", "tst_out10", "tst_out11",
831 static const char * const mute_groups[] = {
832 "mute_key", "mute_en",
835 static struct meson_pmx_func meson_a1_periphs_functions[] = {
836 FUNCTION(gpio_periphs),
860 FUNCTION(remote_input),
862 FUNCTION(clk_32k_in),
863 FUNCTION(remote_out),
878 static struct meson_bank meson_a1_periphs_banks[] = {
879 /* name first last irq pullen pull dir out in ds*/
880 BANK_DS("P", GPIOP_0, GPIOP_12, 0, 12, 0x3, 0, 0x4, 0,
881 0x2, 0, 0x1, 0, 0x0, 0, 0x5, 0),
882 BANK_DS("B", GPIOB_0, GPIOB_6, 13, 19, 0x13, 0, 0x14, 0,
883 0x12, 0, 0x11, 0, 0x10, 0, 0x15, 0),
884 BANK_DS("X", GPIOX_0, GPIOX_16, 20, 36, 0x23, 0, 0x24, 0,
885 0x22, 0, 0x21, 0, 0x20, 0, 0x25, 0),
886 BANK_DS("F", GPIOF_0, GPIOF_12, 37, 49, 0x33, 0, 0x34, 0,
887 0x32, 0, 0x31, 0, 0x30, 0, 0x35, 0),
888 BANK_DS("A", GPIOA_0, GPIOA_11, 50, 61, 0x43, 0, 0x44, 0,
889 0x42, 0, 0x41, 0, 0x40, 0, 0x45, 0),
892 static struct meson_pmx_bank meson_a1_periphs_pmx_banks[] = {
893 /* name first lask reg offset */
894 BANK_PMX("P", GPIOP_0, GPIOP_12, 0x0, 0),
895 BANK_PMX("B", GPIOB_0, GPIOB_6, 0x2, 0),
896 BANK_PMX("X", GPIOX_0, GPIOX_16, 0x3, 0),
897 BANK_PMX("F", GPIOF_0, GPIOF_12, 0x6, 0),
898 BANK_PMX("A", GPIOA_0, GPIOA_11, 0x8, 0),
901 static struct meson_axg_pmx_data meson_a1_periphs_pmx_banks_data = {
902 .pmx_banks = meson_a1_periphs_pmx_banks,
903 .num_pmx_banks = ARRAY_SIZE(meson_a1_periphs_pmx_banks),
906 static struct meson_pinctrl_data meson_a1_periphs_pinctrl_data = {
907 .name = "periphs-banks",
908 .pins = meson_a1_periphs_pins,
909 .groups = meson_a1_periphs_groups,
910 .funcs = meson_a1_periphs_functions,
911 .banks = meson_a1_periphs_banks,
912 .num_pins = ARRAY_SIZE(meson_a1_periphs_pins),
913 .num_groups = ARRAY_SIZE(meson_a1_periphs_groups),
914 .num_funcs = ARRAY_SIZE(meson_a1_periphs_functions),
915 .num_banks = ARRAY_SIZE(meson_a1_periphs_banks),
916 .pmx_ops = &meson_axg_pmx_ops,
917 .pmx_data = &meson_a1_periphs_pmx_banks_data,
918 .parse_dt = &meson_a1_parse_dt_extra,
921 static const struct of_device_id meson_a1_pinctrl_dt_match[] = {
923 .compatible = "amlogic,meson-a1-periphs-pinctrl",
924 .data = &meson_a1_periphs_pinctrl_data,
929 static struct platform_driver meson_a1_pinctrl_driver = {
930 .probe = meson_pinctrl_probe,
932 .name = "meson-a1-pinctrl",
933 .of_match_table = meson_a1_pinctrl_dt_match,
937 builtin_platform_driver(meson_a1_pinctrl_driver);