blob: c8a88d78d40a9d030dcc6c43f58bf65d1e5172cc [file] [log] [blame]
Damir Didjusto93768d12013-01-17 11:30:47 -08001/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -07002 *
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 <linux/init.h>
15#include <linux/ioport.h>
16#include <mach/board.h>
17#include <mach/gpio.h>
18#include <mach/gpiomux.h>
Stepan Moskovchenko95108b82012-11-27 14:28:11 -080019#include <mach/socinfo.h>
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -070020
Subbaraman Narayanamurthy3f93ab12012-08-17 19:39:47 -070021#define KS8851_IRQ_GPIO 94
Sathish Ambleye3154b42012-04-09 10:59:09 -070022
Joel King15ccbfa2013-04-12 17:41:16 -070023static struct gpiomux_setting ap2mdm_cfg = {
24 .func = GPIOMUX_FUNC_GPIO,
25 .drv = GPIOMUX_DRV_8MA,
26 .pull = GPIOMUX_PULL_NONE,
27};
28
29static struct gpiomux_setting mdm2ap_status_cfg = {
30 .func = GPIOMUX_FUNC_GPIO,
31 .drv = GPIOMUX_DRV_8MA,
32 .pull = GPIOMUX_PULL_DOWN,
33 .dir = GPIOMUX_IN,
34};
35
36static struct gpiomux_setting mdm2ap_errfatal_cfg = {
37 .func = GPIOMUX_FUNC_GPIO,
38 .drv = GPIOMUX_DRV_8MA,
39 .pull = GPIOMUX_PULL_DOWN,
40 .dir = GPIOMUX_IN,
41};
42
43static struct gpiomux_setting mdm2ap_pblrdy = {
44 .func = GPIOMUX_FUNC_GPIO,
45 .drv = GPIOMUX_DRV_8MA,
46 .pull = GPIOMUX_PULL_NONE,
47 .dir = GPIOMUX_IN,
48};
49
50
51static struct gpiomux_setting ap2mdm_soft_reset_cfg = {
52 .func = GPIOMUX_FUNC_GPIO,
53 .drv = GPIOMUX_DRV_8MA,
54 .pull = GPIOMUX_PULL_NONE,
55};
56
57static struct gpiomux_setting ap2mdm_wakeup = {
58 .func = GPIOMUX_FUNC_GPIO,
59 .drv = GPIOMUX_DRV_8MA,
60 .pull = GPIOMUX_PULL_DOWN,
61};
62
63static struct msm_gpiomux_config mdm_configs[] __initdata = {
64 /* AP2MDM_STATUS */
65 {
66 .gpio = 105,
67 .settings = {
68 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
69 }
70 },
71 /* MDM2AP_STATUS */
72 {
73 .gpio = 46,
74 .settings = {
75 [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
76 }
77 },
78 /* MDM2AP_ERRFATAL */
79 {
80 .gpio = 82,
81 .settings = {
82 [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
83 }
84 },
85 /* AP2MDM_ERRFATAL */
86 {
87 .gpio = 106,
88 .settings = {
89 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
90 }
91 },
92 /* AP2MDM_SOFT_RESET, aka AP2MDM_PON_RESET_N */
93 {
94 .gpio = 24,
95 .settings = {
96 [GPIOMUX_SUSPENDED] = &ap2mdm_soft_reset_cfg,
97 }
98 },
99 /* AP2MDM_WAKEUP */
100 {
101 .gpio = 104,
102 .settings = {
103 [GPIOMUX_SUSPENDED] = &ap2mdm_wakeup,
104 }
105 },
106 /* MDM2AP_PBL_READY*/
107 {
108 .gpio = 80,
109 .settings = {
110 [GPIOMUX_SUSPENDED] = &mdm2ap_pblrdy,
111 }
112 },
113};
114
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700115static struct gpiomux_setting gpio_uart_config = {
116 .func = GPIOMUX_FUNC_2,
117 .drv = GPIOMUX_DRV_16MA,
118 .pull = GPIOMUX_PULL_NONE,
119 .dir = GPIOMUX_OUT_HIGH,
120};
121
Sagar Dhariaa8e6b0a2012-08-10 20:52:30 -0600122static struct gpiomux_setting slimbus = {
123 .func = GPIOMUX_FUNC_1,
124 .drv = GPIOMUX_DRV_8MA,
125 .pull = GPIOMUX_PULL_KEEPER,
126};
127
Sathish Ambleye3154b42012-04-09 10:59:09 -0700128#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
129static struct gpiomux_setting gpio_eth_config = {
Subbaraman Narayanamurthy3f93ab12012-08-17 19:39:47 -0700130 .pull = GPIOMUX_PULL_UP,
131 .drv = GPIOMUX_DRV_2MA,
Sathish Ambleye3154b42012-04-09 10:59:09 -0700132 .func = GPIOMUX_FUNC_GPIO,
133};
134
Subbaraman Narayanamurthy3f93ab12012-08-17 19:39:47 -0700135static struct gpiomux_setting gpio_spi_cs2_config = {
Sathish Ambleye3154b42012-04-09 10:59:09 -0700136 .func = GPIOMUX_FUNC_4,
Subbaraman Narayanamurthy3f93ab12012-08-17 19:39:47 -0700137 .drv = GPIOMUX_DRV_6MA,
138 .pull = GPIOMUX_PULL_DOWN,
Sathish Ambleye3154b42012-04-09 10:59:09 -0700139};
140
141static struct gpiomux_setting gpio_spi_config = {
142 .func = GPIOMUX_FUNC_1,
143 .drv = GPIOMUX_DRV_12MA,
144 .pull = GPIOMUX_PULL_NONE,
145};
146
Subbaraman Narayanamurthy3f93ab12012-08-17 19:39:47 -0700147static struct gpiomux_setting gpio_spi_cs1_config = {
148 .func = GPIOMUX_FUNC_GPIO,
149 .drv = GPIOMUX_DRV_6MA,
150 .pull = GPIOMUX_PULL_UP,
151};
152
Sathish Ambleye3154b42012-04-09 10:59:09 -0700153static struct msm_gpiomux_config msm_eth_configs[] = {
154 {
155 .gpio = KS8851_IRQ_GPIO,
156 .settings = {
157 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
158 }
159 },
160};
161#endif
Sameer Thalappil8d686d42012-08-24 10:07:31 -0700162
Pawan Kumar Nimmagaddabefacac2013-01-23 15:36:28 -0800163static struct gpiomux_setting gpio_suspend_config[] = {
164 {
165 .func = GPIOMUX_FUNC_GPIO, /* IN-NP */
166 .drv = GPIOMUX_DRV_2MA,
167 .pull = GPIOMUX_PULL_NONE,
168 },
169 {
170 .func = GPIOMUX_FUNC_GPIO, /* O-LOW */
171 .drv = GPIOMUX_DRV_2MA,
172 .pull = GPIOMUX_PULL_NONE,
173 .dir = GPIOMUX_OUT_LOW,
174 },
175};
176
Siddartha Mohanadossc4bc6ae2012-12-06 14:22:22 -0800177static struct gpiomux_setting gpio_epm_config = {
178 .func = GPIOMUX_FUNC_GPIO,
179 .drv = GPIOMUX_DRV_2MA,
180 .pull = GPIOMUX_PULL_DOWN,
181};
182
Sameer Thalappil8d686d42012-08-24 10:07:31 -0700183static struct gpiomux_setting wcnss_5wire_suspend_cfg = {
184 .func = GPIOMUX_FUNC_GPIO,
185 .drv = GPIOMUX_DRV_2MA,
186 .pull = GPIOMUX_PULL_UP,
187};
188
189static struct gpiomux_setting wcnss_5wire_active_cfg = {
190 .func = GPIOMUX_FUNC_1,
191 .drv = GPIOMUX_DRV_6MA,
192 .pull = GPIOMUX_PULL_DOWN,
193};
194
Ram Mohan Korukonda56ac5232013-03-20 23:48:34 +0530195static struct gpiomux_setting ath_gpio_active_cfg = {
196 .func = GPIOMUX_FUNC_GPIO,
197 .drv = GPIOMUX_DRV_2MA,
198 .pull = GPIOMUX_PULL_UP,
199};
200
201static struct gpiomux_setting ath_gpio_suspend_cfg = {
202 .func = GPIOMUX_FUNC_GPIO,
203 .drv = GPIOMUX_DRV_2MA,
204 .pull = GPIOMUX_PULL_DOWN,
205};
206
Jin Honga04caaa2012-05-23 10:28:27 -0700207static struct gpiomux_setting gpio_i2c_config = {
208 .func = GPIOMUX_FUNC_3,
Gilad Avidovb7d8bb12012-11-09 16:30:37 -0700209 /*
210 * Please keep I2C GPIOs drive-strength at minimum (2ma). It is a
211 * workaround for HW issue of glitches caused by rapid GPIO current-
212 * change.
213 */
214 .drv = GPIOMUX_DRV_2MA,
Jin Honga04caaa2012-05-23 10:28:27 -0700215 .pull = GPIOMUX_PULL_NONE,
216};
217
Chandan Uddaraju88b26d72012-08-13 22:28:44 -0700218static struct gpiomux_setting lcd_en_act_cfg = {
219 .func = GPIOMUX_FUNC_GPIO,
220 .drv = GPIOMUX_DRV_8MA,
221 .pull = GPIOMUX_PULL_NONE,
Siddhartha Agrawal6ab3e1c2013-02-22 18:30:37 -0800222 .dir = GPIOMUX_OUT_HIGH,
Chandan Uddaraju88b26d72012-08-13 22:28:44 -0700223};
224
225static struct gpiomux_setting lcd_en_sus_cfg = {
226 .func = GPIOMUX_FUNC_GPIO,
227 .drv = GPIOMUX_DRV_2MA,
228 .pull = GPIOMUX_PULL_DOWN,
229};
Sathish Ambleye3154b42012-04-09 10:59:09 -0700230
Amy Maloche9e99a792012-08-15 23:27:51 -0700231static struct gpiomux_setting atmel_resout_sus_cfg = {
232 .func = GPIOMUX_FUNC_GPIO,
233 .drv = GPIOMUX_DRV_6MA,
234 .pull = GPIOMUX_PULL_DOWN,
235};
236
237static struct gpiomux_setting atmel_resout_act_cfg = {
238 .func = GPIOMUX_FUNC_GPIO,
239 .drv = GPIOMUX_DRV_6MA,
240 .pull = GPIOMUX_PULL_UP,
241};
242
243static struct gpiomux_setting atmel_int_act_cfg = {
244 .func = GPIOMUX_FUNC_GPIO,
245 .drv = GPIOMUX_DRV_8MA,
246 .pull = GPIOMUX_PULL_UP,
247};
248
249static struct gpiomux_setting atmel_int_sus_cfg = {
250 .func = GPIOMUX_FUNC_GPIO,
251 .drv = GPIOMUX_DRV_2MA,
252 .pull = GPIOMUX_PULL_DOWN,
253};
254
Joonwoo Park187e9cb2012-08-24 22:47:53 -0700255static struct gpiomux_setting taiko_reset = {
256 .func = GPIOMUX_FUNC_GPIO,
257 .drv = GPIOMUX_DRV_6MA,
258 .pull = GPIOMUX_PULL_NONE,
259 .dir = GPIOMUX_OUT_LOW,
260};
261
Joonwoo Parkeb84dc72012-09-12 10:22:49 -0700262static struct gpiomux_setting taiko_int = {
263 .func = GPIOMUX_FUNC_GPIO,
264 .drv = GPIOMUX_DRV_2MA,
265 .pull = GPIOMUX_PULL_NONE,
266};
Amy Maloche527acc42012-12-07 18:40:54 -0800267static struct gpiomux_setting hap_lvl_shft_suspended_config = {
268 .func = GPIOMUX_FUNC_GPIO,
269 .drv = GPIOMUX_DRV_2MA,
270 .pull = GPIOMUX_PULL_DOWN,
271};
272
273static struct gpiomux_setting hap_lvl_shft_active_config = {
274 .func = GPIOMUX_FUNC_GPIO,
275 .drv = GPIOMUX_DRV_8MA,
276 .pull = GPIOMUX_PULL_UP,
277};
278static struct msm_gpiomux_config hap_lvl_shft_config[] __initdata = {
279 {
280 .gpio = 86,
281 .settings = {
282 [GPIOMUX_SUSPENDED] = &hap_lvl_shft_suspended_config,
283 [GPIOMUX_ACTIVE] = &hap_lvl_shft_active_config,
284 },
285 },
286};
Joonwoo Parkeb84dc72012-09-12 10:22:49 -0700287
Amy Maloche9e99a792012-08-15 23:27:51 -0700288static struct msm_gpiomux_config msm_touch_configs[] __initdata = {
289 {
290 .gpio = 60, /* TOUCH RESET */
291 .settings = {
292 [GPIOMUX_ACTIVE] = &atmel_resout_act_cfg,
293 [GPIOMUX_SUSPENDED] = &atmel_resout_sus_cfg,
294 },
295 },
296 {
297 .gpio = 61, /* TOUCH IRQ */
298 .settings = {
299 [GPIOMUX_ACTIVE] = &atmel_int_act_cfg,
300 [GPIOMUX_SUSPENDED] = &atmel_int_sus_cfg,
301 },
302 },
303
304};
Ujwal Patel74b5df42012-08-13 22:50:13 -0700305
Manu Gautamac7265b2012-11-21 11:49:15 +0530306static struct gpiomux_setting hsic_sus_cfg = {
307 .func = GPIOMUX_FUNC_GPIO,
308 .drv = GPIOMUX_DRV_2MA,
309 .pull = GPIOMUX_PULL_DOWN,
Manu Gautamac7265b2012-11-21 11:49:15 +0530310};
311
312static struct gpiomux_setting hsic_act_cfg = {
313 .func = GPIOMUX_FUNC_1,
314 .drv = GPIOMUX_DRV_12MA,
315 .pull = GPIOMUX_PULL_NONE,
316};
317
318static struct gpiomux_setting hsic_hub_act_cfg = {
319 .func = GPIOMUX_FUNC_GPIO,
320 .drv = GPIOMUX_DRV_2MA,
321 .pull = GPIOMUX_PULL_UP,
322 .dir = GPIOMUX_IN,
323};
324
Vamsi Krishnac6c16fe2013-03-11 15:54:41 -0700325static struct gpiomux_setting hsic_resume_act_cfg = {
326 .func = GPIOMUX_FUNC_GPIO,
327 .drv = GPIOMUX_DRV_2MA,
328 .pull = GPIOMUX_PULL_DOWN,
329 .dir = GPIOMUX_OUT_LOW,
330};
331
332static struct gpiomux_setting hsic_resume_susp_cfg = {
333 .func = GPIOMUX_FUNC_GPIO,
334 .drv = GPIOMUX_DRV_2MA,
335 .pull = GPIOMUX_PULL_NONE,
336};
337
Manu Gautamac7265b2012-11-21 11:49:15 +0530338static struct msm_gpiomux_config msm_hsic_configs[] = {
339 {
340 .gpio = 144, /*HSIC_STROBE */
341 .settings = {
342 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
343 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
344 },
345 },
346 {
347 .gpio = 145, /* HSIC_DATA */
348 .settings = {
349 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
350 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
351 },
352 },
Vamsi Krishnac6c16fe2013-03-11 15:54:41 -0700353 {
354 .gpio = 80,
355 .settings = {
356 [GPIOMUX_ACTIVE] = &hsic_resume_act_cfg,
357 [GPIOMUX_SUSPENDED] = &hsic_resume_susp_cfg,
358 },
359 },
Manu Gautamac7265b2012-11-21 11:49:15 +0530360};
361
362static struct msm_gpiomux_config msm_hsic_hub_configs[] = {
363 {
364 .gpio = 50, /* HSIC_HUB_INT_N */
365 .settings = {
366 [GPIOMUX_ACTIVE] = &hsic_hub_act_cfg,
367 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
368 },
369 },
370};
371
Manoj Rao5bf2a7e2012-10-29 12:53:27 -0700372static struct gpiomux_setting mhl_suspend_config = {
373 .func = GPIOMUX_FUNC_GPIO,
374 .drv = GPIOMUX_DRV_2MA,
375 .pull = GPIOMUX_PULL_DOWN,
376};
377
378static struct gpiomux_setting mhl_active_1_cfg = {
379 .func = GPIOMUX_FUNC_1,
380 .drv = GPIOMUX_DRV_2MA,
381 .pull = GPIOMUX_PULL_UP,
382 .dir = GPIOMUX_OUT_HIGH,
383};
384
Ujwal Patel74b5df42012-08-13 22:50:13 -0700385static struct gpiomux_setting hdmi_suspend_cfg = {
386 .func = GPIOMUX_FUNC_GPIO,
387 .drv = GPIOMUX_DRV_2MA,
388 .pull = GPIOMUX_PULL_DOWN,
389};
390
391static struct gpiomux_setting hdmi_active_1_cfg = {
392 .func = GPIOMUX_FUNC_1,
393 .drv = GPIOMUX_DRV_2MA,
394 .pull = GPIOMUX_PULL_UP,
395};
396
397static struct gpiomux_setting hdmi_active_2_cfg = {
398 .func = GPIOMUX_FUNC_1,
399 .drv = GPIOMUX_DRV_16MA,
400 .pull = GPIOMUX_PULL_DOWN,
401};
402
Manoj Rao5bf2a7e2012-10-29 12:53:27 -0700403static struct msm_gpiomux_config msm_mhl_configs[] __initdata = {
404 {
405 /* mhl-sii8334 pwr */
406 .gpio = 12,
407 .settings = {
408 [GPIOMUX_SUSPENDED] = &mhl_suspend_config,
409 [GPIOMUX_ACTIVE] = &mhl_active_1_cfg,
410 },
411 },
412 {
413 /* mhl-sii8334 intr */
414 .gpio = 82,
415 .settings = {
416 [GPIOMUX_SUSPENDED] = &mhl_suspend_config,
417 [GPIOMUX_ACTIVE] = &mhl_active_1_cfg,
418 },
419 },
Manoj Rao5bf2a7e2012-10-29 12:53:27 -0700420};
421
422
Ujwal Patel74b5df42012-08-13 22:50:13 -0700423static struct msm_gpiomux_config msm_hdmi_configs[] __initdata = {
424 {
425 .gpio = 31,
426 .settings = {
427 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
428 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
429 },
430 },
431 {
432 .gpio = 32,
433 .settings = {
434 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
435 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
436 },
437 },
438 {
439 .gpio = 33,
440 .settings = {
441 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
442 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
443 },
444 },
445 {
446 .gpio = 34,
447 .settings = {
448 [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg,
449 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
450 },
451 },
452};
453
Saket Saurabheac58342013-02-05 12:20:18 +0530454static struct gpiomux_setting gpio_uart7_active_cfg = {
455 .func = GPIOMUX_FUNC_3,
456 .drv = GPIOMUX_DRV_8MA,
457 .pull = GPIOMUX_PULL_NONE,
458};
459
460static struct gpiomux_setting gpio_uart7_suspend_cfg = {
461 .func = GPIOMUX_FUNC_GPIO,
462 .drv = GPIOMUX_DRV_2MA,
463 .pull = GPIOMUX_PULL_DOWN,
464};
465
466static struct msm_gpiomux_config msm_blsp2_uart7_configs[] __initdata = {
467 {
468 .gpio = 41, /* BLSP2 UART7 TX */
469 .settings = {
470 [GPIOMUX_ACTIVE] = &gpio_uart7_active_cfg,
471 [GPIOMUX_SUSPENDED] = &gpio_uart7_suspend_cfg,
472 },
473 },
474 {
475 .gpio = 42, /* BLSP2 UART7 RX */
476 .settings = {
477 [GPIOMUX_ACTIVE] = &gpio_uart7_active_cfg,
478 [GPIOMUX_SUSPENDED] = &gpio_uart7_suspend_cfg,
479 },
480 },
481 {
482 .gpio = 43, /* BLSP2 UART7 CTS */
483 .settings = {
484 [GPIOMUX_ACTIVE] = &gpio_uart7_active_cfg,
485 [GPIOMUX_SUSPENDED] = &gpio_uart7_suspend_cfg,
486 },
487 },
488 {
489 .gpio = 44, /* BLSP2 UART7 RFR */
490 .settings = {
491 [GPIOMUX_ACTIVE] = &gpio_uart7_active_cfg,
492 [GPIOMUX_SUSPENDED] = &gpio_uart7_suspend_cfg,
493 },
494 },
495};
496
Stepan Moskovchenko95108b82012-11-27 14:28:11 -0800497static struct msm_gpiomux_config msm_rumi_blsp_configs[] __initdata = {
498 {
499 .gpio = 45, /* BLSP2 UART8 TX */
500 .settings = {
501 [GPIOMUX_SUSPENDED] = &gpio_uart_config,
502 },
503 },
504 {
505 .gpio = 46, /* BLSP2 UART8 RX */
506 .settings = {
507 [GPIOMUX_SUSPENDED] = &gpio_uart_config,
508 },
509 },
510};
511
Siddhartha Agrawal6ab3e1c2013-02-22 18:30:37 -0800512static struct msm_gpiomux_config msm_lcd_configs[] __initdata = {
513 {
514 .gpio = 58,
515 .settings = {
516 [GPIOMUX_ACTIVE] = &lcd_en_act_cfg,
517 [GPIOMUX_SUSPENDED] = &lcd_en_sus_cfg,
518 },
519 },
520};
521
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700522static struct msm_gpiomux_config msm_blsp_configs[] __initdata = {
Sathish Ambleye3154b42012-04-09 10:59:09 -0700523#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
524 {
525 .gpio = 0, /* BLSP1 QUP SPI_DATA_MOSI */
526 .settings = {
527 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
528 },
529 },
530 {
531 .gpio = 1, /* BLSP1 QUP SPI_DATA_MISO */
532 .settings = {
533 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
534 },
535 },
536 {
537 .gpio = 3, /* BLSP1 QUP SPI_CLK */
538 .settings = {
539 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
540 },
541 },
542 {
Subbaraman Narayanamurthy3f93ab12012-08-17 19:39:47 -0700543 .gpio = 9, /* BLSP1 QUP SPI_CS2A_N */
Sathish Ambleye3154b42012-04-09 10:59:09 -0700544 .settings = {
Subbaraman Narayanamurthy3f93ab12012-08-17 19:39:47 -0700545 [GPIOMUX_SUSPENDED] = &gpio_spi_cs2_config,
546 },
547 },
548 {
549 .gpio = 8, /* BLSP1 QUP SPI_CS1_N */
550 .settings = {
551 [GPIOMUX_SUSPENDED] = &gpio_spi_cs1_config,
Sathish Ambleye3154b42012-04-09 10:59:09 -0700552 },
553 },
554#endif
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700555 {
Amy Malochebc7e9672012-08-15 10:30:40 -0700556 .gpio = 6, /* BLSP1 QUP2 I2C_DAT */
557 .settings = {
558 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
559 },
560 },
561 {
562 .gpio = 7, /* BLSP1 QUP2 I2C_CLK */
563 .settings = {
564 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
565 },
566 },
567 {
Jin Honga04caaa2012-05-23 10:28:27 -0700568 .gpio = 83, /* BLSP11 QUP I2C_DAT */
569 .settings = {
570 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
571 },
572 },
573 {
574 .gpio = 84, /* BLSP11 QUP I2C_CLK */
575 .settings = {
576 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
577 },
578 },
579 {
Stepan Moskovchenko5269b602012-08-08 17:57:09 -0700580 .gpio = 4, /* BLSP2 UART TX */
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700581 .settings = {
582 [GPIOMUX_SUSPENDED] = &gpio_uart_config,
583 },
584 },
585 {
Stepan Moskovchenko5269b602012-08-08 17:57:09 -0700586 .gpio = 5, /* BLSP2 UART RX */
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700587 .settings = {
588 [GPIOMUX_SUSPENDED] = &gpio_uart_config,
589 },
590 },
Sagar Dhariae0bb6502012-08-10 20:25:51 -0600591 {
592 .gpio = 53, /* BLSP2 QUP4 SPI_DATA_MOSI */
593 .settings = {
Pawan Kumar Nimmagaddabefacac2013-01-23 15:36:28 -0800594 [GPIOMUX_ACTIVE] = &gpio_spi_config,
595 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
Sagar Dhariae0bb6502012-08-10 20:25:51 -0600596 },
597 },
598 {
599 .gpio = 54, /* BLSP2 QUP4 SPI_DATA_MISO */
600 .settings = {
Pawan Kumar Nimmagaddabefacac2013-01-23 15:36:28 -0800601 [GPIOMUX_ACTIVE] = &gpio_spi_config,
602 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
Sagar Dhariae0bb6502012-08-10 20:25:51 -0600603 },
604 },
605 {
606 .gpio = 56, /* BLSP2 QUP4 SPI_CLK */
607 .settings = {
Pawan Kumar Nimmagaddabefacac2013-01-23 15:36:28 -0800608 [GPIOMUX_ACTIVE] = &gpio_spi_config,
609 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
Sagar Dhariae0bb6502012-08-10 20:25:51 -0600610 },
611 },
612 {
613 .gpio = 55, /* BLSP2 QUP4 SPI_CS0_N */
614 .settings = {
Pawan Kumar Nimmagaddabefacac2013-01-23 15:36:28 -0800615 [GPIOMUX_ACTIVE] = &gpio_spi_config,
616 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
Sagar Dhariae0bb6502012-08-10 20:25:51 -0600617 },
618 },
Siddartha Mohanadossc4bc6ae2012-12-06 14:22:22 -0800619 {
620 .gpio = 81, /* EPM enable */
621 .settings = {
622 [GPIOMUX_SUSPENDED] = &gpio_epm_config,
623 },
624 },
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700625};
626
Sagar Dhariaa8e6b0a2012-08-10 20:52:30 -0600627static struct msm_gpiomux_config msm8974_slimbus_config[] __initdata = {
628 {
629 .gpio = 70, /* slimbus clk */
630 .settings = {
631 [GPIOMUX_SUSPENDED] = &slimbus,
632 },
633 },
634 {
635 .gpio = 71, /* slimbus data */
636 .settings = {
637 [GPIOMUX_SUSPENDED] = &slimbus,
638 },
639 },
640};
641
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700642static struct gpiomux_setting cam_settings[] = {
643 {
Sreesudhan Ramakrish Ramkumar88c4a092012-09-07 23:43:46 -0700644 .func = GPIOMUX_FUNC_1, /*active 1*/ /* 0 */
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700645 .drv = GPIOMUX_DRV_2MA,
646 .pull = GPIOMUX_PULL_NONE,
647 },
648
649 {
Sreesudhan Ramakrish Ramkumar88c4a092012-09-07 23:43:46 -0700650 .func = GPIOMUX_FUNC_1, /*suspend*/ /* 1 */
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700651 .drv = GPIOMUX_DRV_2MA,
652 .pull = GPIOMUX_PULL_DOWN,
653 },
654
655 {
Sreesudhan Ramakrish Ramkumar88c4a092012-09-07 23:43:46 -0700656 .func = GPIOMUX_FUNC_1, /*i2c suspend*/ /* 2 */
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700657 .drv = GPIOMUX_DRV_2MA,
658 .pull = GPIOMUX_PULL_KEEPER,
659 },
Sreesudhan Ramakrish Ramkumar88c4a092012-09-07 23:43:46 -0700660
661 {
662 .func = GPIOMUX_FUNC_GPIO, /*active 0*/ /* 3 */
663 .drv = GPIOMUX_DRV_2MA,
664 .pull = GPIOMUX_PULL_NONE,
665 },
666
667 {
668 .func = GPIOMUX_FUNC_GPIO, /*suspend 0*/ /* 4 */
669 .drv = GPIOMUX_DRV_2MA,
670 .pull = GPIOMUX_PULL_DOWN,
671 },
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700672};
673
Subhash Jadavani77e6cd72013-01-15 18:44:51 +0530674static struct gpiomux_setting sd_card_det_active_config = {
Subhash Jadavani76aa7de2012-10-10 09:58:17 +0530675 .func = GPIOMUX_FUNC_GPIO,
676 .drv = GPIOMUX_DRV_2MA,
677 .pull = GPIOMUX_PULL_NONE,
678 .dir = GPIOMUX_IN,
679};
680
Subhash Jadavani77e6cd72013-01-15 18:44:51 +0530681static struct gpiomux_setting sd_card_det_sleep_config = {
682 .func = GPIOMUX_FUNC_GPIO,
683 .drv = GPIOMUX_DRV_2MA,
684 .pull = GPIOMUX_PULL_UP,
685 .dir = GPIOMUX_IN,
686};
687
Subhash Jadavani76aa7de2012-10-10 09:58:17 +0530688static struct msm_gpiomux_config sd_card_det __initdata = {
689 .gpio = 62,
690 .settings = {
Subhash Jadavani77e6cd72013-01-15 18:44:51 +0530691 [GPIOMUX_ACTIVE] = &sd_card_det_active_config,
692 [GPIOMUX_SUSPENDED] = &sd_card_det_sleep_config,
Subhash Jadavani76aa7de2012-10-10 09:58:17 +0530693 },
694};
695
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700696static struct msm_gpiomux_config msm_sensor_configs[] __initdata = {
697 {
698 .gpio = 15, /* CAM_MCLK0 */
699 .settings = {
700 [GPIOMUX_ACTIVE] = &cam_settings[0],
701 [GPIOMUX_SUSPENDED] = &cam_settings[1],
702 },
703 },
704 {
705 .gpio = 16, /* CAM_MCLK1 */
706 .settings = {
707 [GPIOMUX_ACTIVE] = &cam_settings[0],
708 [GPIOMUX_SUSPENDED] = &cam_settings[1],
709 },
710 },
711 {
712 .gpio = 17, /* CAM_MCLK2 */
713 .settings = {
714 [GPIOMUX_ACTIVE] = &cam_settings[0],
715 [GPIOMUX_SUSPENDED] = &cam_settings[1],
716 },
717 },
718 {
719 .gpio = 18, /* WEBCAM1_RESET_N / CAM_MCLK3 */
720 .settings = {
Sreesudhan Ramakrish Ramkumar88c4a092012-09-07 23:43:46 -0700721 [GPIOMUX_ACTIVE] = &cam_settings[3],
722 [GPIOMUX_SUSPENDED] = &cam_settings[4],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700723 },
724 },
725 {
726 .gpio = 19, /* CCI_I2C_SDA0 */
727 .settings = {
728 [GPIOMUX_ACTIVE] = &cam_settings[0],
Pawan Kumar Nimmagadda53621562013-01-28 13:11:44 -0800729 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700730 },
731 },
732 {
733 .gpio = 20, /* CCI_I2C_SCL0 */
734 .settings = {
735 [GPIOMUX_ACTIVE] = &cam_settings[0],
Pawan Kumar Nimmagadda53621562013-01-28 13:11:44 -0800736 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700737 },
738 },
739 {
740 .gpio = 21, /* CCI_I2C_SDA1 */
741 .settings = {
742 [GPIOMUX_ACTIVE] = &cam_settings[0],
Pawan Kumar Nimmagadda53621562013-01-28 13:11:44 -0800743 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700744 },
745 },
746 {
747 .gpio = 22, /* CCI_I2C_SCL1 */
748 .settings = {
749 [GPIOMUX_ACTIVE] = &cam_settings[0],
Pawan Kumar Nimmagadda53621562013-01-28 13:11:44 -0800750 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700751 },
752 },
753 {
754 .gpio = 23, /* FLASH_LED_EN */
755 .settings = {
756 [GPIOMUX_ACTIVE] = &cam_settings[0],
Pawan Kumar Nimmagadda53621562013-01-28 13:11:44 -0800757 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700758 },
759 },
760 {
761 .gpio = 24, /* FLASH_LED_NOW */
762 .settings = {
763 [GPIOMUX_ACTIVE] = &cam_settings[0],
Pawan Kumar Nimmagadda53621562013-01-28 13:11:44 -0800764 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700765 },
766 },
767 {
768 .gpio = 25, /* WEBCAM2_RESET_N */
769 .settings = {
Sreesudhan Ramakrish Ramkumara92d0b72013-03-12 23:39:07 -0700770 [GPIOMUX_ACTIVE] = &cam_settings[3],
Pawan Kumar Nimmagadda53621562013-01-28 13:11:44 -0800771 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700772 },
773 },
774 {
775 .gpio = 26, /* CAM_IRQ */
776 .settings = {
777 [GPIOMUX_ACTIVE] = &cam_settings[0],
778 [GPIOMUX_SUSPENDED] = &cam_settings[1],
779 },
780 },
781 {
782 .gpio = 27, /* OIS_SYNC */
783 .settings = {
784 [GPIOMUX_ACTIVE] = &cam_settings[0],
Pawan Kumar Nimmagadda53621562013-01-28 13:11:44 -0800785 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700786 },
787 },
788 {
789 .gpio = 28, /* WEBCAM1_STANDBY */
790 .settings = {
Sreesudhan Ramakrish Ramkumara92d0b72013-03-12 23:39:07 -0700791 [GPIOMUX_ACTIVE] = &cam_settings[3],
Pawan Kumar Nimmagadda53621562013-01-28 13:11:44 -0800792 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700793 },
794 },
795 {
796 .gpio = 89, /* CAM1_STANDBY_N */
797 .settings = {
Sreesudhan Ramakrish Ramkumara92d0b72013-03-12 23:39:07 -0700798 [GPIOMUX_ACTIVE] = &cam_settings[3],
799 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700800 },
801 },
802 {
803 .gpio = 90, /* CAM1_RST_N */
804 .settings = {
Sreesudhan Ramakrish Ramkumara92d0b72013-03-12 23:39:07 -0700805 [GPIOMUX_ACTIVE] = &cam_settings[3],
806 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700807 },
808 },
809 {
810 .gpio = 91, /* CAM2_STANDBY_N */
811 .settings = {
Sreesudhan Ramakrish Ramkumara92d0b72013-03-12 23:39:07 -0700812 [GPIOMUX_ACTIVE] = &cam_settings[3],
813 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700814 },
815 },
816 {
817 .gpio = 92, /* CAM2_RST_N */
818 .settings = {
Sreesudhan Ramakrish Ramkumara92d0b72013-03-12 23:39:07 -0700819 [GPIOMUX_ACTIVE] = &cam_settings[3],
820 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700821 },
822 },
823};
Damir Didjusto04d3c362013-01-07 14:30:53 -0800824
Banajit Goswami8521b122013-04-03 10:56:11 -0700825static struct gpiomux_setting auxpcm_act_cfg = {
Damir Didjusto04d3c362013-01-07 14:30:53 -0800826 .func = GPIOMUX_FUNC_1,
827 .drv = GPIOMUX_DRV_8MA,
828 .pull = GPIOMUX_PULL_NONE,
829};
830
831
Banajit Goswami8521b122013-04-03 10:56:11 -0700832static struct gpiomux_setting auxpcm_sus_cfg = {
Damir Didjusto04d3c362013-01-07 14:30:53 -0800833 .func = GPIOMUX_FUNC_1,
834 .drv = GPIOMUX_DRV_2MA,
835 .pull = GPIOMUX_PULL_DOWN,
836};
837
Banajit Goswamic8dcf0f2013-04-09 18:21:23 -0700838/* Primary AUXPCM port sharing GPIO lines with Primary MI2S */
839static struct msm_gpiomux_config msm8974_pri_pri_auxpcm_configs[] __initdata = {
Damir Didjusto04d3c362013-01-07 14:30:53 -0800840 {
841 .gpio = 65,
842 .settings = {
Banajit Goswami8521b122013-04-03 10:56:11 -0700843 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
844 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
Damir Didjusto04d3c362013-01-07 14:30:53 -0800845 },
846 },
847 {
848 .gpio = 66,
849 .settings = {
Banajit Goswami8521b122013-04-03 10:56:11 -0700850 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
851 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
Damir Didjusto04d3c362013-01-07 14:30:53 -0800852 },
853 },
854 {
855 .gpio = 67,
856 .settings = {
Banajit Goswami8521b122013-04-03 10:56:11 -0700857 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
858 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
Damir Didjusto04d3c362013-01-07 14:30:53 -0800859 },
860 },
861 {
862 .gpio = 68,
863 .settings = {
Banajit Goswami8521b122013-04-03 10:56:11 -0700864 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
865 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
866 },
867 },
868};
869
Banajit Goswamic8dcf0f2013-04-09 18:21:23 -0700870/* Primary AUXPCM port sharing GPIO lines with Tertiary MI2S */
871static struct msm_gpiomux_config msm8974_pri_ter_auxpcm_configs[] __initdata = {
872 {
873 .gpio = 74,
874 .settings = {
875 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
876 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
877 },
878 },
879 {
880 .gpio = 75,
881 .settings = {
882 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
883 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
884 },
885 },
886 {
887 .gpio = 76,
888 .settings = {
889 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
890 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
891 },
892 },
893 {
894 .gpio = 77,
895 .settings = {
896 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
897 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
898 },
899 },
900};
901
Banajit Goswami8521b122013-04-03 10:56:11 -0700902static struct msm_gpiomux_config msm8974_sec_auxpcm_configs[] __initdata = {
903 {
904 .gpio = 79,
905 .settings = {
906 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
907 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
908 },
909 },
910 {
911 .gpio = 80,
912 .settings = {
913 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
914 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
915 },
916 },
917 {
918 .gpio = 81,
919 .settings = {
920 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
921 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
922 },
923 },
924 {
925 .gpio = 82,
926 .settings = {
927 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
928 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
Damir Didjusto04d3c362013-01-07 14:30:53 -0800929 },
930 },
931};
932
Sameer Thalappil8d686d42012-08-24 10:07:31 -0700933static struct msm_gpiomux_config wcnss_5wire_interface[] = {
934 {
935 .gpio = 36,
936 .settings = {
937 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
938 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
939 },
940 },
941 {
942 .gpio = 37,
943 .settings = {
944 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
945 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
946 },
947 },
948 {
949 .gpio = 38,
950 .settings = {
951 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
952 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
953 },
954 },
955 {
956 .gpio = 39,
957 .settings = {
958 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
959 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
960 },
961 },
962 {
963 .gpio = 40,
964 .settings = {
965 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
966 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
967 },
968 },
969};
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700970
Ram Mohan Korukonda56ac5232013-03-20 23:48:34 +0530971
972static struct msm_gpiomux_config ath_gpio_configs[] = {
973 {
974 .gpio = 51,
975 .settings = {
976 [GPIOMUX_ACTIVE] = &ath_gpio_active_cfg,
977 [GPIOMUX_SUSPENDED] = &ath_gpio_suspend_cfg,
978 },
979 },
980 {
981 .gpio = 79,
982 .settings = {
983 [GPIOMUX_ACTIVE] = &ath_gpio_active_cfg,
984 [GPIOMUX_SUSPENDED] = &ath_gpio_suspend_cfg,
985 },
986 },
987};
988
Joonwoo Park187e9cb2012-08-24 22:47:53 -0700989static struct msm_gpiomux_config msm_taiko_config[] __initdata = {
990 {
991 .gpio = 63, /* SYS_RST_N */
992 .settings = {
993 [GPIOMUX_SUSPENDED] = &taiko_reset,
994 },
Joonwoo Parkeb84dc72012-09-12 10:22:49 -0700995 },
996 {
997 .gpio = 72, /* CDC_INT */
998 .settings = {
999 [GPIOMUX_SUSPENDED] = &taiko_int,
1000 },
1001 },
Joonwoo Park187e9cb2012-08-24 22:47:53 -07001002};
1003
Subhash Jadavani102f0ce2012-12-14 21:25:59 +05301004static struct gpiomux_setting sdc3_clk_actv_cfg = {
1005 .func = GPIOMUX_FUNC_2,
1006 .drv = GPIOMUX_DRV_8MA,
1007 .pull = GPIOMUX_PULL_NONE,
1008};
1009
1010static struct gpiomux_setting sdc3_cmd_data_0_3_actv_cfg = {
1011 .func = GPIOMUX_FUNC_2,
1012 .drv = GPIOMUX_DRV_8MA,
1013 .pull = GPIOMUX_PULL_UP,
1014};
1015
1016static struct gpiomux_setting sdc3_suspend_cfg = {
1017 .func = GPIOMUX_FUNC_GPIO,
1018 .drv = GPIOMUX_DRV_2MA,
1019 .pull = GPIOMUX_PULL_DOWN,
1020};
1021
1022static struct gpiomux_setting sdc3_data_1_suspend_cfg = {
1023 .func = GPIOMUX_FUNC_GPIO,
1024 .drv = GPIOMUX_DRV_8MA,
1025 .pull = GPIOMUX_PULL_UP,
1026};
1027
1028static struct msm_gpiomux_config msm8974_sdc3_configs[] __initdata = {
1029 {
1030 /* DAT3 */
1031 .gpio = 35,
1032 .settings = {
1033 [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
1034 [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
1035 },
1036 },
1037 {
1038 /* DAT2 */
1039 .gpio = 36,
1040 .settings = {
1041 [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
1042 [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
1043 },
1044 },
1045 {
1046 /* DAT1 */
1047 .gpio = 37,
1048 .settings = {
1049 [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
1050 [GPIOMUX_SUSPENDED] = &sdc3_data_1_suspend_cfg,
1051 },
1052 },
1053 {
1054 /* DAT0 */
1055 .gpio = 38,
1056 .settings = {
1057 [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
1058 [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
1059 },
1060 },
1061 {
1062 /* CMD */
1063 .gpio = 39,
1064 .settings = {
1065 [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
1066 [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
1067 },
1068 },
1069 {
1070 /* CLK */
1071 .gpio = 40,
1072 .settings = {
1073 [GPIOMUX_ACTIVE] = &sdc3_clk_actv_cfg,
1074 [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
1075 },
1076 },
1077};
1078
1079static void msm_gpiomux_sdc3_install(void)
1080{
1081 msm_gpiomux_install(msm8974_sdc3_configs,
1082 ARRAY_SIZE(msm8974_sdc3_configs));
1083}
Subhash Jadavani102f0ce2012-12-14 21:25:59 +05301084
1085#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
1086static struct gpiomux_setting sdc4_clk_actv_cfg = {
1087 .func = GPIOMUX_FUNC_2,
1088 .drv = GPIOMUX_DRV_8MA,
1089 .pull = GPIOMUX_PULL_NONE,
1090};
1091
1092static struct gpiomux_setting sdc4_cmd_data_0_3_actv_cfg = {
1093 .func = GPIOMUX_FUNC_2,
1094 .drv = GPIOMUX_DRV_8MA,
1095 .pull = GPIOMUX_PULL_UP,
1096};
1097
1098static struct gpiomux_setting sdc4_suspend_cfg = {
1099 .func = GPIOMUX_FUNC_GPIO,
1100 .drv = GPIOMUX_DRV_2MA,
1101 .pull = GPIOMUX_PULL_DOWN,
1102};
1103
1104static struct gpiomux_setting sdc4_data_1_suspend_cfg = {
1105 .func = GPIOMUX_FUNC_GPIO,
1106 .drv = GPIOMUX_DRV_8MA,
1107 .pull = GPIOMUX_PULL_UP,
1108};
1109
1110static struct msm_gpiomux_config msm8974_sdc4_configs[] __initdata = {
1111 {
1112 /* DAT3 */
1113 .gpio = 92,
1114 .settings = {
1115 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg,
1116 [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg,
1117 },
1118 },
1119 {
1120 /* DAT2 */
1121 .gpio = 94,
1122 .settings = {
1123 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg,
1124 [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg,
1125 },
1126 },
1127 {
1128 /* DAT1 */
1129 .gpio = 95,
1130 .settings = {
1131 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg,
1132 [GPIOMUX_SUSPENDED] = &sdc4_data_1_suspend_cfg,
1133 },
1134 },
1135 {
1136 /* DAT0 */
1137 .gpio = 96,
1138 .settings = {
1139 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg,
1140 [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg,
1141 },
1142 },
1143 {
1144 /* CMD */
1145 .gpio = 91,
1146 .settings = {
1147 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg,
1148 [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg,
1149 },
1150 },
1151 {
1152 /* CLK */
1153 .gpio = 93,
1154 .settings = {
1155 [GPIOMUX_ACTIVE] = &sdc4_clk_actv_cfg,
1156 [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg,
1157 },
1158 },
1159};
1160
1161static void msm_gpiomux_sdc4_install(void)
1162{
1163 msm_gpiomux_install(msm8974_sdc4_configs,
1164 ARRAY_SIZE(msm8974_sdc4_configs));
1165}
1166#else
1167static void msm_gpiomux_sdc4_install(void) {}
1168#endif /* CONFIG_MMC_MSM_SDC4_SUPPORT */
1169
Asaf Pensob8f00b72013-05-05 19:28:58 +03001170static struct msm_gpiomux_config apq8074_dragonboard_ts_config[] __initdata = {
1171 {
1172 /* BLSP1 QUP I2C_DATA */
1173 .gpio = 2,
1174 .settings = {
1175 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
1176 },
1177 },
1178 {
1179 /* BLSP1 QUP I2C_CLK */
1180 .gpio = 3,
1181 .settings = {
1182 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
1183 },
1184 },
1185};
1186
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -07001187void __init msm_8974_init_gpiomux(void)
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -07001188{
1189 int rc;
1190
Rohit Vaswani341c2032012-11-08 18:49:29 -08001191 rc = msm_gpiomux_init_dt();
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -07001192 if (rc) {
Rohit Vaswani341c2032012-11-08 18:49:29 -08001193 pr_err("%s failed %d\n", __func__, rc);
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -07001194 return;
1195 }
1196
Sathish Ambleye3154b42012-04-09 10:59:09 -07001197#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
1198 msm_gpiomux_install(msm_eth_configs, ARRAY_SIZE(msm_eth_configs));
1199#endif
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -07001200 msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));
Saket Saurabheac58342013-02-05 12:20:18 +05301201 msm_gpiomux_install(msm_blsp2_uart7_configs,
1202 ARRAY_SIZE(msm_blsp2_uart7_configs));
Sameer Thalappil8d686d42012-08-24 10:07:31 -07001203 msm_gpiomux_install(wcnss_5wire_interface,
1204 ARRAY_SIZE(wcnss_5wire_interface));
Ram Mohan Korukondaf0f07ec2013-04-13 10:26:11 -07001205 if (of_board_is_liquid())
1206 msm_gpiomux_install_nowrite(ath_gpio_configs,
1207 ARRAY_SIZE(ath_gpio_configs));
Sagar Dhariaa8e6b0a2012-08-10 20:52:30 -06001208 msm_gpiomux_install(msm8974_slimbus_config,
1209 ARRAY_SIZE(msm8974_slimbus_config));
1210
Amy Maloche9e99a792012-08-15 23:27:51 -07001211 msm_gpiomux_install(msm_touch_configs, ARRAY_SIZE(msm_touch_configs));
Amy Maloche527acc42012-12-07 18:40:54 -08001212 msm_gpiomux_install(hap_lvl_shft_config,
1213 ARRAY_SIZE(hap_lvl_shft_config));
Kevin Chanbdcf7ef2012-08-24 08:33:33 -07001214
1215 msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));
Joonwoo Park187e9cb2012-08-24 22:47:53 -07001216
Subhash Jadavani76aa7de2012-10-10 09:58:17 +05301217 msm_gpiomux_install(&sd_card_det, 1);
Ilia Lin7f527482013-05-21 13:59:48 +03001218
1219 if (machine_is_apq8074() && (of_board_is_liquid() || \
1220 of_board_is_dragonboard()))
1221 msm_gpiomux_sdc3_install();
1222
Subhash Jadavani102f0ce2012-12-14 21:25:59 +05301223 msm_gpiomux_sdc4_install();
Subhash Jadavani76aa7de2012-10-10 09:58:17 +05301224
Joonwoo Park187e9cb2012-08-24 22:47:53 -07001225 msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config));
Ujwal Patel74b5df42012-08-13 22:50:13 -07001226
Manu Gautamac7265b2012-11-21 11:49:15 +05301227 msm_gpiomux_install(msm_hsic_configs, ARRAY_SIZE(msm_hsic_configs));
1228 msm_gpiomux_install(msm_hsic_hub_configs,
1229 ARRAY_SIZE(msm_hsic_hub_configs));
1230
Ujwal Patel74b5df42012-08-13 22:50:13 -07001231 msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs));
Stepan Moskovchenko82f0eab2013-04-02 19:52:28 -07001232 if (of_board_is_fluid())
Stepan Moskovchenkoebd05412013-02-07 20:39:56 -08001233 msm_gpiomux_install(msm_mhl_configs,
1234 ARRAY_SIZE(msm_mhl_configs));
Stepan Moskovchenko95108b82012-11-27 14:28:11 -08001235
Banajit Goswamic8dcf0f2013-04-09 18:21:23 -07001236 if (of_board_is_liquid())
1237 msm_gpiomux_install(msm8974_pri_ter_auxpcm_configs,
1238 ARRAY_SIZE(msm8974_pri_ter_auxpcm_configs));
1239 else
1240 msm_gpiomux_install(msm8974_pri_pri_auxpcm_configs,
1241 ARRAY_SIZE(msm8974_pri_pri_auxpcm_configs));
1242
Banajit Goswami8521b122013-04-03 10:56:11 -07001243 msm_gpiomux_install(msm8974_sec_auxpcm_configs,
1244 ARRAY_SIZE(msm8974_sec_auxpcm_configs));
Damir Didjusto04d3c362013-01-07 14:30:53 -08001245
Siddhartha Agrawal6ab3e1c2013-02-22 18:30:37 -08001246 msm_gpiomux_install_nowrite(msm_lcd_configs,
1247 ARRAY_SIZE(msm_lcd_configs));
1248
Stepan Moskovchenko82f0eab2013-04-02 19:52:28 -07001249 if (of_board_is_rumi())
Stepan Moskovchenko95108b82012-11-27 14:28:11 -08001250 msm_gpiomux_install(msm_rumi_blsp_configs,
1251 ARRAY_SIZE(msm_rumi_blsp_configs));
Joel King15ccbfa2013-04-12 17:41:16 -07001252
1253 if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_MDM)
1254 msm_gpiomux_install(mdm_configs,
1255 ARRAY_SIZE(mdm_configs));
Asaf Pensob8f00b72013-05-05 19:28:58 +03001256
1257 if (of_board_is_dragonboard() && machine_is_apq8074())
1258 msm_gpiomux_install(apq8074_dragonboard_ts_config,
1259 ARRAY_SIZE(apq8074_dragonboard_ts_config));
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -07001260}