xref: /openbmc/linux/drivers/pinctrl/qcom/pinctrl-ipq9574.c (revision 1ac731c529cd4d6adbce134754b51ff7d822b145)
1*c74eef68SDevi Priya // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*c74eef68SDevi Priya /*
3*c74eef68SDevi Priya  * Copyright (c) 2023 The Linux Foundation. All rights reserved.
4*c74eef68SDevi Priya  */
5*c74eef68SDevi Priya 
6*c74eef68SDevi Priya #include <linux/module.h>
7*c74eef68SDevi Priya #include <linux/of.h>
8*c74eef68SDevi Priya #include <linux/platform_device.h>
9*c74eef68SDevi Priya 
10*c74eef68SDevi Priya #include "pinctrl-msm.h"
11*c74eef68SDevi Priya 
12*c74eef68SDevi Priya #define REG_SIZE 0x1000
13*c74eef68SDevi Priya #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9)	\
14*c74eef68SDevi Priya 	{					        \
15*c74eef68SDevi Priya 		.grp = PINCTRL_PINGROUP("gpio" #id, 	\
16*c74eef68SDevi Priya 			gpio##id##_pins, 		\
17*c74eef68SDevi Priya 			ARRAY_SIZE(gpio##id##_pins)),	\
18*c74eef68SDevi Priya 		.funcs = (int[]){			\
19*c74eef68SDevi Priya 			msm_mux_gpio, /* gpio mode */	\
20*c74eef68SDevi Priya 			msm_mux_##f1,			\
21*c74eef68SDevi Priya 			msm_mux_##f2,			\
22*c74eef68SDevi Priya 			msm_mux_##f3,			\
23*c74eef68SDevi Priya 			msm_mux_##f4,			\
24*c74eef68SDevi Priya 			msm_mux_##f5,			\
25*c74eef68SDevi Priya 			msm_mux_##f6,			\
26*c74eef68SDevi Priya 			msm_mux_##f7,			\
27*c74eef68SDevi Priya 			msm_mux_##f8,			\
28*c74eef68SDevi Priya 			msm_mux_##f9			\
29*c74eef68SDevi Priya 		},				        \
30*c74eef68SDevi Priya 		.nfuncs = 10,				\
31*c74eef68SDevi Priya 		.ctl_reg = REG_SIZE * id,			\
32*c74eef68SDevi Priya 		.io_reg = 0x4 + REG_SIZE * id,		\
33*c74eef68SDevi Priya 		.intr_cfg_reg = 0x8 + REG_SIZE * id,		\
34*c74eef68SDevi Priya 		.intr_status_reg = 0xc + REG_SIZE * id,	\
35*c74eef68SDevi Priya 		.intr_target_reg = 0x8 + REG_SIZE * id,	\
36*c74eef68SDevi Priya 		.mux_bit = 2,			\
37*c74eef68SDevi Priya 		.pull_bit = 0,			\
38*c74eef68SDevi Priya 		.drv_bit = 6,			\
39*c74eef68SDevi Priya 		.oe_bit = 9,			\
40*c74eef68SDevi Priya 		.in_bit = 0,			\
41*c74eef68SDevi Priya 		.out_bit = 1,			\
42*c74eef68SDevi Priya 		.intr_enable_bit = 0,		\
43*c74eef68SDevi Priya 		.intr_status_bit = 0,		\
44*c74eef68SDevi Priya 		.intr_target_bit = 5,		\
45*c74eef68SDevi Priya 		.intr_target_kpss_val = 3,	\
46*c74eef68SDevi Priya 		.intr_raw_status_bit = 4,	\
47*c74eef68SDevi Priya 		.intr_polarity_bit = 1,		\
48*c74eef68SDevi Priya 		.intr_detection_bit = 2,	\
49*c74eef68SDevi Priya 		.intr_detection_width = 2,	\
50*c74eef68SDevi Priya 	}
51*c74eef68SDevi Priya 
52*c74eef68SDevi Priya static const struct pinctrl_pin_desc ipq9574_pins[] = {
53*c74eef68SDevi Priya 	PINCTRL_PIN(0, "GPIO_0"),
54*c74eef68SDevi Priya 	PINCTRL_PIN(1, "GPIO_1"),
55*c74eef68SDevi Priya 	PINCTRL_PIN(2, "GPIO_2"),
56*c74eef68SDevi Priya 	PINCTRL_PIN(3, "GPIO_3"),
57*c74eef68SDevi Priya 	PINCTRL_PIN(4, "GPIO_4"),
58*c74eef68SDevi Priya 	PINCTRL_PIN(5, "GPIO_5"),
59*c74eef68SDevi Priya 	PINCTRL_PIN(6, "GPIO_6"),
60*c74eef68SDevi Priya 	PINCTRL_PIN(7, "GPIO_7"),
61*c74eef68SDevi Priya 	PINCTRL_PIN(8, "GPIO_8"),
62*c74eef68SDevi Priya 	PINCTRL_PIN(9, "GPIO_9"),
63*c74eef68SDevi Priya 	PINCTRL_PIN(10, "GPIO_10"),
64*c74eef68SDevi Priya 	PINCTRL_PIN(11, "GPIO_11"),
65*c74eef68SDevi Priya 	PINCTRL_PIN(12, "GPIO_12"),
66*c74eef68SDevi Priya 	PINCTRL_PIN(13, "GPIO_13"),
67*c74eef68SDevi Priya 	PINCTRL_PIN(14, "GPIO_14"),
68*c74eef68SDevi Priya 	PINCTRL_PIN(15, "GPIO_15"),
69*c74eef68SDevi Priya 	PINCTRL_PIN(16, "GPIO_16"),
70*c74eef68SDevi Priya 	PINCTRL_PIN(17, "GPIO_17"),
71*c74eef68SDevi Priya 	PINCTRL_PIN(18, "GPIO_18"),
72*c74eef68SDevi Priya 	PINCTRL_PIN(19, "GPIO_19"),
73*c74eef68SDevi Priya 	PINCTRL_PIN(20, "GPIO_20"),
74*c74eef68SDevi Priya 	PINCTRL_PIN(21, "GPIO_21"),
75*c74eef68SDevi Priya 	PINCTRL_PIN(22, "GPIO_22"),
76*c74eef68SDevi Priya 	PINCTRL_PIN(23, "GPIO_23"),
77*c74eef68SDevi Priya 	PINCTRL_PIN(24, "GPIO_24"),
78*c74eef68SDevi Priya 	PINCTRL_PIN(25, "GPIO_25"),
79*c74eef68SDevi Priya 	PINCTRL_PIN(26, "GPIO_26"),
80*c74eef68SDevi Priya 	PINCTRL_PIN(27, "GPIO_27"),
81*c74eef68SDevi Priya 	PINCTRL_PIN(28, "GPIO_28"),
82*c74eef68SDevi Priya 	PINCTRL_PIN(29, "GPIO_29"),
83*c74eef68SDevi Priya 	PINCTRL_PIN(30, "GPIO_30"),
84*c74eef68SDevi Priya 	PINCTRL_PIN(31, "GPIO_31"),
85*c74eef68SDevi Priya 	PINCTRL_PIN(32, "GPIO_32"),
86*c74eef68SDevi Priya 	PINCTRL_PIN(33, "GPIO_33"),
87*c74eef68SDevi Priya 	PINCTRL_PIN(34, "GPIO_34"),
88*c74eef68SDevi Priya 	PINCTRL_PIN(35, "GPIO_35"),
89*c74eef68SDevi Priya 	PINCTRL_PIN(36, "GPIO_36"),
90*c74eef68SDevi Priya 	PINCTRL_PIN(37, "GPIO_37"),
91*c74eef68SDevi Priya 	PINCTRL_PIN(38, "GPIO_38"),
92*c74eef68SDevi Priya 	PINCTRL_PIN(39, "GPIO_39"),
93*c74eef68SDevi Priya 	PINCTRL_PIN(40, "GPIO_40"),
94*c74eef68SDevi Priya 	PINCTRL_PIN(41, "GPIO_41"),
95*c74eef68SDevi Priya 	PINCTRL_PIN(42, "GPIO_42"),
96*c74eef68SDevi Priya 	PINCTRL_PIN(43, "GPIO_43"),
97*c74eef68SDevi Priya 	PINCTRL_PIN(44, "GPIO_44"),
98*c74eef68SDevi Priya 	PINCTRL_PIN(45, "GPIO_45"),
99*c74eef68SDevi Priya 	PINCTRL_PIN(46, "GPIO_46"),
100*c74eef68SDevi Priya 	PINCTRL_PIN(47, "GPIO_47"),
101*c74eef68SDevi Priya 	PINCTRL_PIN(48, "GPIO_48"),
102*c74eef68SDevi Priya 	PINCTRL_PIN(49, "GPIO_49"),
103*c74eef68SDevi Priya 	PINCTRL_PIN(50, "GPIO_50"),
104*c74eef68SDevi Priya 	PINCTRL_PIN(51, "GPIO_51"),
105*c74eef68SDevi Priya 	PINCTRL_PIN(52, "GPIO_52"),
106*c74eef68SDevi Priya 	PINCTRL_PIN(53, "GPIO_53"),
107*c74eef68SDevi Priya 	PINCTRL_PIN(54, "GPIO_54"),
108*c74eef68SDevi Priya 	PINCTRL_PIN(55, "GPIO_55"),
109*c74eef68SDevi Priya 	PINCTRL_PIN(56, "GPIO_56"),
110*c74eef68SDevi Priya 	PINCTRL_PIN(57, "GPIO_57"),
111*c74eef68SDevi Priya 	PINCTRL_PIN(58, "GPIO_58"),
112*c74eef68SDevi Priya 	PINCTRL_PIN(59, "GPIO_59"),
113*c74eef68SDevi Priya 	PINCTRL_PIN(60, "GPIO_60"),
114*c74eef68SDevi Priya 	PINCTRL_PIN(61, "GPIO_61"),
115*c74eef68SDevi Priya 	PINCTRL_PIN(62, "GPIO_62"),
116*c74eef68SDevi Priya 	PINCTRL_PIN(63, "GPIO_63"),
117*c74eef68SDevi Priya 	PINCTRL_PIN(64, "GPIO_64"),
118*c74eef68SDevi Priya };
119*c74eef68SDevi Priya 
120*c74eef68SDevi Priya #define DECLARE_MSM_GPIO_PINS(pin) \
121*c74eef68SDevi Priya 	static const unsigned int gpio##pin##_pins[] = { pin }
122*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(0);
123*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(1);
124*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(2);
125*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(3);
126*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(4);
127*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(5);
128*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(6);
129*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(7);
130*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(8);
131*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(9);
132*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(10);
133*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(11);
134*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(12);
135*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(13);
136*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(14);
137*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(15);
138*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(16);
139*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(17);
140*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(18);
141*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(19);
142*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(20);
143*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(21);
144*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(22);
145*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(23);
146*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(24);
147*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(25);
148*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(26);
149*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(27);
150*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(28);
151*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(29);
152*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(30);
153*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(31);
154*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(32);
155*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(33);
156*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(34);
157*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(35);
158*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(36);
159*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(37);
160*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(38);
161*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(39);
162*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(40);
163*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(41);
164*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(42);
165*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(43);
166*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(44);
167*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(45);
168*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(46);
169*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(47);
170*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(48);
171*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(49);
172*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(50);
173*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(51);
174*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(52);
175*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(53);
176*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(54);
177*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(55);
178*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(56);
179*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(57);
180*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(58);
181*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(59);
182*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(60);
183*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(61);
184*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(62);
185*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(63);
186*c74eef68SDevi Priya DECLARE_MSM_GPIO_PINS(64);
187*c74eef68SDevi Priya 
188*c74eef68SDevi Priya enum ipq9574_functions {
189*c74eef68SDevi Priya 	msm_mux_atest_char,
190*c74eef68SDevi Priya 	msm_mux_atest_char0,
191*c74eef68SDevi Priya 	msm_mux_atest_char1,
192*c74eef68SDevi Priya 	msm_mux_atest_char2,
193*c74eef68SDevi Priya 	msm_mux_atest_char3,
194*c74eef68SDevi Priya 	msm_mux_audio_pdm0,
195*c74eef68SDevi Priya 	msm_mux_audio_pdm1,
196*c74eef68SDevi Priya 	msm_mux_audio_pri,
197*c74eef68SDevi Priya 	msm_mux_audio_sec,
198*c74eef68SDevi Priya 	msm_mux_blsp0_spi,
199*c74eef68SDevi Priya 	msm_mux_blsp0_uart,
200*c74eef68SDevi Priya 	msm_mux_blsp1_i2c,
201*c74eef68SDevi Priya 	msm_mux_blsp1_spi,
202*c74eef68SDevi Priya 	msm_mux_blsp1_uart,
203*c74eef68SDevi Priya 	msm_mux_blsp2_i2c,
204*c74eef68SDevi Priya 	msm_mux_blsp2_spi,
205*c74eef68SDevi Priya 	msm_mux_blsp2_uart,
206*c74eef68SDevi Priya 	msm_mux_blsp3_i2c,
207*c74eef68SDevi Priya 	msm_mux_blsp3_spi,
208*c74eef68SDevi Priya 	msm_mux_blsp3_uart,
209*c74eef68SDevi Priya 	msm_mux_blsp4_i2c,
210*c74eef68SDevi Priya 	msm_mux_blsp4_spi,
211*c74eef68SDevi Priya 	msm_mux_blsp4_uart,
212*c74eef68SDevi Priya 	msm_mux_blsp5_i2c,
213*c74eef68SDevi Priya 	msm_mux_blsp5_uart,
214*c74eef68SDevi Priya 	msm_mux_cri_trng0,
215*c74eef68SDevi Priya 	msm_mux_cri_trng1,
216*c74eef68SDevi Priya 	msm_mux_cri_trng2,
217*c74eef68SDevi Priya 	msm_mux_cri_trng3,
218*c74eef68SDevi Priya 	msm_mux_cxc0,
219*c74eef68SDevi Priya 	msm_mux_cxc1,
220*c74eef68SDevi Priya 	msm_mux_dbg_out,
221*c74eef68SDevi Priya 	msm_mux_dwc_ddrphy,
222*c74eef68SDevi Priya 	msm_mux_gcc_plltest,
223*c74eef68SDevi Priya 	msm_mux_gcc_tlmm,
224*c74eef68SDevi Priya 	msm_mux_gpio,
225*c74eef68SDevi Priya 	msm_mux_mac,
226*c74eef68SDevi Priya 	msm_mux_mdc,
227*c74eef68SDevi Priya 	msm_mux_mdio,
228*c74eef68SDevi Priya 	msm_mux_pcie0_clk,
229*c74eef68SDevi Priya 	msm_mux_pcie0_wake,
230*c74eef68SDevi Priya 	msm_mux_pcie1_clk,
231*c74eef68SDevi Priya 	msm_mux_pcie1_wake,
232*c74eef68SDevi Priya 	msm_mux_pcie2_clk,
233*c74eef68SDevi Priya 	msm_mux_pcie2_wake,
234*c74eef68SDevi Priya 	msm_mux_pcie3_clk,
235*c74eef68SDevi Priya 	msm_mux_pcie3_wake,
236*c74eef68SDevi Priya 	msm_mux_prng_rosc0,
237*c74eef68SDevi Priya 	msm_mux_prng_rosc1,
238*c74eef68SDevi Priya 	msm_mux_prng_rosc2,
239*c74eef68SDevi Priya 	msm_mux_prng_rosc3,
240*c74eef68SDevi Priya 	msm_mux_pta,
241*c74eef68SDevi Priya 	msm_mux_pwm,
242*c74eef68SDevi Priya 	msm_mux_qdss_cti_trig_in_a0,
243*c74eef68SDevi Priya 	msm_mux_qdss_cti_trig_in_a1,
244*c74eef68SDevi Priya 	msm_mux_qdss_cti_trig_in_b0,
245*c74eef68SDevi Priya 	msm_mux_qdss_cti_trig_in_b1,
246*c74eef68SDevi Priya 	msm_mux_qdss_cti_trig_out_a0,
247*c74eef68SDevi Priya 	msm_mux_qdss_cti_trig_out_a1,
248*c74eef68SDevi Priya 	msm_mux_qdss_cti_trig_out_b0,
249*c74eef68SDevi Priya 	msm_mux_qdss_cti_trig_out_b1,
250*c74eef68SDevi Priya 	msm_mux_qdss_traceclk_a,
251*c74eef68SDevi Priya 	msm_mux_qdss_traceclk_b,
252*c74eef68SDevi Priya 	msm_mux_qdss_tracectl_a,
253*c74eef68SDevi Priya 	msm_mux_qdss_tracectl_b,
254*c74eef68SDevi Priya 	msm_mux_qdss_tracedata_a,
255*c74eef68SDevi Priya 	msm_mux_qdss_tracedata_b,
256*c74eef68SDevi Priya 	msm_mux_qspi_data,
257*c74eef68SDevi Priya 	msm_mux_qspi_clk,
258*c74eef68SDevi Priya 	msm_mux_qspi_cs,
259*c74eef68SDevi Priya 	msm_mux_rx0,
260*c74eef68SDevi Priya 	msm_mux_rx1,
261*c74eef68SDevi Priya 	msm_mux_sdc_data,
262*c74eef68SDevi Priya 	msm_mux_sdc_clk,
263*c74eef68SDevi Priya 	msm_mux_sdc_cmd,
264*c74eef68SDevi Priya 	msm_mux_sdc_rclk,
265*c74eef68SDevi Priya 	msm_mux_tsens_max,
266*c74eef68SDevi Priya 	msm_mux_wci20,
267*c74eef68SDevi Priya 	msm_mux_wci21,
268*c74eef68SDevi Priya 	msm_mux_wsa_swrm,
269*c74eef68SDevi Priya 	msm_mux__,
270*c74eef68SDevi Priya };
271*c74eef68SDevi Priya 
272*c74eef68SDevi Priya static const char * const gpio_groups[] = {
273*c74eef68SDevi Priya 	"gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7",
274*c74eef68SDevi Priya 	"gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14",
275*c74eef68SDevi Priya 	"gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21",
276*c74eef68SDevi Priya 	"gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28",
277*c74eef68SDevi Priya 	"gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35",
278*c74eef68SDevi Priya 	"gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42",
279*c74eef68SDevi Priya 	"gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49",
280*c74eef68SDevi Priya 	"gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56",
281*c74eef68SDevi Priya 	"gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63",
282*c74eef68SDevi Priya 	"gpio64",
283*c74eef68SDevi Priya };
284*c74eef68SDevi Priya 
285*c74eef68SDevi Priya static const char * const sdc_data_groups[] = {
286*c74eef68SDevi Priya 	"gpio0",
287*c74eef68SDevi Priya 	"gpio1",
288*c74eef68SDevi Priya 	"gpio2",
289*c74eef68SDevi Priya 	"gpio3",
290*c74eef68SDevi Priya 	"gpio6",
291*c74eef68SDevi Priya 	"gpio7",
292*c74eef68SDevi Priya 	"gpio8",
293*c74eef68SDevi Priya 	"gpio9",
294*c74eef68SDevi Priya };
295*c74eef68SDevi Priya 
296*c74eef68SDevi Priya static const char * const qspi_data_groups[] = {
297*c74eef68SDevi Priya 	"gpio0",
298*c74eef68SDevi Priya 	"gpio1",
299*c74eef68SDevi Priya 	"gpio2",
300*c74eef68SDevi Priya 	"gpio3",
301*c74eef68SDevi Priya };
302*c74eef68SDevi Priya 
303*c74eef68SDevi Priya static const char * const qdss_traceclk_b_groups[] = {
304*c74eef68SDevi Priya 	"gpio0",
305*c74eef68SDevi Priya };
306*c74eef68SDevi Priya 
307*c74eef68SDevi Priya static const char * const qdss_tracectl_b_groups[] = {
308*c74eef68SDevi Priya 	"gpio1",
309*c74eef68SDevi Priya };
310*c74eef68SDevi Priya 
311*c74eef68SDevi Priya static const char * const qdss_tracedata_b_groups[] = {
312*c74eef68SDevi Priya 	"gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9",
313*c74eef68SDevi Priya 	"gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16",
314*c74eef68SDevi Priya 	"gpio17",
315*c74eef68SDevi Priya };
316*c74eef68SDevi Priya 
317*c74eef68SDevi Priya static const char * const sdc_cmd_groups[] = {
318*c74eef68SDevi Priya 	"gpio4",
319*c74eef68SDevi Priya };
320*c74eef68SDevi Priya 
321*c74eef68SDevi Priya static const char * const qspi_cs_groups[] = {
322*c74eef68SDevi Priya 	"gpio4",
323*c74eef68SDevi Priya };
324*c74eef68SDevi Priya 
325*c74eef68SDevi Priya static const char * const sdc_clk_groups[] = {
326*c74eef68SDevi Priya 	"gpio5",
327*c74eef68SDevi Priya };
328*c74eef68SDevi Priya 
329*c74eef68SDevi Priya static const char * const qspi_clk_groups[] = {
330*c74eef68SDevi Priya 	"gpio5",
331*c74eef68SDevi Priya };
332*c74eef68SDevi Priya 
333*c74eef68SDevi Priya static const char * const sdc_rclk_groups[] = {
334*c74eef68SDevi Priya 	"gpio10",
335*c74eef68SDevi Priya };
336*c74eef68SDevi Priya 
337*c74eef68SDevi Priya static const char * const blsp0_spi_groups[] = {
338*c74eef68SDevi Priya 	"gpio11", "gpio12", "gpio13", "gpio14",
339*c74eef68SDevi Priya };
340*c74eef68SDevi Priya 
341*c74eef68SDevi Priya static const char * const blsp0_uart_groups[] = {
342*c74eef68SDevi Priya 	"gpio11", "gpio12", "gpio13", "gpio14",
343*c74eef68SDevi Priya };
344*c74eef68SDevi Priya 
345*c74eef68SDevi Priya static const char * const blsp3_spi_groups[] = {
346*c74eef68SDevi Priya 	"gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21",
347*c74eef68SDevi Priya };
348*c74eef68SDevi Priya 
349*c74eef68SDevi Priya static const char * const blsp3_i2c_groups[] = {
350*c74eef68SDevi Priya 	"gpio15", "gpio16",
351*c74eef68SDevi Priya };
352*c74eef68SDevi Priya 
353*c74eef68SDevi Priya static const char * const blsp3_uart_groups[] = {
354*c74eef68SDevi Priya 	"gpio15", "gpio16", "gpio17", "gpio18",
355*c74eef68SDevi Priya };
356*c74eef68SDevi Priya 
357*c74eef68SDevi Priya static const char * const dbg_out_groups[] = {
358*c74eef68SDevi Priya 	"gpio17",
359*c74eef68SDevi Priya };
360*c74eef68SDevi Priya 
361*c74eef68SDevi Priya static const char * const cri_trng0_groups[] = {
362*c74eef68SDevi Priya 	"gpio20", "gpio38",
363*c74eef68SDevi Priya };
364*c74eef68SDevi Priya 
365*c74eef68SDevi Priya static const char * const cri_trng1_groups[] = {
366*c74eef68SDevi Priya 	"gpio21", "gpio34",
367*c74eef68SDevi Priya };
368*c74eef68SDevi Priya 
369*c74eef68SDevi Priya static const char * const pcie0_clk_groups[] = {
370*c74eef68SDevi Priya 	"gpio22",
371*c74eef68SDevi Priya };
372*c74eef68SDevi Priya 
373*c74eef68SDevi Priya static const char * const pta_groups[] = {
374*c74eef68SDevi Priya 	"gpio22", "gpio23", "gpio24", "gpio54", "gpio55", "gpio56", "gpio61",
375*c74eef68SDevi Priya 	"gpio62", "gpio63",
376*c74eef68SDevi Priya };
377*c74eef68SDevi Priya 
378*c74eef68SDevi Priya static const char * const wci21_groups[] = {
379*c74eef68SDevi Priya 	"gpio23", "gpio24",
380*c74eef68SDevi Priya };
381*c74eef68SDevi Priya 
382*c74eef68SDevi Priya static const char * const cxc0_groups[] = {
383*c74eef68SDevi Priya 	"gpio23", "gpio24",
384*c74eef68SDevi Priya };
385*c74eef68SDevi Priya 
386*c74eef68SDevi Priya static const char * const pcie0_wake_groups[] = {
387*c74eef68SDevi Priya 	"gpio24",
388*c74eef68SDevi Priya };
389*c74eef68SDevi Priya 
390*c74eef68SDevi Priya static const char * const qdss_cti_trig_out_b0_groups[] = {
391*c74eef68SDevi Priya 	"gpio24",
392*c74eef68SDevi Priya };
393*c74eef68SDevi Priya 
394*c74eef68SDevi Priya static const char * const pcie1_clk_groups[] = {
395*c74eef68SDevi Priya 	"gpio25",
396*c74eef68SDevi Priya };
397*c74eef68SDevi Priya 
398*c74eef68SDevi Priya static const char * const qdss_cti_trig_in_b0_groups[] = {
399*c74eef68SDevi Priya 	"gpio25",
400*c74eef68SDevi Priya };
401*c74eef68SDevi Priya 
402*c74eef68SDevi Priya static const char * const atest_char0_groups[] = {
403*c74eef68SDevi Priya 	"gpio26",
404*c74eef68SDevi Priya };
405*c74eef68SDevi Priya 
406*c74eef68SDevi Priya static const char * const qdss_cti_trig_out_b1_groups[] = {
407*c74eef68SDevi Priya 	"gpio26",
408*c74eef68SDevi Priya };
409*c74eef68SDevi Priya 
410*c74eef68SDevi Priya static const char * const pcie1_wake_groups[] = {
411*c74eef68SDevi Priya 	"gpio27",
412*c74eef68SDevi Priya };
413*c74eef68SDevi Priya 
414*c74eef68SDevi Priya static const char * const atest_char1_groups[] = {
415*c74eef68SDevi Priya 	"gpio27",
416*c74eef68SDevi Priya };
417*c74eef68SDevi Priya 
418*c74eef68SDevi Priya static const char * const qdss_cti_trig_in_b1_groups[] = {
419*c74eef68SDevi Priya 	"gpio27",
420*c74eef68SDevi Priya };
421*c74eef68SDevi Priya 
422*c74eef68SDevi Priya static const char * const pcie2_clk_groups[] = {
423*c74eef68SDevi Priya 	"gpio28",
424*c74eef68SDevi Priya };
425*c74eef68SDevi Priya 
426*c74eef68SDevi Priya static const char * const atest_char2_groups[] = {
427*c74eef68SDevi Priya 	"gpio28",
428*c74eef68SDevi Priya };
429*c74eef68SDevi Priya 
430*c74eef68SDevi Priya static const char * const atest_char3_groups[] = {
431*c74eef68SDevi Priya 	"gpio29",
432*c74eef68SDevi Priya };
433*c74eef68SDevi Priya 
434*c74eef68SDevi Priya static const char * const pcie2_wake_groups[] = {
435*c74eef68SDevi Priya 	"gpio30",
436*c74eef68SDevi Priya };
437*c74eef68SDevi Priya 
438*c74eef68SDevi Priya static const char * const pwm_groups[] = {
439*c74eef68SDevi Priya 	"gpio30", "gpio31", "gpio32", "gpio33", "gpio44", "gpio45", "gpio46",
440*c74eef68SDevi Priya 	"gpio47", "gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55",
441*c74eef68SDevi Priya 	"gpio56", "gpio57", "gpio58", "gpio59", "gpio60",
442*c74eef68SDevi Priya };
443*c74eef68SDevi Priya 
444*c74eef68SDevi Priya static const char * const atest_char_groups[] = {
445*c74eef68SDevi Priya 	"gpio30",
446*c74eef68SDevi Priya };
447*c74eef68SDevi Priya 
448*c74eef68SDevi Priya static const char * const pcie3_clk_groups[] = {
449*c74eef68SDevi Priya 	"gpio31",
450*c74eef68SDevi Priya };
451*c74eef68SDevi Priya 
452*c74eef68SDevi Priya static const char * const qdss_cti_trig_in_a1_groups[] = {
453*c74eef68SDevi Priya 	"gpio31",
454*c74eef68SDevi Priya };
455*c74eef68SDevi Priya 
456*c74eef68SDevi Priya static const char * const qdss_cti_trig_out_a1_groups[] = {
457*c74eef68SDevi Priya 	"gpio32",
458*c74eef68SDevi Priya };
459*c74eef68SDevi Priya 
460*c74eef68SDevi Priya static const char * const pcie3_wake_groups[] = {
461*c74eef68SDevi Priya 	"gpio33",
462*c74eef68SDevi Priya };
463*c74eef68SDevi Priya 
464*c74eef68SDevi Priya static const char * const qdss_cti_trig_in_a0_groups[] = {
465*c74eef68SDevi Priya 	"gpio33",
466*c74eef68SDevi Priya };
467*c74eef68SDevi Priya 
468*c74eef68SDevi Priya static const char * const blsp2_uart_groups[] = {
469*c74eef68SDevi Priya 	"gpio34", "gpio35",
470*c74eef68SDevi Priya };
471*c74eef68SDevi Priya 
472*c74eef68SDevi Priya static const char * const blsp2_i2c_groups[] = {
473*c74eef68SDevi Priya 	"gpio34", "gpio35",
474*c74eef68SDevi Priya };
475*c74eef68SDevi Priya 
476*c74eef68SDevi Priya static const char * const blsp2_spi_groups[] = {
477*c74eef68SDevi Priya 	"gpio34", "gpio35", "gpio36", "gpio37",
478*c74eef68SDevi Priya };
479*c74eef68SDevi Priya 
480*c74eef68SDevi Priya static const char * const blsp1_uart_groups[] = {
481*c74eef68SDevi Priya 	"gpio34", "gpio35", "gpio36", "gpio37",
482*c74eef68SDevi Priya };
483*c74eef68SDevi Priya 
484*c74eef68SDevi Priya static const char * const qdss_cti_trig_out_a0_groups[] = {
485*c74eef68SDevi Priya 	"gpio34",
486*c74eef68SDevi Priya };
487*c74eef68SDevi Priya 
488*c74eef68SDevi Priya static const char * const cri_trng2_groups[] = {
489*c74eef68SDevi Priya 	"gpio35",
490*c74eef68SDevi Priya };
491*c74eef68SDevi Priya 
492*c74eef68SDevi Priya static const char * const blsp1_i2c_groups[] = {
493*c74eef68SDevi Priya 	"gpio36", "gpio37",
494*c74eef68SDevi Priya };
495*c74eef68SDevi Priya 
496*c74eef68SDevi Priya static const char * const cri_trng3_groups[] = {
497*c74eef68SDevi Priya 	"gpio36",
498*c74eef68SDevi Priya };
499*c74eef68SDevi Priya 
500*c74eef68SDevi Priya static const char * const dwc_ddrphy_groups[] = {
501*c74eef68SDevi Priya 	"gpio37",
502*c74eef68SDevi Priya };
503*c74eef68SDevi Priya 
504*c74eef68SDevi Priya static const char * const mdc_groups[] = {
505*c74eef68SDevi Priya 	"gpio38",
506*c74eef68SDevi Priya };
507*c74eef68SDevi Priya 
508*c74eef68SDevi Priya static const char * const mdio_groups[] = {
509*c74eef68SDevi Priya 	"gpio39",
510*c74eef68SDevi Priya };
511*c74eef68SDevi Priya 
512*c74eef68SDevi Priya static const char * const audio_pri_groups[] = {
513*c74eef68SDevi Priya 	"gpio40", "gpio41", "gpio42", "gpio43", "gpio61", "gpio61",
514*c74eef68SDevi Priya };
515*c74eef68SDevi Priya 
516*c74eef68SDevi Priya static const char * const audio_pdm0_groups[] = {
517*c74eef68SDevi Priya 	"gpio40", "gpio41", "gpio42", "gpio43",
518*c74eef68SDevi Priya };
519*c74eef68SDevi Priya 
520*c74eef68SDevi Priya static const char * const qdss_traceclk_a_groups[] = {
521*c74eef68SDevi Priya 	"gpio43",
522*c74eef68SDevi Priya };
523*c74eef68SDevi Priya 
524*c74eef68SDevi Priya static const char * const audio_sec_groups[] = {
525*c74eef68SDevi Priya 	"gpio44", "gpio45", "gpio46", "gpio47", "gpio62", "gpio62",
526*c74eef68SDevi Priya };
527*c74eef68SDevi Priya 
528*c74eef68SDevi Priya static const char * const wsa_swrm_groups[] = {
529*c74eef68SDevi Priya 	"gpio44", "gpio45",
530*c74eef68SDevi Priya };
531*c74eef68SDevi Priya 
532*c74eef68SDevi Priya static const char * const qdss_tracectl_a_groups[] = {
533*c74eef68SDevi Priya 	"gpio44",
534*c74eef68SDevi Priya };
535*c74eef68SDevi Priya 
536*c74eef68SDevi Priya static const char * const qdss_tracedata_a_groups[] = {
537*c74eef68SDevi Priya 	"gpio45", "gpio46", "gpio47", "gpio48", "gpio49", "gpio50", "gpio51",
538*c74eef68SDevi Priya 	"gpio52", "gpio53", "gpio54", "gpio55", "gpio56", "gpio57", "gpio58",
539*c74eef68SDevi Priya 	"gpio59", "gpio60",
540*c74eef68SDevi Priya };
541*c74eef68SDevi Priya 
542*c74eef68SDevi Priya static const char * const rx1_groups[] = {
543*c74eef68SDevi Priya 	"gpio46",
544*c74eef68SDevi Priya };
545*c74eef68SDevi Priya 
546*c74eef68SDevi Priya static const char * const mac_groups[] = {
547*c74eef68SDevi Priya 	"gpio46", "gpio47", "gpio57", "gpio58",
548*c74eef68SDevi Priya };
549*c74eef68SDevi Priya 
550*c74eef68SDevi Priya static const char * const blsp5_i2c_groups[] = {
551*c74eef68SDevi Priya 	"gpio48", "gpio49",
552*c74eef68SDevi Priya };
553*c74eef68SDevi Priya 
554*c74eef68SDevi Priya static const char * const blsp5_uart_groups[] = {
555*c74eef68SDevi Priya 	"gpio48", "gpio49",
556*c74eef68SDevi Priya };
557*c74eef68SDevi Priya 
558*c74eef68SDevi Priya static const char * const blsp4_uart_groups[] = {
559*c74eef68SDevi Priya 	"gpio50", "gpio51", "gpio52", "gpio53",
560*c74eef68SDevi Priya };
561*c74eef68SDevi Priya 
562*c74eef68SDevi Priya static const char * const blsp4_i2c_groups[] = {
563*c74eef68SDevi Priya 	"gpio50", "gpio51",
564*c74eef68SDevi Priya };
565*c74eef68SDevi Priya 
566*c74eef68SDevi Priya static const char * const blsp4_spi_groups[] = {
567*c74eef68SDevi Priya 	"gpio50", "gpio51", "gpio52", "gpio53",
568*c74eef68SDevi Priya };
569*c74eef68SDevi Priya 
570*c74eef68SDevi Priya static const char * const wci20_groups[] = {
571*c74eef68SDevi Priya 	"gpio57", "gpio58",
572*c74eef68SDevi Priya };
573*c74eef68SDevi Priya 
574*c74eef68SDevi Priya static const char * const cxc1_groups[] = {
575*c74eef68SDevi Priya 	"gpio57", "gpio58",
576*c74eef68SDevi Priya };
577*c74eef68SDevi Priya 
578*c74eef68SDevi Priya static const char * const rx0_groups[] = {
579*c74eef68SDevi Priya 	"gpio59",
580*c74eef68SDevi Priya };
581*c74eef68SDevi Priya 
582*c74eef68SDevi Priya static const char * const prng_rosc0_groups[] = {
583*c74eef68SDevi Priya 	"gpio60",
584*c74eef68SDevi Priya };
585*c74eef68SDevi Priya 
586*c74eef68SDevi Priya static const char * const gcc_plltest_groups[] = {
587*c74eef68SDevi Priya 	"gpio60", "gpio62",
588*c74eef68SDevi Priya };
589*c74eef68SDevi Priya 
590*c74eef68SDevi Priya static const char * const blsp1_spi_groups[] = {
591*c74eef68SDevi Priya 	"gpio61", "gpio62", "gpio63", "gpio64",
592*c74eef68SDevi Priya };
593*c74eef68SDevi Priya 
594*c74eef68SDevi Priya static const char * const audio_pdm1_groups[] = {
595*c74eef68SDevi Priya 	"gpio61", "gpio62", "gpio63", "gpio64",
596*c74eef68SDevi Priya };
597*c74eef68SDevi Priya 
598*c74eef68SDevi Priya static const char * const prng_rosc1_groups[] = {
599*c74eef68SDevi Priya 	"gpio61",
600*c74eef68SDevi Priya };
601*c74eef68SDevi Priya 
602*c74eef68SDevi Priya static const char * const gcc_tlmm_groups[] = {
603*c74eef68SDevi Priya 	"gpio61",
604*c74eef68SDevi Priya };
605*c74eef68SDevi Priya 
606*c74eef68SDevi Priya static const char * const prng_rosc2_groups[] = {
607*c74eef68SDevi Priya 	"gpio62",
608*c74eef68SDevi Priya };
609*c74eef68SDevi Priya 
610*c74eef68SDevi Priya static const char * const prng_rosc3_groups[] = {
611*c74eef68SDevi Priya 	"gpio63",
612*c74eef68SDevi Priya };
613*c74eef68SDevi Priya 
614*c74eef68SDevi Priya static const char * const tsens_max_groups[] = {
615*c74eef68SDevi Priya 	"gpio64",
616*c74eef68SDevi Priya };
617*c74eef68SDevi Priya 
618*c74eef68SDevi Priya static const struct pinfunction ipq9574_functions[] = {
619*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(atest_char),
620*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(atest_char0),
621*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(atest_char1),
622*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(atest_char2),
623*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(atest_char3),
624*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(audio_pdm0),
625*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(audio_pdm1),
626*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(audio_pri),
627*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(audio_sec),
628*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(blsp0_spi),
629*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(blsp0_uart),
630*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(blsp1_i2c),
631*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(blsp1_spi),
632*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(blsp1_uart),
633*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(blsp2_i2c),
634*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(blsp2_spi),
635*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(blsp2_uart),
636*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(blsp3_i2c),
637*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(blsp3_spi),
638*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(blsp3_uart),
639*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(blsp4_i2c),
640*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(blsp4_spi),
641*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(blsp4_uart),
642*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(blsp5_i2c),
643*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(blsp5_uart),
644*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(cri_trng0),
645*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(cri_trng1),
646*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(cri_trng2),
647*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(cri_trng3),
648*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(cxc0),
649*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(cxc1),
650*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(dbg_out),
651*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(dwc_ddrphy),
652*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(gcc_plltest),
653*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(gcc_tlmm),
654*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(gpio),
655*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(mac),
656*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(mdc),
657*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(mdio),
658*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(pcie0_clk),
659*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(pcie0_wake),
660*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(pcie1_clk),
661*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(pcie1_wake),
662*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(pcie2_clk),
663*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(pcie2_wake),
664*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(pcie3_clk),
665*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(pcie3_wake),
666*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(prng_rosc0),
667*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(prng_rosc1),
668*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(prng_rosc2),
669*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(prng_rosc3),
670*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(pta),
671*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(pwm),
672*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(qdss_cti_trig_in_a0),
673*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(qdss_cti_trig_in_a1),
674*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(qdss_cti_trig_in_b0),
675*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(qdss_cti_trig_in_b1),
676*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(qdss_cti_trig_out_a0),
677*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(qdss_cti_trig_out_a1),
678*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(qdss_cti_trig_out_b0),
679*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(qdss_cti_trig_out_b1),
680*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(qdss_traceclk_a),
681*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(qdss_traceclk_b),
682*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(qdss_tracectl_a),
683*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(qdss_tracectl_b),
684*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(qdss_tracedata_a),
685*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(qdss_tracedata_b),
686*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(qspi_data),
687*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(qspi_clk),
688*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(qspi_cs),
689*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(rx0),
690*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(rx1),
691*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(sdc_data),
692*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(sdc_clk),
693*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(sdc_cmd),
694*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(sdc_rclk),
695*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(tsens_max),
696*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(wci20),
697*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(wci21),
698*c74eef68SDevi Priya 	MSM_PIN_FUNCTION(wsa_swrm),
699*c74eef68SDevi Priya };
700*c74eef68SDevi Priya 
701*c74eef68SDevi Priya static const struct msm_pingroup ipq9574_groups[] = {
702*c74eef68SDevi Priya 	PINGROUP(0, sdc_data, qspi_data, qdss_traceclk_b, _, _, _, _, _, _),
703*c74eef68SDevi Priya 	PINGROUP(1, sdc_data, qspi_data, qdss_tracectl_b, _, _, _, _, _, _),
704*c74eef68SDevi Priya 	PINGROUP(2, sdc_data, qspi_data, qdss_tracedata_b, _, _, _, _, _, _),
705*c74eef68SDevi Priya 	PINGROUP(3, sdc_data, qspi_data, qdss_tracedata_b, _, _, _, _, _, _),
706*c74eef68SDevi Priya 	PINGROUP(4, sdc_cmd, qspi_cs, qdss_tracedata_b, _, _, _, _, _, _),
707*c74eef68SDevi Priya 	PINGROUP(5, sdc_clk, qspi_clk, qdss_tracedata_b, _, _, _, _, _, _),
708*c74eef68SDevi Priya 	PINGROUP(6, sdc_data, qdss_tracedata_b, _, _, _, _, _, _, _),
709*c74eef68SDevi Priya 	PINGROUP(7, sdc_data, qdss_tracedata_b, _, _, _, _, _, _, _),
710*c74eef68SDevi Priya 	PINGROUP(8, sdc_data, qdss_tracedata_b, _, _, _, _, _, _, _),
711*c74eef68SDevi Priya 	PINGROUP(9, sdc_data, qdss_tracedata_b, _, _, _, _, _, _, _),
712*c74eef68SDevi Priya 	PINGROUP(10, sdc_rclk, qdss_tracedata_b, _, _, _, _, _, _, _),
713*c74eef68SDevi Priya 	PINGROUP(11, blsp0_spi, blsp0_uart, qdss_tracedata_b, _, _, _, _, _, _),
714*c74eef68SDevi Priya 	PINGROUP(12, blsp0_spi, blsp0_uart, qdss_tracedata_b, _, _, _, _, _, _),
715*c74eef68SDevi Priya 	PINGROUP(13, blsp0_spi, blsp0_uart, qdss_tracedata_b, _, _, _, _, _, _),
716*c74eef68SDevi Priya 	PINGROUP(14, blsp0_spi, blsp0_uart, qdss_tracedata_b, _, _, _, _, _, _),
717*c74eef68SDevi Priya 	PINGROUP(15, blsp3_spi, blsp3_i2c, blsp3_uart, qdss_tracedata_b, _, _, _, _, _),
718*c74eef68SDevi Priya 	PINGROUP(16, blsp3_spi, blsp3_i2c, blsp3_uart, qdss_tracedata_b, _, _, _, _, _),
719*c74eef68SDevi Priya 	PINGROUP(17, blsp3_spi, blsp3_uart, dbg_out, qdss_tracedata_b, _, _, _, _, _),
720*c74eef68SDevi Priya 	PINGROUP(18, blsp3_spi, blsp3_uart, _, _, _, _, _, _, _),
721*c74eef68SDevi Priya 	PINGROUP(19, blsp3_spi, _, _, _, _, _, _, _, _),
722*c74eef68SDevi Priya 	PINGROUP(20, blsp3_spi, _, cri_trng0, _, _, _, _, _, _),
723*c74eef68SDevi Priya 	PINGROUP(21, blsp3_spi, _, cri_trng1, _, _, _, _, _, _),
724*c74eef68SDevi Priya 	PINGROUP(22, pcie0_clk, _, pta, _, _, _, _, _, _),
725*c74eef68SDevi Priya 	PINGROUP(23, _, pta, wci21, cxc0, _, _, _, _, _),
726*c74eef68SDevi Priya 	PINGROUP(24, pcie0_wake, _, pta, wci21, cxc0, _, qdss_cti_trig_out_b0, _, _),
727*c74eef68SDevi Priya 	PINGROUP(25, pcie1_clk, _, _, qdss_cti_trig_in_b0, _, _, _, _, _),
728*c74eef68SDevi Priya 	PINGROUP(26, _, atest_char0, _, qdss_cti_trig_out_b1, _, _, _, _, _),
729*c74eef68SDevi Priya 	PINGROUP(27, pcie1_wake, _, atest_char1, qdss_cti_trig_in_b1, _, _, _, _, _),
730*c74eef68SDevi Priya 	PINGROUP(28, pcie2_clk, atest_char2, _, _, _, _, _, _, _),
731*c74eef68SDevi Priya 	PINGROUP(29, atest_char3, _, _, _, _, _, _, _, _),
732*c74eef68SDevi Priya 	PINGROUP(30, pcie2_wake, pwm, atest_char, _, _, _, _, _, _),
733*c74eef68SDevi Priya 	PINGROUP(31, pcie3_clk, pwm, _, qdss_cti_trig_in_a1, _, _, _, _, _),
734*c74eef68SDevi Priya 	PINGROUP(32, pwm, _, qdss_cti_trig_out_a1, _, _, _, _, _, _),
735*c74eef68SDevi Priya 	PINGROUP(33, pcie3_wake, pwm, _, qdss_cti_trig_in_a0, _, _, _, _, _),
736*c74eef68SDevi Priya 	PINGROUP(34, blsp2_uart, blsp2_i2c, blsp2_spi, blsp1_uart, _, cri_trng1, qdss_cti_trig_out_a0, _, _),
737*c74eef68SDevi Priya 	PINGROUP(35, blsp2_uart, blsp2_i2c, blsp2_spi, blsp1_uart, _, cri_trng2, _, _, _),
738*c74eef68SDevi Priya 	PINGROUP(36, blsp1_uart, blsp1_i2c, blsp2_spi, _, cri_trng3, _, _, _, _),
739*c74eef68SDevi Priya 	PINGROUP(37, blsp1_uart, blsp1_i2c, blsp2_spi, _, dwc_ddrphy, _, _, _, _),
740*c74eef68SDevi Priya 	PINGROUP(38, mdc, _, cri_trng0, _, _, _, _, _, _),
741*c74eef68SDevi Priya 	PINGROUP(39, mdio, _, _, _, _, _, _, _, _),
742*c74eef68SDevi Priya 	PINGROUP(40, audio_pri, audio_pdm0, _, _, _, _, _, _, _),
743*c74eef68SDevi Priya 	PINGROUP(41, audio_pri, audio_pdm0, _, _, _, _, _, _, _),
744*c74eef68SDevi Priya 	PINGROUP(42, audio_pri, audio_pdm0, _, _, _, _, _, _, _),
745*c74eef68SDevi Priya 	PINGROUP(43, audio_pri, audio_pdm0, _, qdss_traceclk_a, _, _, _, _, _),
746*c74eef68SDevi Priya 	PINGROUP(44, pwm, audio_sec, wsa_swrm, _, qdss_tracectl_a, _, _, _, _),
747*c74eef68SDevi Priya 	PINGROUP(45, pwm, audio_sec, wsa_swrm, _, qdss_tracedata_a, _, _, _, _),
748*c74eef68SDevi Priya 	PINGROUP(46, pwm, audio_sec, rx1, mac, _, qdss_tracedata_a, _, _, _),
749*c74eef68SDevi Priya 	PINGROUP(47, pwm, audio_sec, mac, _, qdss_tracedata_a, _, _, _, _),
750*c74eef68SDevi Priya 	PINGROUP(48, blsp5_i2c, blsp5_uart, _, qdss_tracedata_a, _, _, _, _, _),
751*c74eef68SDevi Priya 	PINGROUP(49, blsp5_i2c, blsp5_uart, _, qdss_tracedata_a, _, _, _, _, _),
752*c74eef68SDevi Priya 	PINGROUP(50, blsp4_uart, blsp4_i2c, blsp4_spi, pwm, qdss_tracedata_a, _, _, _, _),
753*c74eef68SDevi Priya 	PINGROUP(51, blsp4_uart, blsp4_i2c, blsp4_spi, pwm, qdss_tracedata_a, _, _, _, _),
754*c74eef68SDevi Priya 	PINGROUP(52, blsp4_uart, blsp4_spi, pwm, qdss_tracedata_a, _, _, _, _, _),
755*c74eef68SDevi Priya 	PINGROUP(53, blsp4_uart, blsp4_spi, pwm, qdss_tracedata_a, _, _, _, _, _),
756*c74eef68SDevi Priya 	PINGROUP(54, pta, pwm, qdss_tracedata_a, _, _, _, _, _, _),
757*c74eef68SDevi Priya 	PINGROUP(55, pta, pwm, qdss_tracedata_a, _, _, _, _, _, _),
758*c74eef68SDevi Priya 	PINGROUP(56, pta, pwm, qdss_tracedata_a, _, _, _, _, _, _),
759*c74eef68SDevi Priya 	PINGROUP(57, wci20, cxc1, mac, pwm, qdss_tracedata_a, _, _, _, _),
760*c74eef68SDevi Priya 	PINGROUP(58, wci20, cxc1, mac, pwm, qdss_tracedata_a, _, _, _, _),
761*c74eef68SDevi Priya 	PINGROUP(59, rx0, pwm, qdss_tracedata_a, _, _, _, _, _, _),
762*c74eef68SDevi Priya 	PINGROUP(60, pwm, prng_rosc0, qdss_tracedata_a, _, gcc_plltest, _, _, _, _),
763*c74eef68SDevi Priya 	PINGROUP(61, blsp1_spi, audio_pri, audio_pdm1, audio_pri, pta, prng_rosc1, gcc_tlmm, _, _),
764*c74eef68SDevi Priya 	PINGROUP(62, blsp1_spi, audio_sec, audio_pdm1, audio_sec, pta, prng_rosc2, gcc_plltest, _, _),
765*c74eef68SDevi Priya 	PINGROUP(63, blsp1_spi, audio_pdm1, pta, prng_rosc3, _, _, _, _, _),
766*c74eef68SDevi Priya 	PINGROUP(64, blsp1_spi, audio_pdm1, tsens_max, _, _, _, _, _, _),
767*c74eef68SDevi Priya };
768*c74eef68SDevi Priya 
769*c74eef68SDevi Priya /* Reserving GPIO59 for controlling the QFPROM LDO regulator */
770*c74eef68SDevi Priya static const int ipq9574_reserved_gpios[] = {
771*c74eef68SDevi Priya 	59, -1
772*c74eef68SDevi Priya };
773*c74eef68SDevi Priya 
774*c74eef68SDevi Priya static const struct msm_pinctrl_soc_data ipq9574_pinctrl = {
775*c74eef68SDevi Priya 	.pins = ipq9574_pins,
776*c74eef68SDevi Priya 	.npins = ARRAY_SIZE(ipq9574_pins),
777*c74eef68SDevi Priya 	.functions = ipq9574_functions,
778*c74eef68SDevi Priya 	.nfunctions = ARRAY_SIZE(ipq9574_functions),
779*c74eef68SDevi Priya 	.groups = ipq9574_groups,
780*c74eef68SDevi Priya 	.ngroups = ARRAY_SIZE(ipq9574_groups),
781*c74eef68SDevi Priya 	.reserved_gpios = ipq9574_reserved_gpios,
782*c74eef68SDevi Priya 	.ngpios = 65,
783*c74eef68SDevi Priya };
784*c74eef68SDevi Priya 
ipq9574_pinctrl_probe(struct platform_device * pdev)785*c74eef68SDevi Priya static int ipq9574_pinctrl_probe(struct platform_device *pdev)
786*c74eef68SDevi Priya {
787*c74eef68SDevi Priya 	return msm_pinctrl_probe(pdev, &ipq9574_pinctrl);
788*c74eef68SDevi Priya }
789*c74eef68SDevi Priya 
790*c74eef68SDevi Priya static const struct of_device_id ipq9574_pinctrl_of_match[] = {
791*c74eef68SDevi Priya 	{ .compatible = "qcom,ipq9574-tlmm", },
792*c74eef68SDevi Priya 	{ }
793*c74eef68SDevi Priya };
794*c74eef68SDevi Priya MODULE_DEVICE_TABLE(of, ipq9574_pinctrl_of_match);
795*c74eef68SDevi Priya 
796*c74eef68SDevi Priya static struct platform_driver ipq9574_pinctrl_driver = {
797*c74eef68SDevi Priya 	.driver = {
798*c74eef68SDevi Priya 		.name = "ipq9574-tlmm",
799*c74eef68SDevi Priya 		.of_match_table = ipq9574_pinctrl_of_match,
800*c74eef68SDevi Priya 	},
801*c74eef68SDevi Priya 	.probe = ipq9574_pinctrl_probe,
802*c74eef68SDevi Priya 	.remove = msm_pinctrl_remove,
803*c74eef68SDevi Priya };
804*c74eef68SDevi Priya 
ipq9574_pinctrl_init(void)805*c74eef68SDevi Priya static int __init ipq9574_pinctrl_init(void)
806*c74eef68SDevi Priya {
807*c74eef68SDevi Priya 	return platform_driver_register(&ipq9574_pinctrl_driver);
808*c74eef68SDevi Priya }
809*c74eef68SDevi Priya arch_initcall(ipq9574_pinctrl_init);
810*c74eef68SDevi Priya 
ipq9574_pinctrl_exit(void)811*c74eef68SDevi Priya static void __exit ipq9574_pinctrl_exit(void)
812*c74eef68SDevi Priya {
813*c74eef68SDevi Priya 	platform_driver_unregister(&ipq9574_pinctrl_driver);
814*c74eef68SDevi Priya }
815*c74eef68SDevi Priya module_exit(ipq9574_pinctrl_exit);
816*c74eef68SDevi Priya 
817*c74eef68SDevi Priya MODULE_DESCRIPTION("QTI IPQ9574 TLMM driver");
818*c74eef68SDevi Priya MODULE_LICENSE("GPL");
819*c74eef68SDevi Priya