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