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