blob: 8983e95b37ca31aa3afdd7aa1fa9c170e5ff7451 [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};
Jin Hongad9d9962012-09-12 22:44:19 -070034#endif
Stepan Moskovchenko2327a952011-12-14 16:31:28 -080035
36/* The SPI configurations apply to GSBI 5*/
37static struct gpiomux_setting gpio_spi_config = {
38 .func = GPIOMUX_FUNC_2,
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -080039 .drv = GPIOMUX_DRV_12MA,
Stepan Moskovchenko2327a952011-12-14 16:31:28 -080040 .pull = GPIOMUX_PULL_NONE,
41};
42
43/* The SPI configurations apply to GSBI 5 chip select 2*/
44static struct gpiomux_setting gpio_spi_cs2_config = {
45 .func = GPIOMUX_FUNC_3,
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -080046 .drv = GPIOMUX_DRV_12MA,
Stepan Moskovchenko2327a952011-12-14 16:31:28 -080047 .pull = GPIOMUX_PULL_NONE,
48};
49
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -080050/* Chip selects for SPI clients */
51static struct gpiomux_setting gpio_spi_cs_config = {
52 .func = GPIOMUX_FUNC_GPIO,
53 .drv = GPIOMUX_DRV_12MA,
54 .pull = GPIOMUX_PULL_UP,
55};
56
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -080057/* Chip selects for EPM SPI clients */
58static struct gpiomux_setting gpio_epm_spi_cs_config = {
Siddartha Mohanadoss52015a52012-05-09 21:44:58 -070059 .func = GPIOMUX_FUNC_6,
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -080060 .drv = GPIOMUX_DRV_12MA,
61 .pull = GPIOMUX_PULL_UP,
62};
63
Jin Hongad9d9962012-09-12 22:44:19 -070064#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
Stepan Moskovchenko2327a952011-12-14 16:31:28 -080065struct msm_gpiomux_config apq8064_ethernet_configs[] = {
66 {
67 .gpio = 43,
68 .settings = {
69 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
70 [GPIOMUX_ACTIVE] = &gpio_eth_config,
71 }
72 },
73};
74#endif
75
Terence Hampson2e1705f2012-04-11 19:55:29 -040076#ifdef CONFIG_MSM_VCAP
77static struct gpiomux_setting gpio_vcap_config[] = {
78 {
79 .func = GPIOMUX_FUNC_GPIO,
80 .drv = GPIOMUX_DRV_2MA,
81 .pull = GPIOMUX_PULL_DOWN,
82 },
83 {
84 .func = GPIOMUX_FUNC_1,
85 .drv = GPIOMUX_DRV_2MA,
86 .pull = GPIOMUX_PULL_DOWN,
87 },
88 {
89 .func = GPIOMUX_FUNC_2,
90 .drv = GPIOMUX_DRV_2MA,
91 .pull = GPIOMUX_PULL_DOWN,
92 },
93 {
94 .func = GPIOMUX_FUNC_3,
95 .drv = GPIOMUX_DRV_2MA,
96 .pull = GPIOMUX_PULL_DOWN,
97 },
98 {
99 .func = GPIOMUX_FUNC_4,
100 .drv = GPIOMUX_DRV_2MA,
101 .pull = GPIOMUX_PULL_DOWN,
102 },
103 {
104 .func = GPIOMUX_FUNC_5,
105 .drv = GPIOMUX_DRV_2MA,
106 .pull = GPIOMUX_PULL_DOWN,
107 },
108 {
109 .func = GPIOMUX_FUNC_6,
110 .drv = GPIOMUX_DRV_2MA,
111 .pull = GPIOMUX_PULL_DOWN,
112 },
113 {
114 .func = GPIOMUX_FUNC_7,
115 .drv = GPIOMUX_DRV_2MA,
116 .pull = GPIOMUX_PULL_DOWN,
117 },
118 {
119 .func = GPIOMUX_FUNC_8,
120 .drv = GPIOMUX_DRV_2MA,
121 .pull = GPIOMUX_PULL_DOWN,
122 },
123 {
124 .func = GPIOMUX_FUNC_9,
125 .drv = GPIOMUX_DRV_2MA,
126 .pull = GPIOMUX_PULL_DOWN,
127 },
128 {
129 .func = GPIOMUX_FUNC_A,
130 .drv = GPIOMUX_DRV_2MA,
131 .pull = GPIOMUX_PULL_DOWN,
132 },
133};
134
135struct msm_gpiomux_config vcap_configs[] = {
136 {
137 .gpio = 20,
138 .settings = {
139 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[7],
140 [GPIOMUX_ACTIVE] = &gpio_vcap_config[7],
141 }
142 },
143 {
144 .gpio = 25,
145 .settings = {
146 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[2],
147 [GPIOMUX_ACTIVE] = &gpio_vcap_config[2],
148 }
149 },
150 {
151 .gpio = 24,
152 .settings = {
153 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[1],
154 [GPIOMUX_ACTIVE] = &gpio_vcap_config[1],
155 }
156 },
157 {
158 .gpio = 23,
159 .settings = {
160 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[2],
161 [GPIOMUX_ACTIVE] = &gpio_vcap_config[2],
162 }
163 },
164 {
165 .gpio = 19,
166 .settings = {
167 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[8],
168 [GPIOMUX_ACTIVE] = &gpio_vcap_config[8],
169 }
170 },
171 {
172 .gpio = 22,
173 .settings = {
174 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[2],
175 [GPIOMUX_ACTIVE] = &gpio_vcap_config[2],
176 }
177 },
178 {
179 .gpio = 21,
180 .settings = {
181 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[7],
182 [GPIOMUX_ACTIVE] = &gpio_vcap_config[7],
183 }
184 },
185 {
186 .gpio = 12,
187 .settings = {
188 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[6],
189 [GPIOMUX_ACTIVE] = &gpio_vcap_config[6],
190 }
191 },
192 {
193 .gpio = 18,
194 .settings = {
195 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[9],
196 [GPIOMUX_ACTIVE] = &gpio_vcap_config[9],
197 }
198 },
199 {
200 .gpio = 11,
201 .settings = {
202 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[10],
203 [GPIOMUX_ACTIVE] = &gpio_vcap_config[10],
204 }
205 },
206 {
207 .gpio = 10,
208 .settings = {
209 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[9],
210 [GPIOMUX_ACTIVE] = &gpio_vcap_config[9],
211 }
212 },
213 {
214 .gpio = 9,
215 .settings = {
216 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[2],
217 [GPIOMUX_ACTIVE] = &gpio_vcap_config[2],
218 }
219 },
220 {
221 .gpio = 26,
222 .settings = {
223 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[1],
224 [GPIOMUX_ACTIVE] = &gpio_vcap_config[1],
225 }
226 },
227 {
228 .gpio = 8,
229 .settings = {
230 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[3],
231 [GPIOMUX_ACTIVE] = &gpio_vcap_config[3],
232 }
233 },
234 {
235 .gpio = 7,
236 .settings = {
237 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[7],
238 [GPIOMUX_ACTIVE] = &gpio_vcap_config[7],
239 }
240 },
241 {
242 .gpio = 6,
243 .settings = {
244 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[7],
245 [GPIOMUX_ACTIVE] = &gpio_vcap_config[7],
246 }
247 },
248 {
249 .gpio = 80,
250 .settings = {
251 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[2],
252 [GPIOMUX_ACTIVE] = &gpio_vcap_config[2],
253 }
254 },
255 {
256 .gpio = 86,
257 .settings = {
258 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[1],
259 [GPIOMUX_ACTIVE] = &gpio_vcap_config[1],
260 }
261 },
262 {
263 .gpio = 85,
264 .settings = {
265 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[4],
266 [GPIOMUX_ACTIVE] = &gpio_vcap_config[4],
267 }
268 },
269 {
270 .gpio = 84,
271 .settings = {
272 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[3],
273 [GPIOMUX_ACTIVE] = &gpio_vcap_config[3],
274 }
275 },
276 {
277 .gpio = 5,
278 .settings = {
279 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[2],
280 [GPIOMUX_ACTIVE] = &gpio_vcap_config[2],
281 }
282 },
283 {
284 .gpio = 4,
285 .settings = {
286 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[3],
287 [GPIOMUX_ACTIVE] = &gpio_vcap_config[3],
288 }
289 },
290 {
291 .gpio = 3,
292 .settings = {
293 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[6],
294 [GPIOMUX_ACTIVE] = &gpio_vcap_config[6],
295 }
296 },
297 {
298 .gpio = 2,
299 .settings = {
300 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[5],
301 [GPIOMUX_ACTIVE] = &gpio_vcap_config[5],
302 }
303 },
304 {
305 .gpio = 82,
306 .settings = {
307 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[4],
308 [GPIOMUX_ACTIVE] = &gpio_vcap_config[4],
309 }
310 },
311 {
312 .gpio = 83,
313 .settings = {
314 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[4],
315 [GPIOMUX_ACTIVE] = &gpio_vcap_config[4],
316 }
317 },
318 {
319 .gpio = 87,
320 .settings = {
321 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[2],
322 [GPIOMUX_ACTIVE] = &gpio_vcap_config[2],
323 }
324 },
325 {
326 .gpio = 13,
327 .settings = {
328 [GPIOMUX_SUSPENDED] = &gpio_vcap_config[6],
329 [GPIOMUX_ACTIVE] = &gpio_vcap_config[6],
330 }
331 },
332};
333#endif
334
David Keitel3c40fc52012-02-09 17:53:52 -0800335static struct gpiomux_setting gpio_i2c_config = {
336 .func = GPIOMUX_FUNC_1,
337 .drv = GPIOMUX_DRV_8MA,
338 .pull = GPIOMUX_PULL_NONE,
339};
340
Kuirong Wangf8c5e142012-06-21 16:17:32 -0700341static struct gpiomux_setting gpio_i2c_2ma_config = {
342 .func = GPIOMUX_FUNC_1,
343 .drv = GPIOMUX_DRV_2MA,
344 .pull = GPIOMUX_PULL_NONE,
345};
346
347
David Keitel3c40fc52012-02-09 17:53:52 -0800348static struct gpiomux_setting gpio_i2c_config_sus = {
349 .func = GPIOMUX_FUNC_1,
350 .drv = GPIOMUX_DRV_2MA,
351 .pull = GPIOMUX_PULL_KEEPER,
352};
353
Joonwoo Parkca1516f2012-05-08 13:59:37 -0700354static struct gpiomux_setting mbhc_hs_detect = {
355 .func = GPIOMUX_FUNC_1,
356 .drv = GPIOMUX_DRV_2MA,
357 .pull = GPIOMUX_PULL_NONE,
358};
359
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800360static struct gpiomux_setting cdc_mclk = {
361 .func = GPIOMUX_FUNC_1,
362 .drv = GPIOMUX_DRV_8MA,
363 .pull = GPIOMUX_PULL_NONE,
364};
365
Ankit Verma6b7e2ba2012-01-26 15:48:54 -0800366static struct gpiomux_setting wcnss_5wire_suspend_cfg = {
367 .func = GPIOMUX_FUNC_GPIO,
368 .drv = GPIOMUX_DRV_2MA,
369 .pull = GPIOMUX_PULL_UP,
370};
371
372static struct gpiomux_setting wcnss_5wire_active_cfg = {
373 .func = GPIOMUX_FUNC_1,
374 .drv = GPIOMUX_DRV_6MA,
375 .pull = GPIOMUX_PULL_DOWN,
376};
377
378
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800379static struct gpiomux_setting slimbus = {
380 .func = GPIOMUX_FUNC_1,
381 .drv = GPIOMUX_DRV_8MA,
382 .pull = GPIOMUX_PULL_KEEPER,
383};
384
Stepan Moskovchenko5ea3c312012-01-31 18:19:40 -0800385static struct gpiomux_setting gsbi1_uart_config = {
386 .func = GPIOMUX_FUNC_1,
387 .drv = GPIOMUX_DRV_16MA,
388 .pull = GPIOMUX_PULL_NONE,
389};
390
David Collinsf0d00732012-01-25 15:46:50 -0800391static struct gpiomux_setting ext_regulator_config = {
392 .func = GPIOMUX_FUNC_GPIO,
393 .drv = GPIOMUX_DRV_8MA,
394 .pull = GPIOMUX_PULL_NONE,
395 .dir = GPIOMUX_OUT_LOW,
396};
397
Jin Hong4bbbfba2012-02-02 21:48:07 -0800398static struct gpiomux_setting gsbi7_func1_cfg = {
399 .func = GPIOMUX_FUNC_1,
400 .drv = GPIOMUX_DRV_8MA,
401 .pull = GPIOMUX_PULL_NONE,
402};
403
404static struct gpiomux_setting gsbi7_func2_cfg = {
405 .func = GPIOMUX_FUNC_2,
406 .drv = GPIOMUX_DRV_8MA,
407 .pull = GPIOMUX_PULL_NONE,
408};
409
Jing Lin04601f92012-02-05 15:36:07 -0800410static struct gpiomux_setting gsbi3_suspended_cfg = {
411 .func = GPIOMUX_FUNC_1,
412 .drv = GPIOMUX_DRV_2MA,
413 .pull = GPIOMUX_PULL_KEEPER,
414};
415
416static struct gpiomux_setting gsbi3_active_cfg = {
417 .func = GPIOMUX_FUNC_1,
418 .drv = GPIOMUX_DRV_8MA,
419 .pull = GPIOMUX_PULL_NONE,
420};
421
Aravind Venkateswaran0507c8c2012-02-16 17:16:05 -0800422static struct gpiomux_setting hdmi_suspend_cfg = {
423 .func = GPIOMUX_FUNC_GPIO,
424 .drv = GPIOMUX_DRV_2MA,
425 .pull = GPIOMUX_PULL_DOWN,
426};
427
428static struct gpiomux_setting hdmi_active_1_cfg = {
429 .func = GPIOMUX_FUNC_1,
430 .drv = GPIOMUX_DRV_2MA,
431 .pull = GPIOMUX_PULL_UP,
432};
433
434static struct gpiomux_setting hdmi_active_2_cfg = {
435 .func = GPIOMUX_FUNC_1,
436 .drv = GPIOMUX_DRV_16MA,
437 .pull = GPIOMUX_PULL_DOWN,
438};
439
Abhishek Kharbanda72dc72e2012-06-07 13:41:37 -0700440static struct gpiomux_setting hdmi_active_3_cfg = {
441 .func = GPIOMUX_FUNC_GPIO,
442 .drv = GPIOMUX_DRV_2MA,
443 .pull = GPIOMUX_PULL_UP,
444 .dir = GPIOMUX_IN,
445};
446
447static struct gpiomux_setting hdmi_active_4_cfg = {
448 .func = GPIOMUX_FUNC_GPIO,
449 .drv = GPIOMUX_DRV_2MA,
450 .pull = GPIOMUX_PULL_UP,
451 .dir = GPIOMUX_OUT_HIGH,
452};
453
Joel King8f839b92012-04-01 14:37:46 -0700454static struct gpiomux_setting gsbi5_suspended_cfg = {
455 .func = GPIOMUX_FUNC_2,
456 .drv = GPIOMUX_DRV_12MA,
457 .pull = GPIOMUX_PULL_NONE,
458};
459
460static struct gpiomux_setting gsbi5_active_cfg = {
461 .func = GPIOMUX_FUNC_2,
462 .drv = GPIOMUX_DRV_12MA,
463 .pull = GPIOMUX_PULL_NONE,
464};
Anirudh Ghayal9f1aaa72012-04-26 18:15:08 +0530465
466static struct gpiomux_setting sx150x_suspended_cfg = {
467 .func = GPIOMUX_FUNC_GPIO,
468 .drv = GPIOMUX_DRV_8MA,
469 .pull = GPIOMUX_PULL_NONE,
470};
471
472static struct gpiomux_setting sx150x_active_cfg = {
473 .func = GPIOMUX_FUNC_GPIO,
474 .drv = GPIOMUX_DRV_8MA,
475 .pull = GPIOMUX_PULL_NONE,
476};
477
Steve Mucklef132c6c2012-06-06 18:30:57 -0700478#ifdef CONFIG_USB_EHCI_MSM_HSIC
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -0800479static struct gpiomux_setting cyts_sleep_sus_cfg = {
480 .func = GPIOMUX_FUNC_GPIO,
481 .drv = GPIOMUX_DRV_6MA,
482 .pull = GPIOMUX_PULL_DOWN,
483};
484
485static struct gpiomux_setting cyts_sleep_act_cfg = {
486 .func = GPIOMUX_FUNC_GPIO,
487 .drv = GPIOMUX_DRV_6MA,
488 .pull = GPIOMUX_PULL_DOWN,
489};
490
491static struct gpiomux_setting cyts_int_act_cfg = {
492 .func = GPIOMUX_FUNC_GPIO,
493 .drv = GPIOMUX_DRV_8MA,
494 .pull = GPIOMUX_PULL_UP,
495};
496
497static struct gpiomux_setting cyts_int_sus_cfg = {
498 .func = GPIOMUX_FUNC_GPIO,
499 .drv = GPIOMUX_DRV_2MA,
500 .pull = GPIOMUX_PULL_DOWN,
501};
502
503static struct msm_gpiomux_config cyts_gpio_configs[] __initdata = {
504 { /* TS INTERRUPT */
505 .gpio = 6,
506 .settings = {
507 [GPIOMUX_ACTIVE] = &cyts_int_act_cfg,
508 [GPIOMUX_SUSPENDED] = &cyts_int_sus_cfg,
509 },
510 },
511 { /* TS SLEEP */
512 .gpio = 33,
513 .settings = {
514 [GPIOMUX_ACTIVE] = &cyts_sleep_act_cfg,
515 [GPIOMUX_SUSPENDED] = &cyts_sleep_sus_cfg,
516 },
517 },
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -0800518};
Amy Maloche609bb5e2012-08-03 09:41:42 -0700519static struct msm_gpiomux_config cyts_gpio_alt_config[] __initdata = {
520 { /* TS INTERRUPT */
521 .gpio = 6,
522 .settings = {
523 [GPIOMUX_ACTIVE] = &cyts_int_act_cfg,
524 [GPIOMUX_SUSPENDED] = &cyts_int_sus_cfg,
525 },
526 },
527 { /* TS SLEEP */
528 .gpio = 12,
529 .settings = {
530 [GPIOMUX_ACTIVE] = &cyts_sleep_act_cfg,
531 [GPIOMUX_SUSPENDED] = &cyts_sleep_sus_cfg,
532 },
533 },
534};
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -0800535
Amy Maloche9ba3ffe2012-04-26 10:31:20 -0700536static struct gpiomux_setting hsic_act_cfg = {
537 .func = GPIOMUX_FUNC_1,
538 .drv = GPIOMUX_DRV_8MA,
539 .pull = GPIOMUX_PULL_NONE,
540};
541
542static struct gpiomux_setting hsic_sus_cfg = {
543 .func = GPIOMUX_FUNC_GPIO,
544 .drv = GPIOMUX_DRV_2MA,
545 .pull = GPIOMUX_PULL_DOWN,
546 .dir = GPIOMUX_OUT_LOW,
547};
548
Hemant Kumar6fd65032012-05-23 13:02:24 -0700549static struct gpiomux_setting hsic_wakeup_act_cfg = {
550 .func = GPIOMUX_FUNC_GPIO,
551 .drv = GPIOMUX_DRV_8MA,
552 .pull = GPIOMUX_PULL_DOWN,
553 .dir = GPIOMUX_IN,
554};
555
556static struct gpiomux_setting hsic_wakeup_sus_cfg = {
557 .func = GPIOMUX_FUNC_GPIO,
558 .drv = GPIOMUX_DRV_2MA,
559 .pull = GPIOMUX_PULL_DOWN,
560 .dir = GPIOMUX_IN,
561};
Amy Maloche9ba3ffe2012-04-26 10:31:20 -0700562
Hemant Kumara945b472012-01-25 15:08:06 -0800563static struct msm_gpiomux_config apq8064_hsic_configs[] = {
564 {
565 .gpio = 88, /*HSIC_STROBE */
566 .settings = {
567 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
568 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
569 },
570 },
571 {
572 .gpio = 89, /* HSIC_DATA */
573 .settings = {
574 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
575 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
576 },
577 },
Hemant Kumar6fd65032012-05-23 13:02:24 -0700578 {
579 .gpio = 47, /* wake up */
580 .settings = {
581 [GPIOMUX_ACTIVE] = &hsic_wakeup_act_cfg,
582 [GPIOMUX_SUSPENDED] = &hsic_wakeup_sus_cfg,
583 },
584 },
Hemant Kumara945b472012-01-25 15:08:06 -0800585};
586#endif
587
Jing Lin21ed4de2012-02-05 15:53:28 -0800588static struct gpiomux_setting mxt_reset_sus_cfg = {
589 .func = GPIOMUX_FUNC_GPIO,
590 .drv = GPIOMUX_DRV_6MA,
591 .pull = GPIOMUX_PULL_DOWN,
592};
593
594static struct gpiomux_setting mxt_reset_act_cfg = {
595 .func = GPIOMUX_FUNC_GPIO,
596 .drv = GPIOMUX_DRV_6MA,
597 .pull = GPIOMUX_PULL_UP,
598};
599
600static struct gpiomux_setting mxt_int_sus_cfg = {
601 .func = GPIOMUX_FUNC_GPIO,
602 .drv = GPIOMUX_DRV_2MA,
603 .pull = GPIOMUX_PULL_DOWN,
604};
605
606static struct gpiomux_setting mxt_int_act_cfg = {
607 .func = GPIOMUX_FUNC_GPIO,
608 .drv = GPIOMUX_DRV_8MA,
609 .pull = GPIOMUX_PULL_UP,
610};
611
Aravind Venkateswaran0507c8c2012-02-16 17:16:05 -0800612static struct msm_gpiomux_config apq8064_hdmi_configs[] __initdata = {
613 {
614 .gpio = 69,
615 .settings = {
616 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
617 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
618 },
619 },
620 {
621 .gpio = 70,
622 .settings = {
623 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
624 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
625 },
626 },
627 {
628 .gpio = 71,
629 .settings = {
630 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
631 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
632 },
633 },
634 {
635 .gpio = 72,
636 .settings = {
637 [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg,
638 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
639 },
640 },
641};
642
Abhishek Kharbanda72dc72e2012-06-07 13:41:37 -0700643static struct msm_gpiomux_config apq8064_mhl_configs[] __initdata = {
644 {
645 .gpio = 30,
646 .settings = {
647 [GPIOMUX_ACTIVE] = &hdmi_active_3_cfg,
648 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
649 },
650 },
651 {
652 .gpio = 35,
653 .settings = {
654 [GPIOMUX_ACTIVE] = &hdmi_active_4_cfg,
655 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
656 },
657 },
658};
659
Stepan Moskovchenko2327a952011-12-14 16:31:28 -0800660static struct msm_gpiomux_config apq8064_gsbi_configs[] __initdata = {
Stepan Moskovchenko5ea3c312012-01-31 18:19:40 -0800661 {
Jing Lin04601f92012-02-05 15:36:07 -0800662 .gpio = 8, /* GSBI3 I2C QUP SDA */
663 .settings = {
664 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
665 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
666 },
667 },
668 {
669 .gpio = 9, /* GSBI3 I2C QUP SCL */
670 .settings = {
671 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
672 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
673 },
674 },
675 {
Stepan Moskovchenko5ea3c312012-01-31 18:19:40 -0800676 .gpio = 18, /* GSBI1 UART TX */
677 .settings = {
678 [GPIOMUX_SUSPENDED] = &gsbi1_uart_config,
679 },
680 },
681 {
682 .gpio = 19, /* GSBI1 UART RX */
683 .settings = {
684 [GPIOMUX_SUSPENDED] = &gsbi1_uart_config,
685 },
686 },
Stepan Moskovchenko2327a952011-12-14 16:31:28 -0800687 {
688 .gpio = 51, /* GSBI5 QUP SPI_DATA_MOSI */
689 .settings = {
690 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
691 },
692 },
693 {
694 .gpio = 52, /* GSBI5 QUP SPI_DATA_MISO */
695 .settings = {
696 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
697 },
698 },
699 {
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -0800700 .gpio = 53, /* Funny CS0 */
701 .settings = {
702 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
703 },
704 },
705 {
Stepan Moskovchenko2327a952011-12-14 16:31:28 -0800706 .gpio = 31, /* GSBI5 QUP SPI_CS2_N */
707 .settings = {
708 [GPIOMUX_SUSPENDED] = &gpio_spi_cs2_config,
709 },
710 },
711 {
712 .gpio = 54, /* GSBI5 QUP SPI_CLK */
713 .settings = {
714 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
715 },
716 },
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -0800717 {
718 .gpio = 30, /* FP CS */
719 .settings = {
720 [GPIOMUX_SUSPENDED] = &gpio_spi_cs_config,
721 },
722 },
723 {
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -0800724 .gpio = 53, /* NOR CS */
725 .settings = {
726 [GPIOMUX_SUSPENDED] = &gpio_spi_cs_config,
727 },
728 },
Jin Hong4bbbfba2012-02-02 21:48:07 -0800729 {
730 .gpio = 82, /* GSBI7 UART2 TX */
731 .settings = {
732 [GPIOMUX_SUSPENDED] = &gsbi7_func2_cfg,
733 },
734 },
735 {
736 .gpio = 83, /* GSBI7 UART2 RX */
737 .settings = {
738 [GPIOMUX_SUSPENDED] = &gsbi7_func1_cfg,
739 },
740 },
Kuirong Wangf8c5e142012-06-21 16:17:32 -0700741};
742
743static struct msm_gpiomux_config apq8064_non_mi2s_gsbi_configs[] __initdata = {
744 {
745 .gpio = 32, /* EPM CS */
746 .settings = {
747 [GPIOMUX_SUSPENDED] = &gpio_epm_spi_cs_config,
748 },
749 },
750};
751
752static struct msm_gpiomux_config apq8064_gsbi1_i2c_2ma_configs[] __initdata = {
753 {
754 .gpio = 21, /* GSBI1 QUP I2C_CLK */
755 .settings = {
756 [GPIOMUX_SUSPENDED] = &gpio_i2c_config_sus,
757 [GPIOMUX_ACTIVE] = &gpio_i2c_2ma_config,
758 },
759 },
760 {
761 .gpio = 20, /* GSBI1 QUP I2C_DATA */
762 .settings = {
763 [GPIOMUX_SUSPENDED] = &gpio_i2c_config_sus,
764 [GPIOMUX_ACTIVE] = &gpio_i2c_2ma_config,
765 },
766 },
767};
768
769static struct msm_gpiomux_config apq8064_gsbi1_i2c_8ma_configs[] __initdata = {
David Keitel3c40fc52012-02-09 17:53:52 -0800770 {
771 .gpio = 21, /* GSBI1 QUP I2C_CLK */
772 .settings = {
773 [GPIOMUX_SUSPENDED] = &gpio_i2c_config_sus,
774 [GPIOMUX_ACTIVE] = &gpio_i2c_config,
775 },
776 },
777 {
778 .gpio = 20, /* GSBI1 QUP I2C_DATA */
779 .settings = {
780 [GPIOMUX_SUSPENDED] = &gpio_i2c_config_sus,
781 [GPIOMUX_ACTIVE] = &gpio_i2c_config,
782 },
783 },
Stepan Moskovchenko2327a952011-12-14 16:31:28 -0800784};
785
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800786static struct msm_gpiomux_config apq8064_slimbus_config[] __initdata = {
787 {
788 .gpio = 40, /* slimbus clk */
789 .settings = {
790 [GPIOMUX_SUSPENDED] = &slimbus,
791 },
792 },
793 {
794 .gpio = 41, /* slimbus data */
795 .settings = {
796 [GPIOMUX_SUSPENDED] = &slimbus,
797 },
798 },
799};
800
Kuirong Wangf8c5e142012-06-21 16:17:32 -0700801static struct gpiomux_setting spkr_i2s = {
Santosh Mardieff9a742012-04-09 23:23:39 +0530802 .func = GPIOMUX_FUNC_1,
803 .drv = GPIOMUX_DRV_8MA,
804 .pull = GPIOMUX_PULL_KEEPER,
805};
806
807static struct msm_gpiomux_config mpq8064_spkr_i2s_config[] __initdata = {
808 {
809 .gpio = 47, /* spkr i2c sck */
810 .settings = {
Kuirong Wangf8c5e142012-06-21 16:17:32 -0700811 [GPIOMUX_SUSPENDED] = &spkr_i2s,
Santosh Mardieff9a742012-04-09 23:23:39 +0530812 },
813 },
814 {
815 .gpio = 48, /* spkr_i2s_ws */
816 .settings = {
Kuirong Wangf8c5e142012-06-21 16:17:32 -0700817 [GPIOMUX_SUSPENDED] = &spkr_i2s,
Santosh Mardieff9a742012-04-09 23:23:39 +0530818 },
819 },
820 {
821 .gpio = 49, /* spkr_i2s_dout */
822 .settings = {
Kuirong Wangf8c5e142012-06-21 16:17:32 -0700823 [GPIOMUX_SUSPENDED] = &spkr_i2s,
Santosh Mardieff9a742012-04-09 23:23:39 +0530824 },
825 },
826 {
827 .gpio = 50, /* spkr_i2s_mclk */
828 .settings = {
Kuirong Wangf8c5e142012-06-21 16:17:32 -0700829 [GPIOMUX_SUSPENDED] = &spkr_i2s,
Santosh Mardieff9a742012-04-09 23:23:39 +0530830 },
831 },
832};
833
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800834static struct msm_gpiomux_config apq8064_audio_codec_configs[] __initdata = {
835 {
Joonwoo Parkca1516f2012-05-08 13:59:37 -0700836 .gpio = 38,
837 .settings = {
838 [GPIOMUX_SUSPENDED] = &mbhc_hs_detect,
839 },
840 },
841 {
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800842 .gpio = 39,
843 .settings = {
844 [GPIOMUX_SUSPENDED] = &cdc_mclk,
845 },
846 },
847};
848
David Collinsf0d00732012-01-25 15:46:50 -0800849/* External 3.3 V regulator enable */
850static struct msm_gpiomux_config apq8064_ext_regulator_configs[] __initdata = {
851 {
852 .gpio = APQ8064_EXT_3P3V_REG_EN_GPIO,
853 .settings = {
854 [GPIOMUX_SUSPENDED] = &ext_regulator_config,
855 },
856 },
857};
858
Joel Kingdacbc822012-01-25 13:30:57 -0800859static struct gpiomux_setting ap2mdm_cfg = {
860 .func = GPIOMUX_FUNC_GPIO,
861 .drv = GPIOMUX_DRV_8MA,
862 .pull = GPIOMUX_PULL_DOWN,
863};
864
865static struct gpiomux_setting mdm2ap_status_cfg = {
866 .func = GPIOMUX_FUNC_GPIO,
867 .drv = GPIOMUX_DRV_8MA,
Joel King269aa602012-07-23 08:07:35 -0700868 .pull = GPIOMUX_PULL_DOWN,
Joel Kingdacbc822012-01-25 13:30:57 -0800869};
870
871static struct gpiomux_setting mdm2ap_errfatal_cfg = {
872 .func = GPIOMUX_FUNC_GPIO,
873 .drv = GPIOMUX_DRV_16MA,
874 .pull = GPIOMUX_PULL_DOWN,
875};
876
Vamsi Krishnac6dcd5e2012-05-09 15:38:01 -0700877static struct gpiomux_setting mdm2ap_pblrdy = {
878 .func = GPIOMUX_FUNC_GPIO,
879 .drv = GPIOMUX_DRV_16MA,
880 .pull = GPIOMUX_PULL_DOWN,
881};
882
883
Joel King14fe7fa2012-05-27 14:26:11 -0700884static struct gpiomux_setting ap2mdm_soft_reset_cfg = {
Joel Kingdacbc822012-01-25 13:30:57 -0800885 .func = GPIOMUX_FUNC_GPIO,
886 .drv = GPIOMUX_DRV_8MA,
887 .pull = GPIOMUX_PULL_DOWN,
888};
889
Vamsi Krishna9e307cd2012-04-11 13:15:36 -0700890static struct gpiomux_setting ap2mdm_wakeup = {
891 .func = GPIOMUX_FUNC_GPIO,
892 .drv = GPIOMUX_DRV_8MA,
893 .pull = GPIOMUX_PULL_DOWN,
894};
895
Joel Kingdacbc822012-01-25 13:30:57 -0800896static struct msm_gpiomux_config mdm_configs[] __initdata = {
897 /* AP2MDM_STATUS */
898 {
899 .gpio = 48,
900 .settings = {
901 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
902 }
903 },
904 /* MDM2AP_STATUS */
905 {
906 .gpio = 49,
907 .settings = {
Joel King269aa602012-07-23 08:07:35 -0700908 [GPIOMUX_ACTIVE] = &mdm2ap_status_cfg,
Joel Kingdacbc822012-01-25 13:30:57 -0800909 [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
910 }
911 },
912 /* MDM2AP_ERRFATAL */
913 {
914 .gpio = 19,
915 .settings = {
916 [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
917 }
918 },
919 /* AP2MDM_ERRFATAL */
920 {
921 .gpio = 18,
922 .settings = {
923 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
924 }
925 },
Joel King14fe7fa2012-05-27 14:26:11 -0700926 /* AP2MDM_SOFT_RESET, aka AP2MDM_PON_RESET_N */
Joel Kingdacbc822012-01-25 13:30:57 -0800927 {
928 .gpio = 27,
929 .settings = {
Joel King14fe7fa2012-05-27 14:26:11 -0700930 [GPIOMUX_SUSPENDED] = &ap2mdm_soft_reset_cfg,
Joel Kingdacbc822012-01-25 13:30:57 -0800931 }
Mohan Pallaka474b94b2012-01-25 12:59:58 +0530932 },
Vamsi Krishna9e307cd2012-04-11 13:15:36 -0700933 /* AP2MDM_WAKEUP */
934 {
935 .gpio = 35,
936 .settings = {
937 [GPIOMUX_SUSPENDED] = &ap2mdm_wakeup,
938 }
939 },
Vamsi Krishnac6dcd5e2012-05-09 15:38:01 -0700940 /* MDM2AP_PBL_READY*/
941 {
942 .gpio = 46,
943 .settings = {
944 [GPIOMUX_SUSPENDED] = &mdm2ap_pblrdy,
945 }
946 },
Mohan Pallaka474b94b2012-01-25 12:59:58 +0530947};
948
Ameya Thakure155ece2012-07-09 12:08:37 -0700949static struct msm_gpiomux_config mdm_i2s_configs[] __initdata = {
950 /* AP2MDM_STATUS */
951 {
952 .gpio = 48,
953 .settings = {
954 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
955 }
956 },
957 /* MDM2AP_STATUS */
958 {
959 .gpio = 49,
960 .settings = {
961 [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
962 }
963 },
964 /* MDM2AP_ERRFATAL */
965 {
966 .gpio = 19,
967 .settings = {
968 [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
969 }
970 },
971 /* AP2MDM_ERRFATAL */
972 {
973 .gpio = 18,
974 .settings = {
975 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
976 }
977 },
978 /* AP2MDM_SOFT_RESET, aka AP2MDM_PON_RESET_N */
979 {
980 .gpio = 0,
981 .settings = {
982 [GPIOMUX_SUSPENDED] = &ap2mdm_soft_reset_cfg,
983 }
984 },
985 /* AP2MDM_WAKEUP */
986 {
987 .gpio = 44,
988 .settings = {
989 [GPIOMUX_SUSPENDED] = &ap2mdm_wakeup,
990 }
991 },
992 /* MDM2AP_PBL_READY*/
993 {
994 .gpio = 81,
995 .settings = {
996 [GPIOMUX_SUSPENDED] = &mdm2ap_pblrdy,
997 }
998 },
999};
1000
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001001static struct gpiomux_setting i2s_act_cfg = {
Kuirong Wangf23f8c52012-03-31 12:34:51 -07001002 .func = GPIOMUX_FUNC_1,
1003 .drv = GPIOMUX_DRV_8MA,
1004 .pull = GPIOMUX_PULL_NONE,
1005};
1006
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001007static struct gpiomux_setting i2s_act_func_2_cfg = {
1008 .func = GPIOMUX_FUNC_2,
1009 .drv = GPIOMUX_DRV_8MA,
1010 .pull = GPIOMUX_PULL_NONE,
1011};
1012
1013static struct gpiomux_setting i2s_sus_cfg = {
Kuirong Wangf23f8c52012-03-31 12:34:51 -07001014 .func = GPIOMUX_FUNC_GPIO,
1015 .drv = GPIOMUX_DRV_2MA,
1016 .pull = GPIOMUX_PULL_DOWN,
1017};
1018
1019static struct msm_gpiomux_config mpq8064_mi2s_configs[] __initdata = {
1020 {
1021 .gpio = 27, /* mi2s ws */
1022 .settings = {
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001023 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1024 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
Kuirong Wangf23f8c52012-03-31 12:34:51 -07001025 },
1026 },
1027 {
1028 .gpio = 28, /* mi2s sclk */
1029 .settings = {
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001030 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1031 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
Kuirong Wangf23f8c52012-03-31 12:34:51 -07001032 },
1033 },
1034 {
1035 .gpio = 29, /* mi2s dout3 */
1036 .settings = {
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001037 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1038 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
Kuirong Wangf23f8c52012-03-31 12:34:51 -07001039 },
1040 },
1041 {
1042 .gpio = 30, /* mi2s dout2 */
1043 .settings = {
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001044 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1045 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
Kuirong Wangf23f8c52012-03-31 12:34:51 -07001046 },
1047 },
1048
1049 {
1050 .gpio = 31, /* mi2s dout1 */
1051 .settings = {
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001052 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1053 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
Kuirong Wangf23f8c52012-03-31 12:34:51 -07001054 },
1055 },
1056 {
1057 .gpio = 32, /* mi2s dout0 */
1058 .settings = {
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001059 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1060 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
Kuirong Wangf23f8c52012-03-31 12:34:51 -07001061 },
1062 },
1063
1064 {
1065 .gpio = 33, /* mi2s mclk */
1066 .settings = {
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001067 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1068 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
Kuirong Wangf23f8c52012-03-31 12:34:51 -07001069 },
1070 },
1071};
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001072
1073static struct msm_gpiomux_config apq8064_mi2s_configs[] __initdata = {
1074 {
1075 .gpio = 27, /* mi2s ws */
1076 .settings = {
1077 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1078 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
1079 },
1080 },
1081 {
1082 .gpio = 28, /* mi2s sclk */
1083 .settings = {
1084 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1085 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
1086 },
1087 },
1088 {
1089 .gpio = 29, /* mi2s dout3 - TX*/
1090 .settings = {
1091 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1092 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
1093 },
1094 },
1095 {
1096 .gpio = 32, /* mi2s dout0 - RX */
1097 .settings = {
1098 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1099 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
1100 },
1101 },
1102
1103 {
1104 .gpio = 33, /* mi2s mclk */
1105 .settings = {
1106 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1107 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
1108 },
1109 },
1110};
1111
1112static struct msm_gpiomux_config apq8064_mic_i2s_configs[] __initdata = {
1113 {
1114 .gpio = 35, /* mic i2s sclk */
1115 .settings = {
1116 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1117 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
1118 },
1119 },
1120 {
1121 .gpio = 36, /* mic i2s ws */
1122 .settings = {
1123 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1124 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
1125 },
1126 },
1127 {
1128 .gpio = 37, /* mic i2s din0 */
1129 .settings = {
1130 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1131 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
1132 },
1133 },
1134};
1135
1136
1137static struct msm_gpiomux_config apq8064_spkr_i2s_configs[] __initdata = {
1138 {
1139 .gpio = 40, /* spkr i2s sclk */
1140 .settings = {
1141 [GPIOMUX_ACTIVE] = &i2s_act_func_2_cfg,
1142 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
1143 },
1144 },
1145 {
1146 .gpio = 41, /* spkr i2s dout */
1147 .settings = {
1148 [GPIOMUX_ACTIVE] = &i2s_act_func_2_cfg,
1149 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
1150 },
1151 },
1152 {
1153 .gpio = 42, /* spkr i2s ws */
1154 .settings = {
1155 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1156 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
1157 },
1158 },
1159};
1160
1161
Jing Lin21ed4de2012-02-05 15:53:28 -08001162static struct msm_gpiomux_config apq8064_mxt_configs[] __initdata = {
1163 { /* TS INTERRUPT */
1164 .gpio = 6,
1165 .settings = {
1166 [GPIOMUX_ACTIVE] = &mxt_int_act_cfg,
1167 [GPIOMUX_SUSPENDED] = &mxt_int_sus_cfg,
1168 },
1169 },
1170 { /* TS RESET */
1171 .gpio = 33,
1172 .settings = {
1173 [GPIOMUX_ACTIVE] = &mxt_reset_act_cfg,
1174 [GPIOMUX_SUSPENDED] = &mxt_reset_sus_cfg,
1175 },
1176 },
1177};
1178
Ankit Verma6b7e2ba2012-01-26 15:48:54 -08001179static struct msm_gpiomux_config wcnss_5wire_interface[] = {
1180 {
1181 .gpio = 64,
1182 .settings = {
1183 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
1184 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
1185 },
1186 },
1187 {
1188 .gpio = 65,
1189 .settings = {
1190 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
1191 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
1192 },
1193 },
1194 {
1195 .gpio = 66,
1196 .settings = {
1197 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
1198 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
1199 },
1200 },
1201 {
1202 .gpio = 67,
1203 .settings = {
1204 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
1205 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
1206 },
1207 },
1208 {
1209 .gpio = 68,
1210 .settings = {
1211 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
1212 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
1213 },
1214 },
1215};
1216
Joel King8f839b92012-04-01 14:37:46 -07001217static struct msm_gpiomux_config mpq8064_gsbi5_i2c_configs[] __initdata = {
1218 {
1219 .gpio = 53, /* GSBI5 I2C QUP SDA */
1220 .settings = {
1221 [GPIOMUX_SUSPENDED] = &gsbi5_suspended_cfg,
1222 [GPIOMUX_ACTIVE] = &gsbi5_active_cfg,
1223 },
1224 },
1225 {
1226 .gpio = 54, /* GSBI5 I2C QUP SCL */
1227 .settings = {
1228 [GPIOMUX_SUSPENDED] = &gsbi5_suspended_cfg,
1229 [GPIOMUX_ACTIVE] = &gsbi5_active_cfg,
1230 },
1231 },
1232};
1233
Ravi Kumar V05931a22012-04-04 17:09:37 +05301234static struct gpiomux_setting ir_suspended_cfg = {
1235 .func = GPIOMUX_FUNC_GPIO,
1236 .drv = GPIOMUX_DRV_2MA,
1237 .pull = GPIOMUX_PULL_UP,
1238};
1239
1240static struct gpiomux_setting ir_active_cfg = {
1241 .func = GPIOMUX_FUNC_GPIO,
1242 .drv = GPIOMUX_DRV_8MA,
1243 .pull = GPIOMUX_PULL_UP,
1244};
1245
1246static struct msm_gpiomux_config mpq8064_ir_configs[] __initdata = {
1247 {
1248 .gpio = 88, /* GPIO IR */
1249 .settings = {
1250 [GPIOMUX_SUSPENDED] = &ir_suspended_cfg,
1251 [GPIOMUX_ACTIVE] = &ir_active_cfg,
1252 },
1253 },
1254};
1255
Anirudh Ghayal9f1aaa72012-04-26 18:15:08 +05301256static struct msm_gpiomux_config sx150x_int_configs[] __initdata = {
1257 {
1258 .gpio = 81,
1259 .settings = {
1260 [GPIOMUX_SUSPENDED] = &sx150x_suspended_cfg,
1261 [GPIOMUX_ACTIVE] = &sx150x_active_cfg,
1262 },
1263 },
1264};
1265
Oluwafemi Adeyemia46d0322012-05-16 18:27:44 -07001266#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
1267static struct gpiomux_setting sdc2_clk_active_cfg = {
1268 .func = GPIOMUX_FUNC_2,
1269 .drv = GPIOMUX_DRV_8MA,
1270 .pull = GPIOMUX_PULL_NONE,
1271};
1272
1273static struct gpiomux_setting sdc2_cmd_data_0_3_active_cfg = {
1274 .func = GPIOMUX_FUNC_2,
1275 .drv = GPIOMUX_DRV_8MA,
1276 .pull = GPIOMUX_PULL_UP,
1277};
1278
1279static struct gpiomux_setting sdc2_suspended_cfg = {
1280 .func = GPIOMUX_FUNC_GPIO,
1281 .drv = GPIOMUX_DRV_2MA,
1282 .pull = GPIOMUX_PULL_DOWN,
1283};
1284
1285static struct gpiomux_setting sdc2_data_1_suspended_cfg = {
1286 .func = GPIOMUX_FUNC_GPIO,
1287 .drv = GPIOMUX_DRV_2MA,
1288 .pull = GPIOMUX_PULL_UP,
1289};
1290
1291static struct msm_gpiomux_config apq8064_sdc2_configs[] __initdata = {
1292 {
1293 .gpio = 59,
1294 .settings = {
1295 [GPIOMUX_ACTIVE] = &sdc2_clk_active_cfg,
1296 [GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
1297 },
1298 },
1299 {
1300 .gpio = 57,
1301 .settings = {
1302 [GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
1303 [GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
1304 },
1305
1306 },
1307 {
1308 .gpio = 62,
1309 .settings = {
1310 [GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
1311 [GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
1312 },
1313 },
1314 {
1315 .gpio = 61,
1316 .settings = {
1317 [GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
1318 [GPIOMUX_SUSPENDED] = &sdc2_data_1_suspended_cfg,
1319 },
1320 },
1321 {
1322 .gpio = 60,
1323 .settings = {
1324 [GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
1325 [GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
1326 },
1327 },
1328 {
1329 .gpio = 58,
1330 .settings = {
1331 [GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
1332 [GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
1333 },
1334 },
1335};
1336#endif
1337
1338
1339#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
1340static struct gpiomux_setting sdc4_clk_active_cfg = {
1341 .func = GPIOMUX_FUNC_2,
1342 .drv = GPIOMUX_DRV_8MA,
1343 .pull = GPIOMUX_PULL_NONE,
1344};
1345
1346static struct gpiomux_setting sdc4_cmd_data_0_3_active_cfg = {
1347 .func = GPIOMUX_FUNC_2,
1348 .drv = GPIOMUX_DRV_8MA,
1349 .pull = GPIOMUX_PULL_UP,
1350};
1351
1352static struct gpiomux_setting sdc4_suspended_cfg = {
1353 .func = GPIOMUX_FUNC_GPIO,
1354 .drv = GPIOMUX_DRV_2MA,
1355 .pull = GPIOMUX_PULL_DOWN,
1356};
1357
1358static struct gpiomux_setting sdc4_data_1_suspended_cfg = {
1359 .func = GPIOMUX_FUNC_GPIO,
1360 .drv = GPIOMUX_DRV_2MA,
1361 .pull = GPIOMUX_PULL_UP,
1362};
1363
1364static struct msm_gpiomux_config apq8064_sdc4_configs[] __initdata = {
1365 {
1366 .gpio = 68,
1367 .settings = {
1368 [GPIOMUX_ACTIVE] = &sdc4_clk_active_cfg,
1369 [GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
1370 },
1371 },
1372 {
1373 .gpio = 67,
1374 .settings = {
1375 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
1376 [GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
1377 },
1378
1379 },
1380 {
1381 .gpio = 66,
1382 .settings = {
1383 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
1384 [GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
1385 },
1386 },
1387 {
1388 .gpio = 65,
1389 .settings = {
1390 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
1391 [GPIOMUX_SUSPENDED] = &sdc4_data_1_suspended_cfg,
1392 },
1393 },
1394 {
1395 .gpio = 64,
1396 .settings = {
1397 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
1398 [GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
1399 },
1400 },
1401 {
1402 .gpio = 63,
1403 .settings = {
1404 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
1405 [GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
1406 },
1407 },
1408};
1409#endif
1410
Oluwafemi Adeyemi9aff26c2012-06-26 17:28:21 -07001411static struct gpiomux_setting apq8064_sdc3_card_det_cfg = {
1412 .func = GPIOMUX_FUNC_GPIO,
1413 .drv = GPIOMUX_DRV_2MA,
1414 .pull = GPIOMUX_PULL_UP,
1415};
1416
1417static struct msm_gpiomux_config apq8064_sdc3_configs[] __initdata = {
1418 {
1419 .gpio = 26,
1420 .settings = {
1421 [GPIOMUX_SUSPENDED] = &apq8064_sdc3_card_det_cfg,
1422 [GPIOMUX_ACTIVE] = &apq8064_sdc3_card_det_cfg,
1423 },
1424 },
1425};
1426
Mayank Rana262e9032012-05-10 15:14:00 -07001427static struct gpiomux_setting gsbi6_uartdm_active = {
1428 .func = GPIOMUX_FUNC_2,
1429 .drv = GPIOMUX_DRV_8MA,
1430 .pull = GPIOMUX_PULL_NONE,
1431};
1432
1433static struct gpiomux_setting gsbi6_uartdm_suspended = {
1434 .func = GPIOMUX_FUNC_GPIO,
1435 .drv = GPIOMUX_DRV_2MA,
1436 .pull = GPIOMUX_PULL_DOWN,
1437};
1438
1439static struct msm_gpiomux_config mpq8064_uartdm_configs[] __initdata = {
1440 { /* UARTDM_TX */
1441 .gpio = 14,
1442 .settings = {
1443 [GPIOMUX_ACTIVE] = &gsbi6_uartdm_active,
1444 [GPIOMUX_SUSPENDED] = &gsbi6_uartdm_suspended,
1445 },
1446 },
1447 { /* UARTDM_RX */
1448 .gpio = 15,
1449 .settings = {
1450 [GPIOMUX_ACTIVE] = &gsbi6_uartdm_active,
1451 [GPIOMUX_SUSPENDED] = &gsbi6_uartdm_suspended,
1452 },
1453 },
1454 { /* UARTDM_CTS */
1455 .gpio = 16,
1456 .settings = {
1457 [GPIOMUX_ACTIVE] = &gsbi6_uartdm_active,
1458 [GPIOMUX_SUSPENDED] = &gsbi6_uartdm_suspended,
1459 },
1460 },
1461 { /* UARTDM_RFR */
1462 .gpio = 17,
1463 .settings = {
1464 [GPIOMUX_ACTIVE] = &gsbi6_uartdm_active,
1465 [GPIOMUX_SUSPENDED] = &gsbi6_uartdm_suspended,
1466 },
1467 },
1468};
1469
Stepan Moskovchenko2327a952011-12-14 16:31:28 -08001470void __init apq8064_init_gpiomux(void)
1471{
1472 int rc;
Amy Maloche609bb5e2012-08-03 09:41:42 -07001473 int platform_version = socinfo_get_platform_version();
Stepan Moskovchenko2327a952011-12-14 16:31:28 -08001474
1475 rc = msm_gpiomux_init(NR_GPIO_IRQS);
1476 if (rc) {
1477 pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
1478 return;
1479 }
Ankit Verma6fe41b02012-09-13 16:12:11 +05301480 if (!(machine_is_mpq8064_hrd()))
1481 msm_gpiomux_install(wcnss_5wire_interface,
1482 ARRAY_SIZE(wcnss_5wire_interface));
Ankit Verma6b7e2ba2012-01-26 15:48:54 -08001483
Joel King8f839b92012-04-01 14:37:46 -07001484 if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
1485 machine_is_mpq8064_dtv()) {
1486 msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
1487 ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
Terence Hampson2e1705f2012-04-11 19:55:29 -04001488#ifdef CONFIG_MSM_VCAP
1489 msm_gpiomux_install(vcap_configs,
1490 ARRAY_SIZE(vcap_configs));
1491#endif
Anirudh Ghayal9f1aaa72012-04-26 18:15:08 +05301492 msm_gpiomux_install(sx150x_int_configs,
1493 ARRAY_SIZE(sx150x_int_configs));
Joel King8f839b92012-04-01 14:37:46 -07001494 } else {
1495 #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
1496 msm_gpiomux_install(apq8064_ethernet_configs,
1497 ARRAY_SIZE(apq8064_ethernet_configs));
1498 #endif
1499
1500 msm_gpiomux_install(apq8064_gsbi_configs,
1501 ARRAY_SIZE(apq8064_gsbi_configs));
Stepan Moskovchenko2327a952011-12-14 16:31:28 -08001502
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001503 if (!(machine_is_apq8064_mtp() &&
1504 (SOCINFO_VERSION_MINOR(platform_version) == 1)))
1505 msm_gpiomux_install(apq8064_non_mi2s_gsbi_configs,
1506 ARRAY_SIZE(apq8064_non_mi2s_gsbi_configs));
1507 }
1508 if (machine_is_apq8064_mtp() &&
1509 (SOCINFO_VERSION_MINOR(platform_version) == 1)) {
1510 msm_gpiomux_install(apq8064_mic_i2s_configs,
1511 ARRAY_SIZE(apq8064_mic_i2s_configs));
1512 msm_gpiomux_install(apq8064_spkr_i2s_configs,
1513 ARRAY_SIZE(apq8064_spkr_i2s_configs));
1514 msm_gpiomux_install(apq8064_mi2s_configs,
1515 ARRAY_SIZE(apq8064_mi2s_configs));
1516 msm_gpiomux_install(apq8064_gsbi1_i2c_2ma_configs,
1517 ARRAY_SIZE(apq8064_gsbi1_i2c_2ma_configs));
1518 } else {
1519 msm_gpiomux_install(apq8064_slimbus_config,
1520 ARRAY_SIZE(apq8064_slimbus_config));
1521 msm_gpiomux_install(apq8064_gsbi1_i2c_8ma_configs,
1522 ARRAY_SIZE(apq8064_gsbi1_i2c_8ma_configs));
1523 }
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08001524
1525 msm_gpiomux_install(apq8064_audio_codec_configs,
1526 ARRAY_SIZE(apq8064_audio_codec_configs));
1527
Santosh Mardieff9a742012-04-09 23:23:39 +05301528 if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
1529 machine_is_mpq8064_dtv()) {
1530 msm_gpiomux_install(mpq8064_spkr_i2s_config,
1531 ARRAY_SIZE(mpq8064_spkr_i2s_config));
1532 }
1533
Swaminathan Sathappan9e07aa92012-02-29 12:07:27 -08001534 pr_debug("%s(): audio-auxpcm: Include GPIO configs"
1535 " as audio is not the primary user"
1536 " for these GPIO Pins\n", __func__);
David Collinsf0d00732012-01-25 15:46:50 -08001537
Kuirong Wangf23f8c52012-03-31 12:34:51 -07001538 if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
1539 machine_is_mpq8064_dtv())
1540 msm_gpiomux_install(mpq8064_mi2s_configs,
1541 ARRAY_SIZE(mpq8064_mi2s_configs));
1542
David Collinsf0d00732012-01-25 15:46:50 -08001543 msm_gpiomux_install(apq8064_ext_regulator_configs,
1544 ARRAY_SIZE(apq8064_ext_regulator_configs));
Joel Kingdacbc822012-01-25 13:30:57 -08001545
Ameya Thakure155ece2012-07-09 12:08:37 -07001546 if (machine_is_apq8064_mtp()) {
1547 if (SOCINFO_VERSION_MINOR(platform_version) == 1)
1548 msm_gpiomux_install(mdm_i2s_configs,
1549 ARRAY_SIZE(mdm_i2s_configs));
1550 else
1551 msm_gpiomux_install(mdm_configs,
1552 ARRAY_SIZE(mdm_configs));
1553 }
Hemant Kumara945b472012-01-25 15:08:06 -08001554
Amy Maloche609bb5e2012-08-03 09:41:42 -07001555 if (machine_is_apq8064_mtp()) {
1556 if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
1557 msm_gpiomux_install(cyts_gpio_alt_config,
1558 ARRAY_SIZE(cyts_gpio_alt_config));
1559 } else {
1560 msm_gpiomux_install(cyts_gpio_configs,
1561 ARRAY_SIZE(cyts_gpio_configs));
1562 }
1563 }
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001564
Amy Maloche609bb5e2012-08-03 09:41:42 -07001565#ifdef CONFIG_USB_EHCI_MSM_HSIC
Hemant Kumarf1ca9192012-02-07 18:59:33 -08001566 if (machine_is_apq8064_mtp())
1567 msm_gpiomux_install(apq8064_hsic_configs,
1568 ARRAY_SIZE(apq8064_hsic_configs));
Hemant Kumara945b472012-01-25 15:08:06 -08001569#endif
Jing Lin21ed4de2012-02-05 15:53:28 -08001570
1571 if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
1572 msm_gpiomux_install(apq8064_mxt_configs,
1573 ARRAY_SIZE(apq8064_mxt_configs));
Aravind Venkateswaran0507c8c2012-02-16 17:16:05 -08001574
1575 msm_gpiomux_install(apq8064_hdmi_configs,
1576 ARRAY_SIZE(apq8064_hdmi_configs));
Ravi Kumar V05931a22012-04-04 17:09:37 +05301577
Abhishek Kharbanda72dc72e2012-06-07 13:41:37 -07001578 if (apq8064_mhl_display_enabled())
1579 msm_gpiomux_install(apq8064_mhl_configs,
1580 ARRAY_SIZE(apq8064_mhl_configs));
1581
Ravi Kumar V05931a22012-04-04 17:09:37 +05301582 if (machine_is_mpq8064_cdp())
1583 msm_gpiomux_install(mpq8064_ir_configs,
1584 ARRAY_SIZE(mpq8064_ir_configs));
Oluwafemi Adeyemia46d0322012-05-16 18:27:44 -07001585
1586#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
1587 msm_gpiomux_install(apq8064_sdc2_configs,
1588 ARRAY_SIZE(apq8064_sdc2_configs));
1589#endif
1590
1591#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
1592 msm_gpiomux_install(apq8064_sdc4_configs,
1593 ARRAY_SIZE(apq8064_sdc4_configs));
1594#endif
Oluwafemi Adeyemi9aff26c2012-06-26 17:28:21 -07001595
1596 msm_gpiomux_install(apq8064_sdc3_configs,
1597 ARRAY_SIZE(apq8064_sdc3_configs));
Mayank Rana262e9032012-05-10 15:14:00 -07001598 if (machine_is_mpq8064_hrd() || machine_is_mpq8064_dtv())
1599 msm_gpiomux_install(mpq8064_uartdm_configs,
1600 ARRAY_SIZE(mpq8064_uartdm_configs));
Stepan Moskovchenko2327a952011-12-14 16:31:28 -08001601}