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