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