Gilad Avidov | 28e18eb | 2012-11-21 18:13:25 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. |
Syed Rameez Mustafa | 9d16c4f | 2012-09-10 14:16:55 -0700 | [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> |
David Collins | 091bb24 | 2013-05-23 11:08:24 -0700 | [diff] [blame] | 19 | #include <mach/socinfo.h> |
Syed Rameez Mustafa | 9d16c4f | 2012-09-10 14:16:55 -0700 | [diff] [blame] | 20 | |
aiquny | 76b4608 | 2013-03-13 15:58:08 -0700 | [diff] [blame] | 21 | #define KS8851_IRQ_GPIO 115 |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 22 | |
| 23 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
| 24 | static struct gpiomux_setting gpio_eth_config = { |
| 25 | .pull = GPIOMUX_PULL_UP, |
| 26 | .drv = GPIOMUX_DRV_2MA, |
| 27 | .func = GPIOMUX_FUNC_GPIO, |
| 28 | }; |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 29 | |
| 30 | static struct msm_gpiomux_config msm_eth_configs[] = { |
| 31 | { |
| 32 | .gpio = KS8851_IRQ_GPIO, |
| 33 | .settings = { |
| 34 | [GPIOMUX_SUSPENDED] = &gpio_eth_config, |
| 35 | } |
| 36 | }, |
| 37 | }; |
Gilad Avidov | 28e18eb | 2012-11-21 18:13:25 -0700 | [diff] [blame] | 38 | #endif |
| 39 | |
Amy Maloche | 41708ba | 2013-03-03 15:19:27 -0800 | [diff] [blame] | 40 | static struct gpiomux_setting synaptics_int_act_cfg = { |
| 41 | .func = GPIOMUX_FUNC_GPIO, |
| 42 | .drv = GPIOMUX_DRV_8MA, |
| 43 | .pull = GPIOMUX_PULL_UP, |
| 44 | }; |
| 45 | |
| 46 | static struct gpiomux_setting synaptics_int_sus_cfg = { |
| 47 | .func = GPIOMUX_FUNC_GPIO, |
| 48 | .drv = GPIOMUX_DRV_2MA, |
| 49 | .pull = GPIOMUX_PULL_DOWN, |
| 50 | }; |
| 51 | |
| 52 | static struct gpiomux_setting synaptics_reset_act_cfg = { |
| 53 | .func = GPIOMUX_FUNC_GPIO, |
| 54 | .drv = GPIOMUX_DRV_6MA, |
| 55 | .pull = GPIOMUX_PULL_DOWN, |
| 56 | }; |
| 57 | |
| 58 | static struct gpiomux_setting synaptics_reset_sus_cfg = { |
| 59 | .func = GPIOMUX_FUNC_GPIO, |
| 60 | .drv = GPIOMUX_DRV_6MA, |
| 61 | .pull = GPIOMUX_PULL_DOWN, |
| 62 | }; |
| 63 | |
Amy Maloche | 24c59dd | 2013-03-05 11:43:55 -0800 | [diff] [blame] | 64 | static struct gpiomux_setting gpio_keys_active = { |
| 65 | .func = GPIOMUX_FUNC_GPIO, |
| 66 | .drv = GPIOMUX_DRV_2MA, |
| 67 | .pull = GPIOMUX_PULL_UP, |
| 68 | }; |
| 69 | |
| 70 | static struct gpiomux_setting gpio_keys_suspend = { |
| 71 | .func = GPIOMUX_FUNC_GPIO, |
| 72 | .drv = GPIOMUX_DRV_2MA, |
| 73 | .pull = GPIOMUX_PULL_NONE, |
| 74 | }; |
| 75 | |
Gilad Avidov | 28e18eb | 2012-11-21 18:13:25 -0700 | [diff] [blame] | 76 | static struct gpiomux_setting gpio_spi_config = { |
| 77 | .func = GPIOMUX_FUNC_1, |
| 78 | .drv = GPIOMUX_DRV_8MA, |
| 79 | .pull = GPIOMUX_PULL_NONE, |
| 80 | }; |
| 81 | |
Gilad Avidov | d59217c | 2013-02-01 13:45:59 -0700 | [diff] [blame] | 82 | static struct gpiomux_setting gpio_spi_cs_config = { |
| 83 | .func = GPIOMUX_FUNC_1, |
| 84 | .drv = GPIOMUX_DRV_6MA, |
| 85 | .pull = GPIOMUX_PULL_DOWN, |
| 86 | }; |
| 87 | |
aiquny | 76b4608 | 2013-03-13 15:58:08 -0700 | [diff] [blame] | 88 | static struct gpiomux_setting gpio_spi_cs_eth_config = { |
| 89 | .func = GPIOMUX_FUNC_4, |
| 90 | .drv = GPIOMUX_DRV_6MA, |
| 91 | .pull = GPIOMUX_PULL_DOWN, |
| 92 | }; |
| 93 | |
Sheng Fang | 6746c3f | 2013-03-19 08:37:13 +0800 | [diff] [blame] | 94 | static struct gpiomux_setting wcnss_5wire_suspend_cfg = { |
| 95 | .func = GPIOMUX_FUNC_GPIO, |
| 96 | .drv = GPIOMUX_DRV_2MA, |
| 97 | .pull = GPIOMUX_PULL_UP, |
| 98 | }; |
| 99 | |
| 100 | static struct gpiomux_setting wcnss_5wire_active_cfg = { |
| 101 | .func = GPIOMUX_FUNC_1, |
| 102 | .drv = GPIOMUX_DRV_6MA, |
| 103 | .pull = GPIOMUX_PULL_DOWN, |
| 104 | }; |
| 105 | |
Gilad Avidov | 28e18eb | 2012-11-21 18:13:25 -0700 | [diff] [blame] | 106 | static struct gpiomux_setting gpio_i2c_config = { |
| 107 | .func = GPIOMUX_FUNC_3, |
| 108 | .drv = GPIOMUX_DRV_2MA, |
| 109 | .pull = GPIOMUX_PULL_NONE, |
| 110 | }; |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 111 | |
Amy Maloche | 24c59dd | 2013-03-05 11:43:55 -0800 | [diff] [blame] | 112 | static struct msm_gpiomux_config msm_keypad_configs[] __initdata = { |
| 113 | { |
| 114 | .gpio = 106, |
| 115 | .settings = { |
| 116 | [GPIOMUX_ACTIVE] = &gpio_keys_active, |
| 117 | [GPIOMUX_SUSPENDED] = &gpio_keys_suspend, |
| 118 | }, |
| 119 | }, |
| 120 | { |
| 121 | .gpio = 107, |
| 122 | .settings = { |
| 123 | [GPIOMUX_ACTIVE] = &gpio_keys_active, |
| 124 | [GPIOMUX_SUSPENDED] = &gpio_keys_suspend, |
| 125 | }, |
| 126 | }, |
| 127 | { |
| 128 | .gpio = 108, |
| 129 | .settings = { |
| 130 | [GPIOMUX_ACTIVE] = &gpio_keys_active, |
| 131 | [GPIOMUX_SUSPENDED] = &gpio_keys_suspend, |
| 132 | }, |
| 133 | }, |
| 134 | }; |
| 135 | |
Aravind Venkateswaran | f60fb21 | 2013-03-08 13:57:06 -0800 | [diff] [blame] | 136 | static struct gpiomux_setting lcd_rst_act_cfg = { |
| 137 | .func = GPIOMUX_FUNC_GPIO, |
| 138 | .drv = GPIOMUX_DRV_8MA, |
| 139 | .pull = GPIOMUX_PULL_NONE, |
| 140 | .dir = GPIOMUX_OUT_LOW, |
| 141 | }; |
| 142 | |
| 143 | static struct gpiomux_setting lcd_rst_sus_cfg = { |
| 144 | .func = GPIOMUX_FUNC_GPIO, |
| 145 | .drv = GPIOMUX_DRV_2MA, |
| 146 | .pull = GPIOMUX_PULL_DOWN, |
| 147 | }; |
| 148 | |
| 149 | static struct msm_gpiomux_config msm_lcd_configs[] __initdata = { |
| 150 | { |
| 151 | .gpio = 25, |
| 152 | .settings = { |
| 153 | [GPIOMUX_ACTIVE] = &lcd_rst_act_cfg, |
| 154 | [GPIOMUX_SUSPENDED] = &lcd_rst_sus_cfg, |
| 155 | }, |
| 156 | } |
| 157 | }; |
| 158 | |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 159 | static struct msm_gpiomux_config msm_blsp_configs[] __initdata = { |
| 160 | { |
Gilad Avidov | d59217c | 2013-02-01 13:45:59 -0700 | [diff] [blame] | 161 | .gpio = 0, /* BLSP1 QUP1 SPI_DATA_MOSI */ |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 162 | .settings = { |
| 163 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 164 | }, |
| 165 | }, |
| 166 | { |
Gilad Avidov | d59217c | 2013-02-01 13:45:59 -0700 | [diff] [blame] | 167 | .gpio = 1, /* BLSP1 QUP1 SPI_DATA_MISO */ |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 168 | .settings = { |
| 169 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 170 | }, |
| 171 | }, |
| 172 | { |
Gilad Avidov | d59217c | 2013-02-01 13:45:59 -0700 | [diff] [blame] | 173 | .gpio = 2, /* BLSP1 QUP1 SPI_CS1 */ |
| 174 | .settings = { |
| 175 | [GPIOMUX_SUSPENDED] = &gpio_spi_cs_config, |
| 176 | }, |
| 177 | }, |
| 178 | { |
| 179 | .gpio = 3, /* BLSP1 QUP1 SPI_CLK */ |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 180 | .settings = { |
| 181 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 182 | }, |
| 183 | }, |
| 184 | { |
Gilad Avidov | d59217c | 2013-02-01 13:45:59 -0700 | [diff] [blame] | 185 | .gpio = 14, /* BLSP1 QUP4 I2C_SDA */ |
Gilad Avidov | 28e18eb | 2012-11-21 18:13:25 -0700 | [diff] [blame] | 186 | .settings = { |
| 187 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 188 | }, |
| 189 | }, |
| 190 | { |
Gilad Avidov | d59217c | 2013-02-01 13:45:59 -0700 | [diff] [blame] | 191 | .gpio = 15, /* BLSP1 QUP4 I2C_SCL */ |
Gilad Avidov | 28e18eb | 2012-11-21 18:13:25 -0700 | [diff] [blame] | 192 | .settings = { |
| 193 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 194 | }, |
| 195 | }, |
Amy Maloche | 41708ba | 2013-03-03 15:19:27 -0800 | [diff] [blame] | 196 | { |
| 197 | .gpio = 18, /* BLSP1 QUP5 I2C_SDA */ |
| 198 | .settings = { |
| 199 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 200 | }, |
| 201 | }, |
| 202 | { |
| 203 | .gpio = 19, /* BLSP1 QUP5 I2C_SCL */ |
| 204 | .settings = { |
| 205 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 206 | }, |
| 207 | }, |
aiquny | 76b4608 | 2013-03-13 15:58:08 -0700 | [diff] [blame] | 208 | { |
| 209 | .gpio = 22, /* BLSP1 QUP1 SPI_CS_ETH */ |
| 210 | .settings = { |
| 211 | [GPIOMUX_SUSPENDED] = &gpio_spi_cs_eth_config, |
| 212 | }, |
| 213 | }, |
Amy Maloche | 41708ba | 2013-03-03 15:19:27 -0800 | [diff] [blame] | 214 | }; |
| 215 | |
| 216 | static struct msm_gpiomux_config msm_synaptics_configs[] __initdata = { |
| 217 | { |
| 218 | .gpio = 16, |
| 219 | .settings = { |
| 220 | [GPIOMUX_ACTIVE] = &synaptics_reset_act_cfg, |
| 221 | [GPIOMUX_SUSPENDED] = &synaptics_reset_sus_cfg, |
| 222 | }, |
| 223 | }, |
| 224 | { |
| 225 | .gpio = 17, |
| 226 | .settings = { |
| 227 | [GPIOMUX_ACTIVE] = &synaptics_int_act_cfg, |
| 228 | [GPIOMUX_SUSPENDED] = &synaptics_int_sus_cfg, |
| 229 | }, |
| 230 | }, |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 231 | }; |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 232 | |
Krishna Konda | 7af5df9 | 2013-03-06 20:35:30 -0800 | [diff] [blame] | 233 | static struct gpiomux_setting sd_card_det_active_config = { |
| 234 | .func = GPIOMUX_FUNC_GPIO, |
| 235 | .drv = GPIOMUX_DRV_2MA, |
| 236 | .pull = GPIOMUX_PULL_NONE, |
| 237 | .dir = GPIOMUX_IN, |
| 238 | }; |
| 239 | |
| 240 | static struct gpiomux_setting sd_card_det_sleep_config = { |
| 241 | .func = GPIOMUX_FUNC_GPIO, |
| 242 | .drv = GPIOMUX_DRV_2MA, |
| 243 | .pull = GPIOMUX_PULL_UP, |
| 244 | .dir = GPIOMUX_IN, |
| 245 | }; |
| 246 | |
| 247 | static struct msm_gpiomux_config sd_card_det __initdata = { |
| 248 | .gpio = 38, |
| 249 | .settings = { |
| 250 | [GPIOMUX_ACTIVE] = &sd_card_det_active_config, |
| 251 | [GPIOMUX_SUSPENDED] = &sd_card_det_sleep_config, |
| 252 | }, |
| 253 | }; |
| 254 | |
Sheng Fang | 6746c3f | 2013-03-19 08:37:13 +0800 | [diff] [blame] | 255 | static struct msm_gpiomux_config wcnss_5wire_interface[] = { |
| 256 | { |
| 257 | .gpio = 40, |
| 258 | .settings = { |
| 259 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 260 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 261 | }, |
| 262 | }, |
| 263 | { |
| 264 | .gpio = 41, |
| 265 | .settings = { |
| 266 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 267 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 268 | }, |
| 269 | }, |
| 270 | { |
| 271 | .gpio = 42, |
| 272 | .settings = { |
| 273 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 274 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 275 | }, |
| 276 | }, |
| 277 | { |
| 278 | .gpio = 43, |
| 279 | .settings = { |
| 280 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 281 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 282 | }, |
| 283 | }, |
| 284 | { |
| 285 | .gpio = 44, |
| 286 | .settings = { |
| 287 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 288 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 289 | }, |
| 290 | }, |
| 291 | }; |
Su Liu | d1c66ee | 2013-03-22 15:29:48 -0700 | [diff] [blame] | 292 | |
| 293 | static struct gpiomux_setting gpio_suspend_config[] = { |
| 294 | { |
| 295 | .func = GPIOMUX_FUNC_GPIO, /* IN-NP */ |
| 296 | .drv = GPIOMUX_DRV_2MA, |
| 297 | .pull = GPIOMUX_PULL_NONE, |
| 298 | }, |
| 299 | { |
| 300 | .func = GPIOMUX_FUNC_GPIO, /* O-LOW */ |
| 301 | .drv = GPIOMUX_DRV_2MA, |
| 302 | .pull = GPIOMUX_PULL_NONE, |
| 303 | .dir = GPIOMUX_OUT_LOW, |
| 304 | }, |
| 305 | }; |
| 306 | |
| 307 | static struct gpiomux_setting cam_settings[] = { |
| 308 | { |
| 309 | .func = GPIOMUX_FUNC_1, /*active 1*/ /* 0 */ |
| 310 | .drv = GPIOMUX_DRV_2MA, |
| 311 | .pull = GPIOMUX_PULL_NONE, |
| 312 | }, |
| 313 | |
| 314 | { |
| 315 | .func = GPIOMUX_FUNC_1, /*suspend*/ /* 1 */ |
| 316 | .drv = GPIOMUX_DRV_2MA, |
| 317 | .pull = GPIOMUX_PULL_DOWN, |
| 318 | }, |
| 319 | |
| 320 | { |
| 321 | .func = GPIOMUX_FUNC_1, /*i2c suspend*/ /* 2 */ |
| 322 | .drv = GPIOMUX_DRV_2MA, |
| 323 | .pull = GPIOMUX_PULL_KEEPER, |
| 324 | }, |
| 325 | |
| 326 | { |
| 327 | .func = GPIOMUX_FUNC_GPIO, /*active 0*/ /* 3 */ |
| 328 | .drv = GPIOMUX_DRV_2MA, |
| 329 | .pull = GPIOMUX_PULL_NONE, |
| 330 | }, |
| 331 | |
| 332 | { |
| 333 | .func = GPIOMUX_FUNC_GPIO, /*suspend 0*/ /* 4 */ |
| 334 | .drv = GPIOMUX_DRV_2MA, |
| 335 | .pull = GPIOMUX_PULL_DOWN, |
| 336 | }, |
| 337 | }; |
| 338 | |
| 339 | |
| 340 | static struct msm_gpiomux_config msm_sensor_configs[] __initdata = { |
| 341 | { |
| 342 | .gpio = 26, /* CAM_MCLK0 */ |
| 343 | .settings = { |
| 344 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 345 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 346 | }, |
| 347 | }, |
| 348 | { |
| 349 | .gpio = 27, /* CAM_MCLK1 */ |
| 350 | .settings = { |
| 351 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 352 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 353 | }, |
| 354 | |
| 355 | }, |
| 356 | { |
| 357 | .gpio = 29, /* CCI_I2C_SDA0 */ |
| 358 | .settings = { |
| 359 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 360 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
| 361 | }, |
| 362 | }, |
| 363 | { |
| 364 | .gpio = 30, /* CCI_I2C_SCL0 */ |
| 365 | .settings = { |
| 366 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 367 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
| 368 | }, |
| 369 | }, |
| 370 | { |
| 371 | .gpio = 36, /* CAM1_STANDBY_N */ |
| 372 | .settings = { |
| 373 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 374 | [GPIOMUX_SUSPENDED] = &cam_settings[4], |
| 375 | }, |
| 376 | }, |
| 377 | { |
| 378 | .gpio = 37, /* CAM1_RST_N */ |
| 379 | .settings = { |
| 380 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 381 | [GPIOMUX_SUSPENDED] = &cam_settings[4], |
| 382 | }, |
| 383 | }, |
| 384 | { |
| 385 | .gpio = 35, /* CAM2_STANDBY_N */ |
| 386 | .settings = { |
| 387 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 388 | [GPIOMUX_SUSPENDED] = &cam_settings[4], |
| 389 | }, |
| 390 | }, |
| 391 | { |
| 392 | .gpio = 28, /* CAM2_RST_N */ |
| 393 | .settings = { |
| 394 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 395 | [GPIOMUX_SUSPENDED] = &cam_settings[4], |
| 396 | }, |
| 397 | }, |
| 398 | |
| 399 | }; |
| 400 | |
Banajit Goswami | 25715c5 | 2013-05-10 11:45:47 -0700 | [diff] [blame] | 401 | static struct gpiomux_setting auxpcm_act_cfg = { |
| 402 | .func = GPIOMUX_FUNC_1, |
| 403 | .drv = GPIOMUX_DRV_8MA, |
| 404 | .pull = GPIOMUX_PULL_NONE, |
| 405 | }; |
| 406 | |
| 407 | static struct gpiomux_setting auxpcm_sus_cfg = { |
| 408 | .func = GPIOMUX_FUNC_1, |
| 409 | .drv = GPIOMUX_DRV_2MA, |
| 410 | .pull = GPIOMUX_PULL_DOWN, |
| 411 | }; |
| 412 | |
| 413 | static struct msm_gpiomux_config msm_auxpcm_configs[] __initdata = { |
| 414 | { |
| 415 | .gpio = 63, |
| 416 | .settings = { |
| 417 | [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg, |
| 418 | [GPIOMUX_ACTIVE] = &auxpcm_act_cfg, |
| 419 | }, |
| 420 | }, |
| 421 | { |
| 422 | .gpio = 64, |
| 423 | .settings = { |
| 424 | [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg, |
| 425 | [GPIOMUX_ACTIVE] = &auxpcm_act_cfg, |
| 426 | }, |
| 427 | }, |
| 428 | { |
| 429 | .gpio = 65, |
| 430 | .settings = { |
| 431 | [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg, |
| 432 | [GPIOMUX_ACTIVE] = &auxpcm_act_cfg, |
| 433 | }, |
| 434 | }, |
| 435 | { |
| 436 | .gpio = 66, |
| 437 | .settings = { |
| 438 | [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg, |
| 439 | [GPIOMUX_ACTIVE] = &auxpcm_act_cfg, |
| 440 | }, |
| 441 | }, |
| 442 | }; |
| 443 | |
David Collins | 091bb24 | 2013-05-23 11:08:24 -0700 | [diff] [blame] | 444 | static struct gpiomux_setting usb_otg_sw_cfg = { |
| 445 | .func = GPIOMUX_FUNC_GPIO, |
| 446 | .drv = GPIOMUX_DRV_2MA, |
| 447 | .dir = GPIOMUX_OUT_LOW, |
| 448 | }; |
| 449 | |
| 450 | static struct msm_gpiomux_config usb_otg_sw_configs[] __initdata = { |
| 451 | { |
| 452 | .gpio = 67, |
| 453 | .settings = { |
| 454 | [GPIOMUX_SUSPENDED] = &usb_otg_sw_cfg, |
| 455 | }, |
| 456 | }, |
| 457 | }; |
| 458 | |
Syed Rameez Mustafa | 9d16c4f | 2012-09-10 14:16:55 -0700 | [diff] [blame] | 459 | void __init msm8226_init_gpiomux(void) |
| 460 | { |
| 461 | int rc; |
| 462 | |
Rohit Vaswani | 341c203 | 2012-11-08 18:49:29 -0800 | [diff] [blame] | 463 | rc = msm_gpiomux_init_dt(); |
Syed Rameez Mustafa | 9d16c4f | 2012-09-10 14:16:55 -0700 | [diff] [blame] | 464 | if (rc) { |
Rohit Vaswani | 341c203 | 2012-11-08 18:49:29 -0800 | [diff] [blame] | 465 | pr_err("%s failed %d\n", __func__, rc); |
Syed Rameez Mustafa | 9d16c4f | 2012-09-10 14:16:55 -0700 | [diff] [blame] | 466 | return; |
| 467 | } |
Gilad Avidov | 28e18eb | 2012-11-21 18:13:25 -0700 | [diff] [blame] | 468 | |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 469 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
| 470 | msm_gpiomux_install(msm_eth_configs, ARRAY_SIZE(msm_eth_configs)); |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 471 | #endif |
Amy Maloche | 24c59dd | 2013-03-05 11:43:55 -0800 | [diff] [blame] | 472 | msm_gpiomux_install(msm_keypad_configs, |
| 473 | ARRAY_SIZE(msm_keypad_configs)); |
Gilad Avidov | 28e18eb | 2012-11-21 18:13:25 -0700 | [diff] [blame] | 474 | |
| 475 | msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs)); |
Sheng Fang | 6746c3f | 2013-03-19 08:37:13 +0800 | [diff] [blame] | 476 | msm_gpiomux_install(wcnss_5wire_interface, |
| 477 | ARRAY_SIZE(wcnss_5wire_interface)); |
Krishna Konda | 7af5df9 | 2013-03-06 20:35:30 -0800 | [diff] [blame] | 478 | |
| 479 | msm_gpiomux_install(&sd_card_det, 1); |
Amy Maloche | 41708ba | 2013-03-03 15:19:27 -0800 | [diff] [blame] | 480 | msm_gpiomux_install(msm_synaptics_configs, |
| 481 | ARRAY_SIZE(msm_synaptics_configs)); |
Aravind Venkateswaran | f60fb21 | 2013-03-08 13:57:06 -0800 | [diff] [blame] | 482 | msm_gpiomux_install_nowrite(msm_lcd_configs, |
| 483 | ARRAY_SIZE(msm_lcd_configs)); |
Su Liu | d1c66ee | 2013-03-22 15:29:48 -0700 | [diff] [blame] | 484 | msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs)); |
Banajit Goswami | 25715c5 | 2013-05-10 11:45:47 -0700 | [diff] [blame] | 485 | msm_gpiomux_install(msm_auxpcm_configs, |
| 486 | ARRAY_SIZE(msm_auxpcm_configs)); |
David Collins | 091bb24 | 2013-05-23 11:08:24 -0700 | [diff] [blame] | 487 | |
Syed Rameez Mustafa | 7ef6158 | 2013-06-07 16:14:58 -0700 | [diff] [blame^] | 488 | if (of_board_is_cdp() || of_board_is_mtp() || of_board_is_xpm()) |
David Collins | 091bb24 | 2013-05-23 11:08:24 -0700 | [diff] [blame] | 489 | msm_gpiomux_install(usb_otg_sw_configs, |
| 490 | ARRAY_SIZE(usb_otg_sw_configs)); |
Syed Rameez Mustafa | 9d16c4f | 2012-09-10 14:16:55 -0700 | [diff] [blame] | 491 | } |