blob: cd4aff8b9da95f5ea5a3676fcf65f43f2b6340b4 [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
Bhalchandra Gajaredd00a9b2012-05-02 16:44:36 -070091static struct gpiomux_setting audio_mbhc = {
92 .func = GPIOMUX_FUNC_GPIO,
93 .drv = GPIOMUX_DRV_8MA,
94 .pull = GPIOMUX_PULL_NONE,
95};
96
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -080097#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
Mayank Ranabf5084a2011-12-12 17:06:54 +0530159static struct gpiomux_setting hsusb_sus_cfg = {
160 .func = GPIOMUX_FUNC_GPIO,
161 .drv = GPIOMUX_DRV_2MA,
David Keitelc72d8192012-01-09 11:33:55 -0800162 .pull = GPIOMUX_PULL_NONE,
163 .dir = GPIOMUX_OUT_LOW,
Mayank Ranabf5084a2011-12-12 17:06:54 +0530164};
165static struct msm_gpiomux_config msm8930_hsusb_configs[] = {
166 {
167 .gpio = 63, /* HSUSB_EXTERNAL_5V_LDO_EN */
168 .settings = {
Mayank Ranabf5084a2011-12-12 17:06:54 +0530169 [GPIOMUX_SUSPENDED] = &hsusb_sus_cfg,
170 },
171 },
172 {
173 .gpio = 97, /* HSUSB_5V_EN */
174 .settings = {
Mayank Ranabf5084a2011-12-12 17:06:54 +0530175 [GPIOMUX_SUSPENDED] = &hsusb_sus_cfg,
176 },
177 },
178};
179#endif
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800180
181static struct gpiomux_setting hap_lvl_shft_suspended_config = {
182 .func = GPIOMUX_FUNC_GPIO,
183 .drv = GPIOMUX_DRV_2MA,
184 .pull = GPIOMUX_PULL_DOWN,
185};
186
187static struct gpiomux_setting hap_lvl_shft_active_config = {
188 .func = GPIOMUX_FUNC_GPIO,
189 .drv = GPIOMUX_DRV_8MA,
190 .pull = GPIOMUX_PULL_UP,
191};
192
193static struct gpiomux_setting ap2mdm_cfg = {
194 .func = GPIOMUX_FUNC_GPIO,
195 .drv = GPIOMUX_DRV_8MA,
196 .pull = GPIOMUX_PULL_DOWN,
197};
198
199static struct gpiomux_setting mdm2ap_status_cfg = {
200 .func = GPIOMUX_FUNC_GPIO,
201 .drv = GPIOMUX_DRV_8MA,
202 .pull = GPIOMUX_PULL_NONE,
203};
204
205static struct gpiomux_setting mdm2ap_errfatal_cfg = {
206 .func = GPIOMUX_FUNC_GPIO,
207 .drv = GPIOMUX_DRV_16MA,
208 .pull = GPIOMUX_PULL_DOWN,
209};
210
211static struct gpiomux_setting ap2mdm_kpdpwr_n_cfg = {
212 .func = GPIOMUX_FUNC_GPIO,
213 .drv = GPIOMUX_DRV_8MA,
214 .pull = GPIOMUX_PULL_NONE,
215};
216
217static struct gpiomux_setting mdp_vsync_suspend_cfg = {
218 .func = GPIOMUX_FUNC_GPIO,
219 .drv = GPIOMUX_DRV_2MA,
220 .pull = GPIOMUX_PULL_DOWN,
221};
222
223static struct gpiomux_setting mdp_vsync_active_cfg = {
224 .func = GPIOMUX_FUNC_1,
225 .drv = GPIOMUX_DRV_2MA,
226 .pull = GPIOMUX_PULL_DOWN,
227};
228
229#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
230static struct gpiomux_setting hdmi_suspend_cfg = {
231 .func = GPIOMUX_FUNC_GPIO,
232 .drv = GPIOMUX_DRV_2MA,
233 .pull = GPIOMUX_PULL_DOWN,
234};
235
236static struct gpiomux_setting hdmi_active_1_cfg = {
237 .func = GPIOMUX_FUNC_1,
238 .drv = GPIOMUX_DRV_2MA,
239 .pull = GPIOMUX_PULL_UP,
240};
241
242static struct gpiomux_setting hdmi_active_2_cfg = {
243 .func = GPIOMUX_FUNC_1,
244 .drv = GPIOMUX_DRV_2MA,
245 .pull = GPIOMUX_PULL_DOWN,
246};
247#endif
248
249#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
250static struct msm_gpiomux_config msm8960_ethernet_configs[] = {
251 {
252 .gpio = 90,
253 .settings = {
254 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
255 }
256 },
257 {
258 .gpio = 89,
259 .settings = {
260 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
261 }
262 },
263};
264#endif
265
266static struct msm_gpiomux_config msm8960_gsbi_configs[] __initdata = {
267 {
268 .gpio = 6, /* GSBI1 QUP SPI_DATA_MOSI */
269 .settings = {
270 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
271 [GPIOMUX_ACTIVE] = &spi_active,
272 },
273 },
274 {
275 .gpio = 7, /* GSBI1 QUP SPI_DATA_MISO */
276 .settings = {
277 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
278 [GPIOMUX_ACTIVE] = &spi_active,
279 },
280 },
281 {
282 .gpio = 8, /* GSBI1 QUP SPI_CS_N */
283 .settings = {
284 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
285 [GPIOMUX_ACTIVE] = &spi_active,
286 },
287 },
288 {
289 .gpio = 9, /* GSBI1 QUP SPI_CLK */
290 .settings = {
291 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
292 [GPIOMUX_ACTIVE] = &spi_active,
293 },
294 },
295 {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800296 .gpio = 16, /* GSBI3 I2C QUP SDA */
297 .settings = {
298 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
299 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
300 },
301 },
302 {
303 .gpio = 17, /* GSBI3 I2C QUP SCL */
304 .settings = {
305 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
306 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
307 },
308 },
309 {
310 .gpio = 22, /* GSBI5 UART2 */
311 .settings = {
312 [GPIOMUX_SUSPENDED] = &gsbi5,
313 },
314 },
315 {
316 .gpio = 23, /* GSBI5 UART2 */
317 .settings = {
318 [GPIOMUX_SUSPENDED] = &gsbi5,
319 },
320 },
321 {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800322 .gpio = 44, /* GSBI12 I2C QUP SDA */
323 .settings = {
324 [GPIOMUX_SUSPENDED] = &gsbi12,
325 },
326 },
327 {
Harini Jayaramanfe6ff4162012-03-14 11:25:40 -0600328 .gpio = 95, /* GSBI9 I2C QUP SDA */
329 .settings = {
330 [GPIOMUX_SUSPENDED] = &gsbi9,
331 },
332 },
333 {
334 .gpio = 96, /* GSBI12 I2C QUP SCL */
335 .settings = {
336 [GPIOMUX_SUSPENDED] = &gsbi9,
337 },
338 },
339 {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800340 .gpio = 45, /* GSBI12 I2C QUP SCL */
341 .settings = {
342 [GPIOMUX_SUSPENDED] = &gsbi12,
343 },
344 },
345 {
346 .gpio = 73, /* GSBI10 I2C QUP SDA */
347 .settings = {
348 [GPIOMUX_SUSPENDED] = &gsbi10,
349 },
350 },
351 {
352 .gpio = 74, /* GSBI10 I2C QUP SCL */
353 .settings = {
354 [GPIOMUX_SUSPENDED] = &gsbi10,
355 },
356 },
357};
358
359static struct msm_gpiomux_config msm8960_slimbus_config[] __initdata = {
360 {
361 .gpio = 60, /* slimbus data */
362 .settings = {
363 [GPIOMUX_SUSPENDED] = &slimbus,
364 },
365 },
366 {
367 .gpio = 61, /* slimbus clk */
368 .settings = {
369 [GPIOMUX_SUSPENDED] = &slimbus,
370 },
371 },
372};
373
374static struct msm_gpiomux_config msm8960_audio_codec_configs[] __initdata = {
375 {
376 .gpio = 59,
377 .settings = {
378 [GPIOMUX_SUSPENDED] = &cdc_mclk,
379 },
380 },
381};
382
Bhalchandra Gajaredd00a9b2012-05-02 16:44:36 -0700383static struct msm_gpiomux_config msm8960_audio_mbhc_configs[] __initdata = {
384 {
385 .gpio = 37,
386 .settings = {
387 [GPIOMUX_SUSPENDED] = &audio_mbhc,
388 },
389 },
390};
391
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800392static struct msm_gpiomux_config msm8960_audio_auxpcm_configs[] __initdata = {
393 {
394 .gpio = 63,
395 .settings = {
396 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
397 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
398 },
399 },
400 {
401 .gpio = 64,
402 .settings = {
403 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
404 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
405 },
406 },
407 {
408 .gpio = 65,
409 .settings = {
410 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
411 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
412 },
413 },
414 {
415 .gpio = 66,
416 .settings = {
417 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
418 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
419 },
420 },
421};
422
423static struct msm_gpiomux_config wcnss_5wire_interface[] = {
424 {
425 .gpio = 84,
426 .settings = {
427 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
428 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
429 },
430 },
431 {
432 .gpio = 85,
433 .settings = {
434 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
435 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
436 },
437 },
438 {
439 .gpio = 86,
440 .settings = {
441 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
442 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
443 },
444 },
445 {
446 .gpio = 87,
447 .settings = {
448 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
449 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
450 },
451 },
452 {
453 .gpio = 88,
454 .settings = {
455 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
456 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
457 },
458 },
459};
460
Amy Malochef3c9db42011-12-08 15:17:35 -0800461static struct msm_gpiomux_config msm8960_atmel_configs[] __initdata = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800462 { /* TS INTERRUPT */
463 .gpio = 11,
464 .settings = {
Amy Malochef3c9db42011-12-08 15:17:35 -0800465 [GPIOMUX_ACTIVE] = &atmel_int_act_cfg,
466 [GPIOMUX_SUSPENDED] = &atmel_int_sus_cfg,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800467 },
468 },
Amy Malochef3c9db42011-12-08 15:17:35 -0800469 { /* TS LDO ENABLE */
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800470 .gpio = 50,
471 .settings = {
Amy Malochef3c9db42011-12-08 15:17:35 -0800472 [GPIOMUX_ACTIVE] = &atmel_ldo_en_act_cfg,
473 [GPIOMUX_SUSPENDED] = &atmel_ldo_en_sus_cfg,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800474 },
475 },
476 { /* TS RESOUT */
477 .gpio = 52,
478 .settings = {
Amy Malochef3c9db42011-12-08 15:17:35 -0800479 [GPIOMUX_ACTIVE] = &atmel_resout_act_cfg,
480 [GPIOMUX_SUSPENDED] = &atmel_resout_sus_cfg,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800481 },
482 },
483};
484
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800485static struct msm_gpiomux_config hap_lvl_shft_config[] __initdata = {
486 {
487 .gpio = 47,
488 .settings = {
489 [GPIOMUX_SUSPENDED] = &hap_lvl_shft_suspended_config,
490 [GPIOMUX_ACTIVE] = &hap_lvl_shft_active_config,
491 },
492 },
493};
494
495static struct msm_gpiomux_config mdm_configs[] __initdata = {
496 /* AP2MDM_STATUS */
497 {
498 .gpio = 94,
499 .settings = {
500 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
501 }
502 },
503 /* MDM2AP_STATUS */
504 {
505 .gpio = 69,
506 .settings = {
507 [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
508 }
509 },
510 /* MDM2AP_ERRFATAL */
511 {
512 .gpio = 70,
513 .settings = {
514 [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
515 }
516 },
517 /* AP2MDM_ERRFATAL */
518 {
519 .gpio = 95,
520 .settings = {
521 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
522 }
523 },
524 /* AP2MDM_KPDPWR_N */
525 {
526 .gpio = 81,
527 .settings = {
528 [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg,
529 }
530 },
531 /* AP2MDM_PMIC_RESET_N */
532 {
533 .gpio = 80,
534 .settings = {
535 [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg,
536 }
537 }
538};
539
540static struct msm_gpiomux_config msm8960_mdp_vsync_configs[] __initdata = {
541 {
542 .gpio = 0,
543 .settings = {
544 [GPIOMUX_ACTIVE] = &mdp_vsync_active_cfg,
545 [GPIOMUX_SUSPENDED] = &mdp_vsync_suspend_cfg,
546 },
547 }
548};
549
550#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
551static struct msm_gpiomux_config msm8960_hdmi_configs[] __initdata = {
552 {
553 .gpio = 99,
554 .settings = {
555 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
556 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
557 },
558 },
559 {
560 .gpio = 100,
561 .settings = {
562 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
563 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
564 },
565 },
566 {
567 .gpio = 101,
568 .settings = {
569 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
570 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
571 },
572 },
573 {
574 .gpio = 102,
575 .settings = {
576 [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg,
577 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
578 },
579 },
580};
581#endif
582
Amy Malochee8de95d2012-02-23 10:40:25 -0800583static struct gpiomux_setting haptics_active_cfg = {
584 .func = GPIOMUX_FUNC_GPIO,
585 .drv = GPIOMUX_DRV_8MA,
586 .pull = GPIOMUX_PULL_UP,
587};
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +0530588static struct gpiomux_setting haptics_suspend_cfg = {
589 .func = GPIOMUX_FUNC_GPIO,
590 .drv = GPIOMUX_DRV_8MA,
591 .pull = GPIOMUX_PULL_DOWN,
592};
593
594static struct msm_gpiomux_config msm8930_haptics_configs[] __initdata = {
595 {
596 .gpio = 77,
597 .settings = {
Amy Malochee8de95d2012-02-23 10:40:25 -0800598 [GPIOMUX_ACTIVE] = &haptics_active_cfg,
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +0530599 [GPIOMUX_SUSPENDED] = &haptics_suspend_cfg,
600 },
601 },
602 {
603 .gpio = 78,
604 .settings = {
Amy Malochee8de95d2012-02-23 10:40:25 -0800605 [GPIOMUX_ACTIVE] = &haptics_active_cfg,
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +0530606 [GPIOMUX_SUSPENDED] = &haptics_suspend_cfg,
607 },
608 },
609};
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +0530610
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800611int __init msm8930_init_gpiomux(void)
612{
613 int rc = msm_gpiomux_init(NR_GPIO_IRQS);
614 if (rc) {
615 pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
616 return rc;
617 }
618
619#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
620 msm_gpiomux_install(msm8960_ethernet_configs,
621 ARRAY_SIZE(msm8960_ethernet_configs));
622#endif
623
624 msm_gpiomux_install(msm8960_gsbi_configs,
625 ARRAY_SIZE(msm8960_gsbi_configs));
626
Amy Malochef3c9db42011-12-08 15:17:35 -0800627 msm_gpiomux_install(msm8960_atmel_configs,
628 ARRAY_SIZE(msm8960_atmel_configs));
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800629
630 msm_gpiomux_install(msm8960_slimbus_config,
631 ARRAY_SIZE(msm8960_slimbus_config));
632
633 msm_gpiomux_install(msm8960_audio_codec_configs,
634 ARRAY_SIZE(msm8960_audio_codec_configs));
635
Bhalchandra Gajaredd00a9b2012-05-02 16:44:36 -0700636 msm_gpiomux_install(msm8960_audio_mbhc_configs,
637 ARRAY_SIZE(msm8960_audio_mbhc_configs));
638
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800639 msm_gpiomux_install(msm8960_audio_auxpcm_configs,
640 ARRAY_SIZE(msm8960_audio_auxpcm_configs));
641
642 msm_gpiomux_install(wcnss_5wire_interface,
643 ARRAY_SIZE(wcnss_5wire_interface));
644
645 if (machine_is_msm8930_mtp() || machine_is_msm8930_fluid() ||
Mayank Ranabf5084a2011-12-12 17:06:54 +0530646 machine_is_msm8930_cdp()) {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800647 msm_gpiomux_install(hap_lvl_shft_config,
648 ARRAY_SIZE(hap_lvl_shft_config));
Mayank Ranabf5084a2011-12-12 17:06:54 +0530649#ifdef MSM8930_PHASE_2
650 msm_gpiomux_install(msm8930_hsusb_configs,
651 ARRAY_SIZE(msm8930_hsusb_configs));
652#endif
653 }
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800654
655 if (PLATFORM_IS_CHARM25())
656 msm_gpiomux_install(mdm_configs,
657 ARRAY_SIZE(mdm_configs));
658
Amy Malochee8de95d2012-02-23 10:40:25 -0800659 if (machine_is_msm8930_cdp() || machine_is_msm8930_mtp()
660 || machine_is_msm8930_fluid())
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +0530661 msm_gpiomux_install(msm8930_haptics_configs,
662 ARRAY_SIZE(msm8930_haptics_configs));
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +0530663
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800664#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
665 msm_gpiomux_install(msm8960_hdmi_configs,
666 ARRAY_SIZE(msm8960_hdmi_configs));
667#endif
668
669 msm_gpiomux_install(msm8960_mdp_vsync_configs,
670 ARRAY_SIZE(msm8960_mdp_vsync_configs));
671 return 0;
672}