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