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