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