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