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 | |
Yue Ma | 10d8875 | 2014-02-20 17:12:05 -0800 | [diff] [blame] | 14 | #include <linux/gpio.h> |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 15 | #include <linux/init.h> |
| 16 | #include <linux/ioport.h> |
| 17 | #include <mach/board.h> |
| 18 | #include <mach/gpio.h> |
| 19 | #include <mach/gpiomux.h> |
Stepan Moskovchenko | 95108b8 | 2012-11-27 14:28:11 -0800 | [diff] [blame] | 20 | #include <mach/socinfo.h> |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 21 | |
Subbaraman Narayanamurthy | 3f93ab1 | 2012-08-17 19:39:47 -0700 | [diff] [blame] | 22 | #define KS8851_IRQ_GPIO 94 |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 23 | |
Yue Ma | 10d8875 | 2014-02-20 17:12:05 -0800 | [diff] [blame] | 24 | #define WLAN_CLK 40 |
| 25 | #define WLAN_SET 39 |
| 26 | #define WLAN_DATA0 38 |
| 27 | #define WLAN_DATA1 37 |
| 28 | #define WLAN_DATA2 36 |
| 29 | |
Joel King | 15ccbfa | 2013-04-12 17:41:16 -0700 | [diff] [blame] | 30 | static struct gpiomux_setting ap2mdm_cfg = { |
| 31 | .func = GPIOMUX_FUNC_GPIO, |
Tirtha Kanti Ghosh | 2d554cc | 2014-01-20 12:26:57 -0800 | [diff] [blame] | 32 | .drv = GPIOMUX_DRV_2MA, |
Joel King | 15ccbfa | 2013-04-12 17:41:16 -0700 | [diff] [blame] | 33 | .pull = GPIOMUX_PULL_NONE, |
Tirtha Kanti Ghosh | 2d554cc | 2014-01-20 12:26:57 -0800 | [diff] [blame] | 34 | .dir = GPIOMUX_OUT_LOW, |
Joel King | 15ccbfa | 2013-04-12 17:41:16 -0700 | [diff] [blame] | 35 | }; |
| 36 | |
| 37 | static struct gpiomux_setting mdm2ap_status_cfg = { |
| 38 | .func = GPIOMUX_FUNC_GPIO, |
Tirtha Kanti Ghosh | 2d554cc | 2014-01-20 12:26:57 -0800 | [diff] [blame] | 39 | .drv = GPIOMUX_DRV_2MA, |
| 40 | .pull = GPIOMUX_PULL_NONE, |
| 41 | .dir = GPIOMUX_OUT_LOW, |
Joel King | 15ccbfa | 2013-04-12 17:41:16 -0700 | [diff] [blame] | 42 | }; |
| 43 | |
| 44 | static struct gpiomux_setting mdm2ap_errfatal_cfg = { |
| 45 | .func = GPIOMUX_FUNC_GPIO, |
Tirtha Kanti Ghosh | 2d554cc | 2014-01-20 12:26:57 -0800 | [diff] [blame] | 46 | .drv = GPIOMUX_DRV_2MA, |
| 47 | .pull = GPIOMUX_PULL_NONE, |
| 48 | .dir = GPIOMUX_OUT_LOW, |
Joel King | 15ccbfa | 2013-04-12 17:41:16 -0700 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | static struct gpiomux_setting mdm2ap_pblrdy = { |
| 52 | .func = GPIOMUX_FUNC_GPIO, |
Tirtha Kanti Ghosh | 2d554cc | 2014-01-20 12:26:57 -0800 | [diff] [blame] | 53 | .drv = GPIOMUX_DRV_2MA, |
Joel King | 15ccbfa | 2013-04-12 17:41:16 -0700 | [diff] [blame] | 54 | .pull = GPIOMUX_PULL_NONE, |
| 55 | .dir = GPIOMUX_IN, |
| 56 | }; |
| 57 | |
| 58 | |
| 59 | static struct gpiomux_setting ap2mdm_soft_reset_cfg = { |
| 60 | .func = GPIOMUX_FUNC_GPIO, |
Tirtha Kanti Ghosh | 2d554cc | 2014-01-20 12:26:57 -0800 | [diff] [blame] | 61 | .drv = GPIOMUX_DRV_2MA, |
Joel King | 15ccbfa | 2013-04-12 17:41:16 -0700 | [diff] [blame] | 62 | .pull = GPIOMUX_PULL_NONE, |
Tirtha Kanti Ghosh | 2d554cc | 2014-01-20 12:26:57 -0800 | [diff] [blame] | 63 | .dir = GPIOMUX_OUT_LOW, |
Joel King | 15ccbfa | 2013-04-12 17:41:16 -0700 | [diff] [blame] | 64 | }; |
| 65 | |
| 66 | static struct gpiomux_setting ap2mdm_wakeup = { |
| 67 | .func = GPIOMUX_FUNC_GPIO, |
Tirtha Kanti Ghosh | 2d554cc | 2014-01-20 12:26:57 -0800 | [diff] [blame] | 68 | .drv = GPIOMUX_DRV_2MA, |
| 69 | .pull = GPIOMUX_PULL_NONE, |
| 70 | .dir = GPIOMUX_OUT_LOW, |
Joel King | 15ccbfa | 2013-04-12 17:41:16 -0700 | [diff] [blame] | 71 | }; |
| 72 | |
| 73 | static struct msm_gpiomux_config mdm_configs[] __initdata = { |
| 74 | /* AP2MDM_STATUS */ |
| 75 | { |
| 76 | .gpio = 105, |
| 77 | .settings = { |
| 78 | [GPIOMUX_SUSPENDED] = &ap2mdm_cfg, |
| 79 | } |
| 80 | }, |
| 81 | /* MDM2AP_STATUS */ |
| 82 | { |
| 83 | .gpio = 46, |
| 84 | .settings = { |
| 85 | [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg, |
| 86 | } |
| 87 | }, |
| 88 | /* MDM2AP_ERRFATAL */ |
| 89 | { |
| 90 | .gpio = 82, |
| 91 | .settings = { |
| 92 | [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg, |
| 93 | } |
| 94 | }, |
| 95 | /* AP2MDM_ERRFATAL */ |
| 96 | { |
| 97 | .gpio = 106, |
| 98 | .settings = { |
| 99 | [GPIOMUX_SUSPENDED] = &ap2mdm_cfg, |
| 100 | } |
| 101 | }, |
| 102 | /* AP2MDM_SOFT_RESET, aka AP2MDM_PON_RESET_N */ |
| 103 | { |
| 104 | .gpio = 24, |
| 105 | .settings = { |
| 106 | [GPIOMUX_SUSPENDED] = &ap2mdm_soft_reset_cfg, |
| 107 | } |
| 108 | }, |
| 109 | /* AP2MDM_WAKEUP */ |
| 110 | { |
| 111 | .gpio = 104, |
| 112 | .settings = { |
| 113 | [GPIOMUX_SUSPENDED] = &ap2mdm_wakeup, |
| 114 | } |
| 115 | }, |
| 116 | /* MDM2AP_PBL_READY*/ |
| 117 | { |
| 118 | .gpio = 80, |
| 119 | .settings = { |
| 120 | [GPIOMUX_SUSPENDED] = &mdm2ap_pblrdy, |
| 121 | } |
| 122 | }, |
| 123 | }; |
| 124 | |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 125 | static struct gpiomux_setting gpio_uart_config = { |
| 126 | .func = GPIOMUX_FUNC_2, |
| 127 | .drv = GPIOMUX_DRV_16MA, |
| 128 | .pull = GPIOMUX_PULL_NONE, |
| 129 | .dir = GPIOMUX_OUT_HIGH, |
| 130 | }; |
| 131 | |
Sagar Dharia | a8e6b0a | 2012-08-10 20:52:30 -0600 | [diff] [blame] | 132 | static struct gpiomux_setting slimbus = { |
| 133 | .func = GPIOMUX_FUNC_1, |
| 134 | .drv = GPIOMUX_DRV_8MA, |
| 135 | .pull = GPIOMUX_PULL_KEEPER, |
| 136 | }; |
| 137 | |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 138 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
| 139 | static struct gpiomux_setting gpio_eth_config = { |
Subbaraman Narayanamurthy | 3f93ab1 | 2012-08-17 19:39:47 -0700 | [diff] [blame] | 140 | .pull = GPIOMUX_PULL_UP, |
| 141 | .drv = GPIOMUX_DRV_2MA, |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 142 | .func = GPIOMUX_FUNC_GPIO, |
| 143 | }; |
| 144 | |
Subbaraman Narayanamurthy | 3f93ab1 | 2012-08-17 19:39:47 -0700 | [diff] [blame] | 145 | static struct gpiomux_setting gpio_spi_cs2_config = { |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 146 | .func = GPIOMUX_FUNC_4, |
Subbaraman Narayanamurthy | 3f93ab1 | 2012-08-17 19:39:47 -0700 | [diff] [blame] | 147 | .drv = GPIOMUX_DRV_6MA, |
| 148 | .pull = GPIOMUX_PULL_DOWN, |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 149 | }; |
| 150 | |
| 151 | static struct gpiomux_setting gpio_spi_config = { |
| 152 | .func = GPIOMUX_FUNC_1, |
| 153 | .drv = GPIOMUX_DRV_12MA, |
| 154 | .pull = GPIOMUX_PULL_NONE, |
| 155 | }; |
Sana Venkat Raju | e53161a | 2013-09-17 16:33:26 +0530 | [diff] [blame] | 156 | static struct gpiomux_setting gpio_spi_susp_config = { |
| 157 | .func = GPIOMUX_FUNC_GPIO, |
| 158 | .drv = GPIOMUX_DRV_2MA, |
| 159 | .pull = GPIOMUX_PULL_DOWN, |
| 160 | }; |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 161 | |
Subbaraman Narayanamurthy | 3f93ab1 | 2012-08-17 19:39:47 -0700 | [diff] [blame] | 162 | static struct gpiomux_setting gpio_spi_cs1_config = { |
| 163 | .func = GPIOMUX_FUNC_GPIO, |
| 164 | .drv = GPIOMUX_DRV_6MA, |
| 165 | .pull = GPIOMUX_PULL_UP, |
| 166 | }; |
| 167 | |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 168 | static struct msm_gpiomux_config msm_eth_configs[] = { |
| 169 | { |
| 170 | .gpio = KS8851_IRQ_GPIO, |
| 171 | .settings = { |
| 172 | [GPIOMUX_SUSPENDED] = &gpio_eth_config, |
| 173 | } |
| 174 | }, |
| 175 | }; |
| 176 | #endif |
Sameer Thalappil | 8d686d4 | 2012-08-24 10:07:31 -0700 | [diff] [blame] | 177 | |
Pawan Kumar Nimmagadda | befacac | 2013-01-23 15:36:28 -0800 | [diff] [blame] | 178 | static struct gpiomux_setting gpio_suspend_config[] = { |
| 179 | { |
| 180 | .func = GPIOMUX_FUNC_GPIO, /* IN-NP */ |
| 181 | .drv = GPIOMUX_DRV_2MA, |
| 182 | .pull = GPIOMUX_PULL_NONE, |
| 183 | }, |
| 184 | { |
| 185 | .func = GPIOMUX_FUNC_GPIO, /* O-LOW */ |
| 186 | .drv = GPIOMUX_DRV_2MA, |
| 187 | .pull = GPIOMUX_PULL_NONE, |
| 188 | .dir = GPIOMUX_OUT_LOW, |
| 189 | }, |
| 190 | }; |
| 191 | |
Siddartha Mohanadoss | c4bc6ae | 2012-12-06 14:22:22 -0800 | [diff] [blame] | 192 | static struct gpiomux_setting gpio_epm_config = { |
| 193 | .func = GPIOMUX_FUNC_GPIO, |
| 194 | .drv = GPIOMUX_DRV_2MA, |
Siddartha Mohanadoss | 4613d8b | 2013-07-08 14:44:57 -0700 | [diff] [blame] | 195 | .pull = GPIOMUX_PULL_NONE, |
| 196 | .dir = GPIOMUX_OUT_HIGH, |
Siddartha Mohanadoss | c4bc6ae | 2012-12-06 14:22:22 -0800 | [diff] [blame] | 197 | }; |
| 198 | |
Siddartha Mohanadoss | 03e04b5 | 2013-06-11 14:46:59 -0700 | [diff] [blame] | 199 | static struct gpiomux_setting gpio_epm_marker_config = { |
| 200 | .func = GPIOMUX_FUNC_GPIO, |
Siddartha Mohanadoss | 8164ef8 | 2013-07-12 14:07:20 -0700 | [diff] [blame] | 201 | .drv = GPIOMUX_DRV_2MA, |
| 202 | .pull = GPIOMUX_PULL_NONE, |
| 203 | .dir = GPIOMUX_OUT_HIGH, |
Siddartha Mohanadoss | 03e04b5 | 2013-06-11 14:46:59 -0700 | [diff] [blame] | 204 | }; |
| 205 | |
Sameer Thalappil | 8d686d4 | 2012-08-24 10:07:31 -0700 | [diff] [blame] | 206 | static struct gpiomux_setting wcnss_5wire_suspend_cfg = { |
| 207 | .func = GPIOMUX_FUNC_GPIO, |
| 208 | .drv = GPIOMUX_DRV_2MA, |
| 209 | .pull = GPIOMUX_PULL_UP, |
| 210 | }; |
| 211 | |
| 212 | static struct gpiomux_setting wcnss_5wire_active_cfg = { |
| 213 | .func = GPIOMUX_FUNC_1, |
| 214 | .drv = GPIOMUX_DRV_6MA, |
| 215 | .pull = GPIOMUX_PULL_DOWN, |
| 216 | }; |
| 217 | |
Yue Ma | 10d8875 | 2014-02-20 17:12:05 -0800 | [diff] [blame] | 218 | static struct gpiomux_setting wcnss_5gpio_suspend_cfg = { |
| 219 | .func = GPIOMUX_FUNC_GPIO, |
| 220 | .drv = GPIOMUX_DRV_2MA, |
| 221 | .pull = GPIOMUX_PULL_UP, |
| 222 | }; |
| 223 | |
| 224 | static struct gpiomux_setting wcnss_5gpio_active_cfg = { |
| 225 | .func = GPIOMUX_FUNC_GPIO, |
| 226 | .drv = GPIOMUX_DRV_6MA, |
| 227 | .pull = GPIOMUX_PULL_DOWN, |
| 228 | }; |
| 229 | |
Ram Mohan Korukonda | 56ac523 | 2013-03-20 23:48:34 +0530 | [diff] [blame] | 230 | static struct gpiomux_setting ath_gpio_active_cfg = { |
| 231 | .func = GPIOMUX_FUNC_GPIO, |
| 232 | .drv = GPIOMUX_DRV_2MA, |
| 233 | .pull = GPIOMUX_PULL_UP, |
| 234 | }; |
| 235 | |
| 236 | static struct gpiomux_setting ath_gpio_suspend_cfg = { |
| 237 | .func = GPIOMUX_FUNC_GPIO, |
| 238 | .drv = GPIOMUX_DRV_2MA, |
| 239 | .pull = GPIOMUX_PULL_DOWN, |
| 240 | }; |
| 241 | |
Jin Hong | a04caaa | 2012-05-23 10:28:27 -0700 | [diff] [blame] | 242 | static struct gpiomux_setting gpio_i2c_config = { |
| 243 | .func = GPIOMUX_FUNC_3, |
Gilad Avidov | b7d8bb1 | 2012-11-09 16:30:37 -0700 | [diff] [blame] | 244 | /* |
| 245 | * Please keep I2C GPIOs drive-strength at minimum (2ma). It is a |
| 246 | * workaround for HW issue of glitches caused by rapid GPIO current- |
| 247 | * change. |
| 248 | */ |
| 249 | .drv = GPIOMUX_DRV_2MA, |
Jin Hong | a04caaa | 2012-05-23 10:28:27 -0700 | [diff] [blame] | 250 | .pull = GPIOMUX_PULL_NONE, |
| 251 | }; |
| 252 | |
Amy Maloche | 0b29499 | 2013-08-29 10:29:54 -0700 | [diff] [blame] | 253 | static struct gpiomux_setting gpio_i2c_act_config = { |
| 254 | .func = GPIOMUX_FUNC_3, |
| 255 | /* |
| 256 | * Please keep I2C GPIOs drive-strength at minimum (2ma). It is a |
| 257 | * workaround for HW issue of glitches caused by rapid GPIO current- |
| 258 | * change. |
| 259 | */ |
| 260 | .drv = GPIOMUX_DRV_2MA, |
| 261 | .pull = GPIOMUX_PULL_UP, |
| 262 | }; |
| 263 | |
Chandan Uddaraju | 88b26d7 | 2012-08-13 22:28:44 -0700 | [diff] [blame] | 264 | static struct gpiomux_setting lcd_en_act_cfg = { |
| 265 | .func = GPIOMUX_FUNC_GPIO, |
| 266 | .drv = GPIOMUX_DRV_8MA, |
| 267 | .pull = GPIOMUX_PULL_NONE, |
Siddhartha Agrawal | 6ab3e1c | 2013-02-22 18:30:37 -0800 | [diff] [blame] | 268 | .dir = GPIOMUX_OUT_HIGH, |
Chandan Uddaraju | 88b26d7 | 2012-08-13 22:28:44 -0700 | [diff] [blame] | 269 | }; |
| 270 | |
| 271 | static struct gpiomux_setting lcd_en_sus_cfg = { |
| 272 | .func = GPIOMUX_FUNC_GPIO, |
| 273 | .drv = GPIOMUX_DRV_2MA, |
| 274 | .pull = GPIOMUX_PULL_DOWN, |
| 275 | }; |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 276 | |
Amy Maloche | 9e99a79 | 2012-08-15 23:27:51 -0700 | [diff] [blame] | 277 | static struct gpiomux_setting atmel_resout_sus_cfg = { |
| 278 | .func = GPIOMUX_FUNC_GPIO, |
| 279 | .drv = GPIOMUX_DRV_6MA, |
| 280 | .pull = GPIOMUX_PULL_DOWN, |
| 281 | }; |
| 282 | |
| 283 | static struct gpiomux_setting atmel_resout_act_cfg = { |
| 284 | .func = GPIOMUX_FUNC_GPIO, |
| 285 | .drv = GPIOMUX_DRV_6MA, |
| 286 | .pull = GPIOMUX_PULL_UP, |
| 287 | }; |
| 288 | |
| 289 | static struct gpiomux_setting atmel_int_act_cfg = { |
| 290 | .func = GPIOMUX_FUNC_GPIO, |
| 291 | .drv = GPIOMUX_DRV_8MA, |
| 292 | .pull = GPIOMUX_PULL_UP, |
| 293 | }; |
| 294 | |
| 295 | static struct gpiomux_setting atmel_int_sus_cfg = { |
| 296 | .func = GPIOMUX_FUNC_GPIO, |
| 297 | .drv = GPIOMUX_DRV_2MA, |
| 298 | .pull = GPIOMUX_PULL_DOWN, |
| 299 | }; |
| 300 | |
Joonwoo Park | 187e9cb | 2012-08-24 22:47:53 -0700 | [diff] [blame] | 301 | static struct gpiomux_setting taiko_reset = { |
| 302 | .func = GPIOMUX_FUNC_GPIO, |
| 303 | .drv = GPIOMUX_DRV_6MA, |
| 304 | .pull = GPIOMUX_PULL_NONE, |
| 305 | .dir = GPIOMUX_OUT_LOW, |
| 306 | }; |
| 307 | |
Joonwoo Park | eb84dc7 | 2012-09-12 10:22:49 -0700 | [diff] [blame] | 308 | static struct gpiomux_setting taiko_int = { |
| 309 | .func = GPIOMUX_FUNC_GPIO, |
| 310 | .drv = GPIOMUX_DRV_2MA, |
| 311 | .pull = GPIOMUX_PULL_NONE, |
| 312 | }; |
Amy Maloche | 527acc4 | 2012-12-07 18:40:54 -0800 | [diff] [blame] | 313 | static struct gpiomux_setting hap_lvl_shft_suspended_config = { |
| 314 | .func = GPIOMUX_FUNC_GPIO, |
| 315 | .drv = GPIOMUX_DRV_2MA, |
| 316 | .pull = GPIOMUX_PULL_DOWN, |
| 317 | }; |
| 318 | |
| 319 | static struct gpiomux_setting hap_lvl_shft_active_config = { |
| 320 | .func = GPIOMUX_FUNC_GPIO, |
| 321 | .drv = GPIOMUX_DRV_8MA, |
| 322 | .pull = GPIOMUX_PULL_UP, |
| 323 | }; |
| 324 | static struct msm_gpiomux_config hap_lvl_shft_config[] __initdata = { |
| 325 | { |
| 326 | .gpio = 86, |
| 327 | .settings = { |
| 328 | [GPIOMUX_SUSPENDED] = &hap_lvl_shft_suspended_config, |
| 329 | [GPIOMUX_ACTIVE] = &hap_lvl_shft_active_config, |
| 330 | }, |
| 331 | }, |
| 332 | }; |
Joonwoo Park | eb84dc7 | 2012-09-12 10:22:49 -0700 | [diff] [blame] | 333 | |
Amy Maloche | 9e99a79 | 2012-08-15 23:27:51 -0700 | [diff] [blame] | 334 | static struct msm_gpiomux_config msm_touch_configs[] __initdata = { |
| 335 | { |
| 336 | .gpio = 60, /* TOUCH RESET */ |
| 337 | .settings = { |
| 338 | [GPIOMUX_ACTIVE] = &atmel_resout_act_cfg, |
| 339 | [GPIOMUX_SUSPENDED] = &atmel_resout_sus_cfg, |
| 340 | }, |
| 341 | }, |
| 342 | { |
| 343 | .gpio = 61, /* TOUCH IRQ */ |
| 344 | .settings = { |
| 345 | [GPIOMUX_ACTIVE] = &atmel_int_act_cfg, |
| 346 | [GPIOMUX_SUSPENDED] = &atmel_int_sus_cfg, |
| 347 | }, |
| 348 | }, |
| 349 | |
| 350 | }; |
Ujwal Patel | 74b5df4 | 2012-08-13 22:50:13 -0700 | [diff] [blame] | 351 | |
Manu Gautam | ac7265b | 2012-11-21 11:49:15 +0530 | [diff] [blame] | 352 | static struct gpiomux_setting hsic_sus_cfg = { |
| 353 | .func = GPIOMUX_FUNC_GPIO, |
| 354 | .drv = GPIOMUX_DRV_2MA, |
| 355 | .pull = GPIOMUX_PULL_DOWN, |
Manu Gautam | ac7265b | 2012-11-21 11:49:15 +0530 | [diff] [blame] | 356 | }; |
| 357 | |
| 358 | static struct gpiomux_setting hsic_act_cfg = { |
| 359 | .func = GPIOMUX_FUNC_1, |
| 360 | .drv = GPIOMUX_DRV_12MA, |
| 361 | .pull = GPIOMUX_PULL_NONE, |
| 362 | }; |
| 363 | |
| 364 | static struct gpiomux_setting hsic_hub_act_cfg = { |
| 365 | .func = GPIOMUX_FUNC_GPIO, |
| 366 | .drv = GPIOMUX_DRV_2MA, |
| 367 | .pull = GPIOMUX_PULL_UP, |
| 368 | .dir = GPIOMUX_IN, |
| 369 | }; |
| 370 | |
Vamsi Krishna | c6c16fe | 2013-03-11 15:54:41 -0700 | [diff] [blame] | 371 | static struct gpiomux_setting hsic_resume_act_cfg = { |
| 372 | .func = GPIOMUX_FUNC_GPIO, |
| 373 | .drv = GPIOMUX_DRV_2MA, |
| 374 | .pull = GPIOMUX_PULL_DOWN, |
| 375 | .dir = GPIOMUX_OUT_LOW, |
| 376 | }; |
| 377 | |
| 378 | static struct gpiomux_setting hsic_resume_susp_cfg = { |
| 379 | .func = GPIOMUX_FUNC_GPIO, |
| 380 | .drv = GPIOMUX_DRV_2MA, |
| 381 | .pull = GPIOMUX_PULL_NONE, |
| 382 | }; |
| 383 | |
Manu Gautam | ac7265b | 2012-11-21 11:49:15 +0530 | [diff] [blame] | 384 | static struct msm_gpiomux_config msm_hsic_configs[] = { |
| 385 | { |
| 386 | .gpio = 144, /*HSIC_STROBE */ |
| 387 | .settings = { |
| 388 | [GPIOMUX_ACTIVE] = &hsic_act_cfg, |
| 389 | [GPIOMUX_SUSPENDED] = &hsic_sus_cfg, |
| 390 | }, |
| 391 | }, |
| 392 | { |
| 393 | .gpio = 145, /* HSIC_DATA */ |
| 394 | .settings = { |
| 395 | [GPIOMUX_ACTIVE] = &hsic_act_cfg, |
| 396 | [GPIOMUX_SUSPENDED] = &hsic_sus_cfg, |
| 397 | }, |
| 398 | }, |
Vamsi Krishna | c6c16fe | 2013-03-11 15:54:41 -0700 | [diff] [blame] | 399 | { |
| 400 | .gpio = 80, |
| 401 | .settings = { |
| 402 | [GPIOMUX_ACTIVE] = &hsic_resume_act_cfg, |
| 403 | [GPIOMUX_SUSPENDED] = &hsic_resume_susp_cfg, |
| 404 | }, |
| 405 | }, |
Manu Gautam | ac7265b | 2012-11-21 11:49:15 +0530 | [diff] [blame] | 406 | }; |
| 407 | |
| 408 | static struct msm_gpiomux_config msm_hsic_hub_configs[] = { |
| 409 | { |
| 410 | .gpio = 50, /* HSIC_HUB_INT_N */ |
| 411 | .settings = { |
| 412 | [GPIOMUX_ACTIVE] = &hsic_hub_act_cfg, |
| 413 | [GPIOMUX_SUSPENDED] = &hsic_sus_cfg, |
| 414 | }, |
| 415 | }, |
| 416 | }; |
| 417 | |
Manoj Rao | 5bf2a7e | 2012-10-29 12:53:27 -0700 | [diff] [blame] | 418 | static struct gpiomux_setting mhl_suspend_config = { |
| 419 | .func = GPIOMUX_FUNC_GPIO, |
| 420 | .drv = GPIOMUX_DRV_2MA, |
| 421 | .pull = GPIOMUX_PULL_DOWN, |
| 422 | }; |
| 423 | |
| 424 | static struct gpiomux_setting mhl_active_1_cfg = { |
| 425 | .func = GPIOMUX_FUNC_1, |
| 426 | .drv = GPIOMUX_DRV_2MA, |
| 427 | .pull = GPIOMUX_PULL_UP, |
| 428 | .dir = GPIOMUX_OUT_HIGH, |
| 429 | }; |
| 430 | |
Ujwal Patel | 74b5df4 | 2012-08-13 22:50:13 -0700 | [diff] [blame] | 431 | static struct gpiomux_setting hdmi_suspend_cfg = { |
| 432 | .func = GPIOMUX_FUNC_GPIO, |
| 433 | .drv = GPIOMUX_DRV_2MA, |
| 434 | .pull = GPIOMUX_PULL_DOWN, |
| 435 | }; |
| 436 | |
| 437 | static struct gpiomux_setting hdmi_active_1_cfg = { |
| 438 | .func = GPIOMUX_FUNC_1, |
| 439 | .drv = GPIOMUX_DRV_2MA, |
| 440 | .pull = GPIOMUX_PULL_UP, |
| 441 | }; |
| 442 | |
| 443 | static struct gpiomux_setting hdmi_active_2_cfg = { |
| 444 | .func = GPIOMUX_FUNC_1, |
| 445 | .drv = GPIOMUX_DRV_16MA, |
| 446 | .pull = GPIOMUX_PULL_DOWN, |
| 447 | }; |
| 448 | |
Manoj Rao | 5bf2a7e | 2012-10-29 12:53:27 -0700 | [diff] [blame] | 449 | static struct msm_gpiomux_config msm_mhl_configs[] __initdata = { |
| 450 | { |
| 451 | /* mhl-sii8334 pwr */ |
| 452 | .gpio = 12, |
| 453 | .settings = { |
| 454 | [GPIOMUX_SUSPENDED] = &mhl_suspend_config, |
| 455 | [GPIOMUX_ACTIVE] = &mhl_active_1_cfg, |
| 456 | }, |
| 457 | }, |
| 458 | { |
| 459 | /* mhl-sii8334 intr */ |
| 460 | .gpio = 82, |
| 461 | .settings = { |
| 462 | [GPIOMUX_SUSPENDED] = &mhl_suspend_config, |
| 463 | [GPIOMUX_ACTIVE] = &mhl_active_1_cfg, |
| 464 | }, |
| 465 | }, |
Manoj Rao | 5bf2a7e | 2012-10-29 12:53:27 -0700 | [diff] [blame] | 466 | }; |
| 467 | |
| 468 | |
Ujwal Patel | 74b5df4 | 2012-08-13 22:50:13 -0700 | [diff] [blame] | 469 | static struct msm_gpiomux_config msm_hdmi_configs[] __initdata = { |
| 470 | { |
| 471 | .gpio = 31, |
| 472 | .settings = { |
| 473 | [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg, |
| 474 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 475 | }, |
| 476 | }, |
| 477 | { |
| 478 | .gpio = 32, |
| 479 | .settings = { |
| 480 | [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg, |
| 481 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 482 | }, |
| 483 | }, |
| 484 | { |
| 485 | .gpio = 33, |
| 486 | .settings = { |
| 487 | [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg, |
| 488 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 489 | }, |
| 490 | }, |
| 491 | { |
| 492 | .gpio = 34, |
| 493 | .settings = { |
| 494 | [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg, |
| 495 | [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg, |
| 496 | }, |
| 497 | }, |
| 498 | }; |
| 499 | |
Saket Saurabh | eac5834 | 2013-02-05 12:20:18 +0530 | [diff] [blame] | 500 | static struct gpiomux_setting gpio_uart7_active_cfg = { |
| 501 | .func = GPIOMUX_FUNC_3, |
| 502 | .drv = GPIOMUX_DRV_8MA, |
| 503 | .pull = GPIOMUX_PULL_NONE, |
| 504 | }; |
| 505 | |
| 506 | static struct gpiomux_setting gpio_uart7_suspend_cfg = { |
| 507 | .func = GPIOMUX_FUNC_GPIO, |
| 508 | .drv = GPIOMUX_DRV_2MA, |
| 509 | .pull = GPIOMUX_PULL_DOWN, |
| 510 | }; |
| 511 | |
| 512 | static struct msm_gpiomux_config msm_blsp2_uart7_configs[] __initdata = { |
| 513 | { |
| 514 | .gpio = 41, /* BLSP2 UART7 TX */ |
| 515 | .settings = { |
| 516 | [GPIOMUX_ACTIVE] = &gpio_uart7_active_cfg, |
| 517 | [GPIOMUX_SUSPENDED] = &gpio_uart7_suspend_cfg, |
| 518 | }, |
| 519 | }, |
| 520 | { |
| 521 | .gpio = 42, /* BLSP2 UART7 RX */ |
| 522 | .settings = { |
| 523 | [GPIOMUX_ACTIVE] = &gpio_uart7_active_cfg, |
| 524 | [GPIOMUX_SUSPENDED] = &gpio_uart7_suspend_cfg, |
| 525 | }, |
| 526 | }, |
| 527 | { |
| 528 | .gpio = 43, /* BLSP2 UART7 CTS */ |
| 529 | .settings = { |
| 530 | [GPIOMUX_ACTIVE] = &gpio_uart7_active_cfg, |
| 531 | [GPIOMUX_SUSPENDED] = &gpio_uart7_suspend_cfg, |
| 532 | }, |
| 533 | }, |
| 534 | { |
| 535 | .gpio = 44, /* BLSP2 UART7 RFR */ |
| 536 | .settings = { |
| 537 | [GPIOMUX_ACTIVE] = &gpio_uart7_active_cfg, |
| 538 | [GPIOMUX_SUSPENDED] = &gpio_uart7_suspend_cfg, |
| 539 | }, |
| 540 | }, |
| 541 | }; |
| 542 | |
Stepan Moskovchenko | 95108b8 | 2012-11-27 14:28:11 -0800 | [diff] [blame] | 543 | static struct msm_gpiomux_config msm_rumi_blsp_configs[] __initdata = { |
| 544 | { |
| 545 | .gpio = 45, /* BLSP2 UART8 TX */ |
| 546 | .settings = { |
| 547 | [GPIOMUX_SUSPENDED] = &gpio_uart_config, |
| 548 | }, |
| 549 | }, |
| 550 | { |
| 551 | .gpio = 46, /* BLSP2 UART8 RX */ |
| 552 | .settings = { |
| 553 | [GPIOMUX_SUSPENDED] = &gpio_uart_config, |
| 554 | }, |
| 555 | }, |
| 556 | }; |
| 557 | |
Siddhartha Agrawal | 6ab3e1c | 2013-02-22 18:30:37 -0800 | [diff] [blame] | 558 | static struct msm_gpiomux_config msm_lcd_configs[] __initdata = { |
| 559 | { |
| 560 | .gpio = 58, |
| 561 | .settings = { |
| 562 | [GPIOMUX_ACTIVE] = &lcd_en_act_cfg, |
| 563 | [GPIOMUX_SUSPENDED] = &lcd_en_sus_cfg, |
| 564 | }, |
| 565 | }, |
| 566 | }; |
| 567 | |
Siddartha Mohanadoss | 1f32be5 | 2013-05-17 13:29:50 -0700 | [diff] [blame] | 568 | static struct msm_gpiomux_config msm_epm_configs[] __initdata = { |
| 569 | { |
| 570 | .gpio = 81, /* EPM enable */ |
| 571 | .settings = { |
| 572 | [GPIOMUX_SUSPENDED] = &gpio_epm_config, |
| 573 | }, |
| 574 | }, |
Siddartha Mohanadoss | 03e04b5 | 2013-06-11 14:46:59 -0700 | [diff] [blame] | 575 | { |
| 576 | .gpio = 85, /* EPM MARKER2 */ |
| 577 | .settings = { |
| 578 | [GPIOMUX_SUSPENDED] = &gpio_epm_marker_config, |
| 579 | }, |
| 580 | }, |
| 581 | { |
| 582 | .gpio = 96, /* EPM MARKER1 */ |
| 583 | .settings = { |
| 584 | [GPIOMUX_SUSPENDED] = &gpio_epm_marker_config, |
| 585 | }, |
| 586 | }, |
Siddartha Mohanadoss | 1f32be5 | 2013-05-17 13:29:50 -0700 | [diff] [blame] | 587 | }; |
| 588 | |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 589 | static struct msm_gpiomux_config msm_blsp_configs[] __initdata = { |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 590 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
| 591 | { |
| 592 | .gpio = 0, /* BLSP1 QUP SPI_DATA_MOSI */ |
| 593 | .settings = { |
Sana Venkat Raju | e53161a | 2013-09-17 16:33:26 +0530 | [diff] [blame] | 594 | [GPIOMUX_ACTIVE] = &gpio_spi_config, |
| 595 | [GPIOMUX_SUSPENDED] = &gpio_spi_susp_config, |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 596 | }, |
| 597 | }, |
| 598 | { |
| 599 | .gpio = 1, /* BLSP1 QUP SPI_DATA_MISO */ |
| 600 | .settings = { |
Sana Venkat Raju | e53161a | 2013-09-17 16:33:26 +0530 | [diff] [blame] | 601 | [GPIOMUX_ACTIVE] = &gpio_spi_config, |
| 602 | [GPIOMUX_SUSPENDED] = &gpio_spi_susp_config, |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 603 | }, |
| 604 | }, |
| 605 | { |
| 606 | .gpio = 3, /* BLSP1 QUP SPI_CLK */ |
| 607 | .settings = { |
Sana Venkat Raju | e53161a | 2013-09-17 16:33:26 +0530 | [diff] [blame] | 608 | [GPIOMUX_ACTIVE] = &gpio_spi_config, |
| 609 | [GPIOMUX_SUSPENDED] = &gpio_spi_susp_config, |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 610 | }, |
| 611 | }, |
| 612 | { |
Subbaraman Narayanamurthy | 3f93ab1 | 2012-08-17 19:39:47 -0700 | [diff] [blame] | 613 | .gpio = 9, /* BLSP1 QUP SPI_CS2A_N */ |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 614 | .settings = { |
Sana Venkat Raju | e53161a | 2013-09-17 16:33:26 +0530 | [diff] [blame] | 615 | [GPIOMUX_ACTIVE] = &gpio_spi_cs2_config, |
| 616 | [GPIOMUX_SUSPENDED] = &gpio_spi_susp_config, |
Subbaraman Narayanamurthy | 3f93ab1 | 2012-08-17 19:39:47 -0700 | [diff] [blame] | 617 | }, |
| 618 | }, |
| 619 | { |
| 620 | .gpio = 8, /* BLSP1 QUP SPI_CS1_N */ |
| 621 | .settings = { |
Sana Venkat Raju | e53161a | 2013-09-17 16:33:26 +0530 | [diff] [blame] | 622 | [GPIOMUX_ACTIVE] = &gpio_spi_cs1_config, |
| 623 | [GPIOMUX_SUSPENDED] = &gpio_spi_susp_config, |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 624 | }, |
| 625 | }, |
| 626 | #endif |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 627 | { |
Amy Maloche | bc7e967 | 2012-08-15 10:30:40 -0700 | [diff] [blame] | 628 | .gpio = 6, /* BLSP1 QUP2 I2C_DAT */ |
| 629 | .settings = { |
| 630 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
Amy Maloche | 0b29499 | 2013-08-29 10:29:54 -0700 | [diff] [blame] | 631 | [GPIOMUX_ACTIVE] = &gpio_i2c_act_config, |
Amy Maloche | bc7e967 | 2012-08-15 10:30:40 -0700 | [diff] [blame] | 632 | }, |
| 633 | }, |
| 634 | { |
| 635 | .gpio = 7, /* BLSP1 QUP2 I2C_CLK */ |
| 636 | .settings = { |
| 637 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
Amy Maloche | 0b29499 | 2013-08-29 10:29:54 -0700 | [diff] [blame] | 638 | [GPIOMUX_ACTIVE] = &gpio_i2c_act_config, |
Amy Maloche | bc7e967 | 2012-08-15 10:30:40 -0700 | [diff] [blame] | 639 | }, |
| 640 | }, |
| 641 | { |
Jin Hong | a04caaa | 2012-05-23 10:28:27 -0700 | [diff] [blame] | 642 | .gpio = 83, /* BLSP11 QUP I2C_DAT */ |
| 643 | .settings = { |
| 644 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 645 | }, |
| 646 | }, |
| 647 | { |
| 648 | .gpio = 84, /* BLSP11 QUP I2C_CLK */ |
| 649 | .settings = { |
| 650 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 651 | }, |
| 652 | }, |
| 653 | { |
Stepan Moskovchenko | 5269b60 | 2012-08-08 17:57:09 -0700 | [diff] [blame] | 654 | .gpio = 4, /* BLSP2 UART TX */ |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 655 | .settings = { |
| 656 | [GPIOMUX_SUSPENDED] = &gpio_uart_config, |
| 657 | }, |
| 658 | }, |
| 659 | { |
Stepan Moskovchenko | 5269b60 | 2012-08-08 17:57:09 -0700 | [diff] [blame] | 660 | .gpio = 5, /* BLSP2 UART RX */ |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 661 | .settings = { |
| 662 | [GPIOMUX_SUSPENDED] = &gpio_uart_config, |
| 663 | }, |
| 664 | }, |
Houston Hoffman | fd2ff9f | 2013-12-02 20:26:56 -0800 | [diff] [blame] | 665 | { /* NFC */ |
| 666 | .gpio = 29, /* BLSP1 QUP6 I2C_DAT */ |
| 667 | .settings = { |
| 668 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 669 | }, |
| 670 | }, |
| 671 | { /* NFC */ |
| 672 | .gpio = 30, /* BLSP1 QUP6 I2C_CLK */ |
| 673 | .settings = { |
| 674 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 675 | }, |
| 676 | }, |
Sagar Dharia | e0bb650 | 2012-08-10 20:25:51 -0600 | [diff] [blame] | 677 | { |
| 678 | .gpio = 53, /* BLSP2 QUP4 SPI_DATA_MOSI */ |
| 679 | .settings = { |
Pawan Kumar Nimmagadda | befacac | 2013-01-23 15:36:28 -0800 | [diff] [blame] | 680 | [GPIOMUX_ACTIVE] = &gpio_spi_config, |
| 681 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Sagar Dharia | e0bb650 | 2012-08-10 20:25:51 -0600 | [diff] [blame] | 682 | }, |
| 683 | }, |
| 684 | { |
| 685 | .gpio = 54, /* BLSP2 QUP4 SPI_DATA_MISO */ |
| 686 | .settings = { |
Pawan Kumar Nimmagadda | befacac | 2013-01-23 15:36:28 -0800 | [diff] [blame] | 687 | [GPIOMUX_ACTIVE] = &gpio_spi_config, |
| 688 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Sagar Dharia | e0bb650 | 2012-08-10 20:25:51 -0600 | [diff] [blame] | 689 | }, |
| 690 | }, |
| 691 | { |
| 692 | .gpio = 56, /* BLSP2 QUP4 SPI_CLK */ |
| 693 | .settings = { |
Pawan Kumar Nimmagadda | befacac | 2013-01-23 15:36:28 -0800 | [diff] [blame] | 694 | [GPIOMUX_ACTIVE] = &gpio_spi_config, |
| 695 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
Sagar Dharia | e0bb650 | 2012-08-10 20:25:51 -0600 | [diff] [blame] | 696 | }, |
| 697 | }, |
| 698 | { |
| 699 | .gpio = 55, /* BLSP2 QUP4 SPI_CS0_N */ |
| 700 | .settings = { |
Pawan Kumar Nimmagadda | befacac | 2013-01-23 15:36:28 -0800 | [diff] [blame] | 701 | [GPIOMUX_ACTIVE] = &gpio_spi_config, |
| 702 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
Sagar Dharia | e0bb650 | 2012-08-10 20:25:51 -0600 | [diff] [blame] | 703 | }, |
| 704 | }, |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 705 | }; |
| 706 | |
Sagar Dharia | a8e6b0a | 2012-08-10 20:52:30 -0600 | [diff] [blame] | 707 | static struct msm_gpiomux_config msm8974_slimbus_config[] __initdata = { |
| 708 | { |
| 709 | .gpio = 70, /* slimbus clk */ |
| 710 | .settings = { |
| 711 | [GPIOMUX_SUSPENDED] = &slimbus, |
| 712 | }, |
| 713 | }, |
| 714 | { |
| 715 | .gpio = 71, /* slimbus data */ |
| 716 | .settings = { |
| 717 | [GPIOMUX_SUSPENDED] = &slimbus, |
| 718 | }, |
| 719 | }, |
| 720 | }; |
| 721 | |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 722 | static struct gpiomux_setting cam_settings[] = { |
| 723 | { |
Sreesudhan Ramakrish Ramkumar | 88c4a09 | 2012-09-07 23:43:46 -0700 | [diff] [blame] | 724 | .func = GPIOMUX_FUNC_1, /*active 1*/ /* 0 */ |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 725 | .drv = GPIOMUX_DRV_2MA, |
| 726 | .pull = GPIOMUX_PULL_NONE, |
| 727 | }, |
| 728 | |
| 729 | { |
Sreesudhan Ramakrish Ramkumar | 88c4a09 | 2012-09-07 23:43:46 -0700 | [diff] [blame] | 730 | .func = GPIOMUX_FUNC_1, /*suspend*/ /* 1 */ |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 731 | .drv = GPIOMUX_DRV_2MA, |
| 732 | .pull = GPIOMUX_PULL_DOWN, |
| 733 | }, |
| 734 | |
| 735 | { |
Sreesudhan Ramakrish Ramkumar | 88c4a09 | 2012-09-07 23:43:46 -0700 | [diff] [blame] | 736 | .func = GPIOMUX_FUNC_1, /*i2c suspend*/ /* 2 */ |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 737 | .drv = GPIOMUX_DRV_2MA, |
| 738 | .pull = GPIOMUX_PULL_KEEPER, |
| 739 | }, |
Sreesudhan Ramakrish Ramkumar | 88c4a09 | 2012-09-07 23:43:46 -0700 | [diff] [blame] | 740 | |
| 741 | { |
| 742 | .func = GPIOMUX_FUNC_GPIO, /*active 0*/ /* 3 */ |
| 743 | .drv = GPIOMUX_DRV_2MA, |
| 744 | .pull = GPIOMUX_PULL_NONE, |
| 745 | }, |
| 746 | |
| 747 | { |
| 748 | .func = GPIOMUX_FUNC_GPIO, /*suspend 0*/ /* 4 */ |
| 749 | .drv = GPIOMUX_DRV_2MA, |
| 750 | .pull = GPIOMUX_PULL_DOWN, |
| 751 | }, |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 752 | }; |
| 753 | |
Subhash Jadavani | 77e6cd7 | 2013-01-15 18:44:51 +0530 | [diff] [blame] | 754 | static struct gpiomux_setting sd_card_det_active_config = { |
Subhash Jadavani | 76aa7de | 2012-10-10 09:58:17 +0530 | [diff] [blame] | 755 | .func = GPIOMUX_FUNC_GPIO, |
| 756 | .drv = GPIOMUX_DRV_2MA, |
| 757 | .pull = GPIOMUX_PULL_NONE, |
| 758 | .dir = GPIOMUX_IN, |
| 759 | }; |
| 760 | |
Subhash Jadavani | 77e6cd7 | 2013-01-15 18:44:51 +0530 | [diff] [blame] | 761 | static struct gpiomux_setting sd_card_det_sleep_config = { |
| 762 | .func = GPIOMUX_FUNC_GPIO, |
| 763 | .drv = GPIOMUX_DRV_2MA, |
| 764 | .pull = GPIOMUX_PULL_UP, |
| 765 | .dir = GPIOMUX_IN, |
| 766 | }; |
| 767 | |
Subhash Jadavani | 76aa7de | 2012-10-10 09:58:17 +0530 | [diff] [blame] | 768 | static struct msm_gpiomux_config sd_card_det __initdata = { |
| 769 | .gpio = 62, |
| 770 | .settings = { |
Subhash Jadavani | 77e6cd7 | 2013-01-15 18:44:51 +0530 | [diff] [blame] | 771 | [GPIOMUX_ACTIVE] = &sd_card_det_active_config, |
| 772 | [GPIOMUX_SUSPENDED] = &sd_card_det_sleep_config, |
Subhash Jadavani | 76aa7de | 2012-10-10 09:58:17 +0530 | [diff] [blame] | 773 | }, |
| 774 | }; |
| 775 | |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 776 | static struct msm_gpiomux_config msm_sensor_configs[] __initdata = { |
| 777 | { |
| 778 | .gpio = 15, /* CAM_MCLK0 */ |
| 779 | .settings = { |
| 780 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 781 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 782 | }, |
| 783 | }, |
| 784 | { |
| 785 | .gpio = 16, /* CAM_MCLK1 */ |
| 786 | .settings = { |
| 787 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 788 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 789 | }, |
| 790 | }, |
| 791 | { |
| 792 | .gpio = 17, /* CAM_MCLK2 */ |
| 793 | .settings = { |
| 794 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 795 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 796 | }, |
| 797 | }, |
| 798 | { |
| 799 | .gpio = 18, /* WEBCAM1_RESET_N / CAM_MCLK3 */ |
| 800 | .settings = { |
Sreesudhan Ramakrish Ramkumar | 88c4a09 | 2012-09-07 23:43:46 -0700 | [diff] [blame] | 801 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 802 | [GPIOMUX_SUSPENDED] = &cam_settings[4], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 803 | }, |
| 804 | }, |
| 805 | { |
| 806 | .gpio = 19, /* CCI_I2C_SDA0 */ |
| 807 | .settings = { |
| 808 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 809 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 810 | }, |
| 811 | }, |
| 812 | { |
| 813 | .gpio = 20, /* CCI_I2C_SCL0 */ |
| 814 | .settings = { |
| 815 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 816 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 817 | }, |
| 818 | }, |
| 819 | { |
| 820 | .gpio = 21, /* CCI_I2C_SDA1 */ |
| 821 | .settings = { |
| 822 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 823 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 824 | }, |
| 825 | }, |
| 826 | { |
| 827 | .gpio = 22, /* CCI_I2C_SCL1 */ |
| 828 | .settings = { |
| 829 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 830 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 831 | }, |
| 832 | }, |
| 833 | { |
| 834 | .gpio = 23, /* FLASH_LED_EN */ |
| 835 | .settings = { |
| 836 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 837 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 838 | }, |
| 839 | }, |
| 840 | { |
| 841 | .gpio = 24, /* FLASH_LED_NOW */ |
| 842 | .settings = { |
| 843 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 844 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 845 | }, |
| 846 | }, |
| 847 | { |
| 848 | .gpio = 25, /* WEBCAM2_RESET_N */ |
| 849 | .settings = { |
Sreesudhan Ramakrish Ramkumar | a92d0b7 | 2013-03-12 23:39:07 -0700 | [diff] [blame] | 850 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 851 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 852 | }, |
| 853 | }, |
| 854 | { |
| 855 | .gpio = 26, /* CAM_IRQ */ |
| 856 | .settings = { |
| 857 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 858 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 859 | }, |
| 860 | }, |
| 861 | { |
| 862 | .gpio = 27, /* OIS_SYNC */ |
| 863 | .settings = { |
| 864 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 865 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 866 | }, |
| 867 | }, |
| 868 | { |
| 869 | .gpio = 28, /* WEBCAM1_STANDBY */ |
| 870 | .settings = { |
Sreesudhan Ramakrish Ramkumar | a92d0b7 | 2013-03-12 23:39:07 -0700 | [diff] [blame] | 871 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
Pawan Kumar Nimmagadda | 5362156 | 2013-01-28 13:11:44 -0800 | [diff] [blame] | 872 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 873 | }, |
| 874 | }, |
| 875 | { |
| 876 | .gpio = 89, /* CAM1_STANDBY_N */ |
| 877 | .settings = { |
Sreesudhan Ramakrish Ramkumar | a92d0b7 | 2013-03-12 23:39:07 -0700 | [diff] [blame] | 878 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 879 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 880 | }, |
| 881 | }, |
| 882 | { |
| 883 | .gpio = 90, /* CAM1_RST_N */ |
| 884 | .settings = { |
Sreesudhan Ramakrish Ramkumar | a92d0b7 | 2013-03-12 23:39:07 -0700 | [diff] [blame] | 885 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 886 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 887 | }, |
| 888 | }, |
| 889 | { |
| 890 | .gpio = 91, /* CAM2_STANDBY_N */ |
| 891 | .settings = { |
Sreesudhan Ramakrish Ramkumar | a92d0b7 | 2013-03-12 23:39:07 -0700 | [diff] [blame] | 892 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 893 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 894 | }, |
| 895 | }, |
| 896 | { |
| 897 | .gpio = 92, /* CAM2_RST_N */ |
| 898 | .settings = { |
Sreesudhan Ramakrish Ramkumar | a92d0b7 | 2013-03-12 23:39:07 -0700 | [diff] [blame] | 899 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 900 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 901 | }, |
| 902 | }, |
| 903 | }; |
Damir Didjusto | 04d3c36 | 2013-01-07 14:30:53 -0800 | [diff] [blame] | 904 | |
Ilia Lin | bcdb0fb | 2013-07-09 08:35:39 +0300 | [diff] [blame] | 905 | static struct msm_gpiomux_config msm_sensor_configs_dragonboard[] __initdata = { |
| 906 | { |
| 907 | .gpio = 15, /* CAM_MCLK0 */ |
| 908 | .settings = { |
| 909 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 910 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 911 | }, |
| 912 | }, |
| 913 | { |
| 914 | .gpio = 16, /* CAM_MCLK1 */ |
| 915 | .settings = { |
| 916 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 917 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 918 | }, |
| 919 | }, |
| 920 | { |
| 921 | .gpio = 17, /* CAM_MCLK2 */ |
| 922 | .settings = { |
| 923 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 924 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 925 | }, |
| 926 | }, |
| 927 | { |
| 928 | .gpio = 18, /* WEBCAM1_RESET_N / CAM_MCLK3 */ |
| 929 | .settings = { |
| 930 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 931 | [GPIOMUX_SUSPENDED] = &cam_settings[4], |
| 932 | }, |
| 933 | }, |
| 934 | { |
| 935 | .gpio = 19, /* CCI_I2C_SDA0 */ |
| 936 | .settings = { |
| 937 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 938 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
| 939 | }, |
| 940 | }, |
| 941 | { |
| 942 | .gpio = 20, /* CCI_I2C_SCL0 */ |
| 943 | .settings = { |
| 944 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 945 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
| 946 | }, |
| 947 | }, |
| 948 | { |
| 949 | .gpio = 21, /* CCI_I2C_SDA1 */ |
| 950 | .settings = { |
| 951 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 952 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
| 953 | }, |
| 954 | }, |
| 955 | { |
| 956 | .gpio = 22, /* CCI_I2C_SCL1 */ |
| 957 | .settings = { |
| 958 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 959 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
| 960 | }, |
| 961 | }, |
| 962 | { |
| 963 | .gpio = 23, /* FLASH_LED_EN */ |
| 964 | .settings = { |
| 965 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 966 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
| 967 | }, |
| 968 | }, |
| 969 | { |
| 970 | .gpio = 24, /* FLASH_LED_NOW */ |
| 971 | .settings = { |
| 972 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 973 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
| 974 | }, |
| 975 | }, |
| 976 | { |
| 977 | .gpio = 25, /* WEBCAM2_RESET_N */ |
| 978 | .settings = { |
| 979 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 980 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
| 981 | }, |
| 982 | }, |
| 983 | { |
| 984 | .gpio = 26, /* CAM_IRQ */ |
| 985 | .settings = { |
| 986 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 987 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 988 | }, |
| 989 | }, |
| 990 | { |
| 991 | .gpio = 27, /* OIS_SYNC */ |
| 992 | .settings = { |
| 993 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 994 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
| 995 | }, |
| 996 | }, |
| 997 | { |
| 998 | .gpio = 28, /* WEBCAM1_STANDBY */ |
| 999 | .settings = { |
| 1000 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 1001 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
| 1002 | }, |
| 1003 | }, |
| 1004 | { |
| 1005 | .gpio = 89, /* CAM1_STANDBY_N */ |
| 1006 | .settings = { |
| 1007 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 1008 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
| 1009 | }, |
| 1010 | }, |
| 1011 | { |
| 1012 | .gpio = 90, /* CAM1_RST_N */ |
| 1013 | .settings = { |
| 1014 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 1015 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
| 1016 | }, |
| 1017 | }, |
| 1018 | { |
| 1019 | .gpio = 91, /* CAM2_STANDBY_N */ |
| 1020 | .settings = { |
| 1021 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 1022 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
| 1023 | }, |
| 1024 | }, |
| 1025 | { |
| 1026 | .gpio = 94, /* CAM2_RST_N */ |
| 1027 | .settings = { |
| 1028 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 1029 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[1], |
| 1030 | }, |
| 1031 | }, |
| 1032 | }; |
| 1033 | |
Banajit Goswami | 8521b12 | 2013-04-03 10:56:11 -0700 | [diff] [blame] | 1034 | static struct gpiomux_setting auxpcm_act_cfg = { |
Damir Didjusto | 04d3c36 | 2013-01-07 14:30:53 -0800 | [diff] [blame] | 1035 | .func = GPIOMUX_FUNC_1, |
| 1036 | .drv = GPIOMUX_DRV_8MA, |
| 1037 | .pull = GPIOMUX_PULL_NONE, |
| 1038 | }; |
| 1039 | |
| 1040 | |
Banajit Goswami | 8521b12 | 2013-04-03 10:56:11 -0700 | [diff] [blame] | 1041 | static struct gpiomux_setting auxpcm_sus_cfg = { |
Damir Didjusto | 04d3c36 | 2013-01-07 14:30:53 -0800 | [diff] [blame] | 1042 | .func = GPIOMUX_FUNC_1, |
| 1043 | .drv = GPIOMUX_DRV_2MA, |
| 1044 | .pull = GPIOMUX_PULL_DOWN, |
| 1045 | }; |
| 1046 | |
Banajit Goswami | c8dcf0f | 2013-04-09 18:21:23 -0700 | [diff] [blame] | 1047 | /* Primary AUXPCM port sharing GPIO lines with Primary MI2S */ |
| 1048 | static struct msm_gpiomux_config msm8974_pri_pri_auxpcm_configs[] __initdata = { |
Damir Didjusto | 04d3c36 | 2013-01-07 14:30:53 -0800 | [diff] [blame] | 1049 | { |
| 1050 | .gpio = 65, |
| 1051 | .settings = { |
Banajit Goswami | 8521b12 | 2013-04-03 10:56:11 -0700 | [diff] [blame] | 1052 | [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg, |
| 1053 | [GPIOMUX_ACTIVE] = &auxpcm_act_cfg, |
Damir Didjusto | 04d3c36 | 2013-01-07 14:30:53 -0800 | [diff] [blame] | 1054 | }, |
| 1055 | }, |
| 1056 | { |
| 1057 | .gpio = 66, |
| 1058 | .settings = { |
Banajit Goswami | 8521b12 | 2013-04-03 10:56:11 -0700 | [diff] [blame] | 1059 | [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg, |
| 1060 | [GPIOMUX_ACTIVE] = &auxpcm_act_cfg, |
Damir Didjusto | 04d3c36 | 2013-01-07 14:30:53 -0800 | [diff] [blame] | 1061 | }, |
| 1062 | }, |
| 1063 | { |
| 1064 | .gpio = 67, |
| 1065 | .settings = { |
Banajit Goswami | 8521b12 | 2013-04-03 10:56:11 -0700 | [diff] [blame] | 1066 | [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg, |
| 1067 | [GPIOMUX_ACTIVE] = &auxpcm_act_cfg, |
Damir Didjusto | 04d3c36 | 2013-01-07 14:30:53 -0800 | [diff] [blame] | 1068 | }, |
| 1069 | }, |
| 1070 | { |
| 1071 | .gpio = 68, |
| 1072 | .settings = { |
Banajit Goswami | 8521b12 | 2013-04-03 10:56:11 -0700 | [diff] [blame] | 1073 | [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg, |
| 1074 | [GPIOMUX_ACTIVE] = &auxpcm_act_cfg, |
| 1075 | }, |
| 1076 | }, |
| 1077 | }; |
| 1078 | |
Banajit Goswami | c8dcf0f | 2013-04-09 18:21:23 -0700 | [diff] [blame] | 1079 | /* Primary AUXPCM port sharing GPIO lines with Tertiary MI2S */ |
| 1080 | static struct msm_gpiomux_config msm8974_pri_ter_auxpcm_configs[] __initdata = { |
| 1081 | { |
| 1082 | .gpio = 74, |
| 1083 | .settings = { |
| 1084 | [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg, |
| 1085 | [GPIOMUX_ACTIVE] = &auxpcm_act_cfg, |
| 1086 | }, |
| 1087 | }, |
| 1088 | { |
| 1089 | .gpio = 75, |
| 1090 | .settings = { |
| 1091 | [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg, |
| 1092 | [GPIOMUX_ACTIVE] = &auxpcm_act_cfg, |
| 1093 | }, |
| 1094 | }, |
| 1095 | { |
| 1096 | .gpio = 76, |
| 1097 | .settings = { |
| 1098 | [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg, |
| 1099 | [GPIOMUX_ACTIVE] = &auxpcm_act_cfg, |
| 1100 | }, |
| 1101 | }, |
| 1102 | { |
| 1103 | .gpio = 77, |
| 1104 | .settings = { |
| 1105 | [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg, |
| 1106 | [GPIOMUX_ACTIVE] = &auxpcm_act_cfg, |
| 1107 | }, |
| 1108 | }, |
| 1109 | }; |
| 1110 | |
Banajit Goswami | 8521b12 | 2013-04-03 10:56:11 -0700 | [diff] [blame] | 1111 | static struct msm_gpiomux_config msm8974_sec_auxpcm_configs[] __initdata = { |
| 1112 | { |
| 1113 | .gpio = 79, |
| 1114 | .settings = { |
| 1115 | [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg, |
| 1116 | [GPIOMUX_ACTIVE] = &auxpcm_act_cfg, |
| 1117 | }, |
| 1118 | }, |
| 1119 | { |
| 1120 | .gpio = 80, |
| 1121 | .settings = { |
| 1122 | [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg, |
| 1123 | [GPIOMUX_ACTIVE] = &auxpcm_act_cfg, |
| 1124 | }, |
| 1125 | }, |
| 1126 | { |
| 1127 | .gpio = 81, |
| 1128 | .settings = { |
| 1129 | [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg, |
| 1130 | [GPIOMUX_ACTIVE] = &auxpcm_act_cfg, |
| 1131 | }, |
| 1132 | }, |
| 1133 | { |
| 1134 | .gpio = 82, |
| 1135 | .settings = { |
| 1136 | [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg, |
| 1137 | [GPIOMUX_ACTIVE] = &auxpcm_act_cfg, |
Damir Didjusto | 04d3c36 | 2013-01-07 14:30:53 -0800 | [diff] [blame] | 1138 | }, |
| 1139 | }, |
| 1140 | }; |
| 1141 | |
Sameer Thalappil | 8d686d4 | 2012-08-24 10:07:31 -0700 | [diff] [blame] | 1142 | static struct msm_gpiomux_config wcnss_5wire_interface[] = { |
| 1143 | { |
| 1144 | .gpio = 36, |
| 1145 | .settings = { |
| 1146 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 1147 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 1148 | }, |
| 1149 | }, |
| 1150 | { |
| 1151 | .gpio = 37, |
| 1152 | .settings = { |
| 1153 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 1154 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 1155 | }, |
| 1156 | }, |
| 1157 | { |
| 1158 | .gpio = 38, |
| 1159 | .settings = { |
| 1160 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 1161 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 1162 | }, |
| 1163 | }, |
| 1164 | { |
| 1165 | .gpio = 39, |
| 1166 | .settings = { |
| 1167 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 1168 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 1169 | }, |
| 1170 | }, |
| 1171 | { |
| 1172 | .gpio = 40, |
| 1173 | .settings = { |
| 1174 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 1175 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 1176 | }, |
| 1177 | }, |
| 1178 | }; |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 1179 | |
Yue Ma | 10d8875 | 2014-02-20 17:12:05 -0800 | [diff] [blame] | 1180 | static struct msm_gpiomux_config wcnss_5gpio_interface[] = { |
| 1181 | { |
| 1182 | .gpio = 36, |
| 1183 | .settings = { |
| 1184 | [GPIOMUX_ACTIVE] = &wcnss_5gpio_active_cfg, |
| 1185 | [GPIOMUX_SUSPENDED] = &wcnss_5gpio_suspend_cfg, |
| 1186 | }, |
| 1187 | }, |
| 1188 | { |
| 1189 | .gpio = 37, |
| 1190 | .settings = { |
| 1191 | [GPIOMUX_ACTIVE] = &wcnss_5gpio_active_cfg, |
| 1192 | [GPIOMUX_SUSPENDED] = &wcnss_5gpio_suspend_cfg, |
| 1193 | }, |
| 1194 | }, |
| 1195 | { |
| 1196 | .gpio = 38, |
| 1197 | .settings = { |
| 1198 | [GPIOMUX_ACTIVE] = &wcnss_5gpio_active_cfg, |
| 1199 | [GPIOMUX_SUSPENDED] = &wcnss_5gpio_suspend_cfg, |
| 1200 | }, |
| 1201 | }, |
| 1202 | { |
| 1203 | .gpio = 39, |
| 1204 | .settings = { |
| 1205 | [GPIOMUX_ACTIVE] = &wcnss_5gpio_active_cfg, |
| 1206 | [GPIOMUX_SUSPENDED] = &wcnss_5gpio_suspend_cfg, |
| 1207 | }, |
| 1208 | }, |
| 1209 | { |
| 1210 | .gpio = 40, |
| 1211 | .settings = { |
| 1212 | [GPIOMUX_ACTIVE] = &wcnss_5gpio_active_cfg, |
| 1213 | [GPIOMUX_SUSPENDED] = &wcnss_5gpio_suspend_cfg, |
| 1214 | }, |
| 1215 | }, |
| 1216 | }; |
Ram Mohan Korukonda | 56ac523 | 2013-03-20 23:48:34 +0530 | [diff] [blame] | 1217 | |
| 1218 | static struct msm_gpiomux_config ath_gpio_configs[] = { |
| 1219 | { |
| 1220 | .gpio = 51, |
| 1221 | .settings = { |
| 1222 | [GPIOMUX_ACTIVE] = &ath_gpio_active_cfg, |
| 1223 | [GPIOMUX_SUSPENDED] = &ath_gpio_suspend_cfg, |
| 1224 | }, |
| 1225 | }, |
| 1226 | { |
| 1227 | .gpio = 79, |
| 1228 | .settings = { |
| 1229 | [GPIOMUX_ACTIVE] = &ath_gpio_active_cfg, |
| 1230 | [GPIOMUX_SUSPENDED] = &ath_gpio_suspend_cfg, |
| 1231 | }, |
| 1232 | }, |
| 1233 | }; |
| 1234 | |
Joonwoo Park | 187e9cb | 2012-08-24 22:47:53 -0700 | [diff] [blame] | 1235 | static struct msm_gpiomux_config msm_taiko_config[] __initdata = { |
| 1236 | { |
| 1237 | .gpio = 63, /* SYS_RST_N */ |
| 1238 | .settings = { |
| 1239 | [GPIOMUX_SUSPENDED] = &taiko_reset, |
| 1240 | }, |
Joonwoo Park | eb84dc7 | 2012-09-12 10:22:49 -0700 | [diff] [blame] | 1241 | }, |
| 1242 | { |
| 1243 | .gpio = 72, /* CDC_INT */ |
| 1244 | .settings = { |
| 1245 | [GPIOMUX_SUSPENDED] = &taiko_int, |
| 1246 | }, |
| 1247 | }, |
Joonwoo Park | 187e9cb | 2012-08-24 22:47:53 -0700 | [diff] [blame] | 1248 | }; |
| 1249 | |
Subhash Jadavani | 102f0ce | 2012-12-14 21:25:59 +0530 | [diff] [blame] | 1250 | static struct gpiomux_setting sdc3_clk_actv_cfg = { |
| 1251 | .func = GPIOMUX_FUNC_2, |
| 1252 | .drv = GPIOMUX_DRV_8MA, |
| 1253 | .pull = GPIOMUX_PULL_NONE, |
| 1254 | }; |
| 1255 | |
| 1256 | static struct gpiomux_setting sdc3_cmd_data_0_3_actv_cfg = { |
| 1257 | .func = GPIOMUX_FUNC_2, |
| 1258 | .drv = GPIOMUX_DRV_8MA, |
| 1259 | .pull = GPIOMUX_PULL_UP, |
| 1260 | }; |
| 1261 | |
| 1262 | static struct gpiomux_setting sdc3_suspend_cfg = { |
| 1263 | .func = GPIOMUX_FUNC_GPIO, |
| 1264 | .drv = GPIOMUX_DRV_2MA, |
| 1265 | .pull = GPIOMUX_PULL_DOWN, |
| 1266 | }; |
| 1267 | |
| 1268 | static struct gpiomux_setting sdc3_data_1_suspend_cfg = { |
| 1269 | .func = GPIOMUX_FUNC_GPIO, |
| 1270 | .drv = GPIOMUX_DRV_8MA, |
| 1271 | .pull = GPIOMUX_PULL_UP, |
| 1272 | }; |
| 1273 | |
| 1274 | static struct msm_gpiomux_config msm8974_sdc3_configs[] __initdata = { |
| 1275 | { |
| 1276 | /* DAT3 */ |
| 1277 | .gpio = 35, |
| 1278 | .settings = { |
| 1279 | [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg, |
| 1280 | [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg, |
| 1281 | }, |
| 1282 | }, |
| 1283 | { |
| 1284 | /* DAT2 */ |
| 1285 | .gpio = 36, |
| 1286 | .settings = { |
| 1287 | [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg, |
| 1288 | [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg, |
| 1289 | }, |
| 1290 | }, |
| 1291 | { |
| 1292 | /* DAT1 */ |
| 1293 | .gpio = 37, |
| 1294 | .settings = { |
| 1295 | [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg, |
| 1296 | [GPIOMUX_SUSPENDED] = &sdc3_data_1_suspend_cfg, |
| 1297 | }, |
| 1298 | }, |
| 1299 | { |
| 1300 | /* DAT0 */ |
| 1301 | .gpio = 38, |
| 1302 | .settings = { |
| 1303 | [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg, |
| 1304 | [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg, |
| 1305 | }, |
| 1306 | }, |
| 1307 | { |
| 1308 | /* CMD */ |
| 1309 | .gpio = 39, |
| 1310 | .settings = { |
| 1311 | [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg, |
| 1312 | [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg, |
| 1313 | }, |
| 1314 | }, |
| 1315 | { |
| 1316 | /* CLK */ |
| 1317 | .gpio = 40, |
| 1318 | .settings = { |
| 1319 | [GPIOMUX_ACTIVE] = &sdc3_clk_actv_cfg, |
| 1320 | [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg, |
| 1321 | }, |
| 1322 | }, |
| 1323 | }; |
| 1324 | |
| 1325 | static void msm_gpiomux_sdc3_install(void) |
| 1326 | { |
| 1327 | msm_gpiomux_install(msm8974_sdc3_configs, |
| 1328 | ARRAY_SIZE(msm8974_sdc3_configs)); |
| 1329 | } |
Subhash Jadavani | 102f0ce | 2012-12-14 21:25:59 +0530 | [diff] [blame] | 1330 | |
| 1331 | #ifdef CONFIG_MMC_MSM_SDC4_SUPPORT |
| 1332 | static struct gpiomux_setting sdc4_clk_actv_cfg = { |
| 1333 | .func = GPIOMUX_FUNC_2, |
| 1334 | .drv = GPIOMUX_DRV_8MA, |
| 1335 | .pull = GPIOMUX_PULL_NONE, |
| 1336 | }; |
| 1337 | |
| 1338 | static struct gpiomux_setting sdc4_cmd_data_0_3_actv_cfg = { |
| 1339 | .func = GPIOMUX_FUNC_2, |
| 1340 | .drv = GPIOMUX_DRV_8MA, |
| 1341 | .pull = GPIOMUX_PULL_UP, |
| 1342 | }; |
| 1343 | |
| 1344 | static struct gpiomux_setting sdc4_suspend_cfg = { |
| 1345 | .func = GPIOMUX_FUNC_GPIO, |
| 1346 | .drv = GPIOMUX_DRV_2MA, |
| 1347 | .pull = GPIOMUX_PULL_DOWN, |
| 1348 | }; |
| 1349 | |
| 1350 | static struct gpiomux_setting sdc4_data_1_suspend_cfg = { |
| 1351 | .func = GPIOMUX_FUNC_GPIO, |
| 1352 | .drv = GPIOMUX_DRV_8MA, |
| 1353 | .pull = GPIOMUX_PULL_UP, |
| 1354 | }; |
| 1355 | |
| 1356 | static struct msm_gpiomux_config msm8974_sdc4_configs[] __initdata = { |
| 1357 | { |
| 1358 | /* DAT3 */ |
| 1359 | .gpio = 92, |
| 1360 | .settings = { |
| 1361 | [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg, |
| 1362 | [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg, |
| 1363 | }, |
| 1364 | }, |
| 1365 | { |
| 1366 | /* DAT2 */ |
| 1367 | .gpio = 94, |
| 1368 | .settings = { |
| 1369 | [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg, |
| 1370 | [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg, |
| 1371 | }, |
| 1372 | }, |
| 1373 | { |
| 1374 | /* DAT1 */ |
| 1375 | .gpio = 95, |
| 1376 | .settings = { |
| 1377 | [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg, |
| 1378 | [GPIOMUX_SUSPENDED] = &sdc4_data_1_suspend_cfg, |
| 1379 | }, |
| 1380 | }, |
| 1381 | { |
| 1382 | /* DAT0 */ |
| 1383 | .gpio = 96, |
| 1384 | .settings = { |
| 1385 | [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg, |
| 1386 | [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg, |
| 1387 | }, |
| 1388 | }, |
| 1389 | { |
| 1390 | /* CMD */ |
| 1391 | .gpio = 91, |
| 1392 | .settings = { |
| 1393 | [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_actv_cfg, |
| 1394 | [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg, |
| 1395 | }, |
| 1396 | }, |
| 1397 | { |
| 1398 | /* CLK */ |
| 1399 | .gpio = 93, |
| 1400 | .settings = { |
| 1401 | [GPIOMUX_ACTIVE] = &sdc4_clk_actv_cfg, |
| 1402 | [GPIOMUX_SUSPENDED] = &sdc4_suspend_cfg, |
| 1403 | }, |
| 1404 | }, |
| 1405 | }; |
| 1406 | |
| 1407 | static void msm_gpiomux_sdc4_install(void) |
| 1408 | { |
| 1409 | msm_gpiomux_install(msm8974_sdc4_configs, |
| 1410 | ARRAY_SIZE(msm8974_sdc4_configs)); |
| 1411 | } |
| 1412 | #else |
| 1413 | static void msm_gpiomux_sdc4_install(void) {} |
| 1414 | #endif /* CONFIG_MMC_MSM_SDC4_SUPPORT */ |
| 1415 | |
Asaf Penso | b8f00b7 | 2013-05-05 19:28:58 +0300 | [diff] [blame] | 1416 | static struct msm_gpiomux_config apq8074_dragonboard_ts_config[] __initdata = { |
| 1417 | { |
| 1418 | /* BLSP1 QUP I2C_DATA */ |
| 1419 | .gpio = 2, |
| 1420 | .settings = { |
| 1421 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 1422 | }, |
| 1423 | }, |
| 1424 | { |
| 1425 | /* BLSP1 QUP I2C_CLK */ |
| 1426 | .gpio = 3, |
| 1427 | .settings = { |
| 1428 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 1429 | }, |
| 1430 | }, |
| 1431 | }; |
| 1432 | |
Abhimanyu Kapur | 90ced6e | 2012-06-26 17:41:25 -0700 | [diff] [blame] | 1433 | void __init msm_8974_init_gpiomux(void) |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 1434 | { |
| 1435 | int rc; |
| 1436 | |
Rohit Vaswani | 341c203 | 2012-11-08 18:49:29 -0800 | [diff] [blame] | 1437 | rc = msm_gpiomux_init_dt(); |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 1438 | if (rc) { |
Rohit Vaswani | 341c203 | 2012-11-08 18:49:29 -0800 | [diff] [blame] | 1439 | pr_err("%s failed %d\n", __func__, rc); |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 1440 | return; |
| 1441 | } |
| 1442 | |
Xu Han | d4fbf02 | 2013-08-30 14:29:01 -0700 | [diff] [blame] | 1443 | pr_err("%s:%d socinfo_get_version %x\n", __func__, __LINE__, |
| 1444 | socinfo_get_version()); |
| 1445 | if (socinfo_get_version() >= 0x20000) |
| 1446 | msm_tlmm_misc_reg_write(TLMM_SPARE_REG, 0xf); |
| 1447 | |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 1448 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
Ilia Lin | bcdb0fb | 2013-07-09 08:35:39 +0300 | [diff] [blame] | 1449 | if (!(of_board_is_dragonboard() && machine_is_apq8074())) |
| 1450 | msm_gpiomux_install(msm_eth_configs, \ |
| 1451 | ARRAY_SIZE(msm_eth_configs)); |
Sathish Ambley | e3154b4 | 2012-04-09 10:59:09 -0700 | [diff] [blame] | 1452 | #endif |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 1453 | msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs)); |
Saket Saurabh | eac5834 | 2013-02-05 12:20:18 +0530 | [diff] [blame] | 1454 | msm_gpiomux_install(msm_blsp2_uart7_configs, |
| 1455 | ARRAY_SIZE(msm_blsp2_uart7_configs)); |
Sameer Thalappil | 8d686d4 | 2012-08-24 10:07:31 -0700 | [diff] [blame] | 1456 | msm_gpiomux_install(wcnss_5wire_interface, |
| 1457 | ARRAY_SIZE(wcnss_5wire_interface)); |
Ram Mohan Korukonda | f0f07ec | 2013-04-13 10:26:11 -0700 | [diff] [blame] | 1458 | if (of_board_is_liquid()) |
| 1459 | msm_gpiomux_install_nowrite(ath_gpio_configs, |
| 1460 | ARRAY_SIZE(ath_gpio_configs)); |
Sagar Dharia | a8e6b0a | 2012-08-10 20:52:30 -0600 | [diff] [blame] | 1461 | msm_gpiomux_install(msm8974_slimbus_config, |
| 1462 | ARRAY_SIZE(msm8974_slimbus_config)); |
| 1463 | |
Amy Maloche | 9e99a79 | 2012-08-15 23:27:51 -0700 | [diff] [blame] | 1464 | msm_gpiomux_install(msm_touch_configs, ARRAY_SIZE(msm_touch_configs)); |
Amy Maloche | 527acc4 | 2012-12-07 18:40:54 -0800 | [diff] [blame] | 1465 | msm_gpiomux_install(hap_lvl_shft_config, |
| 1466 | ARRAY_SIZE(hap_lvl_shft_config)); |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 1467 | |
Ilia Lin | bcdb0fb | 2013-07-09 08:35:39 +0300 | [diff] [blame] | 1468 | if (of_board_is_dragonboard() && machine_is_apq8074()) |
| 1469 | msm_gpiomux_install(msm_sensor_configs_dragonboard, \ |
| 1470 | ARRAY_SIZE(msm_sensor_configs_dragonboard)); |
| 1471 | else |
| 1472 | msm_gpiomux_install(msm_sensor_configs, \ |
| 1473 | ARRAY_SIZE(msm_sensor_configs)); |
Joonwoo Park | 187e9cb | 2012-08-24 22:47:53 -0700 | [diff] [blame] | 1474 | |
Subhash Jadavani | 76aa7de | 2012-10-10 09:58:17 +0530 | [diff] [blame] | 1475 | msm_gpiomux_install(&sd_card_det, 1); |
Ilia Lin | 7f52748 | 2013-05-21 13:59:48 +0300 | [diff] [blame] | 1476 | |
| 1477 | if (machine_is_apq8074() && (of_board_is_liquid() || \ |
| 1478 | of_board_is_dragonboard())) |
| 1479 | msm_gpiomux_sdc3_install(); |
| 1480 | |
Ilia Lin | bcdb0fb | 2013-07-09 08:35:39 +0300 | [diff] [blame] | 1481 | if (!(of_board_is_dragonboard() && machine_is_apq8074())) |
| 1482 | msm_gpiomux_sdc4_install(); |
Subhash Jadavani | 76aa7de | 2012-10-10 09:58:17 +0530 | [diff] [blame] | 1483 | |
Joonwoo Park | 187e9cb | 2012-08-24 22:47:53 -0700 | [diff] [blame] | 1484 | msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config)); |
Ujwal Patel | 74b5df4 | 2012-08-13 22:50:13 -0700 | [diff] [blame] | 1485 | |
Manu Gautam | ac7265b | 2012-11-21 11:49:15 +0530 | [diff] [blame] | 1486 | msm_gpiomux_install(msm_hsic_configs, ARRAY_SIZE(msm_hsic_configs)); |
| 1487 | msm_gpiomux_install(msm_hsic_hub_configs, |
| 1488 | ARRAY_SIZE(msm_hsic_hub_configs)); |
| 1489 | |
Ujwal Patel | 74b5df4 | 2012-08-13 22:50:13 -0700 | [diff] [blame] | 1490 | msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs)); |
Stepan Moskovchenko | 82f0eab | 2013-04-02 19:52:28 -0700 | [diff] [blame] | 1491 | if (of_board_is_fluid()) |
Stepan Moskovchenko | ebd0541 | 2013-02-07 20:39:56 -0800 | [diff] [blame] | 1492 | msm_gpiomux_install(msm_mhl_configs, |
| 1493 | ARRAY_SIZE(msm_mhl_configs)); |
Stepan Moskovchenko | 95108b8 | 2012-11-27 14:28:11 -0800 | [diff] [blame] | 1494 | |
Tanya Finkel | d3685a3 | 2013-07-01 15:35:56 +0300 | [diff] [blame] | 1495 | if (of_board_is_liquid() || |
| 1496 | (of_board_is_dragonboard() && machine_is_apq8074())) |
Banajit Goswami | c8dcf0f | 2013-04-09 18:21:23 -0700 | [diff] [blame] | 1497 | msm_gpiomux_install(msm8974_pri_ter_auxpcm_configs, |
| 1498 | ARRAY_SIZE(msm8974_pri_ter_auxpcm_configs)); |
| 1499 | else |
| 1500 | msm_gpiomux_install(msm8974_pri_pri_auxpcm_configs, |
| 1501 | ARRAY_SIZE(msm8974_pri_pri_auxpcm_configs)); |
| 1502 | |
Siddartha Mohanadoss | 1f32be5 | 2013-05-17 13:29:50 -0700 | [diff] [blame] | 1503 | if (of_board_is_cdp()) |
| 1504 | msm_gpiomux_install(msm8974_sec_auxpcm_configs, |
Banajit Goswami | 8521b12 | 2013-04-03 10:56:11 -0700 | [diff] [blame] | 1505 | ARRAY_SIZE(msm8974_sec_auxpcm_configs)); |
Siddartha Mohanadoss | 56714a5 | 2013-07-12 15:10:36 -0700 | [diff] [blame] | 1506 | else if (of_board_is_liquid() || of_board_is_fluid() || |
| 1507 | of_board_is_mtp()) |
Siddartha Mohanadoss | 1f32be5 | 2013-05-17 13:29:50 -0700 | [diff] [blame] | 1508 | msm_gpiomux_install(msm_epm_configs, |
| 1509 | ARRAY_SIZE(msm_epm_configs)); |
Damir Didjusto | 04d3c36 | 2013-01-07 14:30:53 -0800 | [diff] [blame] | 1510 | |
Siddhartha Agrawal | 6ab3e1c | 2013-02-22 18:30:37 -0800 | [diff] [blame] | 1511 | msm_gpiomux_install_nowrite(msm_lcd_configs, |
| 1512 | ARRAY_SIZE(msm_lcd_configs)); |
| 1513 | |
Stepan Moskovchenko | 82f0eab | 2013-04-02 19:52:28 -0700 | [diff] [blame] | 1514 | if (of_board_is_rumi()) |
Stepan Moskovchenko | 95108b8 | 2012-11-27 14:28:11 -0800 | [diff] [blame] | 1515 | msm_gpiomux_install(msm_rumi_blsp_configs, |
| 1516 | ARRAY_SIZE(msm_rumi_blsp_configs)); |
Joel King | 15ccbfa | 2013-04-12 17:41:16 -0700 | [diff] [blame] | 1517 | |
| 1518 | if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_MDM) |
| 1519 | msm_gpiomux_install(mdm_configs, |
| 1520 | ARRAY_SIZE(mdm_configs)); |
Asaf Penso | b8f00b7 | 2013-05-05 19:28:58 +0300 | [diff] [blame] | 1521 | |
| 1522 | if (of_board_is_dragonboard() && machine_is_apq8074()) |
| 1523 | msm_gpiomux_install(apq8074_dragonboard_ts_config, |
| 1524 | ARRAY_SIZE(apq8074_dragonboard_ts_config)); |
Sathish Ambley | b17ec7e | 2012-04-03 15:20:03 -0700 | [diff] [blame] | 1525 | } |
Yue Ma | 10d8875 | 2014-02-20 17:12:05 -0800 | [diff] [blame] | 1526 | |
| 1527 | static void wcnss_switch_to_gpio(void) |
| 1528 | { |
| 1529 | /* Switch MUX to GPIO */ |
| 1530 | msm_gpiomux_install(wcnss_5gpio_interface, |
| 1531 | ARRAY_SIZE(wcnss_5gpio_interface)); |
| 1532 | |
| 1533 | /* Ensure GPIO config */ |
| 1534 | gpio_direction_input(WLAN_DATA2); |
| 1535 | gpio_direction_input(WLAN_DATA1); |
| 1536 | gpio_direction_input(WLAN_DATA0); |
| 1537 | gpio_direction_output(WLAN_SET, 0); |
| 1538 | gpio_direction_output(WLAN_CLK, 0); |
| 1539 | } |
| 1540 | |
| 1541 | static void wcnss_switch_to_5wire(void) |
| 1542 | { |
| 1543 | msm_gpiomux_install(wcnss_5wire_interface, |
| 1544 | ARRAY_SIZE(wcnss_5wire_interface)); |
| 1545 | } |
| 1546 | |
| 1547 | u32 wcnss_rf_read_reg(u32 rf_reg_addr) |
| 1548 | { |
| 1549 | int count = 0; |
| 1550 | u32 rf_cmd_and_addr = 0; |
| 1551 | u32 rf_data_received = 0; |
| 1552 | u32 rf_bit = 0; |
| 1553 | |
| 1554 | wcnss_switch_to_gpio(); |
| 1555 | |
| 1556 | /* Reset the signal if it is already being used. */ |
| 1557 | gpio_set_value(WLAN_SET, 0); |
| 1558 | gpio_set_value(WLAN_CLK, 0); |
| 1559 | |
| 1560 | /* We start with cmd_set high WLAN_SET = 1. */ |
| 1561 | gpio_set_value(WLAN_SET, 1); |
| 1562 | |
| 1563 | gpio_direction_output(WLAN_DATA0, 1); |
| 1564 | gpio_direction_output(WLAN_DATA1, 1); |
| 1565 | gpio_direction_output(WLAN_DATA2, 1); |
| 1566 | |
| 1567 | gpio_set_value(WLAN_DATA0, 0); |
| 1568 | gpio_set_value(WLAN_DATA1, 0); |
| 1569 | gpio_set_value(WLAN_DATA2, 0); |
| 1570 | |
| 1571 | /* Prepare command and RF register address that need to sent out. |
| 1572 | * Make sure that we send only 14 bits from LSB. |
| 1573 | */ |
| 1574 | rf_cmd_and_addr = (((WLAN_RF_READ_REG_CMD) | |
| 1575 | (rf_reg_addr << WLAN_RF_REG_ADDR_START_OFFSET)) & |
| 1576 | WLAN_RF_READ_CMD_MASK); |
| 1577 | |
| 1578 | for (count = 0; count < 5; count++) { |
| 1579 | gpio_set_value(WLAN_CLK, 0); |
| 1580 | |
| 1581 | rf_bit = (rf_cmd_and_addr & 0x1); |
| 1582 | gpio_set_value(WLAN_DATA0, rf_bit ? 1 : 0); |
| 1583 | rf_cmd_and_addr = (rf_cmd_and_addr >> 1); |
| 1584 | |
| 1585 | rf_bit = (rf_cmd_and_addr & 0x1); |
| 1586 | gpio_set_value(WLAN_DATA1, rf_bit ? 1 : 0); |
| 1587 | rf_cmd_and_addr = (rf_cmd_and_addr >> 1); |
| 1588 | |
| 1589 | rf_bit = (rf_cmd_and_addr & 0x1); |
| 1590 | gpio_set_value(WLAN_DATA2, rf_bit ? 1 : 0); |
| 1591 | rf_cmd_and_addr = (rf_cmd_and_addr >> 1); |
| 1592 | |
| 1593 | /* Send the data out WLAN_CLK = 1 */ |
| 1594 | gpio_set_value(WLAN_CLK, 1); |
| 1595 | } |
| 1596 | |
| 1597 | /* Pull down the clock signal */ |
| 1598 | gpio_set_value(WLAN_CLK, 0); |
| 1599 | |
| 1600 | /* Configure data pins to input IO pins */ |
| 1601 | gpio_direction_input(WLAN_DATA0); |
| 1602 | gpio_direction_input(WLAN_DATA1); |
| 1603 | gpio_direction_input(WLAN_DATA2); |
| 1604 | |
| 1605 | for (count = 0; count < 2; count++) { |
| 1606 | gpio_set_value(WLAN_CLK, 1); |
| 1607 | gpio_set_value(WLAN_CLK, 0); |
| 1608 | } |
| 1609 | |
| 1610 | rf_bit = 0; |
| 1611 | for (count = 0; count < 6; count++) { |
| 1612 | gpio_set_value(WLAN_CLK, 1); |
| 1613 | gpio_set_value(WLAN_CLK, 0); |
| 1614 | |
| 1615 | rf_bit = gpio_get_value(WLAN_DATA0); |
| 1616 | rf_data_received |= (rf_bit << (count * 3 + 0)); |
| 1617 | |
| 1618 | if (count != 5) { |
| 1619 | rf_bit = gpio_get_value(WLAN_DATA1); |
| 1620 | rf_data_received |= (rf_bit << (count * 3 + 1)); |
| 1621 | |
| 1622 | rf_bit = gpio_get_value(WLAN_DATA2); |
| 1623 | rf_data_received |= (rf_bit << (count * 3 + 2)); |
| 1624 | } |
| 1625 | } |
| 1626 | |
| 1627 | gpio_set_value(WLAN_SET, 0); |
| 1628 | wcnss_switch_to_5wire(); |
| 1629 | |
| 1630 | return rf_data_received; |
| 1631 | } |