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