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