blob: ad74182ec7ab402830c803327fd69dfe8edf6ee6 [file] [log] [blame]
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -07001/* Copyright (c) 2012, Code Aurora Forum. All rights reserved.
2 *
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
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -070023static struct gpiomux_setting gpio_uart_config = {
24 .func = GPIOMUX_FUNC_2,
25 .drv = GPIOMUX_DRV_16MA,
26 .pull = GPIOMUX_PULL_NONE,
27 .dir = GPIOMUX_OUT_HIGH,
28};
29
Sagar Dhariaa8e6b0a2012-08-10 20:52:30 -060030static struct gpiomux_setting slimbus = {
31 .func = GPIOMUX_FUNC_1,
32 .drv = GPIOMUX_DRV_8MA,
33 .pull = GPIOMUX_PULL_KEEPER,
34};
35
Sathish Ambleye3154b42012-04-09 10:59:09 -070036#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
37static struct gpiomux_setting gpio_eth_config = {
Subbaraman Narayanamurthy3f93ab12012-08-17 19:39:47 -070038 .pull = GPIOMUX_PULL_UP,
39 .drv = GPIOMUX_DRV_2MA,
Sathish Ambleye3154b42012-04-09 10:59:09 -070040 .func = GPIOMUX_FUNC_GPIO,
41};
42
Subbaraman Narayanamurthy3f93ab12012-08-17 19:39:47 -070043static struct gpiomux_setting gpio_spi_cs2_config = {
Sathish Ambleye3154b42012-04-09 10:59:09 -070044 .func = GPIOMUX_FUNC_4,
Subbaraman Narayanamurthy3f93ab12012-08-17 19:39:47 -070045 .drv = GPIOMUX_DRV_6MA,
46 .pull = GPIOMUX_PULL_DOWN,
Sathish Ambleye3154b42012-04-09 10:59:09 -070047};
48
49static struct gpiomux_setting gpio_spi_config = {
50 .func = GPIOMUX_FUNC_1,
51 .drv = GPIOMUX_DRV_12MA,
52 .pull = GPIOMUX_PULL_NONE,
53};
54
Subbaraman Narayanamurthy3f93ab12012-08-17 19:39:47 -070055static struct gpiomux_setting gpio_spi_cs1_config = {
56 .func = GPIOMUX_FUNC_GPIO,
57 .drv = GPIOMUX_DRV_6MA,
58 .pull = GPIOMUX_PULL_UP,
59};
60
Sathish Ambleye3154b42012-04-09 10:59:09 -070061static struct msm_gpiomux_config msm_eth_configs[] = {
62 {
63 .gpio = KS8851_IRQ_GPIO,
64 .settings = {
65 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
66 }
67 },
68};
69#endif
Sameer Thalappil8d686d42012-08-24 10:07:31 -070070
71static struct gpiomux_setting wcnss_5wire_suspend_cfg = {
72 .func = GPIOMUX_FUNC_GPIO,
73 .drv = GPIOMUX_DRV_2MA,
74 .pull = GPIOMUX_PULL_UP,
75};
76
77static struct gpiomux_setting wcnss_5wire_active_cfg = {
78 .func = GPIOMUX_FUNC_1,
79 .drv = GPIOMUX_DRV_6MA,
80 .pull = GPIOMUX_PULL_DOWN,
81};
82
Jin Honga04caaa2012-05-23 10:28:27 -070083static struct gpiomux_setting gpio_i2c_config = {
84 .func = GPIOMUX_FUNC_3,
85 .drv = GPIOMUX_DRV_8MA,
86 .pull = GPIOMUX_PULL_NONE,
87};
88
Chandan Uddaraju88b26d72012-08-13 22:28:44 -070089static struct gpiomux_setting lcd_en_act_cfg = {
90 .func = GPIOMUX_FUNC_GPIO,
91 .drv = GPIOMUX_DRV_8MA,
92 .pull = GPIOMUX_PULL_NONE,
93};
94
95static struct gpiomux_setting lcd_en_sus_cfg = {
96 .func = GPIOMUX_FUNC_GPIO,
97 .drv = GPIOMUX_DRV_2MA,
98 .pull = GPIOMUX_PULL_DOWN,
99};
Sathish Ambleye3154b42012-04-09 10:59:09 -0700100
Amy Maloche9e99a792012-08-15 23:27:51 -0700101static struct gpiomux_setting atmel_resout_sus_cfg = {
102 .func = GPIOMUX_FUNC_GPIO,
103 .drv = GPIOMUX_DRV_6MA,
104 .pull = GPIOMUX_PULL_DOWN,
105};
106
107static struct gpiomux_setting atmel_resout_act_cfg = {
108 .func = GPIOMUX_FUNC_GPIO,
109 .drv = GPIOMUX_DRV_6MA,
110 .pull = GPIOMUX_PULL_UP,
111};
112
113static struct gpiomux_setting atmel_int_act_cfg = {
114 .func = GPIOMUX_FUNC_GPIO,
115 .drv = GPIOMUX_DRV_8MA,
116 .pull = GPIOMUX_PULL_UP,
117};
118
119static struct gpiomux_setting atmel_int_sus_cfg = {
120 .func = GPIOMUX_FUNC_GPIO,
121 .drv = GPIOMUX_DRV_2MA,
122 .pull = GPIOMUX_PULL_DOWN,
123};
124
Joonwoo Park187e9cb2012-08-24 22:47:53 -0700125static struct gpiomux_setting taiko_reset = {
126 .func = GPIOMUX_FUNC_GPIO,
127 .drv = GPIOMUX_DRV_6MA,
128 .pull = GPIOMUX_PULL_NONE,
129 .dir = GPIOMUX_OUT_LOW,
130};
131
Joonwoo Parkeb84dc72012-09-12 10:22:49 -0700132static struct gpiomux_setting taiko_int = {
133 .func = GPIOMUX_FUNC_GPIO,
134 .drv = GPIOMUX_DRV_2MA,
135 .pull = GPIOMUX_PULL_NONE,
136};
137
Amy Maloche9e99a792012-08-15 23:27:51 -0700138static struct msm_gpiomux_config msm_touch_configs[] __initdata = {
139 {
140 .gpio = 60, /* TOUCH RESET */
141 .settings = {
142 [GPIOMUX_ACTIVE] = &atmel_resout_act_cfg,
143 [GPIOMUX_SUSPENDED] = &atmel_resout_sus_cfg,
144 },
145 },
146 {
147 .gpio = 61, /* TOUCH IRQ */
148 .settings = {
149 [GPIOMUX_ACTIVE] = &atmel_int_act_cfg,
150 [GPIOMUX_SUSPENDED] = &atmel_int_sus_cfg,
151 },
152 },
153
154};
Ujwal Patel74b5df42012-08-13 22:50:13 -0700155
Manoj Rao5bf2a7e2012-10-29 12:53:27 -0700156static struct gpiomux_setting mhl_suspend_config = {
157 .func = GPIOMUX_FUNC_GPIO,
158 .drv = GPIOMUX_DRV_2MA,
159 .pull = GPIOMUX_PULL_DOWN,
160};
161
162static struct gpiomux_setting mhl_active_1_cfg = {
163 .func = GPIOMUX_FUNC_1,
164 .drv = GPIOMUX_DRV_2MA,
165 .pull = GPIOMUX_PULL_UP,
166 .dir = GPIOMUX_OUT_HIGH,
167};
168
169static struct gpiomux_setting mhl_active_2_cfg = {
170 .func = GPIOMUX_FUNC_1,
171 .drv = GPIOMUX_DRV_2MA,
172 .pull = GPIOMUX_PULL_UP,
173};
174
175
Ujwal Patel74b5df42012-08-13 22:50:13 -0700176static struct gpiomux_setting hdmi_suspend_cfg = {
177 .func = GPIOMUX_FUNC_GPIO,
178 .drv = GPIOMUX_DRV_2MA,
179 .pull = GPIOMUX_PULL_DOWN,
180};
181
182static struct gpiomux_setting hdmi_active_1_cfg = {
183 .func = GPIOMUX_FUNC_1,
184 .drv = GPIOMUX_DRV_2MA,
185 .pull = GPIOMUX_PULL_UP,
186};
187
188static struct gpiomux_setting hdmi_active_2_cfg = {
189 .func = GPIOMUX_FUNC_1,
190 .drv = GPIOMUX_DRV_16MA,
191 .pull = GPIOMUX_PULL_DOWN,
192};
193
Manoj Rao5bf2a7e2012-10-29 12:53:27 -0700194static struct msm_gpiomux_config msm_mhl_configs[] __initdata = {
195 {
196 /* mhl-sii8334 pwr */
197 .gpio = 12,
198 .settings = {
199 [GPIOMUX_SUSPENDED] = &mhl_suspend_config,
200 [GPIOMUX_ACTIVE] = &mhl_active_1_cfg,
201 },
202 },
203 {
204 /* mhl-sii8334 intr */
205 .gpio = 82,
206 .settings = {
207 [GPIOMUX_SUSPENDED] = &mhl_suspend_config,
208 [GPIOMUX_ACTIVE] = &mhl_active_1_cfg,
209 },
210 },
211 {
212 /* mhl-sii8334 reset */
213 .gpio = 8,
214 .settings = {
215 [GPIOMUX_SUSPENDED] = &mhl_suspend_config,
216 [GPIOMUX_ACTIVE] = &mhl_active_2_cfg,
217 },
218 },
219};
220
221
Ujwal Patel74b5df42012-08-13 22:50:13 -0700222static struct msm_gpiomux_config msm_hdmi_configs[] __initdata = {
223 {
224 .gpio = 31,
225 .settings = {
226 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
227 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
228 },
229 },
230 {
231 .gpio = 32,
232 .settings = {
233 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
234 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
235 },
236 },
237 {
238 .gpio = 33,
239 .settings = {
240 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
241 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
242 },
243 },
244 {
245 .gpio = 34,
246 .settings = {
247 [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg,
248 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
249 },
250 },
251};
252
Stepan Moskovchenko95108b82012-11-27 14:28:11 -0800253static struct msm_gpiomux_config msm_rumi_blsp_configs[] __initdata = {
254 {
255 .gpio = 45, /* BLSP2 UART8 TX */
256 .settings = {
257 [GPIOMUX_SUSPENDED] = &gpio_uart_config,
258 },
259 },
260 {
261 .gpio = 46, /* BLSP2 UART8 RX */
262 .settings = {
263 [GPIOMUX_SUSPENDED] = &gpio_uart_config,
264 },
265 },
266};
267
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700268static struct msm_gpiomux_config msm_blsp_configs[] __initdata = {
Sathish Ambleye3154b42012-04-09 10:59:09 -0700269#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
270 {
271 .gpio = 0, /* BLSP1 QUP SPI_DATA_MOSI */
272 .settings = {
273 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
274 },
275 },
276 {
277 .gpio = 1, /* BLSP1 QUP SPI_DATA_MISO */
278 .settings = {
279 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
280 },
281 },
282 {
283 .gpio = 3, /* BLSP1 QUP SPI_CLK */
284 .settings = {
285 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
286 },
287 },
288 {
Subbaraman Narayanamurthy3f93ab12012-08-17 19:39:47 -0700289 .gpio = 9, /* BLSP1 QUP SPI_CS2A_N */
Sathish Ambleye3154b42012-04-09 10:59:09 -0700290 .settings = {
Subbaraman Narayanamurthy3f93ab12012-08-17 19:39:47 -0700291 [GPIOMUX_SUSPENDED] = &gpio_spi_cs2_config,
292 },
293 },
294 {
295 .gpio = 8, /* BLSP1 QUP SPI_CS1_N */
296 .settings = {
297 [GPIOMUX_SUSPENDED] = &gpio_spi_cs1_config,
Sathish Ambleye3154b42012-04-09 10:59:09 -0700298 },
299 },
300#endif
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700301 {
Chandan Uddaraju88b26d72012-08-13 22:28:44 -0700302 .gpio = 58,
303 .settings = {
304 [GPIOMUX_ACTIVE] = &lcd_en_act_cfg,
305 [GPIOMUX_SUSPENDED] = &lcd_en_sus_cfg,
306 },
307 },
308 {
Amy Malochebc7e9672012-08-15 10:30:40 -0700309 .gpio = 6, /* BLSP1 QUP2 I2C_DAT */
310 .settings = {
311 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
312 },
313 },
314 {
315 .gpio = 7, /* BLSP1 QUP2 I2C_CLK */
316 .settings = {
317 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
318 },
319 },
320 {
Jin Honga04caaa2012-05-23 10:28:27 -0700321 .gpio = 83, /* BLSP11 QUP I2C_DAT */
322 .settings = {
323 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
324 },
325 },
326 {
327 .gpio = 84, /* BLSP11 QUP I2C_CLK */
328 .settings = {
329 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
330 },
331 },
332 {
Stepan Moskovchenko5269b602012-08-08 17:57:09 -0700333 .gpio = 4, /* BLSP2 UART TX */
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700334 .settings = {
335 [GPIOMUX_SUSPENDED] = &gpio_uart_config,
336 },
337 },
338 {
Stepan Moskovchenko5269b602012-08-08 17:57:09 -0700339 .gpio = 5, /* BLSP2 UART RX */
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700340 .settings = {
341 [GPIOMUX_SUSPENDED] = &gpio_uart_config,
342 },
343 },
Sagar Dhariae0bb6502012-08-10 20:25:51 -0600344 {
345 .gpio = 53, /* BLSP2 QUP4 SPI_DATA_MOSI */
346 .settings = {
347 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
348 },
349 },
350 {
351 .gpio = 54, /* BLSP2 QUP4 SPI_DATA_MISO */
352 .settings = {
353 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
354 },
355 },
356 {
357 .gpio = 56, /* BLSP2 QUP4 SPI_CLK */
358 .settings = {
359 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
360 },
361 },
362 {
363 .gpio = 55, /* BLSP2 QUP4 SPI_CS0_N */
364 .settings = {
365 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
366 },
367 },
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700368};
369
Sagar Dhariaa8e6b0a2012-08-10 20:52:30 -0600370static struct msm_gpiomux_config msm8974_slimbus_config[] __initdata = {
371 {
372 .gpio = 70, /* slimbus clk */
373 .settings = {
374 [GPIOMUX_SUSPENDED] = &slimbus,
375 },
376 },
377 {
378 .gpio = 71, /* slimbus data */
379 .settings = {
380 [GPIOMUX_SUSPENDED] = &slimbus,
381 },
382 },
383};
384
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700385static struct gpiomux_setting cam_settings[] = {
386 {
Sreesudhan Ramakrish Ramkumar88c4a092012-09-07 23:43:46 -0700387 .func = GPIOMUX_FUNC_1, /*active 1*/ /* 0 */
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700388 .drv = GPIOMUX_DRV_2MA,
389 .pull = GPIOMUX_PULL_NONE,
390 },
391
392 {
Sreesudhan Ramakrish Ramkumar88c4a092012-09-07 23:43:46 -0700393 .func = GPIOMUX_FUNC_1, /*suspend*/ /* 1 */
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700394 .drv = GPIOMUX_DRV_2MA,
395 .pull = GPIOMUX_PULL_DOWN,
396 },
397
398 {
Sreesudhan Ramakrish Ramkumar88c4a092012-09-07 23:43:46 -0700399 .func = GPIOMUX_FUNC_1, /*i2c suspend*/ /* 2 */
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700400 .drv = GPIOMUX_DRV_2MA,
401 .pull = GPIOMUX_PULL_KEEPER,
402 },
Sreesudhan Ramakrish Ramkumar88c4a092012-09-07 23:43:46 -0700403
404 {
405 .func = GPIOMUX_FUNC_GPIO, /*active 0*/ /* 3 */
406 .drv = GPIOMUX_DRV_2MA,
407 .pull = GPIOMUX_PULL_NONE,
408 },
409
410 {
411 .func = GPIOMUX_FUNC_GPIO, /*suspend 0*/ /* 4 */
412 .drv = GPIOMUX_DRV_2MA,
413 .pull = GPIOMUX_PULL_DOWN,
414 },
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700415};
416
Subhash Jadavani76aa7de2012-10-10 09:58:17 +0530417static struct gpiomux_setting sd_card_det_config = {
418 .func = GPIOMUX_FUNC_GPIO,
419 .drv = GPIOMUX_DRV_2MA,
420 .pull = GPIOMUX_PULL_NONE,
421 .dir = GPIOMUX_IN,
422};
423
424static struct msm_gpiomux_config sd_card_det __initdata = {
425 .gpio = 62,
426 .settings = {
427 [GPIOMUX_ACTIVE] = &sd_card_det_config,
428 [GPIOMUX_SUSPENDED] = &sd_card_det_config,
429 },
430};
431
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700432static struct msm_gpiomux_config msm_sensor_configs[] __initdata = {
433 {
434 .gpio = 15, /* CAM_MCLK0 */
435 .settings = {
436 [GPIOMUX_ACTIVE] = &cam_settings[0],
437 [GPIOMUX_SUSPENDED] = &cam_settings[1],
438 },
439 },
440 {
441 .gpio = 16, /* CAM_MCLK1 */
442 .settings = {
443 [GPIOMUX_ACTIVE] = &cam_settings[0],
444 [GPIOMUX_SUSPENDED] = &cam_settings[1],
445 },
446 },
447 {
448 .gpio = 17, /* CAM_MCLK2 */
449 .settings = {
450 [GPIOMUX_ACTIVE] = &cam_settings[0],
451 [GPIOMUX_SUSPENDED] = &cam_settings[1],
452 },
453 },
454 {
455 .gpio = 18, /* WEBCAM1_RESET_N / CAM_MCLK3 */
456 .settings = {
Sreesudhan Ramakrish Ramkumar88c4a092012-09-07 23:43:46 -0700457 [GPIOMUX_ACTIVE] = &cam_settings[3],
458 [GPIOMUX_SUSPENDED] = &cam_settings[4],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700459 },
460 },
461 {
462 .gpio = 19, /* CCI_I2C_SDA0 */
463 .settings = {
464 [GPIOMUX_ACTIVE] = &cam_settings[0],
465 [GPIOMUX_SUSPENDED] = &cam_settings[2],
466 },
467 },
468 {
469 .gpio = 20, /* CCI_I2C_SCL0 */
470 .settings = {
471 [GPIOMUX_ACTIVE] = &cam_settings[0],
472 [GPIOMUX_SUSPENDED] = &cam_settings[2],
473 },
474 },
475 {
476 .gpio = 21, /* CCI_I2C_SDA1 */
477 .settings = {
478 [GPIOMUX_ACTIVE] = &cam_settings[0],
479 [GPIOMUX_SUSPENDED] = &cam_settings[2],
480 },
481 },
482 {
483 .gpio = 22, /* CCI_I2C_SCL1 */
484 .settings = {
485 [GPIOMUX_ACTIVE] = &cam_settings[0],
486 [GPIOMUX_SUSPENDED] = &cam_settings[2],
487 },
488 },
489 {
490 .gpio = 23, /* FLASH_LED_EN */
491 .settings = {
492 [GPIOMUX_ACTIVE] = &cam_settings[0],
493 [GPIOMUX_SUSPENDED] = &cam_settings[1],
494 },
495 },
496 {
497 .gpio = 24, /* FLASH_LED_NOW */
498 .settings = {
499 [GPIOMUX_ACTIVE] = &cam_settings[0],
500 [GPIOMUX_SUSPENDED] = &cam_settings[1],
501 },
502 },
503 {
504 .gpio = 25, /* WEBCAM2_RESET_N */
505 .settings = {
506 [GPIOMUX_ACTIVE] = &cam_settings[0],
507 [GPIOMUX_SUSPENDED] = &cam_settings[1],
508 },
509 },
510 {
511 .gpio = 26, /* CAM_IRQ */
512 .settings = {
513 [GPIOMUX_ACTIVE] = &cam_settings[0],
514 [GPIOMUX_SUSPENDED] = &cam_settings[1],
515 },
516 },
517 {
518 .gpio = 27, /* OIS_SYNC */
519 .settings = {
520 [GPIOMUX_ACTIVE] = &cam_settings[0],
521 [GPIOMUX_SUSPENDED] = &cam_settings[1],
522 },
523 },
524 {
525 .gpio = 28, /* WEBCAM1_STANDBY */
526 .settings = {
527 [GPIOMUX_ACTIVE] = &cam_settings[0],
528 [GPIOMUX_SUSPENDED] = &cam_settings[1],
529 },
530 },
531 {
532 .gpio = 89, /* CAM1_STANDBY_N */
533 .settings = {
534 [GPIOMUX_ACTIVE] = &cam_settings[0],
535 [GPIOMUX_SUSPENDED] = &cam_settings[1],
536 },
537 },
538 {
539 .gpio = 90, /* CAM1_RST_N */
540 .settings = {
541 [GPIOMUX_ACTIVE] = &cam_settings[0],
542 [GPIOMUX_SUSPENDED] = &cam_settings[1],
543 },
544 },
545 {
546 .gpio = 91, /* CAM2_STANDBY_N */
547 .settings = {
548 [GPIOMUX_ACTIVE] = &cam_settings[0],
549 [GPIOMUX_SUSPENDED] = &cam_settings[1],
550 },
551 },
552 {
553 .gpio = 92, /* CAM2_RST_N */
554 .settings = {
555 [GPIOMUX_ACTIVE] = &cam_settings[0],
556 [GPIOMUX_SUSPENDED] = &cam_settings[1],
557 },
558 },
559};
Sameer Thalappil8d686d42012-08-24 10:07:31 -0700560static struct msm_gpiomux_config wcnss_5wire_interface[] = {
561 {
562 .gpio = 36,
563 .settings = {
564 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
565 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
566 },
567 },
568 {
569 .gpio = 37,
570 .settings = {
571 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
572 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
573 },
574 },
575 {
576 .gpio = 38,
577 .settings = {
578 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
579 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
580 },
581 },
582 {
583 .gpio = 39,
584 .settings = {
585 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
586 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
587 },
588 },
589 {
590 .gpio = 40,
591 .settings = {
592 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
593 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
594 },
595 },
596};
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700597
Joonwoo Park187e9cb2012-08-24 22:47:53 -0700598static struct msm_gpiomux_config msm_taiko_config[] __initdata = {
599 {
600 .gpio = 63, /* SYS_RST_N */
601 .settings = {
602 [GPIOMUX_SUSPENDED] = &taiko_reset,
603 },
Joonwoo Parkeb84dc72012-09-12 10:22:49 -0700604 },
605 {
606 .gpio = 72, /* CDC_INT */
607 .settings = {
608 [GPIOMUX_SUSPENDED] = &taiko_int,
609 },
610 },
Joonwoo Park187e9cb2012-08-24 22:47:53 -0700611};
612
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700613void __init msm_8974_init_gpiomux(void)
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700614{
615 int rc;
616
617 rc = msm_gpiomux_init(NR_GPIO_IRQS);
618 if (rc) {
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700619 pr_err(KERN_ERR "msm_8974_init_gpiomux failed %d\n", rc);
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700620 return;
621 }
622
Sathish Ambleye3154b42012-04-09 10:59:09 -0700623#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
624 msm_gpiomux_install(msm_eth_configs, ARRAY_SIZE(msm_eth_configs));
625#endif
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700626 msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));
Sameer Thalappil8d686d42012-08-24 10:07:31 -0700627 msm_gpiomux_install(wcnss_5wire_interface,
628 ARRAY_SIZE(wcnss_5wire_interface));
Sagar Dhariaa8e6b0a2012-08-10 20:52:30 -0600629
630 msm_gpiomux_install(msm8974_slimbus_config,
631 ARRAY_SIZE(msm8974_slimbus_config));
632
Amy Maloche9e99a792012-08-15 23:27:51 -0700633 msm_gpiomux_install(msm_touch_configs, ARRAY_SIZE(msm_touch_configs));
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700634
635 msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));
Joonwoo Park187e9cb2012-08-24 22:47:53 -0700636
Subhash Jadavani76aa7de2012-10-10 09:58:17 +0530637 msm_gpiomux_install(&sd_card_det, 1);
638
Joonwoo Park187e9cb2012-08-24 22:47:53 -0700639 msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config));
Ujwal Patel74b5df42012-08-13 22:50:13 -0700640
641 msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs));
Manoj Rao5bf2a7e2012-10-29 12:53:27 -0700642 msm_gpiomux_install(msm_mhl_configs, ARRAY_SIZE(msm_mhl_configs));
Stepan Moskovchenko95108b82012-11-27 14:28:11 -0800643
644 if (machine_is_msm8974_rumi())
645 msm_gpiomux_install(msm_rumi_blsp_configs,
646 ARRAY_SIZE(msm_rumi_blsp_configs));
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700647}