blob: 1c1944277edbd05acd671d07703ac36bd55ae658 [file] [log] [blame]
Stepan Moskovchenko5ea3c312012-01-31 18:19:40 -08001/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Stepan Moskovchenko2327a952011-12-14 16:31:28 -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 <linux/init.h>
15#include <linux/ioport.h>
16#include <linux/platform_device.h>
17#include <linux/bootmem.h>
Steve Mucklef132c6c2012-06-06 18:30:57 -070018#include <linux/gpio.h>
Stepan Moskovchenko2327a952011-12-14 16:31:28 -080019#include <asm/mach-types.h>
20#include <asm/mach/mmc.h>
21#include <mach/msm_bus_board.h>
22#include <mach/board.h>
Stepan Moskovchenko2327a952011-12-14 16:31:28 -080023#include <mach/gpiomux.h>
Joel Kingdacbc822012-01-25 13:30:57 -080024#include <mach/socinfo.h>
Stepan Moskovchenko2327a952011-12-14 16:31:28 -080025#include "devices.h"
26#include "board-8064.h"
27
28#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
29static struct gpiomux_setting gpio_eth_config = {
30 .pull = GPIOMUX_PULL_NONE,
31 .drv = GPIOMUX_DRV_8MA,
32 .func = GPIOMUX_FUNC_GPIO,
33};
34
35/* The SPI configurations apply to GSBI 5*/
36static struct gpiomux_setting gpio_spi_config = {
37 .func = GPIOMUX_FUNC_2,
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -080038 .drv = GPIOMUX_DRV_12MA,
Stepan Moskovchenko2327a952011-12-14 16:31:28 -080039 .pull = GPIOMUX_PULL_NONE,
40};
41
42/* The SPI configurations apply to GSBI 5 chip select 2*/
43static struct gpiomux_setting gpio_spi_cs2_config = {
44 .func = GPIOMUX_FUNC_3,
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -080045 .drv = GPIOMUX_DRV_12MA,
Stepan Moskovchenko2327a952011-12-14 16:31:28 -080046 .pull = GPIOMUX_PULL_NONE,
47};
48
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -080049/* Chip selects for SPI clients */
50static struct gpiomux_setting gpio_spi_cs_config = {
51 .func = GPIOMUX_FUNC_GPIO,
52 .drv = GPIOMUX_DRV_12MA,
53 .pull = GPIOMUX_PULL_UP,
54};
55
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -080056/* Chip selects for EPM SPI clients */
57static struct gpiomux_setting gpio_epm_spi_cs_config = {
Siddartha Mohanadoss52015a52012-05-09 21:44:58 -070058 .func = GPIOMUX_FUNC_6,
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -080059 .drv = GPIOMUX_DRV_12MA,
60 .pull = GPIOMUX_PULL_UP,
61};
62
Stepan Moskovchenko2327a952011-12-14 16:31:28 -080063struct msm_gpiomux_config apq8064_ethernet_configs[] = {
64 {
65 .gpio = 43,
66 .settings = {
67 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
68 [GPIOMUX_ACTIVE] = &gpio_eth_config,
69 }
70 },
71};
72#endif
73
Terence Hampson2e1705f2012-04-11 19:55:29 -040074#ifdef CONFIG_MSM_VCAP
75static struct gpiomux_setting gpio_vcap_config[] = {
76 {
77 .func = GPIOMUX_FUNC_GPIO,
78 .drv = GPIOMUX_DRV_2MA,
79 .pull = GPIOMUX_PULL_DOWN,
80 },
81 {
82 .func = GPIOMUX_FUNC_1,
83 .drv = GPIOMUX_DRV_2MA,
84 .pull = GPIOMUX_PULL_DOWN,
85 },
86 {
87 .func = GPIOMUX_FUNC_2,
88 .drv = GPIOMUX_DRV_2MA,
89 .pull = GPIOMUX_PULL_DOWN,
90 },
91 {
92 .func = GPIOMUX_FUNC_3,
93 .drv = GPIOMUX_DRV_2MA,
94 .pull = GPIOMUX_PULL_DOWN,
95 },
96 {
97 .func = GPIOMUX_FUNC_4,
98 .drv = GPIOMUX_DRV_2MA,
99 .pull = GPIOMUX_PULL_DOWN,
100 },
101 {
102 .func = GPIOMUX_FUNC_5,
103 .drv = GPIOMUX_DRV_2MA,
104 .pull = GPIOMUX_PULL_DOWN,
105 },
106 {
107 .func = GPIOMUX_FUNC_6,
108 .drv = GPIOMUX_DRV_2MA,
109 .pull = GPIOMUX_PULL_DOWN,
110 },
111 {
112 .func = GPIOMUX_FUNC_7,
113 .drv = GPIOMUX_DRV_2MA,
114 .pull = GPIOMUX_PULL_DOWN,
115 },
116 {
117 .func = GPIOMUX_FUNC_8,
118 .drv = GPIOMUX_DRV_2MA,
119 .pull = GPIOMUX_PULL_DOWN,
120 },
121 {
122 .func = GPIOMUX_FUNC_9,
123 .drv = GPIOMUX_DRV_2MA,
124 .pull = GPIOMUX_PULL_DOWN,
125 },
126 {
127 .func = GPIOMUX_FUNC_A,
128 .drv = GPIOMUX_DRV_2MA,
129 .pull = GPIOMUX_PULL_DOWN,
130 },
131};
132
133struct msm_gpiomux_config vcap_configs[] = {
134 {
135 .gpio = 20,
136 .settings = {
137 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[7],
138 [GPIOMUX_ACTIVE] = &gpio_vcap_config[7],
139 }
140 },
141 {
142 .gpio = 25,
143 .settings = {
144 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[2],
145 [GPIOMUX_ACTIVE] = &gpio_vcap_config[2],
146 }
147 },
148 {
149 .gpio = 24,
150 .settings = {
151 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[1],
152 [GPIOMUX_ACTIVE] = &gpio_vcap_config[1],
153 }
154 },
155 {
156 .gpio = 23,
157 .settings = {
158 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[2],
159 [GPIOMUX_ACTIVE] = &gpio_vcap_config[2],
160 }
161 },
162 {
163 .gpio = 19,
164 .settings = {
165 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[8],
166 [GPIOMUX_ACTIVE] = &gpio_vcap_config[8],
167 }
168 },
169 {
170 .gpio = 22,
171 .settings = {
172 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[2],
173 [GPIOMUX_ACTIVE] = &gpio_vcap_config[2],
174 }
175 },
176 {
177 .gpio = 21,
178 .settings = {
179 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[7],
180 [GPIOMUX_ACTIVE] = &gpio_vcap_config[7],
181 }
182 },
183 {
184 .gpio = 12,
185 .settings = {
186 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[6],
187 [GPIOMUX_ACTIVE] = &gpio_vcap_config[6],
188 }
189 },
190 {
191 .gpio = 18,
192 .settings = {
193 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[9],
194 [GPIOMUX_ACTIVE] = &gpio_vcap_config[9],
195 }
196 },
197 {
198 .gpio = 11,
199 .settings = {
200 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[10],
201 [GPIOMUX_ACTIVE] = &gpio_vcap_config[10],
202 }
203 },
204 {
205 .gpio = 10,
206 .settings = {
207 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[9],
208 [GPIOMUX_ACTIVE] = &gpio_vcap_config[9],
209 }
210 },
211 {
212 .gpio = 9,
213 .settings = {
214 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[2],
215 [GPIOMUX_ACTIVE] = &gpio_vcap_config[2],
216 }
217 },
218 {
219 .gpio = 26,
220 .settings = {
221 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[1],
222 [GPIOMUX_ACTIVE] = &gpio_vcap_config[1],
223 }
224 },
225 {
226 .gpio = 8,
227 .settings = {
228 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[3],
229 [GPIOMUX_ACTIVE] = &gpio_vcap_config[3],
230 }
231 },
232 {
233 .gpio = 7,
234 .settings = {
235 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[7],
236 [GPIOMUX_ACTIVE] = &gpio_vcap_config[7],
237 }
238 },
239 {
240 .gpio = 6,
241 .settings = {
242 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[7],
243 [GPIOMUX_ACTIVE] = &gpio_vcap_config[7],
244 }
245 },
246 {
247 .gpio = 80,
248 .settings = {
249 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[2],
250 [GPIOMUX_ACTIVE] = &gpio_vcap_config[2],
251 }
252 },
253 {
254 .gpio = 86,
255 .settings = {
256 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[1],
257 [GPIOMUX_ACTIVE] = &gpio_vcap_config[1],
258 }
259 },
260 {
261 .gpio = 85,
262 .settings = {
263 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[4],
264 [GPIOMUX_ACTIVE] = &gpio_vcap_config[4],
265 }
266 },
267 {
268 .gpio = 84,
269 .settings = {
270 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[3],
271 [GPIOMUX_ACTIVE] = &gpio_vcap_config[3],
272 }
273 },
274 {
275 .gpio = 5,
276 .settings = {
277 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[2],
278 [GPIOMUX_ACTIVE] = &gpio_vcap_config[2],
279 }
280 },
281 {
282 .gpio = 4,
283 .settings = {
284 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[3],
285 [GPIOMUX_ACTIVE] = &gpio_vcap_config[3],
286 }
287 },
288 {
289 .gpio = 3,
290 .settings = {
291 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[6],
292 [GPIOMUX_ACTIVE] = &gpio_vcap_config[6],
293 }
294 },
295 {
296 .gpio = 2,
297 .settings = {
298 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[5],
299 [GPIOMUX_ACTIVE] = &gpio_vcap_config[5],
300 }
301 },
302 {
303 .gpio = 82,
304 .settings = {
305 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[4],
306 [GPIOMUX_ACTIVE] = &gpio_vcap_config[4],
307 }
308 },
309 {
310 .gpio = 83,
311 .settings = {
312 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[4],
313 [GPIOMUX_ACTIVE] = &gpio_vcap_config[4],
314 }
315 },
316 {
317 .gpio = 87,
318 .settings = {
319 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[2],
320 [GPIOMUX_ACTIVE] = &gpio_vcap_config[2],
321 }
322 },
323 {
324 .gpio = 13,
325 .settings = {
326 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[6],
327 [GPIOMUX_ACTIVE] = &gpio_vcap_config[6],
328 }
329 },
330};
331#endif
332
David Keitel3c40fc52012-02-09 17:53:52 -0800333static struct gpiomux_setting gpio_i2c_config = {
334 .func = GPIOMUX_FUNC_1,
335 .drv = GPIOMUX_DRV_8MA,
336 .pull = GPIOMUX_PULL_NONE,
337};
338
339static struct gpiomux_setting gpio_i2c_config_sus = {
340 .func = GPIOMUX_FUNC_1,
341 .drv = GPIOMUX_DRV_2MA,
342 .pull = GPIOMUX_PULL_KEEPER,
343};
344
Joonwoo Parkca1516f2012-05-08 13:59:37 -0700345static struct gpiomux_setting mbhc_hs_detect = {
346 .func = GPIOMUX_FUNC_1,
347 .drv = GPIOMUX_DRV_2MA,
348 .pull = GPIOMUX_PULL_NONE,
349};
350
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800351static struct gpiomux_setting cdc_mclk = {
352 .func = GPIOMUX_FUNC_1,
353 .drv = GPIOMUX_DRV_8MA,
354 .pull = GPIOMUX_PULL_NONE,
355};
356
Ankit Verma6b7e2ba2012-01-26 15:48:54 -0800357static struct gpiomux_setting wcnss_5wire_suspend_cfg = {
358 .func = GPIOMUX_FUNC_GPIO,
359 .drv = GPIOMUX_DRV_2MA,
360 .pull = GPIOMUX_PULL_UP,
361};
362
363static struct gpiomux_setting wcnss_5wire_active_cfg = {
364 .func = GPIOMUX_FUNC_1,
365 .drv = GPIOMUX_DRV_6MA,
366 .pull = GPIOMUX_PULL_DOWN,
367};
368
369
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800370static struct gpiomux_setting slimbus = {
371 .func = GPIOMUX_FUNC_1,
372 .drv = GPIOMUX_DRV_8MA,
373 .pull = GPIOMUX_PULL_KEEPER,
374};
375
Stepan Moskovchenko5ea3c312012-01-31 18:19:40 -0800376static struct gpiomux_setting gsbi1_uart_config = {
377 .func = GPIOMUX_FUNC_1,
378 .drv = GPIOMUX_DRV_16MA,
379 .pull = GPIOMUX_PULL_NONE,
380};
381
David Collinsf0d00732012-01-25 15:46:50 -0800382static struct gpiomux_setting ext_regulator_config = {
383 .func = GPIOMUX_FUNC_GPIO,
384 .drv = GPIOMUX_DRV_8MA,
385 .pull = GPIOMUX_PULL_NONE,
386 .dir = GPIOMUX_OUT_LOW,
387};
388
Jin Hong4bbbfba2012-02-02 21:48:07 -0800389static struct gpiomux_setting gsbi7_func1_cfg = {
390 .func = GPIOMUX_FUNC_1,
391 .drv = GPIOMUX_DRV_8MA,
392 .pull = GPIOMUX_PULL_NONE,
393};
394
395static struct gpiomux_setting gsbi7_func2_cfg = {
396 .func = GPIOMUX_FUNC_2,
397 .drv = GPIOMUX_DRV_8MA,
398 .pull = GPIOMUX_PULL_NONE,
399};
400
Jing Lin04601f92012-02-05 15:36:07 -0800401static struct gpiomux_setting gsbi3_suspended_cfg = {
402 .func = GPIOMUX_FUNC_1,
403 .drv = GPIOMUX_DRV_2MA,
404 .pull = GPIOMUX_PULL_KEEPER,
405};
406
407static struct gpiomux_setting gsbi3_active_cfg = {
408 .func = GPIOMUX_FUNC_1,
409 .drv = GPIOMUX_DRV_8MA,
410 .pull = GPIOMUX_PULL_NONE,
411};
412
Aravind Venkateswaran0507c8c2012-02-16 17:16:05 -0800413static struct gpiomux_setting hdmi_suspend_cfg = {
414 .func = GPIOMUX_FUNC_GPIO,
415 .drv = GPIOMUX_DRV_2MA,
416 .pull = GPIOMUX_PULL_DOWN,
417};
418
419static struct gpiomux_setting hdmi_active_1_cfg = {
420 .func = GPIOMUX_FUNC_1,
421 .drv = GPIOMUX_DRV_2MA,
422 .pull = GPIOMUX_PULL_UP,
423};
424
425static struct gpiomux_setting hdmi_active_2_cfg = {
426 .func = GPIOMUX_FUNC_1,
427 .drv = GPIOMUX_DRV_16MA,
428 .pull = GPIOMUX_PULL_DOWN,
429};
430
Joel King8f839b92012-04-01 14:37:46 -0700431static struct gpiomux_setting gsbi5_suspended_cfg = {
432 .func = GPIOMUX_FUNC_2,
433 .drv = GPIOMUX_DRV_12MA,
434 .pull = GPIOMUX_PULL_NONE,
435};
436
437static struct gpiomux_setting gsbi5_active_cfg = {
438 .func = GPIOMUX_FUNC_2,
439 .drv = GPIOMUX_DRV_12MA,
440 .pull = GPIOMUX_PULL_NONE,
441};
Anirudh Ghayal9f1aaa72012-04-26 18:15:08 +0530442
443static struct gpiomux_setting sx150x_suspended_cfg = {
444 .func = GPIOMUX_FUNC_GPIO,
445 .drv = GPIOMUX_DRV_8MA,
446 .pull = GPIOMUX_PULL_NONE,
447};
448
449static struct gpiomux_setting sx150x_active_cfg = {
450 .func = GPIOMUX_FUNC_GPIO,
451 .drv = GPIOMUX_DRV_8MA,
452 .pull = GPIOMUX_PULL_NONE,
453};
454
Steve Mucklef132c6c2012-06-06 18:30:57 -0700455#ifdef CONFIG_USB_EHCI_MSM_HSIC
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -0800456static struct gpiomux_setting cyts_sleep_sus_cfg = {
457 .func = GPIOMUX_FUNC_GPIO,
458 .drv = GPIOMUX_DRV_6MA,
459 .pull = GPIOMUX_PULL_DOWN,
460};
461
462static struct gpiomux_setting cyts_sleep_act_cfg = {
463 .func = GPIOMUX_FUNC_GPIO,
464 .drv = GPIOMUX_DRV_6MA,
465 .pull = GPIOMUX_PULL_DOWN,
466};
467
468static struct gpiomux_setting cyts_int_act_cfg = {
469 .func = GPIOMUX_FUNC_GPIO,
470 .drv = GPIOMUX_DRV_8MA,
471 .pull = GPIOMUX_PULL_UP,
472};
473
474static struct gpiomux_setting cyts_int_sus_cfg = {
475 .func = GPIOMUX_FUNC_GPIO,
476 .drv = GPIOMUX_DRV_2MA,
477 .pull = GPIOMUX_PULL_DOWN,
478};
479
480static struct msm_gpiomux_config cyts_gpio_configs[] __initdata = {
481 { /* TS INTERRUPT */
482 .gpio = 6,
483 .settings = {
484 [GPIOMUX_ACTIVE] = &cyts_int_act_cfg,
485 [GPIOMUX_SUSPENDED] = &cyts_int_sus_cfg,
486 },
487 },
488 { /* TS SLEEP */
489 .gpio = 33,
490 .settings = {
491 [GPIOMUX_ACTIVE] = &cyts_sleep_act_cfg,
492 [GPIOMUX_SUSPENDED] = &cyts_sleep_sus_cfg,
493 },
494 },
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -0800495};
496
Amy Maloche9ba3ffe2012-04-26 10:31:20 -0700497static struct gpiomux_setting hsic_act_cfg = {
498 .func = GPIOMUX_FUNC_1,
499 .drv = GPIOMUX_DRV_8MA,
500 .pull = GPIOMUX_PULL_NONE,
501};
502
503static struct gpiomux_setting hsic_sus_cfg = {
504 .func = GPIOMUX_FUNC_GPIO,
505 .drv = GPIOMUX_DRV_2MA,
506 .pull = GPIOMUX_PULL_DOWN,
507 .dir = GPIOMUX_OUT_LOW,
508};
509
Hemant Kumar6fd65032012-05-23 13:02:24 -0700510static struct gpiomux_setting hsic_wakeup_act_cfg = {
511 .func = GPIOMUX_FUNC_GPIO,
512 .drv = GPIOMUX_DRV_8MA,
513 .pull = GPIOMUX_PULL_DOWN,
514 .dir = GPIOMUX_IN,
515};
516
517static struct gpiomux_setting hsic_wakeup_sus_cfg = {
518 .func = GPIOMUX_FUNC_GPIO,
519 .drv = GPIOMUX_DRV_2MA,
520 .pull = GPIOMUX_PULL_DOWN,
521 .dir = GPIOMUX_IN,
522};
Amy Maloche9ba3ffe2012-04-26 10:31:20 -0700523
Hemant Kumara945b472012-01-25 15:08:06 -0800524static struct msm_gpiomux_config apq8064_hsic_configs[] = {
525 {
526 .gpio = 88, /*HSIC_STROBE */
527 .settings = {
528 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
529 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
530 },
531 },
532 {
533 .gpio = 89, /* HSIC_DATA */
534 .settings = {
535 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
536 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
537 },
538 },
Hemant Kumar6fd65032012-05-23 13:02:24 -0700539 {
540 .gpio = 47, /* wake up */
541 .settings = {
542 [GPIOMUX_ACTIVE] = &hsic_wakeup_act_cfg,
543 [GPIOMUX_SUSPENDED] = &hsic_wakeup_sus_cfg,
544 },
545 },
Hemant Kumara945b472012-01-25 15:08:06 -0800546};
547#endif
548
Jing Lin21ed4de2012-02-05 15:53:28 -0800549static struct gpiomux_setting mxt_reset_sus_cfg = {
550 .func = GPIOMUX_FUNC_GPIO,
551 .drv = GPIOMUX_DRV_6MA,
552 .pull = GPIOMUX_PULL_DOWN,
553};
554
555static struct gpiomux_setting mxt_reset_act_cfg = {
556 .func = GPIOMUX_FUNC_GPIO,
557 .drv = GPIOMUX_DRV_6MA,
558 .pull = GPIOMUX_PULL_UP,
559};
560
561static struct gpiomux_setting mxt_int_sus_cfg = {
562 .func = GPIOMUX_FUNC_GPIO,
563 .drv = GPIOMUX_DRV_2MA,
564 .pull = GPIOMUX_PULL_DOWN,
565};
566
567static struct gpiomux_setting mxt_int_act_cfg = {
568 .func = GPIOMUX_FUNC_GPIO,
569 .drv = GPIOMUX_DRV_8MA,
570 .pull = GPIOMUX_PULL_UP,
571};
572
Aravind Venkateswaran0507c8c2012-02-16 17:16:05 -0800573static struct msm_gpiomux_config apq8064_hdmi_configs[] __initdata = {
574 {
575 .gpio = 69,
576 .settings = {
577 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
578 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
579 },
580 },
581 {
582 .gpio = 70,
583 .settings = {
584 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
585 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
586 },
587 },
588 {
589 .gpio = 71,
590 .settings = {
591 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
592 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
593 },
594 },
595 {
596 .gpio = 72,
597 .settings = {
598 [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg,
599 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
600 },
601 },
602};
603
Stepan Moskovchenko2327a952011-12-14 16:31:28 -0800604static struct msm_gpiomux_config apq8064_gsbi_configs[] __initdata = {
Stepan Moskovchenko5ea3c312012-01-31 18:19:40 -0800605 {
Jing Lin04601f92012-02-05 15:36:07 -0800606 .gpio = 8, /* GSBI3 I2C QUP SDA */
607 .settings = {
608 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
609 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
610 },
611 },
612 {
613 .gpio = 9, /* GSBI3 I2C QUP SCL */
614 .settings = {
615 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
616 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
617 },
618 },
619 {
Stepan Moskovchenko5ea3c312012-01-31 18:19:40 -0800620 .gpio = 18, /* GSBI1 UART TX */
621 .settings = {
622 [GPIOMUX_SUSPENDED] = &gsbi1_uart_config,
623 },
624 },
625 {
626 .gpio = 19, /* GSBI1 UART RX */
627 .settings = {
628 [GPIOMUX_SUSPENDED] = &gsbi1_uart_config,
629 },
630 },
Stepan Moskovchenko2327a952011-12-14 16:31:28 -0800631#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
632 {
633 .gpio = 51, /* GSBI5 QUP SPI_DATA_MOSI */
634 .settings = {
635 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
636 },
637 },
638 {
639 .gpio = 52, /* GSBI5 QUP SPI_DATA_MISO */
640 .settings = {
641 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
642 },
643 },
644 {
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -0800645 .gpio = 53, /* Funny CS0 */
646 .settings = {
647 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
648 },
649 },
650 {
Stepan Moskovchenko2327a952011-12-14 16:31:28 -0800651 .gpio = 31, /* GSBI5 QUP SPI_CS2_N */
652 .settings = {
653 [GPIOMUX_SUSPENDED] = &gpio_spi_cs2_config,
654 },
655 },
656 {
657 .gpio = 54, /* GSBI5 QUP SPI_CLK */
658 .settings = {
659 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
660 },
661 },
662#endif
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -0800663 {
664 .gpio = 30, /* FP CS */
665 .settings = {
666 [GPIOMUX_SUSPENDED] = &gpio_spi_cs_config,
667 },
668 },
669 {
670 .gpio = 32, /* EPM CS */
671 .settings = {
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -0800672 [GPIOMUX_SUSPENDED] = &gpio_epm_spi_cs_config,
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -0800673 },
674 },
675 {
676 .gpio = 53, /* NOR CS */
677 .settings = {
678 [GPIOMUX_SUSPENDED] = &gpio_spi_cs_config,
679 },
680 },
Jin Hong4bbbfba2012-02-02 21:48:07 -0800681 {
682 .gpio = 82, /* GSBI7 UART2 TX */
683 .settings = {
684 [GPIOMUX_SUSPENDED] = &gsbi7_func2_cfg,
685 },
686 },
687 {
688 .gpio = 83, /* GSBI7 UART2 RX */
689 .settings = {
690 [GPIOMUX_SUSPENDED] = &gsbi7_func1_cfg,
691 },
692 },
David Keitel3c40fc52012-02-09 17:53:52 -0800693 {
694 .gpio = 21, /* GSBI1 QUP I2C_CLK */
695 .settings = {
696 [GPIOMUX_SUSPENDED] = &gpio_i2c_config_sus,
697 [GPIOMUX_ACTIVE] = &gpio_i2c_config,
698 },
699 },
700 {
701 .gpio = 20, /* GSBI1 QUP I2C_DATA */
702 .settings = {
703 [GPIOMUX_SUSPENDED] = &gpio_i2c_config_sus,
704 [GPIOMUX_ACTIVE] = &gpio_i2c_config,
705 },
706 },
Stepan Moskovchenko2327a952011-12-14 16:31:28 -0800707};
708
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800709static struct msm_gpiomux_config apq8064_slimbus_config[] __initdata = {
710 {
711 .gpio = 40, /* slimbus clk */
712 .settings = {
713 [GPIOMUX_SUSPENDED] = &slimbus,
714 },
715 },
716 {
717 .gpio = 41, /* slimbus data */
718 .settings = {
719 [GPIOMUX_SUSPENDED] = &slimbus,
720 },
721 },
722};
723
Santosh Mardieff9a742012-04-09 23:23:39 +0530724static struct gpiomux_setting spkr_i2c = {
725 .func = GPIOMUX_FUNC_1,
726 .drv = GPIOMUX_DRV_8MA,
727 .pull = GPIOMUX_PULL_KEEPER,
728};
729
730static struct msm_gpiomux_config mpq8064_spkr_i2s_config[] __initdata = {
731 {
732 .gpio = 47, /* spkr i2c sck */
733 .settings = {
734 [GPIOMUX_SUSPENDED] = &spkr_i2c,
735 },
736 },
737 {
738 .gpio = 48, /* spkr_i2s_ws */
739 .settings = {
740 [GPIOMUX_SUSPENDED] = &spkr_i2c,
741 },
742 },
743 {
744 .gpio = 49, /* spkr_i2s_dout */
745 .settings = {
746 [GPIOMUX_SUSPENDED] = &spkr_i2c,
747 },
748 },
749 {
750 .gpio = 50, /* spkr_i2s_mclk */
751 .settings = {
752 [GPIOMUX_SUSPENDED] = &spkr_i2c,
753 },
754 },
755};
756
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800757static struct msm_gpiomux_config apq8064_audio_codec_configs[] __initdata = {
758 {
Joonwoo Parkca1516f2012-05-08 13:59:37 -0700759 .gpio = 38,
760 .settings = {
761 [GPIOMUX_SUSPENDED] = &mbhc_hs_detect,
762 },
763 },
764 {
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800765 .gpio = 39,
766 .settings = {
767 [GPIOMUX_SUSPENDED] = &cdc_mclk,
768 },
769 },
770};
771
David Collinsf0d00732012-01-25 15:46:50 -0800772/* External 3.3 V regulator enable */
773static struct msm_gpiomux_config apq8064_ext_regulator_configs[] __initdata = {
774 {
775 .gpio = APQ8064_EXT_3P3V_REG_EN_GPIO,
776 .settings = {
777 [GPIOMUX_SUSPENDED] = &ext_regulator_config,
778 },
779 },
780};
781
Joel Kingdacbc822012-01-25 13:30:57 -0800782static struct gpiomux_setting ap2mdm_cfg = {
783 .func = GPIOMUX_FUNC_GPIO,
784 .drv = GPIOMUX_DRV_8MA,
785 .pull = GPIOMUX_PULL_DOWN,
786};
787
788static struct gpiomux_setting mdm2ap_status_cfg = {
789 .func = GPIOMUX_FUNC_GPIO,
790 .drv = GPIOMUX_DRV_8MA,
791 .pull = GPIOMUX_PULL_NONE,
792};
793
794static struct gpiomux_setting mdm2ap_errfatal_cfg = {
795 .func = GPIOMUX_FUNC_GPIO,
796 .drv = GPIOMUX_DRV_16MA,
797 .pull = GPIOMUX_PULL_DOWN,
798};
799
Vamsi Krishnac6dcd5e2012-05-09 15:38:01 -0700800static struct gpiomux_setting mdm2ap_pblrdy = {
801 .func = GPIOMUX_FUNC_GPIO,
802 .drv = GPIOMUX_DRV_16MA,
803 .pull = GPIOMUX_PULL_DOWN,
804};
805
806
Joel King14fe7fa2012-05-27 14:26:11 -0700807static struct gpiomux_setting ap2mdm_soft_reset_cfg = {
Joel Kingdacbc822012-01-25 13:30:57 -0800808 .func = GPIOMUX_FUNC_GPIO,
809 .drv = GPIOMUX_DRV_8MA,
810 .pull = GPIOMUX_PULL_DOWN,
811};
812
Vamsi Krishna9e307cd2012-04-11 13:15:36 -0700813static struct gpiomux_setting ap2mdm_wakeup = {
814 .func = GPIOMUX_FUNC_GPIO,
815 .drv = GPIOMUX_DRV_8MA,
816 .pull = GPIOMUX_PULL_DOWN,
817};
818
Joel Kingdacbc822012-01-25 13:30:57 -0800819static struct msm_gpiomux_config mdm_configs[] __initdata = {
820 /* AP2MDM_STATUS */
821 {
822 .gpio = 48,
823 .settings = {
824 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
825 }
826 },
827 /* MDM2AP_STATUS */
828 {
829 .gpio = 49,
830 .settings = {
831 [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
832 }
833 },
834 /* MDM2AP_ERRFATAL */
835 {
836 .gpio = 19,
837 .settings = {
838 [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
839 }
840 },
841 /* AP2MDM_ERRFATAL */
842 {
843 .gpio = 18,
844 .settings = {
845 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
846 }
847 },
Joel King14fe7fa2012-05-27 14:26:11 -0700848 /* AP2MDM_SOFT_RESET, aka AP2MDM_PON_RESET_N */
Joel Kingdacbc822012-01-25 13:30:57 -0800849 {
850 .gpio = 27,
851 .settings = {
Joel King14fe7fa2012-05-27 14:26:11 -0700852 [GPIOMUX_SUSPENDED] = &ap2mdm_soft_reset_cfg,
Joel Kingdacbc822012-01-25 13:30:57 -0800853 }
Mohan Pallaka474b94b2012-01-25 12:59:58 +0530854 },
Vamsi Krishna9e307cd2012-04-11 13:15:36 -0700855 /* AP2MDM_WAKEUP */
856 {
857 .gpio = 35,
858 .settings = {
859 [GPIOMUX_SUSPENDED] = &ap2mdm_wakeup,
860 }
861 },
Vamsi Krishnac6dcd5e2012-05-09 15:38:01 -0700862 /* MDM2AP_PBL_READY*/
863 {
864 .gpio = 46,
865 .settings = {
866 [GPIOMUX_SUSPENDED] = &mdm2ap_pblrdy,
867 }
868 },
Mohan Pallaka474b94b2012-01-25 12:59:58 +0530869};
870
Kuirong Wangf23f8c52012-03-31 12:34:51 -0700871static struct gpiomux_setting mi2s_act_cfg = {
872 .func = GPIOMUX_FUNC_1,
873 .drv = GPIOMUX_DRV_8MA,
874 .pull = GPIOMUX_PULL_NONE,
875};
876
877static struct gpiomux_setting mi2s_sus_cfg = {
878 .func = GPIOMUX_FUNC_GPIO,
879 .drv = GPIOMUX_DRV_2MA,
880 .pull = GPIOMUX_PULL_DOWN,
881};
882
883static struct msm_gpiomux_config mpq8064_mi2s_configs[] __initdata = {
884 {
885 .gpio = 27, /* mi2s ws */
886 .settings = {
887 [GPIOMUX_ACTIVE] = &mi2s_act_cfg,
888 [GPIOMUX_SUSPENDED] = &mi2s_sus_cfg,
889 },
890 },
891 {
892 .gpio = 28, /* mi2s sclk */
893 .settings = {
894 [GPIOMUX_ACTIVE] = &mi2s_act_cfg,
895 [GPIOMUX_SUSPENDED] = &mi2s_sus_cfg,
896 },
897 },
898 {
899 .gpio = 29, /* mi2s dout3 */
900 .settings = {
901 [GPIOMUX_ACTIVE] = &mi2s_act_cfg,
902 [GPIOMUX_SUSPENDED] = &mi2s_sus_cfg,
903 },
904 },
905 {
906 .gpio = 30, /* mi2s dout2 */
907 .settings = {
908 [GPIOMUX_ACTIVE] = &mi2s_act_cfg,
909 [GPIOMUX_SUSPENDED] = &mi2s_sus_cfg,
910 },
911 },
912
913 {
914 .gpio = 31, /* mi2s dout1 */
915 .settings = {
916 [GPIOMUX_ACTIVE] = &mi2s_act_cfg,
917 [GPIOMUX_SUSPENDED] = &mi2s_sus_cfg,
918 },
919 },
920 {
921 .gpio = 32, /* mi2s dout0 */
922 .settings = {
923 [GPIOMUX_ACTIVE] = &mi2s_act_cfg,
924 [GPIOMUX_SUSPENDED] = &mi2s_sus_cfg,
925 },
926 },
927
928 {
929 .gpio = 33, /* mi2s mclk */
930 .settings = {
931 [GPIOMUX_ACTIVE] = &mi2s_act_cfg,
932 [GPIOMUX_SUSPENDED] = &mi2s_sus_cfg,
933 },
934 },
935};
Jing Lin21ed4de2012-02-05 15:53:28 -0800936static struct msm_gpiomux_config apq8064_mxt_configs[] __initdata = {
937 { /* TS INTERRUPT */
938 .gpio = 6,
939 .settings = {
940 [GPIOMUX_ACTIVE] = &mxt_int_act_cfg,
941 [GPIOMUX_SUSPENDED] = &mxt_int_sus_cfg,
942 },
943 },
944 { /* TS RESET */
945 .gpio = 33,
946 .settings = {
947 [GPIOMUX_ACTIVE] = &mxt_reset_act_cfg,
948 [GPIOMUX_SUSPENDED] = &mxt_reset_sus_cfg,
949 },
950 },
951};
952
Ankit Verma6b7e2ba2012-01-26 15:48:54 -0800953static struct msm_gpiomux_config wcnss_5wire_interface[] = {
954 {
955 .gpio = 64,
956 .settings = {
957 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
958 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
959 },
960 },
961 {
962 .gpio = 65,
963 .settings = {
964 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
965 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
966 },
967 },
968 {
969 .gpio = 66,
970 .settings = {
971 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
972 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
973 },
974 },
975 {
976 .gpio = 67,
977 .settings = {
978 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
979 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
980 },
981 },
982 {
983 .gpio = 68,
984 .settings = {
985 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
986 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
987 },
988 },
989};
990
Joel King8f839b92012-04-01 14:37:46 -0700991static struct msm_gpiomux_config mpq8064_gsbi5_i2c_configs[] __initdata = {
992 {
993 .gpio = 53, /* GSBI5 I2C QUP SDA */
994 .settings = {
995 [GPIOMUX_SUSPENDED] = &gsbi5_suspended_cfg,
996 [GPIOMUX_ACTIVE] = &gsbi5_active_cfg,
997 },
998 },
999 {
1000 .gpio = 54, /* GSBI5 I2C QUP SCL */
1001 .settings = {
1002 [GPIOMUX_SUSPENDED] = &gsbi5_suspended_cfg,
1003 [GPIOMUX_ACTIVE] = &gsbi5_active_cfg,
1004 },
1005 },
1006};
1007
Ravi Kumar V05931a22012-04-04 17:09:37 +05301008static struct gpiomux_setting ir_suspended_cfg = {
1009 .func = GPIOMUX_FUNC_GPIO,
1010 .drv = GPIOMUX_DRV_2MA,
1011 .pull = GPIOMUX_PULL_UP,
1012};
1013
1014static struct gpiomux_setting ir_active_cfg = {
1015 .func = GPIOMUX_FUNC_GPIO,
1016 .drv = GPIOMUX_DRV_8MA,
1017 .pull = GPIOMUX_PULL_UP,
1018};
1019
1020static struct msm_gpiomux_config mpq8064_ir_configs[] __initdata = {
1021 {
1022 .gpio = 88, /* GPIO IR */
1023 .settings = {
1024 [GPIOMUX_SUSPENDED] = &ir_suspended_cfg,
1025 [GPIOMUX_ACTIVE] = &ir_active_cfg,
1026 },
1027 },
1028};
1029
Anirudh Ghayal9f1aaa72012-04-26 18:15:08 +05301030static struct msm_gpiomux_config sx150x_int_configs[] __initdata = {
1031 {
1032 .gpio = 81,
1033 .settings = {
1034 [GPIOMUX_SUSPENDED] = &sx150x_suspended_cfg,
1035 [GPIOMUX_ACTIVE] = &sx150x_active_cfg,
1036 },
1037 },
1038};
1039
Oluwafemi Adeyemia46d0322012-05-16 18:27:44 -07001040#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
1041static struct gpiomux_setting sdc2_clk_active_cfg = {
1042 .func = GPIOMUX_FUNC_2,
1043 .drv = GPIOMUX_DRV_8MA,
1044 .pull = GPIOMUX_PULL_NONE,
1045};
1046
1047static struct gpiomux_setting sdc2_cmd_data_0_3_active_cfg = {
1048 .func = GPIOMUX_FUNC_2,
1049 .drv = GPIOMUX_DRV_8MA,
1050 .pull = GPIOMUX_PULL_UP,
1051};
1052
1053static struct gpiomux_setting sdc2_suspended_cfg = {
1054 .func = GPIOMUX_FUNC_GPIO,
1055 .drv = GPIOMUX_DRV_2MA,
1056 .pull = GPIOMUX_PULL_DOWN,
1057};
1058
1059static struct gpiomux_setting sdc2_data_1_suspended_cfg = {
1060 .func = GPIOMUX_FUNC_GPIO,
1061 .drv = GPIOMUX_DRV_2MA,
1062 .pull = GPIOMUX_PULL_UP,
1063};
1064
1065static struct msm_gpiomux_config apq8064_sdc2_configs[] __initdata = {
1066 {
1067 .gpio = 59,
1068 .settings = {
1069 [GPIOMUX_ACTIVE] = &sdc2_clk_active_cfg,
1070 [GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
1071 },
1072 },
1073 {
1074 .gpio = 57,
1075 .settings = {
1076 [GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
1077 [GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
1078 },
1079
1080 },
1081 {
1082 .gpio = 62,
1083 .settings = {
1084 [GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
1085 [GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
1086 },
1087 },
1088 {
1089 .gpio = 61,
1090 .settings = {
1091 [GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
1092 [GPIOMUX_SUSPENDED] = &sdc2_data_1_suspended_cfg,
1093 },
1094 },
1095 {
1096 .gpio = 60,
1097 .settings = {
1098 [GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
1099 [GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
1100 },
1101 },
1102 {
1103 .gpio = 58,
1104 .settings = {
1105 [GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
1106 [GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
1107 },
1108 },
1109};
1110#endif
1111
1112
1113#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
1114static struct gpiomux_setting sdc4_clk_active_cfg = {
1115 .func = GPIOMUX_FUNC_2,
1116 .drv = GPIOMUX_DRV_8MA,
1117 .pull = GPIOMUX_PULL_NONE,
1118};
1119
1120static struct gpiomux_setting sdc4_cmd_data_0_3_active_cfg = {
1121 .func = GPIOMUX_FUNC_2,
1122 .drv = GPIOMUX_DRV_8MA,
1123 .pull = GPIOMUX_PULL_UP,
1124};
1125
1126static struct gpiomux_setting sdc4_suspended_cfg = {
1127 .func = GPIOMUX_FUNC_GPIO,
1128 .drv = GPIOMUX_DRV_2MA,
1129 .pull = GPIOMUX_PULL_DOWN,
1130};
1131
1132static struct gpiomux_setting sdc4_data_1_suspended_cfg = {
1133 .func = GPIOMUX_FUNC_GPIO,
1134 .drv = GPIOMUX_DRV_2MA,
1135 .pull = GPIOMUX_PULL_UP,
1136};
1137
1138static struct msm_gpiomux_config apq8064_sdc4_configs[] __initdata = {
1139 {
1140 .gpio = 68,
1141 .settings = {
1142 [GPIOMUX_ACTIVE] = &sdc4_clk_active_cfg,
1143 [GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
1144 },
1145 },
1146 {
1147 .gpio = 67,
1148 .settings = {
1149 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
1150 [GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
1151 },
1152
1153 },
1154 {
1155 .gpio = 66,
1156 .settings = {
1157 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
1158 [GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
1159 },
1160 },
1161 {
1162 .gpio = 65,
1163 .settings = {
1164 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
1165 [GPIOMUX_SUSPENDED] = &sdc4_data_1_suspended_cfg,
1166 },
1167 },
1168 {
1169 .gpio = 64,
1170 .settings = {
1171 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
1172 [GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
1173 },
1174 },
1175 {
1176 .gpio = 63,
1177 .settings = {
1178 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
1179 [GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
1180 },
1181 },
1182};
1183#endif
1184
Oluwafemi Adeyemi9aff26c2012-06-26 17:28:21 -07001185static struct gpiomux_setting apq8064_sdc3_card_det_cfg = {
1186 .func = GPIOMUX_FUNC_GPIO,
1187 .drv = GPIOMUX_DRV_2MA,
1188 .pull = GPIOMUX_PULL_UP,
1189};
1190
1191static struct msm_gpiomux_config apq8064_sdc3_configs[] __initdata = {
1192 {
1193 .gpio = 26,
1194 .settings = {
1195 [GPIOMUX_SUSPENDED] = &apq8064_sdc3_card_det_cfg,
1196 [GPIOMUX_ACTIVE] = &apq8064_sdc3_card_det_cfg,
1197 },
1198 },
1199};
1200
Stepan Moskovchenko2327a952011-12-14 16:31:28 -08001201void __init apq8064_init_gpiomux(void)
1202{
1203 int rc;
1204
1205 rc = msm_gpiomux_init(NR_GPIO_IRQS);
1206 if (rc) {
1207 pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
1208 return;
1209 }
1210
Ankit Verma6b7e2ba2012-01-26 15:48:54 -08001211 msm_gpiomux_install(wcnss_5wire_interface,
1212 ARRAY_SIZE(wcnss_5wire_interface));
1213
Joel King8f839b92012-04-01 14:37:46 -07001214 if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
1215 machine_is_mpq8064_dtv()) {
1216 msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
1217 ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
Terence Hampson2e1705f2012-04-11 19:55:29 -04001218#ifdef CONFIG_MSM_VCAP
1219 msm_gpiomux_install(vcap_configs,
1220 ARRAY_SIZE(vcap_configs));
1221#endif
Anirudh Ghayal9f1aaa72012-04-26 18:15:08 +05301222 msm_gpiomux_install(sx150x_int_configs,
1223 ARRAY_SIZE(sx150x_int_configs));
Joel King8f839b92012-04-01 14:37:46 -07001224 } else {
1225 #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
1226 msm_gpiomux_install(apq8064_ethernet_configs,
1227 ARRAY_SIZE(apq8064_ethernet_configs));
1228 #endif
1229
1230 msm_gpiomux_install(apq8064_gsbi_configs,
1231 ARRAY_SIZE(apq8064_gsbi_configs));
1232 }
Stepan Moskovchenko2327a952011-12-14 16:31:28 -08001233
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08001234 msm_gpiomux_install(apq8064_slimbus_config,
1235 ARRAY_SIZE(apq8064_slimbus_config));
1236
1237 msm_gpiomux_install(apq8064_audio_codec_configs,
1238 ARRAY_SIZE(apq8064_audio_codec_configs));
1239
Santosh Mardieff9a742012-04-09 23:23:39 +05301240 if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
1241 machine_is_mpq8064_dtv()) {
1242 msm_gpiomux_install(mpq8064_spkr_i2s_config,
1243 ARRAY_SIZE(mpq8064_spkr_i2s_config));
1244 }
1245
Swaminathan Sathappan9e07aa92012-02-29 12:07:27 -08001246 pr_debug("%s(): audio-auxpcm: Include GPIO configs"
1247 " as audio is not the primary user"
1248 " for these GPIO Pins\n", __func__);
David Collinsf0d00732012-01-25 15:46:50 -08001249
Kuirong Wangf23f8c52012-03-31 12:34:51 -07001250 if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
1251 machine_is_mpq8064_dtv())
1252 msm_gpiomux_install(mpq8064_mi2s_configs,
1253 ARRAY_SIZE(mpq8064_mi2s_configs));
1254
David Collinsf0d00732012-01-25 15:46:50 -08001255 msm_gpiomux_install(apq8064_ext_regulator_configs,
1256 ARRAY_SIZE(apq8064_ext_regulator_configs));
Joel Kingdacbc822012-01-25 13:30:57 -08001257
1258 if (machine_is_apq8064_mtp())
1259 msm_gpiomux_install(mdm_configs,
1260 ARRAY_SIZE(mdm_configs));
Hemant Kumara945b472012-01-25 15:08:06 -08001261
Steve Mucklef132c6c2012-06-06 18:30:57 -07001262#ifdef CONFIG_USB_EHCI_MSM_HSIC
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001263 if (machine_is_apq8064_mtp())
1264 msm_gpiomux_install(cyts_gpio_configs,
1265 ARRAY_SIZE(cyts_gpio_configs));
1266
Hemant Kumarf1ca9192012-02-07 18:59:33 -08001267 if (machine_is_apq8064_mtp())
1268 msm_gpiomux_install(apq8064_hsic_configs,
1269 ARRAY_SIZE(apq8064_hsic_configs));
Hemant Kumara945b472012-01-25 15:08:06 -08001270#endif
Jing Lin21ed4de2012-02-05 15:53:28 -08001271
1272 if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
1273 msm_gpiomux_install(apq8064_mxt_configs,
1274 ARRAY_SIZE(apq8064_mxt_configs));
Aravind Venkateswaran0507c8c2012-02-16 17:16:05 -08001275
1276 msm_gpiomux_install(apq8064_hdmi_configs,
1277 ARRAY_SIZE(apq8064_hdmi_configs));
Ravi Kumar V05931a22012-04-04 17:09:37 +05301278
1279 if (machine_is_mpq8064_cdp())
1280 msm_gpiomux_install(mpq8064_ir_configs,
1281 ARRAY_SIZE(mpq8064_ir_configs));
Oluwafemi Adeyemia46d0322012-05-16 18:27:44 -07001282
1283#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
1284 msm_gpiomux_install(apq8064_sdc2_configs,
1285 ARRAY_SIZE(apq8064_sdc2_configs));
1286#endif
1287
1288#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
1289 msm_gpiomux_install(apq8064_sdc4_configs,
1290 ARRAY_SIZE(apq8064_sdc4_configs));
1291#endif
Oluwafemi Adeyemi9aff26c2012-06-26 17:28:21 -07001292
1293 msm_gpiomux_install(apq8064_sdc3_configs,
1294 ARRAY_SIZE(apq8064_sdc3_configs));
Stepan Moskovchenko2327a952011-12-14 16:31:28 -08001295}