blob: 9bf80ede115f84fcdee0bfcf262fac5a0f5fe804 [file] [log] [blame]
Patrick Laib593eaf2012-01-05 22:14:47 -08001/* Copyright (c) 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
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -070058static struct gpiomux_setting gsbi_uart = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -080059 .func = GPIOMUX_FUNC_1,
60 .drv = GPIOMUX_DRV_8MA,
61 .pull = GPIOMUX_PULL_NONE,
62};
63
Mayank Ranae009c922012-03-22 03:02:06 +053064static struct gpiomux_setting gsbi9_active_cfg = {
65 .func = GPIOMUX_FUNC_2,
66 .drv = GPIOMUX_DRV_8MA,
67 .pull = GPIOMUX_PULL_DOWN,
68};
69
70static struct gpiomux_setting gsbi9_suspended_cfg = {
71 .func = GPIOMUX_FUNC_2,
72 .drv = GPIOMUX_DRV_2MA,
73 .pull = GPIOMUX_PULL_DOWN,
74};
75
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -080076static struct gpiomux_setting gsbi10 = {
77 .func = GPIOMUX_FUNC_2,
78 .drv = GPIOMUX_DRV_8MA,
79 .pull = GPIOMUX_PULL_NONE,
80};
81
82static struct gpiomux_setting gsbi12 = {
83 .func = GPIOMUX_FUNC_1,
84 .drv = GPIOMUX_DRV_8MA,
85 .pull = GPIOMUX_PULL_NONE,
86};
87
88static struct gpiomux_setting cdc_mclk = {
89 .func = GPIOMUX_FUNC_1,
90 .drv = GPIOMUX_DRV_8MA,
91 .pull = GPIOMUX_PULL_NONE,
92};
93
94static struct gpiomux_setting audio_auxpcm[] = {
95 /* Suspended state */
96 {
97 .func = GPIOMUX_FUNC_GPIO,
98 .drv = GPIOMUX_DRV_2MA,
Patrick Laib593eaf2012-01-05 22:14:47 -080099 .pull = GPIOMUX_PULL_DOWN,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800100 },
101 /* Active state */
102 {
103 .func = GPIOMUX_FUNC_1,
104 .drv = GPIOMUX_DRV_2MA,
105 .pull = GPIOMUX_PULL_NONE,
106 },
107};
108
109#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
110static struct gpiomux_setting gpio_eth_config = {
111 .pull = GPIOMUX_PULL_NONE,
112 .drv = GPIOMUX_DRV_8MA,
113 .func = GPIOMUX_FUNC_GPIO,
114};
115#endif
116
117static struct gpiomux_setting slimbus = {
118 .func = GPIOMUX_FUNC_1,
119 .drv = GPIOMUX_DRV_8MA,
120 .pull = GPIOMUX_PULL_KEEPER,
121};
122
123static struct gpiomux_setting wcnss_5wire_suspend_cfg = {
124 .func = GPIOMUX_FUNC_GPIO,
125 .drv = GPIOMUX_DRV_2MA,
126 .pull = GPIOMUX_PULL_UP,
127};
128
129static struct gpiomux_setting wcnss_5wire_active_cfg = {
130 .func = GPIOMUX_FUNC_1,
131 .drv = GPIOMUX_DRV_6MA,
132 .pull = GPIOMUX_PULL_DOWN,
133};
134
135static struct gpiomux_setting cyts_resout_sus_cfg = {
136 .func = GPIOMUX_FUNC_GPIO,
137 .drv = GPIOMUX_DRV_6MA,
138 .pull = GPIOMUX_PULL_UP,
139};
140
141static struct gpiomux_setting cyts_resout_act_cfg = {
142 .func = GPIOMUX_FUNC_GPIO,
143 .drv = GPIOMUX_DRV_6MA,
144 .pull = GPIOMUX_PULL_UP,
145};
146
147static struct gpiomux_setting cyts_sleep_sus_cfg = {
148 .func = GPIOMUX_FUNC_GPIO,
149 .drv = GPIOMUX_DRV_6MA,
150 .pull = GPIOMUX_PULL_DOWN,
151};
152
153static struct gpiomux_setting cyts_sleep_act_cfg = {
154 .func = GPIOMUX_FUNC_GPIO,
155 .drv = GPIOMUX_DRV_6MA,
156 .pull = GPIOMUX_PULL_DOWN,
157};
158
159static struct gpiomux_setting cyts_int_act_cfg = {
160 .func = GPIOMUX_FUNC_GPIO,
161 .drv = GPIOMUX_DRV_8MA,
162 .pull = GPIOMUX_PULL_UP,
163};
164
165static struct gpiomux_setting cyts_int_sus_cfg = {
166 .func = GPIOMUX_FUNC_GPIO,
167 .drv = GPIOMUX_DRV_2MA,
168 .pull = GPIOMUX_PULL_DOWN,
169};
170
171#ifdef CONFIG_USB_EHCI_MSM_HSIC
172static struct gpiomux_setting hsic_act_cfg = {
173 .func = GPIOMUX_FUNC_1,
174 .drv = GPIOMUX_DRV_12MA,
175 .pull = GPIOMUX_PULL_NONE,
176};
177
178static struct gpiomux_setting hsic_sus_cfg = {
179 .func = GPIOMUX_FUNC_GPIO,
180 .drv = GPIOMUX_DRV_2MA,
181 .pull = GPIOMUX_PULL_DOWN,
182 .dir = GPIOMUX_OUT_LOW,
183};
184
185static struct gpiomux_setting hsic_hub_act_cfg = {
186 .func = GPIOMUX_FUNC_GPIO,
187 .drv = GPIOMUX_DRV_2MA,
188 .pull = GPIOMUX_PULL_NONE,
189};
190#endif
191
192static struct gpiomux_setting hap_lvl_shft_suspended_config = {
193 .func = GPIOMUX_FUNC_GPIO,
194 .drv = GPIOMUX_DRV_2MA,
195 .pull = GPIOMUX_PULL_DOWN,
196};
197
198static struct gpiomux_setting hap_lvl_shft_active_config = {
199 .func = GPIOMUX_FUNC_GPIO,
200 .drv = GPIOMUX_DRV_8MA,
201 .pull = GPIOMUX_PULL_UP,
202};
203
204static struct gpiomux_setting ap2mdm_cfg = {
205 .func = GPIOMUX_FUNC_GPIO,
206 .drv = GPIOMUX_DRV_8MA,
207 .pull = GPIOMUX_PULL_DOWN,
208};
209
210static struct gpiomux_setting mdm2ap_status_cfg = {
211 .func = GPIOMUX_FUNC_GPIO,
212 .drv = GPIOMUX_DRV_8MA,
213 .pull = GPIOMUX_PULL_NONE,
214};
215
216static struct gpiomux_setting mdm2ap_errfatal_cfg = {
217 .func = GPIOMUX_FUNC_GPIO,
218 .drv = GPIOMUX_DRV_16MA,
219 .pull = GPIOMUX_PULL_DOWN,
220};
221
222static struct gpiomux_setting ap2mdm_kpdpwr_n_cfg = {
223 .func = GPIOMUX_FUNC_GPIO,
224 .drv = GPIOMUX_DRV_8MA,
Joel King1c607312012-01-13 16:41:44 -0800225 .pull = GPIOMUX_PULL_DOWN,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800226};
227
228static struct gpiomux_setting mdp_vsync_suspend_cfg = {
229 .func = GPIOMUX_FUNC_GPIO,
230 .drv = GPIOMUX_DRV_2MA,
231 .pull = GPIOMUX_PULL_DOWN,
232};
233
234static struct gpiomux_setting mdp_vsync_active_cfg = {
235 .func = GPIOMUX_FUNC_1,
236 .drv = GPIOMUX_DRV_2MA,
237 .pull = GPIOMUX_PULL_DOWN,
238};
239
240#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
241static struct gpiomux_setting hdmi_suspend_cfg = {
242 .func = GPIOMUX_FUNC_GPIO,
243 .drv = GPIOMUX_DRV_2MA,
244 .pull = GPIOMUX_PULL_DOWN,
245};
246
247static struct gpiomux_setting hdmi_active_1_cfg = {
248 .func = GPIOMUX_FUNC_1,
249 .drv = GPIOMUX_DRV_2MA,
250 .pull = GPIOMUX_PULL_UP,
251};
252
253static struct gpiomux_setting hdmi_active_2_cfg = {
254 .func = GPIOMUX_FUNC_1,
255 .drv = GPIOMUX_DRV_2MA,
256 .pull = GPIOMUX_PULL_DOWN,
257};
Eugene Yasman67592342011-12-11 13:12:36 +0200258
259static struct gpiomux_setting hdmi_active_3_cfg = {
260 .func = GPIOMUX_FUNC_GPIO,
261 .drv = GPIOMUX_DRV_2MA,
Eugene Yasmana2db4162011-12-13 09:28:22 +0200262 .pull = GPIOMUX_PULL_UP,
Eugene Yasman67592342011-12-11 13:12:36 +0200263 .dir = GPIOMUX_IN,
264};
265
266static struct gpiomux_setting hdmi_active_4_cfg = {
267 .func = GPIOMUX_FUNC_GPIO,
268 .drv = GPIOMUX_DRV_2MA,
269 .pull = GPIOMUX_PULL_UP,
270 .dir = GPIOMUX_OUT_HIGH,
271};
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800272#endif
273
274#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
275static struct msm_gpiomux_config msm8960_ethernet_configs[] = {
276 {
277 .gpio = 90,
278 .settings = {
279 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
280 }
281 },
282 {
283 .gpio = 89,
284 .settings = {
285 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
286 }
287 },
288};
289#endif
290
Mayank Ranae009c922012-03-22 03:02:06 +0530291static struct msm_gpiomux_config msm8960_fusion_gsbi_configs[] = {
292 {
293 .gpio = 93,
294 .settings = {
295 [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg,
296 [GPIOMUX_ACTIVE] = &gsbi9_active_cfg,
297 }
298 },
299 {
300 .gpio = 94,
301 .settings = {
302 [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg,
303 [GPIOMUX_ACTIVE] = &gsbi9_active_cfg,
304 }
305 },
306 {
307 .gpio = 95,
308 .settings = {
309 [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg,
310 [GPIOMUX_ACTIVE] = &gsbi9_active_cfg,
311 }
312 },
313 {
314 .gpio = 96,
315 .settings = {
316 [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg,
317 [GPIOMUX_ACTIVE] = &gsbi9_active_cfg,
318 }
319 },
320};
321
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800322static struct msm_gpiomux_config msm8960_gsbi_configs[] __initdata = {
323 {
324 .gpio = 6, /* GSBI1 QUP SPI_DATA_MOSI */
325 .settings = {
326 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
327 [GPIOMUX_ACTIVE] = &spi_active,
328 },
329 },
330 {
331 .gpio = 7, /* GSBI1 QUP SPI_DATA_MISO */
332 .settings = {
333 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
334 [GPIOMUX_ACTIVE] = &spi_active,
335 },
336 },
337 {
338 .gpio = 8, /* GSBI1 QUP SPI_CS_N */
339 .settings = {
340 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
341 [GPIOMUX_ACTIVE] = &spi_active,
342 },
343 },
344 {
345 .gpio = 9, /* GSBI1 QUP SPI_CLK */
346 .settings = {
347 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
348 [GPIOMUX_ACTIVE] = &spi_active,
349 },
350 },
351 {
352 .gpio = 14, /* GSBI1 SPI_CS_1 */
353 .settings = {
354 [GPIOMUX_SUSPENDED] = &spi_suspended_config2,
355 [GPIOMUX_ACTIVE] = &spi_active_config2,
356 },
357 },
358 {
359 .gpio = 16, /* GSBI3 I2C QUP SDA */
360 .settings = {
361 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
362 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
363 },
364 },
365 {
366 .gpio = 17, /* GSBI3 I2C QUP SCL */
367 .settings = {
368 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
369 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
370 },
371 },
372 {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800373 .gpio = 44, /* GSBI12 I2C QUP SDA */
374 .settings = {
375 [GPIOMUX_SUSPENDED] = &gsbi12,
376 },
377 },
378 {
379 .gpio = 45, /* GSBI12 I2C QUP SCL */
380 .settings = {
381 [GPIOMUX_SUSPENDED] = &gsbi12,
382 },
383 },
384 {
385 .gpio = 73, /* GSBI10 I2C QUP SDA */
386 .settings = {
387 [GPIOMUX_SUSPENDED] = &gsbi10,
388 },
389 },
390 {
391 .gpio = 74, /* GSBI10 I2C QUP SCL */
392 .settings = {
393 [GPIOMUX_SUSPENDED] = &gsbi10,
394 },
395 },
396};
397
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -0700398static struct msm_gpiomux_config msm8960_gsbi5_uart_configs[] __initdata = {
399 {
400 .gpio = 22, /* GSBI5 UART2 */
401 .settings = {
402 [GPIOMUX_SUSPENDED] = &gsbi_uart,
403 },
404 },
405 {
406 .gpio = 23, /* GSBI5 UART2 */
407 .settings = {
408 [GPIOMUX_SUSPENDED] = &gsbi_uart,
409 },
410 },
411 {
412 .gpio = 24, /* GSBI5 UART2 */
413 .settings = {
414 [GPIOMUX_SUSPENDED] = &gsbi_uart,
415 },
416 },
417 {
418 .gpio = 25, /* GSBI5 UART2 */
419 .settings = {
420 [GPIOMUX_SUSPENDED] = &gsbi_uart,
421 },
422 },
423};
424
425static struct msm_gpiomux_config msm8960_gsbi8_uart_configs[] __initdata = {
426 {
427 .gpio = 34, /* GSBI8 UART3 */
428 .settings = {
429 [GPIOMUX_SUSPENDED] = &gsbi_uart,
430 },
431 },
432 {
433 .gpio = 35, /* GSBI8 UART3 */
434 .settings = {
435 [GPIOMUX_SUSPENDED] = &gsbi_uart,
436 },
437 },
438 {
439 .gpio = 36, /* GSBI8 UART3 */
440 .settings = {
441 [GPIOMUX_SUSPENDED] = &gsbi_uart,
442 },
443 },
444 {
445 .gpio = 37, /* GSBI8 UART3 */
446 .settings = {
447 [GPIOMUX_SUSPENDED] = &gsbi_uart,
448 },
449 },
450};
451
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800452static struct msm_gpiomux_config msm8960_slimbus_config[] __initdata = {
453 {
454 .gpio = 60, /* slimbus data */
455 .settings = {
456 [GPIOMUX_SUSPENDED] = &slimbus,
457 },
458 },
459 {
460 .gpio = 61, /* slimbus clk */
461 .settings = {
462 [GPIOMUX_SUSPENDED] = &slimbus,
463 },
464 },
465};
466
467static struct msm_gpiomux_config msm8960_audio_codec_configs[] __initdata = {
468 {
469 .gpio = 59,
470 .settings = {
471 [GPIOMUX_SUSPENDED] = &cdc_mclk,
472 },
473 },
474};
475
476static struct msm_gpiomux_config msm8960_audio_auxpcm_configs[] __initdata = {
477 {
478 .gpio = 63,
479 .settings = {
480 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
481 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
482 },
483 },
484 {
485 .gpio = 64,
486 .settings = {
487 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
488 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
489 },
490 },
491 {
492 .gpio = 65,
493 .settings = {
494 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
495 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
496 },
497 },
498 {
499 .gpio = 66,
500 .settings = {
501 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
502 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
503 },
504 },
505};
506
507static struct msm_gpiomux_config wcnss_5wire_interface[] = {
508 {
509 .gpio = 84,
510 .settings = {
511 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
512 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
513 },
514 },
515 {
516 .gpio = 85,
517 .settings = {
518 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
519 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
520 },
521 },
522 {
523 .gpio = 86,
524 .settings = {
525 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
526 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
527 },
528 },
529 {
530 .gpio = 87,
531 .settings = {
532 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
533 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
534 },
535 },
536 {
537 .gpio = 88,
538 .settings = {
539 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
540 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
541 },
542 },
543};
544
545static struct msm_gpiomux_config msm8960_cyts_configs[] __initdata = {
546 { /* TS INTERRUPT */
547 .gpio = 11,
548 .settings = {
549 [GPIOMUX_ACTIVE] = &cyts_int_act_cfg,
550 [GPIOMUX_SUSPENDED] = &cyts_int_sus_cfg,
551 },
552 },
553 { /* TS SLEEP */
554 .gpio = 50,
555 .settings = {
556 [GPIOMUX_ACTIVE] = &cyts_sleep_act_cfg,
557 [GPIOMUX_SUSPENDED] = &cyts_sleep_sus_cfg,
558 },
559 },
560 { /* TS RESOUT */
561 .gpio = 52,
562 .settings = {
563 [GPIOMUX_ACTIVE] = &cyts_resout_act_cfg,
564 [GPIOMUX_SUSPENDED] = &cyts_resout_sus_cfg,
565 },
566 },
567};
568
569#ifdef CONFIG_USB_EHCI_MSM_HSIC
570static struct msm_gpiomux_config msm8960_hsic_configs[] = {
571 {
572 .gpio = 150, /*HSIC_STROBE */
573 .settings = {
574 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
575 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
576 },
577 },
578 {
579 .gpio = 151, /* HSIC_DATA */
580 .settings = {
581 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
582 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
583 },
584 },
Vijayavardhan Vennapusaafbbb8f2012-04-13 16:28:45 +0530585};
586
587static struct msm_gpiomux_config msm8960_hsic_hub_configs[] = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800588 {
589 .gpio = 91, /* HSIC_HUB_RESET */
590 .settings = {
591 [GPIOMUX_ACTIVE] = &hsic_hub_act_cfg,
592 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
593 },
594 },
595};
596#endif
597
598static struct msm_gpiomux_config hap_lvl_shft_config[] __initdata = {
599 {
600 .gpio = 47,
601 .settings = {
602 [GPIOMUX_SUSPENDED] = &hap_lvl_shft_suspended_config,
603 [GPIOMUX_ACTIVE] = &hap_lvl_shft_active_config,
604 },
605 },
606};
607
608static struct msm_gpiomux_config mdm_configs[] __initdata = {
609 /* AP2MDM_STATUS */
610 {
611 .gpio = 94,
612 .settings = {
613 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
614 }
615 },
616 /* MDM2AP_STATUS */
617 {
618 .gpio = 69,
619 .settings = {
620 [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
621 }
622 },
623 /* MDM2AP_ERRFATAL */
624 {
625 .gpio = 70,
626 .settings = {
627 [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
628 }
629 },
630 /* AP2MDM_ERRFATAL */
631 {
632 .gpio = 95,
633 .settings = {
634 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
635 }
636 },
637 /* AP2MDM_KPDPWR_N */
638 {
639 .gpio = 81,
640 .settings = {
641 [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg,
642 }
643 },
644 /* AP2MDM_PMIC_RESET_N */
645 {
646 .gpio = 80,
647 .settings = {
648 [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg,
649 }
650 }
651};
652
653static struct msm_gpiomux_config msm8960_mdp_vsync_configs[] __initdata = {
654 {
655 .gpio = 0,
656 .settings = {
657 [GPIOMUX_ACTIVE] = &mdp_vsync_active_cfg,
658 [GPIOMUX_SUSPENDED] = &mdp_vsync_suspend_cfg,
659 },
660 }
661};
662
663#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
664static struct msm_gpiomux_config msm8960_hdmi_configs[] __initdata = {
665 {
666 .gpio = 99,
667 .settings = {
668 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
669 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
670 },
671 },
672 {
673 .gpio = 100,
674 .settings = {
675 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
676 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
677 },
678 },
679 {
680 .gpio = 101,
681 .settings = {
682 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
683 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
684 },
685 },
686 {
687 .gpio = 102,
688 .settings = {
689 [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg,
690 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
691 },
692 },
Eugene Yasman67592342011-12-11 13:12:36 +0200693 {
694 .gpio = 15,
695 .settings = {
696 [GPIOMUX_ACTIVE] = &hdmi_active_3_cfg,
697 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
698 },
699 },
700 {
701 .gpio = 66,
702 .settings = {
703 [GPIOMUX_ACTIVE] = &hdmi_active_4_cfg,
704 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
705 },
706 },
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800707};
708#endif
709
710int __init msm8960_init_gpiomux(void)
711{
712 int rc = msm_gpiomux_init(NR_GPIO_IRQS);
713 if (rc) {
714 pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
715 return rc;
716 }
717
718#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
719 msm_gpiomux_install(msm8960_ethernet_configs,
720 ARRAY_SIZE(msm8960_ethernet_configs));
721#endif
722
723 msm_gpiomux_install(msm8960_gsbi_configs,
724 ARRAY_SIZE(msm8960_gsbi_configs));
725
726 msm_gpiomux_install(msm8960_cyts_configs,
727 ARRAY_SIZE(msm8960_cyts_configs));
728
729 msm_gpiomux_install(msm8960_slimbus_config,
730 ARRAY_SIZE(msm8960_slimbus_config));
731
732 msm_gpiomux_install(msm8960_audio_codec_configs,
733 ARRAY_SIZE(msm8960_audio_codec_configs));
734
735 msm_gpiomux_install(msm8960_audio_auxpcm_configs,
736 ARRAY_SIZE(msm8960_audio_auxpcm_configs));
737
738 msm_gpiomux_install(wcnss_5wire_interface,
739 ARRAY_SIZE(wcnss_5wire_interface));
740
741 if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() ||
742 machine_is_msm8960_liquid() || machine_is_msm8960_cdp())
743 msm_gpiomux_install(hap_lvl_shft_config,
744 ARRAY_SIZE(hap_lvl_shft_config));
745
746 if (PLATFORM_IS_CHARM25())
747 msm_gpiomux_install(mdm_configs,
748 ARRAY_SIZE(mdm_configs));
749
750#ifdef CONFIG_USB_EHCI_MSM_HSIC
751 if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
752 (PLATFORM_IS_CHARM25() || machine_is_msm8960_liquid()))
753 msm_gpiomux_install(msm8960_hsic_configs,
754 ARRAY_SIZE(msm8960_hsic_configs));
Vijayavardhan Vennapusaafbbb8f2012-04-13 16:28:45 +0530755
756 if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
757 machine_is_msm8960_liquid())
758 msm_gpiomux_install(msm8960_hsic_hub_configs,
759 ARRAY_SIZE(msm8960_hsic_hub_configs));
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800760#endif
761
762#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
763 msm_gpiomux_install(msm8960_hdmi_configs,
764 ARRAY_SIZE(msm8960_hdmi_configs));
765#endif
766
767 msm_gpiomux_install(msm8960_mdp_vsync_configs,
768 ARRAY_SIZE(msm8960_mdp_vsync_configs));
769
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -0700770 if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE)
771 msm_gpiomux_install(msm8960_gsbi8_uart_configs,
772 ARRAY_SIZE(msm8960_gsbi8_uart_configs));
773 else
774 msm_gpiomux_install(msm8960_gsbi5_uart_configs,
775 ARRAY_SIZE(msm8960_gsbi5_uart_configs));
Mayank Ranae009c922012-03-22 03:02:06 +0530776 /* For 8960 Fusion 2.2 Primary IPC */
777 if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE)
778 msm_gpiomux_install(msm8960_fusion_gsbi_configs,
779 ARRAY_SIZE(msm8960_fusion_gsbi_configs));
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -0700780
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800781 return 0;
782}