blob: 94cafae358ed3ee3bd6f60155ec525b1dd5b1579 [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
14#include <asm/mach-types.h>
15#include <mach/gpio.h>
16#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
243static struct gpiomux_setting mdp_vsync_suspend_cfg = {
244 .func = GPIOMUX_FUNC_GPIO,
245 .drv = GPIOMUX_DRV_2MA,
246 .pull = GPIOMUX_PULL_DOWN,
247};
248
249static struct gpiomux_setting mdp_vsync_active_cfg = {
250 .func = GPIOMUX_FUNC_1,
251 .drv = GPIOMUX_DRV_2MA,
252 .pull = GPIOMUX_PULL_DOWN,
253};
254
255#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
256static struct gpiomux_setting hdmi_suspend_cfg = {
257 .func = GPIOMUX_FUNC_GPIO,
258 .drv = GPIOMUX_DRV_2MA,
259 .pull = GPIOMUX_PULL_DOWN,
260};
261
262static struct gpiomux_setting hdmi_active_1_cfg = {
263 .func = GPIOMUX_FUNC_1,
264 .drv = GPIOMUX_DRV_2MA,
265 .pull = GPIOMUX_PULL_UP,
266};
267
268static struct gpiomux_setting hdmi_active_2_cfg = {
269 .func = GPIOMUX_FUNC_1,
270 .drv = GPIOMUX_DRV_2MA,
271 .pull = GPIOMUX_PULL_DOWN,
272};
Eugene Yasman67592342011-12-11 13:12:36 +0200273
Manoj Rao14648742012-03-30 19:42:12 -0700274#if defined(CONFIG_FB_MSM_HDMI_MHL_8334) || defined(CONFIG_FB_MSM_HDMI_MHL_9244)
Eugene Yasman67592342011-12-11 13:12:36 +0200275static struct gpiomux_setting hdmi_active_3_cfg = {
276 .func = GPIOMUX_FUNC_GPIO,
277 .drv = GPIOMUX_DRV_2MA,
Eugene Yasmana2db4162011-12-13 09:28:22 +0200278 .pull = GPIOMUX_PULL_UP,
Eugene Yasman67592342011-12-11 13:12:36 +0200279 .dir = GPIOMUX_IN,
280};
281
282static struct gpiomux_setting hdmi_active_4_cfg = {
283 .func = GPIOMUX_FUNC_GPIO,
284 .drv = GPIOMUX_DRV_2MA,
285 .pull = GPIOMUX_PULL_UP,
286 .dir = GPIOMUX_OUT_HIGH,
287};
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800288#endif
Manoj Rao14648742012-03-30 19:42:12 -0700289#endif
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800290
291#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
292static struct msm_gpiomux_config msm8960_ethernet_configs[] = {
293 {
294 .gpio = 90,
295 .settings = {
296 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
297 }
298 },
299 {
300 .gpio = 89,
301 .settings = {
302 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
303 }
304 },
305};
306#endif
307
Mayank Ranae009c922012-03-22 03:02:06 +0530308static struct msm_gpiomux_config msm8960_fusion_gsbi_configs[] = {
309 {
310 .gpio = 93,
311 .settings = {
312 [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg,
313 [GPIOMUX_ACTIVE] = &gsbi9_active_cfg,
314 }
315 },
316 {
317 .gpio = 94,
318 .settings = {
319 [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg,
320 [GPIOMUX_ACTIVE] = &gsbi9_active_cfg,
321 }
322 },
323 {
324 .gpio = 95,
325 .settings = {
326 [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg,
327 [GPIOMUX_ACTIVE] = &gsbi9_active_cfg,
328 }
329 },
330 {
331 .gpio = 96,
332 .settings = {
333 [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg,
334 [GPIOMUX_ACTIVE] = &gsbi9_active_cfg,
335 }
336 },
337};
338
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800339static struct msm_gpiomux_config msm8960_gsbi_configs[] __initdata = {
340 {
341 .gpio = 6, /* GSBI1 QUP SPI_DATA_MOSI */
342 .settings = {
343 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
344 [GPIOMUX_ACTIVE] = &spi_active,
345 },
346 },
347 {
348 .gpio = 7, /* GSBI1 QUP SPI_DATA_MISO */
349 .settings = {
350 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
351 [GPIOMUX_ACTIVE] = &spi_active,
352 },
353 },
354 {
355 .gpio = 8, /* GSBI1 QUP SPI_CS_N */
356 .settings = {
357 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
358 [GPIOMUX_ACTIVE] = &spi_active,
359 },
360 },
361 {
362 .gpio = 9, /* GSBI1 QUP SPI_CLK */
363 .settings = {
364 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
365 [GPIOMUX_ACTIVE] = &spi_active,
366 },
367 },
368 {
369 .gpio = 14, /* GSBI1 SPI_CS_1 */
370 .settings = {
371 [GPIOMUX_SUSPENDED] = &spi_suspended_config2,
372 [GPIOMUX_ACTIVE] = &spi_active_config2,
373 },
374 },
375 {
376 .gpio = 16, /* GSBI3 I2C QUP SDA */
377 .settings = {
378 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
379 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
380 },
381 },
382 {
383 .gpio = 17, /* GSBI3 I2C QUP SCL */
384 .settings = {
385 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
386 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
387 },
388 },
389 {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800390 .gpio = 44, /* GSBI12 I2C QUP SDA */
391 .settings = {
392 [GPIOMUX_SUSPENDED] = &gsbi12,
393 },
394 },
395 {
396 .gpio = 45, /* GSBI12 I2C QUP SCL */
397 .settings = {
398 [GPIOMUX_SUSPENDED] = &gsbi12,
399 },
400 },
401 {
402 .gpio = 73, /* GSBI10 I2C QUP SDA */
403 .settings = {
404 [GPIOMUX_SUSPENDED] = &gsbi10,
405 },
406 },
407 {
408 .gpio = 74, /* GSBI10 I2C QUP SCL */
409 .settings = {
410 [GPIOMUX_SUSPENDED] = &gsbi10,
411 },
412 },
413};
414
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -0700415static struct msm_gpiomux_config msm8960_gsbi5_uart_configs[] __initdata = {
416 {
417 .gpio = 22, /* GSBI5 UART2 */
418 .settings = {
419 [GPIOMUX_SUSPENDED] = &gsbi_uart,
420 },
421 },
422 {
423 .gpio = 23, /* GSBI5 UART2 */
424 .settings = {
425 [GPIOMUX_SUSPENDED] = &gsbi_uart,
426 },
427 },
428 {
429 .gpio = 24, /* GSBI5 UART2 */
430 .settings = {
431 [GPIOMUX_SUSPENDED] = &gsbi_uart,
432 },
433 },
434 {
435 .gpio = 25, /* GSBI5 UART2 */
436 .settings = {
437 [GPIOMUX_SUSPENDED] = &gsbi_uart,
438 },
439 },
440};
441
Satish Babu Patakokila95d659d2012-05-10 14:42:46 +0530442static struct msm_gpiomux_config msm8960_external_vfr_configs[] __initdata = {
443 {
444 .gpio = 23, /* EXTERNAL VFR */
445 .settings = {
446 [GPIOMUX_SUSPENDED] = &external_vfr[0],
447 [GPIOMUX_ACTIVE] = &external_vfr[1],
448 },
449 },
450};
451
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -0700452static struct msm_gpiomux_config msm8960_gsbi8_uart_configs[] __initdata = {
453 {
454 .gpio = 34, /* GSBI8 UART3 */
455 .settings = {
456 [GPIOMUX_SUSPENDED] = &gsbi_uart,
457 },
458 },
459 {
460 .gpio = 35, /* GSBI8 UART3 */
461 .settings = {
462 [GPIOMUX_SUSPENDED] = &gsbi_uart,
463 },
464 },
465 {
466 .gpio = 36, /* GSBI8 UART3 */
467 .settings = {
468 [GPIOMUX_SUSPENDED] = &gsbi_uart,
469 },
470 },
471 {
472 .gpio = 37, /* GSBI8 UART3 */
473 .settings = {
474 [GPIOMUX_SUSPENDED] = &gsbi_uart,
475 },
476 },
477};
478
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800479static struct msm_gpiomux_config msm8960_slimbus_config[] __initdata = {
480 {
481 .gpio = 60, /* slimbus data */
482 .settings = {
483 [GPIOMUX_SUSPENDED] = &slimbus,
484 },
485 },
486 {
487 .gpio = 61, /* slimbus clk */
488 .settings = {
489 [GPIOMUX_SUSPENDED] = &slimbus,
490 },
491 },
492};
493
494static struct msm_gpiomux_config msm8960_audio_codec_configs[] __initdata = {
495 {
496 .gpio = 59,
497 .settings = {
498 [GPIOMUX_SUSPENDED] = &cdc_mclk,
499 },
500 },
501};
502
503static struct msm_gpiomux_config msm8960_audio_auxpcm_configs[] __initdata = {
504 {
505 .gpio = 63,
506 .settings = {
507 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
508 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
509 },
510 },
511 {
512 .gpio = 64,
513 .settings = {
514 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
515 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
516 },
517 },
518 {
519 .gpio = 65,
520 .settings = {
521 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
522 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
523 },
524 },
525 {
526 .gpio = 66,
527 .settings = {
528 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
529 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
530 },
531 },
532};
533
534static struct msm_gpiomux_config wcnss_5wire_interface[] = {
535 {
536 .gpio = 84,
537 .settings = {
538 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
539 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
540 },
541 },
542 {
543 .gpio = 85,
544 .settings = {
545 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
546 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
547 },
548 },
549 {
550 .gpio = 86,
551 .settings = {
552 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
553 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
554 },
555 },
556 {
557 .gpio = 87,
558 .settings = {
559 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
560 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
561 },
562 },
563 {
564 .gpio = 88,
565 .settings = {
566 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
567 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
568 },
569 },
570};
571
572static struct msm_gpiomux_config msm8960_cyts_configs[] __initdata = {
573 { /* TS INTERRUPT */
574 .gpio = 11,
575 .settings = {
576 [GPIOMUX_ACTIVE] = &cyts_int_act_cfg,
577 [GPIOMUX_SUSPENDED] = &cyts_int_sus_cfg,
578 },
579 },
580 { /* TS SLEEP */
581 .gpio = 50,
582 .settings = {
583 [GPIOMUX_ACTIVE] = &cyts_sleep_act_cfg,
584 [GPIOMUX_SUSPENDED] = &cyts_sleep_sus_cfg,
585 },
586 },
587 { /* TS RESOUT */
588 .gpio = 52,
589 .settings = {
590 [GPIOMUX_ACTIVE] = &cyts_resout_act_cfg,
591 [GPIOMUX_SUSPENDED] = &cyts_resout_sus_cfg,
592 },
593 },
594};
595
596#ifdef CONFIG_USB_EHCI_MSM_HSIC
597static struct msm_gpiomux_config msm8960_hsic_configs[] = {
598 {
599 .gpio = 150, /*HSIC_STROBE */
600 .settings = {
601 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
602 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
603 },
604 },
605 {
606 .gpio = 151, /* HSIC_DATA */
607 .settings = {
608 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
609 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
610 },
611 },
Vijayavardhan Vennapusaafbbb8f2012-04-13 16:28:45 +0530612};
613
614static struct msm_gpiomux_config msm8960_hsic_hub_configs[] = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800615 {
616 .gpio = 91, /* HSIC_HUB_RESET */
617 .settings = {
618 [GPIOMUX_ACTIVE] = &hsic_hub_act_cfg,
619 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
620 },
621 },
622};
623#endif
624
Pratibhasagar V26cf2652012-01-12 17:31:21 +0530625#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
626static struct gpiomux_setting sdcc4_clk_actv_cfg = {
627 .func = GPIOMUX_FUNC_2,
628 .drv = GPIOMUX_DRV_8MA,
629 .pull = GPIOMUX_PULL_NONE,
630};
631
632static struct gpiomux_setting sdcc4_cmd_data_0_3_actv_cfg = {
633 .func = GPIOMUX_FUNC_2,
634 .drv = GPIOMUX_DRV_8MA,
635 .pull = GPIOMUX_PULL_UP,
636};
637
638static struct gpiomux_setting sdcc4_suspend_cfg = {
639 .func = GPIOMUX_FUNC_GPIO,
640 .drv = GPIOMUX_DRV_2MA,
641 .pull = GPIOMUX_PULL_DOWN,
642};
643
644static struct gpiomux_setting sdcc4_data_1_suspend_cfg = {
645 .func = GPIOMUX_FUNC_GPIO,
646 .drv = GPIOMUX_DRV_8MA,
647 .pull = GPIOMUX_PULL_UP,
648};
649
650static struct msm_gpiomux_config msm8960_sdcc4_configs[] __initdata = {
651 {
652 /* SDC4_DATA_3 */
653 .gpio = 83,
654 .settings = {
655 [GPIOMUX_ACTIVE] = &sdcc4_cmd_data_0_3_actv_cfg,
656 [GPIOMUX_SUSPENDED] = &sdcc4_suspend_cfg,
657 },
658 },
659 {
660 /* SDC4_DATA_2 */
661 .gpio = 84,
662 .settings = {
663 [GPIOMUX_ACTIVE] = &sdcc4_cmd_data_0_3_actv_cfg,
664 [GPIOMUX_SUSPENDED] = &sdcc4_suspend_cfg,
665 },
666 },
667 {
668 /* SDC4_DATA_1 */
669 .gpio = 85,
670 .settings = {
671 [GPIOMUX_ACTIVE] = &sdcc4_cmd_data_0_3_actv_cfg,
672 [GPIOMUX_SUSPENDED] = &sdcc4_data_1_suspend_cfg,
673 },
674 },
675 {
676 /* SDC4_DATA_0 */
677 .gpio = 86,
678 .settings = {
679 [GPIOMUX_ACTIVE] = &sdcc4_cmd_data_0_3_actv_cfg,
680 [GPIOMUX_SUSPENDED] = &sdcc4_suspend_cfg,
681 },
682 },
683 {
684 /* SDC4_CMD */
685 .gpio = 87,
686 .settings = {
687 [GPIOMUX_ACTIVE] = &sdcc4_cmd_data_0_3_actv_cfg,
688 [GPIOMUX_SUSPENDED] = &sdcc4_suspend_cfg,
689 },
690 },
691 {
692 /* SDC4_CLK */
693 .gpio = 88,
694 .settings = {
695 [GPIOMUX_ACTIVE] = &sdcc4_clk_actv_cfg,
696 [GPIOMUX_SUSPENDED] = &sdcc4_suspend_cfg,
697 },
698 },
699};
700#endif
701
702
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800703static struct msm_gpiomux_config hap_lvl_shft_config[] __initdata = {
704 {
705 .gpio = 47,
706 .settings = {
707 [GPIOMUX_SUSPENDED] = &hap_lvl_shft_suspended_config,
708 [GPIOMUX_ACTIVE] = &hap_lvl_shft_active_config,
709 },
710 },
711};
712
Joel King0cbf5d82012-05-24 15:21:38 -0700713static struct msm_gpiomux_config sglte_configs[] __initdata = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800714 /* AP2MDM_STATUS */
715 {
Joel King0cbf5d82012-05-24 15:21:38 -0700716 .gpio = 77,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800717 .settings = {
718 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
719 }
720 },
721 /* MDM2AP_STATUS */
722 {
Joel King0cbf5d82012-05-24 15:21:38 -0700723 .gpio = 24,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800724 .settings = {
725 [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
726 }
727 },
728 /* MDM2AP_ERRFATAL */
729 {
Joel King0cbf5d82012-05-24 15:21:38 -0700730 .gpio = 40,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800731 .settings = {
732 [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
733 }
734 },
735 /* AP2MDM_ERRFATAL */
736 {
Joel King0cbf5d82012-05-24 15:21:38 -0700737 .gpio = 80,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800738 .settings = {
739 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
740 }
741 },
742 /* AP2MDM_KPDPWR_N */
743 {
Joel King0cbf5d82012-05-24 15:21:38 -0700744 .gpio = 79,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800745 .settings = {
746 [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg,
747 }
748 },
Joel King0cbf5d82012-05-24 15:21:38 -0700749 /* AP2MDM_PMIC_PWR_EN */
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800750 {
Joel King0cbf5d82012-05-24 15:21:38 -0700751 .gpio = 22,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800752 .settings = {
753 [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg,
754 }
Joel King0cbf5d82012-05-24 15:21:38 -0700755 },
756 /* AP2MDM_SOFT_RESET */
757 {
758 .gpio = 78,
759 .settings = {
760 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
761 }
762 },
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800763};
764
765static struct msm_gpiomux_config msm8960_mdp_vsync_configs[] __initdata = {
766 {
767 .gpio = 0,
768 .settings = {
769 [GPIOMUX_ACTIVE] = &mdp_vsync_active_cfg,
770 [GPIOMUX_SUSPENDED] = &mdp_vsync_suspend_cfg,
771 },
772 }
773};
774
775#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
776static struct msm_gpiomux_config msm8960_hdmi_configs[] __initdata = {
777 {
778 .gpio = 99,
779 .settings = {
780 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
781 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
782 },
783 },
784 {
785 .gpio = 100,
786 .settings = {
787 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
788 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
789 },
790 },
791 {
792 .gpio = 101,
793 .settings = {
794 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
795 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
796 },
797 },
798 {
799 .gpio = 102,
800 .settings = {
801 [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg,
802 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
803 },
804 },
Manoj Rao14648742012-03-30 19:42:12 -0700805#ifdef CONFIG_FB_MSM_HDMI_MHL_9244
Eugene Yasman67592342011-12-11 13:12:36 +0200806 {
807 .gpio = 15,
808 .settings = {
809 [GPIOMUX_ACTIVE] = &hdmi_active_3_cfg,
810 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
811 },
812 },
813 {
814 .gpio = 66,
815 .settings = {
816 [GPIOMUX_ACTIVE] = &hdmi_active_4_cfg,
817 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
818 },
819 },
Manoj Rao14648742012-03-30 19:42:12 -0700820#endif
821#ifdef CONFIG_FB_MSM_HDMI_MHL_8334
822 {
823 .gpio = 4,
824 .settings = {
825 [GPIOMUX_ACTIVE] = &hdmi_active_3_cfg,
826 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
827 },
828 },
829 {
830 .gpio = 15,
831 .settings = {
832 [GPIOMUX_ACTIVE] = &hdmi_active_4_cfg,
833 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
834 },
835 },
836#endif /* CONFIG_FB_MSM_HDMI_MHL */
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800837};
838#endif
839
Pratibhasagar V57c808e2012-01-12 13:47:30 +0530840#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
841static struct gpiomux_setting sdcc2_clk_actv_cfg = {
842 .func = GPIOMUX_FUNC_2,
843 .drv = GPIOMUX_DRV_8MA,
844 .pull = GPIOMUX_PULL_NONE,
845};
846
847static struct gpiomux_setting sdcc2_cmd_data_0_3_actv_cfg = {
848 .func = GPIOMUX_FUNC_2,
849 .drv = GPIOMUX_DRV_8MA,
850 .pull = GPIOMUX_PULL_UP,
851};
852
853static struct gpiomux_setting sdcc2_suspend_cfg = {
854 .func = GPIOMUX_FUNC_GPIO,
855 .drv = GPIOMUX_DRV_2MA,
856 .pull = GPIOMUX_PULL_DOWN,
857};
858
859static struct gpiomux_setting sdcc2_data_1_suspend_cfg = {
860 .func = GPIOMUX_FUNC_GPIO,
861 .drv = GPIOMUX_DRV_8MA,
862 .pull = GPIOMUX_PULL_UP,
863};
864
865static struct msm_gpiomux_config msm8960_sdcc2_configs[] __initdata = {
866 {
867 /* DATA_3 */
868 .gpio = 92,
869 .settings = {
870 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
871 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
872 },
873 },
874 {
875 /* DATA_2 */
876 .gpio = 91,
877 .settings = {
878 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
879 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
880 },
881 },
882 {
883 /* DATA_1 */
884 .gpio = 90,
885 .settings = {
886 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
887 [GPIOMUX_SUSPENDED] = &sdcc2_data_1_suspend_cfg,
888 },
889 },
890 {
891 /* DATA_0 */
892 .gpio = 89,
893 .settings = {
894 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
895 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
896 },
897 },
898 {
899 /* CMD */
900 .gpio = 97,
901 .settings = {
902 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
903 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
904 },
905 },
906 {
907 /* CLK */
908 .gpio = 98,
909 .settings = {
910 [GPIOMUX_ACTIVE] = &sdcc2_clk_actv_cfg,
911 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
912 },
913 },
914};
915#endif
916
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800917int __init msm8960_init_gpiomux(void)
918{
919 int rc = msm_gpiomux_init(NR_GPIO_IRQS);
920 if (rc) {
921 pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
922 return rc;
923 }
924
925#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
926 msm_gpiomux_install(msm8960_ethernet_configs,
927 ARRAY_SIZE(msm8960_ethernet_configs));
928#endif
929
930 msm_gpiomux_install(msm8960_gsbi_configs,
931 ARRAY_SIZE(msm8960_gsbi_configs));
932
933 msm_gpiomux_install(msm8960_cyts_configs,
934 ARRAY_SIZE(msm8960_cyts_configs));
935
936 msm_gpiomux_install(msm8960_slimbus_config,
937 ARRAY_SIZE(msm8960_slimbus_config));
938
939 msm_gpiomux_install(msm8960_audio_codec_configs,
940 ARRAY_SIZE(msm8960_audio_codec_configs));
941
942 msm_gpiomux_install(msm8960_audio_auxpcm_configs,
943 ARRAY_SIZE(msm8960_audio_auxpcm_configs));
944
945 msm_gpiomux_install(wcnss_5wire_interface,
946 ARRAY_SIZE(wcnss_5wire_interface));
947
Pratibhasagar V26cf2652012-01-12 17:31:21 +0530948#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
949 msm_gpiomux_install(msm8960_sdcc4_configs,
950 ARRAY_SIZE(msm8960_sdcc4_configs));
951#endif
952
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800953 if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() ||
954 machine_is_msm8960_liquid() || machine_is_msm8960_cdp())
955 msm_gpiomux_install(hap_lvl_shft_config,
956 ARRAY_SIZE(hap_lvl_shft_config));
957
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800958#ifdef CONFIG_USB_EHCI_MSM_HSIC
959 if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
Joel King0cbf5d82012-05-24 15:21:38 -0700960 machine_is_msm8960_liquid())
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800961 msm_gpiomux_install(msm8960_hsic_configs,
962 ARRAY_SIZE(msm8960_hsic_configs));
Vijayavardhan Vennapusaafbbb8f2012-04-13 16:28:45 +0530963
964 if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
965 machine_is_msm8960_liquid())
966 msm_gpiomux_install(msm8960_hsic_hub_configs,
967 ARRAY_SIZE(msm8960_hsic_hub_configs));
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800968#endif
969
970#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
971 msm_gpiomux_install(msm8960_hdmi_configs,
972 ARRAY_SIZE(msm8960_hdmi_configs));
973#endif
974
975 msm_gpiomux_install(msm8960_mdp_vsync_configs,
976 ARRAY_SIZE(msm8960_mdp_vsync_configs));
977
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -0700978 if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE)
979 msm_gpiomux_install(msm8960_gsbi8_uart_configs,
980 ARRAY_SIZE(msm8960_gsbi8_uart_configs));
981 else
982 msm_gpiomux_install(msm8960_gsbi5_uart_configs,
983 ARRAY_SIZE(msm8960_gsbi5_uart_configs));
Satish Babu Patakokila95d659d2012-05-10 14:42:46 +0530984
985 if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) {
986 /* For 8960 Fusion 2.2 Primary IPC */
Mayank Ranae009c922012-03-22 03:02:06 +0530987 msm_gpiomux_install(msm8960_fusion_gsbi_configs,
988 ARRAY_SIZE(msm8960_fusion_gsbi_configs));
Satish Babu Patakokila95d659d2012-05-10 14:42:46 +0530989 /* For SGLTE 8960 Fusion External VFR */
990 msm_gpiomux_install(msm8960_external_vfr_configs,
991 ARRAY_SIZE(msm8960_external_vfr_configs));
992 }
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -0700993
Pratibhasagar V57c808e2012-01-12 13:47:30 +0530994#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
995 msm_gpiomux_install(msm8960_sdcc2_configs,
996 ARRAY_SIZE(msm8960_sdcc2_configs));
997#endif
Joel King0cbf5d82012-05-24 15:21:38 -0700998
999 if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE)
1000 msm_gpiomux_install(sglte_configs,
1001 ARRAY_SIZE(sglte_configs));
1002
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08001003 return 0;
1004}