Patrick Lai | b593eaf | 2012-01-05 22:14:47 -0800 | [diff] [blame] | 1 | /* Copyright (c) 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-8960.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 | |
Stepan Moskovchenko | 2b4b1cd | 2012-03-29 18:21:04 -0700 | [diff] [blame] | 58 | static struct gpiomux_setting gsbi_uart = { |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 59 | .func = GPIOMUX_FUNC_1, |
| 60 | .drv = GPIOMUX_DRV_8MA, |
| 61 | .pull = GPIOMUX_PULL_NONE, |
| 62 | }; |
| 63 | |
Mayank Rana | e009c92 | 2012-03-22 03:02:06 +0530 | [diff] [blame] | 64 | static struct gpiomux_setting gsbi9_active_cfg = { |
| 65 | .func = GPIOMUX_FUNC_2, |
| 66 | .drv = GPIOMUX_DRV_8MA, |
| 67 | .pull = GPIOMUX_PULL_DOWN, |
| 68 | }; |
| 69 | |
| 70 | static struct gpiomux_setting gsbi9_suspended_cfg = { |
| 71 | .func = GPIOMUX_FUNC_2, |
| 72 | .drv = GPIOMUX_DRV_2MA, |
| 73 | .pull = GPIOMUX_PULL_DOWN, |
| 74 | }; |
| 75 | |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 76 | static struct gpiomux_setting gsbi10 = { |
| 77 | .func = GPIOMUX_FUNC_2, |
| 78 | .drv = GPIOMUX_DRV_8MA, |
| 79 | .pull = GPIOMUX_PULL_NONE, |
| 80 | }; |
| 81 | |
| 82 | static struct gpiomux_setting gsbi12 = { |
| 83 | .func = GPIOMUX_FUNC_1, |
| 84 | .drv = GPIOMUX_DRV_8MA, |
| 85 | .pull = GPIOMUX_PULL_NONE, |
| 86 | }; |
| 87 | |
| 88 | static struct gpiomux_setting cdc_mclk = { |
| 89 | .func = GPIOMUX_FUNC_1, |
| 90 | .drv = GPIOMUX_DRV_8MA, |
| 91 | .pull = GPIOMUX_PULL_NONE, |
| 92 | }; |
| 93 | |
| 94 | static struct gpiomux_setting audio_auxpcm[] = { |
| 95 | /* Suspended state */ |
| 96 | { |
| 97 | .func = GPIOMUX_FUNC_GPIO, |
| 98 | .drv = GPIOMUX_DRV_2MA, |
Patrick Lai | b593eaf | 2012-01-05 22:14:47 -0800 | [diff] [blame] | 99 | .pull = GPIOMUX_PULL_DOWN, |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 100 | }, |
| 101 | /* Active state */ |
| 102 | { |
| 103 | .func = GPIOMUX_FUNC_1, |
| 104 | .drv = GPIOMUX_DRV_2MA, |
| 105 | .pull = GPIOMUX_PULL_NONE, |
| 106 | }, |
| 107 | }; |
| 108 | |
| 109 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
| 110 | static struct gpiomux_setting gpio_eth_config = { |
| 111 | .pull = GPIOMUX_PULL_NONE, |
| 112 | .drv = GPIOMUX_DRV_8MA, |
| 113 | .func = GPIOMUX_FUNC_GPIO, |
| 114 | }; |
| 115 | #endif |
| 116 | |
| 117 | static struct gpiomux_setting slimbus = { |
| 118 | .func = GPIOMUX_FUNC_1, |
| 119 | .drv = GPIOMUX_DRV_8MA, |
| 120 | .pull = GPIOMUX_PULL_KEEPER, |
| 121 | }; |
| 122 | |
| 123 | static struct gpiomux_setting wcnss_5wire_suspend_cfg = { |
| 124 | .func = GPIOMUX_FUNC_GPIO, |
| 125 | .drv = GPIOMUX_DRV_2MA, |
| 126 | .pull = GPIOMUX_PULL_UP, |
| 127 | }; |
| 128 | |
| 129 | static struct gpiomux_setting wcnss_5wire_active_cfg = { |
| 130 | .func = GPIOMUX_FUNC_1, |
| 131 | .drv = GPIOMUX_DRV_6MA, |
| 132 | .pull = GPIOMUX_PULL_DOWN, |
| 133 | }; |
| 134 | |
| 135 | static struct gpiomux_setting cyts_resout_sus_cfg = { |
| 136 | .func = GPIOMUX_FUNC_GPIO, |
| 137 | .drv = GPIOMUX_DRV_6MA, |
| 138 | .pull = GPIOMUX_PULL_UP, |
| 139 | }; |
| 140 | |
| 141 | static struct gpiomux_setting cyts_resout_act_cfg = { |
| 142 | .func = GPIOMUX_FUNC_GPIO, |
| 143 | .drv = GPIOMUX_DRV_6MA, |
| 144 | .pull = GPIOMUX_PULL_UP, |
| 145 | }; |
| 146 | |
| 147 | static struct gpiomux_setting cyts_sleep_sus_cfg = { |
| 148 | .func = GPIOMUX_FUNC_GPIO, |
| 149 | .drv = GPIOMUX_DRV_6MA, |
| 150 | .pull = GPIOMUX_PULL_DOWN, |
| 151 | }; |
| 152 | |
| 153 | static struct gpiomux_setting cyts_sleep_act_cfg = { |
| 154 | .func = GPIOMUX_FUNC_GPIO, |
| 155 | .drv = GPIOMUX_DRV_6MA, |
| 156 | .pull = GPIOMUX_PULL_DOWN, |
| 157 | }; |
| 158 | |
| 159 | static struct gpiomux_setting cyts_int_act_cfg = { |
| 160 | .func = GPIOMUX_FUNC_GPIO, |
| 161 | .drv = GPIOMUX_DRV_8MA, |
| 162 | .pull = GPIOMUX_PULL_UP, |
| 163 | }; |
| 164 | |
| 165 | static struct gpiomux_setting cyts_int_sus_cfg = { |
| 166 | .func = GPIOMUX_FUNC_GPIO, |
| 167 | .drv = GPIOMUX_DRV_2MA, |
| 168 | .pull = GPIOMUX_PULL_DOWN, |
| 169 | }; |
| 170 | |
| 171 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
| 172 | static struct gpiomux_setting hsic_act_cfg = { |
| 173 | .func = GPIOMUX_FUNC_1, |
| 174 | .drv = GPIOMUX_DRV_12MA, |
| 175 | .pull = GPIOMUX_PULL_NONE, |
| 176 | }; |
| 177 | |
| 178 | static struct gpiomux_setting hsic_sus_cfg = { |
| 179 | .func = GPIOMUX_FUNC_GPIO, |
| 180 | .drv = GPIOMUX_DRV_2MA, |
| 181 | .pull = GPIOMUX_PULL_DOWN, |
| 182 | .dir = GPIOMUX_OUT_LOW, |
| 183 | }; |
| 184 | |
| 185 | static struct gpiomux_setting hsic_hub_act_cfg = { |
| 186 | .func = GPIOMUX_FUNC_GPIO, |
| 187 | .drv = GPIOMUX_DRV_2MA, |
| 188 | .pull = GPIOMUX_PULL_NONE, |
| 189 | }; |
| 190 | #endif |
| 191 | |
| 192 | static struct gpiomux_setting hap_lvl_shft_suspended_config = { |
| 193 | .func = GPIOMUX_FUNC_GPIO, |
| 194 | .drv = GPIOMUX_DRV_2MA, |
| 195 | .pull = GPIOMUX_PULL_DOWN, |
| 196 | }; |
| 197 | |
| 198 | static struct gpiomux_setting hap_lvl_shft_active_config = { |
| 199 | .func = GPIOMUX_FUNC_GPIO, |
| 200 | .drv = GPIOMUX_DRV_8MA, |
| 201 | .pull = GPIOMUX_PULL_UP, |
| 202 | }; |
| 203 | |
| 204 | static struct gpiomux_setting ap2mdm_cfg = { |
| 205 | .func = GPIOMUX_FUNC_GPIO, |
| 206 | .drv = GPIOMUX_DRV_8MA, |
| 207 | .pull = GPIOMUX_PULL_DOWN, |
| 208 | }; |
| 209 | |
| 210 | static struct gpiomux_setting mdm2ap_status_cfg = { |
| 211 | .func = GPIOMUX_FUNC_GPIO, |
| 212 | .drv = GPIOMUX_DRV_8MA, |
| 213 | .pull = GPIOMUX_PULL_NONE, |
| 214 | }; |
| 215 | |
| 216 | static struct gpiomux_setting mdm2ap_errfatal_cfg = { |
| 217 | .func = GPIOMUX_FUNC_GPIO, |
| 218 | .drv = GPIOMUX_DRV_16MA, |
| 219 | .pull = GPIOMUX_PULL_DOWN, |
| 220 | }; |
| 221 | |
| 222 | static struct gpiomux_setting ap2mdm_kpdpwr_n_cfg = { |
| 223 | .func = GPIOMUX_FUNC_GPIO, |
| 224 | .drv = GPIOMUX_DRV_8MA, |
Joel King | 1c60731 | 2012-01-13 16:41:44 -0800 | [diff] [blame] | 225 | .pull = GPIOMUX_PULL_DOWN, |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 226 | }; |
| 227 | |
| 228 | static struct gpiomux_setting mdp_vsync_suspend_cfg = { |
| 229 | .func = GPIOMUX_FUNC_GPIO, |
| 230 | .drv = GPIOMUX_DRV_2MA, |
| 231 | .pull = GPIOMUX_PULL_DOWN, |
| 232 | }; |
| 233 | |
| 234 | static struct gpiomux_setting mdp_vsync_active_cfg = { |
| 235 | .func = GPIOMUX_FUNC_1, |
| 236 | .drv = GPIOMUX_DRV_2MA, |
| 237 | .pull = GPIOMUX_PULL_DOWN, |
| 238 | }; |
| 239 | |
| 240 | #ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL |
| 241 | static struct gpiomux_setting hdmi_suspend_cfg = { |
| 242 | .func = GPIOMUX_FUNC_GPIO, |
| 243 | .drv = GPIOMUX_DRV_2MA, |
| 244 | .pull = GPIOMUX_PULL_DOWN, |
| 245 | }; |
| 246 | |
| 247 | static struct gpiomux_setting hdmi_active_1_cfg = { |
| 248 | .func = GPIOMUX_FUNC_1, |
| 249 | .drv = GPIOMUX_DRV_2MA, |
| 250 | .pull = GPIOMUX_PULL_UP, |
| 251 | }; |
| 252 | |
| 253 | static struct gpiomux_setting hdmi_active_2_cfg = { |
| 254 | .func = GPIOMUX_FUNC_1, |
| 255 | .drv = GPIOMUX_DRV_2MA, |
| 256 | .pull = GPIOMUX_PULL_DOWN, |
| 257 | }; |
Eugene Yasman | 6759234 | 2011-12-11 13:12:36 +0200 | [diff] [blame] | 258 | |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -0700 | [diff] [blame] | 259 | #if defined(CONFIG_FB_MSM_HDMI_MHL_8334) || defined(CONFIG_FB_MSM_HDMI_MHL_9244) |
Eugene Yasman | 6759234 | 2011-12-11 13:12:36 +0200 | [diff] [blame] | 260 | static struct gpiomux_setting hdmi_active_3_cfg = { |
| 261 | .func = GPIOMUX_FUNC_GPIO, |
| 262 | .drv = GPIOMUX_DRV_2MA, |
Eugene Yasman | a2db416 | 2011-12-13 09:28:22 +0200 | [diff] [blame] | 263 | .pull = GPIOMUX_PULL_UP, |
Eugene Yasman | 6759234 | 2011-12-11 13:12:36 +0200 | [diff] [blame] | 264 | .dir = GPIOMUX_IN, |
| 265 | }; |
| 266 | |
| 267 | static struct gpiomux_setting hdmi_active_4_cfg = { |
| 268 | .func = GPIOMUX_FUNC_GPIO, |
| 269 | .drv = GPIOMUX_DRV_2MA, |
| 270 | .pull = GPIOMUX_PULL_UP, |
| 271 | .dir = GPIOMUX_OUT_HIGH, |
| 272 | }; |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 273 | #endif |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -0700 | [diff] [blame] | 274 | #endif |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 275 | |
| 276 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
| 277 | static struct msm_gpiomux_config msm8960_ethernet_configs[] = { |
| 278 | { |
| 279 | .gpio = 90, |
| 280 | .settings = { |
| 281 | [GPIOMUX_SUSPENDED] = &gpio_eth_config, |
| 282 | } |
| 283 | }, |
| 284 | { |
| 285 | .gpio = 89, |
| 286 | .settings = { |
| 287 | [GPIOMUX_SUSPENDED] = &gpio_eth_config, |
| 288 | } |
| 289 | }, |
| 290 | }; |
| 291 | #endif |
| 292 | |
Mayank Rana | e009c92 | 2012-03-22 03:02:06 +0530 | [diff] [blame] | 293 | static struct msm_gpiomux_config msm8960_fusion_gsbi_configs[] = { |
| 294 | { |
| 295 | .gpio = 93, |
| 296 | .settings = { |
| 297 | [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg, |
| 298 | [GPIOMUX_ACTIVE] = &gsbi9_active_cfg, |
| 299 | } |
| 300 | }, |
| 301 | { |
| 302 | .gpio = 94, |
| 303 | .settings = { |
| 304 | [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg, |
| 305 | [GPIOMUX_ACTIVE] = &gsbi9_active_cfg, |
| 306 | } |
| 307 | }, |
| 308 | { |
| 309 | .gpio = 95, |
| 310 | .settings = { |
| 311 | [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg, |
| 312 | [GPIOMUX_ACTIVE] = &gsbi9_active_cfg, |
| 313 | } |
| 314 | }, |
| 315 | { |
| 316 | .gpio = 96, |
| 317 | .settings = { |
| 318 | [GPIOMUX_SUSPENDED] = &gsbi9_suspended_cfg, |
| 319 | [GPIOMUX_ACTIVE] = &gsbi9_active_cfg, |
| 320 | } |
| 321 | }, |
| 322 | }; |
| 323 | |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 324 | static struct msm_gpiomux_config msm8960_gsbi_configs[] __initdata = { |
| 325 | { |
| 326 | .gpio = 6, /* GSBI1 QUP SPI_DATA_MOSI */ |
| 327 | .settings = { |
| 328 | [GPIOMUX_SUSPENDED] = &spi_suspended_config, |
| 329 | [GPIOMUX_ACTIVE] = &spi_active, |
| 330 | }, |
| 331 | }, |
| 332 | { |
| 333 | .gpio = 7, /* GSBI1 QUP SPI_DATA_MISO */ |
| 334 | .settings = { |
| 335 | [GPIOMUX_SUSPENDED] = &spi_suspended_config, |
| 336 | [GPIOMUX_ACTIVE] = &spi_active, |
| 337 | }, |
| 338 | }, |
| 339 | { |
| 340 | .gpio = 8, /* GSBI1 QUP SPI_CS_N */ |
| 341 | .settings = { |
| 342 | [GPIOMUX_SUSPENDED] = &spi_suspended_config, |
| 343 | [GPIOMUX_ACTIVE] = &spi_active, |
| 344 | }, |
| 345 | }, |
| 346 | { |
| 347 | .gpio = 9, /* GSBI1 QUP SPI_CLK */ |
| 348 | .settings = { |
| 349 | [GPIOMUX_SUSPENDED] = &spi_suspended_config, |
| 350 | [GPIOMUX_ACTIVE] = &spi_active, |
| 351 | }, |
| 352 | }, |
| 353 | { |
| 354 | .gpio = 14, /* GSBI1 SPI_CS_1 */ |
| 355 | .settings = { |
| 356 | [GPIOMUX_SUSPENDED] = &spi_suspended_config2, |
| 357 | [GPIOMUX_ACTIVE] = &spi_active_config2, |
| 358 | }, |
| 359 | }, |
| 360 | { |
| 361 | .gpio = 16, /* GSBI3 I2C QUP SDA */ |
| 362 | .settings = { |
| 363 | [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg, |
| 364 | [GPIOMUX_ACTIVE] = &gsbi3_active_cfg, |
| 365 | }, |
| 366 | }, |
| 367 | { |
| 368 | .gpio = 17, /* GSBI3 I2C QUP SCL */ |
| 369 | .settings = { |
| 370 | [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg, |
| 371 | [GPIOMUX_ACTIVE] = &gsbi3_active_cfg, |
| 372 | }, |
| 373 | }, |
| 374 | { |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 375 | .gpio = 44, /* GSBI12 I2C QUP SDA */ |
| 376 | .settings = { |
| 377 | [GPIOMUX_SUSPENDED] = &gsbi12, |
| 378 | }, |
| 379 | }, |
| 380 | { |
| 381 | .gpio = 45, /* GSBI12 I2C QUP SCL */ |
| 382 | .settings = { |
| 383 | [GPIOMUX_SUSPENDED] = &gsbi12, |
| 384 | }, |
| 385 | }, |
| 386 | { |
| 387 | .gpio = 73, /* GSBI10 I2C QUP SDA */ |
| 388 | .settings = { |
| 389 | [GPIOMUX_SUSPENDED] = &gsbi10, |
| 390 | }, |
| 391 | }, |
| 392 | { |
| 393 | .gpio = 74, /* GSBI10 I2C QUP SCL */ |
| 394 | .settings = { |
| 395 | [GPIOMUX_SUSPENDED] = &gsbi10, |
| 396 | }, |
| 397 | }, |
| 398 | }; |
| 399 | |
Stepan Moskovchenko | 2b4b1cd | 2012-03-29 18:21:04 -0700 | [diff] [blame] | 400 | static struct msm_gpiomux_config msm8960_gsbi5_uart_configs[] __initdata = { |
| 401 | { |
| 402 | .gpio = 22, /* GSBI5 UART2 */ |
| 403 | .settings = { |
| 404 | [GPIOMUX_SUSPENDED] = &gsbi_uart, |
| 405 | }, |
| 406 | }, |
| 407 | { |
| 408 | .gpio = 23, /* GSBI5 UART2 */ |
| 409 | .settings = { |
| 410 | [GPIOMUX_SUSPENDED] = &gsbi_uart, |
| 411 | }, |
| 412 | }, |
| 413 | { |
| 414 | .gpio = 24, /* GSBI5 UART2 */ |
| 415 | .settings = { |
| 416 | [GPIOMUX_SUSPENDED] = &gsbi_uart, |
| 417 | }, |
| 418 | }, |
| 419 | { |
| 420 | .gpio = 25, /* GSBI5 UART2 */ |
| 421 | .settings = { |
| 422 | [GPIOMUX_SUSPENDED] = &gsbi_uart, |
| 423 | }, |
| 424 | }, |
| 425 | }; |
| 426 | |
| 427 | static struct msm_gpiomux_config msm8960_gsbi8_uart_configs[] __initdata = { |
| 428 | { |
| 429 | .gpio = 34, /* GSBI8 UART3 */ |
| 430 | .settings = { |
| 431 | [GPIOMUX_SUSPENDED] = &gsbi_uart, |
| 432 | }, |
| 433 | }, |
| 434 | { |
| 435 | .gpio = 35, /* GSBI8 UART3 */ |
| 436 | .settings = { |
| 437 | [GPIOMUX_SUSPENDED] = &gsbi_uart, |
| 438 | }, |
| 439 | }, |
| 440 | { |
| 441 | .gpio = 36, /* GSBI8 UART3 */ |
| 442 | .settings = { |
| 443 | [GPIOMUX_SUSPENDED] = &gsbi_uart, |
| 444 | }, |
| 445 | }, |
| 446 | { |
| 447 | .gpio = 37, /* GSBI8 UART3 */ |
| 448 | .settings = { |
| 449 | [GPIOMUX_SUSPENDED] = &gsbi_uart, |
| 450 | }, |
| 451 | }, |
| 452 | }; |
| 453 | |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 454 | static struct msm_gpiomux_config msm8960_slimbus_config[] __initdata = { |
| 455 | { |
| 456 | .gpio = 60, /* slimbus data */ |
| 457 | .settings = { |
| 458 | [GPIOMUX_SUSPENDED] = &slimbus, |
| 459 | }, |
| 460 | }, |
| 461 | { |
| 462 | .gpio = 61, /* slimbus clk */ |
| 463 | .settings = { |
| 464 | [GPIOMUX_SUSPENDED] = &slimbus, |
| 465 | }, |
| 466 | }, |
| 467 | }; |
| 468 | |
| 469 | static struct msm_gpiomux_config msm8960_audio_codec_configs[] __initdata = { |
| 470 | { |
| 471 | .gpio = 59, |
| 472 | .settings = { |
| 473 | [GPIOMUX_SUSPENDED] = &cdc_mclk, |
| 474 | }, |
| 475 | }, |
| 476 | }; |
| 477 | |
| 478 | static struct msm_gpiomux_config msm8960_audio_auxpcm_configs[] __initdata = { |
| 479 | { |
| 480 | .gpio = 63, |
| 481 | .settings = { |
| 482 | [GPIOMUX_SUSPENDED] = &audio_auxpcm[0], |
| 483 | [GPIOMUX_ACTIVE] = &audio_auxpcm[1], |
| 484 | }, |
| 485 | }, |
| 486 | { |
| 487 | .gpio = 64, |
| 488 | .settings = { |
| 489 | [GPIOMUX_SUSPENDED] = &audio_auxpcm[0], |
| 490 | [GPIOMUX_ACTIVE] = &audio_auxpcm[1], |
| 491 | }, |
| 492 | }, |
| 493 | { |
| 494 | .gpio = 65, |
| 495 | .settings = { |
| 496 | [GPIOMUX_SUSPENDED] = &audio_auxpcm[0], |
| 497 | [GPIOMUX_ACTIVE] = &audio_auxpcm[1], |
| 498 | }, |
| 499 | }, |
| 500 | { |
| 501 | .gpio = 66, |
| 502 | .settings = { |
| 503 | [GPIOMUX_SUSPENDED] = &audio_auxpcm[0], |
| 504 | [GPIOMUX_ACTIVE] = &audio_auxpcm[1], |
| 505 | }, |
| 506 | }, |
| 507 | }; |
| 508 | |
| 509 | static struct msm_gpiomux_config wcnss_5wire_interface[] = { |
| 510 | { |
| 511 | .gpio = 84, |
| 512 | .settings = { |
| 513 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 514 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 515 | }, |
| 516 | }, |
| 517 | { |
| 518 | .gpio = 85, |
| 519 | .settings = { |
| 520 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 521 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 522 | }, |
| 523 | }, |
| 524 | { |
| 525 | .gpio = 86, |
| 526 | .settings = { |
| 527 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 528 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 529 | }, |
| 530 | }, |
| 531 | { |
| 532 | .gpio = 87, |
| 533 | .settings = { |
| 534 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 535 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 536 | }, |
| 537 | }, |
| 538 | { |
| 539 | .gpio = 88, |
| 540 | .settings = { |
| 541 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 542 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 543 | }, |
| 544 | }, |
| 545 | }; |
| 546 | |
| 547 | static struct msm_gpiomux_config msm8960_cyts_configs[] __initdata = { |
| 548 | { /* TS INTERRUPT */ |
| 549 | .gpio = 11, |
| 550 | .settings = { |
| 551 | [GPIOMUX_ACTIVE] = &cyts_int_act_cfg, |
| 552 | [GPIOMUX_SUSPENDED] = &cyts_int_sus_cfg, |
| 553 | }, |
| 554 | }, |
| 555 | { /* TS SLEEP */ |
| 556 | .gpio = 50, |
| 557 | .settings = { |
| 558 | [GPIOMUX_ACTIVE] = &cyts_sleep_act_cfg, |
| 559 | [GPIOMUX_SUSPENDED] = &cyts_sleep_sus_cfg, |
| 560 | }, |
| 561 | }, |
| 562 | { /* TS RESOUT */ |
| 563 | .gpio = 52, |
| 564 | .settings = { |
| 565 | [GPIOMUX_ACTIVE] = &cyts_resout_act_cfg, |
| 566 | [GPIOMUX_SUSPENDED] = &cyts_resout_sus_cfg, |
| 567 | }, |
| 568 | }, |
| 569 | }; |
| 570 | |
| 571 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
| 572 | static struct msm_gpiomux_config msm8960_hsic_configs[] = { |
| 573 | { |
| 574 | .gpio = 150, /*HSIC_STROBE */ |
| 575 | .settings = { |
| 576 | [GPIOMUX_ACTIVE] = &hsic_act_cfg, |
| 577 | [GPIOMUX_SUSPENDED] = &hsic_sus_cfg, |
| 578 | }, |
| 579 | }, |
| 580 | { |
| 581 | .gpio = 151, /* HSIC_DATA */ |
| 582 | .settings = { |
| 583 | [GPIOMUX_ACTIVE] = &hsic_act_cfg, |
| 584 | [GPIOMUX_SUSPENDED] = &hsic_sus_cfg, |
| 585 | }, |
| 586 | }, |
Vijayavardhan Vennapusa | afbbb8f | 2012-04-13 16:28:45 +0530 | [diff] [blame] | 587 | }; |
| 588 | |
| 589 | static struct msm_gpiomux_config msm8960_hsic_hub_configs[] = { |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 590 | { |
| 591 | .gpio = 91, /* HSIC_HUB_RESET */ |
| 592 | .settings = { |
| 593 | [GPIOMUX_ACTIVE] = &hsic_hub_act_cfg, |
| 594 | [GPIOMUX_SUSPENDED] = &hsic_sus_cfg, |
| 595 | }, |
| 596 | }, |
| 597 | }; |
| 598 | #endif |
| 599 | |
| 600 | static struct msm_gpiomux_config hap_lvl_shft_config[] __initdata = { |
| 601 | { |
| 602 | .gpio = 47, |
| 603 | .settings = { |
| 604 | [GPIOMUX_SUSPENDED] = &hap_lvl_shft_suspended_config, |
| 605 | [GPIOMUX_ACTIVE] = &hap_lvl_shft_active_config, |
| 606 | }, |
| 607 | }, |
| 608 | }; |
| 609 | |
| 610 | static struct msm_gpiomux_config mdm_configs[] __initdata = { |
| 611 | /* AP2MDM_STATUS */ |
| 612 | { |
| 613 | .gpio = 94, |
| 614 | .settings = { |
| 615 | [GPIOMUX_SUSPENDED] = &ap2mdm_cfg, |
| 616 | } |
| 617 | }, |
| 618 | /* MDM2AP_STATUS */ |
| 619 | { |
| 620 | .gpio = 69, |
| 621 | .settings = { |
| 622 | [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg, |
| 623 | } |
| 624 | }, |
| 625 | /* MDM2AP_ERRFATAL */ |
| 626 | { |
| 627 | .gpio = 70, |
| 628 | .settings = { |
| 629 | [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg, |
| 630 | } |
| 631 | }, |
| 632 | /* AP2MDM_ERRFATAL */ |
| 633 | { |
| 634 | .gpio = 95, |
| 635 | .settings = { |
| 636 | [GPIOMUX_SUSPENDED] = &ap2mdm_cfg, |
| 637 | } |
| 638 | }, |
| 639 | /* AP2MDM_KPDPWR_N */ |
| 640 | { |
| 641 | .gpio = 81, |
| 642 | .settings = { |
| 643 | [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg, |
| 644 | } |
| 645 | }, |
| 646 | /* AP2MDM_PMIC_RESET_N */ |
| 647 | { |
| 648 | .gpio = 80, |
| 649 | .settings = { |
| 650 | [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg, |
| 651 | } |
| 652 | } |
| 653 | }; |
| 654 | |
| 655 | static struct msm_gpiomux_config msm8960_mdp_vsync_configs[] __initdata = { |
| 656 | { |
| 657 | .gpio = 0, |
| 658 | .settings = { |
| 659 | [GPIOMUX_ACTIVE] = &mdp_vsync_active_cfg, |
| 660 | [GPIOMUX_SUSPENDED] = &mdp_vsync_suspend_cfg, |
| 661 | }, |
| 662 | } |
| 663 | }; |
| 664 | |
| 665 | #ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL |
| 666 | static struct msm_gpiomux_config msm8960_hdmi_configs[] __initdata = { |
| 667 | { |
| 668 | .gpio = 99, |
| 669 | .settings = { |
| 670 | [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg, |
| 671 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 672 | }, |
| 673 | }, |
| 674 | { |
| 675 | .gpio = 100, |
| 676 | .settings = { |
| 677 | [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg, |
| 678 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 679 | }, |
| 680 | }, |
| 681 | { |
| 682 | .gpio = 101, |
| 683 | .settings = { |
| 684 | [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg, |
| 685 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 686 | }, |
| 687 | }, |
| 688 | { |
| 689 | .gpio = 102, |
| 690 | .settings = { |
| 691 | [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg, |
| 692 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 693 | }, |
| 694 | }, |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -0700 | [diff] [blame] | 695 | #ifdef CONFIG_FB_MSM_HDMI_MHL_9244 |
Eugene Yasman | 6759234 | 2011-12-11 13:12:36 +0200 | [diff] [blame] | 696 | { |
| 697 | .gpio = 15, |
| 698 | .settings = { |
| 699 | [GPIOMUX_ACTIVE] = &hdmi_active_3_cfg, |
| 700 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 701 | }, |
| 702 | }, |
| 703 | { |
| 704 | .gpio = 66, |
| 705 | .settings = { |
| 706 | [GPIOMUX_ACTIVE] = &hdmi_active_4_cfg, |
| 707 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 708 | }, |
| 709 | }, |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -0700 | [diff] [blame] | 710 | #endif |
| 711 | #ifdef CONFIG_FB_MSM_HDMI_MHL_8334 |
| 712 | { |
| 713 | .gpio = 4, |
| 714 | .settings = { |
| 715 | [GPIOMUX_ACTIVE] = &hdmi_active_3_cfg, |
| 716 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 717 | }, |
| 718 | }, |
| 719 | { |
| 720 | .gpio = 15, |
| 721 | .settings = { |
| 722 | [GPIOMUX_ACTIVE] = &hdmi_active_4_cfg, |
| 723 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 724 | }, |
| 725 | }, |
| 726 | #endif /* CONFIG_FB_MSM_HDMI_MHL */ |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 727 | }; |
| 728 | #endif |
| 729 | |
Pratibhasagar V | 57c808e | 2012-01-12 13:47:30 +0530 | [diff] [blame^] | 730 | #ifdef CONFIG_MMC_MSM_SDC2_SUPPORT |
| 731 | static struct gpiomux_setting sdcc2_clk_actv_cfg = { |
| 732 | .func = GPIOMUX_FUNC_2, |
| 733 | .drv = GPIOMUX_DRV_8MA, |
| 734 | .pull = GPIOMUX_PULL_NONE, |
| 735 | }; |
| 736 | |
| 737 | static struct gpiomux_setting sdcc2_cmd_data_0_3_actv_cfg = { |
| 738 | .func = GPIOMUX_FUNC_2, |
| 739 | .drv = GPIOMUX_DRV_8MA, |
| 740 | .pull = GPIOMUX_PULL_UP, |
| 741 | }; |
| 742 | |
| 743 | static struct gpiomux_setting sdcc2_suspend_cfg = { |
| 744 | .func = GPIOMUX_FUNC_GPIO, |
| 745 | .drv = GPIOMUX_DRV_2MA, |
| 746 | .pull = GPIOMUX_PULL_DOWN, |
| 747 | }; |
| 748 | |
| 749 | static struct gpiomux_setting sdcc2_data_1_suspend_cfg = { |
| 750 | .func = GPIOMUX_FUNC_GPIO, |
| 751 | .drv = GPIOMUX_DRV_8MA, |
| 752 | .pull = GPIOMUX_PULL_UP, |
| 753 | }; |
| 754 | |
| 755 | static struct msm_gpiomux_config msm8960_sdcc2_configs[] __initdata = { |
| 756 | { |
| 757 | /* DATA_3 */ |
| 758 | .gpio = 92, |
| 759 | .settings = { |
| 760 | [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg, |
| 761 | [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg, |
| 762 | }, |
| 763 | }, |
| 764 | { |
| 765 | /* DATA_2 */ |
| 766 | .gpio = 91, |
| 767 | .settings = { |
| 768 | [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg, |
| 769 | [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg, |
| 770 | }, |
| 771 | }, |
| 772 | { |
| 773 | /* DATA_1 */ |
| 774 | .gpio = 90, |
| 775 | .settings = { |
| 776 | [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg, |
| 777 | [GPIOMUX_SUSPENDED] = &sdcc2_data_1_suspend_cfg, |
| 778 | }, |
| 779 | }, |
| 780 | { |
| 781 | /* DATA_0 */ |
| 782 | .gpio = 89, |
| 783 | .settings = { |
| 784 | [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg, |
| 785 | [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg, |
| 786 | }, |
| 787 | }, |
| 788 | { |
| 789 | /* CMD */ |
| 790 | .gpio = 97, |
| 791 | .settings = { |
| 792 | [GPIOMUX_ACTIVE] = &sdcc2_cmd_data_0_3_actv_cfg, |
| 793 | [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg, |
| 794 | }, |
| 795 | }, |
| 796 | { |
| 797 | /* CLK */ |
| 798 | .gpio = 98, |
| 799 | .settings = { |
| 800 | [GPIOMUX_ACTIVE] = &sdcc2_clk_actv_cfg, |
| 801 | [GPIOMUX_SUSPENDED] = &sdcc2_suspend_cfg, |
| 802 | }, |
| 803 | }, |
| 804 | }; |
| 805 | #endif |
| 806 | |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 807 | int __init msm8960_init_gpiomux(void) |
| 808 | { |
| 809 | int rc = msm_gpiomux_init(NR_GPIO_IRQS); |
| 810 | if (rc) { |
| 811 | pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc); |
| 812 | return rc; |
| 813 | } |
| 814 | |
| 815 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
| 816 | msm_gpiomux_install(msm8960_ethernet_configs, |
| 817 | ARRAY_SIZE(msm8960_ethernet_configs)); |
| 818 | #endif |
| 819 | |
| 820 | msm_gpiomux_install(msm8960_gsbi_configs, |
| 821 | ARRAY_SIZE(msm8960_gsbi_configs)); |
| 822 | |
| 823 | msm_gpiomux_install(msm8960_cyts_configs, |
| 824 | ARRAY_SIZE(msm8960_cyts_configs)); |
| 825 | |
| 826 | msm_gpiomux_install(msm8960_slimbus_config, |
| 827 | ARRAY_SIZE(msm8960_slimbus_config)); |
| 828 | |
| 829 | msm_gpiomux_install(msm8960_audio_codec_configs, |
| 830 | ARRAY_SIZE(msm8960_audio_codec_configs)); |
| 831 | |
| 832 | msm_gpiomux_install(msm8960_audio_auxpcm_configs, |
| 833 | ARRAY_SIZE(msm8960_audio_auxpcm_configs)); |
| 834 | |
| 835 | msm_gpiomux_install(wcnss_5wire_interface, |
| 836 | ARRAY_SIZE(wcnss_5wire_interface)); |
| 837 | |
| 838 | if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() || |
| 839 | machine_is_msm8960_liquid() || machine_is_msm8960_cdp()) |
| 840 | msm_gpiomux_install(hap_lvl_shft_config, |
| 841 | ARRAY_SIZE(hap_lvl_shft_config)); |
| 842 | |
| 843 | if (PLATFORM_IS_CHARM25()) |
| 844 | msm_gpiomux_install(mdm_configs, |
| 845 | ARRAY_SIZE(mdm_configs)); |
| 846 | |
| 847 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
| 848 | if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) && |
| 849 | (PLATFORM_IS_CHARM25() || machine_is_msm8960_liquid())) |
| 850 | msm_gpiomux_install(msm8960_hsic_configs, |
| 851 | ARRAY_SIZE(msm8960_hsic_configs)); |
Vijayavardhan Vennapusa | afbbb8f | 2012-04-13 16:28:45 +0530 | [diff] [blame] | 852 | |
| 853 | if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) && |
| 854 | machine_is_msm8960_liquid()) |
| 855 | msm_gpiomux_install(msm8960_hsic_hub_configs, |
| 856 | ARRAY_SIZE(msm8960_hsic_hub_configs)); |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 857 | #endif |
| 858 | |
| 859 | #ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL |
| 860 | msm_gpiomux_install(msm8960_hdmi_configs, |
| 861 | ARRAY_SIZE(msm8960_hdmi_configs)); |
| 862 | #endif |
| 863 | |
| 864 | msm_gpiomux_install(msm8960_mdp_vsync_configs, |
| 865 | ARRAY_SIZE(msm8960_mdp_vsync_configs)); |
| 866 | |
Stepan Moskovchenko | 2b4b1cd | 2012-03-29 18:21:04 -0700 | [diff] [blame] | 867 | if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) |
| 868 | msm_gpiomux_install(msm8960_gsbi8_uart_configs, |
| 869 | ARRAY_SIZE(msm8960_gsbi8_uart_configs)); |
| 870 | else |
| 871 | msm_gpiomux_install(msm8960_gsbi5_uart_configs, |
| 872 | ARRAY_SIZE(msm8960_gsbi5_uart_configs)); |
Mayank Rana | e009c92 | 2012-03-22 03:02:06 +0530 | [diff] [blame] | 873 | /* For 8960 Fusion 2.2 Primary IPC */ |
| 874 | if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) |
| 875 | msm_gpiomux_install(msm8960_fusion_gsbi_configs, |
| 876 | ARRAY_SIZE(msm8960_fusion_gsbi_configs)); |
Stepan Moskovchenko | 2b4b1cd | 2012-03-29 18:21:04 -0700 | [diff] [blame] | 877 | |
Pratibhasagar V | 57c808e | 2012-01-12 13:47:30 +0530 | [diff] [blame^] | 878 | #ifdef CONFIG_MMC_MSM_SDC2_SUPPORT |
| 879 | msm_gpiomux_install(msm8960_sdcc2_configs, |
| 880 | ARRAY_SIZE(msm8960_sdcc2_configs)); |
| 881 | #endif |
| 882 | |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 883 | return 0; |
| 884 | } |