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