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