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