1/*
2 * Copyright (c) 2014, Sony Mobile Communications AB.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 * GNU General Public License for more details.
12 */
13
14#include <linux/module.h>
15#include <linux/of.h>
16#include <linux/platform_device.h>
17#include <linux/pinctrl/pinctrl.h>
18#include <linux/pinctrl/pinmux.h>
19
20#include "pinctrl-msm.h"
21
22static const struct pinctrl_pin_desc msm8960_pins[] = {
23	PINCTRL_PIN(0, "GPIO_0"),
24	PINCTRL_PIN(1, "GPIO_1"),
25	PINCTRL_PIN(2, "GPIO_2"),
26	PINCTRL_PIN(3, "GPIO_3"),
27	PINCTRL_PIN(4, "GPIO_4"),
28	PINCTRL_PIN(5, "GPIO_5"),
29	PINCTRL_PIN(6, "GPIO_6"),
30	PINCTRL_PIN(7, "GPIO_7"),
31	PINCTRL_PIN(8, "GPIO_8"),
32	PINCTRL_PIN(9, "GPIO_9"),
33	PINCTRL_PIN(10, "GPIO_10"),
34	PINCTRL_PIN(11, "GPIO_11"),
35	PINCTRL_PIN(12, "GPIO_12"),
36	PINCTRL_PIN(13, "GPIO_13"),
37	PINCTRL_PIN(14, "GPIO_14"),
38	PINCTRL_PIN(15, "GPIO_15"),
39	PINCTRL_PIN(16, "GPIO_16"),
40	PINCTRL_PIN(17, "GPIO_17"),
41	PINCTRL_PIN(18, "GPIO_18"),
42	PINCTRL_PIN(19, "GPIO_19"),
43	PINCTRL_PIN(20, "GPIO_20"),
44	PINCTRL_PIN(21, "GPIO_21"),
45	PINCTRL_PIN(22, "GPIO_22"),
46	PINCTRL_PIN(23, "GPIO_23"),
47	PINCTRL_PIN(24, "GPIO_24"),
48	PINCTRL_PIN(25, "GPIO_25"),
49	PINCTRL_PIN(26, "GPIO_26"),
50	PINCTRL_PIN(27, "GPIO_27"),
51	PINCTRL_PIN(28, "GPIO_28"),
52	PINCTRL_PIN(29, "GPIO_29"),
53	PINCTRL_PIN(30, "GPIO_30"),
54	PINCTRL_PIN(31, "GPIO_31"),
55	PINCTRL_PIN(32, "GPIO_32"),
56	PINCTRL_PIN(33, "GPIO_33"),
57	PINCTRL_PIN(34, "GPIO_34"),
58	PINCTRL_PIN(35, "GPIO_35"),
59	PINCTRL_PIN(36, "GPIO_36"),
60	PINCTRL_PIN(37, "GPIO_37"),
61	PINCTRL_PIN(38, "GPIO_38"),
62	PINCTRL_PIN(39, "GPIO_39"),
63	PINCTRL_PIN(40, "GPIO_40"),
64	PINCTRL_PIN(41, "GPIO_41"),
65	PINCTRL_PIN(42, "GPIO_42"),
66	PINCTRL_PIN(43, "GPIO_43"),
67	PINCTRL_PIN(44, "GPIO_44"),
68	PINCTRL_PIN(45, "GPIO_45"),
69	PINCTRL_PIN(46, "GPIO_46"),
70	PINCTRL_PIN(47, "GPIO_47"),
71	PINCTRL_PIN(48, "GPIO_48"),
72	PINCTRL_PIN(49, "GPIO_49"),
73	PINCTRL_PIN(50, "GPIO_50"),
74	PINCTRL_PIN(51, "GPIO_51"),
75	PINCTRL_PIN(52, "GPIO_52"),
76	PINCTRL_PIN(53, "GPIO_53"),
77	PINCTRL_PIN(54, "GPIO_54"),
78	PINCTRL_PIN(55, "GPIO_55"),
79	PINCTRL_PIN(56, "GPIO_56"),
80	PINCTRL_PIN(57, "GPIO_57"),
81	PINCTRL_PIN(58, "GPIO_58"),
82	PINCTRL_PIN(59, "GPIO_59"),
83	PINCTRL_PIN(60, "GPIO_60"),
84	PINCTRL_PIN(61, "GPIO_61"),
85	PINCTRL_PIN(62, "GPIO_62"),
86	PINCTRL_PIN(63, "GPIO_63"),
87	PINCTRL_PIN(64, "GPIO_64"),
88	PINCTRL_PIN(65, "GPIO_65"),
89	PINCTRL_PIN(66, "GPIO_66"),
90	PINCTRL_PIN(67, "GPIO_67"),
91	PINCTRL_PIN(68, "GPIO_68"),
92	PINCTRL_PIN(69, "GPIO_69"),
93	PINCTRL_PIN(70, "GPIO_70"),
94	PINCTRL_PIN(71, "GPIO_71"),
95	PINCTRL_PIN(72, "GPIO_72"),
96	PINCTRL_PIN(73, "GPIO_73"),
97	PINCTRL_PIN(74, "GPIO_74"),
98	PINCTRL_PIN(75, "GPIO_75"),
99	PINCTRL_PIN(76, "GPIO_76"),
100	PINCTRL_PIN(77, "GPIO_77"),
101	PINCTRL_PIN(78, "GPIO_78"),
102	PINCTRL_PIN(79, "GPIO_79"),
103	PINCTRL_PIN(80, "GPIO_80"),
104	PINCTRL_PIN(81, "GPIO_81"),
105	PINCTRL_PIN(82, "GPIO_82"),
106	PINCTRL_PIN(83, "GPIO_83"),
107	PINCTRL_PIN(84, "GPIO_84"),
108	PINCTRL_PIN(85, "GPIO_85"),
109	PINCTRL_PIN(86, "GPIO_86"),
110	PINCTRL_PIN(87, "GPIO_87"),
111	PINCTRL_PIN(88, "GPIO_88"),
112	PINCTRL_PIN(89, "GPIO_89"),
113	PINCTRL_PIN(90, "GPIO_90"),
114	PINCTRL_PIN(91, "GPIO_91"),
115	PINCTRL_PIN(92, "GPIO_92"),
116	PINCTRL_PIN(93, "GPIO_93"),
117	PINCTRL_PIN(94, "GPIO_94"),
118	PINCTRL_PIN(95, "GPIO_95"),
119	PINCTRL_PIN(96, "GPIO_96"),
120	PINCTRL_PIN(97, "GPIO_97"),
121	PINCTRL_PIN(98, "GPIO_98"),
122	PINCTRL_PIN(99, "GPIO_99"),
123	PINCTRL_PIN(100, "GPIO_100"),
124	PINCTRL_PIN(101, "GPIO_101"),
125	PINCTRL_PIN(102, "GPIO_102"),
126	PINCTRL_PIN(103, "GPIO_103"),
127	PINCTRL_PIN(104, "GPIO_104"),
128	PINCTRL_PIN(105, "GPIO_105"),
129	PINCTRL_PIN(106, "GPIO_106"),
130	PINCTRL_PIN(107, "GPIO_107"),
131	PINCTRL_PIN(108, "GPIO_108"),
132	PINCTRL_PIN(109, "GPIO_109"),
133	PINCTRL_PIN(110, "GPIO_110"),
134	PINCTRL_PIN(111, "GPIO_111"),
135	PINCTRL_PIN(112, "GPIO_112"),
136	PINCTRL_PIN(113, "GPIO_113"),
137	PINCTRL_PIN(114, "GPIO_114"),
138	PINCTRL_PIN(115, "GPIO_115"),
139	PINCTRL_PIN(116, "GPIO_116"),
140	PINCTRL_PIN(117, "GPIO_117"),
141	PINCTRL_PIN(118, "GPIO_118"),
142	PINCTRL_PIN(119, "GPIO_119"),
143	PINCTRL_PIN(120, "GPIO_120"),
144	PINCTRL_PIN(121, "GPIO_121"),
145	PINCTRL_PIN(122, "GPIO_122"),
146	PINCTRL_PIN(123, "GPIO_123"),
147	PINCTRL_PIN(124, "GPIO_124"),
148	PINCTRL_PIN(125, "GPIO_125"),
149	PINCTRL_PIN(126, "GPIO_126"),
150	PINCTRL_PIN(127, "GPIO_127"),
151	PINCTRL_PIN(128, "GPIO_128"),
152	PINCTRL_PIN(129, "GPIO_129"),
153	PINCTRL_PIN(130, "GPIO_130"),
154	PINCTRL_PIN(131, "GPIO_131"),
155	PINCTRL_PIN(132, "GPIO_132"),
156	PINCTRL_PIN(133, "GPIO_133"),
157	PINCTRL_PIN(134, "GPIO_134"),
158	PINCTRL_PIN(135, "GPIO_135"),
159	PINCTRL_PIN(136, "GPIO_136"),
160	PINCTRL_PIN(137, "GPIO_137"),
161	PINCTRL_PIN(138, "GPIO_138"),
162	PINCTRL_PIN(139, "GPIO_139"),
163	PINCTRL_PIN(140, "GPIO_140"),
164	PINCTRL_PIN(141, "GPIO_141"),
165	PINCTRL_PIN(142, "GPIO_142"),
166	PINCTRL_PIN(143, "GPIO_143"),
167	PINCTRL_PIN(144, "GPIO_144"),
168	PINCTRL_PIN(145, "GPIO_145"),
169	PINCTRL_PIN(146, "GPIO_146"),
170	PINCTRL_PIN(147, "GPIO_147"),
171	PINCTRL_PIN(148, "GPIO_148"),
172	PINCTRL_PIN(149, "GPIO_149"),
173	PINCTRL_PIN(150, "GPIO_150"),
174	PINCTRL_PIN(151, "GPIO_151"),
175
176	PINCTRL_PIN(152, "SDC1_CLK"),
177	PINCTRL_PIN(153, "SDC1_CMD"),
178	PINCTRL_PIN(154, "SDC1_DATA"),
179	PINCTRL_PIN(155, "SDC3_CLK"),
180	PINCTRL_PIN(156, "SDC3_CMD"),
181	PINCTRL_PIN(157, "SDC3_DATA"),
182};
183
184#define DECLARE_MSM_GPIO_PINS(pin) static const unsigned int gpio##pin##_pins[] = { pin }
185DECLARE_MSM_GPIO_PINS(0);
186DECLARE_MSM_GPIO_PINS(1);
187DECLARE_MSM_GPIO_PINS(2);
188DECLARE_MSM_GPIO_PINS(3);
189DECLARE_MSM_GPIO_PINS(4);
190DECLARE_MSM_GPIO_PINS(5);
191DECLARE_MSM_GPIO_PINS(6);
192DECLARE_MSM_GPIO_PINS(7);
193DECLARE_MSM_GPIO_PINS(8);
194DECLARE_MSM_GPIO_PINS(9);
195DECLARE_MSM_GPIO_PINS(10);
196DECLARE_MSM_GPIO_PINS(11);
197DECLARE_MSM_GPIO_PINS(12);
198DECLARE_MSM_GPIO_PINS(13);
199DECLARE_MSM_GPIO_PINS(14);
200DECLARE_MSM_GPIO_PINS(15);
201DECLARE_MSM_GPIO_PINS(16);
202DECLARE_MSM_GPIO_PINS(17);
203DECLARE_MSM_GPIO_PINS(18);
204DECLARE_MSM_GPIO_PINS(19);
205DECLARE_MSM_GPIO_PINS(20);
206DECLARE_MSM_GPIO_PINS(21);
207DECLARE_MSM_GPIO_PINS(22);
208DECLARE_MSM_GPIO_PINS(23);
209DECLARE_MSM_GPIO_PINS(24);
210DECLARE_MSM_GPIO_PINS(25);
211DECLARE_MSM_GPIO_PINS(26);
212DECLARE_MSM_GPIO_PINS(27);
213DECLARE_MSM_GPIO_PINS(28);
214DECLARE_MSM_GPIO_PINS(29);
215DECLARE_MSM_GPIO_PINS(30);
216DECLARE_MSM_GPIO_PINS(31);
217DECLARE_MSM_GPIO_PINS(32);
218DECLARE_MSM_GPIO_PINS(33);
219DECLARE_MSM_GPIO_PINS(34);
220DECLARE_MSM_GPIO_PINS(35);
221DECLARE_MSM_GPIO_PINS(36);
222DECLARE_MSM_GPIO_PINS(37);
223DECLARE_MSM_GPIO_PINS(38);
224DECLARE_MSM_GPIO_PINS(39);
225DECLARE_MSM_GPIO_PINS(40);
226DECLARE_MSM_GPIO_PINS(41);
227DECLARE_MSM_GPIO_PINS(42);
228DECLARE_MSM_GPIO_PINS(43);
229DECLARE_MSM_GPIO_PINS(44);
230DECLARE_MSM_GPIO_PINS(45);
231DECLARE_MSM_GPIO_PINS(46);
232DECLARE_MSM_GPIO_PINS(47);
233DECLARE_MSM_GPIO_PINS(48);
234DECLARE_MSM_GPIO_PINS(49);
235DECLARE_MSM_GPIO_PINS(50);
236DECLARE_MSM_GPIO_PINS(51);
237DECLARE_MSM_GPIO_PINS(52);
238DECLARE_MSM_GPIO_PINS(53);
239DECLARE_MSM_GPIO_PINS(54);
240DECLARE_MSM_GPIO_PINS(55);
241DECLARE_MSM_GPIO_PINS(56);
242DECLARE_MSM_GPIO_PINS(57);
243DECLARE_MSM_GPIO_PINS(58);
244DECLARE_MSM_GPIO_PINS(59);
245DECLARE_MSM_GPIO_PINS(60);
246DECLARE_MSM_GPIO_PINS(61);
247DECLARE_MSM_GPIO_PINS(62);
248DECLARE_MSM_GPIO_PINS(63);
249DECLARE_MSM_GPIO_PINS(64);
250DECLARE_MSM_GPIO_PINS(65);
251DECLARE_MSM_GPIO_PINS(66);
252DECLARE_MSM_GPIO_PINS(67);
253DECLARE_MSM_GPIO_PINS(68);
254DECLARE_MSM_GPIO_PINS(69);
255DECLARE_MSM_GPIO_PINS(70);
256DECLARE_MSM_GPIO_PINS(71);
257DECLARE_MSM_GPIO_PINS(72);
258DECLARE_MSM_GPIO_PINS(73);
259DECLARE_MSM_GPIO_PINS(74);
260DECLARE_MSM_GPIO_PINS(75);
261DECLARE_MSM_GPIO_PINS(76);
262DECLARE_MSM_GPIO_PINS(77);
263DECLARE_MSM_GPIO_PINS(78);
264DECLARE_MSM_GPIO_PINS(79);
265DECLARE_MSM_GPIO_PINS(80);
266DECLARE_MSM_GPIO_PINS(81);
267DECLARE_MSM_GPIO_PINS(82);
268DECLARE_MSM_GPIO_PINS(83);
269DECLARE_MSM_GPIO_PINS(84);
270DECLARE_MSM_GPIO_PINS(85);
271DECLARE_MSM_GPIO_PINS(86);
272DECLARE_MSM_GPIO_PINS(87);
273DECLARE_MSM_GPIO_PINS(88);
274DECLARE_MSM_GPIO_PINS(89);
275DECLARE_MSM_GPIO_PINS(90);
276DECLARE_MSM_GPIO_PINS(91);
277DECLARE_MSM_GPIO_PINS(92);
278DECLARE_MSM_GPIO_PINS(93);
279DECLARE_MSM_GPIO_PINS(94);
280DECLARE_MSM_GPIO_PINS(95);
281DECLARE_MSM_GPIO_PINS(96);
282DECLARE_MSM_GPIO_PINS(97);
283DECLARE_MSM_GPIO_PINS(98);
284DECLARE_MSM_GPIO_PINS(99);
285DECLARE_MSM_GPIO_PINS(100);
286DECLARE_MSM_GPIO_PINS(101);
287DECLARE_MSM_GPIO_PINS(102);
288DECLARE_MSM_GPIO_PINS(103);
289DECLARE_MSM_GPIO_PINS(104);
290DECLARE_MSM_GPIO_PINS(105);
291DECLARE_MSM_GPIO_PINS(106);
292DECLARE_MSM_GPIO_PINS(107);
293DECLARE_MSM_GPIO_PINS(108);
294DECLARE_MSM_GPIO_PINS(109);
295DECLARE_MSM_GPIO_PINS(110);
296DECLARE_MSM_GPIO_PINS(111);
297DECLARE_MSM_GPIO_PINS(112);
298DECLARE_MSM_GPIO_PINS(113);
299DECLARE_MSM_GPIO_PINS(114);
300DECLARE_MSM_GPIO_PINS(115);
301DECLARE_MSM_GPIO_PINS(116);
302DECLARE_MSM_GPIO_PINS(117);
303DECLARE_MSM_GPIO_PINS(118);
304DECLARE_MSM_GPIO_PINS(119);
305DECLARE_MSM_GPIO_PINS(120);
306DECLARE_MSM_GPIO_PINS(121);
307DECLARE_MSM_GPIO_PINS(122);
308DECLARE_MSM_GPIO_PINS(123);
309DECLARE_MSM_GPIO_PINS(124);
310DECLARE_MSM_GPIO_PINS(125);
311DECLARE_MSM_GPIO_PINS(126);
312DECLARE_MSM_GPIO_PINS(127);
313DECLARE_MSM_GPIO_PINS(128);
314DECLARE_MSM_GPIO_PINS(129);
315DECLARE_MSM_GPIO_PINS(130);
316DECLARE_MSM_GPIO_PINS(131);
317DECLARE_MSM_GPIO_PINS(132);
318DECLARE_MSM_GPIO_PINS(133);
319DECLARE_MSM_GPIO_PINS(134);
320DECLARE_MSM_GPIO_PINS(135);
321DECLARE_MSM_GPIO_PINS(136);
322DECLARE_MSM_GPIO_PINS(137);
323DECLARE_MSM_GPIO_PINS(138);
324DECLARE_MSM_GPIO_PINS(139);
325DECLARE_MSM_GPIO_PINS(140);
326DECLARE_MSM_GPIO_PINS(141);
327DECLARE_MSM_GPIO_PINS(142);
328DECLARE_MSM_GPIO_PINS(143);
329DECLARE_MSM_GPIO_PINS(144);
330DECLARE_MSM_GPIO_PINS(145);
331DECLARE_MSM_GPIO_PINS(146);
332DECLARE_MSM_GPIO_PINS(147);
333DECLARE_MSM_GPIO_PINS(148);
334DECLARE_MSM_GPIO_PINS(149);
335DECLARE_MSM_GPIO_PINS(150);
336DECLARE_MSM_GPIO_PINS(151);
337
338static const unsigned int sdc1_clk_pins[] = { 152 };
339static const unsigned int sdc1_cmd_pins[] = { 153 };
340static const unsigned int sdc1_data_pins[] = { 154 };
341static const unsigned int sdc3_clk_pins[] = { 155 };
342static const unsigned int sdc3_cmd_pins[] = { 156 };
343static const unsigned int sdc3_data_pins[] = { 157 };
344
345#define FUNCTION(fname)					\
346	[MSM_MUX_##fname] = {				\
347		.name = #fname,				\
348		.groups = fname##_groups,		\
349		.ngroups = ARRAY_SIZE(fname##_groups),	\
350	}
351
352#define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11) \
353	{						\
354		.name = "gpio" #id,			\
355		.pins = gpio##id##_pins,		\
356		.npins = ARRAY_SIZE(gpio##id##_pins),	\
357		.funcs = (int[]){			\
358			MSM_MUX_gpio,			\
359			MSM_MUX_##f1,			\
360			MSM_MUX_##f2,			\
361			MSM_MUX_##f3,			\
362			MSM_MUX_##f4,			\
363			MSM_MUX_##f5,			\
364			MSM_MUX_##f6,			\
365			MSM_MUX_##f7,			\
366			MSM_MUX_##f8,			\
367			MSM_MUX_##f9,			\
368			MSM_MUX_##f10,			\
369			MSM_MUX_##f11			\
370		},					\
371		.nfuncs = 12,				\
372		.ctl_reg = 0x1000 + 0x10 * id,		\
373		.io_reg = 0x1004 + 0x10 * id,		\
374		.intr_cfg_reg = 0x1008 + 0x10 * id,	\
375		.intr_status_reg = 0x100c + 0x10 * id,	\
376		.intr_target_reg = 0x400 + 0x4 * id,	\
377		.mux_bit = 2,				\
378		.pull_bit = 0,				\
379		.drv_bit = 6,				\
380		.oe_bit = 9,				\
381		.in_bit = 0,				\
382		.out_bit = 1,				\
383		.intr_enable_bit = 0,			\
384		.intr_status_bit = 0,			\
385		.intr_ack_high = 1,			\
386		.intr_target_bit = 0,			\
387		.intr_target_kpss_val = 4,		\
388		.intr_raw_status_bit = 3,		\
389		.intr_polarity_bit = 1,			\
390		.intr_detection_bit = 2,		\
391		.intr_detection_width = 1,		\
392	}
393
394#define SDC_PINGROUP(pg_name, ctl, pull, drv)		\
395	{						\
396		.name = #pg_name,			\
397		.pins = pg_name##_pins,			\
398		.npins = ARRAY_SIZE(pg_name##_pins),	\
399		.ctl_reg = ctl,				\
400		.io_reg = 0,				\
401		.intr_cfg_reg = 0,			\
402		.intr_status_reg = 0,			\
403		.intr_target_reg = 0,			\
404		.mux_bit = -1,				\
405		.pull_bit = pull,			\
406		.drv_bit = drv,				\
407		.oe_bit = -1,				\
408		.in_bit = -1,				\
409		.out_bit = -1,				\
410		.intr_enable_bit = -1,			\
411		.intr_status_bit = -1,			\
412		.intr_target_bit = -1,			\
413		.intr_target_kpss_val = -1,		\
414		.intr_raw_status_bit = -1,		\
415		.intr_polarity_bit = -1,		\
416		.intr_detection_bit = -1,		\
417		.intr_detection_width = -1,		\
418	}
419
420enum msm8960_functions {
421	MSM_MUX_audio_pcm,
422	MSM_MUX_bt,
423	MSM_MUX_cam_mclk0,
424	MSM_MUX_cam_mclk1,
425	MSM_MUX_cam_mclk2,
426	MSM_MUX_codec_mic_i2s,
427	MSM_MUX_codec_spkr_i2s,
428	MSM_MUX_ext_gps,
429	MSM_MUX_fm,
430	MSM_MUX_gps_blanking,
431	MSM_MUX_gps_pps_in,
432	MSM_MUX_gps_pps_out,
433	MSM_MUX_gp_clk_0a,
434	MSM_MUX_gp_clk_0b,
435	MSM_MUX_gp_clk_1a,
436	MSM_MUX_gp_clk_1b,
437	MSM_MUX_gp_clk_2a,
438	MSM_MUX_gp_clk_2b,
439	MSM_MUX_gp_mn,
440	MSM_MUX_gp_pdm_0a,
441	MSM_MUX_gp_pdm_0b,
442	MSM_MUX_gp_pdm_1a,
443	MSM_MUX_gp_pdm_1b,
444	MSM_MUX_gp_pdm_2a,
445	MSM_MUX_gp_pdm_2b,
446	MSM_MUX_gpio,
447	MSM_MUX_gsbi1,
448	MSM_MUX_gsbi1_spi_cs1_n,
449	MSM_MUX_gsbi1_spi_cs2a_n,
450	MSM_MUX_gsbi1_spi_cs2b_n,
451	MSM_MUX_gsbi1_spi_cs3_n,
452	MSM_MUX_gsbi2,
453	MSM_MUX_gsbi2_spi_cs1_n,
454	MSM_MUX_gsbi2_spi_cs2_n,
455	MSM_MUX_gsbi2_spi_cs3_n,
456	MSM_MUX_gsbi3,
457	MSM_MUX_gsbi4,
458	MSM_MUX_gsbi4_3d_cam_i2c_l,
459	MSM_MUX_gsbi4_3d_cam_i2c_r,
460	MSM_MUX_gsbi5,
461	MSM_MUX_gsbi5_3d_cam_i2c_l,
462	MSM_MUX_gsbi5_3d_cam_i2c_r,
463	MSM_MUX_gsbi6,
464	MSM_MUX_gsbi7,
465	MSM_MUX_gsbi8,
466	MSM_MUX_gsbi9,
467	MSM_MUX_gsbi10,
468	MSM_MUX_gsbi11,
469	MSM_MUX_gsbi11_spi_cs1a_n,
470	MSM_MUX_gsbi11_spi_cs1b_n,
471	MSM_MUX_gsbi11_spi_cs2a_n,
472	MSM_MUX_gsbi11_spi_cs2b_n,
473	MSM_MUX_gsbi11_spi_cs3_n,
474	MSM_MUX_gsbi12,
475	MSM_MUX_hdmi_cec,
476	MSM_MUX_hdmi_ddc_clock,
477	MSM_MUX_hdmi_ddc_data,
478	MSM_MUX_hdmi_hot_plug_detect,
479	MSM_MUX_hsic,
480	MSM_MUX_mdp_vsync,
481	MSM_MUX_mi2s,
482	MSM_MUX_mic_i2s,
483	MSM_MUX_pmb_clk,
484	MSM_MUX_pmb_ext_ctrl,
485	MSM_MUX_ps_hold,
486	MSM_MUX_rpm_wdog,
487	MSM_MUX_sdc2,
488	MSM_MUX_sdc4,
489	MSM_MUX_sdc5,
490	MSM_MUX_slimbus1,
491	MSM_MUX_slimbus2,
492	MSM_MUX_spkr_i2s,
493	MSM_MUX_ssbi1,
494	MSM_MUX_ssbi2,
495	MSM_MUX_ssbi_ext_gps,
496	MSM_MUX_ssbi_pmic2,
497	MSM_MUX_ssbi_qpa1,
498	MSM_MUX_ssbi_ts,
499	MSM_MUX_tsif1,
500	MSM_MUX_tsif2,
501	MSM_MUX_ts_eoc,
502	MSM_MUX_usb_fs1,
503	MSM_MUX_usb_fs1_oe,
504	MSM_MUX_usb_fs1_oe_n,
505	MSM_MUX_usb_fs2,
506	MSM_MUX_usb_fs2_oe,
507	MSM_MUX_usb_fs2_oe_n,
508	MSM_MUX_vfe_camif_timer1_a,
509	MSM_MUX_vfe_camif_timer1_b,
510	MSM_MUX_vfe_camif_timer2,
511	MSM_MUX_vfe_camif_timer3_a,
512	MSM_MUX_vfe_camif_timer3_b,
513	MSM_MUX_vfe_camif_timer4_a,
514	MSM_MUX_vfe_camif_timer4_b,
515	MSM_MUX_vfe_camif_timer4_c,
516	MSM_MUX_vfe_camif_timer5_a,
517	MSM_MUX_vfe_camif_timer5_b,
518	MSM_MUX_vfe_camif_timer6_a,
519	MSM_MUX_vfe_camif_timer6_b,
520	MSM_MUX_vfe_camif_timer6_c,
521	MSM_MUX_vfe_camif_timer7_a,
522	MSM_MUX_vfe_camif_timer7_b,
523	MSM_MUX_vfe_camif_timer7_c,
524	MSM_MUX_wlan,
525	MSM_MUX_NA,
526};
527
528static const char * const audio_pcm_groups[] = {
529	"gpio63", "gpio64", "gpio65", "gpio66"
530};
531
532static const char * const bt_groups[] = {
533	"gpio28", "gpio29", "gpio83"
534};
535
536static const char * const cam_mclk0_groups[] = {
537	"gpio5"
538};
539
540static const char * const cam_mclk1_groups[] = {
541	"gpio4"
542};
543
544static const char * const cam_mclk2_groups[] = {
545	"gpio2"
546};
547
548static const char * const codec_mic_i2s_groups[] = {
549	"gpio54", "gpio55", "gpio56", "gpio57", "gpio58"
550};
551
552static const char * const codec_spkr_i2s_groups[] = {
553	"gpio59", "gpio60", "gpio61", "gpio62"
554};
555
556static const char * const ext_gps_groups[] = {
557	"gpio22", "gpio23", "gpio24", "gpio25"
558};
559
560static const char * const fm_groups[] = {
561	"gpio26", "gpio27"
562};
563
564static const char * const gps_blanking_groups[] = {
565	"gpio137"
566};
567
568static const char * const gps_pps_in_groups[] = {
569	"gpio37"
570};
571
572static const char * const gps_pps_out_groups[] = {
573	"gpio37"
574};
575
576static const char * const gp_clk_0a_groups[] = {
577	"gpio3"
578};
579
580static const char * const gp_clk_0b_groups[] = {
581	"gpio54"
582};
583
584static const char * const gp_clk_1a_groups[] = {
585	"gpio4"
586};
587
588static const char * const gp_clk_1b_groups[] = {
589	"gpio70"
590};
591
592static const char * const gp_clk_2a_groups[] = {
593	"gpio52"
594};
595
596static const char * const gp_clk_2b_groups[] = {
597	"gpio37"
598};
599
600static const char * const gp_mn_groups[] = {
601	"gpio2"
602};
603
604static const char * const gp_pdm_0a_groups[] = {
605	"gpio58"
606};
607
608static const char * const gp_pdm_0b_groups[] = {
609	"gpio39"
610};
611
612static const char * const gp_pdm_1a_groups[] = {
613	"gpio94"
614};
615
616static const char * const gp_pdm_1b_groups[] = {
617	"gpio64"
618};
619
620static const char * const gp_pdm_2a_groups[] = {
621	"gpio69"
622};
623
624static const char * const gp_pdm_2b_groups[] = {
625	"gpio53"
626};
627
628static const char * const gpio_groups[] = {
629	"gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7",
630	"gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14",
631	"gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21",
632	"gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28",
633	"gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35",
634	"gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42",
635	"gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49",
636	"gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56",
637	"gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63",
638	"gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70",
639	"gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77",
640	"gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84",
641	"gpio85", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", "gpio91",
642	"gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98",
643	"gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104",
644	"gpio105", "gpio106", "gpio107", "gpio108", "gpio109", "gpio110",
645	"gpio111", "gpio112", "gpio113", "gpio114", "gpio115", "gpio116",
646	"gpio117", "gpio118", "gpio119", "gpio120", "gpio121", "gpio122",
647	"gpio123", "gpio124", "gpio125", "gpio126", "gpio127", "gpio128",
648	"gpio129", "gpio130", "gpio131", "gpio132", "gpio133", "gpio134",
649	"gpio135", "gpio136", "gpio137", "gpio138", "gpio139", "gpio140",
650	"gpio141", "gpio142", "gpio143", "gpio144", "gpio145", "gpio146",
651	"gpio147", "gpio148", "gpio149", "gpio150", "gpio151"
652};
653
654static const char * const gsbi1_groups[] = {
655	"gpio6", "gpio7", "gpio8", "gpio9"
656};
657
658static const char * const gsbi1_spi_cs1_n_groups[] = {
659	"gpio14"
660};
661
662static const char * const gsbi1_spi_cs2a_n_groups[] = {
663	"gpio15"
664};
665
666static const char * const gsbi1_spi_cs2b_n_groups[] = {
667	"gpio17"
668};
669
670static const char * const gsbi1_spi_cs3_n_groups[] = {
671	"gpio16"
672};
673
674static const char * const gsbi2_groups[] = {
675	"gpio10", "gpio11", "gpio12", "gpio13"
676};
677
678static const char * const gsbi2_spi_cs1_n_groups[] = {
679	"gpio52"
680};
681
682static const char * const gsbi2_spi_cs2_n_groups[] = {
683	"gpio68"
684};
685
686static const char * const gsbi2_spi_cs3_n_groups[] = {
687	"gpio56"
688};
689
690static const char * const gsbi3_groups[] = {
691	"gpio14", "gpio15", "gpio16", "gpio17"
692};
693
694static const char * const gsbi4_groups[] = {
695	"gpio18", "gpio19", "gpio20", "gpio21"
696};
697
698static const char * const gsbi4_3d_cam_i2c_l_groups[] = {
699	"gpio18", "gpio19"
700};
701
702static const char * const gsbi4_3d_cam_i2c_r_groups[] = {
703	"gpio20", "gpio21"
704};
705
706static const char * const gsbi5_groups[] = {
707	"gpio22", "gpio23", "gpio24", "gpio25"
708};
709
710static const char * const gsbi5_3d_cam_i2c_l_groups[] = {
711	"gpio22", "gpio23"
712};
713
714static const char * const gsbi5_3d_cam_i2c_r_groups[] = {
715	"gpio24", "gpio25"
716};
717
718static const char * const gsbi6_groups[] = {
719	"gpio26", "gpio27", "gpio28", "gpio29"
720};
721
722static const char * const gsbi7_groups[] = {
723	"gpio30", "gpio31", "gpio32", "gpio33"
724};
725
726static const char * const gsbi8_groups[] = {
727	"gpio34", "gpio35", "gpio36", "gpio37"
728};
729
730static const char * const gsbi9_groups[] = {
731	"gpio93", "gpio94", "gpio95", "gpio96"
732};
733
734static const char * const gsbi10_groups[] = {
735	"gpio71", "gpio72", "gpio73", "gpio74"
736};
737
738static const char * const gsbi11_groups[] = {
739	"gpio38", "gpio39", "gpio40", "gpio41"
740};
741
742static const char * const gsbi11_spi_cs1a_n_groups[] = {
743	"gpio36"
744};
745
746static const char * const gsbi11_spi_cs1b_n_groups[] = {
747	"gpio18"
748};
749
750static const char * const gsbi11_spi_cs2a_n_groups[] = {
751	"gpio37"
752};
753
754static const char * const gsbi11_spi_cs2b_n_groups[] = {
755	"gpio19"
756};
757
758static const char * const gsbi11_spi_cs3_n_groups[] = {
759	"gpio76"
760};
761
762static const char * const gsbi12_groups[] = {
763	"gpio42", "gpio43", "gpio44", "gpio45"
764};
765
766static const char * const hdmi_cec_groups[] = {
767	"gpio99"
768};
769
770static const char * const hdmi_ddc_clock_groups[] = {
771	"gpio100"
772};
773
774static const char * const hdmi_ddc_data_groups[] = {
775	"gpio101"
776};
777
778static const char * const hdmi_hot_plug_detect_groups[] = {
779	"gpio102"
780};
781
782static const char * const hsic_groups[] = {
783	"gpio150", "gpio151"
784};
785
786static const char * const mdp_vsync_groups[] = {
787	"gpio0", "gpio1", "gpio19"
788};
789
790static const char * const mi2s_groups[] = {
791	"gpio47", "gpio48", "gpio49", "gpio50", "gpio51", "gpio52", "gpio53"
792};
793
794static const char * const mic_i2s_groups[] = {
795	"gpio71", "gpio72", "gpio73", "gpio74"
796};
797
798static const char * const pmb_clk_groups[] = {
799	"gpio21", "gpio86", "gpio112"
800};
801
802static const char * const pmb_ext_ctrl_groups[] = {
803	"gpio4", "gpio5"
804};
805
806static const char * const ps_hold_groups[] = {
807	"gpio108"
808};
809
810static const char * const rpm_wdog_groups[] = {
811	"gpio12"
812};
813
814static const char * const sdc2_groups[] = {
815	"gpio89", "gpio90", "gpio91", "gpio92", "gpio93", "gpio94", "gpio95",
816	"gpio96", "gpio97", "gpio98"
817};
818
819static const char * const sdc4_groups[] = {
820	"gpio83", "gpio84", "gpio85", "gpio86", "gpio87", "gpio88"
821};
822
823static const char * const sdc5_groups[] = {
824	"gpio77", "gpio78", "gpio79", "gpio80", "gpio81", "gpio82"
825};
826
827static const char * const slimbus1_groups[] = {
828	"gpio50", "gpio51", "gpio60", "gpio61"
829};
830
831static const char * const slimbus2_groups[] = {
832	"gpio42", "gpio43"
833};
834
835static const char * const spkr_i2s_groups[] = {
836	"gpio67", "gpio68", "gpio69", "gpio70"
837};
838
839static const char * const ssbi1_groups[] = {
840	"gpio141", "gpio143"
841};
842
843static const char * const ssbi2_groups[] = {
844	"gpio140", "gpio142"
845};
846
847static const char * const ssbi_ext_gps_groups[] = {
848	"gpio23"
849};
850
851static const char * const ssbi_pmic2_groups[] = {
852	"gpio149"
853};
854
855static const char * const ssbi_qpa1_groups[] = {
856	"gpio131"
857};
858
859static const char * const ssbi_ts_groups[] = {
860	"gpio10"
861};
862
863static const char * const tsif1_groups[] = {
864	"gpio75", "gpio76", "gpio77", "gpio82"
865};
866
867static const char * const tsif2_groups[] = {
868	"gpio78", "gpio79", "gpio80", "gpio81"
869};
870
871static const char * const ts_eoc_groups[] = {
872	"gpio11"
873};
874
875static const char * const usb_fs1_groups[] = {
876	"gpio32", "gpio33"
877};
878
879static const char * const usb_fs1_oe_groups[] = {
880	"gpio31"
881};
882
883static const char * const usb_fs1_oe_n_groups[] = {
884	"gpio31"
885};
886
887static const char * const usb_fs2_groups[] = {
888	"gpio34", "gpio35"
889};
890
891static const char * const usb_fs2_oe_groups[] = {
892	"gpio36"
893};
894
895static const char * const usb_fs2_oe_n_groups[] = {
896	"gpio36"
897};
898
899static const char * const vfe_camif_timer1_a_groups[] = {
900	"gpio2"
901};
902
903static const char * const vfe_camif_timer1_b_groups[] = {
904	"gpio38"
905};
906
907static const char * const vfe_camif_timer2_groups[] = {
908	"gpio3"
909};
910
911static const char * const vfe_camif_timer3_a_groups[] = {
912	"gpio4"
913};
914
915static const char * const vfe_camif_timer3_b_groups[] = {
916	"gpio151"
917};
918
919static const char * const vfe_camif_timer4_a_groups[] = {
920	"gpio65"
921};
922
923static const char * const vfe_camif_timer4_b_groups[] = {
924	"gpio150"
925};
926
927static const char * const vfe_camif_timer4_c_groups[] = {
928	"gpio10"
929};
930
931static const char * const vfe_camif_timer5_a_groups[] = {
932	"gpio66"
933};
934
935static const char * const vfe_camif_timer5_b_groups[] = {
936	"gpio39"
937};
938
939static const char * const vfe_camif_timer6_a_groups[] = {
940	"gpio71"
941};
942
943static const char * const vfe_camif_timer6_b_groups[] = {
944	"gpio0"
945};
946
947static const char * const vfe_camif_timer6_c_groups[] = {
948	"gpio18"
949};
950
951static const char * const vfe_camif_timer7_a_groups[] = {
952	"gpio67"
953};
954
955static const char * const vfe_camif_timer7_b_groups[] = {
956	"gpio1"
957};
958
959static const char * const vfe_camif_timer7_c_groups[] = {
960	"gpio19"
961};
962
963static const char * const wlan_groups[] = {
964	"gpio84", "gpio85", "gpio86", "gpio87", "gpio88"
965};
966
967static const struct msm_function msm8960_functions[] = {
968	FUNCTION(audio_pcm),
969	FUNCTION(bt),
970	FUNCTION(cam_mclk0),
971	FUNCTION(cam_mclk1),
972	FUNCTION(cam_mclk2),
973	FUNCTION(codec_mic_i2s),
974	FUNCTION(codec_spkr_i2s),
975	FUNCTION(ext_gps),
976	FUNCTION(fm),
977	FUNCTION(gps_blanking),
978	FUNCTION(gps_pps_in),
979	FUNCTION(gps_pps_out),
980	FUNCTION(gp_clk_0a),
981	FUNCTION(gp_clk_0b),
982	FUNCTION(gp_clk_1a),
983	FUNCTION(gp_clk_1b),
984	FUNCTION(gp_clk_2a),
985	FUNCTION(gp_clk_2b),
986	FUNCTION(gp_mn),
987	FUNCTION(gp_pdm_0a),
988	FUNCTION(gp_pdm_0b),
989	FUNCTION(gp_pdm_1a),
990	FUNCTION(gp_pdm_1b),
991	FUNCTION(gp_pdm_2a),
992	FUNCTION(gp_pdm_2b),
993	FUNCTION(gpio),
994	FUNCTION(gsbi1),
995	FUNCTION(gsbi1_spi_cs1_n),
996	FUNCTION(gsbi1_spi_cs2a_n),
997	FUNCTION(gsbi1_spi_cs2b_n),
998	FUNCTION(gsbi1_spi_cs3_n),
999	FUNCTION(gsbi2),
1000	FUNCTION(gsbi2_spi_cs1_n),
1001	FUNCTION(gsbi2_spi_cs2_n),
1002	FUNCTION(gsbi2_spi_cs3_n),
1003	FUNCTION(gsbi3),
1004	FUNCTION(gsbi4),
1005	FUNCTION(gsbi4_3d_cam_i2c_l),
1006	FUNCTION(gsbi4_3d_cam_i2c_r),
1007	FUNCTION(gsbi5),
1008	FUNCTION(gsbi5_3d_cam_i2c_l),
1009	FUNCTION(gsbi5_3d_cam_i2c_r),
1010	FUNCTION(gsbi6),
1011	FUNCTION(gsbi7),
1012	FUNCTION(gsbi8),
1013	FUNCTION(gsbi9),
1014	FUNCTION(gsbi10),
1015	FUNCTION(gsbi11),
1016	FUNCTION(gsbi11_spi_cs1a_n),
1017	FUNCTION(gsbi11_spi_cs1b_n),
1018	FUNCTION(gsbi11_spi_cs2a_n),
1019	FUNCTION(gsbi11_spi_cs2b_n),
1020	FUNCTION(gsbi11_spi_cs3_n),
1021	FUNCTION(gsbi12),
1022	FUNCTION(hdmi_cec),
1023	FUNCTION(hdmi_ddc_clock),
1024	FUNCTION(hdmi_ddc_data),
1025	FUNCTION(hdmi_hot_plug_detect),
1026	FUNCTION(hsic),
1027	FUNCTION(mdp_vsync),
1028	FUNCTION(mi2s),
1029	FUNCTION(mic_i2s),
1030	FUNCTION(pmb_clk),
1031	FUNCTION(pmb_ext_ctrl),
1032	FUNCTION(ps_hold),
1033	FUNCTION(rpm_wdog),
1034	FUNCTION(sdc2),
1035	FUNCTION(sdc4),
1036	FUNCTION(sdc5),
1037	FUNCTION(slimbus1),
1038	FUNCTION(slimbus2),
1039	FUNCTION(spkr_i2s),
1040	FUNCTION(ssbi1),
1041	FUNCTION(ssbi2),
1042	FUNCTION(ssbi_ext_gps),
1043	FUNCTION(ssbi_pmic2),
1044	FUNCTION(ssbi_qpa1),
1045	FUNCTION(ssbi_ts),
1046	FUNCTION(tsif1),
1047	FUNCTION(tsif2),
1048	FUNCTION(ts_eoc),
1049	FUNCTION(usb_fs1),
1050	FUNCTION(usb_fs1_oe),
1051	FUNCTION(usb_fs1_oe_n),
1052	FUNCTION(usb_fs2),
1053	FUNCTION(usb_fs2_oe),
1054	FUNCTION(usb_fs2_oe_n),
1055	FUNCTION(vfe_camif_timer1_a),
1056	FUNCTION(vfe_camif_timer1_b),
1057	FUNCTION(vfe_camif_timer2),
1058	FUNCTION(vfe_camif_timer3_a),
1059	FUNCTION(vfe_camif_timer3_b),
1060	FUNCTION(vfe_camif_timer4_a),
1061	FUNCTION(vfe_camif_timer4_b),
1062	FUNCTION(vfe_camif_timer4_c),
1063	FUNCTION(vfe_camif_timer5_a),
1064	FUNCTION(vfe_camif_timer5_b),
1065	FUNCTION(vfe_camif_timer6_a),
1066	FUNCTION(vfe_camif_timer6_b),
1067	FUNCTION(vfe_camif_timer6_c),
1068	FUNCTION(vfe_camif_timer7_a),
1069	FUNCTION(vfe_camif_timer7_b),
1070	FUNCTION(vfe_camif_timer7_c),
1071	FUNCTION(wlan),
1072};
1073
1074static const struct msm_pingroup msm8960_groups[] = {
1075	PINGROUP(0, mdp_vsync, vfe_camif_timer6_b, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1076	PINGROUP(1, mdp_vsync, vfe_camif_timer7_b, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1077	PINGROUP(2, vfe_camif_timer1_a, gp_mn, NA, cam_mclk2, NA, NA, NA, NA, NA, NA, NA),
1078	PINGROUP(3, vfe_camif_timer2, gp_clk_0a, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1079	PINGROUP(4, vfe_camif_timer3_a, cam_mclk1, gp_clk_1a, pmb_ext_ctrl, NA, NA, NA, NA, NA, NA, NA),
1080	PINGROUP(5, cam_mclk0, pmb_ext_ctrl, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1081	PINGROUP(6, gsbi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1082	PINGROUP(7, gsbi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1083	PINGROUP(8, gsbi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1084	PINGROUP(9, gsbi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1085	PINGROUP(10, gsbi2, ssbi_ts, NA, vfe_camif_timer4_c, NA, NA, NA, NA, NA, NA, NA),
1086	PINGROUP(11, gsbi2, ts_eoc, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1087	PINGROUP(12, gsbi2, rpm_wdog, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1088	PINGROUP(13, gsbi2, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1089	PINGROUP(14, gsbi3, gsbi1_spi_cs1_n, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1090	PINGROUP(15, gsbi3, gsbi1_spi_cs2a_n, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1091	PINGROUP(16, gsbi3, gsbi1_spi_cs3_n, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1092	PINGROUP(17, gsbi3, gsbi1_spi_cs2b_n, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1093	PINGROUP(18, gsbi4, gsbi11_spi_cs1b_n, NA, NA, gsbi4_3d_cam_i2c_l, vfe_camif_timer6_c, NA, NA, NA, NA, NA),
1094	PINGROUP(19, gsbi4, gsbi11_spi_cs2b_n, NA, mdp_vsync, NA, gsbi4_3d_cam_i2c_l, vfe_camif_timer7_c, NA, NA, NA, NA),
1095	PINGROUP(20, gsbi4, gsbi4_3d_cam_i2c_r, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1096	PINGROUP(21, gsbi4, pmb_clk, gsbi4_3d_cam_i2c_r, NA, NA, NA, NA, NA, NA, NA, NA),
1097	PINGROUP(22, gsbi5, ext_gps, NA, NA, NA, NA, NA, NA, NA, gsbi5_3d_cam_i2c_l, NA),
1098	PINGROUP(23, gsbi5, ssbi_ext_gps, NA, NA, NA, NA, NA, NA, NA, gsbi5_3d_cam_i2c_l, NA),
1099	PINGROUP(24, gsbi5, ext_gps, NA, NA, NA, NA, NA, NA, NA, gsbi5_3d_cam_i2c_r, NA),
1100	PINGROUP(25, gsbi5, ext_gps, NA, NA, NA, NA, NA, NA, NA, gsbi5_3d_cam_i2c_r, NA),
1101	PINGROUP(26, fm, gsbi6, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1102	PINGROUP(27, fm, gsbi6, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1103	PINGROUP(28, bt, gsbi6, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1104	PINGROUP(29, bt, gsbi6, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1105	PINGROUP(30, gsbi7, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1106	PINGROUP(31, gsbi7, usb_fs1_oe, usb_fs1_oe_n, NA, NA, NA, NA, NA, NA, NA, NA),
1107	PINGROUP(32, gsbi7, usb_fs1, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1108	PINGROUP(33, gsbi7, usb_fs1, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1109	PINGROUP(34, gsbi8, usb_fs2, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1110	PINGROUP(35, gsbi8, usb_fs2, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1111	PINGROUP(36, gsbi8, usb_fs2_oe, usb_fs2_oe_n, gsbi11_spi_cs1a_n, NA, NA, NA, NA, NA, NA, NA),
1112	PINGROUP(37, gsbi8, gps_pps_out, gps_pps_in, gsbi11_spi_cs2a_n, gp_clk_2b, NA, NA, NA, NA, NA, NA),
1113	PINGROUP(38, gsbi11, NA, NA, NA, NA, NA, NA, NA, NA, vfe_camif_timer1_b, NA),
1114	PINGROUP(39, gsbi11, gp_pdm_0b, NA, NA, NA, NA, NA, NA, NA, NA, vfe_camif_timer5_b),
1115	PINGROUP(40, gsbi11, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1116	PINGROUP(41, gsbi11, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1117	PINGROUP(42, gsbi12, slimbus2, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1118	PINGROUP(43, gsbi12, slimbus2, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1119	PINGROUP(44, gsbi12, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1120	PINGROUP(45, gsbi12, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1121	PINGROUP(46, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1122	PINGROUP(47, mi2s, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1123	PINGROUP(48, mi2s, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1124	PINGROUP(49, mi2s, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1125	PINGROUP(50, mi2s, slimbus1, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1126	PINGROUP(51, mi2s, slimbus1, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1127	PINGROUP(52, mi2s, gp_clk_2a, gsbi2_spi_cs1_n, NA, NA, NA, NA, NA, NA, NA, NA),
1128	PINGROUP(53, mi2s, gp_pdm_2b, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1129	PINGROUP(54, codec_mic_i2s, gp_clk_0b, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1130	PINGROUP(55, codec_mic_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1131	PINGROUP(56, codec_mic_i2s, gsbi2_spi_cs3_n, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1132	PINGROUP(57, codec_mic_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1133	PINGROUP(58, codec_mic_i2s, gp_pdm_0a, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1134	PINGROUP(59, codec_spkr_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1135	PINGROUP(60, slimbus1, codec_spkr_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1136	PINGROUP(61, slimbus1, codec_spkr_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1137	PINGROUP(62, codec_spkr_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1138	PINGROUP(63, audio_pcm, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1139	PINGROUP(64, audio_pcm, gp_pdm_1b, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1140	PINGROUP(65, audio_pcm, vfe_camif_timer4_a, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1141	PINGROUP(66, audio_pcm, vfe_camif_timer5_a, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1142	PINGROUP(67, spkr_i2s, vfe_camif_timer7_a, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1143	PINGROUP(68, spkr_i2s, gsbi2_spi_cs2_n, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1144	PINGROUP(69, spkr_i2s, gp_pdm_2a, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1145	PINGROUP(70, spkr_i2s, gp_clk_1b, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1146	PINGROUP(71, mic_i2s, gsbi10, vfe_camif_timer6_a, NA, NA, NA, NA, NA, NA, NA, NA),
1147	PINGROUP(72, mic_i2s, gsbi10, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1148	PINGROUP(73, mic_i2s, gsbi10, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1149	PINGROUP(74, mic_i2s, gsbi10, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1150	PINGROUP(75, tsif1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1151	PINGROUP(76, tsif1, gsbi11_spi_cs3_n, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1152	PINGROUP(77, tsif1, sdc5, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1153	PINGROUP(78, tsif2, sdc5, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1154	PINGROUP(79, tsif2, sdc5, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1155	PINGROUP(80, tsif2, sdc5, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1156	PINGROUP(81, tsif2, sdc5, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1157	PINGROUP(82, tsif1, sdc5, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1158	PINGROUP(83, bt, sdc4, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1159	PINGROUP(84, wlan, sdc4, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1160	PINGROUP(85, wlan, sdc4, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1161	PINGROUP(86, wlan, sdc4, pmb_clk, NA, NA, NA, NA, NA, NA, NA, NA),
1162	PINGROUP(87, wlan, sdc4, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1163	PINGROUP(88, wlan, sdc4, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1164	PINGROUP(89, sdc2, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1165	PINGROUP(90, sdc2, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1166	PINGROUP(91, sdc2, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1167	PINGROUP(92, sdc2, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1168	PINGROUP(93, sdc2, gsbi9, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1169	PINGROUP(94, sdc2, gsbi9, gp_pdm_1a, NA, NA, NA, NA, NA, NA, NA, NA),
1170	PINGROUP(95, sdc2, gsbi9, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1171	PINGROUP(96, sdc2, gsbi9, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1172	PINGROUP(97, sdc2, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1173	PINGROUP(98, sdc2, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1174	PINGROUP(99, hdmi_cec, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1175	PINGROUP(100, hdmi_ddc_clock, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1176	PINGROUP(101, hdmi_ddc_data, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1177	PINGROUP(102, hdmi_hot_plug_detect, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1178	PINGROUP(103, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1179	PINGROUP(104, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1180	PINGROUP(105, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1181	PINGROUP(106, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1182	PINGROUP(107, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1183	PINGROUP(108, ps_hold, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1184	PINGROUP(109, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1185	PINGROUP(110, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1186	PINGROUP(111, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1187	PINGROUP(112, NA, pmb_clk, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1188	PINGROUP(113, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1189	PINGROUP(114, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1190	PINGROUP(115, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1191	PINGROUP(116, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1192	PINGROUP(117, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1193	PINGROUP(118, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1194	PINGROUP(119, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1195	PINGROUP(120, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1196	PINGROUP(121, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1197	PINGROUP(122, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1198	PINGROUP(123, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1199	PINGROUP(124, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1200	PINGROUP(125, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1201	PINGROUP(126, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1202	PINGROUP(127, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1203	PINGROUP(128, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1204	PINGROUP(129, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1205	PINGROUP(130, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1206	PINGROUP(131, NA, ssbi_qpa1, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1207	PINGROUP(132, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1208	PINGROUP(133, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1209	PINGROUP(134, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1210	PINGROUP(135, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1211	PINGROUP(136, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1212	PINGROUP(137, gps_blanking, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1213	PINGROUP(138, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1214	PINGROUP(139, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1215	PINGROUP(140, ssbi2, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1216	PINGROUP(141, ssbi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1217	PINGROUP(142, ssbi2, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1218	PINGROUP(143, ssbi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1219	PINGROUP(144, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1220	PINGROUP(145, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1221	PINGROUP(146, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1222	PINGROUP(147, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1223	PINGROUP(148, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1224	PINGROUP(149, ssbi_pmic2, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
1225	PINGROUP(150, hsic, NA, vfe_camif_timer4_b, NA, NA, NA, NA, NA, NA, NA, NA),
1226	PINGROUP(151, hsic, NA, vfe_camif_timer3_b, NA, NA, NA, NA, NA, NA, NA, NA),
1227
1228	SDC_PINGROUP(sdc1_clk, 0x20a0, 13, 6),
1229	SDC_PINGROUP(sdc1_cmd, 0x20a0, 11, 3),
1230	SDC_PINGROUP(sdc1_data, 0x20a0, 9, 0),
1231
1232	SDC_PINGROUP(sdc3_clk, 0x20a4, 14, 6),
1233	SDC_PINGROUP(sdc3_cmd, 0x20a4, 11, 3),
1234	SDC_PINGROUP(sdc3_data, 0x20a4, 9, 0),
1235};
1236
1237#define NUM_GPIO_PINGROUPS 152
1238
1239static const struct msm_pinctrl_soc_data msm8960_pinctrl = {
1240	.pins = msm8960_pins,
1241	.npins = ARRAY_SIZE(msm8960_pins),
1242	.functions = msm8960_functions,
1243	.nfunctions = ARRAY_SIZE(msm8960_functions),
1244	.groups = msm8960_groups,
1245	.ngroups = ARRAY_SIZE(msm8960_groups),
1246	.ngpios = NUM_GPIO_PINGROUPS,
1247};
1248
1249static int msm8960_pinctrl_probe(struct platform_device *pdev)
1250{
1251	return msm_pinctrl_probe(pdev, &msm8960_pinctrl);
1252}
1253
1254static const struct of_device_id msm8960_pinctrl_of_match[] = {
1255	{ .compatible = "qcom,msm8960-pinctrl", },
1256	{ },
1257};
1258
1259static struct platform_driver msm8960_pinctrl_driver = {
1260	.driver = {
1261		.name = "msm8960-pinctrl",
1262		.of_match_table = msm8960_pinctrl_of_match,
1263	},
1264	.probe = msm8960_pinctrl_probe,
1265	.remove = msm_pinctrl_remove,
1266};
1267
1268static int __init msm8960_pinctrl_init(void)
1269{
1270	return platform_driver_register(&msm8960_pinctrl_driver);
1271}
1272arch_initcall(msm8960_pinctrl_init);
1273
1274static void __exit msm8960_pinctrl_exit(void)
1275{
1276	platform_driver_unregister(&msm8960_pinctrl_driver);
1277}
1278module_exit(msm8960_pinctrl_exit);
1279
1280MODULE_AUTHOR("Bjorn Andersson <bjorn.andersson@sonymobile.com>");
1281MODULE_DESCRIPTION("Qualcomm MSM8960 pinctrl driver");
1282MODULE_LICENSE("GPL v2");
1283MODULE_DEVICE_TABLE(of, msm8960_pinctrl_of_match);
1284