blob: 0f88287883eae86d25b3c2af110fcda0670bbf30 [file] [log] [blame]
Terence Hampson6b0fb7e2012-12-19 11:25:21 -05001/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
Stepan Moskovchenko2327a952011-12-14 16:31:28 -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 <linux/platform_device.h>
17#include <linux/bootmem.h>
Steve Mucklef132c6c2012-06-06 18:30:57 -070018#include <linux/gpio.h>
Stepan Moskovchenko2327a952011-12-14 16:31:28 -080019#include <asm/mach-types.h>
20#include <asm/mach/mmc.h>
21#include <mach/msm_bus_board.h>
22#include <mach/board.h>
Stepan Moskovchenko2327a952011-12-14 16:31:28 -080023#include <mach/gpiomux.h>
Joel Kingdacbc822012-01-25 13:30:57 -080024#include <mach/socinfo.h>
Stepan Moskovchenko2327a952011-12-14 16:31:28 -080025#include "devices.h"
26#include "board-8064.h"
27
28#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
29static struct gpiomux_setting gpio_eth_config = {
30 .pull = GPIOMUX_PULL_NONE,
31 .drv = GPIOMUX_DRV_8MA,
32 .func = GPIOMUX_FUNC_GPIO,
33};
Jin Hongad9d9962012-09-12 22:44:19 -070034#endif
Stepan Moskovchenko2327a952011-12-14 16:31:28 -080035
36/* The SPI configurations apply to GSBI 5*/
37static struct gpiomux_setting gpio_spi_config = {
38 .func = GPIOMUX_FUNC_2,
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -080039 .drv = GPIOMUX_DRV_12MA,
Stepan Moskovchenko2327a952011-12-14 16:31:28 -080040 .pull = GPIOMUX_PULL_NONE,
41};
42
43/* The SPI configurations apply to GSBI 5 chip select 2*/
44static struct gpiomux_setting gpio_spi_cs2_config = {
45 .func = GPIOMUX_FUNC_3,
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -080046 .drv = GPIOMUX_DRV_12MA,
Stepan Moskovchenko2327a952011-12-14 16:31:28 -080047 .pull = GPIOMUX_PULL_NONE,
48};
49
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -080050/* Chip selects for SPI clients */
51static struct gpiomux_setting gpio_spi_cs_config = {
52 .func = GPIOMUX_FUNC_GPIO,
53 .drv = GPIOMUX_DRV_12MA,
54 .pull = GPIOMUX_PULL_UP,
55};
56
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -080057/* Chip selects for EPM SPI clients */
58static struct gpiomux_setting gpio_epm_spi_cs_config = {
Siddartha Mohanadoss52015a52012-05-09 21:44:58 -070059 .func = GPIOMUX_FUNC_6,
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -080060 .drv = GPIOMUX_DRV_12MA,
61 .pull = GPIOMUX_PULL_UP,
62};
63
Jin Hongad9d9962012-09-12 22:44:19 -070064#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
Stepan Moskovchenko2327a952011-12-14 16:31:28 -080065struct msm_gpiomux_config apq8064_ethernet_configs[] = {
66 {
67 .gpio = 43,
68 .settings = {
69 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
70 [GPIOMUX_ACTIVE] = &gpio_eth_config,
71 }
72 },
73};
74#endif
75
Terence Hampson2e1705f2012-04-11 19:55:29 -040076#ifdef CONFIG_MSM_VCAP
Terence Hampson6b0fb7e2012-12-19 11:25:21 -050077static struct gpiomux_setting gpio_vcap_config = {
78 .func = GPIOMUX_FUNC_GPIO,
79 .drv = GPIOMUX_DRV_2MA,
80 .pull = GPIOMUX_PULL_DOWN,
Terence Hampson2e1705f2012-04-11 19:55:29 -040081};
82
83struct msm_gpiomux_config vcap_configs[] = {
84 {
85 .gpio = 20,
86 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -050087 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
88 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -040089 }
90 },
91 {
92 .gpio = 25,
93 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -050094 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
95 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -040096 }
97 },
98 {
99 .gpio = 24,
100 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500101 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
102 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400103 }
104 },
105 {
106 .gpio = 23,
107 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500108 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
109 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400110 }
111 },
112 {
113 .gpio = 19,
114 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500115 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
116 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400117 }
118 },
119 {
120 .gpio = 22,
121 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500122 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
123 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400124 }
125 },
126 {
127 .gpio = 21,
128 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500129 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
130 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400131 }
132 },
133 {
134 .gpio = 12,
135 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500136 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
137 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400138 }
139 },
140 {
141 .gpio = 18,
142 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500143 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
144 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400145 }
146 },
147 {
148 .gpio = 11,
149 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500150 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
151 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400152 }
153 },
154 {
155 .gpio = 10,
156 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500157 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
158 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400159 }
160 },
161 {
162 .gpio = 9,
163 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500164 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
165 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400166 }
167 },
168 {
169 .gpio = 26,
170 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500171 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
172 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400173 }
174 },
175 {
176 .gpio = 8,
177 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500178 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
179 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400180 }
181 },
182 {
183 .gpio = 7,
184 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500185 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
186 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400187 }
188 },
189 {
190 .gpio = 6,
191 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500192 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
193 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400194 }
195 },
196 {
197 .gpio = 80,
198 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500199 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
200 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400201 }
202 },
203 {
204 .gpio = 86,
205 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500206 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
207 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400208 }
209 },
210 {
211 .gpio = 85,
212 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500213 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
214 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400215 }
216 },
217 {
218 .gpio = 84,
219 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500220 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
221 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400222 }
223 },
224 {
225 .gpio = 5,
226 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500227 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
228 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400229 }
230 },
231 {
232 .gpio = 4,
233 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500234 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
235 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400236 }
237 },
238 {
239 .gpio = 3,
240 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500241 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
242 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400243 }
244 },
245 {
246 .gpio = 2,
247 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500248 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
249 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400250 }
251 },
252 {
253 .gpio = 82,
254 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500255 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
256 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400257 }
258 },
259 {
260 .gpio = 83,
261 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500262 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
263 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400264 }
265 },
266 {
267 .gpio = 87,
268 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500269 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
270 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400271 }
272 },
273 {
274 .gpio = 13,
275 .settings = {
Terence Hampson6b0fb7e2012-12-19 11:25:21 -0500276 [GPIOMUX_SUSPENDED] = &gpio_vcap_config,
277 [GPIOMUX_ACTIVE] = &gpio_vcap_config,
Terence Hampson2e1705f2012-04-11 19:55:29 -0400278 }
279 },
280};
281#endif
282
David Keitel3c40fc52012-02-09 17:53:52 -0800283static struct gpiomux_setting gpio_i2c_config = {
284 .func = GPIOMUX_FUNC_1,
285 .drv = GPIOMUX_DRV_8MA,
286 .pull = GPIOMUX_PULL_NONE,
287};
288
Kuirong Wangf8c5e142012-06-21 16:17:32 -0700289static struct gpiomux_setting gpio_i2c_2ma_config = {
290 .func = GPIOMUX_FUNC_1,
291 .drv = GPIOMUX_DRV_2MA,
292 .pull = GPIOMUX_PULL_NONE,
293};
294
295
David Keitel3c40fc52012-02-09 17:53:52 -0800296static struct gpiomux_setting gpio_i2c_config_sus = {
297 .func = GPIOMUX_FUNC_1,
298 .drv = GPIOMUX_DRV_2MA,
299 .pull = GPIOMUX_PULL_KEEPER,
300};
301
Joonwoo Parkca1516f2012-05-08 13:59:37 -0700302static struct gpiomux_setting mbhc_hs_detect = {
303 .func = GPIOMUX_FUNC_1,
304 .drv = GPIOMUX_DRV_2MA,
305 .pull = GPIOMUX_PULL_NONE,
306};
307
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800308static struct gpiomux_setting cdc_mclk = {
309 .func = GPIOMUX_FUNC_1,
310 .drv = GPIOMUX_DRV_8MA,
311 .pull = GPIOMUX_PULL_NONE,
312};
313
Srikanth Uyyalaada39c22012-05-18 14:39:35 +0530314static struct gpiomux_setting audio_auxpcm[] = {
315/* Suspended state */
316 {
317 .func = GPIOMUX_FUNC_GPIO,
318 .drv = GPIOMUX_DRV_2MA,
319 .pull = GPIOMUX_PULL_NONE,
320 },
321/* Active state */
322 {
323 .func = GPIOMUX_FUNC_1,
324 .drv = GPIOMUX_DRV_2MA,
325 .pull = GPIOMUX_PULL_NONE,
326 },
327};
328
329
Ankit Verma6b7e2ba2012-01-26 15:48:54 -0800330static struct gpiomux_setting wcnss_5wire_suspend_cfg = {
331 .func = GPIOMUX_FUNC_GPIO,
332 .drv = GPIOMUX_DRV_2MA,
333 .pull = GPIOMUX_PULL_UP,
334};
335
336static struct gpiomux_setting wcnss_5wire_active_cfg = {
337 .func = GPIOMUX_FUNC_1,
338 .drv = GPIOMUX_DRV_6MA,
339 .pull = GPIOMUX_PULL_DOWN,
340};
341
342
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800343static struct gpiomux_setting slimbus = {
344 .func = GPIOMUX_FUNC_1,
345 .drv = GPIOMUX_DRV_8MA,
346 .pull = GPIOMUX_PULL_KEEPER,
347};
348
Stepan Moskovchenko5ea3c312012-01-31 18:19:40 -0800349static struct gpiomux_setting gsbi1_uart_config = {
350 .func = GPIOMUX_FUNC_1,
351 .drv = GPIOMUX_DRV_16MA,
352 .pull = GPIOMUX_PULL_NONE,
353};
354
Rohit Vaswani69f38262013-01-09 13:42:16 -0800355static struct gpiomux_setting gsbi2_uart_config = {
356 .func = GPIOMUX_FUNC_1,
357 .drv = GPIOMUX_DRV_16MA,
358 .pull = GPIOMUX_PULL_NONE,
359};
360
361static struct gpiomux_setting gsbi4_uart_config = {
362 .func = GPIOMUX_FUNC_1,
363 .drv = GPIOMUX_DRV_16MA,
364 .pull = GPIOMUX_PULL_NONE,
365};
366
David Collinsf0d00732012-01-25 15:46:50 -0800367static struct gpiomux_setting ext_regulator_config = {
368 .func = GPIOMUX_FUNC_GPIO,
369 .drv = GPIOMUX_DRV_8MA,
370 .pull = GPIOMUX_PULL_NONE,
371 .dir = GPIOMUX_OUT_LOW,
372};
373
Jin Hong4bbbfba2012-02-02 21:48:07 -0800374static struct gpiomux_setting gsbi7_func1_cfg = {
375 .func = GPIOMUX_FUNC_1,
376 .drv = GPIOMUX_DRV_8MA,
377 .pull = GPIOMUX_PULL_NONE,
378};
379
380static struct gpiomux_setting gsbi7_func2_cfg = {
381 .func = GPIOMUX_FUNC_2,
382 .drv = GPIOMUX_DRV_8MA,
383 .pull = GPIOMUX_PULL_NONE,
384};
385
Jing Lin04601f92012-02-05 15:36:07 -0800386static struct gpiomux_setting gsbi3_suspended_cfg = {
387 .func = GPIOMUX_FUNC_1,
388 .drv = GPIOMUX_DRV_2MA,
389 .pull = GPIOMUX_PULL_KEEPER,
390};
391
392static struct gpiomux_setting gsbi3_active_cfg = {
393 .func = GPIOMUX_FUNC_1,
394 .drv = GPIOMUX_DRV_8MA,
395 .pull = GPIOMUX_PULL_NONE,
396};
397
Aravind Venkateswaran0507c8c2012-02-16 17:16:05 -0800398static struct gpiomux_setting hdmi_suspend_cfg = {
399 .func = GPIOMUX_FUNC_GPIO,
400 .drv = GPIOMUX_DRV_2MA,
401 .pull = GPIOMUX_PULL_DOWN,
402};
403
404static struct gpiomux_setting hdmi_active_1_cfg = {
405 .func = GPIOMUX_FUNC_1,
406 .drv = GPIOMUX_DRV_2MA,
407 .pull = GPIOMUX_PULL_UP,
408};
409
410static struct gpiomux_setting hdmi_active_2_cfg = {
411 .func = GPIOMUX_FUNC_1,
412 .drv = GPIOMUX_DRV_16MA,
413 .pull = GPIOMUX_PULL_DOWN,
414};
415
Abhishek Kharbanda72dc72e2012-06-07 13:41:37 -0700416static struct gpiomux_setting hdmi_active_3_cfg = {
417 .func = GPIOMUX_FUNC_GPIO,
418 .drv = GPIOMUX_DRV_2MA,
419 .pull = GPIOMUX_PULL_UP,
420 .dir = GPIOMUX_IN,
421};
422
423static struct gpiomux_setting hdmi_active_4_cfg = {
424 .func = GPIOMUX_FUNC_GPIO,
425 .drv = GPIOMUX_DRV_2MA,
426 .pull = GPIOMUX_PULL_UP,
427 .dir = GPIOMUX_OUT_HIGH,
428};
429
Joel King8f839b92012-04-01 14:37:46 -0700430static struct gpiomux_setting gsbi5_suspended_cfg = {
431 .func = GPIOMUX_FUNC_2,
432 .drv = GPIOMUX_DRV_12MA,
433 .pull = GPIOMUX_PULL_NONE,
434};
435
436static struct gpiomux_setting gsbi5_active_cfg = {
437 .func = GPIOMUX_FUNC_2,
438 .drv = GPIOMUX_DRV_12MA,
439 .pull = GPIOMUX_PULL_NONE,
440};
Anirudh Ghayal9f1aaa72012-04-26 18:15:08 +0530441
Saket Saurabhd425a5d2012-11-06 16:08:28 +0530442static struct gpiomux_setting gsbi5_uart_cfg = {
443 .func = GPIOMUX_FUNC_2,
444 .drv = GPIOMUX_DRV_8MA,
445 .pull = GPIOMUX_PULL_NONE,
446};
447
Bar Weinerf82c5872012-10-23 14:31:26 +0200448static struct gpiomux_setting gsbi6_spi_cfg = {
449 .func = GPIOMUX_FUNC_2,
450 .drv = GPIOMUX_DRV_16MA,
451 .pull = GPIOMUX_PULL_NONE,
452};
453
Anirudh Ghayal9f1aaa72012-04-26 18:15:08 +0530454static struct gpiomux_setting sx150x_suspended_cfg = {
455 .func = GPIOMUX_FUNC_GPIO,
456 .drv = GPIOMUX_DRV_8MA,
457 .pull = GPIOMUX_PULL_NONE,
458};
459
460static struct gpiomux_setting sx150x_active_cfg = {
461 .func = GPIOMUX_FUNC_GPIO,
462 .drv = GPIOMUX_DRV_8MA,
463 .pull = GPIOMUX_PULL_NONE,
464};
465
Steve Mucklef132c6c2012-06-06 18:30:57 -0700466#ifdef CONFIG_USB_EHCI_MSM_HSIC
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -0800467static struct gpiomux_setting cyts_sleep_sus_cfg = {
468 .func = GPIOMUX_FUNC_GPIO,
469 .drv = GPIOMUX_DRV_6MA,
470 .pull = GPIOMUX_PULL_DOWN,
471};
472
473static struct gpiomux_setting cyts_sleep_act_cfg = {
474 .func = GPIOMUX_FUNC_GPIO,
475 .drv = GPIOMUX_DRV_6MA,
476 .pull = GPIOMUX_PULL_DOWN,
477};
478
479static struct gpiomux_setting cyts_int_act_cfg = {
480 .func = GPIOMUX_FUNC_GPIO,
481 .drv = GPIOMUX_DRV_8MA,
482 .pull = GPIOMUX_PULL_UP,
483};
484
485static struct gpiomux_setting cyts_int_sus_cfg = {
486 .func = GPIOMUX_FUNC_GPIO,
487 .drv = GPIOMUX_DRV_2MA,
488 .pull = GPIOMUX_PULL_DOWN,
489};
490
491static struct msm_gpiomux_config cyts_gpio_configs[] __initdata = {
492 { /* TS INTERRUPT */
493 .gpio = 6,
494 .settings = {
495 [GPIOMUX_ACTIVE] = &cyts_int_act_cfg,
496 [GPIOMUX_SUSPENDED] = &cyts_int_sus_cfg,
497 },
498 },
499 { /* TS SLEEP */
500 .gpio = 33,
501 .settings = {
502 [GPIOMUX_ACTIVE] = &cyts_sleep_act_cfg,
503 [GPIOMUX_SUSPENDED] = &cyts_sleep_sus_cfg,
504 },
505 },
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -0800506};
Amy Maloche609bb5e2012-08-03 09:41:42 -0700507static struct msm_gpiomux_config cyts_gpio_alt_config[] __initdata = {
508 { /* TS INTERRUPT */
509 .gpio = 6,
510 .settings = {
511 [GPIOMUX_ACTIVE] = &cyts_int_act_cfg,
512 [GPIOMUX_SUSPENDED] = &cyts_int_sus_cfg,
513 },
514 },
515 { /* TS SLEEP */
516 .gpio = 12,
517 .settings = {
518 [GPIOMUX_ACTIVE] = &cyts_sleep_act_cfg,
519 [GPIOMUX_SUSPENDED] = &cyts_sleep_sus_cfg,
520 },
521 },
522};
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -0800523
Amy Maloche9ba3ffe2012-04-26 10:31:20 -0700524static struct gpiomux_setting hsic_act_cfg = {
525 .func = GPIOMUX_FUNC_1,
526 .drv = GPIOMUX_DRV_8MA,
527 .pull = GPIOMUX_PULL_NONE,
528};
529
530static struct gpiomux_setting hsic_sus_cfg = {
531 .func = GPIOMUX_FUNC_GPIO,
532 .drv = GPIOMUX_DRV_2MA,
533 .pull = GPIOMUX_PULL_DOWN,
534 .dir = GPIOMUX_OUT_LOW,
535};
536
Hemant Kumar6fd65032012-05-23 13:02:24 -0700537static struct gpiomux_setting hsic_wakeup_act_cfg = {
538 .func = GPIOMUX_FUNC_GPIO,
539 .drv = GPIOMUX_DRV_8MA,
540 .pull = GPIOMUX_PULL_DOWN,
541 .dir = GPIOMUX_IN,
542};
543
544static struct gpiomux_setting hsic_wakeup_sus_cfg = {
545 .func = GPIOMUX_FUNC_GPIO,
546 .drv = GPIOMUX_DRV_2MA,
547 .pull = GPIOMUX_PULL_DOWN,
548 .dir = GPIOMUX_IN,
549};
Amy Maloche9ba3ffe2012-04-26 10:31:20 -0700550
Hemant Kumara945b472012-01-25 15:08:06 -0800551static struct msm_gpiomux_config apq8064_hsic_configs[] = {
552 {
553 .gpio = 88, /*HSIC_STROBE */
554 .settings = {
555 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
556 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
557 },
558 },
559 {
560 .gpio = 89, /* HSIC_DATA */
561 .settings = {
562 [GPIOMUX_ACTIVE] = &hsic_act_cfg,
563 [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
564 },
565 },
Hemant Kumar6fd65032012-05-23 13:02:24 -0700566 {
567 .gpio = 47, /* wake up */
568 .settings = {
569 [GPIOMUX_ACTIVE] = &hsic_wakeup_act_cfg,
570 [GPIOMUX_SUSPENDED] = &hsic_wakeup_sus_cfg,
571 },
572 },
Hemant Kumara945b472012-01-25 15:08:06 -0800573};
574#endif
575
Jing Lin21ed4de2012-02-05 15:53:28 -0800576static struct gpiomux_setting mxt_reset_sus_cfg = {
577 .func = GPIOMUX_FUNC_GPIO,
578 .drv = GPIOMUX_DRV_6MA,
579 .pull = GPIOMUX_PULL_DOWN,
580};
581
582static struct gpiomux_setting mxt_reset_act_cfg = {
583 .func = GPIOMUX_FUNC_GPIO,
584 .drv = GPIOMUX_DRV_6MA,
585 .pull = GPIOMUX_PULL_UP,
586};
587
588static struct gpiomux_setting mxt_int_sus_cfg = {
589 .func = GPIOMUX_FUNC_GPIO,
590 .drv = GPIOMUX_DRV_2MA,
591 .pull = GPIOMUX_PULL_DOWN,
592};
593
594static struct gpiomux_setting mxt_int_act_cfg = {
595 .func = GPIOMUX_FUNC_GPIO,
596 .drv = GPIOMUX_DRV_8MA,
597 .pull = GPIOMUX_PULL_UP,
598};
599
Aravind Venkateswaran0507c8c2012-02-16 17:16:05 -0800600static struct msm_gpiomux_config apq8064_hdmi_configs[] __initdata = {
601 {
602 .gpio = 69,
603 .settings = {
604 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
605 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
606 },
607 },
608 {
609 .gpio = 70,
610 .settings = {
611 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
612 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
613 },
614 },
615 {
616 .gpio = 71,
617 .settings = {
618 [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
619 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
620 },
621 },
622 {
623 .gpio = 72,
624 .settings = {
625 [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg,
626 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
627 },
628 },
629};
630
Abhishek Kharbanda72dc72e2012-06-07 13:41:37 -0700631static struct msm_gpiomux_config apq8064_mhl_configs[] __initdata = {
632 {
633 .gpio = 30,
634 .settings = {
635 [GPIOMUX_ACTIVE] = &hdmi_active_3_cfg,
636 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
637 },
638 },
639 {
640 .gpio = 35,
641 .settings = {
642 [GPIOMUX_ACTIVE] = &hdmi_active_4_cfg,
643 [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
644 },
645 },
646};
647
Stepan Moskovchenko2327a952011-12-14 16:31:28 -0800648static struct msm_gpiomux_config apq8064_gsbi_configs[] __initdata = {
Stepan Moskovchenko5ea3c312012-01-31 18:19:40 -0800649 {
Jing Lin04601f92012-02-05 15:36:07 -0800650 .gpio = 8, /* GSBI3 I2C QUP SDA */
651 .settings = {
652 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
653 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
654 },
655 },
656 {
657 .gpio = 9, /* GSBI3 I2C QUP SCL */
658 .settings = {
659 [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
660 [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
661 },
662 },
663 {
Stepan Moskovchenko5ea3c312012-01-31 18:19:40 -0800664 .gpio = 18, /* GSBI1 UART TX */
665 .settings = {
666 [GPIOMUX_SUSPENDED] = &gsbi1_uart_config,
667 },
668 },
669 {
670 .gpio = 19, /* GSBI1 UART RX */
671 .settings = {
672 [GPIOMUX_SUSPENDED] = &gsbi1_uart_config,
673 },
674 },
Stepan Moskovchenko2327a952011-12-14 16:31:28 -0800675 {
676 .gpio = 51, /* GSBI5 QUP SPI_DATA_MOSI */
677 .settings = {
678 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
679 },
680 },
681 {
682 .gpio = 52, /* GSBI5 QUP SPI_DATA_MISO */
683 .settings = {
684 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
685 },
686 },
687 {
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -0800688 .gpio = 53, /* Funny CS0 */
689 .settings = {
690 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
691 },
692 },
693 {
Stepan Moskovchenko2327a952011-12-14 16:31:28 -0800694 .gpio = 31, /* GSBI5 QUP SPI_CS2_N */
695 .settings = {
696 [GPIOMUX_SUSPENDED] = &gpio_spi_cs2_config,
697 },
698 },
699 {
700 .gpio = 54, /* GSBI5 QUP SPI_CLK */
701 .settings = {
702 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
703 },
704 },
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -0800705 {
706 .gpio = 30, /* FP CS */
707 .settings = {
708 [GPIOMUX_SUSPENDED] = &gpio_spi_cs_config,
709 },
710 },
711 {
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -0800712 .gpio = 53, /* NOR CS */
713 .settings = {
714 [GPIOMUX_SUSPENDED] = &gpio_spi_cs_config,
715 },
716 },
Jin Hong4bbbfba2012-02-02 21:48:07 -0800717 {
718 .gpio = 82, /* GSBI7 UART2 TX */
719 .settings = {
720 [GPIOMUX_SUSPENDED] = &gsbi7_func2_cfg,
721 },
722 },
723 {
724 .gpio = 83, /* GSBI7 UART2 RX */
725 .settings = {
726 [GPIOMUX_SUSPENDED] = &gsbi7_func1_cfg,
727 },
728 },
Kuirong Wangf8c5e142012-06-21 16:17:32 -0700729};
730
Rohit Vaswani69f38262013-01-09 13:42:16 -0800731static struct msm_gpiomux_config fsm8064_ep_gsbi_configs[] __initdata = {
732 {
733 .gpio = 10, /* GSBI4 UART TX */
734 .settings = {
735 [GPIOMUX_SUSPENDED] = &gsbi4_uart_config,
736 },
737 },
738 {
739 .gpio = 11, /* GSBI4 UART RX */
740 .settings = {
741 [GPIOMUX_SUSPENDED] = &gsbi4_uart_config,
742 },
743 },
744 {
745 .gpio = 18, /* GSBI1 UART TX */
746 .settings = {
747 [GPIOMUX_SUSPENDED] = &gsbi1_uart_config,
748 },
749 },
750 {
751 .gpio = 19, /* GSBI1 UART RX */
752 .settings = {
753 [GPIOMUX_SUSPENDED] = &gsbi1_uart_config,
754 },
755 },
756 {
757 .gpio = 22, /* GSBI2 UART TX */
758 .settings = {
759 [GPIOMUX_SUSPENDED] = &gsbi2_uart_config,
760 },
761 },
762 {
763 .gpio = 23, /* GSBI7 UART2 RX */
764 .settings = {
765 [GPIOMUX_SUSPENDED] = &gsbi2_uart_config,
766 },
767 },
768 {
769 .gpio = 51, /* GSBI5 QUP SPI_DATA_MOSI */
770 .settings = {
771 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
772 },
773 },
774 {
775 .gpio = 52, /* GSBI5 QUP SPI_DATA_MISO */
776 .settings = {
777 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
778 },
779 },
780 {
781 .gpio = 53, /* Funny CS0 */
782 .settings = {
783 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
784 },
785 },
786 {
787 .gpio = 54, /* GSBI5 QUP SPI_CLK */
788 .settings = {
789 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
790 },
791 },
792 {
793 .gpio = 53, /* NOR CS */
794 .settings = {
795 [GPIOMUX_SUSPENDED] = &gpio_spi_cs_config,
796 },
797 },
798};
799
Kuirong Wangf8c5e142012-06-21 16:17:32 -0700800static struct msm_gpiomux_config apq8064_non_mi2s_gsbi_configs[] __initdata = {
801 {
802 .gpio = 32, /* EPM CS */
803 .settings = {
804 [GPIOMUX_SUSPENDED] = &gpio_epm_spi_cs_config,
805 },
806 },
807};
808
809static struct msm_gpiomux_config apq8064_gsbi1_i2c_2ma_configs[] __initdata = {
810 {
811 .gpio = 21, /* GSBI1 QUP I2C_CLK */
812 .settings = {
813 [GPIOMUX_SUSPENDED] = &gpio_i2c_config_sus,
814 [GPIOMUX_ACTIVE] = &gpio_i2c_2ma_config,
815 },
816 },
817 {
818 .gpio = 20, /* GSBI1 QUP I2C_DATA */
819 .settings = {
820 [GPIOMUX_SUSPENDED] = &gpio_i2c_config_sus,
821 [GPIOMUX_ACTIVE] = &gpio_i2c_2ma_config,
822 },
823 },
824};
825
826static struct msm_gpiomux_config apq8064_gsbi1_i2c_8ma_configs[] __initdata = {
David Keitel3c40fc52012-02-09 17:53:52 -0800827 {
828 .gpio = 21, /* GSBI1 QUP I2C_CLK */
829 .settings = {
830 [GPIOMUX_SUSPENDED] = &gpio_i2c_config_sus,
831 [GPIOMUX_ACTIVE] = &gpio_i2c_config,
832 },
833 },
834 {
835 .gpio = 20, /* GSBI1 QUP I2C_DATA */
836 .settings = {
837 [GPIOMUX_SUSPENDED] = &gpio_i2c_config_sus,
838 [GPIOMUX_ACTIVE] = &gpio_i2c_config,
839 },
840 },
Stepan Moskovchenko2327a952011-12-14 16:31:28 -0800841};
842
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800843static struct msm_gpiomux_config apq8064_slimbus_config[] __initdata = {
844 {
845 .gpio = 40, /* slimbus clk */
846 .settings = {
847 [GPIOMUX_SUSPENDED] = &slimbus,
848 },
849 },
850 {
851 .gpio = 41, /* slimbus data */
852 .settings = {
853 [GPIOMUX_SUSPENDED] = &slimbus,
854 },
855 },
856};
857
Kuirong Wangf8c5e142012-06-21 16:17:32 -0700858static struct gpiomux_setting spkr_i2s = {
Santosh Mardieff9a742012-04-09 23:23:39 +0530859 .func = GPIOMUX_FUNC_1,
860 .drv = GPIOMUX_DRV_8MA,
861 .pull = GPIOMUX_PULL_KEEPER,
862};
863
864static struct msm_gpiomux_config mpq8064_spkr_i2s_config[] __initdata = {
865 {
866 .gpio = 47, /* spkr i2c sck */
867 .settings = {
Kuirong Wangf8c5e142012-06-21 16:17:32 -0700868 [GPIOMUX_SUSPENDED] = &spkr_i2s,
Santosh Mardieff9a742012-04-09 23:23:39 +0530869 },
870 },
871 {
872 .gpio = 48, /* spkr_i2s_ws */
873 .settings = {
Kuirong Wangf8c5e142012-06-21 16:17:32 -0700874 [GPIOMUX_SUSPENDED] = &spkr_i2s,
Santosh Mardieff9a742012-04-09 23:23:39 +0530875 },
876 },
877 {
878 .gpio = 49, /* spkr_i2s_dout */
879 .settings = {
Kuirong Wangf8c5e142012-06-21 16:17:32 -0700880 [GPIOMUX_SUSPENDED] = &spkr_i2s,
Santosh Mardieff9a742012-04-09 23:23:39 +0530881 },
882 },
883 {
884 .gpio = 50, /* spkr_i2s_mclk */
885 .settings = {
Kuirong Wangf8c5e142012-06-21 16:17:32 -0700886 [GPIOMUX_SUSPENDED] = &spkr_i2s,
Santosh Mardieff9a742012-04-09 23:23:39 +0530887 },
888 },
889};
890
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800891static struct msm_gpiomux_config apq8064_audio_codec_configs[] __initdata = {
892 {
Joonwoo Parkca1516f2012-05-08 13:59:37 -0700893 .gpio = 38,
894 .settings = {
895 [GPIOMUX_SUSPENDED] = &mbhc_hs_detect,
896 },
897 },
898 {
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800899 .gpio = 39,
900 .settings = {
901 [GPIOMUX_SUSPENDED] = &cdc_mclk,
902 },
903 },
904};
905
Srikanth Uyyalaada39c22012-05-18 14:39:35 +0530906static struct msm_gpiomux_config mpq8064_audio_auxpcm_configs[] __initdata = {
907 {
908 .gpio = 43,
909 .settings = {
910 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
911 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
912 },
913 },
914 {
915 .gpio = 44,
916 .settings = {
917 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
918 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
919 },
920 },
921 {
922 .gpio = 45,
923 .settings = {
924 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
925 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
926 },
927 },
928 {
929 .gpio = 46,
930 .settings = {
931 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
932 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
933 },
934 },
935};
936
David Collinsf0d00732012-01-25 15:46:50 -0800937/* External 3.3 V regulator enable */
938static struct msm_gpiomux_config apq8064_ext_regulator_configs[] __initdata = {
939 {
940 .gpio = APQ8064_EXT_3P3V_REG_EN_GPIO,
941 .settings = {
942 [GPIOMUX_SUSPENDED] = &ext_regulator_config,
943 },
944 },
945};
946
Joel Kingdacbc822012-01-25 13:30:57 -0800947static struct gpiomux_setting ap2mdm_cfg = {
948 .func = GPIOMUX_FUNC_GPIO,
Taniya Dasd65f2922012-12-27 17:26:27 +0530949 .drv = GPIOMUX_DRV_4MA,
Joel Kingdacbc822012-01-25 13:30:57 -0800950 .pull = GPIOMUX_PULL_DOWN,
951};
952
953static struct gpiomux_setting mdm2ap_status_cfg = {
954 .func = GPIOMUX_FUNC_GPIO,
Taniya Dasd65f2922012-12-27 17:26:27 +0530955 .drv = GPIOMUX_DRV_2MA,
Joel King269aa602012-07-23 08:07:35 -0700956 .pull = GPIOMUX_PULL_DOWN,
Joel Kingdacbc822012-01-25 13:30:57 -0800957};
958
959static struct gpiomux_setting mdm2ap_errfatal_cfg = {
960 .func = GPIOMUX_FUNC_GPIO,
Taniya Dasd65f2922012-12-27 17:26:27 +0530961 .drv = GPIOMUX_DRV_2MA,
Joel Kingdacbc822012-01-25 13:30:57 -0800962 .pull = GPIOMUX_PULL_DOWN,
963};
964
Vamsi Krishnac6dcd5e2012-05-09 15:38:01 -0700965static struct gpiomux_setting mdm2ap_pblrdy = {
966 .func = GPIOMUX_FUNC_GPIO,
Taniya Dasd65f2922012-12-27 17:26:27 +0530967 .drv = GPIOMUX_DRV_2MA,
Vamsi Krishnac6dcd5e2012-05-09 15:38:01 -0700968 .pull = GPIOMUX_PULL_DOWN,
969};
970
971
Joel King14fe7fa2012-05-27 14:26:11 -0700972static struct gpiomux_setting ap2mdm_soft_reset_cfg = {
Joel Kingdacbc822012-01-25 13:30:57 -0800973 .func = GPIOMUX_FUNC_GPIO,
Taniya Dasd65f2922012-12-27 17:26:27 +0530974 .drv = GPIOMUX_DRV_4MA,
Joel Kingdacbc822012-01-25 13:30:57 -0800975 .pull = GPIOMUX_PULL_DOWN,
976};
977
Vamsi Krishna9e307cd2012-04-11 13:15:36 -0700978static struct gpiomux_setting ap2mdm_wakeup = {
979 .func = GPIOMUX_FUNC_GPIO,
Taniya Dasd65f2922012-12-27 17:26:27 +0530980 .drv = GPIOMUX_DRV_4MA,
Vamsi Krishna9e307cd2012-04-11 13:15:36 -0700981 .pull = GPIOMUX_PULL_DOWN,
982};
983
Joel Kingdacbc822012-01-25 13:30:57 -0800984static struct msm_gpiomux_config mdm_configs[] __initdata = {
985 /* AP2MDM_STATUS */
986 {
987 .gpio = 48,
988 .settings = {
989 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
990 }
991 },
992 /* MDM2AP_STATUS */
993 {
994 .gpio = 49,
995 .settings = {
Joel King269aa602012-07-23 08:07:35 -0700996 [GPIOMUX_ACTIVE] = &mdm2ap_status_cfg,
Joel Kingdacbc822012-01-25 13:30:57 -0800997 [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
998 }
999 },
1000 /* MDM2AP_ERRFATAL */
1001 {
1002 .gpio = 19,
1003 .settings = {
1004 [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
1005 }
1006 },
1007 /* AP2MDM_ERRFATAL */
1008 {
1009 .gpio = 18,
1010 .settings = {
1011 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
1012 }
1013 },
Joel King14fe7fa2012-05-27 14:26:11 -07001014 /* AP2MDM_SOFT_RESET, aka AP2MDM_PON_RESET_N */
Joel Kingdacbc822012-01-25 13:30:57 -08001015 {
1016 .gpio = 27,
1017 .settings = {
Joel King14fe7fa2012-05-27 14:26:11 -07001018 [GPIOMUX_SUSPENDED] = &ap2mdm_soft_reset_cfg,
Joel Kingdacbc822012-01-25 13:30:57 -08001019 }
Mohan Pallaka474b94b2012-01-25 12:59:58 +05301020 },
Vamsi Krishna9e307cd2012-04-11 13:15:36 -07001021 /* AP2MDM_WAKEUP */
1022 {
1023 .gpio = 35,
1024 .settings = {
1025 [GPIOMUX_SUSPENDED] = &ap2mdm_wakeup,
1026 }
1027 },
Vamsi Krishnac6dcd5e2012-05-09 15:38:01 -07001028 /* MDM2AP_PBL_READY*/
1029 {
1030 .gpio = 46,
1031 .settings = {
1032 [GPIOMUX_SUSPENDED] = &mdm2ap_pblrdy,
1033 }
1034 },
Mohan Pallaka474b94b2012-01-25 12:59:58 +05301035};
1036
Ameya Thakure155ece2012-07-09 12:08:37 -07001037static struct msm_gpiomux_config mdm_i2s_configs[] __initdata = {
1038 /* AP2MDM_STATUS */
1039 {
1040 .gpio = 48,
1041 .settings = {
1042 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
1043 }
1044 },
1045 /* MDM2AP_STATUS */
1046 {
1047 .gpio = 49,
1048 .settings = {
1049 [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
1050 }
1051 },
1052 /* MDM2AP_ERRFATAL */
1053 {
1054 .gpio = 19,
1055 .settings = {
1056 [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
1057 }
1058 },
1059 /* AP2MDM_ERRFATAL */
1060 {
1061 .gpio = 18,
1062 .settings = {
1063 [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
1064 }
1065 },
1066 /* AP2MDM_SOFT_RESET, aka AP2MDM_PON_RESET_N */
1067 {
1068 .gpio = 0,
1069 .settings = {
1070 [GPIOMUX_SUSPENDED] = &ap2mdm_soft_reset_cfg,
1071 }
1072 },
1073 /* AP2MDM_WAKEUP */
1074 {
1075 .gpio = 44,
1076 .settings = {
1077 [GPIOMUX_SUSPENDED] = &ap2mdm_wakeup,
1078 }
1079 },
1080 /* MDM2AP_PBL_READY*/
1081 {
1082 .gpio = 81,
1083 .settings = {
1084 [GPIOMUX_SUSPENDED] = &mdm2ap_pblrdy,
1085 }
1086 },
1087};
1088
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001089static struct gpiomux_setting i2s_act_cfg = {
Kuirong Wangf23f8c52012-03-31 12:34:51 -07001090 .func = GPIOMUX_FUNC_1,
1091 .drv = GPIOMUX_DRV_8MA,
1092 .pull = GPIOMUX_PULL_NONE,
1093};
1094
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001095static struct gpiomux_setting i2s_act_func_2_cfg = {
1096 .func = GPIOMUX_FUNC_2,
1097 .drv = GPIOMUX_DRV_8MA,
1098 .pull = GPIOMUX_PULL_NONE,
1099};
1100
1101static struct gpiomux_setting i2s_sus_cfg = {
Kuirong Wangf23f8c52012-03-31 12:34:51 -07001102 .func = GPIOMUX_FUNC_GPIO,
1103 .drv = GPIOMUX_DRV_2MA,
1104 .pull = GPIOMUX_PULL_DOWN,
1105};
1106
1107static struct msm_gpiomux_config mpq8064_mi2s_configs[] __initdata = {
1108 {
1109 .gpio = 27, /* mi2s ws */
1110 .settings = {
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001111 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1112 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
Kuirong Wangf23f8c52012-03-31 12:34:51 -07001113 },
1114 },
1115 {
1116 .gpio = 28, /* mi2s sclk */
1117 .settings = {
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001118 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1119 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
Kuirong Wangf23f8c52012-03-31 12:34:51 -07001120 },
1121 },
1122 {
1123 .gpio = 29, /* mi2s dout3 */
1124 .settings = {
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001125 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1126 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
Kuirong Wangf23f8c52012-03-31 12:34:51 -07001127 },
1128 },
1129 {
1130 .gpio = 30, /* mi2s dout2 */
1131 .settings = {
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001132 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1133 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
Kuirong Wangf23f8c52012-03-31 12:34:51 -07001134 },
1135 },
1136
1137 {
1138 .gpio = 31, /* mi2s dout1 */
1139 .settings = {
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001140 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1141 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
Kuirong Wangf23f8c52012-03-31 12:34:51 -07001142 },
1143 },
1144 {
1145 .gpio = 32, /* mi2s dout0 */
1146 .settings = {
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001147 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1148 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
Kuirong Wangf23f8c52012-03-31 12:34:51 -07001149 },
1150 },
1151
1152 {
1153 .gpio = 33, /* mi2s mclk */
1154 .settings = {
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001155 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1156 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
Kuirong Wangf23f8c52012-03-31 12:34:51 -07001157 },
1158 },
1159};
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001160
1161static struct msm_gpiomux_config apq8064_mi2s_configs[] __initdata = {
1162 {
1163 .gpio = 27, /* mi2s ws */
1164 .settings = {
1165 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1166 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
1167 },
1168 },
1169 {
1170 .gpio = 28, /* mi2s sclk */
1171 .settings = {
1172 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1173 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
1174 },
1175 },
1176 {
1177 .gpio = 29, /* mi2s dout3 - TX*/
1178 .settings = {
1179 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1180 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
1181 },
1182 },
1183 {
1184 .gpio = 32, /* mi2s dout0 - RX */
1185 .settings = {
1186 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1187 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
1188 },
1189 },
1190
1191 {
1192 .gpio = 33, /* mi2s mclk */
1193 .settings = {
1194 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1195 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
1196 },
1197 },
1198};
1199
1200static struct msm_gpiomux_config apq8064_mic_i2s_configs[] __initdata = {
1201 {
1202 .gpio = 35, /* mic i2s sclk */
1203 .settings = {
1204 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1205 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
1206 },
1207 },
1208 {
1209 .gpio = 36, /* mic i2s ws */
1210 .settings = {
1211 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1212 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
1213 },
1214 },
1215 {
1216 .gpio = 37, /* mic i2s din0 */
1217 .settings = {
1218 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1219 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
1220 },
1221 },
1222};
1223
1224
1225static struct msm_gpiomux_config apq8064_spkr_i2s_configs[] __initdata = {
1226 {
1227 .gpio = 40, /* spkr i2s sclk */
1228 .settings = {
1229 [GPIOMUX_ACTIVE] = &i2s_act_func_2_cfg,
1230 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
1231 },
1232 },
1233 {
1234 .gpio = 41, /* spkr i2s dout */
1235 .settings = {
1236 [GPIOMUX_ACTIVE] = &i2s_act_func_2_cfg,
1237 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
1238 },
1239 },
1240 {
1241 .gpio = 42, /* spkr i2s ws */
1242 .settings = {
1243 [GPIOMUX_ACTIVE] = &i2s_act_cfg,
1244 [GPIOMUX_SUSPENDED] = &i2s_sus_cfg,
1245 },
1246 },
1247};
1248
1249
Jing Lin21ed4de2012-02-05 15:53:28 -08001250static struct msm_gpiomux_config apq8064_mxt_configs[] __initdata = {
1251 { /* TS INTERRUPT */
1252 .gpio = 6,
1253 .settings = {
1254 [GPIOMUX_ACTIVE] = &mxt_int_act_cfg,
1255 [GPIOMUX_SUSPENDED] = &mxt_int_sus_cfg,
1256 },
1257 },
1258 { /* TS RESET */
1259 .gpio = 33,
1260 .settings = {
1261 [GPIOMUX_ACTIVE] = &mxt_reset_act_cfg,
1262 [GPIOMUX_SUSPENDED] = &mxt_reset_sus_cfg,
1263 },
1264 },
1265};
1266
Ankit Verma6b7e2ba2012-01-26 15:48:54 -08001267static struct msm_gpiomux_config wcnss_5wire_interface[] = {
1268 {
1269 .gpio = 64,
1270 .settings = {
1271 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
1272 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
1273 },
1274 },
1275 {
1276 .gpio = 65,
1277 .settings = {
1278 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
1279 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
1280 },
1281 },
1282 {
1283 .gpio = 66,
1284 .settings = {
1285 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
1286 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
1287 },
1288 },
1289 {
1290 .gpio = 67,
1291 .settings = {
1292 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
1293 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
1294 },
1295 },
1296 {
1297 .gpio = 68,
1298 .settings = {
1299 [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
1300 [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
1301 },
1302 },
1303};
1304
Joel King8f839b92012-04-01 14:37:46 -07001305static struct msm_gpiomux_config mpq8064_gsbi5_i2c_configs[] __initdata = {
1306 {
1307 .gpio = 53, /* GSBI5 I2C QUP SDA */
1308 .settings = {
1309 [GPIOMUX_SUSPENDED] = &gsbi5_suspended_cfg,
1310 [GPIOMUX_ACTIVE] = &gsbi5_active_cfg,
1311 },
1312 },
1313 {
1314 .gpio = 54, /* GSBI5 I2C QUP SCL */
1315 .settings = {
1316 [GPIOMUX_SUSPENDED] = &gsbi5_suspended_cfg,
1317 [GPIOMUX_ACTIVE] = &gsbi5_active_cfg,
1318 },
1319 },
1320};
1321
Ravi Kumar V05931a22012-04-04 17:09:37 +05301322static struct gpiomux_setting ir_suspended_cfg = {
1323 .func = GPIOMUX_FUNC_GPIO,
1324 .drv = GPIOMUX_DRV_2MA,
1325 .pull = GPIOMUX_PULL_UP,
1326};
1327
1328static struct gpiomux_setting ir_active_cfg = {
1329 .func = GPIOMUX_FUNC_GPIO,
1330 .drv = GPIOMUX_DRV_8MA,
1331 .pull = GPIOMUX_PULL_UP,
1332};
1333
1334static struct msm_gpiomux_config mpq8064_ir_configs[] __initdata = {
1335 {
1336 .gpio = 88, /* GPIO IR */
1337 .settings = {
1338 [GPIOMUX_SUSPENDED] = &ir_suspended_cfg,
1339 [GPIOMUX_ACTIVE] = &ir_active_cfg,
1340 },
1341 },
1342};
1343
Anirudh Ghayal9f1aaa72012-04-26 18:15:08 +05301344static struct msm_gpiomux_config sx150x_int_configs[] __initdata = {
1345 {
1346 .gpio = 81,
1347 .settings = {
1348 [GPIOMUX_SUSPENDED] = &sx150x_suspended_cfg,
1349 [GPIOMUX_ACTIVE] = &sx150x_active_cfg,
1350 },
1351 },
1352};
1353
Oluwafemi Adeyemia46d0322012-05-16 18:27:44 -07001354#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
1355static struct gpiomux_setting sdc2_clk_active_cfg = {
1356 .func = GPIOMUX_FUNC_2,
1357 .drv = GPIOMUX_DRV_8MA,
1358 .pull = GPIOMUX_PULL_NONE,
1359};
1360
1361static struct gpiomux_setting sdc2_cmd_data_0_3_active_cfg = {
1362 .func = GPIOMUX_FUNC_2,
1363 .drv = GPIOMUX_DRV_8MA,
1364 .pull = GPIOMUX_PULL_UP,
1365};
1366
1367static struct gpiomux_setting sdc2_suspended_cfg = {
1368 .func = GPIOMUX_FUNC_GPIO,
1369 .drv = GPIOMUX_DRV_2MA,
1370 .pull = GPIOMUX_PULL_DOWN,
1371};
1372
1373static struct gpiomux_setting sdc2_data_1_suspended_cfg = {
1374 .func = GPIOMUX_FUNC_GPIO,
1375 .drv = GPIOMUX_DRV_2MA,
1376 .pull = GPIOMUX_PULL_UP,
1377};
1378
1379static struct msm_gpiomux_config apq8064_sdc2_configs[] __initdata = {
1380 {
1381 .gpio = 59,
1382 .settings = {
1383 [GPIOMUX_ACTIVE] = &sdc2_clk_active_cfg,
1384 [GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
1385 },
1386 },
1387 {
1388 .gpio = 57,
1389 .settings = {
1390 [GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
1391 [GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
1392 },
1393
1394 },
1395 {
1396 .gpio = 62,
1397 .settings = {
1398 [GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
1399 [GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
1400 },
1401 },
1402 {
1403 .gpio = 61,
1404 .settings = {
1405 [GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
1406 [GPIOMUX_SUSPENDED] = &sdc2_data_1_suspended_cfg,
1407 },
1408 },
1409 {
1410 .gpio = 60,
1411 .settings = {
1412 [GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
1413 [GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
1414 },
1415 },
1416 {
1417 .gpio = 58,
1418 .settings = {
1419 [GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
1420 [GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
1421 },
1422 },
1423};
1424#endif
1425
1426
1427#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
1428static struct gpiomux_setting sdc4_clk_active_cfg = {
1429 .func = GPIOMUX_FUNC_2,
1430 .drv = GPIOMUX_DRV_8MA,
1431 .pull = GPIOMUX_PULL_NONE,
1432};
1433
1434static struct gpiomux_setting sdc4_cmd_data_0_3_active_cfg = {
1435 .func = GPIOMUX_FUNC_2,
1436 .drv = GPIOMUX_DRV_8MA,
1437 .pull = GPIOMUX_PULL_UP,
1438};
1439
1440static struct gpiomux_setting sdc4_suspended_cfg = {
1441 .func = GPIOMUX_FUNC_GPIO,
1442 .drv = GPIOMUX_DRV_2MA,
1443 .pull = GPIOMUX_PULL_DOWN,
1444};
1445
1446static struct gpiomux_setting sdc4_data_1_suspended_cfg = {
1447 .func = GPIOMUX_FUNC_GPIO,
1448 .drv = GPIOMUX_DRV_2MA,
1449 .pull = GPIOMUX_PULL_UP,
1450};
1451
1452static struct msm_gpiomux_config apq8064_sdc4_configs[] __initdata = {
1453 {
1454 .gpio = 68,
1455 .settings = {
1456 [GPIOMUX_ACTIVE] = &sdc4_clk_active_cfg,
1457 [GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
1458 },
1459 },
1460 {
1461 .gpio = 67,
1462 .settings = {
1463 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
1464 [GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
1465 },
1466
1467 },
1468 {
1469 .gpio = 66,
1470 .settings = {
1471 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
1472 [GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
1473 },
1474 },
1475 {
1476 .gpio = 65,
1477 .settings = {
1478 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
1479 [GPIOMUX_SUSPENDED] = &sdc4_data_1_suspended_cfg,
1480 },
1481 },
1482 {
1483 .gpio = 64,
1484 .settings = {
1485 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
1486 [GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
1487 },
1488 },
1489 {
1490 .gpio = 63,
1491 .settings = {
1492 [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
1493 [GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
1494 },
1495 },
1496};
1497#endif
1498
Oluwafemi Adeyemi9aff26c2012-06-26 17:28:21 -07001499static struct gpiomux_setting apq8064_sdc3_card_det_cfg = {
1500 .func = GPIOMUX_FUNC_GPIO,
1501 .drv = GPIOMUX_DRV_2MA,
1502 .pull = GPIOMUX_PULL_UP,
1503};
1504
1505static struct msm_gpiomux_config apq8064_sdc3_configs[] __initdata = {
1506 {
1507 .gpio = 26,
1508 .settings = {
1509 [GPIOMUX_SUSPENDED] = &apq8064_sdc3_card_det_cfg,
1510 [GPIOMUX_ACTIVE] = &apq8064_sdc3_card_det_cfg,
1511 },
1512 },
1513};
1514
Mayank Rana262e9032012-05-10 15:14:00 -07001515static struct gpiomux_setting gsbi6_uartdm_active = {
1516 .func = GPIOMUX_FUNC_2,
1517 .drv = GPIOMUX_DRV_8MA,
1518 .pull = GPIOMUX_PULL_NONE,
1519};
1520
1521static struct gpiomux_setting gsbi6_uartdm_suspended = {
1522 .func = GPIOMUX_FUNC_GPIO,
1523 .drv = GPIOMUX_DRV_2MA,
1524 .pull = GPIOMUX_PULL_DOWN,
1525};
1526
1527static struct msm_gpiomux_config mpq8064_uartdm_configs[] __initdata = {
1528 { /* UARTDM_TX */
1529 .gpio = 14,
1530 .settings = {
1531 [GPIOMUX_ACTIVE] = &gsbi6_uartdm_active,
1532 [GPIOMUX_SUSPENDED] = &gsbi6_uartdm_suspended,
1533 },
1534 },
1535 { /* UARTDM_RX */
1536 .gpio = 15,
1537 .settings = {
1538 [GPIOMUX_ACTIVE] = &gsbi6_uartdm_active,
1539 [GPIOMUX_SUSPENDED] = &gsbi6_uartdm_suspended,
1540 },
1541 },
1542 { /* UARTDM_CTS */
1543 .gpio = 16,
1544 .settings = {
1545 [GPIOMUX_ACTIVE] = &gsbi6_uartdm_active,
1546 [GPIOMUX_SUSPENDED] = &gsbi6_uartdm_suspended,
1547 },
1548 },
1549 { /* UARTDM_RFR */
1550 .gpio = 17,
1551 .settings = {
1552 [GPIOMUX_ACTIVE] = &gsbi6_uartdm_active,
1553 [GPIOMUX_SUSPENDED] = &gsbi6_uartdm_suspended,
1554 },
1555 },
1556};
1557
Bar Weinerf82c5872012-10-23 14:31:26 +02001558static struct msm_gpiomux_config mpq8064_gsbi6_spi_configs[] __initdata = {
1559 {
1560 .gpio = 17, /* GSBI6_0 SPI CLK */
1561 .settings = {
1562 [GPIOMUX_SUSPENDED] = &gsbi6_spi_cfg,
1563 },
1564 },
1565 {
1566 .gpio = 16, /* GSBI6_1 SPI CS */
1567 .settings = {
1568 [GPIOMUX_SUSPENDED] = &gsbi6_spi_cfg,
1569 },
1570 },
1571 {
1572 .gpio = 15, /* GSBI6_2 SPI MISO */
1573 .settings = {
1574 [GPIOMUX_SUSPENDED] = &gsbi6_spi_cfg,
1575 },
1576 },
1577 {
1578 .gpio = 14, /* GSBI6_3 SPI_MOSI */
1579 .settings = {
1580 [GPIOMUX_SUSPENDED] = &gsbi6_spi_cfg,
1581 },
1582 },
1583};
1584
Saket Saurabhd425a5d2012-11-06 16:08:28 +05301585static struct msm_gpiomux_config mpq8064_gsbi5_uart_configs[] __initdata = {
1586 {
1587 .gpio = 51, /* GSBI5 UART TX */
1588 .settings = {
1589 [GPIOMUX_SUSPENDED] = &gsbi5_uart_cfg,
1590 },
1591 },
1592 {
1593 .gpio = 52, /* GSBI5 UART RX */
1594 .settings = {
1595 [GPIOMUX_SUSPENDED] = &gsbi5_uart_cfg,
1596 },
1597 },
1598};
1599
Rohit Vaswani69f38262013-01-09 13:42:16 -08001600static struct gpiomux_setting boot_cfg = {
1601 .func = GPIOMUX_FUNC_GPIO,
1602 .drv = GPIOMUX_DRV_2MA,
1603 .pull = GPIOMUX_PULL_UP,
1604};
1605
1606static struct msm_gpiomux_config fsm8064_ep_boot_configs[] __initdata = {
1607 {
1608 .gpio = 2,
1609 .settings = {
1610 [GPIOMUX_SUSPENDED] = &boot_cfg,
1611 },
1612 },
1613 {
1614 .gpio = 3,
1615 .settings = {
1616 [GPIOMUX_SUSPENDED] = &boot_cfg,
1617 },
1618 },
1619 {
1620 .gpio = 4,
1621 .settings = {
1622 [GPIOMUX_SUSPENDED] = &boot_cfg,
1623 },
1624 },
1625 {
1626 .gpio = 5,
1627 .settings = {
1628 [GPIOMUX_SUSPENDED] = &boot_cfg,
1629 },
1630 },
1631 {
1632 .gpio = 33,
1633 .settings = {
1634 [GPIOMUX_SUSPENDED] = &boot_cfg,
1635 },
1636 },
1637 {
1638 .gpio = 34,
1639 .settings = {
1640 [GPIOMUX_SUSPENDED] = &boot_cfg,
1641 },
1642 },
1643 {
1644 .gpio = 39,
1645 .settings = {
1646 [GPIOMUX_SUSPENDED] = &boot_cfg,
1647 },
1648 },
1649 {
1650 .gpio = 50,
1651 .settings = {
1652 [GPIOMUX_SUSPENDED] = &boot_cfg,
1653 },
1654 },
1655 {
1656 .gpio = 87,
1657 .settings = {
1658 [GPIOMUX_SUSPENDED] = &boot_cfg,
1659 },
1660 },
1661};
1662
1663static struct gpiomux_setting fsm8064_ep_backup_suspended_cfg = {
1664 .func = GPIOMUX_FUNC_GPIO,
1665 .drv = GPIOMUX_DRV_2MA,
1666 .pull = GPIOMUX_PULL_DOWN,
1667 .dir = GPIOMUX_OUT_LOW,
1668};
1669
1670static struct msm_gpiomux_config fsm8064_ep_backup_configs[] __initdata = {
1671 {
1672 .gpio = 45,
1673 .settings = {
1674 [GPIOMUX_SUSPENDED] = &fsm8064_ep_backup_suspended_cfg,
1675 },
1676 },
1677 {
1678 .gpio = 46,
1679 .settings = {
1680 [GPIOMUX_SUSPENDED] = &fsm8064_ep_backup_suspended_cfg,
1681 },
1682 },
1683 {
1684 .gpio = 47,
1685 .settings = {
1686 [GPIOMUX_SUSPENDED] = &fsm8064_ep_backup_suspended_cfg,
1687 },
1688 },
1689 {
1690 .gpio = 62,
1691 .settings = {
1692 [GPIOMUX_SUSPENDED] = &fsm8064_ep_backup_suspended_cfg,
1693 },
1694 },
1695 {
1696 .gpio = 82,
1697 .settings = {
1698 [GPIOMUX_SUSPENDED] = &fsm8064_ep_backup_suspended_cfg,
1699 },
1700 },
1701};
1702
1703static struct gpiomux_setting fsm8064_ep_uim_rst_cfg = {
1704 .func = GPIOMUX_FUNC_GPIO,
1705 .drv = GPIOMUX_DRV_2MA,
1706 .pull = GPIOMUX_PULL_UP,
1707 .dir = GPIOMUX_OUT_LOW,
1708};
1709
1710static struct gpiomux_setting fsm8064_ep_uim_pwr_sel_cfg = {
1711 .func = GPIOMUX_FUNC_GPIO,
1712 .drv = GPIOMUX_DRV_2MA,
1713 .pull = GPIOMUX_PULL_UP,
1714 .dir = GPIOMUX_OUT_HIGH,
1715};
1716
1717static struct msm_gpiomux_config fsm8064_ep_uim_configs[] __initdata = {
1718 {
1719 .gpio = 49, /* UIM_RST */
1720 .settings = {
1721 [GPIOMUX_SUSPENDED] = &fsm8064_ep_uim_rst_cfg,
1722 },
1723 },
1724 {
1725 .gpio = 55, /* UIM_PWR_SEL */
1726 .settings = {
1727 [GPIOMUX_SUSPENDED] = &fsm8064_ep_uim_pwr_sel_cfg,
1728 },
1729 },
1730};
1731
Rohit Vaswani69f38262013-01-09 13:42:16 -08001732static struct gpiomux_setting fsm8064_ep_sync_input_cfg = {
1733 .func = GPIOMUX_FUNC_GPIO,
1734 .drv = GPIOMUX_DRV_4MA,
1735 .pull = GPIOMUX_PULL_UP,
1736};
1737
1738static struct msm_gpiomux_config fsm8064_ep_sync_configs[] __initdata = {
1739 {
1740 .gpio = 6, /* GPSPPSIN_DRSYNC */
1741 .settings = {
Rohit Vaswanid12ce572013-03-05 15:05:51 -08001742 [GPIOMUX_SUSPENDED] = &fsm8064_ep_sync_input_cfg,
Rohit Vaswani69f38262013-01-09 13:42:16 -08001743 },
1744 },
1745 {
1746 .gpio = 7, /* KRAIT_PPS_INPUT */
1747 .settings = {
1748 [GPIOMUX_SUSPENDED] = &fsm8064_ep_sync_input_cfg,
1749 },
1750 },
1751 {
1752 .gpio = 8, /* QDSP_PPS_INPUT */
1753 .settings = {
1754 [GPIOMUX_SUSPENDED] = &fsm8064_ep_sync_input_cfg,
1755 },
1756 },
1757 {
1758 .gpio = 9, /* DAN_TTI_INPUT */
1759 .settings = {
1760 [GPIOMUX_SUSPENDED] = &fsm8064_ep_sync_input_cfg,
1761 },
1762 },
1763};
1764
1765static struct gpiomux_setting fsm8064_ep_led_cfg = {
1766 .func = GPIOMUX_FUNC_GPIO,
1767 .drv = GPIOMUX_DRV_4MA,
1768 .pull = GPIOMUX_PULL_DOWN,
1769 .dir = GPIOMUX_OUT_LOW,
1770};
1771
1772static struct msm_gpiomux_config fsm8064_ep_led_configs[] __initdata = {
1773 {
1774 .gpio = 58, /* RED1 */
1775 .settings = {
1776 [GPIOMUX_SUSPENDED] = &fsm8064_ep_led_cfg,
1777 },
1778 },
1779 {
1780 .gpio = 59, /* GREEN1 */
1781 .settings = {
1782 [GPIOMUX_SUSPENDED] = &fsm8064_ep_led_cfg,
1783 },
1784 },
1785 {
1786 .gpio = 60, /* RED2 */
1787 .settings = {
1788 [GPIOMUX_SUSPENDED] = &fsm8064_ep_led_cfg,
1789 },
1790 },
1791 {
1792 .gpio = 61, /* GREEN2 */
1793 .settings = {
1794 [GPIOMUX_SUSPENDED] = &fsm8064_ep_led_cfg,
1795 },
1796 },
1797 {
1798 .gpio = 69, /* RED3 */
1799 .settings = {
1800 [GPIOMUX_SUSPENDED] = &fsm8064_ep_led_cfg,
1801 },
1802 },
1803 {
1804 .gpio = 70, /* GREEN3 */
1805 .settings = {
1806 [GPIOMUX_SUSPENDED] = &fsm8064_ep_led_cfg,
1807 },
1808 },
1809 {
1810 .gpio = 71, /* RED4 */
1811 .settings = {
1812 [GPIOMUX_SUSPENDED] = &fsm8064_ep_led_cfg,
1813 },
1814 },
1815 {
1816 .gpio = 72, /* GREEN4 */
1817 .settings = {
1818 [GPIOMUX_SUSPENDED] = &fsm8064_ep_led_cfg,
1819 },
1820 },
1821 {
1822 .gpio = 77, /* RED5 */
1823 .settings = {
1824 [GPIOMUX_SUSPENDED] = &fsm8064_ep_led_cfg,
1825 },
1826 },
1827 {
1828 .gpio = 80, /* GREEN5 */
1829 .settings = {
1830 [GPIOMUX_SUSPENDED] = &fsm8064_ep_led_cfg,
1831 },
1832 },
1833};
1834
Stepan Moskovchenko2327a952011-12-14 16:31:28 -08001835void __init apq8064_init_gpiomux(void)
1836{
1837 int rc;
Amy Maloche609bb5e2012-08-03 09:41:42 -07001838 int platform_version = socinfo_get_platform_version();
Stepan Moskovchenko2327a952011-12-14 16:31:28 -08001839
1840 rc = msm_gpiomux_init(NR_GPIO_IRQS);
1841 if (rc) {
1842 pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
1843 return;
1844 }
Ankit Verma6fe41b02012-09-13 16:12:11 +05301845 if (!(machine_is_mpq8064_hrd()))
1846 msm_gpiomux_install(wcnss_5wire_interface,
1847 ARRAY_SIZE(wcnss_5wire_interface));
Ankit Verma6b7e2ba2012-01-26 15:48:54 -08001848
Joel King8f839b92012-04-01 14:37:46 -07001849 if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
1850 machine_is_mpq8064_dtv()) {
1851 msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
1852 ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
Saket Saurabhd425a5d2012-11-06 16:08:28 +05301853 msm_gpiomux_install(mpq8064_gsbi5_uart_configs,
1854 ARRAY_SIZE(mpq8064_gsbi5_uart_configs));
Terence Hampson2e1705f2012-04-11 19:55:29 -04001855#ifdef CONFIG_MSM_VCAP
1856 msm_gpiomux_install(vcap_configs,
1857 ARRAY_SIZE(vcap_configs));
1858#endif
Anirudh Ghayal9f1aaa72012-04-26 18:15:08 +05301859 msm_gpiomux_install(sx150x_int_configs,
1860 ARRAY_SIZE(sx150x_int_configs));
Joel King8f839b92012-04-01 14:37:46 -07001861 } else {
1862 #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
1863 msm_gpiomux_install(apq8064_ethernet_configs,
1864 ARRAY_SIZE(apq8064_ethernet_configs));
1865 #endif
1866
Rohit Vaswani69f38262013-01-09 13:42:16 -08001867 if (machine_is_fsm8064_ep())
1868 msm_gpiomux_install(fsm8064_ep_gsbi_configs,
1869 ARRAY_SIZE(fsm8064_ep_gsbi_configs));
1870 else
1871 msm_gpiomux_install(apq8064_gsbi_configs,
1872 ARRAY_SIZE(apq8064_gsbi_configs));
Stepan Moskovchenko2327a952011-12-14 16:31:28 -08001873
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001874 if (!(machine_is_apq8064_mtp() &&
1875 (SOCINFO_VERSION_MINOR(platform_version) == 1)))
1876 msm_gpiomux_install(apq8064_non_mi2s_gsbi_configs,
1877 ARRAY_SIZE(apq8064_non_mi2s_gsbi_configs));
1878 }
1879 if (machine_is_apq8064_mtp() &&
1880 (SOCINFO_VERSION_MINOR(platform_version) == 1)) {
1881 msm_gpiomux_install(apq8064_mic_i2s_configs,
1882 ARRAY_SIZE(apq8064_mic_i2s_configs));
1883 msm_gpiomux_install(apq8064_spkr_i2s_configs,
1884 ARRAY_SIZE(apq8064_spkr_i2s_configs));
1885 msm_gpiomux_install(apq8064_mi2s_configs,
1886 ARRAY_SIZE(apq8064_mi2s_configs));
1887 msm_gpiomux_install(apq8064_gsbi1_i2c_2ma_configs,
1888 ARRAY_SIZE(apq8064_gsbi1_i2c_2ma_configs));
1889 } else {
Rohit Vaswani69f38262013-01-09 13:42:16 -08001890 if (!machine_is_fsm8064_ep()) {
1891 msm_gpiomux_install(apq8064_slimbus_config,
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001892 ARRAY_SIZE(apq8064_slimbus_config));
Rohit Vaswani69f38262013-01-09 13:42:16 -08001893 }
Terence Hampson6b0fb7e2012-12-19 11:25:21 -05001894 }
1895
1896 if (!(machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
1897 machine_is_mpq8064_dtv()) && !machine_is_apq8064_mtp()) {
Kuirong Wangf8c5e142012-06-21 16:17:32 -07001898 msm_gpiomux_install(apq8064_gsbi1_i2c_8ma_configs,
1899 ARRAY_SIZE(apq8064_gsbi1_i2c_8ma_configs));
1900 }
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08001901
1902 msm_gpiomux_install(apq8064_audio_codec_configs,
1903 ARRAY_SIZE(apq8064_audio_codec_configs));
1904
Santosh Mardieff9a742012-04-09 23:23:39 +05301905 if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
1906 machine_is_mpq8064_dtv()) {
Srikanth Uyyalaada39c22012-05-18 14:39:35 +05301907
1908 msm_gpiomux_install(mpq8064_audio_auxpcm_configs,
1909 ARRAY_SIZE(mpq8064_audio_auxpcm_configs));
1910
Santosh Mardieff9a742012-04-09 23:23:39 +05301911 msm_gpiomux_install(mpq8064_spkr_i2s_config,
1912 ARRAY_SIZE(mpq8064_spkr_i2s_config));
1913 }
1914
Swaminathan Sathappan9e07aa92012-02-29 12:07:27 -08001915 pr_debug("%s(): audio-auxpcm: Include GPIO configs"
1916 " as audio is not the primary user"
1917 " for these GPIO Pins\n", __func__);
David Collinsf0d00732012-01-25 15:46:50 -08001918
Kuirong Wangf23f8c52012-03-31 12:34:51 -07001919 if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
1920 machine_is_mpq8064_dtv())
1921 msm_gpiomux_install(mpq8064_mi2s_configs,
1922 ARRAY_SIZE(mpq8064_mi2s_configs));
1923
Rohit Vaswani69f38262013-01-09 13:42:16 -08001924 if (!machine_is_mpq8064_hrd() && !machine_is_fsm8064_ep())
Bamidi RaviKirand1e9f0d2012-12-10 17:33:10 +05301925 msm_gpiomux_install(apq8064_ext_regulator_configs,
David Collinsf0d00732012-01-25 15:46:50 -08001926 ARRAY_SIZE(apq8064_ext_regulator_configs));
Joel Kingdacbc822012-01-25 13:30:57 -08001927
Ameya Thakure155ece2012-07-09 12:08:37 -07001928 if (machine_is_apq8064_mtp()) {
1929 if (SOCINFO_VERSION_MINOR(platform_version) == 1)
1930 msm_gpiomux_install(mdm_i2s_configs,
1931 ARRAY_SIZE(mdm_i2s_configs));
1932 else
1933 msm_gpiomux_install(mdm_configs,
1934 ARRAY_SIZE(mdm_configs));
1935 }
Hemant Kumara945b472012-01-25 15:08:06 -08001936
Amy Maloche609bb5e2012-08-03 09:41:42 -07001937 if (machine_is_apq8064_mtp()) {
1938 if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
1939 msm_gpiomux_install(cyts_gpio_alt_config,
1940 ARRAY_SIZE(cyts_gpio_alt_config));
1941 } else {
1942 msm_gpiomux_install(cyts_gpio_configs,
1943 ARRAY_SIZE(cyts_gpio_configs));
1944 }
1945 }
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001946
Amy Maloche609bb5e2012-08-03 09:41:42 -07001947#ifdef CONFIG_USB_EHCI_MSM_HSIC
Hemant Kumarf1ca9192012-02-07 18:59:33 -08001948 if (machine_is_apq8064_mtp())
1949 msm_gpiomux_install(apq8064_hsic_configs,
1950 ARRAY_SIZE(apq8064_hsic_configs));
Hemant Kumara945b472012-01-25 15:08:06 -08001951#endif
Jing Lin21ed4de2012-02-05 15:53:28 -08001952
1953 if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
1954 msm_gpiomux_install(apq8064_mxt_configs,
1955 ARRAY_SIZE(apq8064_mxt_configs));
Aravind Venkateswaran0507c8c2012-02-16 17:16:05 -08001956
Rohit Vaswani69f38262013-01-09 13:42:16 -08001957 if (!machine_is_fsm8064_ep())
1958 msm_gpiomux_install(apq8064_hdmi_configs,
1959 ARRAY_SIZE(apq8064_hdmi_configs));
Ravi Kumar V05931a22012-04-04 17:09:37 +05301960
Abhishek Kharbanda72dc72e2012-06-07 13:41:37 -07001961 if (apq8064_mhl_display_enabled())
1962 msm_gpiomux_install(apq8064_mhl_configs,
1963 ARRAY_SIZE(apq8064_mhl_configs));
1964
Bar Weinerf82c5872012-10-23 14:31:26 +02001965 if (machine_is_mpq8064_cdp()) {
Ravi Kumar V05931a22012-04-04 17:09:37 +05301966 msm_gpiomux_install(mpq8064_ir_configs,
1967 ARRAY_SIZE(mpq8064_ir_configs));
Oluwafemi Adeyemia46d0322012-05-16 18:27:44 -07001968
Bar Weinerf82c5872012-10-23 14:31:26 +02001969 msm_gpiomux_install(mpq8064_gsbi6_spi_configs,
1970 ARRAY_SIZE(mpq8064_gsbi6_spi_configs));
1971 }
1972
Oluwafemi Adeyemia46d0322012-05-16 18:27:44 -07001973#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
1974 msm_gpiomux_install(apq8064_sdc2_configs,
1975 ARRAY_SIZE(apq8064_sdc2_configs));
1976#endif
1977
1978#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
1979 msm_gpiomux_install(apq8064_sdc4_configs,
1980 ARRAY_SIZE(apq8064_sdc4_configs));
1981#endif
Oluwafemi Adeyemi9aff26c2012-06-26 17:28:21 -07001982
Terence Hampson6b0fb7e2012-12-19 11:25:21 -05001983 if (!(machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
1984 machine_is_mpq8064_dtv())) {
1985 msm_gpiomux_install(apq8064_sdc3_configs,
1986 ARRAY_SIZE(apq8064_sdc3_configs));
1987 }
Mayank Rana262e9032012-05-10 15:14:00 -07001988 if (machine_is_mpq8064_hrd() || machine_is_mpq8064_dtv())
1989 msm_gpiomux_install(mpq8064_uartdm_configs,
1990 ARRAY_SIZE(mpq8064_uartdm_configs));
Rohit Vaswani69f38262013-01-09 13:42:16 -08001991
1992 if (machine_is_fsm8064_ep()) {
1993 msm_gpiomux_install(fsm8064_ep_boot_configs,
1994 ARRAY_SIZE(fsm8064_ep_boot_configs));
1995 msm_gpiomux_install(fsm8064_ep_backup_configs,
1996 ARRAY_SIZE(fsm8064_ep_backup_configs));
1997 msm_gpiomux_install(fsm8064_ep_uim_configs,
1998 ARRAY_SIZE(fsm8064_ep_uim_configs));
1999 msm_gpiomux_install(fsm8064_ep_sync_configs,
2000 ARRAY_SIZE(fsm8064_ep_sync_configs));
2001 msm_gpiomux_install(fsm8064_ep_led_configs,
2002 ARRAY_SIZE(fsm8064_ep_led_configs));
2003 }
Stepan Moskovchenko2327a952011-12-14 16:31:28 -08002004}