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