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