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