blob: cd201ef02f627f16e5caacc2dc800d61aeb1d344 [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
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -080034static struct gpiomux_setting gsbi3_suspended_cfg = {
35 .func = GPIOMUX_FUNC_1,
36 .drv = GPIOMUX_DRV_2MA,
37 .pull = GPIOMUX_PULL_KEEPER,
38};
39
40static struct gpiomux_setting gsbi3_active_cfg = {
41 .func = GPIOMUX_FUNC_1,
42 .drv = GPIOMUX_DRV_8MA,
43 .pull = GPIOMUX_PULL_NONE,
44};
45
46static struct gpiomux_setting gsbi5 = {
47 .func = GPIOMUX_FUNC_1,
48 .drv = GPIOMUX_DRV_8MA,
49 .pull = GPIOMUX_PULL_NONE,
50};
51
Harini Jayaramanfe6ff4162012-03-14 11:25:40 -060052static struct gpiomux_setting gsbi9 = {
53 .func = GPIOMUX_FUNC_2,
54 .drv = GPIOMUX_DRV_8MA,
55 .pull = GPIOMUX_PULL_NONE,
56};
57
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -080058static struct gpiomux_setting gsbi10 = {
59 .func = GPIOMUX_FUNC_2,
60 .drv = GPIOMUX_DRV_8MA,
61 .pull = GPIOMUX_PULL_NONE,
62};
63
64static struct gpiomux_setting gsbi12 = {
65 .func = GPIOMUX_FUNC_1,
66 .drv = GPIOMUX_DRV_8MA,
67 .pull = GPIOMUX_PULL_NONE,
68};
69
70static struct gpiomux_setting cdc_mclk = {
71 .func = GPIOMUX_FUNC_1,
72 .drv = GPIOMUX_DRV_8MA,
73 .pull = GPIOMUX_PULL_NONE,
74};
75
76static struct gpiomux_setting audio_auxpcm[] = {
77 /* Suspended state */
78 {
79 .func = GPIOMUX_FUNC_GPIO,
80 .drv = GPIOMUX_DRV_2MA,
81 .pull = GPIOMUX_PULL_NONE,
82 },
83 /* Active state */
84 {
85 .func = GPIOMUX_FUNC_1,
86 .drv = GPIOMUX_DRV_2MA,
87 .pull = GPIOMUX_PULL_NONE,
88 },
89};
90
91#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
92static struct gpiomux_setting gpio_eth_config = {
93 .pull = GPIOMUX_PULL_NONE,
94 .drv = GPIOMUX_DRV_8MA,
95 .func = GPIOMUX_FUNC_GPIO,
96};
97#endif
98
99static struct gpiomux_setting slimbus = {
100 .func = GPIOMUX_FUNC_1,
101 .drv = GPIOMUX_DRV_8MA,
102 .pull = GPIOMUX_PULL_KEEPER,
103};
104
105static struct gpiomux_setting wcnss_5wire_suspend_cfg = {
106 .func = GPIOMUX_FUNC_GPIO,
107 .drv = GPIOMUX_DRV_2MA,
108 .pull = GPIOMUX_PULL_UP,
109};
110
111static struct gpiomux_setting wcnss_5wire_active_cfg = {
112 .func = GPIOMUX_FUNC_1,
113 .drv = GPIOMUX_DRV_6MA,
114 .pull = GPIOMUX_PULL_DOWN,
115};
116
Amy Malochef3c9db42011-12-08 15:17:35 -0800117static struct gpiomux_setting atmel_resout_sus_cfg = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800118 .func = GPIOMUX_FUNC_GPIO,
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_act_cfg = {
124 .func = GPIOMUX_FUNC_GPIO,
125 .drv = GPIOMUX_DRV_6MA,
126 .pull = GPIOMUX_PULL_UP,
127};
128
129static struct gpiomux_setting atmel_ldo_en_sus_cfg = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800130 .func = GPIOMUX_FUNC_GPIO,
131 .drv = GPIOMUX_DRV_6MA,
132 .pull = GPIOMUX_PULL_DOWN,
133};
134
Amy Malochef3c9db42011-12-08 15:17:35 -0800135static struct gpiomux_setting atmel_ldo_en_act_cfg = {
136 .func = GPIOMUX_FUNC_GPIO,
137 .drv = GPIOMUX_DRV_6MA,
138 .pull = GPIOMUX_PULL_DOWN,
139};
140
141static struct gpiomux_setting atmel_int_act_cfg = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800142 .func = GPIOMUX_FUNC_GPIO,
143 .drv = GPIOMUX_DRV_8MA,
144 .pull = GPIOMUX_PULL_UP,
145};
146
Amy Malochef3c9db42011-12-08 15:17:35 -0800147static struct gpiomux_setting atmel_int_sus_cfg = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800148 .func = GPIOMUX_FUNC_GPIO,
149 .drv = GPIOMUX_DRV_2MA,
150 .pull = GPIOMUX_PULL_DOWN,
151};
Mayank Ranabf5084a2011-12-12 17:06:54 +0530152#ifdef MSM8930_PHASE_2
Mayank Ranabf5084a2011-12-12 17:06:54 +0530153static struct gpiomux_setting hsusb_sus_cfg = {
154 .func = GPIOMUX_FUNC_GPIO,
155 .drv = GPIOMUX_DRV_2MA,
David Keitelc72d8192012-01-09 11:33:55 -0800156 .pull = GPIOMUX_PULL_NONE,
157 .dir = GPIOMUX_OUT_LOW,
Mayank Ranabf5084a2011-12-12 17:06:54 +0530158};
159static struct msm_gpiomux_config msm8930_hsusb_configs[] = {
160 {
161 .gpio = 63, /* HSUSB_EXTERNAL_5V_LDO_EN */
162 .settings = {
Mayank Ranabf5084a2011-12-12 17:06:54 +0530163 [GPIOMUX_SUSPENDED] = &hsusb_sus_cfg,
164 },
165 },
166 {
167 .gpio = 97, /* HSUSB_5V_EN */
168 .settings = {
Mayank Ranabf5084a2011-12-12 17:06:54 +0530169 [GPIOMUX_SUSPENDED] = &hsusb_sus_cfg,
170 },
171 },
172};
173#endif
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800174#ifdef CONFIG_USB_EHCI_MSM_HSIC
175static struct gpiomux_setting hsic_act_cfg = {
176 .func = GPIOMUX_FUNC_1,
177 .drv = GPIOMUX_DRV_12MA,
178 .pull = GPIOMUX_PULL_NONE,
179};
180
181static struct gpiomux_setting hsic_sus_cfg = {
182 .func = GPIOMUX_FUNC_GPIO,
183 .drv = GPIOMUX_DRV_2MA,
184 .pull = GPIOMUX_PULL_DOWN,
185 .dir = GPIOMUX_OUT_LOW,
186};
187
188static struct gpiomux_setting hsic_hub_act_cfg = {
189 .func = GPIOMUX_FUNC_GPIO,
190 .drv = GPIOMUX_DRV_2MA,
191 .pull = GPIOMUX_PULL_NONE,
192};
193#endif
194
195static struct gpiomux_setting hap_lvl_shft_suspended_config = {
196 .func = GPIOMUX_FUNC_GPIO,
197 .drv = GPIOMUX_DRV_2MA,
198 .pull = GPIOMUX_PULL_DOWN,
199};
200
201static struct gpiomux_setting hap_lvl_shft_active_config = {
202 .func = GPIOMUX_FUNC_GPIO,
203 .drv = GPIOMUX_DRV_8MA,
204 .pull = GPIOMUX_PULL_UP,
205};
206
207static struct gpiomux_setting ap2mdm_cfg = {
208 .func = GPIOMUX_FUNC_GPIO,
209 .drv = GPIOMUX_DRV_8MA,
210 .pull = GPIOMUX_PULL_DOWN,
211};
212
213static struct gpiomux_setting mdm2ap_status_cfg = {
214 .func = GPIOMUX_FUNC_GPIO,
215 .drv = GPIOMUX_DRV_8MA,
216 .pull = GPIOMUX_PULL_NONE,
217};
218
219static struct gpiomux_setting mdm2ap_errfatal_cfg = {
220 .func = GPIOMUX_FUNC_GPIO,
221 .drv = GPIOMUX_DRV_16MA,
222 .pull = GPIOMUX_PULL_DOWN,
223};
224
225static struct gpiomux_setting ap2mdm_kpdpwr_n_cfg = {
226 .func = GPIOMUX_FUNC_GPIO,
227 .drv = GPIOMUX_DRV_8MA,
228 .pull = GPIOMUX_PULL_NONE,
229};
230
231static struct gpiomux_setting mdp_vsync_suspend_cfg = {
232 .func = GPIOMUX_FUNC_GPIO,
233 .drv = GPIOMUX_DRV_2MA,
234 .pull = GPIOMUX_PULL_DOWN,
235};
236
237static struct gpiomux_setting mdp_vsync_active_cfg = {
238 .func = GPIOMUX_FUNC_1,
239 .drv = GPIOMUX_DRV_2MA,
240 .pull = GPIOMUX_PULL_DOWN,
241};
242
243#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
244static struct gpiomux_setting hdmi_suspend_cfg = {
245 .func = GPIOMUX_FUNC_GPIO,
246 .drv = GPIOMUX_DRV_2MA,
247 .pull = GPIOMUX_PULL_DOWN,
248};
249
250static struct gpiomux_setting hdmi_active_1_cfg = {
251 .func = GPIOMUX_FUNC_1,
252 .drv = GPIOMUX_DRV_2MA,
253 .pull = GPIOMUX_PULL_UP,
254};
255
256static struct gpiomux_setting hdmi_active_2_cfg = {
257 .func = GPIOMUX_FUNC_1,
258 .drv = GPIOMUX_DRV_2MA,
259 .pull = GPIOMUX_PULL_DOWN,
260};
261#endif
262
263#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
264static struct msm_gpiomux_config msm8960_ethernet_configs[] = {
265 {
266 .gpio = 90,
267 .settings = {
268 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
269 }
270 },
271 {
272 .gpio = 89,
273 .settings = {
274 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
275 }
276 },
277};
278#endif
279
280static struct msm_gpiomux_config msm8960_gsbi_configs[] __initdata = {
281 {
282 .gpio = 6, /* GSBI1 QUP SPI_DATA_MOSI */
283 .settings = {
284 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
285 [GPIOMUX_ACTIVE] = &spi_active,
286 },
287 },
288 {
289 .gpio = 7, /* GSBI1 QUP SPI_DATA_MISO */
290 .settings = {
291 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
292 [GPIOMUX_ACTIVE] = &spi_active,
293 },
294 },
295 {
296 .gpio = 8, /* GSBI1 QUP SPI_CS_N */
297 .settings = {
298 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
299 [GPIOMUX_ACTIVE] = &spi_active,
300 },
301 },
302 {
303 .gpio = 9, /* GSBI1 QUP SPI_CLK */
304 .settings = {
305 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
306 [GPIOMUX_ACTIVE] = &spi_active,
307 },
308 },
309 {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800310 .gpio = 16, /* GSBI3 I2C QUP SDA */
311 .settings = {
312 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
313 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
314 },
315 },
316 {
317 .gpio = 17, /* GSBI3 I2C QUP SCL */
318 .settings = {
319 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
320 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
321 },
322 },
323 {
324 .gpio = 22, /* GSBI5 UART2 */
325 .settings = {
326 [GPIOMUX_SUSPENDED] = &gsbi5,
327 },
328 },
329 {
330 .gpio = 23, /* GSBI5 UART2 */
331 .settings = {
332 [GPIOMUX_SUSPENDED] = &gsbi5,
333 },
334 },
335 {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800336 .gpio = 44, /* GSBI12 I2C QUP SDA */
337 .settings = {
338 [GPIOMUX_SUSPENDED] = &gsbi12,
339 },
340 },
341 {
Harini Jayaramanfe6ff4162012-03-14 11:25:40 -0600342 .gpio = 95, /* GSBI9 I2C QUP SDA */
343 .settings = {
344 [GPIOMUX_SUSPENDED] = &gsbi9,
345 },
346 },
347 {
348 .gpio = 96, /* GSBI12 I2C QUP SCL */
349 .settings = {
350 [GPIOMUX_SUSPENDED] = &gsbi9,
351 },
352 },
353 {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800354 .gpio = 45, /* GSBI12 I2C QUP SCL */
355 .settings = {
356 [GPIOMUX_SUSPENDED] = &gsbi12,
357 },
358 },
359 {
360 .gpio = 73, /* GSBI10 I2C QUP SDA */
361 .settings = {
362 [GPIOMUX_SUSPENDED] = &gsbi10,
363 },
364 },
365 {
366 .gpio = 74, /* GSBI10 I2C QUP SCL */
367 .settings = {
368 [GPIOMUX_SUSPENDED] = &gsbi10,
369 },
370 },
371};
372
373static struct msm_gpiomux_config msm8960_slimbus_config[] __initdata = {
374 {
375 .gpio = 60, /* slimbus data */
376 .settings = {
377 [GPIOMUX_SUSPENDED] = &slimbus,
378 },
379 },
380 {
381 .gpio = 61, /* slimbus clk */
382 .settings = {
383 [GPIOMUX_SUSPENDED] = &slimbus,
384 },
385 },
386};
387
388static struct msm_gpiomux_config msm8960_audio_codec_configs[] __initdata = {
389 {
390 .gpio = 59,
391 .settings = {
392 [GPIOMUX_SUSPENDED] = &cdc_mclk,
393 },
394 },
395};
396
397static struct msm_gpiomux_config msm8960_audio_auxpcm_configs[] __initdata = {
398 {
399 .gpio = 63,
400 .settings = {
401 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
402 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
403 },
404 },
405 {
406 .gpio = 64,
407 .settings = {
408 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
409 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
410 },
411 },
412 {
413 .gpio = 65,
414 .settings = {
415 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
416 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
417 },
418 },
419 {
420 .gpio = 66,
421 .settings = {
422 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
423 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
424 },
425 },
426};
427
428static struct msm_gpiomux_config wcnss_5wire_interface[] = {
429 {
430 .gpio = 84,
431 .settings = {
432 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
433 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
434 },
435 },
436 {
437 .gpio = 85,
438 .settings = {
439 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
440 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
441 },
442 },
443 {
444 .gpio = 86,
445 .settings = {
446 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
447 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
448 },
449 },
450 {
451 .gpio = 87,
452 .settings = {
453 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
454 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
455 },
456 },
457 {
458 .gpio = 88,
459 .settings = {
460 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
461 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
462 },
463 },
464};
465
Amy Malochef3c9db42011-12-08 15:17:35 -0800466static struct msm_gpiomux_config msm8960_atmel_configs[] __initdata = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800467 { /* TS INTERRUPT */
468 .gpio = 11,
469 .settings = {
Amy Malochef3c9db42011-12-08 15:17:35 -0800470 [GPIOMUX_ACTIVE] = &atmel_int_act_cfg,
471 [GPIOMUX_SUSPENDED] = &atmel_int_sus_cfg,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800472 },
473 },
Amy Malochef3c9db42011-12-08 15:17:35 -0800474 { /* TS LDO ENABLE */
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800475 .gpio = 50,
476 .settings = {
Amy Malochef3c9db42011-12-08 15:17:35 -0800477 [GPIOMUX_ACTIVE] = &atmel_ldo_en_act_cfg,
478 [GPIOMUX_SUSPENDED] = &atmel_ldo_en_sus_cfg,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800479 },
480 },
481 { /* TS RESOUT */
482 .gpio = 52,
483 .settings = {
Amy Malochef3c9db42011-12-08 15:17:35 -0800484 [GPIOMUX_ACTIVE] = &atmel_resout_act_cfg,
485 [GPIOMUX_SUSPENDED] = &atmel_resout_sus_cfg,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800486 },
487 },
488};
489
490#ifdef CONFIG_USB_EHCI_MSM_HSIC
491static struct msm_gpiomux_config msm8960_hsic_configs[] = {
492 {
493 .gpio = 150, /*HSIC_STROBE */
494 .settings = {
495 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
496 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
497 },
498 },
499 {
500 .gpio = 151, /* HSIC_DATA */
501 .settings = {
502 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
503 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
504 },
505 },
506 {
507 .gpio = 91, /* HSIC_HUB_RESET */
508 .settings = {
509 [GPIOMUX_ACTIVE] = &hsic_hub_act_cfg,
510 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
511 },
512 },
513};
514#endif
515
516static struct msm_gpiomux_config hap_lvl_shft_config[] __initdata = {
517 {
518 .gpio = 47,
519 .settings = {
520 [GPIOMUX_SUSPENDED] = &hap_lvl_shft_suspended_config,
521 [GPIOMUX_ACTIVE] = &hap_lvl_shft_active_config,
522 },
523 },
524};
525
526static struct msm_gpiomux_config mdm_configs[] __initdata = {
527 /* AP2MDM_STATUS */
528 {
529 .gpio = 94,
530 .settings = {
531 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
532 }
533 },
534 /* MDM2AP_STATUS */
535 {
536 .gpio = 69,
537 .settings = {
538 [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
539 }
540 },
541 /* MDM2AP_ERRFATAL */
542 {
543 .gpio = 70,
544 .settings = {
545 [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
546 }
547 },
548 /* AP2MDM_ERRFATAL */
549 {
550 .gpio = 95,
551 .settings = {
552 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
553 }
554 },
555 /* AP2MDM_KPDPWR_N */
556 {
557 .gpio = 81,
558 .settings = {
559 [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg,
560 }
561 },
562 /* AP2MDM_PMIC_RESET_N */
563 {
564 .gpio = 80,
565 .settings = {
566 [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg,
567 }
568 }
569};
570
571static struct msm_gpiomux_config msm8960_mdp_vsync_configs[] __initdata = {
572 {
573 .gpio = 0,
574 .settings = {
575 [GPIOMUX_ACTIVE] = &mdp_vsync_active_cfg,
576 [GPIOMUX_SUSPENDED] = &mdp_vsync_suspend_cfg,
577 },
578 }
579};
580
581#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
582static struct msm_gpiomux_config msm8960_hdmi_configs[] __initdata = {
583 {
584 .gpio = 99,
585 .settings = {
586 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
587 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
588 },
589 },
590 {
591 .gpio = 100,
592 .settings = {
593 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
594 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
595 },
596 },
597 {
598 .gpio = 101,
599 .settings = {
600 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
601 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
602 },
603 },
604 {
605 .gpio = 102,
606 .settings = {
607 [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg,
608 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
609 },
610 },
611};
612#endif
613
Amy Malochee8de95d2012-02-23 10:40:25 -0800614static struct gpiomux_setting haptics_active_cfg = {
615 .func = GPIOMUX_FUNC_GPIO,
616 .drv = GPIOMUX_DRV_8MA,
617 .pull = GPIOMUX_PULL_UP,
618};
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +0530619static struct gpiomux_setting haptics_suspend_cfg = {
620 .func = GPIOMUX_FUNC_GPIO,
621 .drv = GPIOMUX_DRV_8MA,
622 .pull = GPIOMUX_PULL_DOWN,
623};
624
625static struct msm_gpiomux_config msm8930_haptics_configs[] __initdata = {
626 {
627 .gpio = 77,
628 .settings = {
Amy Malochee8de95d2012-02-23 10:40:25 -0800629 [GPIOMUX_ACTIVE] = &haptics_active_cfg,
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +0530630 [GPIOMUX_SUSPENDED] = &haptics_suspend_cfg,
631 },
632 },
633 {
634 .gpio = 78,
635 .settings = {
Amy Malochee8de95d2012-02-23 10:40:25 -0800636 [GPIOMUX_ACTIVE] = &haptics_active_cfg,
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +0530637 [GPIOMUX_SUSPENDED] = &haptics_suspend_cfg,
638 },
639 },
640};
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +0530641
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800642int __init msm8930_init_gpiomux(void)
643{
644 int rc = msm_gpiomux_init(NR_GPIO_IRQS);
645 if (rc) {
646 pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
647 return rc;
648 }
649
650#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
651 msm_gpiomux_install(msm8960_ethernet_configs,
652 ARRAY_SIZE(msm8960_ethernet_configs));
653#endif
654
655 msm_gpiomux_install(msm8960_gsbi_configs,
656 ARRAY_SIZE(msm8960_gsbi_configs));
657
Amy Malochef3c9db42011-12-08 15:17:35 -0800658 msm_gpiomux_install(msm8960_atmel_configs,
659 ARRAY_SIZE(msm8960_atmel_configs));
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800660
661 msm_gpiomux_install(msm8960_slimbus_config,
662 ARRAY_SIZE(msm8960_slimbus_config));
663
664 msm_gpiomux_install(msm8960_audio_codec_configs,
665 ARRAY_SIZE(msm8960_audio_codec_configs));
666
667 msm_gpiomux_install(msm8960_audio_auxpcm_configs,
668 ARRAY_SIZE(msm8960_audio_auxpcm_configs));
669
670 msm_gpiomux_install(wcnss_5wire_interface,
671 ARRAY_SIZE(wcnss_5wire_interface));
672
673 if (machine_is_msm8930_mtp() || machine_is_msm8930_fluid() ||
Mayank Ranabf5084a2011-12-12 17:06:54 +0530674 machine_is_msm8930_cdp()) {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800675 msm_gpiomux_install(hap_lvl_shft_config,
676 ARRAY_SIZE(hap_lvl_shft_config));
Mayank Ranabf5084a2011-12-12 17:06:54 +0530677#ifdef MSM8930_PHASE_2
678 msm_gpiomux_install(msm8930_hsusb_configs,
679 ARRAY_SIZE(msm8930_hsusb_configs));
680#endif
681 }
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800682
683 if (PLATFORM_IS_CHARM25())
684 msm_gpiomux_install(mdm_configs,
685 ARRAY_SIZE(mdm_configs));
686
Amy Malochee8de95d2012-02-23 10:40:25 -0800687 if (machine_is_msm8930_cdp() || machine_is_msm8930_mtp()
688 || machine_is_msm8930_fluid())
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +0530689 msm_gpiomux_install(msm8930_haptics_configs,
690 ARRAY_SIZE(msm8930_haptics_configs));
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +0530691
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800692#ifdef CONFIG_USB_EHCI_MSM_HSIC
693 if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
694 !machine_is_msm8930_mtp() &&
695 !machine_is_msm8930_fluid())
696 msm_gpiomux_install(msm8960_hsic_configs,
697 ARRAY_SIZE(msm8960_hsic_configs));
698#endif
699
700#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
701 msm_gpiomux_install(msm8960_hdmi_configs,
702 ARRAY_SIZE(msm8960_hdmi_configs));
703#endif
704
705 msm_gpiomux_install(msm8960_mdp_vsync_configs,
706 ARRAY_SIZE(msm8960_mdp_vsync_configs));
707 return 0;
708}