blob: 53e7c9e413d40cf05c3497a95785d489aaf69016 [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 Ranae009c922012-03-22 03:02:06 +053079static struct gpiomux_setting gsbi9_active_cfg = {
80 .func = GPIOMUX_FUNC_2,
81 .drv = GPIOMUX_DRV_8MA,
82 .pull = GPIOMUX_PULL_DOWN,
83};
84
85static struct gpiomux_setting gsbi9_suspended_cfg = {
86 .func = GPIOMUX_FUNC_2,
87 .drv = GPIOMUX_DRV_2MA,
88 .pull = GPIOMUX_PULL_DOWN,
89};
90
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -080091static struct gpiomux_setting gsbi10 = {
92 .func = GPIOMUX_FUNC_2,
93 .drv = GPIOMUX_DRV_8MA,
94 .pull = GPIOMUX_PULL_NONE,
95};
96
97static struct gpiomux_setting gsbi12 = {
98 .func = GPIOMUX_FUNC_1,
99 .drv = GPIOMUX_DRV_8MA,
100 .pull = GPIOMUX_PULL_NONE,
101};
102
103static struct gpiomux_setting cdc_mclk = {
104 .func = GPIOMUX_FUNC_1,
105 .drv = GPIOMUX_DRV_8MA,
106 .pull = GPIOMUX_PULL_NONE,
107};
108
109static struct gpiomux_setting audio_auxpcm[] = {
110 /* Suspended state */
111 {
112 .func = GPIOMUX_FUNC_GPIO,
113 .drv = GPIOMUX_DRV_2MA,
Patrick Laib593eaf2012-01-05 22:14:47 -0800114 .pull = GPIOMUX_PULL_DOWN,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800115 },
116 /* Active state */
117 {
118 .func = GPIOMUX_FUNC_1,
119 .drv = GPIOMUX_DRV_2MA,
120 .pull = GPIOMUX_PULL_NONE,
121 },
122};
123
124#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
125static struct gpiomux_setting gpio_eth_config = {
126 .pull = GPIOMUX_PULL_NONE,
127 .drv = GPIOMUX_DRV_8MA,
128 .func = GPIOMUX_FUNC_GPIO,
129};
130#endif
131
132static struct gpiomux_setting slimbus = {
133 .func = GPIOMUX_FUNC_1,
134 .drv = GPIOMUX_DRV_8MA,
135 .pull = GPIOMUX_PULL_KEEPER,
136};
137
138static struct gpiomux_setting wcnss_5wire_suspend_cfg = {
139 .func = GPIOMUX_FUNC_GPIO,
140 .drv = GPIOMUX_DRV_2MA,
141 .pull = GPIOMUX_PULL_UP,
142};
143
144static struct gpiomux_setting wcnss_5wire_active_cfg = {
145 .func = GPIOMUX_FUNC_1,
146 .drv = GPIOMUX_DRV_6MA,
147 .pull = GPIOMUX_PULL_DOWN,
148};
149
150static struct gpiomux_setting cyts_resout_sus_cfg = {
151 .func = GPIOMUX_FUNC_GPIO,
152 .drv = GPIOMUX_DRV_6MA,
153 .pull = GPIOMUX_PULL_UP,
154};
155
156static struct gpiomux_setting cyts_resout_act_cfg = {
157 .func = GPIOMUX_FUNC_GPIO,
158 .drv = GPIOMUX_DRV_6MA,
159 .pull = GPIOMUX_PULL_UP,
160};
161
162static struct gpiomux_setting cyts_sleep_sus_cfg = {
163 .func = GPIOMUX_FUNC_GPIO,
164 .drv = GPIOMUX_DRV_6MA,
165 .pull = GPIOMUX_PULL_DOWN,
166};
167
168static struct gpiomux_setting cyts_sleep_act_cfg = {
169 .func = GPIOMUX_FUNC_GPIO,
170 .drv = GPIOMUX_DRV_6MA,
171 .pull = GPIOMUX_PULL_DOWN,
172};
173
174static struct gpiomux_setting cyts_int_act_cfg = {
175 .func = GPIOMUX_FUNC_GPIO,
176 .drv = GPIOMUX_DRV_8MA,
177 .pull = GPIOMUX_PULL_UP,
178};
179
180static struct gpiomux_setting cyts_int_sus_cfg = {
181 .func = GPIOMUX_FUNC_GPIO,
182 .drv = GPIOMUX_DRV_2MA,
183 .pull = GPIOMUX_PULL_DOWN,
184};
185
186#ifdef CONFIG_USB_EHCI_MSM_HSIC
187static struct gpiomux_setting hsic_act_cfg = {
188 .func = GPIOMUX_FUNC_1,
189 .drv = GPIOMUX_DRV_12MA,
190 .pull = GPIOMUX_PULL_NONE,
191};
192
193static struct gpiomux_setting hsic_sus_cfg = {
194 .func = GPIOMUX_FUNC_GPIO,
195 .drv = GPIOMUX_DRV_2MA,
196 .pull = GPIOMUX_PULL_DOWN,
197 .dir = GPIOMUX_OUT_LOW,
198};
199
200static struct gpiomux_setting hsic_hub_act_cfg = {
201 .func = GPIOMUX_FUNC_GPIO,
202 .drv = GPIOMUX_DRV_2MA,
203 .pull = GPIOMUX_PULL_NONE,
204};
205#endif
206
207static struct gpiomux_setting hap_lvl_shft_suspended_config = {
208 .func = GPIOMUX_FUNC_GPIO,
209 .drv = GPIOMUX_DRV_2MA,
210 .pull = GPIOMUX_PULL_DOWN,
211};
212
213static struct gpiomux_setting hap_lvl_shft_active_config = {
214 .func = GPIOMUX_FUNC_GPIO,
215 .drv = GPIOMUX_DRV_8MA,
216 .pull = GPIOMUX_PULL_UP,
217};
218
219static struct gpiomux_setting ap2mdm_cfg = {
220 .func = GPIOMUX_FUNC_GPIO,
221 .drv = GPIOMUX_DRV_8MA,
222 .pull = GPIOMUX_PULL_DOWN,
223};
224
225static struct gpiomux_setting mdm2ap_status_cfg = {
226 .func = GPIOMUX_FUNC_GPIO,
227 .drv = GPIOMUX_DRV_8MA,
228 .pull = GPIOMUX_PULL_NONE,
229};
230
231static struct gpiomux_setting mdm2ap_errfatal_cfg = {
232 .func = GPIOMUX_FUNC_GPIO,
233 .drv = GPIOMUX_DRV_16MA,
234 .pull = GPIOMUX_PULL_DOWN,
235};
236
237static struct gpiomux_setting ap2mdm_kpdpwr_n_cfg = {
238 .func = GPIOMUX_FUNC_GPIO,
239 .drv = GPIOMUX_DRV_8MA,
Joel King1c607312012-01-13 16:41:44 -0800240 .pull = GPIOMUX_PULL_DOWN,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800241};
242
Ameya Thakur43248fd2012-07-10 18:50:52 -0700243static struct gpiomux_setting usbsw_cfg = {
244 .func = GPIOMUX_FUNC_GPIO,
245 .drv = GPIOMUX_DRV_8MA,
246 .pull = GPIOMUX_PULL_DOWN,
247};
248
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800249static struct gpiomux_setting mdp_vsync_suspend_cfg = {
250 .func = GPIOMUX_FUNC_GPIO,
251 .drv = GPIOMUX_DRV_2MA,
252 .pull = GPIOMUX_PULL_DOWN,
253};
254
255static struct gpiomux_setting mdp_vsync_active_cfg = {
256 .func = GPIOMUX_FUNC_1,
257 .drv = GPIOMUX_DRV_2MA,
258 .pull = GPIOMUX_PULL_DOWN,
259};
260
261#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
262static struct gpiomux_setting hdmi_suspend_cfg = {
263 .func = GPIOMUX_FUNC_GPIO,
264 .drv = GPIOMUX_DRV_2MA,
265 .pull = GPIOMUX_PULL_DOWN,
266};
267
268static struct gpiomux_setting hdmi_active_1_cfg = {
269 .func = GPIOMUX_FUNC_1,
270 .drv = GPIOMUX_DRV_2MA,
271 .pull = GPIOMUX_PULL_UP,
272};
273
274static struct gpiomux_setting hdmi_active_2_cfg = {
275 .func = GPIOMUX_FUNC_1,
276 .drv = GPIOMUX_DRV_2MA,
277 .pull = GPIOMUX_PULL_DOWN,
278};
Eugene Yasman67592342011-12-11 13:12:36 +0200279
Manoj Rao14648742012-03-30 19:42:12 -0700280#if defined(CONFIG_FB_MSM_HDMI_MHL_8334) || defined(CONFIG_FB_MSM_HDMI_MHL_9244)
Eugene Yasman67592342011-12-11 13:12:36 +0200281static struct gpiomux_setting hdmi_active_3_cfg = {
282 .func = GPIOMUX_FUNC_GPIO,
283 .drv = GPIOMUX_DRV_2MA,
Eugene Yasmana2db4162011-12-13 09:28:22 +0200284 .pull = GPIOMUX_PULL_UP,
Eugene Yasman67592342011-12-11 13:12:36 +0200285 .dir = GPIOMUX_IN,
286};
287
288static struct gpiomux_setting hdmi_active_4_cfg = {
289 .func = GPIOMUX_FUNC_GPIO,
290 .drv = GPIOMUX_DRV_2MA,
291 .pull = GPIOMUX_PULL_UP,
292 .dir = GPIOMUX_OUT_HIGH,
293};
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800294#endif
Manoj Rao14648742012-03-30 19:42:12 -0700295#endif
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800296
297#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
298static struct msm_gpiomux_config msm8960_ethernet_configs[] = {
299 {
300 .gpio = 90,
301 .settings = {
302 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
303 }
304 },
305 {
306 .gpio = 89,
307 .settings = {
308 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
309 }
310 },
311};
312#endif
313
Mayank Ranae009c922012-03-22 03:02:06 +0530314static struct msm_gpiomux_config msm8960_fusion_gsbi_configs[] = {
315 {
316 .gpio = 93,
317 .settings = {
318 [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg,
319 [GPIOMUX_ACTIVE] = &gsbi9_active_cfg,
320 }
321 },
322 {
323 .gpio = 94,
324 .settings = {
325 [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg,
326 [GPIOMUX_ACTIVE] = &gsbi9_active_cfg,
327 }
328 },
329 {
330 .gpio = 95,
331 .settings = {
332 [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg,
333 [GPIOMUX_ACTIVE] = &gsbi9_active_cfg,
334 }
335 },
336 {
337 .gpio = 96,
338 .settings = {
339 [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg,
340 [GPIOMUX_ACTIVE] = &gsbi9_active_cfg,
341 }
342 },
343};
344
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800345static struct msm_gpiomux_config msm8960_gsbi_configs[] __initdata = {
346 {
347 .gpio = 6, /* GSBI1 QUP SPI_DATA_MOSI */
348 .settings = {
349 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
350 [GPIOMUX_ACTIVE] = &spi_active,
351 },
352 },
353 {
354 .gpio = 7, /* GSBI1 QUP SPI_DATA_MISO */
355 .settings = {
356 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
357 [GPIOMUX_ACTIVE] = &spi_active,
358 },
359 },
360 {
361 .gpio = 8, /* GSBI1 QUP SPI_CS_N */
362 .settings = {
363 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
364 [GPIOMUX_ACTIVE] = &spi_active,
365 },
366 },
367 {
368 .gpio = 9, /* GSBI1 QUP SPI_CLK */
369 .settings = {
370 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
371 [GPIOMUX_ACTIVE] = &spi_active,
372 },
373 },
374 {
375 .gpio = 14, /* GSBI1 SPI_CS_1 */
376 .settings = {
377 [GPIOMUX_SUSPENDED] = &spi_suspended_config2,
378 [GPIOMUX_ACTIVE] = &spi_active_config2,
379 },
380 },
381 {
382 .gpio = 16, /* GSBI3 I2C QUP SDA */
383 .settings = {
384 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
385 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
386 },
387 },
388 {
389 .gpio = 17, /* GSBI3 I2C QUP SCL */
390 .settings = {
391 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
392 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
393 },
394 },
395 {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800396 .gpio = 44, /* GSBI12 I2C QUP SDA */
397 .settings = {
398 [GPIOMUX_SUSPENDED] = &gsbi12,
399 },
400 },
401 {
402 .gpio = 45, /* GSBI12 I2C QUP SCL */
403 .settings = {
404 [GPIOMUX_SUSPENDED] = &gsbi12,
405 },
406 },
407 {
408 .gpio = 73, /* GSBI10 I2C QUP SDA */
409 .settings = {
410 [GPIOMUX_SUSPENDED] = &gsbi10,
411 },
412 },
413 {
414 .gpio = 74, /* GSBI10 I2C QUP SCL */
415 .settings = {
416 [GPIOMUX_SUSPENDED] = &gsbi10,
417 },
418 },
419};
420
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -0700421static struct msm_gpiomux_config msm8960_gsbi5_uart_configs[] __initdata = {
422 {
423 .gpio = 22, /* GSBI5 UART2 */
424 .settings = {
425 [GPIOMUX_SUSPENDED] = &gsbi_uart,
426 },
427 },
428 {
429 .gpio = 23, /* GSBI5 UART2 */
430 .settings = {
431 [GPIOMUX_SUSPENDED] = &gsbi_uart,
432 },
433 },
434 {
435 .gpio = 24, /* GSBI5 UART2 */
436 .settings = {
437 [GPIOMUX_SUSPENDED] = &gsbi_uart,
438 },
439 },
440 {
441 .gpio = 25, /* GSBI5 UART2 */
442 .settings = {
443 [GPIOMUX_SUSPENDED] = &gsbi_uart,
444 },
445 },
446};
447
Satish Babu Patakokila95d659d2012-05-10 14:42:46 +0530448static struct msm_gpiomux_config msm8960_external_vfr_configs[] __initdata = {
449 {
450 .gpio = 23, /* EXTERNAL VFR */
451 .settings = {
452 [GPIOMUX_SUSPENDED] = &external_vfr[0],
453 [GPIOMUX_ACTIVE] = &external_vfr[1],
454 },
455 },
456};
457
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -0700458static struct msm_gpiomux_config msm8960_gsbi8_uart_configs[] __initdata = {
459 {
460 .gpio = 34, /* GSBI8 UART3 */
461 .settings = {
462 [GPIOMUX_SUSPENDED] = &gsbi_uart,
463 },
464 },
465 {
466 .gpio = 35, /* GSBI8 UART3 */
467 .settings = {
468 [GPIOMUX_SUSPENDED] = &gsbi_uart,
469 },
470 },
471 {
472 .gpio = 36, /* GSBI8 UART3 */
473 .settings = {
474 [GPIOMUX_SUSPENDED] = &gsbi_uart,
475 },
476 },
477 {
478 .gpio = 37, /* GSBI8 UART3 */
479 .settings = {
480 [GPIOMUX_SUSPENDED] = &gsbi_uart,
481 },
482 },
483};
484
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800485static struct msm_gpiomux_config msm8960_slimbus_config[] __initdata = {
486 {
487 .gpio = 60, /* slimbus data */
488 .settings = {
489 [GPIOMUX_SUSPENDED] = &slimbus,
490 },
491 },
492 {
493 .gpio = 61, /* slimbus clk */
494 .settings = {
495 [GPIOMUX_SUSPENDED] = &slimbus,
496 },
497 },
498};
499
500static struct msm_gpiomux_config msm8960_audio_codec_configs[] __initdata = {
501 {
502 .gpio = 59,
503 .settings = {
504 [GPIOMUX_SUSPENDED] = &cdc_mclk,
505 },
506 },
507};
508
509static struct msm_gpiomux_config msm8960_audio_auxpcm_configs[] __initdata = {
510 {
511 .gpio = 63,
512 .settings = {
513 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
514 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
515 },
516 },
517 {
518 .gpio = 64,
519 .settings = {
520 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
521 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
522 },
523 },
524 {
525 .gpio = 65,
526 .settings = {
527 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
528 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
529 },
530 },
531 {
532 .gpio = 66,
533 .settings = {
534 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
535 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
536 },
537 },
538};
539
540static struct msm_gpiomux_config wcnss_5wire_interface[] = {
541 {
542 .gpio = 84,
543 .settings = {
544 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
545 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
546 },
547 },
548 {
549 .gpio = 85,
550 .settings = {
551 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
552 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
553 },
554 },
555 {
556 .gpio = 86,
557 .settings = {
558 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
559 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
560 },
561 },
562 {
563 .gpio = 87,
564 .settings = {
565 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
566 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
567 },
568 },
569 {
570 .gpio = 88,
571 .settings = {
572 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
573 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
574 },
575 },
576};
577
578static struct msm_gpiomux_config msm8960_cyts_configs[] __initdata = {
579 { /* TS INTERRUPT */
580 .gpio = 11,
581 .settings = {
582 [GPIOMUX_ACTIVE] = &cyts_int_act_cfg,
583 [GPIOMUX_SUSPENDED] = &cyts_int_sus_cfg,
584 },
585 },
586 { /* TS SLEEP */
587 .gpio = 50,
588 .settings = {
589 [GPIOMUX_ACTIVE] = &cyts_sleep_act_cfg,
590 [GPIOMUX_SUSPENDED] = &cyts_sleep_sus_cfg,
591 },
592 },
593 { /* TS RESOUT */
594 .gpio = 52,
595 .settings = {
596 [GPIOMUX_ACTIVE] = &cyts_resout_act_cfg,
597 [GPIOMUX_SUSPENDED] = &cyts_resout_sus_cfg,
598 },
599 },
600};
601
602#ifdef CONFIG_USB_EHCI_MSM_HSIC
603static struct msm_gpiomux_config msm8960_hsic_configs[] = {
604 {
605 .gpio = 150, /*HSIC_STROBE */
606 .settings = {
607 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
608 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
609 },
610 },
611 {
612 .gpio = 151, /* HSIC_DATA */
613 .settings = {
614 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
615 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
616 },
617 },
Vijayavardhan Vennapusaafbbb8f2012-04-13 16:28:45 +0530618};
619
620static struct msm_gpiomux_config msm8960_hsic_hub_configs[] = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800621 {
622 .gpio = 91, /* HSIC_HUB_RESET */
623 .settings = {
624 [GPIOMUX_ACTIVE] = &hsic_hub_act_cfg,
625 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
626 },
627 },
628};
629#endif
630
Pratibhasagar V26cf2652012-01-12 17:31:21 +0530631#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
632static struct gpiomux_setting sdcc4_clk_actv_cfg = {
633 .func = GPIOMUX_FUNC_2,
634 .drv = GPIOMUX_DRV_8MA,
635 .pull = GPIOMUX_PULL_NONE,
636};
637
638static struct gpiomux_setting sdcc4_cmd_data_0_3_actv_cfg = {
639 .func = GPIOMUX_FUNC_2,
640 .drv = GPIOMUX_DRV_8MA,
641 .pull = GPIOMUX_PULL_UP,
642};
643
644static struct gpiomux_setting sdcc4_suspend_cfg = {
645 .func = GPIOMUX_FUNC_GPIO,
646 .drv = GPIOMUX_DRV_2MA,
647 .pull = GPIOMUX_PULL_DOWN,
648};
649
650static struct gpiomux_setting sdcc4_data_1_suspend_cfg = {
651 .func = GPIOMUX_FUNC_GPIO,
652 .drv = GPIOMUX_DRV_8MA,
653 .pull = GPIOMUX_PULL_UP,
654};
655
656static struct msm_gpiomux_config msm8960_sdcc4_configs[] __initdata = {
657 {
658 /* SDC4_DATA_3 */
659 .gpio = 83,
660 .settings = {
661 [GPIOMUX_ACTIVE] = &sdcc4_cmd_data_0_3_actv_cfg,
662 [GPIOMUX_SUSPENDED] = &sdcc4_suspend_cfg,
663 },
664 },
665 {
666 /* SDC4_DATA_2 */
667 .gpio = 84,
668 .settings = {
669 [GPIOMUX_ACTIVE] = &sdcc4_cmd_data_0_3_actv_cfg,
670 [GPIOMUX_SUSPENDED] = &sdcc4_suspend_cfg,
671 },
672 },
673 {
674 /* SDC4_DATA_1 */
675 .gpio = 85,
676 .settings = {
677 [GPIOMUX_ACTIVE] = &sdcc4_cmd_data_0_3_actv_cfg,
678 [GPIOMUX_SUSPENDED] = &sdcc4_data_1_suspend_cfg,
679 },
680 },
681 {
682 /* SDC4_DATA_0 */
683 .gpio = 86,
684 .settings = {
685 [GPIOMUX_ACTIVE] = &sdcc4_cmd_data_0_3_actv_cfg,
686 [GPIOMUX_SUSPENDED] = &sdcc4_suspend_cfg,
687 },
688 },
689 {
690 /* SDC4_CMD */
691 .gpio = 87,
692 .settings = {
693 [GPIOMUX_ACTIVE] = &sdcc4_cmd_data_0_3_actv_cfg,
694 [GPIOMUX_SUSPENDED] = &sdcc4_suspend_cfg,
695 },
696 },
697 {
698 /* SDC4_CLK */
699 .gpio = 88,
700 .settings = {
701 [GPIOMUX_ACTIVE] = &sdcc4_clk_actv_cfg,
702 [GPIOMUX_SUSPENDED] = &sdcc4_suspend_cfg,
703 },
704 },
705};
706#endif
707
708
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800709static struct msm_gpiomux_config hap_lvl_shft_config[] __initdata = {
710 {
711 .gpio = 47,
712 .settings = {
713 [GPIOMUX_SUSPENDED] = &hap_lvl_shft_suspended_config,
714 [GPIOMUX_ACTIVE] = &hap_lvl_shft_active_config,
715 },
716 },
717};
718
Joel King0cbf5d82012-05-24 15:21:38 -0700719static struct msm_gpiomux_config sglte_configs[] __initdata = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800720 /* AP2MDM_STATUS */
721 {
Joel King0cbf5d82012-05-24 15:21:38 -0700722 .gpio = 77,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800723 .settings = {
724 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
725 }
726 },
727 /* MDM2AP_STATUS */
728 {
Joel King0cbf5d82012-05-24 15:21:38 -0700729 .gpio = 24,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800730 .settings = {
731 [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
732 }
733 },
734 /* MDM2AP_ERRFATAL */
735 {
Joel King0cbf5d82012-05-24 15:21:38 -0700736 .gpio = 40,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800737 .settings = {
738 [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
739 }
740 },
741 /* AP2MDM_ERRFATAL */
742 {
Joel King0cbf5d82012-05-24 15:21:38 -0700743 .gpio = 80,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800744 .settings = {
745 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
746 }
747 },
748 /* AP2MDM_KPDPWR_N */
749 {
Joel King0cbf5d82012-05-24 15:21:38 -0700750 .gpio = 79,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800751 .settings = {
752 [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg,
753 }
754 },
Joel King0cbf5d82012-05-24 15:21:38 -0700755 /* AP2MDM_PMIC_PWR_EN */
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800756 {
Joel King0cbf5d82012-05-24 15:21:38 -0700757 .gpio = 22,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800758 .settings = {
759 [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg,
760 }
Joel King0cbf5d82012-05-24 15:21:38 -0700761 },
762 /* AP2MDM_SOFT_RESET */
763 {
764 .gpio = 78,
765 .settings = {
766 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
767 }
768 },
Ameya Thakur43248fd2012-07-10 18:50:52 -0700769 /* USB_SW */
770 {
771 .gpio = 25,
772 .settings = {
773 [GPIOMUX_SUSPENDED] = &usbsw_cfg,
774 }
775 }
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800776};
777
778static struct msm_gpiomux_config msm8960_mdp_vsync_configs[] __initdata = {
779 {
780 .gpio = 0,
781 .settings = {
782 [GPIOMUX_ACTIVE] = &mdp_vsync_active_cfg,
783 [GPIOMUX_SUSPENDED] = &mdp_vsync_suspend_cfg,
784 },
785 }
786};
787
788#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
789static struct msm_gpiomux_config msm8960_hdmi_configs[] __initdata = {
790 {
791 .gpio = 99,
792 .settings = {
793 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
794 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
795 },
796 },
797 {
798 .gpio = 100,
799 .settings = {
800 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
801 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
802 },
803 },
804 {
805 .gpio = 101,
806 .settings = {
807 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
808 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
809 },
810 },
811 {
812 .gpio = 102,
813 .settings = {
814 [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg,
815 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
816 },
817 },
Manoj Rao14648742012-03-30 19:42:12 -0700818#ifdef CONFIG_FB_MSM_HDMI_MHL_9244
Eugene Yasman67592342011-12-11 13:12:36 +0200819 {
820 .gpio = 15,
821 .settings = {
822 [GPIOMUX_ACTIVE] = &hdmi_active_3_cfg,
823 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
824 },
825 },
826 {
827 .gpio = 66,
828 .settings = {
829 [GPIOMUX_ACTIVE] = &hdmi_active_4_cfg,
830 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
831 },
832 },
Manoj Rao14648742012-03-30 19:42:12 -0700833#endif
834#ifdef CONFIG_FB_MSM_HDMI_MHL_8334
835 {
836 .gpio = 4,
837 .settings = {
838 [GPIOMUX_ACTIVE] = &hdmi_active_3_cfg,
839 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
840 },
841 },
842 {
843 .gpio = 15,
844 .settings = {
845 [GPIOMUX_ACTIVE] = &hdmi_active_4_cfg,
846 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
847 },
848 },
849#endif /* CONFIG_FB_MSM_HDMI_MHL */
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800850};
851#endif
852
Pratibhasagar V57c808e2012-01-12 13:47:30 +0530853#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
854static struct gpiomux_setting sdcc2_clk_actv_cfg = {
855 .func = GPIOMUX_FUNC_2,
856 .drv = GPIOMUX_DRV_8MA,
857 .pull = GPIOMUX_PULL_NONE,
858};
859
860static struct gpiomux_setting sdcc2_cmd_data_0_3_actv_cfg = {
861 .func = GPIOMUX_FUNC_2,
862 .drv = GPIOMUX_DRV_8MA,
863 .pull = GPIOMUX_PULL_UP,
864};
865
866static struct gpiomux_setting sdcc2_suspend_cfg = {
867 .func = GPIOMUX_FUNC_GPIO,
868 .drv = GPIOMUX_DRV_2MA,
869 .pull = GPIOMUX_PULL_DOWN,
870};
871
872static struct gpiomux_setting sdcc2_data_1_suspend_cfg = {
873 .func = GPIOMUX_FUNC_GPIO,
874 .drv = GPIOMUX_DRV_8MA,
875 .pull = GPIOMUX_PULL_UP,
876};
877
878static struct msm_gpiomux_config msm8960_sdcc2_configs[] __initdata = {
879 {
880 /* DATA_3 */
881 .gpio = 92,
882 .settings = {
883 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
884 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
885 },
886 },
887 {
888 /* DATA_2 */
889 .gpio = 91,
890 .settings = {
891 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
892 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
893 },
894 },
895 {
896 /* DATA_1 */
897 .gpio = 90,
898 .settings = {
899 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
900 [GPIOMUX_SUSPENDED] = &sdcc2_data_1_suspend_cfg,
901 },
902 },
903 {
904 /* DATA_0 */
905 .gpio = 89,
906 .settings = {
907 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
908 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
909 },
910 },
911 {
912 /* CMD */
913 .gpio = 97,
914 .settings = {
915 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
916 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
917 },
918 },
919 {
920 /* CLK */
921 .gpio = 98,
922 .settings = {
923 [GPIOMUX_ACTIVE] = &sdcc2_clk_actv_cfg,
924 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
925 },
926 },
927};
928#endif
929
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800930int __init msm8960_init_gpiomux(void)
931{
932 int rc = msm_gpiomux_init(NR_GPIO_IRQS);
933 if (rc) {
934 pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
935 return rc;
936 }
937
938#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
939 msm_gpiomux_install(msm8960_ethernet_configs,
940 ARRAY_SIZE(msm8960_ethernet_configs));
941#endif
942
943 msm_gpiomux_install(msm8960_gsbi_configs,
944 ARRAY_SIZE(msm8960_gsbi_configs));
945
946 msm_gpiomux_install(msm8960_cyts_configs,
947 ARRAY_SIZE(msm8960_cyts_configs));
948
949 msm_gpiomux_install(msm8960_slimbus_config,
950 ARRAY_SIZE(msm8960_slimbus_config));
951
952 msm_gpiomux_install(msm8960_audio_codec_configs,
953 ARRAY_SIZE(msm8960_audio_codec_configs));
954
955 msm_gpiomux_install(msm8960_audio_auxpcm_configs,
956 ARRAY_SIZE(msm8960_audio_auxpcm_configs));
957
958 msm_gpiomux_install(wcnss_5wire_interface,
959 ARRAY_SIZE(wcnss_5wire_interface));
960
Pratibhasagar V26cf2652012-01-12 17:31:21 +0530961#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
962 msm_gpiomux_install(msm8960_sdcc4_configs,
963 ARRAY_SIZE(msm8960_sdcc4_configs));
964#endif
965
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800966 if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() ||
967 machine_is_msm8960_liquid() || machine_is_msm8960_cdp())
968 msm_gpiomux_install(hap_lvl_shft_config,
969 ARRAY_SIZE(hap_lvl_shft_config));
970
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800971#ifdef CONFIG_USB_EHCI_MSM_HSIC
972 if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
Joel King0cbf5d82012-05-24 15:21:38 -0700973 machine_is_msm8960_liquid())
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800974 msm_gpiomux_install(msm8960_hsic_configs,
975 ARRAY_SIZE(msm8960_hsic_configs));
Vijayavardhan Vennapusaafbbb8f2012-04-13 16:28:45 +0530976
977 if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
978 machine_is_msm8960_liquid())
979 msm_gpiomux_install(msm8960_hsic_hub_configs,
980 ARRAY_SIZE(msm8960_hsic_hub_configs));
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800981#endif
982
983#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
984 msm_gpiomux_install(msm8960_hdmi_configs,
985 ARRAY_SIZE(msm8960_hdmi_configs));
986#endif
987
988 msm_gpiomux_install(msm8960_mdp_vsync_configs,
989 ARRAY_SIZE(msm8960_mdp_vsync_configs));
990
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -0700991 if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE)
992 msm_gpiomux_install(msm8960_gsbi8_uart_configs,
993 ARRAY_SIZE(msm8960_gsbi8_uart_configs));
994 else
995 msm_gpiomux_install(msm8960_gsbi5_uart_configs,
996 ARRAY_SIZE(msm8960_gsbi5_uart_configs));
Satish Babu Patakokila95d659d2012-05-10 14:42:46 +0530997
998 if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) {
999 /* For 8960 Fusion 2.2 Primary IPC */
Mayank Ranae009c922012-03-22 03:02:06 +05301000 msm_gpiomux_install(msm8960_fusion_gsbi_configs,
1001 ARRAY_SIZE(msm8960_fusion_gsbi_configs));
Satish Babu Patakokila95d659d2012-05-10 14:42:46 +05301002 /* For SGLTE 8960 Fusion External VFR */
1003 msm_gpiomux_install(msm8960_external_vfr_configs,
1004 ARRAY_SIZE(msm8960_external_vfr_configs));
1005 }
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -07001006
Pratibhasagar V57c808e2012-01-12 13:47:30 +05301007#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
1008 msm_gpiomux_install(msm8960_sdcc2_configs,
1009 ARRAY_SIZE(msm8960_sdcc2_configs));
1010#endif
Joel King0cbf5d82012-05-24 15:21:38 -07001011
1012 if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE)
1013 msm_gpiomux_install(sglte_configs,
1014 ARRAY_SIZE(sglte_configs));
1015
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08001016 return 0;
1017}