Abhijeet Dharmapurikar | fb4a2f8 | 2012-08-23 14:36:59 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [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 | * |
| 12 | */ |
| 13 | #include <linux/kernel.h> |
Niranjana Vishwanathapura | c1edd40 | 2012-06-28 15:32:50 -0600 | [diff] [blame] | 14 | #include <linux/bitops.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 15 | #include <linux/platform_device.h> |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 16 | #include <linux/gpio.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 17 | #include <linux/io.h> |
| 18 | #include <linux/irq.h> |
Kenneth Heitke | 748593a | 2011-07-15 15:45:11 -0600 | [diff] [blame] | 19 | #include <linux/i2c.h> |
David Keitel | 2f613d9 | 2012-02-15 11:29:16 -0800 | [diff] [blame] | 20 | #include <linux/i2c/smb349.h> |
Siddartha Mohanadoss | b9df494 | 2012-02-08 09:58:21 -0800 | [diff] [blame] | 21 | #include <linux/i2c/sx150x.h> |
Sagar Dharia | 8bdcdaf | 2011-09-16 16:01:15 -0600 | [diff] [blame] | 22 | #include <linux/slimbus/slimbus.h> |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 23 | #include <linux/mfd/wcd9xxx/core.h> |
| 24 | #include <linux/mfd/wcd9xxx/pdata.h> |
Amy Maloche | 70090f99 | 2012-02-16 16:35:26 -0800 | [diff] [blame] | 25 | #include <linux/mfd/pm8xxx/misc.h> |
Kenneth Heitke | 36920d3 | 2011-07-20 16:44:30 -0600 | [diff] [blame] | 26 | #include <linux/msm_ssbi.h> |
Stepan Moskovchenko | eed82a5 | 2011-09-02 13:19:23 -0700 | [diff] [blame] | 27 | #include <linux/spi/spi.h> |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 28 | #include <linux/dma-mapping.h> |
| 29 | #include <linux/platform_data/qcom_crypto_device.h> |
Mitchel Humpherys | ca983d8 | 2012-09-06 11:32:54 -0700 | [diff] [blame] | 30 | #include <linux/msm_ion.h> |
Jack Cheung | 46bfffa | 2012-01-19 15:26:24 -0800 | [diff] [blame] | 31 | #include <linux/memory.h> |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 32 | #include <linux/memblock.h> |
Praveen Chidambaram | 877d7a4 | 2012-06-05 14:33:20 -0600 | [diff] [blame] | 33 | #include <linux/msm_thermal.h> |
Jing Lin | 21ed4de | 2012-02-05 15:53:28 -0800 | [diff] [blame] | 34 | #include <linux/i2c/atmel_mxt_ts.h> |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 35 | #include <linux/cyttsp-qc.h> |
Amy Maloche | 70090f99 | 2012-02-16 16:35:26 -0800 | [diff] [blame] | 36 | #include <linux/i2c/isa1200.h> |
Mohan Pallaka | 474b94b | 2012-01-25 12:59:58 +0530 | [diff] [blame] | 37 | #include <linux/gpio_keys.h> |
Siddartha Mohanadoss | b9df494 | 2012-02-08 09:58:21 -0800 | [diff] [blame] | 38 | #include <linux/epm_adc.h> |
Jay Chokshi | e7d8d4f | 2012-04-04 14:47:57 -0700 | [diff] [blame] | 39 | #include <linux/i2c/sx150x.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 40 | #include <asm/mach-types.h> |
| 41 | #include <asm/mach/arch.h> |
| 42 | #include <asm/hardware/gic.h> |
Sahitya Tummala | 3586ed9 | 2011-08-03 09:13:23 +0530 | [diff] [blame] | 43 | #include <asm/mach/mmc.h> |
Ankit Verma | 6b7e2ba | 2012-01-26 15:48:54 -0800 | [diff] [blame] | 44 | #include <linux/platform_data/qcom_wcnss_device.h> |
Bar Weiner | f82c587 | 2012-10-23 14:31:26 +0200 | [diff] [blame] | 45 | #include <linux/ci-bridge-spi.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 46 | |
| 47 | #include <mach/board.h> |
| 48 | #include <mach/msm_iomap.h> |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 49 | #include <mach/ion.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 50 | #include <linux/usb/msm_hsusb.h> |
| 51 | #include <linux/usb/android.h> |
| 52 | #include <mach/socinfo.h> |
Harini Jayaraman | c4c5869 | 2011-07-19 14:50:10 -0600 | [diff] [blame] | 53 | #include <mach/msm_spi.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 54 | #include "timer.h" |
| 55 | #include "devices.h" |
Joel King | 4ebccc6 | 2011-07-22 09:43:22 -0700 | [diff] [blame] | 56 | #include <mach/gpiomux.h> |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 57 | #include <mach/rpm.h> |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 58 | #ifdef CONFIG_ANDROID_PMEM |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 59 | #include <linux/android_pmem.h> |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 60 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 61 | #include <mach/msm_memtypes.h> |
| 62 | #include <linux/bootmem.h> |
| 63 | #include <asm/setup.h> |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 64 | #include <mach/dma.h> |
Jin Hong | d3024e6 | 2012-02-09 16:13:32 -0800 | [diff] [blame] | 65 | #include <mach/msm_dsps.h> |
Gagan Mac | 8a7a5d3 | 2011-11-11 16:43:06 -0700 | [diff] [blame] | 66 | #include <mach/msm_bus_board.h> |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 67 | #include <mach/cpuidle.h> |
Joel King | dacbc82 | 2012-01-25 13:30:57 -0800 | [diff] [blame] | 68 | #include <mach/mdm2.h> |
Siddartha Mohanadoss | caeaa92 | 2012-02-07 16:41:38 -0800 | [diff] [blame] | 69 | #include <linux/msm_tsens.h> |
Stephen Boyd | 4d0d258 | 2012-02-10 14:49:40 -0800 | [diff] [blame] | 70 | #include <mach/msm_xo.h> |
Laura Abbott | 350c836 | 2012-02-28 14:46:52 -0800 | [diff] [blame] | 71 | #include <mach/msm_rtb.h> |
Mayank Rana | 262e903 | 2012-05-10 15:14:00 -0700 | [diff] [blame] | 72 | #include <mach/msm_serial_hs.h> |
Santosh Mardi | eff9a74 | 2012-04-09 23:23:39 +0530 | [diff] [blame] | 73 | #include <sound/cs8427.h> |
Ravi Kumar V | 05931a2 | 2012-04-04 17:09:37 +0530 | [diff] [blame] | 74 | #include <media/gpio-ir-recv.h> |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 75 | #include <linux/fmem.h> |
Niranjana Vishwanathapura | 06f8933 | 2012-05-03 17:11:13 -0600 | [diff] [blame] | 76 | #include <mach/msm_pcie.h> |
Jeff Ohlstein | dd0dd9b | 2012-05-29 17:47:21 -0700 | [diff] [blame] | 77 | #include <mach/restart.h> |
Niranjana Vishwanathapura | c1edd40 | 2012-06-28 15:32:50 -0600 | [diff] [blame] | 78 | #include <mach/msm_iomap.h> |
Joel King | 4ebccc6 | 2011-07-22 09:43:22 -0700 | [diff] [blame] | 79 | |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 80 | #include "msm_watchdog.h" |
Stepan Moskovchenko | 5a83dba | 2011-12-05 17:30:17 -0800 | [diff] [blame] | 81 | #include "board-8064.h" |
Matt Wagantall | 33d01f5 | 2012-02-23 23:27:44 -0800 | [diff] [blame] | 82 | #include "clock.h" |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 83 | #include "spm.h" |
Subhash Jadavani | 909e04f | 2012-04-12 10:52:50 +0530 | [diff] [blame] | 84 | #include <mach/mpm.h> |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 85 | #include "rpm_resources.h" |
Matt Wagantall | 7cca464 | 2012-02-01 16:43:24 -0800 | [diff] [blame] | 86 | #include "pm.h" |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 87 | #include "pm-boot.h" |
Rajesh Sastrula | aee8af3 | 2012-01-20 11:46:31 -0800 | [diff] [blame] | 88 | #include "devices-msm8x60.h" |
Hanumant Singh | 50440d4 | 2012-04-23 19:27:16 -0700 | [diff] [blame] | 89 | #include "smd_private.h" |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 90 | |
Abhishek Kharbanda | 72dc72e | 2012-06-07 13:41:37 -0700 | [diff] [blame] | 91 | #define MHL_GPIO_INT 30 |
| 92 | #define MHL_GPIO_RESET 35 |
| 93 | |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 94 | #define MSM_PMEM_ADSP_SIZE 0x7800000 |
Bharath Ramachandramurthy | 2fd017a | 2012-03-13 10:21:09 -0700 | [diff] [blame] | 95 | #define MSM_PMEM_AUDIO_SIZE 0x4CF000 |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 96 | #ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY |
| 97 | #define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */ |
| 98 | #else |
Chetan Kalyan | 72aac4f | 2012-02-23 14:56:54 -0800 | [diff] [blame] | 99 | #define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */ |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 100 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 101 | |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 102 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
Hanumant Singh | eadb750 | 2012-05-15 18:14:04 -0700 | [diff] [blame] | 103 | #define HOLE_SIZE 0x20000 |
Mitchel Humpherys | 05e5881 | 2012-08-13 14:24:13 -0700 | [diff] [blame] | 104 | #define MSM_CONTIG_MEM_SIZE 0x65000 |
Olav Haugan | 129992c | 2012-03-22 09:54:01 -0700 | [diff] [blame] | 105 | #ifdef CONFIG_MSM_IOMMU |
| 106 | #define MSM_ION_MM_SIZE 0x3800000 |
| 107 | #define MSM_ION_SF_SIZE 0 |
Olav Haugan | 39477bb | 2012-05-14 16:05:36 -0700 | [diff] [blame] | 108 | #define MSM_ION_QSECOM_SIZE 0x780000 /* (7.5MB) */ |
Olav Haugan | 129992c | 2012-03-22 09:54:01 -0700 | [diff] [blame] | 109 | #define MSM_ION_HEAP_NUM 7 |
| 110 | #else |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 111 | #define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE |
Olav Haugan | 129992c | 2012-03-22 09:54:01 -0700 | [diff] [blame] | 112 | #define MSM_ION_SF_SIZE MSM_PMEM_SIZE |
Olav Haugan | 39477bb | 2012-05-14 16:05:36 -0700 | [diff] [blame] | 113 | #define MSM_ION_QSECOM_SIZE 0x600000 /* (6MB) */ |
Olav Haugan | 129992c | 2012-03-22 09:54:01 -0700 | [diff] [blame] | 114 | #define MSM_ION_HEAP_NUM 8 |
| 115 | #endif |
Hanumant Singh | eadb750 | 2012-05-15 18:14:04 -0700 | [diff] [blame] | 116 | #define MSM_ION_MM_FW_SIZE (0x200000 - HOLE_SIZE) /* (2MB - 128KB) */ |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 117 | #define MSM_ION_MFC_SIZE SZ_8K |
Olav Haugan | 2c43fac | 2012-01-19 11:06:37 -0800 | [diff] [blame] | 118 | #define MSM_ION_AUDIO_SIZE MSM_PMEM_AUDIO_SIZE |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 119 | #else |
Mitchel Humpherys | 05e5881 | 2012-08-13 14:24:13 -0700 | [diff] [blame] | 120 | #define MSM_CONTIG_MEM_SIZE 0x110C000 |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 121 | #define MSM_ION_HEAP_NUM 1 |
| 122 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 123 | |
Hanumant Singh | eadb750 | 2012-05-15 18:14:04 -0700 | [diff] [blame] | 124 | #define APQ8064_FIXED_AREA_START (0xa0000000 - (MSM_ION_MM_FW_SIZE + \ |
| 125 | HOLE_SIZE)) |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 126 | #define MAX_FIXED_AREA_SIZE 0x10000000 |
Hanumant Singh | eadb750 | 2012-05-15 18:14:04 -0700 | [diff] [blame] | 127 | #define MSM_MM_FW_SIZE (0x200000 - HOLE_SIZE) |
| 128 | #define APQ8064_FW_START APQ8064_FIXED_AREA_START |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 129 | |
Niranjana Vishwanathapura | c1edd40 | 2012-06-28 15:32:50 -0600 | [diff] [blame] | 130 | #define QFPROM_RAW_FEAT_CONFIG_ROW0_MSB (MSM_QFPROM_BASE + 0x23c) |
| 131 | #define QFPROM_RAW_OEM_CONFIG_ROW0_LSB (MSM_QFPROM_BASE + 0x220) |
| 132 | |
Niranjana Vishwanathapura | 68210ff | 2012-06-24 18:03:49 -0600 | [diff] [blame] | 133 | /* PCIE AXI address space */ |
| 134 | #define PCIE_AXI_BAR_PHYS 0x08000000 |
| 135 | #define PCIE_AXI_BAR_SIZE SZ_128M |
| 136 | |
Niranjana Vishwanathapura | 459a27d | 2012-07-20 12:23:55 -0600 | [diff] [blame] | 137 | /* PCIe pmic gpios */ |
| 138 | #define PCIE_WAKE_N_PMIC_GPIO 12 |
Niranjana Vishwanathapura | 06f8933 | 2012-05-03 17:11:13 -0600 | [diff] [blame] | 139 | #define PCIE_PWR_EN_PMIC_GPIO 13 |
| 140 | #define PCIE_RST_N_PMIC_MPP 1 |
| 141 | |
Mitchel Humpherys | 05e5881 | 2012-08-13 14:24:13 -0700 | [diff] [blame] | 142 | #ifdef CONFIG_KERNEL_MSM_CONTIG_MEM_REGION |
| 143 | static unsigned msm_contig_mem_size = MSM_CONTIG_MEM_SIZE; |
| 144 | static int __init msm_contig_mem_size_setup(char *p) |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 145 | { |
Mitchel Humpherys | 05e5881 | 2012-08-13 14:24:13 -0700 | [diff] [blame] | 146 | msm_contig_mem_size = memparse(p, NULL); |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 147 | return 0; |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 148 | } |
Mitchel Humpherys | 05e5881 | 2012-08-13 14:24:13 -0700 | [diff] [blame] | 149 | early_param("msm_contig_mem_size", msm_contig_mem_size_setup); |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 150 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 151 | |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 152 | #ifdef CONFIG_ANDROID_PMEM |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 153 | static unsigned pmem_size = MSM_PMEM_SIZE; |
| 154 | static int __init pmem_size_setup(char *p) |
| 155 | { |
| 156 | pmem_size = memparse(p, NULL); |
| 157 | return 0; |
| 158 | } |
| 159 | early_param("pmem_size", pmem_size_setup); |
| 160 | |
| 161 | static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE; |
| 162 | |
| 163 | static int __init pmem_adsp_size_setup(char *p) |
| 164 | { |
| 165 | pmem_adsp_size = memparse(p, NULL); |
| 166 | return 0; |
| 167 | } |
| 168 | early_param("pmem_adsp_size", pmem_adsp_size_setup); |
| 169 | |
| 170 | static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE; |
| 171 | |
| 172 | static int __init pmem_audio_size_setup(char *p) |
| 173 | { |
| 174 | pmem_audio_size = memparse(p, NULL); |
| 175 | return 0; |
| 176 | } |
| 177 | early_param("pmem_audio_size", pmem_audio_size_setup); |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 178 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 179 | |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 180 | #ifdef CONFIG_ANDROID_PMEM |
| 181 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 182 | static struct android_pmem_platform_data android_pmem_pdata = { |
| 183 | .name = "pmem", |
| 184 | .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING, |
| 185 | .cached = 1, |
| 186 | .memory_type = MEMTYPE_EBI1, |
| 187 | }; |
| 188 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 189 | static struct platform_device apq8064_android_pmem_device = { |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 190 | .name = "android_pmem", |
| 191 | .id = 0, |
| 192 | .dev = {.platform_data = &android_pmem_pdata}, |
| 193 | }; |
| 194 | |
| 195 | static struct android_pmem_platform_data android_pmem_adsp_pdata = { |
| 196 | .name = "pmem_adsp", |
| 197 | .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, |
| 198 | .cached = 0, |
| 199 | .memory_type = MEMTYPE_EBI1, |
| 200 | }; |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 201 | static struct platform_device apq8064_android_pmem_adsp_device = { |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 202 | .name = "android_pmem", |
| 203 | .id = 2, |
| 204 | .dev = { .platform_data = &android_pmem_adsp_pdata }, |
| 205 | }; |
| 206 | |
| 207 | static struct android_pmem_platform_data android_pmem_audio_pdata = { |
| 208 | .name = "pmem_audio", |
| 209 | .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, |
| 210 | .cached = 0, |
| 211 | .memory_type = MEMTYPE_EBI1, |
| 212 | }; |
| 213 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 214 | static struct platform_device apq8064_android_pmem_audio_device = { |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 215 | .name = "android_pmem", |
| 216 | .id = 4, |
| 217 | .dev = { .platform_data = &android_pmem_audio_pdata }, |
| 218 | }; |
Bharath Ramachandramurthy | 4a3fa91 | 2012-03-13 19:16:24 -0700 | [diff] [blame] | 219 | #endif /* CONFIG_MSM_MULTIMEDIA_USE_ION */ |
| 220 | #endif /* CONFIG_ANDROID_PMEM */ |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 221 | |
Binqiang Qiu | f165c92 | 2012-08-15 18:00:18 -0700 | [diff] [blame] | 222 | #ifdef CONFIG_BATTERY_BCL |
| 223 | static struct platform_device battery_bcl_device = { |
| 224 | .name = "battery_current_limit", |
| 225 | .id = -1, |
| 226 | }; |
| 227 | #endif |
| 228 | |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 229 | struct fmem_platform_data apq8064_fmem_pdata = { |
| 230 | }; |
| 231 | |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 232 | static struct memtype_reserve apq8064_reserve_table[] __initdata = { |
| 233 | [MEMTYPE_SMI] = { |
| 234 | }, |
| 235 | [MEMTYPE_EBI0] = { |
| 236 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 237 | }, |
| 238 | [MEMTYPE_EBI1] = { |
| 239 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 240 | }, |
| 241 | }; |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 242 | |
Laura Abbott | 350c836 | 2012-02-28 14:46:52 -0800 | [diff] [blame] | 243 | static void __init reserve_rtb_memory(void) |
| 244 | { |
| 245 | #if defined(CONFIG_MSM_RTB) |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 246 | apq8064_reserve_table[MEMTYPE_EBI1].size += apq8064_rtb_pdata.size; |
Laura Abbott | 350c836 | 2012-02-28 14:46:52 -0800 | [diff] [blame] | 247 | #endif |
| 248 | } |
| 249 | |
| 250 | |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 251 | static void __init size_pmem_devices(void) |
| 252 | { |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 253 | #ifdef CONFIG_ANDROID_PMEM |
| 254 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 255 | android_pmem_adsp_pdata.size = pmem_adsp_size; |
| 256 | android_pmem_pdata.size = pmem_size; |
| 257 | android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE; |
Bharath Ramachandramurthy | 4a3fa91 | 2012-03-13 19:16:24 -0700 | [diff] [blame] | 258 | #endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/ |
| 259 | #endif /*CONFIG_ANDROID_PMEM*/ |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 260 | } |
| 261 | |
Bharath Ramachandramurthy | 4a3fa91 | 2012-03-13 19:16:24 -0700 | [diff] [blame] | 262 | #ifdef CONFIG_ANDROID_PMEM |
| 263 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 264 | static void __init reserve_memory_for(struct android_pmem_platform_data *p) |
| 265 | { |
| 266 | apq8064_reserve_table[p->memory_type].size += p->size; |
| 267 | } |
Bharath Ramachandramurthy | 4a3fa91 | 2012-03-13 19:16:24 -0700 | [diff] [blame] | 268 | #endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/ |
| 269 | #endif /*CONFIG_ANDROID_PMEM*/ |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 270 | |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 271 | static void __init reserve_pmem_memory(void) |
| 272 | { |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 273 | #ifdef CONFIG_ANDROID_PMEM |
| 274 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 275 | reserve_memory_for(&android_pmem_adsp_pdata); |
| 276 | reserve_memory_for(&android_pmem_pdata); |
| 277 | reserve_memory_for(&android_pmem_audio_pdata); |
Bharath Ramachandramurthy | 4a3fa91 | 2012-03-13 19:16:24 -0700 | [diff] [blame] | 278 | #endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/ |
Mitchel Humpherys | 05e5881 | 2012-08-13 14:24:13 -0700 | [diff] [blame] | 279 | apq8064_reserve_table[MEMTYPE_EBI1].size += msm_contig_mem_size; |
Bharath Ramachandramurthy | 4a3fa91 | 2012-03-13 19:16:24 -0700 | [diff] [blame] | 280 | #endif /*CONFIG_ANDROID_PMEM*/ |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 281 | } |
| 282 | |
| 283 | static int apq8064_paddr_to_memtype(unsigned int paddr) |
| 284 | { |
| 285 | return MEMTYPE_EBI1; |
| 286 | } |
| 287 | |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 288 | #define FMEM_ENABLED 0 |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 289 | |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 290 | #ifdef CONFIG_ION_MSM |
| 291 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 292 | static struct ion_cp_heap_pdata cp_mm_apq8064_ion_pdata = { |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 293 | .permission_type = IPT_TYPE_MM_CARVEOUT, |
Olav Haugan | d3d2968 | 2012-01-19 10:57:07 -0800 | [diff] [blame] | 294 | .align = PAGE_SIZE, |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 295 | .reusable = FMEM_ENABLED, |
| 296 | .mem_is_fmem = FMEM_ENABLED, |
| 297 | .fixed_position = FIXED_MIDDLE, |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 298 | }; |
| 299 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 300 | static struct ion_cp_heap_pdata cp_mfc_apq8064_ion_pdata = { |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 301 | .permission_type = IPT_TYPE_MFC_SHAREDMEM, |
Olav Haugan | d3d2968 | 2012-01-19 10:57:07 -0800 | [diff] [blame] | 302 | .align = PAGE_SIZE, |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 303 | .reusable = 0, |
| 304 | .mem_is_fmem = FMEM_ENABLED, |
| 305 | .fixed_position = FIXED_HIGH, |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 306 | }; |
| 307 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 308 | static struct ion_co_heap_pdata co_apq8064_ion_pdata = { |
Olav Haugan | d3d2968 | 2012-01-19 10:57:07 -0800 | [diff] [blame] | 309 | .adjacent_mem_id = INVALID_HEAP_ID, |
| 310 | .align = PAGE_SIZE, |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 311 | .mem_is_fmem = 0, |
Olav Haugan | d3d2968 | 2012-01-19 10:57:07 -0800 | [diff] [blame] | 312 | }; |
| 313 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 314 | static struct ion_co_heap_pdata fw_co_apq8064_ion_pdata = { |
Olav Haugan | d3d2968 | 2012-01-19 10:57:07 -0800 | [diff] [blame] | 315 | .adjacent_mem_id = ION_CP_MM_HEAP_ID, |
| 316 | .align = SZ_128K, |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 317 | .mem_is_fmem = FMEM_ENABLED, |
| 318 | .fixed_position = FIXED_LOW, |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 319 | }; |
| 320 | #endif |
Olav Haugan | 9cdfc2f | 2012-02-15 09:52:57 -0800 | [diff] [blame] | 321 | |
| 322 | /** |
| 323 | * These heaps are listed in the order they will be allocated. Due to |
| 324 | * video hardware restrictions and content protection the FW heap has to |
| 325 | * be allocated adjacent (below) the MM heap and the MFC heap has to be |
| 326 | * allocated after the MM heap to ensure MFC heap is not more than 256MB |
| 327 | * away from the base address of the FW heap. |
| 328 | * However, the order of FW heap and MM heap doesn't matter since these |
| 329 | * two heaps are taken care of by separate code to ensure they are adjacent |
| 330 | * to each other. |
| 331 | * Don't swap the order unless you know what you are doing! |
| 332 | */ |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 333 | static struct ion_platform_data apq8064_ion_pdata = { |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 334 | .nr = MSM_ION_HEAP_NUM, |
| 335 | .heaps = { |
| 336 | { |
| 337 | .id = ION_SYSTEM_HEAP_ID, |
| 338 | .type = ION_HEAP_TYPE_SYSTEM, |
| 339 | .name = ION_VMALLOC_HEAP_NAME, |
| 340 | }, |
| 341 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 342 | { |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 343 | .id = ION_CP_MM_HEAP_ID, |
| 344 | .type = ION_HEAP_TYPE_CP, |
| 345 | .name = ION_MM_HEAP_NAME, |
| 346 | .size = MSM_ION_MM_SIZE, |
| 347 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 348 | .extra_data = (void *) &cp_mm_apq8064_ion_pdata, |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 349 | }, |
| 350 | { |
Olav Haugan | d3d2968 | 2012-01-19 10:57:07 -0800 | [diff] [blame] | 351 | .id = ION_MM_FIRMWARE_HEAP_ID, |
| 352 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 353 | .name = ION_MM_FIRMWARE_HEAP_NAME, |
| 354 | .size = MSM_ION_MM_FW_SIZE, |
| 355 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 356 | .extra_data = (void *) &fw_co_apq8064_ion_pdata, |
Olav Haugan | d3d2968 | 2012-01-19 10:57:07 -0800 | [diff] [blame] | 357 | }, |
| 358 | { |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 359 | .id = ION_CP_MFC_HEAP_ID, |
| 360 | .type = ION_HEAP_TYPE_CP, |
| 361 | .name = ION_MFC_HEAP_NAME, |
| 362 | .size = MSM_ION_MFC_SIZE, |
| 363 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 364 | .extra_data = (void *) &cp_mfc_apq8064_ion_pdata, |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 365 | }, |
Olav Haugan | 129992c | 2012-03-22 09:54:01 -0700 | [diff] [blame] | 366 | #ifndef CONFIG_MSM_IOMMU |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 367 | { |
Olav Haugan | 9cdfc2f | 2012-02-15 09:52:57 -0800 | [diff] [blame] | 368 | .id = ION_SF_HEAP_ID, |
| 369 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 370 | .name = ION_SF_HEAP_NAME, |
| 371 | .size = MSM_ION_SF_SIZE, |
| 372 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 373 | .extra_data = (void *) &co_apq8064_ion_pdata, |
Olav Haugan | 9cdfc2f | 2012-02-15 09:52:57 -0800 | [diff] [blame] | 374 | }, |
Olav Haugan | 129992c | 2012-03-22 09:54:01 -0700 | [diff] [blame] | 375 | #endif |
Olav Haugan | 9cdfc2f | 2012-02-15 09:52:57 -0800 | [diff] [blame] | 376 | { |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 377 | .id = ION_IOMMU_HEAP_ID, |
| 378 | .type = ION_HEAP_TYPE_IOMMU, |
| 379 | .name = ION_IOMMU_HEAP_NAME, |
| 380 | }, |
Olav Haugan | f45e214 | 2012-01-19 11:01:01 -0800 | [diff] [blame] | 381 | { |
| 382 | .id = ION_QSECOM_HEAP_ID, |
| 383 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 384 | .name = ION_QSECOM_HEAP_NAME, |
| 385 | .size = MSM_ION_QSECOM_SIZE, |
| 386 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 387 | .extra_data = (void *) &co_apq8064_ion_pdata, |
Olav Haugan | f45e214 | 2012-01-19 11:01:01 -0800 | [diff] [blame] | 388 | }, |
Olav Haugan | 2c43fac | 2012-01-19 11:06:37 -0800 | [diff] [blame] | 389 | { |
| 390 | .id = ION_AUDIO_HEAP_ID, |
| 391 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 392 | .name = ION_AUDIO_HEAP_NAME, |
| 393 | .size = MSM_ION_AUDIO_SIZE, |
| 394 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 395 | .extra_data = (void *) &co_apq8064_ion_pdata, |
Olav Haugan | 2c43fac | 2012-01-19 11:06:37 -0800 | [diff] [blame] | 396 | }, |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 397 | #endif |
| 398 | } |
| 399 | }; |
| 400 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 401 | static struct platform_device apq8064_ion_dev = { |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 402 | .name = "ion-msm", |
| 403 | .id = 1, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 404 | .dev = { .platform_data = &apq8064_ion_pdata }, |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 405 | }; |
| 406 | #endif |
| 407 | |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 408 | static struct platform_device apq8064_fmem_device = { |
| 409 | .name = "fmem", |
| 410 | .id = 1, |
| 411 | .dev = { .platform_data = &apq8064_fmem_pdata }, |
| 412 | }; |
| 413 | |
| 414 | static void __init reserve_mem_for_ion(enum ion_memory_types mem_type, |
| 415 | unsigned long size) |
| 416 | { |
| 417 | apq8064_reserve_table[mem_type].size += size; |
| 418 | } |
| 419 | |
| 420 | static void __init apq8064_reserve_fixed_area(unsigned long fixed_area_size) |
| 421 | { |
| 422 | #if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION) |
| 423 | int ret; |
| 424 | |
| 425 | if (fixed_area_size > MAX_FIXED_AREA_SIZE) |
| 426 | panic("fixed area size is larger than %dM\n", |
| 427 | MAX_FIXED_AREA_SIZE >> 20); |
| 428 | |
| 429 | reserve_info->fixed_area_size = fixed_area_size; |
| 430 | reserve_info->fixed_area_start = APQ8064_FW_START; |
| 431 | |
| 432 | ret = memblock_remove(reserve_info->fixed_area_start, |
| 433 | reserve_info->fixed_area_size); |
| 434 | BUG_ON(ret); |
| 435 | #endif |
| 436 | } |
| 437 | |
| 438 | /** |
| 439 | * Reserve memory for ION and calculate amount of reusable memory for fmem. |
| 440 | * We only reserve memory for heaps that are not reusable. However, we only |
| 441 | * support one reusable heap at the moment so we ignore the reusable flag for |
| 442 | * other than the first heap with reusable flag set. Also handle special case |
| 443 | * for video heaps (MM,FW, and MFC). Video requires heaps MM and MFC to be |
| 444 | * at a higher address than FW in addition to not more than 256MB away from the |
| 445 | * base address of the firmware. This means that if MM is reusable the other |
| 446 | * two heaps must be allocated in the same region as FW. This is handled by the |
| 447 | * mem_is_fmem flag in the platform data. In addition the MM heap must be |
| 448 | * adjacent to the FW heap for content protection purposes. |
| 449 | */ |
Stephen Boyd | 668d765 | 2012-04-25 11:31:01 -0700 | [diff] [blame] | 450 | static void __init reserve_ion_memory(void) |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 451 | { |
| 452 | #if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION) |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 453 | unsigned int i; |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 454 | unsigned int fixed_size = 0; |
| 455 | unsigned int fixed_low_size, fixed_middle_size, fixed_high_size; |
| 456 | unsigned long fixed_low_start, fixed_middle_start, fixed_high_start; |
| 457 | |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 458 | fixed_low_size = 0; |
| 459 | fixed_middle_size = 0; |
| 460 | fixed_high_size = 0; |
| 461 | |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 462 | for (i = 0; i < apq8064_ion_pdata.nr; ++i) { |
| 463 | const struct ion_platform_heap *heap = |
| 464 | &(apq8064_ion_pdata.heaps[i]); |
| 465 | |
| 466 | if (heap->extra_data) { |
| 467 | int fixed_position = NOT_FIXED; |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 468 | |
Mitchel Humpherys | 362b52b | 2012-09-13 10:53:22 -0700 | [diff] [blame] | 469 | switch ((int)heap->type) { |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 470 | case ION_HEAP_TYPE_CP: |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 471 | fixed_position = ((struct ion_cp_heap_pdata *) |
| 472 | heap->extra_data)->fixed_position; |
| 473 | break; |
| 474 | case ION_HEAP_TYPE_CARVEOUT: |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 475 | fixed_position = ((struct ion_co_heap_pdata *) |
| 476 | heap->extra_data)->fixed_position; |
| 477 | break; |
| 478 | default: |
| 479 | break; |
| 480 | } |
| 481 | |
| 482 | if (fixed_position != NOT_FIXED) |
| 483 | fixed_size += heap->size; |
| 484 | else |
| 485 | reserve_mem_for_ion(MEMTYPE_EBI1, heap->size); |
| 486 | |
| 487 | if (fixed_position == FIXED_LOW) |
| 488 | fixed_low_size += heap->size; |
| 489 | else if (fixed_position == FIXED_MIDDLE) |
| 490 | fixed_middle_size += heap->size; |
| 491 | else if (fixed_position == FIXED_HIGH) |
| 492 | fixed_high_size += heap->size; |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 493 | } |
| 494 | } |
| 495 | |
| 496 | if (!fixed_size) |
| 497 | return; |
| 498 | |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 499 | /* Since the fixed area may be carved out of lowmem, |
| 500 | * make sure the length is a multiple of 1M. |
| 501 | */ |
Hanumant Singh | eadb750 | 2012-05-15 18:14:04 -0700 | [diff] [blame] | 502 | fixed_size = (fixed_size + HOLE_SIZE + SECTION_SIZE - 1) |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 503 | & SECTION_MASK; |
| 504 | apq8064_reserve_fixed_area(fixed_size); |
| 505 | |
| 506 | fixed_low_start = APQ8064_FIXED_AREA_START; |
Hanumant Singh | eadb750 | 2012-05-15 18:14:04 -0700 | [diff] [blame] | 507 | fixed_middle_start = fixed_low_start + fixed_low_size + HOLE_SIZE; |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 508 | fixed_high_start = fixed_middle_start + fixed_middle_size; |
| 509 | |
| 510 | for (i = 0; i < apq8064_ion_pdata.nr; ++i) { |
| 511 | struct ion_platform_heap *heap = &(apq8064_ion_pdata.heaps[i]); |
| 512 | |
| 513 | if (heap->extra_data) { |
| 514 | int fixed_position = NOT_FIXED; |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 515 | struct ion_cp_heap_pdata *pdata = NULL; |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 516 | |
Mitchel Humpherys | 362b52b | 2012-09-13 10:53:22 -0700 | [diff] [blame] | 517 | switch ((int) heap->type) { |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 518 | case ION_HEAP_TYPE_CP: |
Hanumant Singh | eadb750 | 2012-05-15 18:14:04 -0700 | [diff] [blame] | 519 | pdata = |
| 520 | (struct ion_cp_heap_pdata *)heap->extra_data; |
| 521 | fixed_position = pdata->fixed_position; |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 522 | break; |
| 523 | case ION_HEAP_TYPE_CARVEOUT: |
| 524 | fixed_position = ((struct ion_co_heap_pdata *) |
| 525 | heap->extra_data)->fixed_position; |
| 526 | break; |
| 527 | default: |
| 528 | break; |
| 529 | } |
| 530 | |
| 531 | switch (fixed_position) { |
| 532 | case FIXED_LOW: |
| 533 | heap->base = fixed_low_start; |
| 534 | break; |
| 535 | case FIXED_MIDDLE: |
| 536 | heap->base = fixed_middle_start; |
Hanumant Singh | eadb750 | 2012-05-15 18:14:04 -0700 | [diff] [blame] | 537 | pdata->secure_base = fixed_middle_start |
| 538 | - HOLE_SIZE; |
| 539 | pdata->secure_size = HOLE_SIZE + heap->size; |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 540 | break; |
| 541 | case FIXED_HIGH: |
| 542 | heap->base = fixed_high_start; |
| 543 | break; |
| 544 | default: |
| 545 | break; |
| 546 | } |
| 547 | } |
| 548 | } |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 549 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 550 | } |
| 551 | |
Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 552 | static void __init reserve_mdp_memory(void) |
| 553 | { |
| 554 | apq8064_mdp_writeback(apq8064_reserve_table); |
| 555 | } |
| 556 | |
Laura Abbott | 93a4a35 | 2012-05-25 09:26:35 -0700 | [diff] [blame] | 557 | static void __init reserve_cache_dump_memory(void) |
| 558 | { |
| 559 | #ifdef CONFIG_MSM_CACHE_DUMP |
| 560 | unsigned int total; |
| 561 | |
| 562 | total = apq8064_cache_dump_pdata.l1_size + |
| 563 | apq8064_cache_dump_pdata.l2_size; |
| 564 | apq8064_reserve_table[MEMTYPE_EBI1].size += total; |
| 565 | #endif |
| 566 | } |
| 567 | |
Abhijeet Dharmapurikar | dca26f7 | 2012-09-13 11:02:03 -0700 | [diff] [blame] | 568 | static void __init reserve_mpdcvs_memory(void) |
| 569 | { |
| 570 | apq8064_reserve_table[MEMTYPE_EBI1].size += SZ_32K; |
| 571 | } |
| 572 | |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 573 | static void __init apq8064_calculate_reserve_sizes(void) |
| 574 | { |
| 575 | size_pmem_devices(); |
| 576 | reserve_pmem_memory(); |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 577 | reserve_ion_memory(); |
Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 578 | reserve_mdp_memory(); |
Laura Abbott | 350c836 | 2012-02-28 14:46:52 -0800 | [diff] [blame] | 579 | reserve_rtb_memory(); |
Laura Abbott | 93a4a35 | 2012-05-25 09:26:35 -0700 | [diff] [blame] | 580 | reserve_cache_dump_memory(); |
Abhijeet Dharmapurikar | dca26f7 | 2012-09-13 11:02:03 -0700 | [diff] [blame] | 581 | reserve_mpdcvs_memory(); |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 582 | } |
| 583 | |
| 584 | static struct reserve_info apq8064_reserve_info __initdata = { |
| 585 | .memtype_reserve_table = apq8064_reserve_table, |
| 586 | .calculate_reserve_sizes = apq8064_calculate_reserve_sizes, |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 587 | .reserve_fixed_area = apq8064_reserve_fixed_area, |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 588 | .paddr_to_memtype = apq8064_paddr_to_memtype, |
| 589 | }; |
| 590 | |
| 591 | static int apq8064_memory_bank_size(void) |
| 592 | { |
| 593 | return 1<<29; |
| 594 | } |
| 595 | |
| 596 | static void __init locate_unstable_memory(void) |
| 597 | { |
| 598 | struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1]; |
| 599 | unsigned long bank_size; |
| 600 | unsigned long low, high; |
| 601 | |
| 602 | bank_size = apq8064_memory_bank_size(); |
| 603 | low = meminfo.bank[0].start; |
| 604 | high = mb->start + mb->size; |
Olav Haugan | d76e3a8 | 2012-01-16 16:55:07 -0800 | [diff] [blame] | 605 | |
| 606 | /* Check if 32 bit overflow occured */ |
| 607 | if (high < mb->start) |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 608 | high = -PAGE_SIZE; |
Olav Haugan | d76e3a8 | 2012-01-16 16:55:07 -0800 | [diff] [blame] | 609 | |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 610 | low &= ~(bank_size - 1); |
| 611 | |
| 612 | if (high - low <= bank_size) |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 613 | goto no_dmm; |
| 614 | |
| 615 | #ifdef CONFIG_ENABLE_DMM |
Jack Cheung | 46bfffa | 2012-01-19 15:26:24 -0800 | [diff] [blame] | 616 | apq8064_reserve_info.low_unstable_address = mb->start - |
| 617 | MIN_MEMORY_BLOCK_SIZE + mb->size; |
| 618 | apq8064_reserve_info.max_unstable_size = MIN_MEMORY_BLOCK_SIZE; |
| 619 | |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 620 | apq8064_reserve_info.bank_size = bank_size; |
| 621 | pr_info("low unstable address %lx max size %lx bank size %lx\n", |
| 622 | apq8064_reserve_info.low_unstable_address, |
| 623 | apq8064_reserve_info.max_unstable_size, |
| 624 | apq8064_reserve_info.bank_size); |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 625 | return; |
| 626 | #endif |
| 627 | no_dmm: |
| 628 | apq8064_reserve_info.low_unstable_address = high; |
| 629 | apq8064_reserve_info.max_unstable_size = 0; |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 630 | } |
| 631 | |
Hanumant Singh | 50440d4 | 2012-04-23 19:27:16 -0700 | [diff] [blame] | 632 | static int apq8064_change_memory_power(u64 start, u64 size, |
| 633 | int change_type) |
| 634 | { |
| 635 | return soc_change_memory_power(start, size, change_type); |
| 636 | } |
| 637 | |
Aravind Venkateswaran | 8ac7f41 | 2012-03-16 17:57:30 -0700 | [diff] [blame] | 638 | static char prim_panel_name[PANEL_NAME_MAX_LEN]; |
| 639 | static char ext_panel_name[PANEL_NAME_MAX_LEN]; |
Ajay Singh Parmar | 6b82d2b | 2012-07-19 17:23:26 +0530 | [diff] [blame] | 640 | |
| 641 | static int ext_resolution; |
| 642 | |
Aravind Venkateswaran | 8ac7f41 | 2012-03-16 17:57:30 -0700 | [diff] [blame] | 643 | static int __init prim_display_setup(char *param) |
| 644 | { |
| 645 | if (strnlen(param, PANEL_NAME_MAX_LEN)) |
| 646 | strlcpy(prim_panel_name, param, PANEL_NAME_MAX_LEN); |
| 647 | return 0; |
| 648 | } |
| 649 | early_param("prim_display", prim_display_setup); |
| 650 | |
| 651 | static int __init ext_display_setup(char *param) |
| 652 | { |
| 653 | if (strnlen(param, PANEL_NAME_MAX_LEN)) |
| 654 | strlcpy(ext_panel_name, param, PANEL_NAME_MAX_LEN); |
| 655 | return 0; |
| 656 | } |
| 657 | early_param("ext_display", ext_display_setup); |
| 658 | |
Ajay Singh Parmar | 6b82d2b | 2012-07-19 17:23:26 +0530 | [diff] [blame] | 659 | static int __init hdmi_resulution_setup(char *param) |
| 660 | { |
| 661 | int ret; |
| 662 | ret = kstrtoint(param, 10, &ext_resolution); |
| 663 | return ret; |
| 664 | } |
| 665 | early_param("ext_resolution", hdmi_resulution_setup); |
| 666 | |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 667 | static void __init apq8064_reserve(void) |
| 668 | { |
Ajay Singh Parmar | 6b82d2b | 2012-07-19 17:23:26 +0530 | [diff] [blame] | 669 | apq8064_set_display_params(prim_panel_name, ext_panel_name, |
| 670 | ext_resolution); |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 671 | msm_reserve(); |
| 672 | } |
| 673 | |
Laura Abbott | 6988cef | 2012-03-15 14:27:13 -0700 | [diff] [blame] | 674 | static void __init place_movable_zone(void) |
| 675 | { |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 676 | #ifdef CONFIG_ENABLE_DMM |
Laura Abbott | 6988cef | 2012-03-15 14:27:13 -0700 | [diff] [blame] | 677 | movable_reserved_start = apq8064_reserve_info.low_unstable_address; |
| 678 | movable_reserved_size = apq8064_reserve_info.max_unstable_size; |
| 679 | pr_info("movable zone start %lx size %lx\n", |
| 680 | movable_reserved_start, movable_reserved_size); |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 681 | #endif |
Laura Abbott | 6988cef | 2012-03-15 14:27:13 -0700 | [diff] [blame] | 682 | } |
| 683 | |
| 684 | static void __init apq8064_early_reserve(void) |
| 685 | { |
| 686 | reserve_info = &apq8064_reserve_info; |
| 687 | locate_unstable_memory(); |
| 688 | place_movable_zone(); |
| 689 | |
| 690 | } |
Hemant Kumar | a945b47 | 2012-01-25 15:08:06 -0800 | [diff] [blame] | 691 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
Hemant Kumar | e627597 | 2012-02-29 20:06:21 -0800 | [diff] [blame] | 692 | /* Bandwidth requests (zero) if no vote placed */ |
| 693 | static struct msm_bus_vectors hsic_init_vectors[] = { |
| 694 | { |
| 695 | .src = MSM_BUS_MASTER_SPS, |
| 696 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 697 | .ab = 0, |
| 698 | .ib = 0, |
| 699 | }, |
| 700 | { |
| 701 | .src = MSM_BUS_MASTER_SPS, |
| 702 | .dst = MSM_BUS_SLAVE_SPS, |
| 703 | .ab = 0, |
| 704 | .ib = 0, |
| 705 | }, |
| 706 | }; |
| 707 | |
| 708 | /* Bus bandwidth requests in Bytes/sec */ |
| 709 | static struct msm_bus_vectors hsic_max_vectors[] = { |
| 710 | { |
| 711 | .src = MSM_BUS_MASTER_SPS, |
| 712 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 713 | .ab = 60000000, /* At least 480Mbps on bus. */ |
| 714 | .ib = 960000000, /* MAX bursts rate */ |
| 715 | }, |
| 716 | { |
| 717 | .src = MSM_BUS_MASTER_SPS, |
| 718 | .dst = MSM_BUS_SLAVE_SPS, |
| 719 | .ab = 0, |
| 720 | .ib = 512000000, /*vote for 64Mhz dfab clk rate*/ |
| 721 | }, |
| 722 | }; |
| 723 | |
| 724 | static struct msm_bus_paths hsic_bus_scale_usecases[] = { |
| 725 | { |
| 726 | ARRAY_SIZE(hsic_init_vectors), |
| 727 | hsic_init_vectors, |
| 728 | }, |
| 729 | { |
| 730 | ARRAY_SIZE(hsic_max_vectors), |
| 731 | hsic_max_vectors, |
| 732 | }, |
| 733 | }; |
| 734 | |
| 735 | static struct msm_bus_scale_pdata hsic_bus_scale_pdata = { |
| 736 | hsic_bus_scale_usecases, |
| 737 | ARRAY_SIZE(hsic_bus_scale_usecases), |
| 738 | .name = "hsic", |
| 739 | }; |
| 740 | |
Hemant Kumar | a945b47 | 2012-01-25 15:08:06 -0800 | [diff] [blame] | 741 | static struct msm_hsic_host_platform_data msm_hsic_pdata = { |
Hemant Kumar | e627597 | 2012-02-29 20:06:21 -0800 | [diff] [blame] | 742 | .strobe = 88, |
| 743 | .data = 89, |
| 744 | .bus_scale_table = &hsic_bus_scale_pdata, |
Hemant Kumar | a945b47 | 2012-01-25 15:08:06 -0800 | [diff] [blame] | 745 | }; |
| 746 | #else |
| 747 | static struct msm_hsic_host_platform_data msm_hsic_pdata; |
| 748 | #endif |
| 749 | |
Hemant Kumar | cb7d8a1 | 2012-01-25 12:25:55 -0800 | [diff] [blame] | 750 | #define PID_MAGIC_ID 0x71432909 |
| 751 | #define SERIAL_NUM_MAGIC_ID 0x61945374 |
| 752 | #define SERIAL_NUMBER_LENGTH 127 |
| 753 | #define DLOAD_USB_BASE_ADD 0x2A03F0C8 |
| 754 | |
| 755 | struct magic_num_struct { |
| 756 | uint32_t pid; |
| 757 | uint32_t serial_num; |
| 758 | }; |
| 759 | |
| 760 | struct dload_struct { |
| 761 | uint32_t reserved1; |
| 762 | uint32_t reserved2; |
| 763 | uint32_t reserved3; |
| 764 | uint16_t reserved4; |
| 765 | uint16_t pid; |
| 766 | char serial_number[SERIAL_NUMBER_LENGTH]; |
| 767 | uint16_t reserved5; |
| 768 | struct magic_num_struct magic_struct; |
| 769 | }; |
| 770 | |
| 771 | static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum) |
| 772 | { |
| 773 | struct dload_struct __iomem *dload = 0; |
| 774 | |
| 775 | dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload)); |
| 776 | if (!dload) { |
| 777 | pr_err("%s: cannot remap I/O memory region: %08x\n", |
| 778 | __func__, DLOAD_USB_BASE_ADD); |
| 779 | return -ENXIO; |
| 780 | } |
| 781 | |
| 782 | pr_debug("%s: dload:%p pid:%x serial_num:%s\n", |
| 783 | __func__, dload, pid, snum); |
| 784 | /* update pid */ |
| 785 | dload->magic_struct.pid = PID_MAGIC_ID; |
| 786 | dload->pid = pid; |
| 787 | |
| 788 | /* update serial number */ |
| 789 | dload->magic_struct.serial_num = 0; |
| 790 | if (!snum) { |
| 791 | memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH); |
| 792 | goto out; |
| 793 | } |
| 794 | |
| 795 | dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID; |
| 796 | strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH); |
| 797 | out: |
| 798 | iounmap(dload); |
| 799 | return 0; |
| 800 | } |
| 801 | |
| 802 | static struct android_usb_platform_data android_usb_pdata = { |
| 803 | .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num, |
| 804 | }; |
| 805 | |
Hemant Kumar | 4933b07 | 2011-10-17 23:43:11 -0700 | [diff] [blame] | 806 | static struct platform_device android_usb_device = { |
Hemant Kumar | cb7d8a1 | 2012-01-25 12:25:55 -0800 | [diff] [blame] | 807 | .name = "android_usb", |
| 808 | .id = -1, |
| 809 | .dev = { |
| 810 | .platform_data = &android_usb_pdata, |
| 811 | }, |
Hemant Kumar | 4933b07 | 2011-10-17 23:43:11 -0700 | [diff] [blame] | 812 | }; |
| 813 | |
Hemant Kumar | 7620eed | 2012-02-26 09:08:43 -0800 | [diff] [blame] | 814 | /* Bandwidth requests (zero) if no vote placed */ |
| 815 | static struct msm_bus_vectors usb_init_vectors[] = { |
| 816 | { |
| 817 | .src = MSM_BUS_MASTER_SPS, |
| 818 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 819 | .ab = 0, |
| 820 | .ib = 0, |
| 821 | }, |
| 822 | }; |
| 823 | |
| 824 | /* Bus bandwidth requests in Bytes/sec */ |
| 825 | static struct msm_bus_vectors usb_max_vectors[] = { |
| 826 | { |
| 827 | .src = MSM_BUS_MASTER_SPS, |
| 828 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 829 | .ab = 60000000, /* At least 480Mbps on bus. */ |
| 830 | .ib = 960000000, /* MAX bursts rate */ |
| 831 | }, |
| 832 | }; |
| 833 | |
| 834 | static struct msm_bus_paths usb_bus_scale_usecases[] = { |
| 835 | { |
| 836 | ARRAY_SIZE(usb_init_vectors), |
| 837 | usb_init_vectors, |
| 838 | }, |
| 839 | { |
| 840 | ARRAY_SIZE(usb_max_vectors), |
| 841 | usb_max_vectors, |
| 842 | }, |
| 843 | }; |
| 844 | |
| 845 | static struct msm_bus_scale_pdata usb_bus_scale_pdata = { |
| 846 | usb_bus_scale_usecases, |
| 847 | ARRAY_SIZE(usb_bus_scale_usecases), |
| 848 | .name = "usb", |
| 849 | }; |
| 850 | |
Vamsi Krishna | 1f8704c | 2012-03-29 18:24:24 -0700 | [diff] [blame] | 851 | static int phy_init_seq[] = { |
Chiranjeevi Velempati | f983aeb | 2012-08-23 08:16:50 +0530 | [diff] [blame] | 852 | 0x68, 0x81, /* update DC voltage level */ |
Vamsi Krishna | 1f8704c | 2012-03-29 18:24:24 -0700 | [diff] [blame] | 853 | 0x24, 0x82, /* set pre-emphasis and rise/fall time */ |
| 854 | -1 |
| 855 | }; |
| 856 | |
Vijayavardhan Vennapusa | 4fa1369 | 2012-08-02 14:35:03 +0530 | [diff] [blame] | 857 | #define PMIC_GPIO_DP 27 /* PMIC GPIO for D+ change */ |
| 858 | #define PMIC_GPIO_DP_IRQ PM8921_GPIO_IRQ(PM8921_IRQ_BASE, PMIC_GPIO_DP) |
Jack Pham | 87f202f | 2012-08-06 00:24:22 -0700 | [diff] [blame] | 859 | #define MSM_MPM_PIN_USB1_OTGSESSVLD 40 |
| 860 | |
Hemant Kumar | 4933b07 | 2011-10-17 23:43:11 -0700 | [diff] [blame] | 861 | static struct msm_otg_platform_data msm_otg_pdata = { |
Hemant Kumar | d86c488 | 2012-01-24 19:39:37 -0800 | [diff] [blame] | 862 | .mode = USB_OTG, |
| 863 | .otg_control = OTG_PMIC_CONTROL, |
Hemant Kumar | 4933b07 | 2011-10-17 23:43:11 -0700 | [diff] [blame] | 864 | .phy_type = SNPS_28NM_INTEGRATED_PHY, |
Hemant Kumar | d86c488 | 2012-01-24 19:39:37 -0800 | [diff] [blame] | 865 | .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE), |
| 866 | .power_budget = 750, |
Hemant Kumar | 7620eed | 2012-02-26 09:08:43 -0800 | [diff] [blame] | 867 | .bus_scale_table = &usb_bus_scale_pdata, |
Vamsi Krishna | 1f8704c | 2012-03-29 18:24:24 -0700 | [diff] [blame] | 868 | .phy_init_seq = phy_init_seq, |
Jack Pham | 87f202f | 2012-08-06 00:24:22 -0700 | [diff] [blame] | 869 | .mpm_otgsessvld_int = MSM_MPM_PIN_USB1_OTGSESSVLD, |
Hemant Kumar | 4933b07 | 2011-10-17 23:43:11 -0700 | [diff] [blame] | 870 | }; |
| 871 | |
Hemant Kumar | 1d66e1c | 2012-02-13 15:24:59 -0800 | [diff] [blame] | 872 | static struct msm_usb_host_platform_data msm_ehci_host_pdata3 = { |
Manu Gautam | 91223e0 | 2011-11-08 15:27:22 +0530 | [diff] [blame] | 873 | .power_budget = 500, |
| 874 | }; |
| 875 | |
Hemant Kumar | 1d66e1c | 2012-02-13 15:24:59 -0800 | [diff] [blame] | 876 | #ifdef CONFIG_USB_EHCI_MSM_HOST4 |
| 877 | static struct msm_usb_host_platform_data msm_ehci_host_pdata4; |
| 878 | #endif |
| 879 | |
Manu Gautam | 91223e0 | 2011-11-08 15:27:22 +0530 | [diff] [blame] | 880 | static void __init apq8064_ehci_host_init(void) |
| 881 | { |
Chiranjeevi Velempati | b822fa3 | 2012-05-23 22:05:59 +0530 | [diff] [blame] | 882 | if (machine_is_apq8064_liquid() || machine_is_mpq8064_cdp() || |
Chiranjeevi Velempati | dd4dbaa | 2012-10-05 16:22:04 +0530 | [diff] [blame] | 883 | machine_is_mpq8064_hrd() || machine_is_mpq8064_dtv() || |
| 884 | machine_is_apq8064_cdp()) { |
Chiranjeevi Velempati | b822fa3 | 2012-05-23 22:05:59 +0530 | [diff] [blame] | 885 | if (machine_is_apq8064_liquid()) |
| 886 | msm_ehci_host_pdata3.dock_connect_irq = |
| 887 | PM8921_MPP_IRQ(PM8921_IRQ_BASE, 9); |
Vijayavardhan Vennapusa | 4fa1369 | 2012-08-02 14:35:03 +0530 | [diff] [blame] | 888 | else |
| 889 | msm_ehci_host_pdata3.pmic_gpio_dp_irq = |
| 890 | PMIC_GPIO_DP_IRQ; |
Hemant Kumar | 5692535 | 2012-02-13 16:59:52 -0800 | [diff] [blame] | 891 | |
Manu Gautam | 91223e0 | 2011-11-08 15:27:22 +0530 | [diff] [blame] | 892 | apq8064_device_ehci_host3.dev.platform_data = |
Hemant Kumar | 1d66e1c | 2012-02-13 15:24:59 -0800 | [diff] [blame] | 893 | &msm_ehci_host_pdata3; |
Manu Gautam | 91223e0 | 2011-11-08 15:27:22 +0530 | [diff] [blame] | 894 | platform_device_register(&apq8064_device_ehci_host3); |
Hemant Kumar | 1d66e1c | 2012-02-13 15:24:59 -0800 | [diff] [blame] | 895 | |
| 896 | #ifdef CONFIG_USB_EHCI_MSM_HOST4 |
| 897 | apq8064_device_ehci_host4.dev.platform_data = |
| 898 | &msm_ehci_host_pdata4; |
| 899 | platform_device_register(&apq8064_device_ehci_host4); |
| 900 | #endif |
Manu Gautam | 91223e0 | 2011-11-08 15:27:22 +0530 | [diff] [blame] | 901 | } |
| 902 | } |
| 903 | |
David Keitel | 2f613d9 | 2012-02-15 11:29:16 -0800 | [diff] [blame] | 904 | static struct smb349_platform_data smb349_data __initdata = { |
| 905 | .en_n_gpio = PM8921_GPIO_PM_TO_SYS(37), |
| 906 | .chg_susp_gpio = PM8921_GPIO_PM_TO_SYS(30), |
| 907 | .chg_current_ma = 2200, |
| 908 | }; |
| 909 | |
| 910 | static struct i2c_board_info smb349_charger_i2c_info[] __initdata = { |
| 911 | { |
| 912 | I2C_BOARD_INFO(SMB349_NAME, 0x1B), |
| 913 | .platform_data = &smb349_data, |
| 914 | }, |
| 915 | }; |
| 916 | |
Siddartha Mohanadoss | b9df494 | 2012-02-08 09:58:21 -0800 | [diff] [blame] | 917 | struct sx150x_platform_data apq8064_sx150x_data[] = { |
| 918 | [SX150X_EPM] = { |
| 919 | .gpio_base = GPIO_EPM_EXPANDER_BASE, |
| 920 | .oscio_is_gpo = false, |
| 921 | .io_pullup_ena = 0x0, |
| 922 | .io_pulldn_ena = 0x0, |
| 923 | .io_open_drain_ena = 0x0, |
| 924 | .io_polarity = 0, |
| 925 | .irq_summary = -1, |
| 926 | }, |
| 927 | }; |
| 928 | |
| 929 | static struct epm_chan_properties ads_adc_channel_data[] = { |
Yan He | 44c5996 | 2012-08-31 11:14:58 -0700 | [diff] [blame] | 930 | {10, 100}, {1000, 1}, {10, 100}, {1000, 1}, |
| 931 | {10, 100}, {1000, 1}, {10, 100}, {1000, 1}, |
| 932 | {10, 100}, {20, 100}, {500, 100}, {5, 100}, |
| 933 | {1000, 1}, {200, 100}, {50, 100}, {10, 100}, |
| 934 | {510, 100}, {50, 100}, {20, 100}, {100, 100}, |
| 935 | {510, 100}, {20, 100}, {50, 100}, {200, 100}, |
| 936 | {10, 100}, {20, 100}, {1000, 1}, {10, 100}, |
| 937 | {200, 100}, {510, 100}, {1000, 100}, {200, 100}, |
Siddartha Mohanadoss | b9df494 | 2012-02-08 09:58:21 -0800 | [diff] [blame] | 938 | }; |
| 939 | |
| 940 | static struct epm_adc_platform_data epm_adc_pdata = { |
| 941 | .channel = ads_adc_channel_data, |
| 942 | .bus_id = 0x0, |
| 943 | .epm_i2c_board_info = { |
| 944 | .type = "sx1509q", |
| 945 | .addr = 0x3e, |
| 946 | .platform_data = &apq8064_sx150x_data[SX150X_EPM], |
| 947 | }, |
| 948 | .gpio_expander_base_addr = GPIO_EPM_EXPANDER_BASE, |
| 949 | }; |
| 950 | |
| 951 | static struct platform_device epm_adc_device = { |
| 952 | .name = "epm_adc", |
| 953 | .id = -1, |
| 954 | .dev = { |
| 955 | .platform_data = &epm_adc_pdata, |
| 956 | }, |
| 957 | }; |
| 958 | |
| 959 | static void __init apq8064_epm_adc_init(void) |
| 960 | { |
| 961 | epm_adc_pdata.num_channels = 32; |
| 962 | epm_adc_pdata.num_adc = 2; |
| 963 | epm_adc_pdata.chan_per_adc = 16; |
| 964 | epm_adc_pdata.chan_per_mux = 8; |
| 965 | }; |
| 966 | |
Swaminathan Sathappan | 2f51a75 | 2011-12-05 12:51:19 -0800 | [diff] [blame] | 967 | /* Micbias setting is based on 8660 CDP/MTP/FLUID requirement |
| 968 | * 4 micbiases are used to power various analog and digital |
| 969 | * microphones operating at 1800 mV. Technically, all micbiases |
| 970 | * can source from single cfilter since all microphones operate |
| 971 | * at the same voltage level. The arrangement below is to make |
| 972 | * sure all cfilters are exercised. LDO_H regulator ouput level |
| 973 | * does not need to be as high as 2.85V. It is choosen for |
| 974 | * microphone sensitivity purpose. |
| 975 | */ |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 976 | static struct wcd9xxx_pdata apq8064_tabla_platform_data = { |
Swaminathan Sathappan | 2f51a75 | 2011-12-05 12:51:19 -0800 | [diff] [blame] | 977 | .slimbus_slave_device = { |
| 978 | .name = "tabla-slave", |
| 979 | .e_addr = {0, 0, 0x10, 0, 0x17, 2}, |
| 980 | }, |
Swaminathan Sathappan | cef966d | 2011-12-15 17:27:04 -0800 | [diff] [blame] | 981 | .irq = MSM_GPIO_TO_INT(42), |
Swaminathan Sathappan | 2f51a75 | 2011-12-05 12:51:19 -0800 | [diff] [blame] | 982 | .irq_base = TABLA_INTERRUPT_BASE, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 983 | .num_irqs = NR_WCD9XXX_IRQS, |
Swaminathan Sathappan | 2f51a75 | 2011-12-05 12:51:19 -0800 | [diff] [blame] | 984 | .reset_gpio = PM8921_GPIO_PM_TO_SYS(34), |
| 985 | .micbias = { |
| 986 | .ldoh_v = TABLA_LDOH_2P85_V, |
| 987 | .cfilt1_mv = 1800, |
Bhalchandra Gajare | 975c53a | 2012-08-10 12:16:49 -0700 | [diff] [blame] | 988 | .cfilt2_mv = 2700, |
Swaminathan Sathappan | 2f51a75 | 2011-12-05 12:51:19 -0800 | [diff] [blame] | 989 | .cfilt3_mv = 1800, |
| 990 | .bias1_cfilt_sel = TABLA_CFILT1_SEL, |
| 991 | .bias2_cfilt_sel = TABLA_CFILT2_SEL, |
| 992 | .bias3_cfilt_sel = TABLA_CFILT3_SEL, |
| 993 | .bias4_cfilt_sel = TABLA_CFILT3_SEL, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 994 | }, |
| 995 | .regulator = { |
| 996 | { |
| 997 | .name = "CDC_VDD_CP", |
| 998 | .min_uV = 1800000, |
| 999 | .max_uV = 1800000, |
| 1000 | .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX, |
| 1001 | }, |
| 1002 | { |
| 1003 | .name = "CDC_VDDA_RX", |
| 1004 | .min_uV = 1800000, |
| 1005 | .max_uV = 1800000, |
| 1006 | .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX, |
| 1007 | }, |
| 1008 | { |
| 1009 | .name = "CDC_VDDA_TX", |
| 1010 | .min_uV = 1800000, |
| 1011 | .max_uV = 1800000, |
| 1012 | .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX, |
| 1013 | }, |
| 1014 | { |
| 1015 | .name = "VDDIO_CDC", |
| 1016 | .min_uV = 1800000, |
| 1017 | .max_uV = 1800000, |
| 1018 | .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX, |
| 1019 | }, |
| 1020 | { |
| 1021 | .name = "VDDD_CDC_D", |
| 1022 | .min_uV = 1225000, |
David Collins | 62debe8 | 2012-06-06 17:01:03 -0700 | [diff] [blame] | 1023 | .max_uV = 1250000, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 1024 | .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX, |
| 1025 | }, |
| 1026 | { |
| 1027 | .name = "CDC_VDDA_A_1P2V", |
| 1028 | .min_uV = 1225000, |
David Collins | 62debe8 | 2012-06-06 17:01:03 -0700 | [diff] [blame] | 1029 | .max_uV = 1250000, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 1030 | .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX, |
| 1031 | }, |
| 1032 | }, |
Swaminathan Sathappan | 2f51a75 | 2011-12-05 12:51:19 -0800 | [diff] [blame] | 1033 | }; |
| 1034 | |
| 1035 | static struct slim_device apq8064_slim_tabla = { |
| 1036 | .name = "tabla-slim", |
| 1037 | .e_addr = {0, 1, 0x10, 0, 0x17, 2}, |
| 1038 | .dev = { |
| 1039 | .platform_data = &apq8064_tabla_platform_data, |
| 1040 | }, |
| 1041 | }; |
| 1042 | |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 1043 | static struct wcd9xxx_pdata apq8064_tabla20_platform_data = { |
Swaminathan Sathappan | cef966d | 2011-12-15 17:27:04 -0800 | [diff] [blame] | 1044 | .slimbus_slave_device = { |
| 1045 | .name = "tabla-slave", |
| 1046 | .e_addr = {0, 0, 0x60, 0, 0x17, 2}, |
| 1047 | }, |
| 1048 | .irq = MSM_GPIO_TO_INT(42), |
| 1049 | .irq_base = TABLA_INTERRUPT_BASE, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 1050 | .num_irqs = NR_WCD9XXX_IRQS, |
Swaminathan Sathappan | cef966d | 2011-12-15 17:27:04 -0800 | [diff] [blame] | 1051 | .reset_gpio = PM8921_GPIO_PM_TO_SYS(34), |
| 1052 | .micbias = { |
| 1053 | .ldoh_v = TABLA_LDOH_2P85_V, |
| 1054 | .cfilt1_mv = 1800, |
Bhalchandra Gajare | 975c53a | 2012-08-10 12:16:49 -0700 | [diff] [blame] | 1055 | .cfilt2_mv = 2700, |
Swaminathan Sathappan | cef966d | 2011-12-15 17:27:04 -0800 | [diff] [blame] | 1056 | .cfilt3_mv = 1800, |
| 1057 | .bias1_cfilt_sel = TABLA_CFILT1_SEL, |
| 1058 | .bias2_cfilt_sel = TABLA_CFILT2_SEL, |
| 1059 | .bias3_cfilt_sel = TABLA_CFILT3_SEL, |
| 1060 | .bias4_cfilt_sel = TABLA_CFILT3_SEL, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 1061 | }, |
| 1062 | .regulator = { |
| 1063 | { |
| 1064 | .name = "CDC_VDD_CP", |
| 1065 | .min_uV = 1800000, |
| 1066 | .max_uV = 1800000, |
| 1067 | .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX, |
| 1068 | }, |
| 1069 | { |
| 1070 | .name = "CDC_VDDA_RX", |
| 1071 | .min_uV = 1800000, |
| 1072 | .max_uV = 1800000, |
| 1073 | .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX, |
| 1074 | }, |
| 1075 | { |
| 1076 | .name = "CDC_VDDA_TX", |
| 1077 | .min_uV = 1800000, |
| 1078 | .max_uV = 1800000, |
| 1079 | .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX, |
| 1080 | }, |
| 1081 | { |
| 1082 | .name = "VDDIO_CDC", |
| 1083 | .min_uV = 1800000, |
| 1084 | .max_uV = 1800000, |
| 1085 | .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX, |
| 1086 | }, |
| 1087 | { |
| 1088 | .name = "VDDD_CDC_D", |
| 1089 | .min_uV = 1225000, |
David Collins | 62debe8 | 2012-06-06 17:01:03 -0700 | [diff] [blame] | 1090 | .max_uV = 1250000, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 1091 | .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX, |
| 1092 | }, |
| 1093 | { |
| 1094 | .name = "CDC_VDDA_A_1P2V", |
| 1095 | .min_uV = 1225000, |
David Collins | 62debe8 | 2012-06-06 17:01:03 -0700 | [diff] [blame] | 1096 | .max_uV = 1250000, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 1097 | .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX, |
| 1098 | }, |
| 1099 | }, |
Swaminathan Sathappan | cef966d | 2011-12-15 17:27:04 -0800 | [diff] [blame] | 1100 | }; |
| 1101 | |
| 1102 | static struct slim_device apq8064_slim_tabla20 = { |
| 1103 | .name = "tabla2x-slim", |
| 1104 | .e_addr = {0, 1, 0x60, 0, 0x17, 2}, |
| 1105 | .dev = { |
| 1106 | .platform_data = &apq8064_tabla20_platform_data, |
| 1107 | }, |
| 1108 | }; |
| 1109 | |
Kuirong Wang | f8c5e14 | 2012-06-21 16:17:32 -0700 | [diff] [blame] | 1110 | static struct wcd9xxx_pdata apq8064_tabla_i2c_platform_data = { |
| 1111 | .irq = MSM_GPIO_TO_INT(77), |
| 1112 | .irq_base = TABLA_INTERRUPT_BASE, |
| 1113 | .num_irqs = NR_WCD9XXX_IRQS, |
| 1114 | .reset_gpio = PM8921_GPIO_PM_TO_SYS(34), |
| 1115 | .micbias = { |
| 1116 | .ldoh_v = TABLA_LDOH_2P85_V, |
| 1117 | .cfilt1_mv = 1800, |
| 1118 | .cfilt2_mv = 1800, |
| 1119 | .cfilt3_mv = 1800, |
| 1120 | .bias1_cfilt_sel = TABLA_CFILT1_SEL, |
| 1121 | .bias2_cfilt_sel = TABLA_CFILT2_SEL, |
| 1122 | .bias3_cfilt_sel = TABLA_CFILT3_SEL, |
| 1123 | .bias4_cfilt_sel = TABLA_CFILT3_SEL, |
| 1124 | }, |
| 1125 | .regulator = { |
| 1126 | { |
| 1127 | .name = "CDC_VDD_CP", |
| 1128 | .min_uV = 1800000, |
| 1129 | .max_uV = 1800000, |
| 1130 | .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX, |
| 1131 | }, |
| 1132 | { |
| 1133 | .name = "CDC_VDDA_RX", |
| 1134 | .min_uV = 1800000, |
| 1135 | .max_uV = 1800000, |
| 1136 | .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX, |
| 1137 | }, |
| 1138 | { |
| 1139 | .name = "CDC_VDDA_TX", |
| 1140 | .min_uV = 1800000, |
| 1141 | .max_uV = 1800000, |
| 1142 | .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX, |
| 1143 | }, |
| 1144 | { |
| 1145 | .name = "VDDIO_CDC", |
| 1146 | .min_uV = 1800000, |
| 1147 | .max_uV = 1800000, |
| 1148 | .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX, |
| 1149 | }, |
| 1150 | { |
| 1151 | .name = "VDDD_CDC_D", |
| 1152 | .min_uV = 1225000, |
| 1153 | .max_uV = 1250000, |
| 1154 | .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX, |
| 1155 | }, |
| 1156 | { |
| 1157 | .name = "CDC_VDDA_A_1P2V", |
| 1158 | .min_uV = 1225000, |
| 1159 | .max_uV = 1250000, |
| 1160 | .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX, |
| 1161 | }, |
| 1162 | }, |
| 1163 | }; |
| 1164 | |
| 1165 | static struct i2c_board_info apq8064_tabla_i2c_device_info[] __initdata = { |
| 1166 | { |
| 1167 | I2C_BOARD_INFO("tabla top level", |
| 1168 | APQ_8064_TABLA_I2C_SLAVE_ADDR), |
| 1169 | .platform_data = &apq8064_tabla_i2c_platform_data, |
| 1170 | }, |
| 1171 | { |
| 1172 | I2C_BOARD_INFO("tabla analog", |
| 1173 | APQ_8064_TABLA_ANALOG_I2C_SLAVE_ADDR), |
| 1174 | .platform_data = &apq8064_tabla_i2c_platform_data, |
| 1175 | }, |
| 1176 | { |
| 1177 | I2C_BOARD_INFO("tabla digital1", |
| 1178 | APQ_8064_TABLA_DIGITAL1_I2C_SLAVE_ADDR), |
| 1179 | .platform_data = &apq8064_tabla_i2c_platform_data, |
| 1180 | }, |
| 1181 | { |
| 1182 | I2C_BOARD_INFO("tabla digital2", |
| 1183 | APQ_8064_TABLA_DIGITAL2_I2C_SLAVE_ADDR), |
| 1184 | .platform_data = &apq8064_tabla_i2c_platform_data, |
| 1185 | }, |
| 1186 | }; |
| 1187 | |
Santosh Mardi | 344455a | 2012-09-07 13:22:16 +0530 | [diff] [blame] | 1188 | static struct wcd9xxx_pdata mpq8064_ashiko20_platform_data = { |
| 1189 | .slimbus_slave_device = { |
| 1190 | .name = "tabla-slave", |
| 1191 | .e_addr = {0, 0, 0x60, 0, 0x17, 2}, |
| 1192 | }, |
| 1193 | .irq = MSM_GPIO_TO_INT(42), |
| 1194 | .irq_base = TABLA_INTERRUPT_BASE, |
| 1195 | .num_irqs = NR_WCD9XXX_IRQS, |
| 1196 | .reset_gpio = PM8921_GPIO_PM_TO_SYS(34), |
| 1197 | .micbias = { |
| 1198 | .ldoh_v = TABLA_LDOH_2P85_V, |
| 1199 | .cfilt1_mv = 1800, |
| 1200 | .cfilt2_mv = 1800, |
| 1201 | .cfilt3_mv = 1800, |
| 1202 | .bias1_cfilt_sel = TABLA_CFILT1_SEL, |
| 1203 | .bias2_cfilt_sel = TABLA_CFILT2_SEL, |
| 1204 | .bias3_cfilt_sel = TABLA_CFILT3_SEL, |
| 1205 | .bias4_cfilt_sel = TABLA_CFILT3_SEL, |
| 1206 | }, |
| 1207 | .regulator = { |
| 1208 | { |
| 1209 | .name = "CDC_VDD_CP", |
| 1210 | .min_uV = 1800000, |
| 1211 | .max_uV = 1800000, |
| 1212 | .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX, |
| 1213 | }, |
| 1214 | { |
| 1215 | .name = "CDC_VDDA_RX", |
| 1216 | .min_uV = 1800000, |
| 1217 | .max_uV = 1800000, |
| 1218 | .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX, |
| 1219 | }, |
| 1220 | { |
| 1221 | .name = "CDC_VDDA_TX", |
| 1222 | .min_uV = 1800000, |
| 1223 | .max_uV = 1800000, |
| 1224 | .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX, |
| 1225 | }, |
| 1226 | { |
| 1227 | .name = "VDDIO_CDC", |
| 1228 | .min_uV = 1800000, |
| 1229 | .max_uV = 1800000, |
| 1230 | .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX, |
| 1231 | }, |
| 1232 | { |
| 1233 | .name = "HRD_VDDD_CDC_D", |
| 1234 | .min_uV = 1200000, |
| 1235 | .max_uV = 1200000, |
| 1236 | .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX, |
| 1237 | }, |
| 1238 | { |
| 1239 | .name = "HRD_CDC_VDDA_A_1P2V", |
| 1240 | .min_uV = 1200000, |
| 1241 | .max_uV = 1200000, |
| 1242 | .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX, |
| 1243 | }, |
| 1244 | }, |
| 1245 | }; |
| 1246 | |
| 1247 | static struct slim_device mpq8064_slim_ashiko20 = { |
| 1248 | .name = "tabla2x-slim", |
| 1249 | .e_addr = {0, 1, 0x60, 0, 0x17, 2}, |
| 1250 | .dev = { |
| 1251 | .platform_data = &mpq8064_ashiko20_platform_data, |
| 1252 | }, |
| 1253 | }; |
| 1254 | |
| 1255 | |
Santosh Mardi | 695be0d | 2012-04-10 23:21:12 +0530 | [diff] [blame] | 1256 | /* enable the level shifter for cs8427 to make sure the I2C |
| 1257 | * clock is running at 100KHz and voltage levels are at 3.3 |
| 1258 | * and 5 volts |
| 1259 | */ |
Aviral Gupta | 6bb723f | 2012-11-06 22:27:17 +0530 | [diff] [blame^] | 1260 | static int enable_100KHz_ls(int enable, int gpio) |
Santosh Mardi | 695be0d | 2012-04-10 23:21:12 +0530 | [diff] [blame] | 1261 | { |
Aviral Gupta | 6bb723f | 2012-11-06 22:27:17 +0530 | [diff] [blame^] | 1262 | if (enable) |
| 1263 | gpio_direction_output(gpio, 1); |
| 1264 | else |
| 1265 | gpio_direction_output(gpio, 0); |
| 1266 | return 0; |
Santosh Mardi | 695be0d | 2012-04-10 23:21:12 +0530 | [diff] [blame] | 1267 | } |
| 1268 | |
Santosh Mardi | eff9a74 | 2012-04-09 23:23:39 +0530 | [diff] [blame] | 1269 | static struct cs8427_platform_data cs8427_i2c_platform_data = { |
| 1270 | .irq = SX150X_GPIO(1, 4), |
| 1271 | .reset_gpio = SX150X_GPIO(1, 6), |
Santosh Mardi | 695be0d | 2012-04-10 23:21:12 +0530 | [diff] [blame] | 1272 | .enable = enable_100KHz_ls, |
Aviral Gupta | 6bb723f | 2012-11-06 22:27:17 +0530 | [diff] [blame^] | 1273 | .ls_gpio = SX150X_GPIO(1, 10), |
Santosh Mardi | eff9a74 | 2012-04-09 23:23:39 +0530 | [diff] [blame] | 1274 | }; |
| 1275 | |
| 1276 | static struct i2c_board_info cs8427_device_info[] __initdata = { |
| 1277 | { |
| 1278 | I2C_BOARD_INFO("cs8427", CS8427_ADDR4), |
| 1279 | .platform_data = &cs8427_i2c_platform_data, |
| 1280 | }, |
| 1281 | }; |
| 1282 | |
Amy Maloche | 70090f99 | 2012-02-16 16:35:26 -0800 | [diff] [blame] | 1283 | #define HAP_SHIFT_LVL_OE_GPIO PM8921_MPP_PM_TO_SYS(8) |
| 1284 | #define ISA1200_HAP_EN_GPIO PM8921_GPIO_PM_TO_SYS(33) |
| 1285 | #define ISA1200_HAP_LEN_GPIO PM8921_GPIO_PM_TO_SYS(20) |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 1286 | #define ISA1200_HAP_CLK_PM8921 PM8921_GPIO_PM_TO_SYS(44) |
| 1287 | #define ISA1200_HAP_CLK_PM8917 PM8921_GPIO_PM_TO_SYS(38) |
Amy Maloche | 70090f99 | 2012-02-16 16:35:26 -0800 | [diff] [blame] | 1288 | |
Mohan Pallaka | 2d87760 | 2012-05-11 13:07:30 +0530 | [diff] [blame] | 1289 | static int isa1200_clk_enable(bool on) |
Amy Maloche | 70090f99 | 2012-02-16 16:35:26 -0800 | [diff] [blame] | 1290 | { |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 1291 | unsigned int gpio = ISA1200_HAP_CLK_PM8921; |
Amy Maloche | 8f97389 | 2012-03-26 14:53:13 -0700 | [diff] [blame] | 1292 | int rc = 0; |
| 1293 | |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 1294 | if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917) |
| 1295 | gpio = ISA1200_HAP_CLK_PM8917; |
| 1296 | |
| 1297 | gpio_set_value_cansleep(gpio, on); |
Amy Maloche | 70090f99 | 2012-02-16 16:35:26 -0800 | [diff] [blame] | 1298 | |
Mohan Pallaka | 2d87760 | 2012-05-11 13:07:30 +0530 | [diff] [blame] | 1299 | if (on) { |
Amy Maloche | 8f97389 | 2012-03-26 14:53:13 -0700 | [diff] [blame] | 1300 | rc = pm8xxx_aux_clk_control(CLK_MP3_2, XO_DIV_1, true); |
Mohan Pallaka | 2d87760 | 2012-05-11 13:07:30 +0530 | [diff] [blame] | 1301 | if (rc) { |
| 1302 | pr_err("%s: unable to write aux clock register(%d)\n", |
| 1303 | __func__, rc); |
| 1304 | goto err_gpio_dis; |
| 1305 | } |
| 1306 | } else { |
Amy Maloche | 8f97389 | 2012-03-26 14:53:13 -0700 | [diff] [blame] | 1307 | rc = pm8xxx_aux_clk_control(CLK_MP3_2, XO_DIV_NONE, true); |
Mohan Pallaka | 2d87760 | 2012-05-11 13:07:30 +0530 | [diff] [blame] | 1308 | if (rc) |
| 1309 | pr_err("%s: unable to write aux clock register(%d)\n", |
| 1310 | __func__, rc); |
Amy Maloche | 8f97389 | 2012-03-26 14:53:13 -0700 | [diff] [blame] | 1311 | } |
| 1312 | |
| 1313 | return rc; |
Mohan Pallaka | 2d87760 | 2012-05-11 13:07:30 +0530 | [diff] [blame] | 1314 | |
| 1315 | err_gpio_dis: |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 1316 | gpio_set_value_cansleep(gpio, !on); |
Mohan Pallaka | 2d87760 | 2012-05-11 13:07:30 +0530 | [diff] [blame] | 1317 | return rc; |
Amy Maloche | 70090f99 | 2012-02-16 16:35:26 -0800 | [diff] [blame] | 1318 | } |
| 1319 | |
| 1320 | static int isa1200_dev_setup(bool enable) |
| 1321 | { |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 1322 | unsigned int gpio = ISA1200_HAP_CLK_PM8921; |
Amy Maloche | 70090f99 | 2012-02-16 16:35:26 -0800 | [diff] [blame] | 1323 | int rc = 0; |
| 1324 | |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 1325 | if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917) |
| 1326 | gpio = ISA1200_HAP_CLK_PM8917; |
| 1327 | |
Amy Maloche | 70090f99 | 2012-02-16 16:35:26 -0800 | [diff] [blame] | 1328 | if (!enable) |
| 1329 | goto free_gpio; |
| 1330 | |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 1331 | rc = gpio_request(gpio, "haptics_clk"); |
Amy Maloche | 70090f99 | 2012-02-16 16:35:26 -0800 | [diff] [blame] | 1332 | if (rc) { |
| 1333 | pr_err("%s: unable to request gpio %d config(%d)\n", |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 1334 | __func__, gpio, rc); |
Amy Maloche | 70090f99 | 2012-02-16 16:35:26 -0800 | [diff] [blame] | 1335 | return rc; |
| 1336 | } |
| 1337 | |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 1338 | rc = gpio_direction_output(gpio, 0); |
Amy Maloche | 70090f99 | 2012-02-16 16:35:26 -0800 | [diff] [blame] | 1339 | if (rc) { |
| 1340 | pr_err("%s: unable to set direction\n", __func__); |
| 1341 | goto free_gpio; |
| 1342 | } |
| 1343 | |
| 1344 | return 0; |
| 1345 | |
| 1346 | free_gpio: |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 1347 | gpio_free(gpio); |
Amy Maloche | 70090f99 | 2012-02-16 16:35:26 -0800 | [diff] [blame] | 1348 | return rc; |
| 1349 | } |
| 1350 | |
| 1351 | static struct isa1200_regulator isa1200_reg_data[] = { |
| 1352 | { |
| 1353 | .name = "vddp", |
| 1354 | .min_uV = ISA_I2C_VTG_MIN_UV, |
| 1355 | .max_uV = ISA_I2C_VTG_MAX_UV, |
| 1356 | .load_uA = ISA_I2C_CURR_UA, |
| 1357 | }, |
| 1358 | }; |
| 1359 | |
| 1360 | static struct isa1200_platform_data isa1200_1_pdata = { |
| 1361 | .name = "vibrator", |
| 1362 | .dev_setup = isa1200_dev_setup, |
Mohan Pallaka | 2d87760 | 2012-05-11 13:07:30 +0530 | [diff] [blame] | 1363 | .clk_enable = isa1200_clk_enable, |
Mohan Pallaka | 32f20a7 | 2012-06-14 14:41:11 +0530 | [diff] [blame] | 1364 | .need_pwm_clk = true, |
Amy Maloche | 70090f99 | 2012-02-16 16:35:26 -0800 | [diff] [blame] | 1365 | .hap_en_gpio = ISA1200_HAP_EN_GPIO, |
| 1366 | .hap_len_gpio = ISA1200_HAP_LEN_GPIO, |
| 1367 | .max_timeout = 15000, |
| 1368 | .mode_ctrl = PWM_GEN_MODE, |
| 1369 | .pwm_fd = { |
| 1370 | .pwm_div = 256, |
| 1371 | }, |
| 1372 | .is_erm = false, |
| 1373 | .smart_en = true, |
| 1374 | .ext_clk_en = true, |
| 1375 | .chip_en = 1, |
| 1376 | .regulator_info = isa1200_reg_data, |
| 1377 | .num_regulators = ARRAY_SIZE(isa1200_reg_data), |
| 1378 | }; |
| 1379 | |
| 1380 | static struct i2c_board_info isa1200_board_info[] __initdata = { |
| 1381 | { |
| 1382 | I2C_BOARD_INFO("isa1200_1", 0x90>>1), |
| 1383 | .platform_data = &isa1200_1_pdata, |
| 1384 | }, |
| 1385 | }; |
Jing Lin | 21ed4de | 2012-02-05 15:53:28 -0800 | [diff] [blame] | 1386 | /* configuration data for mxt1386e using V2.1 firmware */ |
| 1387 | static const u8 mxt1386e_config_data_v2_1[] = { |
| 1388 | /* T6 Object */ |
| 1389 | 0, 0, 0, 0, 0, 0, |
| 1390 | /* T38 Object */ |
Jing Lin | c6a55cfc | 2012-08-31 10:54:44 -0700 | [diff] [blame] | 1391 | 14, 3, 0, 5, 7, 12, 0, 0, 0, 0, |
Jing Lin | 21ed4de | 2012-02-05 15:53:28 -0800 | [diff] [blame] | 1392 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1393 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1394 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1395 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1396 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1397 | 0, 0, 0, 0, |
| 1398 | /* T7 Object */ |
Jing Lin | c6a55cfc | 2012-08-31 10:54:44 -0700 | [diff] [blame] | 1399 | 32, 10, 50, |
Jing Lin | 21ed4de | 2012-02-05 15:53:28 -0800 | [diff] [blame] | 1400 | /* T8 Object */ |
Jing Lin | f1208fd | 2012-02-23 11:15:42 -0800 | [diff] [blame] | 1401 | 25, 0, 20, 20, 0, 0, 0, 0, 0, 0, |
Jing Lin | 21ed4de | 2012-02-05 15:53:28 -0800 | [diff] [blame] | 1402 | /* T9 Object */ |
Jing Lin | 943fcec | 2012-05-25 13:58:57 -0700 | [diff] [blame] | 1403 | 139, 0, 0, 26, 42, 0, 32, 80, 2, 5, |
Jing Lin | c6a55cfc | 2012-08-31 10:54:44 -0700 | [diff] [blame] | 1404 | 0, 5, 5, 79, 10, 30, 10, 10, 255, 2, |
Jing Lin | f1208fd | 2012-02-23 11:15:42 -0800 | [diff] [blame] | 1405 | 85, 5, 0, 5, 9, 5, 12, 35, 70, 40, |
| 1406 | 20, 5, 0, 0, 0, |
Jing Lin | 21ed4de | 2012-02-05 15:53:28 -0800 | [diff] [blame] | 1407 | /* T18 Object */ |
| 1408 | 0, 0, |
| 1409 | /* T24 Object */ |
| 1410 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1411 | 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1412 | /* T25 Object */ |
Jing Lin | 943fcec | 2012-05-25 13:58:57 -0700 | [diff] [blame] | 1413 | 1, 0, 60, 115, 156, 99, |
Jing Lin | 21ed4de | 2012-02-05 15:53:28 -0800 | [diff] [blame] | 1414 | /* T27 Object */ |
| 1415 | 0, 0, 0, 0, 0, 0, 0, |
| 1416 | /* T40 Object */ |
| 1417 | 0, 0, 0, 0, 0, |
| 1418 | /* T42 Object */ |
Jing Lin | 943fcec | 2012-05-25 13:58:57 -0700 | [diff] [blame] | 1419 | 0, 0, 255, 0, 255, 0, 0, 0, 0, 0, |
Jing Lin | 21ed4de | 2012-02-05 15:53:28 -0800 | [diff] [blame] | 1420 | /* T43 Object */ |
| 1421 | 0, 0, 0, 0, 0, 0, 0, 64, 0, 8, |
| 1422 | 16, |
| 1423 | /* T46 Object */ |
Jing Lin | f1208fd | 2012-02-23 11:15:42 -0800 | [diff] [blame] | 1424 | 68, 0, 16, 16, 0, 0, 0, 0, 0, |
Jing Lin | 21ed4de | 2012-02-05 15:53:28 -0800 | [diff] [blame] | 1425 | /* T47 Object */ |
| 1426 | 0, 0, 0, 0, 0, 0, 3, 64, 66, 0, |
| 1427 | /* T48 Object */ |
Jing Lin | 943fcec | 2012-05-25 13:58:57 -0700 | [diff] [blame] | 1428 | 1, 64, 64, 0, 0, 0, 0, 0, 0, 0, |
Jing Lin | f1208fd | 2012-02-23 11:15:42 -0800 | [diff] [blame] | 1429 | 32, 40, 0, 10, 10, 0, 0, 100, 10, 90, |
| 1430 | 0, 0, 0, 0, 0, 0, 0, 10, 1, 10, |
| 1431 | 52, 10, 12, 0, 33, 0, 1, 0, 0, 0, |
Jing Lin | 21ed4de | 2012-02-05 15:53:28 -0800 | [diff] [blame] | 1432 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1433 | 0, 0, 0, 0, |
| 1434 | /* T56 Object */ |
| 1435 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1436 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1437 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1438 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
Jing Lin | f1208fd | 2012-02-23 11:15:42 -0800 | [diff] [blame] | 1439 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1440 | 0, |
Jing Lin | 21ed4de | 2012-02-05 15:53:28 -0800 | [diff] [blame] | 1441 | }; |
| 1442 | |
| 1443 | #define MXT_TS_GPIO_IRQ 6 |
| 1444 | #define MXT_TS_PWR_EN_GPIO PM8921_GPIO_PM_TO_SYS(23) |
| 1445 | #define MXT_TS_RESET_GPIO 33 |
| 1446 | |
| 1447 | static struct mxt_config_info mxt_config_array[] = { |
| 1448 | { |
| 1449 | .config = mxt1386e_config_data_v2_1, |
| 1450 | .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1), |
| 1451 | .family_id = 0xA0, |
| 1452 | .variant_id = 0x7, |
| 1453 | .version = 0x21, |
| 1454 | .build = 0xAA, |
Jing Lin | ef4aa9b | 2012-03-26 12:01:41 -0700 | [diff] [blame] | 1455 | .bootldr_id = MXT_BOOTLOADER_ID_1386E, |
| 1456 | .fw_name = "atmel_8064_liquid_v2_2_AA.hex", |
| 1457 | }, |
| 1458 | { |
| 1459 | /* The config data for V2.2.AA is the same as for V2.1.AA */ |
| 1460 | .config = mxt1386e_config_data_v2_1, |
| 1461 | .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1), |
| 1462 | .family_id = 0xA0, |
| 1463 | .variant_id = 0x7, |
| 1464 | .version = 0x22, |
| 1465 | .build = 0xAA, |
| 1466 | .bootldr_id = MXT_BOOTLOADER_ID_1386E, |
Jing Lin | 21ed4de | 2012-02-05 15:53:28 -0800 | [diff] [blame] | 1467 | }, |
| 1468 | }; |
| 1469 | |
| 1470 | static struct mxt_platform_data mxt_platform_data = { |
| 1471 | .config_array = mxt_config_array, |
| 1472 | .config_array_size = ARRAY_SIZE(mxt_config_array), |
Mohan Pallaka | 56a1a5d | 2012-02-23 12:05:13 -0800 | [diff] [blame] | 1473 | .panel_minx = 0, |
| 1474 | .panel_maxx = 1365, |
| 1475 | .panel_miny = 0, |
| 1476 | .panel_maxy = 767, |
| 1477 | .disp_minx = 0, |
| 1478 | .disp_maxx = 1365, |
| 1479 | .disp_miny = 0, |
| 1480 | .disp_maxy = 767, |
Anirudh Ghayal | 39dbe3f | 2012-04-13 15:43:16 +0530 | [diff] [blame] | 1481 | .irqflags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT, |
Jing Lin | 21ed4de | 2012-02-05 15:53:28 -0800 | [diff] [blame] | 1482 | .i2c_pull_up = true, |
| 1483 | .reset_gpio = MXT_TS_RESET_GPIO, |
| 1484 | .irq_gpio = MXT_TS_GPIO_IRQ, |
| 1485 | }; |
| 1486 | |
| 1487 | static struct i2c_board_info mxt_device_info[] __initdata = { |
| 1488 | { |
| 1489 | I2C_BOARD_INFO("atmel_mxt_ts", 0x5b), |
| 1490 | .platform_data = &mxt_platform_data, |
| 1491 | .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ), |
| 1492 | }, |
| 1493 | }; |
Anirudh Ghayal | 2917a5a | 2012-02-05 19:51:07 -0800 | [diff] [blame] | 1494 | #define CYTTSP_TS_GPIO_IRQ 6 |
Anirudh Ghayal | 2917a5a | 2012-02-05 19:51:07 -0800 | [diff] [blame] | 1495 | #define CYTTSP_TS_GPIO_SLEEP 33 |
Amy Maloche | 609bb5e | 2012-08-03 09:41:42 -0700 | [diff] [blame] | 1496 | #define CYTTSP_TS_GPIO_SLEEP_ALT 12 |
Anirudh Ghayal | 2917a5a | 2012-02-05 19:51:07 -0800 | [diff] [blame] | 1497 | |
| 1498 | static ssize_t tma340_vkeys_show(struct kobject *kobj, |
| 1499 | struct kobj_attribute *attr, char *buf) |
| 1500 | { |
| 1501 | return snprintf(buf, 200, |
| 1502 | __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97" |
| 1503 | ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97" |
| 1504 | ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97" |
| 1505 | ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97" |
| 1506 | "\n"); |
| 1507 | } |
| 1508 | |
| 1509 | static struct kobj_attribute tma340_vkeys_attr = { |
| 1510 | .attr = { |
| 1511 | .mode = S_IRUGO, |
| 1512 | }, |
| 1513 | .show = &tma340_vkeys_show, |
| 1514 | }; |
| 1515 | |
| 1516 | static struct attribute *tma340_properties_attrs[] = { |
| 1517 | &tma340_vkeys_attr.attr, |
| 1518 | NULL |
| 1519 | }; |
| 1520 | |
| 1521 | static struct attribute_group tma340_properties_attr_group = { |
| 1522 | .attrs = tma340_properties_attrs, |
| 1523 | }; |
| 1524 | |
| 1525 | static int cyttsp_platform_init(struct i2c_client *client) |
| 1526 | { |
| 1527 | int rc = 0; |
| 1528 | static struct kobject *tma340_properties_kobj; |
| 1529 | |
| 1530 | tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c"; |
| 1531 | tma340_properties_kobj = kobject_create_and_add("board_properties", |
| 1532 | NULL); |
| 1533 | if (tma340_properties_kobj) |
| 1534 | rc = sysfs_create_group(tma340_properties_kobj, |
| 1535 | &tma340_properties_attr_group); |
| 1536 | if (!tma340_properties_kobj || rc) |
| 1537 | pr_err("%s: failed to create board_properties\n", |
| 1538 | __func__); |
| 1539 | |
| 1540 | return 0; |
| 1541 | } |
| 1542 | |
| 1543 | static struct cyttsp_regulator cyttsp_regulator_data[] = { |
| 1544 | { |
| 1545 | .name = "vdd", |
| 1546 | .min_uV = CY_TMA300_VTG_MIN_UV, |
| 1547 | .max_uV = CY_TMA300_VTG_MAX_UV, |
| 1548 | .hpm_load_uA = CY_TMA300_CURR_24HZ_UA, |
| 1549 | .lpm_load_uA = CY_TMA300_CURR_24HZ_UA, |
| 1550 | }, |
| 1551 | { |
| 1552 | .name = "vcc_i2c", |
| 1553 | .min_uV = CY_I2C_VTG_MIN_UV, |
| 1554 | .max_uV = CY_I2C_VTG_MAX_UV, |
| 1555 | .hpm_load_uA = CY_I2C_CURR_UA, |
| 1556 | .lpm_load_uA = CY_I2C_CURR_UA, |
| 1557 | }, |
| 1558 | }; |
| 1559 | |
| 1560 | static struct cyttsp_platform_data cyttsp_pdata = { |
| 1561 | .panel_maxx = 634, |
| 1562 | .panel_maxy = 1166, |
| 1563 | .disp_maxx = 599, |
| 1564 | .disp_maxy = 1023, |
| 1565 | .disp_minx = 0, |
| 1566 | .disp_miny = 0, |
| 1567 | .flags = 0x01, |
| 1568 | .gen = CY_GEN3, |
| 1569 | .use_st = CY_USE_ST, |
| 1570 | .use_mt = CY_USE_MT, |
| 1571 | .use_hndshk = CY_SEND_HNDSHK, |
| 1572 | .use_trk_id = CY_USE_TRACKING_ID, |
| 1573 | .use_sleep = CY_USE_DEEP_SLEEP_SEL, |
| 1574 | .use_gestures = CY_USE_GESTURES, |
| 1575 | .fw_fname = "cyttsp_8064_mtp.hex", |
| 1576 | /* change act_intrvl to customize the Active power state |
| 1577 | * scanning/processing refresh interval for Operating mode |
| 1578 | */ |
| 1579 | .act_intrvl = CY_ACT_INTRVL_DFLT, |
| 1580 | /* change tch_tmout to customize the touch timeout for the |
| 1581 | * Active power state for Operating mode |
| 1582 | */ |
| 1583 | .tch_tmout = CY_TCH_TMOUT_DFLT, |
| 1584 | /* change lp_intrvl to customize the Low Power power state |
| 1585 | * scanning/processing refresh interval for Operating mode |
| 1586 | */ |
| 1587 | .lp_intrvl = CY_LP_INTRVL_DFLT, |
| 1588 | .sleep_gpio = CYTTSP_TS_GPIO_SLEEP, |
Amy Maloche | 9ba3ffe | 2012-04-26 10:31:20 -0700 | [diff] [blame] | 1589 | .resout_gpio = -1, |
Anirudh Ghayal | 2917a5a | 2012-02-05 19:51:07 -0800 | [diff] [blame] | 1590 | .irq_gpio = CYTTSP_TS_GPIO_IRQ, |
| 1591 | .regulator_info = cyttsp_regulator_data, |
| 1592 | .num_regulators = ARRAY_SIZE(cyttsp_regulator_data), |
| 1593 | .init = cyttsp_platform_init, |
| 1594 | .correct_fw_ver = 17, |
| 1595 | }; |
| 1596 | |
| 1597 | static struct i2c_board_info cyttsp_info[] __initdata = { |
| 1598 | { |
| 1599 | I2C_BOARD_INFO(CY_I2C_NAME, 0x24), |
| 1600 | .platform_data = &cyttsp_pdata, |
| 1601 | .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ), |
| 1602 | }, |
| 1603 | }; |
Jing Lin | 21ed4de | 2012-02-05 15:53:28 -0800 | [diff] [blame] | 1604 | |
Ankit Verma | 6b7e2ba | 2012-01-26 15:48:54 -0800 | [diff] [blame] | 1605 | #define MSM_WCNSS_PHYS 0x03000000 |
| 1606 | #define MSM_WCNSS_SIZE 0x280000 |
| 1607 | |
| 1608 | static struct resource resources_wcnss_wlan[] = { |
| 1609 | { |
| 1610 | .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ, |
| 1611 | .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ, |
| 1612 | .name = "wcnss_wlanrx_irq", |
| 1613 | .flags = IORESOURCE_IRQ, |
| 1614 | }, |
| 1615 | { |
| 1616 | .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ, |
| 1617 | .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ, |
| 1618 | .name = "wcnss_wlantx_irq", |
| 1619 | .flags = IORESOURCE_IRQ, |
| 1620 | }, |
| 1621 | { |
| 1622 | .start = MSM_WCNSS_PHYS, |
| 1623 | .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1, |
| 1624 | .name = "wcnss_mmio", |
| 1625 | .flags = IORESOURCE_MEM, |
| 1626 | }, |
| 1627 | { |
| 1628 | .start = 64, |
| 1629 | .end = 68, |
| 1630 | .name = "wcnss_gpios_5wire", |
| 1631 | .flags = IORESOURCE_IO, |
| 1632 | }, |
| 1633 | }; |
| 1634 | |
| 1635 | static struct qcom_wcnss_opts qcom_wcnss_pdata = { |
| 1636 | .has_48mhz_xo = 1, |
| 1637 | }; |
| 1638 | |
| 1639 | static struct platform_device msm_device_wcnss_wlan = { |
| 1640 | .name = "wcnss_wlan", |
| 1641 | .id = 0, |
| 1642 | .num_resources = ARRAY_SIZE(resources_wcnss_wlan), |
| 1643 | .resource = resources_wcnss_wlan, |
| 1644 | .dev = {.platform_data = &qcom_wcnss_pdata}, |
| 1645 | }; |
| 1646 | |
Ankit Verma | b7c26e6 | 2012-02-28 15:04:15 -0800 | [diff] [blame] | 1647 | static struct platform_device msm_device_iris_fm __devinitdata = { |
| 1648 | .name = "iris_fm", |
| 1649 | .id = -1, |
| 1650 | }; |
| 1651 | |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 1652 | #ifdef CONFIG_QSEECOM |
| 1653 | /* qseecom bus scaling */ |
| 1654 | static struct msm_bus_vectors qseecom_clks_init_vectors[] = { |
| 1655 | { |
Ramesh Masavarapu | 1e8c724 | 2012-09-04 11:52:57 -0700 | [diff] [blame] | 1656 | .src = MSM_BUS_MASTER_ADM_PORT0, |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 1657 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 1658 | .ab = 0, |
Ramesh Masavarapu | 1e8c724 | 2012-09-04 11:52:57 -0700 | [diff] [blame] | 1659 | .ib = 0, |
| 1660 | }, |
| 1661 | { |
| 1662 | .src = MSM_BUS_MASTER_ADM_PORT1, |
| 1663 | .dst = MSM_BUS_SLAVE_GSBI1_UART, |
| 1664 | .ab = 0, |
| 1665 | .ib = 0, |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 1666 | }, |
| 1667 | { |
| 1668 | .src = MSM_BUS_MASTER_SPDM, |
| 1669 | .dst = MSM_BUS_SLAVE_SPDM, |
| 1670 | .ib = 0, |
| 1671 | .ab = 0, |
| 1672 | }, |
| 1673 | }; |
| 1674 | |
| 1675 | static struct msm_bus_vectors qseecom_enable_dfab_vectors[] = { |
| 1676 | { |
Ramesh Masavarapu | 1e8c724 | 2012-09-04 11:52:57 -0700 | [diff] [blame] | 1677 | .src = MSM_BUS_MASTER_ADM_PORT0, |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 1678 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
Ramesh Masavarapu | 1e8c724 | 2012-09-04 11:52:57 -0700 | [diff] [blame] | 1679 | .ab = 70000000UL, |
| 1680 | .ib = 70000000UL, |
| 1681 | }, |
| 1682 | { |
| 1683 | .src = MSM_BUS_MASTER_ADM_PORT1, |
| 1684 | .dst = MSM_BUS_SLAVE_GSBI1_UART, |
| 1685 | .ab = 2480000000UL, |
| 1686 | .ib = 2480000000UL, |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 1687 | }, |
| 1688 | { |
| 1689 | .src = MSM_BUS_MASTER_SPDM, |
| 1690 | .dst = MSM_BUS_SLAVE_SPDM, |
| 1691 | .ib = 0, |
| 1692 | .ab = 0, |
| 1693 | }, |
| 1694 | }; |
| 1695 | |
| 1696 | static struct msm_bus_vectors qseecom_enable_sfpb_vectors[] = { |
| 1697 | { |
Ramesh Masavarapu | 1e8c724 | 2012-09-04 11:52:57 -0700 | [diff] [blame] | 1698 | .src = MSM_BUS_MASTER_ADM_PORT0, |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 1699 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 1700 | .ab = 0, |
Ramesh Masavarapu | 1e8c724 | 2012-09-04 11:52:57 -0700 | [diff] [blame] | 1701 | .ib = 0, |
| 1702 | }, |
| 1703 | { |
| 1704 | .src = MSM_BUS_MASTER_ADM_PORT1, |
| 1705 | .dst = MSM_BUS_SLAVE_GSBI1_UART, |
| 1706 | .ab = 0, |
| 1707 | .ib = 0, |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 1708 | }, |
| 1709 | { |
| 1710 | .src = MSM_BUS_MASTER_SPDM, |
| 1711 | .dst = MSM_BUS_SLAVE_SPDM, |
| 1712 | .ib = (64 * 8) * 1000000UL, |
| 1713 | .ab = (64 * 8) * 100000UL, |
| 1714 | }, |
| 1715 | }; |
| 1716 | |
Ramesh Masavarapu | 8d75658 | 2012-10-03 10:18:06 -0700 | [diff] [blame] | 1717 | static struct msm_bus_vectors qseecom_enable_dfab_sfpb_vectors[] = { |
| 1718 | { |
| 1719 | .src = MSM_BUS_MASTER_ADM_PORT0, |
| 1720 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 1721 | .ab = 70000000UL, |
| 1722 | .ib = 70000000UL, |
| 1723 | }, |
| 1724 | { |
| 1725 | .src = MSM_BUS_MASTER_ADM_PORT1, |
| 1726 | .dst = MSM_BUS_SLAVE_GSBI1_UART, |
| 1727 | .ab = 2480000000UL, |
| 1728 | .ib = 2480000000UL, |
| 1729 | }, |
| 1730 | { |
| 1731 | .src = MSM_BUS_MASTER_SPDM, |
| 1732 | .dst = MSM_BUS_SLAVE_SPDM, |
| 1733 | .ib = (64 * 8) * 1000000UL, |
| 1734 | .ab = (64 * 8) * 100000UL, |
| 1735 | }, |
| 1736 | }; |
| 1737 | |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 1738 | static struct msm_bus_paths qseecom_hw_bus_scale_usecases[] = { |
| 1739 | { |
| 1740 | ARRAY_SIZE(qseecom_clks_init_vectors), |
| 1741 | qseecom_clks_init_vectors, |
| 1742 | }, |
| 1743 | { |
| 1744 | ARRAY_SIZE(qseecom_enable_dfab_vectors), |
Ramesh Masavarapu | 1e8c724 | 2012-09-04 11:52:57 -0700 | [diff] [blame] | 1745 | qseecom_enable_dfab_vectors, |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 1746 | }, |
| 1747 | { |
| 1748 | ARRAY_SIZE(qseecom_enable_sfpb_vectors), |
| 1749 | qseecom_enable_sfpb_vectors, |
| 1750 | }, |
Ramesh Masavarapu | 8d75658 | 2012-10-03 10:18:06 -0700 | [diff] [blame] | 1751 | { |
| 1752 | ARRAY_SIZE(qseecom_enable_dfab_sfpb_vectors), |
| 1753 | qseecom_enable_dfab_sfpb_vectors, |
| 1754 | }, |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 1755 | }; |
| 1756 | |
| 1757 | static struct msm_bus_scale_pdata qseecom_bus_pdata = { |
| 1758 | qseecom_hw_bus_scale_usecases, |
| 1759 | ARRAY_SIZE(qseecom_hw_bus_scale_usecases), |
| 1760 | .name = "qsee", |
| 1761 | }; |
| 1762 | |
| 1763 | static struct platform_device qseecom_device = { |
| 1764 | .name = "qseecom", |
| 1765 | .id = 0, |
| 1766 | .dev = { |
| 1767 | .platform_data = &qseecom_bus_pdata, |
| 1768 | }, |
| 1769 | }; |
| 1770 | #endif |
| 1771 | |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 1772 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 1773 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \ |
| 1774 | defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 1775 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 1776 | |
| 1777 | #define QCE_SIZE 0x10000 |
| 1778 | #define QCE_0_BASE 0x11000000 |
| 1779 | |
| 1780 | #define QCE_HW_KEY_SUPPORT 0 |
| 1781 | #define QCE_SHA_HMAC_SUPPORT 1 |
| 1782 | #define QCE_SHARE_CE_RESOURCE 3 |
| 1783 | #define QCE_CE_SHARED 0 |
| 1784 | |
| 1785 | static struct resource qcrypto_resources[] = { |
| 1786 | [0] = { |
| 1787 | .start = QCE_0_BASE, |
| 1788 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 1789 | .flags = IORESOURCE_MEM, |
| 1790 | }, |
| 1791 | [1] = { |
| 1792 | .name = "crypto_channels", |
| 1793 | .start = DMOV8064_CE_IN_CHAN, |
| 1794 | .end = DMOV8064_CE_OUT_CHAN, |
| 1795 | .flags = IORESOURCE_DMA, |
| 1796 | }, |
| 1797 | [2] = { |
| 1798 | .name = "crypto_crci_in", |
| 1799 | .start = DMOV8064_CE_IN_CRCI, |
| 1800 | .end = DMOV8064_CE_IN_CRCI, |
| 1801 | .flags = IORESOURCE_DMA, |
| 1802 | }, |
| 1803 | [3] = { |
| 1804 | .name = "crypto_crci_out", |
| 1805 | .start = DMOV8064_CE_OUT_CRCI, |
| 1806 | .end = DMOV8064_CE_OUT_CRCI, |
| 1807 | .flags = IORESOURCE_DMA, |
| 1808 | }, |
| 1809 | }; |
| 1810 | |
| 1811 | static struct resource qcedev_resources[] = { |
| 1812 | [0] = { |
| 1813 | .start = QCE_0_BASE, |
| 1814 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 1815 | .flags = IORESOURCE_MEM, |
| 1816 | }, |
| 1817 | [1] = { |
| 1818 | .name = "crypto_channels", |
| 1819 | .start = DMOV8064_CE_IN_CHAN, |
| 1820 | .end = DMOV8064_CE_OUT_CHAN, |
| 1821 | .flags = IORESOURCE_DMA, |
| 1822 | }, |
| 1823 | [2] = { |
| 1824 | .name = "crypto_crci_in", |
| 1825 | .start = DMOV8064_CE_IN_CRCI, |
| 1826 | .end = DMOV8064_CE_IN_CRCI, |
| 1827 | .flags = IORESOURCE_DMA, |
| 1828 | }, |
| 1829 | [3] = { |
| 1830 | .name = "crypto_crci_out", |
| 1831 | .start = DMOV8064_CE_OUT_CRCI, |
| 1832 | .end = DMOV8064_CE_OUT_CRCI, |
| 1833 | .flags = IORESOURCE_DMA, |
| 1834 | }, |
| 1835 | }; |
| 1836 | |
| 1837 | #endif |
| 1838 | |
| 1839 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 1840 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 1841 | |
| 1842 | static struct msm_ce_hw_support qcrypto_ce_hw_suppport = { |
| 1843 | .ce_shared = QCE_CE_SHARED, |
| 1844 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 1845 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 1846 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
Ramesh Masavarapu | 4925968 | 2011-12-02 14:00:18 -0800 | [diff] [blame] | 1847 | .bus_scale_table = NULL, |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 1848 | }; |
| 1849 | |
| 1850 | static struct platform_device qcrypto_device = { |
| 1851 | .name = "qcrypto", |
| 1852 | .id = 0, |
| 1853 | .num_resources = ARRAY_SIZE(qcrypto_resources), |
| 1854 | .resource = qcrypto_resources, |
| 1855 | .dev = { |
| 1856 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 1857 | .platform_data = &qcrypto_ce_hw_suppport, |
| 1858 | }, |
| 1859 | }; |
| 1860 | #endif |
| 1861 | |
| 1862 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 1863 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 1864 | |
| 1865 | static struct msm_ce_hw_support qcedev_ce_hw_suppport = { |
| 1866 | .ce_shared = QCE_CE_SHARED, |
| 1867 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 1868 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 1869 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
Ramesh Masavarapu | 4925968 | 2011-12-02 14:00:18 -0800 | [diff] [blame] | 1870 | .bus_scale_table = NULL, |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 1871 | }; |
| 1872 | |
| 1873 | static struct platform_device qcedev_device = { |
| 1874 | .name = "qce", |
| 1875 | .id = 0, |
| 1876 | .num_resources = ARRAY_SIZE(qcedev_resources), |
| 1877 | .resource = qcedev_resources, |
| 1878 | .dev = { |
| 1879 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 1880 | .platform_data = &qcedev_ce_hw_suppport, |
| 1881 | }, |
| 1882 | }; |
| 1883 | #endif |
| 1884 | |
Joel King | ef39084 | 2012-05-23 16:42:48 -0700 | [diff] [blame] | 1885 | static struct mdm_vddmin_resource mdm_vddmin_rscs = { |
| 1886 | .rpm_id = MSM_RPM_ID_VDDMIN_GPIO, |
| 1887 | .ap2mdm_vddmin_gpio = 30, |
| 1888 | .modes = 0x03, |
| 1889 | .drive_strength = 8, |
| 1890 | .mdm2ap_vddmin_gpio = 80, |
| 1891 | }; |
| 1892 | |
Joel King | 269aa60 | 2012-07-23 08:07:35 -0700 | [diff] [blame] | 1893 | static struct gpiomux_setting mdm2ap_status_gpio_run_cfg = { |
| 1894 | .func = GPIOMUX_FUNC_GPIO, |
| 1895 | .drv = GPIOMUX_DRV_8MA, |
| 1896 | .pull = GPIOMUX_PULL_NONE, |
| 1897 | }; |
| 1898 | |
Joel King | dacbc82 | 2012-01-25 13:30:57 -0800 | [diff] [blame] | 1899 | static struct mdm_platform_data mdm_platform_data = { |
| 1900 | .mdm_version = "3.0", |
| 1901 | .ramdump_delay_ms = 2000, |
Joel King | 14fe7fa | 2012-05-27 14:26:11 -0700 | [diff] [blame] | 1902 | .early_power_on = 1, |
| 1903 | .sfr_query = 1, |
Joel King | bf3e4b5 | 2012-09-26 09:10:34 -0700 | [diff] [blame] | 1904 | .send_shdn = 1, |
Joel King | ef39084 | 2012-05-23 16:42:48 -0700 | [diff] [blame] | 1905 | .vddmin_resource = &mdm_vddmin_rscs, |
Hemant Kumar | a945b47 | 2012-01-25 15:08:06 -0800 | [diff] [blame] | 1906 | .peripheral_platform_device = &apq8064_device_hsic_host, |
Ameya Thakur | c9a7a84 | 2012-06-24 22:47:52 -0700 | [diff] [blame] | 1907 | .ramdump_timeout_ms = 120000, |
Joel King | 269aa60 | 2012-07-23 08:07:35 -0700 | [diff] [blame] | 1908 | .mdm2ap_status_gpio_run_cfg = &mdm2ap_status_gpio_run_cfg, |
Joel King | dacbc82 | 2012-01-25 13:30:57 -0800 | [diff] [blame] | 1909 | }; |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 1910 | |
Siddartha Mohanadoss | caeaa92 | 2012-02-07 16:41:38 -0800 | [diff] [blame] | 1911 | static struct tsens_platform_data apq_tsens_pdata = { |
| 1912 | .tsens_factor = 1000, |
| 1913 | .hw_type = APQ_8064, |
| 1914 | .tsens_num_sensor = 11, |
| 1915 | .slope = {1176, 1176, 1154, 1176, 1111, |
| 1916 | 1132, 1132, 1199, 1132, 1199, 1132}, |
| 1917 | }; |
| 1918 | |
Siddartha Mohanadoss | 48cad91 | 2012-04-05 21:29:54 -0700 | [diff] [blame] | 1919 | static struct platform_device msm_tsens_device = { |
| 1920 | .name = "tsens8960-tm", |
| 1921 | .id = -1, |
| 1922 | }; |
| 1923 | |
Praveen Chidambaram | 877d7a4 | 2012-06-05 14:33:20 -0600 | [diff] [blame] | 1924 | static struct msm_thermal_data msm_thermal_pdata = { |
| 1925 | .sensor_id = 7, |
Eugene Seah | 2ee4a5d | 2012-06-25 18:16:41 -0600 | [diff] [blame] | 1926 | .poll_ms = 250, |
| 1927 | .limit_temp_degC = 60, |
| 1928 | .temp_hysteresis_degC = 10, |
| 1929 | .freq_step = 2, |
Praveen Chidambaram | 877d7a4 | 2012-06-05 14:33:20 -0600 | [diff] [blame] | 1930 | }; |
| 1931 | |
Jeff Hugo | 0c0f5e9 | 2011-09-28 13:55:45 -0600 | [diff] [blame] | 1932 | #define MSM_SHARED_RAM_PHYS 0x80000000 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1933 | static void __init apq8064_map_io(void) |
| 1934 | { |
Jeff Hugo | 0c0f5e9 | 2011-09-28 13:55:45 -0600 | [diff] [blame] | 1935 | msm_shared_ram_phys = MSM_SHARED_RAM_PHYS; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1936 | msm_map_apq8064_io(); |
Jeff Ohlstein | 3a77f9f | 2011-09-06 14:50:20 -0700 | [diff] [blame] | 1937 | if (socinfo_init() < 0) |
| 1938 | pr_err("socinfo_init() failed!\n"); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1939 | } |
| 1940 | |
| 1941 | static void __init apq8064_init_irq(void) |
| 1942 | { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1943 | struct msm_mpm_device_data *data = NULL; |
| 1944 | |
| 1945 | #ifdef CONFIG_MSM_MPM |
| 1946 | data = &apq8064_mpm_dev_data; |
| 1947 | #endif |
| 1948 | |
| 1949 | msm_mpm_irq_extn_init(data); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1950 | gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, |
| 1951 | (void *)MSM_QGIC_CPU_BASE); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1952 | } |
| 1953 | |
Abhishek Kharbanda | 72dc72e | 2012-06-07 13:41:37 -0700 | [diff] [blame] | 1954 | static struct msm_mhl_platform_data mhl_platform_data = { |
| 1955 | .irq = MSM_GPIO_TO_INT(MHL_GPIO_INT), |
| 1956 | .gpio_mhl_int = MHL_GPIO_INT, |
| 1957 | .gpio_mhl_reset = MHL_GPIO_RESET, |
| 1958 | .gpio_mhl_power = 0, |
| 1959 | .gpio_hdmi_mhl_mux = 0, |
| 1960 | }; |
| 1961 | |
| 1962 | static struct i2c_board_info sii_device_info[] __initdata = { |
| 1963 | { |
| 1964 | /* |
| 1965 | * keeps SI 8334 as the default |
| 1966 | * MHL TX |
| 1967 | */ |
| 1968 | I2C_BOARD_INFO("sii8334", 0x39), |
| 1969 | .platform_data = &mhl_platform_data, |
| 1970 | .flags = I2C_CLIENT_WAKE, |
| 1971 | }, |
| 1972 | }; |
| 1973 | |
Jay Chokshi | 7805b5a | 2011-11-07 15:55:30 -0800 | [diff] [blame] | 1974 | static struct platform_device msm8064_device_saw_regulator_core0 = { |
| 1975 | .name = "saw-regulator", |
| 1976 | .id = 0, |
| 1977 | .dev = { |
| 1978 | .platform_data = &msm8064_saw_regulator_pdata_8921_s5, |
| 1979 | }, |
| 1980 | }; |
| 1981 | |
| 1982 | static struct platform_device msm8064_device_saw_regulator_core1 = { |
| 1983 | .name = "saw-regulator", |
| 1984 | .id = 1, |
| 1985 | .dev = { |
| 1986 | .platform_data = &msm8064_saw_regulator_pdata_8921_s6, |
| 1987 | }, |
| 1988 | }; |
| 1989 | |
| 1990 | static struct platform_device msm8064_device_saw_regulator_core2 = { |
| 1991 | .name = "saw-regulator", |
| 1992 | .id = 2, |
| 1993 | .dev = { |
| 1994 | .platform_data = &msm8064_saw_regulator_pdata_8821_s0, |
| 1995 | }, |
| 1996 | }; |
| 1997 | |
| 1998 | static struct platform_device msm8064_device_saw_regulator_core3 = { |
| 1999 | .name = "saw-regulator", |
| 2000 | .id = 3, |
| 2001 | .dev = { |
| 2002 | .platform_data = &msm8064_saw_regulator_pdata_8821_s1, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2003 | |
| 2004 | }, |
| 2005 | }; |
| 2006 | |
Oluwafemi Adeyemi | f5a3142 | 2012-03-08 16:58:45 -0800 | [diff] [blame] | 2007 | static struct msm_rpmrs_level msm_rpmrs_levels[] = { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2008 | { |
| 2009 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT, |
| 2010 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 2011 | true, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2012 | 1, 784, 180000, 100, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2013 | }, |
| 2014 | |
| 2015 | { |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 2016 | MSM_PM_SLEEP_MODE_RETENTION, |
| 2017 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 2018 | true, |
| 2019 | 415, 715, 340827, 475, |
| 2020 | }, |
| 2021 | |
| 2022 | { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2023 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE, |
| 2024 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 2025 | true, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2026 | 1300, 228, 1200000, 2000, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2027 | }, |
| 2028 | |
| 2029 | { |
| 2030 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2031 | MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE), |
| 2032 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2033 | 2000, 138, 1208400, 3200, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2034 | }, |
| 2035 | |
| 2036 | { |
| 2037 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
Praveen Chidambaram | e338067 | 2012-02-08 10:32:27 -0700 | [diff] [blame] | 2038 | MSM_RPMRS_LIMITS(ON, HSFS_OPEN, ACTIVE, RET_HIGH), |
| 2039 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2040 | 6000, 119, 1850300, 9000, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2041 | }, |
| 2042 | |
| 2043 | { |
| 2044 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2045 | MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE), |
| 2046 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2047 | 9200, 68, 2839200, 16400, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2048 | }, |
| 2049 | |
| 2050 | { |
| 2051 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2052 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE), |
| 2053 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2054 | 10300, 63, 3128000, 18200, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2055 | }, |
| 2056 | |
| 2057 | { |
| 2058 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2059 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH), |
| 2060 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2061 | 18000, 10, 4602600, 27000, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2062 | }, |
| 2063 | |
| 2064 | { |
| 2065 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2066 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW), |
| 2067 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2068 | 20000, 2, 5752000, 32000, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2069 | }, |
| 2070 | }; |
| 2071 | |
| 2072 | static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = { |
| 2073 | .mode = MSM_PM_BOOT_CONFIG_TZ, |
| 2074 | }; |
| 2075 | |
| 2076 | static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = { |
| 2077 | .levels = &msm_rpmrs_levels[0], |
| 2078 | .num_levels = ARRAY_SIZE(msm_rpmrs_levels), |
| 2079 | .vdd_mem_levels = { |
| 2080 | [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000, |
| 2081 | [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000, |
| 2082 | [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000, |
| 2083 | [MSM_RPMRS_VDD_MEM_MAX] = 1150000, |
| 2084 | }, |
| 2085 | .vdd_dig_levels = { |
| 2086 | [MSM_RPMRS_VDD_DIG_RET_LOW] = 500000, |
| 2087 | [MSM_RPMRS_VDD_DIG_RET_HIGH] = 750000, |
| 2088 | [MSM_RPMRS_VDD_DIG_ACTIVE] = 950000, |
| 2089 | [MSM_RPMRS_VDD_DIG_MAX] = 1150000, |
| 2090 | }, |
| 2091 | .vdd_mask = 0x7FFFFF, |
| 2092 | .rpmrs_target_id = { |
| 2093 | [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK, |
| 2094 | [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST, |
| 2095 | [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_PM8921_S3_0, |
| 2096 | [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_PM8921_S3_1, |
| 2097 | [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8921_L24_0, |
| 2098 | [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8921_L24_1, |
| 2099 | [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL, |
| 2100 | }, |
| 2101 | }; |
| 2102 | |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2103 | static uint8_t spm_wfi_cmd_sequence[] __initdata = { |
| 2104 | 0x03, 0x0f, |
| 2105 | }; |
| 2106 | |
| 2107 | static uint8_t spm_power_collapse_without_rpm[] __initdata = { |
| 2108 | 0x00, 0x24, 0x54, 0x10, |
| 2109 | 0x09, 0x03, 0x01, |
| 2110 | 0x10, 0x54, 0x30, 0x0C, |
| 2111 | 0x24, 0x30, 0x0f, |
| 2112 | }; |
| 2113 | |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 2114 | static uint8_t spm_retention_cmd_sequence[] __initdata = { |
| 2115 | 0x00, 0x05, 0x03, 0x0D, |
| 2116 | 0x0B, 0x00, 0x0f, |
| 2117 | }; |
| 2118 | |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2119 | static uint8_t spm_power_collapse_with_rpm[] __initdata = { |
| 2120 | 0x00, 0x24, 0x54, 0x10, |
| 2121 | 0x09, 0x07, 0x01, 0x0B, |
| 2122 | 0x10, 0x54, 0x30, 0x0C, |
| 2123 | 0x24, 0x30, 0x0f, |
| 2124 | }; |
| 2125 | |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 2126 | static struct msm_spm_seq_entry msm_spm_boot_cpu_seq_list[] __initdata = { |
| 2127 | [0] = { |
| 2128 | .mode = MSM_SPM_MODE_CLOCK_GATING, |
| 2129 | .notify_rpm = false, |
| 2130 | .cmd = spm_wfi_cmd_sequence, |
| 2131 | }, |
| 2132 | [1] = { |
| 2133 | .mode = MSM_SPM_MODE_POWER_RETENTION, |
| 2134 | .notify_rpm = false, |
| 2135 | .cmd = spm_retention_cmd_sequence, |
| 2136 | }, |
| 2137 | [2] = { |
| 2138 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 2139 | .notify_rpm = false, |
| 2140 | .cmd = spm_power_collapse_without_rpm, |
| 2141 | }, |
| 2142 | [3] = { |
| 2143 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 2144 | .notify_rpm = true, |
| 2145 | .cmd = spm_power_collapse_with_rpm, |
| 2146 | }, |
| 2147 | }; |
| 2148 | static struct msm_spm_seq_entry msm_spm_nonboot_cpu_seq_list[] __initdata = { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2149 | [0] = { |
| 2150 | .mode = MSM_SPM_MODE_CLOCK_GATING, |
| 2151 | .notify_rpm = false, |
| 2152 | .cmd = spm_wfi_cmd_sequence, |
| 2153 | }, |
| 2154 | [1] = { |
| 2155 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 2156 | .notify_rpm = false, |
| 2157 | .cmd = spm_power_collapse_without_rpm, |
| 2158 | }, |
| 2159 | [2] = { |
| 2160 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 2161 | .notify_rpm = true, |
| 2162 | .cmd = spm_power_collapse_with_rpm, |
| 2163 | }, |
| 2164 | }; |
| 2165 | |
| 2166 | static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = { |
| 2167 | 0x00, 0x20, 0x03, 0x20, |
| 2168 | 0x00, 0x0f, |
| 2169 | }; |
| 2170 | |
| 2171 | static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = { |
| 2172 | 0x00, 0x20, 0x34, 0x64, |
| 2173 | 0x48, 0x07, 0x48, 0x20, |
| 2174 | 0x50, 0x64, 0x04, 0x34, |
| 2175 | 0x50, 0x0f, |
| 2176 | }; |
| 2177 | static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = { |
| 2178 | 0x00, 0x10, 0x34, 0x64, |
| 2179 | 0x48, 0x07, 0x48, 0x10, |
| 2180 | 0x50, 0x64, 0x04, 0x34, |
| 2181 | 0x50, 0x0F, |
| 2182 | }; |
| 2183 | |
| 2184 | static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = { |
| 2185 | [0] = { |
| 2186 | .mode = MSM_SPM_L2_MODE_RETENTION, |
| 2187 | .notify_rpm = false, |
| 2188 | .cmd = l2_spm_wfi_cmd_sequence, |
| 2189 | }, |
| 2190 | [1] = { |
| 2191 | .mode = MSM_SPM_L2_MODE_GDHS, |
| 2192 | .notify_rpm = true, |
| 2193 | .cmd = l2_spm_gdhs_cmd_sequence, |
| 2194 | }, |
| 2195 | [2] = { |
| 2196 | .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE, |
| 2197 | .notify_rpm = true, |
| 2198 | .cmd = l2_spm_power_off_cmd_sequence, |
| 2199 | }, |
| 2200 | }; |
| 2201 | |
| 2202 | |
| 2203 | static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = { |
| 2204 | [0] = { |
| 2205 | .reg_base_addr = MSM_SAW_L2_BASE, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2206 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00, |
Praveen Chidambaram | e4b9eb1 | 2012-02-28 19:39:58 -0700 | [diff] [blame] | 2207 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2208 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE, |
| 2209 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020, |
| 2210 | .modes = msm_spm_l2_seq_list, |
| 2211 | .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list), |
| 2212 | }, |
| 2213 | }; |
| 2214 | |
| 2215 | static struct msm_spm_platform_data msm_spm_data[] __initdata = { |
| 2216 | [0] = { |
| 2217 | .reg_base_addr = MSM_SAW0_BASE, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2218 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2219 | #if defined(CONFIG_MSM_AVS_HW) |
| 2220 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00, |
| 2221 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00, |
| 2222 | #endif |
| 2223 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 2224 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x03020004, |
| 2225 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0084009C, |
| 2226 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A4001C, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2227 | .vctl_timeout_us = 50, |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 2228 | .num_modes = ARRAY_SIZE(msm_spm_boot_cpu_seq_list), |
| 2229 | .modes = msm_spm_boot_cpu_seq_list, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2230 | }, |
| 2231 | [1] = { |
| 2232 | .reg_base_addr = MSM_SAW1_BASE, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2233 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2234 | #if defined(CONFIG_MSM_AVS_HW) |
| 2235 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00, |
| 2236 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00, |
| 2237 | #endif |
| 2238 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
Praveen Chidambaram | e4b9eb1 | 2012-02-28 19:39:58 -0700 | [diff] [blame] | 2239 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2240 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C, |
| 2241 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C, |
| 2242 | .vctl_timeout_us = 50, |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 2243 | .num_modes = ARRAY_SIZE(msm_spm_nonboot_cpu_seq_list), |
| 2244 | .modes = msm_spm_nonboot_cpu_seq_list, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2245 | }, |
| 2246 | [2] = { |
| 2247 | .reg_base_addr = MSM_SAW2_BASE, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2248 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2249 | #if defined(CONFIG_MSM_AVS_HW) |
| 2250 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00, |
| 2251 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00, |
| 2252 | #endif |
| 2253 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
Praveen Chidambaram | e4b9eb1 | 2012-02-28 19:39:58 -0700 | [diff] [blame] | 2254 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2255 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C, |
| 2256 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C, |
| 2257 | .vctl_timeout_us = 50, |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 2258 | .num_modes = ARRAY_SIZE(msm_spm_nonboot_cpu_seq_list), |
| 2259 | .modes = msm_spm_nonboot_cpu_seq_list, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2260 | }, |
| 2261 | [3] = { |
| 2262 | .reg_base_addr = MSM_SAW3_BASE, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2263 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2264 | #if defined(CONFIG_MSM_AVS_HW) |
| 2265 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00, |
| 2266 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00, |
| 2267 | #endif |
| 2268 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
Praveen Chidambaram | e4b9eb1 | 2012-02-28 19:39:58 -0700 | [diff] [blame] | 2269 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2270 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C, |
| 2271 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C, |
| 2272 | .vctl_timeout_us = 50, |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 2273 | .num_modes = ARRAY_SIZE(msm_spm_nonboot_cpu_seq_list), |
| 2274 | .modes = msm_spm_nonboot_cpu_seq_list, |
Jay Chokshi | 7805b5a | 2011-11-07 15:55:30 -0800 | [diff] [blame] | 2275 | }, |
| 2276 | }; |
| 2277 | |
Gagan Mac | 8a7a5d3 | 2011-11-11 16:43:06 -0700 | [diff] [blame] | 2278 | static void __init apq8064_init_buses(void) |
| 2279 | { |
| 2280 | msm_bus_rpm_set_mt_mask(); |
| 2281 | msm_bus_8064_apps_fabric_pdata.rpm_enabled = 1; |
| 2282 | msm_bus_8064_sys_fabric_pdata.rpm_enabled = 1; |
| 2283 | msm_bus_8064_mm_fabric_pdata.rpm_enabled = 1; |
| 2284 | msm_bus_8064_apps_fabric.dev.platform_data = |
| 2285 | &msm_bus_8064_apps_fabric_pdata; |
| 2286 | msm_bus_8064_sys_fabric.dev.platform_data = |
| 2287 | &msm_bus_8064_sys_fabric_pdata; |
| 2288 | msm_bus_8064_mm_fabric.dev.platform_data = |
| 2289 | &msm_bus_8064_mm_fabric_pdata; |
| 2290 | msm_bus_8064_sys_fpb.dev.platform_data = &msm_bus_8064_sys_fpb_pdata; |
| 2291 | msm_bus_8064_cpss_fpb.dev.platform_data = &msm_bus_8064_cpss_fpb_pdata; |
| 2292 | } |
| 2293 | |
Niranjana Vishwanathapura | 06f8933 | 2012-05-03 17:11:13 -0600 | [diff] [blame] | 2294 | /* PCIe gpios */ |
| 2295 | static struct msm_pcie_gpio_info_t msm_pcie_gpio_info[MSM_PCIE_MAX_GPIO] = { |
| 2296 | {"rst_n", PM8921_MPP_PM_TO_SYS(PCIE_RST_N_PMIC_MPP), 0}, |
| 2297 | {"pwr_en", PM8921_GPIO_PM_TO_SYS(PCIE_PWR_EN_PMIC_GPIO), 1}, |
| 2298 | }; |
| 2299 | |
| 2300 | static struct msm_pcie_platform msm_pcie_platform_data = { |
| 2301 | .gpio = msm_pcie_gpio_info, |
Niranjana Vishwanathapura | 68210ff | 2012-06-24 18:03:49 -0600 | [diff] [blame] | 2302 | .axi_addr = PCIE_AXI_BAR_PHYS, |
| 2303 | .axi_size = PCIE_AXI_BAR_SIZE, |
Niranjana Vishwanathapura | 459a27d | 2012-07-20 12:23:55 -0600 | [diff] [blame] | 2304 | .wake_n = PM8921_GPIO_IRQ(PM8921_IRQ_BASE, PCIE_WAKE_N_PMIC_GPIO), |
Niranjana Vishwanathapura | 06f8933 | 2012-05-03 17:11:13 -0600 | [diff] [blame] | 2305 | }; |
| 2306 | |
Niranjana Vishwanathapura | c1edd40 | 2012-06-28 15:32:50 -0600 | [diff] [blame] | 2307 | static int __init mpq8064_pcie_enabled(void) |
| 2308 | { |
| 2309 | return !((readl_relaxed(QFPROM_RAW_FEAT_CONFIG_ROW0_MSB) & BIT(21)) || |
| 2310 | (readl_relaxed(QFPROM_RAW_OEM_CONFIG_ROW0_LSB) & BIT(4))); |
| 2311 | } |
| 2312 | |
Niranjana Vishwanathapura | 06f8933 | 2012-05-03 17:11:13 -0600 | [diff] [blame] | 2313 | static void __init mpq8064_pcie_init(void) |
| 2314 | { |
Niranjana Vishwanathapura | c1edd40 | 2012-06-28 15:32:50 -0600 | [diff] [blame] | 2315 | if (mpq8064_pcie_enabled()) { |
| 2316 | msm_device_pcie.dev.platform_data = &msm_pcie_platform_data; |
| 2317 | platform_device_register(&msm_device_pcie); |
| 2318 | } |
Niranjana Vishwanathapura | 06f8933 | 2012-05-03 17:11:13 -0600 | [diff] [blame] | 2319 | } |
| 2320 | |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 2321 | static struct platform_device apq8064_device_ext_5v_vreg __devinitdata = { |
| 2322 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2323 | .id = PM8921_MPP_PM_TO_SYS(7), |
| 2324 | .dev = { |
| 2325 | .platform_data |
| 2326 | = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V], |
| 2327 | }, |
| 2328 | }; |
| 2329 | |
Jay Chokshi | 1de4f9d | 2012-02-07 16:11:31 -0800 | [diff] [blame] | 2330 | static struct platform_device apq8064_device_ext_mpp8_vreg __devinitdata = { |
| 2331 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2332 | .id = PM8921_MPP_PM_TO_SYS(8), |
| 2333 | .dev = { |
| 2334 | .platform_data |
| 2335 | = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_MPP8], |
| 2336 | }, |
| 2337 | }; |
| 2338 | |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 2339 | static struct platform_device apq8064_device_ext_3p3v_vreg __devinitdata = { |
| 2340 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2341 | .id = APQ8064_EXT_3P3V_REG_EN_GPIO, |
| 2342 | .dev = { |
| 2343 | .platform_data = |
| 2344 | &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V], |
| 2345 | }, |
| 2346 | }; |
| 2347 | |
David Collins | 390fc33 | 2012-02-07 14:38:16 -0800 | [diff] [blame] | 2348 | static struct platform_device apq8064_device_ext_ts_sw_vreg __devinitdata = { |
| 2349 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2350 | .id = PM8921_GPIO_PM_TO_SYS(23), |
| 2351 | .dev = { |
| 2352 | .platform_data |
| 2353 | = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_TS_SW], |
| 2354 | }, |
| 2355 | }; |
| 2356 | |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 2357 | static struct platform_device apq8064_device_rpm_regulator __devinitdata = { |
| 2358 | .name = "rpm-regulator", |
David Collins | 793793b | 2012-08-21 15:43:02 -0700 | [diff] [blame] | 2359 | .id = 0, |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 2360 | .dev = { |
| 2361 | .platform_data = &apq8064_rpm_regulator_pdata, |
| 2362 | }, |
| 2363 | }; |
| 2364 | |
David Collins | 793793b | 2012-08-21 15:43:02 -0700 | [diff] [blame] | 2365 | static struct platform_device |
| 2366 | apq8064_pm8921_device_rpm_regulator __devinitdata = { |
| 2367 | .name = "rpm-regulator", |
| 2368 | .id = 1, |
| 2369 | .dev = { |
| 2370 | .platform_data = &apq8064_rpm_regulator_pm8921_pdata, |
| 2371 | }, |
| 2372 | }; |
| 2373 | |
Ravi Kumar V | 05931a2 | 2012-04-04 17:09:37 +0530 | [diff] [blame] | 2374 | static struct gpio_ir_recv_platform_data gpio_ir_recv_pdata = { |
| 2375 | .gpio_nr = 88, |
| 2376 | .active_low = 1, |
Ravi Kumar V | 16a614c | 2012-10-12 20:59:56 +0530 | [diff] [blame] | 2377 | .can_wakeup = true, |
Ravi Kumar V | 05931a2 | 2012-04-04 17:09:37 +0530 | [diff] [blame] | 2378 | }; |
| 2379 | |
| 2380 | static struct platform_device gpio_ir_recv_pdev = { |
| 2381 | .name = "gpio-rc-recv", |
| 2382 | .dev = { |
| 2383 | .platform_data = &gpio_ir_recv_pdata, |
| 2384 | }, |
| 2385 | }; |
| 2386 | |
Terence Hampson | 36b7072 | 2012-05-10 13:18:16 -0400 | [diff] [blame] | 2387 | static struct platform_device *common_not_mpq_devices[] __initdata = { |
David Keitel | 3c40fc5 | 2012-02-09 17:53:52 -0800 | [diff] [blame] | 2388 | &apq8064_device_qup_i2c_gsbi1, |
Jing Lin | 04601f9 | 2012-02-05 15:36:07 -0800 | [diff] [blame] | 2389 | &apq8064_device_qup_i2c_gsbi3, |
Kenneth Heitke | 748593a | 2011-07-15 15:45:11 -0600 | [diff] [blame] | 2390 | &apq8064_device_qup_i2c_gsbi4, |
Terence Hampson | 36b7072 | 2012-05-10 13:18:16 -0400 | [diff] [blame] | 2391 | }; |
| 2392 | |
Kuirong Wang | f8c5e14 | 2012-06-21 16:17:32 -0700 | [diff] [blame] | 2393 | static struct platform_device *common_mpq_devices[] __initdata = { |
| 2394 | &mpq_cpudai_sec_i2s_rx, |
| 2395 | &mpq_cpudai_mi2s_tx, |
Aviral Gupta | bfa9788 | 2012-10-16 12:15:59 +0530 | [diff] [blame] | 2396 | &mpq_cpudai_pseudo, |
Kuirong Wang | f8c5e14 | 2012-06-21 16:17:32 -0700 | [diff] [blame] | 2397 | }; |
| 2398 | |
| 2399 | static struct platform_device *common_i2s_devices[] __initdata = { |
| 2400 | &apq_cpudai_mi2s, |
| 2401 | &apq_cpudai_i2s_rx, |
| 2402 | &apq_cpudai_i2s_tx, |
| 2403 | }; |
| 2404 | |
David Collins | 793793b | 2012-08-21 15:43:02 -0700 | [diff] [blame] | 2405 | static struct platform_device *early_common_devices[] __initdata = { |
Matt Wagantall | f5cc389 | 2012-06-07 19:47:02 -0700 | [diff] [blame] | 2406 | &apq8064_device_acpuclk, |
Terence Hampson | 36b7072 | 2012-05-10 13:18:16 -0400 | [diff] [blame] | 2407 | &apq8064_device_dmov, |
Harini Jayaraman | c4c5869 | 2011-07-19 14:50:10 -0600 | [diff] [blame] | 2408 | &apq8064_device_qup_spi_gsbi5, |
David Collins | 793793b | 2012-08-21 15:43:02 -0700 | [diff] [blame] | 2409 | }; |
| 2410 | |
| 2411 | static struct platform_device *pm8921_common_devices[] __initdata = { |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 2412 | &apq8064_device_ext_5v_vreg, |
Jay Chokshi | 1de4f9d | 2012-02-07 16:11:31 -0800 | [diff] [blame] | 2413 | &apq8064_device_ext_mpp8_vreg, |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 2414 | &apq8064_device_ext_3p3v_vreg, |
Jay Chokshi | 9c25f07 | 2011-09-23 18:19:15 -0700 | [diff] [blame] | 2415 | &apq8064_device_ssbi_pmic1, |
| 2416 | &apq8064_device_ssbi_pmic2, |
David Collins | 793793b | 2012-08-21 15:43:02 -0700 | [diff] [blame] | 2417 | }; |
| 2418 | |
| 2419 | static struct platform_device *pm8917_common_devices[] __initdata = { |
| 2420 | &apq8064_device_ext_mpp8_vreg, |
| 2421 | &apq8064_device_ext_3p3v_vreg, |
| 2422 | &apq8064_device_ssbi_pmic1, |
| 2423 | &apq8064_device_ssbi_pmic2, |
David Collins | 793793b | 2012-08-21 15:43:02 -0700 | [diff] [blame] | 2424 | }; |
| 2425 | |
| 2426 | static struct platform_device *common_devices[] __initdata = { |
Jeff Hugo | 0c0f5e9 | 2011-09-28 13:55:45 -0600 | [diff] [blame] | 2427 | &msm_device_smd_apq8064, |
Hemant Kumar | 4933b07 | 2011-10-17 23:43:11 -0700 | [diff] [blame] | 2428 | &apq8064_device_otg, |
| 2429 | &apq8064_device_gadget_peripheral, |
Hemant Kumar | d86c488 | 2012-01-24 19:39:37 -0800 | [diff] [blame] | 2430 | &apq8064_device_hsusb_host, |
Hemant Kumar | 4933b07 | 2011-10-17 23:43:11 -0700 | [diff] [blame] | 2431 | &android_usb_device, |
Ankit Verma | 6b7e2ba | 2012-01-26 15:48:54 -0800 | [diff] [blame] | 2432 | &msm_device_wcnss_wlan, |
Ankit Verma | b7c26e6 | 2012-02-28 15:04:15 -0800 | [diff] [blame] | 2433 | &msm_device_iris_fm, |
Larry Bassel | 67b921d | 2012-04-06 10:23:27 -0700 | [diff] [blame] | 2434 | &apq8064_fmem_device, |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 2435 | #ifdef CONFIG_ANDROID_PMEM |
| 2436 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 2437 | &apq8064_android_pmem_device, |
| 2438 | &apq8064_android_pmem_adsp_device, |
| 2439 | &apq8064_android_pmem_audio_device, |
Bharath Ramachandramurthy | 4a3fa91 | 2012-03-13 19:16:24 -0700 | [diff] [blame] | 2440 | #endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/ |
| 2441 | #endif /*CONFIG_ANDROID_PMEM*/ |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 2442 | #ifdef CONFIG_ION_MSM |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 2443 | &apq8064_ion_dev, |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 2444 | #endif |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 2445 | &msm8064_device_watchdog, |
Jay Chokshi | 7805b5a | 2011-11-07 15:55:30 -0800 | [diff] [blame] | 2446 | &msm8064_device_saw_regulator_core0, |
| 2447 | &msm8064_device_saw_regulator_core1, |
| 2448 | &msm8064_device_saw_regulator_core2, |
| 2449 | &msm8064_device_saw_regulator_core3, |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 2450 | #if defined(CONFIG_QSEECOM) |
| 2451 | &qseecom_device, |
| 2452 | #endif |
| 2453 | |
Joel Nider | 6b9a7bc | 2012-06-26 11:19:19 +0300 | [diff] [blame] | 2454 | &msm_8064_device_tsif[0], |
| 2455 | &msm_8064_device_tsif[1], |
| 2456 | |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 2457 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 2458 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 2459 | &qcrypto_device, |
| 2460 | #endif |
| 2461 | |
| 2462 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 2463 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 2464 | &qcedev_device, |
| 2465 | #endif |
Ramesh Masavarapu | f46be1b | 2011-11-03 11:13:41 -0700 | [diff] [blame] | 2466 | |
| 2467 | #ifdef CONFIG_HW_RANDOM_MSM |
| 2468 | &apq8064_device_rng, |
| 2469 | #endif |
Bharath Ramachandramurthy | b8e797f | 2011-11-30 12:08:42 -0800 | [diff] [blame] | 2470 | &apq_pcm, |
| 2471 | &apq_pcm_routing, |
| 2472 | &apq_cpudai0, |
| 2473 | &apq_cpudai1, |
| 2474 | &apq_cpudai_hdmi_rx, |
| 2475 | &apq_cpudai_bt_rx, |
| 2476 | &apq_cpudai_bt_tx, |
| 2477 | &apq_cpudai_fm_rx, |
| 2478 | &apq_cpudai_fm_tx, |
| 2479 | &apq_cpu_fe, |
| 2480 | &apq_stub_codec, |
| 2481 | &apq_voice, |
| 2482 | &apq_voip, |
| 2483 | &apq_lpa_pcm, |
Krishnankutty Kolathappilly | 4374e33 | 2012-03-18 22:27:30 -0700 | [diff] [blame] | 2484 | &apq_compr_dsp, |
| 2485 | &apq_multi_ch_pcm, |
Jayasena Sangaraboina | 99bf09c | 2012-07-17 12:03:08 -0700 | [diff] [blame] | 2486 | &apq_lowlatency_pcm, |
Bharath Ramachandramurthy | b8e797f | 2011-11-30 12:08:42 -0800 | [diff] [blame] | 2487 | &apq_pcm_hostless, |
| 2488 | &apq_cpudai_afe_01_rx, |
| 2489 | &apq_cpudai_afe_01_tx, |
| 2490 | &apq_cpudai_afe_02_rx, |
| 2491 | &apq_cpudai_afe_02_tx, |
| 2492 | &apq_pcm_afe, |
| 2493 | &apq_cpudai_auxpcm_rx, |
| 2494 | &apq_cpudai_auxpcm_tx, |
Neema Shetty | 8427c26 | 2012-02-16 11:23:43 -0800 | [diff] [blame] | 2495 | &apq_cpudai_stub, |
Neema Shetty | 3c9d286 | 2012-03-11 01:25:32 -0800 | [diff] [blame] | 2496 | &apq_cpudai_slimbus_1_rx, |
| 2497 | &apq_cpudai_slimbus_1_tx, |
Kiran Kandi | 97fe19d | 2012-05-20 22:34:04 -0700 | [diff] [blame] | 2498 | &apq_cpudai_slimbus_2_rx, |
Kiran Kandi | 1e6371d | 2012-03-29 11:48:57 -0700 | [diff] [blame] | 2499 | &apq_cpudai_slimbus_2_tx, |
Neema Shetty | c9d86c3 | 2012-05-09 12:01:39 -0700 | [diff] [blame] | 2500 | &apq_cpudai_slimbus_3_rx, |
Helen Zeng | 38c3c96 | 2012-05-17 14:56:20 -0700 | [diff] [blame] | 2501 | &apq_cpudai_slimbus_3_tx, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2502 | &apq8064_rpm_device, |
| 2503 | &apq8064_rpm_log_device, |
| 2504 | &apq8064_rpm_stat_device, |
Anji Jonnala | 9312992 | 2012-10-09 20:57:53 +0530 | [diff] [blame] | 2505 | &apq8064_rpm_master_stat_device, |
Ramesh Masavarapu | f31ff24 | 2012-05-10 18:55:21 -0700 | [diff] [blame] | 2506 | &apq_device_tz_log, |
Gagan Mac | 8a7a5d3 | 2011-11-11 16:43:06 -0700 | [diff] [blame] | 2507 | &msm_bus_8064_apps_fabric, |
| 2508 | &msm_bus_8064_sys_fabric, |
| 2509 | &msm_bus_8064_mm_fabric, |
| 2510 | &msm_bus_8064_sys_fpb, |
| 2511 | &msm_bus_8064_cpss_fpb, |
Mohan Kumar Gubbihalli Lachma Naik | 7f72edd | 2012-02-06 17:26:47 -0800 | [diff] [blame] | 2512 | &apq8064_msm_device_vidc, |
Stephen Boyd | 25c4a0b | 2011-09-20 00:12:36 -0700 | [diff] [blame] | 2513 | &msm_pil_dsps, |
Matt Wagantall | b94b9a5 | 2012-02-02 21:59:54 -0800 | [diff] [blame] | 2514 | &msm_8960_q6_lpass, |
Stephen Boyd | 7b973de | 2012-03-09 12:26:16 -0800 | [diff] [blame] | 2515 | &msm_pil_vidc, |
Matt Wagantall | 292aace | 2012-01-26 19:12:34 -0800 | [diff] [blame] | 2516 | &msm_gss, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 2517 | &apq8064_rtb_device, |
Abhijeet Dharmapurikar | fb4a2f8 | 2012-08-23 14:36:59 -0700 | [diff] [blame] | 2518 | &apq8064_msm_gov_device, |
Stepan Moskovchenko | 28662c5 | 2012-03-01 12:48:45 -0800 | [diff] [blame] | 2519 | &apq8064_device_cache_erp, |
Stepan Moskovchenko | 0f3de11 | 2012-06-08 18:11:46 -0700 | [diff] [blame] | 2520 | &msm8960_device_ebi1_ch0_erp, |
| 2521 | &msm8960_device_ebi1_ch1_erp, |
Siddartha Mohanadoss | b9df494 | 2012-02-08 09:58:21 -0800 | [diff] [blame] | 2522 | &epm_adc_device, |
Pratik Patel | 3b0ca88 | 2012-06-01 16:54:14 -0700 | [diff] [blame] | 2523 | &coresight_tpiu_device, |
| 2524 | &coresight_etb_device, |
| 2525 | &apq8064_coresight_funnel_device, |
| 2526 | &coresight_etm0_device, |
| 2527 | &coresight_etm1_device, |
| 2528 | &coresight_etm2_device, |
| 2529 | &coresight_etm3_device, |
Helen Zeng | 8f92550 | 2012-03-05 16:50:17 -0800 | [diff] [blame] | 2530 | &apq_cpudai_slim_4_rx, |
| 2531 | &apq_cpudai_slim_4_tx, |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 2532 | #ifdef CONFIG_MSM_GEMINI |
Jignesh Mehta | 921649d | 2012-04-19 06:57:23 -0700 | [diff] [blame] | 2533 | &msm8960_gemini_device, |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 2534 | #endif |
Laura Abbott | 0577d7b | 2012-04-17 11:14:30 -0700 | [diff] [blame] | 2535 | &apq8064_iommu_domain_device, |
Siddartha Mohanadoss | 48cad91 | 2012-04-05 21:29:54 -0700 | [diff] [blame] | 2536 | &msm_tsens_device, |
Laura Abbott | 93a4a35 | 2012-05-25 09:26:35 -0700 | [diff] [blame] | 2537 | &apq8064_cache_dump_device, |
Joel Nider | 0e4a16d | 2012-08-05 14:20:11 +0300 | [diff] [blame] | 2538 | &msm_8064_device_tspp, |
Binqiang Qiu | f165c92 | 2012-08-15 18:00:18 -0700 | [diff] [blame] | 2539 | #ifdef CONFIG_BATTERY_BCL |
| 2540 | &battery_bcl_device, |
| 2541 | #endif |
Abhijeet Dharmapurikar | fb4a2f8 | 2012-08-23 14:36:59 -0700 | [diff] [blame] | 2542 | &apq8064_msm_mpd_device, |
Harini Jayaraman | c4c5869 | 2011-07-19 14:50:10 -0600 | [diff] [blame] | 2543 | }; |
| 2544 | |
Joel King | 82b7e3f | 2012-01-05 10:03:27 -0800 | [diff] [blame] | 2545 | static struct platform_device *cdp_devices[] __initdata = { |
| 2546 | &apq8064_device_uart_gsbi1, |
Jin Hong | 4bbbfba | 2012-02-02 21:48:07 -0800 | [diff] [blame] | 2547 | &apq8064_device_uart_gsbi7, |
Joel King | 82b7e3f | 2012-01-05 10:03:27 -0800 | [diff] [blame] | 2548 | &msm_device_sps_apq8064, |
Aravind Venkateswaran | 4ca2753 | 2012-02-16 14:27:05 -0800 | [diff] [blame] | 2549 | #ifdef CONFIG_MSM_ROTATOR |
| 2550 | &msm_rotator_device, |
| 2551 | #endif |
Anji Jonnala | 6c2b685 | 2012-09-21 13:34:44 +0530 | [diff] [blame] | 2552 | &msm8064_pc_cntr, |
Joel King | 82b7e3f | 2012-01-05 10:03:27 -0800 | [diff] [blame] | 2553 | }; |
| 2554 | |
Jay Chokshi | 1b7eaa9 | 2012-04-04 14:53:14 -0700 | [diff] [blame] | 2555 | static struct platform_device |
Jay Chokshi | 1b7eaa9 | 2012-04-04 14:53:14 -0700 | [diff] [blame] | 2556 | mpq8064_device_ext_1p2_buck_vreg __devinitdata = { |
| 2557 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2558 | .id = SX150X_GPIO(4, 2), |
| 2559 | .dev = { |
| 2560 | .platform_data = |
| 2561 | &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_1P2V], |
| 2562 | }, |
| 2563 | }; |
| 2564 | |
| 2565 | static struct platform_device |
| 2566 | mpq8064_device_ext_1p8_buck_vreg __devinitdata = { |
| 2567 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2568 | .id = SX150X_GPIO(4, 4), |
| 2569 | .dev = { |
| 2570 | .platform_data = |
| 2571 | &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_1P8V], |
| 2572 | }, |
| 2573 | }; |
| 2574 | |
| 2575 | static struct platform_device |
| 2576 | mpq8064_device_ext_2p2_buck_vreg __devinitdata = { |
| 2577 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2578 | .id = SX150X_GPIO(4, 14), |
| 2579 | .dev = { |
| 2580 | .platform_data = |
| 2581 | &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_2P2V], |
| 2582 | }, |
| 2583 | }; |
| 2584 | |
| 2585 | static struct platform_device |
| 2586 | mpq8064_device_ext_5v_buck_vreg __devinitdata = { |
| 2587 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2588 | .id = SX150X_GPIO(4, 3), |
| 2589 | .dev = { |
| 2590 | .platform_data = |
| 2591 | &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_5V], |
| 2592 | }, |
| 2593 | }; |
| 2594 | |
| 2595 | static struct platform_device |
| 2596 | mpq8064_device_ext_3p3v_ldo_vreg __devinitdata = { |
| 2597 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2598 | .id = SX150X_GPIO(4, 15), |
| 2599 | .dev = { |
| 2600 | .platform_data = |
| 2601 | &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_3P3V], |
| 2602 | }, |
| 2603 | }; |
| 2604 | |
Ravi Kumar V | 1c90301 | 2012-05-15 16:11:35 +0530 | [diff] [blame] | 2605 | static struct platform_device rc_input_loopback_pdev = { |
| 2606 | .name = "rc-user-input", |
| 2607 | .id = -1, |
| 2608 | }; |
| 2609 | |
Ravi Kumar V | 040eeff | 2012-05-23 21:29:23 +0530 | [diff] [blame] | 2610 | static int rf4ce_gpio_init(void) |
| 2611 | { |
Ravi Kumar V | 92b2b6c | 2012-08-14 17:18:11 +0530 | [diff] [blame] | 2612 | if (!machine_is_mpq8064_cdp() && |
| 2613 | !machine_is_mpq8064_hrd() && |
| 2614 | !machine_is_mpq8064_dtv()) |
Ravi Kumar V | 040eeff | 2012-05-23 21:29:23 +0530 | [diff] [blame] | 2615 | return -EINVAL; |
| 2616 | |
| 2617 | /* CC2533 SRDY Input */ |
| 2618 | if (!gpio_request(SX150X_GPIO(4, 6), "rf4ce_srdy")) { |
| 2619 | gpio_direction_input(SX150X_GPIO(4, 6)); |
| 2620 | gpio_export(SX150X_GPIO(4, 6), true); |
| 2621 | } |
| 2622 | |
| 2623 | /* CC2533 MRDY Output */ |
| 2624 | if (!gpio_request(SX150X_GPIO(4, 5), "rf4ce_mrdy")) { |
| 2625 | gpio_direction_output(SX150X_GPIO(4, 5), 1); |
| 2626 | gpio_export(SX150X_GPIO(4, 5), true); |
| 2627 | } |
| 2628 | |
| 2629 | /* CC2533 Reset Output */ |
| 2630 | if (!gpio_request(SX150X_GPIO(4, 7), "rf4ce_reset")) { |
| 2631 | gpio_direction_output(SX150X_GPIO(4, 7), 0); |
| 2632 | gpio_export(SX150X_GPIO(4, 7), true); |
| 2633 | } |
| 2634 | |
| 2635 | return 0; |
| 2636 | } |
| 2637 | late_initcall(rf4ce_gpio_init); |
| 2638 | |
Mayank Rana | 262e903 | 2012-05-10 15:14:00 -0700 | [diff] [blame] | 2639 | #ifdef CONFIG_SERIAL_MSM_HS |
| 2640 | static int configure_uart_gpios(int on) |
| 2641 | { |
| 2642 | int ret = 0, i; |
| 2643 | int uart_gpios[] = {14, 15, 16, 17}; |
| 2644 | |
| 2645 | for (i = 0; i < ARRAY_SIZE(uart_gpios); i++) { |
| 2646 | if (on) { |
| 2647 | ret = gpio_request(uart_gpios[i], NULL); |
| 2648 | if (ret) { |
| 2649 | pr_err("%s:unable to request uart gpio[%d]\n", |
| 2650 | __func__, uart_gpios[i]); |
| 2651 | break; |
| 2652 | } |
| 2653 | } else { |
| 2654 | gpio_free(uart_gpios[i]); |
| 2655 | } |
| 2656 | } |
| 2657 | |
| 2658 | if (ret && on && i) |
| 2659 | for (; i >= 0; i--) |
| 2660 | gpio_free(uart_gpios[i]); |
| 2661 | return ret; |
| 2662 | } |
| 2663 | |
| 2664 | static struct msm_serial_hs_platform_data mpq8064_gsbi6_uartdm_pdata = { |
| 2665 | .inject_rx_on_wakeup = 1, |
| 2666 | .rx_to_inject = 0xFD, |
| 2667 | .gpio_config = configure_uart_gpios, |
| 2668 | }; |
| 2669 | #else |
| 2670 | static struct msm_serial_hs_platform_data msm_uart_dm9_pdata; |
| 2671 | #endif |
| 2672 | |
Jay Chokshi | 1b7eaa9 | 2012-04-04 14:53:14 -0700 | [diff] [blame] | 2673 | static struct platform_device *mpq_devices[] __initdata = { |
| 2674 | &msm_device_sps_apq8064, |
| 2675 | &mpq8064_device_qup_i2c_gsbi5, |
| 2676 | #ifdef CONFIG_MSM_ROTATOR |
| 2677 | &msm_rotator_device, |
| 2678 | #endif |
Ravi Kumar V | 05931a2 | 2012-04-04 17:09:37 +0530 | [diff] [blame] | 2679 | &gpio_ir_recv_pdev, |
Jay Chokshi | 1b7eaa9 | 2012-04-04 14:53:14 -0700 | [diff] [blame] | 2680 | &mpq8064_device_ext_1p2_buck_vreg, |
| 2681 | &mpq8064_device_ext_1p8_buck_vreg, |
| 2682 | &mpq8064_device_ext_2p2_buck_vreg, |
| 2683 | &mpq8064_device_ext_5v_buck_vreg, |
| 2684 | &mpq8064_device_ext_3p3v_ldo_vreg, |
Terence Hampson | 2e1705f | 2012-04-11 19:55:29 -0400 | [diff] [blame] | 2685 | #ifdef CONFIG_MSM_VCAP |
| 2686 | &msm8064_device_vcap, |
| 2687 | #endif |
Ravi Kumar V | 1c90301 | 2012-05-15 16:11:35 +0530 | [diff] [blame] | 2688 | &rc_input_loopback_pdev, |
Bar Weiner | f82c587 | 2012-10-23 14:31:26 +0200 | [diff] [blame] | 2689 | &mpq8064_device_qup_spi_gsbi6, |
Jay Chokshi | 1b7eaa9 | 2012-04-04 14:53:14 -0700 | [diff] [blame] | 2690 | }; |
| 2691 | |
Harini Jayaraman | c4c5869 | 2011-07-19 14:50:10 -0600 | [diff] [blame] | 2692 | static struct msm_spi_platform_data apq8064_qup_spi_gsbi5_pdata = { |
Stepan Moskovchenko | c71c979 | 2012-01-31 18:12:44 -0800 | [diff] [blame] | 2693 | .max_clock_speed = 1100000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2694 | }; |
| 2695 | |
Bar Weiner | f82c587 | 2012-10-23 14:31:26 +0200 | [diff] [blame] | 2696 | static struct msm_spi_platform_data mpq8064_qup_spi_gsbi6_pdata = { |
| 2697 | .max_clock_speed = 1100000, |
| 2698 | }; |
| 2699 | |
| 2700 | static struct ci_bridge_platform_data mpq8064_ci_bridge_pdata = { |
| 2701 | .reset_pin = 260, |
| 2702 | .interrupt_pin = 261, |
| 2703 | }; |
| 2704 | |
Stepan Moskovchenko | eed82a5 | 2011-09-02 13:19:23 -0700 | [diff] [blame] | 2705 | #define KS8851_IRQ_GPIO 43 |
| 2706 | |
| 2707 | static struct spi_board_info spi_board_info[] __initdata = { |
| 2708 | { |
| 2709 | .modalias = "ks8851", |
| 2710 | .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO), |
| 2711 | .max_speed_hz = 19200000, |
| 2712 | .bus_num = 0, |
| 2713 | .chip_select = 2, |
| 2714 | .mode = SPI_MODE_0, |
| 2715 | }, |
Siddartha Mohanadoss | b9df494 | 2012-02-08 09:58:21 -0800 | [diff] [blame] | 2716 | { |
| 2717 | .modalias = "epm_adc", |
| 2718 | .max_speed_hz = 1100000, |
| 2719 | .bus_num = 0, |
| 2720 | .chip_select = 3, |
| 2721 | .mode = SPI_MODE_0, |
Bar Weiner | f82c587 | 2012-10-23 14:31:26 +0200 | [diff] [blame] | 2722 | } |
| 2723 | }; |
| 2724 | |
| 2725 | static struct spi_board_info mpq8064_spi_board_info[] __initdata = { |
| 2726 | { |
| 2727 | .modalias = "ci_bridge_spi", |
| 2728 | .max_speed_hz = 1000000, |
| 2729 | .bus_num = 1, |
| 2730 | .chip_select = 0, |
| 2731 | .mode = SPI_MODE_0, |
| 2732 | .platform_data = &mpq8064_ci_bridge_pdata, |
Siddartha Mohanadoss | b9df494 | 2012-02-08 09:58:21 -0800 | [diff] [blame] | 2733 | }, |
Stepan Moskovchenko | eed82a5 | 2011-09-02 13:19:23 -0700 | [diff] [blame] | 2734 | }; |
| 2735 | |
Sagar Dharia | 8bdcdaf | 2011-09-16 16:01:15 -0600 | [diff] [blame] | 2736 | static struct slim_boardinfo apq8064_slim_devices[] = { |
Swaminathan Sathappan | 2f51a75 | 2011-12-05 12:51:19 -0800 | [diff] [blame] | 2737 | { |
Swaminathan Sathappan | cef966d | 2011-12-15 17:27:04 -0800 | [diff] [blame] | 2738 | .bus_num = 1, |
| 2739 | .slim_slave = &apq8064_slim_tabla, |
| 2740 | }, |
| 2741 | { |
| 2742 | .bus_num = 1, |
| 2743 | .slim_slave = &apq8064_slim_tabla20, |
Swaminathan Sathappan | 2f51a75 | 2011-12-05 12:51:19 -0800 | [diff] [blame] | 2744 | }, |
| 2745 | /* add more slimbus slaves as needed */ |
Sagar Dharia | 8bdcdaf | 2011-09-16 16:01:15 -0600 | [diff] [blame] | 2746 | }; |
| 2747 | |
David Keitel | 3c40fc5 | 2012-02-09 17:53:52 -0800 | [diff] [blame] | 2748 | static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi1_pdata = { |
| 2749 | .clk_freq = 100000, |
| 2750 | .src_clk_rate = 24000000, |
| 2751 | }; |
| 2752 | |
Jing Lin | 04601f9 | 2012-02-05 15:36:07 -0800 | [diff] [blame] | 2753 | static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi3_pdata = { |
Anirudh Ghayal | c216347 | 2012-04-10 14:58:14 +0530 | [diff] [blame] | 2754 | .clk_freq = 384000, |
Jing Lin | 04601f9 | 2012-02-05 15:36:07 -0800 | [diff] [blame] | 2755 | .src_clk_rate = 24000000, |
| 2756 | }; |
| 2757 | |
Kenneth Heitke | 748593a | 2011-07-15 15:45:11 -0600 | [diff] [blame] | 2758 | static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi4_pdata = { |
| 2759 | .clk_freq = 100000, |
| 2760 | .src_clk_rate = 24000000, |
Kenneth Heitke | 748593a | 2011-07-15 15:45:11 -0600 | [diff] [blame] | 2761 | }; |
| 2762 | |
Joel King | 8f839b9 | 2012-04-01 14:37:46 -0700 | [diff] [blame] | 2763 | static struct msm_i2c_platform_data mpq8064_i2c_qup_gsbi5_pdata = { |
| 2764 | .clk_freq = 100000, |
| 2765 | .src_clk_rate = 24000000, |
| 2766 | }; |
| 2767 | |
David Keitel | 3c40fc5 | 2012-02-09 17:53:52 -0800 | [diff] [blame] | 2768 | #define GSBI_DUAL_MODE_CODE 0x60 |
| 2769 | #define MSM_GSBI1_PHYS 0x12440000 |
Kenneth Heitke | 748593a | 2011-07-15 15:45:11 -0600 | [diff] [blame] | 2770 | static void __init apq8064_i2c_init(void) |
| 2771 | { |
David Keitel | 3c40fc5 | 2012-02-09 17:53:52 -0800 | [diff] [blame] | 2772 | void __iomem *gsbi_mem; |
| 2773 | |
| 2774 | apq8064_device_qup_i2c_gsbi1.dev.platform_data = |
| 2775 | &apq8064_i2c_qup_gsbi1_pdata; |
| 2776 | gsbi_mem = ioremap_nocache(MSM_GSBI1_PHYS, 4); |
| 2777 | writel_relaxed(GSBI_DUAL_MODE_CODE, gsbi_mem); |
| 2778 | /* Ensure protocol code is written before proceeding */ |
| 2779 | wmb(); |
| 2780 | iounmap(gsbi_mem); |
| 2781 | apq8064_i2c_qup_gsbi1_pdata.use_gsbi_shared_mode = 1; |
Jing Lin | 04601f9 | 2012-02-05 15:36:07 -0800 | [diff] [blame] | 2782 | apq8064_device_qup_i2c_gsbi3.dev.platform_data = |
| 2783 | &apq8064_i2c_qup_gsbi3_pdata; |
Siddartha Mohanadoss | b9df494 | 2012-02-08 09:58:21 -0800 | [diff] [blame] | 2784 | apq8064_device_qup_i2c_gsbi1.dev.platform_data = |
| 2785 | &apq8064_i2c_qup_gsbi1_pdata; |
Kenneth Heitke | 748593a | 2011-07-15 15:45:11 -0600 | [diff] [blame] | 2786 | apq8064_device_qup_i2c_gsbi4.dev.platform_data = |
| 2787 | &apq8064_i2c_qup_gsbi4_pdata; |
Joel King | 8f839b9 | 2012-04-01 14:37:46 -0700 | [diff] [blame] | 2788 | mpq8064_device_qup_i2c_gsbi5.dev.platform_data = |
| 2789 | &mpq8064_i2c_qup_gsbi5_pdata; |
Kenneth Heitke | 748593a | 2011-07-15 15:45:11 -0600 | [diff] [blame] | 2790 | } |
| 2791 | |
Stepan Moskovchenko | c71c979 | 2012-01-31 18:12:44 -0800 | [diff] [blame] | 2792 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
Stepan Moskovchenko | eed82a5 | 2011-09-02 13:19:23 -0700 | [diff] [blame] | 2793 | static int ethernet_init(void) |
| 2794 | { |
| 2795 | int ret; |
| 2796 | ret = gpio_request(KS8851_IRQ_GPIO, "ks8851_irq"); |
| 2797 | if (ret) { |
| 2798 | pr_err("ks8851 gpio_request failed: %d\n", ret); |
| 2799 | goto fail; |
| 2800 | } |
| 2801 | |
| 2802 | return 0; |
| 2803 | fail: |
| 2804 | return ret; |
| 2805 | } |
| 2806 | #else |
| 2807 | static int ethernet_init(void) |
| 2808 | { |
| 2809 | return 0; |
| 2810 | } |
| 2811 | #endif |
| 2812 | |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 2813 | #define GPIO_KEY_HOME PM8921_GPIO_PM_TO_SYS(27) |
| 2814 | #define GPIO_KEY_VOLUME_UP PM8921_GPIO_PM_TO_SYS(35) |
| 2815 | #define GPIO_KEY_VOLUME_DOWN_PM8921 PM8921_GPIO_PM_TO_SYS(38) |
| 2816 | #define GPIO_KEY_VOLUME_DOWN_PM8917 PM8921_GPIO_PM_TO_SYS(30) |
| 2817 | #define GPIO_KEY_CAM_FOCUS PM8921_GPIO_PM_TO_SYS(3) |
| 2818 | #define GPIO_KEY_CAM_SNAP PM8921_GPIO_PM_TO_SYS(4) |
| 2819 | #define GPIO_KEY_ROTATION_PM8921 PM8921_GPIO_PM_TO_SYS(42) |
| 2820 | #define GPIO_KEY_ROTATION_PM8917 PM8921_GPIO_PM_TO_SYS(8) |
Mohan Pallaka | 474b94b | 2012-01-25 12:59:58 +0530 | [diff] [blame] | 2821 | |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 2822 | static struct gpio_keys_button cdp_keys_pm8921[] = { |
Mohan Pallaka | 474b94b | 2012-01-25 12:59:58 +0530 | [diff] [blame] | 2823 | { |
| 2824 | .code = KEY_HOME, |
| 2825 | .gpio = GPIO_KEY_HOME, |
| 2826 | .desc = "home_key", |
| 2827 | .active_low = 1, |
| 2828 | .type = EV_KEY, |
| 2829 | .wakeup = 1, |
| 2830 | .debounce_interval = 15, |
| 2831 | }, |
| 2832 | { |
| 2833 | .code = KEY_VOLUMEUP, |
| 2834 | .gpio = GPIO_KEY_VOLUME_UP, |
| 2835 | .desc = "volume_up_key", |
| 2836 | .active_low = 1, |
| 2837 | .type = EV_KEY, |
| 2838 | .wakeup = 1, |
| 2839 | .debounce_interval = 15, |
| 2840 | }, |
| 2841 | { |
| 2842 | .code = KEY_VOLUMEDOWN, |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 2843 | .gpio = GPIO_KEY_VOLUME_DOWN_PM8921, |
Mohan Pallaka | 474b94b | 2012-01-25 12:59:58 +0530 | [diff] [blame] | 2844 | .desc = "volume_down_key", |
| 2845 | .active_low = 1, |
| 2846 | .type = EV_KEY, |
| 2847 | .wakeup = 1, |
| 2848 | .debounce_interval = 15, |
| 2849 | }, |
| 2850 | { |
| 2851 | .code = SW_ROTATE_LOCK, |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 2852 | .gpio = GPIO_KEY_ROTATION_PM8921, |
| 2853 | .desc = "rotate_key", |
| 2854 | .active_low = 1, |
| 2855 | .type = EV_SW, |
| 2856 | .debounce_interval = 15, |
| 2857 | }, |
| 2858 | }; |
| 2859 | |
| 2860 | static struct gpio_keys_button cdp_keys_pm8917[] = { |
| 2861 | { |
| 2862 | .code = KEY_HOME, |
| 2863 | .gpio = GPIO_KEY_HOME, |
| 2864 | .desc = "home_key", |
| 2865 | .active_low = 1, |
| 2866 | .type = EV_KEY, |
| 2867 | .wakeup = 1, |
| 2868 | .debounce_interval = 15, |
| 2869 | }, |
| 2870 | { |
| 2871 | .code = KEY_VOLUMEUP, |
| 2872 | .gpio = GPIO_KEY_VOLUME_UP, |
| 2873 | .desc = "volume_up_key", |
| 2874 | .active_low = 1, |
| 2875 | .type = EV_KEY, |
| 2876 | .wakeup = 1, |
| 2877 | .debounce_interval = 15, |
| 2878 | }, |
| 2879 | { |
| 2880 | .code = KEY_VOLUMEDOWN, |
| 2881 | .gpio = GPIO_KEY_VOLUME_DOWN_PM8917, |
| 2882 | .desc = "volume_down_key", |
| 2883 | .active_low = 1, |
| 2884 | .type = EV_KEY, |
| 2885 | .wakeup = 1, |
| 2886 | .debounce_interval = 15, |
| 2887 | }, |
| 2888 | { |
| 2889 | .code = SW_ROTATE_LOCK, |
| 2890 | .gpio = GPIO_KEY_ROTATION_PM8917, |
Mohan Pallaka | 474b94b | 2012-01-25 12:59:58 +0530 | [diff] [blame] | 2891 | .desc = "rotate_key", |
| 2892 | .active_low = 1, |
| 2893 | .type = EV_SW, |
| 2894 | .debounce_interval = 15, |
| 2895 | }, |
| 2896 | }; |
| 2897 | |
| 2898 | static struct gpio_keys_platform_data cdp_keys_data = { |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 2899 | .buttons = cdp_keys_pm8921, |
| 2900 | .nbuttons = ARRAY_SIZE(cdp_keys_pm8921), |
Mohan Pallaka | 474b94b | 2012-01-25 12:59:58 +0530 | [diff] [blame] | 2901 | }; |
| 2902 | |
| 2903 | static struct platform_device cdp_kp_pdev = { |
| 2904 | .name = "gpio-keys", |
| 2905 | .id = -1, |
| 2906 | .dev = { |
| 2907 | .platform_data = &cdp_keys_data, |
| 2908 | }, |
| 2909 | }; |
| 2910 | |
| 2911 | static struct gpio_keys_button mtp_keys[] = { |
| 2912 | { |
| 2913 | .code = KEY_CAMERA_FOCUS, |
| 2914 | .gpio = GPIO_KEY_CAM_FOCUS, |
| 2915 | .desc = "cam_focus_key", |
| 2916 | .active_low = 1, |
| 2917 | .type = EV_KEY, |
| 2918 | .wakeup = 1, |
| 2919 | .debounce_interval = 15, |
| 2920 | }, |
| 2921 | { |
| 2922 | .code = KEY_VOLUMEUP, |
| 2923 | .gpio = GPIO_KEY_VOLUME_UP, |
| 2924 | .desc = "volume_up_key", |
| 2925 | .active_low = 1, |
| 2926 | .type = EV_KEY, |
| 2927 | .wakeup = 1, |
| 2928 | .debounce_interval = 15, |
| 2929 | }, |
| 2930 | { |
| 2931 | .code = KEY_VOLUMEDOWN, |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 2932 | .gpio = GPIO_KEY_VOLUME_DOWN_PM8921, |
Mohan Pallaka | 474b94b | 2012-01-25 12:59:58 +0530 | [diff] [blame] | 2933 | .desc = "volume_down_key", |
| 2934 | .active_low = 1, |
| 2935 | .type = EV_KEY, |
| 2936 | .wakeup = 1, |
| 2937 | .debounce_interval = 15, |
| 2938 | }, |
| 2939 | { |
| 2940 | .code = KEY_CAMERA_SNAPSHOT, |
| 2941 | .gpio = GPIO_KEY_CAM_SNAP, |
| 2942 | .desc = "cam_snap_key", |
| 2943 | .active_low = 1, |
| 2944 | .type = EV_KEY, |
| 2945 | .debounce_interval = 15, |
| 2946 | }, |
| 2947 | }; |
| 2948 | |
| 2949 | static struct gpio_keys_platform_data mtp_keys_data = { |
| 2950 | .buttons = mtp_keys, |
| 2951 | .nbuttons = ARRAY_SIZE(mtp_keys), |
| 2952 | }; |
| 2953 | |
| 2954 | static struct platform_device mtp_kp_pdev = { |
| 2955 | .name = "gpio-keys", |
| 2956 | .id = -1, |
| 2957 | .dev = { |
| 2958 | .platform_data = &mtp_keys_data, |
| 2959 | }, |
| 2960 | }; |
| 2961 | |
Mohan Pallaka | b8aa828 | 2012-10-04 14:26:21 +0530 | [diff] [blame] | 2962 | #define MPQ_HRD_HOME_GPIO SX150X_EXP2_GPIO_BASE |
| 2963 | #define MPQ_HRD_VOL_UP_GPIO (SX150X_EXP2_GPIO_BASE + 1) |
| 2964 | #define MPQ_HRD_VOL_DOWN_GPIO (SX150X_EXP2_GPIO_BASE + 2) |
| 2965 | #define MPQ_HRD_RIGHT_GPIO (SX150X_EXP2_GPIO_BASE + 3) |
| 2966 | #define MPQ_HRD_LEFT_GPIO (SX150X_EXP2_GPIO_BASE + 4) |
| 2967 | #define MPQ_HRD_ENTER_GPIO (SX150X_EXP2_GPIO_BASE + 5) |
| 2968 | |
| 2969 | static struct gpio_keys_button mpq_hrd_keys[] = { |
| 2970 | { |
| 2971 | .code = KEY_HOME, |
| 2972 | .gpio = MPQ_HRD_HOME_GPIO, |
| 2973 | .desc = "home_key", |
| 2974 | .active_low = 1, |
| 2975 | .type = EV_KEY, |
| 2976 | .wakeup = 1, |
| 2977 | .debounce_interval = 15, |
| 2978 | }, |
| 2979 | { |
| 2980 | .code = KEY_VOLUMEUP, |
| 2981 | .gpio = MPQ_HRD_VOL_UP_GPIO, |
| 2982 | .desc = "volume_up_key", |
| 2983 | .active_low = 1, |
| 2984 | .type = EV_KEY, |
| 2985 | .wakeup = 1, |
| 2986 | .debounce_interval = 15, |
| 2987 | }, |
| 2988 | { |
| 2989 | .code = KEY_VOLUMEDOWN, |
| 2990 | .gpio = MPQ_HRD_VOL_DOWN_GPIO, |
| 2991 | .desc = "volume_down_key", |
| 2992 | .active_low = 1, |
| 2993 | .type = EV_KEY, |
| 2994 | .wakeup = 1, |
| 2995 | .debounce_interval = 15, |
| 2996 | }, |
| 2997 | { |
| 2998 | .code = KEY_RIGHT, |
| 2999 | .gpio = MPQ_HRD_RIGHT_GPIO, |
| 3000 | .desc = "right_key", |
| 3001 | .active_low = 1, |
| 3002 | .type = EV_KEY, |
| 3003 | .wakeup = 1, |
| 3004 | .debounce_interval = 15, |
| 3005 | }, |
| 3006 | { |
| 3007 | .code = KEY_LEFT, |
| 3008 | .gpio = MPQ_HRD_LEFT_GPIO, |
| 3009 | .desc = "left_key", |
| 3010 | .active_low = 1, |
| 3011 | .type = EV_KEY, |
| 3012 | .wakeup = 1, |
| 3013 | .debounce_interval = 15, |
| 3014 | }, |
| 3015 | { |
| 3016 | .code = KEY_ENTER, |
| 3017 | .gpio = MPQ_HRD_ENTER_GPIO, |
| 3018 | .desc = "enter_key", |
| 3019 | .active_low = 1, |
| 3020 | .type = EV_KEY, |
| 3021 | .wakeup = 1, |
| 3022 | .debounce_interval = 15, |
| 3023 | }, |
| 3024 | }; |
| 3025 | |
| 3026 | static struct gpio_keys_platform_data mpq_hrd_keys_pdata = { |
| 3027 | .buttons = mpq_hrd_keys, |
| 3028 | .nbuttons = ARRAY_SIZE(mpq_hrd_keys), |
| 3029 | }; |
| 3030 | |
| 3031 | static struct platform_device mpq_hrd_keys_pdev = { |
| 3032 | .name = "gpio-keys", |
| 3033 | .id = -1, |
| 3034 | .dev = { |
| 3035 | .platform_data = &mpq_hrd_keys_pdata, |
| 3036 | }, |
| 3037 | }; |
| 3038 | |
Anirudh Ghayal | 32ea625 | 2012-04-26 16:39:50 +0530 | [diff] [blame] | 3039 | static struct gpio_keys_button mpq_keys[] = { |
| 3040 | { |
| 3041 | .code = KEY_VOLUMEDOWN, |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 3042 | .gpio = GPIO_KEY_VOLUME_DOWN_PM8921, |
Anirudh Ghayal | 32ea625 | 2012-04-26 16:39:50 +0530 | [diff] [blame] | 3043 | .desc = "volume_down_key", |
| 3044 | .active_low = 1, |
| 3045 | .type = EV_KEY, |
| 3046 | .wakeup = 1, |
| 3047 | .debounce_interval = 15, |
| 3048 | }, |
| 3049 | { |
| 3050 | .code = KEY_VOLUMEUP, |
| 3051 | .gpio = GPIO_KEY_VOLUME_UP, |
| 3052 | .desc = "volume_up_key", |
| 3053 | .active_low = 1, |
| 3054 | .type = EV_KEY, |
| 3055 | .wakeup = 1, |
| 3056 | .debounce_interval = 15, |
| 3057 | }, |
| 3058 | }; |
| 3059 | |
| 3060 | static struct gpio_keys_platform_data mpq_keys_data = { |
| 3061 | .buttons = mpq_keys, |
| 3062 | .nbuttons = ARRAY_SIZE(mpq_keys), |
| 3063 | }; |
| 3064 | |
| 3065 | static struct platform_device mpq_gpio_keys_pdev = { |
| 3066 | .name = "gpio-keys", |
| 3067 | .id = -1, |
| 3068 | .dev = { |
| 3069 | .platform_data = &mpq_keys_data, |
| 3070 | }, |
| 3071 | }; |
| 3072 | |
| 3073 | #define MPQ_KP_ROW_BASE SX150X_EXP2_GPIO_BASE |
| 3074 | #define MPQ_KP_COL_BASE (SX150X_EXP2_GPIO_BASE + 4) |
| 3075 | |
| 3076 | static unsigned int mpq_row_gpios[] = {MPQ_KP_ROW_BASE, MPQ_KP_ROW_BASE + 1, |
| 3077 | MPQ_KP_ROW_BASE + 2, MPQ_KP_ROW_BASE + 3}; |
| 3078 | static unsigned int mpq_col_gpios[] = {MPQ_KP_COL_BASE, MPQ_KP_COL_BASE + 1, |
| 3079 | MPQ_KP_COL_BASE + 2}; |
| 3080 | |
| 3081 | static const unsigned int mpq_keymap[] = { |
| 3082 | KEY(0, 0, KEY_UP), |
| 3083 | KEY(0, 1, KEY_ENTER), |
| 3084 | KEY(0, 2, KEY_3), |
| 3085 | |
| 3086 | KEY(1, 0, KEY_DOWN), |
| 3087 | KEY(1, 1, KEY_EXIT), |
| 3088 | KEY(1, 2, KEY_4), |
| 3089 | |
| 3090 | KEY(2, 0, KEY_LEFT), |
| 3091 | KEY(2, 1, KEY_1), |
| 3092 | KEY(2, 2, KEY_5), |
| 3093 | |
| 3094 | KEY(3, 0, KEY_RIGHT), |
| 3095 | KEY(3, 1, KEY_2), |
| 3096 | KEY(3, 2, KEY_6), |
| 3097 | }; |
| 3098 | |
| 3099 | static struct matrix_keymap_data mpq_keymap_data = { |
| 3100 | .keymap_size = ARRAY_SIZE(mpq_keymap), |
| 3101 | .keymap = mpq_keymap, |
| 3102 | }; |
| 3103 | |
| 3104 | static struct matrix_keypad_platform_data mpq_keypad_data = { |
| 3105 | .keymap_data = &mpq_keymap_data, |
| 3106 | .row_gpios = mpq_row_gpios, |
| 3107 | .col_gpios = mpq_col_gpios, |
| 3108 | .num_row_gpios = ARRAY_SIZE(mpq_row_gpios), |
| 3109 | .num_col_gpios = ARRAY_SIZE(mpq_col_gpios), |
| 3110 | .col_scan_delay_us = 32000, |
| 3111 | .debounce_ms = 20, |
| 3112 | .wakeup = 1, |
| 3113 | .active_low = 1, |
| 3114 | .no_autorepeat = 1, |
| 3115 | }; |
| 3116 | |
| 3117 | static struct platform_device mpq_keypad_device = { |
| 3118 | .name = "matrix-keypad", |
| 3119 | .id = -1, |
| 3120 | .dev = { |
| 3121 | .platform_data = &mpq_keypad_data, |
| 3122 | }, |
| 3123 | }; |
| 3124 | |
Jin Hong | d3024e6 | 2012-02-09 16:13:32 -0800 | [diff] [blame] | 3125 | /* Sensors DSPS platform data */ |
| 3126 | #define DSPS_PIL_GENERIC_NAME "dsps" |
| 3127 | static void __init apq8064_init_dsps(void) |
| 3128 | { |
| 3129 | struct msm_dsps_platform_data *pdata = |
| 3130 | msm_dsps_device_8064.dev.platform_data; |
| 3131 | pdata->pil_name = DSPS_PIL_GENERIC_NAME; |
| 3132 | pdata->gpios = NULL; |
| 3133 | pdata->gpios_num = 0; |
| 3134 | |
| 3135 | platform_device_register(&msm_dsps_device_8064); |
| 3136 | } |
Mohan Pallaka | 474b94b | 2012-01-25 12:59:58 +0530 | [diff] [blame] | 3137 | |
Jing Lin | 417fa45 | 2012-02-05 14:31:06 -0800 | [diff] [blame] | 3138 | #define I2C_SURF 1 |
| 3139 | #define I2C_FFA (1 << 1) |
| 3140 | #define I2C_RUMI (1 << 2) |
| 3141 | #define I2C_SIM (1 << 3) |
| 3142 | #define I2C_LIQUID (1 << 4) |
Jay Chokshi | e7d8d4f | 2012-04-04 14:47:57 -0700 | [diff] [blame] | 3143 | #define I2C_MPQ_CDP BIT(5) |
| 3144 | #define I2C_MPQ_HRD BIT(6) |
| 3145 | #define I2C_MPQ_DTV BIT(7) |
Jing Lin | 417fa45 | 2012-02-05 14:31:06 -0800 | [diff] [blame] | 3146 | |
| 3147 | struct i2c_registry { |
| 3148 | u8 machs; |
| 3149 | int bus; |
| 3150 | struct i2c_board_info *info; |
| 3151 | int len; |
| 3152 | }; |
| 3153 | |
| 3154 | static struct i2c_registry apq8064_i2c_devices[] __initdata = { |
Jing Lin | 21ed4de | 2012-02-05 15:53:28 -0800 | [diff] [blame] | 3155 | { |
David Keitel | 2f613d9 | 2012-02-15 11:29:16 -0800 | [diff] [blame] | 3156 | I2C_LIQUID, |
| 3157 | APQ_8064_GSBI1_QUP_I2C_BUS_ID, |
| 3158 | smb349_charger_i2c_info, |
| 3159 | ARRAY_SIZE(smb349_charger_i2c_info) |
| 3160 | }, |
| 3161 | { |
Jing Lin | 21ed4de | 2012-02-05 15:53:28 -0800 | [diff] [blame] | 3162 | I2C_SURF | I2C_LIQUID, |
| 3163 | APQ_8064_GSBI3_QUP_I2C_BUS_ID, |
| 3164 | mxt_device_info, |
| 3165 | ARRAY_SIZE(mxt_device_info), |
| 3166 | }, |
Anirudh Ghayal | 2917a5a | 2012-02-05 19:51:07 -0800 | [diff] [blame] | 3167 | { |
| 3168 | I2C_FFA, |
| 3169 | APQ_8064_GSBI3_QUP_I2C_BUS_ID, |
| 3170 | cyttsp_info, |
| 3171 | ARRAY_SIZE(cyttsp_info), |
| 3172 | }, |
Amy Maloche | 70090f99 | 2012-02-16 16:35:26 -0800 | [diff] [blame] | 3173 | { |
| 3174 | I2C_FFA | I2C_LIQUID, |
| 3175 | APQ_8064_GSBI1_QUP_I2C_BUS_ID, |
| 3176 | isa1200_board_info, |
| 3177 | ARRAY_SIZE(isa1200_board_info), |
| 3178 | }, |
Santosh Mardi | eff9a74 | 2012-04-09 23:23:39 +0530 | [diff] [blame] | 3179 | { |
| 3180 | I2C_MPQ_CDP, |
| 3181 | APQ_8064_GSBI5_QUP_I2C_BUS_ID, |
| 3182 | cs8427_device_info, |
| 3183 | ARRAY_SIZE(cs8427_device_info), |
| 3184 | }, |
Abhishek Kharbanda | 72dc72e | 2012-06-07 13:41:37 -0700 | [diff] [blame] | 3185 | { |
| 3186 | I2C_SURF | I2C_FFA | I2C_LIQUID, |
| 3187 | APQ_8064_GSBI1_QUP_I2C_BUS_ID, |
| 3188 | sii_device_info, |
| 3189 | ARRAY_SIZE(sii_device_info), |
| 3190 | } |
Jing Lin | 417fa45 | 2012-02-05 14:31:06 -0800 | [diff] [blame] | 3191 | }; |
| 3192 | |
Kuirong Wang | f8c5e14 | 2012-06-21 16:17:32 -0700 | [diff] [blame] | 3193 | static struct i2c_registry apq8064_tabla_i2c_devices[] __initdata = { |
| 3194 | { |
| 3195 | .bus = APQ_8064_GSBI1_QUP_I2C_BUS_ID, |
| 3196 | .info = apq8064_tabla_i2c_device_info, |
| 3197 | .len = ARRAY_SIZE(apq8064_tabla_i2c_device_info), |
| 3198 | }, |
| 3199 | }; |
| 3200 | |
Jay Chokshi | 607f61b | 2012-04-25 18:21:21 -0700 | [diff] [blame] | 3201 | #define SX150X_EXP1_INT_N PM8921_MPP_IRQ(PM8921_IRQ_BASE, 9) |
Anirudh Ghayal | 9f1aaa7 | 2012-04-26 18:15:08 +0530 | [diff] [blame] | 3202 | #define SX150X_EXP2_INT_N MSM_GPIO_TO_INT(81) |
Jay Chokshi | 607f61b | 2012-04-25 18:21:21 -0700 | [diff] [blame] | 3203 | |
Jay Chokshi | e7d8d4f | 2012-04-04 14:47:57 -0700 | [diff] [blame] | 3204 | struct sx150x_platform_data mpq8064_sx150x_pdata[] = { |
| 3205 | [SX150X_EXP1] = { |
| 3206 | .gpio_base = SX150X_EXP1_GPIO_BASE, |
| 3207 | .oscio_is_gpo = false, |
| 3208 | .io_pullup_ena = 0x0, |
| 3209 | .io_pulldn_ena = 0x0, |
| 3210 | .io_open_drain_ena = 0x0, |
| 3211 | .io_polarity = 0, |
Jay Chokshi | 607f61b | 2012-04-25 18:21:21 -0700 | [diff] [blame] | 3212 | .irq_summary = SX150X_EXP1_INT_N, |
| 3213 | .irq_base = SX150X_EXP1_IRQ_BASE, |
Jay Chokshi | e7d8d4f | 2012-04-04 14:47:57 -0700 | [diff] [blame] | 3214 | }, |
| 3215 | [SX150X_EXP2] = { |
| 3216 | .gpio_base = SX150X_EXP2_GPIO_BASE, |
| 3217 | .oscio_is_gpo = false, |
Anirudh Ghayal | 32ea625 | 2012-04-26 16:39:50 +0530 | [diff] [blame] | 3218 | .io_pullup_ena = 0x0f, |
| 3219 | .io_pulldn_ena = 0x70, |
Jay Chokshi | e7d8d4f | 2012-04-04 14:47:57 -0700 | [diff] [blame] | 3220 | .io_open_drain_ena = 0x0, |
| 3221 | .io_polarity = 0, |
Anirudh Ghayal | 9f1aaa7 | 2012-04-26 18:15:08 +0530 | [diff] [blame] | 3222 | .irq_summary = SX150X_EXP2_INT_N, |
| 3223 | .irq_base = SX150X_EXP2_IRQ_BASE, |
Jay Chokshi | e7d8d4f | 2012-04-04 14:47:57 -0700 | [diff] [blame] | 3224 | }, |
| 3225 | [SX150X_EXP3] = { |
| 3226 | .gpio_base = SX150X_EXP3_GPIO_BASE, |
| 3227 | .oscio_is_gpo = false, |
| 3228 | .io_pullup_ena = 0x0, |
| 3229 | .io_pulldn_ena = 0x0, |
| 3230 | .io_open_drain_ena = 0x0, |
| 3231 | .io_polarity = 0, |
| 3232 | .irq_summary = -1, |
| 3233 | }, |
| 3234 | [SX150X_EXP4] = { |
| 3235 | .gpio_base = SX150X_EXP4_GPIO_BASE, |
| 3236 | .oscio_is_gpo = false, |
| 3237 | .io_pullup_ena = 0x0, |
| 3238 | .io_pulldn_ena = 0x0, |
| 3239 | .io_open_drain_ena = 0x0, |
| 3240 | .io_polarity = 0, |
| 3241 | .irq_summary = -1, |
| 3242 | }, |
| 3243 | }; |
| 3244 | |
| 3245 | static struct i2c_board_info sx150x_gpio_exp_info[] = { |
| 3246 | { |
| 3247 | I2C_BOARD_INFO("sx1509q", 0x70), |
| 3248 | .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP1], |
| 3249 | }, |
| 3250 | { |
| 3251 | I2C_BOARD_INFO("sx1508q", 0x23), |
| 3252 | .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP2], |
| 3253 | }, |
| 3254 | { |
| 3255 | I2C_BOARD_INFO("sx1508q", 0x22), |
| 3256 | .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP3], |
| 3257 | }, |
| 3258 | { |
| 3259 | I2C_BOARD_INFO("sx1509q", 0x3E), |
| 3260 | .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP4], |
| 3261 | }, |
| 3262 | }; |
| 3263 | |
| 3264 | #define MPQ8064_I2C_GSBI5_BUS_ID 5 |
| 3265 | |
| 3266 | static struct i2c_registry mpq8064_i2c_devices[] __initdata = { |
| 3267 | { |
| 3268 | I2C_MPQ_CDP, |
| 3269 | MPQ8064_I2C_GSBI5_BUS_ID, |
| 3270 | sx150x_gpio_exp_info, |
| 3271 | ARRAY_SIZE(sx150x_gpio_exp_info), |
| 3272 | }, |
| 3273 | }; |
| 3274 | |
Jing Lin | 417fa45 | 2012-02-05 14:31:06 -0800 | [diff] [blame] | 3275 | static void __init register_i2c_devices(void) |
| 3276 | { |
| 3277 | u8 mach_mask = 0; |
| 3278 | int i; |
Kuirong Wang | f8c5e14 | 2012-06-21 16:17:32 -0700 | [diff] [blame] | 3279 | u32 version; |
Jing Lin | 417fa45 | 2012-02-05 14:31:06 -0800 | [diff] [blame] | 3280 | |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 3281 | #ifdef CONFIG_MSM_CAMERA |
| 3282 | struct i2c_registry apq8064_camera_i2c_devices = { |
| 3283 | I2C_SURF | I2C_FFA | I2C_LIQUID | I2C_RUMI, |
| 3284 | APQ_8064_GSBI4_QUP_I2C_BUS_ID, |
| 3285 | apq8064_camera_board_info.board_info, |
| 3286 | apq8064_camera_board_info.num_i2c_board_info, |
| 3287 | }; |
| 3288 | #endif |
Jing Lin | 417fa45 | 2012-02-05 14:31:06 -0800 | [diff] [blame] | 3289 | /* Build the matching 'supported_machs' bitmask */ |
| 3290 | if (machine_is_apq8064_cdp()) |
| 3291 | mach_mask = I2C_SURF; |
| 3292 | else if (machine_is_apq8064_mtp()) |
| 3293 | mach_mask = I2C_FFA; |
| 3294 | else if (machine_is_apq8064_liquid()) |
| 3295 | mach_mask = I2C_LIQUID; |
Jay Chokshi | e7d8d4f | 2012-04-04 14:47:57 -0700 | [diff] [blame] | 3296 | else if (PLATFORM_IS_MPQ8064()) |
| 3297 | mach_mask = I2C_MPQ_CDP; |
Jing Lin | 417fa45 | 2012-02-05 14:31:06 -0800 | [diff] [blame] | 3298 | else |
| 3299 | pr_err("unmatched machine ID in register_i2c_devices\n"); |
| 3300 | |
| 3301 | /* Run the array and install devices as appropriate */ |
| 3302 | for (i = 0; i < ARRAY_SIZE(apq8064_i2c_devices); ++i) { |
| 3303 | if (apq8064_i2c_devices[i].machs & mach_mask) |
| 3304 | i2c_register_board_info(apq8064_i2c_devices[i].bus, |
| 3305 | apq8064_i2c_devices[i].info, |
| 3306 | apq8064_i2c_devices[i].len); |
| 3307 | } |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 3308 | #ifdef CONFIG_MSM_CAMERA |
| 3309 | if (apq8064_camera_i2c_devices.machs & mach_mask) |
| 3310 | i2c_register_board_info(apq8064_camera_i2c_devices.bus, |
| 3311 | apq8064_camera_i2c_devices.info, |
| 3312 | apq8064_camera_i2c_devices.len); |
| 3313 | #endif |
Jay Chokshi | e7d8d4f | 2012-04-04 14:47:57 -0700 | [diff] [blame] | 3314 | |
| 3315 | for (i = 0; i < ARRAY_SIZE(mpq8064_i2c_devices); ++i) { |
| 3316 | if (mpq8064_i2c_devices[i].machs & mach_mask) |
| 3317 | i2c_register_board_info( |
| 3318 | mpq8064_i2c_devices[i].bus, |
| 3319 | mpq8064_i2c_devices[i].info, |
| 3320 | mpq8064_i2c_devices[i].len); |
| 3321 | } |
Kuirong Wang | f8c5e14 | 2012-06-21 16:17:32 -0700 | [diff] [blame] | 3322 | |
| 3323 | if (machine_is_apq8064_mtp()) { |
| 3324 | version = socinfo_get_platform_version(); |
| 3325 | if (SOCINFO_VERSION_MINOR(version) == 1) |
| 3326 | for (i = 0; i < ARRAY_SIZE(apq8064_tabla_i2c_devices); |
| 3327 | ++i) |
| 3328 | i2c_register_board_info( |
| 3329 | apq8064_tabla_i2c_devices[i].bus, |
| 3330 | apq8064_tabla_i2c_devices[i].info, |
| 3331 | apq8064_tabla_i2c_devices[i].len); |
| 3332 | } |
| 3333 | |
Jing Lin | 417fa45 | 2012-02-05 14:31:06 -0800 | [diff] [blame] | 3334 | } |
| 3335 | |
Jay Chokshi | 994ff12 | 2012-03-27 15:43:48 -0700 | [diff] [blame] | 3336 | static void enable_ddr3_regulator(void) |
| 3337 | { |
| 3338 | static struct regulator *ext_ddr3; |
| 3339 | |
| 3340 | /* Use MPP7 output state as a flag for PCDDR3 presence. */ |
| 3341 | if (gpio_get_value_cansleep(PM8921_MPP_PM_TO_SYS(7)) > 0) { |
| 3342 | ext_ddr3 = regulator_get(NULL, "ext_ddr3"); |
| 3343 | if (IS_ERR(ext_ddr3) || ext_ddr3 == NULL) |
| 3344 | pr_err("Could not get MPP7 regulator\n"); |
| 3345 | else |
| 3346 | regulator_enable(ext_ddr3); |
| 3347 | } |
| 3348 | } |
| 3349 | |
Jay Chokshi | e7d8d4f | 2012-04-04 14:47:57 -0700 | [diff] [blame] | 3350 | static void enable_avc_i2c_bus(void) |
| 3351 | { |
| 3352 | int avc_i2c_en_mpp = PM8921_MPP_PM_TO_SYS(8); |
| 3353 | int rc; |
| 3354 | |
| 3355 | rc = gpio_request(avc_i2c_en_mpp, "avc_i2c_en"); |
| 3356 | if (rc) |
| 3357 | pr_err("request for avc_i2c_en mpp failed," |
| 3358 | "rc=%d\n", rc); |
| 3359 | else |
| 3360 | gpio_set_value_cansleep(avc_i2c_en_mpp, 1); |
| 3361 | } |
| 3362 | |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 3363 | /* Modify platform data values to match requirements for PM8917. */ |
| 3364 | static void __init apq8064_pm8917_pdata_fixup(void) |
| 3365 | { |
| 3366 | cdp_keys_data.buttons = cdp_keys_pm8917; |
| 3367 | cdp_keys_data.nbuttons = ARRAY_SIZE(cdp_keys_pm8917); |
| 3368 | } |
| 3369 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3370 | static void __init apq8064_common_init(void) |
| 3371 | { |
Kuirong Wang | f8c5e14 | 2012-06-21 16:17:32 -0700 | [diff] [blame] | 3372 | u32 platform_version = socinfo_get_platform_version(); |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 3373 | |
| 3374 | if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917) |
| 3375 | apq8064_pm8917_pdata_fixup(); |
Rohit Vaswani | b1cc493 | 2012-07-23 21:30:11 -0700 | [diff] [blame] | 3376 | platform_device_register(&msm_gpio_device); |
Joel King | 8f839b9 | 2012-04-01 14:37:46 -0700 | [diff] [blame] | 3377 | msm_tsens_early_init(&apq_tsens_pdata); |
Praveen Chidambaram | 877d7a4 | 2012-06-05 14:33:20 -0600 | [diff] [blame] | 3378 | msm_thermal_init(&msm_thermal_pdata); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3379 | if (socinfo_init() < 0) |
| 3380 | pr_err("socinfo_init() failed!\n"); |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 3381 | BUG_ON(msm_rpm_init(&apq8064_rpm_data)); |
| 3382 | BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data)); |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 3383 | regulator_suppress_info_printing(); |
David Collins | 793793b | 2012-08-21 15:43:02 -0700 | [diff] [blame] | 3384 | if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917) |
| 3385 | configure_apq8064_pm8917_power_grid(); |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 3386 | platform_device_register(&apq8064_device_rpm_regulator); |
David Collins | 793793b | 2012-08-21 15:43:02 -0700 | [diff] [blame] | 3387 | if (socinfo_get_pmic_model() != PMIC_MODEL_PM8917) |
| 3388 | platform_device_register(&apq8064_pm8921_device_rpm_regulator); |
Stephen Boyd | 4d0d258 | 2012-02-10 14:49:40 -0800 | [diff] [blame] | 3389 | if (msm_xo_init()) |
| 3390 | pr_err("Failed to initialize XO votes\n"); |
Matt Wagantall | c51e560 | 2012-02-27 17:25:25 -0800 | [diff] [blame] | 3391 | msm_clock_init(&apq8064_clock_init_data); |
Stepan Moskovchenko | 2327a95 | 2011-12-14 16:31:28 -0800 | [diff] [blame] | 3392 | apq8064_init_gpiomux(); |
Kenneth Heitke | 748593a | 2011-07-15 15:45:11 -0600 | [diff] [blame] | 3393 | apq8064_i2c_init(); |
Mohan Pallaka | b8aa828 | 2012-10-04 14:26:21 +0530 | [diff] [blame] | 3394 | |
| 3395 | /* configure sx150x parameters for HRD */ |
| 3396 | if (machine_is_mpq8064_hrd()) { |
| 3397 | mpq8064_sx150x_pdata[SX150X_EXP2].irq_summary = |
| 3398 | PM8921_GPIO_IRQ(PM8921_IRQ_BASE, 40); |
| 3399 | mpq8064_sx150x_pdata[SX150X_EXP2].io_pullup_ena = 0xff; |
| 3400 | mpq8064_sx150x_pdata[SX150X_EXP2].io_pulldn_ena = 0x00; |
| 3401 | } |
| 3402 | |
Jing Lin | 417fa45 | 2012-02-05 14:31:06 -0800 | [diff] [blame] | 3403 | register_i2c_devices(); |
Kenneth Heitke | 36920d3 | 2011-07-20 16:44:30 -0600 | [diff] [blame] | 3404 | |
Harini Jayaraman | c4c5869 | 2011-07-19 14:50:10 -0600 | [diff] [blame] | 3405 | apq8064_device_qup_spi_gsbi5.dev.platform_data = |
| 3406 | &apq8064_qup_spi_gsbi5_pdata; |
Stepan Moskovchenko | c1074f0 | 2011-12-14 17:51:57 -0800 | [diff] [blame] | 3407 | apq8064_init_pmic(); |
Hemant Kumar | 94e7da2 | 2012-02-03 16:52:29 -0800 | [diff] [blame] | 3408 | if (machine_is_apq8064_liquid()) |
| 3409 | msm_otg_pdata.mhl_enable = true; |
Vamsi Krishna | d9863eb | 2012-03-26 17:34:48 -0700 | [diff] [blame] | 3410 | |
Abhishek Kharbanda | 72dc72e | 2012-06-07 13:41:37 -0700 | [diff] [blame] | 3411 | if (apq8064_mhl_display_enabled()) |
| 3412 | mhl_platform_data.mhl_enabled = true; |
| 3413 | |
Ofir Cohen | 94213a7 | 2012-05-03 14:26:32 +0300 | [diff] [blame] | 3414 | android_usb_pdata.swfi_latency = |
| 3415 | msm_rpmrs_levels[0].latency_us; |
Vamsi Krishna | d9863eb | 2012-03-26 17:34:48 -0700 | [diff] [blame] | 3416 | |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 3417 | apq8064_device_otg.dev.platform_data = &msm_otg_pdata; |
Manu Gautam | 91223e0 | 2011-11-08 15:27:22 +0530 | [diff] [blame] | 3418 | apq8064_ehci_host_init(); |
Gagan Mac | 8a7a5d3 | 2011-11-11 16:43:06 -0700 | [diff] [blame] | 3419 | apq8064_init_buses(); |
David Collins | 793793b | 2012-08-21 15:43:02 -0700 | [diff] [blame] | 3420 | |
| 3421 | platform_add_devices(early_common_devices, |
| 3422 | ARRAY_SIZE(early_common_devices)); |
| 3423 | if (socinfo_get_pmic_model() != PMIC_MODEL_PM8917) |
| 3424 | platform_add_devices(pm8921_common_devices, |
| 3425 | ARRAY_SIZE(pm8921_common_devices)); |
| 3426 | else |
| 3427 | platform_add_devices(pm8917_common_devices, |
| 3428 | ARRAY_SIZE(pm8917_common_devices)); |
David Collins | 03c1637 | 2012-10-04 15:57:28 -0700 | [diff] [blame] | 3429 | if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid()) |
| 3430 | platform_device_register(&apq8064_device_ext_ts_sw_vreg); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3431 | platform_add_devices(common_devices, ARRAY_SIZE(common_devices)); |
Terence Hampson | 36b7072 | 2012-05-10 13:18:16 -0400 | [diff] [blame] | 3432 | if (!(machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() || |
| 3433 | machine_is_mpq8064_dtv())) |
| 3434 | platform_add_devices(common_not_mpq_devices, |
| 3435 | ARRAY_SIZE(common_not_mpq_devices)); |
Kuirong Wang | f8c5e14 | 2012-06-21 16:17:32 -0700 | [diff] [blame] | 3436 | |
| 3437 | if ((machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() || |
| 3438 | machine_is_mpq8064_dtv())) |
| 3439 | platform_add_devices(common_mpq_devices, |
| 3440 | ARRAY_SIZE(common_mpq_devices)); |
| 3441 | |
| 3442 | if (machine_is_apq8064_mtp()) { |
| 3443 | if (SOCINFO_VERSION_MINOR(platform_version) == 1) |
| 3444 | platform_add_devices(common_i2s_devices, |
| 3445 | ARRAY_SIZE(common_i2s_devices)); |
| 3446 | } |
| 3447 | |
Jay Chokshi | 994ff12 | 2012-03-27 15:43:48 -0700 | [diff] [blame] | 3448 | enable_ddr3_regulator(); |
Pavankumar Kondeti | 4f5dc3b | 2012-09-07 15:33:09 +0530 | [diff] [blame] | 3449 | msm_hsic_pdata.swfi_latency = |
| 3450 | msm_rpmrs_levels[0].latency_us; |
Hemant Kumar | f1ca919 | 2012-02-07 18:59:33 -0800 | [diff] [blame] | 3451 | if (machine_is_apq8064_mtp()) { |
Hemant Kumar | 30d361c | 2012-08-20 14:44:40 -0700 | [diff] [blame] | 3452 | msm_hsic_pdata.log2_irq_thresh = 5, |
Hemant Kumar | f1ca919 | 2012-02-07 18:59:33 -0800 | [diff] [blame] | 3453 | apq8064_device_hsic_host.dev.platform_data = &msm_hsic_pdata; |
| 3454 | device_initialize(&apq8064_device_hsic_host.dev); |
| 3455 | } |
Jay Chokshi | e874128 | 2012-01-25 15:22:55 -0800 | [diff] [blame] | 3456 | apq8064_pm8xxx_gpio_mpp_init(); |
Sahitya Tummala | 3586ed9 | 2011-08-03 09:13:23 +0530 | [diff] [blame] | 3457 | apq8064_init_mmc(); |
Swaminathan Sathappan | 144b488 | 2012-02-06 17:01:20 -0800 | [diff] [blame] | 3458 | |
| 3459 | if (machine_is_apq8064_mtp()) { |
| 3460 | mdm_8064_device.dev.platform_data = &mdm_platform_data; |
Ameya Thakur | e155ece | 2012-07-09 12:08:37 -0700 | [diff] [blame] | 3461 | if (SOCINFO_VERSION_MINOR(platform_version) == 1) { |
| 3462 | i2s_mdm_8064_device.dev.platform_data = |
| 3463 | &mdm_platform_data; |
| 3464 | platform_device_register(&i2s_mdm_8064_device); |
| 3465 | } else { |
| 3466 | mdm_8064_device.dev.platform_data = &mdm_platform_data; |
| 3467 | platform_device_register(&mdm_8064_device); |
| 3468 | } |
Swaminathan Sathappan | 144b488 | 2012-02-06 17:01:20 -0800 | [diff] [blame] | 3469 | } |
| 3470 | platform_device_register(&apq8064_slim_ctrl); |
Santosh Mardi | 344455a | 2012-09-07 13:22:16 +0530 | [diff] [blame] | 3471 | if (machine_is_mpq8064_hrd() || machine_is_mpq8064_dtv()) { |
| 3472 | apq8064_slim_devices[ARRAY_SIZE(apq8064_slim_devices) - 1].\ |
| 3473 | slim_slave = &mpq8064_slim_ashiko20; |
| 3474 | } |
Sagar Dharia | 8bdcdaf | 2011-09-16 16:01:15 -0600 | [diff] [blame] | 3475 | slim_register_board_info(apq8064_slim_devices, |
| 3476 | ARRAY_SIZE(apq8064_slim_devices)); |
Taniya Das | bbf633d | 2012-07-31 16:07:47 +0530 | [diff] [blame] | 3477 | if (!PLATFORM_IS_MPQ8064()) { |
Taniya Das | 30cae29 | 2012-07-31 15:56:12 +0530 | [diff] [blame] | 3478 | apq8064_init_dsps(); |
Taniya Das | bbf633d | 2012-07-31 16:07:47 +0530 | [diff] [blame] | 3479 | platform_device_register(&msm_8960_riva); |
| 3480 | } |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 3481 | msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data)); |
| 3482 | msm_spm_l2_init(msm_spm_l2_data); |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 3483 | BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata)); |
Siddartha Mohanadoss | b9df494 | 2012-02-08 09:58:21 -0800 | [diff] [blame] | 3484 | apq8064_epm_adc_init(); |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 3485 | msm_pm_set_tz_retention_flag(1); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3486 | } |
| 3487 | |
Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 3488 | static void __init apq8064_allocate_memory_regions(void) |
| 3489 | { |
| 3490 | apq8064_allocate_fb_region(); |
| 3491 | } |
| 3492 | |
Joel King | 82b7e3f | 2012-01-05 10:03:27 -0800 | [diff] [blame] | 3493 | static void __init apq8064_cdp_init(void) |
| 3494 | { |
Hanumant Singh | 50440d4 | 2012-04-23 19:27:16 -0700 | [diff] [blame] | 3495 | if (meminfo_init(SYS_MEMORY, SZ_256M) < 0) |
| 3496 | pr_err("meminfo_init() failed!\n"); |
Amy Maloche | 609bb5e | 2012-08-03 09:41:42 -0700 | [diff] [blame] | 3497 | if (machine_is_apq8064_mtp() && |
| 3498 | SOCINFO_VERSION_MINOR(socinfo_get_platform_version()) == 1) |
| 3499 | cyttsp_pdata.sleep_gpio = CYTTSP_TS_GPIO_SLEEP_ALT; |
Joel King | 82b7e3f | 2012-01-05 10:03:27 -0800 | [diff] [blame] | 3500 | apq8064_common_init(); |
Joel King | 8f839b9 | 2012-04-01 14:37:46 -0700 | [diff] [blame] | 3501 | if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() || |
| 3502 | machine_is_mpq8064_dtv()) { |
Ravi Kumar V | 16a614c | 2012-10-12 20:59:56 +0530 | [diff] [blame] | 3503 | gpio_ir_recv_pdata.swfi_latency = |
| 3504 | msm_rpmrs_levels[0].latency_us; |
Jay Chokshi | e7d8d4f | 2012-04-04 14:47:57 -0700 | [diff] [blame] | 3505 | enable_avc_i2c_bus(); |
Olav Haugan | ef95ae3 | 2012-05-15 09:50:30 -0700 | [diff] [blame] | 3506 | msm_rotator_set_split_iommu_domain(); |
Bar Weiner | f82c587 | 2012-10-23 14:31:26 +0200 | [diff] [blame] | 3507 | |
| 3508 | mpq8064_device_qup_spi_gsbi6.dev.platform_data = |
| 3509 | &mpq8064_qup_spi_gsbi6_pdata; |
| 3510 | |
Joel King | 8f839b9 | 2012-04-01 14:37:46 -0700 | [diff] [blame] | 3511 | platform_add_devices(mpq_devices, ARRAY_SIZE(mpq_devices)); |
Niranjana Vishwanathapura | 06f8933 | 2012-05-03 17:11:13 -0600 | [diff] [blame] | 3512 | mpq8064_pcie_init(); |
Bar Weiner | f82c587 | 2012-10-23 14:31:26 +0200 | [diff] [blame] | 3513 | spi_register_board_info(mpq8064_spi_board_info, |
| 3514 | ARRAY_SIZE(mpq8064_spi_board_info)); |
Joel King | 8f839b9 | 2012-04-01 14:37:46 -0700 | [diff] [blame] | 3515 | } else { |
| 3516 | ethernet_init(); |
Olav Haugan | ef95ae3 | 2012-05-15 09:50:30 -0700 | [diff] [blame] | 3517 | msm_rotator_set_split_iommu_domain(); |
Joel King | 8f839b9 | 2012-04-01 14:37:46 -0700 | [diff] [blame] | 3518 | platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices)); |
| 3519 | spi_register_board_info(spi_board_info, |
| 3520 | ARRAY_SIZE(spi_board_info)); |
| 3521 | } |
Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 3522 | apq8064_init_fb(); |
Jordan Crouse | b3115fe | 2012-02-01 22:11:12 -0700 | [diff] [blame] | 3523 | apq8064_init_gpu(); |
Matt Wagantall | 1f65d9d | 2012-04-25 14:24:20 -0700 | [diff] [blame] | 3524 | platform_add_devices(apq8064_footswitch, apq8064_num_footswitch); |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 3525 | #ifdef CONFIG_MSM_CAMERA |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 3526 | apq8064_init_cam(); |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 3527 | #endif |
Mohan Pallaka | 474b94b | 2012-01-25 12:59:58 +0530 | [diff] [blame] | 3528 | |
Mayank Rana | 262e903 | 2012-05-10 15:14:00 -0700 | [diff] [blame] | 3529 | if (machine_is_mpq8064_hrd() || machine_is_mpq8064_dtv()) { |
| 3530 | platform_device_register(&mpq8064_device_uartdm_gsbi6); |
| 3531 | #ifdef CONFIG_SERIAL_MSM_HS |
| 3532 | /* GSBI6(2) - UARTDM_RX */ |
| 3533 | mpq8064_gsbi6_uartdm_pdata.wakeup_irq = gpio_to_irq(15); |
| 3534 | mpq8064_device_uartdm_gsbi6.dev.platform_data = |
| 3535 | &mpq8064_gsbi6_uartdm_pdata; |
| 3536 | #endif |
| 3537 | } |
| 3538 | |
Ankit Verma | 6fe41b0 | 2012-09-13 16:12:11 +0530 | [diff] [blame] | 3539 | #if defined(CONFIG_BT) && defined(CONFIG_MARIMBA_CORE) |
| 3540 | if (machine_is_mpq8064_hrd()) |
| 3541 | apq8064_bt_power_init(); |
| 3542 | #endif |
| 3543 | |
Mohan Pallaka | 474b94b | 2012-01-25 12:59:58 +0530 | [diff] [blame] | 3544 | if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid()) |
| 3545 | platform_device_register(&cdp_kp_pdev); |
| 3546 | |
| 3547 | if (machine_is_apq8064_mtp()) |
| 3548 | platform_device_register(&mtp_kp_pdev); |
Hanumant Singh | 50440d4 | 2012-04-23 19:27:16 -0700 | [diff] [blame] | 3549 | |
| 3550 | change_memory_power = &apq8064_change_memory_power; |
Anirudh Ghayal | 32ea625 | 2012-04-26 16:39:50 +0530 | [diff] [blame] | 3551 | |
| 3552 | if (machine_is_mpq8064_cdp()) { |
| 3553 | platform_device_register(&mpq_gpio_keys_pdev); |
| 3554 | platform_device_register(&mpq_keypad_device); |
Mohan Pallaka | b8aa828 | 2012-10-04 14:26:21 +0530 | [diff] [blame] | 3555 | } else if (machine_is_mpq8064_hrd()) |
| 3556 | platform_device_register(&mpq_hrd_keys_pdev); |
Joel King | 82b7e3f | 2012-01-05 10:03:27 -0800 | [diff] [blame] | 3557 | } |
| 3558 | |
Joel King | 82b7e3f | 2012-01-05 10:03:27 -0800 | [diff] [blame] | 3559 | MACHINE_START(APQ8064_CDP, "QCT APQ8064 CDP") |
| 3560 | .map_io = apq8064_map_io, |
| 3561 | .reserve = apq8064_reserve, |
| 3562 | .init_irq = apq8064_init_irq, |
| 3563 | .handle_irq = gic_handle_irq, |
| 3564 | .timer = &msm_timer, |
| 3565 | .init_machine = apq8064_cdp_init, |
Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 3566 | .init_early = apq8064_allocate_memory_regions, |
Laura Abbott | 6988cef | 2012-03-15 14:27:13 -0700 | [diff] [blame] | 3567 | .init_very_early = apq8064_early_reserve, |
Jeff Ohlstein | dd0dd9b | 2012-05-29 17:47:21 -0700 | [diff] [blame] | 3568 | .restart = msm_restart, |
Joel King | 82b7e3f | 2012-01-05 10:03:27 -0800 | [diff] [blame] | 3569 | MACHINE_END |
| 3570 | |
| 3571 | MACHINE_START(APQ8064_MTP, "QCT APQ8064 MTP") |
| 3572 | .map_io = apq8064_map_io, |
| 3573 | .reserve = apq8064_reserve, |
| 3574 | .init_irq = apq8064_init_irq, |
| 3575 | .handle_irq = gic_handle_irq, |
| 3576 | .timer = &msm_timer, |
| 3577 | .init_machine = apq8064_cdp_init, |
Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 3578 | .init_early = apq8064_allocate_memory_regions, |
Laura Abbott | 6988cef | 2012-03-15 14:27:13 -0700 | [diff] [blame] | 3579 | .init_very_early = apq8064_early_reserve, |
Jeff Ohlstein | dd0dd9b | 2012-05-29 17:47:21 -0700 | [diff] [blame] | 3580 | .restart = msm_restart, |
Joel King | 82b7e3f | 2012-01-05 10:03:27 -0800 | [diff] [blame] | 3581 | MACHINE_END |
| 3582 | |
| 3583 | MACHINE_START(APQ8064_LIQUID, "QCT APQ8064 LIQUID") |
| 3584 | .map_io = apq8064_map_io, |
| 3585 | .reserve = apq8064_reserve, |
| 3586 | .init_irq = apq8064_init_irq, |
| 3587 | .handle_irq = gic_handle_irq, |
| 3588 | .timer = &msm_timer, |
| 3589 | .init_machine = apq8064_cdp_init, |
Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 3590 | .init_early = apq8064_allocate_memory_regions, |
Laura Abbott | 6988cef | 2012-03-15 14:27:13 -0700 | [diff] [blame] | 3591 | .init_very_early = apq8064_early_reserve, |
Jeff Ohlstein | dd0dd9b | 2012-05-29 17:47:21 -0700 | [diff] [blame] | 3592 | .restart = msm_restart, |
Joel King | 82b7e3f | 2012-01-05 10:03:27 -0800 | [diff] [blame] | 3593 | MACHINE_END |
| 3594 | |
Joel King | 064bbf8 | 2012-04-01 13:23:39 -0700 | [diff] [blame] | 3595 | MACHINE_START(MPQ8064_CDP, "QCT MPQ8064 CDP") |
| 3596 | .map_io = apq8064_map_io, |
| 3597 | .reserve = apq8064_reserve, |
| 3598 | .init_irq = apq8064_init_irq, |
| 3599 | .handle_irq = gic_handle_irq, |
| 3600 | .timer = &msm_timer, |
| 3601 | .init_machine = apq8064_cdp_init, |
| 3602 | .init_early = apq8064_allocate_memory_regions, |
| 3603 | .init_very_early = apq8064_early_reserve, |
Jeff Ohlstein | dd0dd9b | 2012-05-29 17:47:21 -0700 | [diff] [blame] | 3604 | .restart = msm_restart, |
Joel King | 064bbf8 | 2012-04-01 13:23:39 -0700 | [diff] [blame] | 3605 | MACHINE_END |
| 3606 | |
Joel King | 11ca820 | 2012-02-13 16:19:03 -0800 | [diff] [blame] | 3607 | MACHINE_START(MPQ8064_HRD, "QCT MPQ8064 HRD") |
| 3608 | .map_io = apq8064_map_io, |
| 3609 | .reserve = apq8064_reserve, |
| 3610 | .init_irq = apq8064_init_irq, |
| 3611 | .handle_irq = gic_handle_irq, |
| 3612 | .timer = &msm_timer, |
| 3613 | .init_machine = apq8064_cdp_init, |
Joel King | 3a57e77 | 2012-05-28 11:22:55 -0700 | [diff] [blame] | 3614 | .init_early = apq8064_allocate_memory_regions, |
Laura Abbott | 6988cef | 2012-03-15 14:27:13 -0700 | [diff] [blame] | 3615 | .init_very_early = apq8064_early_reserve, |
Jeff Ohlstein | dd0dd9b | 2012-05-29 17:47:21 -0700 | [diff] [blame] | 3616 | .restart = msm_restart, |
Joel King | 11ca820 | 2012-02-13 16:19:03 -0800 | [diff] [blame] | 3617 | MACHINE_END |
| 3618 | |
| 3619 | MACHINE_START(MPQ8064_DTV, "QCT MPQ8064 DTV") |
| 3620 | .map_io = apq8064_map_io, |
| 3621 | .reserve = apq8064_reserve, |
| 3622 | .init_irq = apq8064_init_irq, |
| 3623 | .handle_irq = gic_handle_irq, |
| 3624 | .timer = &msm_timer, |
| 3625 | .init_machine = apq8064_cdp_init, |
Joel King | 3a57e77 | 2012-05-28 11:22:55 -0700 | [diff] [blame] | 3626 | .init_early = apq8064_allocate_memory_regions, |
Laura Abbott | 6988cef | 2012-03-15 14:27:13 -0700 | [diff] [blame] | 3627 | .init_very_early = apq8064_early_reserve, |
Jeff Ohlstein | dd0dd9b | 2012-05-29 17:47:21 -0700 | [diff] [blame] | 3628 | .restart = msm_restart, |
Joel King | 11ca820 | 2012-02-13 16:19:03 -0800 | [diff] [blame] | 3629 | MACHINE_END |