Syed Rameez Mustafa | 3971c14 | 2013-01-09 19:04:53 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. |
Hanumant Singh | 55a1bb0 | 2012-11-06 10:01:15 -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 <mach/board.h> |
| 17 | #include <mach/gpio.h> |
| 18 | #include <mach/gpiomux.h> |
Figo Wang | b1510f8 | 2013-06-13 19:40:20 +0800 | [diff] [blame] | 19 | #include <mach/socinfo.h> |
Hanumant Singh | 55a1bb0 | 2012-11-06 10:01:15 -0800 | [diff] [blame] | 20 | |
Gilad Avidov | a460c47 | 2013-04-12 16:23:32 -0600 | [diff] [blame] | 21 | static struct gpiomux_setting gpio_spi_config = { |
| 22 | .func = GPIOMUX_FUNC_1, |
| 23 | .drv = GPIOMUX_DRV_6MA, |
| 24 | .pull = GPIOMUX_PULL_NONE, |
| 25 | }; |
| 26 | |
Gilad Avidov | f84f279 | 2013-01-31 13:26:39 -0700 | [diff] [blame] | 27 | static struct gpiomux_setting gpio_i2c_config = { |
| 28 | .func = GPIOMUX_FUNC_3, |
| 29 | .drv = GPIOMUX_DRV_2MA, |
| 30 | .pull = GPIOMUX_PULL_NONE, |
| 31 | }; |
| 32 | |
Kenneth Heitke | 0d4fbb1 | 2013-04-10 12:51:14 -0600 | [diff] [blame] | 33 | static struct gpiomux_setting gpio_cam_i2c_config = { |
| 34 | .func = GPIOMUX_FUNC_1, |
| 35 | .drv = GPIOMUX_DRV_2MA, |
| 36 | .pull = GPIOMUX_PULL_NONE, |
| 37 | }; |
| 38 | |
Chun Zhang | f39a065 | 2013-05-01 15:57:54 -0700 | [diff] [blame] | 39 | static struct gpiomux_setting atmel_int_act_cfg = { |
| 40 | .func = GPIOMUX_FUNC_GPIO, |
| 41 | .drv = GPIOMUX_DRV_8MA, |
| 42 | .pull = GPIOMUX_PULL_UP, |
Gilad Avidov | f58f183 | 2013-01-09 17:31:28 -0700 | [diff] [blame] | 43 | }; |
| 44 | |
Chun Zhang | f39a065 | 2013-05-01 15:57:54 -0700 | [diff] [blame] | 45 | static struct gpiomux_setting atmel_int_sus_cfg = { |
| 46 | .func = GPIOMUX_FUNC_GPIO, |
| 47 | .drv = GPIOMUX_DRV_2MA, |
| 48 | .pull = GPIOMUX_PULL_DOWN, |
| 49 | }; |
| 50 | |
| 51 | static struct gpiomux_setting atmel_reset_act_cfg = { |
| 52 | .func = GPIOMUX_FUNC_GPIO, |
| 53 | .drv = GPIOMUX_DRV_6MA, |
| 54 | .pull = GPIOMUX_PULL_UP, |
| 55 | }; |
| 56 | |
| 57 | static struct gpiomux_setting atmel_reset_sus_cfg = { |
| 58 | .func = GPIOMUX_FUNC_GPIO, |
Gilad Avidov | f58f183 | 2013-01-09 17:31:28 -0700 | [diff] [blame] | 59 | .drv = GPIOMUX_DRV_6MA, |
| 60 | .pull = GPIOMUX_PULL_DOWN, |
| 61 | }; |
| 62 | |
Figo Wang | b1510f8 | 2013-06-13 19:40:20 +0800 | [diff] [blame] | 63 | static struct gpiomux_setting focaltech_int_act_cfg = { |
| 64 | .func = GPIOMUX_FUNC_GPIO, |
| 65 | .drv = GPIOMUX_DRV_8MA, |
| 66 | .pull = GPIOMUX_PULL_UP, |
| 67 | }; |
| 68 | |
| 69 | static struct gpiomux_setting focaltech_int_sus_cfg = { |
| 70 | .func = GPIOMUX_FUNC_GPIO, |
| 71 | .drv = GPIOMUX_DRV_2MA, |
| 72 | .pull = GPIOMUX_PULL_DOWN, |
| 73 | }; |
| 74 | |
| 75 | static struct gpiomux_setting focaltech_reset_act_cfg = { |
| 76 | .func = GPIOMUX_FUNC_GPIO, |
| 77 | .drv = GPIOMUX_DRV_6MA, |
| 78 | .pull = GPIOMUX_PULL_UP, |
| 79 | }; |
| 80 | |
| 81 | static struct gpiomux_setting focaltech_reset_sus_cfg = { |
| 82 | .func = GPIOMUX_FUNC_GPIO, |
| 83 | .drv = GPIOMUX_DRV_6MA, |
| 84 | .pull = GPIOMUX_PULL_UP, |
| 85 | }; |
| 86 | |
Sameer Thalappil | 1fafd67 | 2013-04-03 12:31:04 -0700 | [diff] [blame] | 87 | static struct gpiomux_setting wcnss_5wire_suspend_cfg = { |
| 88 | .func = GPIOMUX_FUNC_GPIO, |
| 89 | .drv = GPIOMUX_DRV_2MA, |
| 90 | .pull = GPIOMUX_PULL_UP, |
| 91 | }; |
| 92 | |
| 93 | static struct gpiomux_setting wcnss_5wire_active_cfg = { |
| 94 | .func = GPIOMUX_FUNC_1, |
| 95 | .drv = GPIOMUX_DRV_6MA, |
| 96 | .pull = GPIOMUX_PULL_DOWN, |
| 97 | }; |
| 98 | |
Xiaoming Zhou | 1797226 | 2013-04-10 17:50:35 -0400 | [diff] [blame] | 99 | static struct gpiomux_setting lcd_en_act_cfg = { |
| 100 | .func = GPIOMUX_FUNC_GPIO, |
| 101 | .drv = GPIOMUX_DRV_8MA, |
| 102 | .pull = GPIOMUX_PULL_NONE, |
| 103 | .dir = GPIOMUX_OUT_HIGH, |
| 104 | }; |
| 105 | |
| 106 | static struct gpiomux_setting lcd_en_sus_cfg = { |
| 107 | .func = GPIOMUX_FUNC_GPIO, |
| 108 | .drv = GPIOMUX_DRV_2MA, |
| 109 | .pull = GPIOMUX_PULL_DOWN, |
| 110 | }; |
| 111 | |
Xiaoming Zhou | 8dca7e4 | 2013-05-31 19:44:57 -0400 | [diff] [blame] | 112 | static struct gpiomux_setting lcd_te_act_config = { |
| 113 | .func = GPIOMUX_FUNC_1, |
| 114 | .drv = GPIOMUX_DRV_2MA, |
| 115 | .pull = GPIOMUX_PULL_DOWN, |
| 116 | .dir = GPIOMUX_IN, |
| 117 | }; |
| 118 | |
| 119 | static struct gpiomux_setting lcd_te_sus_config = { |
| 120 | .func = GPIOMUX_FUNC_1, |
| 121 | .drv = GPIOMUX_DRV_2MA, |
| 122 | .pull = GPIOMUX_PULL_DOWN, |
| 123 | .dir = GPIOMUX_IN, |
| 124 | }; |
| 125 | |
Amy Maloche | 19c386b | 2013-04-15 14:06:01 -0700 | [diff] [blame] | 126 | static struct gpiomux_setting gpio_keys_active = { |
| 127 | .func = GPIOMUX_FUNC_GPIO, |
| 128 | .drv = GPIOMUX_DRV_2MA, |
| 129 | .pull = GPIOMUX_PULL_UP, |
| 130 | }; |
| 131 | |
| 132 | static struct gpiomux_setting gpio_keys_suspend = { |
| 133 | .func = GPIOMUX_FUNC_GPIO, |
| 134 | .drv = GPIOMUX_DRV_2MA, |
| 135 | .pull = GPIOMUX_PULL_NONE, |
| 136 | }; |
| 137 | |
Richard Liu | a1d406a | 2013-04-14 13:46:48 -0700 | [diff] [blame] | 138 | /* define gpio used as interrupt input */ |
| 139 | static struct gpiomux_setting gpio_int_act_cfg = { |
| 140 | .func = GPIOMUX_FUNC_GPIO, |
| 141 | .drv = GPIOMUX_DRV_2MA, |
| 142 | .pull = GPIOMUX_PULL_UP, |
| 143 | .dir = GPIOMUX_IN, |
| 144 | }; |
| 145 | |
| 146 | static struct gpiomux_setting gpio_int_sus_cfg = { |
| 147 | .func = GPIOMUX_FUNC_GPIO, |
| 148 | .drv = GPIOMUX_DRV_2MA, |
| 149 | .pull = GPIOMUX_PULL_UP, |
| 150 | .dir = GPIOMUX_IN, |
| 151 | }; |
| 152 | |
| 153 | static struct msm_gpiomux_config msm_gpio_int_configs[] __initdata = { |
| 154 | { |
| 155 | .gpio = 84, |
| 156 | .settings = { |
| 157 | [GPIOMUX_ACTIVE] = &gpio_int_act_cfg, |
| 158 | [GPIOMUX_SUSPENDED] = &gpio_int_sus_cfg, |
| 159 | }, |
| 160 | }, |
| 161 | }; |
| 162 | |
Xiaoming Zhou | 1797226 | 2013-04-10 17:50:35 -0400 | [diff] [blame] | 163 | static struct msm_gpiomux_config msm_lcd_configs[] __initdata = { |
| 164 | { |
| 165 | .gpio = 41, |
| 166 | .settings = { |
| 167 | [GPIOMUX_ACTIVE] = &lcd_en_act_cfg, |
| 168 | [GPIOMUX_SUSPENDED] = &lcd_en_sus_cfg, |
| 169 | }, |
| 170 | }, |
| 171 | { |
| 172 | .gpio = 7, |
| 173 | .settings = { |
| 174 | [GPIOMUX_ACTIVE] = &lcd_en_act_cfg, |
| 175 | [GPIOMUX_SUSPENDED] = &lcd_en_sus_cfg, |
| 176 | }, |
| 177 | }, |
Xiaoming Zhou | 8dca7e4 | 2013-05-31 19:44:57 -0400 | [diff] [blame] | 178 | { |
| 179 | .gpio = 12, |
| 180 | .settings = { |
| 181 | [GPIOMUX_ACTIVE] = &lcd_te_act_config, |
| 182 | [GPIOMUX_SUSPENDED] = &lcd_te_sus_config, |
| 183 | }, |
| 184 | }, |
Xiaoming Zhou | 1797226 | 2013-04-10 17:50:35 -0400 | [diff] [blame] | 185 | }; |
| 186 | |
Gilad Avidov | f84f279 | 2013-01-31 13:26:39 -0700 | [diff] [blame] | 187 | static struct msm_gpiomux_config msm_blsp_configs[] __initdata = { |
| 188 | { |
Chun Zhang | f39a065 | 2013-05-01 15:57:54 -0700 | [diff] [blame] | 189 | .gpio = 2, /* BLSP1 QUP1 I2C_SDA */ |
| 190 | .settings = { |
| 191 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 192 | }, |
| 193 | }, |
| 194 | { |
| 195 | .gpio = 3, /* BLSP1 QUP1 I2C_SCL */ |
| 196 | .settings = { |
| 197 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 198 | }, |
| 199 | }, |
| 200 | { |
Gilad Avidov | f58f183 | 2013-01-09 17:31:28 -0700 | [diff] [blame] | 201 | .gpio = 10, /* BLSP1 QUP3 I2C_SDA */ |
Gilad Avidov | f84f279 | 2013-01-31 13:26:39 -0700 | [diff] [blame] | 202 | .settings = { |
| 203 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 204 | }, |
| 205 | }, |
| 206 | { |
Gilad Avidov | f58f183 | 2013-01-09 17:31:28 -0700 | [diff] [blame] | 207 | .gpio = 11, /* BLSP1 QUP3 I2C_SCL */ |
Gilad Avidov | f84f279 | 2013-01-31 13:26:39 -0700 | [diff] [blame] | 208 | .settings = { |
| 209 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 210 | }, |
| 211 | }, |
Gilad Avidov | f58f183 | 2013-01-09 17:31:28 -0700 | [diff] [blame] | 212 | { |
Kenneth Heitke | 0d4fbb1 | 2013-04-10 12:51:14 -0600 | [diff] [blame] | 213 | .gpio = 16, /* BLSP1 QUP6 I2C_SDA */ |
| 214 | .settings = { |
| 215 | [GPIOMUX_SUSPENDED] = &gpio_cam_i2c_config, |
| 216 | }, |
| 217 | }, |
| 218 | { |
| 219 | .gpio = 17, /* BLSP1 QUP6 I2C_SCL */ |
| 220 | .settings = { |
| 221 | [GPIOMUX_SUSPENDED] = &gpio_cam_i2c_config, |
| 222 | }, |
| 223 | }, |
Chun Zhang | f39a065 | 2013-05-01 15:57:54 -0700 | [diff] [blame] | 224 | }; |
| 225 | |
| 226 | static struct msm_gpiomux_config msm_atmel_configs[] __initdata = { |
Kenneth Heitke | 0d4fbb1 | 2013-04-10 12:51:14 -0600 | [diff] [blame] | 227 | { |
Chun Zhang | f39a065 | 2013-05-01 15:57:54 -0700 | [diff] [blame] | 228 | .gpio = 0, /* TOUCH RESET */ |
Gilad Avidov | f58f183 | 2013-01-09 17:31:28 -0700 | [diff] [blame] | 229 | .settings = { |
Chun Zhang | f39a065 | 2013-05-01 15:57:54 -0700 | [diff] [blame] | 230 | [GPIOMUX_ACTIVE] = &atmel_reset_act_cfg, |
| 231 | [GPIOMUX_SUSPENDED] = &atmel_reset_sus_cfg, |
Gilad Avidov | f58f183 | 2013-01-09 17:31:28 -0700 | [diff] [blame] | 232 | }, |
| 233 | }, |
| 234 | { |
Chun Zhang | f39a065 | 2013-05-01 15:57:54 -0700 | [diff] [blame] | 235 | .gpio = 1, /* TOUCH INT */ |
Gilad Avidov | f58f183 | 2013-01-09 17:31:28 -0700 | [diff] [blame] | 236 | .settings = { |
Chun Zhang | f39a065 | 2013-05-01 15:57:54 -0700 | [diff] [blame] | 237 | [GPIOMUX_ACTIVE] = &atmel_int_act_cfg, |
| 238 | [GPIOMUX_SUSPENDED] = &atmel_int_sus_cfg, |
Gilad Avidov | f58f183 | 2013-01-09 17:31:28 -0700 | [diff] [blame] | 239 | }, |
| 240 | }, |
Gilad Avidov | a460c47 | 2013-04-12 16:23:32 -0600 | [diff] [blame] | 241 | { |
| 242 | .gpio = 86, /* BLSP1 QUP4 SPI_DATA_MOSI */ |
| 243 | .settings = { |
| 244 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 245 | }, |
| 246 | }, |
| 247 | { |
| 248 | .gpio = 87, /* BLSP1 QUP4 SPI_DATA_MISO */ |
| 249 | .settings = { |
| 250 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 251 | }, |
| 252 | }, |
| 253 | { |
| 254 | .gpio = 89, /* BLSP1 QUP4 SPI_CLK */ |
| 255 | .settings = { |
| 256 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 257 | }, |
| 258 | }, |
| 259 | { |
| 260 | .gpio = 88, /* BLSP1 QUP4 SPI_CS */ |
| 261 | .settings = { |
| 262 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 263 | }, |
| 264 | }, |
Gilad Avidov | f84f279 | 2013-01-31 13:26:39 -0700 | [diff] [blame] | 265 | }; |
| 266 | |
Figo Wang | b1510f8 | 2013-06-13 19:40:20 +0800 | [diff] [blame] | 267 | static struct msm_gpiomux_config msm_focaltech_configs[] __initdata = { |
| 268 | { |
| 269 | .gpio = 0, /* TOUCH RESET */ |
| 270 | .settings = { |
| 271 | [GPIOMUX_ACTIVE] = &focaltech_reset_act_cfg, |
| 272 | [GPIOMUX_SUSPENDED] = &focaltech_reset_sus_cfg, |
| 273 | }, |
| 274 | }, |
| 275 | { |
| 276 | .gpio = 1, /* TOUCH INT */ |
| 277 | .settings = { |
| 278 | [GPIOMUX_ACTIVE] = &focaltech_int_act_cfg, |
| 279 | [GPIOMUX_SUSPENDED] = &focaltech_int_sus_cfg, |
| 280 | }, |
| 281 | }, |
| 282 | { |
| 283 | .gpio = 86, /* BLSP1 QUP4 SPI_DATA_MOSI */ |
| 284 | .settings = { |
| 285 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 286 | }, |
| 287 | }, |
| 288 | { |
| 289 | .gpio = 87, /* BLSP1 QUP4 SPI_DATA_MISO */ |
| 290 | .settings = { |
| 291 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 292 | }, |
| 293 | }, |
| 294 | { |
| 295 | .gpio = 89, /* BLSP1 QUP4 SPI_CLK */ |
| 296 | .settings = { |
| 297 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 298 | }, |
| 299 | }, |
| 300 | { |
| 301 | .gpio = 88, /* BLSP1 QUP4 SPI_CS */ |
| 302 | .settings = { |
| 303 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 304 | }, |
| 305 | }, |
| 306 | }; |
| 307 | |
| 308 | |
Sameer Thalappil | 1fafd67 | 2013-04-03 12:31:04 -0700 | [diff] [blame] | 309 | static struct msm_gpiomux_config wcnss_5wire_interface[] = { |
| 310 | { |
| 311 | .gpio = 23, |
| 312 | .settings = { |
| 313 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 314 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 315 | }, |
| 316 | }, |
| 317 | { |
| 318 | .gpio = 24, |
| 319 | .settings = { |
| 320 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 321 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 322 | }, |
| 323 | }, |
| 324 | { |
| 325 | .gpio = 25, |
| 326 | .settings = { |
| 327 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 328 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 329 | }, |
| 330 | }, |
| 331 | { |
| 332 | .gpio = 26, |
| 333 | .settings = { |
| 334 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 335 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 336 | }, |
| 337 | }, |
| 338 | { |
| 339 | .gpio = 27, |
| 340 | .settings = { |
| 341 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 342 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 343 | }, |
| 344 | }, |
| 345 | }; |
| 346 | |
Lokesh Kumar Aakulu | 329a347 | 2013-06-03 06:08:17 -0700 | [diff] [blame] | 347 | static struct gpiomux_setting gpio_suspend_config[] = { |
| 348 | { |
| 349 | .func = GPIOMUX_FUNC_GPIO, /* IN-NP */ |
| 350 | .drv = GPIOMUX_DRV_2MA, |
| 351 | .pull = GPIOMUX_PULL_NONE, |
| 352 | }, |
| 353 | { |
| 354 | .func = GPIOMUX_FUNC_GPIO, /* O-LOW */ |
| 355 | .drv = GPIOMUX_DRV_2MA, |
| 356 | .pull = GPIOMUX_PULL_NONE, |
| 357 | .dir = GPIOMUX_OUT_LOW, |
| 358 | }, |
| 359 | }; |
| 360 | |
| 361 | static struct gpiomux_setting cam_settings[] = { |
| 362 | { |
| 363 | .func = GPIOMUX_FUNC_1, /*active 1*/ /* 0 */ |
| 364 | .drv = GPIOMUX_DRV_2MA, |
| 365 | .pull = GPIOMUX_PULL_NONE, |
| 366 | }, |
| 367 | |
| 368 | { |
| 369 | .func = GPIOMUX_FUNC_1, /*suspend*/ /* 1 */ |
| 370 | .drv = GPIOMUX_DRV_2MA, |
| 371 | .pull = GPIOMUX_PULL_DOWN, |
| 372 | }, |
| 373 | |
| 374 | { |
| 375 | .func = GPIOMUX_FUNC_1, /*i2c suspend*/ /* 2 */ |
| 376 | .drv = GPIOMUX_DRV_2MA, |
| 377 | .pull = GPIOMUX_PULL_KEEPER, |
| 378 | }, |
| 379 | |
| 380 | { |
| 381 | .func = GPIOMUX_FUNC_GPIO, /*active 0*/ /* 3 */ |
| 382 | .drv = GPIOMUX_DRV_2MA, |
| 383 | .pull = GPIOMUX_PULL_NONE, |
| 384 | }, |
| 385 | |
| 386 | { |
| 387 | .func = GPIOMUX_FUNC_GPIO, /*suspend 0*/ /* 4 */ |
| 388 | .drv = GPIOMUX_DRV_2MA, |
| 389 | .pull = GPIOMUX_PULL_DOWN, |
| 390 | }, |
| 391 | }; |
| 392 | |
| 393 | static struct msm_gpiomux_config msm_sensor_configs[] __initdata = { |
| 394 | { |
| 395 | .gpio = 13, /* CAM_MCLK0 */ |
| 396 | .settings = { |
| 397 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 398 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 399 | }, |
| 400 | }, |
| 401 | { |
| 402 | .gpio = 14, /* CAM_MCLK1 */ |
| 403 | .settings = { |
| 404 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 405 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 406 | }, |
| 407 | }, |
| 408 | { |
| 409 | .gpio = 16, /* CCI_I2C_SDA */ |
| 410 | .settings = { |
| 411 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 412 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
| 413 | }, |
| 414 | }, |
| 415 | { |
| 416 | .gpio = 17, /* CCI_I2C_SCL */ |
| 417 | .settings = { |
| 418 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 419 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
| 420 | }, |
| 421 | }, |
| 422 | { |
| 423 | .gpio = 18, /* FLASH_LED_EN */ |
| 424 | .settings = { |
| 425 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 426 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
| 427 | }, |
| 428 | }, |
| 429 | { |
| 430 | .gpio = 19, /* FLASH_LED_NOW */ |
| 431 | .settings = { |
| 432 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 433 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
| 434 | }, |
| 435 | }, |
| 436 | { |
| 437 | .gpio = 8, /* CAM1_STANDBY_N */ |
| 438 | .settings = { |
| 439 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 440 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
| 441 | }, |
| 442 | }, |
| 443 | { |
| 444 | .gpio = 15, /* CAM1_RST_N */ |
| 445 | .settings = { |
| 446 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 447 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
| 448 | }, |
| 449 | }, |
| 450 | { |
| 451 | .gpio = 20, /* WEBCAM1_STANDBY */ |
| 452 | .settings = { |
| 453 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 454 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
| 455 | }, |
| 456 | }, |
| 457 | { |
| 458 | .gpio = 21, /* WEBCAM2_RESET_N */ |
| 459 | .settings = { |
| 460 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 461 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
| 462 | }, |
| 463 | }, |
| 464 | }; |
| 465 | |
Amy Maloche | 19c386b | 2013-04-15 14:06:01 -0700 | [diff] [blame] | 466 | static struct msm_gpiomux_config msm_keypad_configs[] __initdata = { |
| 467 | { |
| 468 | .gpio = 72, |
| 469 | .settings = { |
| 470 | [GPIOMUX_ACTIVE] = &gpio_keys_active, |
| 471 | [GPIOMUX_SUSPENDED] = &gpio_keys_suspend, |
| 472 | }, |
| 473 | }, |
| 474 | { |
| 475 | .gpio = 73, |
| 476 | .settings = { |
| 477 | [GPIOMUX_ACTIVE] = &gpio_keys_active, |
| 478 | [GPIOMUX_SUSPENDED] = &gpio_keys_suspend, |
| 479 | }, |
| 480 | }, |
| 481 | { |
| 482 | .gpio = 74, |
| 483 | .settings = { |
| 484 | [GPIOMUX_ACTIVE] = &gpio_keys_active, |
| 485 | [GPIOMUX_SUSPENDED] = &gpio_keys_suspend, |
| 486 | }, |
| 487 | }, |
| 488 | }; |
| 489 | |
Venkat Gopalakrishnan | 8aaf15a | 2013-04-30 16:27:03 -0700 | [diff] [blame] | 490 | static struct gpiomux_setting sd_card_det_active_config = { |
| 491 | .func = GPIOMUX_FUNC_GPIO, |
| 492 | .drv = GPIOMUX_DRV_2MA, |
| 493 | .pull = GPIOMUX_PULL_NONE, |
| 494 | .dir = GPIOMUX_IN, |
| 495 | }; |
| 496 | |
| 497 | static struct gpiomux_setting sd_card_det_suspend_config = { |
| 498 | .func = GPIOMUX_FUNC_GPIO, |
| 499 | .drv = GPIOMUX_DRV_2MA, |
| 500 | .pull = GPIOMUX_PULL_UP, |
| 501 | .dir = GPIOMUX_IN, |
| 502 | }; |
| 503 | |
| 504 | static struct msm_gpiomux_config sd_card_det[] __initdata = { |
| 505 | { |
| 506 | .gpio = 42, |
| 507 | .settings = { |
| 508 | [GPIOMUX_ACTIVE] = &sd_card_det_active_config, |
| 509 | [GPIOMUX_SUSPENDED] = &sd_card_det_suspend_config, |
| 510 | }, |
| 511 | }, |
| 512 | }; |
| 513 | |
Syed Rameez Mustafa | 3971c14 | 2013-01-09 19:04:53 -0800 | [diff] [blame] | 514 | void __init msm8610_init_gpiomux(void) |
Hanumant Singh | 55a1bb0 | 2012-11-06 10:01:15 -0800 | [diff] [blame] | 515 | { |
| 516 | int rc; |
| 517 | |
Rohit Vaswani | 341c203 | 2012-11-08 18:49:29 -0800 | [diff] [blame] | 518 | rc = msm_gpiomux_init_dt(); |
Hanumant Singh | 55a1bb0 | 2012-11-06 10:01:15 -0800 | [diff] [blame] | 519 | if (rc) { |
Rohit Vaswani | 341c203 | 2012-11-08 18:49:29 -0800 | [diff] [blame] | 520 | pr_err("%s failed %d\n", __func__, rc); |
Hanumant Singh | 55a1bb0 | 2012-11-06 10:01:15 -0800 | [diff] [blame] | 521 | return; |
| 522 | } |
Gilad Avidov | f84f279 | 2013-01-31 13:26:39 -0700 | [diff] [blame] | 523 | |
| 524 | msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs)); |
Figo Wang | b1510f8 | 2013-06-13 19:40:20 +0800 | [diff] [blame] | 525 | if (of_board_is_qrd()) { |
| 526 | msm_gpiomux_install(msm_focaltech_configs, |
| 527 | ARRAY_SIZE(msm_focaltech_configs)); |
| 528 | } else { |
| 529 | msm_gpiomux_install(msm_atmel_configs, |
Chun Zhang | f39a065 | 2013-05-01 15:57:54 -0700 | [diff] [blame] | 530 | ARRAY_SIZE(msm_atmel_configs)); |
Figo Wang | b1510f8 | 2013-06-13 19:40:20 +0800 | [diff] [blame] | 531 | } |
Sameer Thalappil | 1fafd67 | 2013-04-03 12:31:04 -0700 | [diff] [blame] | 532 | msm_gpiomux_install(wcnss_5wire_interface, |
| 533 | ARRAY_SIZE(wcnss_5wire_interface)); |
Xiaoming Zhou | a329c94 | 2013-07-10 10:32:20 -0400 | [diff] [blame^] | 534 | msm_gpiomux_install_nowrite(msm_lcd_configs, |
| 535 | ARRAY_SIZE(msm_lcd_configs)); |
Amy Maloche | 19c386b | 2013-04-15 14:06:01 -0700 | [diff] [blame] | 536 | msm_gpiomux_install(msm_keypad_configs, |
| 537 | ARRAY_SIZE(msm_keypad_configs)); |
Venkat Gopalakrishnan | 8aaf15a | 2013-04-30 16:27:03 -0700 | [diff] [blame] | 538 | msm_gpiomux_install(sd_card_det, ARRAY_SIZE(sd_card_det)); |
Lokesh Kumar Aakulu | 329a347 | 2013-06-03 06:08:17 -0700 | [diff] [blame] | 539 | msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs)); |
Richard Liu | a1d406a | 2013-04-14 13:46:48 -0700 | [diff] [blame] | 540 | msm_gpiomux_install(msm_gpio_int_configs, |
| 541 | ARRAY_SIZE(msm_gpio_int_configs)); |
Hanumant Singh | 55a1bb0 | 2012-11-06 10:01:15 -0800 | [diff] [blame] | 542 | } |