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