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