Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 1 | /* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | * |
| 12 | */ |
| 13 | |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 14 | #include <linux/gpio.h> |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 15 | #include <asm/mach-types.h> |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 16 | #include <mach/gpiomux.h> |
| 17 | #include <mach/socinfo.h> |
| 18 | #include "devices.h" |
Stepan Moskovchenko | 5a83dba | 2011-12-05 17:30:17 -0800 | [diff] [blame] | 19 | #include "board-8930.h" |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 20 | |
| 21 | /* The SPI configurations apply to GSBI 1*/ |
| 22 | static struct gpiomux_setting spi_active = { |
| 23 | .func = GPIOMUX_FUNC_1, |
| 24 | .drv = GPIOMUX_DRV_12MA, |
| 25 | .pull = GPIOMUX_PULL_NONE, |
| 26 | }; |
| 27 | |
| 28 | static struct gpiomux_setting spi_suspended_config = { |
| 29 | .func = GPIOMUX_FUNC_GPIO, |
| 30 | .drv = GPIOMUX_DRV_2MA, |
| 31 | .pull = GPIOMUX_PULL_DOWN, |
| 32 | }; |
| 33 | |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 34 | static struct gpiomux_setting gsbi3_suspended_cfg = { |
| 35 | .func = GPIOMUX_FUNC_1, |
| 36 | .drv = GPIOMUX_DRV_2MA, |
| 37 | .pull = GPIOMUX_PULL_KEEPER, |
| 38 | }; |
| 39 | |
| 40 | static struct gpiomux_setting gsbi3_active_cfg = { |
| 41 | .func = GPIOMUX_FUNC_1, |
| 42 | .drv = GPIOMUX_DRV_8MA, |
| 43 | .pull = GPIOMUX_PULL_NONE, |
| 44 | }; |
| 45 | |
| 46 | static struct gpiomux_setting gsbi5 = { |
| 47 | .func = GPIOMUX_FUNC_1, |
| 48 | .drv = GPIOMUX_DRV_8MA, |
| 49 | .pull = GPIOMUX_PULL_NONE, |
| 50 | }; |
| 51 | |
Harini Jayaraman | fe6ff416 | 2012-03-14 11:25:40 -0600 | [diff] [blame] | 52 | static struct gpiomux_setting gsbi9 = { |
| 53 | .func = GPIOMUX_FUNC_2, |
| 54 | .drv = GPIOMUX_DRV_8MA, |
| 55 | .pull = GPIOMUX_PULL_NONE, |
| 56 | }; |
| 57 | |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 58 | static struct gpiomux_setting gsbi10 = { |
| 59 | .func = GPIOMUX_FUNC_2, |
| 60 | .drv = GPIOMUX_DRV_8MA, |
| 61 | .pull = GPIOMUX_PULL_NONE, |
| 62 | }; |
| 63 | |
| 64 | static struct gpiomux_setting gsbi12 = { |
| 65 | .func = GPIOMUX_FUNC_1, |
| 66 | .drv = GPIOMUX_DRV_8MA, |
| 67 | .pull = GPIOMUX_PULL_NONE, |
| 68 | }; |
| 69 | |
| 70 | static struct gpiomux_setting cdc_mclk = { |
| 71 | .func = GPIOMUX_FUNC_1, |
| 72 | .drv = GPIOMUX_DRV_8MA, |
| 73 | .pull = GPIOMUX_PULL_NONE, |
| 74 | }; |
| 75 | |
| 76 | static struct gpiomux_setting audio_auxpcm[] = { |
| 77 | /* Suspended state */ |
| 78 | { |
| 79 | .func = GPIOMUX_FUNC_GPIO, |
| 80 | .drv = GPIOMUX_DRV_2MA, |
| 81 | .pull = GPIOMUX_PULL_NONE, |
| 82 | }, |
| 83 | /* Active state */ |
| 84 | { |
| 85 | .func = GPIOMUX_FUNC_1, |
| 86 | .drv = GPIOMUX_DRV_2MA, |
| 87 | .pull = GPIOMUX_PULL_NONE, |
| 88 | }, |
| 89 | }; |
| 90 | |
Bhalchandra Gajare | dd00a9b | 2012-05-02 16:44:36 -0700 | [diff] [blame] | 91 | static struct gpiomux_setting audio_mbhc = { |
| 92 | .func = GPIOMUX_FUNC_GPIO, |
| 93 | .drv = GPIOMUX_DRV_8MA, |
| 94 | .pull = GPIOMUX_PULL_NONE, |
| 95 | }; |
| 96 | |
Bhalchandra Gajare | c0ac7d8 | 2012-05-16 11:28:59 -0700 | [diff] [blame] | 97 | static struct gpiomux_setting audio_spkr_boost = { |
| 98 | .func = GPIOMUX_FUNC_GPIO, |
| 99 | .drv = GPIOMUX_DRV_8MA, |
| 100 | .pull = GPIOMUX_PULL_NONE, |
| 101 | }; |
| 102 | |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 103 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
| 104 | static struct gpiomux_setting gpio_eth_config = { |
| 105 | .pull = GPIOMUX_PULL_NONE, |
| 106 | .drv = GPIOMUX_DRV_8MA, |
| 107 | .func = GPIOMUX_FUNC_GPIO, |
| 108 | }; |
| 109 | #endif |
| 110 | |
| 111 | static struct gpiomux_setting slimbus = { |
| 112 | .func = GPIOMUX_FUNC_1, |
| 113 | .drv = GPIOMUX_DRV_8MA, |
| 114 | .pull = GPIOMUX_PULL_KEEPER, |
| 115 | }; |
| 116 | |
| 117 | static struct gpiomux_setting wcnss_5wire_suspend_cfg = { |
| 118 | .func = GPIOMUX_FUNC_GPIO, |
| 119 | .drv = GPIOMUX_DRV_2MA, |
| 120 | .pull = GPIOMUX_PULL_UP, |
| 121 | }; |
| 122 | |
| 123 | static struct gpiomux_setting wcnss_5wire_active_cfg = { |
| 124 | .func = GPIOMUX_FUNC_1, |
| 125 | .drv = GPIOMUX_DRV_6MA, |
| 126 | .pull = GPIOMUX_PULL_DOWN, |
| 127 | }; |
| 128 | |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 129 | static struct gpiomux_setting atmel_resout_sus_cfg = { |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 130 | .func = GPIOMUX_FUNC_GPIO, |
| 131 | .drv = GPIOMUX_DRV_6MA, |
| 132 | .pull = GPIOMUX_PULL_DOWN, |
| 133 | }; |
| 134 | |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 135 | static struct gpiomux_setting atmel_resout_act_cfg = { |
| 136 | .func = GPIOMUX_FUNC_GPIO, |
| 137 | .drv = GPIOMUX_DRV_6MA, |
| 138 | .pull = GPIOMUX_PULL_UP, |
| 139 | }; |
| 140 | |
| 141 | static struct gpiomux_setting atmel_ldo_en_sus_cfg = { |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 142 | .func = GPIOMUX_FUNC_GPIO, |
| 143 | .drv = GPIOMUX_DRV_6MA, |
| 144 | .pull = GPIOMUX_PULL_DOWN, |
| 145 | }; |
| 146 | |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 147 | static struct gpiomux_setting atmel_ldo_en_act_cfg = { |
| 148 | .func = GPIOMUX_FUNC_GPIO, |
| 149 | .drv = GPIOMUX_DRV_6MA, |
| 150 | .pull = GPIOMUX_PULL_DOWN, |
| 151 | }; |
| 152 | |
| 153 | static struct gpiomux_setting atmel_int_act_cfg = { |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 154 | .func = GPIOMUX_FUNC_GPIO, |
| 155 | .drv = GPIOMUX_DRV_8MA, |
| 156 | .pull = GPIOMUX_PULL_UP, |
| 157 | }; |
| 158 | |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 159 | static struct gpiomux_setting atmel_int_sus_cfg = { |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 160 | .func = GPIOMUX_FUNC_GPIO, |
| 161 | .drv = GPIOMUX_DRV_2MA, |
| 162 | .pull = GPIOMUX_PULL_DOWN, |
| 163 | }; |
Mayank Rana | bf5084a | 2011-12-12 17:06:54 +0530 | [diff] [blame] | 164 | #ifdef MSM8930_PHASE_2 |
Mayank Rana | bf5084a | 2011-12-12 17:06:54 +0530 | [diff] [blame] | 165 | static struct gpiomux_setting hsusb_sus_cfg = { |
| 166 | .func = GPIOMUX_FUNC_GPIO, |
| 167 | .drv = GPIOMUX_DRV_2MA, |
David Keitel | c72d819 | 2012-01-09 11:33:55 -0800 | [diff] [blame] | 168 | .pull = GPIOMUX_PULL_NONE, |
| 169 | .dir = GPIOMUX_OUT_LOW, |
Mayank Rana | bf5084a | 2011-12-12 17:06:54 +0530 | [diff] [blame] | 170 | }; |
| 171 | static struct msm_gpiomux_config msm8930_hsusb_configs[] = { |
| 172 | { |
| 173 | .gpio = 63, /* HSUSB_EXTERNAL_5V_LDO_EN */ |
| 174 | .settings = { |
Mayank Rana | bf5084a | 2011-12-12 17:06:54 +0530 | [diff] [blame] | 175 | [GPIOMUX_SUSPENDED] = &hsusb_sus_cfg, |
| 176 | }, |
| 177 | }, |
| 178 | { |
| 179 | .gpio = 97, /* HSUSB_5V_EN */ |
| 180 | .settings = { |
Mayank Rana | bf5084a | 2011-12-12 17:06:54 +0530 | [diff] [blame] | 181 | [GPIOMUX_SUSPENDED] = &hsusb_sus_cfg, |
| 182 | }, |
| 183 | }, |
| 184 | }; |
| 185 | #endif |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 186 | |
| 187 | static struct gpiomux_setting hap_lvl_shft_suspended_config = { |
| 188 | .func = GPIOMUX_FUNC_GPIO, |
| 189 | .drv = GPIOMUX_DRV_2MA, |
| 190 | .pull = GPIOMUX_PULL_DOWN, |
| 191 | }; |
| 192 | |
| 193 | static struct gpiomux_setting hap_lvl_shft_active_config = { |
| 194 | .func = GPIOMUX_FUNC_GPIO, |
| 195 | .drv = GPIOMUX_DRV_8MA, |
| 196 | .pull = GPIOMUX_PULL_UP, |
| 197 | }; |
| 198 | |
| 199 | static struct gpiomux_setting ap2mdm_cfg = { |
| 200 | .func = GPIOMUX_FUNC_GPIO, |
| 201 | .drv = GPIOMUX_DRV_8MA, |
| 202 | .pull = GPIOMUX_PULL_DOWN, |
| 203 | }; |
| 204 | |
| 205 | static struct gpiomux_setting mdm2ap_status_cfg = { |
| 206 | .func = GPIOMUX_FUNC_GPIO, |
| 207 | .drv = GPIOMUX_DRV_8MA, |
| 208 | .pull = GPIOMUX_PULL_NONE, |
| 209 | }; |
| 210 | |
| 211 | static struct gpiomux_setting mdm2ap_errfatal_cfg = { |
| 212 | .func = GPIOMUX_FUNC_GPIO, |
| 213 | .drv = GPIOMUX_DRV_16MA, |
| 214 | .pull = GPIOMUX_PULL_DOWN, |
| 215 | }; |
| 216 | |
| 217 | static struct gpiomux_setting ap2mdm_kpdpwr_n_cfg = { |
| 218 | .func = GPIOMUX_FUNC_GPIO, |
| 219 | .drv = GPIOMUX_DRV_8MA, |
| 220 | .pull = GPIOMUX_PULL_NONE, |
| 221 | }; |
| 222 | |
| 223 | static struct gpiomux_setting mdp_vsync_suspend_cfg = { |
| 224 | .func = GPIOMUX_FUNC_GPIO, |
| 225 | .drv = GPIOMUX_DRV_2MA, |
| 226 | .pull = GPIOMUX_PULL_DOWN, |
| 227 | }; |
| 228 | |
| 229 | static struct gpiomux_setting mdp_vsync_active_cfg = { |
| 230 | .func = GPIOMUX_FUNC_1, |
| 231 | .drv = GPIOMUX_DRV_2MA, |
| 232 | .pull = GPIOMUX_PULL_DOWN, |
| 233 | }; |
| 234 | |
| 235 | #ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL |
| 236 | static struct gpiomux_setting hdmi_suspend_cfg = { |
| 237 | .func = GPIOMUX_FUNC_GPIO, |
| 238 | .drv = GPIOMUX_DRV_2MA, |
| 239 | .pull = GPIOMUX_PULL_DOWN, |
| 240 | }; |
| 241 | |
| 242 | static struct gpiomux_setting hdmi_active_1_cfg = { |
| 243 | .func = GPIOMUX_FUNC_1, |
| 244 | .drv = GPIOMUX_DRV_2MA, |
| 245 | .pull = GPIOMUX_PULL_UP, |
| 246 | }; |
| 247 | |
| 248 | static struct gpiomux_setting hdmi_active_2_cfg = { |
| 249 | .func = GPIOMUX_FUNC_1, |
| 250 | .drv = GPIOMUX_DRV_2MA, |
| 251 | .pull = GPIOMUX_PULL_DOWN, |
| 252 | }; |
Manoj Rao | c6d904c | 2012-06-22 00:32:14 -0700 | [diff] [blame] | 253 | |
| 254 | static struct gpiomux_setting hdmi_active_3_cfg = { |
| 255 | .func = GPIOMUX_FUNC_GPIO, |
| 256 | .drv = GPIOMUX_DRV_2MA, |
| 257 | .pull = GPIOMUX_PULL_UP, |
| 258 | .dir = GPIOMUX_IN, |
| 259 | }; |
| 260 | |
| 261 | static struct gpiomux_setting hdmi_active_4_cfg = { |
| 262 | .func = GPIOMUX_FUNC_GPIO, |
| 263 | .drv = GPIOMUX_DRV_2MA, |
| 264 | .pull = GPIOMUX_PULL_UP, |
| 265 | .dir = GPIOMUX_OUT_HIGH, |
| 266 | }; |
| 267 | |
| 268 | static struct gpiomux_setting hdmi_active_5_cfg = { |
| 269 | .func = GPIOMUX_FUNC_GPIO, |
| 270 | .drv = GPIOMUX_DRV_2MA, |
| 271 | .pull = GPIOMUX_PULL_UP, |
| 272 | .dir = GPIOMUX_OUT_HIGH, |
| 273 | }; |
| 274 | |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 275 | #endif |
| 276 | |
| 277 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
| 278 | static struct msm_gpiomux_config msm8960_ethernet_configs[] = { |
| 279 | { |
| 280 | .gpio = 90, |
| 281 | .settings = { |
| 282 | [GPIOMUX_SUSPENDED] = &gpio_eth_config, |
| 283 | } |
| 284 | }, |
| 285 | { |
| 286 | .gpio = 89, |
| 287 | .settings = { |
| 288 | [GPIOMUX_SUSPENDED] = &gpio_eth_config, |
| 289 | } |
| 290 | }, |
| 291 | }; |
| 292 | #endif |
| 293 | |
| 294 | static struct msm_gpiomux_config msm8960_gsbi_configs[] __initdata = { |
| 295 | { |
| 296 | .gpio = 6, /* GSBI1 QUP SPI_DATA_MOSI */ |
| 297 | .settings = { |
| 298 | [GPIOMUX_SUSPENDED] = &spi_suspended_config, |
| 299 | [GPIOMUX_ACTIVE] = &spi_active, |
| 300 | }, |
| 301 | }, |
| 302 | { |
| 303 | .gpio = 7, /* GSBI1 QUP SPI_DATA_MISO */ |
| 304 | .settings = { |
| 305 | [GPIOMUX_SUSPENDED] = &spi_suspended_config, |
| 306 | [GPIOMUX_ACTIVE] = &spi_active, |
| 307 | }, |
| 308 | }, |
| 309 | { |
| 310 | .gpio = 8, /* GSBI1 QUP SPI_CS_N */ |
| 311 | .settings = { |
| 312 | [GPIOMUX_SUSPENDED] = &spi_suspended_config, |
| 313 | [GPIOMUX_ACTIVE] = &spi_active, |
| 314 | }, |
| 315 | }, |
| 316 | { |
| 317 | .gpio = 9, /* GSBI1 QUP SPI_CLK */ |
| 318 | .settings = { |
| 319 | [GPIOMUX_SUSPENDED] = &spi_suspended_config, |
| 320 | [GPIOMUX_ACTIVE] = &spi_active, |
| 321 | }, |
| 322 | }, |
| 323 | { |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 324 | .gpio = 16, /* GSBI3 I2C QUP SDA */ |
| 325 | .settings = { |
| 326 | [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg, |
| 327 | [GPIOMUX_ACTIVE] = &gsbi3_active_cfg, |
| 328 | }, |
| 329 | }, |
| 330 | { |
| 331 | .gpio = 17, /* GSBI3 I2C QUP SCL */ |
| 332 | .settings = { |
| 333 | [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg, |
| 334 | [GPIOMUX_ACTIVE] = &gsbi3_active_cfg, |
| 335 | }, |
| 336 | }, |
| 337 | { |
| 338 | .gpio = 22, /* GSBI5 UART2 */ |
| 339 | .settings = { |
| 340 | [GPIOMUX_SUSPENDED] = &gsbi5, |
| 341 | }, |
| 342 | }, |
| 343 | { |
| 344 | .gpio = 23, /* GSBI5 UART2 */ |
| 345 | .settings = { |
| 346 | [GPIOMUX_SUSPENDED] = &gsbi5, |
| 347 | }, |
| 348 | }, |
| 349 | { |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 350 | .gpio = 44, /* GSBI12 I2C QUP SDA */ |
| 351 | .settings = { |
| 352 | [GPIOMUX_SUSPENDED] = &gsbi12, |
| 353 | }, |
| 354 | }, |
| 355 | { |
Harini Jayaraman | fe6ff416 | 2012-03-14 11:25:40 -0600 | [diff] [blame] | 356 | .gpio = 95, /* GSBI9 I2C QUP SDA */ |
| 357 | .settings = { |
| 358 | [GPIOMUX_SUSPENDED] = &gsbi9, |
| 359 | }, |
| 360 | }, |
| 361 | { |
| 362 | .gpio = 96, /* GSBI12 I2C QUP SCL */ |
| 363 | .settings = { |
| 364 | [GPIOMUX_SUSPENDED] = &gsbi9, |
| 365 | }, |
| 366 | }, |
| 367 | { |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 368 | .gpio = 45, /* GSBI12 I2C QUP SCL */ |
| 369 | .settings = { |
| 370 | [GPIOMUX_SUSPENDED] = &gsbi12, |
| 371 | }, |
| 372 | }, |
| 373 | { |
| 374 | .gpio = 73, /* GSBI10 I2C QUP SDA */ |
| 375 | .settings = { |
| 376 | [GPIOMUX_SUSPENDED] = &gsbi10, |
| 377 | }, |
| 378 | }, |
| 379 | { |
| 380 | .gpio = 74, /* GSBI10 I2C QUP SCL */ |
| 381 | .settings = { |
| 382 | [GPIOMUX_SUSPENDED] = &gsbi10, |
| 383 | }, |
| 384 | }, |
| 385 | }; |
| 386 | |
| 387 | static struct msm_gpiomux_config msm8960_slimbus_config[] __initdata = { |
| 388 | { |
| 389 | .gpio = 60, /* slimbus data */ |
| 390 | .settings = { |
| 391 | [GPIOMUX_SUSPENDED] = &slimbus, |
| 392 | }, |
| 393 | }, |
| 394 | { |
| 395 | .gpio = 61, /* slimbus clk */ |
| 396 | .settings = { |
| 397 | [GPIOMUX_SUSPENDED] = &slimbus, |
| 398 | }, |
| 399 | }, |
| 400 | }; |
| 401 | |
| 402 | static struct msm_gpiomux_config msm8960_audio_codec_configs[] __initdata = { |
| 403 | { |
| 404 | .gpio = 59, |
| 405 | .settings = { |
| 406 | [GPIOMUX_SUSPENDED] = &cdc_mclk, |
| 407 | }, |
| 408 | }, |
| 409 | }; |
| 410 | |
Bhalchandra Gajare | dd00a9b | 2012-05-02 16:44:36 -0700 | [diff] [blame] | 411 | static struct msm_gpiomux_config msm8960_audio_mbhc_configs[] __initdata = { |
| 412 | { |
| 413 | .gpio = 37, |
| 414 | .settings = { |
| 415 | [GPIOMUX_SUSPENDED] = &audio_mbhc, |
| 416 | }, |
| 417 | }, |
| 418 | }; |
| 419 | |
Bhalchandra Gajare | c0ac7d8 | 2012-05-16 11:28:59 -0700 | [diff] [blame] | 420 | static struct msm_gpiomux_config msm8960_audio_spkr_configs[] __initdata = { |
| 421 | { |
| 422 | .gpio = 15, |
| 423 | .settings = { |
| 424 | [GPIOMUX_SUSPENDED] = &audio_spkr_boost, |
| 425 | }, |
| 426 | }, |
| 427 | }; |
| 428 | |
| 429 | |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 430 | static struct msm_gpiomux_config msm8960_audio_auxpcm_configs[] __initdata = { |
| 431 | { |
| 432 | .gpio = 63, |
| 433 | .settings = { |
| 434 | [GPIOMUX_SUSPENDED] = &audio_auxpcm[0], |
| 435 | [GPIOMUX_ACTIVE] = &audio_auxpcm[1], |
| 436 | }, |
| 437 | }, |
| 438 | { |
| 439 | .gpio = 64, |
| 440 | .settings = { |
| 441 | [GPIOMUX_SUSPENDED] = &audio_auxpcm[0], |
| 442 | [GPIOMUX_ACTIVE] = &audio_auxpcm[1], |
| 443 | }, |
| 444 | }, |
| 445 | { |
| 446 | .gpio = 65, |
| 447 | .settings = { |
| 448 | [GPIOMUX_SUSPENDED] = &audio_auxpcm[0], |
| 449 | [GPIOMUX_ACTIVE] = &audio_auxpcm[1], |
| 450 | }, |
| 451 | }, |
| 452 | { |
| 453 | .gpio = 66, |
| 454 | .settings = { |
| 455 | [GPIOMUX_SUSPENDED] = &audio_auxpcm[0], |
| 456 | [GPIOMUX_ACTIVE] = &audio_auxpcm[1], |
| 457 | }, |
| 458 | }, |
| 459 | }; |
| 460 | |
| 461 | static struct msm_gpiomux_config wcnss_5wire_interface[] = { |
| 462 | { |
| 463 | .gpio = 84, |
| 464 | .settings = { |
| 465 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 466 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 467 | }, |
| 468 | }, |
| 469 | { |
| 470 | .gpio = 85, |
| 471 | .settings = { |
| 472 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 473 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 474 | }, |
| 475 | }, |
| 476 | { |
| 477 | .gpio = 86, |
| 478 | .settings = { |
| 479 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 480 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 481 | }, |
| 482 | }, |
| 483 | { |
| 484 | .gpio = 87, |
| 485 | .settings = { |
| 486 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 487 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 488 | }, |
| 489 | }, |
| 490 | { |
| 491 | .gpio = 88, |
| 492 | .settings = { |
| 493 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 494 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 495 | }, |
| 496 | }, |
| 497 | }; |
| 498 | |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 499 | static struct msm_gpiomux_config msm8960_atmel_configs[] __initdata = { |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 500 | { /* TS INTERRUPT */ |
| 501 | .gpio = 11, |
| 502 | .settings = { |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 503 | [GPIOMUX_ACTIVE] = &atmel_int_act_cfg, |
| 504 | [GPIOMUX_SUSPENDED] = &atmel_int_sus_cfg, |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 505 | }, |
| 506 | }, |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 507 | { /* TS LDO ENABLE */ |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 508 | .gpio = 50, |
| 509 | .settings = { |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 510 | [GPIOMUX_ACTIVE] = &atmel_ldo_en_act_cfg, |
| 511 | [GPIOMUX_SUSPENDED] = &atmel_ldo_en_sus_cfg, |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 512 | }, |
| 513 | }, |
| 514 | { /* TS RESOUT */ |
| 515 | .gpio = 52, |
| 516 | .settings = { |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 517 | [GPIOMUX_ACTIVE] = &atmel_resout_act_cfg, |
| 518 | [GPIOMUX_SUSPENDED] = &atmel_resout_sus_cfg, |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 519 | }, |
| 520 | }, |
| 521 | }; |
| 522 | |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 523 | static struct msm_gpiomux_config hap_lvl_shft_config[] __initdata = { |
| 524 | { |
| 525 | .gpio = 47, |
| 526 | .settings = { |
| 527 | [GPIOMUX_SUSPENDED] = &hap_lvl_shft_suspended_config, |
| 528 | [GPIOMUX_ACTIVE] = &hap_lvl_shft_active_config, |
| 529 | }, |
| 530 | }, |
| 531 | }; |
| 532 | |
| 533 | static struct msm_gpiomux_config mdm_configs[] __initdata = { |
| 534 | /* AP2MDM_STATUS */ |
| 535 | { |
| 536 | .gpio = 94, |
| 537 | .settings = { |
| 538 | [GPIOMUX_SUSPENDED] = &ap2mdm_cfg, |
| 539 | } |
| 540 | }, |
| 541 | /* MDM2AP_STATUS */ |
| 542 | { |
| 543 | .gpio = 69, |
| 544 | .settings = { |
| 545 | [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg, |
| 546 | } |
| 547 | }, |
| 548 | /* MDM2AP_ERRFATAL */ |
| 549 | { |
| 550 | .gpio = 70, |
| 551 | .settings = { |
| 552 | [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg, |
| 553 | } |
| 554 | }, |
| 555 | /* AP2MDM_ERRFATAL */ |
| 556 | { |
| 557 | .gpio = 95, |
| 558 | .settings = { |
| 559 | [GPIOMUX_SUSPENDED] = &ap2mdm_cfg, |
| 560 | } |
| 561 | }, |
| 562 | /* AP2MDM_KPDPWR_N */ |
| 563 | { |
| 564 | .gpio = 81, |
| 565 | .settings = { |
| 566 | [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg, |
| 567 | } |
| 568 | }, |
| 569 | /* AP2MDM_PMIC_RESET_N */ |
| 570 | { |
| 571 | .gpio = 80, |
| 572 | .settings = { |
| 573 | [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg, |
| 574 | } |
| 575 | } |
| 576 | }; |
| 577 | |
| 578 | static struct msm_gpiomux_config msm8960_mdp_vsync_configs[] __initdata = { |
| 579 | { |
| 580 | .gpio = 0, |
| 581 | .settings = { |
| 582 | [GPIOMUX_ACTIVE] = &mdp_vsync_active_cfg, |
| 583 | [GPIOMUX_SUSPENDED] = &mdp_vsync_suspend_cfg, |
| 584 | }, |
| 585 | } |
| 586 | }; |
| 587 | |
| 588 | #ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL |
| 589 | static struct msm_gpiomux_config msm8960_hdmi_configs[] __initdata = { |
| 590 | { |
| 591 | .gpio = 99, |
| 592 | .settings = { |
| 593 | [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg, |
| 594 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 595 | }, |
| 596 | }, |
| 597 | { |
| 598 | .gpio = 100, |
| 599 | .settings = { |
| 600 | [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg, |
| 601 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 602 | }, |
| 603 | }, |
| 604 | { |
| 605 | .gpio = 101, |
| 606 | .settings = { |
| 607 | [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg, |
| 608 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 609 | }, |
| 610 | }, |
| 611 | { |
| 612 | .gpio = 102, |
| 613 | .settings = { |
| 614 | [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg, |
| 615 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 616 | }, |
| 617 | }, |
Manoj Rao | c6d904c | 2012-06-22 00:32:14 -0700 | [diff] [blame] | 618 | |
| 619 | }; |
| 620 | |
| 621 | static struct msm_gpiomux_config msm8930_mhl_configs[] __initdata = { |
| 622 | { |
| 623 | .gpio = 72, |
| 624 | .settings = { |
| 625 | [GPIOMUX_ACTIVE] = &hdmi_active_3_cfg, |
| 626 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 627 | }, |
| 628 | }, |
| 629 | { |
| 630 | .gpio = 71, |
| 631 | .settings = { |
| 632 | [GPIOMUX_ACTIVE] = &hdmi_active_4_cfg, |
| 633 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 634 | }, |
| 635 | }, |
| 636 | { |
| 637 | .gpio = 73, |
| 638 | .settings = { |
| 639 | [GPIOMUX_ACTIVE] = &hdmi_active_5_cfg, |
| 640 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 641 | }, |
| 642 | }, |
| 643 | |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 644 | }; |
| 645 | #endif |
| 646 | |
Amy Maloche | e8de95d | 2012-02-23 10:40:25 -0800 | [diff] [blame] | 647 | static struct gpiomux_setting haptics_active_cfg = { |
| 648 | .func = GPIOMUX_FUNC_GPIO, |
| 649 | .drv = GPIOMUX_DRV_8MA, |
| 650 | .pull = GPIOMUX_PULL_UP, |
| 651 | }; |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 652 | static struct gpiomux_setting haptics_suspend_cfg = { |
| 653 | .func = GPIOMUX_FUNC_GPIO, |
| 654 | .drv = GPIOMUX_DRV_8MA, |
| 655 | .pull = GPIOMUX_PULL_DOWN, |
| 656 | }; |
| 657 | |
| 658 | static struct msm_gpiomux_config msm8930_haptics_configs[] __initdata = { |
| 659 | { |
| 660 | .gpio = 77, |
| 661 | .settings = { |
Amy Maloche | e8de95d | 2012-02-23 10:40:25 -0800 | [diff] [blame] | 662 | [GPIOMUX_ACTIVE] = &haptics_active_cfg, |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 663 | [GPIOMUX_SUSPENDED] = &haptics_suspend_cfg, |
| 664 | }, |
| 665 | }, |
| 666 | { |
| 667 | .gpio = 78, |
| 668 | .settings = { |
Amy Maloche | e8de95d | 2012-02-23 10:40:25 -0800 | [diff] [blame] | 669 | [GPIOMUX_ACTIVE] = &haptics_active_cfg, |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 670 | [GPIOMUX_SUSPENDED] = &haptics_suspend_cfg, |
| 671 | }, |
| 672 | }, |
| 673 | }; |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 674 | |
Krishna Konda | 41b6ab0 | 2012-05-16 15:08:03 -0700 | [diff] [blame] | 675 | static struct gpiomux_setting sd_det_line = { |
| 676 | .func = GPIOMUX_FUNC_GPIO, |
| 677 | .drv = GPIOMUX_DRV_2MA, |
| 678 | .pull = GPIOMUX_PULL_NONE, |
| 679 | }; |
| 680 | |
| 681 | static struct msm_gpiomux_config msm8930_sd_det_config[] __initdata = { |
| 682 | { |
| 683 | .gpio = 94, /* SD Card Detect Line */ |
| 684 | .settings = { |
| 685 | [GPIOMUX_SUSPENDED] = &sd_det_line, |
| 686 | [GPIOMUX_ACTIVE] = &sd_det_line, |
| 687 | }, |
| 688 | }, |
| 689 | }; |
| 690 | |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 691 | int __init msm8930_init_gpiomux(void) |
| 692 | { |
| 693 | int rc = msm_gpiomux_init(NR_GPIO_IRQS); |
| 694 | if (rc) { |
| 695 | pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc); |
| 696 | return rc; |
| 697 | } |
| 698 | |
| 699 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
| 700 | msm_gpiomux_install(msm8960_ethernet_configs, |
| 701 | ARRAY_SIZE(msm8960_ethernet_configs)); |
| 702 | #endif |
| 703 | |
| 704 | msm_gpiomux_install(msm8960_gsbi_configs, |
| 705 | ARRAY_SIZE(msm8960_gsbi_configs)); |
| 706 | |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 707 | msm_gpiomux_install(msm8960_atmel_configs, |
| 708 | ARRAY_SIZE(msm8960_atmel_configs)); |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 709 | |
| 710 | msm_gpiomux_install(msm8960_slimbus_config, |
| 711 | ARRAY_SIZE(msm8960_slimbus_config)); |
| 712 | |
| 713 | msm_gpiomux_install(msm8960_audio_codec_configs, |
| 714 | ARRAY_SIZE(msm8960_audio_codec_configs)); |
| 715 | |
Bhalchandra Gajare | dd00a9b | 2012-05-02 16:44:36 -0700 | [diff] [blame] | 716 | msm_gpiomux_install(msm8960_audio_mbhc_configs, |
| 717 | ARRAY_SIZE(msm8960_audio_mbhc_configs)); |
| 718 | |
Bhalchandra Gajare | c0ac7d8 | 2012-05-16 11:28:59 -0700 | [diff] [blame] | 719 | msm_gpiomux_install(msm8960_audio_spkr_configs, |
| 720 | ARRAY_SIZE(msm8960_audio_spkr_configs)); |
| 721 | |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 722 | msm_gpiomux_install(msm8960_audio_auxpcm_configs, |
| 723 | ARRAY_SIZE(msm8960_audio_auxpcm_configs)); |
| 724 | |
| 725 | msm_gpiomux_install(wcnss_5wire_interface, |
| 726 | ARRAY_SIZE(wcnss_5wire_interface)); |
| 727 | |
| 728 | if (machine_is_msm8930_mtp() || machine_is_msm8930_fluid() || |
Mayank Rana | bf5084a | 2011-12-12 17:06:54 +0530 | [diff] [blame] | 729 | machine_is_msm8930_cdp()) { |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 730 | msm_gpiomux_install(hap_lvl_shft_config, |
| 731 | ARRAY_SIZE(hap_lvl_shft_config)); |
Mayank Rana | bf5084a | 2011-12-12 17:06:54 +0530 | [diff] [blame] | 732 | #ifdef MSM8930_PHASE_2 |
| 733 | msm_gpiomux_install(msm8930_hsusb_configs, |
| 734 | ARRAY_SIZE(msm8930_hsusb_configs)); |
| 735 | #endif |
| 736 | } |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 737 | |
| 738 | if (PLATFORM_IS_CHARM25()) |
| 739 | msm_gpiomux_install(mdm_configs, |
| 740 | ARRAY_SIZE(mdm_configs)); |
| 741 | |
Amy Maloche | e8de95d | 2012-02-23 10:40:25 -0800 | [diff] [blame] | 742 | if (machine_is_msm8930_cdp() || machine_is_msm8930_mtp() |
| 743 | || machine_is_msm8930_fluid()) |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 744 | msm_gpiomux_install(msm8930_haptics_configs, |
| 745 | ARRAY_SIZE(msm8930_haptics_configs)); |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 746 | |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 747 | #ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL |
| 748 | msm_gpiomux_install(msm8960_hdmi_configs, |
| 749 | ARRAY_SIZE(msm8960_hdmi_configs)); |
Manoj Rao | c6d904c | 2012-06-22 00:32:14 -0700 | [diff] [blame] | 750 | if (machine_is_msm8930_fluid()) |
| 751 | msm_gpiomux_install(msm8930_mhl_configs, |
| 752 | ARRAY_SIZE(msm8930_mhl_configs)); |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 753 | #endif |
| 754 | |
| 755 | msm_gpiomux_install(msm8960_mdp_vsync_configs, |
| 756 | ARRAY_SIZE(msm8960_mdp_vsync_configs)); |
Krishna Konda | 41b6ab0 | 2012-05-16 15:08:03 -0700 | [diff] [blame] | 757 | |
| 758 | msm_gpiomux_install(msm8930_sd_det_config, |
| 759 | ARRAY_SIZE(msm8930_sd_det_config)); |
| 760 | |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 761 | return 0; |
| 762 | } |