blob: 51cc8d561290a5461f01b4d0b27f1f3abdb78baf [file] [log] [blame]
Pratibhasagar V26cf2652012-01-12 17:31:21 +05301/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13
Steve Mucklef132c6c2012-06-06 18:30:57 -070014#include <linux/gpio.h>
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -080015#include <asm/mach-types.h>
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -080016#include <mach/gpiomux.h>
17#include <mach/socinfo.h>
18#include "devices.h"
Stepan Moskovchenko5a83dba2011-12-05 17:30:17 -080019#include "board-8960.h"
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -080020
21/* The SPI configurations apply to GSBI 1*/
22static struct gpiomux_setting spi_active = {
23 .func = GPIOMUX_FUNC_1,
24 .drv = GPIOMUX_DRV_12MA,
25 .pull = GPIOMUX_PULL_NONE,
26};
27
28static struct gpiomux_setting spi_suspended_config = {
29 .func = GPIOMUX_FUNC_GPIO,
30 .drv = GPIOMUX_DRV_2MA,
31 .pull = GPIOMUX_PULL_DOWN,
32};
33
34static struct gpiomux_setting spi_active_config2 = {
35 .func = GPIOMUX_FUNC_2,
36 .drv = GPIOMUX_DRV_8MA,
37 .pull = GPIOMUX_PULL_NONE,
38};
39
40static struct gpiomux_setting spi_suspended_config2 = {
41 .func = GPIOMUX_FUNC_GPIO,
42 .drv = GPIOMUX_DRV_2MA,
43 .pull = GPIOMUX_PULL_UP,
44};
45
46static struct gpiomux_setting gsbi3_suspended_cfg = {
47 .func = GPIOMUX_FUNC_1,
48 .drv = GPIOMUX_DRV_2MA,
49 .pull = GPIOMUX_PULL_KEEPER,
50};
51
52static struct gpiomux_setting gsbi3_active_cfg = {
53 .func = GPIOMUX_FUNC_1,
54 .drv = GPIOMUX_DRV_8MA,
55 .pull = GPIOMUX_PULL_NONE,
56};
57
Satish Babu Patakokila95d659d2012-05-10 14:42:46 +053058static struct gpiomux_setting external_vfr[] = {
59 /* Suspended state */
60 {
61 .func = GPIOMUX_FUNC_3,
62 .drv = GPIOMUX_DRV_2MA,
63 .pull = GPIOMUX_PULL_KEEPER,
64 },
65 /* Active state */
66 {
67 .func = GPIOMUX_FUNC_3,
68 .drv = GPIOMUX_DRV_2MA,
69 .pull = GPIOMUX_PULL_KEEPER,
70 },
71};
72
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -070073static struct gpiomux_setting gsbi_uart = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -080074 .func = GPIOMUX_FUNC_1,
75 .drv = GPIOMUX_DRV_8MA,
76 .pull = GPIOMUX_PULL_NONE,
77};
78
Mayank Rana1f02d952012-07-04 19:11:20 +053079static struct gpiomux_setting gsbi8_uartdm_active_cfg = {
80 .func = GPIOMUX_FUNC_1,
81 .drv = GPIOMUX_DRV_8MA,
82 .pull = GPIOMUX_PULL_NONE,
83};
84
85static struct gpiomux_setting gsbi8_uartdm_suspended_cfg = {
86 .func = GPIOMUX_FUNC_GPIO,
87 .drv = GPIOMUX_DRV_2MA,
88 .pull = GPIOMUX_PULL_DOWN,
89};
90
Mayank Ranae009c922012-03-22 03:02:06 +053091static struct gpiomux_setting gsbi9_active_cfg = {
92 .func = GPIOMUX_FUNC_2,
93 .drv = GPIOMUX_DRV_8MA,
94 .pull = GPIOMUX_PULL_DOWN,
95};
96
97static struct gpiomux_setting gsbi9_suspended_cfg = {
98 .func = GPIOMUX_FUNC_2,
99 .drv = GPIOMUX_DRV_2MA,
100 .pull = GPIOMUX_PULL_DOWN,
101};
102
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800103static struct gpiomux_setting gsbi10 = {
104 .func = GPIOMUX_FUNC_2,
105 .drv = GPIOMUX_DRV_8MA,
106 .pull = GPIOMUX_PULL_NONE,
107};
108
109static struct gpiomux_setting gsbi12 = {
110 .func = GPIOMUX_FUNC_1,
111 .drv = GPIOMUX_DRV_8MA,
112 .pull = GPIOMUX_PULL_NONE,
113};
114
115static struct gpiomux_setting cdc_mclk = {
116 .func = GPIOMUX_FUNC_1,
117 .drv = GPIOMUX_DRV_8MA,
118 .pull = GPIOMUX_PULL_NONE,
119};
120
121static struct gpiomux_setting audio_auxpcm[] = {
122 /* Suspended state */
123 {
124 .func = GPIOMUX_FUNC_GPIO,
125 .drv = GPIOMUX_DRV_2MA,
Patrick Laib593eaf2012-01-05 22:14:47 -0800126 .pull = GPIOMUX_PULL_DOWN,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800127 },
128 /* Active state */
129 {
130 .func = GPIOMUX_FUNC_1,
131 .drv = GPIOMUX_DRV_2MA,
132 .pull = GPIOMUX_PULL_NONE,
133 },
134};
135
136#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
137static struct gpiomux_setting gpio_eth_config = {
138 .pull = GPIOMUX_PULL_NONE,
139 .drv = GPIOMUX_DRV_8MA,
140 .func = GPIOMUX_FUNC_GPIO,
141};
142#endif
143
144static struct gpiomux_setting slimbus = {
145 .func = GPIOMUX_FUNC_1,
146 .drv = GPIOMUX_DRV_8MA,
147 .pull = GPIOMUX_PULL_KEEPER,
148};
149
150static struct gpiomux_setting wcnss_5wire_suspend_cfg = {
151 .func = GPIOMUX_FUNC_GPIO,
152 .drv = GPIOMUX_DRV_2MA,
153 .pull = GPIOMUX_PULL_UP,
154};
155
156static struct gpiomux_setting wcnss_5wire_active_cfg = {
157 .func = GPIOMUX_FUNC_1,
158 .drv = GPIOMUX_DRV_6MA,
159 .pull = GPIOMUX_PULL_DOWN,
160};
161
162static struct gpiomux_setting cyts_resout_sus_cfg = {
163 .func = GPIOMUX_FUNC_GPIO,
164 .drv = GPIOMUX_DRV_6MA,
165 .pull = GPIOMUX_PULL_UP,
166};
167
168static struct gpiomux_setting cyts_resout_act_cfg = {
169 .func = GPIOMUX_FUNC_GPIO,
170 .drv = GPIOMUX_DRV_6MA,
171 .pull = GPIOMUX_PULL_UP,
172};
173
174static struct gpiomux_setting cyts_sleep_sus_cfg = {
175 .func = GPIOMUX_FUNC_GPIO,
176 .drv = GPIOMUX_DRV_6MA,
177 .pull = GPIOMUX_PULL_DOWN,
178};
179
180static struct gpiomux_setting cyts_sleep_act_cfg = {
181 .func = GPIOMUX_FUNC_GPIO,
182 .drv = GPIOMUX_DRV_6MA,
183 .pull = GPIOMUX_PULL_DOWN,
184};
185
186static struct gpiomux_setting cyts_int_act_cfg = {
187 .func = GPIOMUX_FUNC_GPIO,
188 .drv = GPIOMUX_DRV_8MA,
189 .pull = GPIOMUX_PULL_UP,
190};
191
192static struct gpiomux_setting cyts_int_sus_cfg = {
193 .func = GPIOMUX_FUNC_GPIO,
194 .drv = GPIOMUX_DRV_2MA,
195 .pull = GPIOMUX_PULL_DOWN,
196};
197
198#ifdef CONFIG_USB_EHCI_MSM_HSIC
199static struct gpiomux_setting hsic_act_cfg = {
200 .func = GPIOMUX_FUNC_1,
201 .drv = GPIOMUX_DRV_12MA,
202 .pull = GPIOMUX_PULL_NONE,
203};
204
205static struct gpiomux_setting hsic_sus_cfg = {
206 .func = GPIOMUX_FUNC_GPIO,
207 .drv = GPIOMUX_DRV_2MA,
208 .pull = GPIOMUX_PULL_DOWN,
209 .dir = GPIOMUX_OUT_LOW,
210};
211
212static struct gpiomux_setting hsic_hub_act_cfg = {
213 .func = GPIOMUX_FUNC_GPIO,
214 .drv = GPIOMUX_DRV_2MA,
215 .pull = GPIOMUX_PULL_NONE,
216};
217#endif
218
219static struct gpiomux_setting hap_lvl_shft_suspended_config = {
220 .func = GPIOMUX_FUNC_GPIO,
221 .drv = GPIOMUX_DRV_2MA,
222 .pull = GPIOMUX_PULL_DOWN,
223};
224
225static struct gpiomux_setting hap_lvl_shft_active_config = {
226 .func = GPIOMUX_FUNC_GPIO,
227 .drv = GPIOMUX_DRV_8MA,
228 .pull = GPIOMUX_PULL_UP,
229};
230
231static struct gpiomux_setting ap2mdm_cfg = {
232 .func = GPIOMUX_FUNC_GPIO,
233 .drv = GPIOMUX_DRV_8MA,
234 .pull = GPIOMUX_PULL_DOWN,
235};
236
237static struct gpiomux_setting mdm2ap_status_cfg = {
238 .func = GPIOMUX_FUNC_GPIO,
239 .drv = GPIOMUX_DRV_8MA,
240 .pull = GPIOMUX_PULL_NONE,
241};
242
243static struct gpiomux_setting mdm2ap_errfatal_cfg = {
244 .func = GPIOMUX_FUNC_GPIO,
245 .drv = GPIOMUX_DRV_16MA,
246 .pull = GPIOMUX_PULL_DOWN,
247};
248
249static struct gpiomux_setting ap2mdm_kpdpwr_n_cfg = {
250 .func = GPIOMUX_FUNC_GPIO,
251 .drv = GPIOMUX_DRV_8MA,
Joel King1c607312012-01-13 16:41:44 -0800252 .pull = GPIOMUX_PULL_DOWN,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800253};
254
Ameya Thakur43248fd2012-07-10 18:50:52 -0700255static struct gpiomux_setting usbsw_cfg = {
256 .func = GPIOMUX_FUNC_GPIO,
257 .drv = GPIOMUX_DRV_8MA,
258 .pull = GPIOMUX_PULL_DOWN,
259};
260
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800261static struct gpiomux_setting mdp_vsync_suspend_cfg = {
262 .func = GPIOMUX_FUNC_GPIO,
263 .drv = GPIOMUX_DRV_2MA,
264 .pull = GPIOMUX_PULL_DOWN,
265};
266
267static struct gpiomux_setting mdp_vsync_active_cfg = {
268 .func = GPIOMUX_FUNC_1,
269 .drv = GPIOMUX_DRV_2MA,
270 .pull = GPIOMUX_PULL_DOWN,
271};
272
273#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
274static struct gpiomux_setting hdmi_suspend_cfg = {
275 .func = GPIOMUX_FUNC_GPIO,
276 .drv = GPIOMUX_DRV_2MA,
277 .pull = GPIOMUX_PULL_DOWN,
278};
279
280static struct gpiomux_setting hdmi_active_1_cfg = {
281 .func = GPIOMUX_FUNC_1,
282 .drv = GPIOMUX_DRV_2MA,
283 .pull = GPIOMUX_PULL_UP,
284};
285
286static struct gpiomux_setting hdmi_active_2_cfg = {
287 .func = GPIOMUX_FUNC_1,
288 .drv = GPIOMUX_DRV_2MA,
289 .pull = GPIOMUX_PULL_DOWN,
290};
Eugene Yasman67592342011-12-11 13:12:36 +0200291
Manoj Rao14648742012-03-30 19:42:12 -0700292#if defined(CONFIG_FB_MSM_HDMI_MHL_8334) || defined(CONFIG_FB_MSM_HDMI_MHL_9244)
Eugene Yasman67592342011-12-11 13:12:36 +0200293static struct gpiomux_setting hdmi_active_3_cfg = {
294 .func = GPIOMUX_FUNC_GPIO,
295 .drv = GPIOMUX_DRV_2MA,
Eugene Yasmana2db4162011-12-13 09:28:22 +0200296 .pull = GPIOMUX_PULL_UP,
Eugene Yasman67592342011-12-11 13:12:36 +0200297 .dir = GPIOMUX_IN,
298};
299
300static struct gpiomux_setting hdmi_active_4_cfg = {
301 .func = GPIOMUX_FUNC_GPIO,
302 .drv = GPIOMUX_DRV_2MA,
303 .pull = GPIOMUX_PULL_UP,
304 .dir = GPIOMUX_OUT_HIGH,
305};
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800306#endif
Manoj Rao14648742012-03-30 19:42:12 -0700307#endif
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800308
309#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
310static struct msm_gpiomux_config msm8960_ethernet_configs[] = {
311 {
312 .gpio = 90,
313 .settings = {
314 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
315 }
316 },
317 {
318 .gpio = 89,
319 .settings = {
320 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
321 }
322 },
323};
324#endif
Mayank Rana1f02d952012-07-04 19:11:20 +0530325/* GSBI8 UART GPIOs for Atheros Bluetooth */
326static struct msm_gpiomux_config msm8960_gsbi8_uartdm_configs[] = {
327 {
328 .gpio = 34,
329 .settings = {
330 [GPIOMUX_SUSPENDED] = &gsbi8_uartdm_suspended_cfg,
331 [GPIOMUX_ACTIVE] = &gsbi8_uartdm_active_cfg,
332 }
333 },
334 {
335 .gpio = 35,
336 .settings = {
337 [GPIOMUX_SUSPENDED] = &gsbi8_uartdm_suspended_cfg,
338 [GPIOMUX_ACTIVE] = &gsbi8_uartdm_active_cfg,
339 }
340 },
341 {
342 .gpio = 36,
343 .settings = {
344 [GPIOMUX_SUSPENDED] = &gsbi8_uartdm_suspended_cfg,
345 [GPIOMUX_ACTIVE] = &gsbi8_uartdm_active_cfg,
346 }
347 },
348 {
349 .gpio = 37,
350 .settings = {
351 [GPIOMUX_SUSPENDED] = &gsbi8_uartdm_suspended_cfg,
352 [GPIOMUX_ACTIVE] = &gsbi8_uartdm_active_cfg,
353 }
354 },
355};
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800356
Mayank Ranae009c922012-03-22 03:02:06 +0530357static struct msm_gpiomux_config msm8960_fusion_gsbi_configs[] = {
358 {
359 .gpio = 93,
360 .settings = {
361 [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg,
362 [GPIOMUX_ACTIVE] = &gsbi9_active_cfg,
363 }
364 },
365 {
366 .gpio = 94,
367 .settings = {
368 [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg,
369 [GPIOMUX_ACTIVE] = &gsbi9_active_cfg,
370 }
371 },
372 {
373 .gpio = 95,
374 .settings = {
375 [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg,
376 [GPIOMUX_ACTIVE] = &gsbi9_active_cfg,
377 }
378 },
379 {
380 .gpio = 96,
381 .settings = {
382 [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg,
383 [GPIOMUX_ACTIVE] = &gsbi9_active_cfg,
384 }
385 },
386};
387
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800388static struct msm_gpiomux_config msm8960_gsbi_configs[] __initdata = {
389 {
390 .gpio = 6, /* GSBI1 QUP SPI_DATA_MOSI */
391 .settings = {
392 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
393 [GPIOMUX_ACTIVE] = &spi_active,
394 },
395 },
396 {
397 .gpio = 7, /* GSBI1 QUP SPI_DATA_MISO */
398 .settings = {
399 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
400 [GPIOMUX_ACTIVE] = &spi_active,
401 },
402 },
403 {
404 .gpio = 8, /* GSBI1 QUP SPI_CS_N */
405 .settings = {
406 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
407 [GPIOMUX_ACTIVE] = &spi_active,
408 },
409 },
410 {
411 .gpio = 9, /* GSBI1 QUP SPI_CLK */
412 .settings = {
413 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
414 [GPIOMUX_ACTIVE] = &spi_active,
415 },
416 },
417 {
418 .gpio = 14, /* GSBI1 SPI_CS_1 */
419 .settings = {
420 [GPIOMUX_SUSPENDED] = &spi_suspended_config2,
421 [GPIOMUX_ACTIVE] = &spi_active_config2,
422 },
423 },
424 {
425 .gpio = 16, /* GSBI3 I2C QUP SDA */
426 .settings = {
427 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
428 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
429 },
430 },
431 {
432 .gpio = 17, /* GSBI3 I2C QUP SCL */
433 .settings = {
434 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
435 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
436 },
437 },
438 {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800439 .gpio = 44, /* GSBI12 I2C QUP SDA */
440 .settings = {
441 [GPIOMUX_SUSPENDED] = &gsbi12,
442 },
443 },
444 {
445 .gpio = 45, /* GSBI12 I2C QUP SCL */
446 .settings = {
447 [GPIOMUX_SUSPENDED] = &gsbi12,
448 },
449 },
450 {
451 .gpio = 73, /* GSBI10 I2C QUP SDA */
452 .settings = {
453 [GPIOMUX_SUSPENDED] = &gsbi10,
454 },
455 },
456 {
457 .gpio = 74, /* GSBI10 I2C QUP SCL */
458 .settings = {
459 [GPIOMUX_SUSPENDED] = &gsbi10,
460 },
461 },
462};
463
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -0700464static struct msm_gpiomux_config msm8960_gsbi5_uart_configs[] __initdata = {
465 {
466 .gpio = 22, /* GSBI5 UART2 */
467 .settings = {
468 [GPIOMUX_SUSPENDED] = &gsbi_uart,
469 },
470 },
471 {
472 .gpio = 23, /* GSBI5 UART2 */
473 .settings = {
474 [GPIOMUX_SUSPENDED] = &gsbi_uart,
475 },
476 },
477 {
478 .gpio = 24, /* GSBI5 UART2 */
479 .settings = {
480 [GPIOMUX_SUSPENDED] = &gsbi_uart,
481 },
482 },
483 {
484 .gpio = 25, /* GSBI5 UART2 */
485 .settings = {
486 [GPIOMUX_SUSPENDED] = &gsbi_uart,
487 },
488 },
489};
490
Satish Babu Patakokila95d659d2012-05-10 14:42:46 +0530491static struct msm_gpiomux_config msm8960_external_vfr_configs[] __initdata = {
492 {
493 .gpio = 23, /* EXTERNAL VFR */
494 .settings = {
495 [GPIOMUX_SUSPENDED] = &external_vfr[0],
496 [GPIOMUX_ACTIVE] = &external_vfr[1],
497 },
498 },
499};
500
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -0700501static struct msm_gpiomux_config msm8960_gsbi8_uart_configs[] __initdata = {
502 {
503 .gpio = 34, /* GSBI8 UART3 */
504 .settings = {
505 [GPIOMUX_SUSPENDED] = &gsbi_uart,
506 },
507 },
508 {
509 .gpio = 35, /* GSBI8 UART3 */
510 .settings = {
511 [GPIOMUX_SUSPENDED] = &gsbi_uart,
512 },
513 },
514 {
515 .gpio = 36, /* GSBI8 UART3 */
516 .settings = {
517 [GPIOMUX_SUSPENDED] = &gsbi_uart,
518 },
519 },
520 {
521 .gpio = 37, /* GSBI8 UART3 */
522 .settings = {
523 [GPIOMUX_SUSPENDED] = &gsbi_uart,
524 },
525 },
526};
527
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800528static struct msm_gpiomux_config msm8960_slimbus_config[] __initdata = {
529 {
530 .gpio = 60, /* slimbus data */
531 .settings = {
532 [GPIOMUX_SUSPENDED] = &slimbus,
533 },
534 },
535 {
536 .gpio = 61, /* slimbus clk */
537 .settings = {
538 [GPIOMUX_SUSPENDED] = &slimbus,
539 },
540 },
541};
542
543static struct msm_gpiomux_config msm8960_audio_codec_configs[] __initdata = {
544 {
545 .gpio = 59,
546 .settings = {
547 [GPIOMUX_SUSPENDED] = &cdc_mclk,
548 },
549 },
550};
551
552static struct msm_gpiomux_config msm8960_audio_auxpcm_configs[] __initdata = {
553 {
554 .gpio = 63,
555 .settings = {
556 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
557 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
558 },
559 },
560 {
561 .gpio = 64,
562 .settings = {
563 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
564 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
565 },
566 },
567 {
568 .gpio = 65,
569 .settings = {
570 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
571 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
572 },
573 },
574 {
575 .gpio = 66,
576 .settings = {
577 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
578 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
579 },
580 },
581};
582
583static struct msm_gpiomux_config wcnss_5wire_interface[] = {
584 {
585 .gpio = 84,
586 .settings = {
587 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
588 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
589 },
590 },
591 {
592 .gpio = 85,
593 .settings = {
594 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
595 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
596 },
597 },
598 {
599 .gpio = 86,
600 .settings = {
601 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
602 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
603 },
604 },
605 {
606 .gpio = 87,
607 .settings = {
608 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
609 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
610 },
611 },
612 {
613 .gpio = 88,
614 .settings = {
615 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
616 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
617 },
618 },
619};
620
621static struct msm_gpiomux_config msm8960_cyts_configs[] __initdata = {
622 { /* TS INTERRUPT */
623 .gpio = 11,
624 .settings = {
625 [GPIOMUX_ACTIVE] = &cyts_int_act_cfg,
626 [GPIOMUX_SUSPENDED] = &cyts_int_sus_cfg,
627 },
628 },
629 { /* TS SLEEP */
630 .gpio = 50,
631 .settings = {
632 [GPIOMUX_ACTIVE] = &cyts_sleep_act_cfg,
633 [GPIOMUX_SUSPENDED] = &cyts_sleep_sus_cfg,
634 },
635 },
636 { /* TS RESOUT */
637 .gpio = 52,
638 .settings = {
639 [GPIOMUX_ACTIVE] = &cyts_resout_act_cfg,
640 [GPIOMUX_SUSPENDED] = &cyts_resout_sus_cfg,
641 },
642 },
643};
644
645#ifdef CONFIG_USB_EHCI_MSM_HSIC
646static struct msm_gpiomux_config msm8960_hsic_configs[] = {
647 {
648 .gpio = 150, /*HSIC_STROBE */
649 .settings = {
650 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
651 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
652 },
653 },
654 {
655 .gpio = 151, /* HSIC_DATA */
656 .settings = {
657 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
658 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
659 },
660 },
Vijayavardhan Vennapusaafbbb8f2012-04-13 16:28:45 +0530661};
662
663static struct msm_gpiomux_config msm8960_hsic_hub_configs[] = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800664 {
665 .gpio = 91, /* HSIC_HUB_RESET */
666 .settings = {
667 [GPIOMUX_ACTIVE] = &hsic_hub_act_cfg,
668 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
669 },
670 },
671};
672#endif
673
Pratibhasagar V26cf2652012-01-12 17:31:21 +0530674#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
675static struct gpiomux_setting sdcc4_clk_actv_cfg = {
676 .func = GPIOMUX_FUNC_2,
677 .drv = GPIOMUX_DRV_8MA,
678 .pull = GPIOMUX_PULL_NONE,
679};
680
681static struct gpiomux_setting sdcc4_cmd_data_0_3_actv_cfg = {
682 .func = GPIOMUX_FUNC_2,
683 .drv = GPIOMUX_DRV_8MA,
684 .pull = GPIOMUX_PULL_UP,
685};
686
687static struct gpiomux_setting sdcc4_suspend_cfg = {
688 .func = GPIOMUX_FUNC_GPIO,
689 .drv = GPIOMUX_DRV_2MA,
690 .pull = GPIOMUX_PULL_DOWN,
691};
692
693static struct gpiomux_setting sdcc4_data_1_suspend_cfg = {
694 .func = GPIOMUX_FUNC_GPIO,
695 .drv = GPIOMUX_DRV_8MA,
696 .pull = GPIOMUX_PULL_UP,
697};
698
699static struct msm_gpiomux_config msm8960_sdcc4_configs[] __initdata = {
700 {
701 /* SDC4_DATA_3 */
702 .gpio = 83,
703 .settings = {
704 [GPIOMUX_ACTIVE] = &sdcc4_cmd_data_0_3_actv_cfg,
705 [GPIOMUX_SUSPENDED] = &sdcc4_suspend_cfg,
706 },
707 },
708 {
709 /* SDC4_DATA_2 */
710 .gpio = 84,
711 .settings = {
712 [GPIOMUX_ACTIVE] = &sdcc4_cmd_data_0_3_actv_cfg,
713 [GPIOMUX_SUSPENDED] = &sdcc4_suspend_cfg,
714 },
715 },
716 {
717 /* SDC4_DATA_1 */
718 .gpio = 85,
719 .settings = {
720 [GPIOMUX_ACTIVE] = &sdcc4_cmd_data_0_3_actv_cfg,
721 [GPIOMUX_SUSPENDED] = &sdcc4_data_1_suspend_cfg,
722 },
723 },
724 {
725 /* SDC4_DATA_0 */
726 .gpio = 86,
727 .settings = {
728 [GPIOMUX_ACTIVE] = &sdcc4_cmd_data_0_3_actv_cfg,
729 [GPIOMUX_SUSPENDED] = &sdcc4_suspend_cfg,
730 },
731 },
732 {
733 /* SDC4_CMD */
734 .gpio = 87,
735 .settings = {
736 [GPIOMUX_ACTIVE] = &sdcc4_cmd_data_0_3_actv_cfg,
737 [GPIOMUX_SUSPENDED] = &sdcc4_suspend_cfg,
738 },
739 },
740 {
741 /* SDC4_CLK */
742 .gpio = 88,
743 .settings = {
744 [GPIOMUX_ACTIVE] = &sdcc4_clk_actv_cfg,
745 [GPIOMUX_SUSPENDED] = &sdcc4_suspend_cfg,
746 },
747 },
748};
749#endif
750
751
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800752static struct msm_gpiomux_config hap_lvl_shft_config[] __initdata = {
753 {
754 .gpio = 47,
755 .settings = {
756 [GPIOMUX_SUSPENDED] = &hap_lvl_shft_suspended_config,
757 [GPIOMUX_ACTIVE] = &hap_lvl_shft_active_config,
758 },
759 },
760};
761
Joel King0cbf5d82012-05-24 15:21:38 -0700762static struct msm_gpiomux_config sglte_configs[] __initdata = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800763 /* AP2MDM_STATUS */
764 {
Joel King0cbf5d82012-05-24 15:21:38 -0700765 .gpio = 77,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800766 .settings = {
767 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
768 }
769 },
770 /* MDM2AP_STATUS */
771 {
Joel King0cbf5d82012-05-24 15:21:38 -0700772 .gpio = 24,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800773 .settings = {
774 [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
775 }
776 },
777 /* MDM2AP_ERRFATAL */
778 {
Joel King0cbf5d82012-05-24 15:21:38 -0700779 .gpio = 40,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800780 .settings = {
781 [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
782 }
783 },
784 /* AP2MDM_ERRFATAL */
785 {
Joel King0cbf5d82012-05-24 15:21:38 -0700786 .gpio = 80,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800787 .settings = {
788 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
789 }
790 },
791 /* AP2MDM_KPDPWR_N */
792 {
Joel King0cbf5d82012-05-24 15:21:38 -0700793 .gpio = 79,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800794 .settings = {
795 [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg,
796 }
797 },
Joel King0cbf5d82012-05-24 15:21:38 -0700798 /* AP2MDM_PMIC_PWR_EN */
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800799 {
Joel King0cbf5d82012-05-24 15:21:38 -0700800 .gpio = 22,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800801 .settings = {
802 [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg,
803 }
Joel King0cbf5d82012-05-24 15:21:38 -0700804 },
805 /* AP2MDM_SOFT_RESET */
806 {
807 .gpio = 78,
808 .settings = {
809 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
810 }
811 },
Ameya Thakur43248fd2012-07-10 18:50:52 -0700812 /* USB_SW */
813 {
814 .gpio = 25,
815 .settings = {
816 [GPIOMUX_SUSPENDED] = &usbsw_cfg,
817 }
818 }
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800819};
820
821static struct msm_gpiomux_config msm8960_mdp_vsync_configs[] __initdata = {
822 {
823 .gpio = 0,
824 .settings = {
825 [GPIOMUX_ACTIVE] = &mdp_vsync_active_cfg,
826 [GPIOMUX_SUSPENDED] = &mdp_vsync_suspend_cfg,
827 },
828 }
829};
830
831#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
832static struct msm_gpiomux_config msm8960_hdmi_configs[] __initdata = {
833 {
834 .gpio = 99,
835 .settings = {
836 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
837 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
838 },
839 },
840 {
841 .gpio = 100,
842 .settings = {
843 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
844 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
845 },
846 },
847 {
848 .gpio = 101,
849 .settings = {
850 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
851 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
852 },
853 },
854 {
855 .gpio = 102,
856 .settings = {
857 [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg,
858 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
859 },
860 },
Manoj Rao14648742012-03-30 19:42:12 -0700861#ifdef CONFIG_FB_MSM_HDMI_MHL_9244
Eugene Yasman67592342011-12-11 13:12:36 +0200862 {
863 .gpio = 15,
864 .settings = {
865 [GPIOMUX_ACTIVE] = &hdmi_active_3_cfg,
866 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
867 },
868 },
869 {
870 .gpio = 66,
871 .settings = {
872 [GPIOMUX_ACTIVE] = &hdmi_active_4_cfg,
873 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
874 },
875 },
Manoj Rao14648742012-03-30 19:42:12 -0700876#endif
877#ifdef CONFIG_FB_MSM_HDMI_MHL_8334
878 {
879 .gpio = 4,
880 .settings = {
881 [GPIOMUX_ACTIVE] = &hdmi_active_3_cfg,
882 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
883 },
884 },
885 {
886 .gpio = 15,
887 .settings = {
888 [GPIOMUX_ACTIVE] = &hdmi_active_4_cfg,
889 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
890 },
891 },
892#endif /* CONFIG_FB_MSM_HDMI_MHL */
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800893};
894#endif
895
Pratibhasagar V57c808e2012-01-12 13:47:30 +0530896#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
897static struct gpiomux_setting sdcc2_clk_actv_cfg = {
898 .func = GPIOMUX_FUNC_2,
899 .drv = GPIOMUX_DRV_8MA,
900 .pull = GPIOMUX_PULL_NONE,
901};
902
903static struct gpiomux_setting sdcc2_cmd_data_0_3_actv_cfg = {
904 .func = GPIOMUX_FUNC_2,
905 .drv = GPIOMUX_DRV_8MA,
906 .pull = GPIOMUX_PULL_UP,
907};
908
909static struct gpiomux_setting sdcc2_suspend_cfg = {
910 .func = GPIOMUX_FUNC_GPIO,
911 .drv = GPIOMUX_DRV_2MA,
912 .pull = GPIOMUX_PULL_DOWN,
913};
914
915static struct gpiomux_setting sdcc2_data_1_suspend_cfg = {
916 .func = GPIOMUX_FUNC_GPIO,
917 .drv = GPIOMUX_DRV_8MA,
918 .pull = GPIOMUX_PULL_UP,
919};
920
921static struct msm_gpiomux_config msm8960_sdcc2_configs[] __initdata = {
922 {
923 /* DATA_3 */
924 .gpio = 92,
925 .settings = {
926 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
927 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
928 },
929 },
930 {
931 /* DATA_2 */
932 .gpio = 91,
933 .settings = {
934 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
935 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
936 },
937 },
938 {
939 /* DATA_1 */
940 .gpio = 90,
941 .settings = {
942 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
943 [GPIOMUX_SUSPENDED] = &sdcc2_data_1_suspend_cfg,
944 },
945 },
946 {
947 /* DATA_0 */
948 .gpio = 89,
949 .settings = {
950 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
951 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
952 },
953 },
954 {
955 /* CMD */
956 .gpio = 97,
957 .settings = {
958 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
959 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
960 },
961 },
962 {
963 /* CLK */
964 .gpio = 98,
965 .settings = {
966 [GPIOMUX_ACTIVE] = &sdcc2_clk_actv_cfg,
967 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
968 },
969 },
970};
971#endif
972
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800973int __init msm8960_init_gpiomux(void)
974{
975 int rc = msm_gpiomux_init(NR_GPIO_IRQS);
976 if (rc) {
977 pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
978 return rc;
979 }
980
981#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
Anirudh Ghayal50137fb2012-07-31 16:58:53 +0530982 if (socinfo_get_platform_subtype() != PLATFORM_SUBTYPE_SGLTE)
983 msm_gpiomux_install(msm8960_ethernet_configs,
984 ARRAY_SIZE(msm8960_ethernet_configs));
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800985#endif
986
987 msm_gpiomux_install(msm8960_gsbi_configs,
988 ARRAY_SIZE(msm8960_gsbi_configs));
989
990 msm_gpiomux_install(msm8960_cyts_configs,
991 ARRAY_SIZE(msm8960_cyts_configs));
992
993 msm_gpiomux_install(msm8960_slimbus_config,
994 ARRAY_SIZE(msm8960_slimbus_config));
995
996 msm_gpiomux_install(msm8960_audio_codec_configs,
997 ARRAY_SIZE(msm8960_audio_codec_configs));
998
999 msm_gpiomux_install(msm8960_audio_auxpcm_configs,
1000 ARRAY_SIZE(msm8960_audio_auxpcm_configs));
1001
1002 msm_gpiomux_install(wcnss_5wire_interface,
1003 ARRAY_SIZE(wcnss_5wire_interface));
1004
Pratibhasagar V26cf2652012-01-12 17:31:21 +05301005#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
1006 msm_gpiomux_install(msm8960_sdcc4_configs,
1007 ARRAY_SIZE(msm8960_sdcc4_configs));
1008#endif
1009
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08001010 if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() ||
1011 machine_is_msm8960_liquid() || machine_is_msm8960_cdp())
1012 msm_gpiomux_install(hap_lvl_shft_config,
1013 ARRAY_SIZE(hap_lvl_shft_config));
1014
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08001015#ifdef CONFIG_USB_EHCI_MSM_HSIC
1016 if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
Joel King0cbf5d82012-05-24 15:21:38 -07001017 machine_is_msm8960_liquid())
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08001018 msm_gpiomux_install(msm8960_hsic_configs,
1019 ARRAY_SIZE(msm8960_hsic_configs));
Vijayavardhan Vennapusaafbbb8f2012-04-13 16:28:45 +05301020
1021 if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
1022 machine_is_msm8960_liquid())
1023 msm_gpiomux_install(msm8960_hsic_hub_configs,
1024 ARRAY_SIZE(msm8960_hsic_hub_configs));
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08001025#endif
1026
1027#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
1028 msm_gpiomux_install(msm8960_hdmi_configs,
1029 ARRAY_SIZE(msm8960_hdmi_configs));
1030#endif
1031
1032 msm_gpiomux_install(msm8960_mdp_vsync_configs,
1033 ARRAY_SIZE(msm8960_mdp_vsync_configs));
1034
Mayank Rana1f02d952012-07-04 19:11:20 +05301035 if (socinfo_get_platform_subtype() != PLATFORM_SUBTYPE_SGLTE)
1036 msm_gpiomux_install(msm8960_gsbi8_uartdm_configs,
1037 ARRAY_SIZE(msm8960_gsbi8_uartdm_configs));
1038
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -07001039 if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE)
1040 msm_gpiomux_install(msm8960_gsbi8_uart_configs,
1041 ARRAY_SIZE(msm8960_gsbi8_uart_configs));
1042 else
1043 msm_gpiomux_install(msm8960_gsbi5_uart_configs,
1044 ARRAY_SIZE(msm8960_gsbi5_uart_configs));
Satish Babu Patakokila95d659d2012-05-10 14:42:46 +05301045
1046 if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) {
1047 /* For 8960 Fusion 2.2 Primary IPC */
Mayank Ranae009c922012-03-22 03:02:06 +05301048 msm_gpiomux_install(msm8960_fusion_gsbi_configs,
1049 ARRAY_SIZE(msm8960_fusion_gsbi_configs));
Satish Babu Patakokila95d659d2012-05-10 14:42:46 +05301050 /* For SGLTE 8960 Fusion External VFR */
1051 msm_gpiomux_install(msm8960_external_vfr_configs,
1052 ARRAY_SIZE(msm8960_external_vfr_configs));
1053 }
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -07001054
Pratibhasagar V57c808e2012-01-12 13:47:30 +05301055#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
1056 msm_gpiomux_install(msm8960_sdcc2_configs,
1057 ARRAY_SIZE(msm8960_sdcc2_configs));
1058#endif
Joel King0cbf5d82012-05-24 15:21:38 -07001059
1060 if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE)
1061 msm_gpiomux_install(sglte_configs,
1062 ARRAY_SIZE(sglte_configs));
1063
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08001064 return 0;
1065}