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