Gilad Avidov | 28e18eb | 2012-11-21 18:13:25 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. |
Syed Rameez Mustafa | 9d16c4f | 2012-09-10 14:16:55 -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> |
David Collins | 091bb24 | 2013-05-23 11:08:24 -0700 | [diff] [blame] | 19 | #include <mach/socinfo.h> |
Syed Rameez Mustafa | 9d16c4f | 2012-09-10 14:16:55 -0700 | [diff] [blame] | 20 | |
Pavankumar Kondeti | 45eb66f | 2013-09-24 15:43:25 +0530 | [diff] [blame] | 21 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
| 22 | static struct gpiomux_setting hsic_sus_cfg = { |
| 23 | .func = GPIOMUX_FUNC_GPIO, |
| 24 | .drv = GPIOMUX_DRV_2MA, |
| 25 | .pull = GPIOMUX_PULL_DOWN, |
| 26 | .dir = GPIOMUX_OUT_LOW, |
| 27 | }; |
| 28 | |
| 29 | static struct gpiomux_setting hsic_act_cfg = { |
| 30 | .func = GPIOMUX_FUNC_1, |
| 31 | .drv = GPIOMUX_DRV_16MA, |
| 32 | .pull = GPIOMUX_PULL_NONE, |
| 33 | }; |
| 34 | |
| 35 | static struct msm_gpiomux_config msm_hsic_configs[] = { |
| 36 | { |
| 37 | .gpio = 115, /* HSIC_STROBE */ |
| 38 | .settings = { |
| 39 | [GPIOMUX_ACTIVE] = &hsic_act_cfg, |
| 40 | [GPIOMUX_SUSPENDED] = &hsic_sus_cfg, |
| 41 | }, |
| 42 | }, |
| 43 | { |
| 44 | .gpio = 116, /* HSIC_DATA */ |
| 45 | .settings = { |
| 46 | [GPIOMUX_ACTIVE] = &hsic_act_cfg, |
| 47 | [GPIOMUX_SUSPENDED] = &hsic_sus_cfg, |
| 48 | }, |
| 49 | }, |
| 50 | }; |
| 51 | #endif |
| 52 | |
aiquny | 76b4608 | 2013-03-13 15:58:08 -0700 | [diff] [blame] | 53 | #define KS8851_IRQ_GPIO 115 |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 54 | |
| 55 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
| 56 | static struct gpiomux_setting gpio_eth_config = { |
| 57 | .pull = GPIOMUX_PULL_UP, |
| 58 | .drv = GPIOMUX_DRV_2MA, |
| 59 | .func = GPIOMUX_FUNC_GPIO, |
| 60 | }; |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 61 | |
| 62 | static struct msm_gpiomux_config msm_eth_configs[] = { |
| 63 | { |
| 64 | .gpio = KS8851_IRQ_GPIO, |
| 65 | .settings = { |
| 66 | [GPIOMUX_SUSPENDED] = &gpio_eth_config, |
| 67 | } |
| 68 | }, |
| 69 | }; |
Gilad Avidov | 28e18eb | 2012-11-21 18:13:25 -0700 | [diff] [blame] | 70 | #endif |
| 71 | |
Amy Maloche | 41708ba | 2013-03-03 15:19:27 -0800 | [diff] [blame] | 72 | static struct gpiomux_setting synaptics_int_act_cfg = { |
| 73 | .func = GPIOMUX_FUNC_GPIO, |
| 74 | .drv = GPIOMUX_DRV_8MA, |
| 75 | .pull = GPIOMUX_PULL_UP, |
| 76 | }; |
| 77 | |
| 78 | static struct gpiomux_setting synaptics_int_sus_cfg = { |
| 79 | .func = GPIOMUX_FUNC_GPIO, |
| 80 | .drv = GPIOMUX_DRV_2MA, |
| 81 | .pull = GPIOMUX_PULL_DOWN, |
| 82 | }; |
| 83 | |
| 84 | static struct gpiomux_setting synaptics_reset_act_cfg = { |
| 85 | .func = GPIOMUX_FUNC_GPIO, |
| 86 | .drv = GPIOMUX_DRV_6MA, |
| 87 | .pull = GPIOMUX_PULL_DOWN, |
| 88 | }; |
| 89 | |
| 90 | static struct gpiomux_setting synaptics_reset_sus_cfg = { |
| 91 | .func = GPIOMUX_FUNC_GPIO, |
Amy Maloche | bf34609 | 2013-07-31 12:57:28 -0700 | [diff] [blame] | 92 | .drv = GPIOMUX_DRV_2MA, |
Amy Maloche | 41708ba | 2013-03-03 15:19:27 -0800 | [diff] [blame] | 93 | .pull = GPIOMUX_PULL_DOWN, |
| 94 | }; |
| 95 | |
Amy Maloche | 24c59dd | 2013-03-05 11:43:55 -0800 | [diff] [blame] | 96 | static struct gpiomux_setting gpio_keys_active = { |
| 97 | .func = GPIOMUX_FUNC_GPIO, |
| 98 | .drv = GPIOMUX_DRV_2MA, |
| 99 | .pull = GPIOMUX_PULL_UP, |
| 100 | }; |
| 101 | |
| 102 | static struct gpiomux_setting gpio_keys_suspend = { |
| 103 | .func = GPIOMUX_FUNC_GPIO, |
| 104 | .drv = GPIOMUX_DRV_2MA, |
| 105 | .pull = GPIOMUX_PULL_NONE, |
| 106 | }; |
| 107 | |
Venkat Raju Sana | 6d4e9c7 | 2013-09-06 19:23:49 +0530 | [diff] [blame] | 108 | static struct gpiomux_setting gpio_spi_act_config = { |
Gilad Avidov | 28e18eb | 2012-11-21 18:13:25 -0700 | [diff] [blame] | 109 | .func = GPIOMUX_FUNC_1, |
| 110 | .drv = GPIOMUX_DRV_8MA, |
| 111 | .pull = GPIOMUX_PULL_NONE, |
| 112 | }; |
| 113 | |
Venkat Raju Sana | 6d4e9c7 | 2013-09-06 19:23:49 +0530 | [diff] [blame] | 114 | static struct gpiomux_setting gpio_spi_cs_act_config = { |
Gilad Avidov | d59217c | 2013-02-01 13:45:59 -0700 | [diff] [blame] | 115 | .func = GPIOMUX_FUNC_1, |
| 116 | .drv = GPIOMUX_DRV_6MA, |
| 117 | .pull = GPIOMUX_PULL_DOWN, |
| 118 | }; |
Venkat Raju Sana | 6d4e9c7 | 2013-09-06 19:23:49 +0530 | [diff] [blame] | 119 | static struct gpiomux_setting gpio_spi_susp_config = { |
| 120 | .func = GPIOMUX_FUNC_GPIO, |
| 121 | .drv = GPIOMUX_DRV_2MA, |
| 122 | .pull = GPIOMUX_PULL_DOWN, |
| 123 | }; |
Gilad Avidov | d59217c | 2013-02-01 13:45:59 -0700 | [diff] [blame] | 124 | |
Su Liu | ec9f6f5 | 2013-08-30 17:33:32 +0800 | [diff] [blame] | 125 | static struct gpiomux_setting gpio_spi_cs_eth_config = { |
| 126 | .func = GPIOMUX_FUNC_4, |
| 127 | .drv = GPIOMUX_DRV_6MA, |
| 128 | .pull = GPIOMUX_PULL_DOWN, |
| 129 | }; |
| 130 | |
Sheng Fang | 6746c3f | 2013-03-19 08:37:13 +0800 | [diff] [blame] | 131 | static struct gpiomux_setting wcnss_5wire_suspend_cfg = { |
| 132 | .func = GPIOMUX_FUNC_GPIO, |
| 133 | .drv = GPIOMUX_DRV_2MA, |
| 134 | .pull = GPIOMUX_PULL_UP, |
| 135 | }; |
| 136 | |
| 137 | static struct gpiomux_setting wcnss_5wire_active_cfg = { |
| 138 | .func = GPIOMUX_FUNC_1, |
| 139 | .drv = GPIOMUX_DRV_6MA, |
| 140 | .pull = GPIOMUX_PULL_DOWN, |
| 141 | }; |
| 142 | |
Gilad Avidov | 28e18eb | 2012-11-21 18:13:25 -0700 | [diff] [blame] | 143 | static struct gpiomux_setting gpio_i2c_config = { |
| 144 | .func = GPIOMUX_FUNC_3, |
| 145 | .drv = GPIOMUX_DRV_2MA, |
| 146 | .pull = GPIOMUX_PULL_NONE, |
| 147 | }; |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 148 | |
Amy Maloche | 24c59dd | 2013-03-05 11:43:55 -0800 | [diff] [blame] | 149 | static struct msm_gpiomux_config msm_keypad_configs[] __initdata = { |
| 150 | { |
| 151 | .gpio = 106, |
| 152 | .settings = { |
| 153 | [GPIOMUX_ACTIVE] = &gpio_keys_active, |
| 154 | [GPIOMUX_SUSPENDED] = &gpio_keys_suspend, |
| 155 | }, |
| 156 | }, |
| 157 | { |
| 158 | .gpio = 107, |
| 159 | .settings = { |
| 160 | [GPIOMUX_ACTIVE] = &gpio_keys_active, |
| 161 | [GPIOMUX_SUSPENDED] = &gpio_keys_suspend, |
| 162 | }, |
| 163 | }, |
| 164 | { |
| 165 | .gpio = 108, |
| 166 | .settings = { |
| 167 | [GPIOMUX_ACTIVE] = &gpio_keys_active, |
| 168 | [GPIOMUX_SUSPENDED] = &gpio_keys_suspend, |
| 169 | }, |
| 170 | }, |
| 171 | }; |
| 172 | |
Aravind Venkateswaran | f60fb21 | 2013-03-08 13:57:06 -0800 | [diff] [blame] | 173 | static struct gpiomux_setting lcd_rst_act_cfg = { |
| 174 | .func = GPIOMUX_FUNC_GPIO, |
| 175 | .drv = GPIOMUX_DRV_8MA, |
Aravind Venkateswaran | d11ac09 | 2013-06-18 12:30:20 -0700 | [diff] [blame] | 176 | .pull = GPIOMUX_PULL_UP, |
| 177 | .dir = GPIOMUX_OUT_HIGH, |
Aravind Venkateswaran | f60fb21 | 2013-03-08 13:57:06 -0800 | [diff] [blame] | 178 | }; |
| 179 | |
| 180 | static struct gpiomux_setting lcd_rst_sus_cfg = { |
| 181 | .func = GPIOMUX_FUNC_GPIO, |
| 182 | .drv = GPIOMUX_DRV_2MA, |
| 183 | .pull = GPIOMUX_PULL_DOWN, |
| 184 | }; |
| 185 | |
| 186 | static struct msm_gpiomux_config msm_lcd_configs[] __initdata = { |
| 187 | { |
| 188 | .gpio = 25, |
| 189 | .settings = { |
| 190 | [GPIOMUX_ACTIVE] = &lcd_rst_act_cfg, |
| 191 | [GPIOMUX_SUSPENDED] = &lcd_rst_sus_cfg, |
| 192 | }, |
| 193 | } |
| 194 | }; |
| 195 | |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 196 | static struct msm_gpiomux_config msm_blsp_configs[] __initdata = { |
| 197 | { |
Gilad Avidov | d59217c | 2013-02-01 13:45:59 -0700 | [diff] [blame] | 198 | .gpio = 0, /* BLSP1 QUP1 SPI_DATA_MOSI */ |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 199 | .settings = { |
Venkat Raju Sana | 6d4e9c7 | 2013-09-06 19:23:49 +0530 | [diff] [blame] | 200 | [GPIOMUX_ACTIVE] = &gpio_spi_act_config, |
| 201 | [GPIOMUX_SUSPENDED] = &gpio_spi_susp_config, |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 202 | }, |
| 203 | }, |
| 204 | { |
Gilad Avidov | d59217c | 2013-02-01 13:45:59 -0700 | [diff] [blame] | 205 | .gpio = 1, /* BLSP1 QUP1 SPI_DATA_MISO */ |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 206 | .settings = { |
Venkat Raju Sana | 6d4e9c7 | 2013-09-06 19:23:49 +0530 | [diff] [blame] | 207 | [GPIOMUX_ACTIVE] = &gpio_spi_act_config, |
| 208 | [GPIOMUX_SUSPENDED] = &gpio_spi_susp_config, |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 209 | }, |
| 210 | }, |
| 211 | { |
Gilad Avidov | d59217c | 2013-02-01 13:45:59 -0700 | [diff] [blame] | 212 | .gpio = 2, /* BLSP1 QUP1 SPI_CS1 */ |
| 213 | .settings = { |
Venkat Raju Sana | 6d4e9c7 | 2013-09-06 19:23:49 +0530 | [diff] [blame] | 214 | [GPIOMUX_ACTIVE] = &gpio_spi_cs_act_config, |
| 215 | [GPIOMUX_SUSPENDED] = &gpio_spi_susp_config, |
Gilad Avidov | d59217c | 2013-02-01 13:45:59 -0700 | [diff] [blame] | 216 | }, |
| 217 | }, |
| 218 | { |
| 219 | .gpio = 3, /* BLSP1 QUP1 SPI_CLK */ |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 220 | .settings = { |
Venkat Raju Sana | 6d4e9c7 | 2013-09-06 19:23:49 +0530 | [diff] [blame] | 221 | [GPIOMUX_ACTIVE] = &gpio_spi_act_config, |
| 222 | [GPIOMUX_SUSPENDED] = &gpio_spi_susp_config, |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 223 | }, |
| 224 | }, |
| 225 | { |
Gilad Avidov | d59217c | 2013-02-01 13:45:59 -0700 | [diff] [blame] | 226 | .gpio = 14, /* BLSP1 QUP4 I2C_SDA */ |
Gilad Avidov | 28e18eb | 2012-11-21 18:13:25 -0700 | [diff] [blame] | 227 | .settings = { |
Bingzhe Cai | 1248722 | 2013-09-02 22:37:36 +0800 | [diff] [blame] | 228 | [GPIOMUX_ACTIVE] = &gpio_i2c_config, |
Gilad Avidov | 28e18eb | 2012-11-21 18:13:25 -0700 | [diff] [blame] | 229 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 230 | }, |
| 231 | }, |
| 232 | { |
Gilad Avidov | d59217c | 2013-02-01 13:45:59 -0700 | [diff] [blame] | 233 | .gpio = 15, /* BLSP1 QUP4 I2C_SCL */ |
Gilad Avidov | 28e18eb | 2012-11-21 18:13:25 -0700 | [diff] [blame] | 234 | .settings = { |
Bingzhe Cai | 1248722 | 2013-09-02 22:37:36 +0800 | [diff] [blame] | 235 | [GPIOMUX_ACTIVE] = &gpio_i2c_config, |
Gilad Avidov | 28e18eb | 2012-11-21 18:13:25 -0700 | [diff] [blame] | 236 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 237 | }, |
| 238 | }, |
Amy Maloche | 41708ba | 2013-03-03 15:19:27 -0800 | [diff] [blame] | 239 | { |
| 240 | .gpio = 18, /* BLSP1 QUP5 I2C_SDA */ |
| 241 | .settings = { |
Bingzhe Cai | 1248722 | 2013-09-02 22:37:36 +0800 | [diff] [blame] | 242 | [GPIOMUX_ACTIVE] = &gpio_i2c_config, |
Amy Maloche | 41708ba | 2013-03-03 15:19:27 -0800 | [diff] [blame] | 243 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 244 | }, |
| 245 | }, |
| 246 | { |
| 247 | .gpio = 19, /* BLSP1 QUP5 I2C_SCL */ |
| 248 | .settings = { |
Bingzhe Cai | 1248722 | 2013-09-02 22:37:36 +0800 | [diff] [blame] | 249 | [GPIOMUX_ACTIVE] = &gpio_i2c_config, |
Amy Maloche | 41708ba | 2013-03-03 15:19:27 -0800 | [diff] [blame] | 250 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 251 | }, |
| 252 | }, |
Su Liu | ec9f6f5 | 2013-08-30 17:33:32 +0800 | [diff] [blame] | 253 | { |
| 254 | .gpio = 22, /* BLSP1 QUP1 SPI_CS_ETH */ |
| 255 | .settings = { |
| 256 | [GPIOMUX_SUSPENDED] = &gpio_spi_cs_eth_config, |
| 257 | }, |
| 258 | }, |
Madan Mohan Koyyalamudi | ddfbd63 | 2013-06-19 17:40:39 -0700 | [diff] [blame] | 259 | { /* NFC */ |
| 260 | .gpio = 10, /* BLSP1 QUP3 I2C_DAT */ |
| 261 | .settings = { |
Bingzhe Cai | 1248722 | 2013-09-02 22:37:36 +0800 | [diff] [blame] | 262 | [GPIOMUX_ACTIVE] = &gpio_i2c_config, |
Madan Mohan Koyyalamudi | ddfbd63 | 2013-06-19 17:40:39 -0700 | [diff] [blame] | 263 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 264 | }, |
| 265 | }, |
| 266 | { /* NFC */ |
| 267 | .gpio = 11, /* BLSP1 QUP3 I2C_CLK */ |
| 268 | .settings = { |
Bingzhe Cai | 1248722 | 2013-09-02 22:37:36 +0800 | [diff] [blame] | 269 | [GPIOMUX_ACTIVE] = &gpio_i2c_config, |
Madan Mohan Koyyalamudi | ddfbd63 | 2013-06-19 17:40:39 -0700 | [diff] [blame] | 270 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 271 | }, |
| 272 | }, |
Amy Maloche | 41708ba | 2013-03-03 15:19:27 -0800 | [diff] [blame] | 273 | }; |
| 274 | |
| 275 | static struct msm_gpiomux_config msm_synaptics_configs[] __initdata = { |
| 276 | { |
| 277 | .gpio = 16, |
| 278 | .settings = { |
| 279 | [GPIOMUX_ACTIVE] = &synaptics_reset_act_cfg, |
| 280 | [GPIOMUX_SUSPENDED] = &synaptics_reset_sus_cfg, |
| 281 | }, |
| 282 | }, |
| 283 | { |
| 284 | .gpio = 17, |
| 285 | .settings = { |
| 286 | [GPIOMUX_ACTIVE] = &synaptics_int_act_cfg, |
| 287 | [GPIOMUX_SUSPENDED] = &synaptics_int_sus_cfg, |
| 288 | }, |
| 289 | }, |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 290 | }; |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 291 | |
Bingzhe Cai | 38869af | 2013-07-29 11:36:40 +0800 | [diff] [blame] | 292 | static struct gpiomux_setting gpio_nc_cfg = { |
| 293 | .func = GPIOMUX_FUNC_GPIO, |
| 294 | .drv = GPIOMUX_DRV_2MA, |
Xiaocheng Li | 44e68fe | 2013-09-02 16:55:04 +0800 | [diff] [blame] | 295 | .pull = GPIOMUX_PULL_NONE, |
Bingzhe Cai | 38869af | 2013-07-29 11:36:40 +0800 | [diff] [blame] | 296 | }; |
| 297 | |
| 298 | static struct gpiomux_setting goodix_ldo_en_act_cfg = { |
| 299 | .func = GPIOMUX_FUNC_GPIO, |
| 300 | .drv = GPIOMUX_DRV_6MA, |
| 301 | .pull = GPIOMUX_PULL_UP, |
| 302 | }; |
| 303 | |
| 304 | static struct gpiomux_setting goodix_ldo_en_sus_cfg = { |
| 305 | .func = GPIOMUX_FUNC_GPIO, |
| 306 | .drv = GPIOMUX_DRV_6MA, |
| 307 | .pull = GPIOMUX_PULL_UP, |
| 308 | }; |
| 309 | |
| 310 | static struct gpiomux_setting goodix_int_act_cfg = { |
| 311 | .func = GPIOMUX_FUNC_GPIO, |
| 312 | .drv = GPIOMUX_DRV_8MA, |
| 313 | .pull = GPIOMUX_PULL_UP, |
| 314 | }; |
| 315 | |
| 316 | static struct gpiomux_setting goodix_int_sus_cfg = { |
| 317 | .func = GPIOMUX_FUNC_GPIO, |
| 318 | .drv = GPIOMUX_DRV_2MA, |
| 319 | .pull = GPIOMUX_PULL_DOWN, |
| 320 | }; |
| 321 | |
| 322 | static struct gpiomux_setting goodix_reset_act_cfg = { |
| 323 | .func = GPIOMUX_FUNC_GPIO, |
| 324 | .drv = GPIOMUX_DRV_8MA, |
| 325 | .pull = GPIOMUX_PULL_UP, |
| 326 | }; |
| 327 | |
| 328 | static struct gpiomux_setting goodix_reset_sus_cfg = { |
| 329 | .func = GPIOMUX_FUNC_GPIO, |
| 330 | .drv = GPIOMUX_DRV_8MA, |
| 331 | .pull = GPIOMUX_PULL_UP, |
| 332 | }; |
| 333 | |
Xiaocheng Li | 44e68fe | 2013-09-02 16:55:04 +0800 | [diff] [blame] | 334 | static struct msm_gpiomux_config msm_skuf_blsp_configs[] __initdata = { |
Bingzhe Cai | 38869af | 2013-07-29 11:36:40 +0800 | [diff] [blame] | 335 | { |
| 336 | .gpio = 2, /* NC */ |
| 337 | .settings = { |
| 338 | [GPIOMUX_SUSPENDED] = &gpio_nc_cfg, |
| 339 | }, |
| 340 | }, |
| 341 | { |
| 342 | .gpio = 3, /* NC */ |
| 343 | .settings = { |
| 344 | [GPIOMUX_SUSPENDED] = &gpio_nc_cfg, |
| 345 | }, |
| 346 | }, |
| 347 | { |
| 348 | .gpio = 4, /* NC */ |
| 349 | .settings = { |
| 350 | [GPIOMUX_SUSPENDED] = &gpio_nc_cfg, |
| 351 | }, |
| 352 | }, |
| 353 | { |
| 354 | .gpio = 14, /* NC */ |
| 355 | .settings = { |
| 356 | [GPIOMUX_SUSPENDED] = &gpio_nc_cfg, |
| 357 | }, |
| 358 | }, |
| 359 | }; |
| 360 | |
Xiaocheng Li | 44e68fe | 2013-09-02 16:55:04 +0800 | [diff] [blame] | 361 | static struct msm_gpiomux_config msm_skuf_goodix_configs[] __initdata = { |
Bingzhe Cai | 38869af | 2013-07-29 11:36:40 +0800 | [diff] [blame] | 362 | { |
| 363 | .gpio = 15, /* LDO EN */ |
| 364 | .settings = { |
| 365 | [GPIOMUX_ACTIVE] = &goodix_ldo_en_act_cfg, |
| 366 | [GPIOMUX_SUSPENDED] = &goodix_ldo_en_sus_cfg, |
| 367 | }, |
| 368 | }, |
| 369 | { |
| 370 | .gpio = 16, /* RESET */ |
| 371 | .settings = { |
| 372 | [GPIOMUX_ACTIVE] = &goodix_reset_act_cfg, |
| 373 | [GPIOMUX_SUSPENDED] = &goodix_reset_sus_cfg, |
| 374 | }, |
| 375 | }, |
| 376 | { |
| 377 | .gpio = 17, /* INT */ |
| 378 | .settings = { |
| 379 | [GPIOMUX_ACTIVE] = &goodix_int_act_cfg, |
| 380 | [GPIOMUX_SUSPENDED] = &goodix_int_sus_cfg, |
| 381 | }, |
| 382 | }, |
| 383 | { |
| 384 | .gpio = 18, /* BLSP1 QUP5 I2C_SDA */ |
| 385 | .settings = { |
Bingzhe Cai | 1248722 | 2013-09-02 22:37:36 +0800 | [diff] [blame] | 386 | [GPIOMUX_ACTIVE] = &gpio_i2c_config, |
Bingzhe Cai | 38869af | 2013-07-29 11:36:40 +0800 | [diff] [blame] | 387 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 388 | }, |
| 389 | }, |
| 390 | { |
| 391 | .gpio = 19, /* BLSP1 QUP5 I2C_SCL */ |
| 392 | .settings = { |
Bingzhe Cai | 1248722 | 2013-09-02 22:37:36 +0800 | [diff] [blame] | 393 | [GPIOMUX_ACTIVE] = &gpio_i2c_config, |
Bingzhe Cai | 38869af | 2013-07-29 11:36:40 +0800 | [diff] [blame] | 394 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 395 | }, |
| 396 | }, |
| 397 | }; |
| 398 | |
| 399 | static struct gpiomux_setting nfc_ldo_act_cfg = { |
| 400 | .func = GPIOMUX_FUNC_GPIO, |
| 401 | .drv = GPIOMUX_DRV_6MA, |
| 402 | .pull = GPIOMUX_PULL_UP, |
| 403 | }; |
| 404 | |
| 405 | static struct gpiomux_setting nfc_ldo_sus_cfg = { |
| 406 | .func = GPIOMUX_FUNC_GPIO, |
| 407 | .drv = GPIOMUX_DRV_6MA, |
| 408 | .pull = GPIOMUX_PULL_UP, |
| 409 | }; |
| 410 | |
| 411 | static struct gpiomux_setting nfc_regc_act_cfg = { |
| 412 | .func = GPIOMUX_FUNC_GPIO, |
| 413 | .drv = GPIOMUX_DRV_6MA, |
| 414 | .pull = GPIOMUX_PULL_UP, |
| 415 | }; |
| 416 | |
| 417 | static struct gpiomux_setting nfc_regc_sus_cfg = { |
| 418 | .func = GPIOMUX_FUNC_GPIO, |
Xiaocheng Li | 44e68fe | 2013-09-02 16:55:04 +0800 | [diff] [blame] | 419 | .drv = GPIOMUX_DRV_2MA, |
| 420 | .pull = GPIOMUX_PULL_NONE, |
| 421 | .dir = GPIOMUX_OUT_LOW, |
Bingzhe Cai | 38869af | 2013-07-29 11:36:40 +0800 | [diff] [blame] | 422 | }; |
| 423 | |
| 424 | static struct gpiomux_setting nfc_wake_act_cfg = { |
| 425 | .func = GPIOMUX_FUNC_GPIO, |
| 426 | .drv = GPIOMUX_DRV_6MA, |
| 427 | .pull = GPIOMUX_PULL_UP, |
| 428 | }; |
| 429 | |
| 430 | static struct gpiomux_setting nfc_wake_sus_cfg = { |
| 431 | .func = GPIOMUX_FUNC_GPIO, |
Xiaocheng Li | 44e68fe | 2013-09-02 16:55:04 +0800 | [diff] [blame] | 432 | .drv = GPIOMUX_DRV_2MA, |
| 433 | .pull = GPIOMUX_PULL_NONE, |
| 434 | .dir = GPIOMUX_OUT_LOW, |
Bingzhe Cai | 38869af | 2013-07-29 11:36:40 +0800 | [diff] [blame] | 435 | }; |
| 436 | |
Xiaocheng Li | 44e68fe | 2013-09-02 16:55:04 +0800 | [diff] [blame] | 437 | static struct msm_gpiomux_config msm_skuf_nfc_configs[] __initdata = { |
Bingzhe Cai | 38869af | 2013-07-29 11:36:40 +0800 | [diff] [blame] | 438 | { /* NFC LDO EN */ |
| 439 | .gpio = 0, |
| 440 | .settings = { |
| 441 | [GPIOMUX_ACTIVE] = &nfc_ldo_act_cfg, |
| 442 | [GPIOMUX_SUSPENDED] = &nfc_ldo_sus_cfg, |
| 443 | }, |
| 444 | }, |
| 445 | { /* NFC REGC*/ |
| 446 | .gpio = 1, |
| 447 | .settings = { |
| 448 | [GPIOMUX_ACTIVE] = &nfc_regc_act_cfg, |
| 449 | [GPIOMUX_SUSPENDED] = &nfc_regc_sus_cfg, |
| 450 | }, |
| 451 | }, |
| 452 | { /* NFC WAKE */ |
| 453 | .gpio = 5, |
| 454 | .settings = { |
| 455 | [GPIOMUX_ACTIVE] = &nfc_wake_act_cfg, |
| 456 | [GPIOMUX_SUSPENDED] = &nfc_wake_sus_cfg, |
| 457 | }, |
| 458 | }, |
| 459 | { /* NFC */ |
| 460 | .gpio = 10, /* BLSP1 QUP3 I2C_DAT */ |
| 461 | .settings = { |
Bingzhe Cai | 1248722 | 2013-09-02 22:37:36 +0800 | [diff] [blame] | 462 | [GPIOMUX_ACTIVE] = &gpio_i2c_config, |
Bingzhe Cai | 38869af | 2013-07-29 11:36:40 +0800 | [diff] [blame] | 463 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 464 | }, |
| 465 | }, |
| 466 | { /* NFC */ |
| 467 | .gpio = 11, /* BLSP1 QUP3 I2C_CLK */ |
| 468 | .settings = { |
Bingzhe Cai | 1248722 | 2013-09-02 22:37:36 +0800 | [diff] [blame] | 469 | [GPIOMUX_ACTIVE] = &gpio_i2c_config, |
Bingzhe Cai | 38869af | 2013-07-29 11:36:40 +0800 | [diff] [blame] | 470 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 471 | }, |
| 472 | }, |
| 473 | }; |
| 474 | |
Krishna Konda | 7af5df9 | 2013-03-06 20:35:30 -0800 | [diff] [blame] | 475 | static struct gpiomux_setting sd_card_det_active_config = { |
| 476 | .func = GPIOMUX_FUNC_GPIO, |
| 477 | .drv = GPIOMUX_DRV_2MA, |
| 478 | .pull = GPIOMUX_PULL_NONE, |
| 479 | .dir = GPIOMUX_IN, |
| 480 | }; |
| 481 | |
| 482 | static struct gpiomux_setting sd_card_det_sleep_config = { |
| 483 | .func = GPIOMUX_FUNC_GPIO, |
| 484 | .drv = GPIOMUX_DRV_2MA, |
| 485 | .pull = GPIOMUX_PULL_UP, |
| 486 | .dir = GPIOMUX_IN, |
| 487 | }; |
| 488 | |
| 489 | static struct msm_gpiomux_config sd_card_det __initdata = { |
| 490 | .gpio = 38, |
| 491 | .settings = { |
| 492 | [GPIOMUX_ACTIVE] = &sd_card_det_active_config, |
| 493 | [GPIOMUX_SUSPENDED] = &sd_card_det_sleep_config, |
| 494 | }, |
| 495 | }; |
| 496 | |
Sheng Fang | 6746c3f | 2013-03-19 08:37:13 +0800 | [diff] [blame] | 497 | static struct msm_gpiomux_config wcnss_5wire_interface[] = { |
| 498 | { |
| 499 | .gpio = 40, |
| 500 | .settings = { |
| 501 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 502 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 503 | }, |
| 504 | }, |
| 505 | { |
| 506 | .gpio = 41, |
| 507 | .settings = { |
| 508 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 509 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 510 | }, |
| 511 | }, |
| 512 | { |
| 513 | .gpio = 42, |
| 514 | .settings = { |
| 515 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 516 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 517 | }, |
| 518 | }, |
| 519 | { |
| 520 | .gpio = 43, |
| 521 | .settings = { |
| 522 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 523 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 524 | }, |
| 525 | }, |
| 526 | { |
| 527 | .gpio = 44, |
| 528 | .settings = { |
| 529 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 530 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 531 | }, |
| 532 | }, |
| 533 | }; |
Su Liu | d1c66ee | 2013-03-22 15:29:48 -0700 | [diff] [blame] | 534 | |
| 535 | static struct gpiomux_setting gpio_suspend_config[] = { |
| 536 | { |
| 537 | .func = GPIOMUX_FUNC_GPIO, /* IN-NP */ |
| 538 | .drv = GPIOMUX_DRV_2MA, |
| 539 | .pull = GPIOMUX_PULL_NONE, |
| 540 | }, |
| 541 | { |
| 542 | .func = GPIOMUX_FUNC_GPIO, /* O-LOW */ |
| 543 | .drv = GPIOMUX_DRV_2MA, |
| 544 | .pull = GPIOMUX_PULL_NONE, |
| 545 | .dir = GPIOMUX_OUT_LOW, |
| 546 | }, |
| 547 | }; |
| 548 | |
| 549 | static struct gpiomux_setting cam_settings[] = { |
| 550 | { |
| 551 | .func = GPIOMUX_FUNC_1, /*active 1*/ /* 0 */ |
| 552 | .drv = GPIOMUX_DRV_2MA, |
| 553 | .pull = GPIOMUX_PULL_NONE, |
| 554 | }, |
| 555 | |
| 556 | { |
| 557 | .func = GPIOMUX_FUNC_1, /*suspend*/ /* 1 */ |
| 558 | .drv = GPIOMUX_DRV_2MA, |
| 559 | .pull = GPIOMUX_PULL_DOWN, |
| 560 | }, |
| 561 | |
| 562 | { |
| 563 | .func = GPIOMUX_FUNC_1, /*i2c suspend*/ /* 2 */ |
| 564 | .drv = GPIOMUX_DRV_2MA, |
| 565 | .pull = GPIOMUX_PULL_KEEPER, |
| 566 | }, |
| 567 | |
| 568 | { |
| 569 | .func = GPIOMUX_FUNC_GPIO, /*active 0*/ /* 3 */ |
| 570 | .drv = GPIOMUX_DRV_2MA, |
| 571 | .pull = GPIOMUX_PULL_NONE, |
| 572 | }, |
| 573 | |
| 574 | { |
| 575 | .func = GPIOMUX_FUNC_GPIO, /*suspend 0*/ /* 4 */ |
| 576 | .drv = GPIOMUX_DRV_2MA, |
| 577 | .pull = GPIOMUX_PULL_DOWN, |
| 578 | }, |
| 579 | }; |
| 580 | |
| 581 | |
| 582 | static struct msm_gpiomux_config msm_sensor_configs[] __initdata = { |
| 583 | { |
| 584 | .gpio = 26, /* CAM_MCLK0 */ |
| 585 | .settings = { |
| 586 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 587 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 588 | }, |
| 589 | }, |
| 590 | { |
| 591 | .gpio = 27, /* CAM_MCLK1 */ |
| 592 | .settings = { |
| 593 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 594 | [GPIOMUX_SUSPENDED] = &cam_settings[1], |
| 595 | }, |
| 596 | |
| 597 | }, |
| 598 | { |
| 599 | .gpio = 29, /* CCI_I2C_SDA0 */ |
| 600 | .settings = { |
| 601 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 602 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
| 603 | }, |
| 604 | }, |
| 605 | { |
| 606 | .gpio = 30, /* CCI_I2C_SCL0 */ |
| 607 | .settings = { |
| 608 | [GPIOMUX_ACTIVE] = &cam_settings[0], |
| 609 | [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0], |
| 610 | }, |
| 611 | }, |
| 612 | { |
| 613 | .gpio = 36, /* CAM1_STANDBY_N */ |
| 614 | .settings = { |
| 615 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 616 | [GPIOMUX_SUSPENDED] = &cam_settings[4], |
| 617 | }, |
| 618 | }, |
| 619 | { |
| 620 | .gpio = 37, /* CAM1_RST_N */ |
| 621 | .settings = { |
| 622 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 623 | [GPIOMUX_SUSPENDED] = &cam_settings[4], |
| 624 | }, |
| 625 | }, |
| 626 | { |
| 627 | .gpio = 35, /* CAM2_STANDBY_N */ |
| 628 | .settings = { |
| 629 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 630 | [GPIOMUX_SUSPENDED] = &cam_settings[4], |
| 631 | }, |
| 632 | }, |
| 633 | { |
| 634 | .gpio = 28, /* CAM2_RST_N */ |
| 635 | .settings = { |
| 636 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 637 | [GPIOMUX_SUSPENDED] = &cam_settings[4], |
| 638 | }, |
| 639 | }, |
| 640 | |
| 641 | }; |
| 642 | |
Su Liu | dc54939 | 2013-08-30 19:05:39 +0800 | [diff] [blame] | 643 | static struct msm_gpiomux_config msm_sensor_configs_skuf_plus[] __initdata = { |
| 644 | { |
| 645 | .gpio = 22, /* CAM1_VDD */ |
| 646 | .settings = { |
| 647 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 648 | [GPIOMUX_SUSPENDED] = &cam_settings[4], |
| 649 | }, |
| 650 | }, |
| 651 | { |
| 652 | .gpio = 34, /* CAM1 VCM_PWDN */ |
| 653 | .settings = { |
| 654 | [GPIOMUX_ACTIVE] = &cam_settings[3], |
| 655 | [GPIOMUX_SUSPENDED] = &cam_settings[4], |
| 656 | }, |
| 657 | }, |
| 658 | }; |
| 659 | |
| 660 | |
Banajit Goswami | 25715c5 | 2013-05-10 11:45:47 -0700 | [diff] [blame] | 661 | static struct gpiomux_setting auxpcm_act_cfg = { |
| 662 | .func = GPIOMUX_FUNC_1, |
| 663 | .drv = GPIOMUX_DRV_8MA, |
| 664 | .pull = GPIOMUX_PULL_NONE, |
| 665 | }; |
| 666 | |
| 667 | static struct gpiomux_setting auxpcm_sus_cfg = { |
| 668 | .func = GPIOMUX_FUNC_1, |
| 669 | .drv = GPIOMUX_DRV_2MA, |
| 670 | .pull = GPIOMUX_PULL_DOWN, |
| 671 | }; |
| 672 | |
| 673 | static struct msm_gpiomux_config msm_auxpcm_configs[] __initdata = { |
| 674 | { |
| 675 | .gpio = 63, |
| 676 | .settings = { |
| 677 | [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg, |
| 678 | [GPIOMUX_ACTIVE] = &auxpcm_act_cfg, |
| 679 | }, |
| 680 | }, |
| 681 | { |
| 682 | .gpio = 64, |
| 683 | .settings = { |
| 684 | [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg, |
| 685 | [GPIOMUX_ACTIVE] = &auxpcm_act_cfg, |
| 686 | }, |
| 687 | }, |
| 688 | { |
| 689 | .gpio = 65, |
| 690 | .settings = { |
| 691 | [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg, |
| 692 | [GPIOMUX_ACTIVE] = &auxpcm_act_cfg, |
| 693 | }, |
| 694 | }, |
| 695 | { |
| 696 | .gpio = 66, |
| 697 | .settings = { |
| 698 | [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg, |
| 699 | [GPIOMUX_ACTIVE] = &auxpcm_act_cfg, |
| 700 | }, |
| 701 | }, |
| 702 | }; |
| 703 | |
David Collins | 091bb24 | 2013-05-23 11:08:24 -0700 | [diff] [blame] | 704 | static struct gpiomux_setting usb_otg_sw_cfg = { |
| 705 | .func = GPIOMUX_FUNC_GPIO, |
| 706 | .drv = GPIOMUX_DRV_2MA, |
| 707 | .dir = GPIOMUX_OUT_LOW, |
| 708 | }; |
| 709 | |
| 710 | static struct msm_gpiomux_config usb_otg_sw_configs[] __initdata = { |
| 711 | { |
| 712 | .gpio = 67, |
| 713 | .settings = { |
| 714 | [GPIOMUX_SUSPENDED] = &usb_otg_sw_cfg, |
| 715 | }, |
| 716 | }, |
| 717 | }; |
| 718 | |
Krishna Konda | fdd71d8 | 2013-07-08 16:30:16 -0700 | [diff] [blame] | 719 | #ifdef CONFIG_MMC_MSM_SDC3_SUPPORT |
| 720 | static struct gpiomux_setting sdc3_clk_actv_cfg = { |
| 721 | .func = GPIOMUX_FUNC_2, |
| 722 | .drv = GPIOMUX_DRV_8MA, |
| 723 | .pull = GPIOMUX_PULL_NONE, |
| 724 | }; |
| 725 | |
| 726 | static struct gpiomux_setting sdc3_cmd_data_0_3_actv_cfg = { |
| 727 | .func = GPIOMUX_FUNC_2, |
| 728 | .drv = GPIOMUX_DRV_8MA, |
| 729 | .pull = GPIOMUX_PULL_UP, |
| 730 | }; |
| 731 | |
| 732 | static struct gpiomux_setting sdc3_suspend_cfg = { |
| 733 | .func = GPIOMUX_FUNC_GPIO, |
| 734 | .drv = GPIOMUX_DRV_2MA, |
| 735 | .pull = GPIOMUX_PULL_DOWN, |
| 736 | }; |
| 737 | |
| 738 | static struct gpiomux_setting sdc3_data_1_suspend_cfg = { |
| 739 | .func = GPIOMUX_FUNC_GPIO, |
| 740 | .drv = GPIOMUX_DRV_2MA, |
| 741 | .pull = GPIOMUX_PULL_UP, |
| 742 | }; |
| 743 | |
| 744 | static struct msm_gpiomux_config msm8226_sdc3_configs[] __initdata = { |
| 745 | { |
| 746 | /* DAT3 */ |
| 747 | .gpio = 39, |
| 748 | .settings = { |
| 749 | [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg, |
| 750 | [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg, |
| 751 | }, |
| 752 | }, |
| 753 | { |
| 754 | /* DAT2 */ |
| 755 | .gpio = 40, |
| 756 | .settings = { |
| 757 | [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg, |
| 758 | [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg, |
| 759 | }, |
| 760 | }, |
| 761 | { |
| 762 | /* DAT1 */ |
| 763 | .gpio = 41, |
| 764 | .settings = { |
| 765 | [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg, |
| 766 | [GPIOMUX_SUSPENDED] = &sdc3_data_1_suspend_cfg, |
| 767 | }, |
| 768 | }, |
| 769 | { |
| 770 | /* DAT0 */ |
| 771 | .gpio = 42, |
| 772 | .settings = { |
| 773 | [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg, |
| 774 | [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg, |
| 775 | }, |
| 776 | }, |
| 777 | { |
| 778 | /* CMD */ |
| 779 | .gpio = 43, |
| 780 | .settings = { |
| 781 | [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg, |
| 782 | [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg, |
| 783 | }, |
| 784 | }, |
| 785 | { |
| 786 | /* CLK */ |
| 787 | .gpio = 44, |
| 788 | .settings = { |
| 789 | [GPIOMUX_ACTIVE] = &sdc3_clk_actv_cfg, |
| 790 | [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg, |
| 791 | }, |
| 792 | }, |
| 793 | }; |
| 794 | |
| 795 | static void msm_gpiomux_sdc3_install(void) |
| 796 | { |
| 797 | msm_gpiomux_install(msm8226_sdc3_configs, |
| 798 | ARRAY_SIZE(msm8226_sdc3_configs)); |
| 799 | } |
| 800 | #else |
| 801 | static void msm_gpiomux_sdc3_install(void) {} |
| 802 | #endif /* CONFIG_MMC_MSM_SDC3_SUPPORT */ |
| 803 | |
Syed Rameez Mustafa | 9d16c4f | 2012-09-10 14:16:55 -0700 | [diff] [blame] | 804 | void __init msm8226_init_gpiomux(void) |
| 805 | { |
| 806 | int rc; |
| 807 | |
Rohit Vaswani | 341c203 | 2012-11-08 18:49:29 -0800 | [diff] [blame] | 808 | rc = msm_gpiomux_init_dt(); |
Syed Rameez Mustafa | 9d16c4f | 2012-09-10 14:16:55 -0700 | [diff] [blame] | 809 | if (rc) { |
Rohit Vaswani | 341c203 | 2012-11-08 18:49:29 -0800 | [diff] [blame] | 810 | pr_err("%s failed %d\n", __func__, rc); |
Syed Rameez Mustafa | 9d16c4f | 2012-09-10 14:16:55 -0700 | [diff] [blame] | 811 | return; |
| 812 | } |
Gilad Avidov | 28e18eb | 2012-11-21 18:13:25 -0700 | [diff] [blame] | 813 | |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 814 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
| 815 | msm_gpiomux_install(msm_eth_configs, ARRAY_SIZE(msm_eth_configs)); |
Syed Rameez Mustafa | 01d15eb | 2012-12-20 15:30:17 -0800 | [diff] [blame] | 816 | #endif |
Amy Maloche | 24c59dd | 2013-03-05 11:43:55 -0800 | [diff] [blame] | 817 | msm_gpiomux_install(msm_keypad_configs, |
| 818 | ARRAY_SIZE(msm_keypad_configs)); |
Gilad Avidov | 28e18eb | 2012-11-21 18:13:25 -0700 | [diff] [blame] | 819 | |
Xiaocheng Li | 44e68fe | 2013-09-02 16:55:04 +0800 | [diff] [blame] | 820 | if (of_board_is_skuf()) |
| 821 | msm_gpiomux_install(msm_skuf_blsp_configs, |
| 822 | ARRAY_SIZE(msm_skuf_blsp_configs)); |
Bingzhe Cai | 38869af | 2013-07-29 11:36:40 +0800 | [diff] [blame] | 823 | else |
| 824 | msm_gpiomux_install(msm_blsp_configs, |
| 825 | ARRAY_SIZE(msm_blsp_configs)); |
| 826 | |
Sheng Fang | 6746c3f | 2013-03-19 08:37:13 +0800 | [diff] [blame] | 827 | msm_gpiomux_install(wcnss_5wire_interface, |
| 828 | ARRAY_SIZE(wcnss_5wire_interface)); |
Krishna Konda | 7af5df9 | 2013-03-06 20:35:30 -0800 | [diff] [blame] | 829 | |
| 830 | msm_gpiomux_install(&sd_card_det, 1); |
Xiaocheng Li | 44e68fe | 2013-09-02 16:55:04 +0800 | [diff] [blame] | 831 | if (of_board_is_skuf()) |
| 832 | msm_gpiomux_install(msm_skuf_goodix_configs, |
| 833 | ARRAY_SIZE(msm_skuf_goodix_configs)); |
Bingzhe Cai | 38869af | 2013-07-29 11:36:40 +0800 | [diff] [blame] | 834 | else |
| 835 | msm_gpiomux_install(msm_synaptics_configs, |
| 836 | ARRAY_SIZE(msm_synaptics_configs)); |
| 837 | |
Xiaocheng Li | 44e68fe | 2013-09-02 16:55:04 +0800 | [diff] [blame] | 838 | if (of_board_is_skuf()) |
| 839 | msm_gpiomux_install(msm_skuf_nfc_configs, |
| 840 | ARRAY_SIZE(msm_skuf_nfc_configs)); |
Bingzhe Cai | 38869af | 2013-07-29 11:36:40 +0800 | [diff] [blame] | 841 | |
Aravind Venkateswaran | f60fb21 | 2013-03-08 13:57:06 -0800 | [diff] [blame] | 842 | msm_gpiomux_install_nowrite(msm_lcd_configs, |
| 843 | ARRAY_SIZE(msm_lcd_configs)); |
Su Liu | dc54939 | 2013-08-30 19:05:39 +0800 | [diff] [blame] | 844 | |
Su Liu | d1c66ee | 2013-03-22 15:29:48 -0700 | [diff] [blame] | 845 | msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs)); |
Su Liu | dc54939 | 2013-08-30 19:05:39 +0800 | [diff] [blame] | 846 | |
| 847 | if (of_board_is_skuf()) |
| 848 | msm_gpiomux_install(msm_sensor_configs_skuf_plus, |
| 849 | ARRAY_SIZE(msm_sensor_configs_skuf_plus)); |
| 850 | |
Banajit Goswami | 25715c5 | 2013-05-10 11:45:47 -0700 | [diff] [blame] | 851 | msm_gpiomux_install(msm_auxpcm_configs, |
| 852 | ARRAY_SIZE(msm_auxpcm_configs)); |
David Collins | 091bb24 | 2013-05-23 11:08:24 -0700 | [diff] [blame] | 853 | |
Syed Rameez Mustafa | 7ef6158 | 2013-06-07 16:14:58 -0700 | [diff] [blame] | 854 | if (of_board_is_cdp() || of_board_is_mtp() || of_board_is_xpm()) |
David Collins | 091bb24 | 2013-05-23 11:08:24 -0700 | [diff] [blame] | 855 | msm_gpiomux_install(usb_otg_sw_configs, |
| 856 | ARRAY_SIZE(usb_otg_sw_configs)); |
Krishna Konda | fdd71d8 | 2013-07-08 16:30:16 -0700 | [diff] [blame] | 857 | |
| 858 | msm_gpiomux_sdc3_install(); |
Pavankumar Kondeti | 45eb66f | 2013-09-24 15:43:25 +0530 | [diff] [blame] | 859 | |
| 860 | /* |
| 861 | * HSIC STROBE gpio is also used by the ethernet. Install HSIC |
| 862 | * gpio mux config only when HSIC is enabled. HSIC config will |
| 863 | * be disabled when ethernet config is enabled. |
| 864 | */ |
| 865 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
Pavankumar Kondeti | 0d6ed96 | 2013-09-25 14:25:52 +0530 | [diff] [blame] | 866 | if (machine_is_msm8926()) { |
| 867 | msm_hsic_configs[0].gpio = 119; /* STROBE */ |
| 868 | msm_hsic_configs[1].gpio = 120; /* DATA */ |
| 869 | } |
Pavankumar Kondeti | 45eb66f | 2013-09-24 15:43:25 +0530 | [diff] [blame] | 870 | msm_gpiomux_install(msm_hsic_configs, ARRAY_SIZE(msm_hsic_configs)); |
| 871 | #endif |
Syed Rameez Mustafa | 9d16c4f | 2012-09-10 14:16:55 -0700 | [diff] [blame] | 872 | } |