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