Damir Didjusto | 93768d1 | 2013-01-17 11:30:47 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | #include <linux/init.h> |
| 15 | #include <linux/ioport.h> |
| 16 | #include <mach/board.h> |
| 17 | #include <mach/gpio.h> |
| 18 | #include <mach/gpiomux.h> |
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 | |
Pawan Kumar Nimmagadda | befacac | 2013-01-23 15:36:28 -0800 | [diff] [blame] | 71 | static struct gpiomux_setting gpio_suspend_config[] = { |
| 72 | { |
| 73 | .func = GPIOMUX_FUNC_GPIO, /* IN-NP */ |
| 74 | .drv = GPIOMUX_DRV_2MA, |
| 75 | .pull = GPIOMUX_PULL_NONE, |
| 76 | }, |
| 77 | { |
| 78 | .func = GPIOMUX_FUNC_GPIO, /* O-LOW */ |
| 79 | .drv = GPIOMUX_DRV_2MA, |
| 80 | .pull = GPIOMUX_PULL_NONE, |
| 81 | .dir = GPIOMUX_OUT_LOW, |
| 82 | }, |
| 83 | }; |
| 84 | |
Siddartha Mohanadoss | c4bc6ae | 2012-12-06 14:22:22 -0800 | [diff] [blame] | 85 | static struct gpiomux_setting gpio_epm_config = { |
| 86 | .func = GPIOMUX_FUNC_GPIO, |
| 87 | .drv = GPIOMUX_DRV_2MA, |
| 88 | .pull = GPIOMUX_PULL_DOWN, |
| 89 | }; |
| 90 | |
Sameer Thalappil | 8d686d4 | 2012-08-24 10:07:31 -0700 | [diff] [blame] | 91 | static struct gpiomux_setting wcnss_5wire_suspend_cfg = { |
| 92 | .func = GPIOMUX_FUNC_GPIO, |
| 93 | .drv = GPIOMUX_DRV_2MA, |
| 94 | .pull = GPIOMUX_PULL_UP, |
| 95 | }; |
| 96 | |
| 97 | static struct gpiomux_setting wcnss_5wire_active_cfg = { |
| 98 | .func = GPIOMUX_FUNC_1, |
| 99 | .drv = GPIOMUX_DRV_6MA, |
| 100 | .pull = GPIOMUX_PULL_DOWN, |
| 101 | }; |
| 102 | |
Jin Hong | a04caaa | 2012-05-23 10:28:27 -0700 | [diff] [blame] | 103 | static struct gpiomux_setting gpio_i2c_config = { |
| 104 | .func = GPIOMUX_FUNC_3, |
Gilad Avidov | b7d8bb1 | 2012-11-09 16:30:37 -0700 | [diff] [blame] | 105 | /* |
| 106 | * Please keep I2C GPIOs drive-strength at minimum (2ma). It is a |
| 107 | * workaround for HW issue of glitches caused by rapid GPIO current- |
| 108 | * change. |
| 109 | */ |
| 110 | .drv = GPIOMUX_DRV_2MA, |
Jin Hong | a04caaa | 2012-05-23 10:28:27 -0700 | [diff] [blame] | 111 | .pull = GPIOMUX_PULL_NONE, |
| 112 | }; |
| 113 | |
Chandan Uddaraju | 88b26d7 | 2012-08-13 22:28:44 -0700 | [diff] [blame] | 114 | static struct gpiomux_setting lcd_en_act_cfg = { |
| 115 | .func = GPIOMUX_FUNC_GPIO, |
| 116 | .drv = GPIOMUX_DRV_8MA, |
| 117 | .pull = GPIOMUX_PULL_NONE, |
| 118 | }; |
| 119 | |
| 120 | static struct gpiomux_setting lcd_en_sus_cfg = { |
| 121 | .func = GPIOMUX_FUNC_GPIO, |
| 122 | .drv = GPIOMUX_DRV_2MA, |
| 123 | .pull = GPIOMUX_PULL_DOWN, |
| 124 | }; |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 125 | |
Amy Maloche | 9e99a79 | 2012-08-15 23:27:51 -0700 | [diff] [blame] | 126 | static struct gpiomux_setting atmel_resout_sus_cfg = { |
| 127 | .func = GPIOMUX_FUNC_GPIO, |
| 128 | .drv = GPIOMUX_DRV_6MA, |
| 129 | .pull = GPIOMUX_PULL_DOWN, |
| 130 | }; |
| 131 | |
| 132 | static struct gpiomux_setting atmel_resout_act_cfg = { |
| 133 | .func = GPIOMUX_FUNC_GPIO, |
| 134 | .drv = GPIOMUX_DRV_6MA, |
| 135 | .pull = GPIOMUX_PULL_UP, |
| 136 | }; |
| 137 | |
| 138 | static struct gpiomux_setting atmel_int_act_cfg = { |
| 139 | .func = GPIOMUX_FUNC_GPIO, |
| 140 | .drv = GPIOMUX_DRV_8MA, |
| 141 | .pull = GPIOMUX_PULL_UP, |
| 142 | }; |
| 143 | |
| 144 | static struct gpiomux_setting atmel_int_sus_cfg = { |
| 145 | .func = GPIOMUX_FUNC_GPIO, |
| 146 | .drv = GPIOMUX_DRV_2MA, |
| 147 | .pull = GPIOMUX_PULL_DOWN, |
| 148 | }; |
| 149 | |
Joonwoo Park | 187e9cb | 2012-08-24 22:47:53 -0700 | [diff] [blame] | 150 | static struct gpiomux_setting taiko_reset = { |
| 151 | .func = GPIOMUX_FUNC_GPIO, |
| 152 | .drv = GPIOMUX_DRV_6MA, |
| 153 | .pull = GPIOMUX_PULL_NONE, |
| 154 | .dir = GPIOMUX_OUT_LOW, |
| 155 | }; |
| 156 | |
Joonwoo Park | eb84dc7 | 2012-09-12 10:22:49 -0700 | [diff] [blame] | 157 | static struct gpiomux_setting taiko_int = { |
| 158 | .func = GPIOMUX_FUNC_GPIO, |
| 159 | .drv = GPIOMUX_DRV_2MA, |
| 160 | .pull = GPIOMUX_PULL_NONE, |
| 161 | }; |
Amy Maloche | 527acc4 | 2012-12-07 18:40:54 -0800 | [diff] [blame] | 162 | static struct gpiomux_setting hap_lvl_shft_suspended_config = { |
| 163 | .func = GPIOMUX_FUNC_GPIO, |
| 164 | .drv = GPIOMUX_DRV_2MA, |
| 165 | .pull = GPIOMUX_PULL_DOWN, |
| 166 | }; |
| 167 | |
| 168 | static struct gpiomux_setting hap_lvl_shft_active_config = { |
| 169 | .func = GPIOMUX_FUNC_GPIO, |
| 170 | .drv = GPIOMUX_DRV_8MA, |
| 171 | .pull = GPIOMUX_PULL_UP, |
| 172 | }; |
| 173 | static struct msm_gpiomux_config hap_lvl_shft_config[] __initdata = { |
| 174 | { |
| 175 | .gpio = 86, |
| 176 | .settings = { |
| 177 | [GPIOMUX_SUSPENDED] = &hap_lvl_shft_suspended_config, |
| 178 | [GPIOMUX_ACTIVE] = &hap_lvl_shft_active_config, |
| 179 | }, |
| 180 | }, |
| 181 | }; |
Joonwoo Park | eb84dc7 | 2012-09-12 10:22:49 -0700 | [diff] [blame] | 182 | |
Amy Maloche | 9e99a79 | 2012-08-15 23:27:51 -0700 | [diff] [blame] | 183 | static struct msm_gpiomux_config msm_touch_configs[] __initdata = { |
| 184 | { |
| 185 | .gpio = 60, /* TOUCH RESET */ |
| 186 | .settings = { |
| 187 | [GPIOMUX_ACTIVE] = &atmel_resout_act_cfg, |
| 188 | [GPIOMUX_SUSPENDED] = &atmel_resout_sus_cfg, |
| 189 | }, |
| 190 | }, |
| 191 | { |
| 192 | .gpio = 61, /* TOUCH IRQ */ |
| 193 | .settings = { |
| 194 | [GPIOMUX_ACTIVE] = &atmel_int_act_cfg, |
| 195 | [GPIOMUX_SUSPENDED] = &atmel_int_sus_cfg, |
| 196 | }, |
| 197 | }, |
| 198 | |
| 199 | }; |
Ujwal Patel | 74b5df4 | 2012-08-13 22:50:13 -0700 | [diff] [blame] | 200 | |
Manu Gautam | ac7265b | 2012-11-21 11:49:15 +0530 | [diff] [blame] | 201 | static struct gpiomux_setting hsic_sus_cfg = { |
| 202 | .func = GPIOMUX_FUNC_GPIO, |
| 203 | .drv = GPIOMUX_DRV_2MA, |
| 204 | .pull = GPIOMUX_PULL_DOWN, |
| 205 | .dir = GPIOMUX_OUT_LOW, |
| 206 | }; |
| 207 | |
| 208 | static struct gpiomux_setting hsic_act_cfg = { |
| 209 | .func = GPIOMUX_FUNC_1, |
| 210 | .drv = GPIOMUX_DRV_12MA, |
| 211 | .pull = GPIOMUX_PULL_NONE, |
| 212 | }; |
| 213 | |
| 214 | static struct gpiomux_setting hsic_hub_act_cfg = { |
| 215 | .func = GPIOMUX_FUNC_GPIO, |
| 216 | .drv = GPIOMUX_DRV_2MA, |
| 217 | .pull = GPIOMUX_PULL_UP, |
| 218 | .dir = GPIOMUX_IN, |
| 219 | }; |
| 220 | |
| 221 | static struct msm_gpiomux_config msm_hsic_configs[] = { |
| 222 | { |
| 223 | .gpio = 144, /*HSIC_STROBE */ |
| 224 | .settings = { |
| 225 | [GPIOMUX_ACTIVE] = &hsic_act_cfg, |
| 226 | [GPIOMUX_SUSPENDED] = &hsic_sus_cfg, |
| 227 | }, |
| 228 | }, |
| 229 | { |
| 230 | .gpio = 145, /* HSIC_DATA */ |
| 231 | .settings = { |
| 232 | [GPIOMUX_ACTIVE] = &hsic_act_cfg, |
| 233 | [GPIOMUX_SUSPENDED] = &hsic_sus_cfg, |
| 234 | }, |
| 235 | }, |
| 236 | }; |
| 237 | |
| 238 | static struct msm_gpiomux_config msm_hsic_hub_configs[] = { |
| 239 | { |
| 240 | .gpio = 50, /* HSIC_HUB_INT_N */ |
| 241 | .settings = { |
| 242 | [GPIOMUX_ACTIVE] = &hsic_hub_act_cfg, |
| 243 | [GPIOMUX_SUSPENDED] = &hsic_sus_cfg, |
| 244 | }, |
| 245 | }, |
| 246 | }; |
| 247 | |
Manoj Rao | 5bf2a7e | 2012-10-29 12:53:27 -0700 | [diff] [blame] | 248 | static struct gpiomux_setting mhl_suspend_config = { |
| 249 | .func = GPIOMUX_FUNC_GPIO, |
| 250 | .drv = GPIOMUX_DRV_2MA, |
| 251 | .pull = GPIOMUX_PULL_DOWN, |
| 252 | }; |
| 253 | |
| 254 | static struct gpiomux_setting mhl_active_1_cfg = { |
| 255 | .func = GPIOMUX_FUNC_1, |
| 256 | .drv = GPIOMUX_DRV_2MA, |
| 257 | .pull = GPIOMUX_PULL_UP, |
| 258 | .dir = GPIOMUX_OUT_HIGH, |
| 259 | }; |
| 260 | |
| 261 | static struct gpiomux_setting mhl_active_2_cfg = { |
| 262 | .func = GPIOMUX_FUNC_1, |
| 263 | .drv = GPIOMUX_DRV_2MA, |
| 264 | .pull = GPIOMUX_PULL_UP, |
| 265 | }; |
| 266 | |
Ujwal Patel | 74b5df4 | 2012-08-13 22:50:13 -0700 | [diff] [blame] | 267 | static struct gpiomux_setting hdmi_suspend_cfg = { |
| 268 | .func = GPIOMUX_FUNC_GPIO, |
| 269 | .drv = GPIOMUX_DRV_2MA, |
| 270 | .pull = GPIOMUX_PULL_DOWN, |
| 271 | }; |
| 272 | |
| 273 | static struct gpiomux_setting hdmi_active_1_cfg = { |
| 274 | .func = GPIOMUX_FUNC_1, |
| 275 | .drv = GPIOMUX_DRV_2MA, |
| 276 | .pull = GPIOMUX_PULL_UP, |
| 277 | }; |
| 278 | |
| 279 | static struct gpiomux_setting hdmi_active_2_cfg = { |
| 280 | .func = GPIOMUX_FUNC_1, |
| 281 | .drv = GPIOMUX_DRV_16MA, |
| 282 | .pull = GPIOMUX_PULL_DOWN, |
| 283 | }; |
| 284 | |
Manoj Rao | 5bf2a7e | 2012-10-29 12:53:27 -0700 | [diff] [blame] | 285 | static struct msm_gpiomux_config msm_mhl_configs[] __initdata = { |
| 286 | { |
| 287 | /* mhl-sii8334 pwr */ |
| 288 | .gpio = 12, |
| 289 | .settings = { |
| 290 | [GPIOMUX_SUSPENDED] = &mhl_suspend_config, |
| 291 | [GPIOMUX_ACTIVE] = &mhl_active_1_cfg, |
| 292 | }, |
| 293 | }, |
| 294 | { |
| 295 | /* mhl-sii8334 intr */ |
| 296 | .gpio = 82, |
| 297 | .settings = { |
| 298 | [GPIOMUX_SUSPENDED] = &mhl_suspend_config, |
| 299 | [GPIOMUX_ACTIVE] = &mhl_active_1_cfg, |
| 300 | }, |
| 301 | }, |
| 302 | { |
| 303 | /* mhl-sii8334 reset */ |
| 304 | .gpio = 8, |
| 305 | .settings = { |
| 306 | [GPIOMUX_SUSPENDED] = &mhl_suspend_config, |
| 307 | [GPIOMUX_ACTIVE] = &mhl_active_2_cfg, |
| 308 | }, |
| 309 | }, |
| 310 | }; |
| 311 | |
| 312 | |
Ujwal Patel | 74b5df4 | 2012-08-13 22:50:13 -0700 | [diff] [blame] | 313 | static struct msm_gpiomux_config msm_hdmi_configs[] __initdata = { |
| 314 | { |
| 315 | .gpio = 31, |
| 316 | .settings = { |
| 317 | [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg, |
| 318 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 319 | }, |
| 320 | }, |
| 321 | { |
| 322 | .gpio = 32, |
| 323 | .settings = { |
| 324 | [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg, |
| 325 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 326 | }, |
| 327 | }, |
| 328 | { |
| 329 | .gpio = 33, |
| 330 | .settings = { |
| 331 | [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg, |
| 332 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 333 | }, |
| 334 | }, |
| 335 | { |
| 336 | .gpio = 34, |
| 337 | .settings = { |
| 338 | [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg, |
| 339 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 340 | }, |
| 341 | }, |
| 342 | }; |
| 343 | |
Stepan Moskovchenko | 95108b8 | 2012-11-27 14:28:11 -0800 | [diff] [blame] | 344 | static struct msm_gpiomux_config msm_rumi_blsp_configs[] __initdata = { |
| 345 | { |
| 346 | .gpio = 45, /* BLSP2 UART8 TX */ |
| 347 | .settings = { |
| 348 | [GPIOMUX_SUSPENDED] = &gpio_uart_config, |
| 349 | }, |
| 350 | }, |
| 351 | { |
| 352 | .gpio = 46, /* BLSP2 UART8 RX */ |
| 353 | .settings = { |
| 354 | [GPIOMUX_SUSPENDED] = &gpio_uart_config, |
| 355 | }, |
| 356 | }, |
| 357 | }; |
| 358 | |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 359 | static struct msm_gpiomux_config msm_blsp_configs[] __initdata = { |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 360 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
| 361 | { |
| 362 | .gpio = 0, /* BLSP1 QUP SPI_DATA_MOSI */ |
| 363 | .settings = { |
| 364 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 365 | }, |
| 366 | }, |
| 367 | { |
| 368 | .gpio = 1, /* BLSP1 QUP SPI_DATA_MISO */ |
| 369 | .settings = { |
| 370 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 371 | }, |
| 372 | }, |
| 373 | { |
| 374 | .gpio = 3, /* BLSP1 QUP SPI_CLK */ |
| 375 | .settings = { |
| 376 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 377 | }, |
| 378 | }, |
| 379 | { |
Subbaraman Narayanamurthy | 3f93ab1 | 2012-08-17 19:39:47 -0700 | [diff] [blame] | 380 | .gpio = 9, /* BLSP1 QUP SPI_CS2A_N */ |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 381 | .settings = { |
Subbaraman Narayanamurthy | 3f93ab1 | 2012-08-17 19:39:47 -0700 | [diff] [blame] | 382 | [GPIOMUX_SUSPENDED] = &gpio_spi_cs2_config, |
| 383 | }, |
| 384 | }, |
| 385 | { |
| 386 | .gpio = 8, /* BLSP1 QUP SPI_CS1_N */ |
| 387 | .settings = { |
| 388 | [GPIOMUX_SUSPENDED] = &gpio_spi_cs1_config, |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 389 | }, |
| 390 | }, |
| 391 | #endif |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 392 | { |
Chandan Uddaraju | 88b26d7 | 2012-08-13 22:28:44 -0700 | [diff] [blame] | 393 | .gpio = 58, |
| 394 | .settings = { |
| 395 | [GPIOMUX_ACTIVE] = &lcd_en_act_cfg, |
| 396 | [GPIOMUX_SUSPENDED] = &lcd_en_sus_cfg, |
| 397 | }, |
| 398 | }, |
| 399 | { |
Amy Maloche | bc7e967 | 2012-08-15 10:30:40 -0700 | [diff] [blame] | 400 | .gpio = 6, /* BLSP1 QUP2 I2C_DAT */ |
| 401 | .settings = { |
| 402 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 403 | }, |
| 404 | }, |
| 405 | { |
| 406 | .gpio = 7, /* BLSP1 QUP2 I2C_CLK */ |
| 407 | .settings = { |
| 408 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 409 | }, |
| 410 | }, |
| 411 | { |
Jin Hong | a04caaa | 2012-05-23 10:28:27 -0700 | [diff] [blame] | 412 | .gpio = 83, /* BLSP11 QUP I2C_DAT */ |
| 413 | .settings = { |
| 414 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 415 | }, |
| 416 | }, |
| 417 | { |
| 418 | .gpio = 84, /* BLSP11 QUP I2C_CLK */ |
| 419 | .settings = { |
| 420 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 421 | }, |
| 422 | }, |
| 423 | { |
Stepan Moskovchenko | 5269b60 | 2012-08-08 17:57:09 -0700 | [diff] [blame] | 424 | .gpio = 4, /* BLSP2 UART TX */ |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 425 | .settings = { |
| 426 | [GPIOMUX_SUSPENDED] = &gpio_uart_config, |
| 427 | }, |
| 428 | }, |
| 429 | { |
Stepan Moskovchenko | 5269b60 | 2012-08-08 17:57:09 -0700 | [diff] [blame] | 430 | .gpio = 5, /* BLSP2 UART RX */ |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 431 | .settings = { |
| 432 | [GPIOMUX_SUSPENDED] = &gpio_uart_config, |
| 433 | }, |
| 434 | }, |
Sagar Dharia | e0bb650 | 2012-08-10 20:25:51 -0600 | [diff] [blame] | 435 | { |
| 436 | .gpio = 53, /* BLSP2 QUP4 SPI_DATA_MOSI */ |
| 437 | .settings = { |
Pawan Kumar Nimmagadda | befacac | 2013-01-23 15:36:28 -0800 | [diff] [blame] | 438 | [GPIOMUX_ACTIVE] = &gpio_spi_config, |
| 439 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Sagar Dharia | e0bb650 | 2012-08-10 20:25:51 -0600 | [diff] [blame] | 440 | }, |
| 441 | }, |
| 442 | { |
| 443 | .gpio = 54, /* BLSP2 QUP4 SPI_DATA_MISO */ |
| 444 | .settings = { |
Pawan Kumar Nimmagadda | befacac | 2013-01-23 15:36:28 -0800 | [diff] [blame] | 445 | [GPIOMUX_ACTIVE] = &gpio_spi_config, |
| 446 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Sagar Dharia | e0bb650 | 2012-08-10 20:25:51 -0600 | [diff] [blame] | 447 | }, |
| 448 | }, |
| 449 | { |
| 450 | .gpio = 56, /* BLSP2 QUP4 SPI_CLK */ |
| 451 | .settings = { |
Pawan Kumar Nimmagadda | befacac | 2013-01-23 15:36:28 -0800 | [diff] [blame] | 452 | [GPIOMUX_ACTIVE] = &gpio_spi_config, |
| 453 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
Sagar Dharia | e0bb650 | 2012-08-10 20:25:51 -0600 | [diff] [blame] | 454 | }, |
| 455 | }, |
| 456 | { |
| 457 | .gpio = 55, /* BLSP2 QUP4 SPI_CS0_N */ |
| 458 | .settings = { |
Pawan Kumar Nimmagadda | befacac | 2013-01-23 15:36:28 -0800 | [diff] [blame] | 459 | [GPIOMUX_ACTIVE] = &gpio_spi_config, |
| 460 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
Sagar Dharia | e0bb650 | 2012-08-10 20:25:51 -0600 | [diff] [blame] | 461 | }, |
| 462 | }, |
Siddartha Mohanadoss | c4bc6ae | 2012-12-06 14:22:22 -0800 | [diff] [blame] | 463 | { |
| 464 | .gpio = 81, /* EPM enable */ |
| 465 | .settings = { |
| 466 | [GPIOMUX_SUSPENDED] = &gpio_epm_config, |
| 467 | }, |
| 468 | }, |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 469 | }; |
| 470 | |
Sagar Dharia | a8e6b0a | 2012-08-10 20:52:30 -0600 | [diff] [blame] | 471 | static struct msm_gpiomux_config msm8974_slimbus_config[] __initdata = { |
| 472 | { |
| 473 | .gpio = 70, /* slimbus clk */ |
| 474 | .settings = { |
| 475 | [GPIOMUX_SUSPENDED] = &slimbus, |
| 476 | }, |
| 477 | }, |
| 478 | { |
| 479 | .gpio = 71, /* slimbus data */ |
| 480 | .settings = { |
| 481 | [GPIOMUX_SUSPENDED] = &slimbus, |
| 482 | }, |
| 483 | }, |
| 484 | }; |
| 485 | |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 486 | static struct gpiomux_setting cam_settings[] = { |
| 487 | { |
Sreesudhan Ramakrish Ramkumar | 88c4a09 | 2012-09-07 23:43:46 -0700 | [diff] [blame] | 488 | .func = GPIOMUX_FUNC_1, /*active 1*/ /* 0 */ |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 489 | .drv = GPIOMUX_DRV_2MA, |
| 490 | .pull = GPIOMUX_PULL_NONE, |
| 491 | }, |
| 492 | |
| 493 | { |
Sreesudhan Ramakrish Ramkumar | 88c4a09 | 2012-09-07 23:43:46 -0700 | [diff] [blame] | 494 | .func = GPIOMUX_FUNC_1, /*suspend*/ /* 1 */ |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 495 | .drv = GPIOMUX_DRV_2MA, |
| 496 | .pull = GPIOMUX_PULL_DOWN, |
| 497 | }, |
| 498 | |
| 499 | { |
Sreesudhan Ramakrish Ramkumar | 88c4a09 | 2012-09-07 23:43:46 -0700 | [diff] [blame] | 500 | .func = GPIOMUX_FUNC_1, /*i2c suspend*/ /* 2 */ |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 501 | .drv = GPIOMUX_DRV_2MA, |
| 502 | .pull = GPIOMUX_PULL_KEEPER, |
| 503 | }, |
Sreesudhan Ramakrish Ramkumar | 88c4a09 | 2012-09-07 23:43:46 -0700 | [diff] [blame] | 504 | |
| 505 | { |
| 506 | .func = GPIOMUX_FUNC_GPIO, /*active 0*/ /* 3 */ |
| 507 | .drv = GPIOMUX_DRV_2MA, |
| 508 | .pull = GPIOMUX_PULL_NONE, |
| 509 | }, |
| 510 | |
| 511 | { |
| 512 | .func = GPIOMUX_FUNC_GPIO, /*suspend 0*/ /* 4 */ |
| 513 | .drv = GPIOMUX_DRV_2MA, |
| 514 | .pull = GPIOMUX_PULL_DOWN, |
| 515 | }, |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 516 | }; |
| 517 | |
Subhash Jadavani | 76aa7de | 2012-10-10 09:58:17 +0530 | [diff] [blame] | 518 | static struct gpiomux_setting sd_card_det_config = { |
| 519 | .func = GPIOMUX_FUNC_GPIO, |
| 520 | .drv = GPIOMUX_DRV_2MA, |
| 521 | .pull = GPIOMUX_PULL_NONE, |
| 522 | .dir = GPIOMUX_IN, |
| 523 | }; |
| 524 | |
| 525 | static struct msm_gpiomux_config sd_card_det __initdata = { |
| 526 | .gpio = 62, |
| 527 | .settings = { |
| 528 | [GPIOMUX_ACTIVE] = &sd_card_det_config, |
| 529 | [GPIOMUX_SUSPENDED] = &sd_card_det_config, |
| 530 | }, |
| 531 | }; |
| 532 | |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 533 | static struct msm_gpiomux_config msm_sensor_configs[] __initdata = { |
| 534 | { |
| 535 | .gpio = 15, /* CAM_MCLK0 */ |
| 536 | .settings = { |
| 537 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 538 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 539 | }, |
| 540 | }, |
| 541 | { |
| 542 | .gpio = 16, /* CAM_MCLK1 */ |
| 543 | .settings = { |
| 544 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 545 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 546 | }, |
| 547 | }, |
| 548 | { |
| 549 | .gpio = 17, /* CAM_MCLK2 */ |
| 550 | .settings = { |
| 551 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 552 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 553 | }, |
| 554 | }, |
| 555 | { |
| 556 | .gpio = 18, /* WEBCAM1_RESET_N / CAM_MCLK3 */ |
| 557 | .settings = { |
Sreesudhan Ramakrish Ramkumar | 88c4a09 | 2012-09-07 23:43:46 -0700 | [diff] [blame] | 558 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 559 | [GPIOMUX_SUSPENDED] = &cam_settings[4], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 560 | }, |
| 561 | }, |
| 562 | { |
| 563 | .gpio = 19, /* CCI_I2C_SDA0 */ |
| 564 | .settings = { |
| 565 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 566 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 567 | }, |
| 568 | }, |
| 569 | { |
| 570 | .gpio = 20, /* CCI_I2C_SCL0 */ |
| 571 | .settings = { |
| 572 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 573 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 574 | }, |
| 575 | }, |
| 576 | { |
| 577 | .gpio = 21, /* CCI_I2C_SDA1 */ |
| 578 | .settings = { |
| 579 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 580 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 581 | }, |
| 582 | }, |
| 583 | { |
| 584 | .gpio = 22, /* CCI_I2C_SCL1 */ |
| 585 | .settings = { |
| 586 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 587 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 588 | }, |
| 589 | }, |
| 590 | { |
| 591 | .gpio = 23, /* FLASH_LED_EN */ |
| 592 | .settings = { |
| 593 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 594 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 595 | }, |
| 596 | }, |
| 597 | { |
| 598 | .gpio = 24, /* FLASH_LED_NOW */ |
| 599 | .settings = { |
| 600 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 601 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 602 | }, |
| 603 | }, |
| 604 | { |
| 605 | .gpio = 25, /* WEBCAM2_RESET_N */ |
| 606 | .settings = { |
| 607 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 608 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 609 | }, |
| 610 | }, |
| 611 | { |
| 612 | .gpio = 26, /* CAM_IRQ */ |
| 613 | .settings = { |
| 614 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 615 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 616 | }, |
| 617 | }, |
| 618 | { |
| 619 | .gpio = 27, /* OIS_SYNC */ |
| 620 | .settings = { |
| 621 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 622 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 623 | }, |
| 624 | }, |
| 625 | { |
| 626 | .gpio = 28, /* WEBCAM1_STANDBY */ |
| 627 | .settings = { |
| 628 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 629 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 630 | }, |
| 631 | }, |
| 632 | { |
| 633 | .gpio = 89, /* CAM1_STANDBY_N */ |
| 634 | .settings = { |
| 635 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 636 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 637 | }, |
| 638 | }, |
| 639 | { |
| 640 | .gpio = 90, /* CAM1_RST_N */ |
| 641 | .settings = { |
| 642 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 643 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 644 | }, |
| 645 | }, |
| 646 | { |
| 647 | .gpio = 91, /* CAM2_STANDBY_N */ |
| 648 | .settings = { |
| 649 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 650 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 651 | }, |
| 652 | }, |
| 653 | { |
| 654 | .gpio = 92, /* CAM2_RST_N */ |
| 655 | .settings = { |
| 656 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 657 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 658 | }, |
| 659 | }, |
| 660 | }; |
Damir Didjusto | 04d3c36 | 2013-01-07 14:30:53 -0800 | [diff] [blame] | 661 | |
| 662 | static struct gpiomux_setting pri_auxpcm_act_cfg = { |
| 663 | .func = GPIOMUX_FUNC_1, |
| 664 | .drv = GPIOMUX_DRV_8MA, |
| 665 | .pull = GPIOMUX_PULL_NONE, |
| 666 | }; |
| 667 | |
| 668 | |
| 669 | static struct gpiomux_setting pri_auxpcm_sus_cfg = { |
| 670 | .func = GPIOMUX_FUNC_1, |
| 671 | .drv = GPIOMUX_DRV_2MA, |
| 672 | .pull = GPIOMUX_PULL_DOWN, |
| 673 | }; |
| 674 | |
| 675 | static struct msm_gpiomux_config msm8974_pri_auxpcm_configs[] __initdata = { |
| 676 | { |
| 677 | .gpio = 65, |
| 678 | .settings = { |
| 679 | [GPIOMUX_SUSPENDED] = &pri_auxpcm_sus_cfg, |
| 680 | [GPIOMUX_ACTIVE] = &pri_auxpcm_act_cfg, |
| 681 | }, |
| 682 | }, |
| 683 | { |
| 684 | .gpio = 66, |
| 685 | .settings = { |
| 686 | [GPIOMUX_SUSPENDED] = &pri_auxpcm_sus_cfg, |
| 687 | [GPIOMUX_ACTIVE] = &pri_auxpcm_act_cfg, |
| 688 | }, |
| 689 | }, |
| 690 | { |
| 691 | .gpio = 67, |
| 692 | .settings = { |
| 693 | [GPIOMUX_SUSPENDED] = &pri_auxpcm_sus_cfg, |
| 694 | [GPIOMUX_ACTIVE] = &pri_auxpcm_act_cfg, |
| 695 | }, |
| 696 | }, |
| 697 | { |
| 698 | .gpio = 68, |
| 699 | .settings = { |
| 700 | [GPIOMUX_SUSPENDED] = &pri_auxpcm_sus_cfg, |
| 701 | [GPIOMUX_ACTIVE] = &pri_auxpcm_act_cfg, |
| 702 | }, |
| 703 | }, |
| 704 | }; |
| 705 | |
Sameer Thalappil | 8d686d4 | 2012-08-24 10:07:31 -0700 | [diff] [blame] | 706 | static struct msm_gpiomux_config wcnss_5wire_interface[] = { |
| 707 | { |
| 708 | .gpio = 36, |
| 709 | .settings = { |
| 710 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 711 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 712 | }, |
| 713 | }, |
| 714 | { |
| 715 | .gpio = 37, |
| 716 | .settings = { |
| 717 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 718 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 719 | }, |
| 720 | }, |
| 721 | { |
| 722 | .gpio = 38, |
| 723 | .settings = { |
| 724 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 725 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 726 | }, |
| 727 | }, |
| 728 | { |
| 729 | .gpio = 39, |
| 730 | .settings = { |
| 731 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 732 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 733 | }, |
| 734 | }, |
| 735 | { |
| 736 | .gpio = 40, |
| 737 | .settings = { |
| 738 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 739 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 740 | }, |
| 741 | }, |
| 742 | }; |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 743 | |
Joonwoo Park | 187e9cb | 2012-08-24 22:47:53 -0700 | [diff] [blame] | 744 | static struct msm_gpiomux_config msm_taiko_config[] __initdata = { |
| 745 | { |
| 746 | .gpio = 63, /* SYS_RST_N */ |
| 747 | .settings = { |
| 748 | [GPIOMUX_SUSPENDED] = &taiko_reset, |
| 749 | }, |
Joonwoo Park | eb84dc7 | 2012-09-12 10:22:49 -0700 | [diff] [blame] | 750 | }, |
| 751 | { |
| 752 | .gpio = 72, /* CDC_INT */ |
| 753 | .settings = { |
| 754 | [GPIOMUX_SUSPENDED] = &taiko_int, |
| 755 | }, |
| 756 | }, |
Joonwoo Park | 187e9cb | 2012-08-24 22:47:53 -0700 | [diff] [blame] | 757 | }; |
| 758 | |
Subhash Jadavani | 102f0ce | 2012-12-14 21:25:59 +0530 | [diff] [blame] | 759 | #ifdef CONFIG_MMC_MSM_SDC3_SUPPORT |
| 760 | static struct gpiomux_setting sdc3_clk_actv_cfg = { |
| 761 | .func = GPIOMUX_FUNC_2, |
| 762 | .drv = GPIOMUX_DRV_8MA, |
| 763 | .pull = GPIOMUX_PULL_NONE, |
| 764 | }; |
| 765 | |
| 766 | static struct gpiomux_setting sdc3_cmd_data_0_3_actv_cfg = { |
| 767 | .func = GPIOMUX_FUNC_2, |
| 768 | .drv = GPIOMUX_DRV_8MA, |
| 769 | .pull = GPIOMUX_PULL_UP, |
| 770 | }; |
| 771 | |
| 772 | static struct gpiomux_setting sdc3_suspend_cfg = { |
| 773 | .func = GPIOMUX_FUNC_GPIO, |
| 774 | .drv = GPIOMUX_DRV_2MA, |
| 775 | .pull = GPIOMUX_PULL_DOWN, |
| 776 | }; |
| 777 | |
| 778 | static struct gpiomux_setting sdc3_data_1_suspend_cfg = { |
| 779 | .func = GPIOMUX_FUNC_GPIO, |
| 780 | .drv = GPIOMUX_DRV_8MA, |
| 781 | .pull = GPIOMUX_PULL_UP, |
| 782 | }; |
| 783 | |
| 784 | static struct msm_gpiomux_config msm8974_sdc3_configs[] __initdata = { |
| 785 | { |
| 786 | /* DAT3 */ |
| 787 | .gpio = 35, |
| 788 | .settings = { |
| 789 | [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg, |
| 790 | [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg, |
| 791 | }, |
| 792 | }, |
| 793 | { |
| 794 | /* DAT2 */ |
| 795 | .gpio = 36, |
| 796 | .settings = { |
| 797 | [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg, |
| 798 | [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg, |
| 799 | }, |
| 800 | }, |
| 801 | { |
| 802 | /* DAT1 */ |
| 803 | .gpio = 37, |
| 804 | .settings = { |
| 805 | [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg, |
| 806 | [GPIOMUX_SUSPENDED] = &sdc3_data_1_suspend_cfg, |
| 807 | }, |
| 808 | }, |
| 809 | { |
| 810 | /* DAT0 */ |
| 811 | .gpio = 38, |
| 812 | .settings = { |
| 813 | [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg, |
| 814 | [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg, |
| 815 | }, |
| 816 | }, |
| 817 | { |
| 818 | /* CMD */ |
| 819 | .gpio = 39, |
| 820 | .settings = { |
| 821 | [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg, |
| 822 | [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg, |
| 823 | }, |
| 824 | }, |
| 825 | { |
| 826 | /* CLK */ |
| 827 | .gpio = 40, |
| 828 | .settings = { |
| 829 | [GPIOMUX_ACTIVE] = &sdc3_clk_actv_cfg, |
| 830 | [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg, |
| 831 | }, |
| 832 | }, |
| 833 | }; |
| 834 | |
| 835 | static void msm_gpiomux_sdc3_install(void) |
| 836 | { |
| 837 | msm_gpiomux_install(msm8974_sdc3_configs, |
| 838 | ARRAY_SIZE(msm8974_sdc3_configs)); |
| 839 | } |
| 840 | #else |
| 841 | static void msm_gpiomux_sdc3_install(void) {} |
| 842 | #endif /* CONFIG_MMC_MSM_SDC3_SUPPORT */ |
| 843 | |
| 844 | #ifdef CONFIG_MMC_MSM_SDC4_SUPPORT |
| 845 | static struct gpiomux_setting sdc4_clk_actv_cfg = { |
| 846 | .func = GPIOMUX_FUNC_2, |
| 847 | .drv = GPIOMUX_DRV_8MA, |
| 848 | .pull = GPIOMUX_PULL_NONE, |
| 849 | }; |
| 850 | |
| 851 | static struct gpiomux_setting sdc4_cmd_data_0_3_actv_cfg = { |
| 852 | .func = GPIOMUX_FUNC_2, |
| 853 | .drv = GPIOMUX_DRV_8MA, |
| 854 | .pull = GPIOMUX_PULL_UP, |
| 855 | }; |
| 856 | |
| 857 | static struct gpiomux_setting sdc4_suspend_cfg = { |
| 858 | .func = GPIOMUX_FUNC_GPIO, |
| 859 | .drv = GPIOMUX_DRV_2MA, |
| 860 | .pull = GPIOMUX_PULL_DOWN, |
| 861 | }; |
| 862 | |
| 863 | static struct gpiomux_setting sdc4_data_1_suspend_cfg = { |
| 864 | .func = GPIOMUX_FUNC_GPIO, |
| 865 | .drv = GPIOMUX_DRV_8MA, |
| 866 | .pull = GPIOMUX_PULL_UP, |
| 867 | }; |
| 868 | |
| 869 | static struct msm_gpiomux_config msm8974_sdc4_configs[] __initdata = { |
| 870 | { |
| 871 | /* DAT3 */ |
| 872 | .gpio = 92, |
| 873 | .settings = { |
| 874 | [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg, |
| 875 | [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg, |
| 876 | }, |
| 877 | }, |
| 878 | { |
| 879 | /* DAT2 */ |
| 880 | .gpio = 94, |
| 881 | .settings = { |
| 882 | [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg, |
| 883 | [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg, |
| 884 | }, |
| 885 | }, |
| 886 | { |
| 887 | /* DAT1 */ |
| 888 | .gpio = 95, |
| 889 | .settings = { |
| 890 | [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg, |
| 891 | [GPIOMUX_SUSPENDED] = &sdc4_data_1_suspend_cfg, |
| 892 | }, |
| 893 | }, |
| 894 | { |
| 895 | /* DAT0 */ |
| 896 | .gpio = 96, |
| 897 | .settings = { |
| 898 | [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg, |
| 899 | [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg, |
| 900 | }, |
| 901 | }, |
| 902 | { |
| 903 | /* CMD */ |
| 904 | .gpio = 91, |
| 905 | .settings = { |
| 906 | [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg, |
| 907 | [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg, |
| 908 | }, |
| 909 | }, |
| 910 | { |
| 911 | /* CLK */ |
| 912 | .gpio = 93, |
| 913 | .settings = { |
| 914 | [GPIOMUX_ACTIVE] = &sdc4_clk_actv_cfg, |
| 915 | [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg, |
| 916 | }, |
| 917 | }, |
| 918 | }; |
| 919 | |
| 920 | static void msm_gpiomux_sdc4_install(void) |
| 921 | { |
| 922 | msm_gpiomux_install(msm8974_sdc4_configs, |
| 923 | ARRAY_SIZE(msm8974_sdc4_configs)); |
| 924 | } |
| 925 | #else |
| 926 | static void msm_gpiomux_sdc4_install(void) {} |
| 927 | #endif /* CONFIG_MMC_MSM_SDC4_SUPPORT */ |
| 928 | |
Abhimanyu Kapur | 90ced6e | 2012-06-26 17:41:25 -0700 | [diff] [blame] | 929 | void __init msm_8974_init_gpiomux(void) |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 930 | { |
| 931 | int rc; |
| 932 | |
Rohit Vaswani | 341c203 | 2012-11-08 18:49:29 -0800 | [diff] [blame] | 933 | rc = msm_gpiomux_init_dt(); |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 934 | if (rc) { |
Rohit Vaswani | 341c203 | 2012-11-08 18:49:29 -0800 | [diff] [blame] | 935 | pr_err("%s failed %d\n", __func__, rc); |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 936 | return; |
| 937 | } |
| 938 | |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 939 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
| 940 | msm_gpiomux_install(msm_eth_configs, ARRAY_SIZE(msm_eth_configs)); |
| 941 | #endif |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 942 | msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs)); |
Sameer Thalappil | 8d686d4 | 2012-08-24 10:07:31 -0700 | [diff] [blame] | 943 | msm_gpiomux_install(wcnss_5wire_interface, |
| 944 | ARRAY_SIZE(wcnss_5wire_interface)); |
Sagar Dharia | a8e6b0a | 2012-08-10 20:52:30 -0600 | [diff] [blame] | 945 | |
| 946 | msm_gpiomux_install(msm8974_slimbus_config, |
| 947 | ARRAY_SIZE(msm8974_slimbus_config)); |
| 948 | |
Amy Maloche | 9e99a79 | 2012-08-15 23:27:51 -0700 | [diff] [blame] | 949 | msm_gpiomux_install(msm_touch_configs, ARRAY_SIZE(msm_touch_configs)); |
Amy Maloche | 527acc4 | 2012-12-07 18:40:54 -0800 | [diff] [blame] | 950 | msm_gpiomux_install(hap_lvl_shft_config, |
| 951 | ARRAY_SIZE(hap_lvl_shft_config)); |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 952 | |
| 953 | msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs)); |
Joonwoo Park | 187e9cb | 2012-08-24 22:47:53 -0700 | [diff] [blame] | 954 | |
Subhash Jadavani | 76aa7de | 2012-10-10 09:58:17 +0530 | [diff] [blame] | 955 | msm_gpiomux_install(&sd_card_det, 1); |
Subhash Jadavani | 102f0ce | 2012-12-14 21:25:59 +0530 | [diff] [blame] | 956 | msm_gpiomux_sdc3_install(); |
| 957 | msm_gpiomux_sdc4_install(); |
Subhash Jadavani | 76aa7de | 2012-10-10 09:58:17 +0530 | [diff] [blame] | 958 | |
Joonwoo Park | 187e9cb | 2012-08-24 22:47:53 -0700 | [diff] [blame] | 959 | msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config)); |
Ujwal Patel | 74b5df4 | 2012-08-13 22:50:13 -0700 | [diff] [blame] | 960 | |
Manu Gautam | ac7265b | 2012-11-21 11:49:15 +0530 | [diff] [blame] | 961 | msm_gpiomux_install(msm_hsic_configs, ARRAY_SIZE(msm_hsic_configs)); |
| 962 | msm_gpiomux_install(msm_hsic_hub_configs, |
| 963 | ARRAY_SIZE(msm_hsic_hub_configs)); |
| 964 | |
Ujwal Patel | 74b5df4 | 2012-08-13 22:50:13 -0700 | [diff] [blame] | 965 | msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs)); |
Manoj Rao | 5bf2a7e | 2012-10-29 12:53:27 -0700 | [diff] [blame] | 966 | msm_gpiomux_install(msm_mhl_configs, ARRAY_SIZE(msm_mhl_configs)); |
Stepan Moskovchenko | 95108b8 | 2012-11-27 14:28:11 -0800 | [diff] [blame] | 967 | |
Damir Didjusto | 04d3c36 | 2013-01-07 14:30:53 -0800 | [diff] [blame] | 968 | msm_gpiomux_install(msm8974_pri_auxpcm_configs, |
| 969 | ARRAY_SIZE(msm8974_pri_auxpcm_configs)); |
| 970 | |
Stepan Moskovchenko | 95108b8 | 2012-11-27 14:28:11 -0800 | [diff] [blame] | 971 | if (machine_is_msm8974_rumi()) |
| 972 | msm_gpiomux_install(msm_rumi_blsp_configs, |
| 973 | ARRAY_SIZE(msm_rumi_blsp_configs)); |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 974 | } |