blob: bfb8be3912b7f7219e8e62308efc1c6c5eddf95e [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 },
542 {
543 .gpio = 91, /* HSIC_HUB_RESET */
544 .settings = {
545 [GPIOMUX_ACTIVE] = &hsic_hub_act_cfg,
546 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
547 },
548 },
549};
550#endif
551
552static struct msm_gpiomux_config hap_lvl_shft_config[] __initdata = {
553 {
554 .gpio = 47,
555 .settings = {
556 [GPIOMUX_SUSPENDED] = &hap_lvl_shft_suspended_config,
557 [GPIOMUX_ACTIVE] = &hap_lvl_shft_active_config,
558 },
559 },
560};
561
562static struct msm_gpiomux_config mdm_configs[] __initdata = {
563 /* AP2MDM_STATUS */
564 {
565 .gpio = 94,
566 .settings = {
567 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
568 }
569 },
570 /* MDM2AP_STATUS */
571 {
572 .gpio = 69,
573 .settings = {
574 [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
575 }
576 },
577 /* MDM2AP_ERRFATAL */
578 {
579 .gpio = 70,
580 .settings = {
581 [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
582 }
583 },
584 /* AP2MDM_ERRFATAL */
585 {
586 .gpio = 95,
587 .settings = {
588 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
589 }
590 },
591 /* AP2MDM_KPDPWR_N */
592 {
593 .gpio = 81,
594 .settings = {
595 [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg,
596 }
597 },
598 /* AP2MDM_PMIC_RESET_N */
599 {
600 .gpio = 80,
601 .settings = {
602 [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg,
603 }
604 }
605};
606
607static struct msm_gpiomux_config msm8960_mdp_vsync_configs[] __initdata = {
608 {
609 .gpio = 0,
610 .settings = {
611 [GPIOMUX_ACTIVE] = &mdp_vsync_active_cfg,
612 [GPIOMUX_SUSPENDED] = &mdp_vsync_suspend_cfg,
613 },
614 }
615};
616
617#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
618static struct msm_gpiomux_config msm8960_hdmi_configs[] __initdata = {
619 {
620 .gpio = 99,
621 .settings = {
622 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
623 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
624 },
625 },
626 {
627 .gpio = 100,
628 .settings = {
629 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
630 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
631 },
632 },
633 {
634 .gpio = 101,
635 .settings = {
636 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
637 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
638 },
639 },
640 {
641 .gpio = 102,
642 .settings = {
643 [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg,
644 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
645 },
646 },
Eugene Yasman67592342011-12-11 13:12:36 +0200647 {
648 .gpio = 15,
649 .settings = {
650 [GPIOMUX_ACTIVE] = &hdmi_active_3_cfg,
651 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
652 },
653 },
654 {
655 .gpio = 66,
656 .settings = {
657 [GPIOMUX_ACTIVE] = &hdmi_active_4_cfg,
658 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
659 },
660 },
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800661};
662#endif
663
664int __init msm8960_init_gpiomux(void)
665{
666 int rc = msm_gpiomux_init(NR_GPIO_IRQS);
667 if (rc) {
668 pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
669 return rc;
670 }
671
672#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
673 msm_gpiomux_install(msm8960_ethernet_configs,
674 ARRAY_SIZE(msm8960_ethernet_configs));
675#endif
676
677 msm_gpiomux_install(msm8960_gsbi_configs,
678 ARRAY_SIZE(msm8960_gsbi_configs));
679
680 msm_gpiomux_install(msm8960_cyts_configs,
681 ARRAY_SIZE(msm8960_cyts_configs));
682
683 msm_gpiomux_install(msm8960_slimbus_config,
684 ARRAY_SIZE(msm8960_slimbus_config));
685
686 msm_gpiomux_install(msm8960_audio_codec_configs,
687 ARRAY_SIZE(msm8960_audio_codec_configs));
688
689 msm_gpiomux_install(msm8960_audio_auxpcm_configs,
690 ARRAY_SIZE(msm8960_audio_auxpcm_configs));
691
692 msm_gpiomux_install(wcnss_5wire_interface,
693 ARRAY_SIZE(wcnss_5wire_interface));
694
695 if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() ||
696 machine_is_msm8960_liquid() || machine_is_msm8960_cdp())
697 msm_gpiomux_install(hap_lvl_shft_config,
698 ARRAY_SIZE(hap_lvl_shft_config));
699
700 if (PLATFORM_IS_CHARM25())
701 msm_gpiomux_install(mdm_configs,
702 ARRAY_SIZE(mdm_configs));
703
704#ifdef CONFIG_USB_EHCI_MSM_HSIC
705 if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
706 (PLATFORM_IS_CHARM25() || machine_is_msm8960_liquid()))
707 msm_gpiomux_install(msm8960_hsic_configs,
708 ARRAY_SIZE(msm8960_hsic_configs));
709#endif
710
711#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
712 msm_gpiomux_install(msm8960_hdmi_configs,
713 ARRAY_SIZE(msm8960_hdmi_configs));
714#endif
715
716 msm_gpiomux_install(msm8960_mdp_vsync_configs,
717 ARRAY_SIZE(msm8960_mdp_vsync_configs));
718
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -0700719 if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE)
720 msm_gpiomux_install(msm8960_gsbi8_uart_configs,
721 ARRAY_SIZE(msm8960_gsbi8_uart_configs));
722 else
723 msm_gpiomux_install(msm8960_gsbi5_uart_configs,
724 ARRAY_SIZE(msm8960_gsbi5_uart_configs));
725
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800726 return 0;
727}