Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2012, Code Aurora Forum. All rights reserved. |
| 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 | |
Subbaraman Narayanamurthy | 3f93ab1 | 2012-08-17 19:39:47 -0700 | [diff] [blame] | 20 | #define KS8851_IRQ_GPIO 94 |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 21 | |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 22 | static struct gpiomux_setting gpio_uart_config = { |
| 23 | .func = GPIOMUX_FUNC_2, |
| 24 | .drv = GPIOMUX_DRV_16MA, |
| 25 | .pull = GPIOMUX_PULL_NONE, |
| 26 | .dir = GPIOMUX_OUT_HIGH, |
| 27 | }; |
| 28 | |
Sagar Dharia | a8e6b0a | 2012-08-10 20:52:30 -0600 | [diff] [blame] | 29 | static struct gpiomux_setting slimbus = { |
| 30 | .func = GPIOMUX_FUNC_1, |
| 31 | .drv = GPIOMUX_DRV_8MA, |
| 32 | .pull = GPIOMUX_PULL_KEEPER, |
| 33 | }; |
| 34 | |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 35 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
| 36 | static struct gpiomux_setting gpio_eth_config = { |
Subbaraman Narayanamurthy | 3f93ab1 | 2012-08-17 19:39:47 -0700 | [diff] [blame] | 37 | .pull = GPIOMUX_PULL_UP, |
| 38 | .drv = GPIOMUX_DRV_2MA, |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 39 | .func = GPIOMUX_FUNC_GPIO, |
| 40 | }; |
| 41 | |
Subbaraman Narayanamurthy | 3f93ab1 | 2012-08-17 19:39:47 -0700 | [diff] [blame] | 42 | static struct gpiomux_setting gpio_spi_cs2_config = { |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 43 | .func = GPIOMUX_FUNC_4, |
Subbaraman Narayanamurthy | 3f93ab1 | 2012-08-17 19:39:47 -0700 | [diff] [blame] | 44 | .drv = GPIOMUX_DRV_6MA, |
| 45 | .pull = GPIOMUX_PULL_DOWN, |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 46 | }; |
| 47 | |
| 48 | static struct gpiomux_setting gpio_spi_config = { |
| 49 | .func = GPIOMUX_FUNC_1, |
| 50 | .drv = GPIOMUX_DRV_12MA, |
| 51 | .pull = GPIOMUX_PULL_NONE, |
| 52 | }; |
| 53 | |
Subbaraman Narayanamurthy | 3f93ab1 | 2012-08-17 19:39:47 -0700 | [diff] [blame] | 54 | static struct gpiomux_setting gpio_spi_cs1_config = { |
| 55 | .func = GPIOMUX_FUNC_GPIO, |
| 56 | .drv = GPIOMUX_DRV_6MA, |
| 57 | .pull = GPIOMUX_PULL_UP, |
| 58 | }; |
| 59 | |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 60 | static struct msm_gpiomux_config msm_eth_configs[] = { |
| 61 | { |
| 62 | .gpio = KS8851_IRQ_GPIO, |
| 63 | .settings = { |
| 64 | [GPIOMUX_SUSPENDED] = &gpio_eth_config, |
| 65 | } |
| 66 | }, |
| 67 | }; |
| 68 | #endif |
Sameer Thalappil | 8d686d4 | 2012-08-24 10:07:31 -0700 | [diff] [blame] | 69 | |
| 70 | static struct gpiomux_setting wcnss_5wire_suspend_cfg = { |
| 71 | .func = GPIOMUX_FUNC_GPIO, |
| 72 | .drv = GPIOMUX_DRV_2MA, |
| 73 | .pull = GPIOMUX_PULL_UP, |
| 74 | }; |
| 75 | |
| 76 | static struct gpiomux_setting wcnss_5wire_active_cfg = { |
| 77 | .func = GPIOMUX_FUNC_1, |
| 78 | .drv = GPIOMUX_DRV_6MA, |
| 79 | .pull = GPIOMUX_PULL_DOWN, |
| 80 | }; |
| 81 | |
Jin Hong | a04caaa | 2012-05-23 10:28:27 -0700 | [diff] [blame] | 82 | static struct gpiomux_setting gpio_i2c_config = { |
| 83 | .func = GPIOMUX_FUNC_3, |
| 84 | .drv = GPIOMUX_DRV_8MA, |
| 85 | .pull = GPIOMUX_PULL_NONE, |
| 86 | }; |
| 87 | |
Chandan Uddaraju | 88b26d7 | 2012-08-13 22:28:44 -0700 | [diff] [blame] | 88 | static struct gpiomux_setting lcd_en_act_cfg = { |
| 89 | .func = GPIOMUX_FUNC_GPIO, |
| 90 | .drv = GPIOMUX_DRV_8MA, |
| 91 | .pull = GPIOMUX_PULL_NONE, |
| 92 | }; |
| 93 | |
| 94 | static struct gpiomux_setting lcd_en_sus_cfg = { |
| 95 | .func = GPIOMUX_FUNC_GPIO, |
| 96 | .drv = GPIOMUX_DRV_2MA, |
| 97 | .pull = GPIOMUX_PULL_DOWN, |
| 98 | }; |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 99 | |
Amy Maloche | 9e99a79 | 2012-08-15 23:27:51 -0700 | [diff] [blame] | 100 | static struct gpiomux_setting atmel_resout_sus_cfg = { |
| 101 | .func = GPIOMUX_FUNC_GPIO, |
| 102 | .drv = GPIOMUX_DRV_6MA, |
| 103 | .pull = GPIOMUX_PULL_DOWN, |
| 104 | }; |
| 105 | |
| 106 | static struct gpiomux_setting atmel_resout_act_cfg = { |
| 107 | .func = GPIOMUX_FUNC_GPIO, |
| 108 | .drv = GPIOMUX_DRV_6MA, |
| 109 | .pull = GPIOMUX_PULL_UP, |
| 110 | }; |
| 111 | |
| 112 | static struct gpiomux_setting atmel_int_act_cfg = { |
| 113 | .func = GPIOMUX_FUNC_GPIO, |
| 114 | .drv = GPIOMUX_DRV_8MA, |
| 115 | .pull = GPIOMUX_PULL_UP, |
| 116 | }; |
| 117 | |
| 118 | static struct gpiomux_setting atmel_int_sus_cfg = { |
| 119 | .func = GPIOMUX_FUNC_GPIO, |
| 120 | .drv = GPIOMUX_DRV_2MA, |
| 121 | .pull = GPIOMUX_PULL_DOWN, |
| 122 | }; |
| 123 | |
Joonwoo Park | 187e9cb | 2012-08-24 22:47:53 -0700 | [diff] [blame] | 124 | static struct gpiomux_setting taiko_reset = { |
| 125 | .func = GPIOMUX_FUNC_GPIO, |
| 126 | .drv = GPIOMUX_DRV_6MA, |
| 127 | .pull = GPIOMUX_PULL_NONE, |
| 128 | .dir = GPIOMUX_OUT_LOW, |
| 129 | }; |
| 130 | |
Amy Maloche | 9e99a79 | 2012-08-15 23:27:51 -0700 | [diff] [blame] | 131 | static struct msm_gpiomux_config msm_touch_configs[] __initdata = { |
| 132 | { |
| 133 | .gpio = 60, /* TOUCH RESET */ |
| 134 | .settings = { |
| 135 | [GPIOMUX_ACTIVE] = &atmel_resout_act_cfg, |
| 136 | [GPIOMUX_SUSPENDED] = &atmel_resout_sus_cfg, |
| 137 | }, |
| 138 | }, |
| 139 | { |
| 140 | .gpio = 61, /* TOUCH IRQ */ |
| 141 | .settings = { |
| 142 | [GPIOMUX_ACTIVE] = &atmel_int_act_cfg, |
| 143 | [GPIOMUX_SUSPENDED] = &atmel_int_sus_cfg, |
| 144 | }, |
| 145 | }, |
| 146 | |
| 147 | }; |
Ujwal Patel | 74b5df4 | 2012-08-13 22:50:13 -0700 | [diff] [blame] | 148 | |
| 149 | static struct gpiomux_setting hdmi_suspend_cfg = { |
| 150 | .func = GPIOMUX_FUNC_GPIO, |
| 151 | .drv = GPIOMUX_DRV_2MA, |
| 152 | .pull = GPIOMUX_PULL_DOWN, |
| 153 | }; |
| 154 | |
| 155 | static struct gpiomux_setting hdmi_active_1_cfg = { |
| 156 | .func = GPIOMUX_FUNC_1, |
| 157 | .drv = GPIOMUX_DRV_2MA, |
| 158 | .pull = GPIOMUX_PULL_UP, |
| 159 | }; |
| 160 | |
| 161 | static struct gpiomux_setting hdmi_active_2_cfg = { |
| 162 | .func = GPIOMUX_FUNC_1, |
| 163 | .drv = GPIOMUX_DRV_16MA, |
| 164 | .pull = GPIOMUX_PULL_DOWN, |
| 165 | }; |
| 166 | |
| 167 | static struct msm_gpiomux_config msm_hdmi_configs[] __initdata = { |
| 168 | { |
| 169 | .gpio = 31, |
| 170 | .settings = { |
| 171 | [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg, |
| 172 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 173 | }, |
| 174 | }, |
| 175 | { |
| 176 | .gpio = 32, |
| 177 | .settings = { |
| 178 | [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg, |
| 179 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 180 | }, |
| 181 | }, |
| 182 | { |
| 183 | .gpio = 33, |
| 184 | .settings = { |
| 185 | [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg, |
| 186 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 187 | }, |
| 188 | }, |
| 189 | { |
| 190 | .gpio = 34, |
| 191 | .settings = { |
| 192 | [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg, |
| 193 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 194 | }, |
| 195 | }, |
| 196 | }; |
| 197 | |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 198 | static struct msm_gpiomux_config msm_blsp_configs[] __initdata = { |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 199 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
| 200 | { |
| 201 | .gpio = 0, /* BLSP1 QUP SPI_DATA_MOSI */ |
| 202 | .settings = { |
| 203 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 204 | }, |
| 205 | }, |
| 206 | { |
| 207 | .gpio = 1, /* BLSP1 QUP SPI_DATA_MISO */ |
| 208 | .settings = { |
| 209 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 210 | }, |
| 211 | }, |
| 212 | { |
| 213 | .gpio = 3, /* BLSP1 QUP SPI_CLK */ |
| 214 | .settings = { |
| 215 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 216 | }, |
| 217 | }, |
| 218 | { |
Subbaraman Narayanamurthy | 3f93ab1 | 2012-08-17 19:39:47 -0700 | [diff] [blame] | 219 | .gpio = 9, /* BLSP1 QUP SPI_CS2A_N */ |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 220 | .settings = { |
Subbaraman Narayanamurthy | 3f93ab1 | 2012-08-17 19:39:47 -0700 | [diff] [blame] | 221 | [GPIOMUX_SUSPENDED] = &gpio_spi_cs2_config, |
| 222 | }, |
| 223 | }, |
| 224 | { |
| 225 | .gpio = 8, /* BLSP1 QUP SPI_CS1_N */ |
| 226 | .settings = { |
| 227 | [GPIOMUX_SUSPENDED] = &gpio_spi_cs1_config, |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 228 | }, |
| 229 | }, |
| 230 | #endif |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 231 | { |
Chandan Uddaraju | 88b26d7 | 2012-08-13 22:28:44 -0700 | [diff] [blame] | 232 | .gpio = 58, |
| 233 | .settings = { |
| 234 | [GPIOMUX_ACTIVE] = &lcd_en_act_cfg, |
| 235 | [GPIOMUX_SUSPENDED] = &lcd_en_sus_cfg, |
| 236 | }, |
| 237 | }, |
| 238 | { |
Amy Maloche | bc7e967 | 2012-08-15 10:30:40 -0700 | [diff] [blame] | 239 | .gpio = 6, /* BLSP1 QUP2 I2C_DAT */ |
| 240 | .settings = { |
| 241 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 242 | }, |
| 243 | }, |
| 244 | { |
| 245 | .gpio = 7, /* BLSP1 QUP2 I2C_CLK */ |
| 246 | .settings = { |
| 247 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 248 | }, |
| 249 | }, |
| 250 | { |
Jin Hong | a04caaa | 2012-05-23 10:28:27 -0700 | [diff] [blame] | 251 | .gpio = 83, /* BLSP11 QUP I2C_DAT */ |
| 252 | .settings = { |
| 253 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 254 | }, |
| 255 | }, |
| 256 | { |
| 257 | .gpio = 84, /* BLSP11 QUP I2C_CLK */ |
| 258 | .settings = { |
| 259 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 260 | }, |
| 261 | }, |
| 262 | { |
Stepan Moskovchenko | 5269b60 | 2012-08-08 17:57:09 -0700 | [diff] [blame] | 263 | .gpio = 4, /* BLSP2 UART TX */ |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 264 | .settings = { |
| 265 | [GPIOMUX_SUSPENDED] = &gpio_uart_config, |
| 266 | }, |
| 267 | }, |
| 268 | { |
Stepan Moskovchenko | 5269b60 | 2012-08-08 17:57:09 -0700 | [diff] [blame] | 269 | .gpio = 5, /* BLSP2 UART RX */ |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 270 | .settings = { |
| 271 | [GPIOMUX_SUSPENDED] = &gpio_uart_config, |
| 272 | }, |
| 273 | }, |
| 274 | }; |
| 275 | |
Sagar Dharia | a8e6b0a | 2012-08-10 20:52:30 -0600 | [diff] [blame] | 276 | static struct msm_gpiomux_config msm8974_slimbus_config[] __initdata = { |
| 277 | { |
| 278 | .gpio = 70, /* slimbus clk */ |
| 279 | .settings = { |
| 280 | [GPIOMUX_SUSPENDED] = &slimbus, |
| 281 | }, |
| 282 | }, |
| 283 | { |
| 284 | .gpio = 71, /* slimbus data */ |
| 285 | .settings = { |
| 286 | [GPIOMUX_SUSPENDED] = &slimbus, |
| 287 | }, |
| 288 | }, |
| 289 | }; |
| 290 | |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 291 | static struct gpiomux_setting cam_settings[] = { |
| 292 | { |
Sreesudhan Ramakrish Ramkumar | 88c4a09 | 2012-09-07 23:43:46 -0700 | [diff] [blame^] | 293 | .func = GPIOMUX_FUNC_1, /*active 1*/ /* 0 */ |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 294 | .drv = GPIOMUX_DRV_2MA, |
| 295 | .pull = GPIOMUX_PULL_NONE, |
| 296 | }, |
| 297 | |
| 298 | { |
Sreesudhan Ramakrish Ramkumar | 88c4a09 | 2012-09-07 23:43:46 -0700 | [diff] [blame^] | 299 | .func = GPIOMUX_FUNC_1, /*suspend*/ /* 1 */ |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 300 | .drv = GPIOMUX_DRV_2MA, |
| 301 | .pull = GPIOMUX_PULL_DOWN, |
| 302 | }, |
| 303 | |
| 304 | { |
Sreesudhan Ramakrish Ramkumar | 88c4a09 | 2012-09-07 23:43:46 -0700 | [diff] [blame^] | 305 | .func = GPIOMUX_FUNC_1, /*i2c suspend*/ /* 2 */ |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 306 | .drv = GPIOMUX_DRV_2MA, |
| 307 | .pull = GPIOMUX_PULL_KEEPER, |
| 308 | }, |
Sreesudhan Ramakrish Ramkumar | 88c4a09 | 2012-09-07 23:43:46 -0700 | [diff] [blame^] | 309 | |
| 310 | { |
| 311 | .func = GPIOMUX_FUNC_GPIO, /*active 0*/ /* 3 */ |
| 312 | .drv = GPIOMUX_DRV_2MA, |
| 313 | .pull = GPIOMUX_PULL_NONE, |
| 314 | }, |
| 315 | |
| 316 | { |
| 317 | .func = GPIOMUX_FUNC_GPIO, /*suspend 0*/ /* 4 */ |
| 318 | .drv = GPIOMUX_DRV_2MA, |
| 319 | .pull = GPIOMUX_PULL_DOWN, |
| 320 | }, |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 321 | }; |
| 322 | |
| 323 | static struct msm_gpiomux_config msm_sensor_configs[] __initdata = { |
| 324 | { |
| 325 | .gpio = 15, /* CAM_MCLK0 */ |
| 326 | .settings = { |
| 327 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 328 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 329 | }, |
| 330 | }, |
| 331 | { |
| 332 | .gpio = 16, /* CAM_MCLK1 */ |
| 333 | .settings = { |
| 334 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 335 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 336 | }, |
| 337 | }, |
| 338 | { |
| 339 | .gpio = 17, /* CAM_MCLK2 */ |
| 340 | .settings = { |
| 341 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 342 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 343 | }, |
| 344 | }, |
| 345 | { |
| 346 | .gpio = 18, /* WEBCAM1_RESET_N / CAM_MCLK3 */ |
| 347 | .settings = { |
Sreesudhan Ramakrish Ramkumar | 88c4a09 | 2012-09-07 23:43:46 -0700 | [diff] [blame^] | 348 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 349 | [GPIOMUX_SUSPENDED] = &cam_settings[4], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 350 | }, |
| 351 | }, |
| 352 | { |
| 353 | .gpio = 19, /* CCI_I2C_SDA0 */ |
| 354 | .settings = { |
| 355 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 356 | [GPIOMUX_SUSPENDED] = &cam_settings[2], |
| 357 | }, |
| 358 | }, |
| 359 | { |
| 360 | .gpio = 20, /* CCI_I2C_SCL0 */ |
| 361 | .settings = { |
| 362 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 363 | [GPIOMUX_SUSPENDED] = &cam_settings[2], |
| 364 | }, |
| 365 | }, |
| 366 | { |
| 367 | .gpio = 21, /* CCI_I2C_SDA1 */ |
| 368 | .settings = { |
| 369 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 370 | [GPIOMUX_SUSPENDED] = &cam_settings[2], |
| 371 | }, |
| 372 | }, |
| 373 | { |
| 374 | .gpio = 22, /* CCI_I2C_SCL1 */ |
| 375 | .settings = { |
| 376 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 377 | [GPIOMUX_SUSPENDED] = &cam_settings[2], |
| 378 | }, |
| 379 | }, |
| 380 | { |
| 381 | .gpio = 23, /* FLASH_LED_EN */ |
| 382 | .settings = { |
| 383 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 384 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 385 | }, |
| 386 | }, |
| 387 | { |
| 388 | .gpio = 24, /* FLASH_LED_NOW */ |
| 389 | .settings = { |
| 390 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 391 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 392 | }, |
| 393 | }, |
| 394 | { |
| 395 | .gpio = 25, /* WEBCAM2_RESET_N */ |
| 396 | .settings = { |
| 397 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 398 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 399 | }, |
| 400 | }, |
| 401 | { |
| 402 | .gpio = 26, /* CAM_IRQ */ |
| 403 | .settings = { |
| 404 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 405 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 406 | }, |
| 407 | }, |
| 408 | { |
| 409 | .gpio = 27, /* OIS_SYNC */ |
| 410 | .settings = { |
| 411 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 412 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 413 | }, |
| 414 | }, |
| 415 | { |
| 416 | .gpio = 28, /* WEBCAM1_STANDBY */ |
| 417 | .settings = { |
| 418 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 419 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 420 | }, |
| 421 | }, |
| 422 | { |
| 423 | .gpio = 89, /* CAM1_STANDBY_N */ |
| 424 | .settings = { |
| 425 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 426 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 427 | }, |
| 428 | }, |
| 429 | { |
| 430 | .gpio = 90, /* CAM1_RST_N */ |
| 431 | .settings = { |
| 432 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 433 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 434 | }, |
| 435 | }, |
| 436 | { |
| 437 | .gpio = 91, /* CAM2_STANDBY_N */ |
| 438 | .settings = { |
| 439 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 440 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 441 | }, |
| 442 | }, |
| 443 | { |
| 444 | .gpio = 92, /* CAM2_RST_N */ |
| 445 | .settings = { |
| 446 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 447 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 448 | }, |
| 449 | }, |
| 450 | }; |
Sameer Thalappil | 8d686d4 | 2012-08-24 10:07:31 -0700 | [diff] [blame] | 451 | static struct msm_gpiomux_config wcnss_5wire_interface[] = { |
| 452 | { |
| 453 | .gpio = 36, |
| 454 | .settings = { |
| 455 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 456 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 457 | }, |
| 458 | }, |
| 459 | { |
| 460 | .gpio = 37, |
| 461 | .settings = { |
| 462 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 463 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 464 | }, |
| 465 | }, |
| 466 | { |
| 467 | .gpio = 38, |
| 468 | .settings = { |
| 469 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 470 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 471 | }, |
| 472 | }, |
| 473 | { |
| 474 | .gpio = 39, |
| 475 | .settings = { |
| 476 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 477 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 478 | }, |
| 479 | }, |
| 480 | { |
| 481 | .gpio = 40, |
| 482 | .settings = { |
| 483 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 484 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 485 | }, |
| 486 | }, |
| 487 | }; |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 488 | |
Joonwoo Park | 187e9cb | 2012-08-24 22:47:53 -0700 | [diff] [blame] | 489 | static struct msm_gpiomux_config msm_taiko_config[] __initdata = { |
| 490 | { |
| 491 | .gpio = 63, /* SYS_RST_N */ |
| 492 | .settings = { |
| 493 | [GPIOMUX_SUSPENDED] = &taiko_reset, |
| 494 | }, |
| 495 | } |
| 496 | }; |
| 497 | |
Abhimanyu Kapur | 90ced6e | 2012-06-26 17:41:25 -0700 | [diff] [blame] | 498 | void __init msm_8974_init_gpiomux(void) |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 499 | { |
| 500 | int rc; |
| 501 | |
| 502 | rc = msm_gpiomux_init(NR_GPIO_IRQS); |
| 503 | if (rc) { |
Abhimanyu Kapur | 90ced6e | 2012-06-26 17:41:25 -0700 | [diff] [blame] | 504 | pr_err(KERN_ERR "msm_8974_init_gpiomux failed %d\n", rc); |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 505 | return; |
| 506 | } |
| 507 | |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 508 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
| 509 | msm_gpiomux_install(msm_eth_configs, ARRAY_SIZE(msm_eth_configs)); |
| 510 | #endif |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 511 | msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs)); |
Sameer Thalappil | 8d686d4 | 2012-08-24 10:07:31 -0700 | [diff] [blame] | 512 | msm_gpiomux_install(wcnss_5wire_interface, |
| 513 | ARRAY_SIZE(wcnss_5wire_interface)); |
Sagar Dharia | a8e6b0a | 2012-08-10 20:52:30 -0600 | [diff] [blame] | 514 | |
| 515 | msm_gpiomux_install(msm8974_slimbus_config, |
| 516 | ARRAY_SIZE(msm8974_slimbus_config)); |
| 517 | |
Amy Maloche | 9e99a79 | 2012-08-15 23:27:51 -0700 | [diff] [blame] | 518 | msm_gpiomux_install(msm_touch_configs, ARRAY_SIZE(msm_touch_configs)); |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 519 | |
| 520 | msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs)); |
Joonwoo Park | 187e9cb | 2012-08-24 22:47:53 -0700 | [diff] [blame] | 521 | |
| 522 | msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config)); |
Ujwal Patel | 74b5df4 | 2012-08-13 22:50:13 -0700 | [diff] [blame] | 523 | |
| 524 | msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs)); |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 525 | } |