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