xref: /linux/drivers/pinctrl/qcom/pinctrl-sm4450.c (revision bba2c3615bd6cfee7456d1130f2e6b01b3f4e9ba)
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
4  */
5 
6 #include <linux/module.h>
7 #include <linux/of.h>
8 #include <linux/platform_device.h>
9 
10 #include "pinctrl-msm.h"
11 
12 #define REG_SIZE 0x1000
13 
14 #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9)	\
15 	{					        \
16 		.grp = PINCTRL_PINGROUP("gpio" #id,     \
17 			gpio##id##_pins,                \
18 			ARRAY_SIZE(gpio##id##_pins)),   \
19 		.funcs = (int[]){			\
20 			msm_mux_gpio, /* gpio mode */	\
21 			msm_mux_##f1,			\
22 			msm_mux_##f2,			\
23 			msm_mux_##f3,			\
24 			msm_mux_##f4,			\
25 			msm_mux_##f5,			\
26 			msm_mux_##f6,			\
27 			msm_mux_##f7,			\
28 			msm_mux_##f8,			\
29 			msm_mux_##f9			\
30 		},				        \
31 		.nfuncs = 10,				\
32 		.ctl_reg = REG_SIZE * id,			\
33 		.io_reg = 0x4 + REG_SIZE * id,		\
34 		.intr_cfg_reg = 0x8 + REG_SIZE * id,		\
35 		.intr_status_reg = 0xc + REG_SIZE * id,	\
36 		.mux_bit = 2,			\
37 		.pull_bit = 0,			\
38 		.drv_bit = 6,			\
39 		.egpio_enable = 12,		\
40 		.egpio_present = 11,		\
41 		.oe_bit = 9,			\
42 		.in_bit = 0,			\
43 		.out_bit = 1,			\
44 		.intr_enable_bit = 0,		\
45 		.intr_status_bit = 0,		\
46 		.intr_target_bit = 5,		\
47 		.intr_target_kpss_val = 3,	\
48 		.intr_raw_status_bit = 4,	\
49 		.intr_polarity_bit = 1,		\
50 		.intr_detection_bit = 2,	\
51 		.intr_detection_width = 2,	\
52 	}
53 
54 #define SDC_QDSD_PINGROUP(pg_name, ctl, pull, drv)	\
55 	{					        \
56 		.grp = PINCTRL_PINGROUP(#pg_name,       \
57 			pg_name##_pins,                 \
58 			ARRAY_SIZE(pg_name##_pins)),    \
59 		.ctl_reg = ctl,				\
60 		.io_reg = 0,				\
61 		.intr_cfg_reg = 0,			\
62 		.intr_status_reg = 0,			\
63 		.mux_bit = -1,				\
64 		.pull_bit = pull,			\
65 		.drv_bit = drv,				\
66 		.oe_bit = -1,				\
67 		.in_bit = -1,				\
68 		.out_bit = -1,				\
69 		.intr_enable_bit = -1,			\
70 		.intr_status_bit = -1,			\
71 		.intr_target_bit = -1,			\
72 		.intr_raw_status_bit = -1,		\
73 		.intr_polarity_bit = -1,		\
74 		.intr_detection_bit = -1,		\
75 		.intr_detection_width = -1,		\
76 	}
77 
78 #define UFS_RESET(pg_name, offset)				\
79 	{					        \
80 		.grp = PINCTRL_PINGROUP(#pg_name,       \
81 			pg_name##_pins,                 \
82 			ARRAY_SIZE(pg_name##_pins)),    \
83 		.ctl_reg = offset,			\
84 		.io_reg = offset + 0x4,			\
85 		.intr_cfg_reg = 0,			\
86 		.intr_status_reg = 0,			\
87 		.mux_bit = -1,				\
88 		.pull_bit = 3,				\
89 		.drv_bit = 0,				\
90 		.oe_bit = -1,				\
91 		.in_bit = -1,				\
92 		.out_bit = 0,				\
93 		.intr_enable_bit = -1,			\
94 		.intr_status_bit = -1,			\
95 		.intr_target_bit = -1,			\
96 		.intr_raw_status_bit = -1,		\
97 		.intr_polarity_bit = -1,		\
98 		.intr_detection_bit = -1,		\
99 		.intr_detection_width = -1,		\
100 	}
101 
102 static const struct pinctrl_pin_desc sm4450_pins[] = {
103 	PINCTRL_PIN(0, "GPIO_0"),
104 	PINCTRL_PIN(1, "GPIO_1"),
105 	PINCTRL_PIN(2, "GPIO_2"),
106 	PINCTRL_PIN(3, "GPIO_3"),
107 	PINCTRL_PIN(4, "GPIO_4"),
108 	PINCTRL_PIN(5, "GPIO_5"),
109 	PINCTRL_PIN(6, "GPIO_6"),
110 	PINCTRL_PIN(7, "GPIO_7"),
111 	PINCTRL_PIN(8, "GPIO_8"),
112 	PINCTRL_PIN(9, "GPIO_9"),
113 	PINCTRL_PIN(10, "GPIO_10"),
114 	PINCTRL_PIN(11, "GPIO_11"),
115 	PINCTRL_PIN(12, "GPIO_12"),
116 	PINCTRL_PIN(13, "GPIO_13"),
117 	PINCTRL_PIN(14, "GPIO_14"),
118 	PINCTRL_PIN(15, "GPIO_15"),
119 	PINCTRL_PIN(16, "GPIO_16"),
120 	PINCTRL_PIN(17, "GPIO_17"),
121 	PINCTRL_PIN(18, "GPIO_18"),
122 	PINCTRL_PIN(19, "GPIO_19"),
123 	PINCTRL_PIN(20, "GPIO_20"),
124 	PINCTRL_PIN(21, "GPIO_21"),
125 	PINCTRL_PIN(22, "GPIO_22"),
126 	PINCTRL_PIN(23, "GPIO_23"),
127 	PINCTRL_PIN(24, "GPIO_24"),
128 	PINCTRL_PIN(25, "GPIO_25"),
129 	PINCTRL_PIN(26, "GPIO_26"),
130 	PINCTRL_PIN(27, "GPIO_27"),
131 	PINCTRL_PIN(28, "GPIO_28"),
132 	PINCTRL_PIN(29, "GPIO_29"),
133 	PINCTRL_PIN(30, "GPIO_30"),
134 	PINCTRL_PIN(31, "GPIO_31"),
135 	PINCTRL_PIN(32, "GPIO_32"),
136 	PINCTRL_PIN(33, "GPIO_33"),
137 	PINCTRL_PIN(34, "GPIO_34"),
138 	PINCTRL_PIN(35, "GPIO_35"),
139 	PINCTRL_PIN(36, "GPIO_36"),
140 	PINCTRL_PIN(37, "GPIO_37"),
141 	PINCTRL_PIN(38, "GPIO_38"),
142 	PINCTRL_PIN(39, "GPIO_39"),
143 	PINCTRL_PIN(40, "GPIO_40"),
144 	PINCTRL_PIN(41, "GPIO_41"),
145 	PINCTRL_PIN(42, "GPIO_42"),
146 	PINCTRL_PIN(43, "GPIO_43"),
147 	PINCTRL_PIN(44, "GPIO_44"),
148 	PINCTRL_PIN(45, "GPIO_45"),
149 	PINCTRL_PIN(46, "GPIO_46"),
150 	PINCTRL_PIN(47, "GPIO_47"),
151 	PINCTRL_PIN(48, "GPIO_48"),
152 	PINCTRL_PIN(49, "GPIO_49"),
153 	PINCTRL_PIN(50, "GPIO_50"),
154 	PINCTRL_PIN(51, "GPIO_51"),
155 	PINCTRL_PIN(52, "GPIO_52"),
156 	PINCTRL_PIN(53, "GPIO_53"),
157 	PINCTRL_PIN(54, "GPIO_54"),
158 	PINCTRL_PIN(55, "GPIO_55"),
159 	PINCTRL_PIN(56, "GPIO_56"),
160 	PINCTRL_PIN(57, "GPIO_57"),
161 	PINCTRL_PIN(58, "GPIO_58"),
162 	PINCTRL_PIN(59, "GPIO_59"),
163 	PINCTRL_PIN(60, "GPIO_60"),
164 	PINCTRL_PIN(61, "GPIO_61"),
165 	PINCTRL_PIN(62, "GPIO_62"),
166 	PINCTRL_PIN(63, "GPIO_63"),
167 	PINCTRL_PIN(64, "GPIO_64"),
168 	PINCTRL_PIN(65, "GPIO_65"),
169 	PINCTRL_PIN(66, "GPIO_66"),
170 	PINCTRL_PIN(67, "GPIO_67"),
171 	PINCTRL_PIN(68, "GPIO_68"),
172 	PINCTRL_PIN(69, "GPIO_69"),
173 	PINCTRL_PIN(70, "GPIO_70"),
174 	PINCTRL_PIN(71, "GPIO_71"),
175 	PINCTRL_PIN(72, "GPIO_72"),
176 	PINCTRL_PIN(73, "GPIO_73"),
177 	PINCTRL_PIN(74, "GPIO_74"),
178 	PINCTRL_PIN(75, "GPIO_75"),
179 	PINCTRL_PIN(76, "GPIO_76"),
180 	PINCTRL_PIN(77, "GPIO_77"),
181 	PINCTRL_PIN(78, "GPIO_78"),
182 	PINCTRL_PIN(79, "GPIO_79"),
183 	PINCTRL_PIN(80, "GPIO_80"),
184 	PINCTRL_PIN(81, "GPIO_81"),
185 	PINCTRL_PIN(82, "GPIO_82"),
186 	PINCTRL_PIN(83, "GPIO_83"),
187 	PINCTRL_PIN(84, "GPIO_84"),
188 	PINCTRL_PIN(85, "GPIO_85"),
189 	PINCTRL_PIN(86, "GPIO_86"),
190 	PINCTRL_PIN(87, "GPIO_87"),
191 	PINCTRL_PIN(88, "GPIO_88"),
192 	PINCTRL_PIN(89, "GPIO_89"),
193 	PINCTRL_PIN(90, "GPIO_90"),
194 	PINCTRL_PIN(91, "GPIO_91"),
195 	PINCTRL_PIN(92, "GPIO_92"),
196 	PINCTRL_PIN(93, "GPIO_93"),
197 	PINCTRL_PIN(94, "GPIO_94"),
198 	PINCTRL_PIN(95, "GPIO_95"),
199 	PINCTRL_PIN(96, "GPIO_96"),
200 	PINCTRL_PIN(97, "GPIO_97"),
201 	PINCTRL_PIN(98, "GPIO_98"),
202 	PINCTRL_PIN(99, "GPIO_99"),
203 	PINCTRL_PIN(100, "GPIO_100"),
204 	PINCTRL_PIN(101, "GPIO_101"),
205 	PINCTRL_PIN(102, "GPIO_102"),
206 	PINCTRL_PIN(103, "GPIO_103"),
207 	PINCTRL_PIN(104, "GPIO_104"),
208 	PINCTRL_PIN(105, "GPIO_105"),
209 	PINCTRL_PIN(106, "GPIO_106"),
210 	PINCTRL_PIN(107, "GPIO_107"),
211 	PINCTRL_PIN(108, "GPIO_108"),
212 	PINCTRL_PIN(109, "GPIO_109"),
213 	PINCTRL_PIN(110, "GPIO_110"),
214 	PINCTRL_PIN(111, "GPIO_111"),
215 	PINCTRL_PIN(112, "GPIO_112"),
216 	PINCTRL_PIN(113, "GPIO_113"),
217 	PINCTRL_PIN(114, "GPIO_114"),
218 	PINCTRL_PIN(115, "GPIO_115"),
219 	PINCTRL_PIN(116, "GPIO_116"),
220 	PINCTRL_PIN(117, "GPIO_117"),
221 	PINCTRL_PIN(118, "GPIO_118"),
222 	PINCTRL_PIN(119, "GPIO_119"),
223 	PINCTRL_PIN(120, "GPIO_120"),
224 	PINCTRL_PIN(121, "GPIO_121"),
225 	PINCTRL_PIN(122, "GPIO_122"),
226 	PINCTRL_PIN(123, "GPIO_123"),
227 	PINCTRL_PIN(124, "GPIO_124"),
228 	PINCTRL_PIN(125, "GPIO_125"),
229 	PINCTRL_PIN(126, "GPIO_126"),
230 	PINCTRL_PIN(127, "GPIO_127"),
231 	PINCTRL_PIN(128, "GPIO_128"),
232 	PINCTRL_PIN(129, "GPIO_129"),
233 	PINCTRL_PIN(130, "GPIO_130"),
234 	PINCTRL_PIN(131, "GPIO_131"),
235 	PINCTRL_PIN(132, "GPIO_132"),
236 	PINCTRL_PIN(133, "GPIO_133"),
237 	PINCTRL_PIN(134, "GPIO_134"),
238 	PINCTRL_PIN(135, "GPIO_135"),
239 	PINCTRL_PIN(136, "UFS_RESET"),
240 	PINCTRL_PIN(137, "SDC1_RCLK"),
241 	PINCTRL_PIN(138, "SDC1_CLK"),
242 	PINCTRL_PIN(139, "SDC1_CMD"),
243 	PINCTRL_PIN(140, "SDC1_DATA"),
244 	PINCTRL_PIN(141, "SDC2_CLK"),
245 	PINCTRL_PIN(142, "SDC2_CMD"),
246 	PINCTRL_PIN(143, "SDC2_DATA"),
247 };
248 
249 #define DECLARE_MSM_GPIO_PINS(pin) \
250 	static const unsigned int gpio##pin##_pins[] = { pin }
251 DECLARE_MSM_GPIO_PINS(0);
252 DECLARE_MSM_GPIO_PINS(1);
253 DECLARE_MSM_GPIO_PINS(2);
254 DECLARE_MSM_GPIO_PINS(3);
255 DECLARE_MSM_GPIO_PINS(4);
256 DECLARE_MSM_GPIO_PINS(5);
257 DECLARE_MSM_GPIO_PINS(6);
258 DECLARE_MSM_GPIO_PINS(7);
259 DECLARE_MSM_GPIO_PINS(8);
260 DECLARE_MSM_GPIO_PINS(9);
261 DECLARE_MSM_GPIO_PINS(10);
262 DECLARE_MSM_GPIO_PINS(11);
263 DECLARE_MSM_GPIO_PINS(12);
264 DECLARE_MSM_GPIO_PINS(13);
265 DECLARE_MSM_GPIO_PINS(14);
266 DECLARE_MSM_GPIO_PINS(15);
267 DECLARE_MSM_GPIO_PINS(16);
268 DECLARE_MSM_GPIO_PINS(17);
269 DECLARE_MSM_GPIO_PINS(18);
270 DECLARE_MSM_GPIO_PINS(19);
271 DECLARE_MSM_GPIO_PINS(20);
272 DECLARE_MSM_GPIO_PINS(21);
273 DECLARE_MSM_GPIO_PINS(22);
274 DECLARE_MSM_GPIO_PINS(23);
275 DECLARE_MSM_GPIO_PINS(24);
276 DECLARE_MSM_GPIO_PINS(25);
277 DECLARE_MSM_GPIO_PINS(26);
278 DECLARE_MSM_GPIO_PINS(27);
279 DECLARE_MSM_GPIO_PINS(28);
280 DECLARE_MSM_GPIO_PINS(29);
281 DECLARE_MSM_GPIO_PINS(30);
282 DECLARE_MSM_GPIO_PINS(31);
283 DECLARE_MSM_GPIO_PINS(32);
284 DECLARE_MSM_GPIO_PINS(33);
285 DECLARE_MSM_GPIO_PINS(34);
286 DECLARE_MSM_GPIO_PINS(35);
287 DECLARE_MSM_GPIO_PINS(36);
288 DECLARE_MSM_GPIO_PINS(37);
289 DECLARE_MSM_GPIO_PINS(38);
290 DECLARE_MSM_GPIO_PINS(39);
291 DECLARE_MSM_GPIO_PINS(40);
292 DECLARE_MSM_GPIO_PINS(41);
293 DECLARE_MSM_GPIO_PINS(42);
294 DECLARE_MSM_GPIO_PINS(43);
295 DECLARE_MSM_GPIO_PINS(44);
296 DECLARE_MSM_GPIO_PINS(45);
297 DECLARE_MSM_GPIO_PINS(46);
298 DECLARE_MSM_GPIO_PINS(47);
299 DECLARE_MSM_GPIO_PINS(48);
300 DECLARE_MSM_GPIO_PINS(49);
301 DECLARE_MSM_GPIO_PINS(50);
302 DECLARE_MSM_GPIO_PINS(51);
303 DECLARE_MSM_GPIO_PINS(52);
304 DECLARE_MSM_GPIO_PINS(53);
305 DECLARE_MSM_GPIO_PINS(54);
306 DECLARE_MSM_GPIO_PINS(55);
307 DECLARE_MSM_GPIO_PINS(56);
308 DECLARE_MSM_GPIO_PINS(57);
309 DECLARE_MSM_GPIO_PINS(58);
310 DECLARE_MSM_GPIO_PINS(59);
311 DECLARE_MSM_GPIO_PINS(60);
312 DECLARE_MSM_GPIO_PINS(61);
313 DECLARE_MSM_GPIO_PINS(62);
314 DECLARE_MSM_GPIO_PINS(63);
315 DECLARE_MSM_GPIO_PINS(64);
316 DECLARE_MSM_GPIO_PINS(65);
317 DECLARE_MSM_GPIO_PINS(66);
318 DECLARE_MSM_GPIO_PINS(67);
319 DECLARE_MSM_GPIO_PINS(68);
320 DECLARE_MSM_GPIO_PINS(69);
321 DECLARE_MSM_GPIO_PINS(70);
322 DECLARE_MSM_GPIO_PINS(71);
323 DECLARE_MSM_GPIO_PINS(72);
324 DECLARE_MSM_GPIO_PINS(73);
325 DECLARE_MSM_GPIO_PINS(74);
326 DECLARE_MSM_GPIO_PINS(75);
327 DECLARE_MSM_GPIO_PINS(76);
328 DECLARE_MSM_GPIO_PINS(77);
329 DECLARE_MSM_GPIO_PINS(78);
330 DECLARE_MSM_GPIO_PINS(79);
331 DECLARE_MSM_GPIO_PINS(80);
332 DECLARE_MSM_GPIO_PINS(81);
333 DECLARE_MSM_GPIO_PINS(82);
334 DECLARE_MSM_GPIO_PINS(83);
335 DECLARE_MSM_GPIO_PINS(84);
336 DECLARE_MSM_GPIO_PINS(85);
337 DECLARE_MSM_GPIO_PINS(86);
338 DECLARE_MSM_GPIO_PINS(87);
339 DECLARE_MSM_GPIO_PINS(88);
340 DECLARE_MSM_GPIO_PINS(89);
341 DECLARE_MSM_GPIO_PINS(90);
342 DECLARE_MSM_GPIO_PINS(91);
343 DECLARE_MSM_GPIO_PINS(92);
344 DECLARE_MSM_GPIO_PINS(93);
345 DECLARE_MSM_GPIO_PINS(94);
346 DECLARE_MSM_GPIO_PINS(95);
347 DECLARE_MSM_GPIO_PINS(96);
348 DECLARE_MSM_GPIO_PINS(97);
349 DECLARE_MSM_GPIO_PINS(98);
350 DECLARE_MSM_GPIO_PINS(99);
351 DECLARE_MSM_GPIO_PINS(100);
352 DECLARE_MSM_GPIO_PINS(101);
353 DECLARE_MSM_GPIO_PINS(102);
354 DECLARE_MSM_GPIO_PINS(103);
355 DECLARE_MSM_GPIO_PINS(104);
356 DECLARE_MSM_GPIO_PINS(105);
357 DECLARE_MSM_GPIO_PINS(106);
358 DECLARE_MSM_GPIO_PINS(107);
359 DECLARE_MSM_GPIO_PINS(108);
360 DECLARE_MSM_GPIO_PINS(109);
361 DECLARE_MSM_GPIO_PINS(110);
362 DECLARE_MSM_GPIO_PINS(111);
363 DECLARE_MSM_GPIO_PINS(112);
364 DECLARE_MSM_GPIO_PINS(113);
365 DECLARE_MSM_GPIO_PINS(114);
366 DECLARE_MSM_GPIO_PINS(115);
367 DECLARE_MSM_GPIO_PINS(116);
368 DECLARE_MSM_GPIO_PINS(117);
369 DECLARE_MSM_GPIO_PINS(118);
370 DECLARE_MSM_GPIO_PINS(119);
371 DECLARE_MSM_GPIO_PINS(120);
372 DECLARE_MSM_GPIO_PINS(121);
373 DECLARE_MSM_GPIO_PINS(122);
374 DECLARE_MSM_GPIO_PINS(123);
375 DECLARE_MSM_GPIO_PINS(124);
376 DECLARE_MSM_GPIO_PINS(125);
377 DECLARE_MSM_GPIO_PINS(126);
378 DECLARE_MSM_GPIO_PINS(127);
379 DECLARE_MSM_GPIO_PINS(128);
380 DECLARE_MSM_GPIO_PINS(129);
381 DECLARE_MSM_GPIO_PINS(130);
382 DECLARE_MSM_GPIO_PINS(131);
383 DECLARE_MSM_GPIO_PINS(132);
384 DECLARE_MSM_GPIO_PINS(133);
385 DECLARE_MSM_GPIO_PINS(134);
386 DECLARE_MSM_GPIO_PINS(135);
387 
388 static const unsigned int ufs_reset_pins[] = { 136 };
389 static const unsigned int sdc1_rclk_pins[] = { 137 };
390 static const unsigned int sdc1_clk_pins[] = { 138 };
391 static const unsigned int sdc1_cmd_pins[] = { 139 };
392 static const unsigned int sdc1_data_pins[] = { 140 };
393 static const unsigned int sdc2_clk_pins[] = { 141 };
394 static const unsigned int sdc2_cmd_pins[] = { 142 };
395 static const unsigned int sdc2_data_pins[] = { 143 };
396 
397 enum sm4450_functions {
398 	msm_mux_gpio,
399 	msm_mux_atest_char,
400 	msm_mux_atest_usb0,
401 	msm_mux_audio_ref_clk,
402 	msm_mux_cam_mclk,
403 	msm_mux_cci_async_in0,
404 	msm_mux_cci_i2c,
405 	msm_mux_cci,
406 	msm_mux_cmu_rng,
407 	msm_mux_coex_uart1_rx,
408 	msm_mux_coex_uart1_tx,
409 	msm_mux_cri_trng,
410 	msm_mux_dbg_out_clk,
411 	msm_mux_ddr_bist,
412 	msm_mux_ddr_pxi0_test,
413 	msm_mux_ddr_pxi1_test,
414 	msm_mux_gcc_gp1_clk,
415 	msm_mux_gcc_gp2_clk,
416 	msm_mux_gcc_gp3_clk,
417 	msm_mux_host2wlan_sol,
418 	msm_mux_ibi_i3c_qup0,
419 	msm_mux_ibi_i3c_qup1,
420 	msm_mux_jitter_bist_ref,
421 	msm_mux_mdp_vsync0_out,
422 	msm_mux_mdp_vsync1_out,
423 	msm_mux_mdp_vsync2_out,
424 	msm_mux_mdp_vsync3_out,
425 	msm_mux_mdp_vsync,
426 	msm_mux_nav,
427 	msm_mux_pcie0_clk_req,
428 	msm_mux_phase_flag,
429 	msm_mux_pll_bist_sync,
430 	msm_mux_pll_clk_aux,
431 	msm_mux_prng_rosc,
432 	msm_mux_qdss_cti_trig0,
433 	msm_mux_qdss_cti_trig1,
434 	msm_mux_qdss_gpio,
435 	msm_mux_qlink0_enable,
436 	msm_mux_qlink0_request,
437 	msm_mux_qlink0_wmss_reset,
438 	msm_mux_qup0_se0,
439 	msm_mux_qup0_se1,
440 	msm_mux_qup0_se2,
441 	msm_mux_qup0_se3,
442 	msm_mux_qup0_se4,
443 	msm_mux_qup1_se0,
444 	msm_mux_qup1_se1,
445 	msm_mux_qup1_se2,
446 	msm_mux_qup1_se3,
447 	msm_mux_qup1_se4,
448 	msm_mux_sd_write_protect,
449 	msm_mux_tb_trig_sdc1,
450 	msm_mux_tb_trig_sdc2,
451 	msm_mux_tgu_ch0_trigout,
452 	msm_mux_tgu_ch1_trigout,
453 	msm_mux_tgu_ch2_trigout,
454 	msm_mux_tgu_ch3_trigout,
455 	msm_mux_tmess_prng,
456 	msm_mux_tsense_pwm1_out,
457 	msm_mux_tsense_pwm2_out,
458 	msm_mux_uim0,
459 	msm_mux_uim1,
460 	msm_mux_usb0_hs_ac,
461 	msm_mux_usb0_phy_ps,
462 	msm_mux_vfr_0_mira,
463 	msm_mux_vfr_0_mirb,
464 	msm_mux_vfr_1,
465 	msm_mux_vsense_trigger_mirnat,
466 	msm_mux_wlan1_adc_dtest0,
467 	msm_mux_wlan1_adc_dtest1,
468 	msm_mux__,
469 };
470 
471 static const char * const gpio_groups[] = {
472 	"gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7",
473 	"gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14",
474 	"gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21",
475 	"gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28",
476 	"gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35",
477 	"gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42",
478 	"gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49",
479 	"gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56",
480 	"gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63",
481 	"gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70",
482 	"gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77",
483 	"gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84",
484 	"gpio85", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", "gpio91",
485 	"gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98",
486 	"gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104",
487 	"gpio105", "gpio106", "gpio107", "gpio108", "gpio109", "gpio110",
488 	"gpio111", "gpio112", "gpio113", "gpio114", "gpio115", "gpio116",
489 	"gpio117", "gpio118", "gpio119", "gpio120", "gpio121", "gpio122",
490 	"gpio123", "gpio124", "gpio125", "gpio126", "gpio127", "gpio128",
491 	"gpio129", "gpio130", "gpio131", "gpio132", "gpio133", "gpio134",
492 	"gpio135",
493 };
494 static const char * const atest_char_groups[] = {
495 	"gpio95", "gpio97", "gpio98", "gpio99", "gpio100",
496 };
497 static const char * const atest_usb0_groups[] = {
498 	"gpio75", "gpio10", "gpio78", "gpio79", "gpio80",
499 };
500 static const char * const audio_ref_clk_groups[] = {
501 	"gpio71",
502 };
503 static const char * const cam_mclk_groups[] = {
504 	"gpio36", "gpio37", "gpio38", "gpio39",
505 };
506 static const char * const cci_async_in0_groups[] = {
507 	"gpio40",
508 };
509 static const char * const cci_i2c_groups[] = {
510 	"gpio45", "gpio47", "gpio49", "gpio44",
511 	"gpio46", "gpio48",
512 };
513 static const char * const cci_groups[] = {
514 	"gpio40", "gpio41", "gpio42", "gpio43",
515 };
516 static const char * const cmu_rng_groups[] = {
517 	"gpio28", "gpio3", "gpio1", "gpio0",
518 };
519 static const char * const coex_uart1_rx_groups[] = {
520 	"gpio54",
521 };
522 static const char * const coex_uart1_tx_groups[] = {
523 	"gpio55",
524 };
525 static const char * const cri_trng_groups[] = {
526 	"gpio42", "gpio40", "gpio41",
527 };
528 static const char * const dbg_out_clk_groups[] = {
529 	"gpio80",
530 };
531 static const char * const ddr_bist_groups[] = {
532 	"gpio32", "gpio29", "gpio30", "gpio31",
533 };
534 static const char * const ddr_pxi0_test_groups[] = {
535 	"gpio90", "gpio127",
536 };
537 static const char * const ddr_pxi1_test_groups[] = {
538 	"gpio118", "gpio122",
539 };
540 static const char * const gcc_gp1_clk_groups[] = {
541 	"gpio37", "gpio48",
542 };
543 static const char * const gcc_gp2_clk_groups[] = {
544 	"gpio30", "gpio49",
545 };
546 static const char * const gcc_gp3_clk_groups[] = {
547 	"gpio3", "gpio50",
548 };
549 static const char * const host2wlan_sol_groups[] = {
550 	"gpio106",
551 };
552 static const char * const ibi_i3c_qup0_groups[] = {
553 	"gpio4", "gpio5",
554 };
555 static const char * const ibi_i3c_qup1_groups[] = {
556 	"gpio0", "gpio1",
557 };
558 static const char * const jitter_bist_ref_groups[] = {
559 	"gpio90",
560 };
561 static const char * const mdp_vsync0_out_groups[] = {
562 	"gpio93",
563 };
564 static const char * const mdp_vsync1_out_groups[] = {
565 	"gpio93",
566 };
567 static const char * const mdp_vsync2_out_groups[] = {
568 	"gpio22",
569 };
570 static const char * const mdp_vsync3_out_groups[] = {
571 	"gpio22",
572 };
573 static const char * const mdp_vsync_groups[] = {
574 	"gpio26", "gpio22", "gpio30", "gpio34", "gpio93", "gpio97",
575 };
576 static const char * const nav_groups[] = {
577 	"gpio81", "gpio83", "gpio84",
578 };
579 static const char * const pcie0_clk_req_groups[] = {
580 	"gpio107",
581 };
582 static const char * const phase_flag_groups[] = {
583 	"gpio7", "gpio8", "gpio9", "gpio11", "gpio13", "gpio14", "gpio15",
584 	"gpio17", "gpio18", "gpio19", "gpio21", "gpio24", "gpio25", "gpio31",
585 	"gpio32", "gpio33", "gpio35", "gpio61", "gpio72", "gpio82", "gpio91",
586 	"gpio95", "gpio97", "gpio98", "gpio99", "gpio100", "gpio105", "gpio115",
587 	"gpio116", "gpio117", "gpio133", "gpio135",
588 };
589 static const char * const pll_bist_sync_groups[] = {
590 	"gpio73",
591 };
592 static const char * const pll_clk_aux_groups[] = {
593 	"gpio108",
594 };
595 static const char * const prng_rosc_groups[] = {
596 	"gpio36", "gpio37", "gpio38", "gpio39",
597 };
598 static const char * const qdss_cti_trig0_groups[] = {
599 	"gpio26", "gpio60", "gpio113", "gpio114",
600 };
601 static const char * const qdss_cti_trig1_groups[] = {
602 	"gpio6", "gpio27", "gpio57", "gpio58",
603 };
604 static const char * const qdss_gpio_groups[] = {
605 	"gpio0", "gpio1", "gpio3", "gpio4", "gpio5", "gpio7", "gpio8",
606 	"gpio9", "gpio14", "gpio15", "gpio17", "gpio23", "gpio31", "gpio32",
607 	"gpio33", "gpio35", "gpio36", "gpio37", "gpio38", "gpio39", "gpio40",
608 	"gpio41", "gpio42", "gpio43", "gpio44", "gpio45", "gpio46", "gpio47",
609 	"gpio49",  "gpio59", "gpio62", "gpio118", "gpio121", "gpio122", "gpio126",
610 	"gpio127",
611 };
612 static const char * const qlink0_enable_groups[] = {
613 	"gpio88",
614 };
615 static const char * const qlink0_request_groups[] = {
616 	"gpio87",
617 };
618 static const char * const qlink0_wmss_reset_groups[] = {
619 	"gpio89",
620 };
621 static const char * const qup0_se0_groups[] = {
622 	"gpio4", "gpio5", "gpio34", "gpio35",
623 };
624 static const char * const qup0_se1_groups[] = {
625 	"gpio10", "gpio11", "gpio12", "gpio13",
626 };
627 static const char * const qup0_se2_groups[] = {
628 	"gpio14", "gpio15", "gpio16", "gpio17",
629 };
630 static const char * const qup0_se3_groups[] = {
631 	"gpio18", "gpio19", "gpio20", "gpio21",
632 };
633 static const char * const qup0_se4_groups[] = {
634 	"gpio6", "gpio7", "gpio8", "gpio9",
635 	"gpio26", "gpio27", "gpio34",
636 };
637 static const char * const qup1_se0_groups[] = {
638 	"gpio0", "gpio1", "gpio2", "gpio3",
639 };
640 static const char * const qup1_se1_groups[] = {
641 	"gpio26", "gpio27", "gpio50", "gpio51",
642 };
643 static const char * const qup1_se2_groups[] = {
644 	"gpio22", "gpio23", "gpio31", "gpio32",
645 };
646 static const char * const qup1_se3_groups[] = {
647 	"gpio24", "gpio25", "gpio51", "gpio50",
648 };
649 static const char * const qup1_se4_groups[] = {
650 	"gpio43", "gpio48", "gpio49", "gpio90",
651 	"gpio91",
652 };
653 static const char * const sd_write_protect_groups[] = {
654 	"gpio102",
655 };
656 static const char * const tb_trig_sdc1_groups[] = {
657 	"gpio128",
658 };
659 static const char * const tb_trig_sdc2_groups[] = {
660 	"gpio51",
661 };
662 static const char * const tgu_ch0_trigout_groups[] = {
663 	"gpio20",
664 };
665 static const char * const tgu_ch1_trigout_groups[] = {
666 	"gpio21",
667 };
668 static const char * const tgu_ch2_trigout_groups[] = {
669 	"gpio22",
670 };
671 static const char * const tgu_ch3_trigout_groups[] = {
672 	"gpio23",
673 };
674 static const char * const tmess_prng_groups[] = {
675 	"gpio57", "gpio58", "gpio59", "gpio60",
676 };
677 static const char * const tsense_pwm1_out_groups[] = {
678 	"gpio134",
679 };
680 static const char * const tsense_pwm2_out_groups[] = {
681 	"gpio134",
682 };
683 static const char * const uim0_groups[] = {
684 	"gpio64", "gpio63", "gpio66", "gpio65",
685 };
686 static const char * const uim1_groups[] = {
687 	"gpio68", "gpio67", "gpio69", "gpio70",
688 };
689 static const char * const usb0_hs_ac_groups[] = {
690 	"gpio99",
691 };
692 static const char * const usb0_phy_ps_groups[] = {
693 	"gpio94",
694 };
695 static const char * const vfr_0_mira_groups[] = {
696 	"gpio19",
697 };
698 static const char * const vfr_0_mirb_groups[] = {
699 	"gpio100",
700 };
701 static const char * const vfr_1_groups[] = {
702 	"gpio84",
703 };
704 static const char * const vsense_trigger_mirnat_groups[] = {
705 	"gpio75",
706 };
707 static const char * const wlan1_adc_dtest0_groups[] = {
708 	"gpio79",
709 };
710 static const char * const wlan1_adc_dtest1_groups[] = {
711 	"gpio80",
712 };
713 
714 static const struct pinfunction sm4450_functions[] = {
715 	MSM_GPIO_PIN_FUNCTION(gpio),
716 	MSM_PIN_FUNCTION(atest_char),
717 	MSM_PIN_FUNCTION(atest_usb0),
718 	MSM_PIN_FUNCTION(audio_ref_clk),
719 	MSM_PIN_FUNCTION(cam_mclk),
720 	MSM_PIN_FUNCTION(cci_async_in0),
721 	MSM_PIN_FUNCTION(cci_i2c),
722 	MSM_PIN_FUNCTION(cci),
723 	MSM_PIN_FUNCTION(cmu_rng),
724 	MSM_PIN_FUNCTION(coex_uart1_rx),
725 	MSM_PIN_FUNCTION(coex_uart1_tx),
726 	MSM_PIN_FUNCTION(cri_trng),
727 	MSM_PIN_FUNCTION(dbg_out_clk),
728 	MSM_PIN_FUNCTION(ddr_bist),
729 	MSM_PIN_FUNCTION(ddr_pxi0_test),
730 	MSM_PIN_FUNCTION(ddr_pxi1_test),
731 	MSM_PIN_FUNCTION(gcc_gp1_clk),
732 	MSM_PIN_FUNCTION(gcc_gp2_clk),
733 	MSM_PIN_FUNCTION(gcc_gp3_clk),
734 	MSM_PIN_FUNCTION(host2wlan_sol),
735 	MSM_PIN_FUNCTION(ibi_i3c_qup0),
736 	MSM_PIN_FUNCTION(ibi_i3c_qup1),
737 	MSM_PIN_FUNCTION(jitter_bist_ref),
738 	MSM_PIN_FUNCTION(mdp_vsync0_out),
739 	MSM_PIN_FUNCTION(mdp_vsync1_out),
740 	MSM_PIN_FUNCTION(mdp_vsync2_out),
741 	MSM_PIN_FUNCTION(mdp_vsync3_out),
742 	MSM_PIN_FUNCTION(mdp_vsync),
743 	MSM_PIN_FUNCTION(nav),
744 	MSM_PIN_FUNCTION(pcie0_clk_req),
745 	MSM_PIN_FUNCTION(phase_flag),
746 	MSM_PIN_FUNCTION(pll_bist_sync),
747 	MSM_PIN_FUNCTION(pll_clk_aux),
748 	MSM_PIN_FUNCTION(prng_rosc),
749 	MSM_PIN_FUNCTION(qdss_cti_trig0),
750 	MSM_PIN_FUNCTION(qdss_cti_trig1),
751 	MSM_PIN_FUNCTION(qdss_gpio),
752 	MSM_PIN_FUNCTION(qlink0_enable),
753 	MSM_PIN_FUNCTION(qlink0_request),
754 	MSM_PIN_FUNCTION(qlink0_wmss_reset),
755 	MSM_PIN_FUNCTION(qup0_se0),
756 	MSM_PIN_FUNCTION(qup0_se1),
757 	MSM_PIN_FUNCTION(qup0_se2),
758 	MSM_PIN_FUNCTION(qup0_se3),
759 	MSM_PIN_FUNCTION(qup0_se4),
760 	MSM_PIN_FUNCTION(qup1_se0),
761 	MSM_PIN_FUNCTION(qup1_se1),
762 	MSM_PIN_FUNCTION(qup1_se2),
763 	MSM_PIN_FUNCTION(qup1_se3),
764 	MSM_PIN_FUNCTION(qup1_se4),
765 	MSM_PIN_FUNCTION(sd_write_protect),
766 	MSM_PIN_FUNCTION(tb_trig_sdc1),
767 	MSM_PIN_FUNCTION(tb_trig_sdc2),
768 	MSM_PIN_FUNCTION(tgu_ch0_trigout),
769 	MSM_PIN_FUNCTION(tgu_ch1_trigout),
770 	MSM_PIN_FUNCTION(tgu_ch2_trigout),
771 	MSM_PIN_FUNCTION(tgu_ch3_trigout),
772 	MSM_PIN_FUNCTION(tmess_prng),
773 	MSM_PIN_FUNCTION(tsense_pwm1_out),
774 	MSM_PIN_FUNCTION(tsense_pwm2_out),
775 	MSM_PIN_FUNCTION(uim0),
776 	MSM_PIN_FUNCTION(uim1),
777 	MSM_PIN_FUNCTION(usb0_hs_ac),
778 	MSM_PIN_FUNCTION(usb0_phy_ps),
779 	MSM_PIN_FUNCTION(vfr_0_mira),
780 	MSM_PIN_FUNCTION(vfr_0_mirb),
781 	MSM_PIN_FUNCTION(vfr_1),
782 	MSM_PIN_FUNCTION(vsense_trigger_mirnat),
783 	MSM_PIN_FUNCTION(wlan1_adc_dtest0),
784 	MSM_PIN_FUNCTION(wlan1_adc_dtest1),
785 };
786 
787 /*
788  * Every pin is maintained as a single group, and missing or non-existing pin
789  * would be maintained as dummy group to synchronize pin group index with
790  * pin descriptor registered with pinctrl core.
791  * Clients would not be able to request these dummy pin groups.
792  */
793 static const struct msm_pingroup sm4450_groups[] = {
794 	[0] = PINGROUP(0, qup1_se0, ibi_i3c_qup1, cmu_rng, qdss_gpio, _, _, _, _, _),
795 	[1] = PINGROUP(1, qup1_se0, ibi_i3c_qup1, cmu_rng, qdss_gpio, _, _, _, _, _),
796 	[2] = PINGROUP(2, qup1_se0, _, _, _, _, _, _, _, _),
797 	[3] = PINGROUP(3, qup1_se0, gcc_gp3_clk, cmu_rng, qdss_gpio, _, _, _, _, _),
798 	[4] = PINGROUP(4, qup0_se0, ibi_i3c_qup0, qdss_gpio, _, _, _, _, _, _),
799 	[5] = PINGROUP(5, qup0_se0, ibi_i3c_qup0, qdss_gpio, _, _, _, _, _, _),
800 	[6] = PINGROUP(6, qup0_se4, qdss_cti_trig1, _, _, _, _, _, _, _),
801 	[7] = PINGROUP(7, qup0_se4, _, phase_flag, qdss_gpio, _, _, _, _, _),
802 	[8] = PINGROUP(8, qup0_se4, _, phase_flag, qdss_gpio, _, _, _, _, _),
803 	[9] = PINGROUP(9, qup0_se4, _, phase_flag, qdss_gpio, _, _, _, _, _),
804 	[10] = PINGROUP(10, qup0_se1, _, atest_usb0, _, _, _, _, _, _),
805 	[11] = PINGROUP(11, qup0_se1, _, phase_flag, _, _, _, _, _, _),
806 	[12] = PINGROUP(12, qup0_se1, _, _, _, _, _, _, _, _),
807 	[13] = PINGROUP(13, qup0_se1, _, phase_flag, _, _, _, _, _, _),
808 	[14] = PINGROUP(14, qup0_se2, _, phase_flag, _, qdss_gpio, _, _, _, _),
809 	[15] = PINGROUP(15, qup0_se2, _, phase_flag, _, qdss_gpio, _, _, _, _),
810 	[16] = PINGROUP(16, qup0_se2, _, _, _, _, _, _, _, _),
811 	[17] = PINGROUP(17, qup0_se2, _, phase_flag, _, qdss_gpio, _, _, _, _),
812 	[18] = PINGROUP(18, qup0_se3, _, phase_flag, _, _, _, _, _, _),
813 	[19] = PINGROUP(19, qup0_se3, vfr_0_mira, _, phase_flag, _, _, _, _, _),
814 	[20] = PINGROUP(20, qup0_se3, tgu_ch0_trigout, _, _, _, _, _, _, _),
815 	[21] = PINGROUP(21, qup0_se3, _, phase_flag, tgu_ch1_trigout, _, _, _, _, _),
816 	[22] = PINGROUP(22, qup1_se2, mdp_vsync, mdp_vsync2_out, mdp_vsync3_out, tgu_ch2_trigout, _, _, _, _),
817 	[23] = PINGROUP(23, qup1_se2, tgu_ch3_trigout, qdss_gpio, _, _, _, _, _, _),
818 	[24] = PINGROUP(24, qup1_se3, _, phase_flag, _, _, _, _, _, _),
819 	[25] = PINGROUP(25, qup1_se3, _, phase_flag, _, _, _, _, _, _),
820 	[26] = PINGROUP(26, qup1_se1, mdp_vsync, qup0_se4, qdss_cti_trig0, _, _, _, _, _),
821 	[27] = PINGROUP(27, qup1_se1, qup0_se4, qdss_cti_trig1, _, _, _, _, _, _),
822 	[28] = PINGROUP(28, cmu_rng, _, _, _, _, _, _, _, _),
823 	[29] = PINGROUP(29, ddr_bist, _, _, _, _, _, _, _, _),
824 	[30] = PINGROUP(30, mdp_vsync, gcc_gp2_clk, ddr_bist, _, _, _, _, _, _),
825 	[31] = PINGROUP(31, qup1_se2, _, phase_flag, ddr_bist, qdss_gpio, _, _, _, _),
826 	[32] = PINGROUP(32, qup1_se2, _, phase_flag, ddr_bist, qdss_gpio, _, _, _, _),
827 	[33] = PINGROUP(33, _, phase_flag, qdss_gpio, _, _, _, _, _, _),
828 	[34] = PINGROUP(34, qup0_se0, qup0_se4, mdp_vsync, _, _, _, _, _, _),
829 	[35] = PINGROUP(35, qup0_se0, _, phase_flag, qdss_gpio, _, _, _, _, _),
830 	[36] = PINGROUP(36, cam_mclk, prng_rosc, qdss_gpio, _, _, _, _, _, _),
831 	[37] = PINGROUP(37, cam_mclk, gcc_gp1_clk, prng_rosc, qdss_gpio, _, _, _, _, _),
832 	[38] = PINGROUP(38, cam_mclk, prng_rosc, qdss_gpio, _, _, _, _, _, _),
833 	[39] = PINGROUP(39, cam_mclk, prng_rosc, qdss_gpio, _, _, _, _, _, _),
834 	[40] = PINGROUP(40, cci, cci_async_in0, cri_trng, qdss_gpio, _, _, _, _, _),
835 	[41] = PINGROUP(41, cci, cri_trng, qdss_gpio, _, _, _, _, _, _),
836 	[42] = PINGROUP(42, cci, cri_trng, qdss_gpio, _, _, _, _, _, _),
837 	[43] = PINGROUP(43, cci, qup1_se4, qdss_gpio, _, _, _, _, _, _),
838 	[44] = PINGROUP(44, cci_i2c, qdss_gpio, _, _, _, _, _, _, _),
839 	[45] = PINGROUP(45, cci_i2c, qdss_gpio, _, _, _, _, _, _, _),
840 	[46] = PINGROUP(46, cci_i2c, qdss_gpio, _, _, _, _, _, _, _),
841 	[47] = PINGROUP(47, cci_i2c, qdss_gpio, _, _, _, _, _, _, _),
842 	[48] = PINGROUP(48, cci_i2c, qup1_se4, gcc_gp1_clk, _, _, _, _, _, _),
843 	[49] = PINGROUP(49, cci_i2c, qup1_se4, gcc_gp2_clk, qdss_gpio, _, _, _, _, _),
844 	[50] = PINGROUP(50, qup1_se1, qup1_se3, _, gcc_gp3_clk, _, _, _, _, _),
845 	[51] = PINGROUP(51, qup1_se1, qup1_se3, _, tb_trig_sdc2, _, _, _, _, _),
846 	[52] = PINGROUP(52, _, _, _, _, _, _, _, _, _),
847 	[53] = PINGROUP(53, _, _, _, _, _, _, _, _, _),
848 	[54] = PINGROUP(54, coex_uart1_rx, _, _, _, _, _, _, _, _),
849 	[55] = PINGROUP(55, coex_uart1_tx, _, _, _, _, _, _, _, _),
850 	[56] = PINGROUP(56, _, _, _, _, _, _, _, _, _),
851 	[57] = PINGROUP(57, tmess_prng, qdss_cti_trig1, _, _, _, _, _, _, _),
852 	[58] = PINGROUP(58, tmess_prng, qdss_cti_trig1, _, _, _, _, _, _, _),
853 	[59] = PINGROUP(59, tmess_prng, qdss_gpio, _, _, _, _, _, _, _),
854 	[60] = PINGROUP(60, tmess_prng, qdss_cti_trig0, _, _, _, _, _, _, _),
855 	[61] = PINGROUP(61, _, phase_flag, _, _, _, _, _, _, _),
856 	[62] = PINGROUP(62, qdss_gpio, _, _, _, _, _, _, _, _),
857 	[63] = PINGROUP(63, uim0, _, _, _, _, _, _, _, _),
858 	[64] = PINGROUP(64, uim0, _, _, _, _, _, _, _, _),
859 	[65] = PINGROUP(65, uim0, _, _, _, _, _, _, _, _),
860 	[66] = PINGROUP(66, uim0, _, _, _, _, _, _, _, _),
861 	[67] = PINGROUP(67, uim1, _, _, _, _, _, _, _, _),
862 	[68] = PINGROUP(68, uim1, _, _, _, _, _, _, _, _),
863 	[69] = PINGROUP(69, uim1, _, _, _, _, _, _, _, _),
864 	[70] = PINGROUP(70, uim1, _, _, _, _, _, _, _, _),
865 	[71] = PINGROUP(71, _, _, _, audio_ref_clk, _, _, _, _, _),
866 	[72] = PINGROUP(72, _, _, _, phase_flag, _, _, _, _, _),
867 	[73] = PINGROUP(73, _, _, _, pll_bist_sync, _, _, _, _, _),
868 	[74] = PINGROUP(74, _, _, _, _, _, _, _, _, _),
869 	[75] = PINGROUP(75, _, _, _, vsense_trigger_mirnat, atest_usb0, _, _, _, _),
870 	[76] = PINGROUP(76, _, _, _, _, _, _, _, _, _),
871 	[77] = PINGROUP(77, _, _, _, _, _, _, _, _, _),
872 	[78] = PINGROUP(78, _, _, _, atest_usb0, _, _, _, _, _),
873 	[79] = PINGROUP(79, _, _, _, wlan1_adc_dtest0, atest_usb0, _, _, _, _),
874 	[80] = PINGROUP(80, _, _, dbg_out_clk, wlan1_adc_dtest1, atest_usb0, _, _, _, _),
875 	[81] = PINGROUP(81, _, nav, _, _, _, _, _, _, _),
876 	[82] = PINGROUP(82, _, _, phase_flag, _, _, _, _, _, _),
877 	[83] = PINGROUP(83, nav, _, _, _, _, _, _, _, _),
878 	[84] = PINGROUP(84, nav, vfr_1, _, _, _, _, _, _, _),
879 	[85] = PINGROUP(85, _, _, _, _, _, _, _, _, _),
880 	[86] = PINGROUP(86, _, _, _, _, _, _, _, _, _),
881 	[87] = PINGROUP(87, qlink0_request, _, _, _, _, _, _, _, _),
882 	[88] = PINGROUP(88, qlink0_enable, _, _, _, _, _, _, _, _),
883 	[89] = PINGROUP(89, qlink0_wmss_reset, _, _, _, _, _, _, _, _),
884 	[90] = PINGROUP(90, qup1_se4, jitter_bist_ref, ddr_pxi0_test, _, _, _, _, _, _),
885 	[91] = PINGROUP(91, qup1_se4, _, phase_flag, _, _, _, _, _, _),
886 	[92] = PINGROUP(92, _, _, _, _, _, _, _, _, _),
887 	[93] = PINGROUP(93, mdp_vsync, mdp_vsync0_out, mdp_vsync1_out, _, _, _, _, _, _),
888 	[94] = PINGROUP(94, usb0_phy_ps, _, _, _, _, _, _, _, _),
889 	[95] = PINGROUP(95, _, phase_flag, atest_char, _, _, _, _, _, _),
890 	[96] = PINGROUP(96, _, _, _, _, _, _, _, _, _),
891 	[97] = PINGROUP(97, mdp_vsync, _, phase_flag, atest_char, _, _, _, _, _),
892 	[98] = PINGROUP(98, _, phase_flag, atest_char, _, _, _, _, _, _),
893 	[99] = PINGROUP(99, usb0_hs_ac, _, phase_flag, atest_char, _, _, _, _, _),
894 	[100] = PINGROUP(100, vfr_0_mirb, _, phase_flag, atest_char, _, _, _, _, _),
895 	[101] = PINGROUP(101, _, _, _, _, _, _, _, _, _),
896 	[102] = PINGROUP(102, sd_write_protect, _, _, _, _, _, _, _, _),
897 	[103] = PINGROUP(103, _, _, _, _, _, _, _, _, _),
898 	[104] = PINGROUP(104, _, _, _, _, _, _, _, _, _),
899 	[105] = PINGROUP(105, _, phase_flag, _, _, _, _, _, _, _),
900 	[106] = PINGROUP(106, host2wlan_sol, _, _, _, _, _, _, _, _),
901 	[107] = PINGROUP(107, pcie0_clk_req, _, _, _, _, _, _, _, _),
902 	[108] = PINGROUP(108, pll_clk_aux, _, _, _, _, _, _, _, _),
903 	[109] = PINGROUP(109, _, _, _, _, _, _, _, _, _),
904 	[110] = PINGROUP(110, _, _, _, _, _, _, _, _, _),
905 	[111] = PINGROUP(111, _, _, _, _, _, _, _, _, _),
906 	[112] = PINGROUP(112, _, _, _, _, _, _, _, _, _),
907 	[113] = PINGROUP(113, qdss_cti_trig0, _, _, _, _, _, _, _, _),
908 	[114] = PINGROUP(114, qdss_cti_trig0, _, _, _, _, _, _, _, _),
909 	[115] = PINGROUP(115, _, phase_flag, _, _, _, _, _, _, _),
910 	[116] = PINGROUP(116, _, phase_flag, _, _, _, _, _, _, _),
911 	[117] = PINGROUP(117, _, phase_flag, _, _, _, _, _, _, _),
912 	[118] = PINGROUP(118, qdss_gpio, _, ddr_pxi1_test, _, _, _, _, _, _),
913 	[119] = PINGROUP(119, _, _, _, _, _, _, _, _, _),
914 	[120] = PINGROUP(120, _, _, _, _, _, _, _, _, _),
915 	[121] = PINGROUP(121, qdss_gpio, _, _, _, _, _, _, _, _),
916 	[122] = PINGROUP(122, qdss_gpio, _, ddr_pxi1_test, _, _, _, _, _, _),
917 	[123] = PINGROUP(123, _, _, _, _, _, _, _, _, _),
918 	[124] = PINGROUP(124, _, _, _, _, _, _, _, _, _),
919 	[125] = PINGROUP(125, _, _, _, _, _, _, _, _, _),
920 	[126] = PINGROUP(126, qdss_gpio, _, _, _, _, _, _, _, _),
921 	[127] = PINGROUP(127, qdss_gpio, ddr_pxi0_test, _, _, _, _, _, _, _),
922 	[128] = PINGROUP(128, tb_trig_sdc1, _, _, _, _, _, _, _, _),
923 	[129] = PINGROUP(129, _, _, _, _, _, _, _, _, _),
924 	[130] = PINGROUP(130, _, _, _, _, _, _, _, _, _),
925 	[131] = PINGROUP(131, _, _, _, _, _, _, _, _, _),
926 	[132] = PINGROUP(132, _, _, _, _, _, _, _, _, _),
927 	[133] = PINGROUP(133, _, phase_flag, _, _, _, _, _, _, _),
928 	[134] = PINGROUP(134, tsense_pwm1_out, tsense_pwm2_out, _, _, _, _, _, _, _),
929 	[135] = PINGROUP(135, _, phase_flag, _, _, _, _, _, _, _),
930 	[136] = UFS_RESET(ufs_reset, 0x97000),
931 	[137] = SDC_QDSD_PINGROUP(sdc1_rclk, 0x8c004, 0, 0),
932 	[138] = SDC_QDSD_PINGROUP(sdc1_clk, 0x8c000, 13, 6),
933 	[139] = SDC_QDSD_PINGROUP(sdc1_cmd, 0x8c000, 11, 3),
934 	[140] = SDC_QDSD_PINGROUP(sdc1_data, 0x8c000, 9, 0),
935 	[141] = SDC_QDSD_PINGROUP(sdc2_clk, 0x8f000, 14, 6),
936 	[142] = SDC_QDSD_PINGROUP(sdc2_cmd, 0x8f000, 11, 3),
937 	[143] = SDC_QDSD_PINGROUP(sdc2_data, 0x8f000, 9, 0),
938 };
939 
940 static const struct msm_gpio_wakeirq_map sm4450_pdc_map[] = {
941 	{ 0, 67 }, { 3, 82 }, { 4, 69 }, { 5, 70 }, { 6, 44 }, { 7, 43 },
942 	{ 8, 71 }, { 9, 86 }, { 10, 48 }, { 11, 77 }, { 12, 90 },
943 	{ 13, 54 }, { 14, 91 }, { 17, 97 }, { 18, 102 }, { 21, 103 },
944 	{ 22, 104 }, { 23, 105 }, { 24, 53 }, { 25, 106 }, { 26, 65 },
945 	{ 27, 55 }, { 28, 89 }, { 30, 80 }, { 31, 109 }, { 33, 87 },
946 	{ 34, 81 }, { 35, 75 }, { 40, 88 }, { 41, 98 }, { 42, 110 },
947 	{ 43, 95 }, { 47, 118 }, { 50, 111 }, { 52, 52 }, { 53, 114 },
948 	{ 54, 115 }, { 55, 99 }, { 56, 45 }, { 57, 85 }, { 58, 56 },
949 	{ 59, 84 }, { 60, 83 }, { 61, 96 }, { 62, 93 }, { 66, 116 },
950 	{ 67, 113 }, { 70, 42 }, { 71, 122 }, { 73, 119 }, { 75, 121 },
951 	{ 77, 120 }, { 79, 123 }, { 81, 124 }, { 83, 64 }, { 84, 128 },
952 	{ 86, 129 }, { 87, 63 }, { 91, 92 }, { 92, 66 }, { 93, 125 },
953 	{ 94, 76 }, { 95, 62 }, { 96, 132 }, { 97, 135 }, { 98, 73 },
954 	{ 99, 133 }, { 101, 46 }, { 102, 134 }, { 103, 49 }, { 105, 58 },
955 	{ 107, 94 }, { 110, 59 }, { 113, 57 }, { 114, 60 }, { 118, 107 },
956 	{ 120, 61 }, { 121, 108 }, { 123, 68 }, { 125, 72 }, { 128, 112 },
957 };
958 
959 static const struct msm_pinctrl_soc_data sm4450_tlmm = {
960 	.pins = sm4450_pins,
961 	.npins = ARRAY_SIZE(sm4450_pins),
962 	.functions = sm4450_functions,
963 	.nfunctions = ARRAY_SIZE(sm4450_functions),
964 	.groups = sm4450_groups,
965 	.ngroups = ARRAY_SIZE(sm4450_groups),
966 	.ngpios = 137,
967 	.wakeirq_map = sm4450_pdc_map,
968 	.nwakeirq_map = ARRAY_SIZE(sm4450_pdc_map),
969 };
970 
971 static int sm4450_tlmm_probe(struct platform_device *pdev)
972 {
973 	return msm_pinctrl_probe(pdev, &sm4450_tlmm);
974 }
975 
976 static const struct of_device_id sm4450_tlmm_of_match[] = {
977 	{ .compatible = "qcom,sm4450-tlmm", },
978 	{ }
979 };
980 
981 static struct platform_driver sm4450_tlmm_driver = {
982 	.driver = {
983 		.name = "sm4450-tlmm",
984 		.of_match_table = sm4450_tlmm_of_match,
985 	},
986 	.probe = sm4450_tlmm_probe,
987 };
988 MODULE_DEVICE_TABLE(of, sm4450_tlmm_of_match);
989 
990 static int __init sm4450_tlmm_init(void)
991 {
992 	return platform_driver_register(&sm4450_tlmm_driver);
993 }
994 arch_initcall(sm4450_tlmm_init);
995 
996 static void __exit sm4450_tlmm_exit(void)
997 {
998 	platform_driver_unregister(&sm4450_tlmm_driver);
999 }
1000 module_exit(sm4450_tlmm_exit);
1001 
1002 MODULE_DESCRIPTION("QTI SM4450 TLMM driver");
1003 MODULE_LICENSE("GPL");
1004