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