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