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