1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
4  * Copyright (C) 2022, Kernkonzept GmbH.
5  */
6 
7 #include <linux/module.h>
8 #include <linux/of.h>
9 #include <linux/platform_device.h>
10 #include <linux/pinctrl/pinctrl.h>
11 
12 #include "pinctrl-msm.h"
13 
14 #define FUNCTION(fname)					\
15 	[msm_mux_##fname] = {				\
16 		.name = #fname,				\
17 		.groups = fname##_groups,		\
18 		.ngroups = ARRAY_SIZE(fname##_groups),	\
19 	}
20 
21 #define REG_SIZE 0x1000
22 #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9)	\
23 	{						\
24 		.name = "gpio" #id,			\
25 		.pins = gpio##id##_pins,		\
26 		.npins = ARRAY_SIZE(gpio##id##_pins),	\
27 		.funcs = (int[]){			\
28 			msm_mux_gpio,			\
29 			msm_mux_##f1,			\
30 			msm_mux_##f2,			\
31 			msm_mux_##f3,			\
32 			msm_mux_##f4,			\
33 			msm_mux_##f5,			\
34 			msm_mux_##f6,			\
35 			msm_mux_##f7,			\
36 			msm_mux_##f8,			\
37 			msm_mux_##f9,			\
38 		},					\
39 		.nfuncs = 10,				\
40 		.ctl_reg = REG_SIZE * id,		\
41 		.io_reg = 0x4 + REG_SIZE * id,		\
42 		.intr_cfg_reg = 0x8 + REG_SIZE * id,	\
43 		.intr_status_reg = 0xc + REG_SIZE * id,	\
44 		.intr_target_reg = 0x8 + REG_SIZE * id,	\
45 		.mux_bit = 2,				\
46 		.pull_bit = 0,				\
47 		.drv_bit = 6,				\
48 		.oe_bit = 9,				\
49 		.in_bit = 0,				\
50 		.out_bit = 1,				\
51 		.intr_enable_bit = 0,			\
52 		.intr_status_bit = 0,			\
53 		.intr_target_bit = 5,			\
54 		.intr_target_kpss_val = 4,		\
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 		.name = #pg_name,			\
64 		.pins = pg_name##_pins,			\
65 		.npins = 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 static const struct pinctrl_pin_desc msm8909_pins[] = {
86 	PINCTRL_PIN(0, "GPIO_0"),
87 	PINCTRL_PIN(1, "GPIO_1"),
88 	PINCTRL_PIN(2, "GPIO_2"),
89 	PINCTRL_PIN(3, "GPIO_3"),
90 	PINCTRL_PIN(4, "GPIO_4"),
91 	PINCTRL_PIN(5, "GPIO_5"),
92 	PINCTRL_PIN(6, "GPIO_6"),
93 	PINCTRL_PIN(7, "GPIO_7"),
94 	PINCTRL_PIN(8, "GPIO_8"),
95 	PINCTRL_PIN(9, "GPIO_9"),
96 	PINCTRL_PIN(10, "GPIO_10"),
97 	PINCTRL_PIN(11, "GPIO_11"),
98 	PINCTRL_PIN(12, "GPIO_12"),
99 	PINCTRL_PIN(13, "GPIO_13"),
100 	PINCTRL_PIN(14, "GPIO_14"),
101 	PINCTRL_PIN(15, "GPIO_15"),
102 	PINCTRL_PIN(16, "GPIO_16"),
103 	PINCTRL_PIN(17, "GPIO_17"),
104 	PINCTRL_PIN(18, "GPIO_18"),
105 	PINCTRL_PIN(19, "GPIO_19"),
106 	PINCTRL_PIN(20, "GPIO_20"),
107 	PINCTRL_PIN(21, "GPIO_21"),
108 	PINCTRL_PIN(22, "GPIO_22"),
109 	PINCTRL_PIN(23, "GPIO_23"),
110 	PINCTRL_PIN(24, "GPIO_24"),
111 	PINCTRL_PIN(25, "GPIO_25"),
112 	PINCTRL_PIN(26, "GPIO_26"),
113 	PINCTRL_PIN(27, "GPIO_27"),
114 	PINCTRL_PIN(28, "GPIO_28"),
115 	PINCTRL_PIN(29, "GPIO_29"),
116 	PINCTRL_PIN(30, "GPIO_30"),
117 	PINCTRL_PIN(31, "GPIO_31"),
118 	PINCTRL_PIN(32, "GPIO_32"),
119 	PINCTRL_PIN(33, "GPIO_33"),
120 	PINCTRL_PIN(34, "GPIO_34"),
121 	PINCTRL_PIN(35, "GPIO_35"),
122 	PINCTRL_PIN(36, "GPIO_36"),
123 	PINCTRL_PIN(37, "GPIO_37"),
124 	PINCTRL_PIN(38, "GPIO_38"),
125 	PINCTRL_PIN(39, "GPIO_39"),
126 	PINCTRL_PIN(40, "GPIO_40"),
127 	PINCTRL_PIN(41, "GPIO_41"),
128 	PINCTRL_PIN(42, "GPIO_42"),
129 	PINCTRL_PIN(43, "GPIO_43"),
130 	PINCTRL_PIN(44, "GPIO_44"),
131 	PINCTRL_PIN(45, "GPIO_45"),
132 	PINCTRL_PIN(46, "GPIO_46"),
133 	PINCTRL_PIN(47, "GPIO_47"),
134 	PINCTRL_PIN(48, "GPIO_48"),
135 	PINCTRL_PIN(49, "GPIO_49"),
136 	PINCTRL_PIN(50, "GPIO_50"),
137 	PINCTRL_PIN(51, "GPIO_51"),
138 	PINCTRL_PIN(52, "GPIO_52"),
139 	PINCTRL_PIN(53, "GPIO_53"),
140 	PINCTRL_PIN(54, "GPIO_54"),
141 	PINCTRL_PIN(55, "GPIO_55"),
142 	PINCTRL_PIN(56, "GPIO_56"),
143 	PINCTRL_PIN(57, "GPIO_57"),
144 	PINCTRL_PIN(58, "GPIO_58"),
145 	PINCTRL_PIN(59, "GPIO_59"),
146 	PINCTRL_PIN(60, "GPIO_60"),
147 	PINCTRL_PIN(61, "GPIO_61"),
148 	PINCTRL_PIN(62, "GPIO_62"),
149 	PINCTRL_PIN(63, "GPIO_63"),
150 	PINCTRL_PIN(64, "GPIO_64"),
151 	PINCTRL_PIN(65, "GPIO_65"),
152 	PINCTRL_PIN(66, "GPIO_66"),
153 	PINCTRL_PIN(67, "GPIO_67"),
154 	PINCTRL_PIN(68, "GPIO_68"),
155 	PINCTRL_PIN(69, "GPIO_69"),
156 	PINCTRL_PIN(70, "GPIO_70"),
157 	PINCTRL_PIN(71, "GPIO_71"),
158 	PINCTRL_PIN(72, "GPIO_72"),
159 	PINCTRL_PIN(73, "GPIO_73"),
160 	PINCTRL_PIN(74, "GPIO_74"),
161 	PINCTRL_PIN(75, "GPIO_75"),
162 	PINCTRL_PIN(76, "GPIO_76"),
163 	PINCTRL_PIN(77, "GPIO_77"),
164 	PINCTRL_PIN(78, "GPIO_78"),
165 	PINCTRL_PIN(79, "GPIO_79"),
166 	PINCTRL_PIN(80, "GPIO_80"),
167 	PINCTRL_PIN(81, "GPIO_81"),
168 	PINCTRL_PIN(82, "GPIO_82"),
169 	PINCTRL_PIN(83, "GPIO_83"),
170 	PINCTRL_PIN(84, "GPIO_84"),
171 	PINCTRL_PIN(85, "GPIO_85"),
172 	PINCTRL_PIN(86, "GPIO_86"),
173 	PINCTRL_PIN(87, "GPIO_87"),
174 	PINCTRL_PIN(88, "GPIO_88"),
175 	PINCTRL_PIN(89, "GPIO_89"),
176 	PINCTRL_PIN(90, "GPIO_90"),
177 	PINCTRL_PIN(91, "GPIO_91"),
178 	PINCTRL_PIN(92, "GPIO_92"),
179 	PINCTRL_PIN(93, "GPIO_93"),
180 	PINCTRL_PIN(94, "GPIO_94"),
181 	PINCTRL_PIN(95, "GPIO_95"),
182 	PINCTRL_PIN(96, "GPIO_96"),
183 	PINCTRL_PIN(97, "GPIO_97"),
184 	PINCTRL_PIN(98, "GPIO_98"),
185 	PINCTRL_PIN(99, "GPIO_99"),
186 	PINCTRL_PIN(100, "GPIO_100"),
187 	PINCTRL_PIN(101, "GPIO_101"),
188 	PINCTRL_PIN(102, "GPIO_102"),
189 	PINCTRL_PIN(103, "GPIO_103"),
190 	PINCTRL_PIN(104, "GPIO_104"),
191 	PINCTRL_PIN(105, "GPIO_105"),
192 	PINCTRL_PIN(106, "GPIO_106"),
193 	PINCTRL_PIN(107, "GPIO_107"),
194 	PINCTRL_PIN(108, "GPIO_108"),
195 	PINCTRL_PIN(109, "GPIO_109"),
196 	PINCTRL_PIN(110, "GPIO_110"),
197 	PINCTRL_PIN(111, "GPIO_111"),
198 	PINCTRL_PIN(112, "GPIO_112"),
199 	PINCTRL_PIN(113, "SDC1_CLK"),
200 	PINCTRL_PIN(114, "SDC1_CMD"),
201 	PINCTRL_PIN(115, "SDC1_DATA"),
202 	PINCTRL_PIN(116, "SDC2_CLK"),
203 	PINCTRL_PIN(117, "SDC2_CMD"),
204 	PINCTRL_PIN(118, "SDC2_DATA"),
205 	PINCTRL_PIN(119, "QDSD_CLK"),
206 	PINCTRL_PIN(120, "QDSD_CMD"),
207 	PINCTRL_PIN(121, "QDSD_DATA0"),
208 	PINCTRL_PIN(122, "QDSD_DATA1"),
209 	PINCTRL_PIN(123, "QDSD_DATA2"),
210 	PINCTRL_PIN(124, "QDSD_DATA3"),
211 };
212 
213 #define DECLARE_MSM_GPIO_PINS(pin) \
214 	static const unsigned int gpio##pin##_pins[] = { pin }
215 DECLARE_MSM_GPIO_PINS(0);
216 DECLARE_MSM_GPIO_PINS(1);
217 DECLARE_MSM_GPIO_PINS(2);
218 DECLARE_MSM_GPIO_PINS(3);
219 DECLARE_MSM_GPIO_PINS(4);
220 DECLARE_MSM_GPIO_PINS(5);
221 DECLARE_MSM_GPIO_PINS(6);
222 DECLARE_MSM_GPIO_PINS(7);
223 DECLARE_MSM_GPIO_PINS(8);
224 DECLARE_MSM_GPIO_PINS(9);
225 DECLARE_MSM_GPIO_PINS(10);
226 DECLARE_MSM_GPIO_PINS(11);
227 DECLARE_MSM_GPIO_PINS(12);
228 DECLARE_MSM_GPIO_PINS(13);
229 DECLARE_MSM_GPIO_PINS(14);
230 DECLARE_MSM_GPIO_PINS(15);
231 DECLARE_MSM_GPIO_PINS(16);
232 DECLARE_MSM_GPIO_PINS(17);
233 DECLARE_MSM_GPIO_PINS(18);
234 DECLARE_MSM_GPIO_PINS(19);
235 DECLARE_MSM_GPIO_PINS(20);
236 DECLARE_MSM_GPIO_PINS(21);
237 DECLARE_MSM_GPIO_PINS(22);
238 DECLARE_MSM_GPIO_PINS(23);
239 DECLARE_MSM_GPIO_PINS(24);
240 DECLARE_MSM_GPIO_PINS(25);
241 DECLARE_MSM_GPIO_PINS(26);
242 DECLARE_MSM_GPIO_PINS(27);
243 DECLARE_MSM_GPIO_PINS(28);
244 DECLARE_MSM_GPIO_PINS(29);
245 DECLARE_MSM_GPIO_PINS(30);
246 DECLARE_MSM_GPIO_PINS(31);
247 DECLARE_MSM_GPIO_PINS(32);
248 DECLARE_MSM_GPIO_PINS(33);
249 DECLARE_MSM_GPIO_PINS(34);
250 DECLARE_MSM_GPIO_PINS(35);
251 DECLARE_MSM_GPIO_PINS(36);
252 DECLARE_MSM_GPIO_PINS(37);
253 DECLARE_MSM_GPIO_PINS(38);
254 DECLARE_MSM_GPIO_PINS(39);
255 DECLARE_MSM_GPIO_PINS(40);
256 DECLARE_MSM_GPIO_PINS(41);
257 DECLARE_MSM_GPIO_PINS(42);
258 DECLARE_MSM_GPIO_PINS(43);
259 DECLARE_MSM_GPIO_PINS(44);
260 DECLARE_MSM_GPIO_PINS(45);
261 DECLARE_MSM_GPIO_PINS(46);
262 DECLARE_MSM_GPIO_PINS(47);
263 DECLARE_MSM_GPIO_PINS(48);
264 DECLARE_MSM_GPIO_PINS(49);
265 DECLARE_MSM_GPIO_PINS(50);
266 DECLARE_MSM_GPIO_PINS(51);
267 DECLARE_MSM_GPIO_PINS(52);
268 DECLARE_MSM_GPIO_PINS(53);
269 DECLARE_MSM_GPIO_PINS(54);
270 DECLARE_MSM_GPIO_PINS(55);
271 DECLARE_MSM_GPIO_PINS(56);
272 DECLARE_MSM_GPIO_PINS(57);
273 DECLARE_MSM_GPIO_PINS(58);
274 DECLARE_MSM_GPIO_PINS(59);
275 DECLARE_MSM_GPIO_PINS(60);
276 DECLARE_MSM_GPIO_PINS(61);
277 DECLARE_MSM_GPIO_PINS(62);
278 DECLARE_MSM_GPIO_PINS(63);
279 DECLARE_MSM_GPIO_PINS(64);
280 DECLARE_MSM_GPIO_PINS(65);
281 DECLARE_MSM_GPIO_PINS(66);
282 DECLARE_MSM_GPIO_PINS(67);
283 DECLARE_MSM_GPIO_PINS(68);
284 DECLARE_MSM_GPIO_PINS(69);
285 DECLARE_MSM_GPIO_PINS(70);
286 DECLARE_MSM_GPIO_PINS(71);
287 DECLARE_MSM_GPIO_PINS(72);
288 DECLARE_MSM_GPIO_PINS(73);
289 DECLARE_MSM_GPIO_PINS(74);
290 DECLARE_MSM_GPIO_PINS(75);
291 DECLARE_MSM_GPIO_PINS(76);
292 DECLARE_MSM_GPIO_PINS(77);
293 DECLARE_MSM_GPIO_PINS(78);
294 DECLARE_MSM_GPIO_PINS(79);
295 DECLARE_MSM_GPIO_PINS(80);
296 DECLARE_MSM_GPIO_PINS(81);
297 DECLARE_MSM_GPIO_PINS(82);
298 DECLARE_MSM_GPIO_PINS(83);
299 DECLARE_MSM_GPIO_PINS(84);
300 DECLARE_MSM_GPIO_PINS(85);
301 DECLARE_MSM_GPIO_PINS(86);
302 DECLARE_MSM_GPIO_PINS(87);
303 DECLARE_MSM_GPIO_PINS(88);
304 DECLARE_MSM_GPIO_PINS(89);
305 DECLARE_MSM_GPIO_PINS(90);
306 DECLARE_MSM_GPIO_PINS(91);
307 DECLARE_MSM_GPIO_PINS(92);
308 DECLARE_MSM_GPIO_PINS(93);
309 DECLARE_MSM_GPIO_PINS(94);
310 DECLARE_MSM_GPIO_PINS(95);
311 DECLARE_MSM_GPIO_PINS(96);
312 DECLARE_MSM_GPIO_PINS(97);
313 DECLARE_MSM_GPIO_PINS(98);
314 DECLARE_MSM_GPIO_PINS(99);
315 DECLARE_MSM_GPIO_PINS(100);
316 DECLARE_MSM_GPIO_PINS(101);
317 DECLARE_MSM_GPIO_PINS(102);
318 DECLARE_MSM_GPIO_PINS(103);
319 DECLARE_MSM_GPIO_PINS(104);
320 DECLARE_MSM_GPIO_PINS(105);
321 DECLARE_MSM_GPIO_PINS(106);
322 DECLARE_MSM_GPIO_PINS(107);
323 DECLARE_MSM_GPIO_PINS(108);
324 DECLARE_MSM_GPIO_PINS(109);
325 DECLARE_MSM_GPIO_PINS(110);
326 DECLARE_MSM_GPIO_PINS(111);
327 DECLARE_MSM_GPIO_PINS(112);
328 
329 static const unsigned int sdc1_clk_pins[] = { 113 };
330 static const unsigned int sdc1_cmd_pins[] = { 114 };
331 static const unsigned int sdc1_data_pins[] = { 115 };
332 static const unsigned int sdc2_clk_pins[] = { 116 };
333 static const unsigned int sdc2_cmd_pins[] = { 117 };
334 static const unsigned int sdc2_data_pins[] = { 118 };
335 static const unsigned int qdsd_clk_pins[] = { 119 };
336 static const unsigned int qdsd_cmd_pins[] = { 120 };
337 static const unsigned int qdsd_data0_pins[] = { 121 };
338 static const unsigned int qdsd_data1_pins[] = { 122 };
339 static const unsigned int qdsd_data2_pins[] = { 123 };
340 static const unsigned int qdsd_data3_pins[] = { 124 };
341 
342 enum msm8909_functions {
343 	msm_mux_gpio,
344 	msm_mux_adsp_ext,
345 	msm_mux_atest_bbrx0,
346 	msm_mux_atest_bbrx1,
347 	msm_mux_atest_char,
348 	msm_mux_atest_char0,
349 	msm_mux_atest_char1,
350 	msm_mux_atest_char2,
351 	msm_mux_atest_char3,
352 	msm_mux_atest_combodac,
353 	msm_mux_atest_gpsadc0,
354 	msm_mux_atest_gpsadc1,
355 	msm_mux_atest_wlan0,
356 	msm_mux_atest_wlan1,
357 	msm_mux_bimc_dte0,
358 	msm_mux_bimc_dte1,
359 	msm_mux_blsp_i2c1,
360 	msm_mux_blsp_i2c2,
361 	msm_mux_blsp_i2c3,
362 	msm_mux_blsp_i2c4,
363 	msm_mux_blsp_i2c5,
364 	msm_mux_blsp_i2c6,
365 	msm_mux_blsp_spi1,
366 	msm_mux_blsp_spi1_cs1,
367 	msm_mux_blsp_spi1_cs2,
368 	msm_mux_blsp_spi1_cs3,
369 	msm_mux_blsp_spi2,
370 	msm_mux_blsp_spi2_cs1,
371 	msm_mux_blsp_spi2_cs2,
372 	msm_mux_blsp_spi2_cs3,
373 	msm_mux_blsp_spi3,
374 	msm_mux_blsp_spi3_cs1,
375 	msm_mux_blsp_spi3_cs2,
376 	msm_mux_blsp_spi3_cs3,
377 	msm_mux_blsp_spi4,
378 	msm_mux_blsp_spi5,
379 	msm_mux_blsp_spi6,
380 	msm_mux_blsp_uart1,
381 	msm_mux_blsp_uart2,
382 	msm_mux_blsp_uim1,
383 	msm_mux_blsp_uim2,
384 	msm_mux_cam_mclk,
385 	msm_mux_cci_async,
386 	msm_mux_cci_timer0,
387 	msm_mux_cci_timer1,
388 	msm_mux_cci_timer2,
389 	msm_mux_cdc_pdm0,
390 	msm_mux_dbg_out,
391 	msm_mux_dmic0_clk,
392 	msm_mux_dmic0_data,
393 	msm_mux_ebi0_wrcdc,
394 	msm_mux_ebi2_a,
395 	msm_mux_ebi2_lcd,
396 	msm_mux_ext_lpass,
397 	msm_mux_gcc_gp1_clk_a,
398 	msm_mux_gcc_gp1_clk_b,
399 	msm_mux_gcc_gp2_clk_a,
400 	msm_mux_gcc_gp2_clk_b,
401 	msm_mux_gcc_gp3_clk_a,
402 	msm_mux_gcc_gp3_clk_b,
403 	msm_mux_gcc_plltest,
404 	msm_mux_gsm0_tx,
405 	msm_mux_ldo_en,
406 	msm_mux_ldo_update,
407 	msm_mux_m_voc,
408 	msm_mux_mdp_vsync,
409 	msm_mux_modem_tsync,
410 	msm_mux_nav_pps,
411 	msm_mux_nav_tsync,
412 	msm_mux_pa_indicator,
413 	msm_mux_pbs0,
414 	msm_mux_pbs1,
415 	msm_mux_pbs2,
416 	msm_mux_pri_mi2s_data0_a,
417 	msm_mux_pri_mi2s_data0_b,
418 	msm_mux_pri_mi2s_data1_a,
419 	msm_mux_pri_mi2s_data1_b,
420 	msm_mux_pri_mi2s_mclk_a,
421 	msm_mux_pri_mi2s_mclk_b,
422 	msm_mux_pri_mi2s_sck_a,
423 	msm_mux_pri_mi2s_sck_b,
424 	msm_mux_pri_mi2s_ws_a,
425 	msm_mux_pri_mi2s_ws_b,
426 	msm_mux_prng_rosc,
427 	msm_mux_pwr_crypto_enabled_a,
428 	msm_mux_pwr_crypto_enabled_b,
429 	msm_mux_pwr_modem_enabled_a,
430 	msm_mux_pwr_modem_enabled_b,
431 	msm_mux_pwr_nav_enabled_a,
432 	msm_mux_pwr_nav_enabled_b,
433 	msm_mux_qdss_cti_trig_in_a0,
434 	msm_mux_qdss_cti_trig_in_a1,
435 	msm_mux_qdss_cti_trig_in_b0,
436 	msm_mux_qdss_cti_trig_in_b1,
437 	msm_mux_qdss_cti_trig_out_a0,
438 	msm_mux_qdss_cti_trig_out_a1,
439 	msm_mux_qdss_cti_trig_out_b0,
440 	msm_mux_qdss_cti_trig_out_b1,
441 	msm_mux_qdss_traceclk_a,
442 	msm_mux_qdss_tracectl_a,
443 	msm_mux_qdss_tracedata_a,
444 	msm_mux_qdss_tracedata_b,
445 	msm_mux_sd_write,
446 	msm_mux_sec_mi2s,
447 	msm_mux_smb_int,
448 	msm_mux_ssbi0,
449 	msm_mux_ssbi1,
450 	msm_mux_uim1_clk,
451 	msm_mux_uim1_data,
452 	msm_mux_uim1_present,
453 	msm_mux_uim1_reset,
454 	msm_mux_uim2_clk,
455 	msm_mux_uim2_data,
456 	msm_mux_uim2_present,
457 	msm_mux_uim2_reset,
458 	msm_mux_uim3_clk,
459 	msm_mux_uim3_data,
460 	msm_mux_uim3_present,
461 	msm_mux_uim3_reset,
462 	msm_mux_uim_batt,
463 	msm_mux_wcss_bt,
464 	msm_mux_wcss_fm,
465 	msm_mux_wcss_wlan,
466 	msm_mux__,
467 };
468 
469 static const char * const adsp_ext_groups[] = { "gpio38" };
470 static const char * const atest_bbrx0_groups[] = { "gpio37" };
471 static const char * const atest_bbrx1_groups[] = { "gpio36" };
472 static const char * const atest_char0_groups[] = { "gpio62" };
473 static const char * const atest_char1_groups[] = { "gpio61" };
474 static const char * const atest_char2_groups[] = { "gpio60" };
475 static const char * const atest_char3_groups[] = { "gpio59" };
476 static const char * const atest_char_groups[] = { "gpio63" };
477 static const char * const atest_combodac_groups[] = {
478 	"gpio32", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", "gpio43",
479 	"gpio44", "gpio45", "gpio47", "gpio48", "gpio66", "gpio81", "gpio83",
480 	"gpio84", "gpio85", "gpio86", "gpio94", "gpio95", "gpio110"
481 };
482 static const char * const atest_gpsadc0_groups[] = { "gpio65" };
483 static const char * const atest_gpsadc1_groups[] = { "gpio79" };
484 static const char * const atest_wlan0_groups[] = { "gpio96" };
485 static const char * const atest_wlan1_groups[] = { "gpio97" };
486 static const char * const bimc_dte0_groups[] = { "gpio6", "gpio59" };
487 static const char * const bimc_dte1_groups[] = { "gpio7", "gpio60" };
488 static const char * const blsp_i2c1_groups[] = { "gpio6", "gpio7" };
489 static const char * const blsp_i2c2_groups[] = { "gpio111", "gpio112" };
490 static const char * const blsp_i2c3_groups[] = { "gpio29", "gpio30" };
491 static const char * const blsp_i2c4_groups[] = { "gpio14", "gpio15" };
492 static const char * const blsp_i2c5_groups[] = { "gpio18", "gpio19" };
493 static const char * const blsp_i2c6_groups[] = { "gpio10", "gpio11" };
494 static const char * const blsp_spi1_cs1_groups[] = { "gpio97" };
495 static const char * const blsp_spi1_cs2_groups[] = { "gpio37" };
496 static const char * const blsp_spi1_cs3_groups[] = { "gpio65" };
497 static const char * const blsp_spi1_groups[] = {
498 	"gpio4", "gpio5", "gpio6", "gpio7"
499 };
500 static const char * const blsp_spi2_cs1_groups[] = { "gpio98" };
501 static const char * const blsp_spi2_cs2_groups[] = { "gpio17" };
502 static const char * const blsp_spi2_cs3_groups[] = { "gpio5" };
503 static const char * const blsp_spi2_groups[] = {
504 	"gpio20", "gpio21", "gpio111", "gpio112"
505 };
506 static const char * const blsp_spi3_cs1_groups[] = { "gpio95" };
507 static const char * const blsp_spi3_cs2_groups[] = { "gpio65" };
508 static const char * const blsp_spi3_cs3_groups[] = { "gpio4" };
509 static const char * const blsp_spi3_groups[] = {
510 	"gpio0", "gpio1", "gpio2", "gpio3"
511 };
512 static const char * const blsp_spi4_groups[] = {
513 	"gpio12", "gpio13", "gpio14", "gpio15"
514 };
515 static const char * const blsp_spi5_groups[] = {
516 	"gpio16", "gpio17", "gpio18", "gpio19"
517 };
518 static const char * const blsp_spi6_groups[] = {
519 	"gpio8", "gpio9", "gpio10", "gpio11"
520 };
521 static const char * const blsp_uart1_groups[] = {
522 	"gpio4", "gpio5", "gpio6", "gpio7"
523 };
524 static const char * const blsp_uart2_groups[] = {
525 	"gpio20", "gpio21", "gpio111", "gpio112"
526 };
527 static const char * const blsp_uim1_groups[] = { "gpio4", "gpio5" };
528 static const char * const blsp_uim2_groups[] = { "gpio20", "gpio21" };
529 static const char * const cam_mclk_groups[] = { "gpio26", "gpio27" };
530 static const char * const cci_async_groups[] = { "gpio33" };
531 static const char * const cci_timer0_groups[] = { "gpio31" };
532 static const char * const cci_timer1_groups[] = { "gpio32" };
533 static const char * const cci_timer2_groups[] = { "gpio38" };
534 static const char * const cdc_pdm0_groups[] = {
535 	"gpio59", "gpio60", "gpio61", "gpio62", "gpio63", "gpio64"
536 };
537 static const char * const dbg_out_groups[] = { "gpio10" };
538 static const char * const dmic0_clk_groups[] = { "gpio4" };
539 static const char * const dmic0_data_groups[] = { "gpio5" };
540 static const char * const ebi0_wrcdc_groups[] = { "gpio64" };
541 static const char * const ebi2_a_groups[] = { "gpio99" };
542 static const char * const ebi2_lcd_groups[] = {
543 	"gpio24", "gpio24", "gpio25", "gpio95"
544 };
545 static const char * const ext_lpass_groups[] = { "gpio45" };
546 static const char * const gcc_gp1_clk_a_groups[] = { "gpio49" };
547 static const char * const gcc_gp1_clk_b_groups[] = { "gpio14" };
548 static const char * const gcc_gp2_clk_a_groups[] = { "gpio50" };
549 static const char * const gcc_gp2_clk_b_groups[] = { "gpio12" };
550 static const char * const gcc_gp3_clk_a_groups[] = { "gpio51" };
551 static const char * const gcc_gp3_clk_b_groups[] = { "gpio13" };
552 static const char * const gcc_plltest_groups[] = { "gpio66", "gpio67" };
553 static const char * const gpio_groups[] = {
554 	"gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7",
555 	"gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14",
556 	"gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21",
557 	"gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28",
558 	"gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35",
559 	"gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42",
560 	"gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49",
561 	"gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56",
562 	"gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63",
563 	"gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70",
564 	"gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77",
565 	"gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84",
566 	"gpio85", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", "gpio91",
567 	"gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98",
568 	"gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104",
569 	"gpio105", "gpio106", "gpio107", "gpio108", "gpio109", "gpio110",
570 	"gpio111", "gpio112"
571 };
572 static const char * const gsm0_tx_groups[] = { "gpio85" };
573 static const char * const ldo_en_groups[] = { "gpio99" };
574 static const char * const ldo_update_groups[] = { "gpio98" };
575 static const char * const m_voc_groups[] = { "gpio8", "gpio95" };
576 static const char * const mdp_vsync_groups[] = { "gpio24", "gpio25" };
577 static const char * const modem_tsync_groups[] = { "gpio83" };
578 static const char * const nav_pps_groups[] = { "gpio83" };
579 static const char * const nav_tsync_groups[] = { "gpio83" };
580 static const char * const pa_indicator_groups[] = { "gpio82" };
581 static const char * const pbs0_groups[] = { "gpio90" };
582 static const char * const pbs1_groups[] = { "gpio91" };
583 static const char * const pbs2_groups[] = { "gpio92" };
584 static const char * const pri_mi2s_data0_a_groups[] = { "gpio62" };
585 static const char * const pri_mi2s_data0_b_groups[] = { "gpio95" };
586 static const char * const pri_mi2s_data1_a_groups[] = { "gpio63" };
587 static const char * const pri_mi2s_data1_b_groups[] = { "gpio96" };
588 static const char * const pri_mi2s_mclk_a_groups[] = { "gpio59" };
589 static const char * const pri_mi2s_mclk_b_groups[] = { "gpio98" };
590 static const char * const pri_mi2s_sck_a_groups[] = { "gpio60" };
591 static const char * const pri_mi2s_sck_b_groups[] = { "gpio94" };
592 static const char * const pri_mi2s_ws_a_groups[] = { "gpio61" };
593 static const char * const pri_mi2s_ws_b_groups[] = { "gpio110" };
594 static const char * const prng_rosc_groups[] = { "gpio43" };
595 static const char * const pwr_crypto_enabled_a_groups[] = { "gpio35" };
596 static const char * const pwr_crypto_enabled_b_groups[] = { "gpio96" };
597 static const char * const pwr_modem_enabled_a_groups[] = { "gpio28" };
598 static const char * const pwr_modem_enabled_b_groups[] = { "gpio94" };
599 static const char * const pwr_nav_enabled_a_groups[] = { "gpio34" };
600 static const char * const pwr_nav_enabled_b_groups[] = { "gpio95" };
601 static const char * const qdss_cti_trig_in_a0_groups[] = { "gpio20" };
602 static const char * const qdss_cti_trig_in_a1_groups[] = { "gpio49" };
603 static const char * const qdss_cti_trig_in_b0_groups[] = { "gpio21" };
604 static const char * const qdss_cti_trig_in_b1_groups[] = { "gpio50" };
605 static const char * const qdss_cti_trig_out_a0_groups[] = { "gpio23" };
606 static const char * const qdss_cti_trig_out_a1_groups[] = { "gpio52" };
607 static const char * const qdss_cti_trig_out_b0_groups[] = { "gpio22" };
608 static const char * const qdss_cti_trig_out_b1_groups[] = { "gpio51" };
609 static const char * const qdss_traceclk_a_groups[] = { "gpio46" };
610 static const char * const qdss_tracectl_a_groups[] = { "gpio45" };
611 static const char * const qdss_tracedata_a_groups[] = {
612 	"gpio8", "gpio9", "gpio10", "gpio39", "gpio40", "gpio41", "gpio42",
613 	"gpio43", "gpio47", "gpio48", "gpio58", "gpio65", "gpio94", "gpio96",
614 	"gpio97"
615 };
616 static const char * const qdss_tracedata_b_groups[] = {
617 	"gpio14", "gpio16", "gpio17", "gpio29", "gpio30", "gpio31", "gpio32",
618 	"gpio33", "gpio34", "gpio35", "gpio36", "gpio37", "gpio93"
619 };
620 static const char * const sd_write_groups[] = { "gpio99" };
621 static const char * const sec_mi2s_groups[] = {
622 	"gpio0", "gpio1", "gpio2", "gpio3", "gpio98"
623 };
624 static const char * const smb_int_groups[] = { "gpio58" };
625 static const char * const ssbi0_groups[] = { "gpio88" };
626 static const char * const ssbi1_groups[] = { "gpio89" };
627 static const char * const uim1_clk_groups[] = { "gpio54" };
628 static const char * const uim1_data_groups[] = { "gpio53" };
629 static const char * const uim1_present_groups[] = { "gpio56" };
630 static const char * const uim1_reset_groups[] = { "gpio55" };
631 static const char * const uim2_clk_groups[] = { "gpio50" };
632 static const char * const uim2_data_groups[] = { "gpio49" };
633 static const char * const uim2_present_groups[] = { "gpio52" };
634 static const char * const uim2_reset_groups[] = { "gpio51" };
635 static const char * const uim3_clk_groups[] = { "gpio23" };
636 static const char * const uim3_data_groups[] = { "gpio20" };
637 static const char * const uim3_present_groups[] = { "gpio21" };
638 static const char * const uim3_reset_groups[] = { "gpio22" };
639 static const char * const uim_batt_groups[] = { "gpio57" };
640 static const char * const wcss_bt_groups[] = { "gpio39", "gpio47", "gpio48" };
641 static const char * const wcss_fm_groups[] = { "gpio45", "gpio46" };
642 static const char * const wcss_wlan_groups[] = {
643 	"gpio40", "gpio41", "gpio42", "gpio43", "gpio44"
644 };
645 
646 static const struct msm_function msm8909_functions[] = {
647 	FUNCTION(adsp_ext),
648 	FUNCTION(atest_bbrx0),
649 	FUNCTION(atest_bbrx1),
650 	FUNCTION(atest_char),
651 	FUNCTION(atest_char0),
652 	FUNCTION(atest_char1),
653 	FUNCTION(atest_char2),
654 	FUNCTION(atest_char3),
655 	FUNCTION(atest_combodac),
656 	FUNCTION(atest_gpsadc0),
657 	FUNCTION(atest_gpsadc1),
658 	FUNCTION(atest_wlan0),
659 	FUNCTION(atest_wlan1),
660 	FUNCTION(bimc_dte0),
661 	FUNCTION(bimc_dte1),
662 	FUNCTION(blsp_i2c1),
663 	FUNCTION(blsp_i2c2),
664 	FUNCTION(blsp_i2c3),
665 	FUNCTION(blsp_i2c4),
666 	FUNCTION(blsp_i2c5),
667 	FUNCTION(blsp_i2c6),
668 	FUNCTION(blsp_spi1),
669 	FUNCTION(blsp_spi1_cs1),
670 	FUNCTION(blsp_spi1_cs2),
671 	FUNCTION(blsp_spi1_cs3),
672 	FUNCTION(blsp_spi2),
673 	FUNCTION(blsp_spi2_cs1),
674 	FUNCTION(blsp_spi2_cs2),
675 	FUNCTION(blsp_spi2_cs3),
676 	FUNCTION(blsp_spi3),
677 	FUNCTION(blsp_spi3_cs1),
678 	FUNCTION(blsp_spi3_cs2),
679 	FUNCTION(blsp_spi3_cs3),
680 	FUNCTION(blsp_spi4),
681 	FUNCTION(blsp_spi5),
682 	FUNCTION(blsp_spi6),
683 	FUNCTION(blsp_uart1),
684 	FUNCTION(blsp_uart2),
685 	FUNCTION(blsp_uim1),
686 	FUNCTION(blsp_uim2),
687 	FUNCTION(cam_mclk),
688 	FUNCTION(cci_async),
689 	FUNCTION(cci_timer0),
690 	FUNCTION(cci_timer1),
691 	FUNCTION(cci_timer2),
692 	FUNCTION(cdc_pdm0),
693 	FUNCTION(dbg_out),
694 	FUNCTION(dmic0_clk),
695 	FUNCTION(dmic0_data),
696 	FUNCTION(ebi0_wrcdc),
697 	FUNCTION(ebi2_a),
698 	FUNCTION(ebi2_lcd),
699 	FUNCTION(ext_lpass),
700 	FUNCTION(gcc_gp1_clk_a),
701 	FUNCTION(gcc_gp1_clk_b),
702 	FUNCTION(gcc_gp2_clk_a),
703 	FUNCTION(gcc_gp2_clk_b),
704 	FUNCTION(gcc_gp3_clk_a),
705 	FUNCTION(gcc_gp3_clk_b),
706 	FUNCTION(gcc_plltest),
707 	FUNCTION(gpio),
708 	FUNCTION(gsm0_tx),
709 	FUNCTION(ldo_en),
710 	FUNCTION(ldo_update),
711 	FUNCTION(m_voc),
712 	FUNCTION(mdp_vsync),
713 	FUNCTION(modem_tsync),
714 	FUNCTION(nav_pps),
715 	FUNCTION(nav_tsync),
716 	FUNCTION(pa_indicator),
717 	FUNCTION(pbs0),
718 	FUNCTION(pbs1),
719 	FUNCTION(pbs2),
720 	FUNCTION(pri_mi2s_data0_a),
721 	FUNCTION(pri_mi2s_data0_b),
722 	FUNCTION(pri_mi2s_data1_a),
723 	FUNCTION(pri_mi2s_data1_b),
724 	FUNCTION(pri_mi2s_mclk_a),
725 	FUNCTION(pri_mi2s_mclk_b),
726 	FUNCTION(pri_mi2s_sck_a),
727 	FUNCTION(pri_mi2s_sck_b),
728 	FUNCTION(pri_mi2s_ws_a),
729 	FUNCTION(pri_mi2s_ws_b),
730 	FUNCTION(prng_rosc),
731 	FUNCTION(pwr_crypto_enabled_a),
732 	FUNCTION(pwr_crypto_enabled_b),
733 	FUNCTION(pwr_modem_enabled_a),
734 	FUNCTION(pwr_modem_enabled_b),
735 	FUNCTION(pwr_nav_enabled_a),
736 	FUNCTION(pwr_nav_enabled_b),
737 	FUNCTION(qdss_cti_trig_in_a0),
738 	FUNCTION(qdss_cti_trig_in_a1),
739 	FUNCTION(qdss_cti_trig_in_b0),
740 	FUNCTION(qdss_cti_trig_in_b1),
741 	FUNCTION(qdss_cti_trig_out_a0),
742 	FUNCTION(qdss_cti_trig_out_a1),
743 	FUNCTION(qdss_cti_trig_out_b0),
744 	FUNCTION(qdss_cti_trig_out_b1),
745 	FUNCTION(qdss_traceclk_a),
746 	FUNCTION(qdss_tracectl_a),
747 	FUNCTION(qdss_tracedata_a),
748 	FUNCTION(qdss_tracedata_b),
749 	FUNCTION(sd_write),
750 	FUNCTION(sec_mi2s),
751 	FUNCTION(smb_int),
752 	FUNCTION(ssbi0),
753 	FUNCTION(ssbi1),
754 	FUNCTION(uim1_clk),
755 	FUNCTION(uim1_data),
756 	FUNCTION(uim1_present),
757 	FUNCTION(uim1_reset),
758 	FUNCTION(uim2_clk),
759 	FUNCTION(uim2_data),
760 	FUNCTION(uim2_present),
761 	FUNCTION(uim2_reset),
762 	FUNCTION(uim3_clk),
763 	FUNCTION(uim3_data),
764 	FUNCTION(uim3_present),
765 	FUNCTION(uim3_reset),
766 	FUNCTION(uim_batt),
767 	FUNCTION(wcss_bt),
768 	FUNCTION(wcss_fm),
769 	FUNCTION(wcss_wlan),
770 };
771 
772 static const struct msm_pingroup msm8909_groups[] = {
773 	PINGROUP(0, blsp_spi3, sec_mi2s, _, _, _, _, _, _, _),
774 	PINGROUP(1, blsp_spi3, sec_mi2s, _, _, _, _, _, _, _),
775 	PINGROUP(2, blsp_spi3, sec_mi2s, _, _, _, _, _, _, _),
776 	PINGROUP(3, blsp_spi3, sec_mi2s, _, _, _, _, _, _, _),
777 	PINGROUP(4, blsp_spi1, blsp_uart1, blsp_uim1, blsp_spi3_cs3, dmic0_clk, _, _, _, _),
778 	PINGROUP(5, blsp_spi1, blsp_uart1, blsp_uim1, blsp_spi2_cs3, dmic0_data, _, _, _, _),
779 	PINGROUP(6, blsp_spi1, blsp_uart1, blsp_i2c1, _, _, _, _, _, bimc_dte0),
780 	PINGROUP(7, blsp_spi1, blsp_uart1, blsp_i2c1, _, _, _, _, _, bimc_dte1),
781 	PINGROUP(8, blsp_spi6, m_voc, _, _, _, _, _, qdss_tracedata_a, _),
782 	PINGROUP(9, blsp_spi6, _, _, _, _, _, qdss_tracedata_a, _, _),
783 	PINGROUP(10, blsp_spi6, blsp_i2c6, dbg_out, qdss_tracedata_a, _, _, _, _, _),
784 	PINGROUP(11, blsp_spi6, blsp_i2c6, _, _, _, _, _, _, _),
785 	PINGROUP(12, blsp_spi4, gcc_gp2_clk_b, _, _, _, _, _, _, _),
786 	PINGROUP(13, blsp_spi4, gcc_gp3_clk_b, _, _, _, _, _, _, _),
787 	PINGROUP(14, blsp_spi4, blsp_i2c4, gcc_gp1_clk_b, _, _, _, _, _, qdss_tracedata_b),
788 	PINGROUP(15, blsp_spi4, blsp_i2c4, _, _, _, _, _, _, _),
789 	PINGROUP(16, blsp_spi5, _, _, _, _, _, qdss_tracedata_b, _, _),
790 	PINGROUP(17, blsp_spi5, blsp_spi2_cs2, _, _, _, _, _, qdss_tracedata_b, _),
791 	PINGROUP(18, blsp_spi5, blsp_i2c5, _, _, _, _, _, _, _),
792 	PINGROUP(19, blsp_spi5, blsp_i2c5, _, _, _, _, _, _, _),
793 	PINGROUP(20, uim3_data, blsp_spi2, blsp_uart2, blsp_uim2, _, qdss_cti_trig_in_a0, _, _, _),
794 	PINGROUP(21, uim3_present, blsp_spi2, blsp_uart2, blsp_uim2, _, qdss_cti_trig_in_b0, _, _, _),
795 	PINGROUP(22, uim3_reset, _, qdss_cti_trig_out_b0, _, _, _, _, _, _),
796 	PINGROUP(23, uim3_clk, qdss_cti_trig_out_a0, _, _, _, _, _, _, _),
797 	PINGROUP(24, mdp_vsync, ebi2_lcd, ebi2_lcd, _, _, _, _, _, _),
798 	PINGROUP(25, mdp_vsync, ebi2_lcd, _, _, _, _, _, _, _),
799 	PINGROUP(26, cam_mclk, _, _, _, _, _, _, _, _),
800 	PINGROUP(27, cam_mclk, _, _, _, _, _, _, _, _),
801 	PINGROUP(28, _, pwr_modem_enabled_a, _, _, _, _, _, _, _),
802 	PINGROUP(29, blsp_i2c3, _, _, _, _, _, qdss_tracedata_b, _, _),
803 	PINGROUP(30, blsp_i2c3, _, _, _, _, _, qdss_tracedata_b, _, _),
804 	PINGROUP(31, cci_timer0, _, _, _, _, _, _, qdss_tracedata_b, _),
805 	PINGROUP(32, cci_timer1, _, qdss_tracedata_b, _, atest_combodac, _, _, _, _),
806 	PINGROUP(33, cci_async, qdss_tracedata_b, _, _, _, _, _, _, _),
807 	PINGROUP(34, pwr_nav_enabled_a, qdss_tracedata_b, _, _, _, _, _, _, _),
808 	PINGROUP(35, pwr_crypto_enabled_a, qdss_tracedata_b, _, _, _, _, _, _, _),
809 	PINGROUP(36, qdss_tracedata_b, _, atest_bbrx1, _, _, _, _, _, _),
810 	PINGROUP(37, blsp_spi1_cs2, qdss_tracedata_b, _, atest_bbrx0, _, _, _, _, _),
811 	PINGROUP(38, cci_timer2, adsp_ext, _, atest_combodac, _, _, _, _, _),
812 	PINGROUP(39, wcss_bt, qdss_tracedata_a, _, atest_combodac, _, _, _, _, _),
813 	PINGROUP(40, wcss_wlan, qdss_tracedata_a, _, atest_combodac, _, _, _, _, _),
814 	PINGROUP(41, wcss_wlan, qdss_tracedata_a, _, atest_combodac, _, _, _, _, _),
815 	PINGROUP(42, wcss_wlan, qdss_tracedata_a, _, atest_combodac, _, _, _, _, _),
816 	PINGROUP(43, wcss_wlan, prng_rosc, qdss_tracedata_a, _, atest_combodac, _, _, _, _),
817 	PINGROUP(44, wcss_wlan, _, atest_combodac, _, _, _, _, _, _),
818 	PINGROUP(45, wcss_fm, ext_lpass, qdss_tracectl_a, _, atest_combodac, _, _, _, _),
819 	PINGROUP(46, wcss_fm, qdss_traceclk_a, _, _, _, _, _, _, _),
820 	PINGROUP(47, wcss_bt, qdss_tracedata_a, _, atest_combodac, _, _, _, _, _),
821 	PINGROUP(48, wcss_bt, qdss_tracedata_a, _, atest_combodac, _, _, _, _, _),
822 	PINGROUP(49, uim2_data, gcc_gp1_clk_a, qdss_cti_trig_in_a1, _, _, _, _, _, _),
823 	PINGROUP(50, uim2_clk, gcc_gp2_clk_a, qdss_cti_trig_in_b1, _, _, _, _, _, _),
824 	PINGROUP(51, uim2_reset, gcc_gp3_clk_a, qdss_cti_trig_out_b1, _, _, _, _, _, _),
825 	PINGROUP(52, uim2_present, qdss_cti_trig_out_a1, _, _, _, _, _, _, _),
826 	PINGROUP(53, uim1_data, _, _, _, _, _, _, _, _),
827 	PINGROUP(54, uim1_clk, _, _, _, _, _, _, _, _),
828 	PINGROUP(55, uim1_reset, _, _, _, _, _, _, _, _),
829 	PINGROUP(56, uim1_present, _, _, _, _, _, _, _, _),
830 	PINGROUP(57, uim_batt, _, _, _, _, _, _, _, _),
831 	PINGROUP(58, qdss_tracedata_a, smb_int, _, _, _, _, _, _, _),
832 	PINGROUP(59, cdc_pdm0, pri_mi2s_mclk_a, atest_char3, _, _, _, _, _, bimc_dte0),
833 	PINGROUP(60, cdc_pdm0, pri_mi2s_sck_a, atest_char2, _, _, _, _, _, bimc_dte1),
834 	PINGROUP(61, cdc_pdm0, pri_mi2s_ws_a, atest_char1, _, _, _, _, _, _),
835 	PINGROUP(62, cdc_pdm0, pri_mi2s_data0_a, atest_char0, _, _, _, _, _, _),
836 	PINGROUP(63, cdc_pdm0, pri_mi2s_data1_a, atest_char, _, _, _, _, _, _),
837 	PINGROUP(64, cdc_pdm0, _, _, _, _, _, ebi0_wrcdc, _, _),
838 	PINGROUP(65, blsp_spi3_cs2, blsp_spi1_cs3, qdss_tracedata_a, _, atest_gpsadc0, _, _, _, _),
839 	PINGROUP(66, _, gcc_plltest, _, atest_combodac, _, _, _, _, _),
840 	PINGROUP(67, _, gcc_plltest, _, _, _, _, _, _, _),
841 	PINGROUP(68, _, _, _, _, _, _, _, _, _),
842 	PINGROUP(69, _, _, _, _, _, _, _, _, _),
843 	PINGROUP(70, _, _, _, _, _, _, _, _, _),
844 	PINGROUP(71, _, _, _, _, _, _, _, _, _),
845 	PINGROUP(72, _, _, _, _, _, _, _, _, _),
846 	PINGROUP(73, _, _, _, _, _, _, _, _, _),
847 	PINGROUP(74, _, _, _, _, _, _, _, _, _),
848 	PINGROUP(75, _, _, _, _, _, _, _, _, _),
849 	PINGROUP(76, _, _, _, _, _, _, _, _, _),
850 	PINGROUP(77, _, _, _, _, _, _, _, _, _),
851 	PINGROUP(78, _, _, _, _, _, _, _, _, _),
852 	PINGROUP(79, _, _, atest_gpsadc1, _, _, _, _, _, _),
853 	PINGROUP(80, _, _, _, _, _, _, _, _, _),
854 	PINGROUP(81, _, _, _, atest_combodac, _, _, _, _, _),
855 	PINGROUP(82, _, pa_indicator, _, _, _, _, _, _, _),
856 	PINGROUP(83, _, modem_tsync, nav_tsync, nav_pps, _, atest_combodac, _, _, _),
857 	PINGROUP(84, _, _, atest_combodac, _, _, _, _, _, _),
858 	PINGROUP(85, gsm0_tx, _, _, atest_combodac, _, _, _, _, _),
859 	PINGROUP(86, _, _, atest_combodac, _, _, _, _, _, _),
860 	PINGROUP(87, _, _, _, _, _, _, _, _, _),
861 	PINGROUP(88, _, ssbi0, _, _, _, _, _, _, _),
862 	PINGROUP(89, _, ssbi1, _, _, _, _, _, _, _),
863 	PINGROUP(90, pbs0, _, _, _, _, _, _, _, _),
864 	PINGROUP(91, pbs1, _, _, _, _, _, _, _, _),
865 	PINGROUP(92, pbs2, _, _, _, _, _, _, _, _),
866 	PINGROUP(93, qdss_tracedata_b, _, _, _, _, _, _, _, _),
867 	PINGROUP(94, pri_mi2s_sck_b, pwr_modem_enabled_b, qdss_tracedata_a, _, atest_combodac, _, _, _, _),
868 	PINGROUP(95, blsp_spi3_cs1, pri_mi2s_data0_b, ebi2_lcd, m_voc, pwr_nav_enabled_b, _, atest_combodac, _, _),
869 	PINGROUP(96, pri_mi2s_data1_b, _, pwr_crypto_enabled_b, qdss_tracedata_a, _, atest_wlan0, _, _, _),
870 	PINGROUP(97, blsp_spi1_cs1, qdss_tracedata_a, _, atest_wlan1, _, _, _, _, _),
871 	PINGROUP(98, sec_mi2s, pri_mi2s_mclk_b, blsp_spi2_cs1, ldo_update, _, _, _, _, _),
872 	PINGROUP(99, ebi2_a, sd_write, ldo_en, _, _, _, _, _, _),
873 	PINGROUP(100, _, _, _, _, _, _, _, _, _),
874 	PINGROUP(101, _, _, _, _, _, _, _, _, _),
875 	PINGROUP(102, _, _, _, _, _, _, _, _, _),
876 	PINGROUP(103, _, _, _, _, _, _, _, _, _),
877 	PINGROUP(104, _, _, _, _, _, _, _, _, _),
878 	PINGROUP(105, _, _, _, _, _, _, _, _, _),
879 	PINGROUP(106, _, _, _, _, _, _, _, _, _),
880 	PINGROUP(107, _, _, _, _, _, _, _, _, _),
881 	PINGROUP(108, _, _, _, _, _, _, _, _, _),
882 	PINGROUP(109, _, _, _, _, _, _, _, _, _),
883 	PINGROUP(110, pri_mi2s_ws_b, _, atest_combodac, _, _, _, _, _, _),
884 	PINGROUP(111, blsp_spi2, blsp_uart2, blsp_i2c2, _, _, _, _, _, _),
885 	PINGROUP(112, blsp_spi2, blsp_uart2, blsp_i2c2, _, _, _, _, _, _),
886 	SDC_QDSD_PINGROUP(sdc1_clk, 0x10a000, 13, 6),
887 	SDC_QDSD_PINGROUP(sdc1_cmd, 0x10a000, 11, 3),
888 	SDC_QDSD_PINGROUP(sdc1_data, 0x10a000, 9, 0),
889 	SDC_QDSD_PINGROUP(sdc2_clk, 0x109000, 14, 6),
890 	SDC_QDSD_PINGROUP(sdc2_cmd, 0x109000, 11, 3),
891 	SDC_QDSD_PINGROUP(sdc2_data, 0x109000, 9, 0),
892 	SDC_QDSD_PINGROUP(qdsd_clk, 0x19c000, 3, 0),
893 	SDC_QDSD_PINGROUP(qdsd_cmd, 0x19c000, 8, 5),
894 	SDC_QDSD_PINGROUP(qdsd_data0, 0x19c000, 13, 10),
895 	SDC_QDSD_PINGROUP(qdsd_data1, 0x19c000, 18, 15),
896 	SDC_QDSD_PINGROUP(qdsd_data2, 0x19c000, 23, 20),
897 	SDC_QDSD_PINGROUP(qdsd_data3, 0x19c000, 28, 25),
898 };
899 
900 static const struct msm_gpio_wakeirq_map msm8909_mpm_map[] = {
901 	{ 65, 3 }, { 5, 4 }, { 11, 5 }, { 12, 6 }, { 64, 7 }, { 58, 8 },
902 	{ 50, 9 }, { 13, 10 }, { 49, 11 }, { 20, 12 }, { 21, 13 }, { 25, 14 },
903 	{ 46, 15 }, { 45, 16 }, { 28, 17 }, { 44, 18 }, { 31, 19 }, { 43, 20 },
904 	{ 42, 21 }, { 34, 22 }, { 35, 23 }, { 36, 24 }, { 37, 25 }, { 38, 26 },
905 	{ 39, 27 }, { 40, 28 }, { 41, 29 }, { 90, 30 }, { 91, 32 }, { 92, 33 },
906 	{ 94, 34 }, { 95, 35 }, { 96, 36 }, { 97, 37 }, { 98, 38 },
907 	{ 110, 39 }, { 111, 40 }, { 112, 41 }, { 105, 42 }, { 107, 43 },
908 	{ 47, 50 }, { 48, 51 },
909 };
910 
911 static const struct msm_pinctrl_soc_data msm8909_pinctrl = {
912 	.pins = msm8909_pins,
913 	.npins = ARRAY_SIZE(msm8909_pins),
914 	.functions = msm8909_functions,
915 	.nfunctions = ARRAY_SIZE(msm8909_functions),
916 	.groups = msm8909_groups,
917 	.ngroups = ARRAY_SIZE(msm8909_groups),
918 	.ngpios = 113,
919 	.wakeirq_map = msm8909_mpm_map,
920 	.nwakeirq_map = ARRAY_SIZE(msm8909_mpm_map),
921 };
922 
923 static int msm8909_pinctrl_probe(struct platform_device *pdev)
924 {
925 	return msm_pinctrl_probe(pdev, &msm8909_pinctrl);
926 }
927 
928 static const struct of_device_id msm8909_pinctrl_of_match[] = {
929 	{ .compatible = "qcom,msm8909-tlmm", },
930 	{ },
931 };
932 MODULE_DEVICE_TABLE(of, msm8909_pinctrl_of_match);
933 
934 static struct platform_driver msm8909_pinctrl_driver = {
935 	.driver = {
936 		.name = "msm8909-pinctrl",
937 		.of_match_table = msm8909_pinctrl_of_match,
938 	},
939 	.probe = msm8909_pinctrl_probe,
940 	.remove = msm_pinctrl_remove,
941 };
942 
943 static int __init msm8909_pinctrl_init(void)
944 {
945 	return platform_driver_register(&msm8909_pinctrl_driver);
946 }
947 arch_initcall(msm8909_pinctrl_init);
948 
949 static void __exit msm8909_pinctrl_exit(void)
950 {
951 	platform_driver_unregister(&msm8909_pinctrl_driver);
952 }
953 module_exit(msm8909_pinctrl_exit);
954 
955 MODULE_DESCRIPTION("Qualcomm MSM8909 TLMM pinctrl driver");
956 MODULE_LICENSE("GPL");
957