1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (c) 2021, The Linux Foundation. All rights reserved.
4 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
5 * Copyright (c) 2023, Linaro Limited
6 */
7
8#include <linux/module.h>
9#include <linux/of.h>
10#include <linux/platform_device.h>
11
12#include "pinctrl-msm.h"
13
14#define REG_SIZE 0x1000
15
16#define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10)	\
17	{					        \
18		.grp = PINCTRL_PINGROUP("gpio" #id,	\
19			gpio##id##_pins,		\
20			ARRAY_SIZE(gpio##id##_pins)),	\
21		.funcs = (int[]){			\
22			msm_mux_gpio, /* gpio mode */	\
23			msm_mux_##f1,			\
24			msm_mux_##f2,			\
25			msm_mux_##f3,			\
26			msm_mux_##f4,			\
27			msm_mux_##f5,			\
28			msm_mux_##f6,			\
29			msm_mux_##f7,			\
30			msm_mux_##f8,			\
31			msm_mux_##f9,			\
32			msm_mux_##f10			\
33		},				        \
34		.nfuncs = 11,				\
35		.ctl_reg = REG_SIZE * id,			\
36		.io_reg = 0x4 + REG_SIZE * id,		\
37		.intr_cfg_reg = 0x8 + REG_SIZE * id,		\
38		.intr_status_reg = 0xc + REG_SIZE * id,	\
39		.intr_target_reg = 0x8 + REG_SIZE * id,	\
40		.mux_bit = 2,			\
41		.pull_bit = 0,			\
42		.drv_bit = 6,			\
43		.i2c_pull_bit = 13,		\
44		.egpio_enable = 12,		\
45		.egpio_present = 11,		\
46		.oe_bit = 9,			\
47		.in_bit = 0,			\
48		.out_bit = 1,			\
49		.intr_enable_bit = 0,		\
50		.intr_status_bit = 0,		\
51		.intr_wakeup_present_bit = 6,   \
52		.intr_wakeup_enable_bit = 7,    \
53		.intr_target_bit = 8,		\
54		.intr_target_kpss_val = 3,	\
55		.intr_raw_status_bit = 4,	\
56		.intr_polarity_bit = 1,		\
57		.intr_detection_bit = 2,	\
58		.intr_detection_width = 2,	\
59	}
60
61#define SDC_QDSD_PINGROUP(pg_name, ctl, pull, drv)	\
62	{					        \
63		.grp = PINCTRL_PINGROUP(#pg_name,	\
64			pg_name##_pins,			\
65			ARRAY_SIZE(pg_name##_pins)),	\
66		.ctl_reg = ctl,				\
67		.io_reg = 0,				\
68		.intr_cfg_reg = 0,			\
69		.intr_status_reg = 0,			\
70		.intr_target_reg = 0,			\
71		.mux_bit = -1,				\
72		.pull_bit = pull,			\
73		.drv_bit = drv,				\
74		.oe_bit = -1,				\
75		.in_bit = -1,				\
76		.out_bit = -1,				\
77		.intr_enable_bit = -1,			\
78		.intr_status_bit = -1,			\
79		.intr_target_bit = -1,			\
80		.intr_raw_status_bit = -1,		\
81		.intr_polarity_bit = -1,		\
82		.intr_detection_bit = -1,		\
83		.intr_detection_width = -1,		\
84	}
85
86#define UFS_RESET(pg_name, ctl, io)			\
87	{					        \
88		.grp = PINCTRL_PINGROUP(#pg_name,	\
89			pg_name##_pins,			\
90			ARRAY_SIZE(pg_name##_pins)),	\
91		.ctl_reg = ctl,				\
92		.io_reg = io,				\
93		.intr_cfg_reg = 0,			\
94		.intr_status_reg = 0,			\
95		.intr_target_reg = 0,			\
96		.mux_bit = -1,				\
97		.pull_bit = 3,				\
98		.drv_bit = 0,				\
99		.oe_bit = -1,				\
100		.in_bit = -1,				\
101		.out_bit = 0,				\
102		.intr_enable_bit = -1,			\
103		.intr_status_bit = -1,			\
104		.intr_target_bit = -1,			\
105		.intr_raw_status_bit = -1,		\
106		.intr_polarity_bit = -1,		\
107		.intr_detection_bit = -1,		\
108		.intr_detection_width = -1,		\
109	}
110
111static const struct pinctrl_pin_desc sm8650_pins[] = {
112	PINCTRL_PIN(0, "GPIO_0"),
113	PINCTRL_PIN(1, "GPIO_1"),
114	PINCTRL_PIN(2, "GPIO_2"),
115	PINCTRL_PIN(3, "GPIO_3"),
116	PINCTRL_PIN(4, "GPIO_4"),
117	PINCTRL_PIN(5, "GPIO_5"),
118	PINCTRL_PIN(6, "GPIO_6"),
119	PINCTRL_PIN(7, "GPIO_7"),
120	PINCTRL_PIN(8, "GPIO_8"),
121	PINCTRL_PIN(9, "GPIO_9"),
122	PINCTRL_PIN(10, "GPIO_10"),
123	PINCTRL_PIN(11, "GPIO_11"),
124	PINCTRL_PIN(12, "GPIO_12"),
125	PINCTRL_PIN(13, "GPIO_13"),
126	PINCTRL_PIN(14, "GPIO_14"),
127	PINCTRL_PIN(15, "GPIO_15"),
128	PINCTRL_PIN(16, "GPIO_16"),
129	PINCTRL_PIN(17, "GPIO_17"),
130	PINCTRL_PIN(18, "GPIO_18"),
131	PINCTRL_PIN(19, "GPIO_19"),
132	PINCTRL_PIN(20, "GPIO_20"),
133	PINCTRL_PIN(21, "GPIO_21"),
134	PINCTRL_PIN(22, "GPIO_22"),
135	PINCTRL_PIN(23, "GPIO_23"),
136	PINCTRL_PIN(24, "GPIO_24"),
137	PINCTRL_PIN(25, "GPIO_25"),
138	PINCTRL_PIN(26, "GPIO_26"),
139	PINCTRL_PIN(27, "GPIO_27"),
140	PINCTRL_PIN(28, "GPIO_28"),
141	PINCTRL_PIN(29, "GPIO_29"),
142	PINCTRL_PIN(30, "GPIO_30"),
143	PINCTRL_PIN(31, "GPIO_31"),
144	PINCTRL_PIN(32, "GPIO_32"),
145	PINCTRL_PIN(33, "GPIO_33"),
146	PINCTRL_PIN(34, "GPIO_34"),
147	PINCTRL_PIN(35, "GPIO_35"),
148	PINCTRL_PIN(36, "GPIO_36"),
149	PINCTRL_PIN(37, "GPIO_37"),
150	PINCTRL_PIN(38, "GPIO_38"),
151	PINCTRL_PIN(39, "GPIO_39"),
152	PINCTRL_PIN(40, "GPIO_40"),
153	PINCTRL_PIN(41, "GPIO_41"),
154	PINCTRL_PIN(42, "GPIO_42"),
155	PINCTRL_PIN(43, "GPIO_43"),
156	PINCTRL_PIN(44, "GPIO_44"),
157	PINCTRL_PIN(45, "GPIO_45"),
158	PINCTRL_PIN(46, "GPIO_46"),
159	PINCTRL_PIN(47, "GPIO_47"),
160	PINCTRL_PIN(48, "GPIO_48"),
161	PINCTRL_PIN(49, "GPIO_49"),
162	PINCTRL_PIN(50, "GPIO_50"),
163	PINCTRL_PIN(51, "GPIO_51"),
164	PINCTRL_PIN(52, "GPIO_52"),
165	PINCTRL_PIN(53, "GPIO_53"),
166	PINCTRL_PIN(54, "GPIO_54"),
167	PINCTRL_PIN(55, "GPIO_55"),
168	PINCTRL_PIN(56, "GPIO_56"),
169	PINCTRL_PIN(57, "GPIO_57"),
170	PINCTRL_PIN(58, "GPIO_58"),
171	PINCTRL_PIN(59, "GPIO_59"),
172	PINCTRL_PIN(60, "GPIO_60"),
173	PINCTRL_PIN(61, "GPIO_61"),
174	PINCTRL_PIN(62, "GPIO_62"),
175	PINCTRL_PIN(63, "GPIO_63"),
176	PINCTRL_PIN(64, "GPIO_64"),
177	PINCTRL_PIN(65, "GPIO_65"),
178	PINCTRL_PIN(66, "GPIO_66"),
179	PINCTRL_PIN(67, "GPIO_67"),
180	PINCTRL_PIN(68, "GPIO_68"),
181	PINCTRL_PIN(69, "GPIO_69"),
182	PINCTRL_PIN(70, "GPIO_70"),
183	PINCTRL_PIN(71, "GPIO_71"),
184	PINCTRL_PIN(72, "GPIO_72"),
185	PINCTRL_PIN(73, "GPIO_73"),
186	PINCTRL_PIN(74, "GPIO_74"),
187	PINCTRL_PIN(75, "GPIO_75"),
188	PINCTRL_PIN(76, "GPIO_76"),
189	PINCTRL_PIN(77, "GPIO_77"),
190	PINCTRL_PIN(78, "GPIO_78"),
191	PINCTRL_PIN(79, "GPIO_79"),
192	PINCTRL_PIN(80, "GPIO_80"),
193	PINCTRL_PIN(81, "GPIO_81"),
194	PINCTRL_PIN(82, "GPIO_82"),
195	PINCTRL_PIN(83, "GPIO_83"),
196	PINCTRL_PIN(84, "GPIO_84"),
197	PINCTRL_PIN(85, "GPIO_85"),
198	PINCTRL_PIN(86, "GPIO_86"),
199	PINCTRL_PIN(87, "GPIO_87"),
200	PINCTRL_PIN(88, "GPIO_88"),
201	PINCTRL_PIN(89, "GPIO_89"),
202	PINCTRL_PIN(90, "GPIO_90"),
203	PINCTRL_PIN(91, "GPIO_91"),
204	PINCTRL_PIN(92, "GPIO_92"),
205	PINCTRL_PIN(93, "GPIO_93"),
206	PINCTRL_PIN(94, "GPIO_94"),
207	PINCTRL_PIN(95, "GPIO_95"),
208	PINCTRL_PIN(96, "GPIO_96"),
209	PINCTRL_PIN(97, "GPIO_97"),
210	PINCTRL_PIN(98, "GPIO_98"),
211	PINCTRL_PIN(99, "GPIO_99"),
212	PINCTRL_PIN(100, "GPIO_100"),
213	PINCTRL_PIN(101, "GPIO_101"),
214	PINCTRL_PIN(102, "GPIO_102"),
215	PINCTRL_PIN(103, "GPIO_103"),
216	PINCTRL_PIN(104, "GPIO_104"),
217	PINCTRL_PIN(105, "GPIO_105"),
218	PINCTRL_PIN(106, "GPIO_106"),
219	PINCTRL_PIN(107, "GPIO_107"),
220	PINCTRL_PIN(108, "GPIO_108"),
221	PINCTRL_PIN(109, "GPIO_109"),
222	PINCTRL_PIN(110, "GPIO_110"),
223	PINCTRL_PIN(111, "GPIO_111"),
224	PINCTRL_PIN(112, "GPIO_112"),
225	PINCTRL_PIN(113, "GPIO_113"),
226	PINCTRL_PIN(114, "GPIO_114"),
227	PINCTRL_PIN(115, "GPIO_115"),
228	PINCTRL_PIN(116, "GPIO_116"),
229	PINCTRL_PIN(117, "GPIO_117"),
230	PINCTRL_PIN(118, "GPIO_118"),
231	PINCTRL_PIN(119, "GPIO_119"),
232	PINCTRL_PIN(120, "GPIO_120"),
233	PINCTRL_PIN(121, "GPIO_121"),
234	PINCTRL_PIN(122, "GPIO_122"),
235	PINCTRL_PIN(123, "GPIO_123"),
236	PINCTRL_PIN(124, "GPIO_124"),
237	PINCTRL_PIN(125, "GPIO_125"),
238	PINCTRL_PIN(126, "GPIO_126"),
239	PINCTRL_PIN(127, "GPIO_127"),
240	PINCTRL_PIN(128, "GPIO_128"),
241	PINCTRL_PIN(129, "GPIO_129"),
242	PINCTRL_PIN(130, "GPIO_130"),
243	PINCTRL_PIN(131, "GPIO_131"),
244	PINCTRL_PIN(132, "GPIO_132"),
245	PINCTRL_PIN(133, "GPIO_133"),
246	PINCTRL_PIN(134, "GPIO_134"),
247	PINCTRL_PIN(135, "GPIO_135"),
248	PINCTRL_PIN(136, "GPIO_136"),
249	PINCTRL_PIN(137, "GPIO_137"),
250	PINCTRL_PIN(138, "GPIO_138"),
251	PINCTRL_PIN(139, "GPIO_139"),
252	PINCTRL_PIN(140, "GPIO_140"),
253	PINCTRL_PIN(141, "GPIO_141"),
254	PINCTRL_PIN(142, "GPIO_142"),
255	PINCTRL_PIN(143, "GPIO_143"),
256	PINCTRL_PIN(144, "GPIO_144"),
257	PINCTRL_PIN(145, "GPIO_145"),
258	PINCTRL_PIN(146, "GPIO_146"),
259	PINCTRL_PIN(147, "GPIO_147"),
260	PINCTRL_PIN(148, "GPIO_148"),
261	PINCTRL_PIN(149, "GPIO_149"),
262	PINCTRL_PIN(150, "GPIO_150"),
263	PINCTRL_PIN(151, "GPIO_151"),
264	PINCTRL_PIN(152, "GPIO_152"),
265	PINCTRL_PIN(153, "GPIO_153"),
266	PINCTRL_PIN(154, "GPIO_154"),
267	PINCTRL_PIN(155, "GPIO_155"),
268	PINCTRL_PIN(156, "GPIO_156"),
269	PINCTRL_PIN(157, "GPIO_157"),
270	PINCTRL_PIN(158, "GPIO_158"),
271	PINCTRL_PIN(159, "GPIO_159"),
272	PINCTRL_PIN(160, "GPIO_160"),
273	PINCTRL_PIN(161, "GPIO_161"),
274	PINCTRL_PIN(162, "GPIO_162"),
275	PINCTRL_PIN(163, "GPIO_163"),
276	PINCTRL_PIN(164, "GPIO_164"),
277	PINCTRL_PIN(165, "GPIO_165"),
278	PINCTRL_PIN(166, "GPIO_166"),
279	PINCTRL_PIN(167, "GPIO_167"),
280	PINCTRL_PIN(168, "GPIO_168"),
281	PINCTRL_PIN(169, "GPIO_169"),
282	PINCTRL_PIN(170, "GPIO_170"),
283	PINCTRL_PIN(171, "GPIO_171"),
284	PINCTRL_PIN(172, "GPIO_172"),
285	PINCTRL_PIN(173, "GPIO_173"),
286	PINCTRL_PIN(174, "GPIO_174"),
287	PINCTRL_PIN(175, "GPIO_175"),
288	PINCTRL_PIN(176, "GPIO_176"),
289	PINCTRL_PIN(177, "GPIO_177"),
290	PINCTRL_PIN(178, "GPIO_178"),
291	PINCTRL_PIN(179, "GPIO_179"),
292	PINCTRL_PIN(180, "GPIO_180"),
293	PINCTRL_PIN(181, "GPIO_181"),
294	PINCTRL_PIN(182, "GPIO_182"),
295	PINCTRL_PIN(183, "GPIO_183"),
296	PINCTRL_PIN(184, "GPIO_184"),
297	PINCTRL_PIN(185, "GPIO_185"),
298	PINCTRL_PIN(186, "GPIO_186"),
299	PINCTRL_PIN(187, "GPIO_187"),
300	PINCTRL_PIN(188, "GPIO_188"),
301	PINCTRL_PIN(189, "GPIO_189"),
302	PINCTRL_PIN(190, "GPIO_190"),
303	PINCTRL_PIN(191, "GPIO_191"),
304	PINCTRL_PIN(192, "GPIO_192"),
305	PINCTRL_PIN(193, "GPIO_193"),
306	PINCTRL_PIN(194, "GPIO_194"),
307	PINCTRL_PIN(195, "GPIO_195"),
308	PINCTRL_PIN(196, "GPIO_196"),
309	PINCTRL_PIN(197, "GPIO_197"),
310	PINCTRL_PIN(198, "GPIO_198"),
311	PINCTRL_PIN(199, "GPIO_199"),
312	PINCTRL_PIN(200, "GPIO_200"),
313	PINCTRL_PIN(201, "GPIO_201"),
314	PINCTRL_PIN(202, "GPIO_202"),
315	PINCTRL_PIN(203, "GPIO_203"),
316	PINCTRL_PIN(204, "GPIO_204"),
317	PINCTRL_PIN(205, "GPIO_205"),
318	PINCTRL_PIN(206, "GPIO_206"),
319	PINCTRL_PIN(207, "GPIO_207"),
320	PINCTRL_PIN(208, "GPIO_208"),
321	PINCTRL_PIN(209, "GPIO_209"),
322	PINCTRL_PIN(210, "UFS_RESET"),
323	PINCTRL_PIN(211, "SDC2_CLK"),
324	PINCTRL_PIN(212, "SDC2_CMD"),
325	PINCTRL_PIN(213, "SDC2_DATA"),
326};
327
328#define DECLARE_MSM_GPIO_PINS(pin) \
329	static const unsigned int gpio##pin##_pins[] = { pin }
330DECLARE_MSM_GPIO_PINS(0);
331DECLARE_MSM_GPIO_PINS(1);
332DECLARE_MSM_GPIO_PINS(2);
333DECLARE_MSM_GPIO_PINS(3);
334DECLARE_MSM_GPIO_PINS(4);
335DECLARE_MSM_GPIO_PINS(5);
336DECLARE_MSM_GPIO_PINS(6);
337DECLARE_MSM_GPIO_PINS(7);
338DECLARE_MSM_GPIO_PINS(8);
339DECLARE_MSM_GPIO_PINS(9);
340DECLARE_MSM_GPIO_PINS(10);
341DECLARE_MSM_GPIO_PINS(11);
342DECLARE_MSM_GPIO_PINS(12);
343DECLARE_MSM_GPIO_PINS(13);
344DECLARE_MSM_GPIO_PINS(14);
345DECLARE_MSM_GPIO_PINS(15);
346DECLARE_MSM_GPIO_PINS(16);
347DECLARE_MSM_GPIO_PINS(17);
348DECLARE_MSM_GPIO_PINS(18);
349DECLARE_MSM_GPIO_PINS(19);
350DECLARE_MSM_GPIO_PINS(20);
351DECLARE_MSM_GPIO_PINS(21);
352DECLARE_MSM_GPIO_PINS(22);
353DECLARE_MSM_GPIO_PINS(23);
354DECLARE_MSM_GPIO_PINS(24);
355DECLARE_MSM_GPIO_PINS(25);
356DECLARE_MSM_GPIO_PINS(26);
357DECLARE_MSM_GPIO_PINS(27);
358DECLARE_MSM_GPIO_PINS(28);
359DECLARE_MSM_GPIO_PINS(29);
360DECLARE_MSM_GPIO_PINS(30);
361DECLARE_MSM_GPIO_PINS(31);
362DECLARE_MSM_GPIO_PINS(32);
363DECLARE_MSM_GPIO_PINS(33);
364DECLARE_MSM_GPIO_PINS(34);
365DECLARE_MSM_GPIO_PINS(35);
366DECLARE_MSM_GPIO_PINS(36);
367DECLARE_MSM_GPIO_PINS(37);
368DECLARE_MSM_GPIO_PINS(38);
369DECLARE_MSM_GPIO_PINS(39);
370DECLARE_MSM_GPIO_PINS(40);
371DECLARE_MSM_GPIO_PINS(41);
372DECLARE_MSM_GPIO_PINS(42);
373DECLARE_MSM_GPIO_PINS(43);
374DECLARE_MSM_GPIO_PINS(44);
375DECLARE_MSM_GPIO_PINS(45);
376DECLARE_MSM_GPIO_PINS(46);
377DECLARE_MSM_GPIO_PINS(47);
378DECLARE_MSM_GPIO_PINS(48);
379DECLARE_MSM_GPIO_PINS(49);
380DECLARE_MSM_GPIO_PINS(50);
381DECLARE_MSM_GPIO_PINS(51);
382DECLARE_MSM_GPIO_PINS(52);
383DECLARE_MSM_GPIO_PINS(53);
384DECLARE_MSM_GPIO_PINS(54);
385DECLARE_MSM_GPIO_PINS(55);
386DECLARE_MSM_GPIO_PINS(56);
387DECLARE_MSM_GPIO_PINS(57);
388DECLARE_MSM_GPIO_PINS(58);
389DECLARE_MSM_GPIO_PINS(59);
390DECLARE_MSM_GPIO_PINS(60);
391DECLARE_MSM_GPIO_PINS(61);
392DECLARE_MSM_GPIO_PINS(62);
393DECLARE_MSM_GPIO_PINS(63);
394DECLARE_MSM_GPIO_PINS(64);
395DECLARE_MSM_GPIO_PINS(65);
396DECLARE_MSM_GPIO_PINS(66);
397DECLARE_MSM_GPIO_PINS(67);
398DECLARE_MSM_GPIO_PINS(68);
399DECLARE_MSM_GPIO_PINS(69);
400DECLARE_MSM_GPIO_PINS(70);
401DECLARE_MSM_GPIO_PINS(71);
402DECLARE_MSM_GPIO_PINS(72);
403DECLARE_MSM_GPIO_PINS(73);
404DECLARE_MSM_GPIO_PINS(74);
405DECLARE_MSM_GPIO_PINS(75);
406DECLARE_MSM_GPIO_PINS(76);
407DECLARE_MSM_GPIO_PINS(77);
408DECLARE_MSM_GPIO_PINS(78);
409DECLARE_MSM_GPIO_PINS(79);
410DECLARE_MSM_GPIO_PINS(80);
411DECLARE_MSM_GPIO_PINS(81);
412DECLARE_MSM_GPIO_PINS(82);
413DECLARE_MSM_GPIO_PINS(83);
414DECLARE_MSM_GPIO_PINS(84);
415DECLARE_MSM_GPIO_PINS(85);
416DECLARE_MSM_GPIO_PINS(86);
417DECLARE_MSM_GPIO_PINS(87);
418DECLARE_MSM_GPIO_PINS(88);
419DECLARE_MSM_GPIO_PINS(89);
420DECLARE_MSM_GPIO_PINS(90);
421DECLARE_MSM_GPIO_PINS(91);
422DECLARE_MSM_GPIO_PINS(92);
423DECLARE_MSM_GPIO_PINS(93);
424DECLARE_MSM_GPIO_PINS(94);
425DECLARE_MSM_GPIO_PINS(95);
426DECLARE_MSM_GPIO_PINS(96);
427DECLARE_MSM_GPIO_PINS(97);
428DECLARE_MSM_GPIO_PINS(98);
429DECLARE_MSM_GPIO_PINS(99);
430DECLARE_MSM_GPIO_PINS(100);
431DECLARE_MSM_GPIO_PINS(101);
432DECLARE_MSM_GPIO_PINS(102);
433DECLARE_MSM_GPIO_PINS(103);
434DECLARE_MSM_GPIO_PINS(104);
435DECLARE_MSM_GPIO_PINS(105);
436DECLARE_MSM_GPIO_PINS(106);
437DECLARE_MSM_GPIO_PINS(107);
438DECLARE_MSM_GPIO_PINS(108);
439DECLARE_MSM_GPIO_PINS(109);
440DECLARE_MSM_GPIO_PINS(110);
441DECLARE_MSM_GPIO_PINS(111);
442DECLARE_MSM_GPIO_PINS(112);
443DECLARE_MSM_GPIO_PINS(113);
444DECLARE_MSM_GPIO_PINS(114);
445DECLARE_MSM_GPIO_PINS(115);
446DECLARE_MSM_GPIO_PINS(116);
447DECLARE_MSM_GPIO_PINS(117);
448DECLARE_MSM_GPIO_PINS(118);
449DECLARE_MSM_GPIO_PINS(119);
450DECLARE_MSM_GPIO_PINS(120);
451DECLARE_MSM_GPIO_PINS(121);
452DECLARE_MSM_GPIO_PINS(122);
453DECLARE_MSM_GPIO_PINS(123);
454DECLARE_MSM_GPIO_PINS(124);
455DECLARE_MSM_GPIO_PINS(125);
456DECLARE_MSM_GPIO_PINS(126);
457DECLARE_MSM_GPIO_PINS(127);
458DECLARE_MSM_GPIO_PINS(128);
459DECLARE_MSM_GPIO_PINS(129);
460DECLARE_MSM_GPIO_PINS(130);
461DECLARE_MSM_GPIO_PINS(131);
462DECLARE_MSM_GPIO_PINS(132);
463DECLARE_MSM_GPIO_PINS(133);
464DECLARE_MSM_GPIO_PINS(134);
465DECLARE_MSM_GPIO_PINS(135);
466DECLARE_MSM_GPIO_PINS(136);
467DECLARE_MSM_GPIO_PINS(137);
468DECLARE_MSM_GPIO_PINS(138);
469DECLARE_MSM_GPIO_PINS(139);
470DECLARE_MSM_GPIO_PINS(140);
471DECLARE_MSM_GPIO_PINS(141);
472DECLARE_MSM_GPIO_PINS(142);
473DECLARE_MSM_GPIO_PINS(143);
474DECLARE_MSM_GPIO_PINS(144);
475DECLARE_MSM_GPIO_PINS(145);
476DECLARE_MSM_GPIO_PINS(146);
477DECLARE_MSM_GPIO_PINS(147);
478DECLARE_MSM_GPIO_PINS(148);
479DECLARE_MSM_GPIO_PINS(149);
480DECLARE_MSM_GPIO_PINS(150);
481DECLARE_MSM_GPIO_PINS(151);
482DECLARE_MSM_GPIO_PINS(152);
483DECLARE_MSM_GPIO_PINS(153);
484DECLARE_MSM_GPIO_PINS(154);
485DECLARE_MSM_GPIO_PINS(155);
486DECLARE_MSM_GPIO_PINS(156);
487DECLARE_MSM_GPIO_PINS(157);
488DECLARE_MSM_GPIO_PINS(158);
489DECLARE_MSM_GPIO_PINS(159);
490DECLARE_MSM_GPIO_PINS(160);
491DECLARE_MSM_GPIO_PINS(161);
492DECLARE_MSM_GPIO_PINS(162);
493DECLARE_MSM_GPIO_PINS(163);
494DECLARE_MSM_GPIO_PINS(164);
495DECLARE_MSM_GPIO_PINS(165);
496DECLARE_MSM_GPIO_PINS(166);
497DECLARE_MSM_GPIO_PINS(167);
498DECLARE_MSM_GPIO_PINS(168);
499DECLARE_MSM_GPIO_PINS(169);
500DECLARE_MSM_GPIO_PINS(170);
501DECLARE_MSM_GPIO_PINS(171);
502DECLARE_MSM_GPIO_PINS(172);
503DECLARE_MSM_GPIO_PINS(173);
504DECLARE_MSM_GPIO_PINS(174);
505DECLARE_MSM_GPIO_PINS(175);
506DECLARE_MSM_GPIO_PINS(176);
507DECLARE_MSM_GPIO_PINS(177);
508DECLARE_MSM_GPIO_PINS(178);
509DECLARE_MSM_GPIO_PINS(179);
510DECLARE_MSM_GPIO_PINS(180);
511DECLARE_MSM_GPIO_PINS(181);
512DECLARE_MSM_GPIO_PINS(182);
513DECLARE_MSM_GPIO_PINS(183);
514DECLARE_MSM_GPIO_PINS(184);
515DECLARE_MSM_GPIO_PINS(185);
516DECLARE_MSM_GPIO_PINS(186);
517DECLARE_MSM_GPIO_PINS(187);
518DECLARE_MSM_GPIO_PINS(188);
519DECLARE_MSM_GPIO_PINS(189);
520DECLARE_MSM_GPIO_PINS(190);
521DECLARE_MSM_GPIO_PINS(191);
522DECLARE_MSM_GPIO_PINS(192);
523DECLARE_MSM_GPIO_PINS(193);
524DECLARE_MSM_GPIO_PINS(194);
525DECLARE_MSM_GPIO_PINS(195);
526DECLARE_MSM_GPIO_PINS(196);
527DECLARE_MSM_GPIO_PINS(197);
528DECLARE_MSM_GPIO_PINS(198);
529DECLARE_MSM_GPIO_PINS(199);
530DECLARE_MSM_GPIO_PINS(200);
531DECLARE_MSM_GPIO_PINS(201);
532DECLARE_MSM_GPIO_PINS(202);
533DECLARE_MSM_GPIO_PINS(203);
534DECLARE_MSM_GPIO_PINS(204);
535DECLARE_MSM_GPIO_PINS(205);
536DECLARE_MSM_GPIO_PINS(206);
537DECLARE_MSM_GPIO_PINS(207);
538DECLARE_MSM_GPIO_PINS(208);
539DECLARE_MSM_GPIO_PINS(209);
540
541static const unsigned int ufs_reset_pins[] = { 210 };
542static const unsigned int sdc2_clk_pins[] = { 211 };
543static const unsigned int sdc2_cmd_pins[] = { 212 };
544static const unsigned int sdc2_data_pins[] = { 213 };
545
546enum sm8650_functions {
547	msm_mux_gpio,
548	msm_mux_aoss_cti,
549	msm_mux_atest_char,
550	msm_mux_atest_usb,
551	msm_mux_audio_ext_mclk0,
552	msm_mux_audio_ext_mclk1,
553	msm_mux_audio_ref_clk,
554	msm_mux_cam_aon_mclk2,
555	msm_mux_cam_aon_mclk4,
556	msm_mux_cam_mclk,
557	msm_mux_cci_async_in,
558	msm_mux_cci_i2c_scl,
559	msm_mux_cci_i2c_sda,
560	msm_mux_cci_timer,
561	msm_mux_cmu_rng,
562	msm_mux_coex_uart1_rx,
563	msm_mux_coex_uart1_tx,
564	msm_mux_coex_uart2_rx,
565	msm_mux_coex_uart2_tx,
566	msm_mux_cri_trng,
567	msm_mux_dbg_out_clk,
568	msm_mux_ddr_bist_complete,
569	msm_mux_ddr_bist_fail,
570	msm_mux_ddr_bist_start,
571	msm_mux_ddr_bist_stop,
572	msm_mux_ddr_pxi0,
573	msm_mux_ddr_pxi1,
574	msm_mux_ddr_pxi2,
575	msm_mux_ddr_pxi3,
576	msm_mux_do_not,
577	msm_mux_dp_hot,
578	msm_mux_egpio,
579	msm_mux_gcc_gp1,
580	msm_mux_gcc_gp2,
581	msm_mux_gcc_gp3,
582	msm_mux_gnss_adc0,
583	msm_mux_gnss_adc1,
584	msm_mux_i2chub0_se0,
585	msm_mux_i2chub0_se1,
586	msm_mux_i2chub0_se2,
587	msm_mux_i2chub0_se3,
588	msm_mux_i2chub0_se4,
589	msm_mux_i2chub0_se5,
590	msm_mux_i2chub0_se6,
591	msm_mux_i2chub0_se7,
592	msm_mux_i2chub0_se8,
593	msm_mux_i2chub0_se9,
594	msm_mux_i2s0_data0,
595	msm_mux_i2s0_data1,
596	msm_mux_i2s0_sck,
597	msm_mux_i2s0_ws,
598	msm_mux_i2s1_data0,
599	msm_mux_i2s1_data1,
600	msm_mux_i2s1_sck,
601	msm_mux_i2s1_ws,
602	msm_mux_ibi_i3c,
603	msm_mux_jitter_bist,
604	msm_mux_mdp_vsync,
605	msm_mux_mdp_vsync0_out,
606	msm_mux_mdp_vsync1_out,
607	msm_mux_mdp_vsync2_out,
608	msm_mux_mdp_vsync3_out,
609	msm_mux_mdp_vsync_e,
610	msm_mux_nav_gpio0,
611	msm_mux_nav_gpio1,
612	msm_mux_nav_gpio2,
613	msm_mux_nav_gpio3,
614	msm_mux_pcie0_clk_req_n,
615	msm_mux_pcie1_clk_req_n,
616	msm_mux_phase_flag,
617	msm_mux_pll_bist_sync,
618	msm_mux_pll_clk_aux,
619	msm_mux_prng_rosc0,
620	msm_mux_prng_rosc1,
621	msm_mux_prng_rosc2,
622	msm_mux_prng_rosc3,
623	msm_mux_qdss_cti,
624	msm_mux_qdss_gpio,
625	msm_mux_qlink_big_enable,
626	msm_mux_qlink_big_request,
627	msm_mux_qlink_little_enable,
628	msm_mux_qlink_little_request,
629	msm_mux_qlink_wmss,
630	msm_mux_qspi0,
631	msm_mux_qspi1,
632	msm_mux_qspi2,
633	msm_mux_qspi3,
634	msm_mux_qspi_clk,
635	msm_mux_qspi_cs,
636	msm_mux_qup1_se0,
637	msm_mux_qup1_se1,
638	msm_mux_qup1_se2,
639	msm_mux_qup1_se3,
640	msm_mux_qup1_se4,
641	msm_mux_qup1_se5,
642	msm_mux_qup1_se6,
643	msm_mux_qup1_se7,
644	msm_mux_qup2_se0,
645	msm_mux_qup2_se1,
646	msm_mux_qup2_se2,
647	msm_mux_qup2_se3,
648	msm_mux_qup2_se4,
649	msm_mux_qup2_se5,
650	msm_mux_qup2_se6,
651	msm_mux_qup2_se7,
652	msm_mux_sd_write_protect,
653	msm_mux_sdc40,
654	msm_mux_sdc41,
655	msm_mux_sdc42,
656	msm_mux_sdc43,
657	msm_mux_sdc4_clk,
658	msm_mux_sdc4_cmd,
659	msm_mux_tb_trig_sdc2,
660	msm_mux_tb_trig_sdc4,
661	msm_mux_tgu_ch0_trigout,
662	msm_mux_tgu_ch1_trigout,
663	msm_mux_tgu_ch2_trigout,
664	msm_mux_tgu_ch3_trigout,
665	msm_mux_tmess_prng0,
666	msm_mux_tmess_prng1,
667	msm_mux_tmess_prng2,
668	msm_mux_tmess_prng3,
669	msm_mux_tsense_pwm1,
670	msm_mux_tsense_pwm2,
671	msm_mux_tsense_pwm3,
672	msm_mux_uim0_clk,
673	msm_mux_uim0_data,
674	msm_mux_uim0_present,
675	msm_mux_uim0_reset,
676	msm_mux_uim1_clk,
677	msm_mux_uim1_data,
678	msm_mux_uim1_present,
679	msm_mux_uim1_reset,
680	msm_mux_usb1_hs,
681	msm_mux_usb_phy,
682	msm_mux_vfr_0,
683	msm_mux_vfr_1,
684	msm_mux_vsense_trigger_mirnat,
685	msm_mux__,
686};
687
688static const char *const gpio_groups[] = {
689	"gpio0",   "gpio1",   "gpio2",   "gpio3",
690	"gpio4",   "gpio5",   "gpio6",   "gpio7",
691	"gpio8",   "gpio9",   "gpio10",  "gpio11",
692	"gpio12",  "gpio13",  "gpio14",  "gpio15",
693	"gpio16",  "gpio17",  "gpio18",  "gpio19",
694	"gpio20",  "gpio21",  "gpio22",  "gpio23",
695	"gpio24",  "gpio25",  "gpio26",  "gpio27",
696	"gpio28",  "gpio29",  "gpio30",  "gpio31",
697	"gpio32",  "gpio33",  "gpio34",  "gpio35",
698	"gpio36",  "gpio37",  "gpio38",  "gpio39",
699	"gpio40",  "gpio41",  "gpio42",  "gpio43",
700	"gpio44",  "gpio45",  "gpio46",  "gpio47",
701	"gpio48",  "gpio49",  "gpio50",  "gpio51",
702	"gpio52",  "gpio53",  "gpio54",  "gpio55",
703	"gpio56",  "gpio57",  "gpio58",  "gpio59",
704	"gpio60",  "gpio61",  "gpio62",  "gpio63",
705	"gpio64",  "gpio65",  "gpio66",  "gpio67",
706	"gpio68",  "gpio69",  "gpio70",  "gpio71",
707	"gpio72",  "gpio73",  "gpio74",  "gpio75",
708	"gpio76",  "gpio77",  "gpio78",  "gpio79",
709	"gpio80",  "gpio81",  "gpio82",  "gpio83",
710	"gpio84",  "gpio85",  "gpio86",  "gpio87",
711	"gpio88",  "gpio89",  "gpio90",  "gpio91",
712	"gpio92",  "gpio93",  "gpio94",  "gpio95",
713	"gpio96",  "gpio97",  "gpio98",  "gpio99",
714	"gpio100", "gpio101", "gpio102", "gpio103",
715	"gpio104", "gpio105", "gpio106", "gpio107",
716	"gpio108", "gpio109", "gpio110", "gpio111",
717	"gpio112", "gpio113", "gpio114", "gpio115",
718	"gpio116", "gpio117", "gpio118", "gpio119",
719	"gpio120", "gpio121", "gpio122", "gpio123",
720	"gpio124", "gpio125", "gpio126", "gpio127",
721	"gpio128", "gpio129", "gpio130", "gpio131",
722	"gpio132", "gpio133", "gpio134", "gpio135",
723	"gpio136", "gpio137", "gpio138", "gpio139",
724	"gpio140", "gpio141", "gpio142", "gpio143",
725	"gpio144", "gpio145", "gpio146", "gpio147",
726	"gpio148", "gpio149", "gpio150", "gpio151",
727	"gpio152", "gpio153", "gpio154", "gpio155",
728	"gpio156", "gpio157", "gpio158", "gpio159",
729	"gpio160", "gpio161", "gpio162", "gpio163",
730	"gpio164", "gpio165", "gpio166", "gpio167",
731	"gpio168", "gpio169", "gpio170", "gpio171",
732	"gpio172", "gpio173", "gpio174", "gpio175",
733	"gpio176", "gpio177", "gpio178", "gpio179",
734	"gpio180", "gpio181", "gpio182", "gpio183",
735	"gpio184", "gpio185", "gpio186", "gpio187",
736	"gpio188", "gpio189", "gpio190", "gpio191",
737	"gpio192", "gpio193", "gpio194", "gpio195",
738	"gpio196", "gpio197", "gpio198", "gpio199",
739	"gpio200", "gpio201", "gpio202", "gpio203",
740	"gpio204", "gpio205", "gpio206", "gpio207",
741	"gpio208", "gpio209",
742};
743
744static const char * const egpio_groups[] = {
745	"gpio0",   "gpio1",   "gpio2",   "gpio3",   "gpio4",   "gpio5",
746	"gpio6",   "gpio7",   "gpio165", "gpio166", "gpio167", "gpio168",
747	"gpio169", "gpio170", "gpio171", "gpio172", "gpio173", "gpio174",
748	"gpio175", "gpio176", "gpio177", "gpio178", "gpio179", "gpio180",
749	"gpio181", "gpio182", "gpio183", "gpio184", "gpio185", "gpio186",
750	"gpio187", "gpio188", "gpio189", "gpio190", "gpio191", "gpio192",
751	"gpio193", "gpio194", "gpio195", "gpio196", "gpio197", "gpio198",
752	"gpio199", "gpio200", "gpio201", "gpio202", "gpio203", "gpio204",
753	"gpio205", "gpio206", "gpio207", "gpio208", "gpio209",
754};
755
756static const char * const aoss_cti_groups[] = {
757	"gpio50", "gpio51", "gpio60", "gpio61",
758};
759
760static const char *const atest_char_groups[] = {
761	"gpio130", "gpio131", "gpio132", "gpio133",
762	"gpio137",
763};
764
765static const char *const atest_usb_groups[] = {
766	"gpio71", "gpio72", "gpio74", "gpio130",
767	"gpio131",
768};
769
770static const char *const audio_ext_mclk0_groups[] = {
771	"gpio125",
772};
773
774static const char *const audio_ext_mclk1_groups[] = {
775	"gpio124",
776};
777
778static const char *const audio_ref_clk_groups[] = {
779	"gpio124",
780};
781
782static const char *const cam_aon_mclk2_groups[] = {
783	"gpio102",
784};
785
786static const char *const cam_aon_mclk4_groups[] = {
787	"gpio104",
788};
789
790static const char *const cam_mclk_groups[] = {
791	"gpio100", "gpio101", "gpio103", "gpio105",
792	"gpio106", "gpio108",
793};
794
795static const char *const cci_async_in_groups[] = {
796	"gpio15", "gpio163", "gpio164",
797};
798
799static const char *const cci_i2c_scl_groups[] = {
800	"gpio13",  "gpio114", "gpio116", "gpio118",
801	"gpio120", "gpio153",
802};
803
804static const char *const cci_i2c_sda_groups[] = {
805	"gpio12",  "gpio112", "gpio113", "gpio115",
806	"gpio117", "gpio119",
807};
808
809static const char *const cci_timer_groups[] = {
810	"gpio10", "gpio11", "gpio109", "gpio110",
811	"gpio111",
812};
813
814static const char *const cmu_rng_groups[] = {
815	"gpio95",  "gpio96", "gpio112", "gpio127",
816	"gpio122", "gpio128",
817};
818
819static const char *const coex_uart1_rx_groups[] = {
820	"gpio148",
821};
822
823static const char *const coex_uart1_tx_groups[] = {
824	"gpio149",
825};
826
827static const char *const coex_uart2_rx_groups[] = {
828	"gpio150",
829};
830
831static const char *const coex_uart2_tx_groups[] = {
832	"gpio151",
833};
834
835static const char *const cri_trng_groups[] = {
836	"gpio187",
837};
838
839static const char *const dbg_out_clk_groups[] = {
840	"gpio92",
841};
842
843static const char *const ddr_bist_complete_groups[] = {
844	"gpio44",
845};
846
847static const char *const ddr_bist_fail_groups[] = {
848	"gpio40",
849};
850
851static const char *const ddr_bist_start_groups[] = {
852	"gpio41",
853};
854
855static const char *const ddr_bist_stop_groups[] = {
856	"gpio45",
857};
858
859static const char *const ddr_pxi0_groups[] = {
860	"gpio75", "gpio76",
861};
862
863static const char *const ddr_pxi1_groups[] = {
864	"gpio44", "gpio45",
865};
866
867static const char *const ddr_pxi2_groups[] = {
868	"gpio51", "gpio62",
869};
870
871static const char *const ddr_pxi3_groups[] = {
872	"gpio46", "gpio47",
873};
874
875static const char *const do_not_groups[] = {
876	"gpio36", "gpio37", "gpio38", "gpio39",
877	"gpio134", "gpio135", "gpio136",
878};
879
880static const char *const dp_hot_groups[] = {
881	"gpio47",
882};
883
884static const char *const gcc_gp1_groups[] = {
885	"gpio86", "gpio134",
886};
887
888static const char *const gcc_gp2_groups[] = {
889	"gpio87", "gpio135",
890};
891
892static const char *const gcc_gp3_groups[] = {
893	"gpio88", "gpio136",
894};
895
896static const char *const gnss_adc0_groups[] = {
897	"gpio89", "gpio91",
898};
899
900static const char *const gnss_adc1_groups[] = {
901	"gpio90", "gpio92",
902};
903
904static const char *const i2chub0_se0_groups[] = {
905	"gpio64", "gpio65",
906};
907
908static const char *const i2chub0_se1_groups[] = {
909	"gpio66", "gpio67",
910};
911
912static const char *const i2chub0_se2_groups[] = {
913	"gpio68", "gpio69",
914};
915
916static const char *const i2chub0_se3_groups[] = {
917	"gpio70", "gpio71",
918};
919
920static const char *const i2chub0_se4_groups[] = {
921	"gpio72", "gpio73",
922};
923
924static const char *const i2chub0_se5_groups[] = {
925	"gpio74", "gpio75",
926};
927
928static const char *const i2chub0_se6_groups[] = {
929	"gpio76", "gpio77",
930};
931
932static const char *const i2chub0_se7_groups[] = {
933	"gpio78", "gpio79",
934};
935
936static const char *const i2chub0_se8_groups[] = {
937	"gpio206", "gpio207",
938};
939
940static const char *const i2chub0_se9_groups[] = {
941	"gpio80", "gpio81",
942};
943
944static const char *const i2s0_data0_groups[] = {
945	"gpio127",
946};
947
948static const char *const i2s0_data1_groups[] = {
949	"gpio128",
950};
951
952static const char *const i2s0_sck_groups[] = {
953	"gpio126",
954};
955
956static const char *const i2s0_ws_groups[] = {
957	"gpio129",
958};
959
960static const char *const i2s1_data0_groups[] = {
961	"gpio122",
962};
963
964static const char *const i2s1_data1_groups[] = {
965	"gpio124",
966};
967
968static const char *const i2s1_sck_groups[] = {
969	"gpio121",
970};
971
972static const char *const i2s1_ws_groups[] = {
973	"gpio123",
974};
975
976static const char *const ibi_i3c_groups[] = {
977	"gpio0",  "gpio1",  "gpio4",  "gpio5",
978	"gpio8",  "gpio9",  "gpio12", "gpio13",
979	"gpio32", "gpio33", "gpio36", "gpio37",
980	"gpio48", "gpio49", "gpio56", "gpio57",
981};
982
983static const char *const jitter_bist_groups[] = {
984	"gpio73",
985};
986
987static const char *const mdp_vsync_groups[] = {
988	"gpio86", "gpio87", "gpio133", "gpio137",
989};
990
991static const char *const mdp_vsync0_out_groups[] = {
992	"gpio86",
993};
994
995static const char *const mdp_vsync1_out_groups[] = {
996	"gpio86",
997};
998
999static const char *const mdp_vsync2_out_groups[] = {
1000	"gpio87",
1001};
1002
1003static const char *const mdp_vsync3_out_groups[] = {
1004	"gpio87",
1005};
1006
1007static const char *const mdp_vsync_e_groups[] = {
1008	"gpio88",
1009};
1010
1011static const char *const nav_gpio0_groups[] = {
1012	"gpio154",
1013};
1014
1015static const char *const nav_gpio1_groups[] = {
1016	"gpio155",
1017};
1018
1019static const char *const nav_gpio2_groups[] = {
1020	"gpio152",
1021};
1022
1023static const char *const nav_gpio3_groups[] = {
1024	"gpio154",
1025};
1026
1027static const char *const pcie0_clk_req_n_groups[] = {
1028	"gpio95",
1029};
1030
1031static const char *const pcie1_clk_req_n_groups[] = {
1032	"gpio98",
1033};
1034
1035static const char *const phase_flag_groups[] = {
1036	"gpio0",   "gpio1",   "gpio3",   "gpio4",
1037	"gpio5",   "gpio7",   "gpio8",   "gpio9",
1038	"gpio11",  "gpio12",  "gpio13",  "gpio15",
1039	"gpio16",  "gpio17",  "gpio19",  "gpio94",
1040	"gpio95",  "gpio96",  "gpio109", "gpio111",
1041	"gpio112", "gpio113", "gpio114", "gpio115",
1042	"gpio116", "gpio117", "gpio118", "gpio119",
1043	"gpio120", "gpio153", "gpio163", "gpio164",
1044};
1045
1046static const char *const pll_bist_sync_groups[] = {
1047	"gpio68",
1048};
1049
1050static const char *const pll_clk_aux_groups[] = {
1051	"gpio106",
1052};
1053
1054static const char *const prng_rosc0_groups[] = {
1055	"gpio186",
1056};
1057
1058static const char *const prng_rosc1_groups[] = {
1059	"gpio183",
1060};
1061
1062static const char *const prng_rosc2_groups[] = {
1063	"gpio182",
1064};
1065
1066static const char *const prng_rosc3_groups[] = {
1067	"gpio181",
1068};
1069
1070static const char *const qdss_cti_groups[] = {
1071	"gpio27", "gpio31", "gpio78",  "gpio79",
1072	"gpio82", "gpio83", "gpio159", "gpio162",
1073};
1074
1075static const char *const qdss_gpio_groups[] = {
1076	"gpio3",   "gpio7",   "gpio8",   "gpio13",
1077	"gpio15",  "gpio100", "gpio101", "gpio102",
1078	"gpio103", "gpio104", "gpio105", "gpio113",
1079	"gpio114", "gpio115", "gpio116", "gpio117",
1080	"gpio118", "gpio140", "gpio141", "gpio142",
1081	"gpio143", "gpio144", "gpio145", "gpio146",
1082	"gpio147", "gpio148", "gpio149", "gpio150",
1083	"gpio151", "gpio152", "gpio153", "gpio154",
1084	"gpio155", "gpio156", "gpio157", "gpio158",
1085};
1086
1087static const char *const qlink_big_enable_groups[] = {
1088	"gpio160",
1089};
1090
1091static const char *const qlink_big_request_groups[] = {
1092	"gpio159",
1093};
1094
1095static const char *const qlink_little_enable_groups[] = {
1096	"gpio157",
1097};
1098
1099static const char *const qlink_little_request_groups[] = {
1100	"gpio156",
1101};
1102
1103static const char *const qlink_wmss_groups[] = {
1104	"gpio158",
1105};
1106
1107static const char *const qspi0_groups[] = {
1108	"gpio134",
1109};
1110
1111static const char *const qspi1_groups[] = {
1112	"gpio136",
1113};
1114
1115static const char *const qspi2_groups[] = {
1116	"gpio56",
1117};
1118
1119static const char *const qspi3_groups[] = {
1120	"gpio57",
1121};
1122
1123static const char *const qspi_clk_groups[] = {
1124	"gpio135",
1125};
1126
1127static const char *const qspi_cs_groups[] = {
1128	"gpio58", "gpio59",
1129};
1130
1131static const char *const qup1_se0_groups[] = {
1132	"gpio32", "gpio33", "gpio34", "gpio35",
1133};
1134
1135static const char *const qup1_se1_groups[] = {
1136	"gpio36", "gpio37", "gpio38", "gpio39",
1137};
1138
1139static const char *const qup1_se2_groups[] = {
1140	"gpio40", "gpio41", "gpio42", "gpio43",
1141	"gpio44", "gpio45", "gpio46",
1142};
1143
1144static const char *const qup1_se3_groups[] = {
1145	"gpio44", "gpio45", "gpio46", "gpio47",
1146};
1147
1148static const char *const qup1_se4_groups[] = {
1149	"gpio48", "gpio49", "gpio50", "gpio51",
1150};
1151
1152static const char *const qup1_se5_groups[] = {
1153	"gpio52", "gpio53", "gpio54", "gpio55",
1154};
1155
1156static const char *const qup1_se6_groups[] = {
1157	"gpio56", "gpio57", "gpio58", "gpio59",
1158};
1159
1160static const char *const qup1_se7_groups[] = {
1161	"gpio60", "gpio61", "gpio62", "gpio63",
1162};
1163
1164static const char *const qup2_se0_groups[] = {
1165	"gpio0", "gpio1", "gpio2", "gpio3",
1166};
1167
1168static const char *const qup2_se1_groups[] = {
1169	"gpio4", "gpio5", "gpio6", "gpio7",
1170};
1171
1172static const char *const qup2_se2_groups[] = {
1173	"gpio8",  "gpio9",  "gpio10", "gpio11",
1174	"gpio13", "gpio15", "gpio12",
1175};
1176
1177static const char *const qup2_se3_groups[] = {
1178	"gpio12", "gpio13", "gpio14", "gpio15",
1179};
1180
1181static const char *const qup2_se4_groups[] = {
1182	"gpio16", "gpio17", "gpio18", "gpio19",
1183};
1184
1185static const char *const qup2_se5_groups[] = {
1186	"gpio20", "gpio21", "gpio22", "gpio23",
1187	"gpio23",
1188};
1189
1190static const char *const qup2_se6_groups[] = {
1191	"gpio24", "gpio25", "gpio26", "gpio27",
1192};
1193
1194static const char *const qup2_se7_groups[] = {
1195	"gpio28", "gpio29", "gpio30", "gpio31",
1196};
1197
1198static const char *const sd_write_protect_groups[] = {
1199	"gpio93",
1200};
1201
1202static const char *const sdc40_groups[] = {
1203	"gpio134",
1204};
1205
1206static const char *const sdc41_groups[] = {
1207	"gpio136",
1208};
1209
1210static const char *const sdc42_groups[] = {
1211	"gpio56",
1212};
1213
1214static const char *const sdc43_groups[] = {
1215	"gpio57",
1216};
1217
1218static const char *const sdc4_clk_groups[] = {
1219	"gpio135",
1220};
1221
1222static const char *const sdc4_cmd_groups[] = {
1223	"gpio59",
1224};
1225
1226static const char *const tb_trig_sdc2_groups[] = {
1227	"gpio8",
1228};
1229
1230static const char *const tb_trig_sdc4_groups[] = {
1231	"gpio58",
1232};
1233
1234static const char *const tgu_ch0_trigout_groups[] = {
1235	"gpio8",
1236};
1237
1238static const char *const tgu_ch1_trigout_groups[] = {
1239	"gpio9",
1240};
1241
1242static const char *const tgu_ch2_trigout_groups[] = {
1243	"gpio10",
1244};
1245
1246static const char *const tgu_ch3_trigout_groups[] = {
1247	"gpio11",
1248};
1249
1250static const char *const tmess_prng0_groups[] = {
1251	"gpio94",
1252};
1253
1254static const char *const tmess_prng1_groups[] = {
1255	"gpio95",
1256};
1257
1258static const char *const tmess_prng2_groups[] = {
1259	"gpio96",
1260};
1261
1262static const char *const tmess_prng3_groups[] = {
1263	"gpio109",
1264};
1265
1266static const char *const tsense_pwm1_groups[] = {
1267	"gpio58",
1268};
1269
1270static const char *const tsense_pwm2_groups[] = {
1271	"gpio58",
1272};
1273
1274static const char *const tsense_pwm3_groups[] = {
1275	"gpio58",
1276};
1277
1278static const char *const uim0_clk_groups[] = {
1279	"gpio131",
1280};
1281
1282static const char *const uim0_data_groups[] = {
1283	"gpio130",
1284};
1285
1286static const char *const uim0_present_groups[] = {
1287	"gpio47",
1288};
1289
1290static const char *const uim0_reset_groups[] = {
1291	"gpio132",
1292};
1293
1294static const char *const uim1_clk_groups[] = {
1295	"gpio135",
1296};
1297
1298static const char *const uim1_data_groups[] = {
1299	"gpio134",
1300};
1301
1302static const char *const uim1_present_groups[] = {
1303	"gpio76",
1304};
1305
1306static const char *const uim1_reset_groups[] = {
1307	"gpio136",
1308};
1309
1310static const char *const usb1_hs_groups[] = {
1311	"gpio89",
1312};
1313
1314static const char *const usb_phy_groups[] = {
1315	"gpio29", "gpio54",
1316};
1317
1318static const char *const vfr_0_groups[] = {
1319	"gpio150",
1320};
1321
1322static const char *const vfr_1_groups[] = {
1323	"gpio155",
1324};
1325
1326static const char *const vsense_trigger_mirnat_groups[] = {
1327	"gpio60",
1328};
1329
1330static const struct pinfunction sm8650_functions[] = {
1331	MSM_PIN_FUNCTION(gpio),
1332	MSM_PIN_FUNCTION(aoss_cti),
1333	MSM_PIN_FUNCTION(atest_char),
1334	MSM_PIN_FUNCTION(atest_usb),
1335	MSM_PIN_FUNCTION(audio_ext_mclk0),
1336	MSM_PIN_FUNCTION(audio_ext_mclk1),
1337	MSM_PIN_FUNCTION(audio_ref_clk),
1338	MSM_PIN_FUNCTION(cam_aon_mclk2),
1339	MSM_PIN_FUNCTION(cam_aon_mclk4),
1340	MSM_PIN_FUNCTION(cam_mclk),
1341	MSM_PIN_FUNCTION(cci_async_in),
1342	MSM_PIN_FUNCTION(cci_i2c_scl),
1343	MSM_PIN_FUNCTION(cci_i2c_sda),
1344	MSM_PIN_FUNCTION(cci_timer),
1345	MSM_PIN_FUNCTION(cmu_rng),
1346	MSM_PIN_FUNCTION(coex_uart1_rx),
1347	MSM_PIN_FUNCTION(coex_uart1_tx),
1348	MSM_PIN_FUNCTION(coex_uart2_rx),
1349	MSM_PIN_FUNCTION(coex_uart2_tx),
1350	MSM_PIN_FUNCTION(cri_trng),
1351	MSM_PIN_FUNCTION(dbg_out_clk),
1352	MSM_PIN_FUNCTION(ddr_bist_complete),
1353	MSM_PIN_FUNCTION(ddr_bist_fail),
1354	MSM_PIN_FUNCTION(ddr_bist_start),
1355	MSM_PIN_FUNCTION(ddr_bist_stop),
1356	MSM_PIN_FUNCTION(ddr_pxi0),
1357	MSM_PIN_FUNCTION(ddr_pxi1),
1358	MSM_PIN_FUNCTION(ddr_pxi2),
1359	MSM_PIN_FUNCTION(ddr_pxi3),
1360	MSM_PIN_FUNCTION(do_not),
1361	MSM_PIN_FUNCTION(dp_hot),
1362	MSM_PIN_FUNCTION(egpio),
1363	MSM_PIN_FUNCTION(gcc_gp1),
1364	MSM_PIN_FUNCTION(gcc_gp2),
1365	MSM_PIN_FUNCTION(gcc_gp3),
1366	MSM_PIN_FUNCTION(gnss_adc0),
1367	MSM_PIN_FUNCTION(gnss_adc1),
1368	MSM_PIN_FUNCTION(i2chub0_se0),
1369	MSM_PIN_FUNCTION(i2chub0_se1),
1370	MSM_PIN_FUNCTION(i2chub0_se2),
1371	MSM_PIN_FUNCTION(i2chub0_se3),
1372	MSM_PIN_FUNCTION(i2chub0_se4),
1373	MSM_PIN_FUNCTION(i2chub0_se5),
1374	MSM_PIN_FUNCTION(i2chub0_se6),
1375	MSM_PIN_FUNCTION(i2chub0_se7),
1376	MSM_PIN_FUNCTION(i2chub0_se8),
1377	MSM_PIN_FUNCTION(i2chub0_se9),
1378	MSM_PIN_FUNCTION(i2s0_data0),
1379	MSM_PIN_FUNCTION(i2s0_data1),
1380	MSM_PIN_FUNCTION(i2s0_sck),
1381	MSM_PIN_FUNCTION(i2s0_ws),
1382	MSM_PIN_FUNCTION(i2s1_data0),
1383	MSM_PIN_FUNCTION(i2s1_data1),
1384	MSM_PIN_FUNCTION(i2s1_sck),
1385	MSM_PIN_FUNCTION(i2s1_ws),
1386	MSM_PIN_FUNCTION(ibi_i3c),
1387	MSM_PIN_FUNCTION(jitter_bist),
1388	MSM_PIN_FUNCTION(mdp_vsync),
1389	MSM_PIN_FUNCTION(mdp_vsync0_out),
1390	MSM_PIN_FUNCTION(mdp_vsync1_out),
1391	MSM_PIN_FUNCTION(mdp_vsync2_out),
1392	MSM_PIN_FUNCTION(mdp_vsync3_out),
1393	MSM_PIN_FUNCTION(mdp_vsync_e),
1394	MSM_PIN_FUNCTION(nav_gpio0),
1395	MSM_PIN_FUNCTION(nav_gpio1),
1396	MSM_PIN_FUNCTION(nav_gpio2),
1397	MSM_PIN_FUNCTION(nav_gpio3),
1398	MSM_PIN_FUNCTION(pcie0_clk_req_n),
1399	MSM_PIN_FUNCTION(pcie1_clk_req_n),
1400	MSM_PIN_FUNCTION(phase_flag),
1401	MSM_PIN_FUNCTION(pll_bist_sync),
1402	MSM_PIN_FUNCTION(pll_clk_aux),
1403	MSM_PIN_FUNCTION(prng_rosc0),
1404	MSM_PIN_FUNCTION(prng_rosc1),
1405	MSM_PIN_FUNCTION(prng_rosc2),
1406	MSM_PIN_FUNCTION(prng_rosc3),
1407	MSM_PIN_FUNCTION(qdss_cti),
1408	MSM_PIN_FUNCTION(qdss_gpio),
1409	MSM_PIN_FUNCTION(qlink_big_enable),
1410	MSM_PIN_FUNCTION(qlink_big_request),
1411	MSM_PIN_FUNCTION(qlink_little_enable),
1412	MSM_PIN_FUNCTION(qlink_little_request),
1413	MSM_PIN_FUNCTION(qlink_wmss),
1414	MSM_PIN_FUNCTION(qspi0),
1415	MSM_PIN_FUNCTION(qspi1),
1416	MSM_PIN_FUNCTION(qspi2),
1417	MSM_PIN_FUNCTION(qspi3),
1418	MSM_PIN_FUNCTION(qspi_clk),
1419	MSM_PIN_FUNCTION(qspi_cs),
1420	MSM_PIN_FUNCTION(qup1_se0),
1421	MSM_PIN_FUNCTION(qup1_se1),
1422	MSM_PIN_FUNCTION(qup1_se2),
1423	MSM_PIN_FUNCTION(qup1_se3),
1424	MSM_PIN_FUNCTION(qup1_se4),
1425	MSM_PIN_FUNCTION(qup1_se5),
1426	MSM_PIN_FUNCTION(qup1_se6),
1427	MSM_PIN_FUNCTION(qup1_se7),
1428	MSM_PIN_FUNCTION(qup2_se0),
1429	MSM_PIN_FUNCTION(qup2_se1),
1430	MSM_PIN_FUNCTION(qup2_se2),
1431	MSM_PIN_FUNCTION(qup2_se3),
1432	MSM_PIN_FUNCTION(qup2_se4),
1433	MSM_PIN_FUNCTION(qup2_se5),
1434	MSM_PIN_FUNCTION(qup2_se6),
1435	MSM_PIN_FUNCTION(qup2_se7),
1436	MSM_PIN_FUNCTION(sd_write_protect),
1437	MSM_PIN_FUNCTION(sdc40),
1438	MSM_PIN_FUNCTION(sdc41),
1439	MSM_PIN_FUNCTION(sdc42),
1440	MSM_PIN_FUNCTION(sdc43),
1441	MSM_PIN_FUNCTION(sdc4_clk),
1442	MSM_PIN_FUNCTION(sdc4_cmd),
1443	MSM_PIN_FUNCTION(tb_trig_sdc2),
1444	MSM_PIN_FUNCTION(tb_trig_sdc4),
1445	MSM_PIN_FUNCTION(tgu_ch0_trigout),
1446	MSM_PIN_FUNCTION(tgu_ch1_trigout),
1447	MSM_PIN_FUNCTION(tgu_ch2_trigout),
1448	MSM_PIN_FUNCTION(tgu_ch3_trigout),
1449	MSM_PIN_FUNCTION(tmess_prng0),
1450	MSM_PIN_FUNCTION(tmess_prng1),
1451	MSM_PIN_FUNCTION(tmess_prng2),
1452	MSM_PIN_FUNCTION(tmess_prng3),
1453	MSM_PIN_FUNCTION(tsense_pwm1),
1454	MSM_PIN_FUNCTION(tsense_pwm2),
1455	MSM_PIN_FUNCTION(tsense_pwm3),
1456	MSM_PIN_FUNCTION(uim0_clk),
1457	MSM_PIN_FUNCTION(uim0_data),
1458	MSM_PIN_FUNCTION(uim0_present),
1459	MSM_PIN_FUNCTION(uim0_reset),
1460	MSM_PIN_FUNCTION(uim1_clk),
1461	MSM_PIN_FUNCTION(uim1_data),
1462	MSM_PIN_FUNCTION(uim1_present),
1463	MSM_PIN_FUNCTION(uim1_reset),
1464	MSM_PIN_FUNCTION(usb1_hs),
1465	MSM_PIN_FUNCTION(usb_phy),
1466	MSM_PIN_FUNCTION(vfr_0),
1467	MSM_PIN_FUNCTION(vfr_1),
1468	MSM_PIN_FUNCTION(vsense_trigger_mirnat),
1469};
1470
1471/*
1472 * Every pin is maintained as a single group, and missing or non-existing pin
1473 * would be maintained as dummy group to synchronize pin group index with
1474 * pin descriptor registered with pinctrl core.
1475 * Clients would not be able to request these dummy pin groups.
1476 */
1477static const struct msm_pingroup sm8650_groups[] = {
1478	[0] = PINGROUP(0, qup2_se0, ibi_i3c, phase_flag, _, _, _, _, _, _, egpio),
1479	[1] = PINGROUP(1, qup2_se0, ibi_i3c, phase_flag, _, _, _, _, _, _, egpio),
1480	[2] = PINGROUP(2, qup2_se0, _, _, _, _, _, _, _, _, egpio),
1481	[3] = PINGROUP(3, qup2_se0, phase_flag, _, qdss_gpio, _, _, _, _, _, egpio),
1482	[4] = PINGROUP(4, qup2_se1, ibi_i3c, phase_flag, _, _, _, _, _, _, egpio),
1483	[5] = PINGROUP(5, qup2_se1, ibi_i3c, phase_flag, _, _, _, _, _, _, egpio),
1484	[6] = PINGROUP(6, qup2_se1, _, _, _, _, _, _, _, _, egpio),
1485	[7] = PINGROUP(7, qup2_se1, phase_flag, _, qdss_gpio, _, _, _, _, _, egpio),
1486	[8] = PINGROUP(8, qup2_se2, ibi_i3c, tb_trig_sdc2, phase_flag, tgu_ch0_trigout, _, qdss_gpio, _, _, _),
1487	[9] = PINGROUP(9, qup2_se2, ibi_i3c, phase_flag, tgu_ch1_trigout, _, _, _, _, _, _),
1488	[10] = PINGROUP(10, qup2_se2, cci_timer, tgu_ch2_trigout, _, _, _, _, _, _, _),
1489	[11] = PINGROUP(11, qup2_se2, cci_timer, phase_flag, tgu_ch3_trigout, _, _, _, _, _, _),
1490	[12] = PINGROUP(12, qup2_se3, cci_i2c_sda, ibi_i3c, qup2_se2, phase_flag, _, _, _, _, _),
1491	[13] = PINGROUP(13, qup2_se3, cci_i2c_scl, ibi_i3c, qup2_se2, phase_flag, _, qdss_gpio, _, _, _),
1492	[14] = PINGROUP(14, qup2_se3, _, _, _, _, _, _, _, _, _),
1493	[15] = PINGROUP(15, qup2_se3, cci_async_in, qup2_se2, phase_flag, _, qdss_gpio, _, _, _, _),
1494	[16] = PINGROUP(16, qup2_se4, phase_flag, _, _, _, _, _, _, _, _),
1495	[17] = PINGROUP(17, qup2_se4, phase_flag, _, _, _, _, _, _, _, _),
1496	[18] = PINGROUP(18, qup2_se4, _, _, _, _, _, _, _, _, _),
1497	[19] = PINGROUP(19, qup2_se4, phase_flag, _, _, _, _, _, _, _, _),
1498	[20] = PINGROUP(20, qup2_se5, _, _, _, _, _, _, _, _, _),
1499	[21] = PINGROUP(21, qup2_se5, _, _, _, _, _, _, _, _, _),
1500	[22] = PINGROUP(22, qup2_se5, _, _, _, _, _, _, _, _, _),
1501	[23] = PINGROUP(23, qup2_se5, qup2_se5, _, _, _, _, _, _, _, _),
1502	[24] = PINGROUP(24, qup2_se6, _, _, _, _, _, _, _, _, _),
1503	[25] = PINGROUP(25, qup2_se6, _, _, _, _, _, _, _, _, _),
1504	[26] = PINGROUP(26, qup2_se6, _, _, _, _, _, _, _, _, _),
1505	[27] = PINGROUP(27, qup2_se6, qdss_cti, _, _, _, _, _, _, _, _),
1506	[28] = PINGROUP(28, qup2_se7, _, _, _, _, _, _, _, _, _),
1507	[29] = PINGROUP(29, qup2_se7, usb_phy, _, _, _, _, _, _, _, _),
1508	[30] = PINGROUP(30, qup2_se7, _, _, _, _, _, _, _, _, _),
1509	[31] = PINGROUP(31, qup2_se7, qdss_cti, _, _, _, _, _, _, _, _),
1510	[32] = PINGROUP(32, qup1_se0, ibi_i3c, _, _, _, _, _, _, _, _),
1511	[33] = PINGROUP(33, qup1_se0, ibi_i3c, _, _, _, _, _, _, _, _),
1512	[34] = PINGROUP(34, qup1_se0, _, _, _, _, _, _, _, _, _),
1513	[35] = PINGROUP(35, qup1_se0, _, _, _, _, _, _, _, _, _),
1514	[36] = PINGROUP(36, qup1_se1, do_not, ibi_i3c, _, _, _, _, _, _, _),
1515	[37] = PINGROUP(37, qup1_se1, do_not, ibi_i3c, _, _, _, _, _, _, _),
1516	[38] = PINGROUP(38, qup1_se1, do_not, _, _, _, _, _, _, _, _),
1517	[39] = PINGROUP(39, qup1_se1, do_not, _, _, _, _, _, _, _, _),
1518	[40] = PINGROUP(40, qup1_se2, ddr_bist_fail, _, _, _, _, _, _, _, _),
1519	[41] = PINGROUP(41, qup1_se2, ddr_bist_start, _, _, _, _, _, _, _, _),
1520	[42] = PINGROUP(42, qup1_se2, _, _, _, _, _, _, _, _, _),
1521	[43] = PINGROUP(43, qup1_se2, _, _, _, _, _, _, _, _, _),
1522	[44] = PINGROUP(44, qup1_se3, qup1_se2, ddr_bist_complete, ddr_pxi1, _, _, _, _, _, _),
1523	[45] = PINGROUP(45, qup1_se3, qup1_se2, ddr_bist_stop, ddr_pxi1, _, _, _, _, _, _),
1524	[46] = PINGROUP(46, qup1_se3, qup1_se2, ddr_pxi3, _, _, _, _, _, _, _),
1525	[47] = PINGROUP(47, qup1_se3, uim0_present, dp_hot, ddr_pxi3, _, _, _, _, _, _),
1526	[48] = PINGROUP(48, qup1_se4, ibi_i3c, _, _, _, _, _, _, _, _),
1527	[49] = PINGROUP(49, qup1_se4, ibi_i3c, _, _, _, _, _, _, _, _),
1528	[50] = PINGROUP(50, qup1_se4, aoss_cti, _, _, _, _, _, _, _, _),
1529	[51] = PINGROUP(51, qup1_se4, aoss_cti, ddr_pxi2, _, _, _, _, _, _, _),
1530	[52] = PINGROUP(52, qup1_se5, _, _, _, _, _, _, _, _, _),
1531	[53] = PINGROUP(53, qup1_se5, _, _, _, _, _, _, _, _, _),
1532	[54] = PINGROUP(54, qup1_se5, usb_phy, _, _, _, _, _, _, _, _),
1533	[55] = PINGROUP(55, qup1_se5, _, _, _, _, _, _, _, _, _),
1534	[56] = PINGROUP(56, qup1_se6, ibi_i3c, qspi2, sdc42, _, _, _, _, _, _),
1535	[57] = PINGROUP(57, qup1_se6, ibi_i3c, qspi3, sdc43, _, _, _, _, _, _),
1536	[58] = PINGROUP(58, qup1_se6, qspi_cs, tb_trig_sdc4, tsense_pwm1, tsense_pwm2, tsense_pwm3, _, _, _, _),
1537	[59] = PINGROUP(59, qup1_se6, _, qspi_cs, sdc4_cmd, _, _, _, _, _, _),
1538	[60] = PINGROUP(60, qup1_se7, aoss_cti, vsense_trigger_mirnat, _, _, _, _, _, _, _),
1539	[61] = PINGROUP(61, qup1_se7, aoss_cti, _, _, _, _, _, _, _, _),
1540	[62] = PINGROUP(62, qup1_se7, ddr_pxi2, _, _, _, _, _, _, _, _),
1541	[63] = PINGROUP(63, qup1_se7, _, _, _, _, _, _, _, _, _),
1542	[64] = PINGROUP(64, i2chub0_se0, _, _, _, _, _, _, _, _, _),
1543	[65] = PINGROUP(65, i2chub0_se0, _, _, _, _, _, _, _, _, _),
1544	[66] = PINGROUP(66, i2chub0_se1, _, _, _, _, _, _, _, _, _),
1545	[67] = PINGROUP(67, i2chub0_se1, _, _, _, _, _, _, _, _, _),
1546	[68] = PINGROUP(68, i2chub0_se2, pll_bist_sync, _, _, _, _, _, _, _, _),
1547	[69] = PINGROUP(69, i2chub0_se2, _, _, _, _, _, _, _, _, _),
1548	[70] = PINGROUP(70, i2chub0_se3, _, _, _, _, _, _, _, _, _),
1549	[71] = PINGROUP(71, i2chub0_se3, _, atest_usb, _, _, _, _, _, _, _),
1550	[72] = PINGROUP(72, i2chub0_se4, _, atest_usb, _, _, _, _, _, _, _),
1551	[73] = PINGROUP(73, i2chub0_se4, jitter_bist, _, _, _, _, _, _, _, _),
1552	[74] = PINGROUP(74, i2chub0_se5, atest_usb, _, _, _, _, _, _, _, _),
1553	[75] = PINGROUP(75, i2chub0_se5, ddr_pxi0, _, _, _, _, _, _, _, _),
1554	[76] = PINGROUP(76, i2chub0_se6, ddr_pxi0, uim1_present, _, _, _, _, _, _, _),
1555	[77] = PINGROUP(77, i2chub0_se6, _, _, _, _, _, _, _, _, _),
1556	[78] = PINGROUP(78, i2chub0_se7, qdss_cti, _, _, _, _, _, _, _, _),
1557	[79] = PINGROUP(79, i2chub0_se7, qdss_cti, _, _, _, _, _, _, _, _),
1558	[80] = PINGROUP(80, i2chub0_se9, _, _, _, _, _, _, _, _, _),
1559	[81] = PINGROUP(81, i2chub0_se9, _, _, _, _, _, _, _, _, _),
1560	[82] = PINGROUP(82, qdss_cti, _, _, _, _, _, _, _, _, _),
1561	[83] = PINGROUP(83, qdss_cti, _, _, _, _, _, _, _, _, _),
1562	[84] = PINGROUP(84, _, _, _, _, _, _, _, _, _, _),
1563	[85] = PINGROUP(85, _, _, _, _, _, _, _, _, _, _),
1564	[86] = PINGROUP(86, mdp_vsync, mdp_vsync0_out, mdp_vsync1_out, gcc_gp1, _, _, _, _, _, _),
1565	[87] = PINGROUP(87, mdp_vsync, mdp_vsync2_out, mdp_vsync3_out, gcc_gp2, _, _, _, _, _, _),
1566	[88] = PINGROUP(88, mdp_vsync_e, gcc_gp3, _, _, _, _, _, _, _, _),
1567	[89] = PINGROUP(89, usb1_hs, gnss_adc0, _, _, _, _, _, _, _, _),
1568	[90] = PINGROUP(90, gnss_adc1, _, _, _, _, _, _, _, _, _),
1569	[91] = PINGROUP(91, _, gnss_adc0, _, _, _, _, _, _, _, _),
1570	[92] = PINGROUP(92, dbg_out_clk, gnss_adc1, _, _, _, _, _, _, _, _),
1571	[93] = PINGROUP(93, sd_write_protect, _, _, _, _, _, _, _, _, _),
1572	[94] = PINGROUP(94, cmu_rng, phase_flag, tmess_prng0, _, _, _, _, _, _, _),
1573	[95] = PINGROUP(95, pcie0_clk_req_n, cmu_rng, phase_flag, tmess_prng1, _, _, _, _, _, _),
1574	[96] = PINGROUP(96, cmu_rng, phase_flag, tmess_prng2, _, _, _, _, _, _, _),
1575	[97] = PINGROUP(97, _, _, _, _, _, _, _, _, _, _),
1576	[98] = PINGROUP(98, pcie1_clk_req_n, _, _, _, _, _, _, _, _, _),
1577	[99] = PINGROUP(99, _, _, _, _, _, _, _, _, _, _),
1578	[100] = PINGROUP(100, cam_mclk, qdss_gpio, _, _, _, _, _, _, _, _),
1579	[101] = PINGROUP(101, cam_mclk, qdss_gpio, _, _, _, _, _, _, _, _),
1580	[102] = PINGROUP(102, cam_aon_mclk2, qdss_gpio, _, _, _, _, _, _, _, _),
1581	[103] = PINGROUP(103, cam_mclk, qdss_gpio, _, _, _, _, _, _, _, _),
1582	[104] = PINGROUP(104, cam_aon_mclk4, qdss_gpio, _, _, _, _, _, _, _, _),
1583	[105] = PINGROUP(105, cam_mclk, qdss_gpio, _, _, _, _, _, _, _, _),
1584	[106] = PINGROUP(106, cam_mclk, pll_clk_aux, _, _, _, _, _, _, _, _),
1585	[107] = PINGROUP(107, _, _, _, _, _, _, _, _, _, _),
1586	[108] = PINGROUP(108, cam_mclk, _, _, _, _, _, _, _, _, _),
1587	[109] = PINGROUP(109, cci_timer, phase_flag, tmess_prng3, _, _, _, _, _, _, _),
1588	[110] = PINGROUP(110, cci_timer, _, _, _, _, _, _, _, _, _),
1589	[111] = PINGROUP(111, cci_timer, phase_flag, _, _, _, _, _, _, _, _),
1590	[112] = PINGROUP(112, cci_i2c_sda, cmu_rng, phase_flag, _, _, _, _, _, _, _),
1591	[113] = PINGROUP(113, cci_i2c_sda, phase_flag, _, qdss_gpio, _, _, _, _, _, _),
1592	[114] = PINGROUP(114, cci_i2c_scl, phase_flag, _, qdss_gpio, _, _, _, _, _, _),
1593	[115] = PINGROUP(115, cci_i2c_sda, phase_flag, _, qdss_gpio, _, _, _, _, _, _),
1594	[116] = PINGROUP(116, cci_i2c_scl, phase_flag, _, qdss_gpio, _, _, _, _, _, _),
1595	[117] = PINGROUP(117, cci_i2c_sda, phase_flag, _, qdss_gpio, _, _, _, _, _, _),
1596	[118] = PINGROUP(118, cci_i2c_scl, phase_flag, _, qdss_gpio, _, _, _, _, _, _),
1597	[119] = PINGROUP(119, cci_i2c_sda, phase_flag, _, _, _, _, _, _, _, _),
1598	[120] = PINGROUP(120, cci_i2c_scl, phase_flag, _, _, _, _, _, _, _, _),
1599	[121] = PINGROUP(121, i2s1_sck, _, _, _, _, _, _, _, _, _),
1600	[122] = PINGROUP(122, i2s1_data0, cmu_rng, _, _, _, _, _, _, _, _),
1601	[123] = PINGROUP(123, i2s1_ws, _, _, _, _, _, _, _, _, _),
1602	[124] = PINGROUP(124, i2s1_data1, audio_ext_mclk1, audio_ref_clk, _, _, _, _, _, _, _),
1603	[125] = PINGROUP(125, audio_ext_mclk0, _, _, _, _, _, _, _, _, _),
1604	[126] = PINGROUP(126, i2s0_sck, _, _, _, _, _, _, _, _, _),
1605	[127] = PINGROUP(127, i2s0_data0, cmu_rng, _, _, _, _, _, _, _, _),
1606	[128] = PINGROUP(128, i2s0_data1, cmu_rng, _, _, _, _, _, _, _, _),
1607	[129] = PINGROUP(129, i2s0_ws, cmu_rng, _, _, _, _, _, _, _, _),
1608	[130] = PINGROUP(130, uim0_data, atest_usb, atest_char, _, _, _, _, _, _, _),
1609	[131] = PINGROUP(131, uim0_clk, atest_usb, atest_char, _, _, _, _, _, _, _),
1610	[132] = PINGROUP(132, uim0_reset, atest_char, _, _, _, _, _, _, _, _),
1611	[133] = PINGROUP(133, mdp_vsync, atest_char, _, _, _, _, _, _, _, _),
1612	[134] = PINGROUP(134, uim1_data, do_not, qspi0, sdc40, gcc_gp1, _, _, _, _, _),
1613	[135] = PINGROUP(135, uim1_clk, do_not, qspi_clk, sdc4_clk, gcc_gp2, _, _, _, _, _),
1614	[136] = PINGROUP(136, uim1_reset, do_not, qspi1, sdc41, gcc_gp3, _, _, _, _, _),
1615	[137] = PINGROUP(137, mdp_vsync, atest_char, _, _, _, _, _, _, _, _),
1616	[138] = PINGROUP(138, _, _, _, _, _, _, _, _, _, _),
1617	[139] = PINGROUP(139, _, _, _, _, _, _, _, _, _, _),
1618	[140] = PINGROUP(140, _, _, qdss_gpio, _, _, _, _, _, _, _),
1619	[141] = PINGROUP(141, _, _, qdss_gpio, _, _, _, _, _, _, _),
1620	[142] = PINGROUP(142, _, _, qdss_gpio, _, _, _, _, _, _, _),
1621	[143] = PINGROUP(143, _, _, qdss_gpio, _, _, _, _, _, _, _),
1622	[144] = PINGROUP(144, _, qdss_gpio, _, _, _, _, _, _, _, _),
1623	[145] = PINGROUP(145, _, qdss_gpio, _, _, _, _, _, _, _, _),
1624	[146] = PINGROUP(146, _, qdss_gpio, _, _, _, _, _, _, _, _),
1625	[147] = PINGROUP(147, _, qdss_gpio, _, _, _, _, _, _, _, _),
1626	[148] = PINGROUP(148, coex_uart1_rx, qdss_gpio, _, _, _, _, _, _, _, _),
1627	[149] = PINGROUP(149, coex_uart1_tx, qdss_gpio, _, _, _, _, _, _, _, _),
1628	[150] = PINGROUP(150, _, vfr_0, coex_uart2_rx, qdss_gpio, _, _, _, _, _, _),
1629	[151] = PINGROUP(151, _, coex_uart2_tx, qdss_gpio, _, _, _, _, _, _, _),
1630	[152] = PINGROUP(152, nav_gpio2, _, qdss_gpio, _, _, _, _, _, _, _),
1631	[153] = PINGROUP(153, cci_i2c_scl, phase_flag, _, qdss_gpio, _, _, _, _, _, _),
1632	[154] = PINGROUP(154, nav_gpio0, nav_gpio3, qdss_gpio, _, _, _, _, _, _, _),
1633	[155] = PINGROUP(155, nav_gpio1, vfr_1, qdss_gpio, _, _, _, _, _, _, _),
1634	[156] = PINGROUP(156, qlink_little_request, qdss_gpio, _, _, _, _, _, _, _, _),
1635	[157] = PINGROUP(157, qlink_little_enable, qdss_gpio, _, _, _, _, _, _, _, _),
1636	[158] = PINGROUP(158, qlink_wmss, qdss_gpio, _, _, _, _, _, _, _, _),
1637	[159] = PINGROUP(159, qlink_big_request, qdss_cti, _, _, _, _, _, _, _, _),
1638	[160] = PINGROUP(160, qlink_big_enable, _, _, _, _, _, _, _, _, _),
1639	[161] = PINGROUP(161, _, _, _, _, _, _, _, _, _, _),
1640	[162] = PINGROUP(162, qdss_cti, _, _, _, _, _, _, _, _, _),
1641	[163] = PINGROUP(163, cci_async_in, phase_flag, _, _, _, _, _, _, _, _),
1642	[164] = PINGROUP(164, cci_async_in, phase_flag, _, _, _, _, _, _, _, _),
1643	[165] = PINGROUP(165, _, _, _, _, _, _, _, _, _, egpio),
1644	[166] = PINGROUP(166, _, _, _, _, _, _, _, _, _, egpio),
1645	[167] = PINGROUP(167, _, _, _, _, _, _, _, _, _, egpio),
1646	[168] = PINGROUP(168, _, _, _, _, _, _, _, _, _, egpio),
1647	[169] = PINGROUP(169, _, _, _, _, _, _, _, _, _, egpio),
1648	[170] = PINGROUP(170, _, _, _, _, _, _, _, _, _, egpio),
1649	[171] = PINGROUP(171, _, _, _, _, _, _, _, _, _, egpio),
1650	[172] = PINGROUP(172, _, _, _, _, _, _, _, _, _, egpio),
1651	[173] = PINGROUP(173, _, _, _, _, _, _, _, _, _, egpio),
1652	[174] = PINGROUP(174, _, _, _, _, _, _, _, _, _, egpio),
1653	[175] = PINGROUP(175, _, _, _, _, _, _, _, _, _, egpio),
1654	[176] = PINGROUP(176, _, _, _, _, _, _, _, _, _, egpio),
1655	[177] = PINGROUP(177, _, _, _, _, _, _, _, _, _, egpio),
1656	[178] = PINGROUP(178, _, _, _, _, _, _, _, _, _, egpio),
1657	[179] = PINGROUP(179, _, _, _, _, _, _, _, _, _, egpio),
1658	[180] = PINGROUP(180, _, _, _, _, _, _, _, _, _, egpio),
1659	[181] = PINGROUP(181, prng_rosc3, _, _, _, _, _, _, _, _, egpio),
1660	[182] = PINGROUP(182, prng_rosc2, _, _, _, _, _, _, _, _, egpio),
1661	[183] = PINGROUP(183, prng_rosc1, _, _, _, _, _, _, _, _, egpio),
1662	[184] = PINGROUP(184, _, _, _, _, _, _, _, _, _, egpio),
1663	[185] = PINGROUP(185, _, _, _, _, _, _, _, _, _, egpio),
1664	[186] = PINGROUP(186, prng_rosc0, _, _, _, _, _, _, _, _, egpio),
1665	[187] = PINGROUP(187, cri_trng, _, _, _, _, _, _, _, _, egpio),
1666	[188] = PINGROUP(188, _, _, _, _, _, _, _, _, _, egpio),
1667	[189] = PINGROUP(189, _, _, _, _, _, _, _, _, _, egpio),
1668	[190] = PINGROUP(190, _, _, _, _, _, _, _, _, _, egpio),
1669	[191] = PINGROUP(191, _, _, _, _, _, _, _, _, _, egpio),
1670	[192] = PINGROUP(192, _, _, _, _, _, _, _, _, _, egpio),
1671	[193] = PINGROUP(193, _, _, _, _, _, _, _, _, _, egpio),
1672	[194] = PINGROUP(194, _, _, _, _, _, _, _, _, _, egpio),
1673	[195] = PINGROUP(195, _, _, _, _, _, _, _, _, _, egpio),
1674	[196] = PINGROUP(196, _, _, _, _, _, _, _, _, _, egpio),
1675	[197] = PINGROUP(197, _, _, _, _, _, _, _, _, _, egpio),
1676	[198] = PINGROUP(198, _, _, _, _, _, _, _, _, _, egpio),
1677	[199] = PINGROUP(199, _, _, _, _, _, _, _, _, _, egpio),
1678	[200] = PINGROUP(200, _, _, _, _, _, _, _, _, _, egpio),
1679	[201] = PINGROUP(201, _, _, _, _, _, _, _, _, _, egpio),
1680	[202] = PINGROUP(202, _, _, _, _, _, _, _, _, _, egpio),
1681	[203] = PINGROUP(203, _, _, _, _, _, _, _, _, _, egpio),
1682	[204] = PINGROUP(204, _, _, _, _, _, _, _, _, _, egpio),
1683	[205] = PINGROUP(205, _, _, _, _, _, _, _, _, _, egpio),
1684	[206] = PINGROUP(206, i2chub0_se8, _, _, _, _, _, _, _, _, egpio),
1685	[207] = PINGROUP(207, i2chub0_se8, _, _, _, _, _, _, _, _, egpio),
1686	[208] = PINGROUP(208, _, _, _, _, _, _, _, _, _, egpio),
1687	[209] = PINGROUP(209, _, _, _, _, _, _, _, _, _, egpio),
1688	[210] = UFS_RESET(ufs_reset, 0xde004, 0xdf000),
1689	[211] = SDC_QDSD_PINGROUP(sdc2_clk, 0xd6000, 14, 6),
1690	[212] = SDC_QDSD_PINGROUP(sdc2_cmd, 0xd6000, 11, 3),
1691	[213] = SDC_QDSD_PINGROUP(sdc2_data, 0xd6000, 9, 0),
1692};
1693
1694static const struct msm_gpio_wakeirq_map sm8650_pdc_map[] = {
1695	{ 0, 94 },    { 3, 105 },   { 4, 78 },    { 7, 67 },    { 8, 64 },
1696	{ 11, 121 },  { 12, 71 },   { 15, 82 },   { 18, 75 },   { 19, 63 },
1697	{ 20, 114 },  { 23, 84 },   { 27, 61 },   { 29, 112 },  { 31, 113 },
1698	{ 32, 66 },   { 35, 52 },   { 36, 123 },  { 39, 56 },   { 43, 59 },
1699	{ 46, 79 },   { 47, 124 },  { 48, 125 },  { 51, 93 },   { 54, 60 },
1700	{ 55, 104 },  { 56, 72 },   { 57, 77 },   { 59, 51 },   { 63, 85 },
1701	{ 64, 107 },  { 65, 108 },  { 66, 109 },  { 67, 83 },   { 68, 110 },
1702	{ 69, 111 },  { 75, 96 },   { 76, 97 },   { 77, 98 },   { 80, 89 },
1703	{ 81, 90 },   { 84, 106 },  { 85, 100 },  { 86, 87 },   { 87, 88 },
1704	{ 88, 65 },   { 90, 92 },   { 92, 99 },   { 95, 118 },  { 96, 119 },
1705	{ 98, 101 },  { 99, 62 },   { 112, 120 }, { 133, 80 },  { 136, 69 },
1706	{ 137, 81 },  { 148, 57 },  { 150, 58 },  { 152, 127 }, { 153, 74 },
1707	{ 154, 126 }, { 155, 73 },  { 156, 128 }, { 159, 129 }, { 162, 86 },
1708	{ 163, 122 }, { 166, 139 }, { 169, 140 }, { 171, 141 }, { 172, 142 },
1709	{ 174, 102 }, { 176, 143 }, { 177, 55 },  { 181, 144 }, { 182, 145 },
1710	{ 185, 146 }, { 187, 95 },  { 188, 130 }, { 190, 131 }, { 191, 132 },
1711	{ 192, 133 }, { 193, 134 }, { 195, 68 },  { 196, 135 }, { 197, 136 },
1712	{ 198, 54 },  { 199, 103 }, { 200, 53 },  { 201, 137 }, { 202, 70 },
1713	{ 203, 138 }, { 204, 76 },  { 205, 91 },
1714};
1715
1716static const struct msm_pinctrl_soc_data sm8650_tlmm = {
1717	.pins = sm8650_pins,
1718	.npins = ARRAY_SIZE(sm8650_pins),
1719	.functions = sm8650_functions,
1720	.nfunctions = ARRAY_SIZE(sm8650_functions),
1721	.groups = sm8650_groups,
1722	.ngroups = ARRAY_SIZE(sm8650_groups),
1723	.ngpios = 211,
1724	.wakeirq_map = sm8650_pdc_map,
1725	.nwakeirq_map = ARRAY_SIZE(sm8650_pdc_map),
1726	.egpio_func = 10,
1727};
1728
1729static int sm8650_tlmm_probe(struct platform_device *pdev)
1730{
1731	return msm_pinctrl_probe(pdev, &sm8650_tlmm);
1732}
1733
1734static const struct of_device_id sm8650_tlmm_of_match[] = {
1735	{ .compatible = "qcom,sm8650-tlmm", },
1736	{},
1737};
1738
1739static struct platform_driver sm8650_tlmm_driver = {
1740	.driver = {
1741		.name = "sm8650-tlmm",
1742		.of_match_table = sm8650_tlmm_of_match,
1743	},
1744	.probe = sm8650_tlmm_probe,
1745	.remove_new = msm_pinctrl_remove,
1746};
1747
1748static int __init sm8650_tlmm_init(void)
1749{
1750	return platform_driver_register(&sm8650_tlmm_driver);
1751}
1752arch_initcall(sm8650_tlmm_init);
1753
1754static void __exit sm8650_tlmm_exit(void)
1755{
1756	platform_driver_unregister(&sm8650_tlmm_driver);
1757}
1758module_exit(sm8650_tlmm_exit);
1759
1760MODULE_DESCRIPTION("QTI SM8650 TLMM driver");
1761MODULE_LICENSE("GPL");
1762MODULE_DEVICE_TABLE(of, sm8650_tlmm_of_match);
1763