blob: fc64ed2f088acf02596ce20b00b1a2c5929a4cc8 [file] [log] [blame]
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +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-8930.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
58static struct gpiomux_setting gsbi5 = {
59 .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,
87 .pull = GPIOMUX_PULL_NONE,
88 },
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
Amy Malochef3c9db42011-12-08 15:17:35 -0800123static struct gpiomux_setting atmel_resout_sus_cfg = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800124 .func = GPIOMUX_FUNC_GPIO,
125 .drv = GPIOMUX_DRV_6MA,
126 .pull = GPIOMUX_PULL_DOWN,
127};
128
Amy Malochef3c9db42011-12-08 15:17:35 -0800129static struct gpiomux_setting atmel_resout_act_cfg = {
130 .func = GPIOMUX_FUNC_GPIO,
131 .drv = GPIOMUX_DRV_6MA,
132 .pull = GPIOMUX_PULL_UP,
133};
134
135static struct gpiomux_setting atmel_ldo_en_sus_cfg = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800136 .func = GPIOMUX_FUNC_GPIO,
137 .drv = GPIOMUX_DRV_6MA,
138 .pull = GPIOMUX_PULL_DOWN,
139};
140
Amy Malochef3c9db42011-12-08 15:17:35 -0800141static struct gpiomux_setting atmel_ldo_en_act_cfg = {
142 .func = GPIOMUX_FUNC_GPIO,
143 .drv = GPIOMUX_DRV_6MA,
144 .pull = GPIOMUX_PULL_DOWN,
145};
146
147static struct gpiomux_setting atmel_int_act_cfg = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800148 .func = GPIOMUX_FUNC_GPIO,
149 .drv = GPIOMUX_DRV_8MA,
150 .pull = GPIOMUX_PULL_UP,
151};
152
Amy Malochef3c9db42011-12-08 15:17:35 -0800153static struct gpiomux_setting atmel_int_sus_cfg = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800154 .func = GPIOMUX_FUNC_GPIO,
155 .drv = GPIOMUX_DRV_2MA,
156 .pull = GPIOMUX_PULL_DOWN,
157};
Mayank Ranabf5084a2011-12-12 17:06:54 +0530158#ifdef MSM8930_PHASE_2
159static struct gpiomux_setting hsusb_act_cfg = {
160 .func = GPIOMUX_FUNC_GPIO,
161 .drv = GPIOMUX_DRV_8MA,
162 .pull = GPIOMUX_PULL_UP,
163};
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800164
Mayank Ranabf5084a2011-12-12 17:06:54 +0530165static struct gpiomux_setting hsusb_sus_cfg = {
166 .func = GPIOMUX_FUNC_GPIO,
167 .drv = GPIOMUX_DRV_2MA,
168 .pull = GPIOMUX_PULL_DOWN,
169};
170static struct msm_gpiomux_config msm8930_hsusb_configs[] = {
171 {
172 .gpio = 63, /* HSUSB_EXTERNAL_5V_LDO_EN */
173 .settings = {
174 [GPIOMUX_ACTIVE] = &hsusb_act_cfg,
175 [GPIOMUX_SUSPENDED] = &hsusb_sus_cfg,
176 },
177 },
178 {
179 .gpio = 97, /* HSUSB_5V_EN */
180 .settings = {
181 [GPIOMUX_ACTIVE] = &hsusb_act_cfg,
182 [GPIOMUX_SUSPENDED] = &hsusb_sus_cfg,
183 },
184 },
185};
186#endif
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800187#ifdef CONFIG_USB_EHCI_MSM_HSIC
188static struct gpiomux_setting hsic_act_cfg = {
189 .func = GPIOMUX_FUNC_1,
190 .drv = GPIOMUX_DRV_12MA,
191 .pull = GPIOMUX_PULL_NONE,
192};
193
194static struct gpiomux_setting hsic_sus_cfg = {
195 .func = GPIOMUX_FUNC_GPIO,
196 .drv = GPIOMUX_DRV_2MA,
197 .pull = GPIOMUX_PULL_DOWN,
198 .dir = GPIOMUX_OUT_LOW,
199};
200
201static struct gpiomux_setting hsic_hub_act_cfg = {
202 .func = GPIOMUX_FUNC_GPIO,
203 .drv = GPIOMUX_DRV_2MA,
204 .pull = GPIOMUX_PULL_NONE,
205};
206#endif
207
208static struct gpiomux_setting hap_lvl_shft_suspended_config = {
209 .func = GPIOMUX_FUNC_GPIO,
210 .drv = GPIOMUX_DRV_2MA,
211 .pull = GPIOMUX_PULL_DOWN,
212};
213
214static struct gpiomux_setting hap_lvl_shft_active_config = {
215 .func = GPIOMUX_FUNC_GPIO,
216 .drv = GPIOMUX_DRV_8MA,
217 .pull = GPIOMUX_PULL_UP,
218};
219
220static struct gpiomux_setting ap2mdm_cfg = {
221 .func = GPIOMUX_FUNC_GPIO,
222 .drv = GPIOMUX_DRV_8MA,
223 .pull = GPIOMUX_PULL_DOWN,
224};
225
226static struct gpiomux_setting mdm2ap_status_cfg = {
227 .func = GPIOMUX_FUNC_GPIO,
228 .drv = GPIOMUX_DRV_8MA,
229 .pull = GPIOMUX_PULL_NONE,
230};
231
232static struct gpiomux_setting mdm2ap_errfatal_cfg = {
233 .func = GPIOMUX_FUNC_GPIO,
234 .drv = GPIOMUX_DRV_16MA,
235 .pull = GPIOMUX_PULL_DOWN,
236};
237
238static struct gpiomux_setting ap2mdm_kpdpwr_n_cfg = {
239 .func = GPIOMUX_FUNC_GPIO,
240 .drv = GPIOMUX_DRV_8MA,
241 .pull = GPIOMUX_PULL_NONE,
242};
243
244static struct gpiomux_setting mdp_vsync_suspend_cfg = {
245 .func = GPIOMUX_FUNC_GPIO,
246 .drv = GPIOMUX_DRV_2MA,
247 .pull = GPIOMUX_PULL_DOWN,
248};
249
250static struct gpiomux_setting mdp_vsync_active_cfg = {
251 .func = GPIOMUX_FUNC_1,
252 .drv = GPIOMUX_DRV_2MA,
253 .pull = GPIOMUX_PULL_DOWN,
254};
255
256#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
257static struct gpiomux_setting hdmi_suspend_cfg = {
258 .func = GPIOMUX_FUNC_GPIO,
259 .drv = GPIOMUX_DRV_2MA,
260 .pull = GPIOMUX_PULL_DOWN,
261};
262
263static struct gpiomux_setting hdmi_active_1_cfg = {
264 .func = GPIOMUX_FUNC_1,
265 .drv = GPIOMUX_DRV_2MA,
266 .pull = GPIOMUX_PULL_UP,
267};
268
269static struct gpiomux_setting hdmi_active_2_cfg = {
270 .func = GPIOMUX_FUNC_1,
271 .drv = GPIOMUX_DRV_2MA,
272 .pull = GPIOMUX_PULL_DOWN,
273};
274#endif
275
276#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
277static struct msm_gpiomux_config msm8960_ethernet_configs[] = {
278 {
279 .gpio = 90,
280 .settings = {
281 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
282 }
283 },
284 {
285 .gpio = 89,
286 .settings = {
287 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
288 }
289 },
290};
291#endif
292
293static struct msm_gpiomux_config msm8960_gsbi_configs[] __initdata = {
294 {
295 .gpio = 6, /* GSBI1 QUP SPI_DATA_MOSI */
296 .settings = {
297 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
298 [GPIOMUX_ACTIVE] = &spi_active,
299 },
300 },
301 {
302 .gpio = 7, /* GSBI1 QUP SPI_DATA_MISO */
303 .settings = {
304 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
305 [GPIOMUX_ACTIVE] = &spi_active,
306 },
307 },
308 {
309 .gpio = 8, /* GSBI1 QUP SPI_CS_N */
310 .settings = {
311 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
312 [GPIOMUX_ACTIVE] = &spi_active,
313 },
314 },
315 {
316 .gpio = 9, /* GSBI1 QUP SPI_CLK */
317 .settings = {
318 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
319 [GPIOMUX_ACTIVE] = &spi_active,
320 },
321 },
322 {
323 .gpio = 14, /* GSBI1 SPI_CS_1 */
324 .settings = {
325 [GPIOMUX_SUSPENDED] = &spi_suspended_config2,
326 [GPIOMUX_ACTIVE] = &spi_active_config2,
327 },
328 },
329 {
330 .gpio = 16, /* GSBI3 I2C QUP SDA */
331 .settings = {
332 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
333 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
334 },
335 },
336 {
337 .gpio = 17, /* GSBI3 I2C QUP SCL */
338 .settings = {
339 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
340 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
341 },
342 },
343 {
344 .gpio = 22, /* GSBI5 UART2 */
345 .settings = {
346 [GPIOMUX_SUSPENDED] = &gsbi5,
347 },
348 },
349 {
350 .gpio = 23, /* GSBI5 UART2 */
351 .settings = {
352 [GPIOMUX_SUSPENDED] = &gsbi5,
353 },
354 },
355 {
356 .gpio = 24, /* GSBI5 UART2 */
357 .settings = {
358 [GPIOMUX_SUSPENDED] = &gsbi5,
359 },
360 },
361 {
362 .gpio = 25, /* GSBI5 UART2 */
363 .settings = {
364 [GPIOMUX_SUSPENDED] = &gsbi5,
365 },
366 },
367 {
368 .gpio = 44, /* GSBI12 I2C QUP SDA */
369 .settings = {
370 [GPIOMUX_SUSPENDED] = &gsbi12,
371 },
372 },
373 {
374 .gpio = 45, /* GSBI12 I2C QUP SCL */
375 .settings = {
376 [GPIOMUX_SUSPENDED] = &gsbi12,
377 },
378 },
379 {
380 .gpio = 73, /* GSBI10 I2C QUP SDA */
381 .settings = {
382 [GPIOMUX_SUSPENDED] = &gsbi10,
383 },
384 },
385 {
386 .gpio = 74, /* GSBI10 I2C QUP SCL */
387 .settings = {
388 [GPIOMUX_SUSPENDED] = &gsbi10,
389 },
390 },
391};
392
393static struct msm_gpiomux_config msm8960_slimbus_config[] __initdata = {
394 {
395 .gpio = 60, /* slimbus data */
396 .settings = {
397 [GPIOMUX_SUSPENDED] = &slimbus,
398 },
399 },
400 {
401 .gpio = 61, /* slimbus clk */
402 .settings = {
403 [GPIOMUX_SUSPENDED] = &slimbus,
404 },
405 },
406};
407
408static struct msm_gpiomux_config msm8960_audio_codec_configs[] __initdata = {
409 {
410 .gpio = 59,
411 .settings = {
412 [GPIOMUX_SUSPENDED] = &cdc_mclk,
413 },
414 },
415};
416
417static struct msm_gpiomux_config msm8960_audio_auxpcm_configs[] __initdata = {
418 {
419 .gpio = 63,
420 .settings = {
421 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
422 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
423 },
424 },
425 {
426 .gpio = 64,
427 .settings = {
428 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
429 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
430 },
431 },
432 {
433 .gpio = 65,
434 .settings = {
435 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
436 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
437 },
438 },
439 {
440 .gpio = 66,
441 .settings = {
442 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
443 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
444 },
445 },
446};
447
448static struct msm_gpiomux_config wcnss_5wire_interface[] = {
449 {
450 .gpio = 84,
451 .settings = {
452 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
453 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
454 },
455 },
456 {
457 .gpio = 85,
458 .settings = {
459 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
460 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
461 },
462 },
463 {
464 .gpio = 86,
465 .settings = {
466 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
467 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
468 },
469 },
470 {
471 .gpio = 87,
472 .settings = {
473 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
474 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
475 },
476 },
477 {
478 .gpio = 88,
479 .settings = {
480 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
481 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
482 },
483 },
484};
485
Amy Malochef3c9db42011-12-08 15:17:35 -0800486static struct msm_gpiomux_config msm8960_atmel_configs[] __initdata = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800487 { /* TS INTERRUPT */
488 .gpio = 11,
489 .settings = {
Amy Malochef3c9db42011-12-08 15:17:35 -0800490 [GPIOMUX_ACTIVE] = &atmel_int_act_cfg,
491 [GPIOMUX_SUSPENDED] = &atmel_int_sus_cfg,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800492 },
493 },
Amy Malochef3c9db42011-12-08 15:17:35 -0800494 { /* TS LDO ENABLE */
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800495 .gpio = 50,
496 .settings = {
Amy Malochef3c9db42011-12-08 15:17:35 -0800497 [GPIOMUX_ACTIVE] = &atmel_ldo_en_act_cfg,
498 [GPIOMUX_SUSPENDED] = &atmel_ldo_en_sus_cfg,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800499 },
500 },
501 { /* TS RESOUT */
502 .gpio = 52,
503 .settings = {
Amy Malochef3c9db42011-12-08 15:17:35 -0800504 [GPIOMUX_ACTIVE] = &atmel_resout_act_cfg,
505 [GPIOMUX_SUSPENDED] = &atmel_resout_sus_cfg,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800506 },
507 },
508};
509
510#ifdef CONFIG_USB_EHCI_MSM_HSIC
511static struct msm_gpiomux_config msm8960_hsic_configs[] = {
512 {
513 .gpio = 150, /*HSIC_STROBE */
514 .settings = {
515 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
516 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
517 },
518 },
519 {
520 .gpio = 151, /* HSIC_DATA */
521 .settings = {
522 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
523 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
524 },
525 },
526 {
527 .gpio = 91, /* HSIC_HUB_RESET */
528 .settings = {
529 [GPIOMUX_ACTIVE] = &hsic_hub_act_cfg,
530 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
531 },
532 },
533};
534#endif
535
536static struct msm_gpiomux_config hap_lvl_shft_config[] __initdata = {
537 {
538 .gpio = 47,
539 .settings = {
540 [GPIOMUX_SUSPENDED] = &hap_lvl_shft_suspended_config,
541 [GPIOMUX_ACTIVE] = &hap_lvl_shft_active_config,
542 },
543 },
544};
545
546static struct msm_gpiomux_config mdm_configs[] __initdata = {
547 /* AP2MDM_STATUS */
548 {
549 .gpio = 94,
550 .settings = {
551 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
552 }
553 },
554 /* MDM2AP_STATUS */
555 {
556 .gpio = 69,
557 .settings = {
558 [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
559 }
560 },
561 /* MDM2AP_ERRFATAL */
562 {
563 .gpio = 70,
564 .settings = {
565 [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
566 }
567 },
568 /* AP2MDM_ERRFATAL */
569 {
570 .gpio = 95,
571 .settings = {
572 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
573 }
574 },
575 /* AP2MDM_KPDPWR_N */
576 {
577 .gpio = 81,
578 .settings = {
579 [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg,
580 }
581 },
582 /* AP2MDM_PMIC_RESET_N */
583 {
584 .gpio = 80,
585 .settings = {
586 [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg,
587 }
588 }
589};
590
591static struct msm_gpiomux_config msm8960_mdp_vsync_configs[] __initdata = {
592 {
593 .gpio = 0,
594 .settings = {
595 [GPIOMUX_ACTIVE] = &mdp_vsync_active_cfg,
596 [GPIOMUX_SUSPENDED] = &mdp_vsync_suspend_cfg,
597 },
598 }
599};
600
601#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
602static struct msm_gpiomux_config msm8960_hdmi_configs[] __initdata = {
603 {
604 .gpio = 99,
605 .settings = {
606 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
607 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
608 },
609 },
610 {
611 .gpio = 100,
612 .settings = {
613 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
614 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
615 },
616 },
617 {
618 .gpio = 101,
619 .settings = {
620 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
621 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
622 },
623 },
624 {
625 .gpio = 102,
626 .settings = {
627 [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg,
628 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
629 },
630 },
631};
632#endif
633
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +0530634#ifdef MSM8930_PHASE_2
635static struct gpiomux_setting haptics_suspend_cfg = {
636 .func = GPIOMUX_FUNC_GPIO,
637 .drv = GPIOMUX_DRV_8MA,
638 .pull = GPIOMUX_PULL_DOWN,
639};
640
641static struct msm_gpiomux_config msm8930_haptics_configs[] __initdata = {
642 {
643 .gpio = 77,
644 .settings = {
645 [GPIOMUX_SUSPENDED] = &haptics_suspend_cfg,
646 },
647 },
648 {
649 .gpio = 78,
650 .settings = {
651 [GPIOMUX_SUSPENDED] = &haptics_suspend_cfg,
652 },
653 },
654};
655#endif
656
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800657int __init msm8930_init_gpiomux(void)
658{
659 int rc = msm_gpiomux_init(NR_GPIO_IRQS);
660 if (rc) {
661 pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
662 return rc;
663 }
664
665#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
666 msm_gpiomux_install(msm8960_ethernet_configs,
667 ARRAY_SIZE(msm8960_ethernet_configs));
668#endif
669
670 msm_gpiomux_install(msm8960_gsbi_configs,
671 ARRAY_SIZE(msm8960_gsbi_configs));
672
Amy Malochef3c9db42011-12-08 15:17:35 -0800673 msm_gpiomux_install(msm8960_atmel_configs,
674 ARRAY_SIZE(msm8960_atmel_configs));
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800675
676 msm_gpiomux_install(msm8960_slimbus_config,
677 ARRAY_SIZE(msm8960_slimbus_config));
678
679 msm_gpiomux_install(msm8960_audio_codec_configs,
680 ARRAY_SIZE(msm8960_audio_codec_configs));
681
682 msm_gpiomux_install(msm8960_audio_auxpcm_configs,
683 ARRAY_SIZE(msm8960_audio_auxpcm_configs));
684
685 msm_gpiomux_install(wcnss_5wire_interface,
686 ARRAY_SIZE(wcnss_5wire_interface));
687
688 if (machine_is_msm8930_mtp() || machine_is_msm8930_fluid() ||
Mayank Ranabf5084a2011-12-12 17:06:54 +0530689 machine_is_msm8930_cdp()) {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800690 msm_gpiomux_install(hap_lvl_shft_config,
691 ARRAY_SIZE(hap_lvl_shft_config));
Mayank Ranabf5084a2011-12-12 17:06:54 +0530692#ifdef MSM8930_PHASE_2
693 msm_gpiomux_install(msm8930_hsusb_configs,
694 ARRAY_SIZE(msm8930_hsusb_configs));
695#endif
696 }
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800697
698 if (PLATFORM_IS_CHARM25())
699 msm_gpiomux_install(mdm_configs,
700 ARRAY_SIZE(mdm_configs));
701
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +0530702#ifdef MSM8930_PHASE_2
703 if (machine_is_msm8930_mtp() || machine_is_msm8930_fluid())
704 msm_gpiomux_install(msm8930_haptics_configs,
705 ARRAY_SIZE(msm8930_haptics_configs));
706#endif
707
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800708#ifdef CONFIG_USB_EHCI_MSM_HSIC
709 if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
710 !machine_is_msm8930_mtp() &&
711 !machine_is_msm8930_fluid())
712 msm_gpiomux_install(msm8960_hsic_configs,
713 ARRAY_SIZE(msm8960_hsic_configs));
714#endif
715
716#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
717 msm_gpiomux_install(msm8960_hdmi_configs,
718 ARRAY_SIZE(msm8960_hdmi_configs));
719#endif
720
721 msm_gpiomux_install(msm8960_mdp_vsync_configs,
722 ARRAY_SIZE(msm8960_mdp_vsync_configs));
723 return 0;
724}