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