blob: 9f1f870fdcf391ac0dc004d0fe665cdbd9a74b7e [file] [log] [blame]
Damir Didjusto93768d12013-01-17 11:30:47 -08001/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -07002 *
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
Pawan Kumar Nimmagaddabefacac2013-01-23 15:36:28 -080071static struct gpiomux_setting gpio_suspend_config[] = {
72 {
73 .func = GPIOMUX_FUNC_GPIO, /* IN-NP */
74 .drv = GPIOMUX_DRV_2MA,
75 .pull = GPIOMUX_PULL_NONE,
76 },
77 {
78 .func = GPIOMUX_FUNC_GPIO, /* O-LOW */
79 .drv = GPIOMUX_DRV_2MA,
80 .pull = GPIOMUX_PULL_NONE,
81 .dir = GPIOMUX_OUT_LOW,
82 },
83};
84
Siddartha Mohanadossc4bc6ae2012-12-06 14:22:22 -080085static struct gpiomux_setting gpio_epm_config = {
86 .func = GPIOMUX_FUNC_GPIO,
87 .drv = GPIOMUX_DRV_2MA,
88 .pull = GPIOMUX_PULL_DOWN,
89};
90
Sameer Thalappil8d686d42012-08-24 10:07:31 -070091static struct gpiomux_setting wcnss_5wire_suspend_cfg = {
92 .func = GPIOMUX_FUNC_GPIO,
93 .drv = GPIOMUX_DRV_2MA,
94 .pull = GPIOMUX_PULL_UP,
95};
96
97static struct gpiomux_setting wcnss_5wire_active_cfg = {
98 .func = GPIOMUX_FUNC_1,
99 .drv = GPIOMUX_DRV_6MA,
100 .pull = GPIOMUX_PULL_DOWN,
101};
102
Ram Mohan Korukonda56ac5232013-03-20 23:48:34 +0530103static struct gpiomux_setting ath_gpio_active_cfg = {
104 .func = GPIOMUX_FUNC_GPIO,
105 .drv = GPIOMUX_DRV_2MA,
106 .pull = GPIOMUX_PULL_UP,
107};
108
109static struct gpiomux_setting ath_gpio_suspend_cfg = {
110 .func = GPIOMUX_FUNC_GPIO,
111 .drv = GPIOMUX_DRV_2MA,
112 .pull = GPIOMUX_PULL_DOWN,
113};
114
Jin Honga04caaa2012-05-23 10:28:27 -0700115static struct gpiomux_setting gpio_i2c_config = {
116 .func = GPIOMUX_FUNC_3,
Gilad Avidovb7d8bb12012-11-09 16:30:37 -0700117 /*
118 * Please keep I2C GPIOs drive-strength at minimum (2ma). It is a
119 * workaround for HW issue of glitches caused by rapid GPIO current-
120 * change.
121 */
122 .drv = GPIOMUX_DRV_2MA,
Jin Honga04caaa2012-05-23 10:28:27 -0700123 .pull = GPIOMUX_PULL_NONE,
124};
125
Chandan Uddaraju88b26d72012-08-13 22:28:44 -0700126static struct gpiomux_setting lcd_en_act_cfg = {
127 .func = GPIOMUX_FUNC_GPIO,
128 .drv = GPIOMUX_DRV_8MA,
129 .pull = GPIOMUX_PULL_NONE,
Siddhartha Agrawal6ab3e1c2013-02-22 18:30:37 -0800130 .dir = GPIOMUX_OUT_HIGH,
Chandan Uddaraju88b26d72012-08-13 22:28:44 -0700131};
132
133static struct gpiomux_setting lcd_en_sus_cfg = {
134 .func = GPIOMUX_FUNC_GPIO,
135 .drv = GPIOMUX_DRV_2MA,
136 .pull = GPIOMUX_PULL_DOWN,
137};
Sathish Ambleye3154b42012-04-09 10:59:09 -0700138
Amy Maloche9e99a792012-08-15 23:27:51 -0700139static struct gpiomux_setting atmel_resout_sus_cfg = {
140 .func = GPIOMUX_FUNC_GPIO,
141 .drv = GPIOMUX_DRV_6MA,
142 .pull = GPIOMUX_PULL_DOWN,
143};
144
145static struct gpiomux_setting atmel_resout_act_cfg = {
146 .func = GPIOMUX_FUNC_GPIO,
147 .drv = GPIOMUX_DRV_6MA,
148 .pull = GPIOMUX_PULL_UP,
149};
150
151static struct gpiomux_setting atmel_int_act_cfg = {
152 .func = GPIOMUX_FUNC_GPIO,
153 .drv = GPIOMUX_DRV_8MA,
154 .pull = GPIOMUX_PULL_UP,
155};
156
157static struct gpiomux_setting atmel_int_sus_cfg = {
158 .func = GPIOMUX_FUNC_GPIO,
159 .drv = GPIOMUX_DRV_2MA,
160 .pull = GPIOMUX_PULL_DOWN,
161};
162
Joonwoo Park187e9cb2012-08-24 22:47:53 -0700163static struct gpiomux_setting taiko_reset = {
164 .func = GPIOMUX_FUNC_GPIO,
165 .drv = GPIOMUX_DRV_6MA,
166 .pull = GPIOMUX_PULL_NONE,
167 .dir = GPIOMUX_OUT_LOW,
168};
169
Joonwoo Parkeb84dc72012-09-12 10:22:49 -0700170static struct gpiomux_setting taiko_int = {
171 .func = GPIOMUX_FUNC_GPIO,
172 .drv = GPIOMUX_DRV_2MA,
173 .pull = GPIOMUX_PULL_NONE,
174};
Amy Maloche527acc42012-12-07 18:40:54 -0800175static struct gpiomux_setting hap_lvl_shft_suspended_config = {
176 .func = GPIOMUX_FUNC_GPIO,
177 .drv = GPIOMUX_DRV_2MA,
178 .pull = GPIOMUX_PULL_DOWN,
179};
180
181static struct gpiomux_setting hap_lvl_shft_active_config = {
182 .func = GPIOMUX_FUNC_GPIO,
183 .drv = GPIOMUX_DRV_8MA,
184 .pull = GPIOMUX_PULL_UP,
185};
186static struct msm_gpiomux_config hap_lvl_shft_config[] __initdata = {
187 {
188 .gpio = 86,
189 .settings = {
190 [GPIOMUX_SUSPENDED] = &hap_lvl_shft_suspended_config,
191 [GPIOMUX_ACTIVE] = &hap_lvl_shft_active_config,
192 },
193 },
194};
Joonwoo Parkeb84dc72012-09-12 10:22:49 -0700195
Amy Maloche9e99a792012-08-15 23:27:51 -0700196static struct msm_gpiomux_config msm_touch_configs[] __initdata = {
197 {
198 .gpio = 60, /* TOUCH RESET */
199 .settings = {
200 [GPIOMUX_ACTIVE] = &atmel_resout_act_cfg,
201 [GPIOMUX_SUSPENDED] = &atmel_resout_sus_cfg,
202 },
203 },
204 {
205 .gpio = 61, /* TOUCH IRQ */
206 .settings = {
207 [GPIOMUX_ACTIVE] = &atmel_int_act_cfg,
208 [GPIOMUX_SUSPENDED] = &atmel_int_sus_cfg,
209 },
210 },
211
212};
Ujwal Patel74b5df42012-08-13 22:50:13 -0700213
Manu Gautamac7265b2012-11-21 11:49:15 +0530214static struct gpiomux_setting hsic_sus_cfg = {
215 .func = GPIOMUX_FUNC_GPIO,
216 .drv = GPIOMUX_DRV_2MA,
217 .pull = GPIOMUX_PULL_DOWN,
Manu Gautamac7265b2012-11-21 11:49:15 +0530218};
219
220static struct gpiomux_setting hsic_act_cfg = {
221 .func = GPIOMUX_FUNC_1,
222 .drv = GPIOMUX_DRV_12MA,
223 .pull = GPIOMUX_PULL_NONE,
224};
225
226static struct gpiomux_setting hsic_hub_act_cfg = {
227 .func = GPIOMUX_FUNC_GPIO,
228 .drv = GPIOMUX_DRV_2MA,
229 .pull = GPIOMUX_PULL_UP,
230 .dir = GPIOMUX_IN,
231};
232
Vamsi Krishnac6c16fe2013-03-11 15:54:41 -0700233static struct gpiomux_setting hsic_resume_act_cfg = {
234 .func = GPIOMUX_FUNC_GPIO,
235 .drv = GPIOMUX_DRV_2MA,
236 .pull = GPIOMUX_PULL_DOWN,
237 .dir = GPIOMUX_OUT_LOW,
238};
239
240static struct gpiomux_setting hsic_resume_susp_cfg = {
241 .func = GPIOMUX_FUNC_GPIO,
242 .drv = GPIOMUX_DRV_2MA,
243 .pull = GPIOMUX_PULL_NONE,
244};
245
Manu Gautamac7265b2012-11-21 11:49:15 +0530246static struct msm_gpiomux_config msm_hsic_configs[] = {
247 {
248 .gpio = 144, /*HSIC_STROBE */
249 .settings = {
250 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
251 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
252 },
253 },
254 {
255 .gpio = 145, /* HSIC_DATA */
256 .settings = {
257 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
258 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
259 },
260 },
Vamsi Krishnac6c16fe2013-03-11 15:54:41 -0700261 {
262 .gpio = 80,
263 .settings = {
264 [GPIOMUX_ACTIVE] = &hsic_resume_act_cfg,
265 [GPIOMUX_SUSPENDED] = &hsic_resume_susp_cfg,
266 },
267 },
Manu Gautamac7265b2012-11-21 11:49:15 +0530268};
269
270static struct msm_gpiomux_config msm_hsic_hub_configs[] = {
271 {
272 .gpio = 50, /* HSIC_HUB_INT_N */
273 .settings = {
274 [GPIOMUX_ACTIVE] = &hsic_hub_act_cfg,
275 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
276 },
277 },
278};
279
Manoj Rao5bf2a7e2012-10-29 12:53:27 -0700280static struct gpiomux_setting mhl_suspend_config = {
281 .func = GPIOMUX_FUNC_GPIO,
282 .drv = GPIOMUX_DRV_2MA,
283 .pull = GPIOMUX_PULL_DOWN,
284};
285
286static struct gpiomux_setting mhl_active_1_cfg = {
287 .func = GPIOMUX_FUNC_1,
288 .drv = GPIOMUX_DRV_2MA,
289 .pull = GPIOMUX_PULL_UP,
290 .dir = GPIOMUX_OUT_HIGH,
291};
292
Ujwal Patel74b5df42012-08-13 22:50:13 -0700293static struct gpiomux_setting hdmi_suspend_cfg = {
294 .func = GPIOMUX_FUNC_GPIO,
295 .drv = GPIOMUX_DRV_2MA,
296 .pull = GPIOMUX_PULL_DOWN,
297};
298
299static struct gpiomux_setting hdmi_active_1_cfg = {
300 .func = GPIOMUX_FUNC_1,
301 .drv = GPIOMUX_DRV_2MA,
302 .pull = GPIOMUX_PULL_UP,
303};
304
305static struct gpiomux_setting hdmi_active_2_cfg = {
306 .func = GPIOMUX_FUNC_1,
307 .drv = GPIOMUX_DRV_16MA,
308 .pull = GPIOMUX_PULL_DOWN,
309};
310
Manoj Rao5bf2a7e2012-10-29 12:53:27 -0700311static struct msm_gpiomux_config msm_mhl_configs[] __initdata = {
312 {
313 /* mhl-sii8334 pwr */
314 .gpio = 12,
315 .settings = {
316 [GPIOMUX_SUSPENDED] = &mhl_suspend_config,
317 [GPIOMUX_ACTIVE] = &mhl_active_1_cfg,
318 },
319 },
320 {
321 /* mhl-sii8334 intr */
322 .gpio = 82,
323 .settings = {
324 [GPIOMUX_SUSPENDED] = &mhl_suspend_config,
325 [GPIOMUX_ACTIVE] = &mhl_active_1_cfg,
326 },
327 },
Manoj Rao5bf2a7e2012-10-29 12:53:27 -0700328};
329
330
Ujwal Patel74b5df42012-08-13 22:50:13 -0700331static struct msm_gpiomux_config msm_hdmi_configs[] __initdata = {
332 {
333 .gpio = 31,
334 .settings = {
335 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
336 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
337 },
338 },
339 {
340 .gpio = 32,
341 .settings = {
342 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
343 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
344 },
345 },
346 {
347 .gpio = 33,
348 .settings = {
349 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
350 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
351 },
352 },
353 {
354 .gpio = 34,
355 .settings = {
356 [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg,
357 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
358 },
359 },
360};
361
Saket Saurabheac58342013-02-05 12:20:18 +0530362static struct gpiomux_setting gpio_uart7_active_cfg = {
363 .func = GPIOMUX_FUNC_3,
364 .drv = GPIOMUX_DRV_8MA,
365 .pull = GPIOMUX_PULL_NONE,
366};
367
368static struct gpiomux_setting gpio_uart7_suspend_cfg = {
369 .func = GPIOMUX_FUNC_GPIO,
370 .drv = GPIOMUX_DRV_2MA,
371 .pull = GPIOMUX_PULL_DOWN,
372};
373
374static struct msm_gpiomux_config msm_blsp2_uart7_configs[] __initdata = {
375 {
376 .gpio = 41, /* BLSP2 UART7 TX */
377 .settings = {
378 [GPIOMUX_ACTIVE] = &gpio_uart7_active_cfg,
379 [GPIOMUX_SUSPENDED] = &gpio_uart7_suspend_cfg,
380 },
381 },
382 {
383 .gpio = 42, /* BLSP2 UART7 RX */
384 .settings = {
385 [GPIOMUX_ACTIVE] = &gpio_uart7_active_cfg,
386 [GPIOMUX_SUSPENDED] = &gpio_uart7_suspend_cfg,
387 },
388 },
389 {
390 .gpio = 43, /* BLSP2 UART7 CTS */
391 .settings = {
392 [GPIOMUX_ACTIVE] = &gpio_uart7_active_cfg,
393 [GPIOMUX_SUSPENDED] = &gpio_uart7_suspend_cfg,
394 },
395 },
396 {
397 .gpio = 44, /* BLSP2 UART7 RFR */
398 .settings = {
399 [GPIOMUX_ACTIVE] = &gpio_uart7_active_cfg,
400 [GPIOMUX_SUSPENDED] = &gpio_uart7_suspend_cfg,
401 },
402 },
403};
404
Stepan Moskovchenko95108b82012-11-27 14:28:11 -0800405static struct msm_gpiomux_config msm_rumi_blsp_configs[] __initdata = {
406 {
407 .gpio = 45, /* BLSP2 UART8 TX */
408 .settings = {
409 [GPIOMUX_SUSPENDED] = &gpio_uart_config,
410 },
411 },
412 {
413 .gpio = 46, /* BLSP2 UART8 RX */
414 .settings = {
415 [GPIOMUX_SUSPENDED] = &gpio_uart_config,
416 },
417 },
418};
419
Siddhartha Agrawal6ab3e1c2013-02-22 18:30:37 -0800420static struct msm_gpiomux_config msm_lcd_configs[] __initdata = {
421 {
422 .gpio = 58,
423 .settings = {
424 [GPIOMUX_ACTIVE] = &lcd_en_act_cfg,
425 [GPIOMUX_SUSPENDED] = &lcd_en_sus_cfg,
426 },
427 },
428};
429
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700430static struct msm_gpiomux_config msm_blsp_configs[] __initdata = {
Sathish Ambleye3154b42012-04-09 10:59:09 -0700431#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
432 {
433 .gpio = 0, /* BLSP1 QUP SPI_DATA_MOSI */
434 .settings = {
435 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
436 },
437 },
438 {
439 .gpio = 1, /* BLSP1 QUP SPI_DATA_MISO */
440 .settings = {
441 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
442 },
443 },
444 {
445 .gpio = 3, /* BLSP1 QUP SPI_CLK */
446 .settings = {
447 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
448 },
449 },
450 {
Subbaraman Narayanamurthy3f93ab12012-08-17 19:39:47 -0700451 .gpio = 9, /* BLSP1 QUP SPI_CS2A_N */
Sathish Ambleye3154b42012-04-09 10:59:09 -0700452 .settings = {
Subbaraman Narayanamurthy3f93ab12012-08-17 19:39:47 -0700453 [GPIOMUX_SUSPENDED] = &gpio_spi_cs2_config,
454 },
455 },
456 {
457 .gpio = 8, /* BLSP1 QUP SPI_CS1_N */
458 .settings = {
459 [GPIOMUX_SUSPENDED] = &gpio_spi_cs1_config,
Sathish Ambleye3154b42012-04-09 10:59:09 -0700460 },
461 },
462#endif
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700463 {
Amy Malochebc7e9672012-08-15 10:30:40 -0700464 .gpio = 6, /* BLSP1 QUP2 I2C_DAT */
465 .settings = {
466 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
467 },
468 },
469 {
470 .gpio = 7, /* BLSP1 QUP2 I2C_CLK */
471 .settings = {
472 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
473 },
474 },
475 {
Jin Honga04caaa2012-05-23 10:28:27 -0700476 .gpio = 83, /* BLSP11 QUP I2C_DAT */
477 .settings = {
478 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
479 },
480 },
481 {
482 .gpio = 84, /* BLSP11 QUP I2C_CLK */
483 .settings = {
484 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
485 },
486 },
487 {
Stepan Moskovchenko5269b602012-08-08 17:57:09 -0700488 .gpio = 4, /* BLSP2 UART TX */
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700489 .settings = {
490 [GPIOMUX_SUSPENDED] = &gpio_uart_config,
491 },
492 },
493 {
Stepan Moskovchenko5269b602012-08-08 17:57:09 -0700494 .gpio = 5, /* BLSP2 UART RX */
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700495 .settings = {
496 [GPIOMUX_SUSPENDED] = &gpio_uart_config,
497 },
498 },
Sagar Dhariae0bb6502012-08-10 20:25:51 -0600499 {
500 .gpio = 53, /* BLSP2 QUP4 SPI_DATA_MOSI */
501 .settings = {
Pawan Kumar Nimmagaddabefacac2013-01-23 15:36:28 -0800502 [GPIOMUX_ACTIVE] = &gpio_spi_config,
503 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
Sagar Dhariae0bb6502012-08-10 20:25:51 -0600504 },
505 },
506 {
507 .gpio = 54, /* BLSP2 QUP4 SPI_DATA_MISO */
508 .settings = {
Pawan Kumar Nimmagaddabefacac2013-01-23 15:36:28 -0800509 [GPIOMUX_ACTIVE] = &gpio_spi_config,
510 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
Sagar Dhariae0bb6502012-08-10 20:25:51 -0600511 },
512 },
513 {
514 .gpio = 56, /* BLSP2 QUP4 SPI_CLK */
515 .settings = {
Pawan Kumar Nimmagaddabefacac2013-01-23 15:36:28 -0800516 [GPIOMUX_ACTIVE] = &gpio_spi_config,
517 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
Sagar Dhariae0bb6502012-08-10 20:25:51 -0600518 },
519 },
520 {
521 .gpio = 55, /* BLSP2 QUP4 SPI_CS0_N */
522 .settings = {
Pawan Kumar Nimmagaddabefacac2013-01-23 15:36:28 -0800523 [GPIOMUX_ACTIVE] = &gpio_spi_config,
524 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
Sagar Dhariae0bb6502012-08-10 20:25:51 -0600525 },
526 },
Siddartha Mohanadossc4bc6ae2012-12-06 14:22:22 -0800527 {
528 .gpio = 81, /* EPM enable */
529 .settings = {
530 [GPIOMUX_SUSPENDED] = &gpio_epm_config,
531 },
532 },
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700533};
534
Sagar Dhariaa8e6b0a2012-08-10 20:52:30 -0600535static struct msm_gpiomux_config msm8974_slimbus_config[] __initdata = {
536 {
537 .gpio = 70, /* slimbus clk */
538 .settings = {
539 [GPIOMUX_SUSPENDED] = &slimbus,
540 },
541 },
542 {
543 .gpio = 71, /* slimbus data */
544 .settings = {
545 [GPIOMUX_SUSPENDED] = &slimbus,
546 },
547 },
548};
549
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700550static struct gpiomux_setting cam_settings[] = {
551 {
Sreesudhan Ramakrish Ramkumar88c4a092012-09-07 23:43:46 -0700552 .func = GPIOMUX_FUNC_1, /*active 1*/ /* 0 */
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700553 .drv = GPIOMUX_DRV_2MA,
554 .pull = GPIOMUX_PULL_NONE,
555 },
556
557 {
Sreesudhan Ramakrish Ramkumar88c4a092012-09-07 23:43:46 -0700558 .func = GPIOMUX_FUNC_1, /*suspend*/ /* 1 */
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700559 .drv = GPIOMUX_DRV_2MA,
560 .pull = GPIOMUX_PULL_DOWN,
561 },
562
563 {
Sreesudhan Ramakrish Ramkumar88c4a092012-09-07 23:43:46 -0700564 .func = GPIOMUX_FUNC_1, /*i2c suspend*/ /* 2 */
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700565 .drv = GPIOMUX_DRV_2MA,
566 .pull = GPIOMUX_PULL_KEEPER,
567 },
Sreesudhan Ramakrish Ramkumar88c4a092012-09-07 23:43:46 -0700568
569 {
570 .func = GPIOMUX_FUNC_GPIO, /*active 0*/ /* 3 */
571 .drv = GPIOMUX_DRV_2MA,
572 .pull = GPIOMUX_PULL_NONE,
573 },
574
575 {
576 .func = GPIOMUX_FUNC_GPIO, /*suspend 0*/ /* 4 */
577 .drv = GPIOMUX_DRV_2MA,
578 .pull = GPIOMUX_PULL_DOWN,
579 },
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700580};
581
Subhash Jadavani77e6cd72013-01-15 18:44:51 +0530582static struct gpiomux_setting sd_card_det_active_config = {
Subhash Jadavani76aa7de2012-10-10 09:58:17 +0530583 .func = GPIOMUX_FUNC_GPIO,
584 .drv = GPIOMUX_DRV_2MA,
585 .pull = GPIOMUX_PULL_NONE,
586 .dir = GPIOMUX_IN,
587};
588
Subhash Jadavani77e6cd72013-01-15 18:44:51 +0530589static struct gpiomux_setting sd_card_det_sleep_config = {
590 .func = GPIOMUX_FUNC_GPIO,
591 .drv = GPIOMUX_DRV_2MA,
592 .pull = GPIOMUX_PULL_UP,
593 .dir = GPIOMUX_IN,
594};
595
Subhash Jadavani76aa7de2012-10-10 09:58:17 +0530596static struct msm_gpiomux_config sd_card_det __initdata = {
597 .gpio = 62,
598 .settings = {
Subhash Jadavani77e6cd72013-01-15 18:44:51 +0530599 [GPIOMUX_ACTIVE] = &sd_card_det_active_config,
600 [GPIOMUX_SUSPENDED] = &sd_card_det_sleep_config,
Subhash Jadavani76aa7de2012-10-10 09:58:17 +0530601 },
602};
603
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700604static struct msm_gpiomux_config msm_sensor_configs[] __initdata = {
605 {
606 .gpio = 15, /* CAM_MCLK0 */
607 .settings = {
608 [GPIOMUX_ACTIVE] = &cam_settings[0],
609 [GPIOMUX_SUSPENDED] = &cam_settings[1],
610 },
611 },
612 {
613 .gpio = 16, /* CAM_MCLK1 */
614 .settings = {
615 [GPIOMUX_ACTIVE] = &cam_settings[0],
616 [GPIOMUX_SUSPENDED] = &cam_settings[1],
617 },
618 },
619 {
620 .gpio = 17, /* CAM_MCLK2 */
621 .settings = {
622 [GPIOMUX_ACTIVE] = &cam_settings[0],
623 [GPIOMUX_SUSPENDED] = &cam_settings[1],
624 },
625 },
626 {
627 .gpio = 18, /* WEBCAM1_RESET_N / CAM_MCLK3 */
628 .settings = {
Sreesudhan Ramakrish Ramkumar88c4a092012-09-07 23:43:46 -0700629 [GPIOMUX_ACTIVE] = &cam_settings[3],
630 [GPIOMUX_SUSPENDED] = &cam_settings[4],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700631 },
632 },
633 {
634 .gpio = 19, /* CCI_I2C_SDA0 */
635 .settings = {
636 [GPIOMUX_ACTIVE] = &cam_settings[0],
Pawan Kumar Nimmagadda53621562013-01-28 13:11:44 -0800637 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700638 },
639 },
640 {
641 .gpio = 20, /* CCI_I2C_SCL0 */
642 .settings = {
643 [GPIOMUX_ACTIVE] = &cam_settings[0],
Pawan Kumar Nimmagadda53621562013-01-28 13:11:44 -0800644 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700645 },
646 },
647 {
648 .gpio = 21, /* CCI_I2C_SDA1 */
649 .settings = {
650 [GPIOMUX_ACTIVE] = &cam_settings[0],
Pawan Kumar Nimmagadda53621562013-01-28 13:11:44 -0800651 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700652 },
653 },
654 {
655 .gpio = 22, /* CCI_I2C_SCL1 */
656 .settings = {
657 [GPIOMUX_ACTIVE] = &cam_settings[0],
Pawan Kumar Nimmagadda53621562013-01-28 13:11:44 -0800658 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700659 },
660 },
661 {
662 .gpio = 23, /* FLASH_LED_EN */
663 .settings = {
664 [GPIOMUX_ACTIVE] = &cam_settings[0],
Pawan Kumar Nimmagadda53621562013-01-28 13:11:44 -0800665 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700666 },
667 },
668 {
669 .gpio = 24, /* FLASH_LED_NOW */
670 .settings = {
671 [GPIOMUX_ACTIVE] = &cam_settings[0],
Pawan Kumar Nimmagadda53621562013-01-28 13:11:44 -0800672 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700673 },
674 },
675 {
676 .gpio = 25, /* WEBCAM2_RESET_N */
677 .settings = {
Sreesudhan Ramakrish Ramkumara92d0b72013-03-12 23:39:07 -0700678 [GPIOMUX_ACTIVE] = &cam_settings[3],
Pawan Kumar Nimmagadda53621562013-01-28 13:11:44 -0800679 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700680 },
681 },
682 {
683 .gpio = 26, /* CAM_IRQ */
684 .settings = {
685 [GPIOMUX_ACTIVE] = &cam_settings[0],
686 [GPIOMUX_SUSPENDED] = &cam_settings[1],
687 },
688 },
689 {
690 .gpio = 27, /* OIS_SYNC */
691 .settings = {
692 [GPIOMUX_ACTIVE] = &cam_settings[0],
Pawan Kumar Nimmagadda53621562013-01-28 13:11:44 -0800693 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700694 },
695 },
696 {
697 .gpio = 28, /* WEBCAM1_STANDBY */
698 .settings = {
Sreesudhan Ramakrish Ramkumara92d0b72013-03-12 23:39:07 -0700699 [GPIOMUX_ACTIVE] = &cam_settings[3],
Pawan Kumar Nimmagadda53621562013-01-28 13:11:44 -0800700 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700701 },
702 },
703 {
704 .gpio = 89, /* CAM1_STANDBY_N */
705 .settings = {
Sreesudhan Ramakrish Ramkumara92d0b72013-03-12 23:39:07 -0700706 [GPIOMUX_ACTIVE] = &cam_settings[3],
707 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700708 },
709 },
710 {
711 .gpio = 90, /* CAM1_RST_N */
712 .settings = {
Sreesudhan Ramakrish Ramkumara92d0b72013-03-12 23:39:07 -0700713 [GPIOMUX_ACTIVE] = &cam_settings[3],
714 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700715 },
716 },
717 {
718 .gpio = 91, /* CAM2_STANDBY_N */
719 .settings = {
Sreesudhan Ramakrish Ramkumara92d0b72013-03-12 23:39:07 -0700720 [GPIOMUX_ACTIVE] = &cam_settings[3],
721 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700722 },
723 },
724 {
725 .gpio = 92, /* CAM2_RST_N */
726 .settings = {
Sreesudhan Ramakrish Ramkumara92d0b72013-03-12 23:39:07 -0700727 [GPIOMUX_ACTIVE] = &cam_settings[3],
728 [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1],
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700729 },
730 },
731};
Damir Didjusto04d3c362013-01-07 14:30:53 -0800732
Banajit Goswami8521b122013-04-03 10:56:11 -0700733static struct gpiomux_setting auxpcm_act_cfg = {
Damir Didjusto04d3c362013-01-07 14:30:53 -0800734 .func = GPIOMUX_FUNC_1,
735 .drv = GPIOMUX_DRV_8MA,
736 .pull = GPIOMUX_PULL_NONE,
737};
738
739
Banajit Goswami8521b122013-04-03 10:56:11 -0700740static struct gpiomux_setting auxpcm_sus_cfg = {
Damir Didjusto04d3c362013-01-07 14:30:53 -0800741 .func = GPIOMUX_FUNC_1,
742 .drv = GPIOMUX_DRV_2MA,
743 .pull = GPIOMUX_PULL_DOWN,
744};
745
746static struct msm_gpiomux_config msm8974_pri_auxpcm_configs[] __initdata = {
747 {
748 .gpio = 65,
749 .settings = {
Banajit Goswami8521b122013-04-03 10:56:11 -0700750 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
751 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
Damir Didjusto04d3c362013-01-07 14:30:53 -0800752 },
753 },
754 {
755 .gpio = 66,
756 .settings = {
Banajit Goswami8521b122013-04-03 10:56:11 -0700757 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
758 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
Damir Didjusto04d3c362013-01-07 14:30:53 -0800759 },
760 },
761 {
762 .gpio = 67,
763 .settings = {
Banajit Goswami8521b122013-04-03 10:56:11 -0700764 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
765 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
Damir Didjusto04d3c362013-01-07 14:30:53 -0800766 },
767 },
768 {
769 .gpio = 68,
770 .settings = {
Banajit Goswami8521b122013-04-03 10:56:11 -0700771 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
772 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
773 },
774 },
775};
776
777static struct msm_gpiomux_config msm8974_sec_auxpcm_configs[] __initdata = {
778 {
779 .gpio = 79,
780 .settings = {
781 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
782 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
783 },
784 },
785 {
786 .gpio = 80,
787 .settings = {
788 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
789 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
790 },
791 },
792 {
793 .gpio = 81,
794 .settings = {
795 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
796 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
797 },
798 },
799 {
800 .gpio = 82,
801 .settings = {
802 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
803 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
Damir Didjusto04d3c362013-01-07 14:30:53 -0800804 },
805 },
806};
807
Sameer Thalappil8d686d42012-08-24 10:07:31 -0700808static struct msm_gpiomux_config wcnss_5wire_interface[] = {
809 {
810 .gpio = 36,
811 .settings = {
812 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
813 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
814 },
815 },
816 {
817 .gpio = 37,
818 .settings = {
819 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
820 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
821 },
822 },
823 {
824 .gpio = 38,
825 .settings = {
826 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
827 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
828 },
829 },
830 {
831 .gpio = 39,
832 .settings = {
833 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
834 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
835 },
836 },
837 {
838 .gpio = 40,
839 .settings = {
840 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
841 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
842 },
843 },
844};
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700845
Ram Mohan Korukonda56ac5232013-03-20 23:48:34 +0530846
847static struct msm_gpiomux_config ath_gpio_configs[] = {
848 {
849 .gpio = 51,
850 .settings = {
851 [GPIOMUX_ACTIVE] = &ath_gpio_active_cfg,
852 [GPIOMUX_SUSPENDED] = &ath_gpio_suspend_cfg,
853 },
854 },
855 {
856 .gpio = 79,
857 .settings = {
858 [GPIOMUX_ACTIVE] = &ath_gpio_active_cfg,
859 [GPIOMUX_SUSPENDED] = &ath_gpio_suspend_cfg,
860 },
861 },
862};
863
Joonwoo Park187e9cb2012-08-24 22:47:53 -0700864static struct msm_gpiomux_config msm_taiko_config[] __initdata = {
865 {
866 .gpio = 63, /* SYS_RST_N */
867 .settings = {
868 [GPIOMUX_SUSPENDED] = &taiko_reset,
869 },
Joonwoo Parkeb84dc72012-09-12 10:22:49 -0700870 },
871 {
872 .gpio = 72, /* CDC_INT */
873 .settings = {
874 [GPIOMUX_SUSPENDED] = &taiko_int,
875 },
876 },
Joonwoo Park187e9cb2012-08-24 22:47:53 -0700877};
878
Subhash Jadavani102f0ce2012-12-14 21:25:59 +0530879#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
880static struct gpiomux_setting sdc3_clk_actv_cfg = {
881 .func = GPIOMUX_FUNC_2,
882 .drv = GPIOMUX_DRV_8MA,
883 .pull = GPIOMUX_PULL_NONE,
884};
885
886static struct gpiomux_setting sdc3_cmd_data_0_3_actv_cfg = {
887 .func = GPIOMUX_FUNC_2,
888 .drv = GPIOMUX_DRV_8MA,
889 .pull = GPIOMUX_PULL_UP,
890};
891
892static struct gpiomux_setting sdc3_suspend_cfg = {
893 .func = GPIOMUX_FUNC_GPIO,
894 .drv = GPIOMUX_DRV_2MA,
895 .pull = GPIOMUX_PULL_DOWN,
896};
897
898static struct gpiomux_setting sdc3_data_1_suspend_cfg = {
899 .func = GPIOMUX_FUNC_GPIO,
900 .drv = GPIOMUX_DRV_8MA,
901 .pull = GPIOMUX_PULL_UP,
902};
903
904static struct msm_gpiomux_config msm8974_sdc3_configs[] __initdata = {
905 {
906 /* DAT3 */
907 .gpio = 35,
908 .settings = {
909 [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
910 [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
911 },
912 },
913 {
914 /* DAT2 */
915 .gpio = 36,
916 .settings = {
917 [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
918 [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
919 },
920 },
921 {
922 /* DAT1 */
923 .gpio = 37,
924 .settings = {
925 [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
926 [GPIOMUX_SUSPENDED] = &sdc3_data_1_suspend_cfg,
927 },
928 },
929 {
930 /* DAT0 */
931 .gpio = 38,
932 .settings = {
933 [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
934 [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
935 },
936 },
937 {
938 /* CMD */
939 .gpio = 39,
940 .settings = {
941 [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
942 [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
943 },
944 },
945 {
946 /* CLK */
947 .gpio = 40,
948 .settings = {
949 [GPIOMUX_ACTIVE] = &sdc3_clk_actv_cfg,
950 [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
951 },
952 },
953};
954
955static void msm_gpiomux_sdc3_install(void)
956{
957 msm_gpiomux_install(msm8974_sdc3_configs,
958 ARRAY_SIZE(msm8974_sdc3_configs));
959}
960#else
961static void msm_gpiomux_sdc3_install(void) {}
962#endif /* CONFIG_MMC_MSM_SDC3_SUPPORT */
963
964#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
965static struct gpiomux_setting sdc4_clk_actv_cfg = {
966 .func = GPIOMUX_FUNC_2,
967 .drv = GPIOMUX_DRV_8MA,
968 .pull = GPIOMUX_PULL_NONE,
969};
970
971static struct gpiomux_setting sdc4_cmd_data_0_3_actv_cfg = {
972 .func = GPIOMUX_FUNC_2,
973 .drv = GPIOMUX_DRV_8MA,
974 .pull = GPIOMUX_PULL_UP,
975};
976
977static struct gpiomux_setting sdc4_suspend_cfg = {
978 .func = GPIOMUX_FUNC_GPIO,
979 .drv = GPIOMUX_DRV_2MA,
980 .pull = GPIOMUX_PULL_DOWN,
981};
982
983static struct gpiomux_setting sdc4_data_1_suspend_cfg = {
984 .func = GPIOMUX_FUNC_GPIO,
985 .drv = GPIOMUX_DRV_8MA,
986 .pull = GPIOMUX_PULL_UP,
987};
988
989static struct msm_gpiomux_config msm8974_sdc4_configs[] __initdata = {
990 {
991 /* DAT3 */
992 .gpio = 92,
993 .settings = {
994 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg,
995 [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg,
996 },
997 },
998 {
999 /* DAT2 */
1000 .gpio = 94,
1001 .settings = {
1002 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg,
1003 [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg,
1004 },
1005 },
1006 {
1007 /* DAT1 */
1008 .gpio = 95,
1009 .settings = {
1010 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg,
1011 [GPIOMUX_SUSPENDED] = &sdc4_data_1_suspend_cfg,
1012 },
1013 },
1014 {
1015 /* DAT0 */
1016 .gpio = 96,
1017 .settings = {
1018 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg,
1019 [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg,
1020 },
1021 },
1022 {
1023 /* CMD */
1024 .gpio = 91,
1025 .settings = {
1026 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg,
1027 [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg,
1028 },
1029 },
1030 {
1031 /* CLK */
1032 .gpio = 93,
1033 .settings = {
1034 [GPIOMUX_ACTIVE] = &sdc4_clk_actv_cfg,
1035 [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg,
1036 },
1037 },
1038};
1039
1040static void msm_gpiomux_sdc4_install(void)
1041{
1042 msm_gpiomux_install(msm8974_sdc4_configs,
1043 ARRAY_SIZE(msm8974_sdc4_configs));
1044}
1045#else
1046static void msm_gpiomux_sdc4_install(void) {}
1047#endif /* CONFIG_MMC_MSM_SDC4_SUPPORT */
1048
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -07001049void __init msm_8974_init_gpiomux(void)
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -07001050{
1051 int rc;
1052
Rohit Vaswani341c2032012-11-08 18:49:29 -08001053 rc = msm_gpiomux_init_dt();
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -07001054 if (rc) {
Rohit Vaswani341c2032012-11-08 18:49:29 -08001055 pr_err("%s failed %d\n", __func__, rc);
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -07001056 return;
1057 }
1058
Sathish Ambleye3154b42012-04-09 10:59:09 -07001059#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
1060 msm_gpiomux_install(msm_eth_configs, ARRAY_SIZE(msm_eth_configs));
1061#endif
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -07001062 msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));
Saket Saurabheac58342013-02-05 12:20:18 +05301063 msm_gpiomux_install(msm_blsp2_uart7_configs,
1064 ARRAY_SIZE(msm_blsp2_uart7_configs));
Sameer Thalappil8d686d42012-08-24 10:07:31 -07001065 msm_gpiomux_install(wcnss_5wire_interface,
1066 ARRAY_SIZE(wcnss_5wire_interface));
Ram Mohan Korukondaf0f07ec2013-04-13 10:26:11 -07001067 if (of_board_is_liquid())
1068 msm_gpiomux_install_nowrite(ath_gpio_configs,
1069 ARRAY_SIZE(ath_gpio_configs));
Sagar Dhariaa8e6b0a2012-08-10 20:52:30 -06001070 msm_gpiomux_install(msm8974_slimbus_config,
1071 ARRAY_SIZE(msm8974_slimbus_config));
1072
Amy Maloche9e99a792012-08-15 23:27:51 -07001073 msm_gpiomux_install(msm_touch_configs, ARRAY_SIZE(msm_touch_configs));
Amy Maloche527acc42012-12-07 18:40:54 -08001074 msm_gpiomux_install(hap_lvl_shft_config,
1075 ARRAY_SIZE(hap_lvl_shft_config));
Kevin Chanbdcf7ef2012-08-24 08:33:33 -07001076
1077 msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));
Joonwoo Park187e9cb2012-08-24 22:47:53 -07001078
Subhash Jadavani76aa7de2012-10-10 09:58:17 +05301079 msm_gpiomux_install(&sd_card_det, 1);
Subhash Jadavani102f0ce2012-12-14 21:25:59 +05301080 msm_gpiomux_sdc3_install();
1081 msm_gpiomux_sdc4_install();
Subhash Jadavani76aa7de2012-10-10 09:58:17 +05301082
Joonwoo Park187e9cb2012-08-24 22:47:53 -07001083 msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config));
Ujwal Patel74b5df42012-08-13 22:50:13 -07001084
Manu Gautamac7265b2012-11-21 11:49:15 +05301085 msm_gpiomux_install(msm_hsic_configs, ARRAY_SIZE(msm_hsic_configs));
1086 msm_gpiomux_install(msm_hsic_hub_configs,
1087 ARRAY_SIZE(msm_hsic_hub_configs));
1088
Ujwal Patel74b5df42012-08-13 22:50:13 -07001089 msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs));
Stepan Moskovchenko82f0eab2013-04-02 19:52:28 -07001090 if (of_board_is_fluid())
Stepan Moskovchenkoebd05412013-02-07 20:39:56 -08001091 msm_gpiomux_install(msm_mhl_configs,
1092 ARRAY_SIZE(msm_mhl_configs));
Stepan Moskovchenko95108b82012-11-27 14:28:11 -08001093
Damir Didjusto04d3c362013-01-07 14:30:53 -08001094 msm_gpiomux_install(msm8974_pri_auxpcm_configs,
1095 ARRAY_SIZE(msm8974_pri_auxpcm_configs));
Banajit Goswami8521b122013-04-03 10:56:11 -07001096 msm_gpiomux_install(msm8974_sec_auxpcm_configs,
1097 ARRAY_SIZE(msm8974_sec_auxpcm_configs));
Damir Didjusto04d3c362013-01-07 14:30:53 -08001098
Siddhartha Agrawal6ab3e1c2013-02-22 18:30:37 -08001099 msm_gpiomux_install_nowrite(msm_lcd_configs,
1100 ARRAY_SIZE(msm_lcd_configs));
1101
Stepan Moskovchenko82f0eab2013-04-02 19:52:28 -07001102 if (of_board_is_rumi())
Stepan Moskovchenko95108b82012-11-27 14:28:11 -08001103 msm_gpiomux_install(msm_rumi_blsp_configs,
1104 ARRAY_SIZE(msm_rumi_blsp_configs));
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -07001105}