Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | * |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 12 | */ |
| 13 | #include <linux/kernel.h> |
| 14 | #include <linux/platform_device.h> |
| 15 | #include <linux/io.h> |
| 16 | #include <linux/irq.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 17 | #include <linux/i2c.h> |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 18 | #include <linux/i2c/sx150x.h> |
Amir Samuelov | 5137e39 | 2011-09-21 17:31:25 +0300 | [diff] [blame] | 19 | #include <linux/i2c/isl9519.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 20 | #include <linux/gpio.h> |
| 21 | #include <linux/msm_ssbi.h> |
| 22 | #include <linux/regulator/gpio-regulator.h> |
| 23 | #include <linux/mfd/pm8xxx/pm8921.h> |
Siddartha Mohanadoss | af91d90 | 2011-10-20 10:23:34 -0700 | [diff] [blame] | 24 | #include <linux/mfd/pm8xxx/pm8xxx-adc.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 25 | #include <linux/regulator/consumer.h> |
| 26 | #include <linux/spi/spi.h> |
| 27 | #include <linux/slimbus/slimbus.h> |
| 28 | #include <linux/bootmem.h> |
Lucille Sylvester | 34ec369 | 2011-08-16 16:28:04 -0600 | [diff] [blame] | 29 | #include <linux/msm_kgsl.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 30 | #ifdef CONFIG_ANDROID_PMEM |
| 31 | #include <linux/android_pmem.h> |
| 32 | #endif |
| 33 | #include <linux/cyttsp.h> |
| 34 | #include <linux/dma-mapping.h> |
| 35 | #include <linux/platform_data/qcom_crypto_device.h> |
Ankur Nandwani | b0039b0 | 2011-08-09 14:00:45 -0700 | [diff] [blame] | 36 | #include <linux/platform_data/qcom_wcnss_device.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 37 | #include <linux/leds.h> |
| 38 | #include <linux/leds-pm8xxx.h> |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 39 | #include <linux/i2c/atmel_mxt_ts.h> |
Siddartha Mohanadoss | ba21fdd | 2011-08-18 10:05:27 -0700 | [diff] [blame] | 40 | #include <linux/msm_tsens.h> |
Stepan Moskovchenko | 93d79ec | 2011-09-21 16:52:16 -0700 | [diff] [blame] | 41 | #include <linux/ks8851.h> |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 42 | #include <linux/i2c/isa1200.h> |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 43 | |
| 44 | #include <asm/mach-types.h> |
| 45 | #include <asm/mach/arch.h> |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 46 | #include <asm/setup.h> |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 47 | #include <asm/hardware/gic.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 48 | #include <asm/mach/mmc.h> |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 49 | |
| 50 | #include <mach/board.h> |
| 51 | #include <mach/msm_iomap.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 52 | #include <mach/msm_spi.h> |
| 53 | #ifdef CONFIG_USB_MSM_OTG_72K |
| 54 | #include <mach/msm_hsusb.h> |
| 55 | #else |
| 56 | #include <linux/usb/msm_hsusb.h> |
| 57 | #endif |
| 58 | #include <linux/usb/android.h> |
| 59 | #include <mach/usbdiag.h> |
| 60 | #include <mach/socinfo.h> |
| 61 | #include <mach/rpm.h> |
| 62 | #include <mach/gpio.h> |
Rohit Vaswani | a513aa8d | 2011-07-18 15:14:28 -0700 | [diff] [blame] | 63 | #include <mach/gpiomux.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 64 | #include <mach/msm_bus_board.h> |
| 65 | #include <mach/msm_memtypes.h> |
| 66 | #include <mach/dma.h> |
| 67 | #include <mach/msm_dsps.h> |
| 68 | #include <mach/msm_xo.h> |
Abhijeet Dharmapurikar | 6d565fd | 2011-09-15 18:49:56 -0700 | [diff] [blame] | 69 | #include <mach/restart.h> |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 70 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 71 | #ifdef CONFIG_WCD9310_CODEC |
| 72 | #include <linux/slimbus/slimbus.h> |
| 73 | #include <linux/mfd/wcd9310/core.h> |
| 74 | #include <linux/mfd/wcd9310/pdata.h> |
| 75 | #endif |
| 76 | |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 77 | #include <linux/ion.h> |
| 78 | #include <mach/ion.h> |
Joel King | b8352a1 | 2011-11-15 18:46:24 -0800 | [diff] [blame] | 79 | #include <mach/mdm2.h> |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 80 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 81 | #include "timer.h" |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 82 | #include "devices.h" |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 83 | #include "devices-msm8x60.h" |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 84 | #include "spm.h" |
| 85 | #include "board-msm8960.h" |
| 86 | #include "pm.h" |
| 87 | #include "cpuidle.h" |
| 88 | #include "rpm_resources.h" |
| 89 | #include "mpm.h" |
Matt Wagantall | 6d9ebee | 2011-08-26 12:15:24 -0700 | [diff] [blame] | 90 | #include "acpuclock.h" |
David Collins | 4c31a87 | 2011-08-31 10:07:10 -0700 | [diff] [blame] | 91 | #include "rpm_log.h" |
Naveen Ramaraj | 76483ad | 2011-09-06 14:25:44 -0700 | [diff] [blame] | 92 | #include "smd_private.h" |
Maheshkumar Sivasubramanian | 8ccc16e | 2011-10-25 15:59:57 -0600 | [diff] [blame] | 93 | #include "pm-boot.h" |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 94 | #include "msm_watchdog.h" |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 95 | #include "board-msm8960.h" |
| 96 | |
Joel King | b8352a1 | 2011-11-15 18:46:24 -0800 | [diff] [blame] | 97 | #define PLATFORM_IS_CHARM25() \ |
| 98 | (machine_is_msm8960_cdp() && \ |
| 99 | (socinfo_get_platform_subtype() == 1) \ |
| 100 | ) |
| 101 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 102 | static struct platform_device msm_fm_platform_init = { |
| 103 | .name = "iris_fm", |
| 104 | .id = -1, |
| 105 | }; |
| 106 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 107 | #define KS8851_RST_GPIO 89 |
| 108 | #define KS8851_IRQ_GPIO 90 |
| 109 | |
Harini Jayaraman | 608d046 | 2011-08-09 19:10:03 -0600 | [diff] [blame] | 110 | /* The SPI configurations apply to GSBI 1*/ |
| 111 | static struct gpiomux_setting spi_active = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 112 | .func = GPIOMUX_FUNC_1, |
Stepan Moskovchenko | a69f905 | 2011-10-26 17:47:18 -0700 | [diff] [blame] | 113 | .drv = GPIOMUX_DRV_12MA, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 114 | .pull = GPIOMUX_PULL_NONE, |
| 115 | }; |
| 116 | |
Harini Jayaraman | 608d046 | 2011-08-09 19:10:03 -0600 | [diff] [blame] | 117 | static struct gpiomux_setting spi_suspended_config = { |
| 118 | .func = GPIOMUX_FUNC_GPIO, |
| 119 | .drv = GPIOMUX_DRV_2MA, |
| 120 | .pull = GPIOMUX_PULL_DOWN, |
| 121 | }; |
| 122 | |
Chandan Uddaraju | 15e54b9 | 2011-09-12 10:52:36 -0700 | [diff] [blame] | 123 | static struct gpiomux_setting spi_active_config2 = { |
| 124 | .func = GPIOMUX_FUNC_2, |
| 125 | .drv = GPIOMUX_DRV_8MA, |
| 126 | .pull = GPIOMUX_PULL_NONE, |
| 127 | }; |
| 128 | |
| 129 | static struct gpiomux_setting spi_suspended_config2 = { |
| 130 | .func = GPIOMUX_FUNC_GPIO, |
| 131 | .drv = GPIOMUX_DRV_2MA, |
| 132 | .pull = GPIOMUX_PULL_UP, |
| 133 | }; |
| 134 | |
Mohan Pallaka | fd9a8f1 | 2011-09-23 11:50:38 +0530 | [diff] [blame] | 135 | static struct gpiomux_setting gsbi3_suspended_cfg = { |
| 136 | .func = GPIOMUX_FUNC_1, |
| 137 | .drv = GPIOMUX_DRV_2MA, |
| 138 | .pull = GPIOMUX_PULL_KEEPER, |
| 139 | }; |
| 140 | |
| 141 | static struct gpiomux_setting gsbi3_active_cfg = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 142 | .func = GPIOMUX_FUNC_1, |
| 143 | .drv = GPIOMUX_DRV_8MA, |
| 144 | .pull = GPIOMUX_PULL_NONE, |
| 145 | }; |
| 146 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 147 | static struct gpiomux_setting gsbi5 = { |
| 148 | .func = GPIOMUX_FUNC_1, |
| 149 | .drv = GPIOMUX_DRV_8MA, |
| 150 | .pull = GPIOMUX_PULL_NONE, |
| 151 | }; |
| 152 | |
| 153 | static struct gpiomux_setting gsbi10 = { |
| 154 | .func = GPIOMUX_FUNC_2, |
| 155 | .drv = GPIOMUX_DRV_8MA, |
| 156 | .pull = GPIOMUX_PULL_NONE, |
| 157 | }; |
| 158 | |
| 159 | static struct gpiomux_setting gsbi12 = { |
| 160 | .func = GPIOMUX_FUNC_1, |
| 161 | .drv = GPIOMUX_DRV_8MA, |
| 162 | .pull = GPIOMUX_PULL_NONE, |
| 163 | }; |
| 164 | |
| 165 | static struct gpiomux_setting cdc_mclk = { |
| 166 | .func = GPIOMUX_FUNC_1, |
| 167 | .drv = GPIOMUX_DRV_8MA, |
| 168 | .pull = GPIOMUX_PULL_NONE, |
| 169 | }; |
| 170 | |
Bhalchandra Gajare | 0e795c4 | 2011-08-15 18:10:30 -0700 | [diff] [blame] | 171 | static struct gpiomux_setting audio_auxpcm[] = { |
| 172 | /* Suspended state */ |
| 173 | { |
| 174 | .func = GPIOMUX_FUNC_GPIO, |
| 175 | .drv = GPIOMUX_DRV_2MA, |
| 176 | .pull = GPIOMUX_PULL_NONE, |
| 177 | }, |
| 178 | /* Active state */ |
| 179 | { |
| 180 | .func = GPIOMUX_FUNC_1, |
| 181 | .drv = GPIOMUX_DRV_2MA, |
| 182 | .pull = GPIOMUX_PULL_NONE, |
| 183 | }, |
| 184 | }; |
| 185 | |
Stepan Moskovchenko | 93d79ec | 2011-09-21 16:52:16 -0700 | [diff] [blame] | 186 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 187 | static struct gpiomux_setting gpio_eth_config = { |
| 188 | .pull = GPIOMUX_PULL_NONE, |
| 189 | .drv = GPIOMUX_DRV_8MA, |
| 190 | .func = GPIOMUX_FUNC_GPIO, |
| 191 | }; |
Stepan Moskovchenko | 41d16827 | 2011-08-09 17:09:42 -0700 | [diff] [blame] | 192 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 193 | |
| 194 | static struct gpiomux_setting slimbus = { |
| 195 | .func = GPIOMUX_FUNC_1, |
| 196 | .drv = GPIOMUX_DRV_8MA, |
| 197 | .pull = GPIOMUX_PULL_KEEPER, |
| 198 | }; |
| 199 | |
Stepan Moskovchenko | fc70d90 | 2011-11-30 12:39:36 -0800 | [diff] [blame^] | 200 | static struct msm_gpiomux_config msm8960_gpiomux_configs[NR_GPIO_IRQS] = { |
Stepan Moskovchenko | 93d79ec | 2011-09-21 16:52:16 -0700 | [diff] [blame] | 201 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 202 | { |
| 203 | .gpio = KS8851_IRQ_GPIO, |
| 204 | .settings = { |
| 205 | [GPIOMUX_SUSPENDED] = &gpio_eth_config, |
| 206 | } |
| 207 | }, |
| 208 | { |
| 209 | .gpio = KS8851_RST_GPIO, |
| 210 | .settings = { |
| 211 | [GPIOMUX_SUSPENDED] = &gpio_eth_config, |
| 212 | } |
| 213 | }, |
Stepan Moskovchenko | 41d16827 | 2011-08-09 17:09:42 -0700 | [diff] [blame] | 214 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 215 | }; |
| 216 | |
| 217 | static struct msm_gpiomux_config msm8960_gsbi_configs[] __initdata = { |
| 218 | { |
| 219 | .gpio = 6, /* GSBI1 QUP SPI_DATA_MOSI */ |
| 220 | .settings = { |
Harini Jayaraman | 608d046 | 2011-08-09 19:10:03 -0600 | [diff] [blame] | 221 | [GPIOMUX_SUSPENDED] = &spi_suspended_config, |
| 222 | [GPIOMUX_ACTIVE] = &spi_active, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 223 | }, |
| 224 | }, |
| 225 | { |
| 226 | .gpio = 7, /* GSBI1 QUP SPI_DATA_MISO */ |
| 227 | .settings = { |
Harini Jayaraman | 608d046 | 2011-08-09 19:10:03 -0600 | [diff] [blame] | 228 | [GPIOMUX_SUSPENDED] = &spi_suspended_config, |
| 229 | [GPIOMUX_ACTIVE] = &spi_active, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 230 | }, |
| 231 | }, |
| 232 | { |
| 233 | .gpio = 8, /* GSBI1 QUP SPI_CS_N */ |
| 234 | .settings = { |
Harini Jayaraman | 608d046 | 2011-08-09 19:10:03 -0600 | [diff] [blame] | 235 | [GPIOMUX_SUSPENDED] = &spi_suspended_config, |
| 236 | [GPIOMUX_ACTIVE] = &spi_active, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 237 | }, |
| 238 | }, |
| 239 | { |
| 240 | .gpio = 9, /* GSBI1 QUP SPI_CLK */ |
| 241 | .settings = { |
Harini Jayaraman | 608d046 | 2011-08-09 19:10:03 -0600 | [diff] [blame] | 242 | [GPIOMUX_SUSPENDED] = &spi_suspended_config, |
| 243 | [GPIOMUX_ACTIVE] = &spi_active, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 244 | }, |
| 245 | }, |
| 246 | { |
Chandan Uddaraju | 15e54b9 | 2011-09-12 10:52:36 -0700 | [diff] [blame] | 247 | .gpio = 14, /* GSBI1 SPI_CS_1 */ |
| 248 | .settings = { |
| 249 | [GPIOMUX_SUSPENDED] = &spi_suspended_config2, |
| 250 | [GPIOMUX_ACTIVE] = &spi_active_config2, |
| 251 | }, |
| 252 | }, |
| 253 | { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 254 | .gpio = 16, /* GSBI3 I2C QUP SDA */ |
| 255 | .settings = { |
Mohan Pallaka | fd9a8f1 | 2011-09-23 11:50:38 +0530 | [diff] [blame] | 256 | [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg, |
| 257 | [GPIOMUX_ACTIVE] = &gsbi3_active_cfg, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 258 | }, |
| 259 | }, |
| 260 | { |
| 261 | .gpio = 17, /* GSBI3 I2C QUP SCL */ |
| 262 | .settings = { |
Mohan Pallaka | fd9a8f1 | 2011-09-23 11:50:38 +0530 | [diff] [blame] | 263 | [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg, |
| 264 | [GPIOMUX_ACTIVE] = &gsbi3_active_cfg, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 265 | }, |
| 266 | }, |
| 267 | { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 268 | .gpio = 22, /* GSBI5 UART2 */ |
| 269 | .settings = { |
| 270 | [GPIOMUX_SUSPENDED] = &gsbi5, |
| 271 | }, |
| 272 | }, |
| 273 | { |
| 274 | .gpio = 23, /* GSBI5 UART2 */ |
| 275 | .settings = { |
| 276 | [GPIOMUX_SUSPENDED] = &gsbi5, |
| 277 | }, |
| 278 | }, |
| 279 | { |
| 280 | .gpio = 24, /* GSBI5 UART2 */ |
| 281 | .settings = { |
| 282 | [GPIOMUX_SUSPENDED] = &gsbi5, |
| 283 | }, |
| 284 | }, |
| 285 | { |
| 286 | .gpio = 25, /* GSBI5 UART2 */ |
| 287 | .settings = { |
| 288 | [GPIOMUX_SUSPENDED] = &gsbi5, |
| 289 | }, |
| 290 | }, |
| 291 | { |
| 292 | .gpio = 44, /* GSBI12 I2C QUP SDA */ |
| 293 | .settings = { |
| 294 | [GPIOMUX_SUSPENDED] = &gsbi12, |
| 295 | }, |
| 296 | }, |
| 297 | { |
| 298 | .gpio = 45, /* GSBI12 I2C QUP SCL */ |
| 299 | .settings = { |
| 300 | [GPIOMUX_SUSPENDED] = &gsbi12, |
| 301 | }, |
| 302 | }, |
| 303 | { |
| 304 | .gpio = 73, /* GSBI10 I2C QUP SDA */ |
| 305 | .settings = { |
| 306 | [GPIOMUX_SUSPENDED] = &gsbi10, |
| 307 | }, |
| 308 | }, |
| 309 | { |
| 310 | .gpio = 74, /* GSBI10 I2C QUP SCL */ |
| 311 | .settings = { |
| 312 | [GPIOMUX_SUSPENDED] = &gsbi10, |
| 313 | }, |
| 314 | }, |
| 315 | }; |
| 316 | |
| 317 | static struct msm_gpiomux_config msm8960_slimbus_config[] __initdata = { |
| 318 | { |
| 319 | .gpio = 60, /* slimbus data */ |
| 320 | .settings = { |
| 321 | [GPIOMUX_SUSPENDED] = &slimbus, |
| 322 | }, |
| 323 | }, |
| 324 | { |
| 325 | .gpio = 61, /* slimbus clk */ |
| 326 | .settings = { |
| 327 | [GPIOMUX_SUSPENDED] = &slimbus, |
| 328 | }, |
| 329 | }, |
| 330 | }; |
| 331 | |
| 332 | static struct msm_gpiomux_config msm8960_audio_codec_configs[] __initdata = { |
| 333 | { |
| 334 | .gpio = 59, |
| 335 | .settings = { |
| 336 | [GPIOMUX_SUSPENDED] = &cdc_mclk, |
| 337 | }, |
| 338 | }, |
| 339 | }; |
Bhalchandra Gajare | 0e795c4 | 2011-08-15 18:10:30 -0700 | [diff] [blame] | 340 | |
| 341 | static struct msm_gpiomux_config msm8960_audio_auxpcm_configs[] __initdata = { |
| 342 | { |
| 343 | .gpio = 63, |
| 344 | .settings = { |
| 345 | [GPIOMUX_SUSPENDED] = &audio_auxpcm[0], |
| 346 | [GPIOMUX_ACTIVE] = &audio_auxpcm[1], |
| 347 | }, |
| 348 | }, |
| 349 | { |
| 350 | .gpio = 64, |
| 351 | .settings = { |
| 352 | [GPIOMUX_SUSPENDED] = &audio_auxpcm[0], |
| 353 | [GPIOMUX_ACTIVE] = &audio_auxpcm[1], |
| 354 | }, |
| 355 | }, |
| 356 | { |
| 357 | .gpio = 65, |
| 358 | .settings = { |
| 359 | [GPIOMUX_SUSPENDED] = &audio_auxpcm[0], |
| 360 | [GPIOMUX_ACTIVE] = &audio_auxpcm[1], |
| 361 | }, |
| 362 | }, |
| 363 | { |
| 364 | .gpio = 66, |
| 365 | .settings = { |
| 366 | [GPIOMUX_SUSPENDED] = &audio_auxpcm[0], |
| 367 | [GPIOMUX_ACTIVE] = &audio_auxpcm[1], |
| 368 | }, |
| 369 | }, |
| 370 | }; |
| 371 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 372 | static struct gpiomux_setting wcnss_5wire_suspend_cfg = { |
| 373 | .func = GPIOMUX_FUNC_GPIO, |
| 374 | .drv = GPIOMUX_DRV_2MA, |
Ankur Nandwani | ad0d9ac | 2011-09-26 11:49:25 -0700 | [diff] [blame] | 375 | .pull = GPIOMUX_PULL_UP, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 376 | }; |
| 377 | |
| 378 | static struct gpiomux_setting wcnss_5wire_active_cfg = { |
| 379 | .func = GPIOMUX_FUNC_1, |
| 380 | .drv = GPIOMUX_DRV_6MA, |
| 381 | .pull = GPIOMUX_PULL_DOWN, |
| 382 | }; |
| 383 | |
| 384 | static struct msm_gpiomux_config wcnss_5wire_interface[] = { |
| 385 | { |
| 386 | .gpio = 84, |
| 387 | .settings = { |
| 388 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 389 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 390 | }, |
| 391 | }, |
| 392 | { |
| 393 | .gpio = 85, |
| 394 | .settings = { |
| 395 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 396 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 397 | }, |
| 398 | }, |
| 399 | { |
| 400 | .gpio = 86, |
| 401 | .settings = { |
| 402 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 403 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 404 | }, |
| 405 | }, |
| 406 | { |
| 407 | .gpio = 87, |
| 408 | .settings = { |
| 409 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 410 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 411 | }, |
| 412 | }, |
| 413 | { |
| 414 | .gpio = 88, |
| 415 | .settings = { |
| 416 | [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg, |
| 417 | [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg, |
| 418 | }, |
| 419 | }, |
| 420 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 421 | |
| 422 | static struct gpiomux_setting cyts_resout_sus_cfg = { |
| 423 | .func = GPIOMUX_FUNC_GPIO, |
| 424 | .drv = GPIOMUX_DRV_6MA, |
| 425 | .pull = GPIOMUX_PULL_UP, |
| 426 | }; |
| 427 | |
| 428 | static struct gpiomux_setting cyts_resout_act_cfg = { |
| 429 | .func = GPIOMUX_FUNC_GPIO, |
| 430 | .drv = GPIOMUX_DRV_6MA, |
| 431 | .pull = GPIOMUX_PULL_UP, |
| 432 | }; |
| 433 | |
| 434 | static struct gpiomux_setting cyts_sleep_sus_cfg = { |
| 435 | .func = GPIOMUX_FUNC_GPIO, |
| 436 | .drv = GPIOMUX_DRV_6MA, |
| 437 | .pull = GPIOMUX_PULL_DOWN, |
| 438 | }; |
| 439 | |
| 440 | static struct gpiomux_setting cyts_sleep_act_cfg = { |
| 441 | .func = GPIOMUX_FUNC_GPIO, |
| 442 | .drv = GPIOMUX_DRV_6MA, |
| 443 | .pull = GPIOMUX_PULL_DOWN, |
| 444 | }; |
| 445 | |
| 446 | static struct gpiomux_setting cyts_int_act_cfg = { |
| 447 | .func = GPIOMUX_FUNC_GPIO, |
| 448 | .drv = GPIOMUX_DRV_8MA, |
| 449 | .pull = GPIOMUX_PULL_UP, |
| 450 | }; |
| 451 | |
| 452 | static struct gpiomux_setting cyts_int_sus_cfg = { |
| 453 | .func = GPIOMUX_FUNC_GPIO, |
| 454 | .drv = GPIOMUX_DRV_2MA, |
Mohan Pallaka | cbc5d16 | 2011-09-13 15:23:21 +0530 | [diff] [blame] | 455 | .pull = GPIOMUX_PULL_DOWN, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 456 | }; |
| 457 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 458 | static struct msm_gpiomux_config msm8960_cyts_configs[] __initdata = { |
| 459 | { /* TS INTERRUPT */ |
| 460 | .gpio = 11, |
| 461 | .settings = { |
| 462 | [GPIOMUX_ACTIVE] = &cyts_int_act_cfg, |
| 463 | [GPIOMUX_SUSPENDED] = &cyts_int_sus_cfg, |
| 464 | }, |
| 465 | }, |
| 466 | { /* TS SLEEP */ |
| 467 | .gpio = 50, |
| 468 | .settings = { |
| 469 | [GPIOMUX_ACTIVE] = &cyts_sleep_act_cfg, |
| 470 | [GPIOMUX_SUSPENDED] = &cyts_sleep_sus_cfg, |
| 471 | }, |
| 472 | }, |
| 473 | { /* TS RESOUT */ |
| 474 | .gpio = 52, |
| 475 | .settings = { |
| 476 | [GPIOMUX_ACTIVE] = &cyts_resout_act_cfg, |
| 477 | [GPIOMUX_SUSPENDED] = &cyts_resout_sus_cfg, |
| 478 | }, |
| 479 | }, |
| 480 | }; |
| 481 | |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 482 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
| 483 | static struct gpiomux_setting hsic_act_cfg = { |
| 484 | .func = GPIOMUX_FUNC_1, |
| 485 | .drv = GPIOMUX_DRV_12MA, |
| 486 | .pull = GPIOMUX_PULL_NONE, |
| 487 | }; |
| 488 | |
| 489 | static struct gpiomux_setting hsic_sus_cfg = { |
| 490 | .func = GPIOMUX_FUNC_GPIO, |
| 491 | .drv = GPIOMUX_DRV_2MA, |
| 492 | .pull = GPIOMUX_PULL_DOWN, |
Vamsi Krishna | f0f7f71 | 2011-11-17 18:15:07 -0800 | [diff] [blame] | 493 | .dir = GPIOMUX_OUT_LOW, |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 494 | }; |
| 495 | |
Vijayavardhan Vennapusa | 2b592824f | 2011-11-02 19:51:32 +0530 | [diff] [blame] | 496 | static struct gpiomux_setting hsic_hub_act_cfg = { |
| 497 | .func = GPIOMUX_FUNC_GPIO, |
| 498 | .drv = GPIOMUX_DRV_2MA, |
| 499 | .pull = GPIOMUX_PULL_NONE, |
| 500 | }; |
| 501 | |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 502 | static struct msm_gpiomux_config msm8960_hsic_configs[] = { |
| 503 | { |
| 504 | .gpio = 150, /*HSIC_STROBE */ |
| 505 | .settings = { |
| 506 | [GPIOMUX_ACTIVE] = &hsic_act_cfg, |
| 507 | [GPIOMUX_SUSPENDED] = &hsic_sus_cfg, |
| 508 | }, |
| 509 | }, |
| 510 | { |
| 511 | .gpio = 151, /* HSIC_DATA */ |
| 512 | .settings = { |
| 513 | [GPIOMUX_ACTIVE] = &hsic_act_cfg, |
| 514 | [GPIOMUX_SUSPENDED] = &hsic_sus_cfg, |
| 515 | }, |
| 516 | }, |
Vijayavardhan Vennapusa | 2b592824f | 2011-11-02 19:51:32 +0530 | [diff] [blame] | 517 | { |
| 518 | .gpio = 91, /* HSIC_HUB_RESET */ |
| 519 | .settings = { |
| 520 | [GPIOMUX_ACTIVE] = &hsic_hub_act_cfg, |
| 521 | [GPIOMUX_SUSPENDED] = &hsic_sus_cfg, |
| 522 | }, |
| 523 | }, |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 524 | }; |
| 525 | #endif |
| 526 | |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 527 | #define HAP_SHIFT_LVL_OE_GPIO 47 |
| 528 | |
| 529 | static struct gpiomux_setting hap_lvl_shft_suspended_config = { |
| 530 | .func = GPIOMUX_FUNC_GPIO, |
| 531 | .drv = GPIOMUX_DRV_2MA, |
| 532 | .pull = GPIOMUX_PULL_DOWN, |
| 533 | }; |
| 534 | |
| 535 | static struct gpiomux_setting hap_lvl_shft_active_config = { |
| 536 | .func = GPIOMUX_FUNC_GPIO, |
| 537 | .drv = GPIOMUX_DRV_8MA, |
| 538 | .pull = GPIOMUX_PULL_UP, |
| 539 | }; |
| 540 | |
| 541 | static struct msm_gpiomux_config hap_lvl_shft_config[] __initdata = { |
| 542 | { |
| 543 | .gpio = HAP_SHIFT_LVL_OE_GPIO, |
| 544 | .settings = { |
| 545 | [GPIOMUX_SUSPENDED] = &hap_lvl_shft_suspended_config, |
| 546 | [GPIOMUX_ACTIVE] = &hap_lvl_shft_active_config, |
| 547 | }, |
| 548 | }, |
| 549 | }; |
| 550 | |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 551 | #if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE) |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 552 | |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 553 | struct sx150x_platform_data msm8960_sx150x_data[] = { |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 554 | [SX150X_CAM] = { |
| 555 | .gpio_base = GPIO_CAM_EXPANDER_BASE, |
| 556 | .oscio_is_gpo = false, |
| 557 | .io_pullup_ena = 0x0, |
Nishant Pandit | 474f225 | 2011-07-23 23:17:56 +0530 | [diff] [blame] | 558 | .io_pulldn_ena = 0xc0, |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 559 | .io_open_drain_ena = 0x0, |
| 560 | .irq_summary = -1, |
| 561 | }, |
| 562 | }; |
Nishant Pandit | 474f225 | 2011-07-23 23:17:56 +0530 | [diff] [blame] | 563 | |
| 564 | #endif |
| 565 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 566 | #define MSM_PMEM_ADSP_SIZE 0x3800000 |
Ben Romberger | 09e462d | 2011-08-09 15:24:37 -0700 | [diff] [blame] | 567 | #define MSM_PMEM_AUDIO_SIZE 0x28B000 |
Ravishangar Kalyanam | f4ef728 | 2011-10-10 17:39:48 -0700 | [diff] [blame] | 568 | #ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY |
| 569 | #define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */ |
| 570 | #else |
Chetan Kalyan | a25d076 | 2011-11-11 17:41:29 -0800 | [diff] [blame] | 571 | #define MSM_PMEM_SIZE 0x1C00000 /* 28 Mbytes */ |
Ravishangar Kalyanam | f4ef728 | 2011-10-10 17:39:48 -0700 | [diff] [blame] | 572 | #endif |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 573 | |
| 574 | |
| 575 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
Laura Abbott | 6db11c9 | 2011-11-04 10:31:43 -0700 | [diff] [blame] | 576 | #define MSM_PMEM_KERNEL_EBI1_SIZE 0xB0C000 |
| 577 | #define MSM_ION_EBI_SIZE (MSM_PMEM_SIZE + 0x600000) |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 578 | #define MSM_ION_ADSP_SIZE MSM_PMEM_ADSP_SIZE |
| 579 | #define MSM_ION_HEAP_NUM 4 |
| 580 | #else |
Laura Abbott | 6db11c9 | 2011-11-04 10:31:43 -0700 | [diff] [blame] | 581 | #define MSM_PMEM_KERNEL_EBI1_SIZE 0x110C000 |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 582 | #define MSM_ION_HEAP_NUM 2 |
| 583 | #endif |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 584 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 585 | #ifdef CONFIG_KERNEL_PMEM_EBI_REGION |
| 586 | static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE; |
| 587 | static int __init pmem_kernel_ebi1_size_setup(char *p) |
| 588 | { |
| 589 | pmem_kernel_ebi1_size = memparse(p, NULL); |
| 590 | return 0; |
| 591 | } |
| 592 | early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup); |
| 593 | #endif |
| 594 | |
| 595 | #ifdef CONFIG_ANDROID_PMEM |
| 596 | static unsigned pmem_size = MSM_PMEM_SIZE; |
| 597 | static int __init pmem_size_setup(char *p) |
| 598 | { |
| 599 | pmem_size = memparse(p, NULL); |
| 600 | return 0; |
| 601 | } |
| 602 | early_param("pmem_size", pmem_size_setup); |
| 603 | |
| 604 | static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE; |
| 605 | |
| 606 | static int __init pmem_adsp_size_setup(char *p) |
| 607 | { |
| 608 | pmem_adsp_size = memparse(p, NULL); |
| 609 | return 0; |
| 610 | } |
| 611 | early_param("pmem_adsp_size", pmem_adsp_size_setup); |
| 612 | |
| 613 | static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE; |
| 614 | |
| 615 | static int __init pmem_audio_size_setup(char *p) |
| 616 | { |
| 617 | pmem_audio_size = memparse(p, NULL); |
| 618 | return 0; |
| 619 | } |
| 620 | early_param("pmem_audio_size", pmem_audio_size_setup); |
| 621 | #endif |
| 622 | |
| 623 | #ifdef CONFIG_ANDROID_PMEM |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 624 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 625 | static struct android_pmem_platform_data android_pmem_pdata = { |
| 626 | .name = "pmem", |
| 627 | .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING, |
| 628 | .cached = 1, |
| 629 | .memory_type = MEMTYPE_EBI1, |
| 630 | }; |
| 631 | |
| 632 | static struct platform_device android_pmem_device = { |
| 633 | .name = "android_pmem", |
| 634 | .id = 0, |
| 635 | .dev = {.platform_data = &android_pmem_pdata}, |
| 636 | }; |
| 637 | |
| 638 | static struct android_pmem_platform_data android_pmem_adsp_pdata = { |
| 639 | .name = "pmem_adsp", |
| 640 | .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, |
| 641 | .cached = 0, |
| 642 | .memory_type = MEMTYPE_EBI1, |
| 643 | }; |
| 644 | static struct platform_device android_pmem_adsp_device = { |
| 645 | .name = "android_pmem", |
| 646 | .id = 2, |
| 647 | .dev = { .platform_data = &android_pmem_adsp_pdata }, |
| 648 | }; |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 649 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 650 | |
| 651 | static struct android_pmem_platform_data android_pmem_audio_pdata = { |
| 652 | .name = "pmem_audio", |
| 653 | .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, |
| 654 | .cached = 0, |
| 655 | .memory_type = MEMTYPE_EBI1, |
| 656 | }; |
| 657 | |
| 658 | static struct platform_device android_pmem_audio_device = { |
| 659 | .name = "android_pmem", |
| 660 | .id = 4, |
| 661 | .dev = { .platform_data = &android_pmem_audio_pdata }, |
| 662 | }; |
| 663 | #endif |
| 664 | |
Swaminathan Sathappan | b77c65e9 | 2011-09-30 18:36:09 -0700 | [diff] [blame] | 665 | #define DSP_RAM_BASE_8960 0x8da00000 |
| 666 | #define DSP_RAM_SIZE_8960 0x1800000 |
| 667 | static int dspcrashd_pdata_8960 = 0xDEADDEAD; |
| 668 | |
| 669 | static struct resource resources_dspcrashd_8960[] = { |
| 670 | { |
| 671 | .name = "msm_dspcrashd", |
| 672 | .start = DSP_RAM_BASE_8960, |
| 673 | .end = DSP_RAM_BASE_8960 + DSP_RAM_SIZE_8960, |
| 674 | .flags = IORESOURCE_DMA, |
| 675 | }, |
| 676 | }; |
| 677 | |
Stepan Moskovchenko | fc70d90 | 2011-11-30 12:39:36 -0800 | [diff] [blame^] | 678 | static struct platform_device msm_device_dspcrashd_8960 = { |
Swaminathan Sathappan | b77c65e9 | 2011-09-30 18:36:09 -0700 | [diff] [blame] | 679 | .name = "msm_dspcrashd", |
| 680 | .num_resources = ARRAY_SIZE(resources_dspcrashd_8960), |
| 681 | .resource = resources_dspcrashd_8960, |
| 682 | .dev = { .platform_data = &dspcrashd_pdata_8960 }, |
| 683 | }; |
| 684 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 685 | static struct memtype_reserve msm8960_reserve_table[] __initdata = { |
| 686 | [MEMTYPE_SMI] = { |
| 687 | }, |
| 688 | [MEMTYPE_EBI0] = { |
| 689 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 690 | }, |
| 691 | [MEMTYPE_EBI1] = { |
| 692 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 693 | }, |
| 694 | }; |
| 695 | |
| 696 | static void __init size_pmem_devices(void) |
| 697 | { |
| 698 | #ifdef CONFIG_ANDROID_PMEM |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 699 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 700 | android_pmem_adsp_pdata.size = pmem_adsp_size; |
| 701 | android_pmem_pdata.size = pmem_size; |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 702 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 703 | android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE; |
| 704 | #endif |
| 705 | } |
| 706 | |
| 707 | static void __init reserve_memory_for(struct android_pmem_platform_data *p) |
| 708 | { |
| 709 | msm8960_reserve_table[p->memory_type].size += p->size; |
| 710 | } |
| 711 | |
| 712 | static void __init reserve_pmem_memory(void) |
| 713 | { |
| 714 | #ifdef CONFIG_ANDROID_PMEM |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 715 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 716 | reserve_memory_for(&android_pmem_adsp_pdata); |
| 717 | reserve_memory_for(&android_pmem_pdata); |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 718 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 719 | reserve_memory_for(&android_pmem_audio_pdata); |
| 720 | msm8960_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size; |
| 721 | #endif |
| 722 | } |
| 723 | |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 724 | static int msm8960_paddr_to_memtype(unsigned int paddr) |
| 725 | { |
| 726 | return MEMTYPE_EBI1; |
| 727 | } |
| 728 | |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 729 | #ifdef CONFIG_ION_MSM |
Stepan Moskovchenko | fc70d90 | 2011-11-30 12:39:36 -0800 | [diff] [blame^] | 730 | static struct ion_platform_data ion_pdata = { |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 731 | .nr = MSM_ION_HEAP_NUM, |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 732 | .heaps = { |
| 733 | { |
| 734 | .id = ION_HEAP_SYSTEM_ID, |
| 735 | .type = ION_HEAP_TYPE_SYSTEM, |
| 736 | .name = ION_KMALLOC_HEAP_NAME, |
| 737 | }, |
| 738 | { |
| 739 | .id = ION_HEAP_SYSTEM_CONTIG_ID, |
| 740 | .type = ION_HEAP_TYPE_SYSTEM_CONTIG, |
| 741 | .name = ION_VMALLOC_HEAP_NAME, |
| 742 | }, |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 743 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 744 | { |
| 745 | .id = ION_HEAP_EBI_ID, |
| 746 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 747 | .name = ION_EBI1_HEAP_NAME, |
| 748 | .size = MSM_ION_EBI_SIZE, |
| 749 | .memory_type = ION_EBI_TYPE, |
| 750 | }, |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 751 | { |
| 752 | .id = ION_HEAP_ADSP_ID, |
| 753 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 754 | .name = ION_ADSP_HEAP_NAME, |
| 755 | .size = MSM_ION_ADSP_SIZE, |
| 756 | .memory_type = ION_EBI_TYPE, |
| 757 | }, |
| 758 | #endif |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 759 | } |
| 760 | }; |
| 761 | |
Stepan Moskovchenko | fc70d90 | 2011-11-30 12:39:36 -0800 | [diff] [blame^] | 762 | static struct platform_device ion_dev = { |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 763 | .name = "ion-msm", |
| 764 | .id = 1, |
| 765 | .dev = { .platform_data = &ion_pdata }, |
| 766 | }; |
| 767 | #endif |
| 768 | |
| 769 | static void reserve_ion_memory(void) |
| 770 | { |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 771 | #if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION) |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 772 | msm8960_reserve_table[MEMTYPE_EBI1].size += MSM_ION_EBI_SIZE; |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 773 | msm8960_reserve_table[MEMTYPE_EBI1].size += MSM_ION_ADSP_SIZE; |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 774 | #endif |
| 775 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 776 | static void __init msm8960_calculate_reserve_sizes(void) |
| 777 | { |
| 778 | size_pmem_devices(); |
| 779 | reserve_pmem_memory(); |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 780 | reserve_ion_memory(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 781 | } |
| 782 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 783 | static struct reserve_info msm8960_reserve_info __initdata = { |
| 784 | .memtype_reserve_table = msm8960_reserve_table, |
| 785 | .calculate_reserve_sizes = msm8960_calculate_reserve_sizes, |
| 786 | .paddr_to_memtype = msm8960_paddr_to_memtype, |
| 787 | }; |
| 788 | |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 789 | static int msm8960_memory_bank_size(void) |
| 790 | { |
| 791 | return 1<<29; |
| 792 | } |
| 793 | |
| 794 | static void __init locate_unstable_memory(void) |
| 795 | { |
| 796 | struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1]; |
| 797 | unsigned long bank_size; |
| 798 | unsigned long low, high; |
| 799 | |
| 800 | bank_size = msm8960_memory_bank_size(); |
| 801 | low = meminfo.bank[0].start; |
| 802 | high = mb->start + mb->size; |
Olav Haugan | 62052e4 | 2011-10-28 14:28:32 -0700 | [diff] [blame] | 803 | |
| 804 | /* Check if 32 bit overflow occured */ |
| 805 | if (high < mb->start) |
| 806 | high = ~0UL; |
| 807 | |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 808 | low &= ~(bank_size - 1); |
| 809 | |
| 810 | if (high - low <= bank_size) |
| 811 | return; |
| 812 | msm8960_reserve_info.low_unstable_address = low + bank_size; |
Olav Haugan | 62052e4 | 2011-10-28 14:28:32 -0700 | [diff] [blame] | 813 | /* To avoid overflow of u32 compute max_unstable_size |
| 814 | * by first subtracting low from mb->start) |
| 815 | * */ |
| 816 | msm8960_reserve_info.max_unstable_size = (mb->start - low) + |
| 817 | mb->size - bank_size; |
| 818 | |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 819 | msm8960_reserve_info.bank_size = bank_size; |
| 820 | pr_info("low unstable address %lx max size %lx bank size %lx\n", |
| 821 | msm8960_reserve_info.low_unstable_address, |
| 822 | msm8960_reserve_info.max_unstable_size, |
| 823 | msm8960_reserve_info.bank_size); |
| 824 | } |
| 825 | |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 826 | static void __init place_movable_zone(void) |
| 827 | { |
| 828 | movable_reserved_start = msm8960_reserve_info.low_unstable_address; |
| 829 | movable_reserved_size = msm8960_reserve_info.max_unstable_size; |
| 830 | pr_info("movable zone start %lx size %lx\n", |
| 831 | movable_reserved_start, movable_reserved_size); |
| 832 | } |
| 833 | |
| 834 | static void __init msm8960_early_memory(void) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 835 | { |
| 836 | reserve_info = &msm8960_reserve_info; |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 837 | locate_unstable_memory(); |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 838 | place_movable_zone(); |
| 839 | } |
| 840 | |
| 841 | static void __init msm8960_reserve(void) |
| 842 | { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 843 | msm_reserve(); |
| 844 | } |
| 845 | |
Larry Bassel | a4414b1 | 2011-08-04 11:11:02 -0700 | [diff] [blame] | 846 | static int msm8960_change_memory_power(u64 start, u64 size, |
| 847 | int change_type) |
Larry Bassel | a7eadea | 2011-07-14 10:46:00 -0700 | [diff] [blame] | 848 | { |
Naveen Ramaraj | b03bb1b | 2011-09-12 14:34:31 -0700 | [diff] [blame] | 849 | return soc_change_memory_power(start, size, change_type); |
Larry Bassel | a7eadea | 2011-07-14 10:46:00 -0700 | [diff] [blame] | 850 | } |
| 851 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 852 | static void __init msm8960_allocate_memory_regions(void) |
| 853 | { |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 854 | msm8960_allocate_fb_region(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 855 | } |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 856 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 857 | #ifdef CONFIG_WCD9310_CODEC |
| 858 | |
| 859 | #define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS) |
| 860 | |
Patrick Lai | 3043fba | 2011-08-01 14:15:57 -0700 | [diff] [blame] | 861 | /* Micbias setting is based on 8660 CDP/MTP/FLUID requirement |
| 862 | * 4 micbiases are used to power various analog and digital |
| 863 | * microphones operating at 1800 mV. Technically, all micbiases |
| 864 | * can source from single cfilter since all microphones operate |
| 865 | * at the same voltage level. The arrangement below is to make |
| 866 | * sure all cfilters are exercised. LDO_H regulator ouput level |
| 867 | * does not need to be as high as 2.85V. It is choosen for |
| 868 | * microphone sensitivity purpose. |
| 869 | */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 870 | static struct tabla_pdata tabla_platform_data = { |
| 871 | .slimbus_slave_device = { |
| 872 | .name = "tabla-slave", |
| 873 | .e_addr = {0, 0, 0x10, 0, 0x17, 2}, |
| 874 | }, |
| 875 | .irq = MSM_GPIO_TO_INT(62), |
| 876 | .irq_base = TABLA_INTERRUPT_BASE, |
| 877 | .num_irqs = NR_TABLA_IRQS, |
| 878 | .reset_gpio = PM8921_GPIO_PM_TO_SYS(34), |
Patrick Lai | 3043fba | 2011-08-01 14:15:57 -0700 | [diff] [blame] | 879 | .micbias = { |
| 880 | .ldoh_v = TABLA_LDOH_2P85_V, |
| 881 | .cfilt1_mv = 1800, |
| 882 | .cfilt2_mv = 1800, |
| 883 | .cfilt3_mv = 1800, |
| 884 | .bias1_cfilt_sel = TABLA_CFILT1_SEL, |
| 885 | .bias2_cfilt_sel = TABLA_CFILT2_SEL, |
| 886 | .bias3_cfilt_sel = TABLA_CFILT3_SEL, |
| 887 | .bias4_cfilt_sel = TABLA_CFILT3_SEL, |
| 888 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 889 | }; |
| 890 | |
| 891 | static struct slim_device msm_slim_tabla = { |
| 892 | .name = "tabla-slim", |
| 893 | .e_addr = {0, 1, 0x10, 0, 0x17, 2}, |
| 894 | .dev = { |
| 895 | .platform_data = &tabla_platform_data, |
| 896 | }, |
| 897 | }; |
Santosh Mardi | 60e19d9 | 2011-10-28 01:15:14 +0530 | [diff] [blame] | 898 | |
| 899 | static struct tabla_pdata tabla20_platform_data = { |
| 900 | .slimbus_slave_device = { |
| 901 | .name = "tabla-slave", |
| 902 | .e_addr = {0, 0, 0x60, 0, 0x17, 2}, |
| 903 | }, |
| 904 | .irq = MSM_GPIO_TO_INT(62), |
| 905 | .irq_base = TABLA_INTERRUPT_BASE, |
| 906 | .num_irqs = NR_TABLA_IRQS, |
| 907 | .reset_gpio = PM8921_GPIO_PM_TO_SYS(34), |
| 908 | .micbias = { |
| 909 | .ldoh_v = TABLA_LDOH_2P85_V, |
| 910 | .cfilt1_mv = 1800, |
| 911 | .cfilt2_mv = 1800, |
| 912 | .cfilt3_mv = 1800, |
| 913 | .bias1_cfilt_sel = TABLA_CFILT1_SEL, |
| 914 | .bias2_cfilt_sel = TABLA_CFILT2_SEL, |
| 915 | .bias3_cfilt_sel = TABLA_CFILT3_SEL, |
| 916 | .bias4_cfilt_sel = TABLA_CFILT3_SEL, |
| 917 | } |
| 918 | }; |
| 919 | |
| 920 | static struct slim_device msm_slim_tabla20 = { |
| 921 | .name = "tabla2x-slim", |
| 922 | .e_addr = {0, 1, 0x60, 0, 0x17, 2}, |
| 923 | .dev = { |
| 924 | .platform_data = &tabla20_platform_data, |
| 925 | }, |
| 926 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 927 | #endif |
| 928 | |
| 929 | static struct slim_boardinfo msm_slim_devices[] = { |
| 930 | #ifdef CONFIG_WCD9310_CODEC |
| 931 | { |
| 932 | .bus_num = 1, |
| 933 | .slim_slave = &msm_slim_tabla, |
| 934 | }, |
Santosh Mardi | 60e19d9 | 2011-10-28 01:15:14 +0530 | [diff] [blame] | 935 | { |
| 936 | .bus_num = 1, |
| 937 | .slim_slave = &msm_slim_tabla20, |
| 938 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 939 | #endif |
| 940 | /* add more slimbus slaves as needed */ |
| 941 | }; |
| 942 | |
Yunsen Wang | 5c1a739 | 2011-07-09 19:10:16 -0700 | [diff] [blame] | 943 | #define MSM_WCNSS_PHYS 0x03000000 |
| 944 | #define MSM_WCNSS_SIZE 0x280000 |
| 945 | |
| 946 | static struct resource resources_wcnss_wlan[] = { |
| 947 | { |
| 948 | .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ, |
| 949 | .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ, |
| 950 | .name = "wcnss_wlanrx_irq", |
| 951 | .flags = IORESOURCE_IRQ, |
| 952 | }, |
| 953 | { |
| 954 | .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ, |
| 955 | .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ, |
| 956 | .name = "wcnss_wlantx_irq", |
| 957 | .flags = IORESOURCE_IRQ, |
| 958 | }, |
| 959 | { |
| 960 | .start = MSM_WCNSS_PHYS, |
| 961 | .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1, |
| 962 | .name = "wcnss_mmio", |
| 963 | .flags = IORESOURCE_MEM, |
| 964 | }, |
Ankur Nandwani | ad0d9ac | 2011-09-26 11:49:25 -0700 | [diff] [blame] | 965 | { |
| 966 | .start = 84, |
| 967 | .end = 88, |
| 968 | .name = "wcnss_gpios_5wire", |
| 969 | .flags = IORESOURCE_IO, |
| 970 | }, |
Yunsen Wang | 5c1a739 | 2011-07-09 19:10:16 -0700 | [diff] [blame] | 971 | }; |
| 972 | |
Ankur Nandwani | b0039b0 | 2011-08-09 14:00:45 -0700 | [diff] [blame] | 973 | static struct qcom_wcnss_opts qcom_wcnss_pdata = { |
| 974 | .has_48mhz_xo = 1, |
| 975 | }; |
| 976 | |
Yunsen Wang | 5c1a739 | 2011-07-09 19:10:16 -0700 | [diff] [blame] | 977 | static struct platform_device msm_device_wcnss_wlan = { |
| 978 | .name = "wcnss_wlan", |
| 979 | .id = 0, |
| 980 | .num_resources = ARRAY_SIZE(resources_wcnss_wlan), |
| 981 | .resource = resources_wcnss_wlan, |
Ankur Nandwani | b0039b0 | 2011-08-09 14:00:45 -0700 | [diff] [blame] | 982 | .dev = {.platform_data = &qcom_wcnss_pdata}, |
Yunsen Wang | 5c1a739 | 2011-07-09 19:10:16 -0700 | [diff] [blame] | 983 | }; |
| 984 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 985 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 986 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \ |
| 987 | defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 988 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 989 | |
| 990 | #define QCE_SIZE 0x10000 |
| 991 | #define QCE_0_BASE 0x18500000 |
| 992 | |
| 993 | #define QCE_HW_KEY_SUPPORT 0 |
| 994 | #define QCE_SHA_HMAC_SUPPORT 1 |
| 995 | #define QCE_SHARE_CE_RESOURCE 1 |
| 996 | #define QCE_CE_SHARED 0 |
| 997 | |
| 998 | static struct resource qcrypto_resources[] = { |
| 999 | [0] = { |
| 1000 | .start = QCE_0_BASE, |
| 1001 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 1002 | .flags = IORESOURCE_MEM, |
| 1003 | }, |
| 1004 | [1] = { |
| 1005 | .name = "crypto_channels", |
| 1006 | .start = DMOV_CE_IN_CHAN, |
| 1007 | .end = DMOV_CE_OUT_CHAN, |
| 1008 | .flags = IORESOURCE_DMA, |
| 1009 | }, |
| 1010 | [2] = { |
| 1011 | .name = "crypto_crci_in", |
| 1012 | .start = DMOV_CE_IN_CRCI, |
| 1013 | .end = DMOV_CE_IN_CRCI, |
| 1014 | .flags = IORESOURCE_DMA, |
| 1015 | }, |
| 1016 | [3] = { |
| 1017 | .name = "crypto_crci_out", |
| 1018 | .start = DMOV_CE_OUT_CRCI, |
| 1019 | .end = DMOV_CE_OUT_CRCI, |
| 1020 | .flags = IORESOURCE_DMA, |
| 1021 | }, |
| 1022 | }; |
| 1023 | |
| 1024 | static struct resource qcedev_resources[] = { |
| 1025 | [0] = { |
| 1026 | .start = QCE_0_BASE, |
| 1027 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 1028 | .flags = IORESOURCE_MEM, |
| 1029 | }, |
| 1030 | [1] = { |
| 1031 | .name = "crypto_channels", |
| 1032 | .start = DMOV_CE_IN_CHAN, |
| 1033 | .end = DMOV_CE_OUT_CHAN, |
| 1034 | .flags = IORESOURCE_DMA, |
| 1035 | }, |
| 1036 | [2] = { |
| 1037 | .name = "crypto_crci_in", |
| 1038 | .start = DMOV_CE_IN_CRCI, |
| 1039 | .end = DMOV_CE_IN_CRCI, |
| 1040 | .flags = IORESOURCE_DMA, |
| 1041 | }, |
| 1042 | [3] = { |
| 1043 | .name = "crypto_crci_out", |
| 1044 | .start = DMOV_CE_OUT_CRCI, |
| 1045 | .end = DMOV_CE_OUT_CRCI, |
| 1046 | .flags = IORESOURCE_DMA, |
| 1047 | }, |
| 1048 | }; |
| 1049 | |
| 1050 | #endif |
| 1051 | |
| 1052 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 1053 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 1054 | |
| 1055 | static struct msm_ce_hw_support qcrypto_ce_hw_suppport = { |
| 1056 | .ce_shared = QCE_CE_SHARED, |
| 1057 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 1058 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 1059 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
| 1060 | }; |
| 1061 | |
| 1062 | static struct platform_device qcrypto_device = { |
| 1063 | .name = "qcrypto", |
| 1064 | .id = 0, |
| 1065 | .num_resources = ARRAY_SIZE(qcrypto_resources), |
| 1066 | .resource = qcrypto_resources, |
| 1067 | .dev = { |
| 1068 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 1069 | .platform_data = &qcrypto_ce_hw_suppport, |
| 1070 | }, |
| 1071 | }; |
| 1072 | #endif |
| 1073 | |
| 1074 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 1075 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 1076 | |
| 1077 | static struct msm_ce_hw_support qcedev_ce_hw_suppport = { |
| 1078 | .ce_shared = QCE_CE_SHARED, |
| 1079 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 1080 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 1081 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
| 1082 | }; |
| 1083 | |
| 1084 | static struct platform_device qcedev_device = { |
| 1085 | .name = "qce", |
| 1086 | .id = 0, |
| 1087 | .num_resources = ARRAY_SIZE(qcedev_resources), |
| 1088 | .resource = qcedev_resources, |
| 1089 | .dev = { |
| 1090 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 1091 | .platform_data = &qcedev_ce_hw_suppport, |
| 1092 | }, |
| 1093 | }; |
| 1094 | #endif |
| 1095 | |
Joel King | b8352a1 | 2011-11-15 18:46:24 -0800 | [diff] [blame] | 1096 | #define MDM2AP_ERRFATAL 70 |
| 1097 | #define AP2MDM_ERRFATAL 95 |
| 1098 | #define MDM2AP_STATUS 69 |
| 1099 | #define AP2MDM_STATUS 94 |
| 1100 | #define AP2MDM_PMIC_RESET_N 80 |
| 1101 | #define AP2MDM_KPDPWR_N 81 |
| 1102 | |
| 1103 | static struct gpiomux_setting ap2mdm_cfg = { |
| 1104 | .func = GPIOMUX_FUNC_GPIO, |
| 1105 | .drv = GPIOMUX_DRV_8MA, |
| 1106 | .pull = GPIOMUX_PULL_DOWN, |
| 1107 | }; |
| 1108 | |
| 1109 | static struct gpiomux_setting mdm2ap_status_cfg = { |
| 1110 | .func = GPIOMUX_FUNC_GPIO, |
| 1111 | .drv = GPIOMUX_DRV_8MA, |
| 1112 | .pull = GPIOMUX_PULL_NONE, |
| 1113 | }; |
| 1114 | |
| 1115 | static struct gpiomux_setting mdm2ap_errfatal_cfg = { |
| 1116 | .func = GPIOMUX_FUNC_GPIO, |
| 1117 | .drv = GPIOMUX_DRV_16MA, |
| 1118 | .pull = GPIOMUX_PULL_DOWN, |
| 1119 | }; |
| 1120 | |
| 1121 | static struct gpiomux_setting ap2mdm_kpdpwr_n_cfg = { |
| 1122 | .func = GPIOMUX_FUNC_GPIO, |
| 1123 | .drv = GPIOMUX_DRV_8MA, |
| 1124 | .pull = GPIOMUX_PULL_NONE, |
| 1125 | }; |
| 1126 | |
| 1127 | static struct msm_gpiomux_config mdm_configs[] __initdata = { |
| 1128 | /* AP2MDM_STATUS */ |
| 1129 | { |
| 1130 | .gpio = AP2MDM_STATUS, |
| 1131 | .settings = { |
| 1132 | [GPIOMUX_SUSPENDED] = &ap2mdm_cfg, |
| 1133 | } |
| 1134 | }, |
| 1135 | /* MDM2AP_STATUS */ |
| 1136 | { |
| 1137 | .gpio = MDM2AP_STATUS, |
| 1138 | .settings = { |
| 1139 | [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg, |
| 1140 | } |
| 1141 | }, |
| 1142 | /* MDM2AP_ERRFATAL */ |
| 1143 | { |
| 1144 | .gpio = MDM2AP_ERRFATAL, |
| 1145 | .settings = { |
| 1146 | [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg, |
| 1147 | } |
| 1148 | }, |
| 1149 | /* AP2MDM_ERRFATAL */ |
| 1150 | { |
| 1151 | .gpio = AP2MDM_ERRFATAL, |
| 1152 | .settings = { |
| 1153 | [GPIOMUX_SUSPENDED] = &ap2mdm_cfg, |
| 1154 | } |
| 1155 | }, |
| 1156 | /* AP2MDM_KPDPWR_N */ |
| 1157 | { |
| 1158 | .gpio = AP2MDM_KPDPWR_N, |
| 1159 | .settings = { |
| 1160 | [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg, |
| 1161 | } |
| 1162 | }, |
| 1163 | /* AP2MDM_PMIC_RESET_N */ |
| 1164 | { |
| 1165 | .gpio = AP2MDM_PMIC_RESET_N, |
| 1166 | .settings = { |
| 1167 | [GPIOMUX_SUSPENDED] = &ap2mdm_kpdpwr_n_cfg, |
| 1168 | } |
| 1169 | } |
| 1170 | }; |
| 1171 | |
| 1172 | static struct resource mdm_resources[] = { |
| 1173 | { |
| 1174 | .start = MDM2AP_ERRFATAL, |
| 1175 | .end = MDM2AP_ERRFATAL, |
| 1176 | .name = "MDM2AP_ERRFATAL", |
| 1177 | .flags = IORESOURCE_IO, |
| 1178 | }, |
| 1179 | { |
| 1180 | .start = AP2MDM_ERRFATAL, |
| 1181 | .end = AP2MDM_ERRFATAL, |
| 1182 | .name = "AP2MDM_ERRFATAL", |
| 1183 | .flags = IORESOURCE_IO, |
| 1184 | }, |
| 1185 | { |
| 1186 | .start = MDM2AP_STATUS, |
| 1187 | .end = MDM2AP_STATUS, |
| 1188 | .name = "MDM2AP_STATUS", |
| 1189 | .flags = IORESOURCE_IO, |
| 1190 | }, |
| 1191 | { |
| 1192 | .start = AP2MDM_STATUS, |
| 1193 | .end = AP2MDM_STATUS, |
| 1194 | .name = "AP2MDM_STATUS", |
| 1195 | .flags = IORESOURCE_IO, |
| 1196 | }, |
| 1197 | { |
| 1198 | .start = AP2MDM_PMIC_RESET_N, |
| 1199 | .end = AP2MDM_PMIC_RESET_N, |
| 1200 | .name = "AP2MDM_PMIC_RESET_N", |
| 1201 | .flags = IORESOURCE_IO, |
| 1202 | }, |
| 1203 | { |
| 1204 | .start = AP2MDM_KPDPWR_N, |
| 1205 | .end = AP2MDM_KPDPWR_N, |
| 1206 | .name = "AP2MDM_KPDPWR_N", |
| 1207 | .flags = IORESOURCE_IO, |
| 1208 | }, |
| 1209 | }; |
| 1210 | |
| 1211 | static struct mdm_platform_data mdm_platform_data = { |
| 1212 | .mdm_version = "2.5", |
| 1213 | }; |
| 1214 | |
Stepan Moskovchenko | fc70d90 | 2011-11-30 12:39:36 -0800 | [diff] [blame^] | 1215 | static struct platform_device mdm_device = { |
Joel King | b8352a1 | 2011-11-15 18:46:24 -0800 | [diff] [blame] | 1216 | .name = "mdm2_modem", |
| 1217 | .id = -1, |
| 1218 | .num_resources = ARRAY_SIZE(mdm_resources), |
| 1219 | .resource = mdm_resources, |
| 1220 | .dev = { |
| 1221 | .platform_data = &mdm_platform_data, |
| 1222 | }, |
| 1223 | }; |
| 1224 | |
| 1225 | static struct platform_device *mdm_devices[] __initdata = { |
| 1226 | &mdm_device, |
| 1227 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1228 | |
| 1229 | static int __init gpiomux_init(void) |
| 1230 | { |
| 1231 | int rc; |
| 1232 | |
| 1233 | rc = msm_gpiomux_init(NR_GPIO_IRQS); |
| 1234 | if (rc) { |
| 1235 | pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc); |
| 1236 | return rc; |
| 1237 | } |
| 1238 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1239 | msm_gpiomux_install(msm8960_gpiomux_configs, |
Stepan Moskovchenko | d2a45a8 | 2011-08-09 17:02:57 -0700 | [diff] [blame] | 1240 | ARRAY_SIZE(msm8960_gpiomux_configs)); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1241 | |
| 1242 | msm_gpiomux_install(msm8960_gsbi_configs, |
| 1243 | ARRAY_SIZE(msm8960_gsbi_configs)); |
| 1244 | |
| 1245 | msm_gpiomux_install(msm8960_cyts_configs, |
| 1246 | ARRAY_SIZE(msm8960_cyts_configs)); |
| 1247 | |
| 1248 | msm_gpiomux_install(msm8960_slimbus_config, |
| 1249 | ARRAY_SIZE(msm8960_slimbus_config)); |
| 1250 | |
| 1251 | msm_gpiomux_install(msm8960_audio_codec_configs, |
| 1252 | ARRAY_SIZE(msm8960_audio_codec_configs)); |
| 1253 | |
Bhalchandra Gajare | 0e795c4 | 2011-08-15 18:10:30 -0700 | [diff] [blame] | 1254 | msm_gpiomux_install(msm8960_audio_auxpcm_configs, |
| 1255 | ARRAY_SIZE(msm8960_audio_auxpcm_configs)); |
| 1256 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1257 | msm_gpiomux_install(wcnss_5wire_interface, |
| 1258 | ARRAY_SIZE(wcnss_5wire_interface)); |
| 1259 | |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1260 | if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() || |
| 1261 | machine_is_msm8960_liquid() || machine_is_msm8960_cdp()) |
| 1262 | msm_gpiomux_install(hap_lvl_shft_config, |
| 1263 | ARRAY_SIZE(hap_lvl_shft_config)); |
Joel King | b8352a1 | 2011-11-15 18:46:24 -0800 | [diff] [blame] | 1264 | |
| 1265 | if (PLATFORM_IS_CHARM25()) |
| 1266 | msm_gpiomux_install(mdm_configs, |
| 1267 | ARRAY_SIZE(mdm_configs)); |
| 1268 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1269 | return 0; |
| 1270 | } |
| 1271 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1272 | #define MSM_SHARED_RAM_PHYS 0x80000000 |
| 1273 | |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1274 | static void __init msm8960_map_io(void) |
| 1275 | { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1276 | msm_shared_ram_phys = MSM_SHARED_RAM_PHYS; |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1277 | msm_map_msm8960_io(); |
Jeff Ohlstein | 3a77f9f | 2011-09-06 14:50:20 -0700 | [diff] [blame] | 1278 | |
| 1279 | if (socinfo_init() < 0) |
| 1280 | pr_err("socinfo_init() failed!\n"); |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1281 | } |
| 1282 | |
Stepan Moskovchenko | f4fdfe5 | 2011-10-18 17:28:58 -0700 | [diff] [blame] | 1283 | #ifdef CONFIG_ARCH_MSM8930 |
| 1284 | static void __init msm8930_map_io(void) |
| 1285 | { |
| 1286 | msm_shared_ram_phys = MSM_SHARED_RAM_PHYS; |
| 1287 | msm_map_msm8930_io(); |
| 1288 | |
| 1289 | if (socinfo_init() < 0) |
| 1290 | pr_err("socinfo_init() failed!\n"); |
| 1291 | } |
| 1292 | #endif |
| 1293 | |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1294 | static void __init msm8960_init_irq(void) |
| 1295 | { |
| 1296 | unsigned int i; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1297 | |
| 1298 | msm_mpm_irq_extn_init(); |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1299 | gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1300 | (void *)MSM_QGIC_CPU_BASE); |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1301 | |
| 1302 | /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1303 | writel_relaxed(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4); |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1304 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1305 | writel_relaxed(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET); |
| 1306 | mb(); |
Stepan Moskovchenko | 50ede4e | 2010-12-13 18:12:19 -0800 | [diff] [blame] | 1307 | |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1308 | /* FIXME: Not installing AVS_SVICINT and AVS_SVICINTSWDONE yet |
| 1309 | * as they are configured as level, which does not play nice with |
| 1310 | * handle_percpu_irq. |
| 1311 | */ |
| 1312 | for (i = GIC_PPI_START; i < GIC_SPI_START; i++) { |
| 1313 | if (i != AVS_SVICINT && i != AVS_SVICINTSWDONE) |
Thomas Gleixner | 6845664a | 2011-03-24 13:25:22 +0100 | [diff] [blame] | 1314 | irq_set_handler(i, handle_percpu_irq); |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1315 | } |
| 1316 | } |
| 1317 | |
Stepan Moskovchenko | 73b943b | 2011-10-31 22:43:00 -0700 | [diff] [blame] | 1318 | /* MSM8960 has 5 SDCC controllers */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1319 | enum sdcc_controllers { |
| 1320 | SDCC1, |
| 1321 | SDCC2, |
| 1322 | SDCC3, |
| 1323 | SDCC4, |
| 1324 | SDCC5, |
| 1325 | MAX_SDCC_CONTROLLER |
| 1326 | }; |
| 1327 | |
Stepan Moskovchenko | 73b943b | 2011-10-31 22:43:00 -0700 | [diff] [blame] | 1328 | /* All SDCC controllers require VDD/VCC voltage */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1329 | static struct msm_mmc_reg_data mmc_vdd_reg_data[MAX_SDCC_CONTROLLER] = { |
| 1330 | /* SDCC1 : eMMC card connected */ |
| 1331 | [SDCC1] = { |
| 1332 | .name = "sdc_vdd", |
Subhash Jadavani | 99ba53a | 2011-08-01 16:04:18 +0530 | [diff] [blame] | 1333 | .high_vol_level = 2950000, |
| 1334 | .low_vol_level = 2950000, |
Subhash Jadavani | dd7ef89 | 2011-08-18 16:49:57 +0530 | [diff] [blame] | 1335 | .always_on = 1, |
| 1336 | .lpm_sup = 1, |
| 1337 | .lpm_uA = 9000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1338 | .hpm_uA = 200000, /* 200mA */ |
| 1339 | }, |
| 1340 | /* SDCC3 : External card slot connected */ |
| 1341 | [SDCC3] = { |
| 1342 | .name = "sdc_vdd", |
Subhash Jadavani | 99ba53a | 2011-08-01 16:04:18 +0530 | [diff] [blame] | 1343 | .high_vol_level = 2950000, |
| 1344 | .low_vol_level = 2950000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1345 | .hpm_uA = 600000, /* 600mA */ |
| 1346 | } |
| 1347 | }; |
| 1348 | |
| 1349 | /* Only slots having eMMC card will require VCCQ voltage */ |
| 1350 | static struct msm_mmc_reg_data mmc_vccq_reg_data[1] = { |
| 1351 | /* SDCC1 : eMMC card connected */ |
| 1352 | [SDCC1] = { |
| 1353 | .name = "sdc_vccq", |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1354 | .always_on = 1, |
Subhash Jadavani | 99ba53a | 2011-08-01 16:04:18 +0530 | [diff] [blame] | 1355 | .high_vol_level = 1800000, |
| 1356 | .low_vol_level = 1800000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1357 | .hpm_uA = 200000, /* 200mA */ |
| 1358 | } |
| 1359 | }; |
| 1360 | |
| 1361 | /* All SDCC controllers may require voting for VDD PAD voltage */ |
| 1362 | static struct msm_mmc_reg_data mmc_vddp_reg_data[MAX_SDCC_CONTROLLER] = { |
| 1363 | /* SDCC3 : External card slot connected */ |
| 1364 | [SDCC3] = { |
| 1365 | .name = "sdc_vddp", |
Subhash Jadavani | 99ba53a | 2011-08-01 16:04:18 +0530 | [diff] [blame] | 1366 | .high_vol_level = 2950000, |
| 1367 | .low_vol_level = 1850000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1368 | .always_on = 1, |
| 1369 | .lpm_sup = 1, |
| 1370 | /* Max. Active current required is 16 mA */ |
| 1371 | .hpm_uA = 16000, |
| 1372 | /* |
| 1373 | * Sleep current required is ~300 uA. But min. vote can be |
| 1374 | * in terms of mA (min. 1 mA). So let's vote for 2 mA |
| 1375 | * during sleep. |
| 1376 | */ |
| 1377 | .lpm_uA = 2000, |
| 1378 | } |
| 1379 | }; |
| 1380 | |
| 1381 | static struct msm_mmc_slot_reg_data mmc_slot_vreg_data[MAX_SDCC_CONTROLLER] = { |
| 1382 | /* SDCC1 : eMMC card connected */ |
| 1383 | [SDCC1] = { |
| 1384 | .vdd_data = &mmc_vdd_reg_data[SDCC1], |
| 1385 | .vccq_data = &mmc_vccq_reg_data[SDCC1], |
| 1386 | }, |
| 1387 | /* SDCC3 : External card slot connected */ |
| 1388 | [SDCC3] = { |
| 1389 | .vdd_data = &mmc_vdd_reg_data[SDCC3], |
| 1390 | .vddp_data = &mmc_vddp_reg_data[SDCC3], |
| 1391 | } |
| 1392 | }; |
| 1393 | |
| 1394 | /* SDC1 pad data */ |
| 1395 | static struct msm_mmc_pad_drv sdc1_pad_drv_on_cfg[] = { |
| 1396 | {TLMM_HDRV_SDC1_CLK, GPIO_CFG_16MA}, |
Subhash Jadavani | 87bda5a | 2011-08-30 17:40:44 +0530 | [diff] [blame] | 1397 | {TLMM_HDRV_SDC1_CMD, GPIO_CFG_10MA}, |
| 1398 | {TLMM_HDRV_SDC1_DATA, GPIO_CFG_10MA} |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1399 | }; |
| 1400 | |
| 1401 | static struct msm_mmc_pad_drv sdc1_pad_drv_off_cfg[] = { |
| 1402 | {TLMM_HDRV_SDC1_CLK, GPIO_CFG_2MA}, |
| 1403 | {TLMM_HDRV_SDC1_CMD, GPIO_CFG_2MA}, |
| 1404 | {TLMM_HDRV_SDC1_DATA, GPIO_CFG_2MA} |
| 1405 | }; |
| 1406 | |
| 1407 | static struct msm_mmc_pad_pull sdc1_pad_pull_on_cfg[] = { |
Subhash Jadavani | b7b5b8a | 2011-09-13 13:00:40 +0530 | [diff] [blame] | 1408 | {TLMM_PULL_SDC1_CLK, GPIO_CFG_NO_PULL}, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1409 | {TLMM_PULL_SDC1_CMD, GPIO_CFG_PULL_UP}, |
| 1410 | {TLMM_PULL_SDC1_DATA, GPIO_CFG_PULL_UP} |
| 1411 | }; |
| 1412 | |
| 1413 | static struct msm_mmc_pad_pull sdc1_pad_pull_off_cfg[] = { |
Subhash Jadavani | b7b5b8a | 2011-09-13 13:00:40 +0530 | [diff] [blame] | 1414 | {TLMM_PULL_SDC1_CLK, GPIO_CFG_NO_PULL}, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1415 | {TLMM_PULL_SDC1_CMD, GPIO_CFG_PULL_DOWN}, |
| 1416 | {TLMM_PULL_SDC1_DATA, GPIO_CFG_PULL_DOWN} |
| 1417 | }; |
| 1418 | |
| 1419 | /* SDC3 pad data */ |
| 1420 | static struct msm_mmc_pad_drv sdc3_pad_drv_on_cfg[] = { |
| 1421 | {TLMM_HDRV_SDC3_CLK, GPIO_CFG_8MA}, |
| 1422 | {TLMM_HDRV_SDC3_CMD, GPIO_CFG_8MA}, |
| 1423 | {TLMM_HDRV_SDC3_DATA, GPIO_CFG_8MA} |
| 1424 | }; |
| 1425 | |
| 1426 | static struct msm_mmc_pad_drv sdc3_pad_drv_off_cfg[] = { |
| 1427 | {TLMM_HDRV_SDC3_CLK, GPIO_CFG_2MA}, |
| 1428 | {TLMM_HDRV_SDC3_CMD, GPIO_CFG_2MA}, |
| 1429 | {TLMM_HDRV_SDC3_DATA, GPIO_CFG_2MA} |
| 1430 | }; |
| 1431 | |
| 1432 | static struct msm_mmc_pad_pull sdc3_pad_pull_on_cfg[] = { |
Subhash Jadavani | b7b5b8a | 2011-09-13 13:00:40 +0530 | [diff] [blame] | 1433 | {TLMM_PULL_SDC3_CLK, GPIO_CFG_NO_PULL}, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1434 | {TLMM_PULL_SDC3_CMD, GPIO_CFG_PULL_UP}, |
| 1435 | {TLMM_PULL_SDC3_DATA, GPIO_CFG_PULL_UP} |
| 1436 | }; |
| 1437 | |
| 1438 | static struct msm_mmc_pad_pull sdc3_pad_pull_off_cfg[] = { |
Subhash Jadavani | b7b5b8a | 2011-09-13 13:00:40 +0530 | [diff] [blame] | 1439 | {TLMM_PULL_SDC3_CLK, GPIO_CFG_NO_PULL}, |
Subhash Jadavani | 46d4f34 | 2011-10-12 14:44:45 +0530 | [diff] [blame] | 1440 | /* |
| 1441 | * SDC3 CMD line should be PULLed UP otherwise fluid platform will |
| 1442 | * see transitions (1 -> 0 and 0 -> 1) on card detection line, |
| 1443 | * which would result in false card detection interrupts. |
| 1444 | */ |
| 1445 | {TLMM_PULL_SDC3_CMD, GPIO_CFG_PULL_UP}, |
| 1446 | /* |
| 1447 | * Keeping DATA lines status to PULL UP will make sure that |
| 1448 | * there is no current leak during sleep if external pull up |
| 1449 | * is connected to DATA lines. |
| 1450 | */ |
| 1451 | {TLMM_PULL_SDC3_DATA, GPIO_CFG_PULL_UP} |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1452 | }; |
| 1453 | |
Stepan Moskovchenko | fc70d90 | 2011-11-30 12:39:36 -0800 | [diff] [blame^] | 1454 | static struct msm_mmc_pad_pull_data mmc_pad_pull_data[MAX_SDCC_CONTROLLER] = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1455 | [SDCC1] = { |
| 1456 | .on = sdc1_pad_pull_on_cfg, |
| 1457 | .off = sdc1_pad_pull_off_cfg, |
| 1458 | .size = ARRAY_SIZE(sdc1_pad_pull_on_cfg) |
| 1459 | }, |
| 1460 | [SDCC3] = { |
| 1461 | .on = sdc3_pad_pull_on_cfg, |
| 1462 | .off = sdc3_pad_pull_off_cfg, |
| 1463 | .size = ARRAY_SIZE(sdc3_pad_pull_on_cfg) |
| 1464 | }, |
| 1465 | }; |
| 1466 | |
Stepan Moskovchenko | fc70d90 | 2011-11-30 12:39:36 -0800 | [diff] [blame^] | 1467 | static struct msm_mmc_pad_drv_data mmc_pad_drv_data[MAX_SDCC_CONTROLLER] = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1468 | [SDCC1] = { |
| 1469 | .on = sdc1_pad_drv_on_cfg, |
| 1470 | .off = sdc1_pad_drv_off_cfg, |
| 1471 | .size = ARRAY_SIZE(sdc1_pad_drv_on_cfg) |
| 1472 | }, |
| 1473 | [SDCC3] = { |
| 1474 | .on = sdc3_pad_drv_on_cfg, |
| 1475 | .off = sdc3_pad_drv_off_cfg, |
| 1476 | .size = ARRAY_SIZE(sdc3_pad_drv_on_cfg) |
| 1477 | }, |
| 1478 | }; |
| 1479 | |
Stepan Moskovchenko | fc70d90 | 2011-11-30 12:39:36 -0800 | [diff] [blame^] | 1480 | static struct msm_mmc_pad_data mmc_pad_data[MAX_SDCC_CONTROLLER] = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1481 | [SDCC1] = { |
| 1482 | .pull = &mmc_pad_pull_data[SDCC1], |
| 1483 | .drv = &mmc_pad_drv_data[SDCC1] |
| 1484 | }, |
| 1485 | [SDCC3] = { |
| 1486 | .pull = &mmc_pad_pull_data[SDCC3], |
| 1487 | .drv = &mmc_pad_drv_data[SDCC3] |
| 1488 | }, |
| 1489 | }; |
| 1490 | |
Stepan Moskovchenko | fc70d90 | 2011-11-30 12:39:36 -0800 | [diff] [blame^] | 1491 | static struct msm_mmc_pin_data mmc_slot_pin_data[MAX_SDCC_CONTROLLER] = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1492 | [SDCC1] = { |
| 1493 | .pad_data = &mmc_pad_data[SDCC1], |
| 1494 | }, |
| 1495 | [SDCC3] = { |
| 1496 | .pad_data = &mmc_pad_data[SDCC3], |
| 1497 | }, |
| 1498 | }; |
| 1499 | |
| 1500 | static unsigned int sdc1_sup_clk_rates[] = { |
Subhash Jadavani | 0e027b7 | 2011-08-30 17:40:55 +0530 | [diff] [blame] | 1501 | 400000, 24000000, 48000000 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1502 | }; |
| 1503 | |
| 1504 | static unsigned int sdc3_sup_clk_rates[] = { |
| 1505 | 400000, 24000000, 48000000, 96000000 |
| 1506 | }; |
| 1507 | |
| 1508 | #ifdef CONFIG_MMC_MSM_SDC1_SUPPORT |
| 1509 | static struct mmc_platform_data msm8960_sdc1_data = { |
| 1510 | .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29, |
| 1511 | #ifdef CONFIG_MMC_MSM_SDC1_8_BIT_SUPPORT |
| 1512 | .mmc_bus_width = MMC_CAP_8_BIT_DATA, |
| 1513 | #else |
| 1514 | .mmc_bus_width = MMC_CAP_4_BIT_DATA, |
| 1515 | #endif |
| 1516 | .sup_clk_table = sdc1_sup_clk_rates, |
| 1517 | .sup_clk_cnt = ARRAY_SIZE(sdc1_sup_clk_rates), |
Subhash Jadavani | b7655b6 | 2011-09-27 19:12:36 +0530 | [diff] [blame] | 1518 | .pclk_src_dfab = 1, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1519 | .nonremovable = 1, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1520 | .vreg_data = &mmc_slot_vreg_data[SDCC1], |
Subhash Jadavani | 0e027b7 | 2011-08-30 17:40:55 +0530 | [diff] [blame] | 1521 | .pin_data = &mmc_slot_pin_data[SDCC1] |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1522 | }; |
| 1523 | #endif |
| 1524 | |
| 1525 | #ifdef CONFIG_MMC_MSM_SDC3_SUPPORT |
| 1526 | static struct mmc_platform_data msm8960_sdc3_data = { |
| 1527 | .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29, |
| 1528 | .mmc_bus_width = MMC_CAP_4_BIT_DATA, |
| 1529 | .sup_clk_table = sdc3_sup_clk_rates, |
| 1530 | .sup_clk_cnt = ARRAY_SIZE(sdc3_sup_clk_rates), |
Subhash Jadavani | b7655b6 | 2011-09-27 19:12:36 +0530 | [diff] [blame] | 1531 | .pclk_src_dfab = 1, |
Subhash Jadavani | b9ef747 | 2011-09-21 18:37:28 +0530 | [diff] [blame] | 1532 | #ifdef CONFIG_MMC_MSM_SDC3_WP_SUPPORT |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1533 | .wpswitch_gpio = PM8921_GPIO_PM_TO_SYS(16), |
Subhash Jadavani | b9ef747 | 2011-09-21 18:37:28 +0530 | [diff] [blame] | 1534 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1535 | .vreg_data = &mmc_slot_vreg_data[SDCC3], |
| 1536 | .pin_data = &mmc_slot_pin_data[SDCC3], |
| 1537 | #ifdef CONFIG_MMC_MSM_CARD_HW_DETECTION |
| 1538 | .status_gpio = PM8921_GPIO_PM_TO_SYS(26), |
| 1539 | .status_irq = PM8921_GPIO_IRQ(PM8921_IRQ_BASE, 26), |
| 1540 | .irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, |
| 1541 | #endif |
| 1542 | .xpc_cap = 1, |
| 1543 | .uhs_caps = (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 | |
| 1544 | MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_DDR50 | |
Subhash Jadavani | 0e027b7 | 2011-08-30 17:40:55 +0530 | [diff] [blame] | 1545 | MMC_CAP_MAX_CURRENT_600) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1546 | }; |
| 1547 | #endif |
| 1548 | |
| 1549 | static void __init msm8960_init_mmc(void) |
| 1550 | { |
| 1551 | #ifdef CONFIG_MMC_MSM_SDC1_SUPPORT |
| 1552 | /* SDC1 : eMMC card connected */ |
| 1553 | msm_add_sdcc(1, &msm8960_sdc1_data); |
| 1554 | #endif |
| 1555 | #ifdef CONFIG_MMC_MSM_SDC3_SUPPORT |
| 1556 | /* SDC3: External card slot */ |
| 1557 | msm_add_sdcc(3, &msm8960_sdc3_data); |
| 1558 | #endif |
| 1559 | } |
| 1560 | |
| 1561 | static void __init msm8960_init_buses(void) |
| 1562 | { |
| 1563 | #ifdef CONFIG_MSM_BUS_SCALING |
Gagan Mac | dc1dc14 | 2011-09-16 15:13:35 -0600 | [diff] [blame] | 1564 | msm_bus_rpm_set_mt_mask(); |
Gagan Mac | ae154c4b | 2011-10-05 19:24:43 -0600 | [diff] [blame] | 1565 | msm_bus_8960_apps_fabric_pdata.rpm_enabled = 1; |
| 1566 | msm_bus_8960_sys_fabric_pdata.rpm_enabled = 1; |
| 1567 | msm_bus_8960_mm_fabric_pdata.rpm_enabled = 1; |
| 1568 | msm_bus_apps_fabric.dev.platform_data = |
| 1569 | &msm_bus_8960_apps_fabric_pdata; |
| 1570 | msm_bus_sys_fabric.dev.platform_data = &msm_bus_8960_sys_fabric_pdata; |
| 1571 | msm_bus_mm_fabric.dev.platform_data = &msm_bus_8960_mm_fabric_pdata; |
| 1572 | msm_bus_sys_fpb.dev.platform_data = &msm_bus_8960_sys_fpb_pdata; |
| 1573 | msm_bus_cpss_fpb.dev.platform_data = &msm_bus_8960_cpss_fpb_pdata; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1574 | #endif |
| 1575 | } |
| 1576 | |
| 1577 | static struct msm_spi_platform_data msm8960_qup_spi_gsbi1_pdata = { |
| 1578 | .max_clock_speed = 15060000, |
| 1579 | }; |
| 1580 | |
| 1581 | #ifdef CONFIG_USB_MSM_OTG_72K |
| 1582 | static struct msm_otg_platform_data msm_otg_pdata; |
| 1583 | #else |
| 1584 | #define USB_5V_EN 42 |
| 1585 | static void msm_hsusb_vbus_power(bool on) |
| 1586 | { |
| 1587 | int rc; |
| 1588 | static bool vbus_is_on; |
| 1589 | static struct regulator *mvs_otg_switch; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1590 | |
| 1591 | if (vbus_is_on == on) |
| 1592 | return; |
| 1593 | |
| 1594 | if (on) { |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 1595 | mvs_otg_switch = regulator_get(&msm8960_device_otg.dev, |
| 1596 | "vbus_otg"); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1597 | if (IS_ERR(mvs_otg_switch)) { |
| 1598 | pr_err("Unable to get mvs_otg_switch\n"); |
| 1599 | return; |
| 1600 | } |
| 1601 | |
| 1602 | rc = gpio_request(PM8921_GPIO_PM_TO_SYS(USB_5V_EN), |
| 1603 | "usb_5v_en"); |
| 1604 | if (rc < 0) { |
| 1605 | pr_err("failed to request usb_5v_en gpio\n"); |
| 1606 | goto put_mvs_otg; |
| 1607 | } |
| 1608 | |
Anji jonnala | 2936fd9 | 2011-11-09 15:39:22 +0530 | [diff] [blame] | 1609 | rc = gpio_direction_output(PM8921_GPIO_PM_TO_SYS(USB_5V_EN), 1); |
| 1610 | if (rc) { |
| 1611 | pr_err("%s: unable to set_direction for gpio [%d]\n", |
| 1612 | __func__, PM8921_GPIO_PM_TO_SYS(USB_5V_EN)); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1613 | goto free_usb_5v_en; |
| 1614 | } |
| 1615 | |
Anji jonnala | 2936fd9 | 2011-11-09 15:39:22 +0530 | [diff] [blame] | 1616 | if (regulator_enable(mvs_otg_switch)) { |
| 1617 | pr_err("unable to enable mvs_otg_switch\n"); |
| 1618 | goto err_ldo_gpio_set_dir; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1619 | } |
Anji jonnala | 2936fd9 | 2011-11-09 15:39:22 +0530 | [diff] [blame] | 1620 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1621 | vbus_is_on = true; |
| 1622 | return; |
| 1623 | } |
Anji jonnala | 2936fd9 | 2011-11-09 15:39:22 +0530 | [diff] [blame] | 1624 | regulator_disable(mvs_otg_switch); |
| 1625 | err_ldo_gpio_set_dir: |
| 1626 | gpio_set_value(PM8921_GPIO_PM_TO_SYS(USB_5V_EN), 0); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1627 | free_usb_5v_en: |
Anji jonnala | 2936fd9 | 2011-11-09 15:39:22 +0530 | [diff] [blame] | 1628 | gpio_free(PM8921_GPIO_PM_TO_SYS(USB_5V_EN)); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1629 | put_mvs_otg: |
Anji jonnala | 2936fd9 | 2011-11-09 15:39:22 +0530 | [diff] [blame] | 1630 | regulator_put(mvs_otg_switch); |
| 1631 | vbus_is_on = false; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1632 | } |
| 1633 | |
| 1634 | static struct msm_otg_platform_data msm_otg_pdata = { |
| 1635 | .mode = USB_OTG, |
| 1636 | .otg_control = OTG_PMIC_CONTROL, |
| 1637 | .phy_type = SNPS_28NM_INTEGRATED_PHY, |
| 1638 | .pclk_src_name = "dfab_usb_hs_clk", |
| 1639 | .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE), |
| 1640 | .vbus_power = msm_hsusb_vbus_power, |
Anji jonnala | 4e3e677 | 2011-09-15 18:53:42 +0530 | [diff] [blame] | 1641 | .power_budget = 750, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1642 | }; |
| 1643 | #endif |
| 1644 | |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 1645 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
Vijayavardhan Vennapusa | 2b592824f | 2011-11-02 19:51:32 +0530 | [diff] [blame] | 1646 | #define HSIC_HUB_RESET_GPIO 91 |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 1647 | static struct msm_hsic_host_platform_data msm_hsic_pdata = { |
| 1648 | .strobe = 150, |
| 1649 | .data = 151, |
| 1650 | }; |
| 1651 | #else |
| 1652 | static struct msm_hsic_host_platform_data msm_hsic_pdata; |
| 1653 | #endif |
| 1654 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1655 | #define PID_MAGIC_ID 0x71432909 |
| 1656 | #define SERIAL_NUM_MAGIC_ID 0x61945374 |
| 1657 | #define SERIAL_NUMBER_LENGTH 127 |
| 1658 | #define DLOAD_USB_BASE_ADD 0x2A03F0C8 |
| 1659 | |
| 1660 | struct magic_num_struct { |
| 1661 | uint32_t pid; |
| 1662 | uint32_t serial_num; |
| 1663 | }; |
| 1664 | |
| 1665 | struct dload_struct { |
| 1666 | uint32_t reserved1; |
| 1667 | uint32_t reserved2; |
| 1668 | uint32_t reserved3; |
| 1669 | uint16_t reserved4; |
| 1670 | uint16_t pid; |
| 1671 | char serial_number[SERIAL_NUMBER_LENGTH]; |
| 1672 | uint16_t reserved5; |
| 1673 | struct magic_num_struct magic_struct; |
| 1674 | }; |
| 1675 | |
| 1676 | static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum) |
| 1677 | { |
| 1678 | struct dload_struct __iomem *dload = 0; |
| 1679 | |
| 1680 | dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload)); |
| 1681 | if (!dload) { |
| 1682 | pr_err("%s: cannot remap I/O memory region: %08x\n", |
| 1683 | __func__, DLOAD_USB_BASE_ADD); |
| 1684 | return -ENXIO; |
| 1685 | } |
| 1686 | |
| 1687 | pr_debug("%s: dload:%p pid:%x serial_num:%s\n", |
| 1688 | __func__, dload, pid, snum); |
| 1689 | /* update pid */ |
| 1690 | dload->magic_struct.pid = PID_MAGIC_ID; |
| 1691 | dload->pid = pid; |
| 1692 | |
| 1693 | /* update serial number */ |
| 1694 | dload->magic_struct.serial_num = 0; |
| 1695 | if (!snum) { |
| 1696 | memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH); |
| 1697 | goto out; |
| 1698 | } |
| 1699 | |
| 1700 | dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID; |
Jin Hong | e49b148 | 2011-10-03 11:15:50 -0700 | [diff] [blame] | 1701 | strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1702 | out: |
| 1703 | iounmap(dload); |
| 1704 | return 0; |
| 1705 | } |
| 1706 | |
| 1707 | static struct android_usb_platform_data android_usb_pdata = { |
| 1708 | .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num, |
| 1709 | }; |
| 1710 | |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 1711 | static struct platform_device android_usb_device = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1712 | .name = "android_usb", |
| 1713 | .id = -1, |
| 1714 | .dev = { |
| 1715 | .platform_data = &android_usb_pdata, |
| 1716 | }, |
| 1717 | }; |
| 1718 | |
| 1719 | static uint8_t spm_wfi_cmd_sequence[] __initdata = { |
| 1720 | 0x03, 0x0f, |
| 1721 | }; |
| 1722 | |
| 1723 | static uint8_t spm_power_collapse_without_rpm[] __initdata = { |
| 1724 | 0x00, 0x24, 0x54, 0x10, |
| 1725 | 0x09, 0x03, 0x01, |
| 1726 | 0x10, 0x54, 0x30, 0x0C, |
| 1727 | 0x24, 0x30, 0x0f, |
| 1728 | }; |
| 1729 | |
| 1730 | static uint8_t spm_power_collapse_with_rpm[] __initdata = { |
| 1731 | 0x00, 0x24, 0x54, 0x10, |
| 1732 | 0x09, 0x07, 0x01, 0x0B, |
| 1733 | 0x10, 0x54, 0x30, 0x0C, |
| 1734 | 0x24, 0x30, 0x0f, |
| 1735 | }; |
| 1736 | |
| 1737 | static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = { |
| 1738 | [0] = { |
| 1739 | .mode = MSM_SPM_MODE_CLOCK_GATING, |
| 1740 | .notify_rpm = false, |
| 1741 | .cmd = spm_wfi_cmd_sequence, |
| 1742 | }, |
| 1743 | [1] = { |
| 1744 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 1745 | .notify_rpm = false, |
| 1746 | .cmd = spm_power_collapse_without_rpm, |
| 1747 | }, |
| 1748 | [2] = { |
| 1749 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 1750 | .notify_rpm = true, |
| 1751 | .cmd = spm_power_collapse_with_rpm, |
| 1752 | }, |
| 1753 | }; |
| 1754 | |
| 1755 | static struct msm_spm_platform_data msm_spm_data[] __initdata = { |
| 1756 | [0] = { |
| 1757 | .reg_base_addr = MSM_SAW0_BASE, |
| 1758 | .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00, |
| 1759 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F, |
| 1760 | .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0x9C, |
| 1761 | #if defined(CONFIG_MSM_AVS_HW) |
| 1762 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00, |
| 1763 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00, |
| 1764 | #endif |
| 1765 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
| 1766 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202, |
| 1767 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C, |
| 1768 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C, |
| 1769 | .vctl_timeout_us = 50, |
| 1770 | .num_modes = ARRAY_SIZE(msm_spm_seq_list), |
| 1771 | .modes = msm_spm_seq_list, |
| 1772 | }, |
| 1773 | [1] = { |
| 1774 | .reg_base_addr = MSM_SAW1_BASE, |
| 1775 | .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00, |
| 1776 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F, |
| 1777 | .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0x9C, |
| 1778 | #if defined(CONFIG_MSM_AVS_HW) |
| 1779 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00, |
| 1780 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00, |
| 1781 | #endif |
| 1782 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
| 1783 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202, |
| 1784 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C, |
| 1785 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C, |
| 1786 | .vctl_timeout_us = 50, |
| 1787 | .num_modes = ARRAY_SIZE(msm_spm_seq_list), |
| 1788 | .modes = msm_spm_seq_list, |
| 1789 | }, |
| 1790 | }; |
| 1791 | |
| 1792 | static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = { |
| 1793 | 0x00, 0x20, 0x03, 0x20, |
| 1794 | 0x00, 0x0f, |
| 1795 | }; |
| 1796 | |
| 1797 | static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = { |
| 1798 | 0x00, 0x20, 0x34, 0x64, |
| 1799 | 0x48, 0x07, 0x48, 0x20, |
| 1800 | 0x50, 0x64, 0x04, 0x34, |
| 1801 | 0x50, 0x0f, |
| 1802 | }; |
| 1803 | static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = { |
| 1804 | 0x00, 0x10, 0x34, 0x64, |
| 1805 | 0x48, 0x07, 0x48, 0x10, |
| 1806 | 0x50, 0x64, 0x04, 0x34, |
| 1807 | 0x50, 0x0F, |
| 1808 | }; |
| 1809 | |
| 1810 | static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = { |
| 1811 | [0] = { |
| 1812 | .mode = MSM_SPM_L2_MODE_RETENTION, |
| 1813 | .notify_rpm = false, |
| 1814 | .cmd = l2_spm_wfi_cmd_sequence, |
| 1815 | }, |
| 1816 | [1] = { |
| 1817 | .mode = MSM_SPM_L2_MODE_GDHS, |
| 1818 | .notify_rpm = true, |
| 1819 | .cmd = l2_spm_gdhs_cmd_sequence, |
| 1820 | }, |
| 1821 | [2] = { |
| 1822 | .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE, |
| 1823 | .notify_rpm = true, |
| 1824 | .cmd = l2_spm_power_off_cmd_sequence, |
| 1825 | }, |
| 1826 | }; |
| 1827 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1828 | static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = { |
| 1829 | [0] = { |
| 1830 | .reg_base_addr = MSM_SAW_L2_BASE, |
| 1831 | .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00, |
| 1832 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00, |
| 1833 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202, |
| 1834 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE, |
| 1835 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020, |
| 1836 | .modes = msm_spm_l2_seq_list, |
| 1837 | .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list), |
| 1838 | }, |
| 1839 | }; |
| 1840 | |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1841 | #define PM_HAP_EN_GPIO PM8921_GPIO_PM_TO_SYS(33) |
| 1842 | #define PM_HAP_LEN_GPIO PM8921_GPIO_PM_TO_SYS(20) |
| 1843 | |
| 1844 | static struct msm_xo_voter *xo_handle_d1; |
| 1845 | |
| 1846 | static int isa1200_power(int on) |
| 1847 | { |
| 1848 | int rc = 0; |
| 1849 | |
| 1850 | gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, !!on); |
| 1851 | |
| 1852 | rc = on ? msm_xo_mode_vote(xo_handle_d1, MSM_XO_MODE_ON) : |
| 1853 | msm_xo_mode_vote(xo_handle_d1, MSM_XO_MODE_OFF); |
| 1854 | if (rc < 0) { |
| 1855 | pr_err("%s: failed to %svote for TCXO D1 buffer%d\n", |
| 1856 | __func__, on ? "" : "de-", rc); |
| 1857 | goto err_xo_vote; |
| 1858 | } |
| 1859 | |
| 1860 | return 0; |
| 1861 | |
| 1862 | err_xo_vote: |
| 1863 | gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, !on); |
| 1864 | return rc; |
| 1865 | } |
| 1866 | |
| 1867 | static int isa1200_dev_setup(bool enable) |
| 1868 | { |
| 1869 | int rc = 0; |
| 1870 | |
| 1871 | struct pm_gpio hap_gpio_config = { |
| 1872 | .direction = PM_GPIO_DIR_OUT, |
| 1873 | .pull = PM_GPIO_PULL_NO, |
| 1874 | .out_strength = PM_GPIO_STRENGTH_HIGH, |
| 1875 | .function = PM_GPIO_FUNC_NORMAL, |
| 1876 | .inv_int_pol = 0, |
| 1877 | .vin_sel = 2, |
| 1878 | .output_buffer = PM_GPIO_OUT_BUF_CMOS, |
| 1879 | .output_value = 0, |
| 1880 | }; |
| 1881 | |
| 1882 | if (enable == true) { |
| 1883 | rc = pm8xxx_gpio_config(PM_HAP_EN_GPIO, &hap_gpio_config); |
| 1884 | if (rc) { |
| 1885 | pr_err("%s: pm8921 gpio %d config failed(%d)\n", |
| 1886 | __func__, PM_HAP_EN_GPIO, rc); |
| 1887 | return rc; |
| 1888 | } |
| 1889 | |
| 1890 | rc = pm8xxx_gpio_config(PM_HAP_LEN_GPIO, &hap_gpio_config); |
| 1891 | if (rc) { |
| 1892 | pr_err("%s: pm8921 gpio %d config failed(%d)\n", |
| 1893 | __func__, PM_HAP_LEN_GPIO, rc); |
| 1894 | return rc; |
| 1895 | } |
| 1896 | |
| 1897 | rc = gpio_request(HAP_SHIFT_LVL_OE_GPIO, "hap_shft_lvl_oe"); |
| 1898 | if (rc) { |
| 1899 | pr_err("%s: unable to request gpio %d (%d)\n", |
| 1900 | __func__, HAP_SHIFT_LVL_OE_GPIO, rc); |
| 1901 | return rc; |
| 1902 | } |
| 1903 | |
| 1904 | rc = gpio_direction_output(HAP_SHIFT_LVL_OE_GPIO, 0); |
| 1905 | if (rc) { |
| 1906 | pr_err("%s: Unable to set direction\n", __func__); |
| 1907 | goto free_gpio; |
| 1908 | } |
| 1909 | |
| 1910 | xo_handle_d1 = msm_xo_get(MSM_XO_TCXO_D1, "isa1200"); |
| 1911 | if (IS_ERR(xo_handle_d1)) { |
| 1912 | rc = PTR_ERR(xo_handle_d1); |
| 1913 | pr_err("%s: failed to get the handle for D1(%d)\n", |
| 1914 | __func__, rc); |
| 1915 | goto gpio_set_dir; |
| 1916 | } |
| 1917 | } else { |
| 1918 | gpio_free(HAP_SHIFT_LVL_OE_GPIO); |
| 1919 | |
| 1920 | msm_xo_put(xo_handle_d1); |
| 1921 | } |
| 1922 | |
| 1923 | return 0; |
| 1924 | |
| 1925 | gpio_set_dir: |
| 1926 | gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, 0); |
| 1927 | free_gpio: |
| 1928 | gpio_free(HAP_SHIFT_LVL_OE_GPIO); |
| 1929 | return rc; |
| 1930 | } |
| 1931 | |
| 1932 | static struct isa1200_regulator isa1200_reg_data[] = { |
| 1933 | { |
| 1934 | .name = "vcc_i2c", |
| 1935 | .min_uV = ISA_I2C_VTG_MIN_UV, |
| 1936 | .max_uV = ISA_I2C_VTG_MAX_UV, |
| 1937 | .load_uA = ISA_I2C_CURR_UA, |
| 1938 | }, |
| 1939 | }; |
| 1940 | |
| 1941 | static struct isa1200_platform_data isa1200_1_pdata = { |
| 1942 | .name = "vibrator", |
| 1943 | .dev_setup = isa1200_dev_setup, |
| 1944 | .power_on = isa1200_power, |
| 1945 | .hap_en_gpio = PM_HAP_EN_GPIO, |
| 1946 | .hap_len_gpio = PM_HAP_LEN_GPIO, |
| 1947 | .max_timeout = 15000, |
| 1948 | .mode_ctrl = PWM_GEN_MODE, |
| 1949 | .pwm_fd = { |
| 1950 | .pwm_div = 256, |
| 1951 | }, |
| 1952 | .is_erm = false, |
| 1953 | .smart_en = true, |
| 1954 | .ext_clk_en = true, |
| 1955 | .chip_en = 1, |
| 1956 | .regulator_info = isa1200_reg_data, |
| 1957 | .num_regulators = ARRAY_SIZE(isa1200_reg_data), |
| 1958 | }; |
| 1959 | |
| 1960 | static struct i2c_board_info msm_isa1200_board_info[] __initdata = { |
| 1961 | { |
| 1962 | I2C_BOARD_INFO("isa1200_1", 0x90>>1), |
| 1963 | .platform_data = &isa1200_1_pdata, |
| 1964 | }, |
| 1965 | }; |
| 1966 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1967 | #define CYTTSP_TS_GPIO_IRQ 11 |
| 1968 | #define CYTTSP_TS_SLEEP_GPIO 50 |
| 1969 | #define CYTTSP_TS_RESOUT_N_GPIO 52 |
| 1970 | |
| 1971 | /*virtual key support */ |
| 1972 | static ssize_t tma340_vkeys_show(struct kobject *kobj, |
| 1973 | struct kobj_attribute *attr, char *buf) |
| 1974 | { |
| 1975 | return snprintf(buf, 200, |
| 1976 | __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97" |
| 1977 | ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97" |
| 1978 | ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97" |
| 1979 | ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97" |
| 1980 | "\n"); |
| 1981 | } |
| 1982 | |
| 1983 | static struct kobj_attribute tma340_vkeys_attr = { |
| 1984 | .attr = { |
| 1985 | .mode = S_IRUGO, |
| 1986 | }, |
| 1987 | .show = &tma340_vkeys_show, |
| 1988 | }; |
| 1989 | |
| 1990 | static struct attribute *tma340_properties_attrs[] = { |
| 1991 | &tma340_vkeys_attr.attr, |
| 1992 | NULL |
| 1993 | }; |
| 1994 | |
| 1995 | static struct attribute_group tma340_properties_attr_group = { |
| 1996 | .attrs = tma340_properties_attrs, |
| 1997 | }; |
| 1998 | |
| 1999 | |
| 2000 | static int cyttsp_platform_init(struct i2c_client *client) |
| 2001 | { |
| 2002 | int rc = 0; |
| 2003 | static struct kobject *tma340_properties_kobj; |
| 2004 | |
| 2005 | tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c"; |
| 2006 | tma340_properties_kobj = kobject_create_and_add("board_properties", |
| 2007 | NULL); |
| 2008 | if (tma340_properties_kobj) |
| 2009 | rc = sysfs_create_group(tma340_properties_kobj, |
| 2010 | &tma340_properties_attr_group); |
| 2011 | if (!tma340_properties_kobj || rc) |
| 2012 | pr_err("%s: failed to create board_properties\n", |
| 2013 | __func__); |
| 2014 | |
| 2015 | return 0; |
| 2016 | } |
| 2017 | |
| 2018 | static struct cyttsp_regulator regulator_data[] = { |
| 2019 | { |
| 2020 | .name = "vdd", |
| 2021 | .min_uV = CY_TMA300_VTG_MIN_UV, |
| 2022 | .max_uV = CY_TMA300_VTG_MAX_UV, |
Anirudh Ghayal | f9929b1 | 2011-09-07 15:57:36 +0530 | [diff] [blame] | 2023 | .hpm_load_uA = CY_TMA300_CURR_24HZ_UA, |
| 2024 | .lpm_load_uA = CY_TMA300_SLEEP_CURR_UA, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2025 | }, |
| 2026 | /* TODO: Remove after runtime PM is enabled in I2C driver */ |
| 2027 | { |
| 2028 | .name = "vcc_i2c", |
| 2029 | .min_uV = CY_I2C_VTG_MIN_UV, |
| 2030 | .max_uV = CY_I2C_VTG_MAX_UV, |
Anirudh Ghayal | f9929b1 | 2011-09-07 15:57:36 +0530 | [diff] [blame] | 2031 | .hpm_load_uA = CY_I2C_CURR_UA, |
| 2032 | .lpm_load_uA = CY_I2C_SLEEP_CURR_UA, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2033 | }, |
| 2034 | }; |
| 2035 | |
| 2036 | static struct cyttsp_platform_data cyttsp_pdata = { |
| 2037 | .panel_maxx = 634, |
| 2038 | .panel_maxy = 1166, |
| 2039 | .disp_maxx = 616, |
| 2040 | .disp_maxy = 1023, |
| 2041 | .disp_minx = 0, |
| 2042 | .disp_miny = 16, |
| 2043 | .flags = 0x01, |
| 2044 | .gen = CY_GEN3, /* or */ |
| 2045 | .use_st = CY_USE_ST, |
| 2046 | .use_mt = CY_USE_MT, |
| 2047 | .use_hndshk = CY_SEND_HNDSHK, |
| 2048 | .use_trk_id = CY_USE_TRACKING_ID, |
Anirudh Ghayal | e96f66d | 2011-08-11 14:06:38 +0530 | [diff] [blame] | 2049 | .use_sleep = CY_USE_DEEP_SLEEP_SEL | CY_USE_LOW_POWER_SEL, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2050 | .use_gestures = CY_USE_GESTURES, |
| 2051 | .fw_fname = "cyttsp_8960_cdp.hex", |
| 2052 | /* activate up to 4 groups |
| 2053 | * and set active distance |
| 2054 | */ |
| 2055 | .gest_set = CY_GEST_GRP1 | CY_GEST_GRP2 | |
| 2056 | CY_GEST_GRP3 | CY_GEST_GRP4 | |
| 2057 | CY_ACT_DIST, |
| 2058 | /* change act_intrvl to customize the Active power state |
| 2059 | * scanning/processing refresh interval for Operating mode |
| 2060 | */ |
| 2061 | .act_intrvl = CY_ACT_INTRVL_DFLT, |
| 2062 | /* change tch_tmout to customize the touch timeout for the |
| 2063 | * Active power state for Operating mode |
| 2064 | */ |
| 2065 | .tch_tmout = CY_TCH_TMOUT_DFLT, |
| 2066 | /* change lp_intrvl to customize the Low Power power state |
| 2067 | * scanning/processing refresh interval for Operating mode |
| 2068 | */ |
| 2069 | .lp_intrvl = CY_LP_INTRVL_DFLT, |
| 2070 | .sleep_gpio = CYTTSP_TS_SLEEP_GPIO, |
| 2071 | .resout_gpio = CYTTSP_TS_RESOUT_N_GPIO, |
| 2072 | .irq_gpio = CYTTSP_TS_GPIO_IRQ, |
| 2073 | .regulator_info = regulator_data, |
| 2074 | .num_regulators = ARRAY_SIZE(regulator_data), |
| 2075 | .init = cyttsp_platform_init, |
Mohan Pallaka | 49c37d6 | 2011-08-01 11:52:00 +0530 | [diff] [blame] | 2076 | .correct_fw_ver = 9, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2077 | }; |
| 2078 | |
| 2079 | static struct i2c_board_info cyttsp_info[] __initdata = { |
| 2080 | { |
| 2081 | I2C_BOARD_INFO(CY_I2C_NAME, 0x24), |
| 2082 | .platform_data = &cyttsp_pdata, |
| 2083 | #ifndef CY_USE_TIMER |
| 2084 | .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ), |
| 2085 | #endif /* CY_USE_TIMER */ |
| 2086 | }, |
| 2087 | }; |
| 2088 | |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2089 | /* configuration data */ |
| 2090 | static const u8 mxt_config_data[] = { |
| 2091 | /* T6 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2092 | 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2093 | /* T38 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 2094 | 11, 2, 0, 11, 11, 11, 0, 0, 0, 0, |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2095 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2096 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2097 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2098 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2099 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2100 | 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2101 | /* T7 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2102 | 100, 16, 50, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2103 | /* T8 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 2104 | 8, 0, 0, 0, 0, 0, 8, 14, 50, 215, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2105 | /* T9 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 2106 | 131, 0, 0, 26, 42, 0, 32, 63, 3, 5, |
| 2107 | 0, 2, 1, 113, 10, 10, 8, 10, 255, 2, |
| 2108 | 85, 5, 0, 0, 20, 20, 75, 25, 202, 29, |
| 2109 | 10, 10, 45, 46, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2110 | /* T15 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2111 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2112 | 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2113 | /* T22 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 2114 | 5, 0, 0, 0, 0, 0, 0, 0, 30, 0, |
| 2115 | 0, 0, 5, 8, 10, 13, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2116 | /* T24 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2117 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2118 | 0, 0, 0, 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2119 | /* T25 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2120 | 3, 0, 188, 52, 52, 33, 0, 0, 0, 0, |
| 2121 | 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2122 | /* T27 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2123 | 0, 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2124 | /* T28 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 2125 | 0, 0, 0, 8, 12, 60, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2126 | /* T40 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2127 | 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2128 | /* T41 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2129 | 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2130 | /* T43 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2131 | 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2132 | }; |
| 2133 | |
| 2134 | #define MXT_TS_GPIO_IRQ 11 |
| 2135 | #define MXT_TS_LDO_EN_GPIO 50 |
| 2136 | #define MXT_TS_RESET_GPIO 52 |
| 2137 | |
| 2138 | static void mxt_init_hw_liquid(void) |
| 2139 | { |
| 2140 | int rc; |
| 2141 | |
| 2142 | rc = gpio_request(MXT_TS_GPIO_IRQ, "mxt_ts_irq_gpio"); |
| 2143 | if (rc) { |
| 2144 | pr_err("%s: unable to request mxt_ts_irq gpio [%d]\n", |
| 2145 | __func__, MXT_TS_GPIO_IRQ); |
| 2146 | return; |
| 2147 | } |
| 2148 | |
| 2149 | rc = gpio_direction_input(MXT_TS_GPIO_IRQ); |
| 2150 | if (rc) { |
| 2151 | pr_err("%s: unable to set_direction for mxt_ts_irq gpio [%d]\n", |
| 2152 | __func__, MXT_TS_GPIO_IRQ); |
| 2153 | goto err_irq_gpio_req; |
| 2154 | } |
| 2155 | |
| 2156 | rc = gpio_request(MXT_TS_LDO_EN_GPIO, "mxt_ldo_en_gpio"); |
| 2157 | if (rc) { |
| 2158 | pr_err("%s: unable to request mxt_ldo_en gpio [%d]\n", |
| 2159 | __func__, MXT_TS_LDO_EN_GPIO); |
| 2160 | goto err_irq_gpio_req; |
| 2161 | } |
| 2162 | |
| 2163 | rc = gpio_direction_output(MXT_TS_LDO_EN_GPIO, 1); |
| 2164 | if (rc) { |
| 2165 | pr_err("%s: unable to set_direction for mxt_ldo_en gpio [%d]\n", |
| 2166 | __func__, MXT_TS_LDO_EN_GPIO); |
| 2167 | goto err_ldo_gpio_req; |
| 2168 | } |
| 2169 | |
| 2170 | rc = gpio_request(MXT_TS_RESET_GPIO, "mxt_reset_gpio"); |
| 2171 | if (rc) { |
| 2172 | pr_err("%s: unable to request mxt_reset gpio [%d]\n", |
| 2173 | __func__, MXT_TS_RESET_GPIO); |
| 2174 | goto err_ldo_gpio_set_dir; |
| 2175 | } |
| 2176 | |
| 2177 | rc = gpio_direction_output(MXT_TS_RESET_GPIO, 1); |
| 2178 | if (rc) { |
| 2179 | pr_err("%s: unable to set_direction for mxt_reset gpio [%d]\n", |
| 2180 | __func__, MXT_TS_RESET_GPIO); |
| 2181 | goto err_reset_gpio_req; |
| 2182 | } |
| 2183 | |
| 2184 | return; |
| 2185 | |
| 2186 | err_reset_gpio_req: |
| 2187 | gpio_free(MXT_TS_RESET_GPIO); |
| 2188 | err_ldo_gpio_set_dir: |
| 2189 | gpio_set_value(MXT_TS_LDO_EN_GPIO, 0); |
| 2190 | err_ldo_gpio_req: |
| 2191 | gpio_free(MXT_TS_LDO_EN_GPIO); |
| 2192 | err_irq_gpio_req: |
| 2193 | gpio_free(MXT_TS_GPIO_IRQ); |
| 2194 | } |
| 2195 | |
| 2196 | static struct mxt_platform_data mxt_platform_data = { |
| 2197 | .config = mxt_config_data, |
| 2198 | .config_length = ARRAY_SIZE(mxt_config_data), |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2199 | .x_size = 1365, |
| 2200 | .y_size = 767, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2201 | .irqflags = IRQF_TRIGGER_FALLING, |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2202 | .i2c_pull_up = true, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2203 | }; |
| 2204 | |
| 2205 | static struct i2c_board_info mxt_device_info[] __initdata = { |
| 2206 | { |
| 2207 | I2C_BOARD_INFO("atmel_mxt_ts", 0x5b), |
| 2208 | .platform_data = &mxt_platform_data, |
| 2209 | .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ), |
| 2210 | }, |
| 2211 | }; |
| 2212 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2213 | static void gsbi_qup_i2c_gpio_config(int adap_id, int config_type) |
| 2214 | { |
| 2215 | } |
| 2216 | |
| 2217 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi4_pdata = { |
| 2218 | .clk_freq = 100000, |
| 2219 | .src_clk_rate = 24000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2220 | .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config, |
| 2221 | }; |
| 2222 | |
| 2223 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi3_pdata = { |
| 2224 | .clk_freq = 100000, |
| 2225 | .src_clk_rate = 24000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2226 | .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config, |
| 2227 | }; |
| 2228 | |
| 2229 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi10_pdata = { |
| 2230 | .clk_freq = 100000, |
| 2231 | .src_clk_rate = 24000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2232 | .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config, |
| 2233 | }; |
| 2234 | |
| 2235 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi12_pdata = { |
| 2236 | .clk_freq = 100000, |
| 2237 | .src_clk_rate = 24000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2238 | .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config, |
| 2239 | }; |
| 2240 | |
| 2241 | static struct msm_rpm_platform_data msm_rpm_data = { |
| 2242 | .reg_base_addrs = { |
| 2243 | [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE, |
| 2244 | [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400, |
| 2245 | [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600, |
| 2246 | [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00, |
| 2247 | }, |
| 2248 | |
| 2249 | .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ, |
| 2250 | .irq_err = RPM_APCC_CPU0_GP_LOW_IRQ, |
| 2251 | .irq_vmpm = RPM_APCC_CPU0_GP_MEDIUM_IRQ, |
| 2252 | .msm_apps_ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008, |
| 2253 | .msm_apps_ipc_rpm_val = 4, |
| 2254 | }; |
| 2255 | |
Stepan Moskovchenko | 93d79ec | 2011-09-21 16:52:16 -0700 | [diff] [blame] | 2256 | static struct ks8851_pdata spi_eth_pdata = { |
| 2257 | .irq_gpio = KS8851_IRQ_GPIO, |
| 2258 | .rst_gpio = KS8851_RST_GPIO, |
| 2259 | }; |
Praveen Chidambaram | 043f4ce | 2011-08-02 09:37:59 -0600 | [diff] [blame] | 2260 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2261 | static struct spi_board_info spi_board_info[] __initdata = { |
| 2262 | { |
| 2263 | .modalias = "ks8851", |
| 2264 | .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO), |
| 2265 | .max_speed_hz = 19200000, |
| 2266 | .bus_num = 0, |
| 2267 | .chip_select = 0, |
| 2268 | .mode = SPI_MODE_0, |
Stepan Moskovchenko | 93d79ec | 2011-09-21 16:52:16 -0700 | [diff] [blame] | 2269 | .platform_data = &spi_eth_pdata |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2270 | }, |
Chandan Uddaraju | 15e54b9 | 2011-09-12 10:52:36 -0700 | [diff] [blame] | 2271 | { |
| 2272 | .modalias = "dsi_novatek_3d_panel_spi", |
| 2273 | .max_speed_hz = 10800000, |
| 2274 | .bus_num = 0, |
| 2275 | .chip_select = 1, |
| 2276 | .mode = SPI_MODE_0, |
| 2277 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2278 | }; |
| 2279 | |
| 2280 | static struct platform_device msm_device_saw_core0 = { |
| 2281 | .name = "saw-regulator", |
| 2282 | .id = 0, |
| 2283 | .dev = { |
| 2284 | .platform_data = &msm_saw_regulator_pdata_s5, |
| 2285 | }, |
| 2286 | }; |
| 2287 | |
| 2288 | static struct platform_device msm_device_saw_core1 = { |
| 2289 | .name = "saw-regulator", |
| 2290 | .id = 1, |
| 2291 | .dev = { |
| 2292 | .platform_data = &msm_saw_regulator_pdata_s6, |
| 2293 | }, |
| 2294 | }; |
| 2295 | |
Siddartha Mohanadoss | ba21fdd | 2011-08-18 10:05:27 -0700 | [diff] [blame] | 2296 | static struct tsens_platform_data msm_tsens_pdata = { |
| 2297 | .slope = 910, |
| 2298 | .tsens_factor = 1000, |
| 2299 | .hw_type = MSM_8960, |
| 2300 | .tsens_num_sensor = 5, |
| 2301 | }; |
| 2302 | |
| 2303 | static struct platform_device msm_tsens_device = { |
| 2304 | .name = "tsens8960-tm", |
| 2305 | .id = -1, |
| 2306 | .dev = { |
| 2307 | .platform_data = &msm_tsens_pdata, |
| 2308 | }, |
| 2309 | }; |
| 2310 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2311 | #ifdef CONFIG_MSM_FAKE_BATTERY |
| 2312 | static struct platform_device fish_battery_device = { |
| 2313 | .name = "fish_battery", |
| 2314 | }; |
| 2315 | #endif |
| 2316 | |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 2317 | static struct platform_device msm8960_device_ext_5v_vreg __devinitdata = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2318 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2319 | .id = PM8921_MPP_PM_TO_SYS(7), |
| 2320 | .dev = { |
| 2321 | .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V], |
| 2322 | }, |
| 2323 | }; |
| 2324 | |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 2325 | static struct platform_device msm8960_device_ext_l2_vreg __devinitdata = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2326 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2327 | .id = 91, |
| 2328 | .dev = { |
| 2329 | .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_L2], |
| 2330 | }, |
| 2331 | }; |
| 2332 | |
David Collins | b10be1d | 2011-09-02 10:29:31 -0700 | [diff] [blame] | 2333 | static struct platform_device msm8960_device_ext_3p3v_vreg __devinitdata = { |
| 2334 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2335 | .id = PM8921_GPIO_PM_TO_SYS(17), |
| 2336 | .dev = { |
| 2337 | .platform_data = |
| 2338 | &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V], |
| 2339 | }, |
| 2340 | }; |
| 2341 | |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 2342 | static struct platform_device msm8960_device_rpm_regulator __devinitdata = { |
| 2343 | .name = "rpm-regulator", |
| 2344 | .id = -1, |
| 2345 | .dev = { |
| 2346 | .platform_data = &msm_rpm_regulator_pdata, |
| 2347 | }, |
| 2348 | }; |
| 2349 | |
David Collins | 4c31a87 | 2011-08-31 10:07:10 -0700 | [diff] [blame] | 2350 | static struct msm_rpm_log_platform_data msm_rpm_log_pdata = { |
| 2351 | .phys_addr_base = 0x0010C000, |
| 2352 | .reg_offsets = { |
| 2353 | [MSM_RPM_LOG_PAGE_INDICES] = 0x00000080, |
| 2354 | [MSM_RPM_LOG_PAGE_BUFFER] = 0x000000A0, |
| 2355 | }, |
| 2356 | .phys_size = SZ_8K, |
| 2357 | .log_len = 4096, /* log's buffer length in bytes */ |
| 2358 | .log_len_mask = (4096 >> 2) - 1, /* length mask in units of u32 */ |
| 2359 | }; |
| 2360 | |
| 2361 | static struct platform_device msm_rpm_log_device = { |
| 2362 | .name = "msm_rpm_log", |
| 2363 | .id = -1, |
| 2364 | .dev = { |
| 2365 | .platform_data = &msm_rpm_log_pdata, |
| 2366 | }, |
| 2367 | }; |
| 2368 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2369 | static struct platform_device *common_devices[] __initdata = { |
Stepan Moskovchenko | df13d34 | 2011-08-03 19:01:25 -0700 | [diff] [blame] | 2370 | &msm8960_device_dmov, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2371 | &msm_device_smd, |
| 2372 | &msm8960_device_uart_gsbi5, |
Mayank Rana | 9f51f58 | 2011-08-04 18:35:59 +0530 | [diff] [blame] | 2373 | &msm_device_uart_dm6, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2374 | &msm_device_saw_core0, |
| 2375 | &msm_device_saw_core1, |
| 2376 | &msm8960_device_ext_5v_vreg, |
| 2377 | &msm8960_device_ext_l2_vreg, |
| 2378 | &msm8960_device_ssbi_pm8921, |
| 2379 | &msm8960_device_qup_spi_gsbi1, |
| 2380 | &msm8960_device_qup_i2c_gsbi3, |
| 2381 | &msm8960_device_qup_i2c_gsbi4, |
| 2382 | &msm8960_device_qup_i2c_gsbi10, |
| 2383 | #ifndef CONFIG_MSM_DSPS |
| 2384 | &msm8960_device_qup_i2c_gsbi12, |
| 2385 | #endif |
| 2386 | &msm_slim_ctrl, |
| 2387 | &msm_device_wcnss_wlan, |
| 2388 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 2389 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 2390 | &qcrypto_device, |
| 2391 | #endif |
| 2392 | |
| 2393 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 2394 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 2395 | &qcedev_device, |
| 2396 | #endif |
| 2397 | #ifdef CONFIG_MSM_ROTATOR |
| 2398 | &msm_rotator_device, |
| 2399 | #endif |
| 2400 | &msm_device_sps, |
| 2401 | #ifdef CONFIG_MSM_FAKE_BATTERY |
| 2402 | &fish_battery_device, |
| 2403 | #endif |
| 2404 | #ifdef CONFIG_ANDROID_PMEM |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 2405 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2406 | &android_pmem_device, |
| 2407 | &android_pmem_adsp_device, |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 2408 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2409 | &android_pmem_audio_device, |
| 2410 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2411 | &msm_device_vidc, |
| 2412 | &msm_device_bam_dmux, |
| 2413 | &msm_fm_platform_init, |
Mona Hossain | 9c430e3 | 2011-07-27 11:04:47 -0700 | [diff] [blame] | 2414 | |
| 2415 | #ifdef CONFIG_HW_RANDOM_MSM |
| 2416 | &msm_device_rng, |
| 2417 | #endif |
Praveen Chidambaram | 043f4ce | 2011-08-02 09:37:59 -0600 | [diff] [blame] | 2418 | &msm_rpm_device, |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 2419 | #ifdef CONFIG_ION_MSM |
| 2420 | &ion_dev, |
| 2421 | #endif |
David Collins | 4c31a87 | 2011-08-31 10:07:10 -0700 | [diff] [blame] | 2422 | &msm_rpm_log_device, |
Praveen Chidambaram | 7a71223 | 2011-10-28 13:39:45 -0600 | [diff] [blame] | 2423 | &msm_rpm_stat_device, |
Mona Hossain | 11c03ac | 2011-10-26 12:42:10 -0700 | [diff] [blame] | 2424 | &msm_device_tz_log, |
| 2425 | |
Pratik Patel | 7831c08 | 2011-06-08 21:44:37 -0700 | [diff] [blame] | 2426 | #ifdef CONFIG_MSM_QDSS |
| 2427 | &msm_etb_device, |
| 2428 | &msm_tpiu_device, |
| 2429 | &msm_funnel_device, |
Pratik Patel | fd6f56a | 2011-10-10 17:47:55 -0700 | [diff] [blame] | 2430 | &msm_debug_device, |
Pratik Patel | 7831c08 | 2011-06-08 21:44:37 -0700 | [diff] [blame] | 2431 | &msm_ptm_device, |
| 2432 | #endif |
Swaminathan Sathappan | b77c65e9 | 2011-09-30 18:36:09 -0700 | [diff] [blame] | 2433 | &msm_device_dspcrashd_8960, |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 2434 | &msm8960_device_watchdog, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2435 | }; |
| 2436 | |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2437 | static struct platform_device *sim_devices[] __initdata = { |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 2438 | &msm8960_device_otg, |
| 2439 | &msm8960_device_gadget_peripheral, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2440 | &msm_device_hsusb_host, |
Vijayavardhan Vennapusa | eb56648 | 2011-09-18 07:48:37 +0530 | [diff] [blame] | 2441 | &msm_device_hsic_host, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2442 | &android_usb_device, |
| 2443 | &msm_device_vidc, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2444 | &msm_bus_apps_fabric, |
| 2445 | &msm_bus_sys_fabric, |
| 2446 | &msm_bus_mm_fabric, |
| 2447 | &msm_bus_sys_fpb, |
| 2448 | &msm_bus_cpss_fpb, |
| 2449 | &msm_pcm, |
| 2450 | &msm_pcm_routing, |
| 2451 | &msm_cpudai0, |
| 2452 | &msm_cpudai1, |
| 2453 | &msm_cpudai_hdmi_rx, |
| 2454 | &msm_cpudai_bt_rx, |
| 2455 | &msm_cpudai_bt_tx, |
| 2456 | &msm_cpudai_fm_rx, |
| 2457 | &msm_cpudai_fm_tx, |
Bhalchandra Gajare | 0e795c4 | 2011-08-15 18:10:30 -0700 | [diff] [blame] | 2458 | &msm_cpudai_auxpcm_rx, |
| 2459 | &msm_cpudai_auxpcm_tx, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2460 | &msm_cpu_fe, |
| 2461 | &msm_stub_codec, |
| 2462 | &msm_voice, |
| 2463 | &msm_voip, |
| 2464 | &msm_lpa_pcm, |
| 2465 | |
| 2466 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 2467 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 2468 | &qcrypto_device, |
| 2469 | #endif |
| 2470 | |
| 2471 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 2472 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 2473 | &qcedev_device, |
| 2474 | #endif |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2475 | }; |
| 2476 | |
| 2477 | static struct platform_device *rumi3_devices[] __initdata = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2478 | &msm_kgsl_3d0, |
| 2479 | &msm_kgsl_2d0, |
| 2480 | &msm_kgsl_2d1, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2481 | #ifdef CONFIG_MSM_GEMINI |
| 2482 | &msm8960_gemini_device, |
| 2483 | #endif |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2484 | }; |
| 2485 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2486 | static struct platform_device *cdp_devices[] __initdata = { |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 2487 | &msm8960_device_otg, |
| 2488 | &msm8960_device_gadget_peripheral, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2489 | &msm_device_hsusb_host, |
| 2490 | &android_usb_device, |
| 2491 | &msm_pcm, |
| 2492 | &msm_pcm_routing, |
| 2493 | &msm_cpudai0, |
| 2494 | &msm_cpudai1, |
| 2495 | &msm_cpudai_hdmi_rx, |
| 2496 | &msm_cpudai_bt_rx, |
| 2497 | &msm_cpudai_bt_tx, |
| 2498 | &msm_cpudai_fm_rx, |
| 2499 | &msm_cpudai_fm_tx, |
Bhalchandra Gajare | 0e795c4 | 2011-08-15 18:10:30 -0700 | [diff] [blame] | 2500 | &msm_cpudai_auxpcm_rx, |
| 2501 | &msm_cpudai_auxpcm_tx, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2502 | &msm_cpu_fe, |
| 2503 | &msm_stub_codec, |
| 2504 | &msm_kgsl_3d0, |
| 2505 | #ifdef CONFIG_MSM_KGSL_2D |
| 2506 | &msm_kgsl_2d0, |
| 2507 | &msm_kgsl_2d1, |
| 2508 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2509 | #ifdef CONFIG_MSM_GEMINI |
| 2510 | &msm8960_gemini_device, |
| 2511 | #endif |
| 2512 | &msm_voice, |
| 2513 | &msm_voip, |
| 2514 | &msm_lpa_pcm, |
Laxminath Kasam | cee1d60 | 2011-08-01 19:26:57 +0530 | [diff] [blame] | 2515 | &msm_cpudai_afe_01_rx, |
| 2516 | &msm_cpudai_afe_01_tx, |
| 2517 | &msm_cpudai_afe_02_rx, |
| 2518 | &msm_cpudai_afe_02_tx, |
| 2519 | &msm_pcm_afe, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2520 | &msm_pcm_hostless, |
| 2521 | &msm_bus_apps_fabric, |
| 2522 | &msm_bus_sys_fabric, |
| 2523 | &msm_bus_mm_fabric, |
| 2524 | &msm_bus_sys_fpb, |
| 2525 | &msm_bus_cpss_fpb, |
Siddartha Mohanadoss | ba21fdd | 2011-08-18 10:05:27 -0700 | [diff] [blame] | 2526 | &msm_tsens_device, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2527 | }; |
| 2528 | |
| 2529 | static void __init msm8960_i2c_init(void) |
| 2530 | { |
| 2531 | msm8960_device_qup_i2c_gsbi4.dev.platform_data = |
| 2532 | &msm8960_i2c_qup_gsbi4_pdata; |
| 2533 | |
| 2534 | msm8960_device_qup_i2c_gsbi3.dev.platform_data = |
| 2535 | &msm8960_i2c_qup_gsbi3_pdata; |
| 2536 | |
| 2537 | msm8960_device_qup_i2c_gsbi10.dev.platform_data = |
| 2538 | &msm8960_i2c_qup_gsbi10_pdata; |
| 2539 | |
| 2540 | msm8960_device_qup_i2c_gsbi12.dev.platform_data = |
| 2541 | &msm8960_i2c_qup_gsbi12_pdata; |
| 2542 | } |
| 2543 | |
Lucille Sylvester | 34ec369 | 2011-08-16 16:28:04 -0600 | [diff] [blame] | 2544 | static void __init msm8960_gfx_init(void) |
| 2545 | { |
Jeremy Gebben | 58b2dce | 2011-10-13 11:14:19 -0600 | [diff] [blame] | 2546 | uint32_t soc_platform_version = socinfo_get_version(); |
Lucille Sylvester | 34ec369 | 2011-08-16 16:28:04 -0600 | [diff] [blame] | 2547 | if (SOCINFO_VERSION_MAJOR(soc_platform_version) == 1) { |
| 2548 | struct kgsl_device_platform_data *kgsl_3d0_pdata = |
| 2549 | msm_kgsl_3d0.dev.platform_data; |
Lucille Sylvester | dce84cd | 2011-10-12 14:15:37 -0600 | [diff] [blame] | 2550 | kgsl_3d0_pdata->pwrlevel[0].gpu_freq = 320000000; |
| 2551 | kgsl_3d0_pdata->pwrlevel[1].gpu_freq = 266667000; |
Lucille Sylvester | 34ec369 | 2011-08-16 16:28:04 -0600 | [diff] [blame] | 2552 | } |
| 2553 | } |
| 2554 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2555 | static struct msm_cpuidle_state msm_cstates[] __initdata = { |
| 2556 | {0, 0, "C0", "WFI", |
| 2557 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT}, |
| 2558 | |
| 2559 | {0, 1, "C1", "STANDALONE_POWER_COLLAPSE", |
| 2560 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE}, |
| 2561 | |
| 2562 | {0, 2, "C2", "POWER_COLLAPSE", |
| 2563 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE}, |
| 2564 | |
| 2565 | {1, 0, "C0", "WFI", |
| 2566 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT}, |
| 2567 | |
| 2568 | {1, 1, "C1", "STANDALONE_POWER_COLLAPSE", |
| 2569 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE}, |
| 2570 | }; |
| 2571 | |
| 2572 | static struct msm_pm_platform_data msm_pm_data[MSM_PM_SLEEP_MODE_NR * 2] = { |
| 2573 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = { |
| 2574 | .idle_supported = 1, |
| 2575 | .suspend_supported = 1, |
| 2576 | .idle_enabled = 0, |
| 2577 | .suspend_enabled = 0, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2578 | }, |
| 2579 | |
| 2580 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = { |
| 2581 | .idle_supported = 1, |
| 2582 | .suspend_supported = 1, |
| 2583 | .idle_enabled = 0, |
| 2584 | .suspend_enabled = 0, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2585 | }, |
| 2586 | |
| 2587 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = { |
| 2588 | .idle_supported = 1, |
| 2589 | .suspend_supported = 1, |
| 2590 | .idle_enabled = 1, |
| 2591 | .suspend_enabled = 1, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2592 | }, |
| 2593 | |
| 2594 | [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = { |
| 2595 | .idle_supported = 0, |
| 2596 | .suspend_supported = 1, |
| 2597 | .idle_enabled = 0, |
| 2598 | .suspend_enabled = 0, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2599 | }, |
| 2600 | |
| 2601 | [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = { |
| 2602 | .idle_supported = 1, |
| 2603 | .suspend_supported = 1, |
| 2604 | .idle_enabled = 0, |
| 2605 | .suspend_enabled = 0, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2606 | }, |
| 2607 | |
| 2608 | [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = { |
| 2609 | .idle_supported = 1, |
| 2610 | .suspend_supported = 0, |
| 2611 | .idle_enabled = 1, |
| 2612 | .suspend_enabled = 0, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2613 | }, |
| 2614 | }; |
| 2615 | |
| 2616 | static struct msm_rpmrs_level msm_rpmrs_levels[] __initdata = { |
| 2617 | { |
| 2618 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT, |
| 2619 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 2620 | true, |
Maheshkumar Sivasubramanian | ef101a0 | 2011-09-19 16:34:30 -0600 | [diff] [blame] | 2621 | 100, 8000, 100000, 1, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2622 | }, |
| 2623 | |
| 2624 | { |
| 2625 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE, |
| 2626 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 2627 | true, |
Maheshkumar Sivasubramanian | ef101a0 | 2011-09-19 16:34:30 -0600 | [diff] [blame] | 2628 | 2000, 6000, 60100000, 3000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2629 | }, |
| 2630 | |
| 2631 | { |
| 2632 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2633 | MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE), |
| 2634 | false, |
Maheshkumar Sivasubramanian | ef101a0 | 2011-09-19 16:34:30 -0600 | [diff] [blame] | 2635 | 4200, 5000, 60350000, 3500, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2636 | }, |
| 2637 | |
| 2638 | { |
| 2639 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2640 | MSM_RPMRS_LIMITS(ON, HSFS_OPEN, MAX, ACTIVE), |
| 2641 | false, |
Maheshkumar Sivasubramanian | ef101a0 | 2011-09-19 16:34:30 -0600 | [diff] [blame] | 2642 | 6300, 4500, 65350000, 4800, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2643 | }, |
Maheshkumar Sivasubramanian | 7df1236 | 2011-11-02 08:25:49 -0600 | [diff] [blame] | 2644 | { |
| 2645 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2646 | MSM_RPMRS_LIMITS(ON, HSFS_OPEN, ACTIVE, RET_HIGH), |
| 2647 | false, |
| 2648 | 7000, 3500, 66600000, 5150, |
| 2649 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2650 | |
| 2651 | { |
| 2652 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2653 | MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE), |
| 2654 | false, |
Maheshkumar Sivasubramanian | ef101a0 | 2011-09-19 16:34:30 -0600 | [diff] [blame] | 2655 | 11700, 2500, 67850000, 5500, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2656 | }, |
| 2657 | |
| 2658 | { |
| 2659 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2660 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE), |
| 2661 | false, |
Maheshkumar Sivasubramanian | ef101a0 | 2011-09-19 16:34:30 -0600 | [diff] [blame] | 2662 | 13800, 2000, 71850000, 6800, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2663 | }, |
| 2664 | |
| 2665 | { |
| 2666 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2667 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH), |
| 2668 | false, |
Maheshkumar Sivasubramanian | ef101a0 | 2011-09-19 16:34:30 -0600 | [diff] [blame] | 2669 | 29700, 500, 75850000, 8800, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2670 | }, |
| 2671 | |
| 2672 | { |
| 2673 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2674 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW), |
| 2675 | false, |
Maheshkumar Sivasubramanian | ef101a0 | 2011-09-19 16:34:30 -0600 | [diff] [blame] | 2676 | 29700, 0, 76350000, 9800, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2677 | }, |
| 2678 | }; |
| 2679 | |
| 2680 | #ifdef CONFIG_I2C |
| 2681 | #define I2C_SURF 1 |
| 2682 | #define I2C_FFA (1 << 1) |
| 2683 | #define I2C_RUMI (1 << 2) |
| 2684 | #define I2C_SIM (1 << 3) |
| 2685 | #define I2C_FLUID (1 << 4) |
Amir Samuelov | 05f8780 | 2011-08-27 18:30:12 +0300 | [diff] [blame] | 2686 | #define I2C_LIQUID (1 << 5) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2687 | |
| 2688 | struct i2c_registry { |
| 2689 | u8 machs; |
| 2690 | int bus; |
| 2691 | struct i2c_board_info *info; |
| 2692 | int len; |
| 2693 | }; |
| 2694 | |
| 2695 | #ifdef CONFIG_MSM_CAMERA |
| 2696 | static struct i2c_board_info msm_camera_boardinfo[] __initdata = { |
| 2697 | #ifdef CONFIG_IMX074 |
| 2698 | { |
| 2699 | I2C_BOARD_INFO("imx074", 0x1A), |
| 2700 | }, |
| 2701 | #endif |
| 2702 | #ifdef CONFIG_OV2720 |
| 2703 | { |
| 2704 | I2C_BOARD_INFO("ov2720", 0x6C), |
| 2705 | }, |
| 2706 | #endif |
Nishant Pandit | 474f225 | 2011-07-23 23:17:56 +0530 | [diff] [blame] | 2707 | #ifdef CONFIG_MSM_CAMERA_FLASH_SC628A |
| 2708 | { |
| 2709 | I2C_BOARD_INFO("sc628a", 0x6E), |
| 2710 | }, |
| 2711 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2712 | }; |
| 2713 | #endif |
| 2714 | |
| 2715 | /* Sensors DSPS platform data */ |
| 2716 | #ifdef CONFIG_MSM_DSPS |
| 2717 | #define DSPS_PIL_GENERIC_NAME "dsps" |
| 2718 | #endif /* CONFIG_MSM_DSPS */ |
| 2719 | |
| 2720 | static void __init msm8960_init_dsps(void) |
| 2721 | { |
| 2722 | #ifdef CONFIG_MSM_DSPS |
| 2723 | struct msm_dsps_platform_data *pdata = |
| 2724 | msm_dsps_device.dev.platform_data; |
| 2725 | pdata->pil_name = DSPS_PIL_GENERIC_NAME; |
| 2726 | pdata->gpios = NULL; |
| 2727 | pdata->gpios_num = 0; |
| 2728 | |
| 2729 | platform_device_register(&msm_dsps_device); |
| 2730 | #endif /* CONFIG_MSM_DSPS */ |
| 2731 | } |
| 2732 | |
Vamsi Krishna | 98f54fb | 2011-11-02 14:55:41 -0700 | [diff] [blame] | 2733 | static void __init msm8960_init_hsic(void) |
| 2734 | { |
| 2735 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
| 2736 | uint32_t version = socinfo_get_version(); |
| 2737 | |
| 2738 | pr_info("%s: version:%d mtp:%d\n", __func__, |
| 2739 | SOCINFO_VERSION_MAJOR(version), |
| 2740 | machine_is_msm8960_mtp()); |
| 2741 | |
| 2742 | if ((SOCINFO_VERSION_MAJOR(version) == 1) || |
| 2743 | machine_is_msm8960_mtp() || |
| 2744 | machine_is_msm8960_fluid()) |
| 2745 | return; |
| 2746 | |
| 2747 | msm_gpiomux_install(msm8960_hsic_configs, |
| 2748 | ARRAY_SIZE(msm8960_hsic_configs)); |
| 2749 | |
| 2750 | platform_device_register(&msm_device_hsic_host); |
| 2751 | #endif |
| 2752 | } |
| 2753 | |
| 2754 | |
Amir Samuelov | 5137e39 | 2011-09-21 17:31:25 +0300 | [diff] [blame] | 2755 | #ifdef CONFIG_ISL9519_CHARGER |
| 2756 | static struct isl_platform_data isl_data __initdata = { |
| 2757 | .valid_n_gpio = 0, /* Not required when notify-by-pmic */ |
| 2758 | .chg_detection_config = NULL, /* Not required when notify-by-pmic */ |
| 2759 | .max_system_voltage = 4200, |
| 2760 | .min_system_voltage = 3200, |
| 2761 | .chgcurrent = 1000, /* 1900, */ |
| 2762 | .term_current = 400, /* Need fine tuning */ |
| 2763 | .input_current = 2048, |
| 2764 | }; |
| 2765 | |
| 2766 | static struct i2c_board_info isl_charger_i2c_info[] __initdata = { |
| 2767 | { |
| 2768 | I2C_BOARD_INFO("isl9519q", 0x9), |
| 2769 | .irq = 0, /* Not required when notify-by-pmic */ |
| 2770 | .platform_data = &isl_data, |
| 2771 | }, |
| 2772 | }; |
| 2773 | #endif /* CONFIG_ISL9519_CHARGER */ |
| 2774 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2775 | static struct i2c_registry msm8960_i2c_devices[] __initdata = { |
| 2776 | #ifdef CONFIG_MSM_CAMERA |
| 2777 | { |
Amir Samuelov | 05f8780 | 2011-08-27 18:30:12 +0300 | [diff] [blame] | 2778 | I2C_SURF | I2C_FFA | I2C_FLUID | I2C_LIQUID | I2C_RUMI, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2779 | MSM_8960_GSBI4_QUP_I2C_BUS_ID, |
| 2780 | msm_camera_boardinfo, |
| 2781 | ARRAY_SIZE(msm_camera_boardinfo), |
| 2782 | }, |
| 2783 | #endif |
Amir Samuelov | 5137e39 | 2011-09-21 17:31:25 +0300 | [diff] [blame] | 2784 | #ifdef CONFIG_ISL9519_CHARGER |
| 2785 | { |
| 2786 | I2C_LIQUID, |
| 2787 | MSM_8960_GSBI10_QUP_I2C_BUS_ID, |
| 2788 | isl_charger_i2c_info, |
| 2789 | ARRAY_SIZE(isl_charger_i2c_info), |
| 2790 | }, |
| 2791 | #endif /* CONFIG_ISL9519_CHARGER */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2792 | { |
| 2793 | I2C_SURF | I2C_FFA | I2C_FLUID, |
| 2794 | MSM_8960_GSBI3_QUP_I2C_BUS_ID, |
| 2795 | cyttsp_info, |
| 2796 | ARRAY_SIZE(cyttsp_info), |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 2797 | }, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2798 | { |
| 2799 | I2C_LIQUID, |
| 2800 | MSM_8960_GSBI3_QUP_I2C_BUS_ID, |
| 2801 | mxt_device_info, |
| 2802 | ARRAY_SIZE(mxt_device_info), |
| 2803 | }, |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 2804 | { |
| 2805 | I2C_LIQUID, |
| 2806 | MSM_8960_GSBI10_QUP_I2C_BUS_ID, |
| 2807 | msm_isa1200_board_info, |
| 2808 | ARRAY_SIZE(msm_isa1200_board_info), |
| 2809 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2810 | }; |
| 2811 | #endif /* CONFIG_I2C */ |
| 2812 | |
| 2813 | static void __init register_i2c_devices(void) |
| 2814 | { |
| 2815 | #ifdef CONFIG_I2C |
| 2816 | u8 mach_mask = 0; |
| 2817 | int i; |
| 2818 | |
| 2819 | /* Build the matching 'supported_machs' bitmask */ |
| 2820 | if (machine_is_msm8960_cdp()) |
| 2821 | mach_mask = I2C_SURF; |
| 2822 | else if (machine_is_msm8960_rumi3()) |
| 2823 | mach_mask = I2C_RUMI; |
| 2824 | else if (machine_is_msm8960_sim()) |
| 2825 | mach_mask = I2C_SIM; |
Amy Maloche | 2d02803 | 2011-07-20 14:08:06 -0700 | [diff] [blame] | 2826 | else if (machine_is_msm8960_fluid()) |
| 2827 | mach_mask = I2C_FLUID; |
Amir Samuelov | 05f8780 | 2011-08-27 18:30:12 +0300 | [diff] [blame] | 2828 | else if (machine_is_msm8960_liquid()) |
| 2829 | mach_mask = I2C_LIQUID; |
Amy Maloche | 1b0663f | 2011-08-02 16:46:22 -0700 | [diff] [blame] | 2830 | else if (machine_is_msm8960_mtp()) |
| 2831 | mach_mask = I2C_FFA; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2832 | else |
| 2833 | pr_err("unmatched machine ID in register_i2c_devices\n"); |
| 2834 | |
| 2835 | /* Run the array and install devices as appropriate */ |
| 2836 | for (i = 0; i < ARRAY_SIZE(msm8960_i2c_devices); ++i) { |
| 2837 | if (msm8960_i2c_devices[i].machs & mach_mask) |
| 2838 | i2c_register_board_info(msm8960_i2c_devices[i].bus, |
| 2839 | msm8960_i2c_devices[i].info, |
| 2840 | msm8960_i2c_devices[i].len); |
| 2841 | } |
| 2842 | #endif |
| 2843 | } |
| 2844 | |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2845 | static void __init msm8960_sim_init(void) |
| 2846 | { |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 2847 | struct msm_watchdog_pdata *wdog_pdata = (struct msm_watchdog_pdata *) |
| 2848 | &msm8960_device_watchdog.dev.platform_data; |
| 2849 | |
| 2850 | wdog_pdata->bark_time = 15000; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2851 | BUG_ON(msm_rpm_init(&msm_rpm_data)); |
| 2852 | BUG_ON(msm_rpmrs_levels_init(msm_rpmrs_levels, |
| 2853 | ARRAY_SIZE(msm_rpmrs_levels))); |
| 2854 | regulator_suppress_info_printing(); |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 2855 | platform_device_register(&msm8960_device_rpm_regulator); |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 2856 | msm_clock_init(&msm8960_clock_init_data); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 2857 | msm8960_init_pmic(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2858 | |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 2859 | msm8960_device_otg.dev.platform_data = &msm_otg_pdata; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2860 | gpiomux_init(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2861 | msm8960_i2c_init(); |
| 2862 | msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data)); |
| 2863 | msm_spm_l2_init(msm_spm_l2_data); |
| 2864 | msm8960_init_buses(); |
| 2865 | platform_add_devices(common_devices, ARRAY_SIZE(common_devices)); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 2866 | msm8960_pm8921_gpio_mpp_init(); |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2867 | platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices)); |
Matt Wagantall | ec57f06 | 2011-08-16 23:54:46 -0700 | [diff] [blame] | 2868 | acpuclk_init(&acpuclk_8960_soc_data); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2869 | |
| 2870 | msm8960_device_qup_spi_gsbi1.dev.platform_data = |
| 2871 | &msm8960_qup_spi_gsbi1_pdata; |
| 2872 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); |
| 2873 | |
| 2874 | msm8960_init_mmc(); |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 2875 | msm8960_init_fb(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2876 | slim_register_board_info(msm_slim_devices, |
| 2877 | ARRAY_SIZE(msm_slim_devices)); |
| 2878 | msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data)); |
| 2879 | msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ); |
| 2880 | msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates), |
| 2881 | msm_pm_data); |
Maheshkumar Sivasubramanian | 8ccc16e | 2011-10-25 15:59:57 -0600 | [diff] [blame] | 2882 | BUG_ON(msm_pm_boot_init(MSM_PM_BOOT_CONFIG_TZ, NULL)); |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2883 | } |
| 2884 | |
| 2885 | static void __init msm8960_rumi3_init(void) |
| 2886 | { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2887 | BUG_ON(msm_rpm_init(&msm_rpm_data)); |
| 2888 | BUG_ON(msm_rpmrs_levels_init(msm_rpmrs_levels, |
| 2889 | ARRAY_SIZE(msm_rpmrs_levels))); |
| 2890 | regulator_suppress_info_printing(); |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 2891 | platform_device_register(&msm8960_device_rpm_regulator); |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 2892 | msm_clock_init(&msm8960_dummy_clock_init_data); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2893 | gpiomux_init(); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 2894 | msm8960_init_pmic(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2895 | msm8960_device_qup_spi_gsbi1.dev.platform_data = |
| 2896 | &msm8960_qup_spi_gsbi1_pdata; |
| 2897 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); |
| 2898 | msm8960_i2c_init(); |
| 2899 | msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data)); |
| 2900 | msm_spm_l2_init(msm_spm_l2_data); |
| 2901 | platform_add_devices(common_devices, ARRAY_SIZE(common_devices)); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 2902 | msm8960_pm8921_gpio_mpp_init(); |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2903 | platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices)); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2904 | msm8960_init_mmc(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2905 | register_i2c_devices(); |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 2906 | msm8960_init_fb(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2907 | slim_register_board_info(msm_slim_devices, |
| 2908 | ARRAY_SIZE(msm_slim_devices)); |
| 2909 | msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data)); |
| 2910 | msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ); |
| 2911 | msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates), |
| 2912 | msm_pm_data); |
Maheshkumar Sivasubramanian | 8ccc16e | 2011-10-25 15:59:57 -0600 | [diff] [blame] | 2913 | BUG_ON(msm_pm_boot_init(MSM_PM_BOOT_CONFIG_TZ, NULL)); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2914 | } |
| 2915 | |
| 2916 | static void __init msm8960_cdp_init(void) |
| 2917 | { |
Naveen Ramaraj | 76483ad | 2011-09-06 14:25:44 -0700 | [diff] [blame] | 2918 | if (meminfo_init(SYS_MEMORY, SZ_256M) < 0) |
| 2919 | pr_err("meminfo_init() failed!\n"); |
| 2920 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2921 | BUG_ON(msm_rpm_init(&msm_rpm_data)); |
| 2922 | BUG_ON(msm_rpmrs_levels_init(msm_rpmrs_levels, |
| 2923 | ARRAY_SIZE(msm_rpmrs_levels))); |
Abhijeet Dharmapurikar | 6d565fd | 2011-09-15 18:49:56 -0700 | [diff] [blame] | 2924 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2925 | regulator_suppress_info_printing(); |
| 2926 | if (msm_xo_init()) |
| 2927 | pr_err("Failed to initialize XO votes\n"); |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 2928 | platform_device_register(&msm8960_device_rpm_regulator); |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 2929 | msm_clock_init(&msm8960_clock_init_data); |
Vijayavardhan Vennapusa | fc464f0 | 2011-11-04 21:54:00 +0530 | [diff] [blame] | 2930 | if (machine_is_msm8960_liquid()) |
| 2931 | msm_otg_pdata.mhl_enable = true; |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 2932 | msm8960_device_otg.dev.platform_data = &msm_otg_pdata; |
Vijayavardhan Vennapusa | 2b592824f | 2011-11-02 19:51:32 +0530 | [diff] [blame] | 2933 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
| 2934 | if (machine_is_msm8960_liquid()) { |
| 2935 | if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 2) |
| 2936 | msm_hsic_pdata.hub_reset = HSIC_HUB_RESET_GPIO; |
| 2937 | } |
| 2938 | #endif |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 2939 | msm_device_hsic_host.dev.platform_data = &msm_hsic_pdata; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2940 | gpiomux_init(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2941 | msm8960_device_qup_spi_gsbi1.dev.platform_data = |
| 2942 | &msm8960_qup_spi_gsbi1_pdata; |
| 2943 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 2944 | |
| 2945 | msm8960_init_pmic(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2946 | msm8960_i2c_init(); |
Lucille Sylvester | 34ec369 | 2011-08-16 16:28:04 -0600 | [diff] [blame] | 2947 | msm8960_gfx_init(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2948 | msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data)); |
| 2949 | msm_spm_l2_init(msm_spm_l2_data); |
| 2950 | msm8960_init_buses(); |
| 2951 | platform_add_devices(msm_footswitch_devices, |
| 2952 | msm_num_footswitch_devices); |
David Collins | b10be1d | 2011-09-02 10:29:31 -0700 | [diff] [blame] | 2953 | if (machine_is_msm8960_liquid()) |
| 2954 | platform_device_register(&msm8960_device_ext_3p3v_vreg); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2955 | platform_add_devices(common_devices, ARRAY_SIZE(common_devices)); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 2956 | msm8960_pm8921_gpio_mpp_init(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2957 | platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices)); |
Vamsi Krishna | 98f54fb | 2011-11-02 14:55:41 -0700 | [diff] [blame] | 2958 | msm8960_init_hsic(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2959 | msm8960_init_cam(); |
| 2960 | msm8960_init_mmc(); |
Matt Wagantall | ec57f06 | 2011-08-16 23:54:46 -0700 | [diff] [blame] | 2961 | acpuclk_init(&acpuclk_8960_soc_data); |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2962 | if (machine_is_msm8960_liquid()) |
| 2963 | mxt_init_hw_liquid(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2964 | register_i2c_devices(); |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 2965 | msm8960_init_fb(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2966 | slim_register_board_info(msm_slim_devices, |
| 2967 | ARRAY_SIZE(msm_slim_devices)); |
| 2968 | msm8960_init_dsps(); |
| 2969 | msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data)); |
| 2970 | msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ); |
| 2971 | msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates), |
| 2972 | msm_pm_data); |
Larry Bassel | a7eadea | 2011-07-14 10:46:00 -0700 | [diff] [blame] | 2973 | change_memory_power = &msm8960_change_memory_power; |
Maheshkumar Sivasubramanian | 8ccc16e | 2011-10-25 15:59:57 -0600 | [diff] [blame] | 2974 | BUG_ON(msm_pm_boot_init(MSM_PM_BOOT_CONFIG_TZ, NULL)); |
Joel King | b8352a1 | 2011-11-15 18:46:24 -0800 | [diff] [blame] | 2975 | |
| 2976 | if (PLATFORM_IS_CHARM25()) |
| 2977 | platform_add_devices(mdm_devices, ARRAY_SIZE(mdm_devices)); |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2978 | } |
| 2979 | |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 2980 | MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR") |
| 2981 | .map_io = msm8960_map_io, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2982 | .reserve = msm8960_reserve, |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 2983 | .init_irq = msm8960_init_irq, |
| 2984 | .timer = &msm_timer, |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2985 | .init_machine = msm8960_sim_init, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2986 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 2987 | .init_very_early = msm8960_early_memory, |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 2988 | MACHINE_END |
Stepan Moskovchenko | 50ede4e | 2010-12-13 18:12:19 -0800 | [diff] [blame] | 2989 | |
| 2990 | MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3") |
| 2991 | .map_io = msm8960_map_io, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2992 | .reserve = msm8960_reserve, |
Stepan Moskovchenko | 50ede4e | 2010-12-13 18:12:19 -0800 | [diff] [blame] | 2993 | .init_irq = msm8960_init_irq, |
| 2994 | .timer = &msm_timer, |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2995 | .init_machine = msm8960_rumi3_init, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2996 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 2997 | .init_very_early = msm8960_early_memory, |
Stepan Moskovchenko | 50ede4e | 2010-12-13 18:12:19 -0800 | [diff] [blame] | 2998 | MACHINE_END |
| 2999 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3000 | MACHINE_START(MSM8960_CDP, "QCT MSM8960 CDP") |
| 3001 | .map_io = msm8960_map_io, |
| 3002 | .reserve = msm8960_reserve, |
| 3003 | .init_irq = msm8960_init_irq, |
| 3004 | .timer = &msm_timer, |
| 3005 | .init_machine = msm8960_cdp_init, |
| 3006 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 3007 | .init_very_early = msm8960_early_memory, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3008 | MACHINE_END |
| 3009 | |
| 3010 | MACHINE_START(MSM8960_MTP, "QCT MSM8960 MTP") |
| 3011 | .map_io = msm8960_map_io, |
| 3012 | .reserve = msm8960_reserve, |
| 3013 | .init_irq = msm8960_init_irq, |
| 3014 | .timer = &msm_timer, |
| 3015 | .init_machine = msm8960_cdp_init, |
| 3016 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 3017 | .init_very_early = msm8960_early_memory, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3018 | MACHINE_END |
| 3019 | |
| 3020 | MACHINE_START(MSM8960_FLUID, "QCT MSM8960 FLUID") |
| 3021 | .map_io = msm8960_map_io, |
| 3022 | .reserve = msm8960_reserve, |
| 3023 | .init_irq = msm8960_init_irq, |
| 3024 | .timer = &msm_timer, |
| 3025 | .init_machine = msm8960_cdp_init, |
| 3026 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 3027 | .init_very_early = msm8960_early_memory, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3028 | MACHINE_END |
Amir Samuelov | 0d1f8ae | 2011-07-28 11:13:58 +0300 | [diff] [blame] | 3029 | |
| 3030 | MACHINE_START(MSM8960_LIQUID, "QCT MSM8960 LIQUID") |
| 3031 | .map_io = msm8960_map_io, |
| 3032 | .reserve = msm8960_reserve, |
| 3033 | .init_irq = msm8960_init_irq, |
| 3034 | .timer = &msm_timer, |
| 3035 | .init_machine = msm8960_cdp_init, |
| 3036 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 3037 | .init_very_early = msm8960_early_memory, |
Amir Samuelov | 0d1f8ae | 2011-07-28 11:13:58 +0300 | [diff] [blame] | 3038 | MACHINE_END |
Stepan Moskovchenko | f4fdfe5 | 2011-10-18 17:28:58 -0700 | [diff] [blame] | 3039 | |
| 3040 | #ifdef CONFIG_ARCH_MSM8930 |
| 3041 | MACHINE_START(MSM8930_CDP, "QCT MSM8930 CDP") |
| 3042 | .map_io = msm8930_map_io, |
| 3043 | .reserve = msm8960_reserve, |
| 3044 | .init_irq = msm8960_init_irq, |
| 3045 | .timer = &msm_timer, |
| 3046 | .init_machine = msm8960_cdp_init, |
| 3047 | .init_early = msm8960_allocate_memory_regions, |
Stepan Moskovchenko | 0ae2e72 | 2011-11-01 13:24:41 -0700 | [diff] [blame] | 3048 | .init_very_early = msm8960_early_memory, |
Stepan Moskovchenko | f4fdfe5 | 2011-10-18 17:28:58 -0700 | [diff] [blame] | 3049 | MACHINE_END |
| 3050 | |
| 3051 | MACHINE_START(MSM8930_MTP, "QCT MSM8930 MTP") |
| 3052 | .map_io = msm8930_map_io, |
| 3053 | .reserve = msm8960_reserve, |
| 3054 | .init_irq = msm8960_init_irq, |
| 3055 | .timer = &msm_timer, |
| 3056 | .init_machine = msm8960_cdp_init, |
| 3057 | .init_early = msm8960_allocate_memory_regions, |
Stepan Moskovchenko | 0ae2e72 | 2011-11-01 13:24:41 -0700 | [diff] [blame] | 3058 | .init_very_early = msm8960_early_memory, |
Stepan Moskovchenko | f4fdfe5 | 2011-10-18 17:28:58 -0700 | [diff] [blame] | 3059 | MACHINE_END |
| 3060 | |
| 3061 | MACHINE_START(MSM8930_FLUID, "QCT MSM8930 FLUID") |
| 3062 | .map_io = msm8930_map_io, |
| 3063 | .reserve = msm8960_reserve, |
| 3064 | .init_irq = msm8960_init_irq, |
| 3065 | .timer = &msm_timer, |
| 3066 | .init_machine = msm8960_cdp_init, |
| 3067 | .init_early = msm8960_allocate_memory_regions, |
Stepan Moskovchenko | 0ae2e72 | 2011-11-01 13:24:41 -0700 | [diff] [blame] | 3068 | .init_very_early = msm8960_early_memory, |
Stepan Moskovchenko | f4fdfe5 | 2011-10-18 17:28:58 -0700 | [diff] [blame] | 3069 | MACHINE_END |
| 3070 | #endif |