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