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