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