blob: 6f61217b8ed996aa9e07de49ca69314e7a47a958 [file] [log] [blame]
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -08001/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
Hanumant Singh55a1bb02012-11-06 10:01:15 -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 <mach/board.h>
17#include <mach/gpio.h>
18#include <mach/gpiomux.h>
Figo Wangb1510f82013-06-13 19:40:20 +080019#include <mach/socinfo.h>
Hanumant Singh55a1bb02012-11-06 10:01:15 -080020
Gilad Avidova460c472013-04-12 16:23:32 -060021static struct gpiomux_setting gpio_spi_config = {
22 .func = GPIOMUX_FUNC_1,
23 .drv = GPIOMUX_DRV_6MA,
24 .pull = GPIOMUX_PULL_NONE,
25};
26
Gilad Avidovf84f2792013-01-31 13:26:39 -070027static struct gpiomux_setting gpio_i2c_config = {
28 .func = GPIOMUX_FUNC_3,
29 .drv = GPIOMUX_DRV_2MA,
30 .pull = GPIOMUX_PULL_NONE,
31};
32
Kenneth Heitke0d4fbb12013-04-10 12:51:14 -060033static struct gpiomux_setting gpio_cam_i2c_config = {
34 .func = GPIOMUX_FUNC_1,
35 .drv = GPIOMUX_DRV_2MA,
36 .pull = GPIOMUX_PULL_NONE,
37};
38
Bansidhar Gopalacharie331f372013-09-25 19:50:43 +010039static struct gpiomux_setting gpio_nfc_config = {
40 .func = GPIOMUX_FUNC_2,
41 .drv = GPIOMUX_DRV_2MA,
42 .pull = GPIOMUX_PULL_NONE,
43};
44static struct gpiomux_setting gpio_nfc_sus_config = {
45 .func = GPIOMUX_FUNC_2,
46 .drv = GPIOMUX_DRV_2MA,
47 .pull = GPIOMUX_PULL_DOWN,
48};
49
Chun Zhangf39a0652013-05-01 15:57:54 -070050static struct gpiomux_setting atmel_int_act_cfg = {
51 .func = GPIOMUX_FUNC_GPIO,
52 .drv = GPIOMUX_DRV_8MA,
53 .pull = GPIOMUX_PULL_UP,
Gilad Avidovf58f1832013-01-09 17:31:28 -070054};
55
Chun Zhangf39a0652013-05-01 15:57:54 -070056static struct gpiomux_setting atmel_int_sus_cfg = {
57 .func = GPIOMUX_FUNC_GPIO,
58 .drv = GPIOMUX_DRV_2MA,
59 .pull = GPIOMUX_PULL_DOWN,
60};
61
62static struct gpiomux_setting atmel_reset_act_cfg = {
63 .func = GPIOMUX_FUNC_GPIO,
64 .drv = GPIOMUX_DRV_6MA,
65 .pull = GPIOMUX_PULL_UP,
66};
67
68static struct gpiomux_setting atmel_reset_sus_cfg = {
69 .func = GPIOMUX_FUNC_GPIO,
Gilad Avidovf58f1832013-01-09 17:31:28 -070070 .drv = GPIOMUX_DRV_6MA,
71 .pull = GPIOMUX_PULL_DOWN,
72};
73
Figo Wangb1510f82013-06-13 19:40:20 +080074static struct gpiomux_setting focaltech_int_act_cfg = {
75 .func = GPIOMUX_FUNC_GPIO,
76 .drv = GPIOMUX_DRV_8MA,
77 .pull = GPIOMUX_PULL_UP,
78};
79
80static struct gpiomux_setting focaltech_int_sus_cfg = {
81 .func = GPIOMUX_FUNC_GPIO,
82 .drv = GPIOMUX_DRV_2MA,
83 .pull = GPIOMUX_PULL_DOWN,
84};
85
86static struct gpiomux_setting focaltech_reset_act_cfg = {
87 .func = GPIOMUX_FUNC_GPIO,
88 .drv = GPIOMUX_DRV_6MA,
89 .pull = GPIOMUX_PULL_UP,
90};
91
92static struct gpiomux_setting focaltech_reset_sus_cfg = {
93 .func = GPIOMUX_FUNC_GPIO,
94 .drv = GPIOMUX_DRV_6MA,
95 .pull = GPIOMUX_PULL_UP,
96};
97
Sameer Thalappil1fafd672013-04-03 12:31:04 -070098static struct gpiomux_setting wcnss_5wire_suspend_cfg = {
99 .func = GPIOMUX_FUNC_GPIO,
100 .drv = GPIOMUX_DRV_2MA,
101 .pull = GPIOMUX_PULL_UP,
102};
103
104static struct gpiomux_setting wcnss_5wire_active_cfg = {
105 .func = GPIOMUX_FUNC_1,
106 .drv = GPIOMUX_DRV_6MA,
107 .pull = GPIOMUX_PULL_DOWN,
108};
109
Xiaoming Zhou17972262013-04-10 17:50:35 -0400110static struct gpiomux_setting lcd_en_act_cfg = {
111 .func = GPIOMUX_FUNC_GPIO,
112 .drv = GPIOMUX_DRV_8MA,
113 .pull = GPIOMUX_PULL_NONE,
114 .dir = GPIOMUX_OUT_HIGH,
115};
116
117static struct gpiomux_setting lcd_en_sus_cfg = {
118 .func = GPIOMUX_FUNC_GPIO,
119 .drv = GPIOMUX_DRV_2MA,
120 .pull = GPIOMUX_PULL_DOWN,
121};
122
Xiaoming Zhou8dca7e42013-05-31 19:44:57 -0400123static struct gpiomux_setting lcd_te_act_config = {
124 .func = GPIOMUX_FUNC_1,
125 .drv = GPIOMUX_DRV_2MA,
126 .pull = GPIOMUX_PULL_DOWN,
127 .dir = GPIOMUX_IN,
128};
129
130static struct gpiomux_setting lcd_te_sus_config = {
131 .func = GPIOMUX_FUNC_1,
132 .drv = GPIOMUX_DRV_2MA,
133 .pull = GPIOMUX_PULL_DOWN,
134 .dir = GPIOMUX_IN,
135};
136
Amy Maloche19c386b2013-04-15 14:06:01 -0700137static struct gpiomux_setting gpio_keys_active = {
138 .func = GPIOMUX_FUNC_GPIO,
139 .drv = GPIOMUX_DRV_2MA,
140 .pull = GPIOMUX_PULL_UP,
141};
142
143static struct gpiomux_setting gpio_keys_suspend = {
144 .func = GPIOMUX_FUNC_GPIO,
145 .drv = GPIOMUX_DRV_2MA,
146 .pull = GPIOMUX_PULL_NONE,
147};
148
Richard Liua1d406a2013-04-14 13:46:48 -0700149/* define gpio used as interrupt input */
150static struct gpiomux_setting gpio_int_act_cfg = {
151 .func = GPIOMUX_FUNC_GPIO,
152 .drv = GPIOMUX_DRV_2MA,
153 .pull = GPIOMUX_PULL_UP,
154 .dir = GPIOMUX_IN,
155};
156
157static struct gpiomux_setting gpio_int_sus_cfg = {
158 .func = GPIOMUX_FUNC_GPIO,
159 .drv = GPIOMUX_DRV_2MA,
160 .pull = GPIOMUX_PULL_UP,
161 .dir = GPIOMUX_IN,
162};
163
164static struct msm_gpiomux_config msm_gpio_int_configs[] __initdata = {
165 {
166 .gpio = 84,
167 .settings = {
168 [GPIOMUX_ACTIVE] = &gpio_int_act_cfg,
169 [GPIOMUX_SUSPENDED] = &gpio_int_sus_cfg,
170 },
171 },
172};
173
Xiaoming Zhou17972262013-04-10 17:50:35 -0400174static struct msm_gpiomux_config msm_lcd_configs[] __initdata = {
175 {
176 .gpio = 41,
177 .settings = {
178 [GPIOMUX_ACTIVE] = &lcd_en_act_cfg,
179 [GPIOMUX_SUSPENDED] = &lcd_en_sus_cfg,
180 },
181 },
182 {
183 .gpio = 7,
184 .settings = {
185 [GPIOMUX_ACTIVE] = &lcd_en_act_cfg,
186 [GPIOMUX_SUSPENDED] = &lcd_en_sus_cfg,
187 },
188 },
Xiaoming Zhou8dca7e42013-05-31 19:44:57 -0400189 {
190 .gpio = 12,
191 .settings = {
192 [GPIOMUX_ACTIVE] = &lcd_te_act_config,
193 [GPIOMUX_SUSPENDED] = &lcd_te_sus_config,
194 },
195 },
Xiaoming Zhou17972262013-04-10 17:50:35 -0400196};
197
Gilad Avidovf84f2792013-01-31 13:26:39 -0700198static struct msm_gpiomux_config msm_blsp_configs[] __initdata = {
199 {
Chun Zhangf39a0652013-05-01 15:57:54 -0700200 .gpio = 2, /* BLSP1 QUP1 I2C_SDA */
201 .settings = {
Bingzhe Cai12487222013-09-02 22:37:36 +0800202 [GPIOMUX_ACTIVE] = &gpio_i2c_config,
Chun Zhangf39a0652013-05-01 15:57:54 -0700203 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
204 },
205 },
206 {
207 .gpio = 3, /* BLSP1 QUP1 I2C_SCL */
208 .settings = {
Bingzhe Cai12487222013-09-02 22:37:36 +0800209 [GPIOMUX_ACTIVE] = &gpio_i2c_config,
Chun Zhangf39a0652013-05-01 15:57:54 -0700210 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
211 },
212 },
213 {
Gilad Avidovf58f1832013-01-09 17:31:28 -0700214 .gpio = 10, /* BLSP1 QUP3 I2C_SDA */
Gilad Avidovf84f2792013-01-31 13:26:39 -0700215 .settings = {
Bingzhe Cai12487222013-09-02 22:37:36 +0800216 [GPIOMUX_ACTIVE] = &gpio_i2c_config,
Gilad Avidovf84f2792013-01-31 13:26:39 -0700217 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
218 },
219 },
220 {
Gilad Avidovf58f1832013-01-09 17:31:28 -0700221 .gpio = 11, /* BLSP1 QUP3 I2C_SCL */
Gilad Avidovf84f2792013-01-31 13:26:39 -0700222 .settings = {
Bingzhe Cai12487222013-09-02 22:37:36 +0800223 [GPIOMUX_ACTIVE] = &gpio_i2c_config,
Gilad Avidovf84f2792013-01-31 13:26:39 -0700224 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
225 },
226 },
Gilad Avidovf58f1832013-01-09 17:31:28 -0700227 {
Kenneth Heitke0d4fbb12013-04-10 12:51:14 -0600228 .gpio = 16, /* BLSP1 QUP6 I2C_SDA */
229 .settings = {
Bingzhe Cai12487222013-09-02 22:37:36 +0800230 [GPIOMUX_ACTIVE] = &gpio_cam_i2c_config,
Kenneth Heitke0d4fbb12013-04-10 12:51:14 -0600231 [GPIOMUX_SUSPENDED] = &gpio_cam_i2c_config,
232 },
233 },
234 {
235 .gpio = 17, /* BLSP1 QUP6 I2C_SCL */
236 .settings = {
Bingzhe Cai12487222013-09-02 22:37:36 +0800237 [GPIOMUX_ACTIVE] = &gpio_cam_i2c_config,
Kenneth Heitke0d4fbb12013-04-10 12:51:14 -0600238 [GPIOMUX_SUSPENDED] = &gpio_cam_i2c_config,
239 },
240 },
Bansidhar Gopalacharie331f372013-09-25 19:50:43 +0100241 {
242 .gpio = 78, /* NFC CLK */
243 .settings = {
244 [GPIOMUX_ACTIVE] = &gpio_nfc_config,
245 [GPIOMUX_SUSPENDED] = &gpio_nfc_sus_config,
246 },
247 },
Chun Zhangf39a0652013-05-01 15:57:54 -0700248};
249
250static struct msm_gpiomux_config msm_atmel_configs[] __initdata = {
Kenneth Heitke0d4fbb12013-04-10 12:51:14 -0600251 {
Chun Zhangf39a0652013-05-01 15:57:54 -0700252 .gpio = 0, /* TOUCH RESET */
Gilad Avidovf58f1832013-01-09 17:31:28 -0700253 .settings = {
Chun Zhangf39a0652013-05-01 15:57:54 -0700254 [GPIOMUX_ACTIVE] = &atmel_reset_act_cfg,
255 [GPIOMUX_SUSPENDED] = &atmel_reset_sus_cfg,
Gilad Avidovf58f1832013-01-09 17:31:28 -0700256 },
257 },
258 {
Chun Zhangf39a0652013-05-01 15:57:54 -0700259 .gpio = 1, /* TOUCH INT */
Gilad Avidovf58f1832013-01-09 17:31:28 -0700260 .settings = {
Chun Zhangf39a0652013-05-01 15:57:54 -0700261 [GPIOMUX_ACTIVE] = &atmel_int_act_cfg,
262 [GPIOMUX_SUSPENDED] = &atmel_int_sus_cfg,
Gilad Avidovf58f1832013-01-09 17:31:28 -0700263 },
264 },
Gilad Avidova460c472013-04-12 16:23:32 -0600265 {
266 .gpio = 86, /* BLSP1 QUP4 SPI_DATA_MOSI */
267 .settings = {
268 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
269 },
270 },
271 {
272 .gpio = 87, /* BLSP1 QUP4 SPI_DATA_MISO */
273 .settings = {
274 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
275 },
276 },
277 {
278 .gpio = 89, /* BLSP1 QUP4 SPI_CLK */
279 .settings = {
280 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
281 },
282 },
283 {
284 .gpio = 88, /* BLSP1 QUP4 SPI_CS */
285 .settings = {
286 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
287 },
288 },
Gilad Avidovf84f2792013-01-31 13:26:39 -0700289};
290
Figo Wangb1510f82013-06-13 19:40:20 +0800291static struct msm_gpiomux_config msm_focaltech_configs[] __initdata = {
292 {
293 .gpio = 0, /* TOUCH RESET */
294 .settings = {
295 [GPIOMUX_ACTIVE] = &focaltech_reset_act_cfg,
296 [GPIOMUX_SUSPENDED] = &focaltech_reset_sus_cfg,
297 },
298 },
299 {
300 .gpio = 1, /* TOUCH INT */
301 .settings = {
302 [GPIOMUX_ACTIVE] = &focaltech_int_act_cfg,
303 [GPIOMUX_SUSPENDED] = &focaltech_int_sus_cfg,
304 },
305 },
306 {
307 .gpio = 86, /* BLSP1 QUP4 SPI_DATA_MOSI */
308 .settings = {
309 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
310 },
311 },
312 {
313 .gpio = 87, /* BLSP1 QUP4 SPI_DATA_MISO */
314 .settings = {
315 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
316 },
317 },
318 {
319 .gpio = 89, /* BLSP1 QUP4 SPI_CLK */
320 .settings = {
321 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
322 },
323 },
324 {
325 .gpio = 88, /* BLSP1 QUP4 SPI_CS */
326 .settings = {
327 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
328 },
329 },
330};
331
332
Sameer Thalappil1fafd672013-04-03 12:31:04 -0700333static struct msm_gpiomux_config wcnss_5wire_interface[] = {
334 {
335 .gpio = 23,
336 .settings = {
337 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
338 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
339 },
340 },
341 {
342 .gpio = 24,
343 .settings = {
344 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
345 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
346 },
347 },
348 {
349 .gpio = 25,
350 .settings = {
351 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
352 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
353 },
354 },
355 {
356 .gpio = 26,
357 .settings = {
358 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
359 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
360 },
361 },
362 {
363 .gpio = 27,
364 .settings = {
365 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
366 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
367 },
368 },
369};
370
Lokesh Kumar Aakulu329a3472013-06-03 06:08:17 -0700371static struct gpiomux_setting gpio_suspend_config[] = {
372 {
373 .func = GPIOMUX_FUNC_GPIO, /* IN-NP */
374 .drv = GPIOMUX_DRV_2MA,
375 .pull = GPIOMUX_PULL_NONE,
376 },
377 {
378 .func = GPIOMUX_FUNC_GPIO, /* O-LOW */
379 .drv = GPIOMUX_DRV_2MA,
380 .pull = GPIOMUX_PULL_NONE,
381 .dir = GPIOMUX_OUT_LOW,
382 },
383};
384
385static struct gpiomux_setting cam_settings[] = {
386 {
387 .func = GPIOMUX_FUNC_1, /*active 1*/ /* 0 */
388 .drv = GPIOMUX_DRV_2MA,
389 .pull = GPIOMUX_PULL_NONE,
390 },
391
392 {
393 .func = GPIOMUX_FUNC_1, /*suspend*/ /* 1 */
394 .drv = GPIOMUX_DRV_2MA,
395 .pull = GPIOMUX_PULL_DOWN,
396 },
397
398 {
399 .func = GPIOMUX_FUNC_1, /*i2c suspend*/ /* 2 */
400 .drv = GPIOMUX_DRV_2MA,
401 .pull = GPIOMUX_PULL_KEEPER,
402 },
403
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 },
415};
416
417static struct msm_gpiomux_config msm_sensor_configs[] __initdata = {
418 {
419 .gpio = 13, /* CAM_MCLK0 */
420 .settings = {
421 [GPIOMUX_ACTIVE] = &cam_settings[0],
422 [GPIOMUX_SUSPENDED] = &cam_settings[1],
423 },
424 },
425 {
426 .gpio = 14, /* CAM_MCLK1 */
427 .settings = {
428 [GPIOMUX_ACTIVE] = &cam_settings[0],
429 [GPIOMUX_SUSPENDED] = &cam_settings[1],
430 },
431 },
432 {
433 .gpio = 16, /* CCI_I2C_SDA */
434 .settings = {
435 [GPIOMUX_ACTIVE] = &cam_settings[0],
436 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
437 },
438 },
439 {
440 .gpio = 17, /* CCI_I2C_SCL */
441 .settings = {
442 [GPIOMUX_ACTIVE] = &cam_settings[0],
443 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
444 },
445 },
446 {
447 .gpio = 18, /* FLASH_LED_EN */
448 .settings = {
Lokesh Kumar Aakulu034626d2013-05-10 20:30:07 -0700449 [GPIOMUX_ACTIVE] = &cam_settings[3],
Lokesh Kumar Aakulu329a3472013-06-03 06:08:17 -0700450 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
451 },
452 },
453 {
454 .gpio = 19, /* FLASH_LED_NOW */
455 .settings = {
Lokesh Kumar Aakulu034626d2013-05-10 20:30:07 -0700456 [GPIOMUX_ACTIVE] = &cam_settings[3],
Lokesh Kumar Aakulu329a3472013-06-03 06:08:17 -0700457 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
458 },
459 },
460 {
461 .gpio = 8, /* CAM1_STANDBY_N */
462 .settings = {
463 [GPIOMUX_ACTIVE] = &cam_settings[3],
464 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
465 },
466 },
467 {
468 .gpio = 15, /* CAM1_RST_N */
469 .settings = {
470 [GPIOMUX_ACTIVE] = &cam_settings[3],
471 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
472 },
473 },
474 {
475 .gpio = 20, /* WEBCAM1_STANDBY */
476 .settings = {
477 [GPIOMUX_ACTIVE] = &cam_settings[3],
478 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
479 },
480 },
481 {
482 .gpio = 21, /* WEBCAM2_RESET_N */
483 .settings = {
484 [GPIOMUX_ACTIVE] = &cam_settings[3],
485 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
486 },
487 },
488};
489
Amy Maloche19c386b2013-04-15 14:06:01 -0700490static struct msm_gpiomux_config msm_keypad_configs[] __initdata = {
491 {
492 .gpio = 72,
493 .settings = {
494 [GPIOMUX_ACTIVE] = &gpio_keys_active,
495 [GPIOMUX_SUSPENDED] = &gpio_keys_suspend,
496 },
497 },
498 {
499 .gpio = 73,
500 .settings = {
501 [GPIOMUX_ACTIVE] = &gpio_keys_active,
502 [GPIOMUX_SUSPENDED] = &gpio_keys_suspend,
503 },
504 },
505 {
506 .gpio = 74,
507 .settings = {
508 [GPIOMUX_ACTIVE] = &gpio_keys_active,
509 [GPIOMUX_SUSPENDED] = &gpio_keys_suspend,
510 },
511 },
512};
513
Venkat Gopalakrishnan8aaf15a2013-04-30 16:27:03 -0700514static struct gpiomux_setting sd_card_det_active_config = {
515 .func = GPIOMUX_FUNC_GPIO,
516 .drv = GPIOMUX_DRV_2MA,
517 .pull = GPIOMUX_PULL_NONE,
518 .dir = GPIOMUX_IN,
519};
520
521static struct gpiomux_setting sd_card_det_suspend_config = {
522 .func = GPIOMUX_FUNC_GPIO,
523 .drv = GPIOMUX_DRV_2MA,
524 .pull = GPIOMUX_PULL_UP,
525 .dir = GPIOMUX_IN,
526};
527
528static struct msm_gpiomux_config sd_card_det[] __initdata = {
529 {
530 .gpio = 42,
531 .settings = {
532 [GPIOMUX_ACTIVE] = &sd_card_det_active_config,
533 [GPIOMUX_SUSPENDED] = &sd_card_det_suspend_config,
534 },
535 },
536};
537
Bingzhe Caife20b712013-07-15 16:48:49 +0800538static struct gpiomux_setting interrupt_gpio_active = {
539 .func = GPIOMUX_FUNC_GPIO,
540 .drv = GPIOMUX_DRV_6MA,
541 .pull = GPIOMUX_PULL_UP,
542};
543
544static struct gpiomux_setting interrupt_gpio_suspend_pullup = {
545 .func = GPIOMUX_FUNC_GPIO,
546 .drv = GPIOMUX_DRV_6MA,
547 .pull = GPIOMUX_PULL_UP,
548};
549
550static struct gpiomux_setting interrupt_gpio_suspend_pulldown = {
551 .func = GPIOMUX_FUNC_GPIO,
552 .drv = GPIOMUX_DRV_6MA,
553 .pull = GPIOMUX_PULL_UP,
554};
555
556static struct msm_gpiomux_config msm_interrupt_configs[] __initdata = {
557 {
558 .gpio = 77, /* NFC_IRQ */
559 .settings = {
560 [GPIOMUX_ACTIVE] = &interrupt_gpio_active,
561 [GPIOMUX_SUSPENDED] = &interrupt_gpio_suspend_pullup,
562 },
563 },
564 {
Bingzhe Caife20b712013-07-15 16:48:49 +0800565 .gpio = 80, /*ALSP_INT */
566 .settings = {
567 [GPIOMUX_ACTIVE] = &interrupt_gpio_active,
568 [GPIOMUX_SUSPENDED] = &interrupt_gpio_suspend_pullup,
569 },
570 },
571 {
572 .gpio = 81, /*ACCEL_INT1 */
573 .settings = {
574 [GPIOMUX_ACTIVE] = &interrupt_gpio_active,
575 [GPIOMUX_SUSPENDED] = &interrupt_gpio_suspend_pulldown,
576 },
577 },
578 {
579 .gpio = 82, /*ACCEL_INT2 */
580 .settings = {
581 [GPIOMUX_ACTIVE] = &interrupt_gpio_active,
582 [GPIOMUX_SUSPENDED] = &interrupt_gpio_suspend_pulldown,
583 },
584 },
585};
586
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800587void __init msm8610_init_gpiomux(void)
Hanumant Singh55a1bb02012-11-06 10:01:15 -0800588{
589 int rc;
590
Rohit Vaswani341c2032012-11-08 18:49:29 -0800591 rc = msm_gpiomux_init_dt();
Hanumant Singh55a1bb02012-11-06 10:01:15 -0800592 if (rc) {
Rohit Vaswani341c2032012-11-08 18:49:29 -0800593 pr_err("%s failed %d\n", __func__, rc);
Hanumant Singh55a1bb02012-11-06 10:01:15 -0800594 return;
595 }
Gilad Avidovf84f2792013-01-31 13:26:39 -0700596
597 msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));
Figo Wangb1510f82013-06-13 19:40:20 +0800598 if (of_board_is_qrd()) {
599 msm_gpiomux_install(msm_focaltech_configs,
600 ARRAY_SIZE(msm_focaltech_configs));
601 } else {
602 msm_gpiomux_install(msm_atmel_configs,
Chun Zhangf39a0652013-05-01 15:57:54 -0700603 ARRAY_SIZE(msm_atmel_configs));
Figo Wangb1510f82013-06-13 19:40:20 +0800604 }
Sameer Thalappil1fafd672013-04-03 12:31:04 -0700605 msm_gpiomux_install(wcnss_5wire_interface,
606 ARRAY_SIZE(wcnss_5wire_interface));
Xiaoming Zhoua329c942013-07-10 10:32:20 -0400607 msm_gpiomux_install_nowrite(msm_lcd_configs,
608 ARRAY_SIZE(msm_lcd_configs));
Amy Maloche19c386b2013-04-15 14:06:01 -0700609 msm_gpiomux_install(msm_keypad_configs,
610 ARRAY_SIZE(msm_keypad_configs));
Venkat Gopalakrishnan8aaf15a2013-04-30 16:27:03 -0700611 msm_gpiomux_install(sd_card_det, ARRAY_SIZE(sd_card_det));
Lokesh Kumar Aakulu329a3472013-06-03 06:08:17 -0700612 msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));
Richard Liua1d406a2013-04-14 13:46:48 -0700613 msm_gpiomux_install(msm_gpio_int_configs,
614 ARRAY_SIZE(msm_gpio_int_configs));
Bingzhe Caife20b712013-07-15 16:48:49 +0800615 if (of_board_is_qrd())
616 msm_gpiomux_install(msm_interrupt_configs,
617 ARRAY_SIZE(msm_interrupt_configs));
Hanumant Singh55a1bb02012-11-06 10:01:15 -0800618}