1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (c) 2020, The Linux Foundation. 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 PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9)	\
13	{					        \
14		.grp = PINCTRL_PINGROUP("gpio" #id, 	\
15			gpio##id##_pins, 		\
16			ARRAY_SIZE(gpio##id##_pins)),	\
17		.funcs = (int[]){			\
18			msm_mux_gpio, /* gpio mode */	\
19			msm_mux_##f1,			\
20			msm_mux_##f2,			\
21			msm_mux_##f3,			\
22			msm_mux_##f4,			\
23			msm_mux_##f5,			\
24			msm_mux_##f6,			\
25			msm_mux_##f7,			\
26			msm_mux_##f8,			\
27			msm_mux_##f9			\
28		},				        \
29		.nfuncs = 10,				\
30		.ctl_reg = 0x1000 * id,			\
31		.io_reg = 0x1000 * id + 0x4,		\
32		.intr_cfg_reg = 0x1000 * id + 0x8,	\
33		.intr_status_reg = 0x1000 * id + 0xc,	\
34		.intr_target_reg = 0x1000 * id + 0x8,	\
35		.mux_bit = 2,			\
36		.pull_bit = 0,			\
37		.drv_bit = 6,			\
38		.egpio_enable = 12,		\
39		.egpio_present = 11,		\
40		.oe_bit = 9,			\
41		.in_bit = 0,			\
42		.out_bit = 1,			\
43		.intr_enable_bit = 0,		\
44		.intr_status_bit = 0,		\
45		.intr_target_bit = 5,		\
46		.intr_target_kpss_val = 3,	\
47		.intr_raw_status_bit = 4,	\
48		.intr_polarity_bit = 1,		\
49		.intr_detection_bit = 2,	\
50		.intr_detection_width = 2,	\
51	}
52
53#define SDC_QDSD_PINGROUP(pg_name, ctl, pull, drv)	\
54	{					        \
55		.grp = PINCTRL_PINGROUP(#pg_name, 	\
56			pg_name##_pins, 		\
57			ARRAY_SIZE(pg_name##_pins)),	\
58		.ctl_reg = ctl,				\
59		.io_reg = 0,				\
60		.intr_cfg_reg = 0,			\
61		.intr_status_reg = 0,			\
62		.intr_target_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		.intr_target_reg = 0,			\
88		.mux_bit = -1,				\
89		.pull_bit = 3,				\
90		.drv_bit = 0,				\
91		.oe_bit = -1,				\
92		.in_bit = -1,				\
93		.out_bit = 0,				\
94		.intr_enable_bit = -1,			\
95		.intr_status_bit = -1,			\
96		.intr_target_bit = -1,			\
97		.intr_raw_status_bit = -1,		\
98		.intr_polarity_bit = -1,		\
99		.intr_detection_bit = -1,		\
100		.intr_detection_width = -1,		\
101	}
102
103static const struct pinctrl_pin_desc sc7280_pins[] = {
104	PINCTRL_PIN(0, "GPIO_0"),
105	PINCTRL_PIN(1, "GPIO_1"),
106	PINCTRL_PIN(2, "GPIO_2"),
107	PINCTRL_PIN(3, "GPIO_3"),
108	PINCTRL_PIN(4, "GPIO_4"),
109	PINCTRL_PIN(5, "GPIO_5"),
110	PINCTRL_PIN(6, "GPIO_6"),
111	PINCTRL_PIN(7, "GPIO_7"),
112	PINCTRL_PIN(8, "GPIO_8"),
113	PINCTRL_PIN(9, "GPIO_9"),
114	PINCTRL_PIN(10, "GPIO_10"),
115	PINCTRL_PIN(11, "GPIO_11"),
116	PINCTRL_PIN(12, "GPIO_12"),
117	PINCTRL_PIN(13, "GPIO_13"),
118	PINCTRL_PIN(14, "GPIO_14"),
119	PINCTRL_PIN(15, "GPIO_15"),
120	PINCTRL_PIN(16, "GPIO_16"),
121	PINCTRL_PIN(17, "GPIO_17"),
122	PINCTRL_PIN(18, "GPIO_18"),
123	PINCTRL_PIN(19, "GPIO_19"),
124	PINCTRL_PIN(20, "GPIO_20"),
125	PINCTRL_PIN(21, "GPIO_21"),
126	PINCTRL_PIN(22, "GPIO_22"),
127	PINCTRL_PIN(23, "GPIO_23"),
128	PINCTRL_PIN(24, "GPIO_24"),
129	PINCTRL_PIN(25, "GPIO_25"),
130	PINCTRL_PIN(26, "GPIO_26"),
131	PINCTRL_PIN(27, "GPIO_27"),
132	PINCTRL_PIN(28, "GPIO_28"),
133	PINCTRL_PIN(29, "GPIO_29"),
134	PINCTRL_PIN(30, "GPIO_30"),
135	PINCTRL_PIN(31, "GPIO_31"),
136	PINCTRL_PIN(32, "GPIO_32"),
137	PINCTRL_PIN(33, "GPIO_33"),
138	PINCTRL_PIN(34, "GPIO_34"),
139	PINCTRL_PIN(35, "GPIO_35"),
140	PINCTRL_PIN(36, "GPIO_36"),
141	PINCTRL_PIN(37, "GPIO_37"),
142	PINCTRL_PIN(38, "GPIO_38"),
143	PINCTRL_PIN(39, "GPIO_39"),
144	PINCTRL_PIN(40, "GPIO_40"),
145	PINCTRL_PIN(41, "GPIO_41"),
146	PINCTRL_PIN(42, "GPIO_42"),
147	PINCTRL_PIN(43, "GPIO_43"),
148	PINCTRL_PIN(44, "GPIO_44"),
149	PINCTRL_PIN(45, "GPIO_45"),
150	PINCTRL_PIN(46, "GPIO_46"),
151	PINCTRL_PIN(47, "GPIO_47"),
152	PINCTRL_PIN(48, "GPIO_48"),
153	PINCTRL_PIN(49, "GPIO_49"),
154	PINCTRL_PIN(50, "GPIO_50"),
155	PINCTRL_PIN(51, "GPIO_51"),
156	PINCTRL_PIN(52, "GPIO_52"),
157	PINCTRL_PIN(53, "GPIO_53"),
158	PINCTRL_PIN(54, "GPIO_54"),
159	PINCTRL_PIN(55, "GPIO_55"),
160	PINCTRL_PIN(56, "GPIO_56"),
161	PINCTRL_PIN(57, "GPIO_57"),
162	PINCTRL_PIN(58, "GPIO_58"),
163	PINCTRL_PIN(59, "GPIO_59"),
164	PINCTRL_PIN(60, "GPIO_60"),
165	PINCTRL_PIN(61, "GPIO_61"),
166	PINCTRL_PIN(62, "GPIO_62"),
167	PINCTRL_PIN(63, "GPIO_63"),
168	PINCTRL_PIN(64, "GPIO_64"),
169	PINCTRL_PIN(65, "GPIO_65"),
170	PINCTRL_PIN(66, "GPIO_66"),
171	PINCTRL_PIN(67, "GPIO_67"),
172	PINCTRL_PIN(68, "GPIO_68"),
173	PINCTRL_PIN(69, "GPIO_69"),
174	PINCTRL_PIN(70, "GPIO_70"),
175	PINCTRL_PIN(71, "GPIO_71"),
176	PINCTRL_PIN(72, "GPIO_72"),
177	PINCTRL_PIN(73, "GPIO_73"),
178	PINCTRL_PIN(74, "GPIO_74"),
179	PINCTRL_PIN(75, "GPIO_75"),
180	PINCTRL_PIN(76, "GPIO_76"),
181	PINCTRL_PIN(77, "GPIO_77"),
182	PINCTRL_PIN(78, "GPIO_78"),
183	PINCTRL_PIN(79, "GPIO_79"),
184	PINCTRL_PIN(80, "GPIO_80"),
185	PINCTRL_PIN(81, "GPIO_81"),
186	PINCTRL_PIN(82, "GPIO_82"),
187	PINCTRL_PIN(83, "GPIO_83"),
188	PINCTRL_PIN(84, "GPIO_84"),
189	PINCTRL_PIN(85, "GPIO_85"),
190	PINCTRL_PIN(86, "GPIO_86"),
191	PINCTRL_PIN(87, "GPIO_87"),
192	PINCTRL_PIN(88, "GPIO_88"),
193	PINCTRL_PIN(89, "GPIO_89"),
194	PINCTRL_PIN(90, "GPIO_90"),
195	PINCTRL_PIN(91, "GPIO_91"),
196	PINCTRL_PIN(92, "GPIO_92"),
197	PINCTRL_PIN(93, "GPIO_93"),
198	PINCTRL_PIN(94, "GPIO_94"),
199	PINCTRL_PIN(95, "GPIO_95"),
200	PINCTRL_PIN(96, "GPIO_96"),
201	PINCTRL_PIN(97, "GPIO_97"),
202	PINCTRL_PIN(98, "GPIO_98"),
203	PINCTRL_PIN(99, "GPIO_99"),
204	PINCTRL_PIN(100, "GPIO_100"),
205	PINCTRL_PIN(101, "GPIO_101"),
206	PINCTRL_PIN(102, "GPIO_102"),
207	PINCTRL_PIN(103, "GPIO_103"),
208	PINCTRL_PIN(104, "GPIO_104"),
209	PINCTRL_PIN(105, "GPIO_105"),
210	PINCTRL_PIN(106, "GPIO_106"),
211	PINCTRL_PIN(107, "GPIO_107"),
212	PINCTRL_PIN(108, "GPIO_108"),
213	PINCTRL_PIN(109, "GPIO_109"),
214	PINCTRL_PIN(110, "GPIO_110"),
215	PINCTRL_PIN(111, "GPIO_111"),
216	PINCTRL_PIN(112, "GPIO_112"),
217	PINCTRL_PIN(113, "GPIO_113"),
218	PINCTRL_PIN(114, "GPIO_114"),
219	PINCTRL_PIN(115, "GPIO_115"),
220	PINCTRL_PIN(116, "GPIO_116"),
221	PINCTRL_PIN(117, "GPIO_117"),
222	PINCTRL_PIN(118, "GPIO_118"),
223	PINCTRL_PIN(119, "GPIO_119"),
224	PINCTRL_PIN(120, "GPIO_120"),
225	PINCTRL_PIN(121, "GPIO_121"),
226	PINCTRL_PIN(122, "GPIO_122"),
227	PINCTRL_PIN(123, "GPIO_123"),
228	PINCTRL_PIN(124, "GPIO_124"),
229	PINCTRL_PIN(125, "GPIO_125"),
230	PINCTRL_PIN(126, "GPIO_126"),
231	PINCTRL_PIN(127, "GPIO_127"),
232	PINCTRL_PIN(128, "GPIO_128"),
233	PINCTRL_PIN(129, "GPIO_129"),
234	PINCTRL_PIN(130, "GPIO_130"),
235	PINCTRL_PIN(131, "GPIO_131"),
236	PINCTRL_PIN(132, "GPIO_132"),
237	PINCTRL_PIN(133, "GPIO_133"),
238	PINCTRL_PIN(134, "GPIO_134"),
239	PINCTRL_PIN(135, "GPIO_135"),
240	PINCTRL_PIN(136, "GPIO_136"),
241	PINCTRL_PIN(137, "GPIO_137"),
242	PINCTRL_PIN(138, "GPIO_138"),
243	PINCTRL_PIN(139, "GPIO_139"),
244	PINCTRL_PIN(140, "GPIO_140"),
245	PINCTRL_PIN(141, "GPIO_141"),
246	PINCTRL_PIN(142, "GPIO_142"),
247	PINCTRL_PIN(143, "GPIO_143"),
248	PINCTRL_PIN(144, "GPIO_144"),
249	PINCTRL_PIN(145, "GPIO_145"),
250	PINCTRL_PIN(146, "GPIO_146"),
251	PINCTRL_PIN(147, "GPIO_147"),
252	PINCTRL_PIN(148, "GPIO_148"),
253	PINCTRL_PIN(149, "GPIO_149"),
254	PINCTRL_PIN(150, "GPIO_150"),
255	PINCTRL_PIN(151, "GPIO_151"),
256	PINCTRL_PIN(152, "GPIO_152"),
257	PINCTRL_PIN(153, "GPIO_153"),
258	PINCTRL_PIN(154, "GPIO_154"),
259	PINCTRL_PIN(155, "GPIO_155"),
260	PINCTRL_PIN(156, "GPIO_156"),
261	PINCTRL_PIN(157, "GPIO_157"),
262	PINCTRL_PIN(158, "GPIO_158"),
263	PINCTRL_PIN(159, "GPIO_159"),
264	PINCTRL_PIN(160, "GPIO_160"),
265	PINCTRL_PIN(161, "GPIO_161"),
266	PINCTRL_PIN(162, "GPIO_162"),
267	PINCTRL_PIN(163, "GPIO_163"),
268	PINCTRL_PIN(164, "GPIO_164"),
269	PINCTRL_PIN(165, "GPIO_165"),
270	PINCTRL_PIN(166, "GPIO_166"),
271	PINCTRL_PIN(167, "GPIO_167"),
272	PINCTRL_PIN(168, "GPIO_168"),
273	PINCTRL_PIN(169, "GPIO_169"),
274	PINCTRL_PIN(170, "GPIO_170"),
275	PINCTRL_PIN(171, "GPIO_171"),
276	PINCTRL_PIN(172, "GPIO_172"),
277	PINCTRL_PIN(173, "GPIO_173"),
278	PINCTRL_PIN(174, "GPIO_174"),
279	PINCTRL_PIN(175, "UFS_RESET"),
280	PINCTRL_PIN(176, "SDC1_RCLK"),
281	PINCTRL_PIN(177, "SDC1_CLK"),
282	PINCTRL_PIN(178, "SDC1_CMD"),
283	PINCTRL_PIN(179, "SDC1_DATA"),
284	PINCTRL_PIN(180, "SDC2_CLK"),
285	PINCTRL_PIN(181, "SDC2_CMD"),
286	PINCTRL_PIN(182, "SDC2_DATA"),
287};
288
289#define DECLARE_MSM_GPIO_PINS(pin) \
290	static const unsigned int gpio##pin##_pins[] = { pin }
291DECLARE_MSM_GPIO_PINS(0);
292DECLARE_MSM_GPIO_PINS(1);
293DECLARE_MSM_GPIO_PINS(2);
294DECLARE_MSM_GPIO_PINS(3);
295DECLARE_MSM_GPIO_PINS(4);
296DECLARE_MSM_GPIO_PINS(5);
297DECLARE_MSM_GPIO_PINS(6);
298DECLARE_MSM_GPIO_PINS(7);
299DECLARE_MSM_GPIO_PINS(8);
300DECLARE_MSM_GPIO_PINS(9);
301DECLARE_MSM_GPIO_PINS(10);
302DECLARE_MSM_GPIO_PINS(11);
303DECLARE_MSM_GPIO_PINS(12);
304DECLARE_MSM_GPIO_PINS(13);
305DECLARE_MSM_GPIO_PINS(14);
306DECLARE_MSM_GPIO_PINS(15);
307DECLARE_MSM_GPIO_PINS(16);
308DECLARE_MSM_GPIO_PINS(17);
309DECLARE_MSM_GPIO_PINS(18);
310DECLARE_MSM_GPIO_PINS(19);
311DECLARE_MSM_GPIO_PINS(20);
312DECLARE_MSM_GPIO_PINS(21);
313DECLARE_MSM_GPIO_PINS(22);
314DECLARE_MSM_GPIO_PINS(23);
315DECLARE_MSM_GPIO_PINS(24);
316DECLARE_MSM_GPIO_PINS(25);
317DECLARE_MSM_GPIO_PINS(26);
318DECLARE_MSM_GPIO_PINS(27);
319DECLARE_MSM_GPIO_PINS(28);
320DECLARE_MSM_GPIO_PINS(29);
321DECLARE_MSM_GPIO_PINS(30);
322DECLARE_MSM_GPIO_PINS(31);
323DECLARE_MSM_GPIO_PINS(32);
324DECLARE_MSM_GPIO_PINS(33);
325DECLARE_MSM_GPIO_PINS(34);
326DECLARE_MSM_GPIO_PINS(35);
327DECLARE_MSM_GPIO_PINS(36);
328DECLARE_MSM_GPIO_PINS(37);
329DECLARE_MSM_GPIO_PINS(38);
330DECLARE_MSM_GPIO_PINS(39);
331DECLARE_MSM_GPIO_PINS(40);
332DECLARE_MSM_GPIO_PINS(41);
333DECLARE_MSM_GPIO_PINS(42);
334DECLARE_MSM_GPIO_PINS(43);
335DECLARE_MSM_GPIO_PINS(44);
336DECLARE_MSM_GPIO_PINS(45);
337DECLARE_MSM_GPIO_PINS(46);
338DECLARE_MSM_GPIO_PINS(47);
339DECLARE_MSM_GPIO_PINS(48);
340DECLARE_MSM_GPIO_PINS(49);
341DECLARE_MSM_GPIO_PINS(50);
342DECLARE_MSM_GPIO_PINS(51);
343DECLARE_MSM_GPIO_PINS(52);
344DECLARE_MSM_GPIO_PINS(53);
345DECLARE_MSM_GPIO_PINS(54);
346DECLARE_MSM_GPIO_PINS(55);
347DECLARE_MSM_GPIO_PINS(56);
348DECLARE_MSM_GPIO_PINS(57);
349DECLARE_MSM_GPIO_PINS(58);
350DECLARE_MSM_GPIO_PINS(59);
351DECLARE_MSM_GPIO_PINS(60);
352DECLARE_MSM_GPIO_PINS(61);
353DECLARE_MSM_GPIO_PINS(62);
354DECLARE_MSM_GPIO_PINS(63);
355DECLARE_MSM_GPIO_PINS(64);
356DECLARE_MSM_GPIO_PINS(65);
357DECLARE_MSM_GPIO_PINS(66);
358DECLARE_MSM_GPIO_PINS(67);
359DECLARE_MSM_GPIO_PINS(68);
360DECLARE_MSM_GPIO_PINS(69);
361DECLARE_MSM_GPIO_PINS(70);
362DECLARE_MSM_GPIO_PINS(71);
363DECLARE_MSM_GPIO_PINS(72);
364DECLARE_MSM_GPIO_PINS(73);
365DECLARE_MSM_GPIO_PINS(74);
366DECLARE_MSM_GPIO_PINS(75);
367DECLARE_MSM_GPIO_PINS(76);
368DECLARE_MSM_GPIO_PINS(77);
369DECLARE_MSM_GPIO_PINS(78);
370DECLARE_MSM_GPIO_PINS(79);
371DECLARE_MSM_GPIO_PINS(80);
372DECLARE_MSM_GPIO_PINS(81);
373DECLARE_MSM_GPIO_PINS(82);
374DECLARE_MSM_GPIO_PINS(83);
375DECLARE_MSM_GPIO_PINS(84);
376DECLARE_MSM_GPIO_PINS(85);
377DECLARE_MSM_GPIO_PINS(86);
378DECLARE_MSM_GPIO_PINS(87);
379DECLARE_MSM_GPIO_PINS(88);
380DECLARE_MSM_GPIO_PINS(89);
381DECLARE_MSM_GPIO_PINS(90);
382DECLARE_MSM_GPIO_PINS(91);
383DECLARE_MSM_GPIO_PINS(92);
384DECLARE_MSM_GPIO_PINS(93);
385DECLARE_MSM_GPIO_PINS(94);
386DECLARE_MSM_GPIO_PINS(95);
387DECLARE_MSM_GPIO_PINS(96);
388DECLARE_MSM_GPIO_PINS(97);
389DECLARE_MSM_GPIO_PINS(98);
390DECLARE_MSM_GPIO_PINS(99);
391DECLARE_MSM_GPIO_PINS(100);
392DECLARE_MSM_GPIO_PINS(101);
393DECLARE_MSM_GPIO_PINS(102);
394DECLARE_MSM_GPIO_PINS(103);
395DECLARE_MSM_GPIO_PINS(104);
396DECLARE_MSM_GPIO_PINS(105);
397DECLARE_MSM_GPIO_PINS(106);
398DECLARE_MSM_GPIO_PINS(107);
399DECLARE_MSM_GPIO_PINS(108);
400DECLARE_MSM_GPIO_PINS(109);
401DECLARE_MSM_GPIO_PINS(110);
402DECLARE_MSM_GPIO_PINS(111);
403DECLARE_MSM_GPIO_PINS(112);
404DECLARE_MSM_GPIO_PINS(113);
405DECLARE_MSM_GPIO_PINS(114);
406DECLARE_MSM_GPIO_PINS(115);
407DECLARE_MSM_GPIO_PINS(116);
408DECLARE_MSM_GPIO_PINS(117);
409DECLARE_MSM_GPIO_PINS(118);
410DECLARE_MSM_GPIO_PINS(119);
411DECLARE_MSM_GPIO_PINS(120);
412DECLARE_MSM_GPIO_PINS(121);
413DECLARE_MSM_GPIO_PINS(122);
414DECLARE_MSM_GPIO_PINS(123);
415DECLARE_MSM_GPIO_PINS(124);
416DECLARE_MSM_GPIO_PINS(125);
417DECLARE_MSM_GPIO_PINS(126);
418DECLARE_MSM_GPIO_PINS(127);
419DECLARE_MSM_GPIO_PINS(128);
420DECLARE_MSM_GPIO_PINS(129);
421DECLARE_MSM_GPIO_PINS(130);
422DECLARE_MSM_GPIO_PINS(131);
423DECLARE_MSM_GPIO_PINS(132);
424DECLARE_MSM_GPIO_PINS(133);
425DECLARE_MSM_GPIO_PINS(134);
426DECLARE_MSM_GPIO_PINS(135);
427DECLARE_MSM_GPIO_PINS(136);
428DECLARE_MSM_GPIO_PINS(137);
429DECLARE_MSM_GPIO_PINS(138);
430DECLARE_MSM_GPIO_PINS(139);
431DECLARE_MSM_GPIO_PINS(140);
432DECLARE_MSM_GPIO_PINS(141);
433DECLARE_MSM_GPIO_PINS(142);
434DECLARE_MSM_GPIO_PINS(143);
435DECLARE_MSM_GPIO_PINS(144);
436DECLARE_MSM_GPIO_PINS(145);
437DECLARE_MSM_GPIO_PINS(146);
438DECLARE_MSM_GPIO_PINS(147);
439DECLARE_MSM_GPIO_PINS(148);
440DECLARE_MSM_GPIO_PINS(149);
441DECLARE_MSM_GPIO_PINS(150);
442DECLARE_MSM_GPIO_PINS(151);
443DECLARE_MSM_GPIO_PINS(152);
444DECLARE_MSM_GPIO_PINS(153);
445DECLARE_MSM_GPIO_PINS(154);
446DECLARE_MSM_GPIO_PINS(155);
447DECLARE_MSM_GPIO_PINS(156);
448DECLARE_MSM_GPIO_PINS(157);
449DECLARE_MSM_GPIO_PINS(158);
450DECLARE_MSM_GPIO_PINS(159);
451DECLARE_MSM_GPIO_PINS(160);
452DECLARE_MSM_GPIO_PINS(161);
453DECLARE_MSM_GPIO_PINS(162);
454DECLARE_MSM_GPIO_PINS(163);
455DECLARE_MSM_GPIO_PINS(164);
456DECLARE_MSM_GPIO_PINS(165);
457DECLARE_MSM_GPIO_PINS(166);
458DECLARE_MSM_GPIO_PINS(167);
459DECLARE_MSM_GPIO_PINS(168);
460DECLARE_MSM_GPIO_PINS(169);
461DECLARE_MSM_GPIO_PINS(170);
462DECLARE_MSM_GPIO_PINS(171);
463DECLARE_MSM_GPIO_PINS(172);
464DECLARE_MSM_GPIO_PINS(173);
465DECLARE_MSM_GPIO_PINS(174);
466
467static const unsigned int ufs_reset_pins[] = { 175 };
468static const unsigned int sdc1_rclk_pins[] = { 176 };
469static const unsigned int sdc1_clk_pins[] = { 177 };
470static const unsigned int sdc1_cmd_pins[] = { 178 };
471static const unsigned int sdc1_data_pins[] = { 179 };
472static const unsigned int sdc2_clk_pins[] = { 180 };
473static const unsigned int sdc2_cmd_pins[] = { 181 };
474static const unsigned int sdc2_data_pins[] = { 182 };
475
476enum sc7280_functions {
477	msm_mux_atest_char,
478	msm_mux_atest_char0,
479	msm_mux_atest_char1,
480	msm_mux_atest_char2,
481	msm_mux_atest_char3,
482	msm_mux_atest_usb0,
483	msm_mux_atest_usb00,
484	msm_mux_atest_usb01,
485	msm_mux_atest_usb02,
486	msm_mux_atest_usb03,
487	msm_mux_atest_usb1,
488	msm_mux_atest_usb10,
489	msm_mux_atest_usb11,
490	msm_mux_atest_usb12,
491	msm_mux_atest_usb13,
492	msm_mux_audio_ref,
493	msm_mux_cam_mclk,
494	msm_mux_cci_async,
495	msm_mux_cci_i2c,
496	msm_mux_cci_timer0,
497	msm_mux_cci_timer1,
498	msm_mux_cci_timer2,
499	msm_mux_cci_timer3,
500	msm_mux_cci_timer4,
501	msm_mux_cmu_rng0,
502	msm_mux_cmu_rng1,
503	msm_mux_cmu_rng2,
504	msm_mux_cmu_rng3,
505	msm_mux_coex_uart1,
506	msm_mux_cri_trng,
507	msm_mux_cri_trng0,
508	msm_mux_cri_trng1,
509	msm_mux_dbg_out,
510	msm_mux_ddr_bist,
511	msm_mux_ddr_pxi0,
512	msm_mux_ddr_pxi1,
513	msm_mux_dp_hot,
514	msm_mux_dp_lcd,
515	msm_mux_edp_hot,
516	msm_mux_edp_lcd,
517	msm_mux_egpio,
518	msm_mux_gcc_gp1,
519	msm_mux_gcc_gp2,
520	msm_mux_gcc_gp3,
521	msm_mux_gpio,
522	msm_mux_host2wlan_sol,
523	msm_mux_ibi_i3c,
524	msm_mux_jitter_bist,
525	msm_mux_lpass_slimbus,
526	msm_mux_mdp_vsync,
527	msm_mux_mdp_vsync0,
528	msm_mux_mdp_vsync1,
529	msm_mux_mdp_vsync2,
530	msm_mux_mdp_vsync3,
531	msm_mux_mdp_vsync4,
532	msm_mux_mdp_vsync5,
533	msm_mux_mi2s0_data0,
534	msm_mux_mi2s0_data1,
535	msm_mux_mi2s0_sck,
536	msm_mux_mi2s0_ws,
537	msm_mux_mi2s1_data0,
538	msm_mux_mi2s1_data1,
539	msm_mux_mi2s1_sck,
540	msm_mux_mi2s1_ws,
541	msm_mux_mi2s2_data0,
542	msm_mux_mi2s2_data1,
543	msm_mux_mi2s2_sck,
544	msm_mux_mi2s2_ws,
545	msm_mux_mss_grfc0,
546	msm_mux_mss_grfc1,
547	msm_mux_mss_grfc10,
548	msm_mux_mss_grfc11,
549	msm_mux_mss_grfc12,
550	msm_mux_mss_grfc2,
551	msm_mux_mss_grfc3,
552	msm_mux_mss_grfc4,
553	msm_mux_mss_grfc5,
554	msm_mux_mss_grfc6,
555	msm_mux_mss_grfc7,
556	msm_mux_mss_grfc8,
557	msm_mux_mss_grfc9,
558	msm_mux_nav_gpio0,
559	msm_mux_nav_gpio1,
560	msm_mux_nav_gpio2,
561	msm_mux_pa_indicator,
562	msm_mux_pcie0_clkreqn,
563	msm_mux_pcie1_clkreqn,
564	msm_mux_phase_flag,
565	msm_mux_pll_bist,
566	msm_mux_pll_bypassnl,
567	msm_mux_pll_clk,
568	msm_mux_pll_reset,
569	msm_mux_pri_mi2s,
570	msm_mux_prng_rosc,
571	msm_mux_qdss,
572	msm_mux_qdss_cti,
573	msm_mux_qlink0_enable,
574	msm_mux_qlink0_request,
575	msm_mux_qlink0_wmss,
576	msm_mux_qlink1_enable,
577	msm_mux_qlink1_request,
578	msm_mux_qlink1_wmss,
579	msm_mux_qspi_clk,
580	msm_mux_qspi_cs,
581	msm_mux_qspi_data,
582	msm_mux_qup00,
583	msm_mux_qup01,
584	msm_mux_qup02,
585	msm_mux_qup03,
586	msm_mux_qup04,
587	msm_mux_qup05,
588	msm_mux_qup06,
589	msm_mux_qup07,
590	msm_mux_qup10,
591	msm_mux_qup11,
592	msm_mux_qup12,
593	msm_mux_qup13,
594	msm_mux_qup14,
595	msm_mux_qup15,
596	msm_mux_qup16,
597	msm_mux_qup17,
598	msm_mux_sd_write,
599	msm_mux_sdc40,
600	msm_mux_sdc41,
601	msm_mux_sdc42,
602	msm_mux_sdc43,
603	msm_mux_sdc4_clk,
604	msm_mux_sdc4_cmd,
605	msm_mux_sec_mi2s,
606	msm_mux_tb_trig,
607	msm_mux_tgu_ch0,
608	msm_mux_tgu_ch1,
609	msm_mux_tsense_pwm1,
610	msm_mux_tsense_pwm2,
611	msm_mux_uim0_clk,
612	msm_mux_uim0_data,
613	msm_mux_uim0_present,
614	msm_mux_uim0_reset,
615	msm_mux_uim1_clk,
616	msm_mux_uim1_data,
617	msm_mux_uim1_present,
618	msm_mux_uim1_reset,
619	msm_mux_usb2phy_ac,
620	msm_mux_usb_phy,
621	msm_mux_vfr_0,
622	msm_mux_vfr_1,
623	msm_mux_vsense_trigger,
624	msm_mux__,
625};
626
627static const char * const gpio_groups[] = {
628	"gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7",
629	"gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14",
630	"gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21",
631	"gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28",
632	"gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35",
633	"gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42",
634	"gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49",
635	"gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56",
636	"gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63",
637	"gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70",
638	"gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77",
639	"gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84",
640	"gpio85", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", "gpio91",
641	"gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98",
642	"gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104",
643	"gpio105", "gpio106", "gpio107", "gpio108", "gpio109", "gpio110",
644	"gpio111", "gpio112", "gpio113", "gpio114", "gpio115", "gpio116",
645	"gpio117", "gpio118", "gpio119", "gpio120", "gpio121", "gpio122",
646	"gpio123", "gpio124", "gpio125", "gpio126", "gpio127", "gpio128",
647	"gpio129", "gpio130", "gpio131", "gpio132", "gpio133", "gpio134",
648	"gpio135", "gpio136", "gpio137", "gpio138", "gpio139", "gpio140",
649	"gpio141", "gpio142", "gpio143", "gpio144", "gpio145", "gpio146",
650	"gpio147", "gpio148", "gpio149", "gpio150", "gpio151", "gpio152",
651	"gpio153", "gpio154", "gpio155", "gpio156", "gpio157", "gpio158",
652	"gpio159", "gpio160", "gpio161", "gpio162", "gpio163", "gpio164",
653	"gpio165", "gpio166", "gpio167", "gpio168", "gpio169", "gpio170",
654	"gpio171", "gpio172", "gpio173", "gpio174",
655};
656static const char * const egpio_groups[] = {
657	"gpio144", "gpio145", "gpio146", "gpio147", "gpio148", "gpio149",
658	"gpio150", "gpio151", "gpio152", "gpio153", "gpio154", "gpio155",
659	"gpio156", "gpio157", "gpio158", "gpio159", "gpio160", "gpio161",
660	"gpio162", "gpio163", "gpio164", "gpio165", "gpio166", "gpio167",
661	"gpio168", "gpio169", "gpio170", "gpio171", "gpio172", "gpio173",
662	"gpio174",
663};
664static const char * const atest_char_groups[] = {
665	"gpio81",
666};
667static const char * const atest_char0_groups[] = {
668	"gpio77",
669};
670static const char * const atest_char1_groups[] = {
671	"gpio78",
672};
673static const char * const atest_char2_groups[] = {
674	"gpio79",
675};
676static const char * const atest_char3_groups[] = {
677	"gpio80",
678};
679static const char * const atest_usb0_groups[] = {
680	"gpio107",
681};
682static const char * const atest_usb00_groups[] = {
683	"gpio106",
684};
685static const char * const atest_usb01_groups[] = {
686	"gpio105",
687};
688static const char * const atest_usb02_groups[] = {
689	"gpio104",
690};
691static const char * const atest_usb03_groups[] = {
692	"gpio103",
693};
694static const char * const atest_usb1_groups[] = {
695	"gpio81",
696};
697static const char * const atest_usb10_groups[] = {
698	"gpio80",
699};
700static const char * const atest_usb11_groups[] = {
701	"gpio79",
702};
703static const char * const atest_usb12_groups[] = {
704	"gpio78",
705};
706static const char * const atest_usb13_groups[] = {
707	"gpio77",
708};
709static const char * const audio_ref_groups[] = {
710	"gpio105",
711};
712static const char * const cam_mclk_groups[] = {
713	"gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio93",
714};
715static const char * const cci_async_groups[] = {
716	"gpio78", "gpio79", "gpio93",
717};
718static const char * const cci_i2c_groups[] = {
719	"gpio69", "gpio70", "gpio71", "gpio72", "gpio73", "gpio74", "gpio75",
720	"gpio76",
721};
722static const char * const cci_timer0_groups[] = {
723	"gpio20",
724};
725static const char * const cci_timer1_groups[] = {
726	"gpio21",
727};
728static const char * const cci_timer2_groups[] = {
729	"gpio77",
730};
731static const char * const cci_timer3_groups[] = {
732	"gpio78",
733};
734static const char * const cci_timer4_groups[] = {
735	"gpio79",
736};
737static const char * const cmu_rng0_groups[] = {
738	"gpio120",
739};
740static const char * const cmu_rng1_groups[] = {
741	"gpio119",
742};
743static const char * const cmu_rng2_groups[] = {
744	"gpio118",
745};
746static const char * const cmu_rng3_groups[] = {
747	"gpio117",
748};
749static const char * const coex_uart1_groups[] = {
750	"gpio127", "gpio128",
751};
752static const char * const cri_trng_groups[] = {
753	"gpio124",
754};
755static const char * const cri_trng0_groups[] = {
756	"gpio121",
757};
758static const char * const cri_trng1_groups[] = {
759	"gpio122",
760};
761static const char * const dbg_out_groups[] = {
762	"gpio38",
763};
764static const char * const ddr_bist_groups[] = {
765	"gpio56", "gpio57", "gpio58", "gpio59",
766};
767static const char * const ddr_pxi0_groups[] = {
768	"gpio14", "gpio15",
769};
770static const char * const ddr_pxi1_groups[] = {
771	"gpio12", "gpio13",
772};
773static const char * const dp_hot_groups[] = {
774	"gpio47",
775};
776static const char * const dp_lcd_groups[] = {
777	"gpio81",
778};
779static const char * const edp_hot_groups[] = {
780	"gpio60",
781};
782static const char * const edp_lcd_groups[] = {
783	"gpio46",
784};
785static const char * const gcc_gp1_groups[] = {
786	"gpio76", "gpio105",
787};
788static const char * const gcc_gp2_groups[] = {
789	"gpio77", "gpio106",
790};
791static const char * const gcc_gp3_groups[] = {
792	"gpio78", "gpio107",
793};
794static const char * const host2wlan_sol_groups[] = {
795	"gpio26",
796};
797static const char * const ibi_i3c_groups[] = {
798	"gpio0", "gpio1", "gpio4", "gpio5", "gpio36", "gpio37",
799};
800static const char * const jitter_bist_groups[] = {
801	"gpio79",
802};
803static const char * const lpass_slimbus_groups[] = {
804	"gpio94", "gpio95",
805};
806static const char * const mdp_vsync_groups[] = {
807	"gpio14", "gpio16", "gpio79", "gpio80", "gpio81",
808};
809static const char * const mdp_vsync0_groups[] = {
810	"gpio80",
811};
812static const char * const mdp_vsync1_groups[] = {
813	"gpio80",
814};
815static const char * const mdp_vsync2_groups[] = {
816	"gpio81",
817};
818static const char * const mdp_vsync3_groups[] = {
819	"gpio81",
820};
821static const char * const mdp_vsync4_groups[] = {
822	"gpio80",
823};
824static const char * const mdp_vsync5_groups[] = {
825	"gpio81",
826};
827static const char * const mi2s0_data0_groups[] = {
828	"gpio98",
829};
830static const char * const mi2s0_data1_groups[] = {
831	"gpio99",
832};
833static const char * const mi2s0_sck_groups[] = {
834	"gpio97",
835};
836static const char * const mi2s0_ws_groups[] = {
837	"gpio100",
838};
839static const char * const mi2s1_data0_groups[] = {
840	"gpio107",
841};
842static const char * const mi2s1_data1_groups[] = {
843	"gpio105",
844};
845static const char * const mi2s1_sck_groups[] = {
846	"gpio106",
847};
848static const char * const mi2s1_ws_groups[] = {
849	"gpio108",
850};
851static const char * const mi2s2_data0_groups[] = {
852	"gpio102",
853};
854static const char * const mi2s2_data1_groups[] = {
855	"gpio104",
856};
857static const char * const mi2s2_sck_groups[] = {
858	"gpio101",
859};
860static const char * const mi2s2_ws_groups[] = {
861	"gpio103",
862};
863static const char * const mss_grfc0_groups[] = {
864	"gpio117", "gpio132",
865};
866static const char * const mss_grfc1_groups[] = {
867	"gpio118",
868};
869static const char * const mss_grfc10_groups[] = {
870	"gpio127",
871};
872static const char * const mss_grfc11_groups[] = {
873	"gpio128",
874};
875static const char * const mss_grfc12_groups[] = {
876	"gpio131",
877};
878static const char * const mss_grfc2_groups[] = {
879	"gpio119",
880};
881static const char * const mss_grfc3_groups[] = {
882	"gpio120",
883};
884static const char * const mss_grfc4_groups[] = {
885	"gpio121",
886};
887static const char * const mss_grfc5_groups[] = {
888	"gpio122",
889};
890static const char * const mss_grfc6_groups[] = {
891	"gpio123",
892};
893static const char * const mss_grfc7_groups[] = {
894	"gpio124",
895};
896static const char * const mss_grfc8_groups[] = {
897	"gpio125",
898};
899static const char * const mss_grfc9_groups[] = {
900	"gpio126",
901};
902static const char * const nav_gpio0_groups[] = {
903	"gpio129",
904};
905static const char * const nav_gpio1_groups[] = {
906	"gpio130",
907};
908static const char * const nav_gpio2_groups[] = {
909	"gpio131",
910};
911static const char * const pa_indicator_groups[] = {
912	"gpio131",
913};
914static const char * const pcie0_clkreqn_groups[] = {
915	"gpio88",
916};
917static const char * const pcie1_clkreqn_groups[] = {
918	"gpio79",
919};
920static const char * const phase_flag_groups[] = {
921	"gpio12", "gpio13", "gpio14", "gpio15", "gpio16",
922	"gpio17", "gpio18", "gpio19", "gpio56", "gpio57",
923	"gpio58", "gpio59", "gpio60", "gpio61", "gpio62",
924	"gpio63", "gpio117", "gpio118", "gpio119", "gpio120",
925	"gpio121", "gpio122", "gpio123", "gpio124", "gpio125",
926	"gpio126", "gpio127", "gpio128", "gpio129", "gpio130",
927	"gpio131", "gpio132",
928};
929static const char * const pll_bist_groups[] = {
930	"gpio80",
931};
932static const char * const pll_bypassnl_groups[] = {
933	"gpio66",
934};
935static const char * const pll_clk_groups[] = {
936	"gpio140",
937};
938static const char * const pll_reset_groups[] = {
939	"gpio67",
940};
941static const char * const pri_mi2s_groups[] = {
942	"gpio96",
943};
944static const char * const prng_rosc_groups[] = {
945	"gpio123",
946};
947static const char * const qdss_groups[] = {
948	"gpio2", "gpio3", "gpio8", "gpio9", "gpio10",
949	"gpio11", "gpio12", "gpio13", "gpio20", "gpio21",
950	"gpio22", "gpio23", "gpio24", "gpio25", "gpio26",
951	"gpio27", "gpio28", "gpio29", "gpio58", "gpio59",
952	"gpio101", "gpio102", "gpio103", "gpio104", "gpio105",
953	"gpio106", "gpio107", "gpio108", "gpio150", "gpio151",
954	"gpio152", "gpio153", "gpio171", "gpio172", "gpio173",
955	"gpio174",
956};
957static const char * const qdss_cti_groups[] = {
958	"gpio15", "gpio16", "gpio18", "gpio19", "gpio156", "gpio157",
959	"gpio165", "gpio166",
960};
961static const char * const qlink0_enable_groups[] = {
962	"gpio134",
963};
964static const char * const qlink0_request_groups[] = {
965	"gpio133",
966};
967static const char * const qlink0_wmss_groups[] = {
968	"gpio135",
969};
970static const char * const qlink1_enable_groups[] = {
971	"gpio137",
972};
973static const char * const qlink1_request_groups[] = {
974	"gpio136",
975};
976static const char * const qlink1_wmss_groups[] = {
977	"gpio138",
978};
979static const char * const qspi_clk_groups[] = {
980	"gpio14",
981};
982static const char * const qspi_cs_groups[] = {
983	"gpio15", "gpio19",
984};
985static const char * const qspi_data_groups[] = {
986	"gpio12", "gpio13", "gpio16", "gpio17",
987};
988static const char * const qup00_groups[] = {
989	"gpio0", "gpio1", "gpio2", "gpio3",
990};
991static const char * const qup01_groups[] = {
992	"gpio4", "gpio5", "gpio6", "gpio7",
993};
994static const char * const qup02_groups[] = {
995	"gpio8", "gpio9", "gpio10", "gpio11",
996};
997static const char * const qup03_groups[] = {
998	"gpio12", "gpio13", "gpio14", "gpio15",
999};
1000static const char * const qup04_groups[] = {
1001	"gpio16", "gpio17", "gpio18", "gpio19",
1002};
1003static const char * const qup05_groups[] = {
1004	"gpio20", "gpio21", "gpio22", "gpio23",
1005};
1006static const char * const qup06_groups[] = {
1007	"gpio24", "gpio25", "gpio26", "gpio27",
1008};
1009static const char * const qup07_groups[] = {
1010	"gpio2", "gpio3", "gpio6", "gpio28", "gpio29", "gpio30", "gpio31",
1011};
1012static const char * const qup10_groups[] = {
1013	"gpio32", "gpio33", "gpio34", "gpio35",
1014};
1015static const char * const qup11_groups[] = {
1016	"gpio36", "gpio37", "gpio38", "gpio39",
1017};
1018static const char * const qup12_groups[] = {
1019	"gpio40", "gpio41", "gpio42", "gpio43",
1020};
1021static const char * const qup13_groups[] = {
1022	"gpio44", "gpio45", "gpio46", "gpio47",
1023};
1024static const char * const qup14_groups[] = {
1025	"gpio38", "gpio48", "gpio49", "gpio50", "gpio51", "gpio54", "gpio55",
1026};
1027static const char * const qup15_groups[] = {
1028	"gpio52", "gpio53", "gpio54", "gpio55",
1029};
1030static const char * const qup16_groups[] = {
1031	"gpio50", "gpio56", "gpio57", "gpio58", "gpio59", "gpio62", "gpio63",
1032};
1033static const char * const qup17_groups[] = {
1034	"gpio60", "gpio61", "gpio62", "gpio63",
1035};
1036static const char * const sd_write_groups[] = {
1037	"gpio61",
1038};
1039static const char * const sdc40_groups[] = {
1040	"gpio12",
1041};
1042static const char * const sdc41_groups[] = {
1043	"gpio13",
1044};
1045static const char * const sdc42_groups[] = {
1046	"gpio16",
1047};
1048static const char * const sdc43_groups[] = {
1049	"gpio17",
1050};
1051static const char * const sdc4_clk_groups[] = {
1052	"gpio14",
1053};
1054static const char * const sdc4_cmd_groups[] = {
1055	"gpio19",
1056};
1057static const char * const sec_mi2s_groups[] = {
1058	"gpio105",
1059};
1060static const char * const tb_trig_groups[] = {
1061	"gpio12", "gpio13", "gpio15",
1062};
1063static const char * const tgu_ch0_groups[] = {
1064	"gpio65",
1065};
1066static const char * const tgu_ch1_groups[] = {
1067	"gpio66",
1068};
1069static const char * const tsense_pwm1_groups[] = {
1070	"gpio61",
1071};
1072static const char * const tsense_pwm2_groups[] = {
1073	"gpio61",
1074};
1075static const char * const uim0_clk_groups[] = {
1076	"gpio114",
1077};
1078static const char * const uim0_data_groups[] = {
1079	"gpio113",
1080};
1081static const char * const uim0_present_groups[] = {
1082	"gpio116",
1083};
1084static const char * const uim0_reset_groups[] = {
1085	"gpio115",
1086};
1087static const char * const uim1_clk_groups[] = {
1088	"gpio110",
1089};
1090static const char * const uim1_data_groups[] = {
1091	"gpio109",
1092};
1093static const char * const uim1_present_groups[] = {
1094	"gpio112",
1095};
1096static const char * const uim1_reset_groups[] = {
1097	"gpio111",
1098};
1099static const char * const usb2phy_ac_groups[] = {
1100	"gpio84", "gpio85",
1101};
1102static const char * const usb_phy_groups[] = {
1103	"gpio140",
1104};
1105static const char * const vfr_0_groups[] = {
1106	"gpio80",
1107};
1108static const char * const vfr_1_groups[] = {
1109	"gpio103",
1110};
1111static const char * const vsense_trigger_groups[] = {
1112	"gpio100",
1113};
1114
1115static const struct pinfunction sc7280_functions[] = {
1116	MSM_PIN_FUNCTION(atest_char),
1117	MSM_PIN_FUNCTION(atest_char0),
1118	MSM_PIN_FUNCTION(atest_char1),
1119	MSM_PIN_FUNCTION(atest_char2),
1120	MSM_PIN_FUNCTION(atest_char3),
1121	MSM_PIN_FUNCTION(atest_usb0),
1122	MSM_PIN_FUNCTION(atest_usb00),
1123	MSM_PIN_FUNCTION(atest_usb01),
1124	MSM_PIN_FUNCTION(atest_usb02),
1125	MSM_PIN_FUNCTION(atest_usb03),
1126	MSM_PIN_FUNCTION(atest_usb1),
1127	MSM_PIN_FUNCTION(atest_usb10),
1128	MSM_PIN_FUNCTION(atest_usb11),
1129	MSM_PIN_FUNCTION(atest_usb12),
1130	MSM_PIN_FUNCTION(atest_usb13),
1131	MSM_PIN_FUNCTION(audio_ref),
1132	MSM_PIN_FUNCTION(cam_mclk),
1133	MSM_PIN_FUNCTION(cci_async),
1134	MSM_PIN_FUNCTION(cci_i2c),
1135	MSM_PIN_FUNCTION(cci_timer0),
1136	MSM_PIN_FUNCTION(cci_timer1),
1137	MSM_PIN_FUNCTION(cci_timer2),
1138	MSM_PIN_FUNCTION(cci_timer3),
1139	MSM_PIN_FUNCTION(cci_timer4),
1140	MSM_PIN_FUNCTION(cmu_rng0),
1141	MSM_PIN_FUNCTION(cmu_rng1),
1142	MSM_PIN_FUNCTION(cmu_rng2),
1143	MSM_PIN_FUNCTION(cmu_rng3),
1144	MSM_PIN_FUNCTION(coex_uart1),
1145	MSM_PIN_FUNCTION(cri_trng),
1146	MSM_PIN_FUNCTION(cri_trng0),
1147	MSM_PIN_FUNCTION(cri_trng1),
1148	MSM_PIN_FUNCTION(dbg_out),
1149	MSM_PIN_FUNCTION(ddr_bist),
1150	MSM_PIN_FUNCTION(ddr_pxi0),
1151	MSM_PIN_FUNCTION(ddr_pxi1),
1152	MSM_PIN_FUNCTION(dp_hot),
1153	MSM_PIN_FUNCTION(dp_lcd),
1154	MSM_PIN_FUNCTION(edp_hot),
1155	MSM_PIN_FUNCTION(edp_lcd),
1156	MSM_PIN_FUNCTION(egpio),
1157	MSM_PIN_FUNCTION(gcc_gp1),
1158	MSM_PIN_FUNCTION(gcc_gp2),
1159	MSM_PIN_FUNCTION(gcc_gp3),
1160	MSM_PIN_FUNCTION(gpio),
1161	MSM_PIN_FUNCTION(host2wlan_sol),
1162	MSM_PIN_FUNCTION(ibi_i3c),
1163	MSM_PIN_FUNCTION(jitter_bist),
1164	MSM_PIN_FUNCTION(lpass_slimbus),
1165	MSM_PIN_FUNCTION(mdp_vsync),
1166	MSM_PIN_FUNCTION(mdp_vsync0),
1167	MSM_PIN_FUNCTION(mdp_vsync1),
1168	MSM_PIN_FUNCTION(mdp_vsync2),
1169	MSM_PIN_FUNCTION(mdp_vsync3),
1170	MSM_PIN_FUNCTION(mdp_vsync4),
1171	MSM_PIN_FUNCTION(mdp_vsync5),
1172	MSM_PIN_FUNCTION(mi2s0_data0),
1173	MSM_PIN_FUNCTION(mi2s0_data1),
1174	MSM_PIN_FUNCTION(mi2s0_sck),
1175	MSM_PIN_FUNCTION(mi2s0_ws),
1176	MSM_PIN_FUNCTION(mi2s1_data0),
1177	MSM_PIN_FUNCTION(mi2s1_data1),
1178	MSM_PIN_FUNCTION(mi2s1_sck),
1179	MSM_PIN_FUNCTION(mi2s1_ws),
1180	MSM_PIN_FUNCTION(mi2s2_data0),
1181	MSM_PIN_FUNCTION(mi2s2_data1),
1182	MSM_PIN_FUNCTION(mi2s2_sck),
1183	MSM_PIN_FUNCTION(mi2s2_ws),
1184	MSM_PIN_FUNCTION(mss_grfc0),
1185	MSM_PIN_FUNCTION(mss_grfc1),
1186	MSM_PIN_FUNCTION(mss_grfc10),
1187	MSM_PIN_FUNCTION(mss_grfc11),
1188	MSM_PIN_FUNCTION(mss_grfc12),
1189	MSM_PIN_FUNCTION(mss_grfc2),
1190	MSM_PIN_FUNCTION(mss_grfc3),
1191	MSM_PIN_FUNCTION(mss_grfc4),
1192	MSM_PIN_FUNCTION(mss_grfc5),
1193	MSM_PIN_FUNCTION(mss_grfc6),
1194	MSM_PIN_FUNCTION(mss_grfc7),
1195	MSM_PIN_FUNCTION(mss_grfc8),
1196	MSM_PIN_FUNCTION(mss_grfc9),
1197	MSM_PIN_FUNCTION(nav_gpio0),
1198	MSM_PIN_FUNCTION(nav_gpio1),
1199	MSM_PIN_FUNCTION(nav_gpio2),
1200	MSM_PIN_FUNCTION(pa_indicator),
1201	MSM_PIN_FUNCTION(pcie0_clkreqn),
1202	MSM_PIN_FUNCTION(pcie1_clkreqn),
1203	MSM_PIN_FUNCTION(phase_flag),
1204	MSM_PIN_FUNCTION(pll_bist),
1205	MSM_PIN_FUNCTION(pll_bypassnl),
1206	MSM_PIN_FUNCTION(pll_clk),
1207	MSM_PIN_FUNCTION(pll_reset),
1208	MSM_PIN_FUNCTION(pri_mi2s),
1209	MSM_PIN_FUNCTION(prng_rosc),
1210	MSM_PIN_FUNCTION(qdss),
1211	MSM_PIN_FUNCTION(qdss_cti),
1212	MSM_PIN_FUNCTION(qlink0_enable),
1213	MSM_PIN_FUNCTION(qlink0_request),
1214	MSM_PIN_FUNCTION(qlink0_wmss),
1215	MSM_PIN_FUNCTION(qlink1_enable),
1216	MSM_PIN_FUNCTION(qlink1_request),
1217	MSM_PIN_FUNCTION(qlink1_wmss),
1218	MSM_PIN_FUNCTION(qspi_clk),
1219	MSM_PIN_FUNCTION(qspi_cs),
1220	MSM_PIN_FUNCTION(qspi_data),
1221	MSM_PIN_FUNCTION(qup00),
1222	MSM_PIN_FUNCTION(qup01),
1223	MSM_PIN_FUNCTION(qup02),
1224	MSM_PIN_FUNCTION(qup03),
1225	MSM_PIN_FUNCTION(qup04),
1226	MSM_PIN_FUNCTION(qup05),
1227	MSM_PIN_FUNCTION(qup06),
1228	MSM_PIN_FUNCTION(qup07),
1229	MSM_PIN_FUNCTION(qup10),
1230	MSM_PIN_FUNCTION(qup11),
1231	MSM_PIN_FUNCTION(qup12),
1232	MSM_PIN_FUNCTION(qup13),
1233	MSM_PIN_FUNCTION(qup14),
1234	MSM_PIN_FUNCTION(qup15),
1235	MSM_PIN_FUNCTION(qup16),
1236	MSM_PIN_FUNCTION(qup17),
1237	MSM_PIN_FUNCTION(sdc40),
1238	MSM_PIN_FUNCTION(sdc41),
1239	MSM_PIN_FUNCTION(sdc42),
1240	MSM_PIN_FUNCTION(sdc43),
1241	MSM_PIN_FUNCTION(sdc4_clk),
1242	MSM_PIN_FUNCTION(sdc4_cmd),
1243	MSM_PIN_FUNCTION(sd_write),
1244	MSM_PIN_FUNCTION(sec_mi2s),
1245	MSM_PIN_FUNCTION(tb_trig),
1246	MSM_PIN_FUNCTION(tgu_ch0),
1247	MSM_PIN_FUNCTION(tgu_ch1),
1248	MSM_PIN_FUNCTION(tsense_pwm1),
1249	MSM_PIN_FUNCTION(tsense_pwm2),
1250	MSM_PIN_FUNCTION(uim0_clk),
1251	MSM_PIN_FUNCTION(uim0_data),
1252	MSM_PIN_FUNCTION(uim0_present),
1253	MSM_PIN_FUNCTION(uim0_reset),
1254	MSM_PIN_FUNCTION(uim1_clk),
1255	MSM_PIN_FUNCTION(uim1_data),
1256	MSM_PIN_FUNCTION(uim1_present),
1257	MSM_PIN_FUNCTION(uim1_reset),
1258	MSM_PIN_FUNCTION(usb2phy_ac),
1259	MSM_PIN_FUNCTION(usb_phy),
1260	MSM_PIN_FUNCTION(vfr_0),
1261	MSM_PIN_FUNCTION(vfr_1),
1262	MSM_PIN_FUNCTION(vsense_trigger),
1263};
1264
1265/* Every pin is maintained as a single group, and missing or non-existing pin
1266 * would be maintained as dummy group to synchronize pin group index with
1267 * pin descriptor registered with pinctrl core.
1268 * Clients would not be able to request these dummy pin groups.
1269 */
1270static const struct msm_pingroup sc7280_groups[] = {
1271	[0] = PINGROUP(0, qup00, ibi_i3c, _, _, _, _, _, _, _),
1272	[1] = PINGROUP(1, qup00, ibi_i3c, _, _, _, _, _, _, _),
1273	[2] = PINGROUP(2, qup00, qup07, _, qdss, _, _, _, _, _),
1274	[3] = PINGROUP(3, qup00, qup07, _, qdss, _, _, _, _, _),
1275	[4] = PINGROUP(4, qup01, ibi_i3c, _, _, _, _, _, _, _),
1276	[5] = PINGROUP(5, qup01, ibi_i3c, _, _, _, _, _, _, _),
1277	[6] = PINGROUP(6, qup01, qup07, _, _, _, _, _, _, _),
1278	[7] = PINGROUP(7, qup01, _, _, _, _, _, _, _, _),
1279	[8] = PINGROUP(8, qup02, _, qdss, _, _, _, _, _, _),
1280	[9] = PINGROUP(9, qup02, _, qdss, _, _, _, _, _, _),
1281	[10] = PINGROUP(10, qup02, _, qdss, _, _, _, _, _, _),
1282	[11] = PINGROUP(11, qup02, _, qdss, _, _, _, _, _, _),
1283	[12] = PINGROUP(12, qup03, qspi_data, sdc40, tb_trig, phase_flag, qdss, ddr_pxi1, _, _),
1284	[13] = PINGROUP(13, qup03, qspi_data, sdc41, tb_trig, phase_flag, qdss, ddr_pxi1, _, _),
1285	[14] = PINGROUP(14, qup03, qspi_clk, sdc4_clk, mdp_vsync, phase_flag, ddr_pxi0, _, _, _),
1286	[15] = PINGROUP(15, qup03, qspi_cs, tb_trig, phase_flag, qdss_cti, ddr_pxi0, _, _, _),
1287	[16] = PINGROUP(16, qup04, qspi_data, sdc42, mdp_vsync, phase_flag, qdss_cti, _, _, _),
1288	[17] = PINGROUP(17, qup04, qspi_data, sdc43, _, phase_flag, _, _, _, _),
1289	[18] = PINGROUP(18, qup04, _, phase_flag, qdss_cti, _, _, _, _, _),
1290	[19] = PINGROUP(19, qup04, qspi_cs, sdc4_cmd, _, phase_flag, qdss_cti, _, _, _),
1291	[20] = PINGROUP(20, qup05, cci_timer0, _, qdss, _, _, _, _, _),
1292	[21] = PINGROUP(21, qup05, cci_timer1, _, qdss, _, _, _, _, _),
1293	[22] = PINGROUP(22, qup05, _, qdss, _, _, _, _, _, _),
1294	[23] = PINGROUP(23, qup05, _, qdss, _, _, _, _, _, _),
1295	[24] = PINGROUP(24, qup06, _, qdss, _, _, _, _, _, _),
1296	[25] = PINGROUP(25, qup06, _, qdss, _, _, _, _, _, _),
1297	[26] = PINGROUP(26, qup06, host2wlan_sol, _, qdss, _, _, _, _, _),
1298	[27] = PINGROUP(27, qup06, _, qdss, _, _, _, _, _, _),
1299	[28] = PINGROUP(28, qup07, _, qdss, _, _, _, _, _, _),
1300	[29] = PINGROUP(29, qup07, qdss, _, _, _, _, _, _, _),
1301	[30] = PINGROUP(30, qup07, _, _, _, _, _, _, _, _),
1302	[31] = PINGROUP(31, qup07, _, _, _, _, _, _, _, _),
1303	[32] = PINGROUP(32, qup10, _, _, _, _, _, _, _, _),
1304	[33] = PINGROUP(33, qup10, _, _, _, _, _, _, _, _),
1305	[34] = PINGROUP(34, qup10, _, _, _, _, _, _, _, _),
1306	[35] = PINGROUP(35, qup10, _, _, _, _, _, _, _, _),
1307	[36] = PINGROUP(36, qup11, ibi_i3c, _, _, _, _, _, _, _),
1308	[37] = PINGROUP(37, qup11, ibi_i3c, _, _, _, _, _, _, _),
1309	[38] = PINGROUP(38, qup11, qup14, dbg_out, _, _, _, _, _, _),
1310	[39] = PINGROUP(39, qup11, _, _, _, _, _, _, _, _),
1311	[40] = PINGROUP(40, qup12, _, _, _, _, _, _, _, _),
1312	[41] = PINGROUP(41, qup12, _, _, _, _, _, _, _, _),
1313	[42] = PINGROUP(42, qup12, _, _, _, _, _, _, _, _),
1314	[43] = PINGROUP(43, qup12, _, _, _, _, _, _, _, _),
1315	[44] = PINGROUP(44, qup13, _, _, _, _, _, _, _, _),
1316	[45] = PINGROUP(45, qup13, _, _, _, _, _, _, _, _),
1317	[46] = PINGROUP(46, qup13, edp_lcd, _, _, _, _, _, _, _),
1318	[47] = PINGROUP(47, qup13, dp_hot, _, _, _, _, _, _, _),
1319	[48] = PINGROUP(48, qup14, _, _, _, _, _, _, _, _),
1320	[49] = PINGROUP(49, qup14, _, _, _, _, _, _, _, _),
1321	[50] = PINGROUP(50, qup14, qup16, _, _, _, _, _, _, _),
1322	[51] = PINGROUP(51, qup14, _, _, _, _, _, _, _, _),
1323	[52] = PINGROUP(52, qup15, _, _, _, _, _, _, _, _),
1324	[53] = PINGROUP(53, qup15, _, _, _, _, _, _, _, _),
1325	[54] = PINGROUP(54, qup15, qup14, _, _, _, _, _, _, _),
1326	[55] = PINGROUP(55, qup15, qup14, _, _, _, _, _, _, _),
1327	[56] = PINGROUP(56, qup16, ddr_bist, phase_flag, _, _, _, _, _, _),
1328	[57] = PINGROUP(57, qup16, ddr_bist, phase_flag, _, _, _, _, _, _),
1329	[58] = PINGROUP(58, qup16, ddr_bist, phase_flag, qdss, _, _, _, _, _),
1330	[59] = PINGROUP(59, qup16, ddr_bist, phase_flag, qdss, _, _, _, _, _),
1331	[60] = PINGROUP(60, qup17, edp_hot, _, phase_flag, _, _, _, _, _),
1332	[61] = PINGROUP(61, qup17, sd_write, phase_flag, tsense_pwm1, tsense_pwm2, _, _, _, _),
1333	[62] = PINGROUP(62, qup17, qup16, phase_flag, _, _, _, _, _, _),
1334	[63] = PINGROUP(63, qup17, qup16, phase_flag, _, _, _, _, _, _),
1335	[64] = PINGROUP(64, cam_mclk, _, _, _, _, _, _, _, _),
1336	[65] = PINGROUP(65, cam_mclk, tgu_ch0, _, _, _, _, _, _, _),
1337	[66] = PINGROUP(66, cam_mclk, pll_bypassnl, tgu_ch1, _, _, _, _, _, _),
1338	[67] = PINGROUP(67, cam_mclk, pll_reset, _, _, _, _, _, _, _),
1339	[68] = PINGROUP(68, cam_mclk, _, _, _, _, _, _, _, _),
1340	[69] = PINGROUP(69, cci_i2c, _, _, _, _, _, _, _, _),
1341	[70] = PINGROUP(70, cci_i2c, _, _, _, _, _, _, _, _),
1342	[71] = PINGROUP(71, cci_i2c, _, _, _, _, _, _, _, _),
1343	[72] = PINGROUP(72, cci_i2c, _, _, _, _, _, _, _, _),
1344	[73] = PINGROUP(73, cci_i2c, _, _, _, _, _, _, _, _),
1345	[74] = PINGROUP(74, cci_i2c, _, _, _, _, _, _, _, _),
1346	[75] = PINGROUP(75, cci_i2c, _, _, _, _, _, _, _, _),
1347	[76] = PINGROUP(76, cci_i2c, gcc_gp1, _, _, _, _, _, _, _),
1348	[77] = PINGROUP(77, cci_timer2, gcc_gp2, _, atest_usb13, atest_char0, _, _, _, _),
1349	[78] = PINGROUP(78, cci_timer3, cci_async, gcc_gp3, _, atest_usb12, atest_char1, _, _, _),
1350	[79] = PINGROUP(79, cci_timer4, cci_async, pcie1_clkreqn, mdp_vsync, jitter_bist, atest_usb11, atest_char2, _, _),
1351	[80] = PINGROUP(80, mdp_vsync, vfr_0, mdp_vsync0, mdp_vsync1, mdp_vsync4, pll_bist, atest_usb10, atest_char3, _),
1352	[81] = PINGROUP(81, mdp_vsync, dp_lcd, mdp_vsync2, mdp_vsync3, mdp_vsync5, atest_usb1, atest_char, _, _),
1353	[82] = PINGROUP(82, _, _, _, _, _, _, _, _, _),
1354	[83] = PINGROUP(83, _, _, _, _, _, _, _, _, _),
1355	[84] = PINGROUP(84, usb2phy_ac, _, _, _, _, _, _, _, _),
1356	[85] = PINGROUP(85, usb2phy_ac, _, _, _, _, _, _, _, _),
1357	[86] = PINGROUP(86, _, _, _, _, _, _, _, _, _),
1358	[87] = PINGROUP(87, _, _, _, _, _, _, _, _, _),
1359	[88] = PINGROUP(88, pcie0_clkreqn, _, _, _, _, _, _, _, _),
1360	[89] = PINGROUP(89, _, _, _, _, _, _, _, _, _),
1361	[90] = PINGROUP(90, _, _, _, _, _, _, _, _, _),
1362	[91] = PINGROUP(91, _, _, _, _, _, _, _, _, _),
1363	[92] = PINGROUP(92, _, _, _, _, _, _, _, _, _),
1364	[93] = PINGROUP(93, cam_mclk, cci_async, _, _, _, _, _, _, _),
1365	[94] = PINGROUP(94, lpass_slimbus, _, _, _, _, _, _, _, _),
1366	[95] = PINGROUP(95, lpass_slimbus, _, _, _, _, _, _, _, _),
1367	[96] = PINGROUP(96, pri_mi2s, _, _, _, _, _, _, _, _),
1368	[97] = PINGROUP(97, mi2s0_sck, _, _, _, _, _, _, _, _),
1369	[98] = PINGROUP(98, mi2s0_data0, _, _, _, _, _, _, _, _),
1370	[99] = PINGROUP(99, mi2s0_data1, _, _, _, _, _, _, _, _),
1371	[100] = PINGROUP(100, mi2s0_ws, _, vsense_trigger, _, _, _, _, _, _),
1372	[101] = PINGROUP(101, mi2s2_sck, _, qdss, _, _, _, _, _, _),
1373	[102] = PINGROUP(102, mi2s2_data0, _, _, qdss, _, _, _, _, _),
1374	[103] = PINGROUP(103, mi2s2_ws, vfr_1, _, _, qdss, _, atest_usb03, _, _),
1375	[104] = PINGROUP(104, mi2s2_data1, _, _, qdss, _, atest_usb02, _, _, _),
1376	[105] = PINGROUP(105, sec_mi2s, mi2s1_data1, audio_ref, gcc_gp1, _, qdss, atest_usb01, _, _),
1377	[106] = PINGROUP(106, mi2s1_sck, gcc_gp2, _, qdss, atest_usb00, _, _, _, _),
1378	[107] = PINGROUP(107, mi2s1_data0, gcc_gp3, _, qdss, atest_usb0, _, _, _, _),
1379	[108] = PINGROUP(108, mi2s1_ws, _, qdss, _, _, _, _, _, _),
1380	[109] = PINGROUP(109, uim1_data, _, _, _, _, _, _, _, _),
1381	[110] = PINGROUP(110, uim1_clk, _, _, _, _, _, _, _, _),
1382	[111] = PINGROUP(111, uim1_reset, _, _, _, _, _, _, _, _),
1383	[112] = PINGROUP(112, uim1_present, _, _, _, _, _, _, _, _),
1384	[113] = PINGROUP(113, uim0_data, _, _, _, _, _, _, _, _),
1385	[114] = PINGROUP(114, uim0_clk, _, _, _, _, _, _, _, _),
1386	[115] = PINGROUP(115, uim0_reset, _, _, _, _, _, _, _, _),
1387	[116] = PINGROUP(116, uim0_present, _, _, _, _, _, _, _, _),
1388	[117] = PINGROUP(117, _, mss_grfc0, cmu_rng3, phase_flag, _, _, _, _, _),
1389	[118] = PINGROUP(118, _, mss_grfc1, cmu_rng2, phase_flag, _, _, _, _, _),
1390	[119] = PINGROUP(119, _, mss_grfc2, cmu_rng1, phase_flag, _, _, _, _, _),
1391	[120] = PINGROUP(120, _, mss_grfc3, cmu_rng0, phase_flag, _, _, _, _, _),
1392	[121] = PINGROUP(121, _, mss_grfc4, cri_trng0, phase_flag, _, _, _, _, _),
1393	[122] = PINGROUP(122, _, mss_grfc5, cri_trng1, phase_flag, _, _, _, _, _),
1394	[123] = PINGROUP(123, _, mss_grfc6, prng_rosc, phase_flag, _, _, _, _, _),
1395	[124] = PINGROUP(124, _, mss_grfc7, cri_trng, phase_flag, _, _, _, _, _),
1396	[125] = PINGROUP(125, _, mss_grfc8, phase_flag, _, _, _, _, _, _),
1397	[126] = PINGROUP(126, _, mss_grfc9, phase_flag, _, _, _, _, _, _),
1398	[127] = PINGROUP(127, coex_uart1, mss_grfc10, phase_flag, _, _, _, _, _, _),
1399	[128] = PINGROUP(128, coex_uart1, mss_grfc11, phase_flag, _, _, _, _, _, _),
1400	[129] = PINGROUP(129, nav_gpio0, phase_flag, _, _, _, _, _, _, _),
1401	[130] = PINGROUP(130, nav_gpio1, phase_flag, _, _, _, _, _, _, _),
1402	[131] = PINGROUP(131, mss_grfc12, nav_gpio2, pa_indicator, phase_flag, _, _, _, _, _),
1403	[132] = PINGROUP(132, mss_grfc0, phase_flag, _, _, _, _, _, _, _),
1404	[133] = PINGROUP(133, qlink0_request, _, _, _, _, _, _, _, _),
1405	[134] = PINGROUP(134, qlink0_enable, _, _, _, _, _, _, _, _),
1406	[135] = PINGROUP(135, qlink0_wmss, _, _, _, _, _, _, _, _),
1407	[136] = PINGROUP(136, qlink1_request, _, _, _, _, _, _, _, _),
1408	[137] = PINGROUP(137, qlink1_enable, _, _, _, _, _, _, _, _),
1409	[138] = PINGROUP(138, qlink1_wmss, _, _, _, _, _, _, _, _),
1410	[139] = PINGROUP(139, _, _, _, _, _, _, _, _, _),
1411	[140] = PINGROUP(140, usb_phy, pll_clk, _, _, _, _, _, _, _),
1412	[141] = PINGROUP(141, _, _, _, _, _, _, _, _, _),
1413	[142] = PINGROUP(142, _, _, _, _, _, _, _, _, _),
1414	[143] = PINGROUP(143, _, _, _, _, _, _, _, _, _),
1415	[144] = PINGROUP(144, _, _, _, _, _, _, _, _, egpio),
1416	[145] = PINGROUP(145, _, _, _, _, _, _, _, _, egpio),
1417	[146] = PINGROUP(146, _, _, _, _, _, _, _, _, egpio),
1418	[147] = PINGROUP(147, _, _, _, _, _, _, _, _, egpio),
1419	[148] = PINGROUP(148, _, _, _, _, _, _, _, _, egpio),
1420	[149] = PINGROUP(149, _, _, _, _, _, _, _, _, egpio),
1421	[150] = PINGROUP(150, qdss, _, _, _, _, _, _, _, egpio),
1422	[151] = PINGROUP(151, qdss, _, _, _, _, _, _, _, egpio),
1423	[152] = PINGROUP(152, qdss, _, _, _, _, _, _, _, egpio),
1424	[153] = PINGROUP(153, qdss, _, _, _, _, _, _, _, egpio),
1425	[154] = PINGROUP(154, _, _, _, _, _, _, _, _, egpio),
1426	[155] = PINGROUP(155, _, _, _, _, _, _, _, _, egpio),
1427	[156] = PINGROUP(156, qdss_cti, _, _, _, _, _, _, _, egpio),
1428	[157] = PINGROUP(157, qdss_cti, _, _, _, _, _, _, _, egpio),
1429	[158] = PINGROUP(158, _, _, _, _, _, _, _, _, egpio),
1430	[159] = PINGROUP(159, _, _, _, _, _, _, _, _, egpio),
1431	[160] = PINGROUP(160, _, _, _, _, _, _, _, _, egpio),
1432	[161] = PINGROUP(161, _, _, _, _, _, _, _, _, egpio),
1433	[162] = PINGROUP(162, _, _, _, _, _, _, _, _, egpio),
1434	[163] = PINGROUP(163, _, _, _, _, _, _, _, _, egpio),
1435	[164] = PINGROUP(164, _, _, _, _, _, _, _, _, egpio),
1436	[165] = PINGROUP(165, qdss_cti, _, _, _, _, _, _, _, egpio),
1437	[166] = PINGROUP(166, qdss_cti, _, _, _, _, _, _, _, egpio),
1438	[167] = PINGROUP(167, _, _, _, _, _, _, _, _, egpio),
1439	[168] = PINGROUP(168, _, _, _, _, _, _, _, _, egpio),
1440	[169] = PINGROUP(169, _, _, _, _, _, _, _, _, egpio),
1441	[170] = PINGROUP(170, _, _, _, _, _, _, _, _, egpio),
1442	[171] = PINGROUP(171, qdss, _, _, _, _, _, _, _, egpio),
1443	[172] = PINGROUP(172, qdss, _, _, _, _, _, _, _, egpio),
1444	[173] = PINGROUP(173, qdss, _, _, _, _, _, _, _, egpio),
1445	[174] = PINGROUP(174, qdss, _, _, _, _, _, _, _, egpio),
1446	[175] = UFS_RESET(ufs_reset, 0xbe000),
1447	[176] = SDC_QDSD_PINGROUP(sdc1_rclk, 0xb3004, 0, 6),
1448	[177] = SDC_QDSD_PINGROUP(sdc1_clk, 0xb3000, 13, 6),
1449	[178] = SDC_QDSD_PINGROUP(sdc1_cmd, 0xb3000, 11, 3),
1450	[179] = SDC_QDSD_PINGROUP(sdc1_data, 0xb3000, 9, 0),
1451	[180] = SDC_QDSD_PINGROUP(sdc2_clk, 0xb4000, 14, 6),
1452	[181] = SDC_QDSD_PINGROUP(sdc2_cmd, 0xb4000, 11, 3),
1453	[182] = SDC_QDSD_PINGROUP(sdc2_data, 0xb4000, 9, 0),
1454};
1455
1456static const struct msm_gpio_wakeirq_map sc7280_pdc_map[] = {
1457	{ 0, 134 }, { 3, 131 }, { 4, 121 }, { 7, 103 }, { 8, 155 },
1458	{ 11, 93 }, { 12, 78 }, { 15, 79 }, { 16, 80 }, { 18, 81 },
1459	{ 19, 107 }, { 20, 82 }, { 21, 83 }, { 23, 99 }, { 24, 86 },
1460	{ 25, 95 }, { 27, 158 }, { 28, 159 }, { 31, 90 }, { 32, 144 },
1461	{ 34, 77 }, { 35, 92 }, { 36, 157 }, { 39, 73 }, { 40, 97 },
1462	{ 41, 98 }, { 43, 85 }, { 44, 100 }, { 45, 101 }, { 47, 102 },
1463	{ 48, 74 }, { 51, 112 }, { 52, 156 }, { 54, 117 }, { 55, 84 },
1464	{ 56, 108 }, { 59, 110 }, { 60, 111 }, { 61, 123 }, { 63, 104 },
1465	{ 68, 127 }, { 72, 150 }, { 75, 133 }, { 77, 125 }, { 78, 105 },
1466	{ 79, 106 }, { 80, 118 }, { 81, 119 }, { 82, 162 }, { 83, 122 },
1467	{ 86, 75 }, { 88, 154 }, { 89, 124 }, { 90, 149 }, { 91, 76 },
1468	{ 93, 128 }, { 95, 160 }, { 101, 126 }, { 102, 96 }, { 103, 116 },
1469	{ 104, 114 }, { 112, 72 }, { 116, 135 }, { 117, 163 }, { 119, 137 },
1470	{ 121, 138 }, { 123, 139 }, { 125, 140 }, { 127, 141 }, { 128, 165 },
1471	{ 129, 143 }, { 130, 94 }, { 131, 145 }, { 133, 146 }, { 136, 147 },
1472	{ 140, 148 }, { 141, 115 }, { 142, 113 }, { 145, 130 }, { 148, 132 },
1473	{ 150, 87 }, { 151, 88 }, { 153, 89 }, { 155, 164 }, { 156, 129 },
1474	{ 157, 161 }, { 158, 120 }, { 161, 136 }, { 163, 142 }, { 172, 166 },
1475	{ 174, 167 },
1476};
1477
1478static const struct msm_pinctrl_soc_data sc7280_pinctrl = {
1479	.pins = sc7280_pins,
1480	.npins = ARRAY_SIZE(sc7280_pins),
1481	.functions = sc7280_functions,
1482	.nfunctions = ARRAY_SIZE(sc7280_functions),
1483	.groups = sc7280_groups,
1484	.ngroups = ARRAY_SIZE(sc7280_groups),
1485	.ngpios = 176,
1486	.wakeirq_map = sc7280_pdc_map,
1487	.nwakeirq_map = ARRAY_SIZE(sc7280_pdc_map),
1488	.egpio_func = 9,
1489};
1490
1491static int sc7280_pinctrl_probe(struct platform_device *pdev)
1492{
1493	return msm_pinctrl_probe(pdev, &sc7280_pinctrl);
1494}
1495
1496static const struct of_device_id sc7280_pinctrl_of_match[] = {
1497	{ .compatible = "qcom,sc7280-pinctrl", },
1498	{ },
1499};
1500
1501static struct platform_driver sc7280_pinctrl_driver = {
1502	.driver = {
1503		.name = "sc7280-pinctrl",
1504		.pm = &msm_pinctrl_dev_pm_ops,
1505		.of_match_table = sc7280_pinctrl_of_match,
1506	},
1507	.probe = sc7280_pinctrl_probe,
1508	.remove = msm_pinctrl_remove,
1509};
1510
1511static int __init sc7280_pinctrl_init(void)
1512{
1513	return platform_driver_register(&sc7280_pinctrl_driver);
1514}
1515arch_initcall(sc7280_pinctrl_init);
1516
1517static void __exit sc7280_pinctrl_exit(void)
1518{
1519	platform_driver_unregister(&sc7280_pinctrl_driver);
1520}
1521module_exit(sc7280_pinctrl_exit);
1522
1523MODULE_DESCRIPTION("QTI sc7280 pinctrl driver");
1524MODULE_LICENSE("GPL v2");
1525MODULE_DEVICE_TABLE(of, sc7280_pinctrl_of_match);
1526