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