David Collins | b455842 | 2012-01-05 10:50:49 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | * |
| 12 | */ |
| 13 | #include <linux/kernel.h> |
| 14 | #include <linux/platform_device.h> |
| 15 | #include <linux/io.h> |
| 16 | #include <linux/irq.h> |
| 17 | #include <linux/i2c.h> |
| 18 | #include <linux/i2c/sx150x.h> |
| 19 | #include <linux/i2c/isl9519.h> |
| 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> |
| 24 | #include <linux/mfd/pm8xxx/pm8xxx-adc.h> |
| 25 | #include <linux/regulator/consumer.h> |
| 26 | #include <linux/spi/spi.h> |
| 27 | #include <linux/slimbus/slimbus.h> |
| 28 | #include <linux/bootmem.h> |
| 29 | #include <linux/msm_kgsl.h> |
| 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> |
| 36 | #include <linux/platform_data/qcom_wcnss_device.h> |
| 37 | #include <linux/leds.h> |
| 38 | #include <linux/leds-pm8xxx.h> |
| 39 | #include <linux/i2c/atmel_mxt_ts.h> |
| 40 | #include <linux/msm_tsens.h> |
| 41 | #include <linux/ks8851.h> |
| 42 | #include <linux/i2c/isa1200.h> |
Anirudh Ghayal | eb3af97 | 2011-12-13 17:29:06 +0530 | [diff] [blame] | 43 | #include <linux/gpio_keys.h> |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 44 | |
| 45 | #include <asm/mach-types.h> |
| 46 | #include <asm/mach/arch.h> |
| 47 | #include <asm/setup.h> |
| 48 | #include <asm/hardware/gic.h> |
| 49 | #include <asm/mach/mmc.h> |
| 50 | |
| 51 | #include <mach/board.h> |
| 52 | #include <mach/msm_iomap.h> |
| 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> |
| 64 | #include <mach/gpiomux.h> |
| 65 | #include <mach/msm_bus_board.h> |
| 66 | #include <mach/msm_memtypes.h> |
| 67 | #include <mach/dma.h> |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 68 | #include <mach/msm_xo.h> |
| 69 | #include <mach/restart.h> |
| 70 | |
| 71 | #ifdef CONFIG_WCD9310_CODEC |
| 72 | #include <linux/slimbus/slimbus.h> |
| 73 | #include <linux/mfd/wcd9310/core.h> |
| 74 | #include <linux/mfd/wcd9310/pdata.h> |
| 75 | #endif |
| 76 | |
| 77 | #include <linux/ion.h> |
| 78 | #include <mach/ion.h> |
| 79 | #include <mach/mdm2.h> |
| 80 | |
| 81 | #include "timer.h" |
| 82 | #include "devices.h" |
| 83 | #include "devices-msm8x60.h" |
| 84 | #include "spm.h" |
Abhijeet Dharmapurikar | efaca4f | 2011-12-27 16:24:07 -0800 | [diff] [blame] | 85 | #include <mach/pm.h> |
| 86 | #include <mach/cpuidle.h> |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 87 | #include "rpm_resources.h" |
| 88 | #include "mpm.h" |
| 89 | #include "acpuclock.h" |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 90 | #include "smd_private.h" |
| 91 | #include "pm-boot.h" |
| 92 | #include "msm_watchdog.h" |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 93 | #include "board-8930.h" |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 94 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 95 | static struct platform_device msm_fm_platform_init = { |
| 96 | .name = "iris_fm", |
| 97 | .id = -1, |
| 98 | }; |
| 99 | |
| 100 | #define KS8851_RST_GPIO 89 |
| 101 | #define KS8851_IRQ_GPIO 90 |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 102 | #define HAP_SHIFT_LVL_OE_GPIO 47 |
| 103 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 104 | #if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE) |
| 105 | |
| 106 | struct sx150x_platform_data msm8930_sx150x_data[] = { |
| 107 | [SX150X_CAM] = { |
| 108 | .gpio_base = GPIO_CAM_EXPANDER_BASE, |
| 109 | .oscio_is_gpo = false, |
| 110 | .io_pullup_ena = 0x0, |
| 111 | .io_pulldn_ena = 0xc0, |
| 112 | .io_open_drain_ena = 0x0, |
| 113 | .irq_summary = -1, |
| 114 | }, |
| 115 | }; |
| 116 | |
| 117 | #endif |
| 118 | |
Olav Haugan | a21169d | 2012-01-04 09:17:06 -0800 | [diff] [blame] | 119 | #define MSM_PMEM_ADSP_SIZE 0x7800000 |
Ben Romberger | 3ffcd81 | 2011-12-08 19:12:10 -0800 | [diff] [blame] | 120 | #define MSM_PMEM_AUDIO_SIZE 0x2B4000 |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 121 | #ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY |
| 122 | #define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */ |
| 123 | #else |
Olav Haugan | b88eef1 | 2012-01-15 10:59:26 -0800 | [diff] [blame] | 124 | #define MSM_PMEM_SIZE 0x2800000 /* 40 Mbytes */ |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 125 | #endif |
| 126 | |
| 127 | |
| 128 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 129 | #define MSM_PMEM_KERNEL_EBI1_SIZE 0xB0C000 |
Olav Haugan | b88eef1 | 2012-01-15 10:59:26 -0800 | [diff] [blame] | 130 | #define MSM_ION_SF_SIZE MSM_PMEM_SIZE |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 131 | #define MSM_ION_MM_FW_SIZE 0x200000 /* (2MB) */ |
Olav Haugan | b88eef1 | 2012-01-15 10:59:26 -0800 | [diff] [blame] | 132 | #define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE |
Olav Haugan | 80854eb | 2012-01-12 12:00:23 -0800 | [diff] [blame] | 133 | #define MSM_ION_QSECOM_SIZE 0x100000 /* (1MB) */ |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 134 | #define MSM_ION_MFC_SIZE SZ_8K |
Olav Haugan | 7355db0 | 2012-01-13 16:59:13 -0800 | [diff] [blame] | 135 | #define MSM_ION_AUDIO_SIZE MSM_PMEM_AUDIO_SIZE |
| 136 | #define MSM_ION_HEAP_NUM 8 |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 137 | #else |
| 138 | #define MSM_PMEM_KERNEL_EBI1_SIZE 0x110C000 |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 139 | #define MSM_ION_HEAP_NUM 1 |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 140 | #endif |
| 141 | |
| 142 | #ifdef CONFIG_KERNEL_PMEM_EBI_REGION |
| 143 | static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE; |
| 144 | static int __init pmem_kernel_ebi1_size_setup(char *p) |
| 145 | { |
| 146 | pmem_kernel_ebi1_size = memparse(p, NULL); |
| 147 | return 0; |
| 148 | } |
| 149 | early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup); |
| 150 | #endif |
| 151 | |
| 152 | #ifdef CONFIG_ANDROID_PMEM |
| 153 | static unsigned pmem_size = MSM_PMEM_SIZE; |
| 154 | static int __init pmem_size_setup(char *p) |
| 155 | { |
| 156 | pmem_size = memparse(p, NULL); |
| 157 | return 0; |
| 158 | } |
| 159 | early_param("pmem_size", pmem_size_setup); |
| 160 | |
| 161 | static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE; |
| 162 | |
| 163 | static int __init pmem_adsp_size_setup(char *p) |
| 164 | { |
| 165 | pmem_adsp_size = memparse(p, NULL); |
| 166 | return 0; |
| 167 | } |
| 168 | early_param("pmem_adsp_size", pmem_adsp_size_setup); |
| 169 | |
| 170 | static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE; |
| 171 | |
| 172 | static int __init pmem_audio_size_setup(char *p) |
| 173 | { |
| 174 | pmem_audio_size = memparse(p, NULL); |
| 175 | return 0; |
| 176 | } |
| 177 | early_param("pmem_audio_size", pmem_audio_size_setup); |
| 178 | #endif |
| 179 | |
| 180 | #ifdef CONFIG_ANDROID_PMEM |
| 181 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 182 | static struct android_pmem_platform_data android_pmem_pdata = { |
| 183 | .name = "pmem", |
| 184 | .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING, |
| 185 | .cached = 1, |
| 186 | .memory_type = MEMTYPE_EBI1, |
| 187 | }; |
| 188 | |
| 189 | static struct platform_device android_pmem_device = { |
| 190 | .name = "android_pmem", |
| 191 | .id = 0, |
| 192 | .dev = {.platform_data = &android_pmem_pdata}, |
| 193 | }; |
| 194 | |
| 195 | static struct android_pmem_platform_data android_pmem_adsp_pdata = { |
| 196 | .name = "pmem_adsp", |
| 197 | .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, |
| 198 | .cached = 0, |
| 199 | .memory_type = MEMTYPE_EBI1, |
| 200 | }; |
| 201 | static struct platform_device android_pmem_adsp_device = { |
| 202 | .name = "android_pmem", |
| 203 | .id = 2, |
| 204 | .dev = { .platform_data = &android_pmem_adsp_pdata }, |
| 205 | }; |
| 206 | #endif |
| 207 | |
| 208 | static struct android_pmem_platform_data android_pmem_audio_pdata = { |
| 209 | .name = "pmem_audio", |
| 210 | .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, |
| 211 | .cached = 0, |
| 212 | .memory_type = MEMTYPE_EBI1, |
| 213 | }; |
| 214 | |
| 215 | static struct platform_device android_pmem_audio_device = { |
| 216 | .name = "android_pmem", |
| 217 | .id = 4, |
| 218 | .dev = { .platform_data = &android_pmem_audio_pdata }, |
| 219 | }; |
| 220 | #endif |
| 221 | |
| 222 | #define DSP_RAM_BASE_8960 0x8da00000 |
| 223 | #define DSP_RAM_SIZE_8960 0x1800000 |
| 224 | static int dspcrashd_pdata_8960 = 0xDEADDEAD; |
| 225 | |
| 226 | static struct resource resources_dspcrashd_8960[] = { |
| 227 | { |
| 228 | .name = "msm_dspcrashd", |
| 229 | .start = DSP_RAM_BASE_8960, |
| 230 | .end = DSP_RAM_BASE_8960 + DSP_RAM_SIZE_8960, |
| 231 | .flags = IORESOURCE_DMA, |
| 232 | }, |
| 233 | }; |
| 234 | |
| 235 | static struct platform_device msm_device_dspcrashd_8960 = { |
| 236 | .name = "msm_dspcrashd", |
| 237 | .num_resources = ARRAY_SIZE(resources_dspcrashd_8960), |
| 238 | .resource = resources_dspcrashd_8960, |
| 239 | .dev = { .platform_data = &dspcrashd_pdata_8960 }, |
| 240 | }; |
| 241 | |
| 242 | static struct memtype_reserve msm8930_reserve_table[] __initdata = { |
| 243 | [MEMTYPE_SMI] = { |
| 244 | }, |
| 245 | [MEMTYPE_EBI0] = { |
| 246 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 247 | }, |
| 248 | [MEMTYPE_EBI1] = { |
| 249 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 250 | }, |
| 251 | }; |
| 252 | |
| 253 | static void __init size_pmem_devices(void) |
| 254 | { |
| 255 | #ifdef CONFIG_ANDROID_PMEM |
| 256 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 257 | android_pmem_adsp_pdata.size = pmem_adsp_size; |
| 258 | android_pmem_pdata.size = pmem_size; |
| 259 | #endif |
| 260 | android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE; |
| 261 | #endif |
| 262 | } |
| 263 | |
| 264 | static void __init reserve_memory_for(struct android_pmem_platform_data *p) |
| 265 | { |
| 266 | msm8930_reserve_table[p->memory_type].size += p->size; |
| 267 | } |
| 268 | |
| 269 | static void __init reserve_pmem_memory(void) |
| 270 | { |
| 271 | #ifdef CONFIG_ANDROID_PMEM |
| 272 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 273 | reserve_memory_for(&android_pmem_adsp_pdata); |
| 274 | reserve_memory_for(&android_pmem_pdata); |
| 275 | #endif |
| 276 | reserve_memory_for(&android_pmem_audio_pdata); |
| 277 | msm8930_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size; |
| 278 | #endif |
| 279 | } |
| 280 | |
| 281 | static int msm8930_paddr_to_memtype(unsigned int paddr) |
| 282 | { |
| 283 | return MEMTYPE_EBI1; |
| 284 | } |
| 285 | |
| 286 | #ifdef CONFIG_ION_MSM |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 287 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 288 | static struct ion_cp_heap_pdata cp_mm_ion_pdata = { |
| 289 | .permission_type = IPT_TYPE_MM_CARVEOUT, |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 290 | .align = PAGE_SIZE, |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 291 | }; |
| 292 | |
| 293 | static struct ion_cp_heap_pdata cp_mfc_ion_pdata = { |
| 294 | .permission_type = IPT_TYPE_MFC_SHAREDMEM, |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 295 | .align = PAGE_SIZE, |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 296 | }; |
| 297 | static struct ion_co_heap_pdata co_ion_pdata = { |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 298 | .adjacent_mem_id = INVALID_HEAP_ID, |
| 299 | .align = PAGE_SIZE, |
| 300 | }; |
| 301 | static struct ion_co_heap_pdata fw_co_ion_pdata = { |
| 302 | .adjacent_mem_id = ION_CP_MM_HEAP_ID, |
| 303 | .align = SZ_128K, |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 304 | }; |
| 305 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 306 | static struct ion_platform_data ion_pdata = { |
| 307 | .nr = MSM_ION_HEAP_NUM, |
| 308 | .heaps = { |
| 309 | { |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 310 | .id = ION_SYSTEM_HEAP_ID, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 311 | .type = ION_HEAP_TYPE_SYSTEM, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 312 | .name = ION_VMALLOC_HEAP_NAME, |
| 313 | }, |
| 314 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 315 | { |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 316 | .id = ION_SF_HEAP_ID, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 317 | .type = ION_HEAP_TYPE_CARVEOUT, |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 318 | .name = ION_SF_HEAP_NAME, |
| 319 | .size = MSM_ION_SF_SIZE, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 320 | .memory_type = ION_EBI_TYPE, |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 321 | .extra_data = (void *) &co_ion_pdata, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 322 | }, |
| 323 | { |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 324 | .id = ION_CP_MM_HEAP_ID, |
Olav Haugan | 0a85251 | 2012-01-09 10:20:55 -0800 | [diff] [blame] | 325 | .type = ION_HEAP_TYPE_CP, |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 326 | .name = ION_MM_HEAP_NAME, |
| 327 | .size = MSM_ION_MM_SIZE, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 328 | .memory_type = ION_EBI_TYPE, |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 329 | .extra_data = (void *) &cp_mm_ion_pdata, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 330 | }, |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 331 | { |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 332 | .id = ION_MM_FIRMWARE_HEAP_ID, |
| 333 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 334 | .name = ION_MM_FIRMWARE_HEAP_NAME, |
| 335 | .size = MSM_ION_MM_FW_SIZE, |
| 336 | .memory_type = ION_EBI_TYPE, |
| 337 | .extra_data = (void *) &fw_co_ion_pdata, |
| 338 | }, |
| 339 | { |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 340 | .id = ION_CP_MFC_HEAP_ID, |
Olav Haugan | 0a85251 | 2012-01-09 10:20:55 -0800 | [diff] [blame] | 341 | .type = ION_HEAP_TYPE_CP, |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 342 | .name = ION_MFC_HEAP_NAME, |
| 343 | .size = MSM_ION_MFC_SIZE, |
| 344 | .memory_type = ION_EBI_TYPE, |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 345 | .extra_data = (void *) &cp_mfc_ion_pdata, |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 346 | }, |
| 347 | { |
| 348 | .id = ION_IOMMU_HEAP_ID, |
| 349 | .type = ION_HEAP_TYPE_IOMMU, |
| 350 | .name = ION_IOMMU_HEAP_NAME, |
| 351 | }, |
Olav Haugan | 80854eb | 2012-01-12 12:00:23 -0800 | [diff] [blame] | 352 | { |
| 353 | .id = ION_QSECOM_HEAP_ID, |
| 354 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 355 | .name = ION_QSECOM_HEAP_NAME, |
| 356 | .size = MSM_ION_QSECOM_SIZE, |
| 357 | .memory_type = ION_EBI_TYPE, |
| 358 | .extra_data = (void *) &co_ion_pdata, |
| 359 | }, |
Olav Haugan | 7355db0 | 2012-01-13 16:59:13 -0800 | [diff] [blame] | 360 | { |
| 361 | .id = ION_AUDIO_HEAP_ID, |
| 362 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 363 | .name = ION_AUDIO_HEAP_NAME, |
| 364 | .size = MSM_ION_AUDIO_SIZE, |
| 365 | .memory_type = ION_EBI_TYPE, |
| 366 | .extra_data = (void *) &co_ion_pdata, |
| 367 | }, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 368 | #endif |
| 369 | } |
| 370 | }; |
| 371 | |
| 372 | static struct platform_device ion_dev = { |
| 373 | .name = "ion-msm", |
| 374 | .id = 1, |
| 375 | .dev = { .platform_data = &ion_pdata }, |
| 376 | }; |
| 377 | #endif |
| 378 | |
| 379 | static void reserve_ion_memory(void) |
| 380 | { |
| 381 | #if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION) |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 382 | msm8930_reserve_table[MEMTYPE_EBI1].size += MSM_ION_SF_SIZE; |
| 383 | msm8930_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_SIZE; |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 384 | msm8930_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_FW_SIZE; |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 385 | msm8930_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MFC_SIZE; |
Olav Haugan | 80854eb | 2012-01-12 12:00:23 -0800 | [diff] [blame] | 386 | msm8930_reserve_table[MEMTYPE_EBI1].size += MSM_ION_QSECOM_SIZE; |
Olav Haugan | 7355db0 | 2012-01-13 16:59:13 -0800 | [diff] [blame] | 387 | msm8930_reserve_table[MEMTYPE_EBI1].size += MSM_ION_AUDIO_SIZE; |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 388 | #endif |
| 389 | } |
Huaibin Yang | a541942 | 2011-12-08 23:52:10 -0800 | [diff] [blame] | 390 | |
| 391 | static void __init reserve_mdp_memory(void) |
| 392 | { |
| 393 | msm8930_mdp_writeback(msm8930_reserve_table); |
| 394 | } |
| 395 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 396 | static void __init msm8930_calculate_reserve_sizes(void) |
| 397 | { |
| 398 | size_pmem_devices(); |
| 399 | reserve_pmem_memory(); |
| 400 | reserve_ion_memory(); |
Huaibin Yang | a541942 | 2011-12-08 23:52:10 -0800 | [diff] [blame] | 401 | reserve_mdp_memory(); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 402 | } |
| 403 | |
| 404 | static struct reserve_info msm8930_reserve_info __initdata = { |
| 405 | .memtype_reserve_table = msm8930_reserve_table, |
| 406 | .calculate_reserve_sizes = msm8930_calculate_reserve_sizes, |
| 407 | .paddr_to_memtype = msm8930_paddr_to_memtype, |
| 408 | }; |
| 409 | |
| 410 | static int msm8930_memory_bank_size(void) |
| 411 | { |
| 412 | return 1<<29; |
| 413 | } |
| 414 | |
| 415 | static void __init locate_unstable_memory(void) |
| 416 | { |
| 417 | struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1]; |
| 418 | unsigned long bank_size; |
| 419 | unsigned long low, high; |
| 420 | |
| 421 | bank_size = msm8930_memory_bank_size(); |
| 422 | low = meminfo.bank[0].start; |
| 423 | high = mb->start + mb->size; |
| 424 | |
| 425 | /* Check if 32 bit overflow occured */ |
| 426 | if (high < mb->start) |
| 427 | high = ~0UL; |
| 428 | |
| 429 | low &= ~(bank_size - 1); |
| 430 | |
| 431 | if (high - low <= bank_size) |
| 432 | return; |
| 433 | msm8930_reserve_info.low_unstable_address = low + bank_size; |
| 434 | /* To avoid overflow of u32 compute max_unstable_size |
| 435 | * by first subtracting low from mb->start) |
| 436 | * */ |
| 437 | msm8930_reserve_info.max_unstable_size = (mb->start - low) + |
| 438 | mb->size - bank_size; |
| 439 | |
| 440 | msm8930_reserve_info.bank_size = bank_size; |
| 441 | pr_info("low unstable address %lx max size %lx bank size %lx\n", |
| 442 | msm8930_reserve_info.low_unstable_address, |
| 443 | msm8930_reserve_info.max_unstable_size, |
| 444 | msm8930_reserve_info.bank_size); |
| 445 | } |
| 446 | |
| 447 | static void __init place_movable_zone(void) |
| 448 | { |
| 449 | movable_reserved_start = msm8930_reserve_info.low_unstable_address; |
| 450 | movable_reserved_size = msm8930_reserve_info.max_unstable_size; |
| 451 | pr_info("movable zone start %lx size %lx\n", |
| 452 | movable_reserved_start, movable_reserved_size); |
| 453 | } |
| 454 | |
| 455 | static void __init msm8930_early_memory(void) |
| 456 | { |
| 457 | reserve_info = &msm8930_reserve_info; |
| 458 | locate_unstable_memory(); |
| 459 | place_movable_zone(); |
| 460 | } |
| 461 | |
| 462 | static void __init msm8930_reserve(void) |
| 463 | { |
| 464 | msm_reserve(); |
| 465 | } |
| 466 | |
| 467 | static int msm8930_change_memory_power(u64 start, u64 size, |
| 468 | int change_type) |
| 469 | { |
| 470 | return soc_change_memory_power(start, size, change_type); |
| 471 | } |
| 472 | |
| 473 | static void __init msm8930_allocate_memory_regions(void) |
| 474 | { |
| 475 | msm8930_allocate_fb_region(); |
| 476 | } |
| 477 | |
| 478 | #ifdef CONFIG_WCD9310_CODEC |
| 479 | |
| 480 | #define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS) |
| 481 | |
| 482 | /* Micbias setting is based on 8660 CDP/MTP/FLUID requirement |
| 483 | * 4 micbiases are used to power various analog and digital |
| 484 | * microphones operating at 1800 mV. Technically, all micbiases |
| 485 | * can source from single cfilter since all microphones operate |
| 486 | * at the same voltage level. The arrangement below is to make |
| 487 | * sure all cfilters are exercised. LDO_H regulator ouput level |
| 488 | * does not need to be as high as 2.85V. It is choosen for |
| 489 | * microphone sensitivity purpose. |
| 490 | */ |
| 491 | static struct tabla_pdata tabla_platform_data = { |
| 492 | .slimbus_slave_device = { |
| 493 | .name = "tabla-slave", |
| 494 | .e_addr = {0, 0, 0x10, 0, 0x17, 2}, |
| 495 | }, |
| 496 | .irq = MSM_GPIO_TO_INT(62), |
| 497 | .irq_base = TABLA_INTERRUPT_BASE, |
| 498 | .num_irqs = NR_TABLA_IRQS, |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 499 | |
| 500 | /*TODO: Replace this with right PM8038 gpio */ |
| 501 | #ifndef MSM8930_PHASE_2 |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 502 | .reset_gpio = PM8921_GPIO_PM_TO_SYS(34), |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 503 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 504 | .micbias = { |
| 505 | .ldoh_v = TABLA_LDOH_2P85_V, |
| 506 | .cfilt1_mv = 1800, |
| 507 | .cfilt2_mv = 1800, |
| 508 | .cfilt3_mv = 1800, |
| 509 | .bias1_cfilt_sel = TABLA_CFILT1_SEL, |
| 510 | .bias2_cfilt_sel = TABLA_CFILT2_SEL, |
| 511 | .bias3_cfilt_sel = TABLA_CFILT3_SEL, |
| 512 | .bias4_cfilt_sel = TABLA_CFILT3_SEL, |
| 513 | } |
| 514 | }; |
| 515 | |
| 516 | static struct slim_device msm_slim_tabla = { |
| 517 | .name = "tabla-slim", |
| 518 | .e_addr = {0, 1, 0x10, 0, 0x17, 2}, |
| 519 | .dev = { |
| 520 | .platform_data = &tabla_platform_data, |
| 521 | }, |
| 522 | }; |
| 523 | |
| 524 | static struct tabla_pdata tabla20_platform_data = { |
| 525 | .slimbus_slave_device = { |
| 526 | .name = "tabla-slave", |
| 527 | .e_addr = {0, 0, 0x60, 0, 0x17, 2}, |
| 528 | }, |
| 529 | .irq = MSM_GPIO_TO_INT(62), |
| 530 | .irq_base = TABLA_INTERRUPT_BASE, |
| 531 | .num_irqs = NR_TABLA_IRQS, |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 532 | |
| 533 | /*TODO: Replace this with right PM8038 gpio */ |
| 534 | #ifndef MSM8930_PHASE_2 |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 535 | .reset_gpio = PM8921_GPIO_PM_TO_SYS(34), |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 536 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 537 | .micbias = { |
| 538 | .ldoh_v = TABLA_LDOH_2P85_V, |
| 539 | .cfilt1_mv = 1800, |
| 540 | .cfilt2_mv = 1800, |
| 541 | .cfilt3_mv = 1800, |
| 542 | .bias1_cfilt_sel = TABLA_CFILT1_SEL, |
| 543 | .bias2_cfilt_sel = TABLA_CFILT2_SEL, |
| 544 | .bias3_cfilt_sel = TABLA_CFILT3_SEL, |
| 545 | .bias4_cfilt_sel = TABLA_CFILT3_SEL, |
| 546 | } |
| 547 | }; |
| 548 | |
| 549 | static struct slim_device msm_slim_tabla20 = { |
| 550 | .name = "tabla2x-slim", |
| 551 | .e_addr = {0, 1, 0x60, 0, 0x17, 2}, |
| 552 | .dev = { |
| 553 | .platform_data = &tabla20_platform_data, |
| 554 | }, |
| 555 | }; |
| 556 | #endif |
| 557 | |
| 558 | static struct slim_boardinfo msm_slim_devices[] = { |
| 559 | #ifdef CONFIG_WCD9310_CODEC |
| 560 | { |
| 561 | .bus_num = 1, |
| 562 | .slim_slave = &msm_slim_tabla, |
| 563 | }, |
| 564 | { |
| 565 | .bus_num = 1, |
| 566 | .slim_slave = &msm_slim_tabla20, |
| 567 | }, |
| 568 | #endif |
| 569 | /* add more slimbus slaves as needed */ |
| 570 | }; |
| 571 | |
| 572 | #define MSM_WCNSS_PHYS 0x03000000 |
| 573 | #define MSM_WCNSS_SIZE 0x280000 |
| 574 | |
| 575 | static struct resource resources_wcnss_wlan[] = { |
| 576 | { |
| 577 | .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ, |
| 578 | .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ, |
| 579 | .name = "wcnss_wlanrx_irq", |
| 580 | .flags = IORESOURCE_IRQ, |
| 581 | }, |
| 582 | { |
| 583 | .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ, |
| 584 | .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ, |
| 585 | .name = "wcnss_wlantx_irq", |
| 586 | .flags = IORESOURCE_IRQ, |
| 587 | }, |
| 588 | { |
| 589 | .start = MSM_WCNSS_PHYS, |
| 590 | .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1, |
| 591 | .name = "wcnss_mmio", |
| 592 | .flags = IORESOURCE_MEM, |
| 593 | }, |
| 594 | { |
| 595 | .start = 84, |
| 596 | .end = 88, |
| 597 | .name = "wcnss_gpios_5wire", |
| 598 | .flags = IORESOURCE_IO, |
| 599 | }, |
| 600 | }; |
| 601 | |
| 602 | static struct qcom_wcnss_opts qcom_wcnss_pdata = { |
| 603 | .has_48mhz_xo = 1, |
| 604 | }; |
| 605 | |
| 606 | static struct platform_device msm_device_wcnss_wlan = { |
| 607 | .name = "wcnss_wlan", |
| 608 | .id = 0, |
| 609 | .num_resources = ARRAY_SIZE(resources_wcnss_wlan), |
| 610 | .resource = resources_wcnss_wlan, |
| 611 | .dev = {.platform_data = &qcom_wcnss_pdata}, |
| 612 | }; |
| 613 | |
| 614 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 615 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \ |
| 616 | defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 617 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 618 | |
| 619 | #define QCE_SIZE 0x10000 |
| 620 | #define QCE_0_BASE 0x18500000 |
| 621 | |
| 622 | #define QCE_HW_KEY_SUPPORT 0 |
| 623 | #define QCE_SHA_HMAC_SUPPORT 1 |
| 624 | #define QCE_SHARE_CE_RESOURCE 1 |
| 625 | #define QCE_CE_SHARED 0 |
| 626 | |
| 627 | static struct resource qcrypto_resources[] = { |
| 628 | [0] = { |
| 629 | .start = QCE_0_BASE, |
| 630 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 631 | .flags = IORESOURCE_MEM, |
| 632 | }, |
| 633 | [1] = { |
| 634 | .name = "crypto_channels", |
| 635 | .start = DMOV_CE_IN_CHAN, |
| 636 | .end = DMOV_CE_OUT_CHAN, |
| 637 | .flags = IORESOURCE_DMA, |
| 638 | }, |
| 639 | [2] = { |
| 640 | .name = "crypto_crci_in", |
| 641 | .start = DMOV_CE_IN_CRCI, |
| 642 | .end = DMOV_CE_IN_CRCI, |
| 643 | .flags = IORESOURCE_DMA, |
| 644 | }, |
| 645 | [3] = { |
| 646 | .name = "crypto_crci_out", |
| 647 | .start = DMOV_CE_OUT_CRCI, |
| 648 | .end = DMOV_CE_OUT_CRCI, |
| 649 | .flags = IORESOURCE_DMA, |
| 650 | }, |
| 651 | }; |
| 652 | |
| 653 | static struct resource qcedev_resources[] = { |
| 654 | [0] = { |
| 655 | .start = QCE_0_BASE, |
| 656 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 657 | .flags = IORESOURCE_MEM, |
| 658 | }, |
| 659 | [1] = { |
| 660 | .name = "crypto_channels", |
| 661 | .start = DMOV_CE_IN_CHAN, |
| 662 | .end = DMOV_CE_OUT_CHAN, |
| 663 | .flags = IORESOURCE_DMA, |
| 664 | }, |
| 665 | [2] = { |
| 666 | .name = "crypto_crci_in", |
| 667 | .start = DMOV_CE_IN_CRCI, |
| 668 | .end = DMOV_CE_IN_CRCI, |
| 669 | .flags = IORESOURCE_DMA, |
| 670 | }, |
| 671 | [3] = { |
| 672 | .name = "crypto_crci_out", |
| 673 | .start = DMOV_CE_OUT_CRCI, |
| 674 | .end = DMOV_CE_OUT_CRCI, |
| 675 | .flags = IORESOURCE_DMA, |
| 676 | }, |
| 677 | }; |
| 678 | |
| 679 | #endif |
| 680 | |
| 681 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 682 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 683 | |
| 684 | static struct msm_ce_hw_support qcrypto_ce_hw_suppport = { |
| 685 | .ce_shared = QCE_CE_SHARED, |
| 686 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 687 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 688 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
| 689 | }; |
| 690 | |
| 691 | static struct platform_device qcrypto_device = { |
| 692 | .name = "qcrypto", |
| 693 | .id = 0, |
| 694 | .num_resources = ARRAY_SIZE(qcrypto_resources), |
| 695 | .resource = qcrypto_resources, |
| 696 | .dev = { |
| 697 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 698 | .platform_data = &qcrypto_ce_hw_suppport, |
| 699 | }, |
| 700 | }; |
| 701 | #endif |
| 702 | |
| 703 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 704 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 705 | |
| 706 | static struct msm_ce_hw_support qcedev_ce_hw_suppport = { |
| 707 | .ce_shared = QCE_CE_SHARED, |
| 708 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 709 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 710 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
| 711 | }; |
| 712 | |
| 713 | static struct platform_device qcedev_device = { |
| 714 | .name = "qce", |
| 715 | .id = 0, |
| 716 | .num_resources = ARRAY_SIZE(qcedev_resources), |
| 717 | .resource = qcedev_resources, |
| 718 | .dev = { |
| 719 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 720 | .platform_data = &qcedev_ce_hw_suppport, |
| 721 | }, |
| 722 | }; |
| 723 | #endif |
| 724 | |
| 725 | #define MDM2AP_ERRFATAL 70 |
| 726 | #define AP2MDM_ERRFATAL 95 |
| 727 | #define MDM2AP_STATUS 69 |
| 728 | #define AP2MDM_STATUS 94 |
| 729 | #define AP2MDM_PMIC_RESET_N 80 |
| 730 | #define AP2MDM_KPDPWR_N 81 |
| 731 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 732 | static struct resource mdm_resources[] = { |
| 733 | { |
| 734 | .start = MDM2AP_ERRFATAL, |
| 735 | .end = MDM2AP_ERRFATAL, |
| 736 | .name = "MDM2AP_ERRFATAL", |
| 737 | .flags = IORESOURCE_IO, |
| 738 | }, |
| 739 | { |
| 740 | .start = AP2MDM_ERRFATAL, |
| 741 | .end = AP2MDM_ERRFATAL, |
| 742 | .name = "AP2MDM_ERRFATAL", |
| 743 | .flags = IORESOURCE_IO, |
| 744 | }, |
| 745 | { |
| 746 | .start = MDM2AP_STATUS, |
| 747 | .end = MDM2AP_STATUS, |
| 748 | .name = "MDM2AP_STATUS", |
| 749 | .flags = IORESOURCE_IO, |
| 750 | }, |
| 751 | { |
| 752 | .start = AP2MDM_STATUS, |
| 753 | .end = AP2MDM_STATUS, |
| 754 | .name = "AP2MDM_STATUS", |
| 755 | .flags = IORESOURCE_IO, |
| 756 | }, |
| 757 | { |
| 758 | .start = AP2MDM_PMIC_RESET_N, |
| 759 | .end = AP2MDM_PMIC_RESET_N, |
| 760 | .name = "AP2MDM_PMIC_RESET_N", |
| 761 | .flags = IORESOURCE_IO, |
| 762 | }, |
| 763 | { |
| 764 | .start = AP2MDM_KPDPWR_N, |
| 765 | .end = AP2MDM_KPDPWR_N, |
| 766 | .name = "AP2MDM_KPDPWR_N", |
| 767 | .flags = IORESOURCE_IO, |
| 768 | }, |
| 769 | }; |
| 770 | |
| 771 | static struct mdm_platform_data mdm_platform_data = { |
| 772 | .mdm_version = "2.5", |
| 773 | }; |
| 774 | |
| 775 | static struct platform_device mdm_device = { |
| 776 | .name = "mdm2_modem", |
| 777 | .id = -1, |
| 778 | .num_resources = ARRAY_SIZE(mdm_resources), |
| 779 | .resource = mdm_resources, |
| 780 | .dev = { |
| 781 | .platform_data = &mdm_platform_data, |
| 782 | }, |
| 783 | }; |
| 784 | |
| 785 | static struct platform_device *mdm_devices[] __initdata = { |
| 786 | &mdm_device, |
| 787 | }; |
| 788 | |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 789 | #ifdef CONFIG_MSM_MPM |
| 790 | static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] __initdata = { |
| 791 | [1] = MSM_GPIO_TO_INT(46), |
| 792 | [2] = MSM_GPIO_TO_INT(150), |
| 793 | [4] = MSM_GPIO_TO_INT(103), |
| 794 | [5] = MSM_GPIO_TO_INT(104), |
| 795 | [6] = MSM_GPIO_TO_INT(105), |
| 796 | [7] = MSM_GPIO_TO_INT(106), |
| 797 | [8] = MSM_GPIO_TO_INT(107), |
| 798 | [9] = MSM_GPIO_TO_INT(7), |
| 799 | [10] = MSM_GPIO_TO_INT(11), |
| 800 | [11] = MSM_GPIO_TO_INT(15), |
| 801 | [12] = MSM_GPIO_TO_INT(19), |
| 802 | [13] = MSM_GPIO_TO_INT(23), |
| 803 | [14] = MSM_GPIO_TO_INT(27), |
| 804 | [15] = MSM_GPIO_TO_INT(31), |
| 805 | [16] = MSM_GPIO_TO_INT(35), |
| 806 | [19] = MSM_GPIO_TO_INT(90), |
| 807 | [20] = MSM_GPIO_TO_INT(92), |
| 808 | [23] = MSM_GPIO_TO_INT(85), |
| 809 | [24] = MSM_GPIO_TO_INT(83), |
| 810 | [25] = USB1_HS_IRQ, |
| 811 | [27] = HDMI_IRQ, |
| 812 | [29] = MSM_GPIO_TO_INT(10), |
| 813 | [30] = MSM_GPIO_TO_INT(102), |
| 814 | [31] = MSM_GPIO_TO_INT(81), |
| 815 | [32] = MSM_GPIO_TO_INT(78), |
| 816 | [33] = MSM_GPIO_TO_INT(94), |
| 817 | [34] = MSM_GPIO_TO_INT(72), |
| 818 | [35] = MSM_GPIO_TO_INT(39), |
| 819 | [36] = MSM_GPIO_TO_INT(43), |
| 820 | [37] = MSM_GPIO_TO_INT(61), |
| 821 | [38] = MSM_GPIO_TO_INT(50), |
| 822 | [39] = MSM_GPIO_TO_INT(42), |
| 823 | [41] = MSM_GPIO_TO_INT(62), |
| 824 | [42] = MSM_GPIO_TO_INT(76), |
| 825 | [43] = MSM_GPIO_TO_INT(75), |
| 826 | [44] = MSM_GPIO_TO_INT(70), |
| 827 | [45] = MSM_GPIO_TO_INT(69), |
| 828 | [46] = MSM_GPIO_TO_INT(67), |
| 829 | [47] = MSM_GPIO_TO_INT(65), |
| 830 | [48] = MSM_GPIO_TO_INT(58), |
| 831 | [49] = MSM_GPIO_TO_INT(54), |
| 832 | [50] = MSM_GPIO_TO_INT(52), |
| 833 | [51] = MSM_GPIO_TO_INT(49), |
| 834 | [52] = MSM_GPIO_TO_INT(40), |
| 835 | [53] = MSM_GPIO_TO_INT(37), |
| 836 | [54] = MSM_GPIO_TO_INT(24), |
| 837 | [55] = MSM_GPIO_TO_INT(14), |
| 838 | }; |
| 839 | |
| 840 | static uint16_t msm_mpm_bypassed_apps_irqs[] __initdata = { |
| 841 | TLMM_MSM_SUMMARY_IRQ, |
| 842 | RPM_APCC_CPU0_GP_HIGH_IRQ, |
| 843 | RPM_APCC_CPU0_GP_MEDIUM_IRQ, |
| 844 | RPM_APCC_CPU0_GP_LOW_IRQ, |
| 845 | RPM_APCC_CPU0_WAKE_UP_IRQ, |
| 846 | RPM_APCC_CPU1_GP_HIGH_IRQ, |
| 847 | RPM_APCC_CPU1_GP_MEDIUM_IRQ, |
| 848 | RPM_APCC_CPU1_GP_LOW_IRQ, |
| 849 | RPM_APCC_CPU1_WAKE_UP_IRQ, |
| 850 | MSS_TO_APPS_IRQ_0, |
| 851 | MSS_TO_APPS_IRQ_1, |
| 852 | MSS_TO_APPS_IRQ_2, |
| 853 | MSS_TO_APPS_IRQ_3, |
| 854 | MSS_TO_APPS_IRQ_4, |
| 855 | MSS_TO_APPS_IRQ_5, |
| 856 | MSS_TO_APPS_IRQ_6, |
| 857 | MSS_TO_APPS_IRQ_7, |
| 858 | MSS_TO_APPS_IRQ_8, |
| 859 | MSS_TO_APPS_IRQ_9, |
| 860 | LPASS_SCSS_GP_LOW_IRQ, |
| 861 | LPASS_SCSS_GP_MEDIUM_IRQ, |
| 862 | LPASS_SCSS_GP_HIGH_IRQ, |
| 863 | SPS_MTI_30, |
| 864 | SPS_MTI_31, |
| 865 | RIVA_APSS_SPARE_IRQ, |
| 866 | RIVA_APPS_WLAN_SMSM_IRQ, |
| 867 | RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ, |
| 868 | RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ, |
| 869 | }; |
| 870 | |
| 871 | struct msm_mpm_device_data msm8930_mpm_dev_data __initdata = { |
| 872 | .irqs_m2a = msm_mpm_irqs_m2a, |
| 873 | .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a), |
| 874 | .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs, |
| 875 | .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs), |
| 876 | .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8, |
| 877 | .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8, |
| 878 | .mpm_apps_ipc_reg = MSM_APCS_GCC_BASE + 0x008, |
| 879 | .mpm_apps_ipc_val = BIT(1), |
| 880 | .mpm_ipc_irq = RPM_APCC_CPU0_GP_MEDIUM_IRQ, |
| 881 | |
| 882 | }; |
| 883 | #endif |
| 884 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 885 | #define MSM_SHARED_RAM_PHYS 0x80000000 |
| 886 | |
| 887 | static void __init msm8930_map_io(void) |
| 888 | { |
| 889 | msm_shared_ram_phys = MSM_SHARED_RAM_PHYS; |
| 890 | msm_map_msm8930_io(); |
| 891 | |
| 892 | if (socinfo_init() < 0) |
| 893 | pr_err("socinfo_init() failed!\n"); |
| 894 | } |
| 895 | |
| 896 | static void __init msm8930_init_irq(void) |
| 897 | { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 898 | struct msm_mpm_device_data *data = NULL; |
| 899 | #ifdef CONFIG_MSM_MPM |
| 900 | data = &msm8930_mpm_dev_data; |
| 901 | #endif |
| 902 | |
| 903 | msm_mpm_irq_extn_init(data); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 904 | gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, |
| 905 | (void *)MSM_QGIC_CPU_BASE); |
| 906 | |
| 907 | /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */ |
| 908 | writel_relaxed(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4); |
| 909 | |
| 910 | writel_relaxed(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET); |
| 911 | mb(); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 912 | } |
| 913 | |
| 914 | static void __init msm8930_init_buses(void) |
| 915 | { |
| 916 | #ifdef CONFIG_MSM_BUS_SCALING |
| 917 | msm_bus_rpm_set_mt_mask(); |
| 918 | msm_bus_8960_apps_fabric_pdata.rpm_enabled = 1; |
| 919 | msm_bus_8960_sys_fabric_pdata.rpm_enabled = 1; |
| 920 | msm_bus_8960_mm_fabric_pdata.rpm_enabled = 1; |
| 921 | msm_bus_apps_fabric.dev.platform_data = |
| 922 | &msm_bus_8960_apps_fabric_pdata; |
| 923 | msm_bus_sys_fabric.dev.platform_data = &msm_bus_8960_sys_fabric_pdata; |
| 924 | msm_bus_mm_fabric.dev.platform_data = &msm_bus_8960_mm_fabric_pdata; |
| 925 | msm_bus_sys_fpb.dev.platform_data = &msm_bus_8960_sys_fpb_pdata; |
| 926 | msm_bus_cpss_fpb.dev.platform_data = &msm_bus_8960_cpss_fpb_pdata; |
| 927 | #endif |
| 928 | } |
| 929 | |
| 930 | static struct msm_spi_platform_data msm8960_qup_spi_gsbi1_pdata = { |
| 931 | .max_clock_speed = 15060000, |
| 932 | }; |
| 933 | |
| 934 | #ifdef CONFIG_USB_MSM_OTG_72K |
| 935 | static struct msm_otg_platform_data msm_otg_pdata; |
| 936 | #else |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 937 | static struct msm_otg_platform_data msm_otg_pdata = { |
| 938 | .mode = USB_OTG, |
| 939 | .otg_control = OTG_PMIC_CONTROL, |
| 940 | .phy_type = SNPS_28NM_INTEGRATED_PHY, |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 941 | .pmic_id_irq = PM8038_USB_ID_IN_IRQ(PM8038_IRQ_BASE), |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 942 | .power_budget = 750, |
| 943 | }; |
| 944 | #endif |
| 945 | |
| 946 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
| 947 | #define HSIC_HUB_RESET_GPIO 91 |
| 948 | static struct msm_hsic_host_platform_data msm_hsic_pdata = { |
| 949 | .strobe = 150, |
| 950 | .data = 151, |
| 951 | }; |
| 952 | #else |
| 953 | static struct msm_hsic_host_platform_data msm_hsic_pdata; |
| 954 | #endif |
| 955 | |
| 956 | #define PID_MAGIC_ID 0x71432909 |
| 957 | #define SERIAL_NUM_MAGIC_ID 0x61945374 |
| 958 | #define SERIAL_NUMBER_LENGTH 127 |
| 959 | #define DLOAD_USB_BASE_ADD 0x2A03F0C8 |
| 960 | |
| 961 | struct magic_num_struct { |
| 962 | uint32_t pid; |
| 963 | uint32_t serial_num; |
| 964 | }; |
| 965 | |
| 966 | struct dload_struct { |
| 967 | uint32_t reserved1; |
| 968 | uint32_t reserved2; |
| 969 | uint32_t reserved3; |
| 970 | uint16_t reserved4; |
| 971 | uint16_t pid; |
| 972 | char serial_number[SERIAL_NUMBER_LENGTH]; |
| 973 | uint16_t reserved5; |
| 974 | struct magic_num_struct magic_struct; |
| 975 | }; |
| 976 | |
| 977 | static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum) |
| 978 | { |
| 979 | struct dload_struct __iomem *dload = 0; |
| 980 | |
| 981 | dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload)); |
| 982 | if (!dload) { |
| 983 | pr_err("%s: cannot remap I/O memory region: %08x\n", |
| 984 | __func__, DLOAD_USB_BASE_ADD); |
| 985 | return -ENXIO; |
| 986 | } |
| 987 | |
| 988 | pr_debug("%s: dload:%p pid:%x serial_num:%s\n", |
| 989 | __func__, dload, pid, snum); |
| 990 | /* update pid */ |
| 991 | dload->magic_struct.pid = PID_MAGIC_ID; |
| 992 | dload->pid = pid; |
| 993 | |
| 994 | /* update serial number */ |
| 995 | dload->magic_struct.serial_num = 0; |
| 996 | if (!snum) { |
| 997 | memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH); |
| 998 | goto out; |
| 999 | } |
| 1000 | |
| 1001 | dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID; |
| 1002 | strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH); |
| 1003 | out: |
| 1004 | iounmap(dload); |
| 1005 | return 0; |
| 1006 | } |
| 1007 | |
| 1008 | static struct android_usb_platform_data android_usb_pdata = { |
| 1009 | .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num, |
| 1010 | }; |
| 1011 | |
| 1012 | static struct platform_device android_usb_device = { |
| 1013 | .name = "android_usb", |
| 1014 | .id = -1, |
| 1015 | .dev = { |
| 1016 | .platform_data = &android_usb_pdata, |
| 1017 | }, |
| 1018 | }; |
| 1019 | |
| 1020 | static uint8_t spm_wfi_cmd_sequence[] __initdata = { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1021 | 0x03, 0x0f, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1022 | }; |
| 1023 | |
| 1024 | static uint8_t spm_power_collapse_without_rpm[] __initdata = { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1025 | 0x00, 0x24, 0x54, 0x10, |
| 1026 | 0x09, 0x03, 0x01, |
| 1027 | 0x10, 0x54, 0x30, 0x0C, |
| 1028 | 0x24, 0x30, 0x0f, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1029 | }; |
| 1030 | |
| 1031 | static uint8_t spm_power_collapse_with_rpm[] __initdata = { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1032 | 0x00, 0x24, 0x54, 0x10, |
| 1033 | 0x09, 0x07, 0x01, 0x0B, |
| 1034 | 0x10, 0x54, 0x30, 0x0C, |
| 1035 | 0x24, 0x30, 0x0f, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1036 | }; |
| 1037 | |
| 1038 | static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = { |
| 1039 | [0] = { |
| 1040 | .mode = MSM_SPM_MODE_CLOCK_GATING, |
| 1041 | .notify_rpm = false, |
| 1042 | .cmd = spm_wfi_cmd_sequence, |
| 1043 | }, |
| 1044 | [1] = { |
| 1045 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 1046 | .notify_rpm = false, |
| 1047 | .cmd = spm_power_collapse_without_rpm, |
| 1048 | }, |
| 1049 | [2] = { |
| 1050 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 1051 | .notify_rpm = true, |
| 1052 | .cmd = spm_power_collapse_with_rpm, |
| 1053 | }, |
| 1054 | }; |
| 1055 | |
| 1056 | static struct msm_spm_platform_data msm_spm_data[] __initdata = { |
| 1057 | [0] = { |
| 1058 | .reg_base_addr = MSM_SAW0_BASE, |
| 1059 | .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00, |
| 1060 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F, |
| 1061 | .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0x9C, |
| 1062 | #if defined(CONFIG_MSM_AVS_HW) |
| 1063 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00, |
| 1064 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00, |
| 1065 | #endif |
| 1066 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
| 1067 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202, |
| 1068 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C, |
| 1069 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C, |
| 1070 | .vctl_timeout_us = 50, |
| 1071 | .num_modes = ARRAY_SIZE(msm_spm_seq_list), |
| 1072 | .modes = msm_spm_seq_list, |
| 1073 | }, |
| 1074 | [1] = { |
| 1075 | .reg_base_addr = MSM_SAW1_BASE, |
| 1076 | .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00, |
| 1077 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F, |
| 1078 | .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0x9C, |
| 1079 | #if defined(CONFIG_MSM_AVS_HW) |
| 1080 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00, |
| 1081 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00, |
| 1082 | #endif |
| 1083 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
| 1084 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202, |
| 1085 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C, |
| 1086 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C, |
| 1087 | .vctl_timeout_us = 50, |
| 1088 | .num_modes = ARRAY_SIZE(msm_spm_seq_list), |
| 1089 | .modes = msm_spm_seq_list, |
| 1090 | }, |
| 1091 | }; |
| 1092 | |
| 1093 | static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1094 | 0x00, 0x20, 0x03, 0x20, |
| 1095 | 0x00, 0x0f, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1096 | }; |
| 1097 | |
| 1098 | static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1099 | 0x00, 0x20, 0x34, 0x64, |
| 1100 | 0x48, 0x07, 0x48, 0x20, |
| 1101 | 0x50, 0x64, 0x04, 0x34, |
| 1102 | 0x50, 0x0f, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1103 | }; |
| 1104 | static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1105 | 0x00, 0x10, 0x34, 0x64, |
| 1106 | 0x48, 0x07, 0x48, 0x10, |
| 1107 | 0x50, 0x64, 0x04, 0x34, |
| 1108 | 0x50, 0x0F, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1109 | }; |
| 1110 | |
| 1111 | static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = { |
| 1112 | [0] = { |
| 1113 | .mode = MSM_SPM_L2_MODE_RETENTION, |
| 1114 | .notify_rpm = false, |
| 1115 | .cmd = l2_spm_wfi_cmd_sequence, |
| 1116 | }, |
| 1117 | [1] = { |
| 1118 | .mode = MSM_SPM_L2_MODE_GDHS, |
| 1119 | .notify_rpm = true, |
| 1120 | .cmd = l2_spm_gdhs_cmd_sequence, |
| 1121 | }, |
| 1122 | [2] = { |
| 1123 | .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE, |
| 1124 | .notify_rpm = true, |
| 1125 | .cmd = l2_spm_power_off_cmd_sequence, |
| 1126 | }, |
| 1127 | }; |
| 1128 | |
| 1129 | static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = { |
| 1130 | [0] = { |
| 1131 | .reg_base_addr = MSM_SAW_L2_BASE, |
| 1132 | .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00, |
| 1133 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00, |
| 1134 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202, |
| 1135 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE, |
| 1136 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020, |
| 1137 | .modes = msm_spm_l2_seq_list, |
| 1138 | .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list), |
| 1139 | }, |
| 1140 | }; |
| 1141 | |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 1142 | #/* TODO: Remove this once PM8038 physically becomes |
| 1143 | * available. |
| 1144 | */ |
| 1145 | #ifndef MSM8930_PHASE_2 |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1146 | #define PM_HAP_EN_GPIO PM8921_GPIO_PM_TO_SYS(33) |
| 1147 | #define PM_HAP_LEN_GPIO PM8921_GPIO_PM_TO_SYS(20) |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 1148 | #else |
| 1149 | #define ISA1200_HAP_EN_GPIO 77 |
| 1150 | #define ISA1200_HAP_LEN_GPIO 78 |
| 1151 | #define ISA1200_HAP_CLK PM8038_GPIO_PM_TO_SYS(7) |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 1152 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1153 | |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 1154 | #ifndef MSM8930_PHASE_2 |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1155 | static struct msm_xo_voter *xo_handle_d1; |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 1156 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1157 | |
| 1158 | static int isa1200_power(int on) |
| 1159 | { |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 1160 | #ifndef MSM8930_PHASE_2 |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1161 | int rc = 0; |
| 1162 | |
| 1163 | gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, !!on); |
| 1164 | |
| 1165 | rc = on ? msm_xo_mode_vote(xo_handle_d1, MSM_XO_MODE_ON) : |
| 1166 | msm_xo_mode_vote(xo_handle_d1, MSM_XO_MODE_OFF); |
| 1167 | if (rc < 0) { |
| 1168 | pr_err("%s: failed to %svote for TCXO D1 buffer%d\n", |
| 1169 | __func__, on ? "" : "de-", rc); |
| 1170 | goto err_xo_vote; |
| 1171 | } |
| 1172 | |
| 1173 | return 0; |
| 1174 | |
| 1175 | err_xo_vote: |
| 1176 | gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, !on); |
| 1177 | return rc; |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 1178 | #else |
| 1179 | gpio_set_value_cansleep(ISA1200_HAP_CLK, !!on); |
| 1180 | |
| 1181 | return 0; |
| 1182 | #endif |
| 1183 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1184 | } |
| 1185 | |
| 1186 | static int isa1200_dev_setup(bool enable) |
| 1187 | { |
| 1188 | int rc = 0; |
| 1189 | |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 1190 | #ifndef MSM8930_PHASE_2 |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1191 | struct pm_gpio hap_gpio_config = { |
| 1192 | .direction = PM_GPIO_DIR_OUT, |
| 1193 | .pull = PM_GPIO_PULL_NO, |
| 1194 | .out_strength = PM_GPIO_STRENGTH_HIGH, |
| 1195 | .function = PM_GPIO_FUNC_NORMAL, |
| 1196 | .inv_int_pol = 0, |
| 1197 | .vin_sel = 2, |
| 1198 | .output_buffer = PM_GPIO_OUT_BUF_CMOS, |
| 1199 | .output_value = 0, |
| 1200 | }; |
| 1201 | |
| 1202 | if (enable == true) { |
| 1203 | rc = pm8xxx_gpio_config(PM_HAP_EN_GPIO, &hap_gpio_config); |
| 1204 | if (rc) { |
| 1205 | pr_err("%s: pm8921 gpio %d config failed(%d)\n", |
| 1206 | __func__, PM_HAP_EN_GPIO, rc); |
| 1207 | return rc; |
| 1208 | } |
| 1209 | |
| 1210 | rc = pm8xxx_gpio_config(PM_HAP_LEN_GPIO, &hap_gpio_config); |
| 1211 | if (rc) { |
| 1212 | pr_err("%s: pm8921 gpio %d config failed(%d)\n", |
| 1213 | __func__, PM_HAP_LEN_GPIO, rc); |
| 1214 | return rc; |
| 1215 | } |
| 1216 | |
| 1217 | rc = gpio_request(HAP_SHIFT_LVL_OE_GPIO, "hap_shft_lvl_oe"); |
| 1218 | if (rc) { |
| 1219 | pr_err("%s: unable to request gpio %d (%d)\n", |
| 1220 | __func__, HAP_SHIFT_LVL_OE_GPIO, rc); |
| 1221 | return rc; |
| 1222 | } |
| 1223 | |
| 1224 | rc = gpio_direction_output(HAP_SHIFT_LVL_OE_GPIO, 0); |
| 1225 | if (rc) { |
| 1226 | pr_err("%s: Unable to set direction\n", __func__); |
| 1227 | goto free_gpio; |
| 1228 | } |
| 1229 | |
| 1230 | xo_handle_d1 = msm_xo_get(MSM_XO_TCXO_D1, "isa1200"); |
| 1231 | if (IS_ERR(xo_handle_d1)) { |
| 1232 | rc = PTR_ERR(xo_handle_d1); |
| 1233 | pr_err("%s: failed to get the handle for D1(%d)\n", |
| 1234 | __func__, rc); |
| 1235 | goto gpio_set_dir; |
| 1236 | } |
| 1237 | } else { |
| 1238 | gpio_free(HAP_SHIFT_LVL_OE_GPIO); |
| 1239 | |
| 1240 | msm_xo_put(xo_handle_d1); |
| 1241 | } |
| 1242 | |
| 1243 | return 0; |
| 1244 | |
| 1245 | gpio_set_dir: |
| 1246 | gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, 0); |
| 1247 | free_gpio: |
| 1248 | gpio_free(HAP_SHIFT_LVL_OE_GPIO); |
| 1249 | return rc; |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 1250 | #else |
| 1251 | struct pm_gpio hap_clk_gpio_config = { |
| 1252 | .direction = PM_GPIO_DIR_OUT, |
| 1253 | .pull = PM_GPIO_PULL_NO, |
| 1254 | .out_strength = PM_GPIO_STRENGTH_HIGH, |
| 1255 | .function = PM_GPIO_FUNC_1, |
| 1256 | .inv_int_pol = 0, |
| 1257 | .vin_sel = PM_GPIO_VIN_S4, |
| 1258 | .output_buffer = PM_GPIO_OUT_BUF_CMOS, |
| 1259 | .output_value = 0, |
| 1260 | }; |
| 1261 | |
| 1262 | rc = pm8xxx_gpio_config(ISA1200_HAP_CLK, &hap_clk_gpio_config); |
| 1263 | if (rc) { |
| 1264 | pr_err("%s: pm8038 gpio %d config failed(%d)\n", |
| 1265 | __func__, ISA1200_HAP_CLK, rc); |
| 1266 | return rc; |
| 1267 | } |
| 1268 | |
| 1269 | rc = gpio_request(ISA1200_HAP_CLK, "haptics_clk"); |
| 1270 | if (rc) { |
| 1271 | pr_err("%s: gpio_request for %d gpio failed rc(%d)\n", |
| 1272 | __func__, ISA1200_HAP_CLK, rc); |
| 1273 | goto fail_gpio_req; |
| 1274 | } |
| 1275 | |
| 1276 | rc = gpio_direction_output(ISA1200_HAP_CLK, 0); |
| 1277 | if (rc) { |
| 1278 | pr_err("%s: gpio_direction_output failed for %d gpio rc(%d)\n", |
| 1279 | __func__, ISA1200_HAP_CLK, rc); |
| 1280 | goto fail_gpio_dir; |
| 1281 | } |
| 1282 | |
| 1283 | return 0; |
| 1284 | |
| 1285 | fail_gpio_dir: |
| 1286 | gpio_free(ISA1200_HAP_CLK); |
| 1287 | fail_gpio_req: |
| 1288 | return rc; |
| 1289 | |
| 1290 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1291 | } |
| 1292 | |
| 1293 | static struct isa1200_regulator isa1200_reg_data[] = { |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 1294 | #ifndef MSM8930_PHASE_2 |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1295 | { |
| 1296 | .name = "vcc_i2c", |
| 1297 | .min_uV = ISA_I2C_VTG_MIN_UV, |
| 1298 | .max_uV = ISA_I2C_VTG_MAX_UV, |
| 1299 | .load_uA = ISA_I2C_CURR_UA, |
| 1300 | }, |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 1301 | #else |
| 1302 | { |
| 1303 | .name = "vddp", |
| 1304 | .min_uV = ISA_I2C_VTG_MIN_UV, |
| 1305 | .max_uV = ISA_I2C_VTG_MAX_UV, |
| 1306 | .load_uA = ISA_I2C_CURR_UA, |
| 1307 | }, |
| 1308 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1309 | }; |
| 1310 | |
| 1311 | static struct isa1200_platform_data isa1200_1_pdata = { |
| 1312 | .name = "vibrator", |
| 1313 | .dev_setup = isa1200_dev_setup, |
| 1314 | .power_on = isa1200_power, |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 1315 | #ifndef MSM8930_PHASE_2 |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1316 | .hap_en_gpio = PM_HAP_EN_GPIO, |
| 1317 | .hap_len_gpio = PM_HAP_LEN_GPIO, |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 1318 | #else |
| 1319 | .hap_en_gpio = ISA1200_HAP_EN_GPIO, |
| 1320 | .hap_len_gpio = ISA1200_HAP_LEN_GPIO, |
| 1321 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1322 | .max_timeout = 15000, |
| 1323 | .mode_ctrl = PWM_GEN_MODE, |
| 1324 | .pwm_fd = { |
| 1325 | .pwm_div = 256, |
| 1326 | }, |
| 1327 | .is_erm = false, |
| 1328 | .smart_en = true, |
| 1329 | .ext_clk_en = true, |
| 1330 | .chip_en = 1, |
| 1331 | .regulator_info = isa1200_reg_data, |
| 1332 | .num_regulators = ARRAY_SIZE(isa1200_reg_data), |
| 1333 | }; |
| 1334 | |
| 1335 | static struct i2c_board_info msm_isa1200_board_info[] __initdata = { |
| 1336 | { |
| 1337 | I2C_BOARD_INFO("isa1200_1", 0x90>>1), |
| 1338 | .platform_data = &isa1200_1_pdata, |
| 1339 | }, |
| 1340 | }; |
| 1341 | |
| 1342 | #define CYTTSP_TS_GPIO_IRQ 11 |
| 1343 | #define CYTTSP_TS_SLEEP_GPIO 50 |
| 1344 | #define CYTTSP_TS_RESOUT_N_GPIO 52 |
| 1345 | |
| 1346 | /*virtual key support */ |
| 1347 | static ssize_t tma340_vkeys_show(struct kobject *kobj, |
| 1348 | struct kobj_attribute *attr, char *buf) |
| 1349 | { |
| 1350 | return snprintf(buf, 200, |
| 1351 | __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97" |
| 1352 | ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97" |
| 1353 | ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97" |
| 1354 | ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97" |
| 1355 | "\n"); |
| 1356 | } |
| 1357 | |
| 1358 | static struct kobj_attribute tma340_vkeys_attr = { |
| 1359 | .attr = { |
| 1360 | .mode = S_IRUGO, |
| 1361 | }, |
| 1362 | .show = &tma340_vkeys_show, |
| 1363 | }; |
| 1364 | |
| 1365 | static struct attribute *tma340_properties_attrs[] = { |
| 1366 | &tma340_vkeys_attr.attr, |
| 1367 | NULL |
| 1368 | }; |
| 1369 | |
| 1370 | static struct attribute_group tma340_properties_attr_group = { |
| 1371 | .attrs = tma340_properties_attrs, |
| 1372 | }; |
| 1373 | |
| 1374 | |
| 1375 | static int cyttsp_platform_init(struct i2c_client *client) |
| 1376 | { |
| 1377 | int rc = 0; |
| 1378 | static struct kobject *tma340_properties_kobj; |
| 1379 | |
| 1380 | tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c"; |
| 1381 | tma340_properties_kobj = kobject_create_and_add("board_properties", |
| 1382 | NULL); |
| 1383 | if (tma340_properties_kobj) |
| 1384 | rc = sysfs_create_group(tma340_properties_kobj, |
| 1385 | &tma340_properties_attr_group); |
| 1386 | if (!tma340_properties_kobj || rc) |
| 1387 | pr_err("%s: failed to create board_properties\n", |
| 1388 | __func__); |
| 1389 | |
| 1390 | return 0; |
| 1391 | } |
| 1392 | |
| 1393 | static struct cyttsp_regulator regulator_data[] = { |
| 1394 | { |
| 1395 | .name = "vdd", |
| 1396 | .min_uV = CY_TMA300_VTG_MIN_UV, |
| 1397 | .max_uV = CY_TMA300_VTG_MAX_UV, |
| 1398 | .hpm_load_uA = CY_TMA300_CURR_24HZ_UA, |
| 1399 | .lpm_load_uA = CY_TMA300_SLEEP_CURR_UA, |
| 1400 | }, |
| 1401 | /* TODO: Remove after runtime PM is enabled in I2C driver */ |
| 1402 | { |
| 1403 | .name = "vcc_i2c", |
| 1404 | .min_uV = CY_I2C_VTG_MIN_UV, |
| 1405 | .max_uV = CY_I2C_VTG_MAX_UV, |
| 1406 | .hpm_load_uA = CY_I2C_CURR_UA, |
| 1407 | .lpm_load_uA = CY_I2C_SLEEP_CURR_UA, |
| 1408 | }, |
| 1409 | }; |
| 1410 | |
| 1411 | static struct cyttsp_platform_data cyttsp_pdata = { |
| 1412 | .panel_maxx = 634, |
| 1413 | .panel_maxy = 1166, |
| 1414 | .disp_maxx = 616, |
| 1415 | .disp_maxy = 1023, |
| 1416 | .disp_minx = 0, |
| 1417 | .disp_miny = 16, |
| 1418 | .flags = 0x01, |
| 1419 | .gen = CY_GEN3, /* or */ |
| 1420 | .use_st = CY_USE_ST, |
| 1421 | .use_mt = CY_USE_MT, |
| 1422 | .use_hndshk = CY_SEND_HNDSHK, |
| 1423 | .use_trk_id = CY_USE_TRACKING_ID, |
| 1424 | .use_sleep = CY_USE_DEEP_SLEEP_SEL | CY_USE_LOW_POWER_SEL, |
| 1425 | .use_gestures = CY_USE_GESTURES, |
| 1426 | .fw_fname = "cyttsp_8960_cdp.hex", |
| 1427 | /* activate up to 4 groups |
| 1428 | * and set active distance |
| 1429 | */ |
| 1430 | .gest_set = CY_GEST_GRP1 | CY_GEST_GRP2 | |
| 1431 | CY_GEST_GRP3 | CY_GEST_GRP4 | |
| 1432 | CY_ACT_DIST, |
| 1433 | /* change act_intrvl to customize the Active power state |
| 1434 | * scanning/processing refresh interval for Operating mode |
| 1435 | */ |
| 1436 | .act_intrvl = CY_ACT_INTRVL_DFLT, |
| 1437 | /* change tch_tmout to customize the touch timeout for the |
| 1438 | * Active power state for Operating mode |
| 1439 | */ |
| 1440 | .tch_tmout = CY_TCH_TMOUT_DFLT, |
| 1441 | /* change lp_intrvl to customize the Low Power power state |
| 1442 | * scanning/processing refresh interval for Operating mode |
| 1443 | */ |
| 1444 | .lp_intrvl = CY_LP_INTRVL_DFLT, |
| 1445 | .sleep_gpio = CYTTSP_TS_SLEEP_GPIO, |
| 1446 | .resout_gpio = CYTTSP_TS_RESOUT_N_GPIO, |
| 1447 | .irq_gpio = CYTTSP_TS_GPIO_IRQ, |
| 1448 | .regulator_info = regulator_data, |
| 1449 | .num_regulators = ARRAY_SIZE(regulator_data), |
| 1450 | .init = cyttsp_platform_init, |
| 1451 | .correct_fw_ver = 9, |
| 1452 | }; |
| 1453 | |
| 1454 | static struct i2c_board_info cyttsp_info[] __initdata = { |
| 1455 | { |
| 1456 | I2C_BOARD_INFO(CY_I2C_NAME, 0x24), |
| 1457 | .platform_data = &cyttsp_pdata, |
| 1458 | #ifndef CY_USE_TIMER |
| 1459 | .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ), |
| 1460 | #endif /* CY_USE_TIMER */ |
| 1461 | }, |
| 1462 | }; |
| 1463 | |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1464 | #define MXT_TS_GPIO_IRQ 11 |
| 1465 | #define MXT_TS_RESET_GPIO 52 |
| 1466 | |
| 1467 | static const u8 mxt_config_data_8930[] = { |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1468 | /* T6 Object */ |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1469 | 0, 0, 0, 0, 0, 0, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1470 | /* T38 Object */ |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1471 | 15, 1, 0, 15, 12, 11, 0, 0, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1472 | /* T7 Object */ |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1473 | 48, 255, 25, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1474 | /* T8 Object */ |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1475 | 27, 0, 5, 1, 0, 0, 8, 8, 0, 0, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1476 | /* T9 Object */ |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1477 | 131, 0, 0, 19, 11, 0, 16, 35, 1, 3, |
| 1478 | 10, 15, 1, 11, 4, 5, 40, 10, 54, 2, |
| 1479 | 43, 4, 0, 0, 0, 0, 143, 40, 143, 80, |
| 1480 | 18, 15, 50, 50, 2, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1481 | /* T15 Object */ |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1482 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1483 | 0, |
| 1484 | /* T18 Object */ |
| 1485 | 0, 0, |
| 1486 | /* T19 Object */ |
| 1487 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1488 | 0, 0, 0, 0, 0, 0, |
| 1489 | /* T23 Object */ |
| 1490 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1491 | 0, 0, 0, 0, 0, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1492 | /* T25 Object */ |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1493 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1494 | 0, 0, 0, 0, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1495 | /* T40 Object */ |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1496 | 0, 0, 0, 0, 0, |
| 1497 | /* T42 Object */ |
| 1498 | 0, 0, 0, 0, 0, 0, 0, 0, |
| 1499 | /* T46 Object */ |
| 1500 | 0, 3, 16, 48, 0, 0, 1, 0, 0, |
| 1501 | /* T47 Object */ |
| 1502 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1503 | /* T48 Object */ |
| 1504 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1505 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1506 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1507 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1508 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1509 | 0, 0, 0, 0, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1510 | }; |
| 1511 | |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1512 | static ssize_t mxt224e_vkeys_show(struct kobject *kobj, |
| 1513 | struct kobj_attribute *attr, char *buf) |
| 1514 | { |
| 1515 | return snprintf(buf, 200, |
| 1516 | __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":65:938:90:90" |
| 1517 | ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":208:938:90:90" |
| 1518 | ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":348:938:90:90" |
| 1519 | ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":490:938:90:90" |
| 1520 | "\n"); |
| 1521 | } |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1522 | |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1523 | static struct kobj_attribute mxt224e_vkeys_attr = { |
| 1524 | .attr = { |
| 1525 | .mode = S_IRUGO, |
| 1526 | }, |
| 1527 | .show = &mxt224e_vkeys_show, |
| 1528 | }; |
| 1529 | |
| 1530 | static struct attribute *mxt224e_properties_attrs[] = { |
| 1531 | &mxt224e_vkeys_attr.attr, |
| 1532 | NULL |
| 1533 | }; |
| 1534 | |
| 1535 | static struct attribute_group mxt224e_properties_attr_group = { |
| 1536 | .attrs = mxt224e_properties_attrs, |
| 1537 | }; |
| 1538 | |
| 1539 | static void mxt_init_vkeys_8930(void) |
| 1540 | { |
| 1541 | int rc; |
| 1542 | static struct kobject *mxt224e_properties_kobj; |
| 1543 | |
| 1544 | mxt224e_vkeys_attr.attr.name = "virtualkeys.atmel_mxt_ts"; |
| 1545 | mxt224e_properties_kobj = kobject_create_and_add("board_properties", |
| 1546 | NULL); |
| 1547 | if (mxt224e_properties_kobj) |
| 1548 | rc = sysfs_create_group(mxt224e_properties_kobj, |
| 1549 | &mxt224e_properties_attr_group); |
| 1550 | if (!mxt224e_properties_kobj || rc) |
| 1551 | pr_err("%s: failed to create board_properties\n", |
| 1552 | __func__); |
| 1553 | |
| 1554 | return; |
| 1555 | } |
| 1556 | |
| 1557 | static struct mxt_platform_data mxt_platform_data_8930 = { |
| 1558 | .config = mxt_config_data_8930, |
| 1559 | .config_length = ARRAY_SIZE(mxt_config_data_8930), |
| 1560 | .x_size = 1067, |
| 1561 | .y_size = 566, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1562 | .irqflags = IRQF_TRIGGER_FALLING, |
Anirudh Ghayal | d7ad84c | 2012-01-09 09:17:53 +0530 | [diff] [blame] | 1563 | #ifdef MSM8930_PHASE_2 |
| 1564 | .digital_pwr_regulator = true, |
| 1565 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1566 | .i2c_pull_up = true, |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1567 | .reset_gpio = MXT_TS_RESET_GPIO, |
| 1568 | .irq_gpio = MXT_TS_GPIO_IRQ, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1569 | }; |
| 1570 | |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1571 | static struct i2c_board_info mxt_device_info_8930[] __initdata = { |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1572 | { |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1573 | I2C_BOARD_INFO("atmel_mxt_ts", 0x4a), |
| 1574 | .platform_data = &mxt_platform_data_8930, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1575 | .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ), |
| 1576 | }, |
| 1577 | }; |
| 1578 | |
Anirudh Ghayal | eb3af97 | 2011-12-13 17:29:06 +0530 | [diff] [blame] | 1579 | #ifdef MSM8930_PHASE_2 |
| 1580 | |
| 1581 | #define GPIO_VOLUME_UP PM8038_GPIO_PM_TO_SYS(3) |
| 1582 | #define GPIO_VOLUME_DOWN PM8038_GPIO_PM_TO_SYS(8) |
| 1583 | #define GPIO_CAMERA_SNAPSHOT PM8038_GPIO_PM_TO_SYS(10) |
| 1584 | #define GPIO_CAMERA_FOCUS PM8038_GPIO_PM_TO_SYS(11) |
| 1585 | |
| 1586 | static struct gpio_keys_button keys_8930[] = { |
| 1587 | { |
| 1588 | .code = KEY_VOLUMEUP, |
| 1589 | .type = EV_KEY, |
| 1590 | .desc = "volume_up", |
| 1591 | .gpio = GPIO_VOLUME_UP, |
| 1592 | .wakeup = 1, |
| 1593 | .active_low = 1, |
| 1594 | }, |
| 1595 | { |
| 1596 | .code = KEY_VOLUMEDOWN, |
| 1597 | .type = EV_KEY, |
| 1598 | .desc = "volume_down", |
| 1599 | .gpio = GPIO_VOLUME_DOWN, |
| 1600 | .wakeup = 1, |
| 1601 | .active_low = 1, |
| 1602 | }, |
| 1603 | { |
| 1604 | .code = KEY_CAMERA_FOCUS, |
| 1605 | .type = EV_KEY, |
| 1606 | .desc = "camera_focus", |
| 1607 | .gpio = GPIO_CAMERA_FOCUS, |
| 1608 | .wakeup = 1, |
| 1609 | .active_low = 1, |
| 1610 | }, |
| 1611 | { |
| 1612 | .code = KEY_CAMERA_SNAPSHOT, |
| 1613 | .type = EV_KEY, |
| 1614 | .desc = "camera_snapshot", |
| 1615 | .gpio = GPIO_CAMERA_SNAPSHOT, |
| 1616 | .wakeup = 1, |
| 1617 | .active_low = 1, |
| 1618 | }, |
| 1619 | }; |
| 1620 | |
| 1621 | /* Add GPIO keys for 8930 */ |
| 1622 | static struct gpio_keys_platform_data gpio_keys_8930_pdata = { |
| 1623 | .buttons = keys_8930, |
| 1624 | .nbuttons = 4, |
| 1625 | }; |
| 1626 | |
| 1627 | static struct platform_device gpio_keys_8930 = { |
| 1628 | .name = "gpio-keys", |
| 1629 | .id = -1, |
| 1630 | .dev = { |
| 1631 | .platform_data = &gpio_keys_8930_pdata, |
| 1632 | }, |
| 1633 | }; |
| 1634 | #endif /* MSM8930_PHASE_2 */ |
| 1635 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1636 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi4_pdata = { |
| 1637 | .clk_freq = 100000, |
| 1638 | .src_clk_rate = 24000000, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1639 | }; |
| 1640 | |
| 1641 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi3_pdata = { |
| 1642 | .clk_freq = 100000, |
| 1643 | .src_clk_rate = 24000000, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1644 | }; |
| 1645 | |
| 1646 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi10_pdata = { |
| 1647 | .clk_freq = 100000, |
| 1648 | .src_clk_rate = 24000000, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1649 | }; |
| 1650 | |
| 1651 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi12_pdata = { |
| 1652 | .clk_freq = 100000, |
| 1653 | .src_clk_rate = 24000000, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1654 | }; |
| 1655 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1656 | |
| 1657 | static struct ks8851_pdata spi_eth_pdata = { |
| 1658 | .irq_gpio = KS8851_IRQ_GPIO, |
| 1659 | .rst_gpio = KS8851_RST_GPIO, |
| 1660 | }; |
| 1661 | |
| 1662 | static struct spi_board_info spi_board_info[] __initdata = { |
| 1663 | { |
| 1664 | .modalias = "ks8851", |
| 1665 | .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO), |
| 1666 | .max_speed_hz = 19200000, |
| 1667 | .bus_num = 0, |
| 1668 | .chip_select = 0, |
| 1669 | .mode = SPI_MODE_0, |
| 1670 | .platform_data = &spi_eth_pdata |
| 1671 | }, |
| 1672 | { |
| 1673 | .modalias = "dsi_novatek_3d_panel_spi", |
| 1674 | .max_speed_hz = 10800000, |
| 1675 | .bus_num = 0, |
| 1676 | .chip_select = 1, |
| 1677 | .mode = SPI_MODE_0, |
| 1678 | }, |
| 1679 | }; |
| 1680 | |
| 1681 | static struct platform_device msm_device_saw_core0 = { |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 1682 | .name = "saw-regulator", |
| 1683 | .id = 0, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1684 | .dev = { |
David Collins | b455842 | 2012-01-05 10:50:49 -0800 | [diff] [blame] | 1685 | .platform_data = &msm8930_saw_regulator_core0_pdata, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1686 | }, |
| 1687 | }; |
| 1688 | |
| 1689 | static struct platform_device msm_device_saw_core1 = { |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 1690 | .name = "saw-regulator", |
| 1691 | .id = 1, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1692 | .dev = { |
David Collins | b455842 | 2012-01-05 10:50:49 -0800 | [diff] [blame] | 1693 | .platform_data = &msm8930_saw_regulator_core1_pdata, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1694 | }, |
| 1695 | }; |
| 1696 | |
| 1697 | static struct tsens_platform_data msm_tsens_pdata = { |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 1698 | .slope = 910, |
| 1699 | .tsens_factor = 1000, |
| 1700 | .hw_type = MSM_8960, |
| 1701 | .tsens_num_sensor = 5, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1702 | }; |
| 1703 | |
| 1704 | static struct platform_device msm_tsens_device = { |
| 1705 | .name = "tsens8960-tm", |
| 1706 | .id = -1, |
| 1707 | .dev = { |
| 1708 | .platform_data = &msm_tsens_pdata, |
| 1709 | }, |
| 1710 | }; |
| 1711 | |
| 1712 | #ifdef CONFIG_MSM_FAKE_BATTERY |
| 1713 | static struct platform_device fish_battery_device = { |
| 1714 | .name = "fish_battery", |
| 1715 | }; |
| 1716 | #endif |
| 1717 | |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 1718 | #ifndef MSM8930_PHASE_2 |
| 1719 | |
| 1720 | /* 8930 Phase 1 */ |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 1721 | static struct platform_device msm8930_device_ext_5v_vreg __devinitdata = { |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1722 | .name = GPIO_REGULATOR_DEV_NAME, |
| 1723 | .id = PM8921_MPP_PM_TO_SYS(7), |
| 1724 | .dev = { |
| 1725 | .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V], |
| 1726 | }, |
| 1727 | }; |
| 1728 | |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 1729 | static struct platform_device msm8930_device_ext_l2_vreg __devinitdata = { |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1730 | .name = GPIO_REGULATOR_DEV_NAME, |
| 1731 | .id = 91, |
| 1732 | .dev = { |
| 1733 | .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_L2], |
| 1734 | }, |
| 1735 | }; |
| 1736 | |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 1737 | #else |
| 1738 | |
| 1739 | /* 8930 Phase 2 */ |
| 1740 | static struct platform_device msm8930_device_ext_5v_vreg __devinitdata = { |
| 1741 | .name = GPIO_REGULATOR_DEV_NAME, |
| 1742 | .id = 63, |
| 1743 | .dev = { |
| 1744 | .platform_data = |
| 1745 | &msm8930_gpio_regulator_pdata[MSM8930_GPIO_VREG_ID_EXT_5V], |
| 1746 | }, |
| 1747 | }; |
| 1748 | |
| 1749 | static struct platform_device msm8930_device_ext_otg_sw_vreg __devinitdata = { |
| 1750 | .name = GPIO_REGULATOR_DEV_NAME, |
| 1751 | .id = 97, |
| 1752 | .dev = { |
| 1753 | .platform_data = |
| 1754 | &msm8930_gpio_regulator_pdata[MSM8930_GPIO_VREG_ID_EXT_OTG_SW], |
| 1755 | }, |
| 1756 | }; |
| 1757 | |
| 1758 | #endif |
| 1759 | |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 1760 | static struct platform_device msm8930_device_rpm_regulator __devinitdata = { |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1761 | .name = "rpm-regulator", |
| 1762 | .id = -1, |
| 1763 | .dev = { |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame^] | 1764 | #ifndef MSM8930_PHASE_2 |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1765 | .platform_data = &msm_rpm_regulator_pdata, |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame^] | 1766 | #else |
| 1767 | .platform_data = &msm8930_rpm_regulator_pdata, |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 1768 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1769 | }, |
| 1770 | }; |
| 1771 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1772 | static struct platform_device *common_devices[] __initdata = { |
| 1773 | &msm8960_device_dmov, |
| 1774 | &msm_device_smd, |
| 1775 | &msm8960_device_uart_gsbi5, |
| 1776 | &msm_device_uart_dm6, |
| 1777 | &msm_device_saw_core0, |
| 1778 | &msm_device_saw_core1, |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 1779 | &msm8930_device_ext_5v_vreg, |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 1780 | #ifndef MSM8930_PHASE_2 |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 1781 | &msm8930_device_ext_l2_vreg, |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 1782 | #endif |
Jay Chokshi | 33c044a | 2011-12-07 13:05:40 -0800 | [diff] [blame] | 1783 | &msm8960_device_ssbi_pmic, |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 1784 | #ifdef MSM8930_PHASE_2 |
| 1785 | &msm8930_device_ext_otg_sw_vreg, |
| 1786 | #endif |
Stephen Boyd | 28d5495 | 2011-12-16 13:19:51 -0800 | [diff] [blame] | 1787 | &msm_8960_q6_lpass, |
| 1788 | &msm_8960_q6_mss_fw, |
| 1789 | &msm_8960_q6_mss_sw, |
Stephen Boyd | 322a992 | 2011-09-20 01:05:54 -0700 | [diff] [blame] | 1790 | &msm_8960_riva, |
Stephen Boyd | d89eebe | 2011-09-28 23:28:11 -0700 | [diff] [blame] | 1791 | &msm_pil_tzapps, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1792 | &msm8960_device_qup_spi_gsbi1, |
| 1793 | &msm8960_device_qup_i2c_gsbi3, |
| 1794 | &msm8960_device_qup_i2c_gsbi4, |
| 1795 | &msm8960_device_qup_i2c_gsbi10, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1796 | &msm8960_device_qup_i2c_gsbi12, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1797 | &msm_slim_ctrl, |
| 1798 | &msm_device_wcnss_wlan, |
| 1799 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 1800 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 1801 | &qcrypto_device, |
| 1802 | #endif |
| 1803 | |
| 1804 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 1805 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 1806 | &qcedev_device, |
| 1807 | #endif |
| 1808 | #ifdef CONFIG_MSM_ROTATOR |
| 1809 | &msm_rotator_device, |
| 1810 | #endif |
| 1811 | &msm_device_sps, |
| 1812 | #ifdef CONFIG_MSM_FAKE_BATTERY |
| 1813 | &fish_battery_device, |
| 1814 | #endif |
| 1815 | #ifdef CONFIG_ANDROID_PMEM |
| 1816 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 1817 | &android_pmem_device, |
| 1818 | &android_pmem_adsp_device, |
| 1819 | #endif |
| 1820 | &android_pmem_audio_device, |
| 1821 | #endif |
| 1822 | &msm_device_vidc, |
| 1823 | &msm_device_bam_dmux, |
| 1824 | &msm_fm_platform_init, |
| 1825 | |
| 1826 | #ifdef CONFIG_HW_RANDOM_MSM |
| 1827 | &msm_device_rng, |
| 1828 | #endif |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1829 | &msm8930_rpm_device, |
| 1830 | &msm8930_rpm_log_device, |
| 1831 | &msm8930_rpm_stat_device, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1832 | #ifdef CONFIG_ION_MSM |
| 1833 | &ion_dev, |
| 1834 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1835 | &msm_device_tz_log, |
| 1836 | |
| 1837 | #ifdef CONFIG_MSM_QDSS |
| 1838 | &msm_etb_device, |
| 1839 | &msm_tpiu_device, |
| 1840 | &msm_funnel_device, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1841 | &msm_ptm_device, |
| 1842 | #endif |
| 1843 | &msm_device_dspcrashd_8960, |
| 1844 | &msm8960_device_watchdog, |
Anirudh Ghayal | eb3af97 | 2011-12-13 17:29:06 +0530 | [diff] [blame] | 1845 | #ifdef MSM8930_PHASE_2 |
| 1846 | &gpio_keys_8930, |
| 1847 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1848 | }; |
| 1849 | |
| 1850 | static struct platform_device *cdp_devices[] __initdata = { |
| 1851 | &msm8960_device_otg, |
| 1852 | &msm8960_device_gadget_peripheral, |
| 1853 | &msm_device_hsusb_host, |
| 1854 | &android_usb_device, |
| 1855 | &msm_pcm, |
| 1856 | &msm_pcm_routing, |
| 1857 | &msm_cpudai0, |
| 1858 | &msm_cpudai1, |
| 1859 | &msm_cpudai_hdmi_rx, |
| 1860 | &msm_cpudai_bt_rx, |
| 1861 | &msm_cpudai_bt_tx, |
| 1862 | &msm_cpudai_fm_rx, |
| 1863 | &msm_cpudai_fm_tx, |
| 1864 | &msm_cpudai_auxpcm_rx, |
| 1865 | &msm_cpudai_auxpcm_tx, |
| 1866 | &msm_cpu_fe, |
| 1867 | &msm_stub_codec, |
| 1868 | &msm_kgsl_3d0, |
| 1869 | #ifdef CONFIG_MSM_KGSL_2D |
| 1870 | &msm_kgsl_2d0, |
| 1871 | &msm_kgsl_2d1, |
| 1872 | #endif |
| 1873 | #ifdef CONFIG_MSM_GEMINI |
| 1874 | &msm8960_gemini_device, |
| 1875 | #endif |
| 1876 | &msm_voice, |
| 1877 | &msm_voip, |
| 1878 | &msm_lpa_pcm, |
| 1879 | &msm_cpudai_afe_01_rx, |
| 1880 | &msm_cpudai_afe_01_tx, |
| 1881 | &msm_cpudai_afe_02_rx, |
| 1882 | &msm_cpudai_afe_02_tx, |
| 1883 | &msm_pcm_afe, |
Ajay Dudani | 79e268c | 2011-12-28 13:14:44 -0800 | [diff] [blame] | 1884 | &msm_compr_dsp, |
| 1885 | &msm_cpudai_incall_music_rx, |
| 1886 | &msm_cpudai_incall_record_rx, |
| 1887 | &msm_cpudai_incall_record_tx, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1888 | &msm_pcm_hostless, |
| 1889 | &msm_bus_apps_fabric, |
| 1890 | &msm_bus_sys_fabric, |
| 1891 | &msm_bus_mm_fabric, |
| 1892 | &msm_bus_sys_fpb, |
| 1893 | &msm_bus_cpss_fpb, |
| 1894 | &msm_tsens_device, |
| 1895 | }; |
| 1896 | |
| 1897 | static void __init msm8930_i2c_init(void) |
| 1898 | { |
| 1899 | msm8960_device_qup_i2c_gsbi4.dev.platform_data = |
| 1900 | &msm8960_i2c_qup_gsbi4_pdata; |
| 1901 | |
| 1902 | msm8960_device_qup_i2c_gsbi3.dev.platform_data = |
| 1903 | &msm8960_i2c_qup_gsbi3_pdata; |
| 1904 | |
| 1905 | msm8960_device_qup_i2c_gsbi10.dev.platform_data = |
| 1906 | &msm8960_i2c_qup_gsbi10_pdata; |
| 1907 | |
| 1908 | msm8960_device_qup_i2c_gsbi12.dev.platform_data = |
| 1909 | &msm8960_i2c_qup_gsbi12_pdata; |
| 1910 | } |
| 1911 | |
| 1912 | static void __init msm8930_gfx_init(void) |
| 1913 | { |
| 1914 | uint32_t soc_platform_version = socinfo_get_version(); |
| 1915 | if (SOCINFO_VERSION_MAJOR(soc_platform_version) == 1) { |
| 1916 | struct kgsl_device_platform_data *kgsl_3d0_pdata = |
| 1917 | msm_kgsl_3d0.dev.platform_data; |
| 1918 | kgsl_3d0_pdata->pwrlevel[0].gpu_freq = 320000000; |
| 1919 | kgsl_3d0_pdata->pwrlevel[1].gpu_freq = 266667000; |
| 1920 | } |
| 1921 | } |
| 1922 | |
| 1923 | static struct msm_cpuidle_state msm_cstates[] __initdata = { |
| 1924 | {0, 0, "C0", "WFI", |
| 1925 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT}, |
| 1926 | |
| 1927 | {0, 1, "C1", "STANDALONE_POWER_COLLAPSE", |
| 1928 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE}, |
| 1929 | |
| 1930 | {0, 2, "C2", "POWER_COLLAPSE", |
| 1931 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE}, |
| 1932 | |
| 1933 | {1, 0, "C0", "WFI", |
| 1934 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT}, |
| 1935 | |
| 1936 | {1, 1, "C1", "STANDALONE_POWER_COLLAPSE", |
| 1937 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE}, |
| 1938 | }; |
| 1939 | |
| 1940 | static struct msm_pm_platform_data msm_pm_data[MSM_PM_SLEEP_MODE_NR * 2] = { |
| 1941 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = { |
| 1942 | .idle_supported = 1, |
| 1943 | .suspend_supported = 1, |
| 1944 | .idle_enabled = 0, |
| 1945 | .suspend_enabled = 0, |
| 1946 | }, |
| 1947 | |
| 1948 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = { |
| 1949 | .idle_supported = 1, |
| 1950 | .suspend_supported = 1, |
| 1951 | .idle_enabled = 0, |
| 1952 | .suspend_enabled = 0, |
| 1953 | }, |
| 1954 | |
| 1955 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = { |
| 1956 | .idle_supported = 1, |
| 1957 | .suspend_supported = 1, |
| 1958 | .idle_enabled = 1, |
| 1959 | .suspend_enabled = 1, |
| 1960 | }, |
| 1961 | |
| 1962 | [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = { |
| 1963 | .idle_supported = 0, |
| 1964 | .suspend_supported = 1, |
| 1965 | .idle_enabled = 0, |
| 1966 | .suspend_enabled = 0, |
| 1967 | }, |
| 1968 | |
| 1969 | [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = { |
| 1970 | .idle_supported = 1, |
| 1971 | .suspend_supported = 1, |
| 1972 | .idle_enabled = 0, |
| 1973 | .suspend_enabled = 0, |
| 1974 | }, |
| 1975 | |
| 1976 | [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = { |
| 1977 | .idle_supported = 1, |
| 1978 | .suspend_supported = 0, |
| 1979 | .idle_enabled = 1, |
| 1980 | .suspend_enabled = 0, |
| 1981 | }, |
| 1982 | }; |
| 1983 | |
| 1984 | static struct msm_rpmrs_level msm_rpmrs_levels[] __initdata = { |
| 1985 | { |
| 1986 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT, |
| 1987 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 1988 | true, |
| 1989 | 100, 8000, 100000, 1, |
| 1990 | }, |
| 1991 | |
| 1992 | { |
| 1993 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE, |
| 1994 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 1995 | true, |
| 1996 | 2000, 6000, 60100000, 3000, |
| 1997 | }, |
| 1998 | |
| 1999 | { |
| 2000 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2001 | MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE), |
| 2002 | false, |
| 2003 | 4200, 5000, 60350000, 3500, |
| 2004 | }, |
| 2005 | |
| 2006 | { |
| 2007 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2008 | MSM_RPMRS_LIMITS(ON, HSFS_OPEN, MAX, ACTIVE), |
| 2009 | false, |
| 2010 | 6300, 4500, 65350000, 4800, |
| 2011 | }, |
| 2012 | { |
| 2013 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2014 | MSM_RPMRS_LIMITS(ON, HSFS_OPEN, ACTIVE, RET_HIGH), |
| 2015 | false, |
| 2016 | 7000, 3500, 66600000, 5150, |
| 2017 | }, |
| 2018 | |
| 2019 | { |
| 2020 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2021 | MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE), |
| 2022 | false, |
| 2023 | 11700, 2500, 67850000, 5500, |
| 2024 | }, |
| 2025 | |
| 2026 | { |
| 2027 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2028 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE), |
| 2029 | false, |
| 2030 | 13800, 2000, 71850000, 6800, |
| 2031 | }, |
| 2032 | |
| 2033 | { |
| 2034 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2035 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH), |
| 2036 | false, |
| 2037 | 29700, 500, 75850000, 8800, |
| 2038 | }, |
| 2039 | |
| 2040 | { |
| 2041 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2042 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW), |
| 2043 | false, |
| 2044 | 29700, 0, 76350000, 9800, |
| 2045 | }, |
| 2046 | }; |
| 2047 | |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2048 | static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = { |
| 2049 | .levels = &msm_rpmrs_levels[0], |
| 2050 | .num_levels = ARRAY_SIZE(msm_rpmrs_levels), |
| 2051 | .vdd_mem_levels = { |
| 2052 | [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000, |
| 2053 | [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000, |
| 2054 | [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000, |
| 2055 | [MSM_RPMRS_VDD_MEM_MAX] = 1150000, |
| 2056 | }, |
| 2057 | .vdd_dig_levels = { |
| 2058 | [MSM_RPMRS_VDD_DIG_RET_LOW] = 500000, |
| 2059 | [MSM_RPMRS_VDD_DIG_RET_HIGH] = 750000, |
| 2060 | [MSM_RPMRS_VDD_DIG_ACTIVE] = 950000, |
| 2061 | [MSM_RPMRS_VDD_DIG_MAX] = 1150000, |
| 2062 | }, |
| 2063 | .vdd_mask = 0x7FFFFF, |
| 2064 | .rpmrs_target_id = { |
| 2065 | [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK, |
| 2066 | [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST, |
| 2067 | [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_PM8038_S1_0, |
| 2068 | [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_PM8038_S1_1, |
| 2069 | [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8038_L24_0, |
| 2070 | [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8038_L24_1, |
| 2071 | [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL, |
| 2072 | }, |
| 2073 | }; |
| 2074 | |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 2075 | static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = { |
| 2076 | .mode = MSM_PM_BOOT_CONFIG_TZ, |
| 2077 | }; |
| 2078 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2079 | #ifdef CONFIG_I2C |
| 2080 | #define I2C_SURF 1 |
| 2081 | #define I2C_FFA (1 << 1) |
| 2082 | #define I2C_RUMI (1 << 2) |
| 2083 | #define I2C_SIM (1 << 3) |
| 2084 | #define I2C_FLUID (1 << 4) |
| 2085 | #define I2C_LIQUID (1 << 5) |
| 2086 | |
| 2087 | struct i2c_registry { |
| 2088 | u8 machs; |
| 2089 | int bus; |
| 2090 | struct i2c_board_info *info; |
| 2091 | int len; |
| 2092 | }; |
| 2093 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2094 | static void __init msm8930_init_hsic(void) |
| 2095 | { |
| 2096 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
| 2097 | uint32_t version = socinfo_get_version(); |
| 2098 | |
| 2099 | pr_info("%s: version:%d mtp:%d\n", __func__, |
| 2100 | SOCINFO_VERSION_MAJOR(version), |
| 2101 | machine_is_msm8930_mtp()); |
| 2102 | |
| 2103 | if ((SOCINFO_VERSION_MAJOR(version) == 1) || |
| 2104 | machine_is_msm8930_mtp() || |
| 2105 | machine_is_msm8930_fluid()) |
| 2106 | return; |
| 2107 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2108 | platform_device_register(&msm_device_hsic_host); |
| 2109 | #endif |
| 2110 | } |
| 2111 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2112 | #ifdef CONFIG_ISL9519_CHARGER |
| 2113 | static struct isl_platform_data isl_data __initdata = { |
| 2114 | .valid_n_gpio = 0, /* Not required when notify-by-pmic */ |
| 2115 | .chg_detection_config = NULL, /* Not required when notify-by-pmic */ |
| 2116 | .max_system_voltage = 4200, |
| 2117 | .min_system_voltage = 3200, |
| 2118 | .chgcurrent = 1000, /* 1900, */ |
| 2119 | .term_current = 400, /* Need fine tuning */ |
| 2120 | .input_current = 2048, |
| 2121 | }; |
| 2122 | |
| 2123 | static struct i2c_board_info isl_charger_i2c_info[] __initdata = { |
| 2124 | { |
| 2125 | I2C_BOARD_INFO("isl9519q", 0x9), |
| 2126 | .irq = 0, /* Not required when notify-by-pmic */ |
| 2127 | .platform_data = &isl_data, |
| 2128 | }, |
| 2129 | }; |
| 2130 | #endif /* CONFIG_ISL9519_CHARGER */ |
| 2131 | |
| 2132 | static struct i2c_registry msm8960_i2c_devices[] __initdata = { |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2133 | #ifdef CONFIG_ISL9519_CHARGER |
| 2134 | { |
| 2135 | I2C_LIQUID, |
| 2136 | MSM_8930_GSBI10_QUP_I2C_BUS_ID, |
| 2137 | isl_charger_i2c_info, |
| 2138 | ARRAY_SIZE(isl_charger_i2c_info), |
| 2139 | }, |
| 2140 | #endif /* CONFIG_ISL9519_CHARGER */ |
| 2141 | { |
| 2142 | I2C_SURF | I2C_FFA | I2C_FLUID, |
| 2143 | MSM_8930_GSBI3_QUP_I2C_BUS_ID, |
| 2144 | cyttsp_info, |
| 2145 | ARRAY_SIZE(cyttsp_info), |
| 2146 | }, |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 2147 | #ifndef MSM8930_PHASE_2 |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2148 | { |
| 2149 | I2C_LIQUID, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2150 | MSM_8930_GSBI10_QUP_I2C_BUS_ID, |
| 2151 | msm_isa1200_board_info, |
| 2152 | ARRAY_SIZE(msm_isa1200_board_info), |
| 2153 | }, |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 2154 | #else |
| 2155 | { |
| 2156 | I2C_FFA | I2C_FLUID, |
| 2157 | MSM_8930_GSBI10_QUP_I2C_BUS_ID, |
| 2158 | msm_isa1200_board_info, |
| 2159 | ARRAY_SIZE(msm_isa1200_board_info), |
| 2160 | }, |
| 2161 | #endif |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 2162 | { |
| 2163 | I2C_SURF, |
| 2164 | MSM_8930_GSBI3_QUP_I2C_BUS_ID, |
| 2165 | mxt_device_info_8930, |
| 2166 | ARRAY_SIZE(mxt_device_info_8930), |
| 2167 | }, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2168 | }; |
| 2169 | #endif /* CONFIG_I2C */ |
| 2170 | |
| 2171 | static void __init register_i2c_devices(void) |
| 2172 | { |
| 2173 | #ifdef CONFIG_I2C |
| 2174 | u8 mach_mask = 0; |
| 2175 | int i; |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 2176 | #ifdef CONFIG_MSM_CAMERA |
| 2177 | struct i2c_registry msm8930_camera_i2c_devices = { |
| 2178 | I2C_SURF | I2C_FFA | I2C_FLUID | I2C_LIQUID | I2C_RUMI, |
| 2179 | MSM_8930_GSBI4_QUP_I2C_BUS_ID, |
| 2180 | msm8930_camera_board_info.board_info, |
| 2181 | msm8930_camera_board_info.num_i2c_board_info, |
| 2182 | }; |
| 2183 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2184 | |
| 2185 | /* Build the matching 'supported_machs' bitmask */ |
Stepan Moskovchenko | 8768eff | 2011-12-01 18:55:07 -0800 | [diff] [blame] | 2186 | if (machine_is_msm8930_cdp() || machine_is_msm8627_cdp()) |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2187 | mach_mask = I2C_SURF; |
| 2188 | else if (machine_is_msm8930_fluid()) |
| 2189 | mach_mask = I2C_FLUID; |
Stepan Moskovchenko | 8768eff | 2011-12-01 18:55:07 -0800 | [diff] [blame] | 2190 | else if (machine_is_msm8930_mtp() || machine_is_msm8627_mtp()) |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2191 | mach_mask = I2C_FFA; |
| 2192 | else |
| 2193 | pr_err("unmatched machine ID in register_i2c_devices\n"); |
| 2194 | |
| 2195 | /* Run the array and install devices as appropriate */ |
| 2196 | for (i = 0; i < ARRAY_SIZE(msm8960_i2c_devices); ++i) { |
| 2197 | if (msm8960_i2c_devices[i].machs & mach_mask) |
| 2198 | i2c_register_board_info(msm8960_i2c_devices[i].bus, |
| 2199 | msm8960_i2c_devices[i].info, |
| 2200 | msm8960_i2c_devices[i].len); |
| 2201 | } |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 2202 | #ifdef CONFIG_MSM_CAMERA |
| 2203 | if (msm8930_camera_i2c_devices.machs & mach_mask) |
| 2204 | i2c_register_board_info(msm8930_camera_i2c_devices.bus, |
| 2205 | msm8930_camera_i2c_devices.info, |
| 2206 | msm8930_camera_i2c_devices.len); |
| 2207 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2208 | #endif |
| 2209 | } |
| 2210 | |
| 2211 | static void __init msm8930_cdp_init(void) |
| 2212 | { |
| 2213 | if (meminfo_init(SYS_MEMORY, SZ_256M) < 0) |
| 2214 | pr_err("meminfo_init() failed!\n"); |
| 2215 | |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2216 | BUG_ON(msm_rpm_init(&msm8930_rpm_data)); |
| 2217 | BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data)); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2218 | |
| 2219 | regulator_suppress_info_printing(); |
| 2220 | if (msm_xo_init()) |
| 2221 | pr_err("Failed to initialize XO votes\n"); |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 2222 | platform_device_register(&msm8930_device_rpm_regulator); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2223 | msm_clock_init(&msm8960_clock_init_data); |
| 2224 | msm8960_device_otg.dev.platform_data = &msm_otg_pdata; |
| 2225 | msm_device_hsic_host.dev.platform_data = &msm_hsic_pdata; |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 2226 | msm8930_init_gpiomux(); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2227 | msm8960_device_qup_spi_gsbi1.dev.platform_data = |
| 2228 | &msm8960_qup_spi_gsbi1_pdata; |
| 2229 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); |
| 2230 | |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 2231 | /* |
| 2232 | * TODO: When physical 8930/PM8038 hardware becomes |
| 2233 | * available, remove this block or add the config |
| 2234 | * option. |
| 2235 | */ |
| 2236 | #ifndef MSM8930_PHASE_2 |
| 2237 | msm8960_init_pmic(); |
| 2238 | #else |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2239 | msm8930_init_pmic(); |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 2240 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2241 | msm8930_i2c_init(); |
| 2242 | msm8930_gfx_init(); |
| 2243 | msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data)); |
| 2244 | msm_spm_l2_init(msm_spm_l2_data); |
| 2245 | msm8930_init_buses(); |
| 2246 | platform_add_devices(msm_footswitch_devices, |
| 2247 | msm_num_footswitch_devices); |
| 2248 | platform_add_devices(common_devices, ARRAY_SIZE(common_devices)); |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 2249 | /* |
| 2250 | * TODO: When physical 8930/PM8038 hardware becomes |
| 2251 | * available, remove this block or add the config |
| 2252 | * option. |
| 2253 | */ |
| 2254 | #ifndef MSM8930_PHASE_2 |
| 2255 | msm8960_pm8921_gpio_mpp_init(); |
| 2256 | #else |
| 2257 | msm8930_pm8038_gpio_mpp_init(); |
| 2258 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2259 | platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices)); |
| 2260 | msm8930_init_hsic(); |
| 2261 | msm8930_init_cam(); |
| 2262 | msm8930_init_mmc(); |
Tianyi Gou | 7c6b81f | 2011-12-07 23:09:08 -0800 | [diff] [blame] | 2263 | acpuclk_init(&acpuclk_8930_soc_data); |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 2264 | if (machine_is_msm8930_cdp() || machine_is_msm8627_cdp()) |
| 2265 | mxt_init_vkeys_8930(); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2266 | register_i2c_devices(); |
| 2267 | msm8930_init_fb(); |
| 2268 | slim_register_board_info(msm_slim_devices, |
| 2269 | ARRAY_SIZE(msm_slim_devices)); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2270 | msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data)); |
| 2271 | msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ); |
| 2272 | msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates), |
| 2273 | msm_pm_data); |
| 2274 | change_memory_power = &msm8930_change_memory_power; |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 2275 | BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata)); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2276 | |
| 2277 | if (PLATFORM_IS_CHARM25()) |
| 2278 | platform_add_devices(mdm_devices, ARRAY_SIZE(mdm_devices)); |
| 2279 | } |
| 2280 | |
| 2281 | MACHINE_START(MSM8930_CDP, "QCT MSM8930 CDP") |
| 2282 | .map_io = msm8930_map_io, |
| 2283 | .reserve = msm8930_reserve, |
| 2284 | .init_irq = msm8930_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 2285 | .handle_irq = gic_handle_irq, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2286 | .timer = &msm_timer, |
| 2287 | .init_machine = msm8930_cdp_init, |
| 2288 | .init_early = msm8930_allocate_memory_regions, |
| 2289 | .init_very_early = msm8930_early_memory, |
| 2290 | MACHINE_END |
| 2291 | |
| 2292 | MACHINE_START(MSM8930_MTP, "QCT MSM8930 MTP") |
| 2293 | .map_io = msm8930_map_io, |
| 2294 | .reserve = msm8930_reserve, |
| 2295 | .init_irq = msm8930_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 2296 | .handle_irq = gic_handle_irq, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2297 | .timer = &msm_timer, |
| 2298 | .init_machine = msm8930_cdp_init, |
| 2299 | .init_early = msm8930_allocate_memory_regions, |
| 2300 | .init_very_early = msm8930_early_memory, |
| 2301 | MACHINE_END |
| 2302 | |
| 2303 | MACHINE_START(MSM8930_FLUID, "QCT MSM8930 FLUID") |
| 2304 | .map_io = msm8930_map_io, |
| 2305 | .reserve = msm8930_reserve, |
| 2306 | .init_irq = msm8930_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 2307 | .handle_irq = gic_handle_irq, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2308 | .timer = &msm_timer, |
| 2309 | .init_machine = msm8930_cdp_init, |
| 2310 | .init_early = msm8930_allocate_memory_regions, |
| 2311 | .init_very_early = msm8930_early_memory, |
| 2312 | MACHINE_END |
Stepan Moskovchenko | 8768eff | 2011-12-01 18:55:07 -0800 | [diff] [blame] | 2313 | |
| 2314 | MACHINE_START(MSM8627_CDP, "QCT MSM8627 CDP") |
| 2315 | .map_io = msm8930_map_io, |
| 2316 | .reserve = msm8930_reserve, |
| 2317 | .init_irq = msm8930_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 2318 | .handle_irq = gic_handle_irq, |
Stepan Moskovchenko | 8768eff | 2011-12-01 18:55:07 -0800 | [diff] [blame] | 2319 | .timer = &msm_timer, |
| 2320 | .init_machine = msm8930_cdp_init, |
| 2321 | .init_early = msm8930_allocate_memory_regions, |
| 2322 | .init_very_early = msm8930_early_memory, |
| 2323 | MACHINE_END |
| 2324 | |
| 2325 | MACHINE_START(MSM8627_MTP, "QCT MSM8627 MTP") |
| 2326 | .map_io = msm8930_map_io, |
| 2327 | .reserve = msm8930_reserve, |
| 2328 | .init_irq = msm8930_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 2329 | .handle_irq = gic_handle_irq, |
Stepan Moskovchenko | 8768eff | 2011-12-01 18:55:07 -0800 | [diff] [blame] | 2330 | .timer = &msm_timer, |
| 2331 | .init_machine = msm8930_cdp_init, |
| 2332 | .init_early = msm8930_allocate_memory_regions, |
| 2333 | .init_very_early = msm8930_early_memory, |
| 2334 | MACHINE_END |