blob: c7ab260a76535e130a0e7c4fc3dfdab923c6661f [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
Steve Mucklef132c6c2012-06-06 18:30:57 -070014#include <linux/gpio.h>
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -080015#include <asm/mach-types.h>
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -080016#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
Bhalchandra Gajarec0ac7d82012-05-16 11:28:59 -070097static struct gpiomux_setting audio_spkr_boost = {
98 .func = GPIOMUX_FUNC_GPIO,
99 .drv = GPIOMUX_DRV_8MA,
100 .pull = GPIOMUX_PULL_NONE,
101};
102
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800103#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
104static struct gpiomux_setting gpio_eth_config = {
105 .pull = GPIOMUX_PULL_NONE,
106 .drv = GPIOMUX_DRV_8MA,
107 .func = GPIOMUX_FUNC_GPIO,
108};
109#endif
110
111static struct gpiomux_setting slimbus = {
112 .func = GPIOMUX_FUNC_1,
113 .drv = GPIOMUX_DRV_8MA,
114 .pull = GPIOMUX_PULL_KEEPER,
115};
116
117static struct gpiomux_setting wcnss_5wire_suspend_cfg = {
118 .func = GPIOMUX_FUNC_GPIO,
119 .drv = GPIOMUX_DRV_2MA,
120 .pull = GPIOMUX_PULL_UP,
121};
122
123static struct gpiomux_setting wcnss_5wire_active_cfg = {
124 .func = GPIOMUX_FUNC_1,
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_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_resout_act_cfg = {
136 .func = GPIOMUX_FUNC_GPIO,
137 .drv = GPIOMUX_DRV_6MA,
138 .pull = GPIOMUX_PULL_UP,
139};
140
141static struct gpiomux_setting atmel_ldo_en_sus_cfg = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800142 .func = GPIOMUX_FUNC_GPIO,
143 .drv = GPIOMUX_DRV_6MA,
144 .pull = GPIOMUX_PULL_DOWN,
145};
146
Amy Malochef3c9db42011-12-08 15:17:35 -0800147static struct gpiomux_setting atmel_ldo_en_act_cfg = {
148 .func = GPIOMUX_FUNC_GPIO,
149 .drv = GPIOMUX_DRV_6MA,
150 .pull = GPIOMUX_PULL_DOWN,
151};
152
153static struct gpiomux_setting atmel_int_act_cfg = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800154 .func = GPIOMUX_FUNC_GPIO,
155 .drv = GPIOMUX_DRV_8MA,
156 .pull = GPIOMUX_PULL_UP,
157};
158
Amy Malochef3c9db42011-12-08 15:17:35 -0800159static struct gpiomux_setting atmel_int_sus_cfg = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800160 .func = GPIOMUX_FUNC_GPIO,
161 .drv = GPIOMUX_DRV_2MA,
162 .pull = GPIOMUX_PULL_DOWN,
163};
Mayank Ranabf5084a2011-12-12 17:06:54 +0530164#ifdef MSM8930_PHASE_2
Mayank Ranabf5084a2011-12-12 17:06:54 +0530165static struct gpiomux_setting hsusb_sus_cfg = {
166 .func = GPIOMUX_FUNC_GPIO,
167 .drv = GPIOMUX_DRV_2MA,
David Keitelc72d8192012-01-09 11:33:55 -0800168 .pull = GPIOMUX_PULL_NONE,
169 .dir = GPIOMUX_OUT_LOW,
Mayank Ranabf5084a2011-12-12 17:06:54 +0530170};
171static struct msm_gpiomux_config msm8930_hsusb_configs[] = {
172 {
173 .gpio = 63, /* HSUSB_EXTERNAL_5V_LDO_EN */
174 .settings = {
Mayank Ranabf5084a2011-12-12 17:06:54 +0530175 [GPIOMUX_SUSPENDED] = &hsusb_sus_cfg,
176 },
177 },
178 {
179 .gpio = 97, /* HSUSB_5V_EN */
180 .settings = {
Mayank Ranabf5084a2011-12-12 17:06:54 +0530181 [GPIOMUX_SUSPENDED] = &hsusb_sus_cfg,
182 },
183 },
184};
185#endif
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800186
187static struct gpiomux_setting hap_lvl_shft_suspended_config = {
188 .func = GPIOMUX_FUNC_GPIO,
189 .drv = GPIOMUX_DRV_2MA,
190 .pull = GPIOMUX_PULL_DOWN,
191};
192
193static struct gpiomux_setting hap_lvl_shft_active_config = {
194 .func = GPIOMUX_FUNC_GPIO,
195 .drv = GPIOMUX_DRV_8MA,
196 .pull = GPIOMUX_PULL_UP,
197};
198
199static struct gpiomux_setting ap2mdm_cfg = {
200 .func = GPIOMUX_FUNC_GPIO,
201 .drv = GPIOMUX_DRV_8MA,
202 .pull = GPIOMUX_PULL_DOWN,
203};
204
205static struct gpiomux_setting mdm2ap_status_cfg = {
206 .func = GPIOMUX_FUNC_GPIO,
207 .drv = GPIOMUX_DRV_8MA,
208 .pull = GPIOMUX_PULL_NONE,
209};
210
211static struct gpiomux_setting mdm2ap_errfatal_cfg = {
212 .func = GPIOMUX_FUNC_GPIO,
213 .drv = GPIOMUX_DRV_16MA,
214 .pull = GPIOMUX_PULL_DOWN,
215};
216
217static struct gpiomux_setting ap2mdm_kpdpwr_n_cfg = {
218 .func = GPIOMUX_FUNC_GPIO,
219 .drv = GPIOMUX_DRV_8MA,
220 .pull = GPIOMUX_PULL_NONE,
221};
222
223static struct gpiomux_setting mdp_vsync_suspend_cfg = {
224 .func = GPIOMUX_FUNC_GPIO,
225 .drv = GPIOMUX_DRV_2MA,
226 .pull = GPIOMUX_PULL_DOWN,
227};
228
229static struct gpiomux_setting mdp_vsync_active_cfg = {
230 .func = GPIOMUX_FUNC_1,
231 .drv = GPIOMUX_DRV_2MA,
232 .pull = GPIOMUX_PULL_DOWN,
233};
234
235#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
236static struct gpiomux_setting hdmi_suspend_cfg = {
237 .func = GPIOMUX_FUNC_GPIO,
238 .drv = GPIOMUX_DRV_2MA,
239 .pull = GPIOMUX_PULL_DOWN,
240};
241
242static struct gpiomux_setting hdmi_active_1_cfg = {
243 .func = GPIOMUX_FUNC_1,
244 .drv = GPIOMUX_DRV_2MA,
245 .pull = GPIOMUX_PULL_UP,
246};
247
248static struct gpiomux_setting hdmi_active_2_cfg = {
249 .func = GPIOMUX_FUNC_1,
250 .drv = GPIOMUX_DRV_2MA,
251 .pull = GPIOMUX_PULL_DOWN,
252};
253#endif
254
255#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
256static struct msm_gpiomux_config msm8960_ethernet_configs[] = {
257 {
258 .gpio = 90,
259 .settings = {
260 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
261 }
262 },
263 {
264 .gpio = 89,
265 .settings = {
266 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
267 }
268 },
269};
270#endif
271
272static struct msm_gpiomux_config msm8960_gsbi_configs[] __initdata = {
273 {
274 .gpio = 6, /* GSBI1 QUP SPI_DATA_MOSI */
275 .settings = {
276 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
277 [GPIOMUX_ACTIVE] = &spi_active,
278 },
279 },
280 {
281 .gpio = 7, /* GSBI1 QUP SPI_DATA_MISO */
282 .settings = {
283 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
284 [GPIOMUX_ACTIVE] = &spi_active,
285 },
286 },
287 {
288 .gpio = 8, /* GSBI1 QUP SPI_CS_N */
289 .settings = {
290 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
291 [GPIOMUX_ACTIVE] = &spi_active,
292 },
293 },
294 {
295 .gpio = 9, /* GSBI1 QUP SPI_CLK */
296 .settings = {
297 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
298 [GPIOMUX_ACTIVE] = &spi_active,
299 },
300 },
301 {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800302 .gpio = 16, /* GSBI3 I2C QUP SDA */
303 .settings = {
304 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
305 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
306 },
307 },
308 {
309 .gpio = 17, /* GSBI3 I2C QUP SCL */
310 .settings = {
311 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
312 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
313 },
314 },
315 {
316 .gpio = 22, /* GSBI5 UART2 */
317 .settings = {
318 [GPIOMUX_SUSPENDED] = &gsbi5,
319 },
320 },
321 {
322 .gpio = 23, /* GSBI5 UART2 */
323 .settings = {
324 [GPIOMUX_SUSPENDED] = &gsbi5,
325 },
326 },
327 {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800328 .gpio = 44, /* GSBI12 I2C QUP SDA */
329 .settings = {
330 [GPIOMUX_SUSPENDED] = &gsbi12,
331 },
332 },
333 {
Harini Jayaramanfe6ff4162012-03-14 11:25:40 -0600334 .gpio = 95, /* GSBI9 I2C QUP SDA */
335 .settings = {
336 [GPIOMUX_SUSPENDED] = &gsbi9,
337 },
338 },
339 {
340 .gpio = 96, /* GSBI12 I2C QUP SCL */
341 .settings = {
342 [GPIOMUX_SUSPENDED] = &gsbi9,
343 },
344 },
345 {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800346 .gpio = 45, /* GSBI12 I2C QUP SCL */
347 .settings = {
348 [GPIOMUX_SUSPENDED] = &gsbi12,
349 },
350 },
351 {
352 .gpio = 73, /* GSBI10 I2C QUP SDA */
353 .settings = {
354 [GPIOMUX_SUSPENDED] = &gsbi10,
355 },
356 },
357 {
358 .gpio = 74, /* GSBI10 I2C QUP SCL */
359 .settings = {
360 [GPIOMUX_SUSPENDED] = &gsbi10,
361 },
362 },
363};
364
365static struct msm_gpiomux_config msm8960_slimbus_config[] __initdata = {
366 {
367 .gpio = 60, /* slimbus data */
368 .settings = {
369 [GPIOMUX_SUSPENDED] = &slimbus,
370 },
371 },
372 {
373 .gpio = 61, /* slimbus clk */
374 .settings = {
375 [GPIOMUX_SUSPENDED] = &slimbus,
376 },
377 },
378};
379
380static struct msm_gpiomux_config msm8960_audio_codec_configs[] __initdata = {
381 {
382 .gpio = 59,
383 .settings = {
384 [GPIOMUX_SUSPENDED] = &cdc_mclk,
385 },
386 },
387};
388
Bhalchandra Gajaredd00a9b2012-05-02 16:44:36 -0700389static struct msm_gpiomux_config msm8960_audio_mbhc_configs[] __initdata = {
390 {
391 .gpio = 37,
392 .settings = {
393 [GPIOMUX_SUSPENDED] = &audio_mbhc,
394 },
395 },
396};
397
Bhalchandra Gajarec0ac7d82012-05-16 11:28:59 -0700398static struct msm_gpiomux_config msm8960_audio_spkr_configs[] __initdata = {
399 {
400 .gpio = 15,
401 .settings = {
402 [GPIOMUX_SUSPENDED] = &audio_spkr_boost,
403 },
404 },
405};
406
407
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800408static struct msm_gpiomux_config msm8960_audio_auxpcm_configs[] __initdata = {
409 {
410 .gpio = 63,
411 .settings = {
412 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
413 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
414 },
415 },
416 {
417 .gpio = 64,
418 .settings = {
419 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
420 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
421 },
422 },
423 {
424 .gpio = 65,
425 .settings = {
426 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
427 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
428 },
429 },
430 {
431 .gpio = 66,
432 .settings = {
433 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
434 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
435 },
436 },
437};
438
439static struct msm_gpiomux_config wcnss_5wire_interface[] = {
440 {
441 .gpio = 84,
442 .settings = {
443 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
444 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
445 },
446 },
447 {
448 .gpio = 85,
449 .settings = {
450 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
451 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
452 },
453 },
454 {
455 .gpio = 86,
456 .settings = {
457 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
458 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
459 },
460 },
461 {
462 .gpio = 87,
463 .settings = {
464 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
465 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
466 },
467 },
468 {
469 .gpio = 88,
470 .settings = {
471 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
472 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
473 },
474 },
475};
476
Amy Malochef3c9db42011-12-08 15:17:35 -0800477static struct msm_gpiomux_config msm8960_atmel_configs[] __initdata = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800478 { /* TS INTERRUPT */
479 .gpio = 11,
480 .settings = {
Amy Malochef3c9db42011-12-08 15:17:35 -0800481 [GPIOMUX_ACTIVE] = &atmel_int_act_cfg,
482 [GPIOMUX_SUSPENDED] = &atmel_int_sus_cfg,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800483 },
484 },
Amy Malochef3c9db42011-12-08 15:17:35 -0800485 { /* TS LDO ENABLE */
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800486 .gpio = 50,
487 .settings = {
Amy Malochef3c9db42011-12-08 15:17:35 -0800488 [GPIOMUX_ACTIVE] = &atmel_ldo_en_act_cfg,
489 [GPIOMUX_SUSPENDED] = &atmel_ldo_en_sus_cfg,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800490 },
491 },
492 { /* TS RESOUT */
493 .gpio = 52,
494 .settings = {
Amy Malochef3c9db42011-12-08 15:17:35 -0800495 [GPIOMUX_ACTIVE] = &atmel_resout_act_cfg,
496 [GPIOMUX_SUSPENDED] = &atmel_resout_sus_cfg,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800497 },
498 },
499};
500
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800501static struct msm_gpiomux_config hap_lvl_shft_config[] __initdata = {
502 {
503 .gpio = 47,
504 .settings = {
505 [GPIOMUX_SUSPENDED] = &hap_lvl_shft_suspended_config,
506 [GPIOMUX_ACTIVE] = &hap_lvl_shft_active_config,
507 },
508 },
509};
510
511static struct msm_gpiomux_config mdm_configs[] __initdata = {
512 /* AP2MDM_STATUS */
513 {
514 .gpio = 94,
515 .settings = {
516 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
517 }
518 },
519 /* MDM2AP_STATUS */
520 {
521 .gpio = 69,
522 .settings = {
523 [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
524 }
525 },
526 /* MDM2AP_ERRFATAL */
527 {
528 .gpio = 70,
529 .settings = {
530 [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
531 }
532 },
533 /* AP2MDM_ERRFATAL */
534 {
535 .gpio = 95,
536 .settings = {
537 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
538 }
539 },
540 /* AP2MDM_KPDPWR_N */
541 {
542 .gpio = 81,
543 .settings = {
544 [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg,
545 }
546 },
547 /* AP2MDM_PMIC_RESET_N */
548 {
549 .gpio = 80,
550 .settings = {
551 [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg,
552 }
553 }
554};
555
556static struct msm_gpiomux_config msm8960_mdp_vsync_configs[] __initdata = {
557 {
558 .gpio = 0,
559 .settings = {
560 [GPIOMUX_ACTIVE] = &mdp_vsync_active_cfg,
561 [GPIOMUX_SUSPENDED] = &mdp_vsync_suspend_cfg,
562 },
563 }
564};
565
566#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
567static struct msm_gpiomux_config msm8960_hdmi_configs[] __initdata = {
568 {
569 .gpio = 99,
570 .settings = {
571 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
572 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
573 },
574 },
575 {
576 .gpio = 100,
577 .settings = {
578 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
579 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
580 },
581 },
582 {
583 .gpio = 101,
584 .settings = {
585 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
586 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
587 },
588 },
589 {
590 .gpio = 102,
591 .settings = {
592 [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg,
593 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
594 },
595 },
596};
597#endif
598
Amy Malochee8de95d2012-02-23 10:40:25 -0800599static struct gpiomux_setting haptics_active_cfg = {
600 .func = GPIOMUX_FUNC_GPIO,
601 .drv = GPIOMUX_DRV_8MA,
602 .pull = GPIOMUX_PULL_UP,
603};
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +0530604static struct gpiomux_setting haptics_suspend_cfg = {
605 .func = GPIOMUX_FUNC_GPIO,
606 .drv = GPIOMUX_DRV_8MA,
607 .pull = GPIOMUX_PULL_DOWN,
608};
609
610static struct msm_gpiomux_config msm8930_haptics_configs[] __initdata = {
611 {
612 .gpio = 77,
613 .settings = {
Amy Malochee8de95d2012-02-23 10:40:25 -0800614 [GPIOMUX_ACTIVE] = &haptics_active_cfg,
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +0530615 [GPIOMUX_SUSPENDED] = &haptics_suspend_cfg,
616 },
617 },
618 {
619 .gpio = 78,
620 .settings = {
Amy Malochee8de95d2012-02-23 10:40:25 -0800621 [GPIOMUX_ACTIVE] = &haptics_active_cfg,
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +0530622 [GPIOMUX_SUSPENDED] = &haptics_suspend_cfg,
623 },
624 },
625};
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +0530626
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800627int __init msm8930_init_gpiomux(void)
628{
629 int rc = msm_gpiomux_init(NR_GPIO_IRQS);
630 if (rc) {
631 pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
632 return rc;
633 }
634
635#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
636 msm_gpiomux_install(msm8960_ethernet_configs,
637 ARRAY_SIZE(msm8960_ethernet_configs));
638#endif
639
640 msm_gpiomux_install(msm8960_gsbi_configs,
641 ARRAY_SIZE(msm8960_gsbi_configs));
642
Amy Malochef3c9db42011-12-08 15:17:35 -0800643 msm_gpiomux_install(msm8960_atmel_configs,
644 ARRAY_SIZE(msm8960_atmel_configs));
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800645
646 msm_gpiomux_install(msm8960_slimbus_config,
647 ARRAY_SIZE(msm8960_slimbus_config));
648
649 msm_gpiomux_install(msm8960_audio_codec_configs,
650 ARRAY_SIZE(msm8960_audio_codec_configs));
651
Bhalchandra Gajaredd00a9b2012-05-02 16:44:36 -0700652 msm_gpiomux_install(msm8960_audio_mbhc_configs,
653 ARRAY_SIZE(msm8960_audio_mbhc_configs));
654
Bhalchandra Gajarec0ac7d82012-05-16 11:28:59 -0700655 msm_gpiomux_install(msm8960_audio_spkr_configs,
656 ARRAY_SIZE(msm8960_audio_spkr_configs));
657
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800658 msm_gpiomux_install(msm8960_audio_auxpcm_configs,
659 ARRAY_SIZE(msm8960_audio_auxpcm_configs));
660
661 msm_gpiomux_install(wcnss_5wire_interface,
662 ARRAY_SIZE(wcnss_5wire_interface));
663
664 if (machine_is_msm8930_mtp() || machine_is_msm8930_fluid() ||
Mayank Ranabf5084a2011-12-12 17:06:54 +0530665 machine_is_msm8930_cdp()) {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800666 msm_gpiomux_install(hap_lvl_shft_config,
667 ARRAY_SIZE(hap_lvl_shft_config));
Mayank Ranabf5084a2011-12-12 17:06:54 +0530668#ifdef MSM8930_PHASE_2
669 msm_gpiomux_install(msm8930_hsusb_configs,
670 ARRAY_SIZE(msm8930_hsusb_configs));
671#endif
672 }
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800673
674 if (PLATFORM_IS_CHARM25())
675 msm_gpiomux_install(mdm_configs,
676 ARRAY_SIZE(mdm_configs));
677
Amy Malochee8de95d2012-02-23 10:40:25 -0800678 if (machine_is_msm8930_cdp() || machine_is_msm8930_mtp()
679 || machine_is_msm8930_fluid())
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +0530680 msm_gpiomux_install(msm8930_haptics_configs,
681 ARRAY_SIZE(msm8930_haptics_configs));
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +0530682
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800683#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
684 msm_gpiomux_install(msm8960_hdmi_configs,
685 ARRAY_SIZE(msm8960_hdmi_configs));
686#endif
687
688 msm_gpiomux_install(msm8960_mdp_vsync_configs,
689 ARRAY_SIZE(msm8960_mdp_vsync_configs));
690 return 0;
691}