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