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