2 * Pin controller and GPIO driver for Amlogic Meson GXL.
4 * Copyright (C) 2016 Endless Mobile, Inc.
5 * Author: Carlo Caione <carlo@endlessm.com>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
11 * You should have received a copy of the GNU General Public License
12 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 #include <dt-bindings/gpio/meson-gxl-gpio.h>
16 #include "pinctrl-meson.h"
17 #include "pinctrl-meson8-pmx.h"
19 static const struct pinctrl_pin_desc meson_gxl_periphs_pins
[] = {
100 MESON_PIN(GPIODV_27
),
101 MESON_PIN(GPIODV_28
),
102 MESON_PIN(GPIODV_29
),
124 MESON_PIN(GPIOCLK_0
),
125 MESON_PIN(GPIOCLK_1
),
128 static const unsigned int emmc_nand_d07_pins
[] = {
129 BOOT_0
, BOOT_1
, BOOT_2
, BOOT_3
, BOOT_4
, BOOT_5
, BOOT_6
, BOOT_7
,
131 static const unsigned int emmc_clk_pins
[] = { BOOT_8
};
132 static const unsigned int emmc_cmd_pins
[] = { BOOT_10
};
133 static const unsigned int emmc_ds_pins
[] = { BOOT_15
};
135 static const unsigned int nor_d_pins
[] = { BOOT_11
};
136 static const unsigned int nor_q_pins
[] = { BOOT_12
};
137 static const unsigned int nor_c_pins
[] = { BOOT_13
};
138 static const unsigned int nor_cs_pins
[] = { BOOT_15
};
140 static const unsigned int spi_mosi_pins
[] = { GPIOX_8
};
141 static const unsigned int spi_miso_pins
[] = { GPIOX_9
};
142 static const unsigned int spi_ss0_pins
[] = { GPIOX_10
};
143 static const unsigned int spi_sclk_pins
[] = { GPIOX_11
};
145 static const unsigned int sdcard_d0_pins
[] = { CARD_1
};
146 static const unsigned int sdcard_d1_pins
[] = { CARD_0
};
147 static const unsigned int sdcard_d2_pins
[] = { CARD_5
};
148 static const unsigned int sdcard_d3_pins
[] = { CARD_4
};
149 static const unsigned int sdcard_cmd_pins
[] = { CARD_3
};
150 static const unsigned int sdcard_clk_pins
[] = { CARD_2
};
152 static const unsigned int sdio_d0_pins
[] = { GPIOX_0
};
153 static const unsigned int sdio_d1_pins
[] = { GPIOX_1
};
154 static const unsigned int sdio_d2_pins
[] = { GPIOX_2
};
155 static const unsigned int sdio_d3_pins
[] = { GPIOX_3
};
156 static const unsigned int sdio_clk_pins
[] = { GPIOX_4
};
157 static const unsigned int sdio_cmd_pins
[] = { GPIOX_5
};
158 static const unsigned int sdio_irq_pins
[] = { GPIOX_7
};
160 static const unsigned int nand_ce0_pins
[] = { BOOT_8
};
161 static const unsigned int nand_ce1_pins
[] = { BOOT_9
};
162 static const unsigned int nand_rb0_pins
[] = { BOOT_10
};
163 static const unsigned int nand_ale_pins
[] = { BOOT_11
};
164 static const unsigned int nand_cle_pins
[] = { BOOT_12
};
165 static const unsigned int nand_wen_clk_pins
[] = { BOOT_13
};
166 static const unsigned int nand_ren_wr_pins
[] = { BOOT_14
};
167 static const unsigned int nand_dqs_pins
[] = { BOOT_15
};
169 static const unsigned int uart_tx_a_pins
[] = { GPIOX_12
};
170 static const unsigned int uart_rx_a_pins
[] = { GPIOX_13
};
171 static const unsigned int uart_cts_a_pins
[] = { GPIOX_14
};
172 static const unsigned int uart_rts_a_pins
[] = { GPIOX_15
};
174 static const unsigned int uart_tx_b_pins
[] = { GPIODV_24
};
175 static const unsigned int uart_rx_b_pins
[] = { GPIODV_25
};
176 static const unsigned int uart_cts_b_pins
[] = { GPIODV_26
};
177 static const unsigned int uart_rts_b_pins
[] = { GPIODV_27
};
179 static const unsigned int uart_tx_c_pins
[] = { GPIOX_8
};
180 static const unsigned int uart_rx_c_pins
[] = { GPIOX_9
};
181 static const unsigned int uart_cts_c_pins
[] = { GPIOX_10
};
182 static const unsigned int uart_rts_c_pins
[] = { GPIOX_11
};
184 static const unsigned int i2c_sck_a_pins
[] = { GPIODV_25
};
185 static const unsigned int i2c_sda_a_pins
[] = { GPIODV_24
};
187 static const unsigned int i2c_sck_b_pins
[] = { GPIODV_27
};
188 static const unsigned int i2c_sda_b_pins
[] = { GPIODV_26
};
190 static const unsigned int i2c_sck_c_pins
[] = { GPIODV_29
};
191 static const unsigned int i2c_sda_c_pins
[] = { GPIODV_28
};
193 static const unsigned int i2c_sck_c_dv19_pins
[] = { GPIODV_19
};
194 static const unsigned int i2c_sda_c_dv18_pins
[] = { GPIODV_18
};
196 static const unsigned int eth_mdio_pins
[] = { GPIOZ_0
};
197 static const unsigned int eth_mdc_pins
[] = { GPIOZ_1
};
198 static const unsigned int eth_clk_rx_clk_pins
[] = { GPIOZ_2
};
199 static const unsigned int eth_rx_dv_pins
[] = { GPIOZ_3
};
200 static const unsigned int eth_rxd0_pins
[] = { GPIOZ_4
};
201 static const unsigned int eth_rxd1_pins
[] = { GPIOZ_5
};
202 static const unsigned int eth_rxd2_pins
[] = { GPIOZ_6
};
203 static const unsigned int eth_rxd3_pins
[] = { GPIOZ_7
};
204 static const unsigned int eth_rgmii_tx_clk_pins
[] = { GPIOZ_8
};
205 static const unsigned int eth_tx_en_pins
[] = { GPIOZ_9
};
206 static const unsigned int eth_txd0_pins
[] = { GPIOZ_10
};
207 static const unsigned int eth_txd1_pins
[] = { GPIOZ_11
};
208 static const unsigned int eth_txd2_pins
[] = { GPIOZ_12
};
209 static const unsigned int eth_txd3_pins
[] = { GPIOZ_13
};
211 static const unsigned int pwm_a_pins
[] = { GPIOX_6
};
213 static const unsigned int pwm_b_pins
[] = { GPIODV_29
};
215 static const unsigned int pwm_c_pins
[] = { GPIOZ_15
};
217 static const unsigned int pwm_d_pins
[] = { GPIODV_28
};
219 static const unsigned int pwm_e_pins
[] = { GPIOX_16
};
221 static const unsigned int pwm_f_clk_pins
[] = { GPIOCLK_1
};
222 static const unsigned int pwm_f_x_pins
[] = { GPIOX_7
};
224 static const unsigned int hdmi_hpd_pins
[] = { GPIOH_0
};
225 static const unsigned int hdmi_sda_pins
[] = { GPIOH_1
};
226 static const unsigned int hdmi_scl_pins
[] = { GPIOH_2
};
228 static const unsigned int i2s_am_clk_pins
[] = { GPIOH_6
};
229 static const unsigned int i2s_out_ao_clk_pins
[] = { GPIOH_7
};
230 static const unsigned int i2s_out_lr_clk_pins
[] = { GPIOH_8
};
231 static const unsigned int i2s_out_ch01_pins
[] = { GPIOH_9
};
232 static const unsigned int i2s_out_ch23_z_pins
[] = { GPIOZ_5
};
233 static const unsigned int i2s_out_ch45_z_pins
[] = { GPIOZ_6
};
234 static const unsigned int i2s_out_ch67_z_pins
[] = { GPIOZ_7
};
236 static const unsigned int spdif_out_h_pins
[] = { GPIOH_4
};
238 static const unsigned int eth_link_led_pins
[] = { GPIOZ_14
};
239 static const unsigned int eth_act_led_pins
[] = { GPIOZ_15
};
241 static const unsigned int tsin_a_d0_pins
[] = { GPIODV_0
};
242 static const unsigned int tsin_a_clk_pins
[] = { GPIODV_8
};
243 static const unsigned int tsin_a_sop_pins
[] = { GPIODV_9
};
244 static const unsigned int tsin_a_d_valid_pins
[] = { GPIODV_10
};
245 static const unsigned int tsin_a_fail_pins
[] = { GPIODV_11
};
246 static const unsigned int tsin_a_dp_pins
[] = {
247 GPIODV_1
, GPIODV_2
, GPIODV_3
, GPIODV_4
, GPIODV_5
, GPIODV_6
, GPIODV_7
,
250 static const struct pinctrl_pin_desc meson_gxl_aobus_pins
[] = {
262 MESON_PIN(GPIO_TEST_N
),
265 static const unsigned int uart_tx_ao_a_pins
[] = { GPIOAO_0
};
266 static const unsigned int uart_rx_ao_a_pins
[] = { GPIOAO_1
};
267 static const unsigned int uart_tx_ao_b_0_pins
[] = { GPIOAO_0
};
268 static const unsigned int uart_rx_ao_b_1_pins
[] = { GPIOAO_1
};
269 static const unsigned int uart_cts_ao_a_pins
[] = { GPIOAO_2
};
270 static const unsigned int uart_rts_ao_a_pins
[] = { GPIOAO_3
};
271 static const unsigned int uart_tx_ao_b_pins
[] = { GPIOAO_4
};
272 static const unsigned int uart_rx_ao_b_pins
[] = { GPIOAO_5
};
273 static const unsigned int uart_cts_ao_b_pins
[] = { GPIOAO_2
};
274 static const unsigned int uart_rts_ao_b_pins
[] = { GPIOAO_3
};
276 static const unsigned int i2c_sck_ao_pins
[] = {GPIOAO_4
};
277 static const unsigned int i2c_sda_ao_pins
[] = {GPIOAO_5
};
278 static const unsigned int i2c_slave_sck_ao_pins
[] = {GPIOAO_4
};
279 static const unsigned int i2c_slave_sda_ao_pins
[] = {GPIOAO_5
};
281 static const unsigned int remote_input_ao_pins
[] = {GPIOAO_7
};
283 static const unsigned int pwm_ao_a_3_pins
[] = { GPIOAO_3
};
284 static const unsigned int pwm_ao_a_8_pins
[] = { GPIOAO_8
};
286 static const unsigned int pwm_ao_b_pins
[] = { GPIOAO_9
};
287 static const unsigned int pwm_ao_b_6_pins
[] = { GPIOAO_6
};
289 static const unsigned int i2s_out_ch23_ao_pins
[] = { GPIOAO_8
};
290 static const unsigned int i2s_out_ch45_ao_pins
[] = { GPIOAO_9
};
291 static const unsigned int i2s_out_ch67_ao_pins
[] = { GPIO_TEST_N
};
293 static const unsigned int spdif_out_ao_6_pins
[] = { GPIOAO_6
};
294 static const unsigned int spdif_out_ao_9_pins
[] = { GPIOAO_9
};
296 static const unsigned int ao_cec_pins
[] = { GPIOAO_8
};
297 static const unsigned int ee_cec_pins
[] = { GPIOAO_8
};
299 static struct meson_pmx_group meson_gxl_periphs_groups
[] = {
310 GPIO_GROUP(GPIOZ_10
),
311 GPIO_GROUP(GPIOZ_11
),
312 GPIO_GROUP(GPIOZ_12
),
313 GPIO_GROUP(GPIOZ_13
),
314 GPIO_GROUP(GPIOZ_14
),
315 GPIO_GROUP(GPIOZ_15
),
353 GPIO_GROUP(GPIODV_0
),
354 GPIO_GROUP(GPIODV_1
),
355 GPIO_GROUP(GPIODV_2
),
356 GPIO_GROUP(GPIODV_3
),
357 GPIO_GROUP(GPIODV_4
),
358 GPIO_GROUP(GPIODV_5
),
359 GPIO_GROUP(GPIODV_6
),
360 GPIO_GROUP(GPIODV_7
),
361 GPIO_GROUP(GPIODV_8
),
362 GPIO_GROUP(GPIODV_9
),
363 GPIO_GROUP(GPIODV_10
),
364 GPIO_GROUP(GPIODV_11
),
365 GPIO_GROUP(GPIODV_12
),
366 GPIO_GROUP(GPIODV_13
),
367 GPIO_GROUP(GPIODV_14
),
368 GPIO_GROUP(GPIODV_15
),
369 GPIO_GROUP(GPIODV_16
),
370 GPIO_GROUP(GPIODV_17
),
371 GPIO_GROUP(GPIODV_19
),
372 GPIO_GROUP(GPIODV_20
),
373 GPIO_GROUP(GPIODV_21
),
374 GPIO_GROUP(GPIODV_22
),
375 GPIO_GROUP(GPIODV_23
),
376 GPIO_GROUP(GPIODV_24
),
377 GPIO_GROUP(GPIODV_25
),
378 GPIO_GROUP(GPIODV_26
),
379 GPIO_GROUP(GPIODV_27
),
380 GPIO_GROUP(GPIODV_28
),
381 GPIO_GROUP(GPIODV_29
),
393 GPIO_GROUP(GPIOX_10
),
394 GPIO_GROUP(GPIOX_11
),
395 GPIO_GROUP(GPIOX_12
),
396 GPIO_GROUP(GPIOX_13
),
397 GPIO_GROUP(GPIOX_14
),
398 GPIO_GROUP(GPIOX_15
),
399 GPIO_GROUP(GPIOX_16
),
400 GPIO_GROUP(GPIOX_17
),
401 GPIO_GROUP(GPIOX_18
),
403 GPIO_GROUP(GPIOCLK_0
),
404 GPIO_GROUP(GPIOCLK_1
),
406 GPIO_GROUP(GPIO_TEST_N
),
409 GROUP(sdio_d0
, 5, 31),
410 GROUP(sdio_d1
, 5, 30),
411 GROUP(sdio_d2
, 5, 29),
412 GROUP(sdio_d3
, 5, 28),
413 GROUP(sdio_clk
, 5, 27),
414 GROUP(sdio_cmd
, 5, 26),
415 GROUP(sdio_irq
, 5, 24),
416 GROUP(uart_tx_a
, 5, 19),
417 GROUP(uart_rx_a
, 5, 18),
418 GROUP(uart_cts_a
, 5, 17),
419 GROUP(uart_rts_a
, 5, 16),
420 GROUP(uart_tx_c
, 5, 13),
421 GROUP(uart_rx_c
, 5, 12),
422 GROUP(uart_cts_c
, 5, 11),
423 GROUP(uart_rts_c
, 5, 10),
426 GROUP(pwm_f_x
, 5, 14),
427 GROUP(spi_mosi
, 5, 3),
428 GROUP(spi_miso
, 5, 2),
429 GROUP(spi_ss0
, 5, 1),
430 GROUP(spi_sclk
, 5, 0),
433 GROUP(eth_mdio
, 4, 23),
434 GROUP(eth_mdc
, 4, 22),
435 GROUP(eth_clk_rx_clk
, 4, 21),
436 GROUP(eth_rx_dv
, 4, 20),
437 GROUP(eth_rxd0
, 4, 19),
438 GROUP(eth_rxd1
, 4, 18),
439 GROUP(eth_rxd2
, 4, 17),
440 GROUP(eth_rxd3
, 4, 16),
441 GROUP(eth_rgmii_tx_clk
, 4, 15),
442 GROUP(eth_tx_en
, 4, 14),
443 GROUP(eth_txd0
, 4, 13),
444 GROUP(eth_txd1
, 4, 12),
445 GROUP(eth_txd2
, 4, 11),
446 GROUP(eth_txd3
, 4, 10),
448 GROUP(i2s_out_ch23_z
, 3, 26),
449 GROUP(i2s_out_ch45_z
, 3, 25),
450 GROUP(i2s_out_ch67_z
, 3, 24),
451 GROUP(eth_link_led
, 4, 25),
452 GROUP(eth_act_led
, 4, 24),
455 GROUP(hdmi_hpd
, 6, 31),
456 GROUP(hdmi_sda
, 6, 30),
457 GROUP(hdmi_scl
, 6, 29),
458 GROUP(i2s_am_clk
, 6, 26),
459 GROUP(i2s_out_ao_clk
, 6, 25),
460 GROUP(i2s_out_lr_clk
, 6, 24),
461 GROUP(i2s_out_ch01
, 6, 23),
462 GROUP(spdif_out_h
, 6, 28),
465 GROUP(uart_tx_b
, 2, 16),
466 GROUP(uart_rx_b
, 2, 15),
467 GROUP(uart_cts_b
, 2, 14),
468 GROUP(uart_rts_b
, 2, 13),
469 GROUP(i2c_sda_c_dv18
, 1, 17),
470 GROUP(i2c_sck_c_dv19
, 1, 16),
471 GROUP(i2c_sda_a
, 1, 15),
472 GROUP(i2c_sck_a
, 1, 14),
473 GROUP(i2c_sda_b
, 1, 13),
474 GROUP(i2c_sck_b
, 1, 12),
475 GROUP(i2c_sda_c
, 1, 11),
476 GROUP(i2c_sck_c
, 1, 10),
479 GROUP(tsin_a_d0
, 2, 4),
480 GROUP(tsin_a_dp
, 2, 3),
481 GROUP(tsin_a_clk
, 2, 2),
482 GROUP(tsin_a_sop
, 2, 1),
483 GROUP(tsin_a_d_valid
, 2, 0),
484 GROUP(tsin_a_fail
, 1, 31),
487 GROUP(emmc_nand_d07
, 7, 31),
488 GROUP(emmc_clk
, 7, 30),
489 GROUP(emmc_cmd
, 7, 29),
490 GROUP(emmc_ds
, 7, 28),
494 GROUP(nor_cs
, 7, 10),
495 GROUP(nand_ce0
, 7, 7),
496 GROUP(nand_ce1
, 7, 6),
497 GROUP(nand_rb0
, 7, 5),
498 GROUP(nand_ale
, 7, 4),
499 GROUP(nand_cle
, 7, 3),
500 GROUP(nand_wen_clk
, 7, 2),
501 GROUP(nand_ren_wr
, 7, 1),
502 GROUP(nand_dqs
, 7, 0),
505 GROUP(sdcard_d1
, 6, 5),
506 GROUP(sdcard_d0
, 6, 4),
507 GROUP(sdcard_d3
, 6, 1),
508 GROUP(sdcard_d2
, 6, 0),
509 GROUP(sdcard_cmd
, 6, 2),
510 GROUP(sdcard_clk
, 6, 3),
513 GROUP(pwm_f_clk
, 8, 30),
516 static struct meson_pmx_group meson_gxl_aobus_groups
[] = {
517 GPIO_GROUP(GPIOAO_0
),
518 GPIO_GROUP(GPIOAO_1
),
519 GPIO_GROUP(GPIOAO_2
),
520 GPIO_GROUP(GPIOAO_3
),
521 GPIO_GROUP(GPIOAO_4
),
522 GPIO_GROUP(GPIOAO_5
),
523 GPIO_GROUP(GPIOAO_6
),
524 GPIO_GROUP(GPIOAO_7
),
525 GPIO_GROUP(GPIOAO_8
),
526 GPIO_GROUP(GPIOAO_9
),
529 GROUP(uart_tx_ao_b_0
, 0, 26),
530 GROUP(uart_rx_ao_b_1
, 0, 25),
531 GROUP(uart_tx_ao_b
, 0, 24),
532 GROUP(uart_rx_ao_b
, 0, 23),
533 GROUP(uart_tx_ao_a
, 0, 12),
534 GROUP(uart_rx_ao_a
, 0, 11),
535 GROUP(uart_cts_ao_a
, 0, 10),
536 GROUP(uart_rts_ao_a
, 0, 9),
537 GROUP(uart_cts_ao_b
, 0, 8),
538 GROUP(uart_rts_ao_b
, 0, 7),
539 GROUP(i2c_sck_ao
, 0, 6),
540 GROUP(i2c_sda_ao
, 0, 5),
541 GROUP(i2c_slave_sck_ao
, 0, 2),
542 GROUP(i2c_slave_sda_ao
, 0, 1),
543 GROUP(remote_input_ao
, 0, 0),
544 GROUP(pwm_ao_a_3
, 0, 22),
545 GROUP(pwm_ao_b_6
, 0, 18),
546 GROUP(pwm_ao_a_8
, 0, 17),
547 GROUP(pwm_ao_b
, 0, 3),
548 GROUP(i2s_out_ch23_ao
, 1, 0),
549 GROUP(i2s_out_ch45_ao
, 1, 1),
550 GROUP(spdif_out_ao_6
, 0, 16),
551 GROUP(spdif_out_ao_9
, 0, 4),
552 GROUP(ao_cec
, 0, 15),
553 GROUP(ee_cec
, 0, 14),
556 GROUP(i2s_out_ch67_ao
, 1, 2),
559 static const char * const gpio_periphs_groups
[] = {
560 "GPIOZ_0", "GPIOZ_1", "GPIOZ_2", "GPIOZ_3", "GPIOZ_4",
561 "GPIOZ_5", "GPIOZ_6", "GPIOZ_7", "GPIOZ_8", "GPIOZ_9",
562 "GPIOZ_10", "GPIOZ_11", "GPIOZ_12", "GPIOZ_13", "GPIOZ_14",
565 "GPIOH_0", "GPIOH_1", "GPIOH_2", "GPIOH_3", "GPIOH_4",
566 "GPIOH_5", "GPIOH_6", "GPIOH_7", "GPIOH_8", "GPIOH_9",
568 "BOOT_0", "BOOT_1", "BOOT_2", "BOOT_3", "BOOT_4",
569 "BOOT_5", "BOOT_6", "BOOT_7", "BOOT_8", "BOOT_9",
570 "BOOT_10", "BOOT_11", "BOOT_12", "BOOT_13", "BOOT_14",
573 "CARD_0", "CARD_1", "CARD_2", "CARD_3", "CARD_4",
576 "GPIODV_0", "GPIODV_1", "GPIODV_2", "GPIODV_3", "GPIODV_4",
577 "GPIODV_5", "GPIODV_6", "GPIODV_7", "GPIODV_8", "GPIODV_9",
578 "GPIODV_10", "GPIODV_11", "GPIODV_12", "GPIODV_13", "GPIODV_14",
579 "GPIODV_15", "GPIODV_16", "GPIODV_17", "GPIODV_18", "GPIODV_19",
580 "GPIODV_20", "GPIODV_21", "GPIODV_22", "GPIODV_23", "GPIODV_24",
581 "GPIODV_25", "GPIODV_26", "GPIODV_27", "GPIODV_28", "GPIODV_29",
583 "GPIOX_0", "GPIOX_1", "GPIOX_2", "GPIOX_3", "GPIOX_4",
584 "GPIOX_5", "GPIOX_6", "GPIOX_7", "GPIOX_8", "GPIOX_9",
585 "GPIOX_10", "GPIOX_11", "GPIOX_12", "GPIOX_13", "GPIOX_14",
586 "GPIOX_15", "GPIOX_16", "GPIOX_17", "GPIOX_18",
589 static const char * const emmc_groups
[] = {
590 "emmc_nand_d07", "emmc_clk", "emmc_cmd", "emmc_ds",
593 static const char * const nor_groups
[] = {
594 "nor_d", "nor_q", "nor_c", "nor_cs",
597 static const char * const spi_groups
[] = {
598 "spi_mosi", "spi_miso", "spi_ss0", "spi_sclk",
601 static const char * const sdcard_groups
[] = {
602 "sdcard_d0", "sdcard_d1", "sdcard_d2", "sdcard_d3",
603 "sdcard_cmd", "sdcard_clk",
606 static const char * const sdio_groups
[] = {
607 "sdio_d0", "sdio_d1", "sdio_d2", "sdio_d3",
608 "sdio_cmd", "sdio_clk", "sdio_irq",
611 static const char * const nand_groups
[] = {
612 "emmc_nand_d07", "nand_ce0", "nand_ce1", "nand_rb0", "nand_ale",
613 "nand_cle", "nand_wen_clk", "nand_ren_wr", "nand_dqs",
616 static const char * const uart_a_groups
[] = {
617 "uart_tx_a", "uart_rx_a", "uart_cts_a", "uart_rts_a",
620 static const char * const uart_b_groups
[] = {
621 "uart_tx_b", "uart_rx_b", "uart_cts_b", "uart_rts_b",
624 static const char * const uart_c_groups
[] = {
625 "uart_tx_c", "uart_rx_c", "uart_cts_c", "uart_rts_c",
628 static const char * const i2c_a_groups
[] = {
629 "i2c_sck_a", "i2c_sda_a",
632 static const char * const i2c_b_groups
[] = {
633 "i2c_sck_b", "i2c_sda_b",
636 static const char * const i2c_c_groups
[] = {
637 "i2c_sck_c", "i2c_sda_c", "i2c_sda_c_dv18", "i2c_sck_c_dv19",
640 static const char * const eth_groups
[] = {
641 "eth_mdio", "eth_mdc", "eth_clk_rx_clk", "eth_rx_dv",
642 "eth_rxd0", "eth_rxd1", "eth_rxd2", "eth_rxd3",
643 "eth_rgmii_tx_clk", "eth_tx_en",
644 "eth_txd0", "eth_txd1", "eth_txd2", "eth_txd3",
647 static const char * const pwm_a_groups
[] = {
651 static const char * const pwm_b_groups
[] = {
655 static const char * const pwm_c_groups
[] = {
659 static const char * const pwm_d_groups
[] = {
663 static const char * const pwm_e_groups
[] = {
667 static const char * const pwm_f_groups
[] = {
668 "pwm_f_clk", "pwm_f_x",
671 static const char * const hdmi_hpd_groups
[] = {
675 static const char * const hdmi_i2c_groups
[] = {
676 "hdmi_sda", "hdmi_scl",
679 static const char * const i2s_out_groups
[] = {
680 "i2s_am_clk", "i2s_out_ao_clk", "i2s_out_lr_clk",
681 "i2s_out_ch01", "i2s_out_ch23_z", "i2s_out_ch45_z", "i2s_out_ch67_z",
684 static const char * const spdif_out_groups
[] = {
688 static const char * const eth_led_groups
[] = {
689 "eth_link_led", "eth_act_led",
692 static const char * const tsin_a_groups
[] = {
693 "tsin_a_clk", "tsin_a_sop",
694 "tsin_a_d_valid", "tsin_a_d0",
695 "tsin_a_dp", "tsin_a_fail",
698 static const char * const gpio_aobus_groups
[] = {
699 "GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3", "GPIOAO_4",
700 "GPIOAO_5", "GPIOAO_6", "GPIOAO_7", "GPIOAO_8", "GPIOAO_9",
705 static const char * const uart_ao_groups
[] = {
706 "uart_tx_ao_a", "uart_rx_ao_a", "uart_cts_ao_a", "uart_rts_ao_a",
709 static const char * const uart_ao_b_groups
[] = {
710 "uart_tx_ao_b", "uart_rx_ao_b", "uart_cts_ao_b", "uart_rts_ao_b",
711 "uart_tx_ao_b_0", "uart_rx_ao_b_1",
714 static const char * const i2c_ao_groups
[] = {
715 "i2c_sck_ao", "i2c_sda_ao",
718 static const char * const i2c_slave_ao_groups
[] = {
719 "i2c_slave_sck_ao", "i2c_slave_sda_ao",
722 static const char * const remote_input_ao_groups
[] = {
726 static const char * const pwm_ao_a_groups
[] = {
727 "pwm_ao_a_3", "pwm_ao_a_8",
730 static const char * const pwm_ao_b_groups
[] = {
731 "pwm_ao_b", "pwm_ao_b_6",
734 static const char * const i2s_out_ao_groups
[] = {
735 "i2s_out_ch23_ao", "i2s_out_ch45_ao", "i2s_out_ch67_ao",
738 static const char * const spdif_out_ao_groups
[] = {
739 "spdif_out_ao_6", "spdif_out_ao_9",
742 static const char * const cec_ao_groups
[] = {
746 static struct meson_pmx_func meson_gxl_periphs_functions
[] = {
747 FUNCTION(gpio_periphs
),
775 static struct meson_pmx_func meson_gxl_aobus_functions
[] = {
776 FUNCTION(gpio_aobus
),
780 FUNCTION(i2c_slave_ao
),
781 FUNCTION(remote_input_ao
),
784 FUNCTION(i2s_out_ao
),
785 FUNCTION(spdif_out_ao
),
789 static struct meson_bank meson_gxl_periphs_banks
[] = {
790 /* name first last irq pullen pull dir out in */
791 BANK("X", GPIOX_0
, GPIOX_18
, 89, 107, 4, 0, 4, 0, 12, 0, 13, 0, 14, 0),
792 BANK("DV", GPIODV_0
, GPIODV_29
, 83, 88, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0),
793 BANK("H", GPIOH_0
, GPIOH_9
, 26, 35, 1, 20, 1, 20, 3, 20, 4, 20, 5, 20),
794 BANK("Z", GPIOZ_0
, GPIOZ_15
, 10, 25, 3, 0, 3, 0, 9, 0, 10, 0, 11, 0),
795 BANK("CARD", CARD_0
, CARD_6
, 52, 58, 2, 20, 2, 20, 6, 20, 7, 20, 8, 20),
796 BANK("BOOT", BOOT_0
, BOOT_15
, 36, 51, 2, 0, 2, 0, 6, 0, 7, 0, 8, 0),
797 BANK("CLK", GPIOCLK_0
, GPIOCLK_1
, 108, 109, 3, 28, 3, 28, 9, 28, 10, 28, 11, 28),
800 static struct meson_bank meson_gxl_aobus_banks
[] = {
801 /* name first last irq pullen pull dir out in */
802 BANK("AO", GPIOAO_0
, GPIOAO_9
, 0, 9, 0, 16, 0, 0, 0, 0, 0, 16, 1, 0),
805 static struct meson_pinctrl_data meson_gxl_periphs_pinctrl_data
= {
806 .name
= "periphs-banks",
807 .pins
= meson_gxl_periphs_pins
,
808 .groups
= meson_gxl_periphs_groups
,
809 .funcs
= meson_gxl_periphs_functions
,
810 .banks
= meson_gxl_periphs_banks
,
811 .num_pins
= ARRAY_SIZE(meson_gxl_periphs_pins
),
812 .num_groups
= ARRAY_SIZE(meson_gxl_periphs_groups
),
813 .num_funcs
= ARRAY_SIZE(meson_gxl_periphs_functions
),
814 .num_banks
= ARRAY_SIZE(meson_gxl_periphs_banks
),
815 .pmx_ops
= &meson8_pmx_ops
,
818 static struct meson_pinctrl_data meson_gxl_aobus_pinctrl_data
= {
819 .name
= "aobus-banks",
820 .pins
= meson_gxl_aobus_pins
,
821 .groups
= meson_gxl_aobus_groups
,
822 .funcs
= meson_gxl_aobus_functions
,
823 .banks
= meson_gxl_aobus_banks
,
824 .num_pins
= ARRAY_SIZE(meson_gxl_aobus_pins
),
825 .num_groups
= ARRAY_SIZE(meson_gxl_aobus_groups
),
826 .num_funcs
= ARRAY_SIZE(meson_gxl_aobus_functions
),
827 .num_banks
= ARRAY_SIZE(meson_gxl_aobus_banks
),
828 .pmx_ops
= &meson8_pmx_ops
,
831 static const struct of_device_id meson_gxl_pinctrl_dt_match
[] = {
833 .compatible
= "amlogic,meson-gxl-periphs-pinctrl",
834 .data
= &meson_gxl_periphs_pinctrl_data
,
837 .compatible
= "amlogic,meson-gxl-aobus-pinctrl",
838 .data
= &meson_gxl_aobus_pinctrl_data
,
843 static struct platform_driver meson_gxl_pinctrl_driver
= {
844 .probe
= meson_pinctrl_probe
,
846 .name
= "meson-gxl-pinctrl",
847 .of_match_table
= meson_gxl_pinctrl_dt_match
,
850 builtin_platform_driver(meson_gxl_pinctrl_driver
);