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