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 |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 73 | #include <linux/mfd/wcd9xxx/core.h> |
| 74 | #include <linux/mfd/wcd9xxx/pdata.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 75 | #endif |
| 76 | |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 77 | #include <linux/ion.h> |
| 78 | #include <mach/ion.h> |
Joel King | b8352a1 | 2011-11-15 18:46:24 -0800 | [diff] [blame] | 79 | #include <mach/mdm2.h> |
Vamsi Krishna | 6aa6b1f | 2011-12-14 22:55:20 -0800 | [diff] [blame] | 80 | #include <mach/mdm-peripheral.h> |
Laura Abbott | f8c03b9 | 2012-02-16 14:57:58 -0800 | [diff] [blame] | 81 | #include <mach/msm_rtb.h> |
Laura Abbott | 306bcc2 | 2012-03-08 11:24:53 -0800 | [diff] [blame] | 82 | #include <mach/msm_cache_dump.h> |
| 83 | #include <mach/scm.h> |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 84 | |
Larry Bassel | 41a055b | 2011-12-06 16:15:14 -0800 | [diff] [blame] | 85 | #include <linux/fmem.h> |
| 86 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 87 | #include "timer.h" |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 88 | #include "devices.h" |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 89 | #include "devices-msm8x60.h" |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 90 | #include "spm.h" |
Stepan Moskovchenko | 5a83dba | 2011-12-05 17:30:17 -0800 | [diff] [blame] | 91 | #include "board-8960.h" |
Matt Wagantall | 7cca464 | 2012-02-01 16:43:24 -0800 | [diff] [blame] | 92 | #include "pm.h" |
Abhijeet Dharmapurikar | efaca4f | 2011-12-27 16:24:07 -0800 | [diff] [blame] | 93 | #include <mach/cpuidle.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 94 | #include "rpm_resources.h" |
| 95 | #include "mpm.h" |
Matt Wagantall | 6d9ebee | 2011-08-26 12:15:24 -0700 | [diff] [blame] | 96 | #include "acpuclock.h" |
Naveen Ramaraj | 76483ad | 2011-09-06 14:25:44 -0700 | [diff] [blame] | 97 | #include "smd_private.h" |
Maheshkumar Sivasubramanian | 8ccc16e | 2011-10-25 15:59:57 -0600 | [diff] [blame] | 98 | #include "pm-boot.h" |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 99 | #include "msm_watchdog.h" |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 100 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 101 | static struct platform_device msm_fm_platform_init = { |
| 102 | .name = "iris_fm", |
| 103 | .id = -1, |
| 104 | }; |
| 105 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 106 | #define KS8851_RST_GPIO 89 |
| 107 | #define KS8851_IRQ_GPIO 90 |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 108 | #define HAP_SHIFT_LVL_OE_GPIO 47 |
| 109 | |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 110 | #if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE) |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 111 | |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 112 | struct sx150x_platform_data msm8960_sx150x_data[] = { |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 113 | [SX150X_CAM] = { |
| 114 | .gpio_base = GPIO_CAM_EXPANDER_BASE, |
| 115 | .oscio_is_gpo = false, |
| 116 | .io_pullup_ena = 0x0, |
Nishant Pandit | 474f225 | 2011-07-23 23:17:56 +0530 | [diff] [blame] | 117 | .io_pulldn_ena = 0xc0, |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 118 | .io_open_drain_ena = 0x0, |
| 119 | .irq_summary = -1, |
| 120 | }, |
Amir Samuelov | 755616d | 2011-12-13 16:34:46 +0200 | [diff] [blame] | 121 | [SX150X_LIQUID] = { |
| 122 | .gpio_base = GPIO_LIQUID_EXPANDER_BASE, |
| 123 | .oscio_is_gpo = false, |
| 124 | .io_pullup_ena = 0x0c08, |
| 125 | .io_pulldn_ena = 0x4060, |
| 126 | .io_open_drain_ena = 0x000c, |
| 127 | .io_polarity = 0, |
| 128 | .irq_summary = -1, |
| 129 | }, |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 130 | }; |
Nishant Pandit | 474f225 | 2011-07-23 23:17:56 +0530 | [diff] [blame] | 131 | |
| 132 | #endif |
| 133 | |
Olav Haugan | a21169d | 2012-01-04 09:17:06 -0800 | [diff] [blame] | 134 | #define MSM_PMEM_ADSP_SIZE 0x7800000 |
Bharath Ramachandramurthy | 2fd017a | 2012-03-13 10:21:09 -0700 | [diff] [blame] | 135 | #define MSM_PMEM_AUDIO_SIZE 0x4CF000 |
Mathew Karimpanal | 15fa5c4 | 2011-12-14 21:28:10 -0800 | [diff] [blame] | 136 | #define MSM_PMEM_SIZE 0x2800000 /* 40 Mbytes */ |
Ravishangar Kalyanam | 671f5ce | 2011-12-06 20:25:29 -0800 | [diff] [blame] | 137 | #define MSM_LIQUID_PMEM_SIZE 0x4000000 /* 64 Mbytes */ |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 138 | #define MSM_HDMI_PRIM_PMEM_SIZE 0x4000000 /* 64 Mbytes */ |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 139 | |
| 140 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
Bharath Ramachandramurthy | 2fd017a | 2012-03-13 10:21:09 -0700 | [diff] [blame] | 141 | #define MSM_PMEM_KERNEL_EBI1_SIZE 0x65000 |
Olav Haugan | 3259455 | 2012-03-13 11:40:05 -0700 | [diff] [blame] | 142 | #ifdef CONFIG_MSM_IOMMU |
| 143 | #define MSM_ION_MM_SIZE 0x3800000 |
| 144 | #define MSM_ION_SF_SIZE 0x0 |
| 145 | #define MSM_ION_HEAP_NUM 7 |
| 146 | #else |
| 147 | #define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE |
| 148 | #define MSM_ION_SF_SIZE MSM_PMEM_SIZE |
| 149 | #define MSM_ION_HEAP_NUM 8 |
| 150 | #endif |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 151 | #define MSM_ION_MM_FW_SIZE 0x200000 /* (2MB) */ |
Olav Haugan | 424ff49 | 2012-03-13 11:41:23 -0700 | [diff] [blame] | 152 | #define MSM_ION_QSECOM_SIZE 0x600000 /* (6MB) */ |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 153 | #define MSM_ION_MFC_SIZE SZ_8K |
Olav Haugan | 7355db0 | 2012-01-13 16:59:13 -0800 | [diff] [blame] | 154 | #define MSM_ION_AUDIO_SIZE MSM_PMEM_AUDIO_SIZE |
Olav Haugan | 3259455 | 2012-03-13 11:40:05 -0700 | [diff] [blame] | 155 | |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 156 | #define MSM_LIQUID_ION_MM_SIZE (MSM_ION_MM_SIZE + 0x600000) |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 157 | #define MSM_LIQUID_ION_SF_SIZE MSM_LIQUID_PMEM_SIZE |
| 158 | #define MSM_HDMI_PRIM_ION_SF_SIZE MSM_HDMI_PRIM_PMEM_SIZE |
| 159 | static unsigned msm_ion_sf_size = MSM_ION_SF_SIZE; |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 160 | #else |
Laura Abbott | 6db11c9 | 2011-11-04 10:31:43 -0700 | [diff] [blame] | 161 | #define MSM_PMEM_KERNEL_EBI1_SIZE 0x110C000 |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 162 | #define MSM_ION_HEAP_NUM 1 |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 163 | #endif |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 164 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 165 | #ifdef CONFIG_KERNEL_PMEM_EBI_REGION |
| 166 | static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE; |
| 167 | static int __init pmem_kernel_ebi1_size_setup(char *p) |
| 168 | { |
| 169 | pmem_kernel_ebi1_size = memparse(p, NULL); |
| 170 | return 0; |
| 171 | } |
| 172 | early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup); |
| 173 | #endif |
| 174 | |
| 175 | #ifdef CONFIG_ANDROID_PMEM |
| 176 | static unsigned pmem_size = MSM_PMEM_SIZE; |
Ravishangar Kalyanam | 671f5ce | 2011-12-06 20:25:29 -0800 | [diff] [blame] | 177 | static unsigned pmem_param_set; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 178 | static int __init pmem_size_setup(char *p) |
| 179 | { |
| 180 | pmem_size = memparse(p, NULL); |
Ravishangar Kalyanam | 671f5ce | 2011-12-06 20:25:29 -0800 | [diff] [blame] | 181 | pmem_param_set = 1; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 182 | return 0; |
| 183 | } |
| 184 | early_param("pmem_size", pmem_size_setup); |
| 185 | |
| 186 | static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE; |
| 187 | |
| 188 | static int __init pmem_adsp_size_setup(char *p) |
| 189 | { |
| 190 | pmem_adsp_size = memparse(p, NULL); |
| 191 | return 0; |
| 192 | } |
| 193 | early_param("pmem_adsp_size", pmem_adsp_size_setup); |
| 194 | |
| 195 | static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE; |
| 196 | |
| 197 | static int __init pmem_audio_size_setup(char *p) |
| 198 | { |
| 199 | pmem_audio_size = memparse(p, NULL); |
| 200 | return 0; |
| 201 | } |
| 202 | early_param("pmem_audio_size", pmem_audio_size_setup); |
| 203 | #endif |
| 204 | |
| 205 | #ifdef CONFIG_ANDROID_PMEM |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 206 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 207 | static struct android_pmem_platform_data android_pmem_pdata = { |
| 208 | .name = "pmem", |
| 209 | .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING, |
| 210 | .cached = 1, |
| 211 | .memory_type = MEMTYPE_EBI1, |
| 212 | }; |
| 213 | |
| 214 | static struct platform_device android_pmem_device = { |
| 215 | .name = "android_pmem", |
| 216 | .id = 0, |
| 217 | .dev = {.platform_data = &android_pmem_pdata}, |
| 218 | }; |
| 219 | |
| 220 | static struct android_pmem_platform_data android_pmem_adsp_pdata = { |
| 221 | .name = "pmem_adsp", |
| 222 | .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, |
| 223 | .cached = 0, |
| 224 | .memory_type = MEMTYPE_EBI1, |
| 225 | }; |
| 226 | static struct platform_device android_pmem_adsp_device = { |
| 227 | .name = "android_pmem", |
| 228 | .id = 2, |
| 229 | .dev = { .platform_data = &android_pmem_adsp_pdata }, |
| 230 | }; |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 231 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 232 | |
| 233 | static struct android_pmem_platform_data android_pmem_audio_pdata = { |
| 234 | .name = "pmem_audio", |
| 235 | .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, |
| 236 | .cached = 0, |
| 237 | .memory_type = MEMTYPE_EBI1, |
| 238 | }; |
| 239 | |
| 240 | static struct platform_device android_pmem_audio_device = { |
| 241 | .name = "android_pmem", |
| 242 | .id = 4, |
| 243 | .dev = { .platform_data = &android_pmem_audio_pdata }, |
| 244 | }; |
| 245 | #endif |
| 246 | |
Larry Bassel | 41a055b | 2011-12-06 16:15:14 -0800 | [diff] [blame] | 247 | struct fmem_platform_data fmem_pdata = { |
| 248 | }; |
| 249 | |
Swaminathan Sathappan | b77c65e9 | 2011-09-30 18:36:09 -0700 | [diff] [blame] | 250 | #define DSP_RAM_BASE_8960 0x8da00000 |
| 251 | #define DSP_RAM_SIZE_8960 0x1800000 |
| 252 | static int dspcrashd_pdata_8960 = 0xDEADDEAD; |
| 253 | |
| 254 | static struct resource resources_dspcrashd_8960[] = { |
| 255 | { |
| 256 | .name = "msm_dspcrashd", |
| 257 | .start = DSP_RAM_BASE_8960, |
| 258 | .end = DSP_RAM_BASE_8960 + DSP_RAM_SIZE_8960, |
| 259 | .flags = IORESOURCE_DMA, |
| 260 | }, |
| 261 | }; |
| 262 | |
Stepan Moskovchenko | fc70d90 | 2011-11-30 12:39:36 -0800 | [diff] [blame] | 263 | static struct platform_device msm_device_dspcrashd_8960 = { |
Swaminathan Sathappan | b77c65e9 | 2011-09-30 18:36:09 -0700 | [diff] [blame] | 264 | .name = "msm_dspcrashd", |
| 265 | .num_resources = ARRAY_SIZE(resources_dspcrashd_8960), |
| 266 | .resource = resources_dspcrashd_8960, |
| 267 | .dev = { .platform_data = &dspcrashd_pdata_8960 }, |
| 268 | }; |
| 269 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 270 | static struct memtype_reserve msm8960_reserve_table[] __initdata = { |
| 271 | [MEMTYPE_SMI] = { |
| 272 | }, |
| 273 | [MEMTYPE_EBI0] = { |
| 274 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 275 | }, |
| 276 | [MEMTYPE_EBI1] = { |
| 277 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 278 | }, |
| 279 | }; |
| 280 | |
Laura Abbott | f8c03b9 | 2012-02-16 14:57:58 -0800 | [diff] [blame] | 281 | #if defined(CONFIG_MSM_RTB) |
| 282 | static struct msm_rtb_platform_data msm_rtb_pdata = { |
| 283 | .size = SZ_1M, |
| 284 | }; |
| 285 | |
| 286 | static int __init msm_rtb_set_buffer_size(char *p) |
| 287 | { |
| 288 | int s; |
| 289 | |
| 290 | s = memparse(p, NULL); |
| 291 | msm_rtb_pdata.size = ALIGN(s, SZ_4K); |
| 292 | return 0; |
| 293 | } |
| 294 | early_param("msm_rtb_size", msm_rtb_set_buffer_size); |
| 295 | |
| 296 | |
| 297 | static struct platform_device msm_rtb_device = { |
| 298 | .name = "msm_rtb", |
| 299 | .id = -1, |
| 300 | .dev = { |
| 301 | .platform_data = &msm_rtb_pdata, |
| 302 | }, |
| 303 | }; |
| 304 | #endif |
| 305 | |
| 306 | static void __init reserve_rtb_memory(void) |
| 307 | { |
| 308 | #if defined(CONFIG_MSM_RTB) |
| 309 | msm8960_reserve_table[MEMTYPE_EBI1].size += msm_rtb_pdata.size; |
| 310 | #endif |
| 311 | } |
| 312 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 313 | static void __init size_pmem_devices(void) |
| 314 | { |
| 315 | #ifdef CONFIG_ANDROID_PMEM |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 316 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 317 | android_pmem_adsp_pdata.size = pmem_adsp_size; |
Ravishangar Kalyanam | 671f5ce | 2011-12-06 20:25:29 -0800 | [diff] [blame] | 318 | |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 319 | if (!pmem_param_set) { |
| 320 | if (machine_is_msm8960_liquid()) |
| 321 | pmem_size = MSM_LIQUID_PMEM_SIZE; |
| 322 | if (hdmi_is_primary) |
| 323 | pmem_size = MSM_HDMI_PRIM_PMEM_SIZE; |
| 324 | } |
| 325 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 326 | android_pmem_pdata.size = pmem_size; |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 327 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 328 | android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE; |
| 329 | #endif |
| 330 | } |
| 331 | |
| 332 | static void __init reserve_memory_for(struct android_pmem_platform_data *p) |
| 333 | { |
| 334 | msm8960_reserve_table[p->memory_type].size += p->size; |
| 335 | } |
| 336 | |
| 337 | static void __init reserve_pmem_memory(void) |
| 338 | { |
| 339 | #ifdef CONFIG_ANDROID_PMEM |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 340 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 341 | reserve_memory_for(&android_pmem_adsp_pdata); |
| 342 | reserve_memory_for(&android_pmem_pdata); |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 343 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 344 | reserve_memory_for(&android_pmem_audio_pdata); |
| 345 | msm8960_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size; |
| 346 | #endif |
| 347 | } |
| 348 | |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 349 | static int msm8960_paddr_to_memtype(unsigned int paddr) |
| 350 | { |
| 351 | return MEMTYPE_EBI1; |
| 352 | } |
| 353 | |
Olav Haugan | f6dc774 | 2012-02-15 09:11:55 -0800 | [diff] [blame] | 354 | #define FMEM_ENABLED 1 |
| 355 | |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 356 | #ifdef CONFIG_ION_MSM |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 357 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 358 | static struct ion_cp_heap_pdata cp_mm_ion_pdata = { |
| 359 | .permission_type = IPT_TYPE_MM_CARVEOUT, |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 360 | .align = PAGE_SIZE, |
Olav Haugan | f6dc774 | 2012-02-15 09:11:55 -0800 | [diff] [blame] | 361 | .reusable = FMEM_ENABLED, |
| 362 | .mem_is_fmem = FMEM_ENABLED, |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 363 | }; |
| 364 | |
| 365 | static struct ion_cp_heap_pdata cp_mfc_ion_pdata = { |
| 366 | .permission_type = IPT_TYPE_MFC_SHAREDMEM, |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 367 | .align = PAGE_SIZE, |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 368 | .reusable = 0, |
Olav Haugan | f6dc774 | 2012-02-15 09:11:55 -0800 | [diff] [blame] | 369 | .mem_is_fmem = FMEM_ENABLED, |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 370 | }; |
| 371 | |
| 372 | static struct ion_co_heap_pdata co_ion_pdata = { |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 373 | .adjacent_mem_id = INVALID_HEAP_ID, |
| 374 | .align = PAGE_SIZE, |
Olav Haugan | f6dc774 | 2012-02-15 09:11:55 -0800 | [diff] [blame] | 375 | .mem_is_fmem = 0, |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 376 | }; |
| 377 | |
| 378 | static struct ion_co_heap_pdata fw_co_ion_pdata = { |
| 379 | .adjacent_mem_id = ION_CP_MM_HEAP_ID, |
| 380 | .align = SZ_128K, |
Olav Haugan | f6dc774 | 2012-02-15 09:11:55 -0800 | [diff] [blame] | 381 | .mem_is_fmem = FMEM_ENABLED, |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 382 | }; |
| 383 | #endif |
Olav Haugan | 9cdfc2f | 2012-02-15 09:52:57 -0800 | [diff] [blame] | 384 | |
| 385 | /** |
| 386 | * These heaps are listed in the order they will be allocated. Due to |
| 387 | * video hardware restrictions and content protection the FW heap has to |
| 388 | * be allocated adjacent (below) the MM heap and the MFC heap has to be |
| 389 | * allocated after the MM heap to ensure MFC heap is not more than 256MB |
| 390 | * away from the base address of the FW heap. |
| 391 | * However, the order of FW heap and MM heap doesn't matter since these |
| 392 | * two heaps are taken care of by separate code to ensure they are adjacent |
| 393 | * to each other. |
| 394 | * Don't swap the order unless you know what you are doing! |
| 395 | */ |
Stepan Moskovchenko | fc70d90 | 2011-11-30 12:39:36 -0800 | [diff] [blame] | 396 | static struct ion_platform_data ion_pdata = { |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 397 | .nr = MSM_ION_HEAP_NUM, |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 398 | .heaps = { |
| 399 | { |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 400 | .id = ION_SYSTEM_HEAP_ID, |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 401 | .type = ION_HEAP_TYPE_SYSTEM, |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 402 | .name = ION_VMALLOC_HEAP_NAME, |
| 403 | }, |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 404 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 405 | { |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 406 | .id = ION_CP_MM_HEAP_ID, |
Olav Haugan | 0a85251 | 2012-01-09 10:20:55 -0800 | [diff] [blame] | 407 | .type = ION_HEAP_TYPE_CP, |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 408 | .name = ION_MM_HEAP_NAME, |
| 409 | .size = MSM_ION_MM_SIZE, |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 410 | .memory_type = ION_EBI_TYPE, |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 411 | .extra_data = (void *) &cp_mm_ion_pdata, |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 412 | }, |
Laura Abbott | 8c01736 | 2011-09-22 20:59:12 -0700 | [diff] [blame] | 413 | { |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 414 | .id = ION_MM_FIRMWARE_HEAP_ID, |
| 415 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 416 | .name = ION_MM_FIRMWARE_HEAP_NAME, |
| 417 | .size = MSM_ION_MM_FW_SIZE, |
| 418 | .memory_type = ION_EBI_TYPE, |
| 419 | .extra_data = (void *) &fw_co_ion_pdata, |
| 420 | }, |
| 421 | { |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 422 | .id = ION_CP_MFC_HEAP_ID, |
Olav Haugan | 0a85251 | 2012-01-09 10:20:55 -0800 | [diff] [blame] | 423 | .type = ION_HEAP_TYPE_CP, |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 424 | .name = ION_MFC_HEAP_NAME, |
| 425 | .size = MSM_ION_MFC_SIZE, |
| 426 | .memory_type = ION_EBI_TYPE, |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 427 | .extra_data = (void *) &cp_mfc_ion_pdata, |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 428 | }, |
Olav Haugan | 3259455 | 2012-03-13 11:40:05 -0700 | [diff] [blame] | 429 | #ifndef CONFIG_MSM_IOMMU |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 430 | { |
Olav Haugan | 9cdfc2f | 2012-02-15 09:52:57 -0800 | [diff] [blame] | 431 | .id = ION_SF_HEAP_ID, |
| 432 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 433 | .name = ION_SF_HEAP_NAME, |
| 434 | .size = MSM_ION_SF_SIZE, |
| 435 | .memory_type = ION_EBI_TYPE, |
| 436 | .extra_data = (void *) &co_ion_pdata, |
| 437 | }, |
Olav Haugan | 3259455 | 2012-03-13 11:40:05 -0700 | [diff] [blame] | 438 | #endif |
Olav Haugan | 9cdfc2f | 2012-02-15 09:52:57 -0800 | [diff] [blame] | 439 | { |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 440 | .id = ION_IOMMU_HEAP_ID, |
Laura Abbott | 8c01736 | 2011-09-22 20:59:12 -0700 | [diff] [blame] | 441 | .type = ION_HEAP_TYPE_IOMMU, |
| 442 | .name = ION_IOMMU_HEAP_NAME, |
| 443 | }, |
Olav Haugan | 80854eb | 2012-01-12 12:00:23 -0800 | [diff] [blame] | 444 | { |
| 445 | .id = ION_QSECOM_HEAP_ID, |
| 446 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 447 | .name = ION_QSECOM_HEAP_NAME, |
| 448 | .size = MSM_ION_QSECOM_SIZE, |
| 449 | .memory_type = ION_EBI_TYPE, |
| 450 | .extra_data = (void *) &co_ion_pdata, |
| 451 | }, |
Olav Haugan | 7355db0 | 2012-01-13 16:59:13 -0800 | [diff] [blame] | 452 | { |
| 453 | .id = ION_AUDIO_HEAP_ID, |
| 454 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 455 | .name = ION_AUDIO_HEAP_NAME, |
| 456 | .size = MSM_ION_AUDIO_SIZE, |
| 457 | .memory_type = ION_EBI_TYPE, |
| 458 | .extra_data = (void *) &co_ion_pdata, |
| 459 | }, |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 460 | #endif |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 461 | } |
| 462 | }; |
| 463 | |
Stepan Moskovchenko | fc70d90 | 2011-11-30 12:39:36 -0800 | [diff] [blame] | 464 | static struct platform_device ion_dev = { |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 465 | .name = "ion-msm", |
| 466 | .id = 1, |
| 467 | .dev = { .platform_data = &ion_pdata }, |
| 468 | }; |
| 469 | #endif |
| 470 | |
Larry Bassel | 41a055b | 2011-12-06 16:15:14 -0800 | [diff] [blame] | 471 | struct platform_device fmem_device = { |
| 472 | .name = "fmem", |
| 473 | .id = 1, |
| 474 | .dev = { .platform_data = &fmem_pdata }, |
| 475 | }; |
| 476 | |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 477 | static void __init adjust_mem_for_liquid(void) |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 478 | { |
Ravishangar Kalyanam | 671f5ce | 2011-12-06 20:25:29 -0800 | [diff] [blame] | 479 | unsigned int i; |
| 480 | |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 481 | if (!pmem_param_set) { |
| 482 | if (machine_is_msm8960_liquid()) |
| 483 | msm_ion_sf_size = MSM_LIQUID_ION_SF_SIZE; |
| 484 | |
| 485 | if (hdmi_is_primary) |
| 486 | msm_ion_sf_size = MSM_HDMI_PRIM_ION_SF_SIZE; |
| 487 | |
| 488 | if (machine_is_msm8960_liquid() || hdmi_is_primary) { |
| 489 | for (i = 0; i < ion_pdata.nr; i++) { |
| 490 | if (ion_pdata.heaps[i].id == ION_SF_HEAP_ID) { |
| 491 | ion_pdata.heaps[i].size = |
| 492 | msm_ion_sf_size; |
| 493 | pr_debug("msm_ion_sf_size 0x%x\n", |
| 494 | msm_ion_sf_size); |
| 495 | break; |
| 496 | } |
Ravishangar Kalyanam | 671f5ce | 2011-12-06 20:25:29 -0800 | [diff] [blame] | 497 | } |
| 498 | } |
| 499 | } |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 500 | } |
| 501 | |
| 502 | static void __init reserve_mem_for_ion(enum ion_memory_types mem_type, |
| 503 | unsigned long size) |
| 504 | { |
| 505 | msm8960_reserve_table[mem_type].size += size; |
| 506 | } |
| 507 | |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 508 | /** |
| 509 | * Reserve memory for ION and calculate amount of reusable memory for fmem. |
| 510 | * We only reserve memory for heaps that are not reusable. However, we only |
| 511 | * support one reusable heap at the moment so we ignore the reusable flag for |
| 512 | * other than the first heap with reusable flag set. Also handle special case |
Olav Haugan | f6dc774 | 2012-02-15 09:11:55 -0800 | [diff] [blame] | 513 | * for video heaps (MM,FW, and MFC). Video requires heaps MM and MFC to be |
| 514 | * at a higher address than FW in addition to not more than 256MB away from the |
| 515 | * base address of the firmware. This means that if MM is reusable the other |
| 516 | * two heaps must be allocated in the same region as FW. This is handled by the |
| 517 | * mem_is_fmem flag in the platform data. In addition the MM heap must be |
| 518 | * adjacent to the FW heap for content protection purposes. |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 519 | */ |
| 520 | static void __init reserve_ion_memory(void) |
| 521 | { |
| 522 | #if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION) |
| 523 | unsigned int i; |
| 524 | unsigned int reusable_count = 0; |
| 525 | |
| 526 | adjust_mem_for_liquid(); |
| 527 | fmem_pdata.size = 0; |
Olav Haugan | f6dc774 | 2012-02-15 09:11:55 -0800 | [diff] [blame] | 528 | fmem_pdata.reserved_size_low = 0; |
| 529 | fmem_pdata.reserved_size_high = 0; |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 530 | |
| 531 | /* We only support 1 reusable heap. Check if more than one heap |
| 532 | * is specified as reusable and set as non-reusable if found. |
| 533 | */ |
| 534 | for (i = 0; i < ion_pdata.nr; ++i) { |
| 535 | const struct ion_platform_heap *heap = &(ion_pdata.heaps[i]); |
| 536 | |
| 537 | if (heap->type == ION_HEAP_TYPE_CP && heap->extra_data) { |
| 538 | struct ion_cp_heap_pdata *data = heap->extra_data; |
| 539 | |
| 540 | reusable_count += (data->reusable) ? 1 : 0; |
| 541 | |
| 542 | if (data->reusable && reusable_count > 1) { |
| 543 | pr_err("%s: Too many heaps specified as " |
| 544 | "reusable. Heap %s was not configured " |
| 545 | "as reusable.\n", __func__, heap->name); |
| 546 | data->reusable = 0; |
| 547 | } |
| 548 | } |
| 549 | } |
| 550 | |
| 551 | for (i = 0; i < ion_pdata.nr; ++i) { |
| 552 | int reusable = 0; |
| 553 | int adjacent_heap_id = INVALID_HEAP_ID; |
Olav Haugan | f6dc774 | 2012-02-15 09:11:55 -0800 | [diff] [blame] | 554 | int mem_is_fmem = 0; |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 555 | const struct ion_platform_heap *heap = &(ion_pdata.heaps[i]); |
| 556 | |
| 557 | if (heap->extra_data) { |
| 558 | switch (heap->type) { |
| 559 | case ION_HEAP_TYPE_CP: |
| 560 | reusable = ((struct ion_cp_heap_pdata *) |
| 561 | heap->extra_data)->reusable; |
Olav Haugan | f6dc774 | 2012-02-15 09:11:55 -0800 | [diff] [blame] | 562 | mem_is_fmem = ((struct ion_cp_heap_pdata *) |
| 563 | heap->extra_data)->mem_is_fmem; |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 564 | break; |
| 565 | case ION_HEAP_TYPE_CARVEOUT: |
| 566 | adjacent_heap_id = ((struct ion_co_heap_pdata *) |
| 567 | heap->extra_data)->adjacent_mem_id; |
Olav Haugan | f6dc774 | 2012-02-15 09:11:55 -0800 | [diff] [blame] | 568 | mem_is_fmem = ((struct ion_co_heap_pdata *) |
| 569 | heap->extra_data)->mem_is_fmem; |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 570 | break; |
| 571 | default: |
| 572 | break; |
| 573 | } |
| 574 | } |
| 575 | |
Olav Haugan | f6dc774 | 2012-02-15 09:11:55 -0800 | [diff] [blame] | 576 | if (mem_is_fmem && !reusable) { |
| 577 | if (adjacent_heap_id != INVALID_HEAP_ID) |
| 578 | fmem_pdata.reserved_size_low += heap->size; |
| 579 | else |
| 580 | fmem_pdata.reserved_size_high += heap->size; |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 581 | } |
Olav Haugan | f6dc774 | 2012-02-15 09:11:55 -0800 | [diff] [blame] | 582 | if (mem_is_fmem) |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 583 | fmem_pdata.size += heap->size; |
Olav Haugan | f6dc774 | 2012-02-15 09:11:55 -0800 | [diff] [blame] | 584 | else |
| 585 | reserve_mem_for_ion(MEMTYPE_EBI1, heap->size); |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 586 | } |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 587 | #endif |
| 588 | } |
Huaibin Yang | a541942 | 2011-12-08 23:52:10 -0800 | [diff] [blame] | 589 | |
| 590 | static void __init reserve_mdp_memory(void) |
| 591 | { |
| 592 | msm8960_mdp_writeback(msm8960_reserve_table); |
| 593 | } |
| 594 | |
Laura Abbott | 306bcc2 | 2012-03-08 11:24:53 -0800 | [diff] [blame] | 595 | #if defined(CONFIG_MSM_CACHE_DUMP) |
| 596 | static struct msm_cache_dump_platform_data msm_cache_dump_pdata = { |
| 597 | .l2_size = L2_BUFFER_SIZE, |
| 598 | }; |
| 599 | |
| 600 | static struct platform_device msm_cache_dump_device = { |
| 601 | .name = "msm_cache_dump", |
| 602 | .id = -1, |
| 603 | .dev = { |
| 604 | .platform_data = &msm_cache_dump_pdata, |
| 605 | }, |
| 606 | }; |
| 607 | |
| 608 | #endif |
| 609 | |
| 610 | static void reserve_cache_dump_memory(void) |
| 611 | { |
| 612 | #ifdef CONFIG_MSM_CACHE_DUMP |
| 613 | unsigned int spare; |
| 614 | unsigned int l1_size; |
| 615 | unsigned int total; |
| 616 | int ret; |
| 617 | |
| 618 | ret = scm_call(L1C_SERVICE_ID, L1C_BUFFER_GET_SIZE_COMMAND_ID, &spare, |
| 619 | sizeof(spare), &l1_size, sizeof(l1_size)); |
| 620 | |
| 621 | if (ret) |
| 622 | /* Fall back to something reasonable here */ |
| 623 | l1_size = L1_BUFFER_SIZE; |
| 624 | |
| 625 | total = l1_size + L2_BUFFER_SIZE; |
| 626 | |
| 627 | msm8960_reserve_table[MEMTYPE_EBI1].size += total; |
| 628 | msm_cache_dump_pdata.l1_size = l1_size; |
| 629 | #endif |
| 630 | } |
| 631 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 632 | static void __init msm8960_calculate_reserve_sizes(void) |
| 633 | { |
| 634 | size_pmem_devices(); |
| 635 | reserve_pmem_memory(); |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 636 | reserve_ion_memory(); |
Huaibin Yang | a541942 | 2011-12-08 23:52:10 -0800 | [diff] [blame] | 637 | reserve_mdp_memory(); |
Laura Abbott | f8c03b9 | 2012-02-16 14:57:58 -0800 | [diff] [blame] | 638 | reserve_rtb_memory(); |
Laura Abbott | 306bcc2 | 2012-03-08 11:24:53 -0800 | [diff] [blame] | 639 | reserve_cache_dump_memory(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 640 | } |
| 641 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 642 | static struct reserve_info msm8960_reserve_info __initdata = { |
| 643 | .memtype_reserve_table = msm8960_reserve_table, |
| 644 | .calculate_reserve_sizes = msm8960_calculate_reserve_sizes, |
| 645 | .paddr_to_memtype = msm8960_paddr_to_memtype, |
| 646 | }; |
| 647 | |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 648 | static int msm8960_memory_bank_size(void) |
| 649 | { |
| 650 | return 1<<29; |
| 651 | } |
| 652 | |
| 653 | static void __init locate_unstable_memory(void) |
| 654 | { |
| 655 | struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1]; |
| 656 | unsigned long bank_size; |
| 657 | unsigned long low, high; |
| 658 | |
| 659 | bank_size = msm8960_memory_bank_size(); |
| 660 | low = meminfo.bank[0].start; |
| 661 | high = mb->start + mb->size; |
Olav Haugan | 62052e4 | 2011-10-28 14:28:32 -0700 | [diff] [blame] | 662 | |
| 663 | /* Check if 32 bit overflow occured */ |
| 664 | if (high < mb->start) |
| 665 | high = ~0UL; |
| 666 | |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 667 | low &= ~(bank_size - 1); |
| 668 | |
| 669 | if (high - low <= bank_size) |
| 670 | return; |
Larry Bassel | b8d6102 | 2012-02-24 10:49:45 -0800 | [diff] [blame] | 671 | |
| 672 | msm8960_reserve_info.bank_size = bank_size; |
| 673 | #ifdef CONFIG_ENABLE_DMM |
Jack Cheung | 60eaeab | 2012-01-09 16:40:26 -0800 | [diff] [blame] | 674 | msm8960_reserve_info.low_unstable_address = mb->start - |
| 675 | MIN_MEMORY_BLOCK_SIZE + mb->size; |
Jack Cheung | 0b1987e | 2011-11-18 13:36:29 -0800 | [diff] [blame] | 676 | msm8960_reserve_info.max_unstable_size = MIN_MEMORY_BLOCK_SIZE; |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 677 | pr_info("low unstable address %lx max size %lx bank size %lx\n", |
| 678 | msm8960_reserve_info.low_unstable_address, |
| 679 | msm8960_reserve_info.max_unstable_size, |
| 680 | msm8960_reserve_info.bank_size); |
Larry Bassel | b8d6102 | 2012-02-24 10:49:45 -0800 | [diff] [blame] | 681 | #else |
| 682 | msm8960_reserve_info.low_unstable_address = 0; |
| 683 | msm8960_reserve_info.max_unstable_size = 0; |
| 684 | #endif |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 685 | } |
| 686 | |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 687 | static void __init place_movable_zone(void) |
| 688 | { |
Larry Bassel | b8d6102 | 2012-02-24 10:49:45 -0800 | [diff] [blame] | 689 | #ifdef CONFIG_ENABLE_DMM |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 690 | movable_reserved_start = msm8960_reserve_info.low_unstable_address; |
| 691 | movable_reserved_size = msm8960_reserve_info.max_unstable_size; |
| 692 | pr_info("movable zone start %lx size %lx\n", |
| 693 | movable_reserved_start, movable_reserved_size); |
Larry Bassel | b8d6102 | 2012-02-24 10:49:45 -0800 | [diff] [blame] | 694 | #endif |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 695 | } |
| 696 | |
| 697 | static void __init msm8960_early_memory(void) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 698 | { |
| 699 | reserve_info = &msm8960_reserve_info; |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 700 | locate_unstable_memory(); |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 701 | place_movable_zone(); |
| 702 | } |
| 703 | |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 704 | static char prim_panel_name[PANEL_NAME_MAX_LEN]; |
| 705 | static char ext_panel_name[PANEL_NAME_MAX_LEN]; |
| 706 | static int __init prim_display_setup(char *param) |
| 707 | { |
| 708 | if (strnlen(param, PANEL_NAME_MAX_LEN)) |
| 709 | strlcpy(prim_panel_name, param, PANEL_NAME_MAX_LEN); |
| 710 | return 0; |
| 711 | } |
| 712 | early_param("prim_display", prim_display_setup); |
| 713 | |
| 714 | static int __init ext_display_setup(char *param) |
| 715 | { |
| 716 | if (strnlen(param, PANEL_NAME_MAX_LEN)) |
| 717 | strlcpy(ext_panel_name, param, PANEL_NAME_MAX_LEN); |
| 718 | return 0; |
| 719 | } |
| 720 | early_param("ext_display", ext_display_setup); |
| 721 | |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 722 | static void __init msm8960_reserve(void) |
| 723 | { |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 724 | msm8960_set_display_params(prim_panel_name, ext_panel_name); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 725 | msm_reserve(); |
Larry Bassel | 41a055b | 2011-12-06 16:15:14 -0800 | [diff] [blame] | 726 | fmem_pdata.phys = reserve_memory_for_fmem(fmem_pdata.size); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 727 | } |
| 728 | |
Larry Bassel | a4414b1 | 2011-08-04 11:11:02 -0700 | [diff] [blame] | 729 | static int msm8960_change_memory_power(u64 start, u64 size, |
| 730 | int change_type) |
Larry Bassel | a7eadea | 2011-07-14 10:46:00 -0700 | [diff] [blame] | 731 | { |
Naveen Ramaraj | b03bb1b | 2011-09-12 14:34:31 -0700 | [diff] [blame] | 732 | return soc_change_memory_power(start, size, change_type); |
Larry Bassel | a7eadea | 2011-07-14 10:46:00 -0700 | [diff] [blame] | 733 | } |
| 734 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 735 | static void __init msm8960_allocate_memory_regions(void) |
| 736 | { |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 737 | msm8960_allocate_fb_region(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 738 | } |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 739 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 740 | #ifdef CONFIG_WCD9310_CODEC |
| 741 | |
| 742 | #define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS) |
| 743 | |
Patrick Lai | 3043fba | 2011-08-01 14:15:57 -0700 | [diff] [blame] | 744 | /* Micbias setting is based on 8660 CDP/MTP/FLUID requirement |
| 745 | * 4 micbiases are used to power various analog and digital |
| 746 | * microphones operating at 1800 mV. Technically, all micbiases |
| 747 | * can source from single cfilter since all microphones operate |
| 748 | * at the same voltage level. The arrangement below is to make |
| 749 | * sure all cfilters are exercised. LDO_H regulator ouput level |
| 750 | * does not need to be as high as 2.85V. It is choosen for |
| 751 | * microphone sensitivity purpose. |
| 752 | */ |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 753 | static struct wcd9xxx_pdata tabla_platform_data = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 754 | .slimbus_slave_device = { |
| 755 | .name = "tabla-slave", |
| 756 | .e_addr = {0, 0, 0x10, 0, 0x17, 2}, |
| 757 | }, |
| 758 | .irq = MSM_GPIO_TO_INT(62), |
| 759 | .irq_base = TABLA_INTERRUPT_BASE, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 760 | .num_irqs = NR_WCD9XXX_IRQS, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 761 | .reset_gpio = PM8921_GPIO_PM_TO_SYS(34), |
Patrick Lai | 3043fba | 2011-08-01 14:15:57 -0700 | [diff] [blame] | 762 | .micbias = { |
| 763 | .ldoh_v = TABLA_LDOH_2P85_V, |
| 764 | .cfilt1_mv = 1800, |
| 765 | .cfilt2_mv = 1800, |
| 766 | .cfilt3_mv = 1800, |
| 767 | .bias1_cfilt_sel = TABLA_CFILT1_SEL, |
| 768 | .bias2_cfilt_sel = TABLA_CFILT2_SEL, |
| 769 | .bias3_cfilt_sel = TABLA_CFILT3_SEL, |
| 770 | .bias4_cfilt_sel = TABLA_CFILT3_SEL, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 771 | }, |
| 772 | .regulator = { |
| 773 | { |
| 774 | .name = "CDC_VDD_CP", |
| 775 | .min_uV = 1800000, |
| 776 | .max_uV = 1800000, |
| 777 | .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX, |
| 778 | }, |
| 779 | { |
| 780 | .name = "CDC_VDDA_RX", |
| 781 | .min_uV = 1800000, |
| 782 | .max_uV = 1800000, |
| 783 | .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX, |
| 784 | }, |
| 785 | { |
| 786 | .name = "CDC_VDDA_TX", |
| 787 | .min_uV = 1800000, |
| 788 | .max_uV = 1800000, |
| 789 | .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX, |
| 790 | }, |
| 791 | { |
| 792 | .name = "VDDIO_CDC", |
| 793 | .min_uV = 1800000, |
| 794 | .max_uV = 1800000, |
| 795 | .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX, |
| 796 | }, |
| 797 | { |
| 798 | .name = "VDDD_CDC_D", |
| 799 | .min_uV = 1225000, |
| 800 | .max_uV = 1225000, |
| 801 | .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX, |
| 802 | }, |
| 803 | { |
| 804 | .name = "CDC_VDDA_A_1P2V", |
| 805 | .min_uV = 1225000, |
| 806 | .max_uV = 1225000, |
| 807 | .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX, |
| 808 | }, |
| 809 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 810 | }; |
| 811 | |
| 812 | static struct slim_device msm_slim_tabla = { |
| 813 | .name = "tabla-slim", |
| 814 | .e_addr = {0, 1, 0x10, 0, 0x17, 2}, |
| 815 | .dev = { |
| 816 | .platform_data = &tabla_platform_data, |
| 817 | }, |
| 818 | }; |
Santosh Mardi | 60e19d9 | 2011-10-28 01:15:14 +0530 | [diff] [blame] | 819 | |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 820 | static struct wcd9xxx_pdata tabla20_platform_data = { |
Santosh Mardi | 60e19d9 | 2011-10-28 01:15:14 +0530 | [diff] [blame] | 821 | .slimbus_slave_device = { |
| 822 | .name = "tabla-slave", |
| 823 | .e_addr = {0, 0, 0x60, 0, 0x17, 2}, |
| 824 | }, |
| 825 | .irq = MSM_GPIO_TO_INT(62), |
| 826 | .irq_base = TABLA_INTERRUPT_BASE, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 827 | .num_irqs = NR_WCD9XXX_IRQS, |
Santosh Mardi | 60e19d9 | 2011-10-28 01:15:14 +0530 | [diff] [blame] | 828 | .reset_gpio = PM8921_GPIO_PM_TO_SYS(34), |
| 829 | .micbias = { |
| 830 | .ldoh_v = TABLA_LDOH_2P85_V, |
| 831 | .cfilt1_mv = 1800, |
| 832 | .cfilt2_mv = 1800, |
| 833 | .cfilt3_mv = 1800, |
| 834 | .bias1_cfilt_sel = TABLA_CFILT1_SEL, |
| 835 | .bias2_cfilt_sel = TABLA_CFILT2_SEL, |
| 836 | .bias3_cfilt_sel = TABLA_CFILT3_SEL, |
| 837 | .bias4_cfilt_sel = TABLA_CFILT3_SEL, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 838 | }, |
| 839 | .regulator = { |
| 840 | { |
| 841 | .name = "CDC_VDD_CP", |
| 842 | .min_uV = 1800000, |
| 843 | .max_uV = 1800000, |
| 844 | .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX, |
| 845 | }, |
| 846 | { |
| 847 | .name = "CDC_VDDA_RX", |
| 848 | .min_uV = 1800000, |
| 849 | .max_uV = 1800000, |
| 850 | .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX, |
| 851 | }, |
| 852 | { |
| 853 | .name = "CDC_VDDA_TX", |
| 854 | .min_uV = 1800000, |
| 855 | .max_uV = 1800000, |
| 856 | .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX, |
| 857 | }, |
| 858 | { |
| 859 | .name = "VDDIO_CDC", |
| 860 | .min_uV = 1800000, |
| 861 | .max_uV = 1800000, |
| 862 | .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX, |
| 863 | }, |
| 864 | { |
| 865 | .name = "VDDD_CDC_D", |
| 866 | .min_uV = 1225000, |
| 867 | .max_uV = 1225000, |
| 868 | .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX, |
| 869 | }, |
| 870 | { |
| 871 | .name = "CDC_VDDA_A_1P2V", |
| 872 | .min_uV = 1225000, |
| 873 | .max_uV = 1225000, |
| 874 | .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX, |
| 875 | }, |
| 876 | }, |
Santosh Mardi | 60e19d9 | 2011-10-28 01:15:14 +0530 | [diff] [blame] | 877 | }; |
| 878 | |
| 879 | static struct slim_device msm_slim_tabla20 = { |
| 880 | .name = "tabla2x-slim", |
| 881 | .e_addr = {0, 1, 0x60, 0, 0x17, 2}, |
| 882 | .dev = { |
| 883 | .platform_data = &tabla20_platform_data, |
| 884 | }, |
| 885 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 886 | #endif |
| 887 | |
| 888 | static struct slim_boardinfo msm_slim_devices[] = { |
| 889 | #ifdef CONFIG_WCD9310_CODEC |
| 890 | { |
| 891 | .bus_num = 1, |
| 892 | .slim_slave = &msm_slim_tabla, |
| 893 | }, |
Santosh Mardi | 60e19d9 | 2011-10-28 01:15:14 +0530 | [diff] [blame] | 894 | { |
| 895 | .bus_num = 1, |
| 896 | .slim_slave = &msm_slim_tabla20, |
| 897 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 898 | #endif |
| 899 | /* add more slimbus slaves as needed */ |
| 900 | }; |
| 901 | |
Yunsen Wang | 5c1a739 | 2011-07-09 19:10:16 -0700 | [diff] [blame] | 902 | #define MSM_WCNSS_PHYS 0x03000000 |
| 903 | #define MSM_WCNSS_SIZE 0x280000 |
| 904 | |
| 905 | static struct resource resources_wcnss_wlan[] = { |
| 906 | { |
| 907 | .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ, |
| 908 | .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ, |
| 909 | .name = "wcnss_wlanrx_irq", |
| 910 | .flags = IORESOURCE_IRQ, |
| 911 | }, |
| 912 | { |
| 913 | .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ, |
| 914 | .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ, |
| 915 | .name = "wcnss_wlantx_irq", |
| 916 | .flags = IORESOURCE_IRQ, |
| 917 | }, |
| 918 | { |
| 919 | .start = MSM_WCNSS_PHYS, |
| 920 | .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1, |
| 921 | .name = "wcnss_mmio", |
| 922 | .flags = IORESOURCE_MEM, |
| 923 | }, |
Ankur Nandwani | ad0d9ac | 2011-09-26 11:49:25 -0700 | [diff] [blame] | 924 | { |
| 925 | .start = 84, |
| 926 | .end = 88, |
| 927 | .name = "wcnss_gpios_5wire", |
| 928 | .flags = IORESOURCE_IO, |
| 929 | }, |
Yunsen Wang | 5c1a739 | 2011-07-09 19:10:16 -0700 | [diff] [blame] | 930 | }; |
| 931 | |
Ankur Nandwani | b0039b0 | 2011-08-09 14:00:45 -0700 | [diff] [blame] | 932 | static struct qcom_wcnss_opts qcom_wcnss_pdata = { |
| 933 | .has_48mhz_xo = 1, |
| 934 | }; |
| 935 | |
Yunsen Wang | 5c1a739 | 2011-07-09 19:10:16 -0700 | [diff] [blame] | 936 | static struct platform_device msm_device_wcnss_wlan = { |
| 937 | .name = "wcnss_wlan", |
| 938 | .id = 0, |
| 939 | .num_resources = ARRAY_SIZE(resources_wcnss_wlan), |
| 940 | .resource = resources_wcnss_wlan, |
Ankur Nandwani | b0039b0 | 2011-08-09 14:00:45 -0700 | [diff] [blame] | 941 | .dev = {.platform_data = &qcom_wcnss_pdata}, |
Yunsen Wang | 5c1a739 | 2011-07-09 19:10:16 -0700 | [diff] [blame] | 942 | }; |
| 943 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 944 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 945 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \ |
| 946 | defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 947 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 948 | |
| 949 | #define QCE_SIZE 0x10000 |
| 950 | #define QCE_0_BASE 0x18500000 |
| 951 | |
| 952 | #define QCE_HW_KEY_SUPPORT 0 |
| 953 | #define QCE_SHA_HMAC_SUPPORT 1 |
| 954 | #define QCE_SHARE_CE_RESOURCE 1 |
| 955 | #define QCE_CE_SHARED 0 |
| 956 | |
Ramesh Masavarapu | 4925968 | 2011-12-02 14:00:18 -0800 | [diff] [blame] | 957 | /* Begin Bus scaling definitions */ |
| 958 | static struct msm_bus_vectors crypto_hw_init_vectors[] = { |
| 959 | { |
| 960 | .src = MSM_BUS_MASTER_ADM_PORT0, |
| 961 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 962 | .ab = 0, |
| 963 | .ib = 0, |
| 964 | }, |
| 965 | { |
| 966 | .src = MSM_BUS_MASTER_ADM_PORT1, |
| 967 | .dst = MSM_BUS_SLAVE_GSBI1_UART, |
| 968 | .ab = 0, |
| 969 | .ib = 0, |
| 970 | }, |
| 971 | }; |
| 972 | |
| 973 | static struct msm_bus_vectors crypto_hw_active_vectors[] = { |
| 974 | { |
| 975 | .src = MSM_BUS_MASTER_ADM_PORT0, |
| 976 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 977 | .ab = 70000000UL, |
| 978 | .ib = 70000000UL, |
| 979 | }, |
| 980 | { |
| 981 | .src = MSM_BUS_MASTER_ADM_PORT1, |
| 982 | .dst = MSM_BUS_SLAVE_GSBI1_UART, |
| 983 | .ab = 2480000000UL, |
| 984 | .ib = 2480000000UL, |
| 985 | }, |
| 986 | }; |
| 987 | |
| 988 | static struct msm_bus_paths crypto_hw_bus_scale_usecases[] = { |
| 989 | { |
| 990 | ARRAY_SIZE(crypto_hw_init_vectors), |
| 991 | crypto_hw_init_vectors, |
| 992 | }, |
| 993 | { |
| 994 | ARRAY_SIZE(crypto_hw_active_vectors), |
| 995 | crypto_hw_active_vectors, |
| 996 | }, |
| 997 | }; |
| 998 | |
| 999 | static struct msm_bus_scale_pdata crypto_hw_bus_scale_pdata = { |
| 1000 | crypto_hw_bus_scale_usecases, |
| 1001 | ARRAY_SIZE(crypto_hw_bus_scale_usecases), |
| 1002 | .name = "cryptohw", |
| 1003 | }; |
| 1004 | /* End Bus Scaling Definitions*/ |
| 1005 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1006 | static struct resource qcrypto_resources[] = { |
| 1007 | [0] = { |
| 1008 | .start = QCE_0_BASE, |
| 1009 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 1010 | .flags = IORESOURCE_MEM, |
| 1011 | }, |
| 1012 | [1] = { |
| 1013 | .name = "crypto_channels", |
| 1014 | .start = DMOV_CE_IN_CHAN, |
| 1015 | .end = DMOV_CE_OUT_CHAN, |
| 1016 | .flags = IORESOURCE_DMA, |
| 1017 | }, |
| 1018 | [2] = { |
| 1019 | .name = "crypto_crci_in", |
| 1020 | .start = DMOV_CE_IN_CRCI, |
| 1021 | .end = DMOV_CE_IN_CRCI, |
| 1022 | .flags = IORESOURCE_DMA, |
| 1023 | }, |
| 1024 | [3] = { |
| 1025 | .name = "crypto_crci_out", |
| 1026 | .start = DMOV_CE_OUT_CRCI, |
| 1027 | .end = DMOV_CE_OUT_CRCI, |
| 1028 | .flags = IORESOURCE_DMA, |
| 1029 | }, |
| 1030 | }; |
| 1031 | |
| 1032 | static struct resource qcedev_resources[] = { |
| 1033 | [0] = { |
| 1034 | .start = QCE_0_BASE, |
| 1035 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 1036 | .flags = IORESOURCE_MEM, |
| 1037 | }, |
| 1038 | [1] = { |
| 1039 | .name = "crypto_channels", |
| 1040 | .start = DMOV_CE_IN_CHAN, |
| 1041 | .end = DMOV_CE_OUT_CHAN, |
| 1042 | .flags = IORESOURCE_DMA, |
| 1043 | }, |
| 1044 | [2] = { |
| 1045 | .name = "crypto_crci_in", |
| 1046 | .start = DMOV_CE_IN_CRCI, |
| 1047 | .end = DMOV_CE_IN_CRCI, |
| 1048 | .flags = IORESOURCE_DMA, |
| 1049 | }, |
| 1050 | [3] = { |
| 1051 | .name = "crypto_crci_out", |
| 1052 | .start = DMOV_CE_OUT_CRCI, |
| 1053 | .end = DMOV_CE_OUT_CRCI, |
| 1054 | .flags = IORESOURCE_DMA, |
| 1055 | }, |
| 1056 | }; |
| 1057 | |
| 1058 | #endif |
| 1059 | |
| 1060 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 1061 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 1062 | |
| 1063 | static struct msm_ce_hw_support qcrypto_ce_hw_suppport = { |
| 1064 | .ce_shared = QCE_CE_SHARED, |
| 1065 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 1066 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 1067 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
Ramesh Masavarapu | 4925968 | 2011-12-02 14:00:18 -0800 | [diff] [blame] | 1068 | .bus_scale_table = &crypto_hw_bus_scale_pdata, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1069 | }; |
| 1070 | |
| 1071 | static struct platform_device qcrypto_device = { |
| 1072 | .name = "qcrypto", |
| 1073 | .id = 0, |
| 1074 | .num_resources = ARRAY_SIZE(qcrypto_resources), |
| 1075 | .resource = qcrypto_resources, |
| 1076 | .dev = { |
| 1077 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 1078 | .platform_data = &qcrypto_ce_hw_suppport, |
| 1079 | }, |
| 1080 | }; |
| 1081 | #endif |
| 1082 | |
| 1083 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 1084 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 1085 | |
| 1086 | static struct msm_ce_hw_support qcedev_ce_hw_suppport = { |
| 1087 | .ce_shared = QCE_CE_SHARED, |
| 1088 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 1089 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 1090 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
Ramesh Masavarapu | 4925968 | 2011-12-02 14:00:18 -0800 | [diff] [blame] | 1091 | .bus_scale_table = &crypto_hw_bus_scale_pdata, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1092 | }; |
| 1093 | |
| 1094 | static struct platform_device qcedev_device = { |
| 1095 | .name = "qce", |
| 1096 | .id = 0, |
| 1097 | .num_resources = ARRAY_SIZE(qcedev_resources), |
| 1098 | .resource = qcedev_resources, |
| 1099 | .dev = { |
| 1100 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 1101 | .platform_data = &qcedev_ce_hw_suppport, |
| 1102 | }, |
| 1103 | }; |
| 1104 | #endif |
| 1105 | |
Joel King | b8352a1 | 2011-11-15 18:46:24 -0800 | [diff] [blame] | 1106 | #define MDM2AP_ERRFATAL 70 |
| 1107 | #define AP2MDM_ERRFATAL 95 |
| 1108 | #define MDM2AP_STATUS 69 |
| 1109 | #define AP2MDM_STATUS 94 |
| 1110 | #define AP2MDM_PMIC_RESET_N 80 |
| 1111 | #define AP2MDM_KPDPWR_N 81 |
| 1112 | |
Joel King | b8352a1 | 2011-11-15 18:46:24 -0800 | [diff] [blame] | 1113 | static struct resource mdm_resources[] = { |
| 1114 | { |
| 1115 | .start = MDM2AP_ERRFATAL, |
| 1116 | .end = MDM2AP_ERRFATAL, |
| 1117 | .name = "MDM2AP_ERRFATAL", |
| 1118 | .flags = IORESOURCE_IO, |
| 1119 | }, |
| 1120 | { |
| 1121 | .start = AP2MDM_ERRFATAL, |
| 1122 | .end = AP2MDM_ERRFATAL, |
| 1123 | .name = "AP2MDM_ERRFATAL", |
| 1124 | .flags = IORESOURCE_IO, |
| 1125 | }, |
| 1126 | { |
| 1127 | .start = MDM2AP_STATUS, |
| 1128 | .end = MDM2AP_STATUS, |
| 1129 | .name = "MDM2AP_STATUS", |
| 1130 | .flags = IORESOURCE_IO, |
| 1131 | }, |
| 1132 | { |
| 1133 | .start = AP2MDM_STATUS, |
| 1134 | .end = AP2MDM_STATUS, |
| 1135 | .name = "AP2MDM_STATUS", |
| 1136 | .flags = IORESOURCE_IO, |
| 1137 | }, |
| 1138 | { |
| 1139 | .start = AP2MDM_PMIC_RESET_N, |
| 1140 | .end = AP2MDM_PMIC_RESET_N, |
| 1141 | .name = "AP2MDM_PMIC_RESET_N", |
| 1142 | .flags = IORESOURCE_IO, |
| 1143 | }, |
| 1144 | { |
| 1145 | .start = AP2MDM_KPDPWR_N, |
| 1146 | .end = AP2MDM_KPDPWR_N, |
| 1147 | .name = "AP2MDM_KPDPWR_N", |
| 1148 | .flags = IORESOURCE_IO, |
| 1149 | }, |
| 1150 | }; |
| 1151 | |
| 1152 | static struct mdm_platform_data mdm_platform_data = { |
| 1153 | .mdm_version = "2.5", |
| 1154 | }; |
| 1155 | |
Stepan Moskovchenko | fc70d90 | 2011-11-30 12:39:36 -0800 | [diff] [blame] | 1156 | static struct platform_device mdm_device = { |
Joel King | b8352a1 | 2011-11-15 18:46:24 -0800 | [diff] [blame] | 1157 | .name = "mdm2_modem", |
| 1158 | .id = -1, |
| 1159 | .num_resources = ARRAY_SIZE(mdm_resources), |
| 1160 | .resource = mdm_resources, |
| 1161 | .dev = { |
| 1162 | .platform_data = &mdm_platform_data, |
| 1163 | }, |
| 1164 | }; |
| 1165 | |
| 1166 | static struct platform_device *mdm_devices[] __initdata = { |
| 1167 | &mdm_device, |
| 1168 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1169 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1170 | #define MSM_SHARED_RAM_PHYS 0x80000000 |
| 1171 | |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1172 | static void __init msm8960_map_io(void) |
| 1173 | { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1174 | msm_shared_ram_phys = MSM_SHARED_RAM_PHYS; |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1175 | msm_map_msm8960_io(); |
Jeff Ohlstein | 3a77f9f | 2011-09-06 14:50:20 -0700 | [diff] [blame] | 1176 | |
| 1177 | if (socinfo_init() < 0) |
| 1178 | pr_err("socinfo_init() failed!\n"); |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1179 | } |
| 1180 | |
| 1181 | static void __init msm8960_init_irq(void) |
| 1182 | { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1183 | struct msm_mpm_device_data *data = NULL; |
| 1184 | |
| 1185 | #ifdef CONFIG_MSM_MPM |
| 1186 | data = &msm8960_mpm_dev_data; |
| 1187 | #endif |
| 1188 | |
| 1189 | msm_mpm_irq_extn_init(data); |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1190 | gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1191 | (void *)MSM_QGIC_CPU_BASE); |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1192 | } |
| 1193 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1194 | static void __init msm8960_init_buses(void) |
| 1195 | { |
| 1196 | #ifdef CONFIG_MSM_BUS_SCALING |
Gagan Mac | dc1dc14 | 2011-09-16 15:13:35 -0600 | [diff] [blame] | 1197 | msm_bus_rpm_set_mt_mask(); |
Gagan Mac | ae154c4b | 2011-10-05 19:24:43 -0600 | [diff] [blame] | 1198 | msm_bus_8960_apps_fabric_pdata.rpm_enabled = 1; |
| 1199 | msm_bus_8960_sys_fabric_pdata.rpm_enabled = 1; |
| 1200 | msm_bus_8960_mm_fabric_pdata.rpm_enabled = 1; |
| 1201 | msm_bus_apps_fabric.dev.platform_data = |
| 1202 | &msm_bus_8960_apps_fabric_pdata; |
| 1203 | msm_bus_sys_fabric.dev.platform_data = &msm_bus_8960_sys_fabric_pdata; |
| 1204 | msm_bus_mm_fabric.dev.platform_data = &msm_bus_8960_mm_fabric_pdata; |
| 1205 | msm_bus_sys_fpb.dev.platform_data = &msm_bus_8960_sys_fpb_pdata; |
| 1206 | 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] | 1207 | #endif |
| 1208 | } |
| 1209 | |
| 1210 | static struct msm_spi_platform_data msm8960_qup_spi_gsbi1_pdata = { |
| 1211 | .max_clock_speed = 15060000, |
| 1212 | }; |
| 1213 | |
| 1214 | #ifdef CONFIG_USB_MSM_OTG_72K |
| 1215 | static struct msm_otg_platform_data msm_otg_pdata; |
| 1216 | #else |
Anji jonnala | a8b8d73 | 2011-12-06 10:03:24 +0530 | [diff] [blame] | 1217 | static int wr_phy_init_seq[] = { |
| 1218 | 0x44, 0x80, /* set VBUS valid threshold |
| 1219 | and disconnect valid threshold */ |
| 1220 | 0x38, 0x81, /* update DC voltage level */ |
| 1221 | 0x14, 0x82, /* set preemphasis and rise/fall time */ |
| 1222 | 0x13, 0x83, /* set source impedance adjusment */ |
| 1223 | -1}; |
| 1224 | |
| 1225 | static int liquid_v1_phy_init_seq[] = { |
| 1226 | 0x44, 0x80,/* set VBUS valid threshold |
| 1227 | and disconnect valid threshold */ |
| 1228 | 0x3C, 0x81,/* update DC voltage level */ |
| 1229 | 0x18, 0x82,/* set preemphasis and rise/fall time */ |
| 1230 | 0x23, 0x83,/* set source impedance sdjusment */ |
| 1231 | -1}; |
| 1232 | |
Manu Gautam | cd82e9d | 2011-12-20 14:17:28 +0530 | [diff] [blame] | 1233 | #ifdef CONFIG_MSM_BUS_SCALING |
| 1234 | /* Bandwidth requests (zero) if no vote placed */ |
| 1235 | static struct msm_bus_vectors usb_init_vectors[] = { |
| 1236 | { |
| 1237 | .src = MSM_BUS_MASTER_SPS, |
| 1238 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 1239 | .ab = 0, |
| 1240 | .ib = 0, |
| 1241 | }, |
| 1242 | }; |
| 1243 | |
| 1244 | /* Bus bandwidth requests in Bytes/sec */ |
| 1245 | static struct msm_bus_vectors usb_max_vectors[] = { |
| 1246 | { |
| 1247 | .src = MSM_BUS_MASTER_SPS, |
| 1248 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 1249 | .ab = 60000000, /* At least 480Mbps on bus. */ |
| 1250 | .ib = 960000000, /* MAX bursts rate */ |
| 1251 | }, |
| 1252 | }; |
| 1253 | |
| 1254 | static struct msm_bus_paths usb_bus_scale_usecases[] = { |
| 1255 | { |
| 1256 | ARRAY_SIZE(usb_init_vectors), |
| 1257 | usb_init_vectors, |
| 1258 | }, |
| 1259 | { |
| 1260 | ARRAY_SIZE(usb_max_vectors), |
| 1261 | usb_max_vectors, |
| 1262 | }, |
| 1263 | }; |
| 1264 | |
| 1265 | static struct msm_bus_scale_pdata usb_bus_scale_pdata = { |
| 1266 | usb_bus_scale_usecases, |
| 1267 | ARRAY_SIZE(usb_bus_scale_usecases), |
| 1268 | .name = "usb", |
| 1269 | }; |
| 1270 | #endif |
| 1271 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1272 | static struct msm_otg_platform_data msm_otg_pdata = { |
| 1273 | .mode = USB_OTG, |
| 1274 | .otg_control = OTG_PMIC_CONTROL, |
| 1275 | .phy_type = SNPS_28NM_INTEGRATED_PHY, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1276 | .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE), |
Anji jonnala | 4e3e677 | 2011-09-15 18:53:42 +0530 | [diff] [blame] | 1277 | .power_budget = 750, |
Manu Gautam | cd82e9d | 2011-12-20 14:17:28 +0530 | [diff] [blame] | 1278 | #ifdef CONFIG_MSM_BUS_SCALING |
| 1279 | .bus_scale_table = &usb_bus_scale_pdata, |
| 1280 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1281 | }; |
| 1282 | #endif |
| 1283 | |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 1284 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
Vijayavardhan Vennapusa | 2b592824f | 2011-11-02 19:51:32 +0530 | [diff] [blame] | 1285 | #define HSIC_HUB_RESET_GPIO 91 |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 1286 | static struct msm_hsic_host_platform_data msm_hsic_pdata = { |
| 1287 | .strobe = 150, |
| 1288 | .data = 151, |
| 1289 | }; |
| 1290 | #else |
| 1291 | static struct msm_hsic_host_platform_data msm_hsic_pdata; |
| 1292 | #endif |
| 1293 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1294 | #define PID_MAGIC_ID 0x71432909 |
| 1295 | #define SERIAL_NUM_MAGIC_ID 0x61945374 |
| 1296 | #define SERIAL_NUMBER_LENGTH 127 |
| 1297 | #define DLOAD_USB_BASE_ADD 0x2A03F0C8 |
| 1298 | |
| 1299 | struct magic_num_struct { |
| 1300 | uint32_t pid; |
| 1301 | uint32_t serial_num; |
| 1302 | }; |
| 1303 | |
| 1304 | struct dload_struct { |
| 1305 | uint32_t reserved1; |
| 1306 | uint32_t reserved2; |
| 1307 | uint32_t reserved3; |
| 1308 | uint16_t reserved4; |
| 1309 | uint16_t pid; |
| 1310 | char serial_number[SERIAL_NUMBER_LENGTH]; |
| 1311 | uint16_t reserved5; |
| 1312 | struct magic_num_struct magic_struct; |
| 1313 | }; |
| 1314 | |
| 1315 | static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum) |
| 1316 | { |
| 1317 | struct dload_struct __iomem *dload = 0; |
| 1318 | |
| 1319 | dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload)); |
| 1320 | if (!dload) { |
| 1321 | pr_err("%s: cannot remap I/O memory region: %08x\n", |
| 1322 | __func__, DLOAD_USB_BASE_ADD); |
| 1323 | return -ENXIO; |
| 1324 | } |
| 1325 | |
| 1326 | pr_debug("%s: dload:%p pid:%x serial_num:%s\n", |
| 1327 | __func__, dload, pid, snum); |
| 1328 | /* update pid */ |
| 1329 | dload->magic_struct.pid = PID_MAGIC_ID; |
| 1330 | dload->pid = pid; |
| 1331 | |
| 1332 | /* update serial number */ |
| 1333 | dload->magic_struct.serial_num = 0; |
| 1334 | if (!snum) { |
| 1335 | memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH); |
| 1336 | goto out; |
| 1337 | } |
| 1338 | |
| 1339 | dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID; |
Jin Hong | e49b148 | 2011-10-03 11:15:50 -0700 | [diff] [blame] | 1340 | strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1341 | out: |
| 1342 | iounmap(dload); |
| 1343 | return 0; |
| 1344 | } |
| 1345 | |
| 1346 | static struct android_usb_platform_data android_usb_pdata = { |
| 1347 | .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num, |
| 1348 | }; |
| 1349 | |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 1350 | static struct platform_device android_usb_device = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1351 | .name = "android_usb", |
| 1352 | .id = -1, |
| 1353 | .dev = { |
| 1354 | .platform_data = &android_usb_pdata, |
| 1355 | }, |
| 1356 | }; |
| 1357 | |
| 1358 | static uint8_t spm_wfi_cmd_sequence[] __initdata = { |
| 1359 | 0x03, 0x0f, |
| 1360 | }; |
| 1361 | |
| 1362 | static uint8_t spm_power_collapse_without_rpm[] __initdata = { |
| 1363 | 0x00, 0x24, 0x54, 0x10, |
| 1364 | 0x09, 0x03, 0x01, |
| 1365 | 0x10, 0x54, 0x30, 0x0C, |
| 1366 | 0x24, 0x30, 0x0f, |
| 1367 | }; |
| 1368 | |
| 1369 | static uint8_t spm_power_collapse_with_rpm[] __initdata = { |
| 1370 | 0x00, 0x24, 0x54, 0x10, |
| 1371 | 0x09, 0x07, 0x01, 0x0B, |
| 1372 | 0x10, 0x54, 0x30, 0x0C, |
| 1373 | 0x24, 0x30, 0x0f, |
| 1374 | }; |
| 1375 | |
| 1376 | static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = { |
| 1377 | [0] = { |
| 1378 | .mode = MSM_SPM_MODE_CLOCK_GATING, |
| 1379 | .notify_rpm = false, |
| 1380 | .cmd = spm_wfi_cmd_sequence, |
| 1381 | }, |
| 1382 | [1] = { |
| 1383 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 1384 | .notify_rpm = false, |
| 1385 | .cmd = spm_power_collapse_without_rpm, |
| 1386 | }, |
| 1387 | [2] = { |
| 1388 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 1389 | .notify_rpm = true, |
| 1390 | .cmd = spm_power_collapse_with_rpm, |
| 1391 | }, |
| 1392 | }; |
| 1393 | |
| 1394 | static struct msm_spm_platform_data msm_spm_data[] __initdata = { |
| 1395 | [0] = { |
| 1396 | .reg_base_addr = MSM_SAW0_BASE, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1397 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1398 | #if defined(CONFIG_MSM_AVS_HW) |
| 1399 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00, |
| 1400 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00, |
| 1401 | #endif |
| 1402 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
Praveen Chidambaram | e4b9eb1 | 2012-02-28 19:39:58 -0700 | [diff] [blame] | 1403 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1404 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C, |
| 1405 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C, |
| 1406 | .vctl_timeout_us = 50, |
| 1407 | .num_modes = ARRAY_SIZE(msm_spm_seq_list), |
| 1408 | .modes = msm_spm_seq_list, |
| 1409 | }, |
| 1410 | [1] = { |
| 1411 | .reg_base_addr = MSM_SAW1_BASE, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1412 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1413 | #if defined(CONFIG_MSM_AVS_HW) |
| 1414 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00, |
| 1415 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00, |
| 1416 | #endif |
| 1417 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
Praveen Chidambaram | e4b9eb1 | 2012-02-28 19:39:58 -0700 | [diff] [blame] | 1418 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1419 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C, |
| 1420 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C, |
| 1421 | .vctl_timeout_us = 50, |
| 1422 | .num_modes = ARRAY_SIZE(msm_spm_seq_list), |
| 1423 | .modes = msm_spm_seq_list, |
| 1424 | }, |
| 1425 | }; |
| 1426 | |
| 1427 | static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = { |
| 1428 | 0x00, 0x20, 0x03, 0x20, |
| 1429 | 0x00, 0x0f, |
| 1430 | }; |
| 1431 | |
| 1432 | static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = { |
| 1433 | 0x00, 0x20, 0x34, 0x64, |
| 1434 | 0x48, 0x07, 0x48, 0x20, |
| 1435 | 0x50, 0x64, 0x04, 0x34, |
| 1436 | 0x50, 0x0f, |
| 1437 | }; |
| 1438 | static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = { |
| 1439 | 0x00, 0x10, 0x34, 0x64, |
| 1440 | 0x48, 0x07, 0x48, 0x10, |
| 1441 | 0x50, 0x64, 0x04, 0x34, |
| 1442 | 0x50, 0x0F, |
| 1443 | }; |
| 1444 | |
| 1445 | static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = { |
| 1446 | [0] = { |
| 1447 | .mode = MSM_SPM_L2_MODE_RETENTION, |
| 1448 | .notify_rpm = false, |
| 1449 | .cmd = l2_spm_wfi_cmd_sequence, |
| 1450 | }, |
| 1451 | [1] = { |
| 1452 | .mode = MSM_SPM_L2_MODE_GDHS, |
| 1453 | .notify_rpm = true, |
| 1454 | .cmd = l2_spm_gdhs_cmd_sequence, |
| 1455 | }, |
| 1456 | [2] = { |
| 1457 | .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE, |
| 1458 | .notify_rpm = true, |
| 1459 | .cmd = l2_spm_power_off_cmd_sequence, |
| 1460 | }, |
| 1461 | }; |
| 1462 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1463 | static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = { |
| 1464 | [0] = { |
| 1465 | .reg_base_addr = MSM_SAW_L2_BASE, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1466 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00, |
Praveen Chidambaram | e4b9eb1 | 2012-02-28 19:39:58 -0700 | [diff] [blame] | 1467 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1468 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE, |
| 1469 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020, |
| 1470 | .modes = msm_spm_l2_seq_list, |
| 1471 | .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list), |
| 1472 | }, |
| 1473 | }; |
| 1474 | |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1475 | #define PM_HAP_EN_GPIO PM8921_GPIO_PM_TO_SYS(33) |
| 1476 | #define PM_HAP_LEN_GPIO PM8921_GPIO_PM_TO_SYS(20) |
| 1477 | |
| 1478 | static struct msm_xo_voter *xo_handle_d1; |
| 1479 | |
| 1480 | static int isa1200_power(int on) |
| 1481 | { |
| 1482 | int rc = 0; |
| 1483 | |
| 1484 | gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, !!on); |
| 1485 | |
| 1486 | rc = on ? msm_xo_mode_vote(xo_handle_d1, MSM_XO_MODE_ON) : |
| 1487 | msm_xo_mode_vote(xo_handle_d1, MSM_XO_MODE_OFF); |
| 1488 | if (rc < 0) { |
| 1489 | pr_err("%s: failed to %svote for TCXO D1 buffer%d\n", |
| 1490 | __func__, on ? "" : "de-", rc); |
| 1491 | goto err_xo_vote; |
| 1492 | } |
| 1493 | |
| 1494 | return 0; |
| 1495 | |
| 1496 | err_xo_vote: |
| 1497 | gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, !on); |
| 1498 | return rc; |
| 1499 | } |
| 1500 | |
| 1501 | static int isa1200_dev_setup(bool enable) |
| 1502 | { |
| 1503 | int rc = 0; |
| 1504 | |
| 1505 | struct pm_gpio hap_gpio_config = { |
| 1506 | .direction = PM_GPIO_DIR_OUT, |
| 1507 | .pull = PM_GPIO_PULL_NO, |
| 1508 | .out_strength = PM_GPIO_STRENGTH_HIGH, |
| 1509 | .function = PM_GPIO_FUNC_NORMAL, |
| 1510 | .inv_int_pol = 0, |
| 1511 | .vin_sel = 2, |
| 1512 | .output_buffer = PM_GPIO_OUT_BUF_CMOS, |
| 1513 | .output_value = 0, |
| 1514 | }; |
| 1515 | |
| 1516 | if (enable == true) { |
| 1517 | rc = pm8xxx_gpio_config(PM_HAP_EN_GPIO, &hap_gpio_config); |
| 1518 | if (rc) { |
| 1519 | pr_err("%s: pm8921 gpio %d config failed(%d)\n", |
| 1520 | __func__, PM_HAP_EN_GPIO, rc); |
| 1521 | return rc; |
| 1522 | } |
| 1523 | |
| 1524 | rc = pm8xxx_gpio_config(PM_HAP_LEN_GPIO, &hap_gpio_config); |
| 1525 | if (rc) { |
| 1526 | pr_err("%s: pm8921 gpio %d config failed(%d)\n", |
| 1527 | __func__, PM_HAP_LEN_GPIO, rc); |
| 1528 | return rc; |
| 1529 | } |
| 1530 | |
| 1531 | rc = gpio_request(HAP_SHIFT_LVL_OE_GPIO, "hap_shft_lvl_oe"); |
| 1532 | if (rc) { |
| 1533 | pr_err("%s: unable to request gpio %d (%d)\n", |
| 1534 | __func__, HAP_SHIFT_LVL_OE_GPIO, rc); |
| 1535 | return rc; |
| 1536 | } |
| 1537 | |
| 1538 | rc = gpio_direction_output(HAP_SHIFT_LVL_OE_GPIO, 0); |
| 1539 | if (rc) { |
| 1540 | pr_err("%s: Unable to set direction\n", __func__); |
| 1541 | goto free_gpio; |
| 1542 | } |
| 1543 | |
| 1544 | xo_handle_d1 = msm_xo_get(MSM_XO_TCXO_D1, "isa1200"); |
| 1545 | if (IS_ERR(xo_handle_d1)) { |
| 1546 | rc = PTR_ERR(xo_handle_d1); |
| 1547 | pr_err("%s: failed to get the handle for D1(%d)\n", |
| 1548 | __func__, rc); |
| 1549 | goto gpio_set_dir; |
| 1550 | } |
| 1551 | } else { |
| 1552 | gpio_free(HAP_SHIFT_LVL_OE_GPIO); |
| 1553 | |
| 1554 | msm_xo_put(xo_handle_d1); |
| 1555 | } |
| 1556 | |
| 1557 | return 0; |
| 1558 | |
| 1559 | gpio_set_dir: |
| 1560 | gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, 0); |
| 1561 | free_gpio: |
| 1562 | gpio_free(HAP_SHIFT_LVL_OE_GPIO); |
| 1563 | return rc; |
| 1564 | } |
| 1565 | |
| 1566 | static struct isa1200_regulator isa1200_reg_data[] = { |
| 1567 | { |
| 1568 | .name = "vcc_i2c", |
| 1569 | .min_uV = ISA_I2C_VTG_MIN_UV, |
| 1570 | .max_uV = ISA_I2C_VTG_MAX_UV, |
| 1571 | .load_uA = ISA_I2C_CURR_UA, |
| 1572 | }, |
| 1573 | }; |
| 1574 | |
| 1575 | static struct isa1200_platform_data isa1200_1_pdata = { |
| 1576 | .name = "vibrator", |
| 1577 | .dev_setup = isa1200_dev_setup, |
| 1578 | .power_on = isa1200_power, |
| 1579 | .hap_en_gpio = PM_HAP_EN_GPIO, |
| 1580 | .hap_len_gpio = PM_HAP_LEN_GPIO, |
| 1581 | .max_timeout = 15000, |
| 1582 | .mode_ctrl = PWM_GEN_MODE, |
| 1583 | .pwm_fd = { |
| 1584 | .pwm_div = 256, |
| 1585 | }, |
| 1586 | .is_erm = false, |
| 1587 | .smart_en = true, |
| 1588 | .ext_clk_en = true, |
| 1589 | .chip_en = 1, |
| 1590 | .regulator_info = isa1200_reg_data, |
| 1591 | .num_regulators = ARRAY_SIZE(isa1200_reg_data), |
| 1592 | }; |
| 1593 | |
| 1594 | static struct i2c_board_info msm_isa1200_board_info[] __initdata = { |
| 1595 | { |
| 1596 | I2C_BOARD_INFO("isa1200_1", 0x90>>1), |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1597 | }, |
| 1598 | }; |
| 1599 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1600 | #define CYTTSP_TS_GPIO_IRQ 11 |
| 1601 | #define CYTTSP_TS_SLEEP_GPIO 50 |
| 1602 | #define CYTTSP_TS_RESOUT_N_GPIO 52 |
| 1603 | |
| 1604 | /*virtual key support */ |
| 1605 | static ssize_t tma340_vkeys_show(struct kobject *kobj, |
| 1606 | struct kobj_attribute *attr, char *buf) |
| 1607 | { |
| 1608 | return snprintf(buf, 200, |
| 1609 | __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97" |
| 1610 | ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97" |
| 1611 | ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97" |
| 1612 | ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97" |
| 1613 | "\n"); |
| 1614 | } |
| 1615 | |
| 1616 | static struct kobj_attribute tma340_vkeys_attr = { |
| 1617 | .attr = { |
| 1618 | .mode = S_IRUGO, |
| 1619 | }, |
| 1620 | .show = &tma340_vkeys_show, |
| 1621 | }; |
| 1622 | |
| 1623 | static struct attribute *tma340_properties_attrs[] = { |
| 1624 | &tma340_vkeys_attr.attr, |
| 1625 | NULL |
| 1626 | }; |
| 1627 | |
| 1628 | static struct attribute_group tma340_properties_attr_group = { |
| 1629 | .attrs = tma340_properties_attrs, |
| 1630 | }; |
| 1631 | |
| 1632 | |
| 1633 | static int cyttsp_platform_init(struct i2c_client *client) |
| 1634 | { |
| 1635 | int rc = 0; |
| 1636 | static struct kobject *tma340_properties_kobj; |
| 1637 | |
| 1638 | tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c"; |
| 1639 | tma340_properties_kobj = kobject_create_and_add("board_properties", |
| 1640 | NULL); |
| 1641 | if (tma340_properties_kobj) |
| 1642 | rc = sysfs_create_group(tma340_properties_kobj, |
| 1643 | &tma340_properties_attr_group); |
| 1644 | if (!tma340_properties_kobj || rc) |
| 1645 | pr_err("%s: failed to create board_properties\n", |
| 1646 | __func__); |
| 1647 | |
| 1648 | return 0; |
| 1649 | } |
| 1650 | |
| 1651 | static struct cyttsp_regulator regulator_data[] = { |
| 1652 | { |
| 1653 | .name = "vdd", |
| 1654 | .min_uV = CY_TMA300_VTG_MIN_UV, |
| 1655 | .max_uV = CY_TMA300_VTG_MAX_UV, |
Anirudh Ghayal | f9929b1 | 2011-09-07 15:57:36 +0530 | [diff] [blame] | 1656 | .hpm_load_uA = CY_TMA300_CURR_24HZ_UA, |
| 1657 | .lpm_load_uA = CY_TMA300_SLEEP_CURR_UA, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1658 | }, |
| 1659 | /* TODO: Remove after runtime PM is enabled in I2C driver */ |
| 1660 | { |
| 1661 | .name = "vcc_i2c", |
| 1662 | .min_uV = CY_I2C_VTG_MIN_UV, |
| 1663 | .max_uV = CY_I2C_VTG_MAX_UV, |
Anirudh Ghayal | f9929b1 | 2011-09-07 15:57:36 +0530 | [diff] [blame] | 1664 | .hpm_load_uA = CY_I2C_CURR_UA, |
| 1665 | .lpm_load_uA = CY_I2C_SLEEP_CURR_UA, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1666 | }, |
| 1667 | }; |
| 1668 | |
| 1669 | static struct cyttsp_platform_data cyttsp_pdata = { |
| 1670 | .panel_maxx = 634, |
| 1671 | .panel_maxy = 1166, |
| 1672 | .disp_maxx = 616, |
| 1673 | .disp_maxy = 1023, |
| 1674 | .disp_minx = 0, |
| 1675 | .disp_miny = 16, |
| 1676 | .flags = 0x01, |
| 1677 | .gen = CY_GEN3, /* or */ |
| 1678 | .use_st = CY_USE_ST, |
| 1679 | .use_mt = CY_USE_MT, |
| 1680 | .use_hndshk = CY_SEND_HNDSHK, |
| 1681 | .use_trk_id = CY_USE_TRACKING_ID, |
Anirudh Ghayal | e96f66d | 2011-08-11 14:06:38 +0530 | [diff] [blame] | 1682 | .use_sleep = CY_USE_DEEP_SLEEP_SEL | CY_USE_LOW_POWER_SEL, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1683 | .use_gestures = CY_USE_GESTURES, |
| 1684 | .fw_fname = "cyttsp_8960_cdp.hex", |
| 1685 | /* activate up to 4 groups |
| 1686 | * and set active distance |
| 1687 | */ |
| 1688 | .gest_set = CY_GEST_GRP1 | CY_GEST_GRP2 | |
| 1689 | CY_GEST_GRP3 | CY_GEST_GRP4 | |
| 1690 | CY_ACT_DIST, |
| 1691 | /* change act_intrvl to customize the Active power state |
| 1692 | * scanning/processing refresh interval for Operating mode |
| 1693 | */ |
| 1694 | .act_intrvl = CY_ACT_INTRVL_DFLT, |
| 1695 | /* change tch_tmout to customize the touch timeout for the |
| 1696 | * Active power state for Operating mode |
| 1697 | */ |
| 1698 | .tch_tmout = CY_TCH_TMOUT_DFLT, |
| 1699 | /* change lp_intrvl to customize the Low Power power state |
| 1700 | * scanning/processing refresh interval for Operating mode |
| 1701 | */ |
| 1702 | .lp_intrvl = CY_LP_INTRVL_DFLT, |
| 1703 | .sleep_gpio = CYTTSP_TS_SLEEP_GPIO, |
| 1704 | .resout_gpio = CYTTSP_TS_RESOUT_N_GPIO, |
| 1705 | .irq_gpio = CYTTSP_TS_GPIO_IRQ, |
| 1706 | .regulator_info = regulator_data, |
| 1707 | .num_regulators = ARRAY_SIZE(regulator_data), |
| 1708 | .init = cyttsp_platform_init, |
Mohan Pallaka | 49c37d6 | 2011-08-01 11:52:00 +0530 | [diff] [blame] | 1709 | .correct_fw_ver = 9, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1710 | }; |
| 1711 | |
| 1712 | static struct i2c_board_info cyttsp_info[] __initdata = { |
| 1713 | { |
| 1714 | I2C_BOARD_INFO(CY_I2C_NAME, 0x24), |
| 1715 | .platform_data = &cyttsp_pdata, |
| 1716 | #ifndef CY_USE_TIMER |
| 1717 | .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ), |
| 1718 | #endif /* CY_USE_TIMER */ |
| 1719 | }, |
| 1720 | }; |
| 1721 | |
Jing Lin | dc4413c | 2012-01-16 15:22:52 -0800 | [diff] [blame] | 1722 | /* configuration data for mxt1386 */ |
| 1723 | static const u8 mxt1386_config_data[] = { |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1724 | /* T6 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1725 | 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1726 | /* T38 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 1727 | 11, 2, 0, 11, 11, 11, 0, 0, 0, 0, |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1728 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1729 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1730 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1731 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1732 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1733 | 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1734 | /* T7 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1735 | 100, 16, 50, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1736 | /* T8 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 1737 | 8, 0, 0, 0, 0, 0, 8, 14, 50, 215, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1738 | /* T9 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 1739 | 131, 0, 0, 26, 42, 0, 32, 63, 3, 5, |
| 1740 | 0, 2, 1, 113, 10, 10, 8, 10, 255, 2, |
| 1741 | 85, 5, 0, 0, 20, 20, 75, 25, 202, 29, |
| 1742 | 10, 10, 45, 46, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1743 | /* T15 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1744 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1745 | 0, |
Anirudh Ghayal | dab4e0d | 2012-01-09 14:59:27 +0530 | [diff] [blame] | 1746 | /* T18 Object */ |
| 1747 | 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1748 | /* T22 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 1749 | 5, 0, 0, 0, 0, 0, 0, 0, 30, 0, |
| 1750 | 0, 0, 5, 8, 10, 13, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1751 | /* T24 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1752 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1753 | 0, 0, 0, 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1754 | /* T25 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1755 | 3, 0, 188, 52, 52, 33, 0, 0, 0, 0, |
| 1756 | 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1757 | /* T27 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1758 | 0, 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1759 | /* T28 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 1760 | 0, 0, 0, 8, 12, 60, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1761 | /* T40 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1762 | 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1763 | /* T41 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1764 | 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1765 | /* T43 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1766 | 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1767 | }; |
| 1768 | |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 1769 | /* configuration data for mxt1386e using V1.0 firmware */ |
| 1770 | static const u8 mxt1386e_config_data_v1_0[] = { |
| 1771 | /* T6 Object */ |
| 1772 | 0, 0, 0, 0, 0, 0, |
| 1773 | /* T38 Object */ |
| 1774 | 12, 1, 0, 17, 1, 12, 0, 0, 0, 0, |
| 1775 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1776 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1777 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1778 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1779 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1780 | 0, 0, 0, 0, |
| 1781 | /* T7 Object */ |
| 1782 | 100, 16, 50, |
| 1783 | /* T8 Object */ |
| 1784 | 25, 0, 20, 20, 0, 0, 20, 50, 0, 0, |
| 1785 | /* T9 Object */ |
| 1786 | 131, 0, 0, 26, 42, 0, 32, 80, 2, 5, |
| 1787 | 0, 5, 5, 0, 10, 30, 10, 10, 255, 2, |
| 1788 | 85, 5, 10, 10, 10, 10, 135, 55, 70, 40, |
| 1789 | 10, 5, 0, 0, 0, |
| 1790 | /* T18 Object */ |
| 1791 | 0, 0, |
| 1792 | /* T24 Object */ |
| 1793 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1794 | 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1795 | /* T25 Object */ |
| 1796 | 3, 0, 60, 115, 156, 99, |
| 1797 | /* T27 Object */ |
| 1798 | 0, 0, 0, 0, 0, 0, 0, |
| 1799 | /* T40 Object */ |
| 1800 | 0, 0, 0, 0, 0, |
| 1801 | /* T42 Object */ |
| 1802 | 2, 0, 255, 0, 255, 0, 0, 0, 0, 0, |
| 1803 | /* T43 Object */ |
| 1804 | 0, 0, 0, 0, 0, 0, 0, |
| 1805 | /* T46 Object */ |
| 1806 | 64, 0, 20, 20, 0, 0, 0, 0, 0, |
| 1807 | /* T47 Object */ |
| 1808 | 0, 0, 0, 0, 0, 0, 3, 64, 66, 0, |
| 1809 | /* T48 Object */ |
| 1810 | 31, 64, 64, 0, 0, 0, 0, 0, 0, 0, |
| 1811 | 48, 40, 0, 10, 10, 0, 0, 100, 10, 80, |
| 1812 | 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, |
| 1813 | 52, 0, 12, 0, 17, 0, 1, 0, 0, 0, |
| 1814 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1815 | 0, 0, 0, 0, |
| 1816 | /* T56 Object */ |
| 1817 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1818 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1819 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1820 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1821 | 2, 99, 33, |
| 1822 | }; |
| 1823 | |
| 1824 | /* configuration data for mxt1386e using V2.1 firmware */ |
| 1825 | static const u8 mxt1386e_config_data_v2_1[] = { |
| 1826 | /* T6 Object */ |
| 1827 | 0, 0, 0, 0, 0, 0, |
| 1828 | /* T38 Object */ |
| 1829 | 12, 2, 0, 17, 1, 12, 0, 0, 0, 0, |
| 1830 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1831 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1832 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1833 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1834 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1835 | 0, 0, 0, 0, |
| 1836 | /* T7 Object */ |
| 1837 | 100, 16, 50, |
| 1838 | /* T8 Object */ |
| 1839 | 25, 0, 20, 20, 0, 0, 20, 50, 0, 0, |
| 1840 | /* T9 Object */ |
| 1841 | 131, 0, 0, 26, 42, 0, 32, 80, 2, 5, |
| 1842 | 0, 5, 5, 0, 10, 30, 10, 10, 255, 2, |
| 1843 | 85, 5, 10, 10, 10, 10, 135, 55, 70, 40, |
| 1844 | 10, 5, 0, 0, 0, |
| 1845 | /* T18 Object */ |
| 1846 | 0, 0, |
| 1847 | /* T24 Object */ |
| 1848 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1849 | 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1850 | /* T25 Object */ |
| 1851 | 3, 0, 60, 115, 156, 99, |
| 1852 | /* T27 Object */ |
| 1853 | 0, 0, 0, 0, 0, 0, 0, |
| 1854 | /* T40 Object */ |
| 1855 | 0, 0, 0, 0, 0, |
| 1856 | /* T42 Object */ |
| 1857 | 2, 0, 255, 0, 255, 0, 0, 0, 0, 0, |
| 1858 | /* T43 Object */ |
| 1859 | 0, 0, 0, 0, 0, 0, 0, 64, 0, 8, |
| 1860 | 16, |
| 1861 | /* T46 Object */ |
| 1862 | 64, 0, 20, 20, 0, 0, 0, 0, 0, |
| 1863 | /* T47 Object */ |
| 1864 | 0, 0, 0, 0, 0, 0, 3, 64, 66, 0, |
| 1865 | /* T48 Object */ |
| 1866 | 31, 64, 64, 0, 0, 0, 0, 0, 0, 0, |
| 1867 | 48, 40, 0, 10, 10, 0, 0, 100, 10, 80, |
| 1868 | 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, |
| 1869 | 52, 0, 12, 0, 17, 0, 1, 0, 0, 0, |
| 1870 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1871 | 0, 0, 0, 0, |
| 1872 | /* T56 Object */ |
| 1873 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1874 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1875 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1876 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1877 | 2, 99, 33, 0, 149, 24, 193, 255, 255, 255, |
| 1878 | 255, |
| 1879 | }; |
| 1880 | |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 1881 | /* configuration data for mxt1386e on 3D SKU using V2.1 firmware */ |
| 1882 | static const u8 mxt1386e_config_data_3d[] = { |
| 1883 | /* T6 Object */ |
| 1884 | 0, 0, 0, 0, 0, 0, |
| 1885 | /* T38 Object */ |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 1886 | 13, 1, 0, 23, 2, 12, 0, 0, 0, 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 1887 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1888 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1889 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1890 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1891 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1892 | 0, 0, 0, 0, |
| 1893 | /* T7 Object */ |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 1894 | 100, 10, 50, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 1895 | /* T8 Object */ |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 1896 | 25, 0, 20, 20, 0, 0, 0, 0, 0, 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 1897 | /* T9 Object */ |
| 1898 | 131, 0, 0, 26, 42, 0, 32, 80, 2, 5, |
| 1899 | 0, 5, 5, 0, 10, 30, 10, 10, 175, 4, |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 1900 | 127, 7, 26, 21, 17, 19, 143, 35, 207, 40, |
| 1901 | 20, 5, 54, 49, 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 1902 | /* T18 Object */ |
| 1903 | 0, 0, |
| 1904 | /* T24 Object */ |
| 1905 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1906 | 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1907 | /* T25 Object */ |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 1908 | 0, 0, 72, 113, 168, 97, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 1909 | /* T27 Object */ |
| 1910 | 0, 0, 0, 0, 0, 0, 0, |
| 1911 | /* T40 Object */ |
| 1912 | 0, 0, 0, 0, 0, |
| 1913 | /* T42 Object */ |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 1914 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 1915 | /* T43 Object */ |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 1916 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1917 | 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 1918 | /* T46 Object */ |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 1919 | 68, 0, 16, 16, 0, 0, 0, 0, 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 1920 | /* T47 Object */ |
| 1921 | 0, 0, 0, 0, 0, 0, 3, 64, 66, 0, |
| 1922 | /* T48 Object */ |
| 1923 | 31, 64, 64, 0, 0, 0, 0, 0, 0, 0, |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 1924 | 32, 50, 0, 10, 10, 0, 0, 100, 10, 90, |
| 1925 | 0, 0, 0, 0, 0, 0, 0, 10, 1, 30, |
| 1926 | 52, 10, 5, 0, 33, 0, 1, 0, 0, 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 1927 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1928 | 0, 0, 0, 0, |
| 1929 | /* T56 Object */ |
| 1930 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1931 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1932 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1933 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 1934 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1935 | 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 1936 | }; |
| 1937 | |
Amy Maloche | 08266db | 2011-11-04 11:07:16 -0700 | [diff] [blame] | 1938 | #define MXT_TS_GPIO_IRQ 11 |
| 1939 | #define MXT_TS_LDO_EN_GPIO 50 |
| 1940 | #define MXT_TS_RESET_GPIO 52 |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1941 | |
| 1942 | static void mxt_init_hw_liquid(void) |
| 1943 | { |
| 1944 | int rc; |
| 1945 | |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1946 | rc = gpio_request(MXT_TS_LDO_EN_GPIO, "mxt_ldo_en_gpio"); |
| 1947 | if (rc) { |
Amy Maloche | 08266db | 2011-11-04 11:07:16 -0700 | [diff] [blame] | 1948 | pr_err("%s: unable to request mxt_ldo_en_gpio [%d]\n", |
| 1949 | __func__, MXT_TS_LDO_EN_GPIO); |
| 1950 | return; |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1951 | } |
| 1952 | |
| 1953 | rc = gpio_direction_output(MXT_TS_LDO_EN_GPIO, 1); |
| 1954 | if (rc) { |
Amy Maloche | 08266db | 2011-11-04 11:07:16 -0700 | [diff] [blame] | 1955 | pr_err("%s: unable to set_direction for mxt_ldo_en_gpio [%d]\n", |
| 1956 | __func__, MXT_TS_LDO_EN_GPIO); |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1957 | goto err_ldo_gpio_req; |
| 1958 | } |
| 1959 | |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1960 | return; |
| 1961 | |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1962 | err_ldo_gpio_req: |
| 1963 | gpio_free(MXT_TS_LDO_EN_GPIO); |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1964 | } |
| 1965 | |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 1966 | static struct mxt_config_info mxt_config_array_2d[] = { |
Jing Lin | dc4413c | 2012-01-16 15:22:52 -0800 | [diff] [blame] | 1967 | { |
| 1968 | .config = mxt1386_config_data, |
| 1969 | .config_length = ARRAY_SIZE(mxt1386_config_data), |
| 1970 | .family_id = 0xA0, |
| 1971 | .variant_id = 0x0, |
| 1972 | .version = 0x10, |
| 1973 | .build = 0xAA, |
Anirudh Ghayal | a77941e | 2012-02-23 19:12:26 -0800 | [diff] [blame] | 1974 | .bootldr_id = MXT_BOOTLOADER_ID_1386, |
Jing Lin | dc4413c | 2012-01-16 15:22:52 -0800 | [diff] [blame] | 1975 | }, |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 1976 | { |
| 1977 | .config = mxt1386e_config_data_v1_0, |
| 1978 | .config_length = ARRAY_SIZE(mxt1386e_config_data_v1_0), |
| 1979 | .family_id = 0xA0, |
| 1980 | .variant_id = 0x2, |
| 1981 | .version = 0x10, |
| 1982 | .build = 0xAA, |
Anirudh Ghayal | a77941e | 2012-02-23 19:12:26 -0800 | [diff] [blame] | 1983 | .bootldr_id = MXT_BOOTLOADER_ID_1386E, |
Anirudh Ghayal | 3432d7f | 2012-02-17 14:59:53 -0800 | [diff] [blame] | 1984 | .fw_name = "atmel_8960_liquid_v2_1_AA.hex", |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 1985 | }, |
| 1986 | { |
| 1987 | .config = mxt1386e_config_data_v2_1, |
| 1988 | .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1), |
| 1989 | .family_id = 0xA0, |
| 1990 | .variant_id = 0x7, |
| 1991 | .version = 0x21, |
| 1992 | .build = 0xAA, |
Anirudh Ghayal | a77941e | 2012-02-23 19:12:26 -0800 | [diff] [blame] | 1993 | .bootldr_id = MXT_BOOTLOADER_ID_1386E, |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 1994 | }, |
Jing Lin | dc4413c | 2012-01-16 15:22:52 -0800 | [diff] [blame] | 1995 | }; |
| 1996 | |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 1997 | static struct mxt_platform_data mxt_platform_data_2d = { |
| 1998 | .config_array = mxt_config_array_2d, |
| 1999 | .config_array_size = ARRAY_SIZE(mxt_config_array_2d), |
Mohan Pallaka | 56a1a5d | 2012-02-23 12:05:13 -0800 | [diff] [blame] | 2000 | .panel_minx = 0, |
| 2001 | .panel_maxx = 1365, |
| 2002 | .panel_miny = 0, |
| 2003 | .panel_maxy = 767, |
| 2004 | .disp_minx = 0, |
| 2005 | .disp_maxx = 1365, |
| 2006 | .disp_miny = 0, |
| 2007 | .disp_maxy = 767, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2008 | .irqflags = IRQF_TRIGGER_FALLING, |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2009 | .i2c_pull_up = true, |
Amy Maloche | 08266db | 2011-11-04 11:07:16 -0700 | [diff] [blame] | 2010 | .reset_gpio = MXT_TS_RESET_GPIO, |
| 2011 | .irq_gpio = MXT_TS_GPIO_IRQ, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2012 | }; |
| 2013 | |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2014 | static struct mxt_config_info mxt_config_array_3d[] = { |
| 2015 | { |
| 2016 | .config = mxt1386e_config_data_3d, |
| 2017 | .config_length = ARRAY_SIZE(mxt1386e_config_data_3d), |
| 2018 | .family_id = 0xA0, |
| 2019 | .variant_id = 0x7, |
| 2020 | .version = 0x21, |
| 2021 | .build = 0xAA, |
| 2022 | }, |
| 2023 | }; |
| 2024 | |
| 2025 | static struct mxt_platform_data mxt_platform_data_3d = { |
| 2026 | .config_array = mxt_config_array_3d, |
| 2027 | .config_array_size = ARRAY_SIZE(mxt_config_array_3d), |
Mohan Pallaka | 56a1a5d | 2012-02-23 12:05:13 -0800 | [diff] [blame] | 2028 | .panel_minx = 0, |
| 2029 | .panel_maxx = 1919, |
| 2030 | .panel_miny = 0, |
| 2031 | .panel_maxy = 1199, |
| 2032 | .disp_minx = 0, |
| 2033 | .disp_maxx = 1919, |
| 2034 | .disp_miny = 0, |
| 2035 | .disp_maxy = 1199, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2036 | .irqflags = IRQF_TRIGGER_FALLING, |
| 2037 | .i2c_pull_up = true, |
| 2038 | .reset_gpio = MXT_TS_RESET_GPIO, |
| 2039 | .irq_gpio = MXT_TS_GPIO_IRQ, |
| 2040 | }; |
| 2041 | |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2042 | static struct i2c_board_info mxt_device_info[] __initdata = { |
| 2043 | { |
| 2044 | I2C_BOARD_INFO("atmel_mxt_ts", 0x5b), |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2045 | .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ), |
| 2046 | }, |
| 2047 | }; |
| 2048 | |
Eugene Yasman | d2316b8 | 2011-12-07 18:23:48 +0200 | [diff] [blame] | 2049 | static struct i2c_board_info sii_device_info[] __initdata = { |
| 2050 | { |
| 2051 | I2C_BOARD_INFO("Sil-9244", 0x39), |
| 2052 | .flags = I2C_CLIENT_WAKE, |
| 2053 | .irq = MSM_GPIO_TO_INT(15), |
| 2054 | }, |
| 2055 | }; |
| 2056 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2057 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi4_pdata = { |
| 2058 | .clk_freq = 100000, |
| 2059 | .src_clk_rate = 24000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2060 | }; |
| 2061 | |
| 2062 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi3_pdata = { |
| 2063 | .clk_freq = 100000, |
| 2064 | .src_clk_rate = 24000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2065 | }; |
| 2066 | |
| 2067 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi10_pdata = { |
| 2068 | .clk_freq = 100000, |
| 2069 | .src_clk_rate = 24000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2070 | }; |
| 2071 | |
| 2072 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi12_pdata = { |
| 2073 | .clk_freq = 100000, |
| 2074 | .src_clk_rate = 24000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2075 | }; |
| 2076 | |
Maheshkumar Sivasubramanian | 6866b1c | 2011-06-07 14:20:33 -0600 | [diff] [blame] | 2077 | static struct msm_pm_sleep_status_data msm_pm_slp_sts_data = { |
| 2078 | .base_addr = MSM_ACC0_BASE + 0x08, |
| 2079 | .cpu_offset = MSM_ACC1_BASE - MSM_ACC0_BASE, |
| 2080 | .mask = 1UL << 13, |
| 2081 | }; |
| 2082 | |
Stepan Moskovchenko | 93d79ec | 2011-09-21 16:52:16 -0700 | [diff] [blame] | 2083 | static struct ks8851_pdata spi_eth_pdata = { |
| 2084 | .irq_gpio = KS8851_IRQ_GPIO, |
| 2085 | .rst_gpio = KS8851_RST_GPIO, |
| 2086 | }; |
Praveen Chidambaram | 043f4ce | 2011-08-02 09:37:59 -0600 | [diff] [blame] | 2087 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2088 | static struct spi_board_info spi_board_info[] __initdata = { |
| 2089 | { |
| 2090 | .modalias = "ks8851", |
| 2091 | .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO), |
| 2092 | .max_speed_hz = 19200000, |
| 2093 | .bus_num = 0, |
| 2094 | .chip_select = 0, |
| 2095 | .mode = SPI_MODE_0, |
Stepan Moskovchenko | 93d79ec | 2011-09-21 16:52:16 -0700 | [diff] [blame] | 2096 | .platform_data = &spi_eth_pdata |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2097 | }, |
Chandan Uddaraju | 15e54b9 | 2011-09-12 10:52:36 -0700 | [diff] [blame] | 2098 | { |
| 2099 | .modalias = "dsi_novatek_3d_panel_spi", |
| 2100 | .max_speed_hz = 10800000, |
| 2101 | .bus_num = 0, |
| 2102 | .chip_select = 1, |
| 2103 | .mode = SPI_MODE_0, |
| 2104 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2105 | }; |
| 2106 | |
| 2107 | static struct platform_device msm_device_saw_core0 = { |
| 2108 | .name = "saw-regulator", |
| 2109 | .id = 0, |
| 2110 | .dev = { |
| 2111 | .platform_data = &msm_saw_regulator_pdata_s5, |
| 2112 | }, |
| 2113 | }; |
| 2114 | |
| 2115 | static struct platform_device msm_device_saw_core1 = { |
| 2116 | .name = "saw-regulator", |
| 2117 | .id = 1, |
| 2118 | .dev = { |
| 2119 | .platform_data = &msm_saw_regulator_pdata_s6, |
| 2120 | }, |
| 2121 | }; |
| 2122 | |
Siddartha Mohanadoss | ba21fdd | 2011-08-18 10:05:27 -0700 | [diff] [blame] | 2123 | static struct tsens_platform_data msm_tsens_pdata = { |
Siddartha Mohanadoss | caeaa92 | 2012-02-07 16:41:38 -0800 | [diff] [blame] | 2124 | .slope = {910, 910, 910, 910, 910}, |
Siddartha Mohanadoss | ba21fdd | 2011-08-18 10:05:27 -0700 | [diff] [blame] | 2125 | .tsens_factor = 1000, |
| 2126 | .hw_type = MSM_8960, |
| 2127 | .tsens_num_sensor = 5, |
| 2128 | }; |
| 2129 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2130 | #ifdef CONFIG_MSM_FAKE_BATTERY |
| 2131 | static struct platform_device fish_battery_device = { |
| 2132 | .name = "fish_battery", |
| 2133 | }; |
| 2134 | #endif |
| 2135 | |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 2136 | static struct platform_device msm8960_device_ext_5v_vreg __devinitdata = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2137 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2138 | .id = PM8921_MPP_PM_TO_SYS(7), |
| 2139 | .dev = { |
| 2140 | .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V], |
| 2141 | }, |
| 2142 | }; |
| 2143 | |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 2144 | static struct platform_device msm8960_device_ext_l2_vreg __devinitdata = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2145 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2146 | .id = 91, |
| 2147 | .dev = { |
| 2148 | .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_L2], |
| 2149 | }, |
| 2150 | }; |
| 2151 | |
David Collins | b10be1d | 2011-09-02 10:29:31 -0700 | [diff] [blame] | 2152 | static struct platform_device msm8960_device_ext_3p3v_vreg __devinitdata = { |
| 2153 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2154 | .id = PM8921_GPIO_PM_TO_SYS(17), |
| 2155 | .dev = { |
| 2156 | .platform_data = |
| 2157 | &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V], |
| 2158 | }, |
| 2159 | }; |
| 2160 | |
David Collins | 35a78f5 | 2011-12-14 15:54:25 -0800 | [diff] [blame] | 2161 | static struct platform_device msm8960_device_ext_otg_sw_vreg __devinitdata = { |
| 2162 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2163 | .id = PM8921_GPIO_PM_TO_SYS(42), |
| 2164 | .dev = { |
| 2165 | .platform_data = |
| 2166 | &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_OTG_SW], |
| 2167 | }, |
| 2168 | }; |
| 2169 | |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 2170 | static struct platform_device msm8960_device_rpm_regulator __devinitdata = { |
| 2171 | .name = "rpm-regulator", |
| 2172 | .id = -1, |
| 2173 | .dev = { |
| 2174 | .platform_data = &msm_rpm_regulator_pdata, |
| 2175 | }, |
| 2176 | }; |
| 2177 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2178 | static struct platform_device *common_devices[] __initdata = { |
Stepan Moskovchenko | df13d34 | 2011-08-03 19:01:25 -0700 | [diff] [blame] | 2179 | &msm8960_device_dmov, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2180 | &msm_device_smd, |
| 2181 | &msm8960_device_uart_gsbi5, |
Mayank Rana | 9f51f58 | 2011-08-04 18:35:59 +0530 | [diff] [blame] | 2182 | &msm_device_uart_dm6, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2183 | &msm_device_saw_core0, |
| 2184 | &msm_device_saw_core1, |
| 2185 | &msm8960_device_ext_5v_vreg, |
David Collins | 8757961 | 2012-01-30 16:00:15 -0800 | [diff] [blame] | 2186 | &msm8960_device_ssbi_pmic, |
David Collins | 96aa3e1 | 2012-02-29 10:31:34 -0800 | [diff] [blame] | 2187 | &msm8960_device_ext_otg_sw_vreg, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2188 | &msm8960_device_qup_spi_gsbi1, |
| 2189 | &msm8960_device_qup_i2c_gsbi3, |
| 2190 | &msm8960_device_qup_i2c_gsbi4, |
| 2191 | &msm8960_device_qup_i2c_gsbi10, |
| 2192 | #ifndef CONFIG_MSM_DSPS |
| 2193 | &msm8960_device_qup_i2c_gsbi12, |
| 2194 | #endif |
| 2195 | &msm_slim_ctrl, |
| 2196 | &msm_device_wcnss_wlan, |
| 2197 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 2198 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 2199 | &qcrypto_device, |
| 2200 | #endif |
| 2201 | |
| 2202 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 2203 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 2204 | &qcedev_device, |
| 2205 | #endif |
| 2206 | #ifdef CONFIG_MSM_ROTATOR |
| 2207 | &msm_rotator_device, |
| 2208 | #endif |
| 2209 | &msm_device_sps, |
| 2210 | #ifdef CONFIG_MSM_FAKE_BATTERY |
| 2211 | &fish_battery_device, |
| 2212 | #endif |
Larry Bassel | 41a055b | 2011-12-06 16:15:14 -0800 | [diff] [blame] | 2213 | &fmem_device, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2214 | #ifdef CONFIG_ANDROID_PMEM |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 2215 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2216 | &android_pmem_device, |
| 2217 | &android_pmem_adsp_device, |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 2218 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2219 | &android_pmem_audio_device, |
| 2220 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2221 | &msm_device_vidc, |
| 2222 | &msm_device_bam_dmux, |
| 2223 | &msm_fm_platform_init, |
Mona Hossain | 9c430e3 | 2011-07-27 11:04:47 -0700 | [diff] [blame] | 2224 | |
Joel Nider | a126194 | 2011-09-12 16:30:09 +0300 | [diff] [blame] | 2225 | #if defined(CONFIG_TSIF) || defined(CONFIG_TSIF_MODULE) |
| 2226 | #ifdef CONFIG_MSM_USE_TSIF1 |
| 2227 | &msm_device_tsif[1], |
| 2228 | #else |
| 2229 | &msm_device_tsif[0], |
| 2230 | #endif |
| 2231 | #endif |
| 2232 | |
Mona Hossain | 9c430e3 | 2011-07-27 11:04:47 -0700 | [diff] [blame] | 2233 | #ifdef CONFIG_HW_RANDOM_MSM |
| 2234 | &msm_device_rng, |
| 2235 | #endif |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 2236 | #ifdef CONFIG_ION_MSM |
| 2237 | &ion_dev, |
| 2238 | #endif |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2239 | &msm8960_rpm_device, |
| 2240 | &msm8960_rpm_log_device, |
| 2241 | &msm8960_rpm_stat_device, |
Mona Hossain | 11c03ac | 2011-10-26 12:42:10 -0700 | [diff] [blame] | 2242 | &msm_device_tz_log, |
Pratik Patel | 7831c08 | 2011-06-08 21:44:37 -0700 | [diff] [blame] | 2243 | #ifdef CONFIG_MSM_QDSS |
Pratik Patel | 1403f2a | 2012-03-21 10:10:00 -0700 | [diff] [blame^] | 2244 | &msm_qdss_device, |
Pratik Patel | 7831c08 | 2011-06-08 21:44:37 -0700 | [diff] [blame] | 2245 | &msm_etb_device, |
| 2246 | &msm_tpiu_device, |
| 2247 | &msm_funnel_device, |
Pratik Patel | 492b301 | 2012-03-06 14:22:30 -0800 | [diff] [blame] | 2248 | &msm_etm_device, |
Pratik Patel | 7831c08 | 2011-06-08 21:44:37 -0700 | [diff] [blame] | 2249 | #endif |
Swaminathan Sathappan | b77c65e9 | 2011-09-30 18:36:09 -0700 | [diff] [blame] | 2250 | &msm_device_dspcrashd_8960, |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 2251 | &msm8960_device_watchdog, |
Laura Abbott | f8c03b9 | 2012-02-16 14:57:58 -0800 | [diff] [blame] | 2252 | #ifdef CONFIG_MSM_RTB |
| 2253 | &msm_rtb_device, |
| 2254 | #endif |
Praveen Chidambaram | 8ea3dcd | 2011-12-07 14:46:31 -0700 | [diff] [blame] | 2255 | &msm8960_cpu_idle_device, |
Praveen Chidambaram | 5c8adf2 | 2012-02-23 18:44:37 -0700 | [diff] [blame] | 2256 | &msm8960_msm_gov_device, |
Stepan Moskovchenko | 28662c5 | 2012-03-01 12:48:45 -0800 | [diff] [blame] | 2257 | &msm8960_device_cache_erp, |
Laura Abbott | 306bcc2 | 2012-03-08 11:24:53 -0800 | [diff] [blame] | 2258 | #ifdef CONFIG_MSM_CACHE_DUMP |
| 2259 | &msm_cache_dump_device, |
| 2260 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2261 | }; |
| 2262 | |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2263 | static struct platform_device *sim_devices[] __initdata = { |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 2264 | &msm8960_device_otg, |
| 2265 | &msm8960_device_gadget_peripheral, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2266 | &msm_device_hsusb_host, |
Vijayavardhan Vennapusa | eb56648 | 2011-09-18 07:48:37 +0530 | [diff] [blame] | 2267 | &msm_device_hsic_host, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2268 | &android_usb_device, |
| 2269 | &msm_device_vidc, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2270 | &msm_bus_apps_fabric, |
| 2271 | &msm_bus_sys_fabric, |
| 2272 | &msm_bus_mm_fabric, |
| 2273 | &msm_bus_sys_fpb, |
| 2274 | &msm_bus_cpss_fpb, |
| 2275 | &msm_pcm, |
Kiran Kandi | 5e809b0 | 2012-01-31 00:24:33 -0800 | [diff] [blame] | 2276 | &msm_multi_ch_pcm, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2277 | &msm_pcm_routing, |
| 2278 | &msm_cpudai0, |
| 2279 | &msm_cpudai1, |
| 2280 | &msm_cpudai_hdmi_rx, |
| 2281 | &msm_cpudai_bt_rx, |
| 2282 | &msm_cpudai_bt_tx, |
| 2283 | &msm_cpudai_fm_rx, |
| 2284 | &msm_cpudai_fm_tx, |
Bhalchandra Gajare | 0e795c4 | 2011-08-15 18:10:30 -0700 | [diff] [blame] | 2285 | &msm_cpudai_auxpcm_rx, |
| 2286 | &msm_cpudai_auxpcm_tx, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2287 | &msm_cpu_fe, |
| 2288 | &msm_stub_codec, |
| 2289 | &msm_voice, |
| 2290 | &msm_voip, |
| 2291 | &msm_lpa_pcm, |
Asish Bhattacharya | 96bb6f4 | 2011-11-01 20:36:09 +0530 | [diff] [blame] | 2292 | &msm_compr_dsp, |
Helen Zeng | 0705a5f | 2011-10-14 15:29:52 -0700 | [diff] [blame] | 2293 | &msm_cpudai_incall_music_rx, |
Helen Zeng | e3d716a | 2011-10-14 16:32:16 -0700 | [diff] [blame] | 2294 | &msm_cpudai_incall_record_rx, |
| 2295 | &msm_cpudai_incall_record_tx, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2296 | |
| 2297 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 2298 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 2299 | &qcrypto_device, |
| 2300 | #endif |
| 2301 | |
| 2302 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 2303 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 2304 | &qcedev_device, |
| 2305 | #endif |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2306 | }; |
| 2307 | |
| 2308 | static struct platform_device *rumi3_devices[] __initdata = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2309 | &msm_kgsl_3d0, |
| 2310 | &msm_kgsl_2d0, |
| 2311 | &msm_kgsl_2d1, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2312 | #ifdef CONFIG_MSM_GEMINI |
| 2313 | &msm8960_gemini_device, |
| 2314 | #endif |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2315 | }; |
| 2316 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2317 | static struct platform_device *cdp_devices[] __initdata = { |
Stephen Boyd | eb81988 | 2011-08-29 14:46:30 -0700 | [diff] [blame] | 2318 | &msm_8960_q6_lpass, |
| 2319 | &msm_8960_q6_mss_fw, |
| 2320 | &msm_8960_q6_mss_sw, |
Stephen Boyd | 322a992 | 2011-09-20 01:05:54 -0700 | [diff] [blame] | 2321 | &msm_8960_riva, |
Stephen Boyd | d89eebe | 2011-09-28 23:28:11 -0700 | [diff] [blame] | 2322 | &msm_pil_tzapps, |
Stephen Boyd | 25c4a0b | 2011-09-20 00:12:36 -0700 | [diff] [blame] | 2323 | &msm_pil_dsps, |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 2324 | &msm8960_device_otg, |
| 2325 | &msm8960_device_gadget_peripheral, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2326 | &msm_device_hsusb_host, |
| 2327 | &android_usb_device, |
| 2328 | &msm_pcm, |
Kiran Kandi | 5e809b0 | 2012-01-31 00:24:33 -0800 | [diff] [blame] | 2329 | &msm_multi_ch_pcm, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2330 | &msm_pcm_routing, |
| 2331 | &msm_cpudai0, |
| 2332 | &msm_cpudai1, |
| 2333 | &msm_cpudai_hdmi_rx, |
| 2334 | &msm_cpudai_bt_rx, |
| 2335 | &msm_cpudai_bt_tx, |
| 2336 | &msm_cpudai_fm_rx, |
| 2337 | &msm_cpudai_fm_tx, |
Bhalchandra Gajare | 0e795c4 | 2011-08-15 18:10:30 -0700 | [diff] [blame] | 2338 | &msm_cpudai_auxpcm_rx, |
| 2339 | &msm_cpudai_auxpcm_tx, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2340 | &msm_cpu_fe, |
| 2341 | &msm_stub_codec, |
| 2342 | &msm_kgsl_3d0, |
| 2343 | #ifdef CONFIG_MSM_KGSL_2D |
| 2344 | &msm_kgsl_2d0, |
| 2345 | &msm_kgsl_2d1, |
| 2346 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2347 | #ifdef CONFIG_MSM_GEMINI |
| 2348 | &msm8960_gemini_device, |
| 2349 | #endif |
| 2350 | &msm_voice, |
| 2351 | &msm_voip, |
| 2352 | &msm_lpa_pcm, |
Laxminath Kasam | cee1d60 | 2011-08-01 19:26:57 +0530 | [diff] [blame] | 2353 | &msm_cpudai_afe_01_rx, |
| 2354 | &msm_cpudai_afe_01_tx, |
| 2355 | &msm_cpudai_afe_02_rx, |
| 2356 | &msm_cpudai_afe_02_tx, |
| 2357 | &msm_pcm_afe, |
Asish Bhattacharya | 96bb6f4 | 2011-11-01 20:36:09 +0530 | [diff] [blame] | 2358 | &msm_compr_dsp, |
Helen Zeng | 0705a5f | 2011-10-14 15:29:52 -0700 | [diff] [blame] | 2359 | &msm_cpudai_incall_music_rx, |
Helen Zeng | e3d716a | 2011-10-14 16:32:16 -0700 | [diff] [blame] | 2360 | &msm_cpudai_incall_record_rx, |
| 2361 | &msm_cpudai_incall_record_tx, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2362 | &msm_pcm_hostless, |
| 2363 | &msm_bus_apps_fabric, |
| 2364 | &msm_bus_sys_fabric, |
| 2365 | &msm_bus_mm_fabric, |
| 2366 | &msm_bus_sys_fpb, |
| 2367 | &msm_bus_cpss_fpb, |
| 2368 | }; |
| 2369 | |
| 2370 | static void __init msm8960_i2c_init(void) |
| 2371 | { |
| 2372 | msm8960_device_qup_i2c_gsbi4.dev.platform_data = |
| 2373 | &msm8960_i2c_qup_gsbi4_pdata; |
| 2374 | |
| 2375 | msm8960_device_qup_i2c_gsbi3.dev.platform_data = |
| 2376 | &msm8960_i2c_qup_gsbi3_pdata; |
| 2377 | |
| 2378 | msm8960_device_qup_i2c_gsbi10.dev.platform_data = |
| 2379 | &msm8960_i2c_qup_gsbi10_pdata; |
| 2380 | |
| 2381 | msm8960_device_qup_i2c_gsbi12.dev.platform_data = |
| 2382 | &msm8960_i2c_qup_gsbi12_pdata; |
| 2383 | } |
| 2384 | |
Lucille Sylvester | 34ec369 | 2011-08-16 16:28:04 -0600 | [diff] [blame] | 2385 | static void __init msm8960_gfx_init(void) |
| 2386 | { |
Jeremy Gebben | 58b2dce | 2011-10-13 11:14:19 -0600 | [diff] [blame] | 2387 | uint32_t soc_platform_version = socinfo_get_version(); |
Lucille Sylvester | 34ec369 | 2011-08-16 16:28:04 -0600 | [diff] [blame] | 2388 | if (SOCINFO_VERSION_MAJOR(soc_platform_version) == 1) { |
| 2389 | struct kgsl_device_platform_data *kgsl_3d0_pdata = |
| 2390 | msm_kgsl_3d0.dev.platform_data; |
Lucille Sylvester | dce84cd | 2011-10-12 14:15:37 -0600 | [diff] [blame] | 2391 | kgsl_3d0_pdata->pwrlevel[0].gpu_freq = 320000000; |
| 2392 | kgsl_3d0_pdata->pwrlevel[1].gpu_freq = 266667000; |
Lucille Sylvester | 34ec369 | 2011-08-16 16:28:04 -0600 | [diff] [blame] | 2393 | } |
| 2394 | } |
| 2395 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2396 | static struct msm_cpuidle_state msm_cstates[] __initdata = { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2397 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2398 | {0, 0, "C0", "WFI", |
| 2399 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT}, |
| 2400 | |
| 2401 | {0, 1, "C1", "STANDALONE_POWER_COLLAPSE", |
| 2402 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE}, |
| 2403 | |
| 2404 | {0, 2, "C2", "POWER_COLLAPSE", |
| 2405 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE}, |
| 2406 | |
| 2407 | {1, 0, "C0", "WFI", |
| 2408 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT}, |
| 2409 | |
| 2410 | {1, 1, "C1", "STANDALONE_POWER_COLLAPSE", |
| 2411 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE}, |
| 2412 | }; |
| 2413 | |
| 2414 | static struct msm_pm_platform_data msm_pm_data[MSM_PM_SLEEP_MODE_NR * 2] = { |
| 2415 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = { |
| 2416 | .idle_supported = 1, |
| 2417 | .suspend_supported = 1, |
| 2418 | .idle_enabled = 0, |
| 2419 | .suspend_enabled = 0, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2420 | }, |
| 2421 | |
| 2422 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = { |
| 2423 | .idle_supported = 1, |
| 2424 | .suspend_supported = 1, |
| 2425 | .idle_enabled = 0, |
| 2426 | .suspend_enabled = 0, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2427 | }, |
| 2428 | |
| 2429 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = { |
| 2430 | .idle_supported = 1, |
| 2431 | .suspend_supported = 1, |
| 2432 | .idle_enabled = 1, |
| 2433 | .suspend_enabled = 1, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2434 | }, |
| 2435 | |
| 2436 | [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = { |
| 2437 | .idle_supported = 0, |
| 2438 | .suspend_supported = 1, |
| 2439 | .idle_enabled = 0, |
| 2440 | .suspend_enabled = 0, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2441 | }, |
| 2442 | |
| 2443 | [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = { |
| 2444 | .idle_supported = 1, |
| 2445 | .suspend_supported = 1, |
| 2446 | .idle_enabled = 0, |
| 2447 | .suspend_enabled = 0, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2448 | }, |
| 2449 | |
| 2450 | [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = { |
| 2451 | .idle_supported = 1, |
| 2452 | .suspend_supported = 0, |
| 2453 | .idle_enabled = 1, |
| 2454 | .suspend_enabled = 0, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2455 | }, |
| 2456 | }; |
| 2457 | |
Subhash Jadavani | 933e6a6 | 2011-12-26 18:05:04 +0530 | [diff] [blame] | 2458 | static struct msm_rpmrs_level msm_rpmrs_levels[] = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2459 | { |
| 2460 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT, |
| 2461 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 2462 | true, |
Praveen Chidambaram | 8e499d4 | 2012-02-08 10:32:27 -0700 | [diff] [blame] | 2463 | 100, 650, 801, 200, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2464 | }, |
| 2465 | |
| 2466 | { |
| 2467 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE, |
| 2468 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 2469 | true, |
Praveen Chidambaram | 8e499d4 | 2012-02-08 10:32:27 -0700 | [diff] [blame] | 2470 | 2000, 200, 576000, 2000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2471 | }, |
| 2472 | |
| 2473 | { |
| 2474 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2475 | MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE), |
| 2476 | false, |
Praveen Chidambaram | 8e499d4 | 2012-02-08 10:32:27 -0700 | [diff] [blame] | 2477 | 8500, 51, 1122000, 8500, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2478 | }, |
| 2479 | |
| 2480 | { |
| 2481 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2482 | MSM_RPMRS_LIMITS(ON, HSFS_OPEN, MAX, ACTIVE), |
| 2483 | false, |
Praveen Chidambaram | 8e499d4 | 2012-02-08 10:32:27 -0700 | [diff] [blame] | 2484 | 9000, 51, 1130300, 9000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2485 | }, |
Maheshkumar Sivasubramanian | 7df1236 | 2011-11-02 08:25:49 -0600 | [diff] [blame] | 2486 | { |
| 2487 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2488 | MSM_RPMRS_LIMITS(ON, HSFS_OPEN, ACTIVE, RET_HIGH), |
| 2489 | false, |
Praveen Chidambaram | 8e499d4 | 2012-02-08 10:32:27 -0700 | [diff] [blame] | 2490 | 10000, 51, 1130300, 10000, |
Maheshkumar Sivasubramanian | 7df1236 | 2011-11-02 08:25:49 -0600 | [diff] [blame] | 2491 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2492 | |
| 2493 | { |
| 2494 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2495 | MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE), |
| 2496 | false, |
Praveen Chidambaram | 8e499d4 | 2012-02-08 10:32:27 -0700 | [diff] [blame] | 2497 | 12000, 14, 2205900, 12000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2498 | }, |
| 2499 | |
| 2500 | { |
| 2501 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2502 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE), |
| 2503 | false, |
Praveen Chidambaram | 8e499d4 | 2012-02-08 10:32:27 -0700 | [diff] [blame] | 2504 | 18000, 12, 2364250, 18000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2505 | }, |
| 2506 | |
| 2507 | { |
| 2508 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2509 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH), |
| 2510 | false, |
Praveen Chidambaram | 8e499d4 | 2012-02-08 10:32:27 -0700 | [diff] [blame] | 2511 | 23500, 10, 2667000, 23500, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2512 | }, |
| 2513 | |
| 2514 | { |
| 2515 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2516 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW), |
| 2517 | false, |
Praveen Chidambaram | 8e499d4 | 2012-02-08 10:32:27 -0700 | [diff] [blame] | 2518 | 29700, 5, 2867000, 30000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2519 | }, |
| 2520 | }; |
| 2521 | |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2522 | static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = { |
| 2523 | .levels = &msm_rpmrs_levels[0], |
| 2524 | .num_levels = ARRAY_SIZE(msm_rpmrs_levels), |
| 2525 | .vdd_mem_levels = { |
| 2526 | [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000, |
| 2527 | [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000, |
| 2528 | [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000, |
| 2529 | [MSM_RPMRS_VDD_MEM_MAX] = 1150000, |
| 2530 | }, |
| 2531 | .vdd_dig_levels = { |
| 2532 | [MSM_RPMRS_VDD_DIG_RET_LOW] = 500000, |
| 2533 | [MSM_RPMRS_VDD_DIG_RET_HIGH] = 750000, |
| 2534 | [MSM_RPMRS_VDD_DIG_ACTIVE] = 950000, |
| 2535 | [MSM_RPMRS_VDD_DIG_MAX] = 1150000, |
| 2536 | }, |
| 2537 | .vdd_mask = 0x7FFFFF, |
| 2538 | .rpmrs_target_id = { |
| 2539 | [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK, |
| 2540 | [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST, |
| 2541 | [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_PM8921_S3_0, |
| 2542 | [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_PM8921_S3_1, |
| 2543 | [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8921_L24_0, |
| 2544 | [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8921_L24_1, |
| 2545 | [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL, |
| 2546 | }, |
| 2547 | }; |
| 2548 | |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 2549 | static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = { |
| 2550 | .mode = MSM_PM_BOOT_CONFIG_TZ, |
| 2551 | }; |
| 2552 | |
Subhash Jadavani | 933e6a6 | 2011-12-26 18:05:04 +0530 | [diff] [blame] | 2553 | uint32_t msm_rpm_get_swfi_latency(void) |
| 2554 | { |
| 2555 | int i; |
| 2556 | |
| 2557 | for (i = 0; i < ARRAY_SIZE(msm_rpmrs_levels); i++) { |
| 2558 | if (msm_rpmrs_levels[i].sleep_mode == |
| 2559 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT) |
| 2560 | return msm_rpmrs_levels[i].latency_us; |
| 2561 | } |
| 2562 | |
| 2563 | return 0; |
| 2564 | } |
| 2565 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2566 | #ifdef CONFIG_I2C |
| 2567 | #define I2C_SURF 1 |
| 2568 | #define I2C_FFA (1 << 1) |
| 2569 | #define I2C_RUMI (1 << 2) |
| 2570 | #define I2C_SIM (1 << 3) |
| 2571 | #define I2C_FLUID (1 << 4) |
Amir Samuelov | 05f8780 | 2011-08-27 18:30:12 +0300 | [diff] [blame] | 2572 | #define I2C_LIQUID (1 << 5) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2573 | |
| 2574 | struct i2c_registry { |
| 2575 | u8 machs; |
| 2576 | int bus; |
| 2577 | struct i2c_board_info *info; |
| 2578 | int len; |
| 2579 | }; |
| 2580 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2581 | /* Sensors DSPS platform data */ |
| 2582 | #ifdef CONFIG_MSM_DSPS |
| 2583 | #define DSPS_PIL_GENERIC_NAME "dsps" |
| 2584 | #endif /* CONFIG_MSM_DSPS */ |
| 2585 | |
| 2586 | static void __init msm8960_init_dsps(void) |
| 2587 | { |
| 2588 | #ifdef CONFIG_MSM_DSPS |
| 2589 | struct msm_dsps_platform_data *pdata = |
| 2590 | msm_dsps_device.dev.platform_data; |
| 2591 | pdata->pil_name = DSPS_PIL_GENERIC_NAME; |
| 2592 | pdata->gpios = NULL; |
| 2593 | pdata->gpios_num = 0; |
| 2594 | |
| 2595 | platform_device_register(&msm_dsps_device); |
| 2596 | #endif /* CONFIG_MSM_DSPS */ |
| 2597 | } |
| 2598 | |
Vamsi Krishna | 6aa6b1f | 2011-12-14 22:55:20 -0800 | [diff] [blame] | 2599 | static int hsic_peripheral_status = 1; |
| 2600 | static DEFINE_MUTEX(hsic_status_lock); |
| 2601 | |
| 2602 | void peripheral_connect() |
| 2603 | { |
| 2604 | mutex_lock(&hsic_status_lock); |
| 2605 | if (hsic_peripheral_status) |
| 2606 | goto out; |
| 2607 | platform_device_add(&msm_device_hsic_host); |
| 2608 | hsic_peripheral_status = 1; |
| 2609 | out: |
| 2610 | mutex_unlock(&hsic_status_lock); |
| 2611 | } |
| 2612 | EXPORT_SYMBOL(peripheral_connect); |
| 2613 | |
| 2614 | void peripheral_disconnect() |
| 2615 | { |
| 2616 | mutex_lock(&hsic_status_lock); |
| 2617 | if (!hsic_peripheral_status) |
| 2618 | goto out; |
| 2619 | platform_device_del(&msm_device_hsic_host); |
| 2620 | hsic_peripheral_status = 0; |
| 2621 | out: |
| 2622 | mutex_unlock(&hsic_status_lock); |
| 2623 | } |
| 2624 | EXPORT_SYMBOL(peripheral_disconnect); |
| 2625 | |
Vamsi Krishna | 98f54fb | 2011-11-02 14:55:41 -0700 | [diff] [blame] | 2626 | static void __init msm8960_init_hsic(void) |
| 2627 | { |
| 2628 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
| 2629 | uint32_t version = socinfo_get_version(); |
| 2630 | |
Vamsi Krishna | f74d2edb | 2011-12-02 10:41:11 -0800 | [diff] [blame] | 2631 | if (SOCINFO_VERSION_MAJOR(version) == 1) |
Vamsi Krishna | 98f54fb | 2011-11-02 14:55:41 -0700 | [diff] [blame] | 2632 | return; |
| 2633 | |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 2634 | if (PLATFORM_IS_CHARM25() || machine_is_msm8960_liquid()) |
Vamsi Krishna | f74d2edb | 2011-12-02 10:41:11 -0800 | [diff] [blame] | 2635 | platform_device_register(&msm_device_hsic_host); |
Vamsi Krishna | 98f54fb | 2011-11-02 14:55:41 -0700 | [diff] [blame] | 2636 | #endif |
| 2637 | } |
| 2638 | |
Amir Samuelov | 5137e39 | 2011-09-21 17:31:25 +0300 | [diff] [blame] | 2639 | #ifdef CONFIG_ISL9519_CHARGER |
| 2640 | static struct isl_platform_data isl_data __initdata = { |
| 2641 | .valid_n_gpio = 0, /* Not required when notify-by-pmic */ |
| 2642 | .chg_detection_config = NULL, /* Not required when notify-by-pmic */ |
| 2643 | .max_system_voltage = 4200, |
| 2644 | .min_system_voltage = 3200, |
Amir Samuelov | 95f49ff | 2012-01-29 09:14:08 +0200 | [diff] [blame] | 2645 | .chgcurrent = 1900, |
| 2646 | .term_current = 0, |
Amir Samuelov | 5137e39 | 2011-09-21 17:31:25 +0300 | [diff] [blame] | 2647 | .input_current = 2048, |
| 2648 | }; |
| 2649 | |
| 2650 | static struct i2c_board_info isl_charger_i2c_info[] __initdata = { |
| 2651 | { |
| 2652 | I2C_BOARD_INFO("isl9519q", 0x9), |
| 2653 | .irq = 0, /* Not required when notify-by-pmic */ |
| 2654 | .platform_data = &isl_data, |
| 2655 | }, |
| 2656 | }; |
| 2657 | #endif /* CONFIG_ISL9519_CHARGER */ |
| 2658 | |
Amir Samuelov | 755616d | 2011-12-13 16:34:46 +0200 | [diff] [blame] | 2659 | static struct i2c_board_info liquid_io_expander_i2c_info[] __initdata = { |
| 2660 | { |
| 2661 | I2C_BOARD_INFO("sx1508q", 0x20), |
| 2662 | .platform_data = &msm8960_sx150x_data[SX150X_LIQUID] |
| 2663 | }, |
| 2664 | }; |
| 2665 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2666 | static struct i2c_registry msm8960_i2c_devices[] __initdata = { |
Amir Samuelov | 5137e39 | 2011-09-21 17:31:25 +0300 | [diff] [blame] | 2667 | #ifdef CONFIG_ISL9519_CHARGER |
| 2668 | { |
| 2669 | I2C_LIQUID, |
| 2670 | MSM_8960_GSBI10_QUP_I2C_BUS_ID, |
| 2671 | isl_charger_i2c_info, |
| 2672 | ARRAY_SIZE(isl_charger_i2c_info), |
| 2673 | }, |
| 2674 | #endif /* CONFIG_ISL9519_CHARGER */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2675 | { |
| 2676 | I2C_SURF | I2C_FFA | I2C_FLUID, |
| 2677 | MSM_8960_GSBI3_QUP_I2C_BUS_ID, |
| 2678 | cyttsp_info, |
| 2679 | ARRAY_SIZE(cyttsp_info), |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 2680 | }, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2681 | { |
| 2682 | I2C_LIQUID, |
| 2683 | MSM_8960_GSBI3_QUP_I2C_BUS_ID, |
| 2684 | mxt_device_info, |
| 2685 | ARRAY_SIZE(mxt_device_info), |
| 2686 | }, |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 2687 | { |
Mohan Pallaka | f69f049 | 2011-11-21 13:08:33 +0530 | [diff] [blame] | 2688 | I2C_FFA | I2C_LIQUID, |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 2689 | MSM_8960_GSBI10_QUP_I2C_BUS_ID, |
Eugene Yasman | d2316b8 | 2011-12-07 18:23:48 +0200 | [diff] [blame] | 2690 | sii_device_info, |
| 2691 | ARRAY_SIZE(sii_device_info), |
| 2692 | }, |
| 2693 | { |
| 2694 | I2C_LIQUID, |
| 2695 | MSM_8960_GSBI10_QUP_I2C_BUS_ID, |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 2696 | msm_isa1200_board_info, |
| 2697 | ARRAY_SIZE(msm_isa1200_board_info), |
| 2698 | }, |
Amir Samuelov | 755616d | 2011-12-13 16:34:46 +0200 | [diff] [blame] | 2699 | { |
| 2700 | I2C_LIQUID, |
| 2701 | MSM_8960_GSBI10_QUP_I2C_BUS_ID, |
| 2702 | liquid_io_expander_i2c_info, |
| 2703 | ARRAY_SIZE(liquid_io_expander_i2c_info), |
| 2704 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2705 | }; |
| 2706 | #endif /* CONFIG_I2C */ |
| 2707 | |
| 2708 | static void __init register_i2c_devices(void) |
| 2709 | { |
| 2710 | #ifdef CONFIG_I2C |
| 2711 | u8 mach_mask = 0; |
| 2712 | int i; |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 2713 | #ifdef CONFIG_MSM_CAMERA |
| 2714 | struct i2c_registry msm8960_camera_i2c_devices = { |
| 2715 | I2C_SURF | I2C_FFA | I2C_FLUID | I2C_LIQUID | I2C_RUMI, |
| 2716 | MSM_8960_GSBI4_QUP_I2C_BUS_ID, |
| 2717 | msm8960_camera_board_info.board_info, |
| 2718 | msm8960_camera_board_info.num_i2c_board_info, |
| 2719 | }; |
| 2720 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2721 | |
| 2722 | /* Build the matching 'supported_machs' bitmask */ |
| 2723 | if (machine_is_msm8960_cdp()) |
| 2724 | mach_mask = I2C_SURF; |
| 2725 | else if (machine_is_msm8960_rumi3()) |
| 2726 | mach_mask = I2C_RUMI; |
| 2727 | else if (machine_is_msm8960_sim()) |
| 2728 | mach_mask = I2C_SIM; |
Amy Maloche | 2d02803 | 2011-07-20 14:08:06 -0700 | [diff] [blame] | 2729 | else if (machine_is_msm8960_fluid()) |
| 2730 | mach_mask = I2C_FLUID; |
Amir Samuelov | 05f8780 | 2011-08-27 18:30:12 +0300 | [diff] [blame] | 2731 | else if (machine_is_msm8960_liquid()) |
| 2732 | mach_mask = I2C_LIQUID; |
Amy Maloche | 1b0663f | 2011-08-02 16:46:22 -0700 | [diff] [blame] | 2733 | else if (machine_is_msm8960_mtp()) |
| 2734 | mach_mask = I2C_FFA; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2735 | else |
| 2736 | pr_err("unmatched machine ID in register_i2c_devices\n"); |
| 2737 | |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2738 | if (machine_is_msm8960_liquid()) { |
| 2739 | if (SOCINFO_VERSION_MAJOR(socinfo_get_platform_version()) == 3) |
| 2740 | mxt_device_info[0].platform_data = |
| 2741 | &mxt_platform_data_3d; |
| 2742 | else |
| 2743 | mxt_device_info[0].platform_data = |
| 2744 | &mxt_platform_data_2d; |
| 2745 | } |
| 2746 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2747 | /* Run the array and install devices as appropriate */ |
| 2748 | for (i = 0; i < ARRAY_SIZE(msm8960_i2c_devices); ++i) { |
| 2749 | if (msm8960_i2c_devices[i].machs & mach_mask) |
| 2750 | i2c_register_board_info(msm8960_i2c_devices[i].bus, |
| 2751 | msm8960_i2c_devices[i].info, |
| 2752 | msm8960_i2c_devices[i].len); |
| 2753 | } |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 2754 | #ifdef CONFIG_MSM_CAMERA |
| 2755 | if (msm8960_camera_i2c_devices.machs & mach_mask) |
| 2756 | i2c_register_board_info(msm8960_camera_i2c_devices.bus, |
| 2757 | msm8960_camera_i2c_devices.info, |
| 2758 | msm8960_camera_i2c_devices.len); |
| 2759 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2760 | #endif |
| 2761 | } |
| 2762 | |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2763 | static void __init msm8960_sim_init(void) |
| 2764 | { |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 2765 | struct msm_watchdog_pdata *wdog_pdata = (struct msm_watchdog_pdata *) |
| 2766 | &msm8960_device_watchdog.dev.platform_data; |
| 2767 | |
| 2768 | wdog_pdata->bark_time = 15000; |
Siddartha Mohanadoss | fad0af1 | 2012-01-20 15:08:38 -0800 | [diff] [blame] | 2769 | msm_tsens_early_init(&msm_tsens_pdata); |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2770 | BUG_ON(msm_rpm_init(&msm8960_rpm_data)); |
| 2771 | BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data)); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2772 | regulator_suppress_info_printing(); |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 2773 | platform_device_register(&msm8960_device_rpm_regulator); |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 2774 | msm_clock_init(&msm8960_clock_init_data); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 2775 | msm8960_init_pmic(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2776 | |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 2777 | msm8960_device_otg.dev.platform_data = &msm_otg_pdata; |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 2778 | msm8960_init_gpiomux(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2779 | msm8960_i2c_init(); |
| 2780 | msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data)); |
| 2781 | msm_spm_l2_init(msm_spm_l2_data); |
| 2782 | msm8960_init_buses(); |
| 2783 | platform_add_devices(common_devices, ARRAY_SIZE(common_devices)); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 2784 | msm8960_pm8921_gpio_mpp_init(); |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2785 | platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices)); |
Matt Wagantall | ec57f06 | 2011-08-16 23:54:46 -0700 | [diff] [blame] | 2786 | acpuclk_init(&acpuclk_8960_soc_data); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2787 | |
| 2788 | msm8960_device_qup_spi_gsbi1.dev.platform_data = |
| 2789 | &msm8960_qup_spi_gsbi1_pdata; |
| 2790 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); |
| 2791 | |
| 2792 | msm8960_init_mmc(); |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 2793 | msm8960_init_fb(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2794 | slim_register_board_info(msm_slim_devices, |
| 2795 | ARRAY_SIZE(msm_slim_devices)); |
| 2796 | msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data)); |
| 2797 | msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ); |
| 2798 | msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates), |
| 2799 | msm_pm_data); |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 2800 | BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata)); |
Maheshkumar Sivasubramanian | 6866b1c | 2011-06-07 14:20:33 -0600 | [diff] [blame] | 2801 | msm_pm_init_sleep_status_data(&msm_pm_slp_sts_data); |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2802 | } |
| 2803 | |
| 2804 | static void __init msm8960_rumi3_init(void) |
| 2805 | { |
Siddartha Mohanadoss | fad0af1 | 2012-01-20 15:08:38 -0800 | [diff] [blame] | 2806 | msm_tsens_early_init(&msm_tsens_pdata); |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2807 | BUG_ON(msm_rpm_init(&msm8960_rpm_data)); |
| 2808 | BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data)); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2809 | regulator_suppress_info_printing(); |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 2810 | platform_device_register(&msm8960_device_rpm_regulator); |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 2811 | msm_clock_init(&msm8960_dummy_clock_init_data); |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 2812 | msm8960_init_gpiomux(); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 2813 | msm8960_init_pmic(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2814 | msm8960_device_qup_spi_gsbi1.dev.platform_data = |
| 2815 | &msm8960_qup_spi_gsbi1_pdata; |
| 2816 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); |
| 2817 | msm8960_i2c_init(); |
| 2818 | msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data)); |
| 2819 | msm_spm_l2_init(msm_spm_l2_data); |
| 2820 | platform_add_devices(common_devices, ARRAY_SIZE(common_devices)); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 2821 | msm8960_pm8921_gpio_mpp_init(); |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2822 | platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices)); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2823 | msm8960_init_mmc(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2824 | register_i2c_devices(); |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 2825 | msm8960_init_fb(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2826 | slim_register_board_info(msm_slim_devices, |
| 2827 | ARRAY_SIZE(msm_slim_devices)); |
| 2828 | msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data)); |
| 2829 | msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ); |
| 2830 | msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates), |
| 2831 | msm_pm_data); |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 2832 | BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata)); |
Maheshkumar Sivasubramanian | 6866b1c | 2011-06-07 14:20:33 -0600 | [diff] [blame] | 2833 | msm_pm_init_sleep_status_data(&msm_pm_slp_sts_data); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2834 | } |
| 2835 | |
| 2836 | static void __init msm8960_cdp_init(void) |
| 2837 | { |
Naveen Ramaraj | 76483ad | 2011-09-06 14:25:44 -0700 | [diff] [blame] | 2838 | if (meminfo_init(SYS_MEMORY, SZ_256M) < 0) |
| 2839 | pr_err("meminfo_init() failed!\n"); |
| 2840 | |
Siddartha Mohanadoss | fad0af1 | 2012-01-20 15:08:38 -0800 | [diff] [blame] | 2841 | msm_tsens_early_init(&msm_tsens_pdata); |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2842 | BUG_ON(msm_rpm_init(&msm8960_rpm_data)); |
| 2843 | BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data)); |
Abhijeet Dharmapurikar | 6d565fd | 2011-09-15 18:49:56 -0700 | [diff] [blame] | 2844 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2845 | regulator_suppress_info_printing(); |
| 2846 | if (msm_xo_init()) |
| 2847 | pr_err("Failed to initialize XO votes\n"); |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 2848 | platform_device_register(&msm8960_device_rpm_regulator); |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 2849 | msm_clock_init(&msm8960_clock_init_data); |
Vijayavardhan Vennapusa | fc464f0 | 2011-11-04 21:54:00 +0530 | [diff] [blame] | 2850 | if (machine_is_msm8960_liquid()) |
| 2851 | msm_otg_pdata.mhl_enable = true; |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 2852 | msm8960_device_otg.dev.platform_data = &msm_otg_pdata; |
Anji jonnala | a8b8d73 | 2011-12-06 10:03:24 +0530 | [diff] [blame] | 2853 | if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() || |
| 2854 | machine_is_msm8960_cdp()) { |
| 2855 | msm_otg_pdata.phy_init_seq = wr_phy_init_seq; |
| 2856 | } else if (machine_is_msm8960_liquid()) { |
| 2857 | msm_otg_pdata.phy_init_seq = |
| 2858 | liquid_v1_phy_init_seq; |
| 2859 | } |
Anji jonnala | a7c1c5c | 2011-12-12 12:20:36 +0530 | [diff] [blame] | 2860 | msm_otg_pdata.swfi_latency = |
| 2861 | msm_rpmrs_levels[0].latency_us; |
Vijayavardhan Vennapusa | 2b592824f | 2011-11-02 19:51:32 +0530 | [diff] [blame] | 2862 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
| 2863 | if (machine_is_msm8960_liquid()) { |
| 2864 | if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 2) |
| 2865 | msm_hsic_pdata.hub_reset = HSIC_HUB_RESET_GPIO; |
| 2866 | } |
| 2867 | #endif |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 2868 | msm_device_hsic_host.dev.platform_data = &msm_hsic_pdata; |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 2869 | msm8960_init_gpiomux(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2870 | msm8960_device_qup_spi_gsbi1.dev.platform_data = |
| 2871 | &msm8960_qup_spi_gsbi1_pdata; |
| 2872 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 2873 | |
| 2874 | msm8960_init_pmic(); |
Mohan Pallaka | f69f049 | 2011-11-21 13:08:33 +0530 | [diff] [blame] | 2875 | if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 2 && |
| 2876 | (machine_is_msm8960_mtp())) || machine_is_msm8960_liquid()) |
| 2877 | msm_isa1200_board_info[0].platform_data = &isa1200_1_pdata; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2878 | msm8960_i2c_init(); |
Lucille Sylvester | 34ec369 | 2011-08-16 16:28:04 -0600 | [diff] [blame] | 2879 | msm8960_gfx_init(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2880 | msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data)); |
| 2881 | msm_spm_l2_init(msm_spm_l2_data); |
| 2882 | msm8960_init_buses(); |
| 2883 | platform_add_devices(msm_footswitch_devices, |
| 2884 | msm_num_footswitch_devices); |
David Collins | b10be1d | 2011-09-02 10:29:31 -0700 | [diff] [blame] | 2885 | if (machine_is_msm8960_liquid()) |
| 2886 | platform_device_register(&msm8960_device_ext_3p3v_vreg); |
David Collins | d5a4073 | 2011-11-29 15:53:56 -0800 | [diff] [blame] | 2887 | if (machine_is_msm8960_cdp()) |
| 2888 | platform_device_register(&msm8960_device_ext_l2_vreg); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2889 | platform_add_devices(common_devices, ARRAY_SIZE(common_devices)); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 2890 | msm8960_pm8921_gpio_mpp_init(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2891 | platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices)); |
Vamsi Krishna | 98f54fb | 2011-11-02 14:55:41 -0700 | [diff] [blame] | 2892 | msm8960_init_hsic(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2893 | msm8960_init_cam(); |
| 2894 | msm8960_init_mmc(); |
Matt Wagantall | ec57f06 | 2011-08-16 23:54:46 -0700 | [diff] [blame] | 2895 | acpuclk_init(&acpuclk_8960_soc_data); |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2896 | if (machine_is_msm8960_liquid()) |
| 2897 | mxt_init_hw_liquid(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2898 | register_i2c_devices(); |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 2899 | msm8960_init_fb(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2900 | slim_register_board_info(msm_slim_devices, |
| 2901 | ARRAY_SIZE(msm_slim_devices)); |
| 2902 | msm8960_init_dsps(); |
| 2903 | msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data)); |
| 2904 | msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ); |
| 2905 | msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates), |
| 2906 | msm_pm_data); |
Larry Bassel | a7eadea | 2011-07-14 10:46:00 -0700 | [diff] [blame] | 2907 | change_memory_power = &msm8960_change_memory_power; |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 2908 | BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata)); |
Maheshkumar Sivasubramanian | 6866b1c | 2011-06-07 14:20:33 -0600 | [diff] [blame] | 2909 | msm_pm_init_sleep_status_data(&msm_pm_slp_sts_data); |
Joel King | b8352a1 | 2011-11-15 18:46:24 -0800 | [diff] [blame] | 2910 | if (PLATFORM_IS_CHARM25()) |
| 2911 | platform_add_devices(mdm_devices, ARRAY_SIZE(mdm_devices)); |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2912 | } |
| 2913 | |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 2914 | MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR") |
| 2915 | .map_io = msm8960_map_io, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2916 | .reserve = msm8960_reserve, |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 2917 | .init_irq = msm8960_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 2918 | .handle_irq = gic_handle_irq, |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 2919 | .timer = &msm_timer, |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2920 | .init_machine = msm8960_sim_init, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2921 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 2922 | .init_very_early = msm8960_early_memory, |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 2923 | MACHINE_END |
Stepan Moskovchenko | 50ede4e | 2010-12-13 18:12:19 -0800 | [diff] [blame] | 2924 | |
| 2925 | MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3") |
| 2926 | .map_io = msm8960_map_io, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2927 | .reserve = msm8960_reserve, |
Stepan Moskovchenko | 50ede4e | 2010-12-13 18:12:19 -0800 | [diff] [blame] | 2928 | .init_irq = msm8960_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 2929 | .handle_irq = gic_handle_irq, |
Stepan Moskovchenko | 50ede4e | 2010-12-13 18:12:19 -0800 | [diff] [blame] | 2930 | .timer = &msm_timer, |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 2931 | .init_machine = msm8960_rumi3_init, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2932 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 2933 | .init_very_early = msm8960_early_memory, |
Stepan Moskovchenko | 50ede4e | 2010-12-13 18:12:19 -0800 | [diff] [blame] | 2934 | MACHINE_END |
| 2935 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2936 | MACHINE_START(MSM8960_CDP, "QCT MSM8960 CDP") |
| 2937 | .map_io = msm8960_map_io, |
| 2938 | .reserve = msm8960_reserve, |
| 2939 | .init_irq = msm8960_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 2940 | .handle_irq = gic_handle_irq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2941 | .timer = &msm_timer, |
| 2942 | .init_machine = msm8960_cdp_init, |
| 2943 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 2944 | .init_very_early = msm8960_early_memory, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2945 | MACHINE_END |
| 2946 | |
| 2947 | MACHINE_START(MSM8960_MTP, "QCT MSM8960 MTP") |
| 2948 | .map_io = msm8960_map_io, |
| 2949 | .reserve = msm8960_reserve, |
| 2950 | .init_irq = msm8960_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 2951 | .handle_irq = gic_handle_irq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2952 | .timer = &msm_timer, |
| 2953 | .init_machine = msm8960_cdp_init, |
| 2954 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 2955 | .init_very_early = msm8960_early_memory, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2956 | MACHINE_END |
| 2957 | |
| 2958 | MACHINE_START(MSM8960_FLUID, "QCT MSM8960 FLUID") |
| 2959 | .map_io = msm8960_map_io, |
| 2960 | .reserve = msm8960_reserve, |
| 2961 | .init_irq = msm8960_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 2962 | .handle_irq = gic_handle_irq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2963 | .timer = &msm_timer, |
| 2964 | .init_machine = msm8960_cdp_init, |
| 2965 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 2966 | .init_very_early = msm8960_early_memory, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2967 | MACHINE_END |
Amir Samuelov | 0d1f8ae | 2011-07-28 11:13:58 +0300 | [diff] [blame] | 2968 | |
| 2969 | MACHINE_START(MSM8960_LIQUID, "QCT MSM8960 LIQUID") |
| 2970 | .map_io = msm8960_map_io, |
| 2971 | .reserve = msm8960_reserve, |
| 2972 | .init_irq = msm8960_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 2973 | .handle_irq = gic_handle_irq, |
Amir Samuelov | 0d1f8ae | 2011-07-28 11:13:58 +0300 | [diff] [blame] | 2974 | .timer = &msm_timer, |
| 2975 | .init_machine = msm8960_cdp_init, |
| 2976 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 2977 | .init_very_early = msm8960_early_memory, |
Amir Samuelov | 0d1f8ae | 2011-07-28 11:13:58 +0300 | [diff] [blame] | 2978 | MACHINE_END |