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> |
Jack Cheung | 0b1987e | 2011-11-18 13:36:29 -0800 | [diff] [blame] | 43 | #include <linux/memory.h> |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 44 | |
| 45 | #include <asm/mach-types.h> |
| 46 | #include <asm/mach/arch.h> |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 47 | #include <asm/setup.h> |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 48 | #include <asm/hardware/gic.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 49 | #include <asm/mach/mmc.h> |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 50 | |
| 51 | #include <mach/board.h> |
| 52 | #include <mach/msm_iomap.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 53 | #include <mach/msm_spi.h> |
| 54 | #ifdef CONFIG_USB_MSM_OTG_72K |
| 55 | #include <mach/msm_hsusb.h> |
| 56 | #else |
| 57 | #include <linux/usb/msm_hsusb.h> |
| 58 | #endif |
| 59 | #include <linux/usb/android.h> |
| 60 | #include <mach/usbdiag.h> |
| 61 | #include <mach/socinfo.h> |
| 62 | #include <mach/rpm.h> |
| 63 | #include <mach/gpio.h> |
Rohit Vaswani | a513aa8d | 2011-07-18 15:14:28 -0700 | [diff] [blame] | 64 | #include <mach/gpiomux.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 65 | #include <mach/msm_bus_board.h> |
| 66 | #include <mach/msm_memtypes.h> |
| 67 | #include <mach/dma.h> |
| 68 | #include <mach/msm_dsps.h> |
| 69 | #include <mach/msm_xo.h> |
Abhijeet Dharmapurikar | 6d565fd | 2011-09-15 18:49:56 -0700 | [diff] [blame] | 70 | #include <mach/restart.h> |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 71 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 72 | #ifdef CONFIG_WCD9310_CODEC |
| 73 | #include <linux/slimbus/slimbus.h> |
| 74 | #include <linux/mfd/wcd9310/core.h> |
| 75 | #include <linux/mfd/wcd9310/pdata.h> |
| 76 | #endif |
| 77 | |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 78 | #include <linux/ion.h> |
| 79 | #include <mach/ion.h> |
Joel King | b8352a1 | 2011-11-15 18:46:24 -0800 | [diff] [blame] | 80 | #include <mach/mdm2.h> |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 81 | |
Larry Bassel | 41a055b | 2011-12-06 16:15:14 -0800 | [diff] [blame] | 82 | #include <linux/fmem.h> |
| 83 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 84 | #include "timer.h" |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 85 | #include "devices.h" |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 86 | #include "devices-msm8x60.h" |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 87 | #include "spm.h" |
Stepan Moskovchenko | 5a83dba | 2011-12-05 17:30:17 -0800 | [diff] [blame] | 88 | #include "board-8960.h" |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 89 | #include "pm.h" |
| 90 | #include "cpuidle.h" |
| 91 | #include "rpm_resources.h" |
| 92 | #include "mpm.h" |
Matt Wagantall | 6d9ebee | 2011-08-26 12:15:24 -0700 | [diff] [blame] | 93 | #include "acpuclock.h" |
David Collins | 4c31a87 | 2011-08-31 10:07:10 -0700 | [diff] [blame] | 94 | #include "rpm_log.h" |
Naveen Ramaraj | 76483ad | 2011-09-06 14:25:44 -0700 | [diff] [blame] | 95 | #include "smd_private.h" |
Maheshkumar Sivasubramanian | 8ccc16e | 2011-10-25 15:59:57 -0600 | [diff] [blame] | 96 | #include "pm-boot.h" |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 97 | #include "msm_watchdog.h" |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 98 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 99 | static struct platform_device msm_fm_platform_init = { |
| 100 | .name = "iris_fm", |
| 101 | .id = -1, |
| 102 | }; |
| 103 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 104 | #define KS8851_RST_GPIO 89 |
| 105 | #define KS8851_IRQ_GPIO 90 |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 106 | #define HAP_SHIFT_LVL_OE_GPIO 47 |
| 107 | |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 108 | #if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE) |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 109 | |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 110 | struct sx150x_platform_data msm8960_sx150x_data[] = { |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 111 | [SX150X_CAM] = { |
| 112 | .gpio_base = GPIO_CAM_EXPANDER_BASE, |
| 113 | .oscio_is_gpo = false, |
| 114 | .io_pullup_ena = 0x0, |
Nishant Pandit | 474f225 | 2011-07-23 23:17:56 +0530 | [diff] [blame] | 115 | .io_pulldn_ena = 0xc0, |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 116 | .io_open_drain_ena = 0x0, |
| 117 | .irq_summary = -1, |
| 118 | }, |
Amir Samuelov | 755616d | 2011-12-13 16:34:46 +0200 | [diff] [blame] | 119 | [SX150X_LIQUID] = { |
| 120 | .gpio_base = GPIO_LIQUID_EXPANDER_BASE, |
| 121 | .oscio_is_gpo = false, |
| 122 | .io_pullup_ena = 0x0c08, |
| 123 | .io_pulldn_ena = 0x4060, |
| 124 | .io_open_drain_ena = 0x000c, |
| 125 | .io_polarity = 0, |
| 126 | .irq_summary = -1, |
| 127 | }, |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 128 | }; |
Nishant Pandit | 474f225 | 2011-07-23 23:17:56 +0530 | [diff] [blame] | 129 | |
| 130 | #endif |
| 131 | |
Haynes Mathew George | 9bc2765 | 2011-12-13 19:14:14 -0800 | [diff] [blame] | 132 | #define MSM_PMEM_ADSP_SIZE 0x4200000 |
Ben Romberger | 3ffcd81 | 2011-12-08 19:12:10 -0800 | [diff] [blame] | 133 | #define MSM_PMEM_AUDIO_SIZE 0x2B4000 |
Ravishangar Kalyanam | f4ef728 | 2011-10-10 17:39:48 -0700 | [diff] [blame] | 134 | #ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY |
| 135 | #define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */ |
| 136 | #else |
Chetan Kalyan | a25d076 | 2011-11-11 17:41:29 -0800 | [diff] [blame] | 137 | #define MSM_PMEM_SIZE 0x1C00000 /* 28 Mbytes */ |
Ravishangar Kalyanam | f4ef728 | 2011-10-10 17:39:48 -0700 | [diff] [blame] | 138 | #endif |
Ravishangar Kalyanam | 671f5ce | 2011-12-06 20:25:29 -0800 | [diff] [blame] | 139 | #define MSM_LIQUID_PMEM_SIZE 0x4000000 /* 64 Mbytes */ |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 140 | |
| 141 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
Laura Abbott | 6db11c9 | 2011-11-04 10:31:43 -0700 | [diff] [blame] | 142 | #define MSM_PMEM_KERNEL_EBI1_SIZE 0xB0C000 |
| 143 | #define MSM_ION_EBI_SIZE (MSM_PMEM_SIZE + 0x600000) |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 144 | #define MSM_ION_ADSP_SIZE MSM_PMEM_ADSP_SIZE |
Laura Abbott | 8c01736 | 2011-09-22 20:59:12 -0700 | [diff] [blame] | 145 | #define MSM_ION_HEAP_NUM 5 |
Ravishangar Kalyanam | 671f5ce | 2011-12-06 20:25:29 -0800 | [diff] [blame] | 146 | #define MSM_LIQUID_ION_EBI_SIZE (MSM_LIQUID_PMEM_SIZE + 0x600000) |
| 147 | static unsigned msm_ion_ebi_size = MSM_ION_EBI_SIZE; |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 148 | #else |
Laura Abbott | 6db11c9 | 2011-11-04 10:31:43 -0700 | [diff] [blame] | 149 | #define MSM_PMEM_KERNEL_EBI1_SIZE 0x110C000 |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 150 | #define MSM_ION_HEAP_NUM 2 |
| 151 | #endif |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 152 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 153 | #ifdef CONFIG_KERNEL_PMEM_EBI_REGION |
| 154 | static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE; |
| 155 | static int __init pmem_kernel_ebi1_size_setup(char *p) |
| 156 | { |
| 157 | pmem_kernel_ebi1_size = memparse(p, NULL); |
| 158 | return 0; |
| 159 | } |
| 160 | early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup); |
| 161 | #endif |
| 162 | |
| 163 | #ifdef CONFIG_ANDROID_PMEM |
| 164 | static unsigned pmem_size = MSM_PMEM_SIZE; |
Ravishangar Kalyanam | 671f5ce | 2011-12-06 20:25:29 -0800 | [diff] [blame] | 165 | static unsigned pmem_param_set; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 166 | static int __init pmem_size_setup(char *p) |
| 167 | { |
| 168 | pmem_size = memparse(p, NULL); |
Ravishangar Kalyanam | 671f5ce | 2011-12-06 20:25:29 -0800 | [diff] [blame] | 169 | pmem_param_set = 1; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 170 | return 0; |
| 171 | } |
| 172 | early_param("pmem_size", pmem_size_setup); |
| 173 | |
| 174 | static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE; |
| 175 | |
| 176 | static int __init pmem_adsp_size_setup(char *p) |
| 177 | { |
| 178 | pmem_adsp_size = memparse(p, NULL); |
| 179 | return 0; |
| 180 | } |
| 181 | early_param("pmem_adsp_size", pmem_adsp_size_setup); |
| 182 | |
| 183 | static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE; |
| 184 | |
| 185 | static int __init pmem_audio_size_setup(char *p) |
| 186 | { |
| 187 | pmem_audio_size = memparse(p, NULL); |
| 188 | return 0; |
| 189 | } |
| 190 | early_param("pmem_audio_size", pmem_audio_size_setup); |
| 191 | #endif |
| 192 | |
| 193 | #ifdef CONFIG_ANDROID_PMEM |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 194 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 195 | static struct android_pmem_platform_data android_pmem_pdata = { |
| 196 | .name = "pmem", |
| 197 | .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING, |
| 198 | .cached = 1, |
| 199 | .memory_type = MEMTYPE_EBI1, |
| 200 | }; |
| 201 | |
| 202 | static struct platform_device android_pmem_device = { |
| 203 | .name = "android_pmem", |
| 204 | .id = 0, |
| 205 | .dev = {.platform_data = &android_pmem_pdata}, |
| 206 | }; |
| 207 | |
| 208 | static struct android_pmem_platform_data android_pmem_adsp_pdata = { |
| 209 | .name = "pmem_adsp", |
| 210 | .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, |
| 211 | .cached = 0, |
| 212 | .memory_type = MEMTYPE_EBI1, |
| 213 | }; |
| 214 | static struct platform_device android_pmem_adsp_device = { |
| 215 | .name = "android_pmem", |
| 216 | .id = 2, |
| 217 | .dev = { .platform_data = &android_pmem_adsp_pdata }, |
| 218 | }; |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 219 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 220 | |
| 221 | static struct android_pmem_platform_data android_pmem_audio_pdata = { |
| 222 | .name = "pmem_audio", |
| 223 | .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, |
| 224 | .cached = 0, |
| 225 | .memory_type = MEMTYPE_EBI1, |
| 226 | }; |
| 227 | |
| 228 | static struct platform_device android_pmem_audio_device = { |
| 229 | .name = "android_pmem", |
| 230 | .id = 4, |
| 231 | .dev = { .platform_data = &android_pmem_audio_pdata }, |
| 232 | }; |
| 233 | #endif |
| 234 | |
Larry Bassel | 41a055b | 2011-12-06 16:15:14 -0800 | [diff] [blame] | 235 | struct fmem_platform_data fmem_pdata = { |
| 236 | }; |
| 237 | |
Swaminathan Sathappan | b77c65e9 | 2011-09-30 18:36:09 -0700 | [diff] [blame] | 238 | #define DSP_RAM_BASE_8960 0x8da00000 |
| 239 | #define DSP_RAM_SIZE_8960 0x1800000 |
| 240 | static int dspcrashd_pdata_8960 = 0xDEADDEAD; |
| 241 | |
| 242 | static struct resource resources_dspcrashd_8960[] = { |
| 243 | { |
| 244 | .name = "msm_dspcrashd", |
| 245 | .start = DSP_RAM_BASE_8960, |
| 246 | .end = DSP_RAM_BASE_8960 + DSP_RAM_SIZE_8960, |
| 247 | .flags = IORESOURCE_DMA, |
| 248 | }, |
| 249 | }; |
| 250 | |
Stepan Moskovchenko | fc70d90 | 2011-11-30 12:39:36 -0800 | [diff] [blame] | 251 | static struct platform_device msm_device_dspcrashd_8960 = { |
Swaminathan Sathappan | b77c65e9 | 2011-09-30 18:36:09 -0700 | [diff] [blame] | 252 | .name = "msm_dspcrashd", |
| 253 | .num_resources = ARRAY_SIZE(resources_dspcrashd_8960), |
| 254 | .resource = resources_dspcrashd_8960, |
| 255 | .dev = { .platform_data = &dspcrashd_pdata_8960 }, |
| 256 | }; |
| 257 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 258 | static struct memtype_reserve msm8960_reserve_table[] __initdata = { |
| 259 | [MEMTYPE_SMI] = { |
| 260 | }, |
| 261 | [MEMTYPE_EBI0] = { |
| 262 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 263 | }, |
| 264 | [MEMTYPE_EBI1] = { |
| 265 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 266 | }, |
| 267 | }; |
| 268 | |
| 269 | static void __init size_pmem_devices(void) |
| 270 | { |
| 271 | #ifdef CONFIG_ANDROID_PMEM |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 272 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 273 | android_pmem_adsp_pdata.size = pmem_adsp_size; |
Ravishangar Kalyanam | 671f5ce | 2011-12-06 20:25:29 -0800 | [diff] [blame] | 274 | |
| 275 | if (!pmem_param_set && machine_is_msm8960_liquid()) |
| 276 | pmem_size = MSM_LIQUID_PMEM_SIZE; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 277 | android_pmem_pdata.size = pmem_size; |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 278 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 279 | android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE; |
| 280 | #endif |
| 281 | } |
| 282 | |
| 283 | static void __init reserve_memory_for(struct android_pmem_platform_data *p) |
| 284 | { |
| 285 | msm8960_reserve_table[p->memory_type].size += p->size; |
| 286 | } |
| 287 | |
| 288 | static void __init reserve_pmem_memory(void) |
| 289 | { |
| 290 | #ifdef CONFIG_ANDROID_PMEM |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 291 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 292 | reserve_memory_for(&android_pmem_adsp_pdata); |
| 293 | reserve_memory_for(&android_pmem_pdata); |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 294 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 295 | reserve_memory_for(&android_pmem_audio_pdata); |
| 296 | msm8960_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size; |
| 297 | #endif |
| 298 | } |
| 299 | |
Larry Bassel | 41a055b | 2011-12-06 16:15:14 -0800 | [diff] [blame] | 300 | static void __init reserve_fmem_memory(void) |
| 301 | { |
| 302 | } |
| 303 | |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 304 | static int msm8960_paddr_to_memtype(unsigned int paddr) |
| 305 | { |
| 306 | return MEMTYPE_EBI1; |
| 307 | } |
| 308 | |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 309 | #ifdef CONFIG_ION_MSM |
Stepan Moskovchenko | fc70d90 | 2011-11-30 12:39:36 -0800 | [diff] [blame] | 310 | static struct ion_platform_data ion_pdata = { |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 311 | .nr = MSM_ION_HEAP_NUM, |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 312 | .heaps = { |
| 313 | { |
| 314 | .id = ION_HEAP_SYSTEM_ID, |
| 315 | .type = ION_HEAP_TYPE_SYSTEM, |
| 316 | .name = ION_KMALLOC_HEAP_NAME, |
| 317 | }, |
| 318 | { |
| 319 | .id = ION_HEAP_SYSTEM_CONTIG_ID, |
| 320 | .type = ION_HEAP_TYPE_SYSTEM_CONTIG, |
| 321 | .name = ION_VMALLOC_HEAP_NAME, |
| 322 | }, |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 323 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 324 | { |
| 325 | .id = ION_HEAP_EBI_ID, |
| 326 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 327 | .name = ION_EBI1_HEAP_NAME, |
| 328 | .size = MSM_ION_EBI_SIZE, |
| 329 | .memory_type = ION_EBI_TYPE, |
| 330 | }, |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 331 | { |
| 332 | .id = ION_HEAP_ADSP_ID, |
| 333 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 334 | .name = ION_ADSP_HEAP_NAME, |
| 335 | .size = MSM_ION_ADSP_SIZE, |
| 336 | .memory_type = ION_EBI_TYPE, |
| 337 | }, |
Laura Abbott | 8c01736 | 2011-09-22 20:59:12 -0700 | [diff] [blame] | 338 | { |
| 339 | .id = ION_HEAP_IOMMU_ID, |
| 340 | .type = ION_HEAP_TYPE_IOMMU, |
| 341 | .name = ION_IOMMU_HEAP_NAME, |
| 342 | }, |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 343 | #endif |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 344 | } |
| 345 | }; |
| 346 | |
Stepan Moskovchenko | fc70d90 | 2011-11-30 12:39:36 -0800 | [diff] [blame] | 347 | static struct platform_device ion_dev = { |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 348 | .name = "ion-msm", |
| 349 | .id = 1, |
| 350 | .dev = { .platform_data = &ion_pdata }, |
| 351 | }; |
| 352 | #endif |
| 353 | |
Larry Bassel | 41a055b | 2011-12-06 16:15:14 -0800 | [diff] [blame] | 354 | struct platform_device fmem_device = { |
| 355 | .name = "fmem", |
| 356 | .id = 1, |
| 357 | .dev = { .platform_data = &fmem_pdata }, |
| 358 | }; |
| 359 | |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 360 | static void reserve_ion_memory(void) |
| 361 | { |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 362 | #if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION) |
Ravishangar Kalyanam | 671f5ce | 2011-12-06 20:25:29 -0800 | [diff] [blame] | 363 | unsigned int i; |
| 364 | |
| 365 | if (!pmem_param_set && machine_is_msm8960_liquid()) { |
| 366 | msm_ion_ebi_size = MSM_LIQUID_ION_EBI_SIZE; |
| 367 | for (i = 0; i < ion_pdata.nr; i++) { |
| 368 | if (ion_pdata.heaps[i].id == ION_HEAP_EBI_ID) { |
| 369 | ion_pdata.heaps[i].size = msm_ion_ebi_size; |
| 370 | pr_debug("msm_ion_ebi_size 0x%x\n", |
| 371 | msm_ion_ebi_size); |
| 372 | break; |
| 373 | } |
| 374 | } |
| 375 | } |
| 376 | msm8960_reserve_table[MEMTYPE_EBI1].size += msm_ion_ebi_size; |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 377 | msm8960_reserve_table[MEMTYPE_EBI1].size += MSM_ION_ADSP_SIZE; |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 378 | #endif |
| 379 | } |
Huaibin Yang | a541942 | 2011-12-08 23:52:10 -0800 | [diff] [blame] | 380 | |
| 381 | static void __init reserve_mdp_memory(void) |
| 382 | { |
| 383 | msm8960_mdp_writeback(msm8960_reserve_table); |
| 384 | } |
| 385 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 386 | static void __init msm8960_calculate_reserve_sizes(void) |
| 387 | { |
| 388 | size_pmem_devices(); |
| 389 | reserve_pmem_memory(); |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 390 | reserve_ion_memory(); |
Larry Bassel | 41a055b | 2011-12-06 16:15:14 -0800 | [diff] [blame] | 391 | reserve_fmem_memory(); |
Huaibin Yang | a541942 | 2011-12-08 23:52:10 -0800 | [diff] [blame] | 392 | reserve_mdp_memory(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 393 | } |
| 394 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 395 | static struct reserve_info msm8960_reserve_info __initdata = { |
| 396 | .memtype_reserve_table = msm8960_reserve_table, |
| 397 | .calculate_reserve_sizes = msm8960_calculate_reserve_sizes, |
| 398 | .paddr_to_memtype = msm8960_paddr_to_memtype, |
| 399 | }; |
| 400 | |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 401 | static int msm8960_memory_bank_size(void) |
| 402 | { |
| 403 | return 1<<29; |
| 404 | } |
| 405 | |
| 406 | static void __init locate_unstable_memory(void) |
| 407 | { |
| 408 | struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1]; |
| 409 | unsigned long bank_size; |
| 410 | unsigned long low, high; |
| 411 | |
| 412 | bank_size = msm8960_memory_bank_size(); |
| 413 | low = meminfo.bank[0].start; |
| 414 | high = mb->start + mb->size; |
Olav Haugan | 62052e4 | 2011-10-28 14:28:32 -0700 | [diff] [blame] | 415 | |
| 416 | /* Check if 32 bit overflow occured */ |
| 417 | if (high < mb->start) |
| 418 | high = ~0UL; |
| 419 | |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 420 | low &= ~(bank_size - 1); |
| 421 | |
| 422 | if (high - low <= bank_size) |
| 423 | return; |
Jack Cheung | 0b1987e | 2011-11-18 13:36:29 -0800 | [diff] [blame] | 424 | msm8960_reserve_info.low_unstable_address = high - |
| 425 | MIN_MEMORY_BLOCK_SIZE; |
| 426 | msm8960_reserve_info.max_unstable_size = MIN_MEMORY_BLOCK_SIZE; |
Olav Haugan | 62052e4 | 2011-10-28 14:28:32 -0700 | [diff] [blame] | 427 | |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 428 | msm8960_reserve_info.bank_size = bank_size; |
| 429 | pr_info("low unstable address %lx max size %lx bank size %lx\n", |
| 430 | msm8960_reserve_info.low_unstable_address, |
| 431 | msm8960_reserve_info.max_unstable_size, |
| 432 | msm8960_reserve_info.bank_size); |
| 433 | } |
| 434 | |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 435 | static void __init place_movable_zone(void) |
| 436 | { |
| 437 | movable_reserved_start = msm8960_reserve_info.low_unstable_address; |
| 438 | movable_reserved_size = msm8960_reserve_info.max_unstable_size; |
| 439 | pr_info("movable zone start %lx size %lx\n", |
| 440 | movable_reserved_start, movable_reserved_size); |
| 441 | } |
| 442 | |
| 443 | static void __init msm8960_early_memory(void) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 444 | { |
| 445 | reserve_info = &msm8960_reserve_info; |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 446 | locate_unstable_memory(); |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 447 | place_movable_zone(); |
| 448 | } |
| 449 | |
| 450 | static void __init msm8960_reserve(void) |
| 451 | { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 452 | msm_reserve(); |
Larry Bassel | 41a055b | 2011-12-06 16:15:14 -0800 | [diff] [blame] | 453 | fmem_pdata.phys = reserve_memory_for_fmem(fmem_pdata.size); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 454 | } |
| 455 | |
Larry Bassel | a4414b1 | 2011-08-04 11:11:02 -0700 | [diff] [blame] | 456 | static int msm8960_change_memory_power(u64 start, u64 size, |
| 457 | int change_type) |
Larry Bassel | a7eadea | 2011-07-14 10:46:00 -0700 | [diff] [blame] | 458 | { |
Naveen Ramaraj | b03bb1b | 2011-09-12 14:34:31 -0700 | [diff] [blame] | 459 | return soc_change_memory_power(start, size, change_type); |
Larry Bassel | a7eadea | 2011-07-14 10:46:00 -0700 | [diff] [blame] | 460 | } |
| 461 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 462 | static void __init msm8960_allocate_memory_regions(void) |
| 463 | { |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 464 | msm8960_allocate_fb_region(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 465 | } |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 466 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 467 | #ifdef CONFIG_WCD9310_CODEC |
| 468 | |
| 469 | #define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS) |
| 470 | |
Patrick Lai | 3043fba | 2011-08-01 14:15:57 -0700 | [diff] [blame] | 471 | /* Micbias setting is based on 8660 CDP/MTP/FLUID requirement |
| 472 | * 4 micbiases are used to power various analog and digital |
| 473 | * microphones operating at 1800 mV. Technically, all micbiases |
| 474 | * can source from single cfilter since all microphones operate |
| 475 | * at the same voltage level. The arrangement below is to make |
| 476 | * sure all cfilters are exercised. LDO_H regulator ouput level |
| 477 | * does not need to be as high as 2.85V. It is choosen for |
| 478 | * microphone sensitivity purpose. |
| 479 | */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 480 | static struct tabla_pdata tabla_platform_data = { |
| 481 | .slimbus_slave_device = { |
| 482 | .name = "tabla-slave", |
| 483 | .e_addr = {0, 0, 0x10, 0, 0x17, 2}, |
| 484 | }, |
| 485 | .irq = MSM_GPIO_TO_INT(62), |
| 486 | .irq_base = TABLA_INTERRUPT_BASE, |
| 487 | .num_irqs = NR_TABLA_IRQS, |
| 488 | .reset_gpio = PM8921_GPIO_PM_TO_SYS(34), |
Patrick Lai | 3043fba | 2011-08-01 14:15:57 -0700 | [diff] [blame] | 489 | .micbias = { |
| 490 | .ldoh_v = TABLA_LDOH_2P85_V, |
| 491 | .cfilt1_mv = 1800, |
| 492 | .cfilt2_mv = 1800, |
| 493 | .cfilt3_mv = 1800, |
| 494 | .bias1_cfilt_sel = TABLA_CFILT1_SEL, |
| 495 | .bias2_cfilt_sel = TABLA_CFILT2_SEL, |
| 496 | .bias3_cfilt_sel = TABLA_CFILT3_SEL, |
| 497 | .bias4_cfilt_sel = TABLA_CFILT3_SEL, |
| 498 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 499 | }; |
| 500 | |
| 501 | static struct slim_device msm_slim_tabla = { |
| 502 | .name = "tabla-slim", |
| 503 | .e_addr = {0, 1, 0x10, 0, 0x17, 2}, |
| 504 | .dev = { |
| 505 | .platform_data = &tabla_platform_data, |
| 506 | }, |
| 507 | }; |
Santosh Mardi | 60e19d9 | 2011-10-28 01:15:14 +0530 | [diff] [blame] | 508 | |
| 509 | static struct tabla_pdata tabla20_platform_data = { |
| 510 | .slimbus_slave_device = { |
| 511 | .name = "tabla-slave", |
| 512 | .e_addr = {0, 0, 0x60, 0, 0x17, 2}, |
| 513 | }, |
| 514 | .irq = MSM_GPIO_TO_INT(62), |
| 515 | .irq_base = TABLA_INTERRUPT_BASE, |
| 516 | .num_irqs = NR_TABLA_IRQS, |
| 517 | .reset_gpio = PM8921_GPIO_PM_TO_SYS(34), |
| 518 | .micbias = { |
| 519 | .ldoh_v = TABLA_LDOH_2P85_V, |
| 520 | .cfilt1_mv = 1800, |
| 521 | .cfilt2_mv = 1800, |
| 522 | .cfilt3_mv = 1800, |
| 523 | .bias1_cfilt_sel = TABLA_CFILT1_SEL, |
| 524 | .bias2_cfilt_sel = TABLA_CFILT2_SEL, |
| 525 | .bias3_cfilt_sel = TABLA_CFILT3_SEL, |
| 526 | .bias4_cfilt_sel = TABLA_CFILT3_SEL, |
| 527 | } |
| 528 | }; |
| 529 | |
| 530 | static struct slim_device msm_slim_tabla20 = { |
| 531 | .name = "tabla2x-slim", |
| 532 | .e_addr = {0, 1, 0x60, 0, 0x17, 2}, |
| 533 | .dev = { |
| 534 | .platform_data = &tabla20_platform_data, |
| 535 | }, |
| 536 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 537 | #endif |
| 538 | |
| 539 | static struct slim_boardinfo msm_slim_devices[] = { |
| 540 | #ifdef CONFIG_WCD9310_CODEC |
| 541 | { |
| 542 | .bus_num = 1, |
| 543 | .slim_slave = &msm_slim_tabla, |
| 544 | }, |
Santosh Mardi | 60e19d9 | 2011-10-28 01:15:14 +0530 | [diff] [blame] | 545 | { |
| 546 | .bus_num = 1, |
| 547 | .slim_slave = &msm_slim_tabla20, |
| 548 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 549 | #endif |
| 550 | /* add more slimbus slaves as needed */ |
| 551 | }; |
| 552 | |
Yunsen Wang | 5c1a739 | 2011-07-09 19:10:16 -0700 | [diff] [blame] | 553 | #define MSM_WCNSS_PHYS 0x03000000 |
| 554 | #define MSM_WCNSS_SIZE 0x280000 |
| 555 | |
| 556 | static struct resource resources_wcnss_wlan[] = { |
| 557 | { |
| 558 | .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ, |
| 559 | .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ, |
| 560 | .name = "wcnss_wlanrx_irq", |
| 561 | .flags = IORESOURCE_IRQ, |
| 562 | }, |
| 563 | { |
| 564 | .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ, |
| 565 | .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ, |
| 566 | .name = "wcnss_wlantx_irq", |
| 567 | .flags = IORESOURCE_IRQ, |
| 568 | }, |
| 569 | { |
| 570 | .start = MSM_WCNSS_PHYS, |
| 571 | .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1, |
| 572 | .name = "wcnss_mmio", |
| 573 | .flags = IORESOURCE_MEM, |
| 574 | }, |
Ankur Nandwani | ad0d9ac | 2011-09-26 11:49:25 -0700 | [diff] [blame] | 575 | { |
| 576 | .start = 84, |
| 577 | .end = 88, |
| 578 | .name = "wcnss_gpios_5wire", |
| 579 | .flags = IORESOURCE_IO, |
| 580 | }, |
Yunsen Wang | 5c1a739 | 2011-07-09 19:10:16 -0700 | [diff] [blame] | 581 | }; |
| 582 | |
Ankur Nandwani | b0039b0 | 2011-08-09 14:00:45 -0700 | [diff] [blame] | 583 | static struct qcom_wcnss_opts qcom_wcnss_pdata = { |
| 584 | .has_48mhz_xo = 1, |
| 585 | }; |
| 586 | |
Yunsen Wang | 5c1a739 | 2011-07-09 19:10:16 -0700 | [diff] [blame] | 587 | static struct platform_device msm_device_wcnss_wlan = { |
| 588 | .name = "wcnss_wlan", |
| 589 | .id = 0, |
| 590 | .num_resources = ARRAY_SIZE(resources_wcnss_wlan), |
| 591 | .resource = resources_wcnss_wlan, |
Ankur Nandwani | b0039b0 | 2011-08-09 14:00:45 -0700 | [diff] [blame] | 592 | .dev = {.platform_data = &qcom_wcnss_pdata}, |
Yunsen Wang | 5c1a739 | 2011-07-09 19:10:16 -0700 | [diff] [blame] | 593 | }; |
| 594 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 595 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 596 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \ |
| 597 | defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 598 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 599 | |
| 600 | #define QCE_SIZE 0x10000 |
| 601 | #define QCE_0_BASE 0x18500000 |
| 602 | |
| 603 | #define QCE_HW_KEY_SUPPORT 0 |
| 604 | #define QCE_SHA_HMAC_SUPPORT 1 |
| 605 | #define QCE_SHARE_CE_RESOURCE 1 |
| 606 | #define QCE_CE_SHARED 0 |
| 607 | |
Ramesh Masavarapu | 4925968 | 2011-12-02 14:00:18 -0800 | [diff] [blame^] | 608 | /* Begin Bus scaling definitions */ |
| 609 | static struct msm_bus_vectors crypto_hw_init_vectors[] = { |
| 610 | { |
| 611 | .src = MSM_BUS_MASTER_ADM_PORT0, |
| 612 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 613 | .ab = 0, |
| 614 | .ib = 0, |
| 615 | }, |
| 616 | { |
| 617 | .src = MSM_BUS_MASTER_ADM_PORT1, |
| 618 | .dst = MSM_BUS_SLAVE_GSBI1_UART, |
| 619 | .ab = 0, |
| 620 | .ib = 0, |
| 621 | }, |
| 622 | }; |
| 623 | |
| 624 | static struct msm_bus_vectors crypto_hw_active_vectors[] = { |
| 625 | { |
| 626 | .src = MSM_BUS_MASTER_ADM_PORT0, |
| 627 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 628 | .ab = 70000000UL, |
| 629 | .ib = 70000000UL, |
| 630 | }, |
| 631 | { |
| 632 | .src = MSM_BUS_MASTER_ADM_PORT1, |
| 633 | .dst = MSM_BUS_SLAVE_GSBI1_UART, |
| 634 | .ab = 2480000000UL, |
| 635 | .ib = 2480000000UL, |
| 636 | }, |
| 637 | }; |
| 638 | |
| 639 | static struct msm_bus_paths crypto_hw_bus_scale_usecases[] = { |
| 640 | { |
| 641 | ARRAY_SIZE(crypto_hw_init_vectors), |
| 642 | crypto_hw_init_vectors, |
| 643 | }, |
| 644 | { |
| 645 | ARRAY_SIZE(crypto_hw_active_vectors), |
| 646 | crypto_hw_active_vectors, |
| 647 | }, |
| 648 | }; |
| 649 | |
| 650 | static struct msm_bus_scale_pdata crypto_hw_bus_scale_pdata = { |
| 651 | crypto_hw_bus_scale_usecases, |
| 652 | ARRAY_SIZE(crypto_hw_bus_scale_usecases), |
| 653 | .name = "cryptohw", |
| 654 | }; |
| 655 | /* End Bus Scaling Definitions*/ |
| 656 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 657 | static struct resource qcrypto_resources[] = { |
| 658 | [0] = { |
| 659 | .start = QCE_0_BASE, |
| 660 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 661 | .flags = IORESOURCE_MEM, |
| 662 | }, |
| 663 | [1] = { |
| 664 | .name = "crypto_channels", |
| 665 | .start = DMOV_CE_IN_CHAN, |
| 666 | .end = DMOV_CE_OUT_CHAN, |
| 667 | .flags = IORESOURCE_DMA, |
| 668 | }, |
| 669 | [2] = { |
| 670 | .name = "crypto_crci_in", |
| 671 | .start = DMOV_CE_IN_CRCI, |
| 672 | .end = DMOV_CE_IN_CRCI, |
| 673 | .flags = IORESOURCE_DMA, |
| 674 | }, |
| 675 | [3] = { |
| 676 | .name = "crypto_crci_out", |
| 677 | .start = DMOV_CE_OUT_CRCI, |
| 678 | .end = DMOV_CE_OUT_CRCI, |
| 679 | .flags = IORESOURCE_DMA, |
| 680 | }, |
| 681 | }; |
| 682 | |
| 683 | static struct resource qcedev_resources[] = { |
| 684 | [0] = { |
| 685 | .start = QCE_0_BASE, |
| 686 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 687 | .flags = IORESOURCE_MEM, |
| 688 | }, |
| 689 | [1] = { |
| 690 | .name = "crypto_channels", |
| 691 | .start = DMOV_CE_IN_CHAN, |
| 692 | .end = DMOV_CE_OUT_CHAN, |
| 693 | .flags = IORESOURCE_DMA, |
| 694 | }, |
| 695 | [2] = { |
| 696 | .name = "crypto_crci_in", |
| 697 | .start = DMOV_CE_IN_CRCI, |
| 698 | .end = DMOV_CE_IN_CRCI, |
| 699 | .flags = IORESOURCE_DMA, |
| 700 | }, |
| 701 | [3] = { |
| 702 | .name = "crypto_crci_out", |
| 703 | .start = DMOV_CE_OUT_CRCI, |
| 704 | .end = DMOV_CE_OUT_CRCI, |
| 705 | .flags = IORESOURCE_DMA, |
| 706 | }, |
| 707 | }; |
| 708 | |
| 709 | #endif |
| 710 | |
| 711 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 712 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 713 | |
| 714 | static struct msm_ce_hw_support qcrypto_ce_hw_suppport = { |
| 715 | .ce_shared = QCE_CE_SHARED, |
| 716 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 717 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 718 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
Ramesh Masavarapu | 4925968 | 2011-12-02 14:00:18 -0800 | [diff] [blame^] | 719 | .bus_scale_table = &crypto_hw_bus_scale_pdata, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 720 | }; |
| 721 | |
| 722 | static struct platform_device qcrypto_device = { |
| 723 | .name = "qcrypto", |
| 724 | .id = 0, |
| 725 | .num_resources = ARRAY_SIZE(qcrypto_resources), |
| 726 | .resource = qcrypto_resources, |
| 727 | .dev = { |
| 728 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 729 | .platform_data = &qcrypto_ce_hw_suppport, |
| 730 | }, |
| 731 | }; |
| 732 | #endif |
| 733 | |
| 734 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 735 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 736 | |
| 737 | static struct msm_ce_hw_support qcedev_ce_hw_suppport = { |
| 738 | .ce_shared = QCE_CE_SHARED, |
| 739 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 740 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 741 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
Ramesh Masavarapu | 4925968 | 2011-12-02 14:00:18 -0800 | [diff] [blame^] | 742 | .bus_scale_table = &crypto_hw_bus_scale_pdata, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 743 | }; |
| 744 | |
| 745 | static struct platform_device qcedev_device = { |
| 746 | .name = "qce", |
| 747 | .id = 0, |
| 748 | .num_resources = ARRAY_SIZE(qcedev_resources), |
| 749 | .resource = qcedev_resources, |
| 750 | .dev = { |
| 751 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 752 | .platform_data = &qcedev_ce_hw_suppport, |
| 753 | }, |
| 754 | }; |
| 755 | #endif |
| 756 | |
Joel King | b8352a1 | 2011-11-15 18:46:24 -0800 | [diff] [blame] | 757 | #define MDM2AP_ERRFATAL 70 |
| 758 | #define AP2MDM_ERRFATAL 95 |
| 759 | #define MDM2AP_STATUS 69 |
| 760 | #define AP2MDM_STATUS 94 |
| 761 | #define AP2MDM_PMIC_RESET_N 80 |
| 762 | #define AP2MDM_KPDPWR_N 81 |
| 763 | |
Joel King | b8352a1 | 2011-11-15 18:46:24 -0800 | [diff] [blame] | 764 | static struct resource mdm_resources[] = { |
| 765 | { |
| 766 | .start = MDM2AP_ERRFATAL, |
| 767 | .end = MDM2AP_ERRFATAL, |
| 768 | .name = "MDM2AP_ERRFATAL", |
| 769 | .flags = IORESOURCE_IO, |
| 770 | }, |
| 771 | { |
| 772 | .start = AP2MDM_ERRFATAL, |
| 773 | .end = AP2MDM_ERRFATAL, |
| 774 | .name = "AP2MDM_ERRFATAL", |
| 775 | .flags = IORESOURCE_IO, |
| 776 | }, |
| 777 | { |
| 778 | .start = MDM2AP_STATUS, |
| 779 | .end = MDM2AP_STATUS, |
| 780 | .name = "MDM2AP_STATUS", |
| 781 | .flags = IORESOURCE_IO, |
| 782 | }, |
| 783 | { |
| 784 | .start = AP2MDM_STATUS, |
| 785 | .end = AP2MDM_STATUS, |
| 786 | .name = "AP2MDM_STATUS", |
| 787 | .flags = IORESOURCE_IO, |
| 788 | }, |
| 789 | { |
| 790 | .start = AP2MDM_PMIC_RESET_N, |
| 791 | .end = AP2MDM_PMIC_RESET_N, |
| 792 | .name = "AP2MDM_PMIC_RESET_N", |
| 793 | .flags = IORESOURCE_IO, |
| 794 | }, |
| 795 | { |
| 796 | .start = AP2MDM_KPDPWR_N, |
| 797 | .end = AP2MDM_KPDPWR_N, |
| 798 | .name = "AP2MDM_KPDPWR_N", |
| 799 | .flags = IORESOURCE_IO, |
| 800 | }, |
| 801 | }; |
| 802 | |
| 803 | static struct mdm_platform_data mdm_platform_data = { |
| 804 | .mdm_version = "2.5", |
| 805 | }; |
| 806 | |
Stepan Moskovchenko | fc70d90 | 2011-11-30 12:39:36 -0800 | [diff] [blame] | 807 | static struct platform_device mdm_device = { |
Joel King | b8352a1 | 2011-11-15 18:46:24 -0800 | [diff] [blame] | 808 | .name = "mdm2_modem", |
| 809 | .id = -1, |
| 810 | .num_resources = ARRAY_SIZE(mdm_resources), |
| 811 | .resource = mdm_resources, |
| 812 | .dev = { |
| 813 | .platform_data = &mdm_platform_data, |
| 814 | }, |
| 815 | }; |
| 816 | |
| 817 | static struct platform_device *mdm_devices[] __initdata = { |
| 818 | &mdm_device, |
| 819 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 820 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 821 | #define MSM_SHARED_RAM_PHYS 0x80000000 |
| 822 | |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 823 | static void __init msm8960_map_io(void) |
| 824 | { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 825 | msm_shared_ram_phys = MSM_SHARED_RAM_PHYS; |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 826 | msm_map_msm8960_io(); |
Jeff Ohlstein | 3a77f9f | 2011-09-06 14:50:20 -0700 | [diff] [blame] | 827 | |
| 828 | if (socinfo_init() < 0) |
| 829 | pr_err("socinfo_init() failed!\n"); |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 830 | } |
| 831 | |
| 832 | static void __init msm8960_init_irq(void) |
| 833 | { |
| 834 | unsigned int i; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 835 | |
| 836 | msm_mpm_irq_extn_init(); |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 837 | gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 838 | (void *)MSM_QGIC_CPU_BASE); |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 839 | |
| 840 | /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 841 | writel_relaxed(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4); |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 842 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 843 | writel_relaxed(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET); |
| 844 | mb(); |
Stepan Moskovchenko | 50ede4e | 2010-12-13 18:12:19 -0800 | [diff] [blame] | 845 | |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 846 | /* FIXME: Not installing AVS_SVICINT and AVS_SVICINTSWDONE yet |
| 847 | * as they are configured as level, which does not play nice with |
| 848 | * handle_percpu_irq. |
| 849 | */ |
| 850 | for (i = GIC_PPI_START; i < GIC_SPI_START; i++) { |
| 851 | if (i != AVS_SVICINT && i != AVS_SVICINTSWDONE) |
Thomas Gleixner | 6845664a | 2011-03-24 13:25:22 +0100 | [diff] [blame] | 852 | irq_set_handler(i, handle_percpu_irq); |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 853 | } |
| 854 | } |
| 855 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 856 | static void __init msm8960_init_buses(void) |
| 857 | { |
| 858 | #ifdef CONFIG_MSM_BUS_SCALING |
Gagan Mac | dc1dc14 | 2011-09-16 15:13:35 -0600 | [diff] [blame] | 859 | msm_bus_rpm_set_mt_mask(); |
Gagan Mac | ae154c4b | 2011-10-05 19:24:43 -0600 | [diff] [blame] | 860 | msm_bus_8960_apps_fabric_pdata.rpm_enabled = 1; |
| 861 | msm_bus_8960_sys_fabric_pdata.rpm_enabled = 1; |
| 862 | msm_bus_8960_mm_fabric_pdata.rpm_enabled = 1; |
| 863 | msm_bus_apps_fabric.dev.platform_data = |
| 864 | &msm_bus_8960_apps_fabric_pdata; |
| 865 | msm_bus_sys_fabric.dev.platform_data = &msm_bus_8960_sys_fabric_pdata; |
| 866 | msm_bus_mm_fabric.dev.platform_data = &msm_bus_8960_mm_fabric_pdata; |
| 867 | msm_bus_sys_fpb.dev.platform_data = &msm_bus_8960_sys_fpb_pdata; |
| 868 | 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] | 869 | #endif |
| 870 | } |
| 871 | |
| 872 | static struct msm_spi_platform_data msm8960_qup_spi_gsbi1_pdata = { |
| 873 | .max_clock_speed = 15060000, |
| 874 | }; |
| 875 | |
| 876 | #ifdef CONFIG_USB_MSM_OTG_72K |
| 877 | static struct msm_otg_platform_data msm_otg_pdata; |
| 878 | #else |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 879 | static void msm_hsusb_vbus_power(bool on) |
| 880 | { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 881 | static bool vbus_is_on; |
| 882 | static struct regulator *mvs_otg_switch; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 883 | |
| 884 | if (vbus_is_on == on) |
| 885 | return; |
| 886 | |
| 887 | if (on) { |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 888 | mvs_otg_switch = regulator_get(&msm8960_device_otg.dev, |
| 889 | "vbus_otg"); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 890 | if (IS_ERR(mvs_otg_switch)) { |
| 891 | pr_err("Unable to get mvs_otg_switch\n"); |
| 892 | return; |
| 893 | } |
| 894 | |
Anji jonnala | 2936fd9 | 2011-11-09 15:39:22 +0530 | [diff] [blame] | 895 | if (regulator_enable(mvs_otg_switch)) { |
| 896 | pr_err("unable to enable mvs_otg_switch\n"); |
David Collins | 57954fa | 2011-12-15 09:14:40 -0800 | [diff] [blame] | 897 | goto put_mvs_otg; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 898 | } |
Anji jonnala | 2936fd9 | 2011-11-09 15:39:22 +0530 | [diff] [blame] | 899 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 900 | vbus_is_on = true; |
| 901 | return; |
| 902 | } |
Anji jonnala | 2936fd9 | 2011-11-09 15:39:22 +0530 | [diff] [blame] | 903 | regulator_disable(mvs_otg_switch); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 904 | put_mvs_otg: |
Anji jonnala | 2936fd9 | 2011-11-09 15:39:22 +0530 | [diff] [blame] | 905 | regulator_put(mvs_otg_switch); |
| 906 | vbus_is_on = false; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 907 | } |
| 908 | |
Anji jonnala | a8b8d73 | 2011-12-06 10:03:24 +0530 | [diff] [blame] | 909 | static int wr_phy_init_seq[] = { |
| 910 | 0x44, 0x80, /* set VBUS valid threshold |
| 911 | and disconnect valid threshold */ |
| 912 | 0x38, 0x81, /* update DC voltage level */ |
| 913 | 0x14, 0x82, /* set preemphasis and rise/fall time */ |
| 914 | 0x13, 0x83, /* set source impedance adjusment */ |
| 915 | -1}; |
| 916 | |
| 917 | static int liquid_v1_phy_init_seq[] = { |
| 918 | 0x44, 0x80,/* set VBUS valid threshold |
| 919 | and disconnect valid threshold */ |
| 920 | 0x3C, 0x81,/* update DC voltage level */ |
| 921 | 0x18, 0x82,/* set preemphasis and rise/fall time */ |
| 922 | 0x23, 0x83,/* set source impedance sdjusment */ |
| 923 | -1}; |
| 924 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 925 | static struct msm_otg_platform_data msm_otg_pdata = { |
| 926 | .mode = USB_OTG, |
| 927 | .otg_control = OTG_PMIC_CONTROL, |
| 928 | .phy_type = SNPS_28NM_INTEGRATED_PHY, |
| 929 | .pclk_src_name = "dfab_usb_hs_clk", |
| 930 | .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE), |
| 931 | .vbus_power = msm_hsusb_vbus_power, |
Anji jonnala | 4e3e677 | 2011-09-15 18:53:42 +0530 | [diff] [blame] | 932 | .power_budget = 750, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 933 | }; |
| 934 | #endif |
| 935 | |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 936 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
Vijayavardhan Vennapusa | 2b592824f | 2011-11-02 19:51:32 +0530 | [diff] [blame] | 937 | #define HSIC_HUB_RESET_GPIO 91 |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 938 | static struct msm_hsic_host_platform_data msm_hsic_pdata = { |
| 939 | .strobe = 150, |
| 940 | .data = 151, |
| 941 | }; |
| 942 | #else |
| 943 | static struct msm_hsic_host_platform_data msm_hsic_pdata; |
| 944 | #endif |
| 945 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 946 | #define PID_MAGIC_ID 0x71432909 |
| 947 | #define SERIAL_NUM_MAGIC_ID 0x61945374 |
| 948 | #define SERIAL_NUMBER_LENGTH 127 |
| 949 | #define DLOAD_USB_BASE_ADD 0x2A03F0C8 |
| 950 | |
| 951 | struct magic_num_struct { |
| 952 | uint32_t pid; |
| 953 | uint32_t serial_num; |
| 954 | }; |
| 955 | |
| 956 | struct dload_struct { |
| 957 | uint32_t reserved1; |
| 958 | uint32_t reserved2; |
| 959 | uint32_t reserved3; |
| 960 | uint16_t reserved4; |
| 961 | uint16_t pid; |
| 962 | char serial_number[SERIAL_NUMBER_LENGTH]; |
| 963 | uint16_t reserved5; |
| 964 | struct magic_num_struct magic_struct; |
| 965 | }; |
| 966 | |
| 967 | static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum) |
| 968 | { |
| 969 | struct dload_struct __iomem *dload = 0; |
| 970 | |
| 971 | dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload)); |
| 972 | if (!dload) { |
| 973 | pr_err("%s: cannot remap I/O memory region: %08x\n", |
| 974 | __func__, DLOAD_USB_BASE_ADD); |
| 975 | return -ENXIO; |
| 976 | } |
| 977 | |
| 978 | pr_debug("%s: dload:%p pid:%x serial_num:%s\n", |
| 979 | __func__, dload, pid, snum); |
| 980 | /* update pid */ |
| 981 | dload->magic_struct.pid = PID_MAGIC_ID; |
| 982 | dload->pid = pid; |
| 983 | |
| 984 | /* update serial number */ |
| 985 | dload->magic_struct.serial_num = 0; |
| 986 | if (!snum) { |
| 987 | memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH); |
| 988 | goto out; |
| 989 | } |
| 990 | |
| 991 | dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID; |
Jin Hong | e49b148 | 2011-10-03 11:15:50 -0700 | [diff] [blame] | 992 | strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 993 | out: |
| 994 | iounmap(dload); |
| 995 | return 0; |
| 996 | } |
| 997 | |
| 998 | static struct android_usb_platform_data android_usb_pdata = { |
| 999 | .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num, |
| 1000 | }; |
| 1001 | |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 1002 | static struct platform_device android_usb_device = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1003 | .name = "android_usb", |
| 1004 | .id = -1, |
| 1005 | .dev = { |
| 1006 | .platform_data = &android_usb_pdata, |
| 1007 | }, |
| 1008 | }; |
| 1009 | |
| 1010 | static uint8_t spm_wfi_cmd_sequence[] __initdata = { |
| 1011 | 0x03, 0x0f, |
| 1012 | }; |
| 1013 | |
| 1014 | static uint8_t spm_power_collapse_without_rpm[] __initdata = { |
| 1015 | 0x00, 0x24, 0x54, 0x10, |
| 1016 | 0x09, 0x03, 0x01, |
| 1017 | 0x10, 0x54, 0x30, 0x0C, |
| 1018 | 0x24, 0x30, 0x0f, |
| 1019 | }; |
| 1020 | |
| 1021 | static uint8_t spm_power_collapse_with_rpm[] __initdata = { |
| 1022 | 0x00, 0x24, 0x54, 0x10, |
| 1023 | 0x09, 0x07, 0x01, 0x0B, |
| 1024 | 0x10, 0x54, 0x30, 0x0C, |
| 1025 | 0x24, 0x30, 0x0f, |
| 1026 | }; |
| 1027 | |
| 1028 | static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = { |
| 1029 | [0] = { |
| 1030 | .mode = MSM_SPM_MODE_CLOCK_GATING, |
| 1031 | .notify_rpm = false, |
| 1032 | .cmd = spm_wfi_cmd_sequence, |
| 1033 | }, |
| 1034 | [1] = { |
| 1035 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 1036 | .notify_rpm = false, |
| 1037 | .cmd = spm_power_collapse_without_rpm, |
| 1038 | }, |
| 1039 | [2] = { |
| 1040 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 1041 | .notify_rpm = true, |
| 1042 | .cmd = spm_power_collapse_with_rpm, |
| 1043 | }, |
| 1044 | }; |
| 1045 | |
| 1046 | static struct msm_spm_platform_data msm_spm_data[] __initdata = { |
| 1047 | [0] = { |
| 1048 | .reg_base_addr = MSM_SAW0_BASE, |
| 1049 | .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00, |
| 1050 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F, |
Stephen Boyd | 9ac587a | 2011-12-09 22:55:10 -0800 | [diff] [blame] | 1051 | .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0xB0, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1052 | #if defined(CONFIG_MSM_AVS_HW) |
| 1053 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00, |
| 1054 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00, |
| 1055 | #endif |
| 1056 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
| 1057 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202, |
| 1058 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C, |
| 1059 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C, |
| 1060 | .vctl_timeout_us = 50, |
| 1061 | .num_modes = ARRAY_SIZE(msm_spm_seq_list), |
| 1062 | .modes = msm_spm_seq_list, |
| 1063 | }, |
| 1064 | [1] = { |
| 1065 | .reg_base_addr = MSM_SAW1_BASE, |
| 1066 | .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00, |
| 1067 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F, |
Stephen Boyd | 9ac587a | 2011-12-09 22:55:10 -0800 | [diff] [blame] | 1068 | .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0xB0, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1069 | #if defined(CONFIG_MSM_AVS_HW) |
| 1070 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00, |
| 1071 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00, |
| 1072 | #endif |
| 1073 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
| 1074 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202, |
| 1075 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C, |
| 1076 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C, |
| 1077 | .vctl_timeout_us = 50, |
| 1078 | .num_modes = ARRAY_SIZE(msm_spm_seq_list), |
| 1079 | .modes = msm_spm_seq_list, |
| 1080 | }, |
| 1081 | }; |
| 1082 | |
| 1083 | static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = { |
| 1084 | 0x00, 0x20, 0x03, 0x20, |
| 1085 | 0x00, 0x0f, |
| 1086 | }; |
| 1087 | |
| 1088 | static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = { |
| 1089 | 0x00, 0x20, 0x34, 0x64, |
| 1090 | 0x48, 0x07, 0x48, 0x20, |
| 1091 | 0x50, 0x64, 0x04, 0x34, |
| 1092 | 0x50, 0x0f, |
| 1093 | }; |
| 1094 | static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = { |
| 1095 | 0x00, 0x10, 0x34, 0x64, |
| 1096 | 0x48, 0x07, 0x48, 0x10, |
| 1097 | 0x50, 0x64, 0x04, 0x34, |
| 1098 | 0x50, 0x0F, |
| 1099 | }; |
| 1100 | |
| 1101 | static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = { |
| 1102 | [0] = { |
| 1103 | .mode = MSM_SPM_L2_MODE_RETENTION, |
| 1104 | .notify_rpm = false, |
| 1105 | .cmd = l2_spm_wfi_cmd_sequence, |
| 1106 | }, |
| 1107 | [1] = { |
| 1108 | .mode = MSM_SPM_L2_MODE_GDHS, |
| 1109 | .notify_rpm = true, |
| 1110 | .cmd = l2_spm_gdhs_cmd_sequence, |
| 1111 | }, |
| 1112 | [2] = { |
| 1113 | .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE, |
| 1114 | .notify_rpm = true, |
| 1115 | .cmd = l2_spm_power_off_cmd_sequence, |
| 1116 | }, |
| 1117 | }; |
| 1118 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1119 | static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = { |
| 1120 | [0] = { |
| 1121 | .reg_base_addr = MSM_SAW_L2_BASE, |
| 1122 | .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00, |
| 1123 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00, |
| 1124 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202, |
| 1125 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE, |
| 1126 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020, |
| 1127 | .modes = msm_spm_l2_seq_list, |
| 1128 | .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list), |
| 1129 | }, |
| 1130 | }; |
| 1131 | |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1132 | #define PM_HAP_EN_GPIO PM8921_GPIO_PM_TO_SYS(33) |
| 1133 | #define PM_HAP_LEN_GPIO PM8921_GPIO_PM_TO_SYS(20) |
| 1134 | |
| 1135 | static struct msm_xo_voter *xo_handle_d1; |
| 1136 | |
| 1137 | static int isa1200_power(int on) |
| 1138 | { |
| 1139 | int rc = 0; |
| 1140 | |
| 1141 | gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, !!on); |
| 1142 | |
| 1143 | rc = on ? msm_xo_mode_vote(xo_handle_d1, MSM_XO_MODE_ON) : |
| 1144 | msm_xo_mode_vote(xo_handle_d1, MSM_XO_MODE_OFF); |
| 1145 | if (rc < 0) { |
| 1146 | pr_err("%s: failed to %svote for TCXO D1 buffer%d\n", |
| 1147 | __func__, on ? "" : "de-", rc); |
| 1148 | goto err_xo_vote; |
| 1149 | } |
| 1150 | |
| 1151 | return 0; |
| 1152 | |
| 1153 | err_xo_vote: |
| 1154 | gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, !on); |
| 1155 | return rc; |
| 1156 | } |
| 1157 | |
| 1158 | static int isa1200_dev_setup(bool enable) |
| 1159 | { |
| 1160 | int rc = 0; |
| 1161 | |
| 1162 | struct pm_gpio hap_gpio_config = { |
| 1163 | .direction = PM_GPIO_DIR_OUT, |
| 1164 | .pull = PM_GPIO_PULL_NO, |
| 1165 | .out_strength = PM_GPIO_STRENGTH_HIGH, |
| 1166 | .function = PM_GPIO_FUNC_NORMAL, |
| 1167 | .inv_int_pol = 0, |
| 1168 | .vin_sel = 2, |
| 1169 | .output_buffer = PM_GPIO_OUT_BUF_CMOS, |
| 1170 | .output_value = 0, |
| 1171 | }; |
| 1172 | |
| 1173 | if (enable == true) { |
| 1174 | rc = pm8xxx_gpio_config(PM_HAP_EN_GPIO, &hap_gpio_config); |
| 1175 | if (rc) { |
| 1176 | pr_err("%s: pm8921 gpio %d config failed(%d)\n", |
| 1177 | __func__, PM_HAP_EN_GPIO, rc); |
| 1178 | return rc; |
| 1179 | } |
| 1180 | |
| 1181 | rc = pm8xxx_gpio_config(PM_HAP_LEN_GPIO, &hap_gpio_config); |
| 1182 | if (rc) { |
| 1183 | pr_err("%s: pm8921 gpio %d config failed(%d)\n", |
| 1184 | __func__, PM_HAP_LEN_GPIO, rc); |
| 1185 | return rc; |
| 1186 | } |
| 1187 | |
| 1188 | rc = gpio_request(HAP_SHIFT_LVL_OE_GPIO, "hap_shft_lvl_oe"); |
| 1189 | if (rc) { |
| 1190 | pr_err("%s: unable to request gpio %d (%d)\n", |
| 1191 | __func__, HAP_SHIFT_LVL_OE_GPIO, rc); |
| 1192 | return rc; |
| 1193 | } |
| 1194 | |
| 1195 | rc = gpio_direction_output(HAP_SHIFT_LVL_OE_GPIO, 0); |
| 1196 | if (rc) { |
| 1197 | pr_err("%s: Unable to set direction\n", __func__); |
| 1198 | goto free_gpio; |
| 1199 | } |
| 1200 | |
| 1201 | xo_handle_d1 = msm_xo_get(MSM_XO_TCXO_D1, "isa1200"); |
| 1202 | if (IS_ERR(xo_handle_d1)) { |
| 1203 | rc = PTR_ERR(xo_handle_d1); |
| 1204 | pr_err("%s: failed to get the handle for D1(%d)\n", |
| 1205 | __func__, rc); |
| 1206 | goto gpio_set_dir; |
| 1207 | } |
| 1208 | } else { |
| 1209 | gpio_free(HAP_SHIFT_LVL_OE_GPIO); |
| 1210 | |
| 1211 | msm_xo_put(xo_handle_d1); |
| 1212 | } |
| 1213 | |
| 1214 | return 0; |
| 1215 | |
| 1216 | gpio_set_dir: |
| 1217 | gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, 0); |
| 1218 | free_gpio: |
| 1219 | gpio_free(HAP_SHIFT_LVL_OE_GPIO); |
| 1220 | return rc; |
| 1221 | } |
| 1222 | |
| 1223 | static struct isa1200_regulator isa1200_reg_data[] = { |
| 1224 | { |
| 1225 | .name = "vcc_i2c", |
| 1226 | .min_uV = ISA_I2C_VTG_MIN_UV, |
| 1227 | .max_uV = ISA_I2C_VTG_MAX_UV, |
| 1228 | .load_uA = ISA_I2C_CURR_UA, |
| 1229 | }, |
| 1230 | }; |
| 1231 | |
| 1232 | static struct isa1200_platform_data isa1200_1_pdata = { |
| 1233 | .name = "vibrator", |
| 1234 | .dev_setup = isa1200_dev_setup, |
| 1235 | .power_on = isa1200_power, |
| 1236 | .hap_en_gpio = PM_HAP_EN_GPIO, |
| 1237 | .hap_len_gpio = PM_HAP_LEN_GPIO, |
| 1238 | .max_timeout = 15000, |
| 1239 | .mode_ctrl = PWM_GEN_MODE, |
| 1240 | .pwm_fd = { |
| 1241 | .pwm_div = 256, |
| 1242 | }, |
| 1243 | .is_erm = false, |
| 1244 | .smart_en = true, |
| 1245 | .ext_clk_en = true, |
| 1246 | .chip_en = 1, |
| 1247 | .regulator_info = isa1200_reg_data, |
| 1248 | .num_regulators = ARRAY_SIZE(isa1200_reg_data), |
| 1249 | }; |
| 1250 | |
| 1251 | static struct i2c_board_info msm_isa1200_board_info[] __initdata = { |
| 1252 | { |
| 1253 | I2C_BOARD_INFO("isa1200_1", 0x90>>1), |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1254 | }, |
| 1255 | }; |
| 1256 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1257 | #define CYTTSP_TS_GPIO_IRQ 11 |
| 1258 | #define CYTTSP_TS_SLEEP_GPIO 50 |
| 1259 | #define CYTTSP_TS_RESOUT_N_GPIO 52 |
| 1260 | |
| 1261 | /*virtual key support */ |
| 1262 | static ssize_t tma340_vkeys_show(struct kobject *kobj, |
| 1263 | struct kobj_attribute *attr, char *buf) |
| 1264 | { |
| 1265 | return snprintf(buf, 200, |
| 1266 | __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97" |
| 1267 | ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97" |
| 1268 | ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97" |
| 1269 | ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97" |
| 1270 | "\n"); |
| 1271 | } |
| 1272 | |
| 1273 | static struct kobj_attribute tma340_vkeys_attr = { |
| 1274 | .attr = { |
| 1275 | .mode = S_IRUGO, |
| 1276 | }, |
| 1277 | .show = &tma340_vkeys_show, |
| 1278 | }; |
| 1279 | |
| 1280 | static struct attribute *tma340_properties_attrs[] = { |
| 1281 | &tma340_vkeys_attr.attr, |
| 1282 | NULL |
| 1283 | }; |
| 1284 | |
| 1285 | static struct attribute_group tma340_properties_attr_group = { |
| 1286 | .attrs = tma340_properties_attrs, |
| 1287 | }; |
| 1288 | |
| 1289 | |
| 1290 | static int cyttsp_platform_init(struct i2c_client *client) |
| 1291 | { |
| 1292 | int rc = 0; |
| 1293 | static struct kobject *tma340_properties_kobj; |
| 1294 | |
| 1295 | tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c"; |
| 1296 | tma340_properties_kobj = kobject_create_and_add("board_properties", |
| 1297 | NULL); |
| 1298 | if (tma340_properties_kobj) |
| 1299 | rc = sysfs_create_group(tma340_properties_kobj, |
| 1300 | &tma340_properties_attr_group); |
| 1301 | if (!tma340_properties_kobj || rc) |
| 1302 | pr_err("%s: failed to create board_properties\n", |
| 1303 | __func__); |
| 1304 | |
| 1305 | return 0; |
| 1306 | } |
| 1307 | |
| 1308 | static struct cyttsp_regulator regulator_data[] = { |
| 1309 | { |
| 1310 | .name = "vdd", |
| 1311 | .min_uV = CY_TMA300_VTG_MIN_UV, |
| 1312 | .max_uV = CY_TMA300_VTG_MAX_UV, |
Anirudh Ghayal | f9929b1 | 2011-09-07 15:57:36 +0530 | [diff] [blame] | 1313 | .hpm_load_uA = CY_TMA300_CURR_24HZ_UA, |
| 1314 | .lpm_load_uA = CY_TMA300_SLEEP_CURR_UA, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1315 | }, |
| 1316 | /* TODO: Remove after runtime PM is enabled in I2C driver */ |
| 1317 | { |
| 1318 | .name = "vcc_i2c", |
| 1319 | .min_uV = CY_I2C_VTG_MIN_UV, |
| 1320 | .max_uV = CY_I2C_VTG_MAX_UV, |
Anirudh Ghayal | f9929b1 | 2011-09-07 15:57:36 +0530 | [diff] [blame] | 1321 | .hpm_load_uA = CY_I2C_CURR_UA, |
| 1322 | .lpm_load_uA = CY_I2C_SLEEP_CURR_UA, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1323 | }, |
| 1324 | }; |
| 1325 | |
| 1326 | static struct cyttsp_platform_data cyttsp_pdata = { |
| 1327 | .panel_maxx = 634, |
| 1328 | .panel_maxy = 1166, |
| 1329 | .disp_maxx = 616, |
| 1330 | .disp_maxy = 1023, |
| 1331 | .disp_minx = 0, |
| 1332 | .disp_miny = 16, |
| 1333 | .flags = 0x01, |
| 1334 | .gen = CY_GEN3, /* or */ |
| 1335 | .use_st = CY_USE_ST, |
| 1336 | .use_mt = CY_USE_MT, |
| 1337 | .use_hndshk = CY_SEND_HNDSHK, |
| 1338 | .use_trk_id = CY_USE_TRACKING_ID, |
Anirudh Ghayal | e96f66d | 2011-08-11 14:06:38 +0530 | [diff] [blame] | 1339 | .use_sleep = CY_USE_DEEP_SLEEP_SEL | CY_USE_LOW_POWER_SEL, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1340 | .use_gestures = CY_USE_GESTURES, |
| 1341 | .fw_fname = "cyttsp_8960_cdp.hex", |
| 1342 | /* activate up to 4 groups |
| 1343 | * and set active distance |
| 1344 | */ |
| 1345 | .gest_set = CY_GEST_GRP1 | CY_GEST_GRP2 | |
| 1346 | CY_GEST_GRP3 | CY_GEST_GRP4 | |
| 1347 | CY_ACT_DIST, |
| 1348 | /* change act_intrvl to customize the Active power state |
| 1349 | * scanning/processing refresh interval for Operating mode |
| 1350 | */ |
| 1351 | .act_intrvl = CY_ACT_INTRVL_DFLT, |
| 1352 | /* change tch_tmout to customize the touch timeout for the |
| 1353 | * Active power state for Operating mode |
| 1354 | */ |
| 1355 | .tch_tmout = CY_TCH_TMOUT_DFLT, |
| 1356 | /* change lp_intrvl to customize the Low Power power state |
| 1357 | * scanning/processing refresh interval for Operating mode |
| 1358 | */ |
| 1359 | .lp_intrvl = CY_LP_INTRVL_DFLT, |
| 1360 | .sleep_gpio = CYTTSP_TS_SLEEP_GPIO, |
| 1361 | .resout_gpio = CYTTSP_TS_RESOUT_N_GPIO, |
| 1362 | .irq_gpio = CYTTSP_TS_GPIO_IRQ, |
| 1363 | .regulator_info = regulator_data, |
| 1364 | .num_regulators = ARRAY_SIZE(regulator_data), |
| 1365 | .init = cyttsp_platform_init, |
Mohan Pallaka | 49c37d6 | 2011-08-01 11:52:00 +0530 | [diff] [blame] | 1366 | .correct_fw_ver = 9, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1367 | }; |
| 1368 | |
| 1369 | static struct i2c_board_info cyttsp_info[] __initdata = { |
| 1370 | { |
| 1371 | I2C_BOARD_INFO(CY_I2C_NAME, 0x24), |
| 1372 | .platform_data = &cyttsp_pdata, |
| 1373 | #ifndef CY_USE_TIMER |
| 1374 | .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ), |
| 1375 | #endif /* CY_USE_TIMER */ |
| 1376 | }, |
| 1377 | }; |
| 1378 | |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1379 | /* configuration data */ |
| 1380 | static const u8 mxt_config_data[] = { |
| 1381 | /* T6 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1382 | 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1383 | /* T38 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 1384 | 11, 2, 0, 11, 11, 11, 0, 0, 0, 0, |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1385 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1386 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1387 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1388 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1389 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1390 | 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1391 | /* T7 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1392 | 100, 16, 50, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1393 | /* T8 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 1394 | 8, 0, 0, 0, 0, 0, 8, 14, 50, 215, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1395 | /* T9 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 1396 | 131, 0, 0, 26, 42, 0, 32, 63, 3, 5, |
| 1397 | 0, 2, 1, 113, 10, 10, 8, 10, 255, 2, |
| 1398 | 85, 5, 0, 0, 20, 20, 75, 25, 202, 29, |
| 1399 | 10, 10, 45, 46, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1400 | /* T15 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1401 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1402 | 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1403 | /* T22 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 1404 | 5, 0, 0, 0, 0, 0, 0, 0, 30, 0, |
| 1405 | 0, 0, 5, 8, 10, 13, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1406 | /* T24 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1407 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1408 | 0, 0, 0, 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1409 | /* T25 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1410 | 3, 0, 188, 52, 52, 33, 0, 0, 0, 0, |
| 1411 | 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1412 | /* T27 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1413 | 0, 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1414 | /* T28 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 1415 | 0, 0, 0, 8, 12, 60, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1416 | /* T40 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1417 | 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1418 | /* T41 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1419 | 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1420 | /* T43 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1421 | 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1422 | }; |
| 1423 | |
| 1424 | #define MXT_TS_GPIO_IRQ 11 |
| 1425 | #define MXT_TS_LDO_EN_GPIO 50 |
| 1426 | #define MXT_TS_RESET_GPIO 52 |
| 1427 | |
| 1428 | static void mxt_init_hw_liquid(void) |
| 1429 | { |
| 1430 | int rc; |
| 1431 | |
| 1432 | rc = gpio_request(MXT_TS_GPIO_IRQ, "mxt_ts_irq_gpio"); |
| 1433 | if (rc) { |
| 1434 | pr_err("%s: unable to request mxt_ts_irq gpio [%d]\n", |
| 1435 | __func__, MXT_TS_GPIO_IRQ); |
| 1436 | return; |
| 1437 | } |
| 1438 | |
| 1439 | rc = gpio_direction_input(MXT_TS_GPIO_IRQ); |
| 1440 | if (rc) { |
| 1441 | pr_err("%s: unable to set_direction for mxt_ts_irq gpio [%d]\n", |
| 1442 | __func__, MXT_TS_GPIO_IRQ); |
| 1443 | goto err_irq_gpio_req; |
| 1444 | } |
| 1445 | |
| 1446 | rc = gpio_request(MXT_TS_LDO_EN_GPIO, "mxt_ldo_en_gpio"); |
| 1447 | if (rc) { |
| 1448 | pr_err("%s: unable to request mxt_ldo_en gpio [%d]\n", |
| 1449 | __func__, MXT_TS_LDO_EN_GPIO); |
| 1450 | goto err_irq_gpio_req; |
| 1451 | } |
| 1452 | |
| 1453 | rc = gpio_direction_output(MXT_TS_LDO_EN_GPIO, 1); |
| 1454 | if (rc) { |
| 1455 | pr_err("%s: unable to set_direction for mxt_ldo_en gpio [%d]\n", |
| 1456 | __func__, MXT_TS_LDO_EN_GPIO); |
| 1457 | goto err_ldo_gpio_req; |
| 1458 | } |
| 1459 | |
| 1460 | rc = gpio_request(MXT_TS_RESET_GPIO, "mxt_reset_gpio"); |
| 1461 | if (rc) { |
| 1462 | pr_err("%s: unable to request mxt_reset gpio [%d]\n", |
| 1463 | __func__, MXT_TS_RESET_GPIO); |
| 1464 | goto err_ldo_gpio_set_dir; |
| 1465 | } |
| 1466 | |
| 1467 | rc = gpio_direction_output(MXT_TS_RESET_GPIO, 1); |
| 1468 | if (rc) { |
| 1469 | pr_err("%s: unable to set_direction for mxt_reset gpio [%d]\n", |
| 1470 | __func__, MXT_TS_RESET_GPIO); |
| 1471 | goto err_reset_gpio_req; |
| 1472 | } |
| 1473 | |
| 1474 | return; |
| 1475 | |
| 1476 | err_reset_gpio_req: |
| 1477 | gpio_free(MXT_TS_RESET_GPIO); |
| 1478 | err_ldo_gpio_set_dir: |
| 1479 | gpio_set_value(MXT_TS_LDO_EN_GPIO, 0); |
| 1480 | err_ldo_gpio_req: |
| 1481 | gpio_free(MXT_TS_LDO_EN_GPIO); |
| 1482 | err_irq_gpio_req: |
| 1483 | gpio_free(MXT_TS_GPIO_IRQ); |
| 1484 | } |
| 1485 | |
| 1486 | static struct mxt_platform_data mxt_platform_data = { |
| 1487 | .config = mxt_config_data, |
| 1488 | .config_length = ARRAY_SIZE(mxt_config_data), |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1489 | .x_size = 1365, |
| 1490 | .y_size = 767, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1491 | .irqflags = IRQF_TRIGGER_FALLING, |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1492 | .i2c_pull_up = true, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1493 | }; |
| 1494 | |
| 1495 | static struct i2c_board_info mxt_device_info[] __initdata = { |
| 1496 | { |
| 1497 | I2C_BOARD_INFO("atmel_mxt_ts", 0x5b), |
| 1498 | .platform_data = &mxt_platform_data, |
| 1499 | .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ), |
| 1500 | }, |
| 1501 | }; |
| 1502 | |
Eugene Yasman | d2316b8 | 2011-12-07 18:23:48 +0200 | [diff] [blame] | 1503 | static struct i2c_board_info sii_device_info[] __initdata = { |
| 1504 | { |
| 1505 | I2C_BOARD_INFO("Sil-9244", 0x39), |
| 1506 | .flags = I2C_CLIENT_WAKE, |
| 1507 | .irq = MSM_GPIO_TO_INT(15), |
| 1508 | }, |
| 1509 | }; |
| 1510 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1511 | static void gsbi_qup_i2c_gpio_config(int adap_id, int config_type) |
| 1512 | { |
| 1513 | } |
| 1514 | |
| 1515 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi4_pdata = { |
| 1516 | .clk_freq = 100000, |
| 1517 | .src_clk_rate = 24000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1518 | .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config, |
| 1519 | }; |
| 1520 | |
| 1521 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi3_pdata = { |
| 1522 | .clk_freq = 100000, |
| 1523 | .src_clk_rate = 24000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1524 | .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config, |
| 1525 | }; |
| 1526 | |
| 1527 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi10_pdata = { |
| 1528 | .clk_freq = 100000, |
| 1529 | .src_clk_rate = 24000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1530 | .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config, |
| 1531 | }; |
| 1532 | |
| 1533 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi12_pdata = { |
| 1534 | .clk_freq = 100000, |
| 1535 | .src_clk_rate = 24000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1536 | .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config, |
| 1537 | }; |
| 1538 | |
| 1539 | static struct msm_rpm_platform_data msm_rpm_data = { |
| 1540 | .reg_base_addrs = { |
| 1541 | [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE, |
| 1542 | [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400, |
| 1543 | [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600, |
| 1544 | [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00, |
| 1545 | }, |
| 1546 | |
| 1547 | .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ, |
| 1548 | .irq_err = RPM_APCC_CPU0_GP_LOW_IRQ, |
| 1549 | .irq_vmpm = RPM_APCC_CPU0_GP_MEDIUM_IRQ, |
| 1550 | .msm_apps_ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008, |
| 1551 | .msm_apps_ipc_rpm_val = 4, |
| 1552 | }; |
| 1553 | |
Stepan Moskovchenko | 93d79ec | 2011-09-21 16:52:16 -0700 | [diff] [blame] | 1554 | static struct ks8851_pdata spi_eth_pdata = { |
| 1555 | .irq_gpio = KS8851_IRQ_GPIO, |
| 1556 | .rst_gpio = KS8851_RST_GPIO, |
| 1557 | }; |
Praveen Chidambaram | 043f4ce | 2011-08-02 09:37:59 -0600 | [diff] [blame] | 1558 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1559 | static struct spi_board_info spi_board_info[] __initdata = { |
| 1560 | { |
| 1561 | .modalias = "ks8851", |
| 1562 | .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO), |
| 1563 | .max_speed_hz = 19200000, |
| 1564 | .bus_num = 0, |
| 1565 | .chip_select = 0, |
| 1566 | .mode = SPI_MODE_0, |
Stepan Moskovchenko | 93d79ec | 2011-09-21 16:52:16 -0700 | [diff] [blame] | 1567 | .platform_data = &spi_eth_pdata |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1568 | }, |
Chandan Uddaraju | 15e54b9 | 2011-09-12 10:52:36 -0700 | [diff] [blame] | 1569 | { |
| 1570 | .modalias = "dsi_novatek_3d_panel_spi", |
| 1571 | .max_speed_hz = 10800000, |
| 1572 | .bus_num = 0, |
| 1573 | .chip_select = 1, |
| 1574 | .mode = SPI_MODE_0, |
| 1575 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1576 | }; |
| 1577 | |
| 1578 | static struct platform_device msm_device_saw_core0 = { |
| 1579 | .name = "saw-regulator", |
| 1580 | .id = 0, |
| 1581 | .dev = { |
| 1582 | .platform_data = &msm_saw_regulator_pdata_s5, |
| 1583 | }, |
| 1584 | }; |
| 1585 | |
| 1586 | static struct platform_device msm_device_saw_core1 = { |
| 1587 | .name = "saw-regulator", |
| 1588 | .id = 1, |
| 1589 | .dev = { |
| 1590 | .platform_data = &msm_saw_regulator_pdata_s6, |
| 1591 | }, |
| 1592 | }; |
| 1593 | |
Siddartha Mohanadoss | ba21fdd | 2011-08-18 10:05:27 -0700 | [diff] [blame] | 1594 | static struct tsens_platform_data msm_tsens_pdata = { |
| 1595 | .slope = 910, |
| 1596 | .tsens_factor = 1000, |
| 1597 | .hw_type = MSM_8960, |
| 1598 | .tsens_num_sensor = 5, |
| 1599 | }; |
| 1600 | |
| 1601 | static struct platform_device msm_tsens_device = { |
| 1602 | .name = "tsens8960-tm", |
| 1603 | .id = -1, |
| 1604 | .dev = { |
| 1605 | .platform_data = &msm_tsens_pdata, |
| 1606 | }, |
| 1607 | }; |
| 1608 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1609 | #ifdef CONFIG_MSM_FAKE_BATTERY |
| 1610 | static struct platform_device fish_battery_device = { |
| 1611 | .name = "fish_battery", |
| 1612 | }; |
| 1613 | #endif |
| 1614 | |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 1615 | static struct platform_device msm8960_device_ext_5v_vreg __devinitdata = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1616 | .name = GPIO_REGULATOR_DEV_NAME, |
| 1617 | .id = PM8921_MPP_PM_TO_SYS(7), |
| 1618 | .dev = { |
| 1619 | .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V], |
| 1620 | }, |
| 1621 | }; |
| 1622 | |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 1623 | static struct platform_device msm8960_device_ext_l2_vreg __devinitdata = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1624 | .name = GPIO_REGULATOR_DEV_NAME, |
| 1625 | .id = 91, |
| 1626 | .dev = { |
| 1627 | .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_L2], |
| 1628 | }, |
| 1629 | }; |
| 1630 | |
David Collins | b10be1d | 2011-09-02 10:29:31 -0700 | [diff] [blame] | 1631 | static struct platform_device msm8960_device_ext_3p3v_vreg __devinitdata = { |
| 1632 | .name = GPIO_REGULATOR_DEV_NAME, |
| 1633 | .id = PM8921_GPIO_PM_TO_SYS(17), |
| 1634 | .dev = { |
| 1635 | .platform_data = |
| 1636 | &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V], |
| 1637 | }, |
| 1638 | }; |
| 1639 | |
David Collins | 35a78f5 | 2011-12-14 15:54:25 -0800 | [diff] [blame] | 1640 | static struct platform_device msm8960_device_ext_otg_sw_vreg __devinitdata = { |
| 1641 | .name = GPIO_REGULATOR_DEV_NAME, |
| 1642 | .id = PM8921_GPIO_PM_TO_SYS(42), |
| 1643 | .dev = { |
| 1644 | .platform_data = |
| 1645 | &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_OTG_SW], |
| 1646 | }, |
| 1647 | }; |
| 1648 | |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 1649 | static struct platform_device msm8960_device_rpm_regulator __devinitdata = { |
| 1650 | .name = "rpm-regulator", |
| 1651 | .id = -1, |
| 1652 | .dev = { |
| 1653 | .platform_data = &msm_rpm_regulator_pdata, |
| 1654 | }, |
| 1655 | }; |
| 1656 | |
David Collins | 4c31a87 | 2011-08-31 10:07:10 -0700 | [diff] [blame] | 1657 | static struct msm_rpm_log_platform_data msm_rpm_log_pdata = { |
| 1658 | .phys_addr_base = 0x0010C000, |
| 1659 | .reg_offsets = { |
| 1660 | [MSM_RPM_LOG_PAGE_INDICES] = 0x00000080, |
| 1661 | [MSM_RPM_LOG_PAGE_BUFFER] = 0x000000A0, |
| 1662 | }, |
| 1663 | .phys_size = SZ_8K, |
| 1664 | .log_len = 4096, /* log's buffer length in bytes */ |
| 1665 | .log_len_mask = (4096 >> 2) - 1, /* length mask in units of u32 */ |
| 1666 | }; |
| 1667 | |
| 1668 | static struct platform_device msm_rpm_log_device = { |
| 1669 | .name = "msm_rpm_log", |
| 1670 | .id = -1, |
| 1671 | .dev = { |
| 1672 | .platform_data = &msm_rpm_log_pdata, |
| 1673 | }, |
| 1674 | }; |
| 1675 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1676 | static struct platform_device *common_devices[] __initdata = { |
Stepan Moskovchenko | df13d34 | 2011-08-03 19:01:25 -0700 | [diff] [blame] | 1677 | &msm8960_device_dmov, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1678 | &msm_device_smd, |
| 1679 | &msm8960_device_uart_gsbi5, |
Mayank Rana | 9f51f58 | 2011-08-04 18:35:59 +0530 | [diff] [blame] | 1680 | &msm_device_uart_dm6, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1681 | &msm_device_saw_core0, |
| 1682 | &msm_device_saw_core1, |
| 1683 | &msm8960_device_ext_5v_vreg, |
Jay Chokshi | 33c044a | 2011-12-07 13:05:40 -0800 | [diff] [blame] | 1684 | &msm8960_device_ssbi_pmic, |
David Collins | 35a78f5 | 2011-12-14 15:54:25 -0800 | [diff] [blame] | 1685 | &msm8960_device_ext_otg_sw_vreg, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1686 | &msm8960_device_qup_spi_gsbi1, |
| 1687 | &msm8960_device_qup_i2c_gsbi3, |
| 1688 | &msm8960_device_qup_i2c_gsbi4, |
| 1689 | &msm8960_device_qup_i2c_gsbi10, |
| 1690 | #ifndef CONFIG_MSM_DSPS |
| 1691 | &msm8960_device_qup_i2c_gsbi12, |
| 1692 | #endif |
| 1693 | &msm_slim_ctrl, |
| 1694 | &msm_device_wcnss_wlan, |
| 1695 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 1696 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 1697 | &qcrypto_device, |
| 1698 | #endif |
| 1699 | |
| 1700 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 1701 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 1702 | &qcedev_device, |
| 1703 | #endif |
| 1704 | #ifdef CONFIG_MSM_ROTATOR |
| 1705 | &msm_rotator_device, |
| 1706 | #endif |
| 1707 | &msm_device_sps, |
| 1708 | #ifdef CONFIG_MSM_FAKE_BATTERY |
| 1709 | &fish_battery_device, |
| 1710 | #endif |
Larry Bassel | 41a055b | 2011-12-06 16:15:14 -0800 | [diff] [blame] | 1711 | &fmem_device, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1712 | #ifdef CONFIG_ANDROID_PMEM |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 1713 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1714 | &android_pmem_device, |
| 1715 | &android_pmem_adsp_device, |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 1716 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1717 | &android_pmem_audio_device, |
| 1718 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1719 | &msm_device_vidc, |
| 1720 | &msm_device_bam_dmux, |
| 1721 | &msm_fm_platform_init, |
Mona Hossain | 9c430e3 | 2011-07-27 11:04:47 -0700 | [diff] [blame] | 1722 | |
| 1723 | #ifdef CONFIG_HW_RANDOM_MSM |
| 1724 | &msm_device_rng, |
| 1725 | #endif |
Praveen Chidambaram | 043f4ce | 2011-08-02 09:37:59 -0600 | [diff] [blame] | 1726 | &msm_rpm_device, |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 1727 | #ifdef CONFIG_ION_MSM |
| 1728 | &ion_dev, |
| 1729 | #endif |
David Collins | 4c31a87 | 2011-08-31 10:07:10 -0700 | [diff] [blame] | 1730 | &msm_rpm_log_device, |
Praveen Chidambaram | 7a71223 | 2011-10-28 13:39:45 -0600 | [diff] [blame] | 1731 | &msm_rpm_stat_device, |
Mona Hossain | 11c03ac | 2011-10-26 12:42:10 -0700 | [diff] [blame] | 1732 | &msm_device_tz_log, |
| 1733 | |
Pratik Patel | 7831c08 | 2011-06-08 21:44:37 -0700 | [diff] [blame] | 1734 | #ifdef CONFIG_MSM_QDSS |
| 1735 | &msm_etb_device, |
| 1736 | &msm_tpiu_device, |
| 1737 | &msm_funnel_device, |
Pratik Patel | fd6f56a | 2011-10-10 17:47:55 -0700 | [diff] [blame] | 1738 | &msm_debug_device, |
Pratik Patel | 7831c08 | 2011-06-08 21:44:37 -0700 | [diff] [blame] | 1739 | &msm_ptm_device, |
| 1740 | #endif |
Swaminathan Sathappan | b77c65e9 | 2011-09-30 18:36:09 -0700 | [diff] [blame] | 1741 | &msm_device_dspcrashd_8960, |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 1742 | &msm8960_device_watchdog, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1743 | }; |
| 1744 | |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 1745 | static struct platform_device *sim_devices[] __initdata = { |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 1746 | &msm8960_device_otg, |
| 1747 | &msm8960_device_gadget_peripheral, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1748 | &msm_device_hsusb_host, |
Vijayavardhan Vennapusa | eb56648 | 2011-09-18 07:48:37 +0530 | [diff] [blame] | 1749 | &msm_device_hsic_host, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1750 | &android_usb_device, |
| 1751 | &msm_device_vidc, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1752 | &msm_bus_apps_fabric, |
| 1753 | &msm_bus_sys_fabric, |
| 1754 | &msm_bus_mm_fabric, |
| 1755 | &msm_bus_sys_fpb, |
| 1756 | &msm_bus_cpss_fpb, |
| 1757 | &msm_pcm, |
| 1758 | &msm_pcm_routing, |
| 1759 | &msm_cpudai0, |
| 1760 | &msm_cpudai1, |
| 1761 | &msm_cpudai_hdmi_rx, |
| 1762 | &msm_cpudai_bt_rx, |
| 1763 | &msm_cpudai_bt_tx, |
| 1764 | &msm_cpudai_fm_rx, |
| 1765 | &msm_cpudai_fm_tx, |
Bhalchandra Gajare | 0e795c4 | 2011-08-15 18:10:30 -0700 | [diff] [blame] | 1766 | &msm_cpudai_auxpcm_rx, |
| 1767 | &msm_cpudai_auxpcm_tx, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1768 | &msm_cpu_fe, |
| 1769 | &msm_stub_codec, |
| 1770 | &msm_voice, |
| 1771 | &msm_voip, |
| 1772 | &msm_lpa_pcm, |
Asish Bhattacharya | 96bb6f4 | 2011-11-01 20:36:09 +0530 | [diff] [blame] | 1773 | &msm_compr_dsp, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1774 | |
| 1775 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 1776 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 1777 | &qcrypto_device, |
| 1778 | #endif |
| 1779 | |
| 1780 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 1781 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 1782 | &qcedev_device, |
| 1783 | #endif |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 1784 | }; |
| 1785 | |
| 1786 | static struct platform_device *rumi3_devices[] __initdata = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1787 | &msm_kgsl_3d0, |
| 1788 | &msm_kgsl_2d0, |
| 1789 | &msm_kgsl_2d1, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1790 | #ifdef CONFIG_MSM_GEMINI |
| 1791 | &msm8960_gemini_device, |
| 1792 | #endif |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 1793 | }; |
| 1794 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1795 | static struct platform_device *cdp_devices[] __initdata = { |
Stephen Boyd | eb81988 | 2011-08-29 14:46:30 -0700 | [diff] [blame] | 1796 | &msm_8960_q6_lpass, |
| 1797 | &msm_8960_q6_mss_fw, |
| 1798 | &msm_8960_q6_mss_sw, |
Stephen Boyd | 322a992 | 2011-09-20 01:05:54 -0700 | [diff] [blame] | 1799 | &msm_8960_riva, |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 1800 | &msm8960_device_otg, |
| 1801 | &msm8960_device_gadget_peripheral, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1802 | &msm_device_hsusb_host, |
| 1803 | &android_usb_device, |
| 1804 | &msm_pcm, |
| 1805 | &msm_pcm_routing, |
| 1806 | &msm_cpudai0, |
| 1807 | &msm_cpudai1, |
| 1808 | &msm_cpudai_hdmi_rx, |
| 1809 | &msm_cpudai_bt_rx, |
| 1810 | &msm_cpudai_bt_tx, |
| 1811 | &msm_cpudai_fm_rx, |
| 1812 | &msm_cpudai_fm_tx, |
Bhalchandra Gajare | 0e795c4 | 2011-08-15 18:10:30 -0700 | [diff] [blame] | 1813 | &msm_cpudai_auxpcm_rx, |
| 1814 | &msm_cpudai_auxpcm_tx, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1815 | &msm_cpu_fe, |
| 1816 | &msm_stub_codec, |
| 1817 | &msm_kgsl_3d0, |
| 1818 | #ifdef CONFIG_MSM_KGSL_2D |
| 1819 | &msm_kgsl_2d0, |
| 1820 | &msm_kgsl_2d1, |
| 1821 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1822 | #ifdef CONFIG_MSM_GEMINI |
| 1823 | &msm8960_gemini_device, |
| 1824 | #endif |
| 1825 | &msm_voice, |
| 1826 | &msm_voip, |
| 1827 | &msm_lpa_pcm, |
Laxminath Kasam | cee1d60 | 2011-08-01 19:26:57 +0530 | [diff] [blame] | 1828 | &msm_cpudai_afe_01_rx, |
| 1829 | &msm_cpudai_afe_01_tx, |
| 1830 | &msm_cpudai_afe_02_rx, |
| 1831 | &msm_cpudai_afe_02_tx, |
| 1832 | &msm_pcm_afe, |
Asish Bhattacharya | 96bb6f4 | 2011-11-01 20:36:09 +0530 | [diff] [blame] | 1833 | &msm_compr_dsp, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1834 | &msm_pcm_hostless, |
| 1835 | &msm_bus_apps_fabric, |
| 1836 | &msm_bus_sys_fabric, |
| 1837 | &msm_bus_mm_fabric, |
| 1838 | &msm_bus_sys_fpb, |
| 1839 | &msm_bus_cpss_fpb, |
Siddartha Mohanadoss | ba21fdd | 2011-08-18 10:05:27 -0700 | [diff] [blame] | 1840 | &msm_tsens_device, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1841 | }; |
| 1842 | |
| 1843 | static void __init msm8960_i2c_init(void) |
| 1844 | { |
| 1845 | msm8960_device_qup_i2c_gsbi4.dev.platform_data = |
| 1846 | &msm8960_i2c_qup_gsbi4_pdata; |
| 1847 | |
| 1848 | msm8960_device_qup_i2c_gsbi3.dev.platform_data = |
| 1849 | &msm8960_i2c_qup_gsbi3_pdata; |
| 1850 | |
| 1851 | msm8960_device_qup_i2c_gsbi10.dev.platform_data = |
| 1852 | &msm8960_i2c_qup_gsbi10_pdata; |
| 1853 | |
| 1854 | msm8960_device_qup_i2c_gsbi12.dev.platform_data = |
| 1855 | &msm8960_i2c_qup_gsbi12_pdata; |
| 1856 | } |
| 1857 | |
Lucille Sylvester | 34ec369 | 2011-08-16 16:28:04 -0600 | [diff] [blame] | 1858 | static void __init msm8960_gfx_init(void) |
| 1859 | { |
Jeremy Gebben | 58b2dce | 2011-10-13 11:14:19 -0600 | [diff] [blame] | 1860 | uint32_t soc_platform_version = socinfo_get_version(); |
Lucille Sylvester | 34ec369 | 2011-08-16 16:28:04 -0600 | [diff] [blame] | 1861 | if (SOCINFO_VERSION_MAJOR(soc_platform_version) == 1) { |
| 1862 | struct kgsl_device_platform_data *kgsl_3d0_pdata = |
| 1863 | msm_kgsl_3d0.dev.platform_data; |
Lucille Sylvester | dce84cd | 2011-10-12 14:15:37 -0600 | [diff] [blame] | 1864 | kgsl_3d0_pdata->pwrlevel[0].gpu_freq = 320000000; |
| 1865 | kgsl_3d0_pdata->pwrlevel[1].gpu_freq = 266667000; |
Lucille Sylvester | 34ec369 | 2011-08-16 16:28:04 -0600 | [diff] [blame] | 1866 | } |
| 1867 | } |
| 1868 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1869 | static struct msm_cpuidle_state msm_cstates[] __initdata = { |
| 1870 | {0, 0, "C0", "WFI", |
| 1871 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT}, |
| 1872 | |
| 1873 | {0, 1, "C1", "STANDALONE_POWER_COLLAPSE", |
| 1874 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE}, |
| 1875 | |
| 1876 | {0, 2, "C2", "POWER_COLLAPSE", |
| 1877 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE}, |
| 1878 | |
| 1879 | {1, 0, "C0", "WFI", |
| 1880 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT}, |
| 1881 | |
| 1882 | {1, 1, "C1", "STANDALONE_POWER_COLLAPSE", |
| 1883 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE}, |
| 1884 | }; |
| 1885 | |
| 1886 | static struct msm_pm_platform_data msm_pm_data[MSM_PM_SLEEP_MODE_NR * 2] = { |
| 1887 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = { |
| 1888 | .idle_supported = 1, |
| 1889 | .suspend_supported = 1, |
| 1890 | .idle_enabled = 0, |
| 1891 | .suspend_enabled = 0, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1892 | }, |
| 1893 | |
| 1894 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = { |
| 1895 | .idle_supported = 1, |
| 1896 | .suspend_supported = 1, |
| 1897 | .idle_enabled = 0, |
| 1898 | .suspend_enabled = 0, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1899 | }, |
| 1900 | |
| 1901 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = { |
| 1902 | .idle_supported = 1, |
| 1903 | .suspend_supported = 1, |
| 1904 | .idle_enabled = 1, |
| 1905 | .suspend_enabled = 1, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1906 | }, |
| 1907 | |
| 1908 | [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = { |
| 1909 | .idle_supported = 0, |
| 1910 | .suspend_supported = 1, |
| 1911 | .idle_enabled = 0, |
| 1912 | .suspend_enabled = 0, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1913 | }, |
| 1914 | |
| 1915 | [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = { |
| 1916 | .idle_supported = 1, |
| 1917 | .suspend_supported = 1, |
| 1918 | .idle_enabled = 0, |
| 1919 | .suspend_enabled = 0, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1920 | }, |
| 1921 | |
| 1922 | [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = { |
| 1923 | .idle_supported = 1, |
| 1924 | .suspend_supported = 0, |
| 1925 | .idle_enabled = 1, |
| 1926 | .suspend_enabled = 0, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1927 | }, |
| 1928 | }; |
| 1929 | |
| 1930 | static struct msm_rpmrs_level msm_rpmrs_levels[] __initdata = { |
| 1931 | { |
| 1932 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT, |
| 1933 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 1934 | true, |
Maheshkumar Sivasubramanian | ef101a0 | 2011-09-19 16:34:30 -0600 | [diff] [blame] | 1935 | 100, 8000, 100000, 1, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1936 | }, |
| 1937 | |
| 1938 | { |
| 1939 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE, |
| 1940 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 1941 | true, |
Maheshkumar Sivasubramanian | ef101a0 | 2011-09-19 16:34:30 -0600 | [diff] [blame] | 1942 | 2000, 6000, 60100000, 3000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1943 | }, |
| 1944 | |
| 1945 | { |
| 1946 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 1947 | MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE), |
| 1948 | false, |
Maheshkumar Sivasubramanian | ef101a0 | 2011-09-19 16:34:30 -0600 | [diff] [blame] | 1949 | 4200, 5000, 60350000, 3500, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1950 | }, |
| 1951 | |
| 1952 | { |
| 1953 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 1954 | MSM_RPMRS_LIMITS(ON, HSFS_OPEN, MAX, ACTIVE), |
| 1955 | false, |
Maheshkumar Sivasubramanian | ef101a0 | 2011-09-19 16:34:30 -0600 | [diff] [blame] | 1956 | 6300, 4500, 65350000, 4800, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1957 | }, |
Maheshkumar Sivasubramanian | 7df1236 | 2011-11-02 08:25:49 -0600 | [diff] [blame] | 1958 | { |
| 1959 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 1960 | MSM_RPMRS_LIMITS(ON, HSFS_OPEN, ACTIVE, RET_HIGH), |
| 1961 | false, |
| 1962 | 7000, 3500, 66600000, 5150, |
| 1963 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1964 | |
| 1965 | { |
| 1966 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 1967 | MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE), |
| 1968 | false, |
Maheshkumar Sivasubramanian | ef101a0 | 2011-09-19 16:34:30 -0600 | [diff] [blame] | 1969 | 11700, 2500, 67850000, 5500, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1970 | }, |
| 1971 | |
| 1972 | { |
| 1973 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 1974 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE), |
| 1975 | false, |
Maheshkumar Sivasubramanian | ef101a0 | 2011-09-19 16:34:30 -0600 | [diff] [blame] | 1976 | 13800, 2000, 71850000, 6800, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1977 | }, |
| 1978 | |
| 1979 | { |
| 1980 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 1981 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH), |
| 1982 | false, |
Maheshkumar Sivasubramanian | ef101a0 | 2011-09-19 16:34:30 -0600 | [diff] [blame] | 1983 | 29700, 500, 75850000, 8800, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1984 | }, |
| 1985 | |
| 1986 | { |
| 1987 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 1988 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW), |
| 1989 | false, |
Maheshkumar Sivasubramanian | ef101a0 | 2011-09-19 16:34:30 -0600 | [diff] [blame] | 1990 | 29700, 0, 76350000, 9800, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1991 | }, |
| 1992 | }; |
| 1993 | |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 1994 | static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = { |
| 1995 | .mode = MSM_PM_BOOT_CONFIG_TZ, |
| 1996 | }; |
| 1997 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1998 | #ifdef CONFIG_I2C |
| 1999 | #define I2C_SURF 1 |
| 2000 | #define I2C_FFA (1 << 1) |
| 2001 | #define I2C_RUMI (1 << 2) |
| 2002 | #define I2C_SIM (1 << 3) |
| 2003 | #define I2C_FLUID (1 << 4) |
Amir Samuelov | 05f8780 | 2011-08-27 18:30:12 +0300 | [diff] [blame] | 2004 | #define I2C_LIQUID (1 << 5) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2005 | |
| 2006 | struct i2c_registry { |
| 2007 | u8 machs; |
| 2008 | int bus; |
| 2009 | struct i2c_board_info *info; |
| 2010 | int len; |
| 2011 | }; |
| 2012 | |
| 2013 | #ifdef CONFIG_MSM_CAMERA |
| 2014 | static struct i2c_board_info msm_camera_boardinfo[] __initdata = { |
| 2015 | #ifdef CONFIG_IMX074 |
| 2016 | { |
| 2017 | I2C_BOARD_INFO("imx074", 0x1A), |
| 2018 | }, |
| 2019 | #endif |
| 2020 | #ifdef CONFIG_OV2720 |
| 2021 | { |
| 2022 | I2C_BOARD_INFO("ov2720", 0x6C), |
| 2023 | }, |
| 2024 | #endif |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 2025 | #ifdef CONFIG_MT9M114 |
| 2026 | { |
| 2027 | I2C_BOARD_INFO("mt9m114", 0x48), |
| 2028 | }, |
| 2029 | #endif |
Nishant Pandit | 474f225 | 2011-07-23 23:17:56 +0530 | [diff] [blame] | 2030 | #ifdef CONFIG_MSM_CAMERA_FLASH_SC628A |
| 2031 | { |
| 2032 | I2C_BOARD_INFO("sc628a", 0x6E), |
| 2033 | }, |
| 2034 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2035 | }; |
| 2036 | #endif |
| 2037 | |
| 2038 | /* Sensors DSPS platform data */ |
| 2039 | #ifdef CONFIG_MSM_DSPS |
| 2040 | #define DSPS_PIL_GENERIC_NAME "dsps" |
| 2041 | #endif /* CONFIG_MSM_DSPS */ |
| 2042 | |
| 2043 | static void __init msm8960_init_dsps(void) |
| 2044 | { |
| 2045 | #ifdef CONFIG_MSM_DSPS |
| 2046 | struct msm_dsps_platform_data *pdata = |
| 2047 | msm_dsps_device.dev.platform_data; |
| 2048 | pdata->pil_name = DSPS_PIL_GENERIC_NAME; |
| 2049 | pdata->gpios = NULL; |
| 2050 | pdata->gpios_num = 0; |
| 2051 | |
| 2052 | platform_device_register(&msm_dsps_device); |
| 2053 | #endif /* CONFIG_MSM_DSPS */ |
| 2054 | } |
| 2055 | |
Vamsi Krishna | 98f54fb | 2011-11-02 14:55:41 -0700 | [diff] [blame] | 2056 | static void __init msm8960_init_hsic(void) |
| 2057 | { |
| 2058 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
| 2059 | uint32_t version = socinfo_get_version(); |
| 2060 | |
Vamsi Krishna | f74d2edb | 2011-12-02 10:41:11 -0800 | [diff] [blame] | 2061 | if (SOCINFO_VERSION_MAJOR(version) == 1) |
Vamsi Krishna | 98f54fb | 2011-11-02 14:55:41 -0700 | [diff] [blame] | 2062 | return; |
| 2063 | |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 2064 | if (PLATFORM_IS_CHARM25() || machine_is_msm8960_liquid()) |
Vamsi Krishna | f74d2edb | 2011-12-02 10:41:11 -0800 | [diff] [blame] | 2065 | platform_device_register(&msm_device_hsic_host); |
Vamsi Krishna | 98f54fb | 2011-11-02 14:55:41 -0700 | [diff] [blame] | 2066 | #endif |
| 2067 | } |
| 2068 | |
Amir Samuelov | 5137e39 | 2011-09-21 17:31:25 +0300 | [diff] [blame] | 2069 | #ifdef CONFIG_ISL9519_CHARGER |
| 2070 | static struct isl_platform_data isl_data __initdata = { |
| 2071 | .valid_n_gpio = 0, /* Not required when notify-by-pmic */ |
| 2072 | .chg_detection_config = NULL, /* Not required when notify-by-pmic */ |
| 2073 | .max_system_voltage = 4200, |
| 2074 | .min_system_voltage = 3200, |
| 2075 | .chgcurrent = 1000, /* 1900, */ |
| 2076 | .term_current = 400, /* Need fine tuning */ |
| 2077 | .input_current = 2048, |
| 2078 | }; |
| 2079 | |
| 2080 | static struct i2c_board_info isl_charger_i2c_info[] __initdata = { |
| 2081 | { |
| 2082 | I2C_BOARD_INFO("isl9519q", 0x9), |
| 2083 | .irq = 0, /* Not required when notify-by-pmic */ |
| 2084 | .platform_data = &isl_data, |
| 2085 | }, |
| 2086 | }; |
| 2087 | #endif /* CONFIG_ISL9519_CHARGER */ |
| 2088 | |
Amir Samuelov | 755616d | 2011-12-13 16:34:46 +0200 | [diff] [blame] | 2089 | static struct i2c_board_info liquid_io_expander_i2c_info[] __initdata = { |
| 2090 | { |
| 2091 | I2C_BOARD_INFO("sx1508q", 0x20), |
| 2092 | .platform_data = &msm8960_sx150x_data[SX150X_LIQUID] |
| 2093 | }, |
| 2094 | }; |
| 2095 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2096 | static struct i2c_registry msm8960_i2c_devices[] __initdata = { |
| 2097 | #ifdef CONFIG_MSM_CAMERA |
| 2098 | { |
Amir Samuelov | 05f8780 | 2011-08-27 18:30:12 +0300 | [diff] [blame] | 2099 | I2C_SURF | I2C_FFA | I2C_FLUID | I2C_LIQUID | I2C_RUMI, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2100 | MSM_8960_GSBI4_QUP_I2C_BUS_ID, |
| 2101 | msm_camera_boardinfo, |
| 2102 | ARRAY_SIZE(msm_camera_boardinfo), |
| 2103 | }, |
| 2104 | #endif |
Amir Samuelov | 5137e39 | 2011-09-21 17:31:25 +0300 | [diff] [blame] | 2105 | #ifdef CONFIG_ISL9519_CHARGER |
| 2106 | { |
| 2107 | I2C_LIQUID, |
| 2108 | MSM_8960_GSBI10_QUP_I2C_BUS_ID, |
| 2109 | isl_charger_i2c_info, |
| 2110 | ARRAY_SIZE(isl_charger_i2c_info), |
| 2111 | }, |
| 2112 | #endif /* CONFIG_ISL9519_CHARGER */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2113 | { |
| 2114 | I2C_SURF | I2C_FFA | I2C_FLUID, |
| 2115 | MSM_8960_GSBI3_QUP_I2C_BUS_ID, |
| 2116 | cyttsp_info, |
| 2117 | ARRAY_SIZE(cyttsp_info), |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 2118 | }, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2119 | { |
| 2120 | I2C_LIQUID, |
| 2121 | MSM_8960_GSBI3_QUP_I2C_BUS_ID, |
| 2122 | mxt_device_info, |
| 2123 | ARRAY_SIZE(mxt_device_info), |
| 2124 | }, |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 2125 | { |
Mohan Pallaka | f69f049 | 2011-11-21 13:08:33 +0530 | [diff] [blame] | 2126 | I2C_FFA | I2C_LIQUID, |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 2127 | MSM_8960_GSBI10_QUP_I2C_BUS_ID, |
Eugene Yasman | d2316b8 | 2011-12-07 18:23:48 +0200 | [diff] [blame] | 2128 | sii_device_info, |
| 2129 | ARRAY_SIZE(sii_device_info), |
| 2130 | }, |
| 2131 | { |
| 2132 | I2C_LIQUID, |
| 2133 | MSM_8960_GSBI10_QUP_I2C_BUS_ID, |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 2134 | msm_isa1200_board_info, |
| 2135 | ARRAY_SIZE(msm_isa1200_board_info), |
| 2136 | }, |
Amir Samuelov | 755616d | 2011-12-13 16:34:46 +0200 | [diff] [blame] | 2137 | { |
| 2138 | I2C_LIQUID, |
| 2139 | MSM_8960_GSBI10_QUP_I2C_BUS_ID, |
| 2140 | liquid_io_expander_i2c_info, |
| 2141 | ARRAY_SIZE(liquid_io_expander_i2c_info), |
| 2142 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2143 | }; |
| 2144 | #endif /* CONFIG_I2C */ |
| 2145 | |
| 2146 | static void __init register_i2c_devices(void) |
| 2147 | { |
| 2148 | #ifdef CONFIG_I2C |
| 2149 | u8 mach_mask = 0; |
| 2150 | int i; |
| 2151 | |
| 2152 | /* Build the matching 'supported_machs' bitmask */ |
| 2153 | if (machine_is_msm8960_cdp()) |
| 2154 | mach_mask = I2C_SURF; |
| 2155 | else if (machine_is_msm8960_rumi3()) |
| 2156 | mach_mask = I2C_RUMI; |
| 2157 | else if (machine_is_msm8960_sim()) |
| 2158 | mach_mask = I2C_SIM; |
Amy Maloche | 2d02803 | 2011-07-20 14:08:06 -0700 | [diff] [blame] | 2159 | else if (machine_is_msm8960_fluid()) |
| 2160 | mach_mask = I2C_FLUID; |
Amir Samuelov | 05f8780 | 2011-08-27 18:30:12 +0300 | [diff] [blame] | 2161 | else if (machine_is_msm8960_liquid()) |
| 2162 | mach_mask = I2C_LIQUID; |
Amy Maloche | 1b0663f | 2011-08-02 16:46:22 -0700 | [diff] [blame] | 2163 | else if (machine_is_msm8960_mtp()) |
| 2164 | mach_mask = I2C_FFA; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2165 | else |
| 2166 | pr_err("unmatched machine ID in register_i2c_devices\n"); |
| 2167 | |
| 2168 | /* Run the array and install devices as appropriate */ |
| 2169 | for (i = 0; i < ARRAY_SIZE(msm8960_i2c_devices); ++i) { |
| 2170 | if (msm8960_i2c_devices[i].machs & mach_mask) |
| 2171 | i2c_register_board_info(msm8960_i2c_devices[i].bus, |
| 2172 | msm8960_i2c_devices[i].info, |
| 2173 | msm8960_i2c_devices[i].len); |
| 2174 | } |
| 2175 | #endif |
| 2176 | } |
| 2177 | |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2178 | static void __init msm8960_sim_init(void) |
| 2179 | { |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 2180 | struct msm_watchdog_pdata *wdog_pdata = (struct msm_watchdog_pdata *) |
| 2181 | &msm8960_device_watchdog.dev.platform_data; |
| 2182 | |
| 2183 | wdog_pdata->bark_time = 15000; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2184 | BUG_ON(msm_rpm_init(&msm_rpm_data)); |
| 2185 | BUG_ON(msm_rpmrs_levels_init(msm_rpmrs_levels, |
| 2186 | ARRAY_SIZE(msm_rpmrs_levels))); |
| 2187 | regulator_suppress_info_printing(); |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 2188 | platform_device_register(&msm8960_device_rpm_regulator); |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 2189 | msm_clock_init(&msm8960_clock_init_data); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 2190 | msm8960_init_pmic(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2191 | |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 2192 | msm8960_device_otg.dev.platform_data = &msm_otg_pdata; |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 2193 | msm8960_init_gpiomux(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2194 | msm8960_i2c_init(); |
| 2195 | msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data)); |
| 2196 | msm_spm_l2_init(msm_spm_l2_data); |
| 2197 | msm8960_init_buses(); |
| 2198 | platform_add_devices(common_devices, ARRAY_SIZE(common_devices)); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 2199 | msm8960_pm8921_gpio_mpp_init(); |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2200 | platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices)); |
Matt Wagantall | ec57f06 | 2011-08-16 23:54:46 -0700 | [diff] [blame] | 2201 | acpuclk_init(&acpuclk_8960_soc_data); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2202 | |
| 2203 | msm8960_device_qup_spi_gsbi1.dev.platform_data = |
| 2204 | &msm8960_qup_spi_gsbi1_pdata; |
| 2205 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); |
| 2206 | |
| 2207 | msm8960_init_mmc(); |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 2208 | msm8960_init_fb(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2209 | slim_register_board_info(msm_slim_devices, |
| 2210 | ARRAY_SIZE(msm_slim_devices)); |
| 2211 | msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data)); |
| 2212 | msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ); |
| 2213 | msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates), |
| 2214 | msm_pm_data); |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 2215 | BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata)); |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2216 | } |
| 2217 | |
| 2218 | static void __init msm8960_rumi3_init(void) |
| 2219 | { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2220 | BUG_ON(msm_rpm_init(&msm_rpm_data)); |
| 2221 | BUG_ON(msm_rpmrs_levels_init(msm_rpmrs_levels, |
| 2222 | ARRAY_SIZE(msm_rpmrs_levels))); |
| 2223 | regulator_suppress_info_printing(); |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 2224 | platform_device_register(&msm8960_device_rpm_regulator); |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 2225 | msm_clock_init(&msm8960_dummy_clock_init_data); |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 2226 | msm8960_init_gpiomux(); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 2227 | msm8960_init_pmic(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2228 | msm8960_device_qup_spi_gsbi1.dev.platform_data = |
| 2229 | &msm8960_qup_spi_gsbi1_pdata; |
| 2230 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); |
| 2231 | msm8960_i2c_init(); |
| 2232 | msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data)); |
| 2233 | msm_spm_l2_init(msm_spm_l2_data); |
| 2234 | platform_add_devices(common_devices, ARRAY_SIZE(common_devices)); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 2235 | msm8960_pm8921_gpio_mpp_init(); |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2236 | platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices)); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2237 | msm8960_init_mmc(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2238 | register_i2c_devices(); |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 2239 | msm8960_init_fb(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2240 | slim_register_board_info(msm_slim_devices, |
| 2241 | ARRAY_SIZE(msm_slim_devices)); |
| 2242 | msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data)); |
| 2243 | msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ); |
| 2244 | msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates), |
| 2245 | msm_pm_data); |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 2246 | BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata)); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2247 | } |
| 2248 | |
| 2249 | static void __init msm8960_cdp_init(void) |
| 2250 | { |
Naveen Ramaraj | 76483ad | 2011-09-06 14:25:44 -0700 | [diff] [blame] | 2251 | if (meminfo_init(SYS_MEMORY, SZ_256M) < 0) |
| 2252 | pr_err("meminfo_init() failed!\n"); |
| 2253 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2254 | BUG_ON(msm_rpm_init(&msm_rpm_data)); |
| 2255 | BUG_ON(msm_rpmrs_levels_init(msm_rpmrs_levels, |
| 2256 | ARRAY_SIZE(msm_rpmrs_levels))); |
Abhijeet Dharmapurikar | 6d565fd | 2011-09-15 18:49:56 -0700 | [diff] [blame] | 2257 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2258 | regulator_suppress_info_printing(); |
| 2259 | if (msm_xo_init()) |
| 2260 | pr_err("Failed to initialize XO votes\n"); |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 2261 | platform_device_register(&msm8960_device_rpm_regulator); |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 2262 | msm_clock_init(&msm8960_clock_init_data); |
Vijayavardhan Vennapusa | fc464f0 | 2011-11-04 21:54:00 +0530 | [diff] [blame] | 2263 | if (machine_is_msm8960_liquid()) |
| 2264 | msm_otg_pdata.mhl_enable = true; |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 2265 | msm8960_device_otg.dev.platform_data = &msm_otg_pdata; |
Anji jonnala | a8b8d73 | 2011-12-06 10:03:24 +0530 | [diff] [blame] | 2266 | if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() || |
| 2267 | machine_is_msm8960_cdp()) { |
| 2268 | msm_otg_pdata.phy_init_seq = wr_phy_init_seq; |
| 2269 | } else if (machine_is_msm8960_liquid()) { |
| 2270 | msm_otg_pdata.phy_init_seq = |
| 2271 | liquid_v1_phy_init_seq; |
| 2272 | } |
Anji jonnala | a7c1c5c | 2011-12-12 12:20:36 +0530 | [diff] [blame] | 2273 | msm_otg_pdata.swfi_latency = |
| 2274 | msm_rpmrs_levels[0].latency_us; |
Vijayavardhan Vennapusa | 2b592824f | 2011-11-02 19:51:32 +0530 | [diff] [blame] | 2275 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
| 2276 | if (machine_is_msm8960_liquid()) { |
| 2277 | if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 2) |
| 2278 | msm_hsic_pdata.hub_reset = HSIC_HUB_RESET_GPIO; |
| 2279 | } |
| 2280 | #endif |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 2281 | msm_device_hsic_host.dev.platform_data = &msm_hsic_pdata; |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 2282 | msm8960_init_gpiomux(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2283 | msm8960_device_qup_spi_gsbi1.dev.platform_data = |
| 2284 | &msm8960_qup_spi_gsbi1_pdata; |
| 2285 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 2286 | |
| 2287 | msm8960_init_pmic(); |
Mohan Pallaka | f69f049 | 2011-11-21 13:08:33 +0530 | [diff] [blame] | 2288 | if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 2 && |
| 2289 | (machine_is_msm8960_mtp())) || machine_is_msm8960_liquid()) |
| 2290 | msm_isa1200_board_info[0].platform_data = &isa1200_1_pdata; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2291 | msm8960_i2c_init(); |
Lucille Sylvester | 34ec369 | 2011-08-16 16:28:04 -0600 | [diff] [blame] | 2292 | msm8960_gfx_init(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2293 | msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data)); |
| 2294 | msm_spm_l2_init(msm_spm_l2_data); |
| 2295 | msm8960_init_buses(); |
| 2296 | platform_add_devices(msm_footswitch_devices, |
| 2297 | msm_num_footswitch_devices); |
David Collins | b10be1d | 2011-09-02 10:29:31 -0700 | [diff] [blame] | 2298 | if (machine_is_msm8960_liquid()) |
| 2299 | platform_device_register(&msm8960_device_ext_3p3v_vreg); |
David Collins | d5a4073 | 2011-11-29 15:53:56 -0800 | [diff] [blame] | 2300 | if (machine_is_msm8960_cdp()) |
| 2301 | platform_device_register(&msm8960_device_ext_l2_vreg); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2302 | platform_add_devices(common_devices, ARRAY_SIZE(common_devices)); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 2303 | msm8960_pm8921_gpio_mpp_init(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2304 | platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices)); |
Vamsi Krishna | 98f54fb | 2011-11-02 14:55:41 -0700 | [diff] [blame] | 2305 | msm8960_init_hsic(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2306 | msm8960_init_cam(); |
| 2307 | msm8960_init_mmc(); |
Matt Wagantall | ec57f06 | 2011-08-16 23:54:46 -0700 | [diff] [blame] | 2308 | acpuclk_init(&acpuclk_8960_soc_data); |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2309 | if (machine_is_msm8960_liquid()) |
| 2310 | mxt_init_hw_liquid(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2311 | register_i2c_devices(); |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 2312 | msm8960_init_fb(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2313 | slim_register_board_info(msm_slim_devices, |
| 2314 | ARRAY_SIZE(msm_slim_devices)); |
| 2315 | msm8960_init_dsps(); |
| 2316 | msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data)); |
| 2317 | msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ); |
| 2318 | msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates), |
| 2319 | msm_pm_data); |
Larry Bassel | a7eadea | 2011-07-14 10:46:00 -0700 | [diff] [blame] | 2320 | change_memory_power = &msm8960_change_memory_power; |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 2321 | BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata)); |
Joel King | b8352a1 | 2011-11-15 18:46:24 -0800 | [diff] [blame] | 2322 | if (PLATFORM_IS_CHARM25()) |
| 2323 | platform_add_devices(mdm_devices, ARRAY_SIZE(mdm_devices)); |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2324 | } |
| 2325 | |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 2326 | MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR") |
| 2327 | .map_io = msm8960_map_io, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2328 | .reserve = msm8960_reserve, |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 2329 | .init_irq = msm8960_init_irq, |
| 2330 | .timer = &msm_timer, |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2331 | .init_machine = msm8960_sim_init, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2332 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 2333 | .init_very_early = msm8960_early_memory, |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 2334 | MACHINE_END |
Stepan Moskovchenko | 50ede4e | 2010-12-13 18:12:19 -0800 | [diff] [blame] | 2335 | |
| 2336 | MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3") |
| 2337 | .map_io = msm8960_map_io, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2338 | .reserve = msm8960_reserve, |
Stepan Moskovchenko | 50ede4e | 2010-12-13 18:12:19 -0800 | [diff] [blame] | 2339 | .init_irq = msm8960_init_irq, |
| 2340 | .timer = &msm_timer, |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2341 | .init_machine = msm8960_rumi3_init, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2342 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 2343 | .init_very_early = msm8960_early_memory, |
Stepan Moskovchenko | 50ede4e | 2010-12-13 18:12:19 -0800 | [diff] [blame] | 2344 | MACHINE_END |
| 2345 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2346 | MACHINE_START(MSM8960_CDP, "QCT MSM8960 CDP") |
| 2347 | .map_io = msm8960_map_io, |
| 2348 | .reserve = msm8960_reserve, |
| 2349 | .init_irq = msm8960_init_irq, |
| 2350 | .timer = &msm_timer, |
| 2351 | .init_machine = msm8960_cdp_init, |
| 2352 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 2353 | .init_very_early = msm8960_early_memory, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2354 | MACHINE_END |
| 2355 | |
| 2356 | MACHINE_START(MSM8960_MTP, "QCT MSM8960 MTP") |
| 2357 | .map_io = msm8960_map_io, |
| 2358 | .reserve = msm8960_reserve, |
| 2359 | .init_irq = msm8960_init_irq, |
| 2360 | .timer = &msm_timer, |
| 2361 | .init_machine = msm8960_cdp_init, |
| 2362 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 2363 | .init_very_early = msm8960_early_memory, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2364 | MACHINE_END |
| 2365 | |
| 2366 | MACHINE_START(MSM8960_FLUID, "QCT MSM8960 FLUID") |
| 2367 | .map_io = msm8960_map_io, |
| 2368 | .reserve = msm8960_reserve, |
| 2369 | .init_irq = msm8960_init_irq, |
| 2370 | .timer = &msm_timer, |
| 2371 | .init_machine = msm8960_cdp_init, |
| 2372 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 2373 | .init_very_early = msm8960_early_memory, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2374 | MACHINE_END |
Amir Samuelov | 0d1f8ae | 2011-07-28 11:13:58 +0300 | [diff] [blame] | 2375 | |
| 2376 | MACHINE_START(MSM8960_LIQUID, "QCT MSM8960 LIQUID") |
| 2377 | .map_io = msm8960_map_io, |
| 2378 | .reserve = msm8960_reserve, |
| 2379 | .init_irq = msm8960_init_irq, |
| 2380 | .timer = &msm_timer, |
| 2381 | .init_machine = msm8960_cdp_init, |
| 2382 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 2383 | .init_very_early = msm8960_early_memory, |
Amir Samuelov | 0d1f8ae | 2011-07-28 11:13:58 +0300 | [diff] [blame] | 2384 | MACHINE_END |