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