xref: /linux/drivers/pinctrl/meson/pinctrl-meson-s4.c (revision 3a39d672e7f48b8d6b91a09afa4b55352773b4b5)
1775214d3SQianggui Song // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2775214d3SQianggui Song /*
3775214d3SQianggui Song  * Pin controller and GPIO driver for Amlogic Meson S4 SoC.
4775214d3SQianggui Song  *
5775214d3SQianggui Song  * Copyright (c) 2021 Amlogic, Inc. All rights reserved.
6775214d3SQianggui Song  * Author: Qianggui Song <qianggui.song@amlogic.com>
7775214d3SQianggui Song  */
8775214d3SQianggui Song 
9775214d3SQianggui Song #include <dt-bindings/gpio/meson-s4-gpio.h>
10775214d3SQianggui Song #include "pinctrl-meson.h"
11775214d3SQianggui Song #include "pinctrl-meson-axg-pmx.h"
12775214d3SQianggui Song 
13775214d3SQianggui Song static const struct pinctrl_pin_desc meson_s4_periphs_pins[] = {
14775214d3SQianggui Song 	MESON_PIN(GPIOE_0),
15775214d3SQianggui Song 	MESON_PIN(GPIOE_1),
16775214d3SQianggui Song 
17775214d3SQianggui Song 	MESON_PIN(GPIOB_0),
18775214d3SQianggui Song 	MESON_PIN(GPIOB_1),
19775214d3SQianggui Song 	MESON_PIN(GPIOB_2),
20775214d3SQianggui Song 	MESON_PIN(GPIOB_3),
21775214d3SQianggui Song 	MESON_PIN(GPIOB_4),
22775214d3SQianggui Song 	MESON_PIN(GPIOB_5),
23775214d3SQianggui Song 	MESON_PIN(GPIOB_6),
24775214d3SQianggui Song 	MESON_PIN(GPIOB_7),
25775214d3SQianggui Song 	MESON_PIN(GPIOB_8),
26775214d3SQianggui Song 	MESON_PIN(GPIOB_9),
27775214d3SQianggui Song 	MESON_PIN(GPIOB_10),
28775214d3SQianggui Song 	MESON_PIN(GPIOB_11),
29775214d3SQianggui Song 	MESON_PIN(GPIOB_12),
30775214d3SQianggui Song 	MESON_PIN(GPIOB_13),
31775214d3SQianggui Song 
32775214d3SQianggui Song 	MESON_PIN(GPIOC_0),
33775214d3SQianggui Song 	MESON_PIN(GPIOC_1),
34775214d3SQianggui Song 	MESON_PIN(GPIOC_2),
35775214d3SQianggui Song 	MESON_PIN(GPIOC_3),
36775214d3SQianggui Song 	MESON_PIN(GPIOC_4),
37775214d3SQianggui Song 	MESON_PIN(GPIOC_5),
38775214d3SQianggui Song 	MESON_PIN(GPIOC_6),
39775214d3SQianggui Song 	MESON_PIN(GPIOC_7),
40775214d3SQianggui Song 
41775214d3SQianggui Song 	MESON_PIN(GPIOD_0),
42775214d3SQianggui Song 	MESON_PIN(GPIOD_1),
43775214d3SQianggui Song 	MESON_PIN(GPIOD_2),
44775214d3SQianggui Song 	MESON_PIN(GPIOD_3),
45775214d3SQianggui Song 	MESON_PIN(GPIOD_4),
46775214d3SQianggui Song 	MESON_PIN(GPIOD_5),
47775214d3SQianggui Song 	MESON_PIN(GPIOD_6),
48775214d3SQianggui Song 	MESON_PIN(GPIOD_7),
49775214d3SQianggui Song 	MESON_PIN(GPIOD_8),
50775214d3SQianggui Song 	MESON_PIN(GPIOD_9),
51775214d3SQianggui Song 	MESON_PIN(GPIOD_10),
52775214d3SQianggui Song 	MESON_PIN(GPIOD_11),
53775214d3SQianggui Song 
54775214d3SQianggui Song 	MESON_PIN(GPIOH_0),
55775214d3SQianggui Song 	MESON_PIN(GPIOH_1),
56775214d3SQianggui Song 	MESON_PIN(GPIOH_2),
57775214d3SQianggui Song 	MESON_PIN(GPIOH_3),
58775214d3SQianggui Song 	MESON_PIN(GPIOH_4),
59775214d3SQianggui Song 	MESON_PIN(GPIOH_5),
60775214d3SQianggui Song 	MESON_PIN(GPIOH_6),
61775214d3SQianggui Song 	MESON_PIN(GPIOH_7),
62775214d3SQianggui Song 	MESON_PIN(GPIOH_8),
63775214d3SQianggui Song 	MESON_PIN(GPIOH_9),
64775214d3SQianggui Song 	MESON_PIN(GPIOH_10),
65775214d3SQianggui Song 	MESON_PIN(GPIOH_11),
66775214d3SQianggui Song 
67775214d3SQianggui Song 	MESON_PIN(GPIOX_0),
68775214d3SQianggui Song 	MESON_PIN(GPIOX_1),
69775214d3SQianggui Song 	MESON_PIN(GPIOX_2),
70775214d3SQianggui Song 	MESON_PIN(GPIOX_3),
71775214d3SQianggui Song 	MESON_PIN(GPIOX_4),
72775214d3SQianggui Song 	MESON_PIN(GPIOX_5),
73775214d3SQianggui Song 	MESON_PIN(GPIOX_6),
74775214d3SQianggui Song 	MESON_PIN(GPIOX_7),
75775214d3SQianggui Song 	MESON_PIN(GPIOX_8),
76775214d3SQianggui Song 	MESON_PIN(GPIOX_9),
77775214d3SQianggui Song 	MESON_PIN(GPIOX_10),
78775214d3SQianggui Song 	MESON_PIN(GPIOX_11),
79775214d3SQianggui Song 	MESON_PIN(GPIOX_12),
80775214d3SQianggui Song 	MESON_PIN(GPIOX_13),
81775214d3SQianggui Song 	MESON_PIN(GPIOX_14),
82775214d3SQianggui Song 	MESON_PIN(GPIOX_15),
83775214d3SQianggui Song 	MESON_PIN(GPIOX_16),
84775214d3SQianggui Song 	MESON_PIN(GPIOX_17),
85775214d3SQianggui Song 	MESON_PIN(GPIOX_18),
86775214d3SQianggui Song 	MESON_PIN(GPIOX_19),
87775214d3SQianggui Song 
88775214d3SQianggui Song 	MESON_PIN(GPIOZ_0),
89775214d3SQianggui Song 	MESON_PIN(GPIOZ_1),
90775214d3SQianggui Song 	MESON_PIN(GPIOZ_2),
91775214d3SQianggui Song 	MESON_PIN(GPIOZ_3),
92775214d3SQianggui Song 	MESON_PIN(GPIOZ_4),
93775214d3SQianggui Song 	MESON_PIN(GPIOZ_5),
94775214d3SQianggui Song 	MESON_PIN(GPIOZ_6),
95775214d3SQianggui Song 	MESON_PIN(GPIOZ_7),
96775214d3SQianggui Song 	MESON_PIN(GPIOZ_8),
97775214d3SQianggui Song 	MESON_PIN(GPIOZ_9),
98775214d3SQianggui Song 	MESON_PIN(GPIOZ_10),
99775214d3SQianggui Song 	MESON_PIN(GPIOZ_11),
100775214d3SQianggui Song 	MESON_PIN(GPIOZ_12),
101775214d3SQianggui Song 
102775214d3SQianggui Song 	MESON_PIN(GPIO_TEST_N),
103775214d3SQianggui Song };
104775214d3SQianggui Song 
105775214d3SQianggui Song /* BANK E func1 */
106775214d3SQianggui Song static const unsigned int i2c0_sda_pins[]		= { GPIOE_0 };
107775214d3SQianggui Song static const unsigned int i2c0_scl_pins[]		= { GPIOE_1 };
108775214d3SQianggui Song 
109775214d3SQianggui Song /* BANK E func2 */
110775214d3SQianggui Song static const unsigned int uart_b_tx_e_pins[]		= { GPIOE_0 };
111775214d3SQianggui Song static const unsigned int uart_b_rx_e_pins[]		= { GPIOE_1 };
112775214d3SQianggui Song 
113775214d3SQianggui Song /* BANK E func3 */
114775214d3SQianggui Song static const unsigned int pwm_h_pins[]			= { GPIOE_0 };
115775214d3SQianggui Song static const unsigned int pwm_j_pins[]			= { GPIOE_1 };
116775214d3SQianggui Song 
117775214d3SQianggui Song /* BANK B func1 */
118775214d3SQianggui Song static const unsigned int emmc_nand_d0_pins[]		= { GPIOB_0 };
119775214d3SQianggui Song static const unsigned int emmc_nand_d1_pins[]		= { GPIOB_1 };
120775214d3SQianggui Song static const unsigned int emmc_nand_d2_pins[]		= { GPIOB_2 };
121775214d3SQianggui Song static const unsigned int emmc_nand_d3_pins[]		= { GPIOB_3 };
122775214d3SQianggui Song static const unsigned int emmc_nand_d4_pins[]		= { GPIOB_4 };
123775214d3SQianggui Song static const unsigned int emmc_nand_d5_pins[]		= { GPIOB_5 };
124775214d3SQianggui Song static const unsigned int emmc_nand_d6_pins[]		= { GPIOB_6 };
125775214d3SQianggui Song static const unsigned int emmc_nand_d7_pins[]		= { GPIOB_7 };
126775214d3SQianggui Song static const unsigned int emmc_clk_pins[]		= { GPIOB_8 };
127775214d3SQianggui Song static const unsigned int emmc_rst_pins[]		= { GPIOB_9 };
128775214d3SQianggui Song static const unsigned int emmc_cmd_pins[]		= { GPIOB_10 };
129775214d3SQianggui Song static const unsigned int emmc_nand_ds_pins[]		= { GPIOB_11 };
130775214d3SQianggui Song 
131775214d3SQianggui Song /* Bank B func2 */
132775214d3SQianggui Song static const unsigned int nand_wen_clk_pins[]		= { GPIOB_8 };
133775214d3SQianggui Song static const unsigned int nand_ale_pins[]		= { GPIOB_9 };
134775214d3SQianggui Song static const unsigned int nand_ren_wr_pins[]		= { GPIOB_10 };
135775214d3SQianggui Song static const unsigned int nand_cle_pins[]		= { GPIOB_11 };
136775214d3SQianggui Song static const unsigned int nand_ce0_pins[]		= { GPIOB_12 };
137775214d3SQianggui Song 
138775214d3SQianggui Song /* Bank B func3 */
139775214d3SQianggui Song static const unsigned int spif_hold_pins[]		= { GPIOB_3 };
140775214d3SQianggui Song static const unsigned int spif_mo_pins[]		= { GPIOB_4 };
141775214d3SQianggui Song static const unsigned int spif_mi_pins[]		= { GPIOB_5 };
142775214d3SQianggui Song static const unsigned int spif_clk_pins[]		= { GPIOB_6 };
143775214d3SQianggui Song static const unsigned int spif_wp_pins[]		= { GPIOB_7 };
144775214d3SQianggui Song static const unsigned int spif_cs_pins[]		= { GPIOB_13 };
145775214d3SQianggui Song 
146775214d3SQianggui Song /* Bank C func1 */
147775214d3SQianggui Song static const unsigned int sdcard_d0_c_pins[]		= { GPIOC_0 };
148775214d3SQianggui Song static const unsigned int sdcard_d1_c_pins[]		= { GPIOC_1 };
149775214d3SQianggui Song static const unsigned int sdcard_d2_c_pins[]		= { GPIOC_2 };
150775214d3SQianggui Song static const unsigned int sdcard_d3_c_pins[]		= { GPIOC_3 };
151775214d3SQianggui Song static const unsigned int sdcard_clk_c_pins[]		= { GPIOC_4 };
152775214d3SQianggui Song static const unsigned int sdcard_cmd_c_pins[]		= { GPIOC_5 };
153775214d3SQianggui Song static const unsigned int sdcard_cd_pins[]		= { GPIOC_6 };
154775214d3SQianggui Song 
155775214d3SQianggui Song /* Bank C func2 */
156775214d3SQianggui Song static const unsigned int jtag_2_tdo_pins[]		= { GPIOC_0 };
157775214d3SQianggui Song static const unsigned int jtag_2_tdi_pins[]		= { GPIOC_1 };
158775214d3SQianggui Song static const unsigned int uart_b_rx_c_pins[]		= { GPIOC_2 };
159775214d3SQianggui Song static const unsigned int uart_b_tx_c_pins[]		= { GPIOC_3 };
160775214d3SQianggui Song static const unsigned int jtag_2_clk_pins[]		= { GPIOC_4 };
161775214d3SQianggui Song static const unsigned int jtag_2_tms_pins[]		= { GPIOC_5 };
162775214d3SQianggui Song static const unsigned int i2c1_sda_c_pins[]		= { GPIOC_6 };
163775214d3SQianggui Song static const unsigned int i2c1_scl_c_pins[]		= { GPIOC_7 };
164775214d3SQianggui Song 
165775214d3SQianggui Song /* Bank C func3 */
166775214d3SQianggui Song static const unsigned int pdm_din1_c_pins[]		= { GPIOC_0 };
167775214d3SQianggui Song static const unsigned int pdm_din0_c_pins[]		= { GPIOC_1 };
168775214d3SQianggui Song static const unsigned int i2c4_sda_c_pins[]		= { GPIOC_2 };
169775214d3SQianggui Song static const unsigned int i2c4_scl_c_pins[]		= { GPIOC_3 };
170775214d3SQianggui Song static const unsigned int pdm_dclk_c_pins[]		= { GPIOC_4 };
171775214d3SQianggui Song static const unsigned int iso7816_clk_c_pins[]		= { GPIOC_5 };
172775214d3SQianggui Song static const unsigned int iso7816_data_c_pins[]		= { GPIOC_6 };
173775214d3SQianggui Song 
174775214d3SQianggui Song /* Bank C func4 */
175775214d3SQianggui Song static const unsigned int tdm_d2_c_pins[]		= { GPIOC_0 };
176775214d3SQianggui Song static const unsigned int tdm_d3_c_pins[]		= { GPIOC_1 };
177775214d3SQianggui Song static const unsigned int tdm_fs1_c_pins[]		= { GPIOC_2 };
178775214d3SQianggui Song static const unsigned int tdm_sclk1_c_pins[]		= { GPIOC_3 };
179775214d3SQianggui Song static const unsigned int mclk_1_c_pins[]		= { GPIOC_4 };
180775214d3SQianggui Song static const unsigned int tdm_d4_c_pins[]		= { GPIOC_5 };
181775214d3SQianggui Song static const unsigned int tdm_d5_c_pins[]		= { GPIOC_6 };
182775214d3SQianggui Song 
183775214d3SQianggui Song /* Bank D func1 */
184775214d3SQianggui Song static const unsigned int uart_b_tx_d_pins[]		= { GPIOD_0 };
185775214d3SQianggui Song static const unsigned int uart_b_rx_d_pins[]		= { GPIOD_1 };
186775214d3SQianggui Song static const unsigned int uart_b_cts_d_pins[]		= { GPIOD_2 };
187775214d3SQianggui Song static const unsigned int uart_b_rts_d_pins[]		= { GPIOD_3 };
188775214d3SQianggui Song static const unsigned int remote_out_pins[]		= { GPIOD_4 };
189775214d3SQianggui Song static const unsigned int remote_in_pins[]		= { GPIOD_5 };
190775214d3SQianggui Song static const unsigned int jtag_1_clk_pins[]		= { GPIOD_6 };
191775214d3SQianggui Song static const unsigned int jtag_1_tms_pins[]		= { GPIOD_7 };
192775214d3SQianggui Song static const unsigned int jtag_1_tdi_pins[]		= { GPIOD_8 };
193775214d3SQianggui Song static const unsigned int jtag_1_tdo_pins[]		= { GPIOD_9 };
194775214d3SQianggui Song static const unsigned int clk12_24_pins[]		= { GPIOD_10 };
195775214d3SQianggui Song static const unsigned int pwm_g_hiz_pins[]		= { GPIOD_11 };
196775214d3SQianggui Song 
197775214d3SQianggui Song /* Bank D func2 */
198775214d3SQianggui Song static const unsigned int i2c4_sda_d_pins[]		= { GPIOD_2 };
199775214d3SQianggui Song static const unsigned int i2c4_scl_d_pins[]		= { GPIOD_3 };
200775214d3SQianggui Song static const unsigned int mclk_1_d_pins[]		= { GPIOD_4 };
201775214d3SQianggui Song static const unsigned int tdm_sclk1_d_pins[]		= { GPIOD_6 };
202775214d3SQianggui Song static const unsigned int tdm_fs1_d_pins[]		= { GPIOD_7 };
203775214d3SQianggui Song static const unsigned int tdm_d4_d_pins[]		= { GPIOD_8 };
204775214d3SQianggui Song static const unsigned int tdm_d3_d_pins[]		= { GPIOD_9 };
205775214d3SQianggui Song static const unsigned int tdm_d2_d_pins[]		= { GPIOD_10 };
206775214d3SQianggui Song static const unsigned int pwm_g_d_pins[]		= { GPIOD_11 };
207775214d3SQianggui Song 
208775214d3SQianggui Song /* Bank D func3 */
209775214d3SQianggui Song static const unsigned int uart_c_tx_pins[]		= { GPIOD_2 };
210775214d3SQianggui Song static const unsigned int uart_c_rx_pins[]		= { GPIOD_3 };
211775214d3SQianggui Song static const unsigned int pwm_b_d_pins[]		= { GPIOD_4 };
212775214d3SQianggui Song static const unsigned int pwm_a_d_pins[]		= { GPIOD_6 };
213775214d3SQianggui Song static const unsigned int pwm_c_d_pins[]		= { GPIOD_7 };
214775214d3SQianggui Song static const unsigned int pwm_d_d_pins[]		= { GPIOD_8 };
215775214d3SQianggui Song static const unsigned int pwm_i_d_pins[]		= { GPIOD_9 };
216775214d3SQianggui Song 
217775214d3SQianggui Song /* Bank D func4 */
218775214d3SQianggui Song static const unsigned int clk_32k_in_pins[]		= { GPIOD_2 };
219775214d3SQianggui Song static const unsigned int pwm_b_hiz_pins[]		= { GPIOD_4 };
220775214d3SQianggui Song static const unsigned int pwm_a_hiz_pins[]		= { GPIOD_6 };
221775214d3SQianggui Song static const unsigned int pwm_c_hiz_pins[]		= { GPIOD_7 };
222775214d3SQianggui Song static const unsigned int pdm_dclk_d_pins[]		= { GPIOD_8 };
223775214d3SQianggui Song static const unsigned int pdm_din0_d_pins[]		= { GPIOD_9 };
224775214d3SQianggui Song static const unsigned int pdm_din1_d_pins[]		= { GPIOD_10 };
225775214d3SQianggui Song 
226775214d3SQianggui Song /* Bank D func5 */
227775214d3SQianggui Song static const unsigned int mic_mute_en_pins[]		= { GPIOD_2 };
228775214d3SQianggui Song static const unsigned int mic_mute_key_pins[]		= { GPIOD_3 };
229775214d3SQianggui Song static const unsigned int i2c1_sda_d_pins[]		= { GPIOD_6 };
230775214d3SQianggui Song static const unsigned int i2c1_scl_d_pins[]		= { GPIOD_7 };
231775214d3SQianggui Song static const unsigned int i2c2_sda_d_pins[]		= { GPIOD_10 };
232775214d3SQianggui Song static const unsigned int i2c2_scl_d_pins[]		= { GPIOD_11 };
233775214d3SQianggui Song 
234775214d3SQianggui Song /* Bank D func6 */
235775214d3SQianggui Song static const unsigned int gen_clk_d_pins[]		= { GPIOD_10 };
236775214d3SQianggui Song static const unsigned int tsin_b_clk_c_pins[]		= { GPIOD_6 };
237775214d3SQianggui Song static const unsigned int tsin_b_sop_c_pins[]		= { GPIOD_7 };
238775214d3SQianggui Song static const unsigned int tsin_b_valid_c_pins[]		= { GPIOD_8 };
239775214d3SQianggui Song static const unsigned int tsin_b_d0_c_pins[]		= { GPIOD_9 };
240775214d3SQianggui Song 
241775214d3SQianggui Song /* Bank H func1 */
242775214d3SQianggui Song static const unsigned int hdmitx_sda_pins[]		= { GPIOH_0 };
243775214d3SQianggui Song static const unsigned int hdmitx_sck_pins[]		= { GPIOH_1 };
244775214d3SQianggui Song static const unsigned int hdmitx_hpd_in_pins[]		= { GPIOH_2 };
245775214d3SQianggui Song static const unsigned int ao_cec_a_pins[]		= { GPIOH_3 };
246775214d3SQianggui Song static const unsigned int spdif_out_h_pins[]		= { GPIOH_4 };
247775214d3SQianggui Song static const unsigned int spdif_in_pins[]		= { GPIOH_5 };
248775214d3SQianggui Song static const unsigned int i2c1_sda_h_pins[]		= { GPIOH_6 };
249775214d3SQianggui Song static const unsigned int i2c1_scl_h_pins[]		= { GPIOH_7 };
250775214d3SQianggui Song static const unsigned int i2c2_sda_h8_pins[]		= { GPIOH_8 };
251775214d3SQianggui Song static const unsigned int i2c2_scl_h9_pins[]		= { GPIOH_9 };
252775214d3SQianggui Song static const unsigned int eth_link_led_pins[]		= { GPIOH_10 };
253775214d3SQianggui Song static const unsigned int eth_act_led_pins[]		= { GPIOH_11 };
254775214d3SQianggui Song 
255775214d3SQianggui Song /* Bank H func2 */
256775214d3SQianggui Song static const unsigned int i2c2_sda_h0_pins[]		= { GPIOH_0 };
257775214d3SQianggui Song static const unsigned int i2c2_scl_h1_pins[]		= { GPIOH_1 };
258775214d3SQianggui Song static const unsigned int ao_cec_b_pins[]		= { GPIOH_3 };
259775214d3SQianggui Song static const unsigned int uart_d_tx_h_pins[]		= { GPIOH_4 };
260775214d3SQianggui Song static const unsigned int uart_d_rx_h_pins[]		= { GPIOH_5 };
261775214d3SQianggui Song static const unsigned int uart_d_cts_h_pins[]		= { GPIOH_6 };
262775214d3SQianggui Song static const unsigned int uart_d_rts_h_pins[]		= { GPIOH_7 };
263775214d3SQianggui Song static const unsigned int iso7816_clk_h_pins[]		= { GPIOH_8 };
264775214d3SQianggui Song static const unsigned int iso7816_data_h_pins[]		= { GPIOH_9 };
265775214d3SQianggui Song static const unsigned int uart_e_tx_h_pins[]		= { GPIOH_10 };
266775214d3SQianggui Song static const unsigned int uart_e_rx_h_pins[]		= { GPIOH_11 };
267775214d3SQianggui Song 
268775214d3SQianggui Song /* Bank H func3 */
269775214d3SQianggui Song static const unsigned int pwm_d_h_pins[]		= { GPIOH_6 };
270775214d3SQianggui Song static const unsigned int pwm_i_h_pins[]		= { GPIOH_7 };
271775214d3SQianggui Song static const unsigned int pdm_dclk_h_pins[]		= { GPIOH_8 };
272775214d3SQianggui Song static const unsigned int pdm_din0_h_pins[]		= { GPIOH_9 };
273775214d3SQianggui Song static const unsigned int pdm_din1_h_pins[]		= { GPIOH_10 };
274775214d3SQianggui Song 
275775214d3SQianggui Song /* Bank H func4 */
276775214d3SQianggui Song static const unsigned int mclk_1_h_pins[]		= { GPIOH_4 };
277775214d3SQianggui Song static const unsigned int tdm_sclk1_h_pins[]		= { GPIOH_5 };
278775214d3SQianggui Song static const unsigned int tdm_fs1_h_pins[]		= { GPIOH_6 };
279775214d3SQianggui Song static const unsigned int tdm_d2_h_pins[]		= { GPIOH_7 };
280775214d3SQianggui Song static const unsigned int tdm_d3_h_pins[]		= { GPIOH_8 };
281775214d3SQianggui Song static const unsigned int tdm_d4_h_pins[]		= { GPIOH_9 };
282775214d3SQianggui Song 
283775214d3SQianggui Song /* Bank H func5 */
284775214d3SQianggui Song static const unsigned int spi_a_miso_h_pins[]		= { GPIOH_4 };
285775214d3SQianggui Song static const unsigned int spi_a_mosi_h_pins[]		= { GPIOH_5 };
286775214d3SQianggui Song static const unsigned int spi_a_clk_h_pins[]		= { GPIOH_6 };
287775214d3SQianggui Song static const unsigned int spi_a_ss0_h_pins[]		= { GPIOH_7 };
288775214d3SQianggui Song 
289775214d3SQianggui Song /* Bank H func6 */
290775214d3SQianggui Song static const unsigned int gen_clk_h_pins[]		= { GPIOH_11 };
291775214d3SQianggui Song static const unsigned int tsin_b1_clk_pins[]		= { GPIOH_4 };
292775214d3SQianggui Song static const unsigned int tsin_b1_sop_pins[]		= { GPIOH_5 };
293775214d3SQianggui Song static const unsigned int tsin_b1_valid_pins[]		= { GPIOH_6 };
294775214d3SQianggui Song static const unsigned int tsin_b1_d0_pins[]		= { GPIOH_7 };
295775214d3SQianggui Song 
296775214d3SQianggui Song /* Bank X func1 */
297775214d3SQianggui Song static const unsigned int sdio_d0_pins[]		= { GPIOX_0 };
298775214d3SQianggui Song static const unsigned int sdio_d1_pins[]		= { GPIOX_1 };
299775214d3SQianggui Song static const unsigned int sdio_d2_pins[]		= { GPIOX_2 };
300775214d3SQianggui Song static const unsigned int sdio_d3_pins[]		= { GPIOX_3 };
301775214d3SQianggui Song static const unsigned int sdio_clk_pins[]		= { GPIOX_4 };
302775214d3SQianggui Song static const unsigned int sdio_cmd_pins[]		= { GPIOX_5 };
303775214d3SQianggui Song static const unsigned int pwm_a_x_pins[]		= { GPIOX_6 };
304775214d3SQianggui Song static const unsigned int pwm_f_x_pins[]		= { GPIOX_7 };
305775214d3SQianggui Song static const unsigned int tdm_d1_pins[]			= { GPIOX_8 };
306775214d3SQianggui Song static const unsigned int tdm_d0_pins[]			= { GPIOX_9 };
307775214d3SQianggui Song static const unsigned int tdm_fs0_pins[]		= { GPIOX_10 };
308775214d3SQianggui Song static const unsigned int tdm_sclk0_pins[]		= { GPIOX_11 };
309775214d3SQianggui Song static const unsigned int uart_a_tx_pins[]		= { GPIOX_12 };
310775214d3SQianggui Song static const unsigned int uart_a_rx_pins[]		= { GPIOX_13 };
311775214d3SQianggui Song static const unsigned int uart_a_cts_pins[]		= { GPIOX_14 };
312775214d3SQianggui Song static const unsigned int uart_a_rts_pins[]		= { GPIOX_15 };
313775214d3SQianggui Song static const unsigned int pwm_e_x_pins[]		= { GPIOX_16 };
314775214d3SQianggui Song static const unsigned int i2c1_sda_x_pins[]		= { GPIOX_17 };
315775214d3SQianggui Song static const unsigned int i2c1_scl_x_pins[]		= { GPIOX_18 };
316775214d3SQianggui Song static const unsigned int pwm_b_x_pins[]		= { GPIOX_19 };
317775214d3SQianggui Song 
318775214d3SQianggui Song /* Bank X func2 */
319775214d3SQianggui Song static const unsigned int pdm_din0_x_pins[]		= { GPIOX_8 };
320775214d3SQianggui Song static const unsigned int pdm_din1_x_pins[]		= { GPIOX_9 };
321775214d3SQianggui Song static const unsigned int pdm_dclk_x_pins[]		= { GPIOX_11 };
322775214d3SQianggui Song 
323775214d3SQianggui Song /* Bank X func3 */
324775214d3SQianggui Song static const unsigned int spi_a_mosi_x_pins[]		= { GPIOX_8 };
325775214d3SQianggui Song static const unsigned int spi_a_miso_x_pins[]		= { GPIOX_9 };
326775214d3SQianggui Song static const unsigned int spi_a_ss0_x_pins[]		= { GPIOX_10 };
327775214d3SQianggui Song static const unsigned int spi_a_clk_x_pins[]		= { GPIOX_11 };
328775214d3SQianggui Song 
329775214d3SQianggui Song /* Bank X func4 */
330775214d3SQianggui Song static const unsigned int pwm_c_x_pins[]		= { GPIOX_8 };
331775214d3SQianggui Song static const unsigned int i2c_slave_scl_pins[]		= { GPIOX_10 };
332775214d3SQianggui Song static const unsigned int i2c_slave_sda_pins[]		= { GPIOX_11 };
333775214d3SQianggui Song 
334775214d3SQianggui Song /* Bank X func5 */
335775214d3SQianggui Song static const unsigned int i2c3_sda_x_pins[]		= { GPIOX_10 };
336775214d3SQianggui Song static const unsigned int i2c3_scl_x_pins[]		= { GPIOX_11 };
337775214d3SQianggui Song 
338775214d3SQianggui Song /* Bank Z func1 */
339775214d3SQianggui Song static const unsigned int tdm_fs2_pins[]		= { GPIOZ_0 };
340775214d3SQianggui Song static const unsigned int tdm_sclk2_pins[]		= { GPIOZ_1 };
341775214d3SQianggui Song static const unsigned int tdm_d4_z_pins[]		= { GPIOZ_2 };
342775214d3SQianggui Song static const unsigned int tdm_d5_z_pins[]		= { GPIOZ_3 };
343775214d3SQianggui Song static const unsigned int tdm_d6_pins[]			= { GPIOZ_4 };
344775214d3SQianggui Song static const unsigned int tdm_d7_pins[]			= { GPIOZ_5 };
345775214d3SQianggui Song static const unsigned int mclk_2_pins[]			= { GPIOZ_6 };
346775214d3SQianggui Song static const unsigned int spdif_out_z_pins[]		= { GPIOZ_9 };
347775214d3SQianggui Song static const unsigned int dtv_a_if_agc_z10_pins[]	= { GPIOZ_10 };
348775214d3SQianggui Song static const unsigned int uart_e_tx_z11_pins[]		= { GPIOZ_11 };
349775214d3SQianggui Song static const unsigned int uart_e_rx_z12_pins[]		= { GPIOZ_12 };
350775214d3SQianggui Song 
351775214d3SQianggui Song /* Bank Z func2 */
352775214d3SQianggui Song static const unsigned int tsin_a_clk_pins[]		= { GPIOZ_0 };
353775214d3SQianggui Song static const unsigned int tsin_a_sop_pins[]		= { GPIOZ_1 };
354775214d3SQianggui Song static const unsigned int tsin_a_valid_pins[]		= { GPIOZ_2 };
355775214d3SQianggui Song static const unsigned int tsin_a_din0_pins[]		= { GPIOZ_3 };
356775214d3SQianggui Song static const unsigned int dtv_a_if_agc_z6_pins[]	= { GPIOZ_6 };
357775214d3SQianggui Song static const unsigned int dtv_b_if_agc_pins[]		= { GPIOZ_7 };
358775214d3SQianggui Song static const unsigned int i2c3_sda_z_pins[]		= { GPIOZ_8 };
359775214d3SQianggui Song static const unsigned int i2c3_scl_z_pins[]		= { GPIOZ_9 };
360775214d3SQianggui Song static const unsigned int dtv_a_rf_agc_pins[]		= { GPIOZ_10 };
361775214d3SQianggui Song static const unsigned int dtv_b_rf_agc_pins[]		= { GPIOZ_11 };
362775214d3SQianggui Song 
363775214d3SQianggui Song /* Bank Z func3 */
364775214d3SQianggui Song static const unsigned int sdcard_d0_z_pins[]		= { GPIOZ_0 };
365775214d3SQianggui Song static const unsigned int sdcard_d1_z_pins[]		= { GPIOZ_1 };
366775214d3SQianggui Song static const unsigned int sdcard_d2_z_pins[]		= { GPIOZ_2 };
367775214d3SQianggui Song static const unsigned int sdcard_d3_z_pins[]		= { GPIOZ_3 };
368775214d3SQianggui Song static const unsigned int sdcard_clk_z_pins[]		= { GPIOZ_4 };
369775214d3SQianggui Song static const unsigned int sdcard_cmd_z_pins[]		= { GPIOZ_5 };
370775214d3SQianggui Song static const unsigned int uart_e_tx_z8_pins[]		= { GPIOZ_8 };
371775214d3SQianggui Song static const unsigned int uart_e_rx_z9_pins[]		= { GPIOZ_9 };
372775214d3SQianggui Song static const unsigned int pdm_din1_z_pins[]		= { GPIOZ_10 };
373775214d3SQianggui Song static const unsigned int pdm_din0_z_pins[]		= { GPIOZ_11 };
374775214d3SQianggui Song static const unsigned int pdm_dclk_z_pins[]		= { GPIOZ_12 };
375775214d3SQianggui Song 
376775214d3SQianggui Song /* Bank Z func4 */
377775214d3SQianggui Song static const unsigned int spi_a_miso_z_pins[]		= { GPIOZ_0 };
378775214d3SQianggui Song static const unsigned int spi_a_mosi_z_pins[]		= { GPIOZ_1 };
379775214d3SQianggui Song static const unsigned int spi_a_clk_z_pins[]		= { GPIOZ_2 };
380775214d3SQianggui Song static const unsigned int spi_a_ss0_z_pins[]		= { GPIOZ_3 };
381775214d3SQianggui Song static const unsigned int spi_a_ss1_z_pins[]		= { GPIOZ_4 };
382775214d3SQianggui Song static const unsigned int spi_a_ss2_z_pins[]		= { GPIOZ_5 };
383775214d3SQianggui Song static const unsigned int i2c4_scl_z_pins[]		= { GPIOZ_11 };
384775214d3SQianggui Song static const unsigned int i2c4_sda_z_pins[]		= { GPIOZ_12 };
385775214d3SQianggui Song 
386775214d3SQianggui Song /* Bank Z func5 */
387775214d3SQianggui Song static const unsigned int uart_d_tx_z_pins[]		= { GPIOZ_0 };
388775214d3SQianggui Song static const unsigned int uart_d_rx_z_pins[]		= { GPIOZ_1 };
389775214d3SQianggui Song static const unsigned int uart_d_cts_z_pins[]		= { GPIOZ_2 };
390775214d3SQianggui Song static const unsigned int uart_d_rts_z_pins[]		= { GPIOZ_3 };
391775214d3SQianggui Song static const unsigned int pwm_g_z_pins[]		= { GPIOZ_4 };
392775214d3SQianggui Song static const unsigned int pwm_f_z_pins[]		= { GPIOZ_5 };
393775214d3SQianggui Song static const unsigned int pwm_e_z_pins[]		= { GPIOZ_6 };
394775214d3SQianggui Song static const unsigned int tsin_b_clk_z_pins[]		= { GPIOZ_7 };
395775214d3SQianggui Song static const unsigned int tsin_b_sop_z_pins[]		= { GPIOZ_10 };
396775214d3SQianggui Song static const unsigned int tsin_b_valid_z_pins[]		= { GPIOZ_11 };
397775214d3SQianggui Song static const unsigned int tsin_b_d0_z_pins[]		= { GPIOZ_12 };
398775214d3SQianggui Song 
399775214d3SQianggui Song /* Bank Z func6 */
400775214d3SQianggui Song static const unsigned int s2_demod_gpio7_pins[]		= { GPIOZ_0 };
401775214d3SQianggui Song static const unsigned int s2_demod_gpio6_pins[]		= { GPIOZ_1 };
402775214d3SQianggui Song static const unsigned int s2_demod_gpio5_pins[]		= { GPIOZ_2 };
403775214d3SQianggui Song static const unsigned int s2_demod_gpio4_pins[]		= { GPIOZ_3 };
404775214d3SQianggui Song static const unsigned int s2_demod_gpio3_pins[]		= { GPIOZ_4 };
405775214d3SQianggui Song static const unsigned int s2_demod_gpio2_pins[]		= { GPIOZ_5 };
406775214d3SQianggui Song static const unsigned int diseqc_out_pins[]		= { GPIOZ_7 };
407775214d3SQianggui Song static const unsigned int s2_demod_gpio1_pins[]		= { GPIOZ_8 };
408775214d3SQianggui Song static const unsigned int s2_demod_gpio0_pins[]		= { GPIOZ_12 };
409775214d3SQianggui Song 
410775214d3SQianggui Song /* Bank Z func7 */
411775214d3SQianggui Song static const unsigned int gen_clk_z9_pins[]		= { GPIOZ_9 };
412775214d3SQianggui Song static const unsigned int gen_clk_z12_pins[]		= { GPIOZ_12 };
413775214d3SQianggui Song 
414*8a74a53eSChristophe JAILLET static const struct meson_pmx_group meson_s4_periphs_groups[] = {
415775214d3SQianggui Song 	GPIO_GROUP(GPIOE_0),
416775214d3SQianggui Song 	GPIO_GROUP(GPIOE_1),
417775214d3SQianggui Song 
418775214d3SQianggui Song 	GPIO_GROUP(GPIOB_0),
419775214d3SQianggui Song 	GPIO_GROUP(GPIOB_1),
420775214d3SQianggui Song 	GPIO_GROUP(GPIOB_2),
421775214d3SQianggui Song 	GPIO_GROUP(GPIOB_3),
422775214d3SQianggui Song 	GPIO_GROUP(GPIOB_4),
423775214d3SQianggui Song 	GPIO_GROUP(GPIOB_5),
424775214d3SQianggui Song 	GPIO_GROUP(GPIOB_6),
425775214d3SQianggui Song 	GPIO_GROUP(GPIOB_7),
426775214d3SQianggui Song 	GPIO_GROUP(GPIOB_8),
427775214d3SQianggui Song 	GPIO_GROUP(GPIOB_9),
428775214d3SQianggui Song 	GPIO_GROUP(GPIOB_10),
429775214d3SQianggui Song 	GPIO_GROUP(GPIOB_11),
430775214d3SQianggui Song 	GPIO_GROUP(GPIOB_12),
431775214d3SQianggui Song 	GPIO_GROUP(GPIOB_13),
432775214d3SQianggui Song 
433775214d3SQianggui Song 	GPIO_GROUP(GPIOC_0),
434775214d3SQianggui Song 	GPIO_GROUP(GPIOC_1),
435775214d3SQianggui Song 	GPIO_GROUP(GPIOC_2),
436775214d3SQianggui Song 	GPIO_GROUP(GPIOC_3),
437775214d3SQianggui Song 	GPIO_GROUP(GPIOC_4),
438775214d3SQianggui Song 	GPIO_GROUP(GPIOC_5),
439775214d3SQianggui Song 	GPIO_GROUP(GPIOC_6),
440775214d3SQianggui Song 	GPIO_GROUP(GPIOC_7),
441775214d3SQianggui Song 
442775214d3SQianggui Song 	GPIO_GROUP(GPIOD_0),
443775214d3SQianggui Song 	GPIO_GROUP(GPIOD_1),
444775214d3SQianggui Song 	GPIO_GROUP(GPIOD_2),
445775214d3SQianggui Song 	GPIO_GROUP(GPIOD_3),
446775214d3SQianggui Song 	GPIO_GROUP(GPIOD_4),
447775214d3SQianggui Song 	GPIO_GROUP(GPIOD_5),
448775214d3SQianggui Song 	GPIO_GROUP(GPIOD_6),
449775214d3SQianggui Song 	GPIO_GROUP(GPIOD_7),
450775214d3SQianggui Song 	GPIO_GROUP(GPIOD_8),
451775214d3SQianggui Song 	GPIO_GROUP(GPIOD_9),
452775214d3SQianggui Song 	GPIO_GROUP(GPIOD_10),
453775214d3SQianggui Song 	GPIO_GROUP(GPIOD_11),
454775214d3SQianggui Song 
455775214d3SQianggui Song 	GPIO_GROUP(GPIOH_0),
456775214d3SQianggui Song 	GPIO_GROUP(GPIOH_1),
457775214d3SQianggui Song 	GPIO_GROUP(GPIOH_2),
458775214d3SQianggui Song 	GPIO_GROUP(GPIOH_3),
459775214d3SQianggui Song 	GPIO_GROUP(GPIOH_4),
460775214d3SQianggui Song 	GPIO_GROUP(GPIOH_5),
461775214d3SQianggui Song 	GPIO_GROUP(GPIOH_6),
462775214d3SQianggui Song 	GPIO_GROUP(GPIOH_7),
463775214d3SQianggui Song 	GPIO_GROUP(GPIOH_8),
464775214d3SQianggui Song 	GPIO_GROUP(GPIOH_9),
465775214d3SQianggui Song 	GPIO_GROUP(GPIOH_10),
466775214d3SQianggui Song 	GPIO_GROUP(GPIOH_11),
467775214d3SQianggui Song 
468775214d3SQianggui Song 	GPIO_GROUP(GPIOX_0),
469775214d3SQianggui Song 	GPIO_GROUP(GPIOX_1),
470775214d3SQianggui Song 	GPIO_GROUP(GPIOX_2),
471775214d3SQianggui Song 	GPIO_GROUP(GPIOX_3),
472775214d3SQianggui Song 	GPIO_GROUP(GPIOX_4),
473775214d3SQianggui Song 	GPIO_GROUP(GPIOX_5),
474775214d3SQianggui Song 	GPIO_GROUP(GPIOX_6),
475775214d3SQianggui Song 	GPIO_GROUP(GPIOX_7),
476775214d3SQianggui Song 	GPIO_GROUP(GPIOX_8),
477775214d3SQianggui Song 	GPIO_GROUP(GPIOX_9),
478775214d3SQianggui Song 	GPIO_GROUP(GPIOX_10),
479775214d3SQianggui Song 	GPIO_GROUP(GPIOX_11),
480775214d3SQianggui Song 	GPIO_GROUP(GPIOX_12),
481775214d3SQianggui Song 	GPIO_GROUP(GPIOX_13),
482775214d3SQianggui Song 	GPIO_GROUP(GPIOX_14),
483775214d3SQianggui Song 	GPIO_GROUP(GPIOX_15),
484775214d3SQianggui Song 	GPIO_GROUP(GPIOX_16),
485775214d3SQianggui Song 	GPIO_GROUP(GPIOX_17),
486775214d3SQianggui Song 	GPIO_GROUP(GPIOX_18),
487775214d3SQianggui Song 	GPIO_GROUP(GPIOX_19),
488775214d3SQianggui Song 
489775214d3SQianggui Song 	GPIO_GROUP(GPIOZ_0),
490775214d3SQianggui Song 	GPIO_GROUP(GPIOZ_1),
491775214d3SQianggui Song 	GPIO_GROUP(GPIOZ_2),
492775214d3SQianggui Song 	GPIO_GROUP(GPIOZ_3),
493775214d3SQianggui Song 	GPIO_GROUP(GPIOZ_4),
494775214d3SQianggui Song 	GPIO_GROUP(GPIOZ_5),
495775214d3SQianggui Song 	GPIO_GROUP(GPIOZ_6),
496775214d3SQianggui Song 	GPIO_GROUP(GPIOZ_7),
497775214d3SQianggui Song 	GPIO_GROUP(GPIOZ_8),
498775214d3SQianggui Song 	GPIO_GROUP(GPIOZ_9),
499775214d3SQianggui Song 	GPIO_GROUP(GPIOZ_10),
500775214d3SQianggui Song 	GPIO_GROUP(GPIOZ_11),
501775214d3SQianggui Song 	GPIO_GROUP(GPIOZ_12),
502775214d3SQianggui Song 
503775214d3SQianggui Song 	GPIO_GROUP(GPIO_TEST_N),
504775214d3SQianggui Song 
505775214d3SQianggui Song 	/* BANK E func1 */
506775214d3SQianggui Song 	GROUP(i2c0_sda,			1),
507775214d3SQianggui Song 	GROUP(i2c0_scl,			1),
508775214d3SQianggui Song 
509775214d3SQianggui Song 	/* BANK E func2 */
510775214d3SQianggui Song 	GROUP(uart_b_tx_e,		2),
511775214d3SQianggui Song 	GROUP(uart_b_rx_e,		2),
512775214d3SQianggui Song 
513775214d3SQianggui Song 	/* BANK E func3 */
514775214d3SQianggui Song 	GROUP(pwm_h,			3),
515775214d3SQianggui Song 	GROUP(pwm_j,			3),
516775214d3SQianggui Song 
517775214d3SQianggui Song 	/* BANK B func1 */
518775214d3SQianggui Song 	GROUP(emmc_nand_d0,		1),
519775214d3SQianggui Song 	GROUP(emmc_nand_d1,		1),
520775214d3SQianggui Song 	GROUP(emmc_nand_d2,		1),
521775214d3SQianggui Song 	GROUP(emmc_nand_d3,		1),
522775214d3SQianggui Song 	GROUP(emmc_nand_d4,		1),
523775214d3SQianggui Song 	GROUP(emmc_nand_d5,		1),
524775214d3SQianggui Song 	GROUP(emmc_nand_d6,		1),
525775214d3SQianggui Song 	GROUP(emmc_nand_d7,		1),
526775214d3SQianggui Song 	GROUP(emmc_clk,			1),
527775214d3SQianggui Song 	GROUP(emmc_rst,			1),
528775214d3SQianggui Song 	GROUP(emmc_cmd,			1),
529775214d3SQianggui Song 	GROUP(emmc_nand_ds,		1),
530775214d3SQianggui Song 
531775214d3SQianggui Song 	/* Bank B func2 */
532775214d3SQianggui Song 	GROUP(nand_wen_clk,		2),
533775214d3SQianggui Song 	GROUP(nand_ale,			2),
534775214d3SQianggui Song 	GROUP(nand_ren_wr,		2),
535775214d3SQianggui Song 	GROUP(nand_cle,			2),
536775214d3SQianggui Song 	GROUP(nand_ce0,			2),
537775214d3SQianggui Song 
538775214d3SQianggui Song 	/* Bank B func3 */
539775214d3SQianggui Song 	GROUP(spif_hold,		3),
540775214d3SQianggui Song 	GROUP(spif_mo,			3),
541775214d3SQianggui Song 	GROUP(spif_mi,			3),
542775214d3SQianggui Song 	GROUP(spif_clk,			3),
543775214d3SQianggui Song 	GROUP(spif_wp,			3),
544775214d3SQianggui Song 	GROUP(spif_cs,			3),
545775214d3SQianggui Song 
546775214d3SQianggui Song 	/* Bank C func1 */
547775214d3SQianggui Song 	GROUP(sdcard_d0_c,		1),
548775214d3SQianggui Song 	GROUP(sdcard_d1_c,		1),
549775214d3SQianggui Song 	GROUP(sdcard_d2_c,		1),
550775214d3SQianggui Song 	GROUP(sdcard_d3_c,		1),
551775214d3SQianggui Song 	GROUP(sdcard_clk_c,		1),
552775214d3SQianggui Song 	GROUP(sdcard_cmd_c,		1),
553775214d3SQianggui Song 	GROUP(sdcard_cd,		1),
554775214d3SQianggui Song 
555775214d3SQianggui Song 	/* Bank C func2 */
556775214d3SQianggui Song 	GROUP(jtag_2_tdo,		2),
557775214d3SQianggui Song 	GROUP(jtag_2_tdi,		2),
558775214d3SQianggui Song 	GROUP(uart_b_rx_c,		2),
559775214d3SQianggui Song 	GROUP(uart_b_tx_c,		2),
560775214d3SQianggui Song 	GROUP(jtag_2_clk,		2),
561775214d3SQianggui Song 	GROUP(jtag_2_tms,		2),
562775214d3SQianggui Song 	GROUP(i2c1_sda_c,		2),
563775214d3SQianggui Song 	GROUP(i2c1_scl_c,		2),
564775214d3SQianggui Song 
565775214d3SQianggui Song 	/* Bank C func3 */
566775214d3SQianggui Song 	GROUP(pdm_din1_c,		3),
567775214d3SQianggui Song 	GROUP(pdm_din0_c,		3),
568775214d3SQianggui Song 	GROUP(i2c4_sda_c,		3),
569775214d3SQianggui Song 	GROUP(i2c4_scl_c,		3),
570775214d3SQianggui Song 	GROUP(pdm_dclk_c,		3),
571775214d3SQianggui Song 	GROUP(iso7816_clk_c,		3),
572775214d3SQianggui Song 	GROUP(iso7816_data_c,		3),
573775214d3SQianggui Song 
574775214d3SQianggui Song 	/* Bank C func4 */
575775214d3SQianggui Song 	GROUP(tdm_d2_c,			4),
576775214d3SQianggui Song 	GROUP(tdm_d3_c,			4),
577775214d3SQianggui Song 	GROUP(tdm_fs1_c,		4),
57834069de3SQianggui Song 	GROUP(tdm_sclk1_c,		4),
579775214d3SQianggui Song 	GROUP(mclk_1_c,			4),
580775214d3SQianggui Song 	GROUP(tdm_d4_c,			4),
581775214d3SQianggui Song 	GROUP(tdm_d5_c,			4),
582775214d3SQianggui Song 
583775214d3SQianggui Song 	/* Bank D func1 */
584775214d3SQianggui Song 	GROUP(uart_b_tx_d,		1),
585775214d3SQianggui Song 	GROUP(uart_b_rx_d,		1),
586775214d3SQianggui Song 	GROUP(uart_b_cts_d,		1),
587775214d3SQianggui Song 	GROUP(uart_b_rts_d,		1),
588775214d3SQianggui Song 	GROUP(remote_out,		1),
589775214d3SQianggui Song 	GROUP(remote_in,		1),
590775214d3SQianggui Song 	GROUP(jtag_1_clk,		1),
591775214d3SQianggui Song 	GROUP(jtag_1_tms,		1),
592775214d3SQianggui Song 	GROUP(jtag_1_tdi,		1),
593775214d3SQianggui Song 	GROUP(jtag_1_tdo,		1),
594775214d3SQianggui Song 	GROUP(clk12_24,			1),
595775214d3SQianggui Song 	GROUP(pwm_g_hiz,		1),
596775214d3SQianggui Song 
597775214d3SQianggui Song 	/* Bank D func2 */
598775214d3SQianggui Song 	GROUP(i2c4_sda_d,		2),
599775214d3SQianggui Song 	GROUP(i2c4_scl_d,		2),
600775214d3SQianggui Song 	GROUP(mclk_1_d,			2),
601775214d3SQianggui Song 	GROUP(tdm_sclk1_d,		2),
602775214d3SQianggui Song 	GROUP(tdm_fs1_d,		2),
603775214d3SQianggui Song 	GROUP(tdm_d4_d,			2),
604775214d3SQianggui Song 	GROUP(tdm_d3_d,			2),
605775214d3SQianggui Song 	GROUP(tdm_d2_d,			2),
606775214d3SQianggui Song 	GROUP(pwm_g_d,			2),
607775214d3SQianggui Song 
608775214d3SQianggui Song 	/* Bank D func3 */
609775214d3SQianggui Song 	GROUP(uart_c_tx,		3),
610775214d3SQianggui Song 	GROUP(uart_c_rx,		3),
611775214d3SQianggui Song 	GROUP(pwm_b_d,			3),
612775214d3SQianggui Song 	GROUP(pwm_a_d,			3),
613775214d3SQianggui Song 	GROUP(pwm_c_d,			3),
614775214d3SQianggui Song 	GROUP(pwm_d_d,			3),
615775214d3SQianggui Song 	GROUP(pwm_i_d,			3),
616775214d3SQianggui Song 
617775214d3SQianggui Song 	/* Bank D func4 */
618775214d3SQianggui Song 	GROUP(clk_32k_in,		4),
619775214d3SQianggui Song 	GROUP(pwm_b_hiz,		4),
620775214d3SQianggui Song 	GROUP(pwm_a_hiz,		4),
621775214d3SQianggui Song 	GROUP(pwm_c_hiz,		4),
622775214d3SQianggui Song 	GROUP(pdm_dclk_d,		4),
623775214d3SQianggui Song 	GROUP(pdm_din0_d,		4),
624775214d3SQianggui Song 	GROUP(pdm_din1_d,		4),
625775214d3SQianggui Song 
626775214d3SQianggui Song 	/* Bank D func5 */
627775214d3SQianggui Song 	GROUP(mic_mute_en,		5),
628775214d3SQianggui Song 	GROUP(mic_mute_key,		5),
629775214d3SQianggui Song 	GROUP(i2c1_sda_d,		5),
630775214d3SQianggui Song 	GROUP(i2c1_scl_d,		5),
631775214d3SQianggui Song 	GROUP(i2c2_sda_d,		5),
632775214d3SQianggui Song 	GROUP(i2c2_scl_d,		5),
633775214d3SQianggui Song 
634775214d3SQianggui Song 	/* Bank D func6 */
635775214d3SQianggui Song 	GROUP(gen_clk_d,		6),
636775214d3SQianggui Song 	GROUP(tsin_b_clk_c,		6),
637775214d3SQianggui Song 	GROUP(tsin_b_sop_c,		6),
638775214d3SQianggui Song 	GROUP(tsin_b_valid_c,		6),
639775214d3SQianggui Song 	GROUP(tsin_b_d0_c,		6),
640775214d3SQianggui Song 
641775214d3SQianggui Song 	/* Bank H func1 */
642775214d3SQianggui Song 	GROUP(hdmitx_sda,		1),
643775214d3SQianggui Song 	GROUP(hdmitx_sck,		1),
644775214d3SQianggui Song 	GROUP(hdmitx_hpd_in,		1),
645775214d3SQianggui Song 	GROUP(ao_cec_a,			1),
646775214d3SQianggui Song 	GROUP(spdif_out_h,		1),
647775214d3SQianggui Song 	GROUP(spdif_in,			1),
648775214d3SQianggui Song 	GROUP(i2c1_sda_h,		1),
649775214d3SQianggui Song 	GROUP(i2c1_scl_h,		1),
650775214d3SQianggui Song 	GROUP(i2c2_sda_h8,		1),
651775214d3SQianggui Song 	GROUP(i2c2_scl_h9,		1),
652775214d3SQianggui Song 	GROUP(eth_link_led,		1),
653775214d3SQianggui Song 	GROUP(eth_act_led,		1),
654775214d3SQianggui Song 
655775214d3SQianggui Song 	/* Bank H func2 */
656775214d3SQianggui Song 	GROUP(i2c2_sda_h0,		2),
657775214d3SQianggui Song 	GROUP(i2c2_scl_h1,		2),
658775214d3SQianggui Song 	GROUP(ao_cec_b,			2),
659775214d3SQianggui Song 	GROUP(uart_d_tx_h,		2),
660775214d3SQianggui Song 	GROUP(uart_d_rx_h,		2),
661775214d3SQianggui Song 	GROUP(uart_d_cts_h,		2),
662775214d3SQianggui Song 	GROUP(uart_d_rts_h,		2),
663775214d3SQianggui Song 	GROUP(iso7816_clk_h,		2),
664775214d3SQianggui Song 	GROUP(iso7816_data_h,		2),
665775214d3SQianggui Song 	GROUP(uart_e_tx_h,		2),
666775214d3SQianggui Song 	GROUP(uart_e_rx_h,		2),
667775214d3SQianggui Song 
668775214d3SQianggui Song 	/* Bank H func3 */
669775214d3SQianggui Song 	GROUP(pwm_d_h,			3),
670775214d3SQianggui Song 	GROUP(pwm_i_h,			3),
671775214d3SQianggui Song 	GROUP(pdm_dclk_h,		3),
672775214d3SQianggui Song 	GROUP(pdm_din0_h,		3),
673775214d3SQianggui Song 	GROUP(pdm_din1_h,		3),
674775214d3SQianggui Song 
675775214d3SQianggui Song 	/* Bank H func4 */
676775214d3SQianggui Song 	GROUP(mclk_1_h,			4),
677775214d3SQianggui Song 	GROUP(tdm_sclk1_h,		4),
678775214d3SQianggui Song 	GROUP(tdm_fs1_h,		4),
679775214d3SQianggui Song 	GROUP(tdm_d2_h,			4),
680775214d3SQianggui Song 	GROUP(tdm_d3_h,			4),
681775214d3SQianggui Song 	GROUP(tdm_d4_h,			4),
682775214d3SQianggui Song 
683775214d3SQianggui Song 	/* Bank H func5 */
684775214d3SQianggui Song 	GROUP(spi_a_miso_h,		5),
685775214d3SQianggui Song 	GROUP(spi_a_mosi_h,		5),
686775214d3SQianggui Song 	GROUP(spi_a_clk_h,		5),
687775214d3SQianggui Song 	GROUP(spi_a_ss0_h,		5),
688775214d3SQianggui Song 
689775214d3SQianggui Song 	/* Bank H func6 */
690775214d3SQianggui Song 	GROUP(gen_clk_h,		6),
691775214d3SQianggui Song 	GROUP(tsin_b1_clk,		6),
692775214d3SQianggui Song 	GROUP(tsin_b1_sop,		6),
693775214d3SQianggui Song 	GROUP(tsin_b1_valid,		6),
694775214d3SQianggui Song 	GROUP(tsin_b1_d0,		6),
695775214d3SQianggui Song 
696775214d3SQianggui Song 	/* Bank X func1 */
697775214d3SQianggui Song 	GROUP(sdio_d0,			1),
698775214d3SQianggui Song 	GROUP(sdio_d1,			1),
699775214d3SQianggui Song 	GROUP(sdio_d2,			1),
700775214d3SQianggui Song 	GROUP(sdio_d3,			1),
701775214d3SQianggui Song 	GROUP(sdio_clk,			1),
702775214d3SQianggui Song 	GROUP(sdio_cmd,			1),
703775214d3SQianggui Song 	GROUP(pwm_a_x,			1),
704775214d3SQianggui Song 	GROUP(pwm_f_x,			1),
705775214d3SQianggui Song 	GROUP(tdm_d1,			1),
706775214d3SQianggui Song 	GROUP(tdm_d0,			1),
707775214d3SQianggui Song 	GROUP(tdm_fs0,			1),
708775214d3SQianggui Song 	GROUP(tdm_sclk0,		1),
709775214d3SQianggui Song 	GROUP(uart_a_tx,		1),
710775214d3SQianggui Song 	GROUP(uart_a_rx,		1),
711775214d3SQianggui Song 	GROUP(uart_a_cts,		1),
712775214d3SQianggui Song 	GROUP(uart_a_rts,		1),
713775214d3SQianggui Song 	GROUP(pwm_e_x,			1),
714775214d3SQianggui Song 	GROUP(i2c1_sda_x,		1),
715775214d3SQianggui Song 	GROUP(i2c1_scl_x,		1),
716775214d3SQianggui Song 	GROUP(pwm_b_x,			1),
717775214d3SQianggui Song 
718775214d3SQianggui Song 	/* Bank X func2 */
719775214d3SQianggui Song 	GROUP(pdm_din0_x,		2),
720775214d3SQianggui Song 	GROUP(pdm_din1_x,		2),
721775214d3SQianggui Song 	GROUP(pdm_dclk_x,		2),
722775214d3SQianggui Song 
723775214d3SQianggui Song 	/* Bank X func3 */
724775214d3SQianggui Song 	GROUP(spi_a_mosi_x,		3),
725775214d3SQianggui Song 	GROUP(spi_a_miso_x,		3),
726775214d3SQianggui Song 	GROUP(spi_a_ss0_x,		3),
727775214d3SQianggui Song 	GROUP(spi_a_clk_x,		3),
728775214d3SQianggui Song 
729775214d3SQianggui Song 	/* Bank X func4 */
730775214d3SQianggui Song 	GROUP(pwm_c_x,			4),
731775214d3SQianggui Song 	GROUP(i2c_slave_scl,		4),
732775214d3SQianggui Song 	GROUP(i2c_slave_sda,		4),
733775214d3SQianggui Song 
734775214d3SQianggui Song 	/* Bank X func5 */
735775214d3SQianggui Song 	GROUP(i2c3_sda_x,		5),
736775214d3SQianggui Song 	GROUP(i2c3_scl_x,		5),
737775214d3SQianggui Song 
738775214d3SQianggui Song 	/* Bank Z func1 */
739775214d3SQianggui Song 	GROUP(tdm_fs2,			1),
740775214d3SQianggui Song 	GROUP(tdm_sclk2,		1),
741775214d3SQianggui Song 	GROUP(tdm_d4_z,			1),
742775214d3SQianggui Song 	GROUP(tdm_d5_z,			1),
743775214d3SQianggui Song 	GROUP(tdm_d6,			1),
744775214d3SQianggui Song 	GROUP(tdm_d7,			1),
745775214d3SQianggui Song 	GROUP(mclk_2,			1),
746775214d3SQianggui Song 	GROUP(spdif_out_z,		1),
747775214d3SQianggui Song 	GROUP(dtv_a_if_agc_z10,		1),
748775214d3SQianggui Song 	GROUP(uart_e_tx_z11,		1),
749775214d3SQianggui Song 	GROUP(uart_e_rx_z12,		1),
750775214d3SQianggui Song 
751775214d3SQianggui Song 	/* Bank Z func2 */
752775214d3SQianggui Song 	GROUP(tsin_a_clk,		2),
753775214d3SQianggui Song 	GROUP(tsin_a_sop,		2),
754775214d3SQianggui Song 	GROUP(tsin_a_valid,		2),
755775214d3SQianggui Song 	GROUP(tsin_a_din0,		2),
756775214d3SQianggui Song 	GROUP(dtv_a_if_agc_z6,		2),
757775214d3SQianggui Song 	GROUP(dtv_b_if_agc,		2),
758775214d3SQianggui Song 	GROUP(i2c3_sda_z,		2),
759775214d3SQianggui Song 	GROUP(i2c3_scl_z,		2),
760775214d3SQianggui Song 	GROUP(dtv_a_rf_agc,		2),
761775214d3SQianggui Song 	GROUP(dtv_b_rf_agc,		2),
762775214d3SQianggui Song 
763775214d3SQianggui Song 	/* Bank Z func3 */
764775214d3SQianggui Song 	GROUP(sdcard_d0_z,		3),
765775214d3SQianggui Song 	GROUP(sdcard_d1_z,		3),
766775214d3SQianggui Song 	GROUP(sdcard_d2_z,		3),
767775214d3SQianggui Song 	GROUP(sdcard_d3_z,		3),
768775214d3SQianggui Song 	GROUP(sdcard_clk_z,		3),
769775214d3SQianggui Song 	GROUP(sdcard_cmd_z,		3),
770775214d3SQianggui Song 	GROUP(uart_e_tx_z8,		3),
771775214d3SQianggui Song 	GROUP(uart_e_rx_z9,		3),
772775214d3SQianggui Song 	GROUP(pdm_din1_z,		3),
773775214d3SQianggui Song 	GROUP(pdm_din0_z,		3),
774775214d3SQianggui Song 	GROUP(pdm_dclk_z,		3),
775775214d3SQianggui Song 
776775214d3SQianggui Song 	/* Bank Z func4 */
777775214d3SQianggui Song 	GROUP(spi_a_miso_z,		4),
778775214d3SQianggui Song 	GROUP(spi_a_mosi_z,		4),
779775214d3SQianggui Song 	GROUP(spi_a_clk_z,		4),
780775214d3SQianggui Song 	GROUP(spi_a_ss0_z,		4),
781775214d3SQianggui Song 	GROUP(spi_a_ss1_z,		4),
782775214d3SQianggui Song 	GROUP(spi_a_ss2_z,		4),
783775214d3SQianggui Song 	GROUP(i2c4_scl_z,		4),
784775214d3SQianggui Song 	GROUP(i2c4_sda_z,		4),
785775214d3SQianggui Song 
786775214d3SQianggui Song 	/* Bank Z func5 */
787775214d3SQianggui Song 	GROUP(uart_d_tx_z,		5),
788775214d3SQianggui Song 	GROUP(uart_d_rx_z,		5),
789775214d3SQianggui Song 	GROUP(uart_d_cts_z,		5),
790775214d3SQianggui Song 	GROUP(uart_d_rts_z,		5),
791775214d3SQianggui Song 	GROUP(pwm_g_z,			5),
792775214d3SQianggui Song 	GROUP(pwm_f_z,			5),
793775214d3SQianggui Song 	GROUP(pwm_e_z,			5),
794775214d3SQianggui Song 	GROUP(tsin_b_clk_z,		5),
795775214d3SQianggui Song 	GROUP(tsin_b_sop_z,		5),
796775214d3SQianggui Song 	GROUP(tsin_b_valid_z,		5),
797775214d3SQianggui Song 	GROUP(tsin_b_d0_z,		5),
798775214d3SQianggui Song 
799775214d3SQianggui Song 	/* Bank Z func6 */
800775214d3SQianggui Song 	GROUP(s2_demod_gpio7,		6),
801775214d3SQianggui Song 	GROUP(s2_demod_gpio6,		6),
802775214d3SQianggui Song 	GROUP(s2_demod_gpio5,		6),
803775214d3SQianggui Song 	GROUP(s2_demod_gpio4,		6),
804775214d3SQianggui Song 	GROUP(s2_demod_gpio3,		6),
805775214d3SQianggui Song 	GROUP(s2_demod_gpio2,		6),
806775214d3SQianggui Song 	GROUP(diseqc_out,		6),
807775214d3SQianggui Song 	GROUP(s2_demod_gpio1,		6),
808775214d3SQianggui Song 	GROUP(s2_demod_gpio0,		6),
809775214d3SQianggui Song 
810775214d3SQianggui Song 	/* Bank Z func7 */
811775214d3SQianggui Song 	GROUP(gen_clk_z9,		7),
812775214d3SQianggui Song 	GROUP(gen_clk_z12,		7),
813775214d3SQianggui Song };
814775214d3SQianggui Song 
815775214d3SQianggui Song static const char * const gpio_periphs_groups[] = {
816775214d3SQianggui Song 	"GPIOE_0", "GPIOE_1",
817775214d3SQianggui Song 
818775214d3SQianggui Song 	"GPIOB_0", "GPIOB_1", "GPIOB_2", "GPIOB_3", "GPIOB_4", "GPIOB_5",
819775214d3SQianggui Song 	"GPIOB_6", "GPIOB_7", "GPIOB_8", "GPIOB_9", "GPIOB_10", "GPIOB_11",
820775214d3SQianggui Song 	"GPIOB_12", "GPIOB_13",
821775214d3SQianggui Song 
822775214d3SQianggui Song 	"GPIOC_0", "GPIOC_1", "GPIOC_2", "GPIOC_3", "GPIOC_4", "GPIOC_5",
823775214d3SQianggui Song 	"GPIOC_6", "GPIOC_7",
824775214d3SQianggui Song 
825775214d3SQianggui Song 	"GPIOD_0", "GPIOD_1", "GPIOD_2", "GPIOD_3", "GPIOD_4", "GPIOD_5",
826775214d3SQianggui Song 	"GPIOD_6", "GPIOD_7", "GPIOD_8", "GPIOD_9", "GPIOD_10", "GPIOD_11",
827775214d3SQianggui Song 
828775214d3SQianggui Song 	"GPIOH_0", "GPIOH_1", "GPIOH_2", "GPIOH_3", "GPIOH_4", "GPIOH_5",
829775214d3SQianggui Song 	"GPIOH_6", "GPIOH_7", "GPIOH_8", "GPIOH_9", "GPIOH_10", "GPIOH_11",
830775214d3SQianggui Song 
831775214d3SQianggui Song 	"GPIOX_0", "GPIOX_1", "GPIOX_2", "GPIOX_3", "GPIOX_4", "GPIOX_5",
832775214d3SQianggui Song 	"GPIOX_6", "GPIOX_7", "GPIOX_8", "GPIOX_9", "GPIOX_10", "GPIOX_11",
833775214d3SQianggui Song 	"GPIOX_12", "GPIOX_13", "GPIOX_14", "GPIOX_15", "GPIOX_16", "GPIOX_17",
834775214d3SQianggui Song 	"GPIOX_18", "GPIOX_19",
835775214d3SQianggui Song 
836775214d3SQianggui Song 	"GPIOZ_0", "GPIOZ_1", "GPIOZ_2", "GPIOZ_3", "GPIOZ_4", "GPIOZ_5",
837775214d3SQianggui Song 	"GPIOZ_6", "GPIOZ_7", "GPIOZ_8", "GPIOZ_9", "GPIOZ_10",
838775214d3SQianggui Song 	"GPIOZ_11", "GPIOZ_12",
839775214d3SQianggui Song 
840775214d3SQianggui Song 	"GPIO_TEST_N",
841775214d3SQianggui Song };
842775214d3SQianggui Song 
843775214d3SQianggui Song static const char * const i2c0_groups[] = {
844775214d3SQianggui Song 	"i2c0_sda", "i2c0_scl",
845775214d3SQianggui Song };
846775214d3SQianggui Song 
847775214d3SQianggui Song static const char * const i2c1_groups[] = {
848775214d3SQianggui Song 	"i2c1_sda_c", "i2c1_scl_c",
849775214d3SQianggui Song 	"i2c1_sda_d", "i2c1_scl_d",
850775214d3SQianggui Song 	"i2c1_sda_h", "i2c1_scl_h",
851775214d3SQianggui Song 	"i2c1_sda_x", "i2c1_scl_x",
852775214d3SQianggui Song };
853775214d3SQianggui Song 
854775214d3SQianggui Song static const char * const i2c2_groups[] = {
855775214d3SQianggui Song 	"i2c2_sda_d", "i2c2_scl_d",
856775214d3SQianggui Song 	"i2c2_sda_h8", "i2c2_scl_h9",
857775214d3SQianggui Song 	"i2c2_sda_h0", "i2c2_scl_h1l,"
858775214d3SQianggui Song };
859775214d3SQianggui Song 
860775214d3SQianggui Song static const char * const i2c3_groups[] = {
861775214d3SQianggui Song 	"i2c3_sda_x", "i2c3_scl_x",
862775214d3SQianggui Song 	"i2c3_sda_z", "i2c3_scl_z",
863775214d3SQianggui Song };
864775214d3SQianggui Song 
865775214d3SQianggui Song static const char * const i2c4_groups[] = {
866775214d3SQianggui Song 	"i2c4_sda_c", "i2c4_scl_c",
867775214d3SQianggui Song 	"i2c4_sda_d", "i2c4_scl_d",
868775214d3SQianggui Song 	"i2c4_scl_z", "i2c4_sda_z",
869775214d3SQianggui Song };
870775214d3SQianggui Song 
871775214d3SQianggui Song static const char * const uart_a_groups[] = {
872775214d3SQianggui Song 	"uart_a_tx", "uart_a_rx", "uart_a_cts", "uart_a_rts",
873775214d3SQianggui Song };
874775214d3SQianggui Song 
875775214d3SQianggui Song static const char * const uart_b_groups[] = {
876775214d3SQianggui Song 	"uart_b_tx_e", "uart_b_rx_e", "uart_b_rx_c", "uart_b_tx_c",
877775214d3SQianggui Song 	"uart_b_tx_d", "uart_b_rx_d", "uart_b_cts_d", "uart_b_rts_d",
878775214d3SQianggui Song };
879775214d3SQianggui Song 
880775214d3SQianggui Song static const char * const uart_c_groups[] = {
881775214d3SQianggui Song 	"uart_c_tx", "uart_c_rx",
882775214d3SQianggui Song };
883775214d3SQianggui Song 
884775214d3SQianggui Song static const char * const uart_d_groups[] = {
885775214d3SQianggui Song 	"uart_d_tx_h", "uart_d_rx_h", "uart_d_cts_h", "uart_d_rts_h",
886775214d3SQianggui Song 	"uart_d_tx_z", "uart_d_rx_z", "uart_d_cts_z", "uart_d_rts_z",
887775214d3SQianggui Song };
888775214d3SQianggui Song 
889775214d3SQianggui Song static const char * const uart_e_groups[] = {
890775214d3SQianggui Song 	"uart_e_tx_h", "uart_e_rx_h", "uart_e_tx_z11", "uart_e_rx_z12",
891775214d3SQianggui Song 	"uart_e_tx_z8", "uart_e_rx_z9",
892775214d3SQianggui Song };
893775214d3SQianggui Song 
894775214d3SQianggui Song static const char * const emmc_groups[] = {
895775214d3SQianggui Song 	"emmc_nand_d0", "emmc_nand_d1", "emmc_nand_d2", "emmc_nand_d3",
896775214d3SQianggui Song 	"emmc_nand_d4", "emmc_nand_d5", "emmc_nand_d6", "emmc_nand_d7",
897775214d3SQianggui Song 	"emmc_clk", "emmc_rst", "emmc_cmd", "emmc_nand_ds",
898775214d3SQianggui Song };
899775214d3SQianggui Song 
900775214d3SQianggui Song static const char * const nand_groups[] = {
901775214d3SQianggui Song 	"emmc_nand_d0", "emmc_nand_d1", "emmc_nand_d2", "emmc_nand_d3",
902775214d3SQianggui Song 	"emmc_nand_d4", "emmc_nand_d5", "emmc_nand_d6", "emmc_nand_d7",
903775214d3SQianggui Song 	"nand_wen_clk", "nand_ale", "nand_ren_wr", "nand_cle", "nand_ce0",
904775214d3SQianggui Song };
905775214d3SQianggui Song 
906775214d3SQianggui Song static const char * const spif_groups[] = {
907775214d3SQianggui Song 	"spif_hold", "spif_mo", "spif_mi", "spif_clk", "spif_wp",
908775214d3SQianggui Song 	"spif_cs",
909775214d3SQianggui Song };
910775214d3SQianggui Song 
911775214d3SQianggui Song static const char * const sdcard_groups[] = {
912775214d3SQianggui Song 	"sdcard_d0_c", "sdcard_d1_c", "sdcard_d2_c", "sdcard_d3_c",
913775214d3SQianggui Song 	"sdcard_clk_c", "sdcard_cmd_c", "sdcard_cd",
914775214d3SQianggui Song 	"sdcard_d0_z", "sdcard_d1_z", "sdcard_d2_z", "sdcard_d3_z",
915775214d3SQianggui Song 	"sdcard_clk_z", "sdcard_cmd_z",
916775214d3SQianggui Song };
917775214d3SQianggui Song 
918775214d3SQianggui Song static const char * const jtag_1_groups[] = {
919775214d3SQianggui Song 	"jtag_1_clk", "jtag_1_tms", "jtag_1_tdi", "jtag_1_tdo",
920775214d3SQianggui Song };
921775214d3SQianggui Song 
922775214d3SQianggui Song static const char * const jtag_2_groups[] = {
923775214d3SQianggui Song 	"jtag_2_tdo", "jtag_2_tdi", "jtag_2_clk", "jtag_2_tms",
924775214d3SQianggui Song };
925775214d3SQianggui Song 
926775214d3SQianggui Song static const char * const pdm_groups[] = {
927775214d3SQianggui Song 	"pdm_din1_c", "pdm_din0_c", "pdm_dclk_c",
928775214d3SQianggui Song 	"pdm_dclk_d", "pdm_din0_d", "pdm_din1_d",
929775214d3SQianggui Song 	"pdm_dclk_h", "pdm_din0_h", "pdm_din1_h",
930775214d3SQianggui Song 	"pdm_din0_x", "pdm_din1_x", "pdm_dclk_x",
931775214d3SQianggui Song 	"pdm_din1_z", "pdm_din0_z", "pdm_dclk_z",
932775214d3SQianggui Song };
933775214d3SQianggui Song 
934775214d3SQianggui Song static const char * const iso7816_groups[] = {
935775214d3SQianggui Song 	"iso7816_clk_c", "iso7816_data_c",
936775214d3SQianggui Song 	"iso7816_clk_h", "iso7816_data_h",
937775214d3SQianggui Song };
938775214d3SQianggui Song 
939775214d3SQianggui Song static const char * const tdm_groups[] = {
94034069de3SQianggui Song 	"tdm_d2_c", "tdm_d3_c", "tdm_fs1_c", "tdm_d4_c", "tdm_d5_c", "tdm_sclk1_c",
941775214d3SQianggui Song 	"tdm_fs1_d", "tdm_d4_d", "tdm_d3_d", "tdm_d2_d", "tdm_sclk1_d",
942775214d3SQianggui Song 	"tdm_sclk1_h", "tdm_fs1_h", "tdm_d2_h", "tdm_d3_h", "tdm_d4_h",
943775214d3SQianggui Song 	"tdm_d1", "tdm_d0", "tdm_fs0", "tdm_sclk0", "tdm_fs2", "tdm_sclk2",
944775214d3SQianggui Song 	"tdm_d4_z", "tdm_d5_z", "tdm_d6", "tdm_d7",
945775214d3SQianggui Song };
946775214d3SQianggui Song 
947775214d3SQianggui Song static const char * const mclk_1_groups[] = {
948775214d3SQianggui Song 	"mclk_1_c", "mclk_1_d", "mclk_1_h", "mclk_2",
949775214d3SQianggui Song };
950775214d3SQianggui Song 
951775214d3SQianggui Song static const char * const mclk_2_groups[] = {
952775214d3SQianggui Song 	"mclk_2",
953775214d3SQianggui Song };
954775214d3SQianggui Song 
955775214d3SQianggui Song static const char * const remote_out_groups[] = {
956775214d3SQianggui Song 	"remote_out",
957775214d3SQianggui Song };
958775214d3SQianggui Song 
959775214d3SQianggui Song static const char * const remote_in_groups[] = {
960775214d3SQianggui Song 	"remote_in",
961775214d3SQianggui Song };
962775214d3SQianggui Song 
963775214d3SQianggui Song static const char * const clk12_24_groups[] = {
964775214d3SQianggui Song 	"clk12_24",
965775214d3SQianggui Song };
966775214d3SQianggui Song 
967775214d3SQianggui Song static const char * const clk_32k_in_groups[] = {
968775214d3SQianggui Song 	"clk_32k_in",
969775214d3SQianggui Song };
970775214d3SQianggui Song 
971775214d3SQianggui Song static const char * const pwm_a_hiz_groups[] = {
972775214d3SQianggui Song 	"pwm_a_hiz",
973775214d3SQianggui Song };
974775214d3SQianggui Song 
975775214d3SQianggui Song static const char * const pwm_b_hiz_groups[] = {
976775214d3SQianggui Song 	"pwm_b_hiz",
977775214d3SQianggui Song };
978775214d3SQianggui Song 
979775214d3SQianggui Song static const char * const pwm_c_hiz_groups[] = {
980775214d3SQianggui Song 	"pwm_c_hiz",
981775214d3SQianggui Song };
982775214d3SQianggui Song 
983775214d3SQianggui Song static const char * const pwm_g_hiz_groups[] = {
984775214d3SQianggui Song 	"pwm_g_hiz",
985775214d3SQianggui Song };
986775214d3SQianggui Song 
987775214d3SQianggui Song static const char * const pwm_a_groups[] = {
988775214d3SQianggui Song 	"pwm_a_d",
989775214d3SQianggui Song };
990775214d3SQianggui Song 
991775214d3SQianggui Song static const char * const pwm_b_groups[] = {
992775214d3SQianggui Song 	"pwm_b_d", "pwm_b_x",
993775214d3SQianggui Song };
994775214d3SQianggui Song 
995775214d3SQianggui Song static const char * const pwm_c_groups[] = {
996775214d3SQianggui Song 	"pwm_c_d", "pwm_c_x",
997775214d3SQianggui Song };
998775214d3SQianggui Song 
999775214d3SQianggui Song static const char * const pwm_d_groups[] = {
1000775214d3SQianggui Song 	"pwm_d_d", "pwm_d_h",
1001775214d3SQianggui Song };
1002775214d3SQianggui Song 
1003775214d3SQianggui Song static const char * const pwm_e_groups[] = {
1004775214d3SQianggui Song 	"pwm_e_x", "pwm_e_z",
1005775214d3SQianggui Song };
1006775214d3SQianggui Song 
1007775214d3SQianggui Song static const char * const pwm_f_groups[] = {
1008775214d3SQianggui Song 	"pwm_f_x", "pwm_f_z",
1009775214d3SQianggui Song };
1010775214d3SQianggui Song 
1011775214d3SQianggui Song static const char * const pwm_g_groups[] = {
1012775214d3SQianggui Song 	"pwm_g_d", "pwm_g_z",
1013775214d3SQianggui Song };
1014775214d3SQianggui Song 
1015775214d3SQianggui Song static const char * const pwm_h_groups[] = {
1016775214d3SQianggui Song 	"pwm_h",
1017775214d3SQianggui Song };
1018775214d3SQianggui Song 
1019775214d3SQianggui Song static const char * const pwm_i_groups[] = {
1020775214d3SQianggui Song 	"pwm_i_d", "pwm_i_h"
1021775214d3SQianggui Song };
1022775214d3SQianggui Song 
1023775214d3SQianggui Song static const char * const pwm_j_groups[] = {
1024775214d3SQianggui Song 	"pwm_j",
1025775214d3SQianggui Song };
1026775214d3SQianggui Song 
1027775214d3SQianggui Song static const char * const mic_mute_groups[] = {
1028775214d3SQianggui Song 	"mic_mute_en", "mic_mute_key",
1029775214d3SQianggui Song };
1030775214d3SQianggui Song 
1031775214d3SQianggui Song static const char * const hdmitx_groups[] = {
1032775214d3SQianggui Song 	"hdmitx_sda", "hdmitx_sck", "hdmitx_hpd_in",
1033775214d3SQianggui Song };
1034775214d3SQianggui Song 
1035775214d3SQianggui Song static const char * const ao_cec_a_groups[] = {
1036775214d3SQianggui Song 	"ao_cec_a",
1037775214d3SQianggui Song };
1038775214d3SQianggui Song 
1039775214d3SQianggui Song static const char * const ao_cec_b_groups[] = {
1040775214d3SQianggui Song 	"ao_cec_b",
1041775214d3SQianggui Song };
1042775214d3SQianggui Song 
1043775214d3SQianggui Song static const char * const spdif_out_groups[] = {
1044775214d3SQianggui Song 	"spdif_out_h", "spdif_out_z",
1045775214d3SQianggui Song };
1046775214d3SQianggui Song 
1047775214d3SQianggui Song static const char * const spdif_in_groups[] = {
1048775214d3SQianggui Song 	"spdif_in",
1049775214d3SQianggui Song };
1050775214d3SQianggui Song 
1051775214d3SQianggui Song static const char * const eth_groups[] = {
1052775214d3SQianggui Song 	"eth_link_led", "eth_act_led",
1053775214d3SQianggui Song };
1054775214d3SQianggui Song 
1055775214d3SQianggui Song static const char * const spi_a_groups[] = {
1056775214d3SQianggui Song 	"spi_a_miso_h", "spi_a_mosi_h", "spi_a_clk_h", "spi_a_ss0_h",
1057775214d3SQianggui Song 
1058775214d3SQianggui Song 	"spi_a_mosi_x", "spi_a_miso_x", "spi_a_ss0_x", "spi_a_clk_x",
1059775214d3SQianggui Song 
1060775214d3SQianggui Song 	"spi_a_miso_z", "spi_a_mosi_z", "spi_a_clk_z", "spi_a_ss0_z",
1061775214d3SQianggui Song 	"spi_a_ss1_z", "spi_a_ss2_z",
1062775214d3SQianggui Song };
1063775214d3SQianggui Song 
1064775214d3SQianggui Song static const char * const gen_clk_groups[] = {
1065775214d3SQianggui Song 	"gen_clk_h", "gen_clk_z9", "gen_clk_z12",
1066775214d3SQianggui Song };
1067775214d3SQianggui Song 
1068775214d3SQianggui Song static const char * const sdio_groups[] = {
1069775214d3SQianggui Song 	"sdio_d0", "sdio_d1", "sdio_d2", "sdio_d3", "sdio_clk", "sdio_cmd",
1070775214d3SQianggui Song };
1071775214d3SQianggui Song 
1072775214d3SQianggui Song static const char * const i2c_slave_groups[] = {
1073775214d3SQianggui Song 	"i2c_slave_scl", "i2c_slave_sda",
1074775214d3SQianggui Song };
1075775214d3SQianggui Song 
1076775214d3SQianggui Song static const char * const dtv_groups[] = {
1077775214d3SQianggui Song 	"dtv_a_if_agc_z10", "dtv_a_if_agc_z6", "dtv_b_if_agc",
1078775214d3SQianggui Song 	"dtv_a_rf_agc", "dtv_b_rf_agc",
1079775214d3SQianggui Song };
1080775214d3SQianggui Song 
1081775214d3SQianggui Song static const char * const tsin_a_groups[] = {
1082775214d3SQianggui Song 	"tsin_a_clk", "tsin_a_sop", "tsin_a_valid", "tsin_a_din0",
1083775214d3SQianggui Song };
1084775214d3SQianggui Song 
1085775214d3SQianggui Song static const char * const tsin_b_groups[] = {
1086775214d3SQianggui Song 	"tsin_b_clk_c", "tsin_b_sop_c", "tsin_b_valid_c", "tsin_b_d0_c",
1087775214d3SQianggui Song 	"tsin_b_clk_z", "tsin_b_sop_z", "tsin_b_valid_z", "tsin_b_d0_z",
1088775214d3SQianggui Song };
1089775214d3SQianggui Song 
1090775214d3SQianggui Song static const char * const tsin_b1_groups[] = {
1091775214d3SQianggui Song 	"tsin_b1_clk", "tsin_b1_sop", "tsin_b1_valid", "tsin_b1_d0",
1092775214d3SQianggui Song };
1093775214d3SQianggui Song 
1094775214d3SQianggui Song static const char * const diseqc_out_groups[] = {
1095775214d3SQianggui Song 	"diseqc_out",
1096775214d3SQianggui Song };
1097775214d3SQianggui Song 
1098775214d3SQianggui Song static const char * const s2_demod_groups[] = {
1099775214d3SQianggui Song 	"s2_demod_gpio7", "s2_demod_gpio6", "s2_demod_gpio5", "s2_demod_gpio4",
1100775214d3SQianggui Song 	"s2_demod_gpio3", "s2_demod_gpio2", "s2_demod_gpio1", "s2_demod_gpio0",
1101775214d3SQianggui Song };
1102775214d3SQianggui Song 
1103*8a74a53eSChristophe JAILLET static const struct meson_pmx_func meson_s4_periphs_functions[] = {
1104775214d3SQianggui Song 	FUNCTION(gpio_periphs),
1105775214d3SQianggui Song 	FUNCTION(i2c0),
1106775214d3SQianggui Song 	FUNCTION(i2c1),
1107775214d3SQianggui Song 	FUNCTION(i2c2),
1108775214d3SQianggui Song 	FUNCTION(i2c3),
1109775214d3SQianggui Song 	FUNCTION(i2c4),
1110775214d3SQianggui Song 	FUNCTION(uart_a),
1111775214d3SQianggui Song 	FUNCTION(uart_b),
1112775214d3SQianggui Song 	FUNCTION(uart_c),
1113775214d3SQianggui Song 	FUNCTION(uart_d),
1114775214d3SQianggui Song 	FUNCTION(uart_e),
1115775214d3SQianggui Song 	FUNCTION(emmc),
1116775214d3SQianggui Song 	FUNCTION(nand),
1117775214d3SQianggui Song 	FUNCTION(spif),
1118775214d3SQianggui Song 	FUNCTION(sdcard),
1119775214d3SQianggui Song 	FUNCTION(jtag_1),
1120775214d3SQianggui Song 	FUNCTION(jtag_2),
1121775214d3SQianggui Song 	FUNCTION(pdm),
1122775214d3SQianggui Song 	FUNCTION(iso7816),
1123775214d3SQianggui Song 	FUNCTION(tdm),
1124775214d3SQianggui Song 	FUNCTION(mclk_1),
1125775214d3SQianggui Song 	FUNCTION(mclk_2),
1126775214d3SQianggui Song 	FUNCTION(remote_out),
1127775214d3SQianggui Song 	FUNCTION(remote_in),
1128775214d3SQianggui Song 	FUNCTION(clk12_24),
1129775214d3SQianggui Song 	FUNCTION(clk_32k_in),
1130775214d3SQianggui Song 	FUNCTION(pwm_a_hiz),
1131775214d3SQianggui Song 	FUNCTION(pwm_b_hiz),
1132775214d3SQianggui Song 	FUNCTION(pwm_c_hiz),
1133775214d3SQianggui Song 	FUNCTION(pwm_g_hiz),
1134775214d3SQianggui Song 	FUNCTION(pwm_a),
1135775214d3SQianggui Song 	FUNCTION(pwm_b),
1136775214d3SQianggui Song 	FUNCTION(pwm_c),
1137775214d3SQianggui Song 	FUNCTION(pwm_d),
1138775214d3SQianggui Song 	FUNCTION(pwm_e),
1139775214d3SQianggui Song 	FUNCTION(pwm_f),
1140775214d3SQianggui Song 	FUNCTION(pwm_g),
1141775214d3SQianggui Song 	FUNCTION(pwm_h),
1142775214d3SQianggui Song 	FUNCTION(pwm_i),
1143775214d3SQianggui Song 	FUNCTION(pwm_j),
1144775214d3SQianggui Song 	FUNCTION(mic_mute),
1145775214d3SQianggui Song 	FUNCTION(hdmitx),
1146775214d3SQianggui Song 	FUNCTION(ao_cec_a),
1147775214d3SQianggui Song 	FUNCTION(ao_cec_b),
1148775214d3SQianggui Song 	FUNCTION(spdif_out),
1149775214d3SQianggui Song 	FUNCTION(spdif_in),
1150775214d3SQianggui Song 	FUNCTION(eth),
1151775214d3SQianggui Song 	FUNCTION(spi_a),
1152775214d3SQianggui Song 	FUNCTION(gen_clk),
1153775214d3SQianggui Song 	FUNCTION(sdio),
1154775214d3SQianggui Song 	FUNCTION(i2c_slave),
1155775214d3SQianggui Song 	FUNCTION(dtv),
1156775214d3SQianggui Song 	FUNCTION(tsin_a),
1157775214d3SQianggui Song 	FUNCTION(tsin_b),
1158775214d3SQianggui Song 	FUNCTION(tsin_b1),
1159775214d3SQianggui Song 	FUNCTION(diseqc_out),
1160775214d3SQianggui Song 	FUNCTION(s2_demod),
1161775214d3SQianggui Song };
1162775214d3SQianggui Song 
1163*8a74a53eSChristophe JAILLET static const struct meson_bank meson_s4_periphs_banks[] = {
1164775214d3SQianggui Song 	/* name  first  last  irq  pullen  pull  dir  out  in */
1165775214d3SQianggui Song 	BANK_DS("B", GPIOB_0,    GPIOB_13,  0, 13,
1166775214d3SQianggui Song 		0x63,  0,  0x64,  0,  0x62, 0,  0x61, 0,  0x60, 0, 0x67, 0),
1167775214d3SQianggui Song 	BANK_DS("C", GPIOC_0,    GPIOC_7,   14, 21,
1168775214d3SQianggui Song 		0x53,  0,  0x54,  0,  0x52, 0,  0x51, 0,  0x50, 0, 0x57, 0),
1169775214d3SQianggui Song 	BANK_DS("E", GPIOE_0,    GPIOE_1,   22, 23,
1170775214d3SQianggui Song 		0x43,  0,  0x44,  0,  0x42, 0,  0x41, 0,  0x40, 0, 0x47, 0),
1171775214d3SQianggui Song 	BANK_DS("D", GPIOD_0,    GPIOD_11,  24, 35,
1172775214d3SQianggui Song 		0x33,  0,  0x34,  0,  0x32, 0,  0x31, 0,  0x30, 0, 0x37, 0),
1173775214d3SQianggui Song 	BANK_DS("H", GPIOH_0,    GPIOH_11,  36, 47,
1174775214d3SQianggui Song 		0x23,  0,  0x24,  0,  0x22, 0,  0x21, 0,  0x20, 0, 0x27, 0),
1175775214d3SQianggui Song 	BANK_DS("X", GPIOX_0,    GPIOX_19,   48, 67,
1176775214d3SQianggui Song 		0x13,  0,  0x14,  0,  0x12, 0,  0x11, 0,  0x10, 0, 0x17, 0),
1177775214d3SQianggui Song 	BANK_DS("Z", GPIOZ_0,    GPIOZ_12,  68, 80,
1178775214d3SQianggui Song 		0x03,  0,  0x04,  0,  0x02, 0,  0x01, 0,  0x00, 0, 0x07, 0),
1179775214d3SQianggui Song 	BANK_DS("TEST_N", GPIO_TEST_N,    GPIO_TEST_N,   -1, -1,
1180775214d3SQianggui Song 		0x83,  0,  0x84,  0,  0x82, 0,  0x81,  0, 0x80, 0, 0x87, 0),
1181775214d3SQianggui Song };
1182775214d3SQianggui Song 
1183*8a74a53eSChristophe JAILLET static const struct meson_pmx_bank meson_s4_periphs_pmx_banks[] = {
1184775214d3SQianggui Song 	/*name	            first	 lask        reg offset*/
1185775214d3SQianggui Song 	BANK_PMX("B",      GPIOB_0,     GPIOB_13,    0x00, 0),
1186775214d3SQianggui Song 	BANK_PMX("C",      GPIOC_0,     GPIOC_7,     0x9,  0),
1187775214d3SQianggui Song 	BANK_PMX("E",      GPIOE_0,     GPIOE_1,     0x12, 0),
1188775214d3SQianggui Song 	BANK_PMX("D",      GPIOD_0,     GPIOD_11,    0x10, 0),
1189775214d3SQianggui Song 	BANK_PMX("H",      GPIOH_0,     GPIOH_11,    0xb,  0),
1190775214d3SQianggui Song 	BANK_PMX("X",      GPIOX_0,     GPIOX_19,    0x3,  0),
1191775214d3SQianggui Song 	BANK_PMX("Z",      GPIOZ_0,     GPIOZ_12,    0x6,  0),
1192775214d3SQianggui Song 	BANK_PMX("TEST_N", GPIO_TEST_N, GPIO_TEST_N, 0xf,  0)
1193775214d3SQianggui Song };
1194775214d3SQianggui Song 
1195*8a74a53eSChristophe JAILLET static const struct meson_axg_pmx_data meson_s4_periphs_pmx_banks_data = {
1196775214d3SQianggui Song 	.pmx_banks	= meson_s4_periphs_pmx_banks,
1197775214d3SQianggui Song 	.num_pmx_banks	= ARRAY_SIZE(meson_s4_periphs_pmx_banks),
1198775214d3SQianggui Song };
1199775214d3SQianggui Song 
1200*8a74a53eSChristophe JAILLET static const struct meson_pinctrl_data meson_s4_periphs_pinctrl_data = {
1201775214d3SQianggui Song 	.name		= "periphs-banks",
1202775214d3SQianggui Song 	.pins		= meson_s4_periphs_pins,
1203775214d3SQianggui Song 	.groups		= meson_s4_periphs_groups,
1204775214d3SQianggui Song 	.funcs		= meson_s4_periphs_functions,
1205775214d3SQianggui Song 	.banks		= meson_s4_periphs_banks,
1206775214d3SQianggui Song 	.num_pins	= ARRAY_SIZE(meson_s4_periphs_pins),
1207775214d3SQianggui Song 	.num_groups	= ARRAY_SIZE(meson_s4_periphs_groups),
1208775214d3SQianggui Song 	.num_funcs	= ARRAY_SIZE(meson_s4_periphs_functions),
1209775214d3SQianggui Song 	.num_banks	= ARRAY_SIZE(meson_s4_periphs_banks),
1210775214d3SQianggui Song 	.pmx_ops	= &meson_axg_pmx_ops,
1211775214d3SQianggui Song 	.pmx_data	= &meson_s4_periphs_pmx_banks_data,
1212775214d3SQianggui Song 	.parse_dt	= &meson_a1_parse_dt_extra,
1213775214d3SQianggui Song };
1214775214d3SQianggui Song 
1215775214d3SQianggui Song static const struct of_device_id meson_s4_pinctrl_dt_match[] = {
1216775214d3SQianggui Song 	{
1217775214d3SQianggui Song 		.compatible = "amlogic,meson-s4-periphs-pinctrl",
1218775214d3SQianggui Song 		.data = &meson_s4_periphs_pinctrl_data,
1219775214d3SQianggui Song 	},
1220775214d3SQianggui Song 	{ }
1221775214d3SQianggui Song };
1222775214d3SQianggui Song MODULE_DEVICE_TABLE(of, meson_s4_pinctrl_dt_match);
1223775214d3SQianggui Song 
1224775214d3SQianggui Song static struct platform_driver meson_s4_pinctrl_driver = {
1225775214d3SQianggui Song 	.probe  = meson_pinctrl_probe,
1226775214d3SQianggui Song 	.driver = {
1227775214d3SQianggui Song 		.name	= "meson-s4-pinctrl",
1228775214d3SQianggui Song 		.of_match_table = meson_s4_pinctrl_dt_match,
1229775214d3SQianggui Song 	},
1230775214d3SQianggui Song };
1231775214d3SQianggui Song module_platform_driver(meson_s4_pinctrl_driver);
1232775214d3SQianggui Song 
12335224b7a9SJeff Johnson MODULE_DESCRIPTION("Amlogic Meson S4 SoC pinctrl driver");
1234775214d3SQianggui Song MODULE_LICENSE("Dual BSD/GPL");
1235