blob: 28d50cc6ef91c87950f8628162fb7ee7a2791e4a [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
Siddartha Mohanadossc4bc6ae2012-12-06 14:22:22 -080071static struct gpiomux_setting gpio_epm_config = {
72 .func = GPIOMUX_FUNC_GPIO,
73 .drv = GPIOMUX_DRV_2MA,
74 .pull = GPIOMUX_PULL_DOWN,
75};
76
Sameer Thalappil8d686d42012-08-24 10:07:31 -070077static struct gpiomux_setting wcnss_5wire_suspend_cfg = {
78 .func = GPIOMUX_FUNC_GPIO,
79 .drv = GPIOMUX_DRV_2MA,
80 .pull = GPIOMUX_PULL_UP,
81};
82
83static struct gpiomux_setting wcnss_5wire_active_cfg = {
84 .func = GPIOMUX_FUNC_1,
85 .drv = GPIOMUX_DRV_6MA,
86 .pull = GPIOMUX_PULL_DOWN,
87};
88
Jin Honga04caaa2012-05-23 10:28:27 -070089static struct gpiomux_setting gpio_i2c_config = {
90 .func = GPIOMUX_FUNC_3,
91 .drv = GPIOMUX_DRV_8MA,
92 .pull = GPIOMUX_PULL_NONE,
93};
94
Chandan Uddaraju88b26d72012-08-13 22:28:44 -070095static struct gpiomux_setting lcd_en_act_cfg = {
96 .func = GPIOMUX_FUNC_GPIO,
97 .drv = GPIOMUX_DRV_8MA,
98 .pull = GPIOMUX_PULL_NONE,
99};
100
101static struct gpiomux_setting lcd_en_sus_cfg = {
102 .func = GPIOMUX_FUNC_GPIO,
103 .drv = GPIOMUX_DRV_2MA,
104 .pull = GPIOMUX_PULL_DOWN,
105};
Sathish Ambleye3154b42012-04-09 10:59:09 -0700106
Amy Maloche9e99a792012-08-15 23:27:51 -0700107static struct gpiomux_setting atmel_resout_sus_cfg = {
108 .func = GPIOMUX_FUNC_GPIO,
109 .drv = GPIOMUX_DRV_6MA,
110 .pull = GPIOMUX_PULL_DOWN,
111};
112
113static struct gpiomux_setting atmel_resout_act_cfg = {
114 .func = GPIOMUX_FUNC_GPIO,
115 .drv = GPIOMUX_DRV_6MA,
116 .pull = GPIOMUX_PULL_UP,
117};
118
119static struct gpiomux_setting atmel_int_act_cfg = {
120 .func = GPIOMUX_FUNC_GPIO,
121 .drv = GPIOMUX_DRV_8MA,
122 .pull = GPIOMUX_PULL_UP,
123};
124
125static struct gpiomux_setting atmel_int_sus_cfg = {
126 .func = GPIOMUX_FUNC_GPIO,
127 .drv = GPIOMUX_DRV_2MA,
128 .pull = GPIOMUX_PULL_DOWN,
129};
130
Joonwoo Park187e9cb2012-08-24 22:47:53 -0700131static struct gpiomux_setting taiko_reset = {
132 .func = GPIOMUX_FUNC_GPIO,
133 .drv = GPIOMUX_DRV_6MA,
134 .pull = GPIOMUX_PULL_NONE,
135 .dir = GPIOMUX_OUT_LOW,
136};
137
Joonwoo Parkeb84dc72012-09-12 10:22:49 -0700138static struct gpiomux_setting taiko_int = {
139 .func = GPIOMUX_FUNC_GPIO,
140 .drv = GPIOMUX_DRV_2MA,
141 .pull = GPIOMUX_PULL_NONE,
142};
143
Amy Maloche9e99a792012-08-15 23:27:51 -0700144static struct msm_gpiomux_config msm_touch_configs[] __initdata = {
145 {
146 .gpio = 60, /* TOUCH RESET */
147 .settings = {
148 [GPIOMUX_ACTIVE] = &atmel_resout_act_cfg,
149 [GPIOMUX_SUSPENDED] = &atmel_resout_sus_cfg,
150 },
151 },
152 {
153 .gpio = 61, /* TOUCH IRQ */
154 .settings = {
155 [GPIOMUX_ACTIVE] = &atmel_int_act_cfg,
156 [GPIOMUX_SUSPENDED] = &atmel_int_sus_cfg,
157 },
158 },
159
160};
Ujwal Patel74b5df42012-08-13 22:50:13 -0700161
Manu Gautamac7265b2012-11-21 11:49:15 +0530162static struct gpiomux_setting hsic_sus_cfg = {
163 .func = GPIOMUX_FUNC_GPIO,
164 .drv = GPIOMUX_DRV_2MA,
165 .pull = GPIOMUX_PULL_DOWN,
166 .dir = GPIOMUX_OUT_LOW,
167};
168
169static struct gpiomux_setting hsic_act_cfg = {
170 .func = GPIOMUX_FUNC_1,
171 .drv = GPIOMUX_DRV_12MA,
172 .pull = GPIOMUX_PULL_NONE,
173};
174
175static struct gpiomux_setting hsic_hub_act_cfg = {
176 .func = GPIOMUX_FUNC_GPIO,
177 .drv = GPIOMUX_DRV_2MA,
178 .pull = GPIOMUX_PULL_UP,
179 .dir = GPIOMUX_IN,
180};
181
182static struct msm_gpiomux_config msm_hsic_configs[] = {
183 {
184 .gpio = 144, /*HSIC_STROBE */
185 .settings = {
186 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
187 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
188 },
189 },
190 {
191 .gpio = 145, /* HSIC_DATA */
192 .settings = {
193 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
194 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
195 },
196 },
197};
198
199static struct msm_gpiomux_config msm_hsic_hub_configs[] = {
200 {
201 .gpio = 50, /* HSIC_HUB_INT_N */
202 .settings = {
203 [GPIOMUX_ACTIVE] = &hsic_hub_act_cfg,
204 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
205 },
206 },
207};
208
Manoj Rao5bf2a7e2012-10-29 12:53:27 -0700209static struct gpiomux_setting mhl_suspend_config = {
210 .func = GPIOMUX_FUNC_GPIO,
211 .drv = GPIOMUX_DRV_2MA,
212 .pull = GPIOMUX_PULL_DOWN,
213};
214
215static struct gpiomux_setting mhl_active_1_cfg = {
216 .func = GPIOMUX_FUNC_1,
217 .drv = GPIOMUX_DRV_2MA,
218 .pull = GPIOMUX_PULL_UP,
219 .dir = GPIOMUX_OUT_HIGH,
220};
221
222static struct gpiomux_setting mhl_active_2_cfg = {
223 .func = GPIOMUX_FUNC_1,
224 .drv = GPIOMUX_DRV_2MA,
225 .pull = GPIOMUX_PULL_UP,
226};
227
Ujwal Patel74b5df42012-08-13 22:50:13 -0700228static struct gpiomux_setting hdmi_suspend_cfg = {
229 .func = GPIOMUX_FUNC_GPIO,
230 .drv = GPIOMUX_DRV_2MA,
231 .pull = GPIOMUX_PULL_DOWN,
232};
233
234static struct gpiomux_setting hdmi_active_1_cfg = {
235 .func = GPIOMUX_FUNC_1,
236 .drv = GPIOMUX_DRV_2MA,
237 .pull = GPIOMUX_PULL_UP,
238};
239
240static struct gpiomux_setting hdmi_active_2_cfg = {
241 .func = GPIOMUX_FUNC_1,
242 .drv = GPIOMUX_DRV_16MA,
243 .pull = GPIOMUX_PULL_DOWN,
244};
245
Manoj Rao5bf2a7e2012-10-29 12:53:27 -0700246static struct msm_gpiomux_config msm_mhl_configs[] __initdata = {
247 {
248 /* mhl-sii8334 pwr */
249 .gpio = 12,
250 .settings = {
251 [GPIOMUX_SUSPENDED] = &mhl_suspend_config,
252 [GPIOMUX_ACTIVE] = &mhl_active_1_cfg,
253 },
254 },
255 {
256 /* mhl-sii8334 intr */
257 .gpio = 82,
258 .settings = {
259 [GPIOMUX_SUSPENDED] = &mhl_suspend_config,
260 [GPIOMUX_ACTIVE] = &mhl_active_1_cfg,
261 },
262 },
263 {
264 /* mhl-sii8334 reset */
265 .gpio = 8,
266 .settings = {
267 [GPIOMUX_SUSPENDED] = &mhl_suspend_config,
268 [GPIOMUX_ACTIVE] = &mhl_active_2_cfg,
269 },
270 },
271};
272
273
Ujwal Patel74b5df42012-08-13 22:50:13 -0700274static struct msm_gpiomux_config msm_hdmi_configs[] __initdata = {
275 {
276 .gpio = 31,
277 .settings = {
278 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
279 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
280 },
281 },
282 {
283 .gpio = 32,
284 .settings = {
285 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
286 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
287 },
288 },
289 {
290 .gpio = 33,
291 .settings = {
292 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
293 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
294 },
295 },
296 {
297 .gpio = 34,
298 .settings = {
299 [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg,
300 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
301 },
302 },
303};
304
Stepan Moskovchenko95108b82012-11-27 14:28:11 -0800305static struct msm_gpiomux_config msm_rumi_blsp_configs[] __initdata = {
306 {
307 .gpio = 45, /* BLSP2 UART8 TX */
308 .settings = {
309 [GPIOMUX_SUSPENDED] = &gpio_uart_config,
310 },
311 },
312 {
313 .gpio = 46, /* BLSP2 UART8 RX */
314 .settings = {
315 [GPIOMUX_SUSPENDED] = &gpio_uart_config,
316 },
317 },
318};
319
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700320static struct msm_gpiomux_config msm_blsp_configs[] __initdata = {
Sathish Ambleye3154b42012-04-09 10:59:09 -0700321#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
322 {
323 .gpio = 0, /* BLSP1 QUP SPI_DATA_MOSI */
324 .settings = {
325 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
326 },
327 },
328 {
329 .gpio = 1, /* BLSP1 QUP SPI_DATA_MISO */
330 .settings = {
331 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
332 },
333 },
334 {
335 .gpio = 3, /* BLSP1 QUP SPI_CLK */
336 .settings = {
337 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
338 },
339 },
340 {
Subbaraman Narayanamurthy3f93ab12012-08-17 19:39:47 -0700341 .gpio = 9, /* BLSP1 QUP SPI_CS2A_N */
Sathish Ambleye3154b42012-04-09 10:59:09 -0700342 .settings = {
Subbaraman Narayanamurthy3f93ab12012-08-17 19:39:47 -0700343 [GPIOMUX_SUSPENDED] = &gpio_spi_cs2_config,
344 },
345 },
346 {
347 .gpio = 8, /* BLSP1 QUP SPI_CS1_N */
348 .settings = {
349 [GPIOMUX_SUSPENDED] = &gpio_spi_cs1_config,
Sathish Ambleye3154b42012-04-09 10:59:09 -0700350 },
351 },
352#endif
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700353 {
Chandan Uddaraju88b26d72012-08-13 22:28:44 -0700354 .gpio = 58,
355 .settings = {
356 [GPIOMUX_ACTIVE] = &lcd_en_act_cfg,
357 [GPIOMUX_SUSPENDED] = &lcd_en_sus_cfg,
358 },
359 },
360 {
Amy Malochebc7e9672012-08-15 10:30:40 -0700361 .gpio = 6, /* BLSP1 QUP2 I2C_DAT */
362 .settings = {
363 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
364 },
365 },
366 {
367 .gpio = 7, /* BLSP1 QUP2 I2C_CLK */
368 .settings = {
369 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
370 },
371 },
372 {
Jin Honga04caaa2012-05-23 10:28:27 -0700373 .gpio = 83, /* BLSP11 QUP I2C_DAT */
374 .settings = {
375 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
376 },
377 },
378 {
379 .gpio = 84, /* BLSP11 QUP I2C_CLK */
380 .settings = {
381 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
382 },
383 },
384 {
Stepan Moskovchenko5269b602012-08-08 17:57:09 -0700385 .gpio = 4, /* BLSP2 UART TX */
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700386 .settings = {
387 [GPIOMUX_SUSPENDED] = &gpio_uart_config,
388 },
389 },
390 {
Stepan Moskovchenko5269b602012-08-08 17:57:09 -0700391 .gpio = 5, /* BLSP2 UART RX */
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700392 .settings = {
393 [GPIOMUX_SUSPENDED] = &gpio_uart_config,
394 },
395 },
Sagar Dhariae0bb6502012-08-10 20:25:51 -0600396 {
397 .gpio = 53, /* BLSP2 QUP4 SPI_DATA_MOSI */
398 .settings = {
399 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
400 },
401 },
402 {
403 .gpio = 54, /* BLSP2 QUP4 SPI_DATA_MISO */
404 .settings = {
405 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
406 },
407 },
408 {
409 .gpio = 56, /* BLSP2 QUP4 SPI_CLK */
410 .settings = {
411 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
412 },
413 },
414 {
415 .gpio = 55, /* BLSP2 QUP4 SPI_CS0_N */
416 .settings = {
417 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
418 },
419 },
Siddartha Mohanadossc4bc6ae2012-12-06 14:22:22 -0800420 {
421 .gpio = 81, /* EPM enable */
422 .settings = {
423 [GPIOMUX_SUSPENDED] = &gpio_epm_config,
424 },
425 },
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700426};
427
Sagar Dhariaa8e6b0a2012-08-10 20:52:30 -0600428static struct msm_gpiomux_config msm8974_slimbus_config[] __initdata = {
429 {
430 .gpio = 70, /* slimbus clk */
431 .settings = {
432 [GPIOMUX_SUSPENDED] = &slimbus,
433 },
434 },
435 {
436 .gpio = 71, /* slimbus data */
437 .settings = {
438 [GPIOMUX_SUSPENDED] = &slimbus,
439 },
440 },
441};
442
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700443static struct gpiomux_setting cam_settings[] = {
444 {
Sreesudhan Ramakrish Ramkumar88c4a092012-09-07 23:43:46 -0700445 .func = GPIOMUX_FUNC_1, /*active 1*/ /* 0 */
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700446 .drv = GPIOMUX_DRV_2MA,
447 .pull = GPIOMUX_PULL_NONE,
448 },
449
450 {
Sreesudhan Ramakrish Ramkumar88c4a092012-09-07 23:43:46 -0700451 .func = GPIOMUX_FUNC_1, /*suspend*/ /* 1 */
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700452 .drv = GPIOMUX_DRV_2MA,
453 .pull = GPIOMUX_PULL_DOWN,
454 },
455
456 {
Sreesudhan Ramakrish Ramkumar88c4a092012-09-07 23:43:46 -0700457 .func = GPIOMUX_FUNC_1, /*i2c suspend*/ /* 2 */
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700458 .drv = GPIOMUX_DRV_2MA,
459 .pull = GPIOMUX_PULL_KEEPER,
460 },
Sreesudhan Ramakrish Ramkumar88c4a092012-09-07 23:43:46 -0700461
462 {
463 .func = GPIOMUX_FUNC_GPIO, /*active 0*/ /* 3 */
464 .drv = GPIOMUX_DRV_2MA,
465 .pull = GPIOMUX_PULL_NONE,
466 },
467
468 {
469 .func = GPIOMUX_FUNC_GPIO, /*suspend 0*/ /* 4 */
470 .drv = GPIOMUX_DRV_2MA,
471 .pull = GPIOMUX_PULL_DOWN,
472 },
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700473};
474
Subhash Jadavani76aa7de2012-10-10 09:58:17 +0530475static struct gpiomux_setting sd_card_det_config = {
476 .func = GPIOMUX_FUNC_GPIO,
477 .drv = GPIOMUX_DRV_2MA,
478 .pull = GPIOMUX_PULL_NONE,
479 .dir = GPIOMUX_IN,
480};
481
482static struct msm_gpiomux_config sd_card_det __initdata = {
483 .gpio = 62,
484 .settings = {
485 [GPIOMUX_ACTIVE] = &sd_card_det_config,
486 [GPIOMUX_SUSPENDED] = &sd_card_det_config,
487 },
488};
489
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700490static struct msm_gpiomux_config msm_sensor_configs[] __initdata = {
491 {
492 .gpio = 15, /* CAM_MCLK0 */
493 .settings = {
494 [GPIOMUX_ACTIVE] = &cam_settings[0],
495 [GPIOMUX_SUSPENDED] = &cam_settings[1],
496 },
497 },
498 {
499 .gpio = 16, /* CAM_MCLK1 */
500 .settings = {
501 [GPIOMUX_ACTIVE] = &cam_settings[0],
502 [GPIOMUX_SUSPENDED] = &cam_settings[1],
503 },
504 },
505 {
506 .gpio = 17, /* CAM_MCLK2 */
507 .settings = {
508 [GPIOMUX_ACTIVE] = &cam_settings[0],
509 [GPIOMUX_SUSPENDED] = &cam_settings[1],
510 },
511 },
512 {
513 .gpio = 18, /* WEBCAM1_RESET_N / CAM_MCLK3 */
514 .settings = {
Sreesudhan Ramakrish Ramkumar88c4a092012-09-07 23:43:46 -0700515 [GPIOMUX_ACTIVE] = &cam_settings[3],
516 [GPIOMUX_SUSPENDED] = &cam_settings[4],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700517 },
518 },
519 {
520 .gpio = 19, /* CCI_I2C_SDA0 */
521 .settings = {
522 [GPIOMUX_ACTIVE] = &cam_settings[0],
523 [GPIOMUX_SUSPENDED] = &cam_settings[2],
524 },
525 },
526 {
527 .gpio = 20, /* CCI_I2C_SCL0 */
528 .settings = {
529 [GPIOMUX_ACTIVE] = &cam_settings[0],
530 [GPIOMUX_SUSPENDED] = &cam_settings[2],
531 },
532 },
533 {
534 .gpio = 21, /* CCI_I2C_SDA1 */
535 .settings = {
536 [GPIOMUX_ACTIVE] = &cam_settings[0],
537 [GPIOMUX_SUSPENDED] = &cam_settings[2],
538 },
539 },
540 {
541 .gpio = 22, /* CCI_I2C_SCL1 */
542 .settings = {
543 [GPIOMUX_ACTIVE] = &cam_settings[0],
544 [GPIOMUX_SUSPENDED] = &cam_settings[2],
545 },
546 },
547 {
548 .gpio = 23, /* FLASH_LED_EN */
549 .settings = {
550 [GPIOMUX_ACTIVE] = &cam_settings[0],
551 [GPIOMUX_SUSPENDED] = &cam_settings[1],
552 },
553 },
554 {
555 .gpio = 24, /* FLASH_LED_NOW */
556 .settings = {
557 [GPIOMUX_ACTIVE] = &cam_settings[0],
558 [GPIOMUX_SUSPENDED] = &cam_settings[1],
559 },
560 },
561 {
562 .gpio = 25, /* WEBCAM2_RESET_N */
563 .settings = {
564 [GPIOMUX_ACTIVE] = &cam_settings[0],
565 [GPIOMUX_SUSPENDED] = &cam_settings[1],
566 },
567 },
568 {
569 .gpio = 26, /* CAM_IRQ */
570 .settings = {
571 [GPIOMUX_ACTIVE] = &cam_settings[0],
572 [GPIOMUX_SUSPENDED] = &cam_settings[1],
573 },
574 },
575 {
576 .gpio = 27, /* OIS_SYNC */
577 .settings = {
578 [GPIOMUX_ACTIVE] = &cam_settings[0],
579 [GPIOMUX_SUSPENDED] = &cam_settings[1],
580 },
581 },
582 {
583 .gpio = 28, /* WEBCAM1_STANDBY */
584 .settings = {
585 [GPIOMUX_ACTIVE] = &cam_settings[0],
586 [GPIOMUX_SUSPENDED] = &cam_settings[1],
587 },
588 },
589 {
590 .gpio = 89, /* CAM1_STANDBY_N */
591 .settings = {
592 [GPIOMUX_ACTIVE] = &cam_settings[0],
593 [GPIOMUX_SUSPENDED] = &cam_settings[1],
594 },
595 },
596 {
597 .gpio = 90, /* CAM1_RST_N */
598 .settings = {
599 [GPIOMUX_ACTIVE] = &cam_settings[0],
600 [GPIOMUX_SUSPENDED] = &cam_settings[1],
601 },
602 },
603 {
604 .gpio = 91, /* CAM2_STANDBY_N */
605 .settings = {
606 [GPIOMUX_ACTIVE] = &cam_settings[0],
607 [GPIOMUX_SUSPENDED] = &cam_settings[1],
608 },
609 },
610 {
611 .gpio = 92, /* CAM2_RST_N */
612 .settings = {
613 [GPIOMUX_ACTIVE] = &cam_settings[0],
614 [GPIOMUX_SUSPENDED] = &cam_settings[1],
615 },
616 },
617};
Sameer Thalappil8d686d42012-08-24 10:07:31 -0700618static struct msm_gpiomux_config wcnss_5wire_interface[] = {
619 {
620 .gpio = 36,
621 .settings = {
622 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
623 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
624 },
625 },
626 {
627 .gpio = 37,
628 .settings = {
629 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
630 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
631 },
632 },
633 {
634 .gpio = 38,
635 .settings = {
636 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
637 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
638 },
639 },
640 {
641 .gpio = 39,
642 .settings = {
643 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
644 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
645 },
646 },
647 {
648 .gpio = 40,
649 .settings = {
650 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
651 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
652 },
653 },
654};
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700655
Joonwoo Park187e9cb2012-08-24 22:47:53 -0700656static struct msm_gpiomux_config msm_taiko_config[] __initdata = {
657 {
658 .gpio = 63, /* SYS_RST_N */
659 .settings = {
660 [GPIOMUX_SUSPENDED] = &taiko_reset,
661 },
Joonwoo Parkeb84dc72012-09-12 10:22:49 -0700662 },
663 {
664 .gpio = 72, /* CDC_INT */
665 .settings = {
666 [GPIOMUX_SUSPENDED] = &taiko_int,
667 },
668 },
Joonwoo Park187e9cb2012-08-24 22:47:53 -0700669};
670
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700671void __init msm_8974_init_gpiomux(void)
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700672{
673 int rc;
674
675 rc = msm_gpiomux_init(NR_GPIO_IRQS);
676 if (rc) {
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700677 pr_err(KERN_ERR "msm_8974_init_gpiomux failed %d\n", rc);
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700678 return;
679 }
680
Sathish Ambleye3154b42012-04-09 10:59:09 -0700681#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
682 msm_gpiomux_install(msm_eth_configs, ARRAY_SIZE(msm_eth_configs));
683#endif
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700684 msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));
Sameer Thalappil8d686d42012-08-24 10:07:31 -0700685 msm_gpiomux_install(wcnss_5wire_interface,
686 ARRAY_SIZE(wcnss_5wire_interface));
Sagar Dhariaa8e6b0a2012-08-10 20:52:30 -0600687
688 msm_gpiomux_install(msm8974_slimbus_config,
689 ARRAY_SIZE(msm8974_slimbus_config));
690
Amy Maloche9e99a792012-08-15 23:27:51 -0700691 msm_gpiomux_install(msm_touch_configs, ARRAY_SIZE(msm_touch_configs));
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700692
693 msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));
Joonwoo Park187e9cb2012-08-24 22:47:53 -0700694
Subhash Jadavani76aa7de2012-10-10 09:58:17 +0530695 msm_gpiomux_install(&sd_card_det, 1);
696
Joonwoo Park187e9cb2012-08-24 22:47:53 -0700697 msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config));
Ujwal Patel74b5df42012-08-13 22:50:13 -0700698
Manu Gautamac7265b2012-11-21 11:49:15 +0530699 msm_gpiomux_install(msm_hsic_configs, ARRAY_SIZE(msm_hsic_configs));
700 msm_gpiomux_install(msm_hsic_hub_configs,
701 ARRAY_SIZE(msm_hsic_hub_configs));
702
Ujwal Patel74b5df42012-08-13 22:50:13 -0700703 msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs));
Manoj Rao5bf2a7e2012-10-29 12:53:27 -0700704 msm_gpiomux_install(msm_mhl_configs, ARRAY_SIZE(msm_mhl_configs));
Stepan Moskovchenko95108b82012-11-27 14:28:11 -0800705
706 if (machine_is_msm8974_rumi())
707 msm_gpiomux_install(msm_rumi_blsp_configs,
708 ARRAY_SIZE(msm_rumi_blsp_configs));
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700709}