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 | |
Saket Saurabh | eac5834 | 2013-02-05 12:20:18 +0530 | [diff] [blame] | 344 | static struct gpiomux_setting gpio_uart7_active_cfg = { |
| 345 | .func = GPIOMUX_FUNC_3, |
| 346 | .drv = GPIOMUX_DRV_8MA, |
| 347 | .pull = GPIOMUX_PULL_NONE, |
| 348 | }; |
| 349 | |
| 350 | static struct gpiomux_setting gpio_uart7_suspend_cfg = { |
| 351 | .func = GPIOMUX_FUNC_GPIO, |
| 352 | .drv = GPIOMUX_DRV_2MA, |
| 353 | .pull = GPIOMUX_PULL_DOWN, |
| 354 | }; |
| 355 | |
| 356 | static struct msm_gpiomux_config msm_blsp2_uart7_configs[] __initdata = { |
| 357 | { |
| 358 | .gpio = 41, /* BLSP2 UART7 TX */ |
| 359 | .settings = { |
| 360 | [GPIOMUX_ACTIVE] = &gpio_uart7_active_cfg, |
| 361 | [GPIOMUX_SUSPENDED] = &gpio_uart7_suspend_cfg, |
| 362 | }, |
| 363 | }, |
| 364 | { |
| 365 | .gpio = 42, /* BLSP2 UART7 RX */ |
| 366 | .settings = { |
| 367 | [GPIOMUX_ACTIVE] = &gpio_uart7_active_cfg, |
| 368 | [GPIOMUX_SUSPENDED] = &gpio_uart7_suspend_cfg, |
| 369 | }, |
| 370 | }, |
| 371 | { |
| 372 | .gpio = 43, /* BLSP2 UART7 CTS */ |
| 373 | .settings = { |
| 374 | [GPIOMUX_ACTIVE] = &gpio_uart7_active_cfg, |
| 375 | [GPIOMUX_SUSPENDED] = &gpio_uart7_suspend_cfg, |
| 376 | }, |
| 377 | }, |
| 378 | { |
| 379 | .gpio = 44, /* BLSP2 UART7 RFR */ |
| 380 | .settings = { |
| 381 | [GPIOMUX_ACTIVE] = &gpio_uart7_active_cfg, |
| 382 | [GPIOMUX_SUSPENDED] = &gpio_uart7_suspend_cfg, |
| 383 | }, |
| 384 | }, |
| 385 | }; |
| 386 | |
Stepan Moskovchenko | 95108b8 | 2012-11-27 14:28:11 -0800 | [diff] [blame] | 387 | static struct msm_gpiomux_config msm_rumi_blsp_configs[] __initdata = { |
| 388 | { |
| 389 | .gpio = 45, /* BLSP2 UART8 TX */ |
| 390 | .settings = { |
| 391 | [GPIOMUX_SUSPENDED] = &gpio_uart_config, |
| 392 | }, |
| 393 | }, |
| 394 | { |
| 395 | .gpio = 46, /* BLSP2 UART8 RX */ |
| 396 | .settings = { |
| 397 | [GPIOMUX_SUSPENDED] = &gpio_uart_config, |
| 398 | }, |
| 399 | }, |
| 400 | }; |
| 401 | |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 402 | static struct msm_gpiomux_config msm_blsp_configs[] __initdata = { |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 403 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
| 404 | { |
| 405 | .gpio = 0, /* BLSP1 QUP SPI_DATA_MOSI */ |
| 406 | .settings = { |
| 407 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 408 | }, |
| 409 | }, |
| 410 | { |
| 411 | .gpio = 1, /* BLSP1 QUP SPI_DATA_MISO */ |
| 412 | .settings = { |
| 413 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 414 | }, |
| 415 | }, |
| 416 | { |
| 417 | .gpio = 3, /* BLSP1 QUP SPI_CLK */ |
| 418 | .settings = { |
| 419 | [GPIOMUX_SUSPENDED] = &gpio_spi_config, |
| 420 | }, |
| 421 | }, |
| 422 | { |
Subbaraman Narayanamurthy | 3f93ab1 | 2012-08-17 19:39:47 -0700 | [diff] [blame] | 423 | .gpio = 9, /* BLSP1 QUP SPI_CS2A_N */ |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 424 | .settings = { |
Subbaraman Narayanamurthy | 3f93ab1 | 2012-08-17 19:39:47 -0700 | [diff] [blame] | 425 | [GPIOMUX_SUSPENDED] = &gpio_spi_cs2_config, |
| 426 | }, |
| 427 | }, |
| 428 | { |
| 429 | .gpio = 8, /* BLSP1 QUP SPI_CS1_N */ |
| 430 | .settings = { |
| 431 | [GPIOMUX_SUSPENDED] = &gpio_spi_cs1_config, |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 432 | }, |
| 433 | }, |
| 434 | #endif |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 435 | { |
Chandan Uddaraju | 88b26d7 | 2012-08-13 22:28:44 -0700 | [diff] [blame] | 436 | .gpio = 58, |
| 437 | .settings = { |
| 438 | [GPIOMUX_ACTIVE] = &lcd_en_act_cfg, |
| 439 | [GPIOMUX_SUSPENDED] = &lcd_en_sus_cfg, |
| 440 | }, |
| 441 | }, |
| 442 | { |
Amy Maloche | bc7e967 | 2012-08-15 10:30:40 -0700 | [diff] [blame] | 443 | .gpio = 6, /* BLSP1 QUP2 I2C_DAT */ |
| 444 | .settings = { |
| 445 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 446 | }, |
| 447 | }, |
| 448 | { |
| 449 | .gpio = 7, /* BLSP1 QUP2 I2C_CLK */ |
| 450 | .settings = { |
| 451 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 452 | }, |
| 453 | }, |
| 454 | { |
Jin Hong | a04caaa | 2012-05-23 10:28:27 -0700 | [diff] [blame] | 455 | .gpio = 83, /* BLSP11 QUP I2C_DAT */ |
| 456 | .settings = { |
| 457 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 458 | }, |
| 459 | }, |
| 460 | { |
| 461 | .gpio = 84, /* BLSP11 QUP I2C_CLK */ |
| 462 | .settings = { |
| 463 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 464 | }, |
| 465 | }, |
| 466 | { |
Stepan Moskovchenko | 5269b60 | 2012-08-08 17:57:09 -0700 | [diff] [blame] | 467 | .gpio = 4, /* BLSP2 UART TX */ |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 468 | .settings = { |
| 469 | [GPIOMUX_SUSPENDED] = &gpio_uart_config, |
| 470 | }, |
| 471 | }, |
| 472 | { |
Stepan Moskovchenko | 5269b60 | 2012-08-08 17:57:09 -0700 | [diff] [blame] | 473 | .gpio = 5, /* BLSP2 UART RX */ |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 474 | .settings = { |
| 475 | [GPIOMUX_SUSPENDED] = &gpio_uart_config, |
| 476 | }, |
| 477 | }, |
Sagar Dharia | e0bb650 | 2012-08-10 20:25:51 -0600 | [diff] [blame] | 478 | { |
| 479 | .gpio = 53, /* BLSP2 QUP4 SPI_DATA_MOSI */ |
| 480 | .settings = { |
Pawan Kumar Nimmagadda | befacac | 2013-01-23 15:36:28 -0800 | [diff] [blame] | 481 | [GPIOMUX_ACTIVE] = &gpio_spi_config, |
| 482 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Sagar Dharia | e0bb650 | 2012-08-10 20:25:51 -0600 | [diff] [blame] | 483 | }, |
| 484 | }, |
| 485 | { |
| 486 | .gpio = 54, /* BLSP2 QUP4 SPI_DATA_MISO */ |
| 487 | .settings = { |
Pawan Kumar Nimmagadda | befacac | 2013-01-23 15:36:28 -0800 | [diff] [blame] | 488 | [GPIOMUX_ACTIVE] = &gpio_spi_config, |
| 489 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Sagar Dharia | e0bb650 | 2012-08-10 20:25:51 -0600 | [diff] [blame] | 490 | }, |
| 491 | }, |
| 492 | { |
| 493 | .gpio = 56, /* BLSP2 QUP4 SPI_CLK */ |
| 494 | .settings = { |
Pawan Kumar Nimmagadda | befacac | 2013-01-23 15:36:28 -0800 | [diff] [blame] | 495 | [GPIOMUX_ACTIVE] = &gpio_spi_config, |
| 496 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
Sagar Dharia | e0bb650 | 2012-08-10 20:25:51 -0600 | [diff] [blame] | 497 | }, |
| 498 | }, |
| 499 | { |
| 500 | .gpio = 55, /* BLSP2 QUP4 SPI_CS0_N */ |
| 501 | .settings = { |
Pawan Kumar Nimmagadda | befacac | 2013-01-23 15:36:28 -0800 | [diff] [blame] | 502 | [GPIOMUX_ACTIVE] = &gpio_spi_config, |
| 503 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
Sagar Dharia | e0bb650 | 2012-08-10 20:25:51 -0600 | [diff] [blame] | 504 | }, |
| 505 | }, |
Siddartha Mohanadoss | c4bc6ae | 2012-12-06 14:22:22 -0800 | [diff] [blame] | 506 | { |
| 507 | .gpio = 81, /* EPM enable */ |
| 508 | .settings = { |
| 509 | [GPIOMUX_SUSPENDED] = &gpio_epm_config, |
| 510 | }, |
| 511 | }, |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 512 | }; |
| 513 | |
Sagar Dharia | a8e6b0a | 2012-08-10 20:52:30 -0600 | [diff] [blame] | 514 | static struct msm_gpiomux_config msm8974_slimbus_config[] __initdata = { |
| 515 | { |
| 516 | .gpio = 70, /* slimbus clk */ |
| 517 | .settings = { |
| 518 | [GPIOMUX_SUSPENDED] = &slimbus, |
| 519 | }, |
| 520 | }, |
| 521 | { |
| 522 | .gpio = 71, /* slimbus data */ |
| 523 | .settings = { |
| 524 | [GPIOMUX_SUSPENDED] = &slimbus, |
| 525 | }, |
| 526 | }, |
| 527 | }; |
| 528 | |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 529 | static struct gpiomux_setting cam_settings[] = { |
| 530 | { |
Sreesudhan Ramakrish Ramkumar | 88c4a09 | 2012-09-07 23:43:46 -0700 | [diff] [blame] | 531 | .func = GPIOMUX_FUNC_1, /*active 1*/ /* 0 */ |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 532 | .drv = GPIOMUX_DRV_2MA, |
| 533 | .pull = GPIOMUX_PULL_NONE, |
| 534 | }, |
| 535 | |
| 536 | { |
Sreesudhan Ramakrish Ramkumar | 88c4a09 | 2012-09-07 23:43:46 -0700 | [diff] [blame] | 537 | .func = GPIOMUX_FUNC_1, /*suspend*/ /* 1 */ |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 538 | .drv = GPIOMUX_DRV_2MA, |
| 539 | .pull = GPIOMUX_PULL_DOWN, |
| 540 | }, |
| 541 | |
| 542 | { |
Sreesudhan Ramakrish Ramkumar | 88c4a09 | 2012-09-07 23:43:46 -0700 | [diff] [blame] | 543 | .func = GPIOMUX_FUNC_1, /*i2c suspend*/ /* 2 */ |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 544 | .drv = GPIOMUX_DRV_2MA, |
| 545 | .pull = GPIOMUX_PULL_KEEPER, |
| 546 | }, |
Sreesudhan Ramakrish Ramkumar | 88c4a09 | 2012-09-07 23:43:46 -0700 | [diff] [blame] | 547 | |
| 548 | { |
| 549 | .func = GPIOMUX_FUNC_GPIO, /*active 0*/ /* 3 */ |
| 550 | .drv = GPIOMUX_DRV_2MA, |
| 551 | .pull = GPIOMUX_PULL_NONE, |
| 552 | }, |
| 553 | |
| 554 | { |
| 555 | .func = GPIOMUX_FUNC_GPIO, /*suspend 0*/ /* 4 */ |
| 556 | .drv = GPIOMUX_DRV_2MA, |
| 557 | .pull = GPIOMUX_PULL_DOWN, |
| 558 | }, |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 559 | }; |
| 560 | |
Subhash Jadavani | 77e6cd7 | 2013-01-15 18:44:51 +0530 | [diff] [blame] | 561 | static struct gpiomux_setting sd_card_det_active_config = { |
Subhash Jadavani | 76aa7de | 2012-10-10 09:58:17 +0530 | [diff] [blame] | 562 | .func = GPIOMUX_FUNC_GPIO, |
| 563 | .drv = GPIOMUX_DRV_2MA, |
| 564 | .pull = GPIOMUX_PULL_NONE, |
| 565 | .dir = GPIOMUX_IN, |
| 566 | }; |
| 567 | |
Subhash Jadavani | 77e6cd7 | 2013-01-15 18:44:51 +0530 | [diff] [blame] | 568 | static struct gpiomux_setting sd_card_det_sleep_config = { |
| 569 | .func = GPIOMUX_FUNC_GPIO, |
| 570 | .drv = GPIOMUX_DRV_2MA, |
| 571 | .pull = GPIOMUX_PULL_UP, |
| 572 | .dir = GPIOMUX_IN, |
| 573 | }; |
| 574 | |
Subhash Jadavani | 76aa7de | 2012-10-10 09:58:17 +0530 | [diff] [blame] | 575 | static struct msm_gpiomux_config sd_card_det __initdata = { |
| 576 | .gpio = 62, |
| 577 | .settings = { |
Subhash Jadavani | 77e6cd7 | 2013-01-15 18:44:51 +0530 | [diff] [blame] | 578 | [GPIOMUX_ACTIVE] = &sd_card_det_active_config, |
| 579 | [GPIOMUX_SUSPENDED] = &sd_card_det_sleep_config, |
Subhash Jadavani | 76aa7de | 2012-10-10 09:58:17 +0530 | [diff] [blame] | 580 | }, |
| 581 | }; |
| 582 | |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 583 | static struct msm_gpiomux_config msm_sensor_configs[] __initdata = { |
| 584 | { |
| 585 | .gpio = 15, /* CAM_MCLK0 */ |
| 586 | .settings = { |
| 587 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 588 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 589 | }, |
| 590 | }, |
| 591 | { |
| 592 | .gpio = 16, /* CAM_MCLK1 */ |
| 593 | .settings = { |
| 594 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 595 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 596 | }, |
| 597 | }, |
| 598 | { |
| 599 | .gpio = 17, /* CAM_MCLK2 */ |
| 600 | .settings = { |
| 601 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 602 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 603 | }, |
| 604 | }, |
| 605 | { |
| 606 | .gpio = 18, /* WEBCAM1_RESET_N / CAM_MCLK3 */ |
| 607 | .settings = { |
Sreesudhan Ramakrish Ramkumar | 88c4a09 | 2012-09-07 23:43:46 -0700 | [diff] [blame] | 608 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 609 | [GPIOMUX_SUSPENDED] = &cam_settings[4], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 610 | }, |
| 611 | }, |
| 612 | { |
| 613 | .gpio = 19, /* CCI_I2C_SDA0 */ |
| 614 | .settings = { |
| 615 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 616 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 617 | }, |
| 618 | }, |
| 619 | { |
| 620 | .gpio = 20, /* CCI_I2C_SCL0 */ |
| 621 | .settings = { |
| 622 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 623 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 624 | }, |
| 625 | }, |
| 626 | { |
| 627 | .gpio = 21, /* CCI_I2C_SDA1 */ |
| 628 | .settings = { |
| 629 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 630 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 631 | }, |
| 632 | }, |
| 633 | { |
| 634 | .gpio = 22, /* CCI_I2C_SCL1 */ |
| 635 | .settings = { |
| 636 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 637 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 638 | }, |
| 639 | }, |
| 640 | { |
| 641 | .gpio = 23, /* FLASH_LED_EN */ |
| 642 | .settings = { |
| 643 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 644 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 645 | }, |
| 646 | }, |
| 647 | { |
| 648 | .gpio = 24, /* FLASH_LED_NOW */ |
| 649 | .settings = { |
| 650 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 651 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 652 | }, |
| 653 | }, |
| 654 | { |
| 655 | .gpio = 25, /* WEBCAM2_RESET_N */ |
| 656 | .settings = { |
| 657 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 658 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 659 | }, |
| 660 | }, |
| 661 | { |
| 662 | .gpio = 26, /* CAM_IRQ */ |
| 663 | .settings = { |
| 664 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 665 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 666 | }, |
| 667 | }, |
| 668 | { |
| 669 | .gpio = 27, /* OIS_SYNC */ |
| 670 | .settings = { |
| 671 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 672 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 673 | }, |
| 674 | }, |
| 675 | { |
| 676 | .gpio = 28, /* WEBCAM1_STANDBY */ |
| 677 | .settings = { |
| 678 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 679 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 680 | }, |
| 681 | }, |
| 682 | { |
| 683 | .gpio = 89, /* CAM1_STANDBY_N */ |
| 684 | .settings = { |
| 685 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 686 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 687 | }, |
| 688 | }, |
| 689 | { |
| 690 | .gpio = 90, /* CAM1_RST_N */ |
| 691 | .settings = { |
| 692 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 693 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 694 | }, |
| 695 | }, |
| 696 | { |
| 697 | .gpio = 91, /* CAM2_STANDBY_N */ |
| 698 | .settings = { |
| 699 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 700 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 701 | }, |
| 702 | }, |
| 703 | { |
| 704 | .gpio = 92, /* CAM2_RST_N */ |
| 705 | .settings = { |
| 706 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 707 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 708 | }, |
| 709 | }, |
| 710 | }; |
Damir Didjusto | 04d3c36 | 2013-01-07 14:30:53 -0800 | [diff] [blame] | 711 | |
| 712 | static struct gpiomux_setting pri_auxpcm_act_cfg = { |
| 713 | .func = GPIOMUX_FUNC_1, |
| 714 | .drv = GPIOMUX_DRV_8MA, |
| 715 | .pull = GPIOMUX_PULL_NONE, |
| 716 | }; |
| 717 | |
| 718 | |
| 719 | static struct gpiomux_setting pri_auxpcm_sus_cfg = { |
| 720 | .func = GPIOMUX_FUNC_1, |
| 721 | .drv = GPIOMUX_DRV_2MA, |
| 722 | .pull = GPIOMUX_PULL_DOWN, |
| 723 | }; |
| 724 | |
| 725 | static struct msm_gpiomux_config msm8974_pri_auxpcm_configs[] __initdata = { |
| 726 | { |
| 727 | .gpio = 65, |
| 728 | .settings = { |
| 729 | [GPIOMUX_SUSPENDED] = &pri_auxpcm_sus_cfg, |
| 730 | [GPIOMUX_ACTIVE] = &pri_auxpcm_act_cfg, |
| 731 | }, |
| 732 | }, |
| 733 | { |
| 734 | .gpio = 66, |
| 735 | .settings = { |
| 736 | [GPIOMUX_SUSPENDED] = &pri_auxpcm_sus_cfg, |
| 737 | [GPIOMUX_ACTIVE] = &pri_auxpcm_act_cfg, |
| 738 | }, |
| 739 | }, |
| 740 | { |
| 741 | .gpio = 67, |
| 742 | .settings = { |
| 743 | [GPIOMUX_SUSPENDED] = &pri_auxpcm_sus_cfg, |
| 744 | [GPIOMUX_ACTIVE] = &pri_auxpcm_act_cfg, |
| 745 | }, |
| 746 | }, |
| 747 | { |
| 748 | .gpio = 68, |
| 749 | .settings = { |
| 750 | [GPIOMUX_SUSPENDED] = &pri_auxpcm_sus_cfg, |
| 751 | [GPIOMUX_ACTIVE] = &pri_auxpcm_act_cfg, |
| 752 | }, |
| 753 | }, |
| 754 | }; |
| 755 | |
Sameer Thalappil | 8d686d4 | 2012-08-24 10:07:31 -0700 | [diff] [blame] | 756 | static struct msm_gpiomux_config wcnss_5wire_interface[] = { |
| 757 | { |
| 758 | .gpio = 36, |
| 759 | .settings = { |
| 760 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 761 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 762 | }, |
| 763 | }, |
| 764 | { |
| 765 | .gpio = 37, |
| 766 | .settings = { |
| 767 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 768 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 769 | }, |
| 770 | }, |
| 771 | { |
| 772 | .gpio = 38, |
| 773 | .settings = { |
| 774 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 775 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 776 | }, |
| 777 | }, |
| 778 | { |
| 779 | .gpio = 39, |
| 780 | .settings = { |
| 781 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 782 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 783 | }, |
| 784 | }, |
| 785 | { |
| 786 | .gpio = 40, |
| 787 | .settings = { |
| 788 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 789 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 790 | }, |
| 791 | }, |
| 792 | }; |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 793 | |
Joonwoo Park | 187e9cb | 2012-08-24 22:47:53 -0700 | [diff] [blame] | 794 | static struct msm_gpiomux_config msm_taiko_config[] __initdata = { |
| 795 | { |
| 796 | .gpio = 63, /* SYS_RST_N */ |
| 797 | .settings = { |
| 798 | [GPIOMUX_SUSPENDED] = &taiko_reset, |
| 799 | }, |
Joonwoo Park | eb84dc7 | 2012-09-12 10:22:49 -0700 | [diff] [blame] | 800 | }, |
| 801 | { |
| 802 | .gpio = 72, /* CDC_INT */ |
| 803 | .settings = { |
| 804 | [GPIOMUX_SUSPENDED] = &taiko_int, |
| 805 | }, |
| 806 | }, |
Joonwoo Park | 187e9cb | 2012-08-24 22:47:53 -0700 | [diff] [blame] | 807 | }; |
| 808 | |
Subhash Jadavani | 102f0ce | 2012-12-14 21:25:59 +0530 | [diff] [blame] | 809 | #ifdef CONFIG_MMC_MSM_SDC3_SUPPORT |
| 810 | static struct gpiomux_setting sdc3_clk_actv_cfg = { |
| 811 | .func = GPIOMUX_FUNC_2, |
| 812 | .drv = GPIOMUX_DRV_8MA, |
| 813 | .pull = GPIOMUX_PULL_NONE, |
| 814 | }; |
| 815 | |
| 816 | static struct gpiomux_setting sdc3_cmd_data_0_3_actv_cfg = { |
| 817 | .func = GPIOMUX_FUNC_2, |
| 818 | .drv = GPIOMUX_DRV_8MA, |
| 819 | .pull = GPIOMUX_PULL_UP, |
| 820 | }; |
| 821 | |
| 822 | static struct gpiomux_setting sdc3_suspend_cfg = { |
| 823 | .func = GPIOMUX_FUNC_GPIO, |
| 824 | .drv = GPIOMUX_DRV_2MA, |
| 825 | .pull = GPIOMUX_PULL_DOWN, |
| 826 | }; |
| 827 | |
| 828 | static struct gpiomux_setting sdc3_data_1_suspend_cfg = { |
| 829 | .func = GPIOMUX_FUNC_GPIO, |
| 830 | .drv = GPIOMUX_DRV_8MA, |
| 831 | .pull = GPIOMUX_PULL_UP, |
| 832 | }; |
| 833 | |
| 834 | static struct msm_gpiomux_config msm8974_sdc3_configs[] __initdata = { |
| 835 | { |
| 836 | /* DAT3 */ |
| 837 | .gpio = 35, |
| 838 | .settings = { |
| 839 | [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg, |
| 840 | [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg, |
| 841 | }, |
| 842 | }, |
| 843 | { |
| 844 | /* DAT2 */ |
| 845 | .gpio = 36, |
| 846 | .settings = { |
| 847 | [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg, |
| 848 | [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg, |
| 849 | }, |
| 850 | }, |
| 851 | { |
| 852 | /* DAT1 */ |
| 853 | .gpio = 37, |
| 854 | .settings = { |
| 855 | [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg, |
| 856 | [GPIOMUX_SUSPENDED] = &sdc3_data_1_suspend_cfg, |
| 857 | }, |
| 858 | }, |
| 859 | { |
| 860 | /* DAT0 */ |
| 861 | .gpio = 38, |
| 862 | .settings = { |
| 863 | [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg, |
| 864 | [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg, |
| 865 | }, |
| 866 | }, |
| 867 | { |
| 868 | /* CMD */ |
| 869 | .gpio = 39, |
| 870 | .settings = { |
| 871 | [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg, |
| 872 | [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg, |
| 873 | }, |
| 874 | }, |
| 875 | { |
| 876 | /* CLK */ |
| 877 | .gpio = 40, |
| 878 | .settings = { |
| 879 | [GPIOMUX_ACTIVE] = &sdc3_clk_actv_cfg, |
| 880 | [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg, |
| 881 | }, |
| 882 | }, |
| 883 | }; |
| 884 | |
| 885 | static void msm_gpiomux_sdc3_install(void) |
| 886 | { |
| 887 | msm_gpiomux_install(msm8974_sdc3_configs, |
| 888 | ARRAY_SIZE(msm8974_sdc3_configs)); |
| 889 | } |
| 890 | #else |
| 891 | static void msm_gpiomux_sdc3_install(void) {} |
| 892 | #endif /* CONFIG_MMC_MSM_SDC3_SUPPORT */ |
| 893 | |
| 894 | #ifdef CONFIG_MMC_MSM_SDC4_SUPPORT |
| 895 | static struct gpiomux_setting sdc4_clk_actv_cfg = { |
| 896 | .func = GPIOMUX_FUNC_2, |
| 897 | .drv = GPIOMUX_DRV_8MA, |
| 898 | .pull = GPIOMUX_PULL_NONE, |
| 899 | }; |
| 900 | |
| 901 | static struct gpiomux_setting sdc4_cmd_data_0_3_actv_cfg = { |
| 902 | .func = GPIOMUX_FUNC_2, |
| 903 | .drv = GPIOMUX_DRV_8MA, |
| 904 | .pull = GPIOMUX_PULL_UP, |
| 905 | }; |
| 906 | |
| 907 | static struct gpiomux_setting sdc4_suspend_cfg = { |
| 908 | .func = GPIOMUX_FUNC_GPIO, |
| 909 | .drv = GPIOMUX_DRV_2MA, |
| 910 | .pull = GPIOMUX_PULL_DOWN, |
| 911 | }; |
| 912 | |
| 913 | static struct gpiomux_setting sdc4_data_1_suspend_cfg = { |
| 914 | .func = GPIOMUX_FUNC_GPIO, |
| 915 | .drv = GPIOMUX_DRV_8MA, |
| 916 | .pull = GPIOMUX_PULL_UP, |
| 917 | }; |
| 918 | |
| 919 | static struct msm_gpiomux_config msm8974_sdc4_configs[] __initdata = { |
| 920 | { |
| 921 | /* DAT3 */ |
| 922 | .gpio = 92, |
| 923 | .settings = { |
| 924 | [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg, |
| 925 | [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg, |
| 926 | }, |
| 927 | }, |
| 928 | { |
| 929 | /* DAT2 */ |
| 930 | .gpio = 94, |
| 931 | .settings = { |
| 932 | [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg, |
| 933 | [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg, |
| 934 | }, |
| 935 | }, |
| 936 | { |
| 937 | /* DAT1 */ |
| 938 | .gpio = 95, |
| 939 | .settings = { |
| 940 | [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg, |
| 941 | [GPIOMUX_SUSPENDED] = &sdc4_data_1_suspend_cfg, |
| 942 | }, |
| 943 | }, |
| 944 | { |
| 945 | /* DAT0 */ |
| 946 | .gpio = 96, |
| 947 | .settings = { |
| 948 | [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg, |
| 949 | [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg, |
| 950 | }, |
| 951 | }, |
| 952 | { |
| 953 | /* CMD */ |
| 954 | .gpio = 91, |
| 955 | .settings = { |
| 956 | [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg, |
| 957 | [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg, |
| 958 | }, |
| 959 | }, |
| 960 | { |
| 961 | /* CLK */ |
| 962 | .gpio = 93, |
| 963 | .settings = { |
| 964 | [GPIOMUX_ACTIVE] = &sdc4_clk_actv_cfg, |
| 965 | [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg, |
| 966 | }, |
| 967 | }, |
| 968 | }; |
| 969 | |
| 970 | static void msm_gpiomux_sdc4_install(void) |
| 971 | { |
| 972 | msm_gpiomux_install(msm8974_sdc4_configs, |
| 973 | ARRAY_SIZE(msm8974_sdc4_configs)); |
| 974 | } |
| 975 | #else |
| 976 | static void msm_gpiomux_sdc4_install(void) {} |
| 977 | #endif /* CONFIG_MMC_MSM_SDC4_SUPPORT */ |
| 978 | |
Abhimanyu Kapur | 90ced6e | 2012-06-26 17:41:25 -0700 | [diff] [blame] | 979 | void __init msm_8974_init_gpiomux(void) |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 980 | { |
| 981 | int rc; |
| 982 | |
Rohit Vaswani | 341c203 | 2012-11-08 18:49:29 -0800 | [diff] [blame] | 983 | rc = msm_gpiomux_init_dt(); |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 984 | if (rc) { |
Rohit Vaswani | 341c203 | 2012-11-08 18:49:29 -0800 | [diff] [blame] | 985 | pr_err("%s failed %d\n", __func__, rc); |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 986 | return; |
| 987 | } |
| 988 | |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 989 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
| 990 | msm_gpiomux_install(msm_eth_configs, ARRAY_SIZE(msm_eth_configs)); |
| 991 | #endif |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 992 | msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs)); |
Saket Saurabh | eac5834 | 2013-02-05 12:20:18 +0530 | [diff] [blame] | 993 | msm_gpiomux_install(msm_blsp2_uart7_configs, |
| 994 | ARRAY_SIZE(msm_blsp2_uart7_configs)); |
Sameer Thalappil | 8d686d4 | 2012-08-24 10:07:31 -0700 | [diff] [blame] | 995 | msm_gpiomux_install(wcnss_5wire_interface, |
| 996 | ARRAY_SIZE(wcnss_5wire_interface)); |
Sagar Dharia | a8e6b0a | 2012-08-10 20:52:30 -0600 | [diff] [blame] | 997 | |
| 998 | msm_gpiomux_install(msm8974_slimbus_config, |
| 999 | ARRAY_SIZE(msm8974_slimbus_config)); |
| 1000 | |
Amy Maloche | 9e99a79 | 2012-08-15 23:27:51 -0700 | [diff] [blame] | 1001 | msm_gpiomux_install(msm_touch_configs, ARRAY_SIZE(msm_touch_configs)); |
Amy Maloche | 527acc4 | 2012-12-07 18:40:54 -0800 | [diff] [blame] | 1002 | msm_gpiomux_install(hap_lvl_shft_config, |
| 1003 | ARRAY_SIZE(hap_lvl_shft_config)); |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 1004 | |
| 1005 | msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs)); |
Joonwoo Park | 187e9cb | 2012-08-24 22:47:53 -0700 | [diff] [blame] | 1006 | |
Subhash Jadavani | 76aa7de | 2012-10-10 09:58:17 +0530 | [diff] [blame] | 1007 | msm_gpiomux_install(&sd_card_det, 1); |
Subhash Jadavani | 102f0ce | 2012-12-14 21:25:59 +0530 | [diff] [blame] | 1008 | msm_gpiomux_sdc3_install(); |
| 1009 | msm_gpiomux_sdc4_install(); |
Subhash Jadavani | 76aa7de | 2012-10-10 09:58:17 +0530 | [diff] [blame] | 1010 | |
Joonwoo Park | 187e9cb | 2012-08-24 22:47:53 -0700 | [diff] [blame] | 1011 | msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config)); |
Ujwal Patel | 74b5df4 | 2012-08-13 22:50:13 -0700 | [diff] [blame] | 1012 | |
Manu Gautam | ac7265b | 2012-11-21 11:49:15 +0530 | [diff] [blame] | 1013 | msm_gpiomux_install(msm_hsic_configs, ARRAY_SIZE(msm_hsic_configs)); |
| 1014 | msm_gpiomux_install(msm_hsic_hub_configs, |
| 1015 | ARRAY_SIZE(msm_hsic_hub_configs)); |
| 1016 | |
Ujwal Patel | 74b5df4 | 2012-08-13 22:50:13 -0700 | [diff] [blame] | 1017 | msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs)); |
Stepan Moskovchenko | ebd0541 | 2013-02-07 20:39:56 -0800 | [diff] [blame^] | 1018 | if (machine_is_msm8974_fluid()) |
| 1019 | msm_gpiomux_install(msm_mhl_configs, |
| 1020 | ARRAY_SIZE(msm_mhl_configs)); |
Stepan Moskovchenko | 95108b8 | 2012-11-27 14:28:11 -0800 | [diff] [blame] | 1021 | |
Damir Didjusto | 04d3c36 | 2013-01-07 14:30:53 -0800 | [diff] [blame] | 1022 | msm_gpiomux_install(msm8974_pri_auxpcm_configs, |
| 1023 | ARRAY_SIZE(msm8974_pri_auxpcm_configs)); |
| 1024 | |
Stepan Moskovchenko | 95108b8 | 2012-11-27 14:28:11 -0800 | [diff] [blame] | 1025 | if (machine_is_msm8974_rumi()) |
| 1026 | msm_gpiomux_install(msm_rumi_blsp_configs, |
| 1027 | ARRAY_SIZE(msm_rumi_blsp_configs)); |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 1028 | } |