Stepan Moskovchenko | 5ea3c31 | 2012-01-31 18:19:40 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. |
Stepan Moskovchenko | 2327a95 | 2011-12-14 16:31:28 -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 <linux/init.h> |
| 15 | #include <linux/ioport.h> |
| 16 | #include <linux/platform_device.h> |
| 17 | #include <linux/bootmem.h> |
| 18 | #include <asm/mach-types.h> |
| 19 | #include <asm/mach/mmc.h> |
| 20 | #include <mach/msm_bus_board.h> |
| 21 | #include <mach/board.h> |
| 22 | #include <mach/gpio.h> |
| 23 | #include <mach/gpiomux.h> |
Joel King | dacbc82 | 2012-01-25 13:30:57 -0800 | [diff] [blame] | 24 | #include <mach/socinfo.h> |
Stepan Moskovchenko | 2327a95 | 2011-12-14 16:31:28 -0800 | [diff] [blame] | 25 | #include "devices.h" |
| 26 | #include "board-8064.h" |
| 27 | |
| 28 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
| 29 | static struct gpiomux_setting gpio_eth_config = { |
| 30 | .pull = GPIOMUX_PULL_NONE, |
| 31 | .drv = GPIOMUX_DRV_8MA, |
| 32 | .func = GPIOMUX_FUNC_GPIO, |
| 33 | }; |
| 34 | |
| 35 | /* The SPI configurations apply to GSBI 5*/ |
| 36 | static struct gpiomux_setting gpio_spi_config = { |
| 37 | .func = GPIOMUX_FUNC_2, |
Stepan Moskovchenko | c71c979 | 2012-01-31 18:12:44 -0800 | [diff] [blame] | 38 | .drv = GPIOMUX_DRV_12MA, |
Stepan Moskovchenko | 2327a95 | 2011-12-14 16:31:28 -0800 | [diff] [blame] | 39 | .pull = GPIOMUX_PULL_NONE, |
| 40 | }; |
| 41 | |
| 42 | /* The SPI configurations apply to GSBI 5 chip select 2*/ |
| 43 | static struct gpiomux_setting gpio_spi_cs2_config = { |
| 44 | .func = GPIOMUX_FUNC_3, |
Stepan Moskovchenko | c71c979 | 2012-01-31 18:12:44 -0800 | [diff] [blame] | 45 | .drv = GPIOMUX_DRV_12MA, |
Stepan Moskovchenko | 2327a95 | 2011-12-14 16:31:28 -0800 | [diff] [blame] | 46 | .pull = GPIOMUX_PULL_NONE, |
| 47 | }; |
| 48 | |
Stepan Moskovchenko | c71c979 | 2012-01-31 18:12:44 -0800 | [diff] [blame] | 49 | /* Chip selects for SPI clients */ |
| 50 | static struct gpiomux_setting gpio_spi_cs_config = { |
| 51 | .func = GPIOMUX_FUNC_GPIO, |
| 52 | .drv = GPIOMUX_DRV_12MA, |
| 53 | .pull = GPIOMUX_PULL_UP, |
| 54 | }; |
| 55 | |
Stepan Moskovchenko | 2327a95 | 2011-12-14 16:31:28 -0800 | [diff] [blame] | 56 | struct msm_gpiomux_config apq8064_ethernet_configs[] = { |
| 57 | { |
| 58 | .gpio = 43, |
| 59 | .settings = { |
| 60 | [GPIOMUX_SUSPENDED] = &gpio_eth_config, |
| 61 | [GPIOMUX_ACTIVE] = &gpio_eth_config, |
| 62 | } |
| 63 | }, |
| 64 | }; |
| 65 | #endif |
| 66 | |
David Keitel | 3c40fc5 | 2012-02-09 17:53:52 -0800 | [diff] [blame] | 67 | static struct gpiomux_setting gpio_i2c_config = { |
| 68 | .func = GPIOMUX_FUNC_1, |
| 69 | .drv = GPIOMUX_DRV_8MA, |
| 70 | .pull = GPIOMUX_PULL_NONE, |
| 71 | }; |
| 72 | |
| 73 | static struct gpiomux_setting gpio_i2c_config_sus = { |
| 74 | .func = GPIOMUX_FUNC_1, |
| 75 | .drv = GPIOMUX_DRV_2MA, |
| 76 | .pull = GPIOMUX_PULL_KEEPER, |
| 77 | }; |
| 78 | |
Swaminathan Sathappan | cef966d | 2011-12-15 17:27:04 -0800 | [diff] [blame] | 79 | static struct gpiomux_setting cdc_mclk = { |
| 80 | .func = GPIOMUX_FUNC_1, |
| 81 | .drv = GPIOMUX_DRV_8MA, |
| 82 | .pull = GPIOMUX_PULL_NONE, |
| 83 | }; |
| 84 | |
Stepan Moskovchenko | 2327a95 | 2011-12-14 16:31:28 -0800 | [diff] [blame] | 85 | static struct gpiomux_setting audio_auxpcm[] = { |
| 86 | /* Suspended state */ |
| 87 | { |
| 88 | .func = GPIOMUX_FUNC_GPIO, |
| 89 | .drv = GPIOMUX_DRV_2MA, |
| 90 | .pull = GPIOMUX_PULL_NONE, |
| 91 | }, |
| 92 | /* Active state */ |
| 93 | { |
| 94 | .func = GPIOMUX_FUNC_1, |
| 95 | .drv = GPIOMUX_DRV_2MA, |
| 96 | .pull = GPIOMUX_PULL_NONE, |
| 97 | }, |
| 98 | }; |
| 99 | |
Ankit Verma | 6b7e2ba | 2012-01-26 15:48:54 -0800 | [diff] [blame] | 100 | |
| 101 | static struct gpiomux_setting wcnss_5wire_suspend_cfg = { |
| 102 | .func = GPIOMUX_FUNC_GPIO, |
| 103 | .drv = GPIOMUX_DRV_2MA, |
| 104 | .pull = GPIOMUX_PULL_UP, |
| 105 | }; |
| 106 | |
| 107 | static struct gpiomux_setting wcnss_5wire_active_cfg = { |
| 108 | .func = GPIOMUX_FUNC_1, |
| 109 | .drv = GPIOMUX_DRV_6MA, |
| 110 | .pull = GPIOMUX_PULL_DOWN, |
| 111 | }; |
| 112 | |
| 113 | |
Swaminathan Sathappan | cef966d | 2011-12-15 17:27:04 -0800 | [diff] [blame] | 114 | static struct gpiomux_setting slimbus = { |
| 115 | .func = GPIOMUX_FUNC_1, |
| 116 | .drv = GPIOMUX_DRV_8MA, |
| 117 | .pull = GPIOMUX_PULL_KEEPER, |
| 118 | }; |
| 119 | |
Stepan Moskovchenko | 5ea3c31 | 2012-01-31 18:19:40 -0800 | [diff] [blame] | 120 | static struct gpiomux_setting gsbi1_uart_config = { |
| 121 | .func = GPIOMUX_FUNC_1, |
| 122 | .drv = GPIOMUX_DRV_16MA, |
| 123 | .pull = GPIOMUX_PULL_NONE, |
| 124 | }; |
| 125 | |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 126 | static struct gpiomux_setting ext_regulator_config = { |
| 127 | .func = GPIOMUX_FUNC_GPIO, |
| 128 | .drv = GPIOMUX_DRV_8MA, |
| 129 | .pull = GPIOMUX_PULL_NONE, |
| 130 | .dir = GPIOMUX_OUT_LOW, |
| 131 | }; |
| 132 | |
Jin Hong | 4bbbfba | 2012-02-02 21:48:07 -0800 | [diff] [blame] | 133 | static struct gpiomux_setting gsbi7_func1_cfg = { |
| 134 | .func = GPIOMUX_FUNC_1, |
| 135 | .drv = GPIOMUX_DRV_8MA, |
| 136 | .pull = GPIOMUX_PULL_NONE, |
| 137 | }; |
| 138 | |
| 139 | static struct gpiomux_setting gsbi7_func2_cfg = { |
| 140 | .func = GPIOMUX_FUNC_2, |
| 141 | .drv = GPIOMUX_DRV_8MA, |
| 142 | .pull = GPIOMUX_PULL_NONE, |
| 143 | }; |
| 144 | |
Jing Lin | 04601f9 | 2012-02-05 15:36:07 -0800 | [diff] [blame] | 145 | static struct gpiomux_setting gsbi3_suspended_cfg = { |
| 146 | .func = GPIOMUX_FUNC_1, |
| 147 | .drv = GPIOMUX_DRV_2MA, |
| 148 | .pull = GPIOMUX_PULL_KEEPER, |
| 149 | }; |
| 150 | |
| 151 | static struct gpiomux_setting gsbi3_active_cfg = { |
| 152 | .func = GPIOMUX_FUNC_1, |
| 153 | .drv = GPIOMUX_DRV_8MA, |
| 154 | .pull = GPIOMUX_PULL_NONE, |
| 155 | }; |
| 156 | |
Hemant Kumar | a945b47 | 2012-01-25 15:08:06 -0800 | [diff] [blame] | 157 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
| 158 | static struct gpiomux_setting hsic_act_cfg = { |
| 159 | .func = GPIOMUX_FUNC_1, |
| 160 | .drv = GPIOMUX_DRV_8MA, |
| 161 | .pull = GPIOMUX_PULL_NONE, |
| 162 | }; |
| 163 | |
| 164 | static struct gpiomux_setting hsic_sus_cfg = { |
| 165 | .func = GPIOMUX_FUNC_GPIO, |
| 166 | .drv = GPIOMUX_DRV_2MA, |
| 167 | .pull = GPIOMUX_PULL_DOWN, |
| 168 | .dir = GPIOMUX_OUT_LOW, |
| 169 | }; |
| 170 | |
Anirudh Ghayal | 2917a5a | 2012-02-05 19:51:07 -0800 | [diff] [blame] | 171 | static struct gpiomux_setting cyts_resout_sus_cfg = { |
| 172 | .func = GPIOMUX_FUNC_GPIO, |
| 173 | .drv = GPIOMUX_DRV_6MA, |
| 174 | .pull = GPIOMUX_PULL_UP, |
| 175 | }; |
| 176 | |
| 177 | static struct gpiomux_setting cyts_resout_act_cfg = { |
| 178 | .func = GPIOMUX_FUNC_GPIO, |
| 179 | .drv = GPIOMUX_DRV_6MA, |
| 180 | .pull = GPIOMUX_PULL_UP, |
| 181 | }; |
| 182 | |
| 183 | static struct gpiomux_setting cyts_sleep_sus_cfg = { |
| 184 | .func = GPIOMUX_FUNC_GPIO, |
| 185 | .drv = GPIOMUX_DRV_6MA, |
| 186 | .pull = GPIOMUX_PULL_DOWN, |
| 187 | }; |
| 188 | |
| 189 | static struct gpiomux_setting cyts_sleep_act_cfg = { |
| 190 | .func = GPIOMUX_FUNC_GPIO, |
| 191 | .drv = GPIOMUX_DRV_6MA, |
| 192 | .pull = GPIOMUX_PULL_DOWN, |
| 193 | }; |
| 194 | |
| 195 | static struct gpiomux_setting cyts_int_act_cfg = { |
| 196 | .func = GPIOMUX_FUNC_GPIO, |
| 197 | .drv = GPIOMUX_DRV_8MA, |
| 198 | .pull = GPIOMUX_PULL_UP, |
| 199 | }; |
| 200 | |
| 201 | static struct gpiomux_setting cyts_int_sus_cfg = { |
| 202 | .func = GPIOMUX_FUNC_GPIO, |
| 203 | .drv = GPIOMUX_DRV_2MA, |
| 204 | .pull = GPIOMUX_PULL_DOWN, |
| 205 | }; |
| 206 | |
| 207 | static struct msm_gpiomux_config cyts_gpio_configs[] __initdata = { |
| 208 | { /* TS INTERRUPT */ |
| 209 | .gpio = 6, |
| 210 | .settings = { |
| 211 | [GPIOMUX_ACTIVE] = &cyts_int_act_cfg, |
| 212 | [GPIOMUX_SUSPENDED] = &cyts_int_sus_cfg, |
| 213 | }, |
| 214 | }, |
| 215 | { /* TS SLEEP */ |
| 216 | .gpio = 33, |
| 217 | .settings = { |
| 218 | [GPIOMUX_ACTIVE] = &cyts_sleep_act_cfg, |
| 219 | [GPIOMUX_SUSPENDED] = &cyts_sleep_sus_cfg, |
| 220 | }, |
| 221 | }, |
| 222 | { /* TS RESOUT */ |
| 223 | .gpio = 7, |
| 224 | .settings = { |
| 225 | [GPIOMUX_ACTIVE] = &cyts_resout_act_cfg, |
| 226 | [GPIOMUX_SUSPENDED] = &cyts_resout_sus_cfg, |
| 227 | }, |
| 228 | }, |
| 229 | }; |
| 230 | |
Hemant Kumar | a945b47 | 2012-01-25 15:08:06 -0800 | [diff] [blame] | 231 | static struct msm_gpiomux_config apq8064_hsic_configs[] = { |
| 232 | { |
| 233 | .gpio = 88, /*HSIC_STROBE */ |
| 234 | .settings = { |
| 235 | [GPIOMUX_ACTIVE] = &hsic_act_cfg, |
| 236 | [GPIOMUX_SUSPENDED] = &hsic_sus_cfg, |
| 237 | }, |
| 238 | }, |
| 239 | { |
| 240 | .gpio = 89, /* HSIC_DATA */ |
| 241 | .settings = { |
| 242 | [GPIOMUX_ACTIVE] = &hsic_act_cfg, |
| 243 | [GPIOMUX_SUSPENDED] = &hsic_sus_cfg, |
| 244 | }, |
| 245 | }, |
| 246 | }; |
| 247 | #endif |
| 248 | |
Jing Lin | 21ed4de | 2012-02-05 15:53:28 -0800 | [diff] [blame] | 249 | static struct gpiomux_setting mxt_reset_sus_cfg = { |
| 250 | .func = GPIOMUX_FUNC_GPIO, |
| 251 | .drv = GPIOMUX_DRV_6MA, |
| 252 | .pull = GPIOMUX_PULL_DOWN, |
| 253 | }; |
| 254 | |
| 255 | static struct gpiomux_setting mxt_reset_act_cfg = { |
| 256 | .func = GPIOMUX_FUNC_GPIO, |
| 257 | .drv = GPIOMUX_DRV_6MA, |
| 258 | .pull = GPIOMUX_PULL_UP, |
| 259 | }; |
| 260 | |
| 261 | static struct gpiomux_setting mxt_int_sus_cfg = { |
| 262 | .func = GPIOMUX_FUNC_GPIO, |
| 263 | .drv = GPIOMUX_DRV_2MA, |
| 264 | .pull = GPIOMUX_PULL_DOWN, |
| 265 | }; |
| 266 | |
| 267 | static struct gpiomux_setting mxt_int_act_cfg = { |
| 268 | .func = GPIOMUX_FUNC_GPIO, |
| 269 | .drv = GPIOMUX_DRV_8MA, |
| 270 | .pull = GPIOMUX_PULL_UP, |
| 271 | }; |
| 272 | |
Stepan Moskovchenko | 2327a95 | 2011-12-14 16:31:28 -0800 | [diff] [blame] | 273 | static struct msm_gpiomux_config apq8064_gsbi_configs[] __initdata = { |
Stepan Moskovchenko | 5ea3c31 | 2012-01-31 18:19:40 -0800 | [diff] [blame] | 274 | { |
Jing Lin | 04601f9 | 2012-02-05 15:36:07 -0800 | [diff] [blame] | 275 | .gpio = 8, /* GSBI3 I2C QUP SDA */ |
| 276 | .settings = { |
| 277 | [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg, |
| 278 | [GPIOMUX_ACTIVE] = &gsbi3_active_cfg, |
| 279 | }, |
| 280 | }, |
| 281 | { |
| 282 | .gpio = 9, /* GSBI3 I2C QUP SCL */ |
| 283 | .settings = { |
| 284 | [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg, |
| 285 | [GPIOMUX_ACTIVE] = &gsbi3_active_cfg, |
| 286 | }, |
| 287 | }, |
| 288 | { |
Stepan Moskovchenko | 5ea3c31 | 2012-01-31 18:19:40 -0800 | [diff] [blame] | 289 | .gpio = 18, /* GSBI1 UART TX */ |
| 290 | .settings = { |
| 291 | [GPIOMUX_SUSPENDED] = &gsbi1_uart_config, |
| 292 | }, |
| 293 | }, |
| 294 | { |
| 295 | .gpio = 19, /* GSBI1 UART RX */ |
| 296 | .settings = { |
| 297 | [GPIOMUX_SUSPENDED] = &gsbi1_uart_config, |
| 298 | }, |
| 299 | }, |
Stepan Moskovchenko | 2327a95 | 2011-12-14 16:31:28 -0800 | [diff] [blame] | 300 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
| 301 | { |
| 302 | .gpio = 51, /* GSBI5 QUP SPI_DATA_MOSI */ |
| 303 | .settings = { |
| 304 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 305 | }, |
| 306 | }, |
| 307 | { |
| 308 | .gpio = 52, /* GSBI5 QUP SPI_DATA_MISO */ |
| 309 | .settings = { |
| 310 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 311 | }, |
| 312 | }, |
| 313 | { |
Stepan Moskovchenko | c71c979 | 2012-01-31 18:12:44 -0800 | [diff] [blame] | 314 | .gpio = 53, /* Funny CS0 */ |
| 315 | .settings = { |
| 316 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 317 | }, |
| 318 | }, |
| 319 | { |
Stepan Moskovchenko | 2327a95 | 2011-12-14 16:31:28 -0800 | [diff] [blame] | 320 | .gpio = 31, /* GSBI5 QUP SPI_CS2_N */ |
| 321 | .settings = { |
| 322 | [GPIOMUX_SUSPENDED] = &gpio_spi_cs2_config, |
| 323 | }, |
| 324 | }, |
| 325 | { |
| 326 | .gpio = 54, /* GSBI5 QUP SPI_CLK */ |
| 327 | .settings = { |
| 328 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 329 | }, |
| 330 | }, |
| 331 | #endif |
Stepan Moskovchenko | c71c979 | 2012-01-31 18:12:44 -0800 | [diff] [blame] | 332 | { |
| 333 | .gpio = 30, /* FP CS */ |
| 334 | .settings = { |
| 335 | [GPIOMUX_SUSPENDED] = &gpio_spi_cs_config, |
| 336 | }, |
| 337 | }, |
| 338 | { |
| 339 | .gpio = 32, /* EPM CS */ |
| 340 | .settings = { |
| 341 | [GPIOMUX_SUSPENDED] = &gpio_spi_cs_config, |
| 342 | }, |
| 343 | }, |
| 344 | { |
| 345 | .gpio = 53, /* NOR CS */ |
| 346 | .settings = { |
| 347 | [GPIOMUX_SUSPENDED] = &gpio_spi_cs_config, |
| 348 | }, |
| 349 | }, |
Jin Hong | 4bbbfba | 2012-02-02 21:48:07 -0800 | [diff] [blame] | 350 | { |
| 351 | .gpio = 82, /* GSBI7 UART2 TX */ |
| 352 | .settings = { |
| 353 | [GPIOMUX_SUSPENDED] = &gsbi7_func2_cfg, |
| 354 | }, |
| 355 | }, |
| 356 | { |
| 357 | .gpio = 83, /* GSBI7 UART2 RX */ |
| 358 | .settings = { |
| 359 | [GPIOMUX_SUSPENDED] = &gsbi7_func1_cfg, |
| 360 | }, |
| 361 | }, |
David Keitel | 3c40fc5 | 2012-02-09 17:53:52 -0800 | [diff] [blame] | 362 | { |
| 363 | .gpio = 21, /* GSBI1 QUP I2C_CLK */ |
| 364 | .settings = { |
| 365 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config_sus, |
| 366 | [GPIOMUX_ACTIVE] = &gpio_i2c_config, |
| 367 | }, |
| 368 | }, |
| 369 | { |
| 370 | .gpio = 20, /* GSBI1 QUP I2C_DATA */ |
| 371 | .settings = { |
| 372 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config_sus, |
| 373 | [GPIOMUX_ACTIVE] = &gpio_i2c_config, |
| 374 | }, |
| 375 | }, |
Stepan Moskovchenko | 2327a95 | 2011-12-14 16:31:28 -0800 | [diff] [blame] | 376 | }; |
| 377 | |
Swaminathan Sathappan | cef966d | 2011-12-15 17:27:04 -0800 | [diff] [blame] | 378 | static struct msm_gpiomux_config apq8064_slimbus_config[] __initdata = { |
| 379 | { |
| 380 | .gpio = 40, /* slimbus clk */ |
| 381 | .settings = { |
| 382 | [GPIOMUX_SUSPENDED] = &slimbus, |
| 383 | }, |
| 384 | }, |
| 385 | { |
| 386 | .gpio = 41, /* slimbus data */ |
| 387 | .settings = { |
| 388 | [GPIOMUX_SUSPENDED] = &slimbus, |
| 389 | }, |
| 390 | }, |
| 391 | }; |
| 392 | |
| 393 | static struct msm_gpiomux_config apq8064_audio_codec_configs[] __initdata = { |
| 394 | { |
| 395 | .gpio = 39, |
| 396 | .settings = { |
| 397 | [GPIOMUX_SUSPENDED] = &cdc_mclk, |
| 398 | }, |
| 399 | }, |
| 400 | }; |
| 401 | |
Stepan Moskovchenko | 2327a95 | 2011-12-14 16:31:28 -0800 | [diff] [blame] | 402 | static struct msm_gpiomux_config apq8064_audio_auxpcm_configs[] __initdata = { |
| 403 | { |
| 404 | .gpio = 43, |
| 405 | .settings = { |
| 406 | [GPIOMUX_SUSPENDED] = &audio_auxpcm[0], |
| 407 | [GPIOMUX_ACTIVE] = &audio_auxpcm[1], |
| 408 | }, |
| 409 | }, |
| 410 | { |
| 411 | .gpio = 44, |
| 412 | .settings = { |
| 413 | [GPIOMUX_SUSPENDED] = &audio_auxpcm[0], |
| 414 | [GPIOMUX_ACTIVE] = &audio_auxpcm[1], |
| 415 | }, |
| 416 | }, |
| 417 | { |
| 418 | .gpio = 45, |
| 419 | .settings = { |
| 420 | [GPIOMUX_SUSPENDED] = &audio_auxpcm[0], |
| 421 | [GPIOMUX_ACTIVE] = &audio_auxpcm[1], |
| 422 | }, |
| 423 | }, |
| 424 | { |
| 425 | .gpio = 46, |
| 426 | .settings = { |
| 427 | [GPIOMUX_SUSPENDED] = &audio_auxpcm[0], |
| 428 | [GPIOMUX_ACTIVE] = &audio_auxpcm[1], |
| 429 | }, |
| 430 | }, |
| 431 | }; |
| 432 | |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 433 | /* External 3.3 V regulator enable */ |
| 434 | static struct msm_gpiomux_config apq8064_ext_regulator_configs[] __initdata = { |
| 435 | { |
| 436 | .gpio = APQ8064_EXT_3P3V_REG_EN_GPIO, |
| 437 | .settings = { |
| 438 | [GPIOMUX_SUSPENDED] = &ext_regulator_config, |
| 439 | }, |
| 440 | }, |
| 441 | }; |
| 442 | |
Joel King | dacbc82 | 2012-01-25 13:30:57 -0800 | [diff] [blame] | 443 | static struct gpiomux_setting ap2mdm_cfg = { |
| 444 | .func = GPIOMUX_FUNC_GPIO, |
| 445 | .drv = GPIOMUX_DRV_8MA, |
| 446 | .pull = GPIOMUX_PULL_DOWN, |
| 447 | }; |
| 448 | |
| 449 | static struct gpiomux_setting mdm2ap_status_cfg = { |
| 450 | .func = GPIOMUX_FUNC_GPIO, |
| 451 | .drv = GPIOMUX_DRV_8MA, |
| 452 | .pull = GPIOMUX_PULL_NONE, |
| 453 | }; |
| 454 | |
| 455 | static struct gpiomux_setting mdm2ap_errfatal_cfg = { |
| 456 | .func = GPIOMUX_FUNC_GPIO, |
| 457 | .drv = GPIOMUX_DRV_16MA, |
| 458 | .pull = GPIOMUX_PULL_DOWN, |
| 459 | }; |
| 460 | |
| 461 | static struct gpiomux_setting ap2mdm_pon_reset_n_cfg = { |
| 462 | .func = GPIOMUX_FUNC_GPIO, |
| 463 | .drv = GPIOMUX_DRV_8MA, |
| 464 | .pull = GPIOMUX_PULL_DOWN, |
| 465 | }; |
| 466 | |
| 467 | static struct msm_gpiomux_config mdm_configs[] __initdata = { |
| 468 | /* AP2MDM_STATUS */ |
| 469 | { |
| 470 | .gpio = 48, |
| 471 | .settings = { |
| 472 | [GPIOMUX_SUSPENDED] = &ap2mdm_cfg, |
| 473 | } |
| 474 | }, |
| 475 | /* MDM2AP_STATUS */ |
| 476 | { |
| 477 | .gpio = 49, |
| 478 | .settings = { |
| 479 | [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg, |
| 480 | } |
| 481 | }, |
| 482 | /* MDM2AP_ERRFATAL */ |
| 483 | { |
| 484 | .gpio = 19, |
| 485 | .settings = { |
| 486 | [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg, |
| 487 | } |
| 488 | }, |
| 489 | /* AP2MDM_ERRFATAL */ |
| 490 | { |
| 491 | .gpio = 18, |
| 492 | .settings = { |
| 493 | [GPIOMUX_SUSPENDED] = &ap2mdm_cfg, |
| 494 | } |
| 495 | }, |
| 496 | /* AP2MDM_PON_RESET_N */ |
| 497 | { |
| 498 | .gpio = 27, |
| 499 | .settings = { |
| 500 | [GPIOMUX_SUSPENDED] = &ap2mdm_pon_reset_n_cfg, |
| 501 | } |
Mohan Pallaka | 474b94b | 2012-01-25 12:59:58 +0530 | [diff] [blame^] | 502 | }, |
| 503 | }; |
| 504 | |
| 505 | static struct gpiomux_setting gpio_rotate_key_act_config = { |
| 506 | .pull = GPIOMUX_PULL_UP, |
| 507 | .drv = GPIOMUX_DRV_8MA, |
| 508 | .func = GPIOMUX_FUNC_GPIO, |
| 509 | }; |
| 510 | |
| 511 | static struct gpiomux_setting gpio_rotate_key_sus_config = { |
| 512 | .pull = GPIOMUX_PULL_NONE, |
| 513 | .drv = GPIOMUX_DRV_2MA, |
| 514 | .func = GPIOMUX_FUNC_GPIO, |
| 515 | }; |
| 516 | |
| 517 | struct msm_gpiomux_config apq8064_rotate_key_config[] = { |
| 518 | { |
| 519 | .gpio = 46, |
| 520 | .settings = { |
| 521 | [GPIOMUX_SUSPENDED] = &gpio_rotate_key_sus_config, |
| 522 | [GPIOMUX_ACTIVE] = &gpio_rotate_key_act_config, |
| 523 | } |
| 524 | }, |
Joel King | dacbc82 | 2012-01-25 13:30:57 -0800 | [diff] [blame] | 525 | }; |
| 526 | |
Jing Lin | 21ed4de | 2012-02-05 15:53:28 -0800 | [diff] [blame] | 527 | static struct msm_gpiomux_config apq8064_mxt_configs[] __initdata = { |
| 528 | { /* TS INTERRUPT */ |
| 529 | .gpio = 6, |
| 530 | .settings = { |
| 531 | [GPIOMUX_ACTIVE] = &mxt_int_act_cfg, |
| 532 | [GPIOMUX_SUSPENDED] = &mxt_int_sus_cfg, |
| 533 | }, |
| 534 | }, |
| 535 | { /* TS RESET */ |
| 536 | .gpio = 33, |
| 537 | .settings = { |
| 538 | [GPIOMUX_ACTIVE] = &mxt_reset_act_cfg, |
| 539 | [GPIOMUX_SUSPENDED] = &mxt_reset_sus_cfg, |
| 540 | }, |
| 541 | }, |
| 542 | }; |
| 543 | |
Ankit Verma | 6b7e2ba | 2012-01-26 15:48:54 -0800 | [diff] [blame] | 544 | static struct msm_gpiomux_config wcnss_5wire_interface[] = { |
| 545 | { |
| 546 | .gpio = 64, |
| 547 | .settings = { |
| 548 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 549 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 550 | }, |
| 551 | }, |
| 552 | { |
| 553 | .gpio = 65, |
| 554 | .settings = { |
| 555 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 556 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 557 | }, |
| 558 | }, |
| 559 | { |
| 560 | .gpio = 66, |
| 561 | .settings = { |
| 562 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 563 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 564 | }, |
| 565 | }, |
| 566 | { |
| 567 | .gpio = 67, |
| 568 | .settings = { |
| 569 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 570 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 571 | }, |
| 572 | }, |
| 573 | { |
| 574 | .gpio = 68, |
| 575 | .settings = { |
| 576 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 577 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 578 | }, |
| 579 | }, |
| 580 | }; |
| 581 | |
Stepan Moskovchenko | 2327a95 | 2011-12-14 16:31:28 -0800 | [diff] [blame] | 582 | void __init apq8064_init_gpiomux(void) |
| 583 | { |
| 584 | int rc; |
| 585 | |
| 586 | rc = msm_gpiomux_init(NR_GPIO_IRQS); |
| 587 | if (rc) { |
| 588 | pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc); |
| 589 | return; |
| 590 | } |
| 591 | |
| 592 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
| 593 | msm_gpiomux_install(apq8064_ethernet_configs, |
| 594 | ARRAY_SIZE(apq8064_ethernet_configs)); |
| 595 | #endif |
| 596 | |
Ankit Verma | 6b7e2ba | 2012-01-26 15:48:54 -0800 | [diff] [blame] | 597 | msm_gpiomux_install(wcnss_5wire_interface, |
| 598 | ARRAY_SIZE(wcnss_5wire_interface)); |
| 599 | |
Stepan Moskovchenko | 2327a95 | 2011-12-14 16:31:28 -0800 | [diff] [blame] | 600 | msm_gpiomux_install(apq8064_gsbi_configs, |
| 601 | ARRAY_SIZE(apq8064_gsbi_configs)); |
| 602 | |
Swaminathan Sathappan | cef966d | 2011-12-15 17:27:04 -0800 | [diff] [blame] | 603 | msm_gpiomux_install(apq8064_slimbus_config, |
| 604 | ARRAY_SIZE(apq8064_slimbus_config)); |
| 605 | |
| 606 | msm_gpiomux_install(apq8064_audio_codec_configs, |
| 607 | ARRAY_SIZE(apq8064_audio_codec_configs)); |
| 608 | |
Stepan Moskovchenko | 2327a95 | 2011-12-14 16:31:28 -0800 | [diff] [blame] | 609 | msm_gpiomux_install(apq8064_audio_auxpcm_configs, |
| 610 | ARRAY_SIZE(apq8064_audio_auxpcm_configs)); |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 611 | |
| 612 | msm_gpiomux_install(apq8064_ext_regulator_configs, |
| 613 | ARRAY_SIZE(apq8064_ext_regulator_configs)); |
Joel King | dacbc82 | 2012-01-25 13:30:57 -0800 | [diff] [blame] | 614 | |
| 615 | if (machine_is_apq8064_mtp()) |
| 616 | msm_gpiomux_install(mdm_configs, |
| 617 | ARRAY_SIZE(mdm_configs)); |
Hemant Kumar | a945b47 | 2012-01-25 15:08:06 -0800 | [diff] [blame] | 618 | |
Anirudh Ghayal | 2917a5a | 2012-02-05 19:51:07 -0800 | [diff] [blame] | 619 | if (machine_is_apq8064_mtp()) |
| 620 | msm_gpiomux_install(cyts_gpio_configs, |
| 621 | ARRAY_SIZE(cyts_gpio_configs)); |
| 622 | |
Hemant Kumar | a945b47 | 2012-01-25 15:08:06 -0800 | [diff] [blame] | 623 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
| 624 | msm_gpiomux_install(apq8064_hsic_configs, |
| 625 | ARRAY_SIZE(apq8064_hsic_configs)); |
| 626 | #endif |
Jing Lin | 21ed4de | 2012-02-05 15:53:28 -0800 | [diff] [blame] | 627 | |
| 628 | if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid()) |
| 629 | msm_gpiomux_install(apq8064_mxt_configs, |
| 630 | ARRAY_SIZE(apq8064_mxt_configs)); |
Mohan Pallaka | 474b94b | 2012-01-25 12:59:58 +0530 | [diff] [blame^] | 631 | |
| 632 | if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid()) |
| 633 | msm_gpiomux_install(apq8064_rotate_key_config, |
| 634 | ARRAY_SIZE(apq8064_rotate_key_config)); |
Stepan Moskovchenko | 2327a95 | 2011-12-14 16:31:28 -0800 | [diff] [blame] | 635 | } |