blob: 705275c0e33044cddd07135f2cfc6ec268f50b08 [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
Banajit Goswamic8dcf0f2013-04-09 18:21:23 -0700746/* Primary AUXPCM port sharing GPIO lines with Primary MI2S */
747static struct msm_gpiomux_config msm8974_pri_pri_auxpcm_configs[] __initdata = {
Damir Didjusto04d3c362013-01-07 14:30:53 -0800748 {
749 .gpio = 65,
750 .settings = {
Banajit Goswami8521b122013-04-03 10:56:11 -0700751 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
752 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
Damir Didjusto04d3c362013-01-07 14:30:53 -0800753 },
754 },
755 {
756 .gpio = 66,
757 .settings = {
Banajit Goswami8521b122013-04-03 10:56:11 -0700758 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
759 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
Damir Didjusto04d3c362013-01-07 14:30:53 -0800760 },
761 },
762 {
763 .gpio = 67,
764 .settings = {
Banajit Goswami8521b122013-04-03 10:56:11 -0700765 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
766 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
Damir Didjusto04d3c362013-01-07 14:30:53 -0800767 },
768 },
769 {
770 .gpio = 68,
771 .settings = {
Banajit Goswami8521b122013-04-03 10:56:11 -0700772 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
773 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
774 },
775 },
776};
777
Banajit Goswamic8dcf0f2013-04-09 18:21:23 -0700778/* Primary AUXPCM port sharing GPIO lines with Tertiary MI2S */
779static struct msm_gpiomux_config msm8974_pri_ter_auxpcm_configs[] __initdata = {
780 {
781 .gpio = 74,
782 .settings = {
783 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
784 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
785 },
786 },
787 {
788 .gpio = 75,
789 .settings = {
790 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
791 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
792 },
793 },
794 {
795 .gpio = 76,
796 .settings = {
797 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
798 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
799 },
800 },
801 {
802 .gpio = 77,
803 .settings = {
804 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
805 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
806 },
807 },
808};
809
Banajit Goswami8521b122013-04-03 10:56:11 -0700810static struct msm_gpiomux_config msm8974_sec_auxpcm_configs[] __initdata = {
811 {
812 .gpio = 79,
813 .settings = {
814 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
815 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
816 },
817 },
818 {
819 .gpio = 80,
820 .settings = {
821 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
822 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
823 },
824 },
825 {
826 .gpio = 81,
827 .settings = {
828 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
829 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
830 },
831 },
832 {
833 .gpio = 82,
834 .settings = {
835 [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
836 [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
Damir Didjusto04d3c362013-01-07 14:30:53 -0800837 },
838 },
839};
840
Sameer Thalappil8d686d42012-08-24 10:07:31 -0700841static struct msm_gpiomux_config wcnss_5wire_interface[] = {
842 {
843 .gpio = 36,
844 .settings = {
845 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
846 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
847 },
848 },
849 {
850 .gpio = 37,
851 .settings = {
852 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
853 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
854 },
855 },
856 {
857 .gpio = 38,
858 .settings = {
859 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
860 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
861 },
862 },
863 {
864 .gpio = 39,
865 .settings = {
866 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
867 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
868 },
869 },
870 {
871 .gpio = 40,
872 .settings = {
873 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
874 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
875 },
876 },
877};
Kevin Chanbdcf7ef2012-08-24 08:33:33 -0700878
Ram Mohan Korukonda56ac5232013-03-20 23:48:34 +0530879
880static struct msm_gpiomux_config ath_gpio_configs[] = {
881 {
882 .gpio = 51,
883 .settings = {
884 [GPIOMUX_ACTIVE] = &ath_gpio_active_cfg,
885 [GPIOMUX_SUSPENDED] = &ath_gpio_suspend_cfg,
886 },
887 },
888 {
889 .gpio = 79,
890 .settings = {
891 [GPIOMUX_ACTIVE] = &ath_gpio_active_cfg,
892 [GPIOMUX_SUSPENDED] = &ath_gpio_suspend_cfg,
893 },
894 },
895};
896
Joonwoo Park187e9cb2012-08-24 22:47:53 -0700897static struct msm_gpiomux_config msm_taiko_config[] __initdata = {
898 {
899 .gpio = 63, /* SYS_RST_N */
900 .settings = {
901 [GPIOMUX_SUSPENDED] = &taiko_reset,
902 },
Joonwoo Parkeb84dc72012-09-12 10:22:49 -0700903 },
904 {
905 .gpio = 72, /* CDC_INT */
906 .settings = {
907 [GPIOMUX_SUSPENDED] = &taiko_int,
908 },
909 },
Joonwoo Park187e9cb2012-08-24 22:47:53 -0700910};
911
Subhash Jadavani102f0ce2012-12-14 21:25:59 +0530912#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
913static struct gpiomux_setting sdc3_clk_actv_cfg = {
914 .func = GPIOMUX_FUNC_2,
915 .drv = GPIOMUX_DRV_8MA,
916 .pull = GPIOMUX_PULL_NONE,
917};
918
919static struct gpiomux_setting sdc3_cmd_data_0_3_actv_cfg = {
920 .func = GPIOMUX_FUNC_2,
921 .drv = GPIOMUX_DRV_8MA,
922 .pull = GPIOMUX_PULL_UP,
923};
924
925static struct gpiomux_setting sdc3_suspend_cfg = {
926 .func = GPIOMUX_FUNC_GPIO,
927 .drv = GPIOMUX_DRV_2MA,
928 .pull = GPIOMUX_PULL_DOWN,
929};
930
931static struct gpiomux_setting sdc3_data_1_suspend_cfg = {
932 .func = GPIOMUX_FUNC_GPIO,
933 .drv = GPIOMUX_DRV_8MA,
934 .pull = GPIOMUX_PULL_UP,
935};
936
937static struct msm_gpiomux_config msm8974_sdc3_configs[] __initdata = {
938 {
939 /* DAT3 */
940 .gpio = 35,
941 .settings = {
942 [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
943 [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
944 },
945 },
946 {
947 /* DAT2 */
948 .gpio = 36,
949 .settings = {
950 [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
951 [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
952 },
953 },
954 {
955 /* DAT1 */
956 .gpio = 37,
957 .settings = {
958 [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
959 [GPIOMUX_SUSPENDED] = &sdc3_data_1_suspend_cfg,
960 },
961 },
962 {
963 /* DAT0 */
964 .gpio = 38,
965 .settings = {
966 [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
967 [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
968 },
969 },
970 {
971 /* CMD */
972 .gpio = 39,
973 .settings = {
974 [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
975 [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
976 },
977 },
978 {
979 /* CLK */
980 .gpio = 40,
981 .settings = {
982 [GPIOMUX_ACTIVE] = &sdc3_clk_actv_cfg,
983 [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
984 },
985 },
986};
987
988static void msm_gpiomux_sdc3_install(void)
989{
990 msm_gpiomux_install(msm8974_sdc3_configs,
991 ARRAY_SIZE(msm8974_sdc3_configs));
992}
993#else
994static void msm_gpiomux_sdc3_install(void) {}
995#endif /* CONFIG_MMC_MSM_SDC3_SUPPORT */
996
997#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
998static struct gpiomux_setting sdc4_clk_actv_cfg = {
999 .func = GPIOMUX_FUNC_2,
1000 .drv = GPIOMUX_DRV_8MA,
1001 .pull = GPIOMUX_PULL_NONE,
1002};
1003
1004static struct gpiomux_setting sdc4_cmd_data_0_3_actv_cfg = {
1005 .func = GPIOMUX_FUNC_2,
1006 .drv = GPIOMUX_DRV_8MA,
1007 .pull = GPIOMUX_PULL_UP,
1008};
1009
1010static struct gpiomux_setting sdc4_suspend_cfg = {
1011 .func = GPIOMUX_FUNC_GPIO,
1012 .drv = GPIOMUX_DRV_2MA,
1013 .pull = GPIOMUX_PULL_DOWN,
1014};
1015
1016static struct gpiomux_setting sdc4_data_1_suspend_cfg = {
1017 .func = GPIOMUX_FUNC_GPIO,
1018 .drv = GPIOMUX_DRV_8MA,
1019 .pull = GPIOMUX_PULL_UP,
1020};
1021
1022static struct msm_gpiomux_config msm8974_sdc4_configs[] __initdata = {
1023 {
1024 /* DAT3 */
1025 .gpio = 92,
1026 .settings = {
1027 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg,
1028 [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg,
1029 },
1030 },
1031 {
1032 /* DAT2 */
1033 .gpio = 94,
1034 .settings = {
1035 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg,
1036 [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg,
1037 },
1038 },
1039 {
1040 /* DAT1 */
1041 .gpio = 95,
1042 .settings = {
1043 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg,
1044 [GPIOMUX_SUSPENDED] = &sdc4_data_1_suspend_cfg,
1045 },
1046 },
1047 {
1048 /* DAT0 */
1049 .gpio = 96,
1050 .settings = {
1051 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg,
1052 [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg,
1053 },
1054 },
1055 {
1056 /* CMD */
1057 .gpio = 91,
1058 .settings = {
1059 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg,
1060 [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg,
1061 },
1062 },
1063 {
1064 /* CLK */
1065 .gpio = 93,
1066 .settings = {
1067 [GPIOMUX_ACTIVE] = &sdc4_clk_actv_cfg,
1068 [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg,
1069 },
1070 },
1071};
1072
1073static void msm_gpiomux_sdc4_install(void)
1074{
1075 msm_gpiomux_install(msm8974_sdc4_configs,
1076 ARRAY_SIZE(msm8974_sdc4_configs));
1077}
1078#else
1079static void msm_gpiomux_sdc4_install(void) {}
1080#endif /* CONFIG_MMC_MSM_SDC4_SUPPORT */
1081
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -07001082void __init msm_8974_init_gpiomux(void)
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -07001083{
1084 int rc;
1085
Rohit Vaswani341c2032012-11-08 18:49:29 -08001086 rc = msm_gpiomux_init_dt();
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -07001087 if (rc) {
Rohit Vaswani341c2032012-11-08 18:49:29 -08001088 pr_err("%s failed %d\n", __func__, rc);
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -07001089 return;
1090 }
1091
Sathish Ambleye3154b42012-04-09 10:59:09 -07001092#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
1093 msm_gpiomux_install(msm_eth_configs, ARRAY_SIZE(msm_eth_configs));
1094#endif
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -07001095 msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));
Saket Saurabheac58342013-02-05 12:20:18 +05301096 msm_gpiomux_install(msm_blsp2_uart7_configs,
1097 ARRAY_SIZE(msm_blsp2_uart7_configs));
Sameer Thalappil8d686d42012-08-24 10:07:31 -07001098 msm_gpiomux_install(wcnss_5wire_interface,
1099 ARRAY_SIZE(wcnss_5wire_interface));
Ram Mohan Korukondaf0f07ec2013-04-13 10:26:11 -07001100 if (of_board_is_liquid())
1101 msm_gpiomux_install_nowrite(ath_gpio_configs,
1102 ARRAY_SIZE(ath_gpio_configs));
Sagar Dhariaa8e6b0a2012-08-10 20:52:30 -06001103 msm_gpiomux_install(msm8974_slimbus_config,
1104 ARRAY_SIZE(msm8974_slimbus_config));
1105
Amy Maloche9e99a792012-08-15 23:27:51 -07001106 msm_gpiomux_install(msm_touch_configs, ARRAY_SIZE(msm_touch_configs));
Amy Maloche527acc42012-12-07 18:40:54 -08001107 msm_gpiomux_install(hap_lvl_shft_config,
1108 ARRAY_SIZE(hap_lvl_shft_config));
Kevin Chanbdcf7ef2012-08-24 08:33:33 -07001109
1110 msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));
Joonwoo Park187e9cb2012-08-24 22:47:53 -07001111
Subhash Jadavani76aa7de2012-10-10 09:58:17 +05301112 msm_gpiomux_install(&sd_card_det, 1);
Subhash Jadavani102f0ce2012-12-14 21:25:59 +05301113 msm_gpiomux_sdc3_install();
1114 msm_gpiomux_sdc4_install();
Subhash Jadavani76aa7de2012-10-10 09:58:17 +05301115
Joonwoo Park187e9cb2012-08-24 22:47:53 -07001116 msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config));
Ujwal Patel74b5df42012-08-13 22:50:13 -07001117
Manu Gautamac7265b2012-11-21 11:49:15 +05301118 msm_gpiomux_install(msm_hsic_configs, ARRAY_SIZE(msm_hsic_configs));
1119 msm_gpiomux_install(msm_hsic_hub_configs,
1120 ARRAY_SIZE(msm_hsic_hub_configs));
1121
Ujwal Patel74b5df42012-08-13 22:50:13 -07001122 msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs));
Stepan Moskovchenko82f0eab2013-04-02 19:52:28 -07001123 if (of_board_is_fluid())
Stepan Moskovchenkoebd05412013-02-07 20:39:56 -08001124 msm_gpiomux_install(msm_mhl_configs,
1125 ARRAY_SIZE(msm_mhl_configs));
Stepan Moskovchenko95108b82012-11-27 14:28:11 -08001126
Banajit Goswamic8dcf0f2013-04-09 18:21:23 -07001127 if (of_board_is_liquid())
1128 msm_gpiomux_install(msm8974_pri_ter_auxpcm_configs,
1129 ARRAY_SIZE(msm8974_pri_ter_auxpcm_configs));
1130 else
1131 msm_gpiomux_install(msm8974_pri_pri_auxpcm_configs,
1132 ARRAY_SIZE(msm8974_pri_pri_auxpcm_configs));
1133
Banajit Goswami8521b122013-04-03 10:56:11 -07001134 msm_gpiomux_install(msm8974_sec_auxpcm_configs,
1135 ARRAY_SIZE(msm8974_sec_auxpcm_configs));
Damir Didjusto04d3c362013-01-07 14:30:53 -08001136
Siddhartha Agrawal6ab3e1c2013-02-22 18:30:37 -08001137 msm_gpiomux_install_nowrite(msm_lcd_configs,
1138 ARRAY_SIZE(msm_lcd_configs));
1139
Stepan Moskovchenko82f0eab2013-04-02 19:52:28 -07001140 if (of_board_is_rumi())
Stepan Moskovchenko95108b82012-11-27 14:28:11 -08001141 msm_gpiomux_install(msm_rumi_blsp_configs,
1142 ARRAY_SIZE(msm_rumi_blsp_configs));
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -07001143}