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