blob: 978eb0994cb99e42d48d0bc4849d5bbb9e404c88 [file] [log] [blame]
Pratibhasagar V26cf2652012-01-12 17:31:21 +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-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
Mayank Ranae009c922012-03-22 03:02:06 +053064static struct gpiomux_setting gsbi9_active_cfg = {
65 .func = GPIOMUX_FUNC_2,
66 .drv = GPIOMUX_DRV_8MA,
67 .pull = GPIOMUX_PULL_DOWN,
68};
69
70static struct gpiomux_setting gsbi9_suspended_cfg = {
71 .func = GPIOMUX_FUNC_2,
72 .drv = GPIOMUX_DRV_2MA,
73 .pull = GPIOMUX_PULL_DOWN,
74};
75
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -080076static struct gpiomux_setting gsbi10 = {
77 .func = GPIOMUX_FUNC_2,
78 .drv = GPIOMUX_DRV_8MA,
79 .pull = GPIOMUX_PULL_NONE,
80};
81
82static struct gpiomux_setting gsbi12 = {
83 .func = GPIOMUX_FUNC_1,
84 .drv = GPIOMUX_DRV_8MA,
85 .pull = GPIOMUX_PULL_NONE,
86};
87
88static struct gpiomux_setting cdc_mclk = {
89 .func = GPIOMUX_FUNC_1,
90 .drv = GPIOMUX_DRV_8MA,
91 .pull = GPIOMUX_PULL_NONE,
92};
93
94static struct gpiomux_setting audio_auxpcm[] = {
95 /* Suspended state */
96 {
97 .func = GPIOMUX_FUNC_GPIO,
98 .drv = GPIOMUX_DRV_2MA,
Patrick Laib593eaf2012-01-05 22:14:47 -080099 .pull = GPIOMUX_PULL_DOWN,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800100 },
101 /* Active state */
102 {
103 .func = GPIOMUX_FUNC_1,
104 .drv = GPIOMUX_DRV_2MA,
105 .pull = GPIOMUX_PULL_NONE,
106 },
107};
108
109#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
110static struct gpiomux_setting gpio_eth_config = {
111 .pull = GPIOMUX_PULL_NONE,
112 .drv = GPIOMUX_DRV_8MA,
113 .func = GPIOMUX_FUNC_GPIO,
114};
115#endif
116
117static struct gpiomux_setting slimbus = {
118 .func = GPIOMUX_FUNC_1,
119 .drv = GPIOMUX_DRV_8MA,
120 .pull = GPIOMUX_PULL_KEEPER,
121};
122
123static struct gpiomux_setting wcnss_5wire_suspend_cfg = {
124 .func = GPIOMUX_FUNC_GPIO,
125 .drv = GPIOMUX_DRV_2MA,
126 .pull = GPIOMUX_PULL_UP,
127};
128
129static struct gpiomux_setting wcnss_5wire_active_cfg = {
130 .func = GPIOMUX_FUNC_1,
131 .drv = GPIOMUX_DRV_6MA,
132 .pull = GPIOMUX_PULL_DOWN,
133};
134
135static struct gpiomux_setting cyts_resout_sus_cfg = {
136 .func = GPIOMUX_FUNC_GPIO,
137 .drv = GPIOMUX_DRV_6MA,
138 .pull = GPIOMUX_PULL_UP,
139};
140
141static struct gpiomux_setting cyts_resout_act_cfg = {
142 .func = GPIOMUX_FUNC_GPIO,
143 .drv = GPIOMUX_DRV_6MA,
144 .pull = GPIOMUX_PULL_UP,
145};
146
147static struct gpiomux_setting cyts_sleep_sus_cfg = {
148 .func = GPIOMUX_FUNC_GPIO,
149 .drv = GPIOMUX_DRV_6MA,
150 .pull = GPIOMUX_PULL_DOWN,
151};
152
153static struct gpiomux_setting cyts_sleep_act_cfg = {
154 .func = GPIOMUX_FUNC_GPIO,
155 .drv = GPIOMUX_DRV_6MA,
156 .pull = GPIOMUX_PULL_DOWN,
157};
158
159static struct gpiomux_setting cyts_int_act_cfg = {
160 .func = GPIOMUX_FUNC_GPIO,
161 .drv = GPIOMUX_DRV_8MA,
162 .pull = GPIOMUX_PULL_UP,
163};
164
165static struct gpiomux_setting cyts_int_sus_cfg = {
166 .func = GPIOMUX_FUNC_GPIO,
167 .drv = GPIOMUX_DRV_2MA,
168 .pull = GPIOMUX_PULL_DOWN,
169};
170
171#ifdef CONFIG_USB_EHCI_MSM_HSIC
172static struct gpiomux_setting hsic_act_cfg = {
173 .func = GPIOMUX_FUNC_1,
174 .drv = GPIOMUX_DRV_12MA,
175 .pull = GPIOMUX_PULL_NONE,
176};
177
178static struct gpiomux_setting hsic_sus_cfg = {
179 .func = GPIOMUX_FUNC_GPIO,
180 .drv = GPIOMUX_DRV_2MA,
181 .pull = GPIOMUX_PULL_DOWN,
182 .dir = GPIOMUX_OUT_LOW,
183};
184
185static struct gpiomux_setting hsic_hub_act_cfg = {
186 .func = GPIOMUX_FUNC_GPIO,
187 .drv = GPIOMUX_DRV_2MA,
188 .pull = GPIOMUX_PULL_NONE,
189};
190#endif
191
192static struct gpiomux_setting hap_lvl_shft_suspended_config = {
193 .func = GPIOMUX_FUNC_GPIO,
194 .drv = GPIOMUX_DRV_2MA,
195 .pull = GPIOMUX_PULL_DOWN,
196};
197
198static struct gpiomux_setting hap_lvl_shft_active_config = {
199 .func = GPIOMUX_FUNC_GPIO,
200 .drv = GPIOMUX_DRV_8MA,
201 .pull = GPIOMUX_PULL_UP,
202};
203
204static struct gpiomux_setting ap2mdm_cfg = {
205 .func = GPIOMUX_FUNC_GPIO,
206 .drv = GPIOMUX_DRV_8MA,
207 .pull = GPIOMUX_PULL_DOWN,
208};
209
210static struct gpiomux_setting mdm2ap_status_cfg = {
211 .func = GPIOMUX_FUNC_GPIO,
212 .drv = GPIOMUX_DRV_8MA,
213 .pull = GPIOMUX_PULL_NONE,
214};
215
216static struct gpiomux_setting mdm2ap_errfatal_cfg = {
217 .func = GPIOMUX_FUNC_GPIO,
218 .drv = GPIOMUX_DRV_16MA,
219 .pull = GPIOMUX_PULL_DOWN,
220};
221
222static struct gpiomux_setting ap2mdm_kpdpwr_n_cfg = {
223 .func = GPIOMUX_FUNC_GPIO,
224 .drv = GPIOMUX_DRV_8MA,
Joel King1c607312012-01-13 16:41:44 -0800225 .pull = GPIOMUX_PULL_DOWN,
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800226};
227
228static struct gpiomux_setting mdp_vsync_suspend_cfg = {
229 .func = GPIOMUX_FUNC_GPIO,
230 .drv = GPIOMUX_DRV_2MA,
231 .pull = GPIOMUX_PULL_DOWN,
232};
233
234static struct gpiomux_setting mdp_vsync_active_cfg = {
235 .func = GPIOMUX_FUNC_1,
236 .drv = GPIOMUX_DRV_2MA,
237 .pull = GPIOMUX_PULL_DOWN,
238};
239
240#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
241static struct gpiomux_setting hdmi_suspend_cfg = {
242 .func = GPIOMUX_FUNC_GPIO,
243 .drv = GPIOMUX_DRV_2MA,
244 .pull = GPIOMUX_PULL_DOWN,
245};
246
247static struct gpiomux_setting hdmi_active_1_cfg = {
248 .func = GPIOMUX_FUNC_1,
249 .drv = GPIOMUX_DRV_2MA,
250 .pull = GPIOMUX_PULL_UP,
251};
252
253static struct gpiomux_setting hdmi_active_2_cfg = {
254 .func = GPIOMUX_FUNC_1,
255 .drv = GPIOMUX_DRV_2MA,
256 .pull = GPIOMUX_PULL_DOWN,
257};
Eugene Yasman67592342011-12-11 13:12:36 +0200258
Manoj Rao14648742012-03-30 19:42:12 -0700259#if defined(CONFIG_FB_MSM_HDMI_MHL_8334) || defined(CONFIG_FB_MSM_HDMI_MHL_9244)
Eugene Yasman67592342011-12-11 13:12:36 +0200260static struct gpiomux_setting hdmi_active_3_cfg = {
261 .func = GPIOMUX_FUNC_GPIO,
262 .drv = GPIOMUX_DRV_2MA,
Eugene Yasmana2db4162011-12-13 09:28:22 +0200263 .pull = GPIOMUX_PULL_UP,
Eugene Yasman67592342011-12-11 13:12:36 +0200264 .dir = GPIOMUX_IN,
265};
266
267static struct gpiomux_setting hdmi_active_4_cfg = {
268 .func = GPIOMUX_FUNC_GPIO,
269 .drv = GPIOMUX_DRV_2MA,
270 .pull = GPIOMUX_PULL_UP,
271 .dir = GPIOMUX_OUT_HIGH,
272};
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800273#endif
Manoj Rao14648742012-03-30 19:42:12 -0700274#endif
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800275
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
Mayank Ranae009c922012-03-22 03:02:06 +0530293static struct msm_gpiomux_config msm8960_fusion_gsbi_configs[] = {
294 {
295 .gpio = 93,
296 .settings = {
297 [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg,
298 [GPIOMUX_ACTIVE] = &gsbi9_active_cfg,
299 }
300 },
301 {
302 .gpio = 94,
303 .settings = {
304 [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg,
305 [GPIOMUX_ACTIVE] = &gsbi9_active_cfg,
306 }
307 },
308 {
309 .gpio = 95,
310 .settings = {
311 [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg,
312 [GPIOMUX_ACTIVE] = &gsbi9_active_cfg,
313 }
314 },
315 {
316 .gpio = 96,
317 .settings = {
318 [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg,
319 [GPIOMUX_ACTIVE] = &gsbi9_active_cfg,
320 }
321 },
322};
323
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800324static struct msm_gpiomux_config msm8960_gsbi_configs[] __initdata = {
325 {
326 .gpio = 6, /* GSBI1 QUP SPI_DATA_MOSI */
327 .settings = {
328 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
329 [GPIOMUX_ACTIVE] = &spi_active,
330 },
331 },
332 {
333 .gpio = 7, /* GSBI1 QUP SPI_DATA_MISO */
334 .settings = {
335 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
336 [GPIOMUX_ACTIVE] = &spi_active,
337 },
338 },
339 {
340 .gpio = 8, /* GSBI1 QUP SPI_CS_N */
341 .settings = {
342 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
343 [GPIOMUX_ACTIVE] = &spi_active,
344 },
345 },
346 {
347 .gpio = 9, /* GSBI1 QUP SPI_CLK */
348 .settings = {
349 [GPIOMUX_SUSPENDED] = &spi_suspended_config,
350 [GPIOMUX_ACTIVE] = &spi_active,
351 },
352 },
353 {
354 .gpio = 14, /* GSBI1 SPI_CS_1 */
355 .settings = {
356 [GPIOMUX_SUSPENDED] = &spi_suspended_config2,
357 [GPIOMUX_ACTIVE] = &spi_active_config2,
358 },
359 },
360 {
361 .gpio = 16, /* GSBI3 I2C QUP SDA */
362 .settings = {
363 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
364 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
365 },
366 },
367 {
368 .gpio = 17, /* GSBI3 I2C QUP SCL */
369 .settings = {
370 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
371 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
372 },
373 },
374 {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800375 .gpio = 44, /* GSBI12 I2C QUP SDA */
376 .settings = {
377 [GPIOMUX_SUSPENDED] = &gsbi12,
378 },
379 },
380 {
381 .gpio = 45, /* GSBI12 I2C QUP SCL */
382 .settings = {
383 [GPIOMUX_SUSPENDED] = &gsbi12,
384 },
385 },
386 {
387 .gpio = 73, /* GSBI10 I2C QUP SDA */
388 .settings = {
389 [GPIOMUX_SUSPENDED] = &gsbi10,
390 },
391 },
392 {
393 .gpio = 74, /* GSBI10 I2C QUP SCL */
394 .settings = {
395 [GPIOMUX_SUSPENDED] = &gsbi10,
396 },
397 },
398};
399
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -0700400static struct msm_gpiomux_config msm8960_gsbi5_uart_configs[] __initdata = {
401 {
402 .gpio = 22, /* GSBI5 UART2 */
403 .settings = {
404 [GPIOMUX_SUSPENDED] = &gsbi_uart,
405 },
406 },
407 {
408 .gpio = 23, /* GSBI5 UART2 */
409 .settings = {
410 [GPIOMUX_SUSPENDED] = &gsbi_uart,
411 },
412 },
413 {
414 .gpio = 24, /* GSBI5 UART2 */
415 .settings = {
416 [GPIOMUX_SUSPENDED] = &gsbi_uart,
417 },
418 },
419 {
420 .gpio = 25, /* GSBI5 UART2 */
421 .settings = {
422 [GPIOMUX_SUSPENDED] = &gsbi_uart,
423 },
424 },
425};
426
427static struct msm_gpiomux_config msm8960_gsbi8_uart_configs[] __initdata = {
428 {
429 .gpio = 34, /* GSBI8 UART3 */
430 .settings = {
431 [GPIOMUX_SUSPENDED] = &gsbi_uart,
432 },
433 },
434 {
435 .gpio = 35, /* GSBI8 UART3 */
436 .settings = {
437 [GPIOMUX_SUSPENDED] = &gsbi_uart,
438 },
439 },
440 {
441 .gpio = 36, /* GSBI8 UART3 */
442 .settings = {
443 [GPIOMUX_SUSPENDED] = &gsbi_uart,
444 },
445 },
446 {
447 .gpio = 37, /* GSBI8 UART3 */
448 .settings = {
449 [GPIOMUX_SUSPENDED] = &gsbi_uart,
450 },
451 },
452};
453
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800454static struct msm_gpiomux_config msm8960_slimbus_config[] __initdata = {
455 {
456 .gpio = 60, /* slimbus data */
457 .settings = {
458 [GPIOMUX_SUSPENDED] = &slimbus,
459 },
460 },
461 {
462 .gpio = 61, /* slimbus clk */
463 .settings = {
464 [GPIOMUX_SUSPENDED] = &slimbus,
465 },
466 },
467};
468
469static struct msm_gpiomux_config msm8960_audio_codec_configs[] __initdata = {
470 {
471 .gpio = 59,
472 .settings = {
473 [GPIOMUX_SUSPENDED] = &cdc_mclk,
474 },
475 },
476};
477
478static struct msm_gpiomux_config msm8960_audio_auxpcm_configs[] __initdata = {
479 {
480 .gpio = 63,
481 .settings = {
482 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
483 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
484 },
485 },
486 {
487 .gpio = 64,
488 .settings = {
489 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
490 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
491 },
492 },
493 {
494 .gpio = 65,
495 .settings = {
496 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
497 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
498 },
499 },
500 {
501 .gpio = 66,
502 .settings = {
503 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
504 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
505 },
506 },
507};
508
509static struct msm_gpiomux_config wcnss_5wire_interface[] = {
510 {
511 .gpio = 84,
512 .settings = {
513 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
514 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
515 },
516 },
517 {
518 .gpio = 85,
519 .settings = {
520 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
521 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
522 },
523 },
524 {
525 .gpio = 86,
526 .settings = {
527 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
528 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
529 },
530 },
531 {
532 .gpio = 87,
533 .settings = {
534 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
535 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
536 },
537 },
538 {
539 .gpio = 88,
540 .settings = {
541 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
542 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
543 },
544 },
545};
546
547static struct msm_gpiomux_config msm8960_cyts_configs[] __initdata = {
548 { /* TS INTERRUPT */
549 .gpio = 11,
550 .settings = {
551 [GPIOMUX_ACTIVE] = &cyts_int_act_cfg,
552 [GPIOMUX_SUSPENDED] = &cyts_int_sus_cfg,
553 },
554 },
555 { /* TS SLEEP */
556 .gpio = 50,
557 .settings = {
558 [GPIOMUX_ACTIVE] = &cyts_sleep_act_cfg,
559 [GPIOMUX_SUSPENDED] = &cyts_sleep_sus_cfg,
560 },
561 },
562 { /* TS RESOUT */
563 .gpio = 52,
564 .settings = {
565 [GPIOMUX_ACTIVE] = &cyts_resout_act_cfg,
566 [GPIOMUX_SUSPENDED] = &cyts_resout_sus_cfg,
567 },
568 },
569};
570
571#ifdef CONFIG_USB_EHCI_MSM_HSIC
572static struct msm_gpiomux_config msm8960_hsic_configs[] = {
573 {
574 .gpio = 150, /*HSIC_STROBE */
575 .settings = {
576 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
577 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
578 },
579 },
580 {
581 .gpio = 151, /* HSIC_DATA */
582 .settings = {
583 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
584 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
585 },
586 },
Vijayavardhan Vennapusaafbbb8f2012-04-13 16:28:45 +0530587};
588
589static struct msm_gpiomux_config msm8960_hsic_hub_configs[] = {
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800590 {
591 .gpio = 91, /* HSIC_HUB_RESET */
592 .settings = {
593 [GPIOMUX_ACTIVE] = &hsic_hub_act_cfg,
594 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
595 },
596 },
597};
598#endif
599
Pratibhasagar V26cf2652012-01-12 17:31:21 +0530600#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
601static struct gpiomux_setting sdcc4_clk_actv_cfg = {
602 .func = GPIOMUX_FUNC_2,
603 .drv = GPIOMUX_DRV_8MA,
604 .pull = GPIOMUX_PULL_NONE,
605};
606
607static struct gpiomux_setting sdcc4_cmd_data_0_3_actv_cfg = {
608 .func = GPIOMUX_FUNC_2,
609 .drv = GPIOMUX_DRV_8MA,
610 .pull = GPIOMUX_PULL_UP,
611};
612
613static struct gpiomux_setting sdcc4_suspend_cfg = {
614 .func = GPIOMUX_FUNC_GPIO,
615 .drv = GPIOMUX_DRV_2MA,
616 .pull = GPIOMUX_PULL_DOWN,
617};
618
619static struct gpiomux_setting sdcc4_data_1_suspend_cfg = {
620 .func = GPIOMUX_FUNC_GPIO,
621 .drv = GPIOMUX_DRV_8MA,
622 .pull = GPIOMUX_PULL_UP,
623};
624
625static struct msm_gpiomux_config msm8960_sdcc4_configs[] __initdata = {
626 {
627 /* SDC4_DATA_3 */
628 .gpio = 83,
629 .settings = {
630 [GPIOMUX_ACTIVE] = &sdcc4_cmd_data_0_3_actv_cfg,
631 [GPIOMUX_SUSPENDED] = &sdcc4_suspend_cfg,
632 },
633 },
634 {
635 /* SDC4_DATA_2 */
636 .gpio = 84,
637 .settings = {
638 [GPIOMUX_ACTIVE] = &sdcc4_cmd_data_0_3_actv_cfg,
639 [GPIOMUX_SUSPENDED] = &sdcc4_suspend_cfg,
640 },
641 },
642 {
643 /* SDC4_DATA_1 */
644 .gpio = 85,
645 .settings = {
646 [GPIOMUX_ACTIVE] = &sdcc4_cmd_data_0_3_actv_cfg,
647 [GPIOMUX_SUSPENDED] = &sdcc4_data_1_suspend_cfg,
648 },
649 },
650 {
651 /* SDC4_DATA_0 */
652 .gpio = 86,
653 .settings = {
654 [GPIOMUX_ACTIVE] = &sdcc4_cmd_data_0_3_actv_cfg,
655 [GPIOMUX_SUSPENDED] = &sdcc4_suspend_cfg,
656 },
657 },
658 {
659 /* SDC4_CMD */
660 .gpio = 87,
661 .settings = {
662 [GPIOMUX_ACTIVE] = &sdcc4_cmd_data_0_3_actv_cfg,
663 [GPIOMUX_SUSPENDED] = &sdcc4_suspend_cfg,
664 },
665 },
666 {
667 /* SDC4_CLK */
668 .gpio = 88,
669 .settings = {
670 [GPIOMUX_ACTIVE] = &sdcc4_clk_actv_cfg,
671 [GPIOMUX_SUSPENDED] = &sdcc4_suspend_cfg,
672 },
673 },
674};
675#endif
676
677
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800678static struct msm_gpiomux_config hap_lvl_shft_config[] __initdata = {
679 {
680 .gpio = 47,
681 .settings = {
682 [GPIOMUX_SUSPENDED] = &hap_lvl_shft_suspended_config,
683 [GPIOMUX_ACTIVE] = &hap_lvl_shft_active_config,
684 },
685 },
686};
687
688static struct msm_gpiomux_config mdm_configs[] __initdata = {
689 /* AP2MDM_STATUS */
690 {
691 .gpio = 94,
692 .settings = {
693 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
694 }
695 },
696 /* MDM2AP_STATUS */
697 {
698 .gpio = 69,
699 .settings = {
700 [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
701 }
702 },
703 /* MDM2AP_ERRFATAL */
704 {
705 .gpio = 70,
706 .settings = {
707 [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
708 }
709 },
710 /* AP2MDM_ERRFATAL */
711 {
712 .gpio = 95,
713 .settings = {
714 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
715 }
716 },
717 /* AP2MDM_KPDPWR_N */
718 {
719 .gpio = 81,
720 .settings = {
721 [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg,
722 }
723 },
724 /* AP2MDM_PMIC_RESET_N */
725 {
726 .gpio = 80,
727 .settings = {
728 [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg,
729 }
730 }
731};
732
733static struct msm_gpiomux_config msm8960_mdp_vsync_configs[] __initdata = {
734 {
735 .gpio = 0,
736 .settings = {
737 [GPIOMUX_ACTIVE] = &mdp_vsync_active_cfg,
738 [GPIOMUX_SUSPENDED] = &mdp_vsync_suspend_cfg,
739 },
740 }
741};
742
743#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
744static struct msm_gpiomux_config msm8960_hdmi_configs[] __initdata = {
745 {
746 .gpio = 99,
747 .settings = {
748 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
749 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
750 },
751 },
752 {
753 .gpio = 100,
754 .settings = {
755 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
756 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
757 },
758 },
759 {
760 .gpio = 101,
761 .settings = {
762 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
763 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
764 },
765 },
766 {
767 .gpio = 102,
768 .settings = {
769 [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg,
770 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
771 },
772 },
Manoj Rao14648742012-03-30 19:42:12 -0700773#ifdef CONFIG_FB_MSM_HDMI_MHL_9244
Eugene Yasman67592342011-12-11 13:12:36 +0200774 {
775 .gpio = 15,
776 .settings = {
777 [GPIOMUX_ACTIVE] = &hdmi_active_3_cfg,
778 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
779 },
780 },
781 {
782 .gpio = 66,
783 .settings = {
784 [GPIOMUX_ACTIVE] = &hdmi_active_4_cfg,
785 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
786 },
787 },
Manoj Rao14648742012-03-30 19:42:12 -0700788#endif
789#ifdef CONFIG_FB_MSM_HDMI_MHL_8334
790 {
791 .gpio = 4,
792 .settings = {
793 [GPIOMUX_ACTIVE] = &hdmi_active_3_cfg,
794 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
795 },
796 },
797 {
798 .gpio = 15,
799 .settings = {
800 [GPIOMUX_ACTIVE] = &hdmi_active_4_cfg,
801 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
802 },
803 },
804#endif /* CONFIG_FB_MSM_HDMI_MHL */
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800805};
806#endif
807
Pratibhasagar V57c808e2012-01-12 13:47:30 +0530808#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
809static struct gpiomux_setting sdcc2_clk_actv_cfg = {
810 .func = GPIOMUX_FUNC_2,
811 .drv = GPIOMUX_DRV_8MA,
812 .pull = GPIOMUX_PULL_NONE,
813};
814
815static struct gpiomux_setting sdcc2_cmd_data_0_3_actv_cfg = {
816 .func = GPIOMUX_FUNC_2,
817 .drv = GPIOMUX_DRV_8MA,
818 .pull = GPIOMUX_PULL_UP,
819};
820
821static struct gpiomux_setting sdcc2_suspend_cfg = {
822 .func = GPIOMUX_FUNC_GPIO,
823 .drv = GPIOMUX_DRV_2MA,
824 .pull = GPIOMUX_PULL_DOWN,
825};
826
827static struct gpiomux_setting sdcc2_data_1_suspend_cfg = {
828 .func = GPIOMUX_FUNC_GPIO,
829 .drv = GPIOMUX_DRV_8MA,
830 .pull = GPIOMUX_PULL_UP,
831};
832
833static struct msm_gpiomux_config msm8960_sdcc2_configs[] __initdata = {
834 {
835 /* DATA_3 */
836 .gpio = 92,
837 .settings = {
838 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
839 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
840 },
841 },
842 {
843 /* DATA_2 */
844 .gpio = 91,
845 .settings = {
846 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
847 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
848 },
849 },
850 {
851 /* DATA_1 */
852 .gpio = 90,
853 .settings = {
854 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
855 [GPIOMUX_SUSPENDED] = &sdcc2_data_1_suspend_cfg,
856 },
857 },
858 {
859 /* DATA_0 */
860 .gpio = 89,
861 .settings = {
862 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
863 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
864 },
865 },
866 {
867 /* CMD */
868 .gpio = 97,
869 .settings = {
870 [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg,
871 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
872 },
873 },
874 {
875 /* CLK */
876 .gpio = 98,
877 .settings = {
878 [GPIOMUX_ACTIVE] = &sdcc2_clk_actv_cfg,
879 [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg,
880 },
881 },
882};
883#endif
884
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800885int __init msm8960_init_gpiomux(void)
886{
887 int rc = msm_gpiomux_init(NR_GPIO_IRQS);
888 if (rc) {
889 pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
890 return rc;
891 }
892
893#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
894 msm_gpiomux_install(msm8960_ethernet_configs,
895 ARRAY_SIZE(msm8960_ethernet_configs));
896#endif
897
898 msm_gpiomux_install(msm8960_gsbi_configs,
899 ARRAY_SIZE(msm8960_gsbi_configs));
900
901 msm_gpiomux_install(msm8960_cyts_configs,
902 ARRAY_SIZE(msm8960_cyts_configs));
903
904 msm_gpiomux_install(msm8960_slimbus_config,
905 ARRAY_SIZE(msm8960_slimbus_config));
906
907 msm_gpiomux_install(msm8960_audio_codec_configs,
908 ARRAY_SIZE(msm8960_audio_codec_configs));
909
910 msm_gpiomux_install(msm8960_audio_auxpcm_configs,
911 ARRAY_SIZE(msm8960_audio_auxpcm_configs));
912
913 msm_gpiomux_install(wcnss_5wire_interface,
914 ARRAY_SIZE(wcnss_5wire_interface));
915
Pratibhasagar V26cf2652012-01-12 17:31:21 +0530916#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
917 msm_gpiomux_install(msm8960_sdcc4_configs,
918 ARRAY_SIZE(msm8960_sdcc4_configs));
919#endif
920
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800921 if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() ||
922 machine_is_msm8960_liquid() || machine_is_msm8960_cdp())
923 msm_gpiomux_install(hap_lvl_shft_config,
924 ARRAY_SIZE(hap_lvl_shft_config));
925
926 if (PLATFORM_IS_CHARM25())
927 msm_gpiomux_install(mdm_configs,
928 ARRAY_SIZE(mdm_configs));
929
930#ifdef CONFIG_USB_EHCI_MSM_HSIC
931 if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
932 (PLATFORM_IS_CHARM25() || machine_is_msm8960_liquid()))
933 msm_gpiomux_install(msm8960_hsic_configs,
934 ARRAY_SIZE(msm8960_hsic_configs));
Vijayavardhan Vennapusaafbbb8f2012-04-13 16:28:45 +0530935
936 if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
937 machine_is_msm8960_liquid())
938 msm_gpiomux_install(msm8960_hsic_hub_configs,
939 ARRAY_SIZE(msm8960_hsic_hub_configs));
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800940#endif
941
942#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
943 msm_gpiomux_install(msm8960_hdmi_configs,
944 ARRAY_SIZE(msm8960_hdmi_configs));
945#endif
946
947 msm_gpiomux_install(msm8960_mdp_vsync_configs,
948 ARRAY_SIZE(msm8960_mdp_vsync_configs));
949
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -0700950 if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE)
951 msm_gpiomux_install(msm8960_gsbi8_uart_configs,
952 ARRAY_SIZE(msm8960_gsbi8_uart_configs));
953 else
954 msm_gpiomux_install(msm8960_gsbi5_uart_configs,
955 ARRAY_SIZE(msm8960_gsbi5_uart_configs));
Mayank Ranae009c922012-03-22 03:02:06 +0530956 /* For 8960 Fusion 2.2 Primary IPC */
957 if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE)
958 msm_gpiomux_install(msm8960_fusion_gsbi_configs,
959 ARRAY_SIZE(msm8960_fusion_gsbi_configs));
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -0700960
Pratibhasagar V57c808e2012-01-12 13:47:30 +0530961#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
962 msm_gpiomux_install(msm8960_sdcc2_configs,
963 ARRAY_SIZE(msm8960_sdcc2_configs));
964#endif
965
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800966 return 0;
967}