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