blob: 0e05407104a1d150568d3a8ef6baf2e67a047c19 [file] [log] [blame]
Manu Gautam5143b252012-01-05 19:25:23 -08001/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13#include <linux/kernel.h>
Niranjana Vishwanathapurac1edd402012-06-28 15:32:50 -060014#include <linux/bitops.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070015#include <linux/platform_device.h>
Steve Mucklef132c6c2012-06-06 18:30:57 -070016#include <linux/gpio.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070017#include <linux/io.h>
18#include <linux/irq.h>
Kenneth Heitke748593a2011-07-15 15:45:11 -060019#include <linux/i2c.h>
David Keitel2f613d92012-02-15 11:29:16 -080020#include <linux/i2c/smb349.h>
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -080021#include <linux/i2c/sx150x.h>
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -060022#include <linux/slimbus/slimbus.h>
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +053023#include <linux/mfd/wcd9xxx/core.h>
24#include <linux/mfd/wcd9xxx/pdata.h>
Amy Maloche70090f992012-02-16 16:35:26 -080025#include <linux/mfd/pm8xxx/misc.h>
Kenneth Heitke36920d32011-07-20 16:44:30 -060026#include <linux/msm_ssbi.h>
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -070027#include <linux/spi/spi.h>
Ramesh Masavarapu28311912011-10-27 11:04:12 -070028#include <linux/dma-mapping.h>
29#include <linux/platform_data/qcom_crypto_device.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080030#include <linux/ion.h>
Jack Cheung46bfffa2012-01-19 15:26:24 -080031#include <linux/memory.h>
Larry Bassel67b921d2012-04-06 10:23:27 -070032#include <linux/memblock.h>
Praveen Chidambaram877d7a42012-06-05 14:33:20 -060033#include <linux/msm_thermal.h>
Jing Lin21ed4de2012-02-05 15:53:28 -080034#include <linux/i2c/atmel_mxt_ts.h>
Steve Mucklef132c6c2012-06-06 18:30:57 -070035#include <linux/cyttsp-qc.h>
Amy Maloche70090f992012-02-16 16:35:26 -080036#include <linux/i2c/isa1200.h>
Mohan Pallaka474b94b2012-01-25 12:59:58 +053037#include <linux/gpio_keys.h>
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -080038#include <linux/epm_adc.h>
Jay Chokshie7d8d4f2012-04-04 14:47:57 -070039#include <linux/i2c/sx150x.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070040#include <asm/mach-types.h>
41#include <asm/mach/arch.h>
42#include <asm/hardware/gic.h>
Sahitya Tummala3586ed92011-08-03 09:13:23 +053043#include <asm/mach/mmc.h>
Ankit Verma6b7e2ba2012-01-26 15:48:54 -080044#include <linux/platform_data/qcom_wcnss_device.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070045
46#include <mach/board.h>
47#include <mach/msm_iomap.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080048#include <mach/ion.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070049#include <linux/usb/msm_hsusb.h>
50#include <linux/usb/android.h>
51#include <mach/socinfo.h>
Harini Jayaramanc4c58692011-07-19 14:50:10 -060052#include <mach/msm_spi.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070053#include "timer.h"
54#include "devices.h"
Joel King4ebccc62011-07-22 09:43:22 -070055#include <mach/gpiomux.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060056#include <mach/rpm.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080057#ifdef CONFIG_ANDROID_PMEM
Kevin Chan13be4e22011-10-20 11:30:32 -070058#include <linux/android_pmem.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080059#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070060#include <mach/msm_memtypes.h>
61#include <linux/bootmem.h>
62#include <asm/setup.h>
Ramesh Masavarapu28311912011-10-27 11:04:12 -070063#include <mach/dma.h>
Jin Hongd3024e62012-02-09 16:13:32 -080064#include <mach/msm_dsps.h>
Gagan Mac8a7a5d32011-11-11 16:43:06 -070065#include <mach/msm_bus_board.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060066#include <mach/cpuidle.h>
Joel Kingdacbc822012-01-25 13:30:57 -080067#include <mach/mdm2.h>
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -080068#include <linux/msm_tsens.h>
Stephen Boyd4d0d2582012-02-10 14:49:40 -080069#include <mach/msm_xo.h>
Laura Abbott350c8362012-02-28 14:46:52 -080070#include <mach/msm_rtb.h>
Santosh Mardieff9a742012-04-09 23:23:39 +053071#include <sound/cs8427.h>
Ravi Kumar V05931a22012-04-04 17:09:37 +053072#include <media/gpio-ir-recv.h>
Larry Bassel67b921d2012-04-06 10:23:27 -070073#include <linux/fmem.h>
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -060074#include <mach/msm_pcie.h>
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -070075#include <mach/restart.h>
Niranjana Vishwanathapurac1edd402012-06-28 15:32:50 -060076#include <mach/msm_iomap.h>
Joel King4ebccc62011-07-22 09:43:22 -070077
Jeff Ohlstein7e668552011-10-06 16:17:25 -070078#include "msm_watchdog.h"
Stepan Moskovchenko5a83dba2011-12-05 17:30:17 -080079#include "board-8064.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060080#include "spm.h"
Subhash Jadavani909e04f2012-04-12 10:52:50 +053081#include <mach/mpm.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060082#include "rpm_resources.h"
Matt Wagantall7cca4642012-02-01 16:43:24 -080083#include "pm.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060084#include "pm-boot.h"
Rajesh Sastrulaaee8af32012-01-20 11:46:31 -080085#include "devices-msm8x60.h"
Hanumant Singh50440d42012-04-23 19:27:16 -070086#include "smd_private.h"
Jay Chokshiea67c622011-07-29 17:12:26 -070087
Olav Haugan7c6aa742012-01-16 16:47:37 -080088#define MSM_PMEM_ADSP_SIZE 0x7800000
Bharath Ramachandramurthy2fd017a2012-03-13 10:21:09 -070089#define MSM_PMEM_AUDIO_SIZE 0x4CF000
Olav Haugan7c6aa742012-01-16 16:47:37 -080090#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
91#define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
92#else
Chetan Kalyan72aac4f2012-02-23 14:56:54 -080093#define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
Olav Haugan7c6aa742012-01-16 16:47:37 -080094#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070095
Olav Haugan7c6aa742012-01-16 16:47:37 -080096#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Hanumant Singheadb7502012-05-15 18:14:04 -070097#define HOLE_SIZE 0x20000
Mitchel Humpherys05e58812012-08-13 14:24:13 -070098#define MSM_CONTIG_MEM_SIZE 0x65000
Olav Haugan129992c2012-03-22 09:54:01 -070099#ifdef CONFIG_MSM_IOMMU
100#define MSM_ION_MM_SIZE 0x3800000
101#define MSM_ION_SF_SIZE 0
Olav Haugan39477bb2012-05-14 16:05:36 -0700102#define MSM_ION_QSECOM_SIZE 0x780000 /* (7.5MB) */
Olav Haugan129992c2012-03-22 09:54:01 -0700103#define MSM_ION_HEAP_NUM 7
104#else
Olav Haugan7c6aa742012-01-16 16:47:37 -0800105#define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE
Olav Haugan129992c2012-03-22 09:54:01 -0700106#define MSM_ION_SF_SIZE MSM_PMEM_SIZE
Olav Haugan39477bb2012-05-14 16:05:36 -0700107#define MSM_ION_QSECOM_SIZE 0x600000 /* (6MB) */
Olav Haugan129992c2012-03-22 09:54:01 -0700108#define MSM_ION_HEAP_NUM 8
109#endif
Hanumant Singheadb7502012-05-15 18:14:04 -0700110#define MSM_ION_MM_FW_SIZE (0x200000 - HOLE_SIZE) /* (2MB - 128KB) */
Olav Haugan7c6aa742012-01-16 16:47:37 -0800111#define MSM_ION_MFC_SIZE SZ_8K
Olav Haugan2c43fac2012-01-19 11:06:37 -0800112#define MSM_ION_AUDIO_SIZE MSM_PMEM_AUDIO_SIZE
Olav Haugan7c6aa742012-01-16 16:47:37 -0800113#else
Mitchel Humpherys05e58812012-08-13 14:24:13 -0700114#define MSM_CONTIG_MEM_SIZE 0x110C000
Olav Haugan7c6aa742012-01-16 16:47:37 -0800115#define MSM_ION_HEAP_NUM 1
116#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700117
Hanumant Singheadb7502012-05-15 18:14:04 -0700118#define APQ8064_FIXED_AREA_START (0xa0000000 - (MSM_ION_MM_FW_SIZE + \
119 HOLE_SIZE))
Larry Bassel67b921d2012-04-06 10:23:27 -0700120#define MAX_FIXED_AREA_SIZE 0x10000000
Hanumant Singheadb7502012-05-15 18:14:04 -0700121#define MSM_MM_FW_SIZE (0x200000 - HOLE_SIZE)
122#define APQ8064_FW_START APQ8064_FIXED_AREA_START
Larry Bassel67b921d2012-04-06 10:23:27 -0700123
Niranjana Vishwanathapurac1edd402012-06-28 15:32:50 -0600124#define QFPROM_RAW_FEAT_CONFIG_ROW0_MSB (MSM_QFPROM_BASE + 0x23c)
125#define QFPROM_RAW_OEM_CONFIG_ROW0_LSB (MSM_QFPROM_BASE + 0x220)
126
Niranjana Vishwanathapura68210ff2012-06-24 18:03:49 -0600127/* PCIE AXI address space */
128#define PCIE_AXI_BAR_PHYS 0x08000000
129#define PCIE_AXI_BAR_SIZE SZ_128M
130
Niranjana Vishwanathapura459a27d2012-07-20 12:23:55 -0600131/* PCIe pmic gpios */
132#define PCIE_WAKE_N_PMIC_GPIO 12
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -0600133#define PCIE_PWR_EN_PMIC_GPIO 13
134#define PCIE_RST_N_PMIC_MPP 1
135
Mitchel Humpherys05e58812012-08-13 14:24:13 -0700136#ifdef CONFIG_KERNEL_MSM_CONTIG_MEM_REGION
137static unsigned msm_contig_mem_size = MSM_CONTIG_MEM_SIZE;
138static int __init msm_contig_mem_size_setup(char *p)
Kevin Chan13be4e22011-10-20 11:30:32 -0700139{
Mitchel Humpherys05e58812012-08-13 14:24:13 -0700140 msm_contig_mem_size = memparse(p, NULL);
Olav Haugan7c6aa742012-01-16 16:47:37 -0800141 return 0;
Kevin Chan13be4e22011-10-20 11:30:32 -0700142}
Mitchel Humpherys05e58812012-08-13 14:24:13 -0700143early_param("msm_contig_mem_size", msm_contig_mem_size_setup);
Olav Haugan7c6aa742012-01-16 16:47:37 -0800144#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700145
Olav Haugan7c6aa742012-01-16 16:47:37 -0800146#ifdef CONFIG_ANDROID_PMEM
Kevin Chan13be4e22011-10-20 11:30:32 -0700147static unsigned pmem_size = MSM_PMEM_SIZE;
148static int __init pmem_size_setup(char *p)
149{
150 pmem_size = memparse(p, NULL);
151 return 0;
152}
153early_param("pmem_size", pmem_size_setup);
154
155static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
156
157static int __init pmem_adsp_size_setup(char *p)
158{
159 pmem_adsp_size = memparse(p, NULL);
160 return 0;
161}
162early_param("pmem_adsp_size", pmem_adsp_size_setup);
163
164static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
165
166static int __init pmem_audio_size_setup(char *p)
167{
168 pmem_audio_size = memparse(p, NULL);
169 return 0;
170}
171early_param("pmem_audio_size", pmem_audio_size_setup);
Olav Haugan7c6aa742012-01-16 16:47:37 -0800172#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700173
Olav Haugan7c6aa742012-01-16 16:47:37 -0800174#ifdef CONFIG_ANDROID_PMEM
175#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700176static struct android_pmem_platform_data android_pmem_pdata = {
177 .name = "pmem",
178 .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING,
179 .cached = 1,
180 .memory_type = MEMTYPE_EBI1,
181};
182
Laura Abbottb93525f2012-04-12 09:57:19 -0700183static struct platform_device apq8064_android_pmem_device = {
Kevin Chan13be4e22011-10-20 11:30:32 -0700184 .name = "android_pmem",
185 .id = 0,
186 .dev = {.platform_data = &android_pmem_pdata},
187};
188
189static struct android_pmem_platform_data android_pmem_adsp_pdata = {
190 .name = "pmem_adsp",
191 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
192 .cached = 0,
193 .memory_type = MEMTYPE_EBI1,
194};
Laura Abbottb93525f2012-04-12 09:57:19 -0700195static struct platform_device apq8064_android_pmem_adsp_device = {
Kevin Chan13be4e22011-10-20 11:30:32 -0700196 .name = "android_pmem",
197 .id = 2,
198 .dev = { .platform_data = &android_pmem_adsp_pdata },
199};
200
201static struct android_pmem_platform_data android_pmem_audio_pdata = {
202 .name = "pmem_audio",
203 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
204 .cached = 0,
205 .memory_type = MEMTYPE_EBI1,
206};
207
Laura Abbottb93525f2012-04-12 09:57:19 -0700208static struct platform_device apq8064_android_pmem_audio_device = {
Kevin Chan13be4e22011-10-20 11:30:32 -0700209 .name = "android_pmem",
210 .id = 4,
211 .dev = { .platform_data = &android_pmem_audio_pdata },
212};
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700213#endif /* CONFIG_MSM_MULTIMEDIA_USE_ION */
214#endif /* CONFIG_ANDROID_PMEM */
Olav Haugan7c6aa742012-01-16 16:47:37 -0800215
Larry Bassel67b921d2012-04-06 10:23:27 -0700216struct fmem_platform_data apq8064_fmem_pdata = {
217};
218
Olav Haugan7c6aa742012-01-16 16:47:37 -0800219static struct memtype_reserve apq8064_reserve_table[] __initdata = {
220 [MEMTYPE_SMI] = {
221 },
222 [MEMTYPE_EBI0] = {
223 .flags = MEMTYPE_FLAGS_1M_ALIGN,
224 },
225 [MEMTYPE_EBI1] = {
226 .flags = MEMTYPE_FLAGS_1M_ALIGN,
227 },
228};
Kevin Chan13be4e22011-10-20 11:30:32 -0700229
Laura Abbott350c8362012-02-28 14:46:52 -0800230static void __init reserve_rtb_memory(void)
231{
232#if defined(CONFIG_MSM_RTB)
Laura Abbottb93525f2012-04-12 09:57:19 -0700233 apq8064_reserve_table[MEMTYPE_EBI1].size += apq8064_rtb_pdata.size;
Laura Abbott350c8362012-02-28 14:46:52 -0800234#endif
235}
236
237
Kevin Chan13be4e22011-10-20 11:30:32 -0700238static void __init size_pmem_devices(void)
239{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800240#ifdef CONFIG_ANDROID_PMEM
241#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700242 android_pmem_adsp_pdata.size = pmem_adsp_size;
243 android_pmem_pdata.size = pmem_size;
244 android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE;
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700245#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
246#endif /*CONFIG_ANDROID_PMEM*/
Kevin Chan13be4e22011-10-20 11:30:32 -0700247}
248
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700249#ifdef CONFIG_ANDROID_PMEM
250#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700251static void __init reserve_memory_for(struct android_pmem_platform_data *p)
252{
253 apq8064_reserve_table[p->memory_type].size += p->size;
254}
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700255#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
256#endif /*CONFIG_ANDROID_PMEM*/
Kevin Chan13be4e22011-10-20 11:30:32 -0700257
Kevin Chan13be4e22011-10-20 11:30:32 -0700258static void __init reserve_pmem_memory(void)
259{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800260#ifdef CONFIG_ANDROID_PMEM
261#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700262 reserve_memory_for(&android_pmem_adsp_pdata);
263 reserve_memory_for(&android_pmem_pdata);
264 reserve_memory_for(&android_pmem_audio_pdata);
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700265#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
Mitchel Humpherys05e58812012-08-13 14:24:13 -0700266 apq8064_reserve_table[MEMTYPE_EBI1].size += msm_contig_mem_size;
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700267#endif /*CONFIG_ANDROID_PMEM*/
Olav Haugan7c6aa742012-01-16 16:47:37 -0800268}
269
270static int apq8064_paddr_to_memtype(unsigned int paddr)
271{
272 return MEMTYPE_EBI1;
273}
274
Steve Mucklef132c6c2012-06-06 18:30:57 -0700275#define FMEM_ENABLED 0
Larry Bassel67b921d2012-04-06 10:23:27 -0700276
Olav Haugan7c6aa742012-01-16 16:47:37 -0800277#ifdef CONFIG_ION_MSM
278#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Laura Abbottb93525f2012-04-12 09:57:19 -0700279static struct ion_cp_heap_pdata cp_mm_apq8064_ion_pdata = {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800280 .permission_type = IPT_TYPE_MM_CARVEOUT,
Olav Haugand3d29682012-01-19 10:57:07 -0800281 .align = PAGE_SIZE,
Larry Bassel67b921d2012-04-06 10:23:27 -0700282 .reusable = FMEM_ENABLED,
283 .mem_is_fmem = FMEM_ENABLED,
284 .fixed_position = FIXED_MIDDLE,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800285};
286
Laura Abbottb93525f2012-04-12 09:57:19 -0700287static struct ion_cp_heap_pdata cp_mfc_apq8064_ion_pdata = {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800288 .permission_type = IPT_TYPE_MFC_SHAREDMEM,
Olav Haugand3d29682012-01-19 10:57:07 -0800289 .align = PAGE_SIZE,
Larry Bassel67b921d2012-04-06 10:23:27 -0700290 .reusable = 0,
291 .mem_is_fmem = FMEM_ENABLED,
292 .fixed_position = FIXED_HIGH,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800293};
294
Laura Abbottb93525f2012-04-12 09:57:19 -0700295static struct ion_co_heap_pdata co_apq8064_ion_pdata = {
Olav Haugand3d29682012-01-19 10:57:07 -0800296 .adjacent_mem_id = INVALID_HEAP_ID,
297 .align = PAGE_SIZE,
Larry Bassel67b921d2012-04-06 10:23:27 -0700298 .mem_is_fmem = 0,
Olav Haugand3d29682012-01-19 10:57:07 -0800299};
300
Laura Abbottb93525f2012-04-12 09:57:19 -0700301static struct ion_co_heap_pdata fw_co_apq8064_ion_pdata = {
Olav Haugand3d29682012-01-19 10:57:07 -0800302 .adjacent_mem_id = ION_CP_MM_HEAP_ID,
303 .align = SZ_128K,
Larry Bassel67b921d2012-04-06 10:23:27 -0700304 .mem_is_fmem = FMEM_ENABLED,
305 .fixed_position = FIXED_LOW,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800306};
307#endif
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800308
309/**
310 * These heaps are listed in the order they will be allocated. Due to
311 * video hardware restrictions and content protection the FW heap has to
312 * be allocated adjacent (below) the MM heap and the MFC heap has to be
313 * allocated after the MM heap to ensure MFC heap is not more than 256MB
314 * away from the base address of the FW heap.
315 * However, the order of FW heap and MM heap doesn't matter since these
316 * two heaps are taken care of by separate code to ensure they are adjacent
317 * to each other.
318 * Don't swap the order unless you know what you are doing!
319 */
Laura Abbottb93525f2012-04-12 09:57:19 -0700320static struct ion_platform_data apq8064_ion_pdata = {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800321 .nr = MSM_ION_HEAP_NUM,
322 .heaps = {
323 {
324 .id = ION_SYSTEM_HEAP_ID,
325 .type = ION_HEAP_TYPE_SYSTEM,
326 .name = ION_VMALLOC_HEAP_NAME,
327 },
328#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
329 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800330 .id = ION_CP_MM_HEAP_ID,
331 .type = ION_HEAP_TYPE_CP,
332 .name = ION_MM_HEAP_NAME,
333 .size = MSM_ION_MM_SIZE,
334 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700335 .extra_data = (void *) &cp_mm_apq8064_ion_pdata,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800336 },
337 {
Olav Haugand3d29682012-01-19 10:57:07 -0800338 .id = ION_MM_FIRMWARE_HEAP_ID,
339 .type = ION_HEAP_TYPE_CARVEOUT,
340 .name = ION_MM_FIRMWARE_HEAP_NAME,
341 .size = MSM_ION_MM_FW_SIZE,
342 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700343 .extra_data = (void *) &fw_co_apq8064_ion_pdata,
Olav Haugand3d29682012-01-19 10:57:07 -0800344 },
345 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800346 .id = ION_CP_MFC_HEAP_ID,
347 .type = ION_HEAP_TYPE_CP,
348 .name = ION_MFC_HEAP_NAME,
349 .size = MSM_ION_MFC_SIZE,
350 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700351 .extra_data = (void *) &cp_mfc_apq8064_ion_pdata,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800352 },
Olav Haugan129992c2012-03-22 09:54:01 -0700353#ifndef CONFIG_MSM_IOMMU
Olav Haugan7c6aa742012-01-16 16:47:37 -0800354 {
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800355 .id = ION_SF_HEAP_ID,
356 .type = ION_HEAP_TYPE_CARVEOUT,
357 .name = ION_SF_HEAP_NAME,
358 .size = MSM_ION_SF_SIZE,
359 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700360 .extra_data = (void *) &co_apq8064_ion_pdata,
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800361 },
Olav Haugan129992c2012-03-22 09:54:01 -0700362#endif
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800363 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800364 .id = ION_IOMMU_HEAP_ID,
365 .type = ION_HEAP_TYPE_IOMMU,
366 .name = ION_IOMMU_HEAP_NAME,
367 },
Olav Hauganf45e2142012-01-19 11:01:01 -0800368 {
369 .id = ION_QSECOM_HEAP_ID,
370 .type = ION_HEAP_TYPE_CARVEOUT,
371 .name = ION_QSECOM_HEAP_NAME,
372 .size = MSM_ION_QSECOM_SIZE,
373 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700374 .extra_data = (void *) &co_apq8064_ion_pdata,
Olav Hauganf45e2142012-01-19 11:01:01 -0800375 },
Olav Haugan2c43fac2012-01-19 11:06:37 -0800376 {
377 .id = ION_AUDIO_HEAP_ID,
378 .type = ION_HEAP_TYPE_CARVEOUT,
379 .name = ION_AUDIO_HEAP_NAME,
380 .size = MSM_ION_AUDIO_SIZE,
381 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700382 .extra_data = (void *) &co_apq8064_ion_pdata,
Olav Haugan2c43fac2012-01-19 11:06:37 -0800383 },
Olav Haugan7c6aa742012-01-16 16:47:37 -0800384#endif
385 }
386};
387
Laura Abbottb93525f2012-04-12 09:57:19 -0700388static struct platform_device apq8064_ion_dev = {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800389 .name = "ion-msm",
390 .id = 1,
Laura Abbottb93525f2012-04-12 09:57:19 -0700391 .dev = { .platform_data = &apq8064_ion_pdata },
Olav Haugan7c6aa742012-01-16 16:47:37 -0800392};
393#endif
394
Larry Bassel67b921d2012-04-06 10:23:27 -0700395static struct platform_device apq8064_fmem_device = {
396 .name = "fmem",
397 .id = 1,
398 .dev = { .platform_data = &apq8064_fmem_pdata },
399};
400
401static void __init reserve_mem_for_ion(enum ion_memory_types mem_type,
402 unsigned long size)
403{
404 apq8064_reserve_table[mem_type].size += size;
405}
406
407static void __init apq8064_reserve_fixed_area(unsigned long fixed_area_size)
408{
409#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
410 int ret;
411
412 if (fixed_area_size > MAX_FIXED_AREA_SIZE)
413 panic("fixed area size is larger than %dM\n",
414 MAX_FIXED_AREA_SIZE >> 20);
415
416 reserve_info->fixed_area_size = fixed_area_size;
417 reserve_info->fixed_area_start = APQ8064_FW_START;
418
419 ret = memblock_remove(reserve_info->fixed_area_start,
420 reserve_info->fixed_area_size);
421 BUG_ON(ret);
422#endif
423}
424
425/**
426 * Reserve memory for ION and calculate amount of reusable memory for fmem.
427 * We only reserve memory for heaps that are not reusable. However, we only
428 * support one reusable heap at the moment so we ignore the reusable flag for
429 * other than the first heap with reusable flag set. Also handle special case
430 * for video heaps (MM,FW, and MFC). Video requires heaps MM and MFC to be
431 * at a higher address than FW in addition to not more than 256MB away from the
432 * base address of the firmware. This means that if MM is reusable the other
433 * two heaps must be allocated in the same region as FW. This is handled by the
434 * mem_is_fmem flag in the platform data. In addition the MM heap must be
435 * adjacent to the FW heap for content protection purposes.
436 */
Stephen Boyd668d7652012-04-25 11:31:01 -0700437static void __init reserve_ion_memory(void)
Olav Haugan7c6aa742012-01-16 16:47:37 -0800438{
439#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
Larry Bassel67b921d2012-04-06 10:23:27 -0700440 unsigned int i;
441 unsigned int reusable_count = 0;
442 unsigned int fixed_size = 0;
443 unsigned int fixed_low_size, fixed_middle_size, fixed_high_size;
444 unsigned long fixed_low_start, fixed_middle_start, fixed_high_start;
445
446 apq8064_fmem_pdata.size = 0;
447 apq8064_fmem_pdata.reserved_size_low = 0;
448 apq8064_fmem_pdata.reserved_size_high = 0;
Olav Haugan62436252012-05-16 09:09:43 -0700449 apq8064_fmem_pdata.align = PAGE_SIZE;
Larry Bassel67b921d2012-04-06 10:23:27 -0700450 fixed_low_size = 0;
451 fixed_middle_size = 0;
452 fixed_high_size = 0;
453
454 /* We only support 1 reusable heap. Check if more than one heap
455 * is specified as reusable and set as non-reusable if found.
456 */
457 for (i = 0; i < apq8064_ion_pdata.nr; ++i) {
458 const struct ion_platform_heap *heap =
459 &(apq8064_ion_pdata.heaps[i]);
460
461 if (heap->type == ION_HEAP_TYPE_CP && heap->extra_data) {
462 struct ion_cp_heap_pdata *data = heap->extra_data;
463
464 reusable_count += (data->reusable) ? 1 : 0;
465
466 if (data->reusable && reusable_count > 1) {
467 pr_err("%s: Too many heaps specified as "
468 "reusable. Heap %s was not configured "
469 "as reusable.\n", __func__, heap->name);
470 data->reusable = 0;
471 }
472 }
473 }
474
475 for (i = 0; i < apq8064_ion_pdata.nr; ++i) {
476 const struct ion_platform_heap *heap =
477 &(apq8064_ion_pdata.heaps[i]);
478
479 if (heap->extra_data) {
480 int fixed_position = NOT_FIXED;
481 int mem_is_fmem = 0;
482
483 switch (heap->type) {
484 case ION_HEAP_TYPE_CP:
485 mem_is_fmem = ((struct ion_cp_heap_pdata *)
486 heap->extra_data)->mem_is_fmem;
487 fixed_position = ((struct ion_cp_heap_pdata *)
488 heap->extra_data)->fixed_position;
489 break;
490 case ION_HEAP_TYPE_CARVEOUT:
491 mem_is_fmem = ((struct ion_co_heap_pdata *)
492 heap->extra_data)->mem_is_fmem;
493 fixed_position = ((struct ion_co_heap_pdata *)
494 heap->extra_data)->fixed_position;
495 break;
496 default:
497 break;
498 }
499
500 if (fixed_position != NOT_FIXED)
501 fixed_size += heap->size;
502 else
503 reserve_mem_for_ion(MEMTYPE_EBI1, heap->size);
504
505 if (fixed_position == FIXED_LOW)
506 fixed_low_size += heap->size;
507 else if (fixed_position == FIXED_MIDDLE)
508 fixed_middle_size += heap->size;
509 else if (fixed_position == FIXED_HIGH)
510 fixed_high_size += heap->size;
511
512 if (mem_is_fmem)
513 apq8064_fmem_pdata.size += heap->size;
514 }
515 }
516
517 if (!fixed_size)
518 return;
519
520 if (apq8064_fmem_pdata.size) {
Hanumant Singheadb7502012-05-15 18:14:04 -0700521 apq8064_fmem_pdata.reserved_size_low = fixed_low_size +
522 HOLE_SIZE;
Larry Bassel67b921d2012-04-06 10:23:27 -0700523 apq8064_fmem_pdata.reserved_size_high = fixed_high_size;
524 }
525
526 /* Since the fixed area may be carved out of lowmem,
527 * make sure the length is a multiple of 1M.
528 */
Hanumant Singheadb7502012-05-15 18:14:04 -0700529 fixed_size = (fixed_size + HOLE_SIZE + SECTION_SIZE - 1)
Larry Bassel67b921d2012-04-06 10:23:27 -0700530 & SECTION_MASK;
531 apq8064_reserve_fixed_area(fixed_size);
532
533 fixed_low_start = APQ8064_FIXED_AREA_START;
Hanumant Singheadb7502012-05-15 18:14:04 -0700534 fixed_middle_start = fixed_low_start + fixed_low_size + HOLE_SIZE;
Larry Bassel67b921d2012-04-06 10:23:27 -0700535 fixed_high_start = fixed_middle_start + fixed_middle_size;
536
537 for (i = 0; i < apq8064_ion_pdata.nr; ++i) {
538 struct ion_platform_heap *heap = &(apq8064_ion_pdata.heaps[i]);
539
540 if (heap->extra_data) {
541 int fixed_position = NOT_FIXED;
Steve Mucklef132c6c2012-06-06 18:30:57 -0700542 struct ion_cp_heap_pdata *pdata = NULL;
Larry Bassel67b921d2012-04-06 10:23:27 -0700543
544 switch (heap->type) {
545 case ION_HEAP_TYPE_CP:
Hanumant Singheadb7502012-05-15 18:14:04 -0700546 pdata =
547 (struct ion_cp_heap_pdata *)heap->extra_data;
548 fixed_position = pdata->fixed_position;
Larry Bassel67b921d2012-04-06 10:23:27 -0700549 break;
550 case ION_HEAP_TYPE_CARVEOUT:
551 fixed_position = ((struct ion_co_heap_pdata *)
552 heap->extra_data)->fixed_position;
553 break;
554 default:
555 break;
556 }
557
558 switch (fixed_position) {
559 case FIXED_LOW:
560 heap->base = fixed_low_start;
561 break;
562 case FIXED_MIDDLE:
563 heap->base = fixed_middle_start;
Hanumant Singheadb7502012-05-15 18:14:04 -0700564 pdata->secure_base = fixed_middle_start
565 - HOLE_SIZE;
566 pdata->secure_size = HOLE_SIZE + heap->size;
Larry Bassel67b921d2012-04-06 10:23:27 -0700567 break;
568 case FIXED_HIGH:
569 heap->base = fixed_high_start;
570 break;
571 default:
572 break;
573 }
574 }
575 }
Olav Haugan7c6aa742012-01-16 16:47:37 -0800576#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700577}
578
Huaibin Yang4a084e32011-12-15 15:25:52 -0800579static void __init reserve_mdp_memory(void)
580{
581 apq8064_mdp_writeback(apq8064_reserve_table);
582}
583
Laura Abbott93a4a352012-05-25 09:26:35 -0700584static void __init reserve_cache_dump_memory(void)
585{
586#ifdef CONFIG_MSM_CACHE_DUMP
587 unsigned int total;
588
589 total = apq8064_cache_dump_pdata.l1_size +
590 apq8064_cache_dump_pdata.l2_size;
591 apq8064_reserve_table[MEMTYPE_EBI1].size += total;
592#endif
593}
594
Kevin Chan13be4e22011-10-20 11:30:32 -0700595static void __init apq8064_calculate_reserve_sizes(void)
596{
597 size_pmem_devices();
598 reserve_pmem_memory();
Olav Haugan7c6aa742012-01-16 16:47:37 -0800599 reserve_ion_memory();
Huaibin Yang4a084e32011-12-15 15:25:52 -0800600 reserve_mdp_memory();
Laura Abbott350c8362012-02-28 14:46:52 -0800601 reserve_rtb_memory();
Laura Abbott93a4a352012-05-25 09:26:35 -0700602 reserve_cache_dump_memory();
Kevin Chan13be4e22011-10-20 11:30:32 -0700603}
604
605static struct reserve_info apq8064_reserve_info __initdata = {
606 .memtype_reserve_table = apq8064_reserve_table,
607 .calculate_reserve_sizes = apq8064_calculate_reserve_sizes,
Larry Bassel67b921d2012-04-06 10:23:27 -0700608 .reserve_fixed_area = apq8064_reserve_fixed_area,
Kevin Chan13be4e22011-10-20 11:30:32 -0700609 .paddr_to_memtype = apq8064_paddr_to_memtype,
610};
611
612static int apq8064_memory_bank_size(void)
613{
614 return 1<<29;
615}
616
617static void __init locate_unstable_memory(void)
618{
619 struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1];
620 unsigned long bank_size;
621 unsigned long low, high;
622
623 bank_size = apq8064_memory_bank_size();
624 low = meminfo.bank[0].start;
625 high = mb->start + mb->size;
Olav Haugand76e3a82012-01-16 16:55:07 -0800626
627 /* Check if 32 bit overflow occured */
628 if (high < mb->start)
Larry Bassel67b921d2012-04-06 10:23:27 -0700629 high = -PAGE_SIZE;
Olav Haugand76e3a82012-01-16 16:55:07 -0800630
Kevin Chan13be4e22011-10-20 11:30:32 -0700631 low &= ~(bank_size - 1);
632
633 if (high - low <= bank_size)
Larry Bassel67b921d2012-04-06 10:23:27 -0700634 goto no_dmm;
635
636#ifdef CONFIG_ENABLE_DMM
Jack Cheung46bfffa2012-01-19 15:26:24 -0800637 apq8064_reserve_info.low_unstable_address = mb->start -
638 MIN_MEMORY_BLOCK_SIZE + mb->size;
639 apq8064_reserve_info.max_unstable_size = MIN_MEMORY_BLOCK_SIZE;
640
Kevin Chan13be4e22011-10-20 11:30:32 -0700641 apq8064_reserve_info.bank_size = bank_size;
642 pr_info("low unstable address %lx max size %lx bank size %lx\n",
643 apq8064_reserve_info.low_unstable_address,
644 apq8064_reserve_info.max_unstable_size,
645 apq8064_reserve_info.bank_size);
Larry Bassel67b921d2012-04-06 10:23:27 -0700646 return;
647#endif
648no_dmm:
649 apq8064_reserve_info.low_unstable_address = high;
650 apq8064_reserve_info.max_unstable_size = 0;
Kevin Chan13be4e22011-10-20 11:30:32 -0700651}
652
Hanumant Singh50440d42012-04-23 19:27:16 -0700653static int apq8064_change_memory_power(u64 start, u64 size,
654 int change_type)
655{
656 return soc_change_memory_power(start, size, change_type);
657}
658
Aravind Venkateswaran8ac7f412012-03-16 17:57:30 -0700659static char prim_panel_name[PANEL_NAME_MAX_LEN];
660static char ext_panel_name[PANEL_NAME_MAX_LEN];
Ajay Singh Parmar6b82d2b2012-07-19 17:23:26 +0530661
662static int ext_resolution;
663
Aravind Venkateswaran8ac7f412012-03-16 17:57:30 -0700664static int __init prim_display_setup(char *param)
665{
666 if (strnlen(param, PANEL_NAME_MAX_LEN))
667 strlcpy(prim_panel_name, param, PANEL_NAME_MAX_LEN);
668 return 0;
669}
670early_param("prim_display", prim_display_setup);
671
672static int __init ext_display_setup(char *param)
673{
674 if (strnlen(param, PANEL_NAME_MAX_LEN))
675 strlcpy(ext_panel_name, param, PANEL_NAME_MAX_LEN);
676 return 0;
677}
678early_param("ext_display", ext_display_setup);
679
Ajay Singh Parmar6b82d2b2012-07-19 17:23:26 +0530680static int __init hdmi_resulution_setup(char *param)
681{
682 int ret;
683 ret = kstrtoint(param, 10, &ext_resolution);
684 return ret;
685}
686early_param("ext_resolution", hdmi_resulution_setup);
687
Kevin Chan13be4e22011-10-20 11:30:32 -0700688static void __init apq8064_reserve(void)
689{
Ajay Singh Parmar6b82d2b2012-07-19 17:23:26 +0530690 apq8064_set_display_params(prim_panel_name, ext_panel_name,
691 ext_resolution);
Kevin Chan13be4e22011-10-20 11:30:32 -0700692 msm_reserve();
Larry Bassel67b921d2012-04-06 10:23:27 -0700693 if (apq8064_fmem_pdata.size) {
694#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
695 if (reserve_info->fixed_area_size) {
696 apq8064_fmem_pdata.phys =
697 reserve_info->fixed_area_start + MSM_MM_FW_SIZE;
698 pr_info("mm fw at %lx (fixed) size %x\n",
699 reserve_info->fixed_area_start, MSM_MM_FW_SIZE);
700 pr_info("fmem start %lx (fixed) size %lx\n",
701 apq8064_fmem_pdata.phys,
702 apq8064_fmem_pdata.size);
703 }
704#endif
705 }
Kevin Chan13be4e22011-10-20 11:30:32 -0700706}
707
Laura Abbott6988cef2012-03-15 14:27:13 -0700708static void __init place_movable_zone(void)
709{
Larry Bassel67b921d2012-04-06 10:23:27 -0700710#ifdef CONFIG_ENABLE_DMM
Laura Abbott6988cef2012-03-15 14:27:13 -0700711 movable_reserved_start = apq8064_reserve_info.low_unstable_address;
712 movable_reserved_size = apq8064_reserve_info.max_unstable_size;
713 pr_info("movable zone start %lx size %lx\n",
714 movable_reserved_start, movable_reserved_size);
Larry Bassel67b921d2012-04-06 10:23:27 -0700715#endif
Laura Abbott6988cef2012-03-15 14:27:13 -0700716}
717
718static void __init apq8064_early_reserve(void)
719{
720 reserve_info = &apq8064_reserve_info;
721 locate_unstable_memory();
722 place_movable_zone();
723
724}
Hemant Kumara945b472012-01-25 15:08:06 -0800725#ifdef CONFIG_USB_EHCI_MSM_HSIC
Hemant Kumare6275972012-02-29 20:06:21 -0800726/* Bandwidth requests (zero) if no vote placed */
727static struct msm_bus_vectors hsic_init_vectors[] = {
728 {
729 .src = MSM_BUS_MASTER_SPS,
730 .dst = MSM_BUS_SLAVE_EBI_CH0,
731 .ab = 0,
732 .ib = 0,
733 },
734 {
735 .src = MSM_BUS_MASTER_SPS,
736 .dst = MSM_BUS_SLAVE_SPS,
737 .ab = 0,
738 .ib = 0,
739 },
740};
741
742/* Bus bandwidth requests in Bytes/sec */
743static struct msm_bus_vectors hsic_max_vectors[] = {
744 {
745 .src = MSM_BUS_MASTER_SPS,
746 .dst = MSM_BUS_SLAVE_EBI_CH0,
747 .ab = 60000000, /* At least 480Mbps on bus. */
748 .ib = 960000000, /* MAX bursts rate */
749 },
750 {
751 .src = MSM_BUS_MASTER_SPS,
752 .dst = MSM_BUS_SLAVE_SPS,
753 .ab = 0,
754 .ib = 512000000, /*vote for 64Mhz dfab clk rate*/
755 },
756};
757
758static struct msm_bus_paths hsic_bus_scale_usecases[] = {
759 {
760 ARRAY_SIZE(hsic_init_vectors),
761 hsic_init_vectors,
762 },
763 {
764 ARRAY_SIZE(hsic_max_vectors),
765 hsic_max_vectors,
766 },
767};
768
769static struct msm_bus_scale_pdata hsic_bus_scale_pdata = {
770 hsic_bus_scale_usecases,
771 ARRAY_SIZE(hsic_bus_scale_usecases),
772 .name = "hsic",
773};
774
Hemant Kumara945b472012-01-25 15:08:06 -0800775static struct msm_hsic_host_platform_data msm_hsic_pdata = {
Hemant Kumare6275972012-02-29 20:06:21 -0800776 .strobe = 88,
777 .data = 89,
778 .bus_scale_table = &hsic_bus_scale_pdata,
Hemant Kumara945b472012-01-25 15:08:06 -0800779};
780#else
781static struct msm_hsic_host_platform_data msm_hsic_pdata;
782#endif
783
Hemant Kumarcb7d8a12012-01-25 12:25:55 -0800784#define PID_MAGIC_ID 0x71432909
785#define SERIAL_NUM_MAGIC_ID 0x61945374
786#define SERIAL_NUMBER_LENGTH 127
787#define DLOAD_USB_BASE_ADD 0x2A03F0C8
788
789struct magic_num_struct {
790 uint32_t pid;
791 uint32_t serial_num;
792};
793
794struct dload_struct {
795 uint32_t reserved1;
796 uint32_t reserved2;
797 uint32_t reserved3;
798 uint16_t reserved4;
799 uint16_t pid;
800 char serial_number[SERIAL_NUMBER_LENGTH];
801 uint16_t reserved5;
802 struct magic_num_struct magic_struct;
803};
804
805static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
806{
807 struct dload_struct __iomem *dload = 0;
808
809 dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload));
810 if (!dload) {
811 pr_err("%s: cannot remap I/O memory region: %08x\n",
812 __func__, DLOAD_USB_BASE_ADD);
813 return -ENXIO;
814 }
815
816 pr_debug("%s: dload:%p pid:%x serial_num:%s\n",
817 __func__, dload, pid, snum);
818 /* update pid */
819 dload->magic_struct.pid = PID_MAGIC_ID;
820 dload->pid = pid;
821
822 /* update serial number */
823 dload->magic_struct.serial_num = 0;
824 if (!snum) {
825 memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH);
826 goto out;
827 }
828
829 dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID;
830 strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH);
831out:
832 iounmap(dload);
833 return 0;
834}
835
836static struct android_usb_platform_data android_usb_pdata = {
837 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
838};
839
Hemant Kumar4933b072011-10-17 23:43:11 -0700840static struct platform_device android_usb_device = {
Hemant Kumarcb7d8a12012-01-25 12:25:55 -0800841 .name = "android_usb",
842 .id = -1,
843 .dev = {
844 .platform_data = &android_usb_pdata,
845 },
Hemant Kumar4933b072011-10-17 23:43:11 -0700846};
847
Hemant Kumar7620eed2012-02-26 09:08:43 -0800848/* Bandwidth requests (zero) if no vote placed */
849static struct msm_bus_vectors usb_init_vectors[] = {
850 {
851 .src = MSM_BUS_MASTER_SPS,
852 .dst = MSM_BUS_SLAVE_EBI_CH0,
853 .ab = 0,
854 .ib = 0,
855 },
856};
857
858/* Bus bandwidth requests in Bytes/sec */
859static struct msm_bus_vectors usb_max_vectors[] = {
860 {
861 .src = MSM_BUS_MASTER_SPS,
862 .dst = MSM_BUS_SLAVE_EBI_CH0,
863 .ab = 60000000, /* At least 480Mbps on bus. */
864 .ib = 960000000, /* MAX bursts rate */
865 },
866};
867
868static struct msm_bus_paths usb_bus_scale_usecases[] = {
869 {
870 ARRAY_SIZE(usb_init_vectors),
871 usb_init_vectors,
872 },
873 {
874 ARRAY_SIZE(usb_max_vectors),
875 usb_max_vectors,
876 },
877};
878
879static struct msm_bus_scale_pdata usb_bus_scale_pdata = {
880 usb_bus_scale_usecases,
881 ARRAY_SIZE(usb_bus_scale_usecases),
882 .name = "usb",
883};
884
Vamsi Krishna1f8704c2012-03-29 18:24:24 -0700885static int phy_init_seq[] = {
886 0x38, 0x81, /* update DC voltage level */
887 0x24, 0x82, /* set pre-emphasis and rise/fall time */
888 -1
889};
890
Vijayavardhan Vennapusa4fa13692012-08-02 14:35:03 +0530891#define PMIC_GPIO_DP 27 /* PMIC GPIO for D+ change */
892#define PMIC_GPIO_DP_IRQ PM8921_GPIO_IRQ(PM8921_IRQ_BASE, PMIC_GPIO_DP)
Jack Pham87f202f2012-08-06 00:24:22 -0700893#define MSM_MPM_PIN_USB1_OTGSESSVLD 40
894
Hemant Kumar4933b072011-10-17 23:43:11 -0700895static struct msm_otg_platform_data msm_otg_pdata = {
Hemant Kumard86c4882012-01-24 19:39:37 -0800896 .mode = USB_OTG,
897 .otg_control = OTG_PMIC_CONTROL,
Hemant Kumar4933b072011-10-17 23:43:11 -0700898 .phy_type = SNPS_28NM_INTEGRATED_PHY,
Hemant Kumard86c4882012-01-24 19:39:37 -0800899 .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE),
900 .power_budget = 750,
Hemant Kumar7620eed2012-02-26 09:08:43 -0800901 .bus_scale_table = &usb_bus_scale_pdata,
Vamsi Krishna1f8704c2012-03-29 18:24:24 -0700902 .phy_init_seq = phy_init_seq,
Jack Pham87f202f2012-08-06 00:24:22 -0700903 .mpm_otgsessvld_int = MSM_MPM_PIN_USB1_OTGSESSVLD,
Hemant Kumar4933b072011-10-17 23:43:11 -0700904};
905
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800906static struct msm_usb_host_platform_data msm_ehci_host_pdata3 = {
Manu Gautam91223e02011-11-08 15:27:22 +0530907 .power_budget = 500,
908};
909
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800910#ifdef CONFIG_USB_EHCI_MSM_HOST4
911static struct msm_usb_host_platform_data msm_ehci_host_pdata4;
912#endif
913
Manu Gautam91223e02011-11-08 15:27:22 +0530914static void __init apq8064_ehci_host_init(void)
915{
Chiranjeevi Velempatib822fa32012-05-23 22:05:59 +0530916 if (machine_is_apq8064_liquid() || machine_is_mpq8064_cdp() ||
917 machine_is_mpq8064_hrd() || machine_is_mpq8064_dtv()) {
918 if (machine_is_apq8064_liquid())
919 msm_ehci_host_pdata3.dock_connect_irq =
920 PM8921_MPP_IRQ(PM8921_IRQ_BASE, 9);
Vijayavardhan Vennapusa4fa13692012-08-02 14:35:03 +0530921 else
922 msm_ehci_host_pdata3.pmic_gpio_dp_irq =
923 PMIC_GPIO_DP_IRQ;
Hemant Kumar56925352012-02-13 16:59:52 -0800924
Manu Gautam91223e02011-11-08 15:27:22 +0530925 apq8064_device_ehci_host3.dev.platform_data =
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800926 &msm_ehci_host_pdata3;
Manu Gautam91223e02011-11-08 15:27:22 +0530927 platform_device_register(&apq8064_device_ehci_host3);
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800928
929#ifdef CONFIG_USB_EHCI_MSM_HOST4
930 apq8064_device_ehci_host4.dev.platform_data =
931 &msm_ehci_host_pdata4;
932 platform_device_register(&apq8064_device_ehci_host4);
933#endif
Manu Gautam91223e02011-11-08 15:27:22 +0530934 }
935}
936
David Keitel2f613d92012-02-15 11:29:16 -0800937static struct smb349_platform_data smb349_data __initdata = {
938 .en_n_gpio = PM8921_GPIO_PM_TO_SYS(37),
939 .chg_susp_gpio = PM8921_GPIO_PM_TO_SYS(30),
940 .chg_current_ma = 2200,
941};
942
943static struct i2c_board_info smb349_charger_i2c_info[] __initdata = {
944 {
945 I2C_BOARD_INFO(SMB349_NAME, 0x1B),
946 .platform_data = &smb349_data,
947 },
948};
949
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -0800950struct sx150x_platform_data apq8064_sx150x_data[] = {
951 [SX150X_EPM] = {
952 .gpio_base = GPIO_EPM_EXPANDER_BASE,
953 .oscio_is_gpo = false,
954 .io_pullup_ena = 0x0,
955 .io_pulldn_ena = 0x0,
956 .io_open_drain_ena = 0x0,
957 .io_polarity = 0,
958 .irq_summary = -1,
959 },
960};
961
962static struct epm_chan_properties ads_adc_channel_data[] = {
963 {10, 100}, {500, 50}, {1, 1}, {1, 1},
964 {20, 50}, {10, 100}, {1, 1}, {1, 1},
965 {10, 100}, {10, 100}, {100, 100}, {200, 100},
966 {100, 50}, {2000, 50}, {1000, 50}, {200, 50},
967 {200, 100}, {1, 1}, {20, 50}, {500, 50},
968 {50, 50}, {200, 100}, {500, 100}, {20, 50},
969 {200, 50}, {2000, 100}, {1000, 50}, {100, 50},
970 {200, 100}, {500, 50}, {1000, 100}, {200, 50},
971 {1000, 50}, {50, 50}, {100, 50}, {100, 50},
972 {1, 1}, {1, 1}, {20, 100}, {20, 50},
973 {500, 100}, {1000, 100}, {100, 50}, {1000, 50},
974 {100, 50}, {1000, 100}, {100, 50}, {100, 50},
975};
976
977static struct epm_adc_platform_data epm_adc_pdata = {
978 .channel = ads_adc_channel_data,
979 .bus_id = 0x0,
980 .epm_i2c_board_info = {
981 .type = "sx1509q",
982 .addr = 0x3e,
983 .platform_data = &apq8064_sx150x_data[SX150X_EPM],
984 },
985 .gpio_expander_base_addr = GPIO_EPM_EXPANDER_BASE,
986};
987
988static struct platform_device epm_adc_device = {
989 .name = "epm_adc",
990 .id = -1,
991 .dev = {
992 .platform_data = &epm_adc_pdata,
993 },
994};
995
996static void __init apq8064_epm_adc_init(void)
997{
998 epm_adc_pdata.num_channels = 32;
999 epm_adc_pdata.num_adc = 2;
1000 epm_adc_pdata.chan_per_adc = 16;
1001 epm_adc_pdata.chan_per_mux = 8;
1002};
1003
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001004/* Micbias setting is based on 8660 CDP/MTP/FLUID requirement
1005 * 4 micbiases are used to power various analog and digital
1006 * microphones operating at 1800 mV. Technically, all micbiases
1007 * can source from single cfilter since all microphones operate
1008 * at the same voltage level. The arrangement below is to make
1009 * sure all cfilters are exercised. LDO_H regulator ouput level
1010 * does not need to be as high as 2.85V. It is choosen for
1011 * microphone sensitivity purpose.
1012 */
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301013static struct wcd9xxx_pdata apq8064_tabla_platform_data = {
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001014 .slimbus_slave_device = {
1015 .name = "tabla-slave",
1016 .e_addr = {0, 0, 0x10, 0, 0x17, 2},
1017 },
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08001018 .irq = MSM_GPIO_TO_INT(42),
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001019 .irq_base = TABLA_INTERRUPT_BASE,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301020 .num_irqs = NR_WCD9XXX_IRQS,
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001021 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
1022 .micbias = {
1023 .ldoh_v = TABLA_LDOH_2P85_V,
1024 .cfilt1_mv = 1800,
Bhalchandra Gajare975c53a2012-08-10 12:16:49 -07001025 .cfilt2_mv = 2700,
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001026 .cfilt3_mv = 1800,
1027 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
1028 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
1029 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
1030 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301031 },
1032 .regulator = {
1033 {
1034 .name = "CDC_VDD_CP",
1035 .min_uV = 1800000,
1036 .max_uV = 1800000,
1037 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
1038 },
1039 {
1040 .name = "CDC_VDDA_RX",
1041 .min_uV = 1800000,
1042 .max_uV = 1800000,
1043 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
1044 },
1045 {
1046 .name = "CDC_VDDA_TX",
1047 .min_uV = 1800000,
1048 .max_uV = 1800000,
1049 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
1050 },
1051 {
1052 .name = "VDDIO_CDC",
1053 .min_uV = 1800000,
1054 .max_uV = 1800000,
1055 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
1056 },
1057 {
1058 .name = "VDDD_CDC_D",
1059 .min_uV = 1225000,
David Collins62debe82012-06-06 17:01:03 -07001060 .max_uV = 1250000,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301061 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
1062 },
1063 {
1064 .name = "CDC_VDDA_A_1P2V",
1065 .min_uV = 1225000,
David Collins62debe82012-06-06 17:01:03 -07001066 .max_uV = 1250000,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301067 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
1068 },
1069 },
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001070};
1071
1072static struct slim_device apq8064_slim_tabla = {
1073 .name = "tabla-slim",
1074 .e_addr = {0, 1, 0x10, 0, 0x17, 2},
1075 .dev = {
1076 .platform_data = &apq8064_tabla_platform_data,
1077 },
1078};
1079
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301080static struct wcd9xxx_pdata apq8064_tabla20_platform_data = {
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08001081 .slimbus_slave_device = {
1082 .name = "tabla-slave",
1083 .e_addr = {0, 0, 0x60, 0, 0x17, 2},
1084 },
1085 .irq = MSM_GPIO_TO_INT(42),
1086 .irq_base = TABLA_INTERRUPT_BASE,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301087 .num_irqs = NR_WCD9XXX_IRQS,
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08001088 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
1089 .micbias = {
1090 .ldoh_v = TABLA_LDOH_2P85_V,
1091 .cfilt1_mv = 1800,
Bhalchandra Gajare975c53a2012-08-10 12:16:49 -07001092 .cfilt2_mv = 2700,
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08001093 .cfilt3_mv = 1800,
1094 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
1095 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
1096 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
1097 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301098 },
1099 .regulator = {
1100 {
1101 .name = "CDC_VDD_CP",
1102 .min_uV = 1800000,
1103 .max_uV = 1800000,
1104 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
1105 },
1106 {
1107 .name = "CDC_VDDA_RX",
1108 .min_uV = 1800000,
1109 .max_uV = 1800000,
1110 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
1111 },
1112 {
1113 .name = "CDC_VDDA_TX",
1114 .min_uV = 1800000,
1115 .max_uV = 1800000,
1116 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
1117 },
1118 {
1119 .name = "VDDIO_CDC",
1120 .min_uV = 1800000,
1121 .max_uV = 1800000,
1122 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
1123 },
1124 {
1125 .name = "VDDD_CDC_D",
1126 .min_uV = 1225000,
David Collins62debe82012-06-06 17:01:03 -07001127 .max_uV = 1250000,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301128 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
1129 },
1130 {
1131 .name = "CDC_VDDA_A_1P2V",
1132 .min_uV = 1225000,
David Collins62debe82012-06-06 17:01:03 -07001133 .max_uV = 1250000,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301134 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
1135 },
1136 },
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08001137};
1138
1139static struct slim_device apq8064_slim_tabla20 = {
1140 .name = "tabla2x-slim",
1141 .e_addr = {0, 1, 0x60, 0, 0x17, 2},
1142 .dev = {
1143 .platform_data = &apq8064_tabla20_platform_data,
1144 },
1145};
1146
Santosh Mardi695be0d2012-04-10 23:21:12 +05301147/* enable the level shifter for cs8427 to make sure the I2C
1148 * clock is running at 100KHz and voltage levels are at 3.3
1149 * and 5 volts
1150 */
1151static int enable_100KHz_ls(int enable)
1152{
1153 int ret = 0;
1154 if (enable) {
1155 ret = gpio_request(SX150X_GPIO(1, 10),
1156 "cs8427_100KHZ_ENABLE");
1157 if (ret) {
1158 pr_err("%s: Failed to request gpio %d\n", __func__,
1159 SX150X_GPIO(1, 10));
1160 return ret;
1161 }
1162 gpio_direction_output(SX150X_GPIO(1, 10), 1);
1163 } else
1164 gpio_free(SX150X_GPIO(1, 10));
1165 return ret;
1166}
1167
Santosh Mardieff9a742012-04-09 23:23:39 +05301168static struct cs8427_platform_data cs8427_i2c_platform_data = {
1169 .irq = SX150X_GPIO(1, 4),
1170 .reset_gpio = SX150X_GPIO(1, 6),
Santosh Mardi695be0d2012-04-10 23:21:12 +05301171 .enable = enable_100KHz_ls,
Santosh Mardieff9a742012-04-09 23:23:39 +05301172};
1173
1174static struct i2c_board_info cs8427_device_info[] __initdata = {
1175 {
1176 I2C_BOARD_INFO("cs8427", CS8427_ADDR4),
1177 .platform_data = &cs8427_i2c_platform_data,
1178 },
1179};
1180
Amy Maloche70090f992012-02-16 16:35:26 -08001181#define HAP_SHIFT_LVL_OE_GPIO PM8921_MPP_PM_TO_SYS(8)
1182#define ISA1200_HAP_EN_GPIO PM8921_GPIO_PM_TO_SYS(33)
1183#define ISA1200_HAP_LEN_GPIO PM8921_GPIO_PM_TO_SYS(20)
1184#define ISA1200_HAP_CLK PM8921_GPIO_PM_TO_SYS(44)
1185
Mohan Pallaka2d877602012-05-11 13:07:30 +05301186static int isa1200_clk_enable(bool on)
Amy Maloche70090f992012-02-16 16:35:26 -08001187{
Amy Maloche8f973892012-03-26 14:53:13 -07001188 int rc = 0;
1189
Mohan Pallaka2d877602012-05-11 13:07:30 +05301190 gpio_set_value_cansleep(ISA1200_HAP_CLK, on);
Amy Maloche70090f992012-02-16 16:35:26 -08001191
Mohan Pallaka2d877602012-05-11 13:07:30 +05301192 if (on) {
Amy Maloche8f973892012-03-26 14:53:13 -07001193 rc = pm8xxx_aux_clk_control(CLK_MP3_2, XO_DIV_1, true);
Mohan Pallaka2d877602012-05-11 13:07:30 +05301194 if (rc) {
1195 pr_err("%s: unable to write aux clock register(%d)\n",
1196 __func__, rc);
1197 goto err_gpio_dis;
1198 }
1199 } else {
Amy Maloche8f973892012-03-26 14:53:13 -07001200 rc = pm8xxx_aux_clk_control(CLK_MP3_2, XO_DIV_NONE, true);
Mohan Pallaka2d877602012-05-11 13:07:30 +05301201 if (rc)
1202 pr_err("%s: unable to write aux clock register(%d)\n",
1203 __func__, rc);
Amy Maloche8f973892012-03-26 14:53:13 -07001204 }
1205
1206 return rc;
Mohan Pallaka2d877602012-05-11 13:07:30 +05301207
1208err_gpio_dis:
1209 gpio_set_value_cansleep(ISA1200_HAP_CLK, !on);
1210 return rc;
Amy Maloche70090f992012-02-16 16:35:26 -08001211}
1212
1213static int isa1200_dev_setup(bool enable)
1214{
1215 int rc = 0;
1216
Amy Maloche70090f992012-02-16 16:35:26 -08001217 if (!enable)
1218 goto free_gpio;
1219
1220 rc = gpio_request(ISA1200_HAP_CLK, "haptics_clk");
1221 if (rc) {
1222 pr_err("%s: unable to request gpio %d config(%d)\n",
1223 __func__, ISA1200_HAP_CLK, rc);
1224 return rc;
1225 }
1226
1227 rc = gpio_direction_output(ISA1200_HAP_CLK, 0);
1228 if (rc) {
1229 pr_err("%s: unable to set direction\n", __func__);
1230 goto free_gpio;
1231 }
1232
1233 return 0;
1234
1235free_gpio:
1236 gpio_free(ISA1200_HAP_CLK);
1237 return rc;
1238}
1239
1240static struct isa1200_regulator isa1200_reg_data[] = {
1241 {
1242 .name = "vddp",
1243 .min_uV = ISA_I2C_VTG_MIN_UV,
1244 .max_uV = ISA_I2C_VTG_MAX_UV,
1245 .load_uA = ISA_I2C_CURR_UA,
1246 },
1247};
1248
1249static struct isa1200_platform_data isa1200_1_pdata = {
1250 .name = "vibrator",
1251 .dev_setup = isa1200_dev_setup,
Mohan Pallaka2d877602012-05-11 13:07:30 +05301252 .clk_enable = isa1200_clk_enable,
Mohan Pallaka32f20a72012-06-14 14:41:11 +05301253 .need_pwm_clk = true,
Amy Maloche70090f992012-02-16 16:35:26 -08001254 .hap_en_gpio = ISA1200_HAP_EN_GPIO,
1255 .hap_len_gpio = ISA1200_HAP_LEN_GPIO,
1256 .max_timeout = 15000,
1257 .mode_ctrl = PWM_GEN_MODE,
1258 .pwm_fd = {
1259 .pwm_div = 256,
1260 },
1261 .is_erm = false,
1262 .smart_en = true,
1263 .ext_clk_en = true,
1264 .chip_en = 1,
1265 .regulator_info = isa1200_reg_data,
1266 .num_regulators = ARRAY_SIZE(isa1200_reg_data),
1267};
1268
1269static struct i2c_board_info isa1200_board_info[] __initdata = {
1270 {
1271 I2C_BOARD_INFO("isa1200_1", 0x90>>1),
1272 .platform_data = &isa1200_1_pdata,
1273 },
1274};
Jing Lin21ed4de2012-02-05 15:53:28 -08001275/* configuration data for mxt1386e using V2.1 firmware */
1276static const u8 mxt1386e_config_data_v2_1[] = {
1277 /* T6 Object */
1278 0, 0, 0, 0, 0, 0,
1279 /* T38 Object */
Jing Lin943fcec2012-05-25 13:58:57 -07001280 14, 2, 0, 24, 5, 12, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001281 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1282 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1283 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1284 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1285 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1286 0, 0, 0, 0,
1287 /* T7 Object */
Jing Linf1208fd2012-02-23 11:15:42 -08001288 100, 10, 50,
Jing Lin21ed4de2012-02-05 15:53:28 -08001289 /* T8 Object */
Jing Linf1208fd2012-02-23 11:15:42 -08001290 25, 0, 20, 20, 0, 0, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001291 /* T9 Object */
Jing Lin943fcec2012-05-25 13:58:57 -07001292 139, 0, 0, 26, 42, 0, 32, 80, 2, 5,
Jing Lin21ed4de2012-02-05 15:53:28 -08001293 0, 5, 5, 0, 10, 30, 10, 10, 255, 2,
Jing Linf1208fd2012-02-23 11:15:42 -08001294 85, 5, 0, 5, 9, 5, 12, 35, 70, 40,
1295 20, 5, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001296 /* T18 Object */
1297 0, 0,
1298 /* T24 Object */
1299 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1300 0, 0, 0, 0, 0, 0, 0, 0, 0,
1301 /* T25 Object */
Jing Lin943fcec2012-05-25 13:58:57 -07001302 1, 0, 60, 115, 156, 99,
Jing Lin21ed4de2012-02-05 15:53:28 -08001303 /* T27 Object */
1304 0, 0, 0, 0, 0, 0, 0,
1305 /* T40 Object */
1306 0, 0, 0, 0, 0,
1307 /* T42 Object */
Jing Lin943fcec2012-05-25 13:58:57 -07001308 0, 0, 255, 0, 255, 0, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001309 /* T43 Object */
1310 0, 0, 0, 0, 0, 0, 0, 64, 0, 8,
1311 16,
1312 /* T46 Object */
Jing Linf1208fd2012-02-23 11:15:42 -08001313 68, 0, 16, 16, 0, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001314 /* T47 Object */
1315 0, 0, 0, 0, 0, 0, 3, 64, 66, 0,
1316 /* T48 Object */
Jing Lin943fcec2012-05-25 13:58:57 -07001317 1, 64, 64, 0, 0, 0, 0, 0, 0, 0,
Jing Linf1208fd2012-02-23 11:15:42 -08001318 32, 40, 0, 10, 10, 0, 0, 100, 10, 90,
1319 0, 0, 0, 0, 0, 0, 0, 10, 1, 10,
1320 52, 10, 12, 0, 33, 0, 1, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001321 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1322 0, 0, 0, 0,
1323 /* T56 Object */
1324 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1325 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1326 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1327 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Jing Linf1208fd2012-02-23 11:15:42 -08001328 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1329 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001330};
1331
1332#define MXT_TS_GPIO_IRQ 6
1333#define MXT_TS_PWR_EN_GPIO PM8921_GPIO_PM_TO_SYS(23)
1334#define MXT_TS_RESET_GPIO 33
1335
1336static struct mxt_config_info mxt_config_array[] = {
1337 {
1338 .config = mxt1386e_config_data_v2_1,
1339 .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1),
1340 .family_id = 0xA0,
1341 .variant_id = 0x7,
1342 .version = 0x21,
1343 .build = 0xAA,
Jing Linef4aa9b2012-03-26 12:01:41 -07001344 .bootldr_id = MXT_BOOTLOADER_ID_1386E,
1345 .fw_name = "atmel_8064_liquid_v2_2_AA.hex",
1346 },
1347 {
1348 /* The config data for V2.2.AA is the same as for V2.1.AA */
1349 .config = mxt1386e_config_data_v2_1,
1350 .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1),
1351 .family_id = 0xA0,
1352 .variant_id = 0x7,
1353 .version = 0x22,
1354 .build = 0xAA,
1355 .bootldr_id = MXT_BOOTLOADER_ID_1386E,
Jing Lin21ed4de2012-02-05 15:53:28 -08001356 },
1357};
1358
1359static struct mxt_platform_data mxt_platform_data = {
1360 .config_array = mxt_config_array,
1361 .config_array_size = ARRAY_SIZE(mxt_config_array),
Mohan Pallaka56a1a5d2012-02-23 12:05:13 -08001362 .panel_minx = 0,
1363 .panel_maxx = 1365,
1364 .panel_miny = 0,
1365 .panel_maxy = 767,
1366 .disp_minx = 0,
1367 .disp_maxx = 1365,
1368 .disp_miny = 0,
1369 .disp_maxy = 767,
Anirudh Ghayal39dbe3f2012-04-13 15:43:16 +05301370 .irqflags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
Jing Lin21ed4de2012-02-05 15:53:28 -08001371 .i2c_pull_up = true,
1372 .reset_gpio = MXT_TS_RESET_GPIO,
1373 .irq_gpio = MXT_TS_GPIO_IRQ,
1374};
1375
1376static struct i2c_board_info mxt_device_info[] __initdata = {
1377 {
1378 I2C_BOARD_INFO("atmel_mxt_ts", 0x5b),
1379 .platform_data = &mxt_platform_data,
1380 .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ),
1381 },
1382};
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001383#define CYTTSP_TS_GPIO_IRQ 6
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001384#define CYTTSP_TS_GPIO_SLEEP 33
Amy Maloche609bb5e2012-08-03 09:41:42 -07001385#define CYTTSP_TS_GPIO_SLEEP_ALT 12
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001386
1387static ssize_t tma340_vkeys_show(struct kobject *kobj,
1388 struct kobj_attribute *attr, char *buf)
1389{
1390 return snprintf(buf, 200,
1391 __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97"
1392 ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97"
1393 ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97"
1394 ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97"
1395 "\n");
1396}
1397
1398static struct kobj_attribute tma340_vkeys_attr = {
1399 .attr = {
1400 .mode = S_IRUGO,
1401 },
1402 .show = &tma340_vkeys_show,
1403};
1404
1405static struct attribute *tma340_properties_attrs[] = {
1406 &tma340_vkeys_attr.attr,
1407 NULL
1408};
1409
1410static struct attribute_group tma340_properties_attr_group = {
1411 .attrs = tma340_properties_attrs,
1412};
1413
1414static int cyttsp_platform_init(struct i2c_client *client)
1415{
1416 int rc = 0;
1417 static struct kobject *tma340_properties_kobj;
1418
1419 tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c";
1420 tma340_properties_kobj = kobject_create_and_add("board_properties",
1421 NULL);
1422 if (tma340_properties_kobj)
1423 rc = sysfs_create_group(tma340_properties_kobj,
1424 &tma340_properties_attr_group);
1425 if (!tma340_properties_kobj || rc)
1426 pr_err("%s: failed to create board_properties\n",
1427 __func__);
1428
1429 return 0;
1430}
1431
1432static struct cyttsp_regulator cyttsp_regulator_data[] = {
1433 {
1434 .name = "vdd",
1435 .min_uV = CY_TMA300_VTG_MIN_UV,
1436 .max_uV = CY_TMA300_VTG_MAX_UV,
1437 .hpm_load_uA = CY_TMA300_CURR_24HZ_UA,
1438 .lpm_load_uA = CY_TMA300_CURR_24HZ_UA,
1439 },
1440 {
1441 .name = "vcc_i2c",
1442 .min_uV = CY_I2C_VTG_MIN_UV,
1443 .max_uV = CY_I2C_VTG_MAX_UV,
1444 .hpm_load_uA = CY_I2C_CURR_UA,
1445 .lpm_load_uA = CY_I2C_CURR_UA,
1446 },
1447};
1448
1449static struct cyttsp_platform_data cyttsp_pdata = {
1450 .panel_maxx = 634,
1451 .panel_maxy = 1166,
1452 .disp_maxx = 599,
1453 .disp_maxy = 1023,
1454 .disp_minx = 0,
1455 .disp_miny = 0,
1456 .flags = 0x01,
1457 .gen = CY_GEN3,
1458 .use_st = CY_USE_ST,
1459 .use_mt = CY_USE_MT,
1460 .use_hndshk = CY_SEND_HNDSHK,
1461 .use_trk_id = CY_USE_TRACKING_ID,
1462 .use_sleep = CY_USE_DEEP_SLEEP_SEL,
1463 .use_gestures = CY_USE_GESTURES,
1464 .fw_fname = "cyttsp_8064_mtp.hex",
1465 /* change act_intrvl to customize the Active power state
1466 * scanning/processing refresh interval for Operating mode
1467 */
1468 .act_intrvl = CY_ACT_INTRVL_DFLT,
1469 /* change tch_tmout to customize the touch timeout for the
1470 * Active power state for Operating mode
1471 */
1472 .tch_tmout = CY_TCH_TMOUT_DFLT,
1473 /* change lp_intrvl to customize the Low Power power state
1474 * scanning/processing refresh interval for Operating mode
1475 */
1476 .lp_intrvl = CY_LP_INTRVL_DFLT,
1477 .sleep_gpio = CYTTSP_TS_GPIO_SLEEP,
Amy Maloche9ba3ffe2012-04-26 10:31:20 -07001478 .resout_gpio = -1,
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001479 .irq_gpio = CYTTSP_TS_GPIO_IRQ,
1480 .regulator_info = cyttsp_regulator_data,
1481 .num_regulators = ARRAY_SIZE(cyttsp_regulator_data),
1482 .init = cyttsp_platform_init,
1483 .correct_fw_ver = 17,
1484};
1485
1486static struct i2c_board_info cyttsp_info[] __initdata = {
1487 {
1488 I2C_BOARD_INFO(CY_I2C_NAME, 0x24),
1489 .platform_data = &cyttsp_pdata,
1490 .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ),
1491 },
1492};
Jing Lin21ed4de2012-02-05 15:53:28 -08001493
Ankit Verma6b7e2ba2012-01-26 15:48:54 -08001494#define MSM_WCNSS_PHYS 0x03000000
1495#define MSM_WCNSS_SIZE 0x280000
1496
1497static struct resource resources_wcnss_wlan[] = {
1498 {
1499 .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1500 .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1501 .name = "wcnss_wlanrx_irq",
1502 .flags = IORESOURCE_IRQ,
1503 },
1504 {
1505 .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1506 .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1507 .name = "wcnss_wlantx_irq",
1508 .flags = IORESOURCE_IRQ,
1509 },
1510 {
1511 .start = MSM_WCNSS_PHYS,
1512 .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1,
1513 .name = "wcnss_mmio",
1514 .flags = IORESOURCE_MEM,
1515 },
1516 {
1517 .start = 64,
1518 .end = 68,
1519 .name = "wcnss_gpios_5wire",
1520 .flags = IORESOURCE_IO,
1521 },
1522};
1523
1524static struct qcom_wcnss_opts qcom_wcnss_pdata = {
1525 .has_48mhz_xo = 1,
1526};
1527
1528static struct platform_device msm_device_wcnss_wlan = {
1529 .name = "wcnss_wlan",
1530 .id = 0,
1531 .num_resources = ARRAY_SIZE(resources_wcnss_wlan),
1532 .resource = resources_wcnss_wlan,
1533 .dev = {.platform_data = &qcom_wcnss_pdata},
1534};
1535
Ankit Vermab7c26e62012-02-28 15:04:15 -08001536static struct platform_device msm_device_iris_fm __devinitdata = {
1537 .name = "iris_fm",
1538 .id = -1,
1539};
1540
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07001541#ifdef CONFIG_QSEECOM
1542/* qseecom bus scaling */
1543static struct msm_bus_vectors qseecom_clks_init_vectors[] = {
1544 {
1545 .src = MSM_BUS_MASTER_SPS,
1546 .dst = MSM_BUS_SLAVE_EBI_CH0,
1547 .ib = 0,
1548 .ab = 0,
1549 },
1550 {
1551 .src = MSM_BUS_MASTER_SPDM,
1552 .dst = MSM_BUS_SLAVE_SPDM,
1553 .ib = 0,
1554 .ab = 0,
1555 },
1556};
1557
1558static struct msm_bus_vectors qseecom_enable_dfab_vectors[] = {
1559 {
1560 .src = MSM_BUS_MASTER_SPS,
1561 .dst = MSM_BUS_SLAVE_EBI_CH0,
1562 .ib = (492 * 8) * 1000000UL,
1563 .ab = (492 * 8) * 100000UL,
1564 },
1565 {
1566 .src = MSM_BUS_MASTER_SPDM,
1567 .dst = MSM_BUS_SLAVE_SPDM,
1568 .ib = 0,
1569 .ab = 0,
1570 },
1571};
1572
1573static struct msm_bus_vectors qseecom_enable_sfpb_vectors[] = {
1574 {
1575 .src = MSM_BUS_MASTER_SPS,
1576 .dst = MSM_BUS_SLAVE_EBI_CH0,
1577 .ib = 0,
1578 .ab = 0,
1579 },
1580 {
1581 .src = MSM_BUS_MASTER_SPDM,
1582 .dst = MSM_BUS_SLAVE_SPDM,
1583 .ib = (64 * 8) * 1000000UL,
1584 .ab = (64 * 8) * 100000UL,
1585 },
1586};
1587
1588static struct msm_bus_paths qseecom_hw_bus_scale_usecases[] = {
1589 {
1590 ARRAY_SIZE(qseecom_clks_init_vectors),
1591 qseecom_clks_init_vectors,
1592 },
1593 {
1594 ARRAY_SIZE(qseecom_enable_dfab_vectors),
1595 qseecom_enable_sfpb_vectors,
1596 },
1597 {
1598 ARRAY_SIZE(qseecom_enable_sfpb_vectors),
1599 qseecom_enable_sfpb_vectors,
1600 },
1601};
1602
1603static struct msm_bus_scale_pdata qseecom_bus_pdata = {
1604 qseecom_hw_bus_scale_usecases,
1605 ARRAY_SIZE(qseecom_hw_bus_scale_usecases),
1606 .name = "qsee",
1607};
1608
1609static struct platform_device qseecom_device = {
1610 .name = "qseecom",
1611 .id = 0,
1612 .dev = {
1613 .platform_data = &qseecom_bus_pdata,
1614 },
1615};
1616#endif
1617
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001618#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1619 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
1620 defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1621 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1622
1623#define QCE_SIZE 0x10000
1624#define QCE_0_BASE 0x11000000
1625
1626#define QCE_HW_KEY_SUPPORT 0
1627#define QCE_SHA_HMAC_SUPPORT 1
1628#define QCE_SHARE_CE_RESOURCE 3
1629#define QCE_CE_SHARED 0
1630
1631static struct resource qcrypto_resources[] = {
1632 [0] = {
1633 .start = QCE_0_BASE,
1634 .end = QCE_0_BASE + QCE_SIZE - 1,
1635 .flags = IORESOURCE_MEM,
1636 },
1637 [1] = {
1638 .name = "crypto_channels",
1639 .start = DMOV8064_CE_IN_CHAN,
1640 .end = DMOV8064_CE_OUT_CHAN,
1641 .flags = IORESOURCE_DMA,
1642 },
1643 [2] = {
1644 .name = "crypto_crci_in",
1645 .start = DMOV8064_CE_IN_CRCI,
1646 .end = DMOV8064_CE_IN_CRCI,
1647 .flags = IORESOURCE_DMA,
1648 },
1649 [3] = {
1650 .name = "crypto_crci_out",
1651 .start = DMOV8064_CE_OUT_CRCI,
1652 .end = DMOV8064_CE_OUT_CRCI,
1653 .flags = IORESOURCE_DMA,
1654 },
1655};
1656
1657static struct resource qcedev_resources[] = {
1658 [0] = {
1659 .start = QCE_0_BASE,
1660 .end = QCE_0_BASE + QCE_SIZE - 1,
1661 .flags = IORESOURCE_MEM,
1662 },
1663 [1] = {
1664 .name = "crypto_channels",
1665 .start = DMOV8064_CE_IN_CHAN,
1666 .end = DMOV8064_CE_OUT_CHAN,
1667 .flags = IORESOURCE_DMA,
1668 },
1669 [2] = {
1670 .name = "crypto_crci_in",
1671 .start = DMOV8064_CE_IN_CRCI,
1672 .end = DMOV8064_CE_IN_CRCI,
1673 .flags = IORESOURCE_DMA,
1674 },
1675 [3] = {
1676 .name = "crypto_crci_out",
1677 .start = DMOV8064_CE_OUT_CRCI,
1678 .end = DMOV8064_CE_OUT_CRCI,
1679 .flags = IORESOURCE_DMA,
1680 },
1681};
1682
1683#endif
1684
1685#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1686 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1687
1688static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
1689 .ce_shared = QCE_CE_SHARED,
1690 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1691 .hw_key_support = QCE_HW_KEY_SUPPORT,
1692 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -08001693 .bus_scale_table = NULL,
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001694};
1695
1696static struct platform_device qcrypto_device = {
1697 .name = "qcrypto",
1698 .id = 0,
1699 .num_resources = ARRAY_SIZE(qcrypto_resources),
1700 .resource = qcrypto_resources,
1701 .dev = {
1702 .coherent_dma_mask = DMA_BIT_MASK(32),
1703 .platform_data = &qcrypto_ce_hw_suppport,
1704 },
1705};
1706#endif
1707
1708#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1709 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1710
1711static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
1712 .ce_shared = QCE_CE_SHARED,
1713 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1714 .hw_key_support = QCE_HW_KEY_SUPPORT,
1715 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -08001716 .bus_scale_table = NULL,
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001717};
1718
1719static struct platform_device qcedev_device = {
1720 .name = "qce",
1721 .id = 0,
1722 .num_resources = ARRAY_SIZE(qcedev_resources),
1723 .resource = qcedev_resources,
1724 .dev = {
1725 .coherent_dma_mask = DMA_BIT_MASK(32),
1726 .platform_data = &qcedev_ce_hw_suppport,
1727 },
1728};
1729#endif
1730
Joel Kingef390842012-05-23 16:42:48 -07001731static struct mdm_vddmin_resource mdm_vddmin_rscs = {
1732 .rpm_id = MSM_RPM_ID_VDDMIN_GPIO,
1733 .ap2mdm_vddmin_gpio = 30,
1734 .modes = 0x03,
1735 .drive_strength = 8,
1736 .mdm2ap_vddmin_gpio = 80,
1737};
1738
Joel King269aa602012-07-23 08:07:35 -07001739static struct gpiomux_setting mdm2ap_status_gpio_run_cfg = {
1740 .func = GPIOMUX_FUNC_GPIO,
1741 .drv = GPIOMUX_DRV_8MA,
1742 .pull = GPIOMUX_PULL_NONE,
1743};
1744
Joel Kingdacbc822012-01-25 13:30:57 -08001745static struct mdm_platform_data mdm_platform_data = {
1746 .mdm_version = "3.0",
1747 .ramdump_delay_ms = 2000,
Joel King14fe7fa2012-05-27 14:26:11 -07001748 .early_power_on = 1,
1749 .sfr_query = 1,
Joel Kingef390842012-05-23 16:42:48 -07001750 .vddmin_resource = &mdm_vddmin_rscs,
Hemant Kumara945b472012-01-25 15:08:06 -08001751 .peripheral_platform_device = &apq8064_device_hsic_host,
Ameya Thakurc9a7a842012-06-24 22:47:52 -07001752 .ramdump_timeout_ms = 120000,
Joel King269aa602012-07-23 08:07:35 -07001753 .mdm2ap_status_gpio_run_cfg = &mdm2ap_status_gpio_run_cfg,
Joel Kingdacbc822012-01-25 13:30:57 -08001754};
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001755
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -08001756static struct tsens_platform_data apq_tsens_pdata = {
1757 .tsens_factor = 1000,
1758 .hw_type = APQ_8064,
1759 .tsens_num_sensor = 11,
1760 .slope = {1176, 1176, 1154, 1176, 1111,
1761 1132, 1132, 1199, 1132, 1199, 1132},
1762};
1763
Siddartha Mohanadoss48cad912012-04-05 21:29:54 -07001764static struct platform_device msm_tsens_device = {
1765 .name = "tsens8960-tm",
1766 .id = -1,
1767};
1768
Praveen Chidambaram877d7a42012-06-05 14:33:20 -06001769static struct msm_thermal_data msm_thermal_pdata = {
1770 .sensor_id = 7,
Eugene Seah2ee4a5d2012-06-25 18:16:41 -06001771 .poll_ms = 250,
1772 .limit_temp_degC = 60,
1773 .temp_hysteresis_degC = 10,
1774 .freq_step = 2,
Praveen Chidambaram877d7a42012-06-05 14:33:20 -06001775};
1776
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001777#define MSM_SHARED_RAM_PHYS 0x80000000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001778static void __init apq8064_map_io(void)
1779{
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001780 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001781 msm_map_apq8064_io();
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -07001782 if (socinfo_init() < 0)
1783 pr_err("socinfo_init() failed!\n");
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001784}
1785
1786static void __init apq8064_init_irq(void)
1787{
Praveen Chidambaram78499012011-11-01 17:15:17 -06001788 struct msm_mpm_device_data *data = NULL;
1789
1790#ifdef CONFIG_MSM_MPM
1791 data = &apq8064_mpm_dev_data;
1792#endif
1793
1794 msm_mpm_irq_extn_init(data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001795 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
1796 (void *)MSM_QGIC_CPU_BASE);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001797}
1798
Jay Chokshi7805b5a2011-11-07 15:55:30 -08001799static struct platform_device msm8064_device_saw_regulator_core0 = {
1800 .name = "saw-regulator",
1801 .id = 0,
1802 .dev = {
1803 .platform_data = &msm8064_saw_regulator_pdata_8921_s5,
1804 },
1805};
1806
1807static struct platform_device msm8064_device_saw_regulator_core1 = {
1808 .name = "saw-regulator",
1809 .id = 1,
1810 .dev = {
1811 .platform_data = &msm8064_saw_regulator_pdata_8921_s6,
1812 },
1813};
1814
1815static struct platform_device msm8064_device_saw_regulator_core2 = {
1816 .name = "saw-regulator",
1817 .id = 2,
1818 .dev = {
1819 .platform_data = &msm8064_saw_regulator_pdata_8821_s0,
1820 },
1821};
1822
1823static struct platform_device msm8064_device_saw_regulator_core3 = {
1824 .name = "saw-regulator",
1825 .id = 3,
1826 .dev = {
1827 .platform_data = &msm8064_saw_regulator_pdata_8821_s1,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001828
1829 },
1830};
1831
Oluwafemi Adeyemif5a31422012-03-08 16:58:45 -08001832static struct msm_rpmrs_level msm_rpmrs_levels[] = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06001833 {
1834 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
1835 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
1836 true,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06001837 1, 784, 180000, 100,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001838 },
1839
1840 {
1841 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
1842 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
1843 true,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06001844 1300, 228, 1200000, 2000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001845 },
1846
1847 {
1848 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1849 MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE),
1850 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06001851 2000, 138, 1208400, 3200,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001852 },
1853
1854 {
1855 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001856 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, ACTIVE, RET_HIGH),
1857 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06001858 6000, 119, 1850300, 9000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001859 },
1860
1861 {
1862 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1863 MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE),
1864 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06001865 9200, 68, 2839200, 16400,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001866 },
1867
1868 {
1869 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1870 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
1871 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06001872 10300, 63, 3128000, 18200,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001873 },
1874
1875 {
1876 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1877 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH),
1878 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06001879 18000, 10, 4602600, 27000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001880 },
1881
1882 {
1883 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1884 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
1885 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06001886 20000, 2, 5752000, 32000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001887 },
1888};
1889
1890static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
1891 .mode = MSM_PM_BOOT_CONFIG_TZ,
1892};
1893
1894static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = {
1895 .levels = &msm_rpmrs_levels[0],
1896 .num_levels = ARRAY_SIZE(msm_rpmrs_levels),
1897 .vdd_mem_levels = {
1898 [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000,
1899 [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000,
1900 [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000,
1901 [MSM_RPMRS_VDD_MEM_MAX] = 1150000,
1902 },
1903 .vdd_dig_levels = {
1904 [MSM_RPMRS_VDD_DIG_RET_LOW] = 500000,
1905 [MSM_RPMRS_VDD_DIG_RET_HIGH] = 750000,
1906 [MSM_RPMRS_VDD_DIG_ACTIVE] = 950000,
1907 [MSM_RPMRS_VDD_DIG_MAX] = 1150000,
1908 },
1909 .vdd_mask = 0x7FFFFF,
1910 .rpmrs_target_id = {
1911 [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK,
1912 [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST,
1913 [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_PM8921_S3_0,
1914 [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_PM8921_S3_1,
1915 [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8921_L24_0,
1916 [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8921_L24_1,
1917 [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL,
1918 },
1919};
1920
Praveen Chidambaram78499012011-11-01 17:15:17 -06001921static uint8_t spm_wfi_cmd_sequence[] __initdata = {
1922 0x03, 0x0f,
1923};
1924
1925static uint8_t spm_power_collapse_without_rpm[] __initdata = {
1926 0x00, 0x24, 0x54, 0x10,
1927 0x09, 0x03, 0x01,
1928 0x10, 0x54, 0x30, 0x0C,
1929 0x24, 0x30, 0x0f,
1930};
1931
1932static uint8_t spm_power_collapse_with_rpm[] __initdata = {
1933 0x00, 0x24, 0x54, 0x10,
1934 0x09, 0x07, 0x01, 0x0B,
1935 0x10, 0x54, 0x30, 0x0C,
1936 0x24, 0x30, 0x0f,
1937};
1938
1939static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
1940 [0] = {
1941 .mode = MSM_SPM_MODE_CLOCK_GATING,
1942 .notify_rpm = false,
1943 .cmd = spm_wfi_cmd_sequence,
1944 },
1945 [1] = {
1946 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1947 .notify_rpm = false,
1948 .cmd = spm_power_collapse_without_rpm,
1949 },
1950 [2] = {
1951 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1952 .notify_rpm = true,
1953 .cmd = spm_power_collapse_with_rpm,
1954 },
1955};
1956
1957static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = {
1958 0x00, 0x20, 0x03, 0x20,
1959 0x00, 0x0f,
1960};
1961
1962static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = {
1963 0x00, 0x20, 0x34, 0x64,
1964 0x48, 0x07, 0x48, 0x20,
1965 0x50, 0x64, 0x04, 0x34,
1966 0x50, 0x0f,
1967};
1968static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = {
1969 0x00, 0x10, 0x34, 0x64,
1970 0x48, 0x07, 0x48, 0x10,
1971 0x50, 0x64, 0x04, 0x34,
1972 0x50, 0x0F,
1973};
1974
1975static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = {
1976 [0] = {
1977 .mode = MSM_SPM_L2_MODE_RETENTION,
1978 .notify_rpm = false,
1979 .cmd = l2_spm_wfi_cmd_sequence,
1980 },
1981 [1] = {
1982 .mode = MSM_SPM_L2_MODE_GDHS,
1983 .notify_rpm = true,
1984 .cmd = l2_spm_gdhs_cmd_sequence,
1985 },
1986 [2] = {
1987 .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE,
1988 .notify_rpm = true,
1989 .cmd = l2_spm_power_off_cmd_sequence,
1990 },
1991};
1992
1993
1994static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = {
1995 [0] = {
1996 .reg_base_addr = MSM_SAW_L2_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001997 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001998 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001999 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE,
2000 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020,
2001 .modes = msm_spm_l2_seq_list,
2002 .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list),
2003 },
2004};
2005
2006static struct msm_spm_platform_data msm_spm_data[] __initdata = {
2007 [0] = {
2008 .reg_base_addr = MSM_SAW0_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002009 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002010#if defined(CONFIG_MSM_AVS_HW)
2011 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
2012 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
2013#endif
2014 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07002015 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002016 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
2017 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
2018 .vctl_timeout_us = 50,
2019 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
2020 .modes = msm_spm_seq_list,
2021 },
2022 [1] = {
2023 .reg_base_addr = MSM_SAW1_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002024 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002025#if defined(CONFIG_MSM_AVS_HW)
2026 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
2027 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
2028#endif
2029 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07002030 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002031 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
2032 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
2033 .vctl_timeout_us = 50,
2034 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
2035 .modes = msm_spm_seq_list,
2036 },
2037 [2] = {
2038 .reg_base_addr = MSM_SAW2_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002039 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002040#if defined(CONFIG_MSM_AVS_HW)
2041 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
2042 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
2043#endif
2044 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07002045 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002046 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
2047 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
2048 .vctl_timeout_us = 50,
2049 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
2050 .modes = msm_spm_seq_list,
2051 },
2052 [3] = {
2053 .reg_base_addr = MSM_SAW3_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002054 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002055#if defined(CONFIG_MSM_AVS_HW)
2056 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
2057 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
2058#endif
2059 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07002060 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002061 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
2062 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
2063 .vctl_timeout_us = 50,
2064 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
2065 .modes = msm_spm_seq_list,
Jay Chokshi7805b5a2011-11-07 15:55:30 -08002066 },
2067};
2068
Gagan Mac8a7a5d32011-11-11 16:43:06 -07002069static void __init apq8064_init_buses(void)
2070{
2071 msm_bus_rpm_set_mt_mask();
2072 msm_bus_8064_apps_fabric_pdata.rpm_enabled = 1;
2073 msm_bus_8064_sys_fabric_pdata.rpm_enabled = 1;
2074 msm_bus_8064_mm_fabric_pdata.rpm_enabled = 1;
2075 msm_bus_8064_apps_fabric.dev.platform_data =
2076 &msm_bus_8064_apps_fabric_pdata;
2077 msm_bus_8064_sys_fabric.dev.platform_data =
2078 &msm_bus_8064_sys_fabric_pdata;
2079 msm_bus_8064_mm_fabric.dev.platform_data =
2080 &msm_bus_8064_mm_fabric_pdata;
2081 msm_bus_8064_sys_fpb.dev.platform_data = &msm_bus_8064_sys_fpb_pdata;
2082 msm_bus_8064_cpss_fpb.dev.platform_data = &msm_bus_8064_cpss_fpb_pdata;
2083}
2084
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06002085/* PCIe gpios */
2086static struct msm_pcie_gpio_info_t msm_pcie_gpio_info[MSM_PCIE_MAX_GPIO] = {
2087 {"rst_n", PM8921_MPP_PM_TO_SYS(PCIE_RST_N_PMIC_MPP), 0},
2088 {"pwr_en", PM8921_GPIO_PM_TO_SYS(PCIE_PWR_EN_PMIC_GPIO), 1},
2089};
2090
2091static struct msm_pcie_platform msm_pcie_platform_data = {
2092 .gpio = msm_pcie_gpio_info,
Niranjana Vishwanathapura68210ff2012-06-24 18:03:49 -06002093 .axi_addr = PCIE_AXI_BAR_PHYS,
2094 .axi_size = PCIE_AXI_BAR_SIZE,
Niranjana Vishwanathapura459a27d2012-07-20 12:23:55 -06002095 .wake_n = PM8921_GPIO_IRQ(PM8921_IRQ_BASE, PCIE_WAKE_N_PMIC_GPIO),
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06002096};
2097
Niranjana Vishwanathapurac1edd402012-06-28 15:32:50 -06002098static int __init mpq8064_pcie_enabled(void)
2099{
2100 return !((readl_relaxed(QFPROM_RAW_FEAT_CONFIG_ROW0_MSB) & BIT(21)) ||
2101 (readl_relaxed(QFPROM_RAW_OEM_CONFIG_ROW0_LSB) & BIT(4)));
2102}
2103
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06002104static void __init mpq8064_pcie_init(void)
2105{
Niranjana Vishwanathapurac1edd402012-06-28 15:32:50 -06002106 if (mpq8064_pcie_enabled()) {
2107 msm_device_pcie.dev.platform_data = &msm_pcie_platform_data;
2108 platform_device_register(&msm_device_pcie);
2109 }
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06002110}
2111
David Collinsf0d00732012-01-25 15:46:50 -08002112static struct platform_device apq8064_device_ext_5v_vreg __devinitdata = {
2113 .name = GPIO_REGULATOR_DEV_NAME,
2114 .id = PM8921_MPP_PM_TO_SYS(7),
2115 .dev = {
2116 .platform_data
2117 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V],
2118 },
2119};
2120
Jay Chokshi1de4f9d2012-02-07 16:11:31 -08002121static struct platform_device apq8064_device_ext_mpp8_vreg __devinitdata = {
2122 .name = GPIO_REGULATOR_DEV_NAME,
2123 .id = PM8921_MPP_PM_TO_SYS(8),
2124 .dev = {
2125 .platform_data
2126 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_MPP8],
2127 },
2128};
2129
David Collinsf0d00732012-01-25 15:46:50 -08002130static struct platform_device apq8064_device_ext_3p3v_vreg __devinitdata = {
2131 .name = GPIO_REGULATOR_DEV_NAME,
2132 .id = APQ8064_EXT_3P3V_REG_EN_GPIO,
2133 .dev = {
2134 .platform_data =
2135 &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V],
2136 },
2137};
2138
David Collins390fc332012-02-07 14:38:16 -08002139static struct platform_device apq8064_device_ext_ts_sw_vreg __devinitdata = {
2140 .name = GPIO_REGULATOR_DEV_NAME,
2141 .id = PM8921_GPIO_PM_TO_SYS(23),
2142 .dev = {
2143 .platform_data
2144 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_TS_SW],
2145 },
2146};
2147
David Collins2782b5c2012-02-06 10:02:42 -08002148static struct platform_device apq8064_device_rpm_regulator __devinitdata = {
2149 .name = "rpm-regulator",
2150 .id = -1,
2151 .dev = {
2152 .platform_data = &apq8064_rpm_regulator_pdata,
2153 },
2154};
2155
Ravi Kumar V05931a22012-04-04 17:09:37 +05302156static struct gpio_ir_recv_platform_data gpio_ir_recv_pdata = {
2157 .gpio_nr = 88,
2158 .active_low = 1,
2159};
2160
2161static struct platform_device gpio_ir_recv_pdev = {
2162 .name = "gpio-rc-recv",
2163 .dev = {
2164 .platform_data = &gpio_ir_recv_pdata,
2165 },
2166};
2167
Terence Hampson36b70722012-05-10 13:18:16 -04002168static struct platform_device *common_not_mpq_devices[] __initdata = {
David Keitel3c40fc52012-02-09 17:53:52 -08002169 &apq8064_device_qup_i2c_gsbi1,
Jing Lin04601f92012-02-05 15:36:07 -08002170 &apq8064_device_qup_i2c_gsbi3,
Kenneth Heitke748593a2011-07-15 15:45:11 -06002171 &apq8064_device_qup_i2c_gsbi4,
Terence Hampson36b70722012-05-10 13:18:16 -04002172};
2173
2174static struct platform_device *common_devices[] __initdata = {
Matt Wagantallf5cc3892012-06-07 19:47:02 -07002175 &apq8064_device_acpuclk,
Terence Hampson36b70722012-05-10 13:18:16 -04002176 &apq8064_device_dmov,
Harini Jayaramanc4c58692011-07-19 14:50:10 -06002177 &apq8064_device_qup_spi_gsbi5,
David Collinsf0d00732012-01-25 15:46:50 -08002178 &apq8064_device_ext_5v_vreg,
Jay Chokshi1de4f9d2012-02-07 16:11:31 -08002179 &apq8064_device_ext_mpp8_vreg,
David Collinsf0d00732012-01-25 15:46:50 -08002180 &apq8064_device_ext_3p3v_vreg,
Jay Chokshi9c25f072011-09-23 18:19:15 -07002181 &apq8064_device_ssbi_pmic1,
2182 &apq8064_device_ssbi_pmic2,
Steve Mucklef132c6c2012-06-06 18:30:57 -07002183 &apq8064_device_ext_ts_sw_vreg,
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06002184 &msm_device_smd_apq8064,
Hemant Kumar4933b072011-10-17 23:43:11 -07002185 &apq8064_device_otg,
2186 &apq8064_device_gadget_peripheral,
Hemant Kumard86c4882012-01-24 19:39:37 -08002187 &apq8064_device_hsusb_host,
Hemant Kumar4933b072011-10-17 23:43:11 -07002188 &android_usb_device,
Ankit Verma6b7e2ba2012-01-26 15:48:54 -08002189 &msm_device_wcnss_wlan,
Ankit Vermab7c26e62012-02-28 15:04:15 -08002190 &msm_device_iris_fm,
Larry Bassel67b921d2012-04-06 10:23:27 -07002191 &apq8064_fmem_device,
Olav Haugan7c6aa742012-01-16 16:47:37 -08002192#ifdef CONFIG_ANDROID_PMEM
2193#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Laura Abbottb93525f2012-04-12 09:57:19 -07002194 &apq8064_android_pmem_device,
2195 &apq8064_android_pmem_adsp_device,
2196 &apq8064_android_pmem_audio_device,
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -07002197#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
2198#endif /*CONFIG_ANDROID_PMEM*/
Olav Haugan7c6aa742012-01-16 16:47:37 -08002199#ifdef CONFIG_ION_MSM
Laura Abbottb93525f2012-04-12 09:57:19 -07002200 &apq8064_ion_dev,
Olav Haugan7c6aa742012-01-16 16:47:37 -08002201#endif
Jeff Ohlstein7e668552011-10-06 16:17:25 -07002202 &msm8064_device_watchdog,
Jay Chokshi7805b5a2011-11-07 15:55:30 -08002203 &msm8064_device_saw_regulator_core0,
2204 &msm8064_device_saw_regulator_core1,
2205 &msm8064_device_saw_regulator_core2,
2206 &msm8064_device_saw_regulator_core3,
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07002207#if defined(CONFIG_QSEECOM)
2208 &qseecom_device,
2209#endif
2210
Joel Nider6b9a7bc2012-06-26 11:19:19 +03002211 &msm_8064_device_tsif[0],
2212 &msm_8064_device_tsif[1],
2213
Ramesh Masavarapu28311912011-10-27 11:04:12 -07002214#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
2215 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
2216 &qcrypto_device,
2217#endif
2218
2219#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
2220 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
2221 &qcedev_device,
2222#endif
Ramesh Masavarapuf46be1b2011-11-03 11:13:41 -07002223
2224#ifdef CONFIG_HW_RANDOM_MSM
2225 &apq8064_device_rng,
2226#endif
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -08002227 &apq_pcm,
2228 &apq_pcm_routing,
2229 &apq_cpudai0,
2230 &apq_cpudai1,
Santosh Mardieff9a742012-04-09 23:23:39 +05302231 &mpq_cpudai_sec_i2s_rx,
Kuirong Wangf23f8c52012-03-31 12:34:51 -07002232 &mpq_cpudai_mi2s_tx,
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -08002233 &apq_cpudai_hdmi_rx,
2234 &apq_cpudai_bt_rx,
2235 &apq_cpudai_bt_tx,
2236 &apq_cpudai_fm_rx,
2237 &apq_cpudai_fm_tx,
2238 &apq_cpu_fe,
2239 &apq_stub_codec,
2240 &apq_voice,
2241 &apq_voip,
2242 &apq_lpa_pcm,
Krishnankutty Kolathappilly4374e332012-03-18 22:27:30 -07002243 &apq_compr_dsp,
2244 &apq_multi_ch_pcm,
Jayasena Sangaraboina99bf09c2012-07-17 12:03:08 -07002245 &apq_lowlatency_pcm,
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -08002246 &apq_pcm_hostless,
2247 &apq_cpudai_afe_01_rx,
2248 &apq_cpudai_afe_01_tx,
2249 &apq_cpudai_afe_02_rx,
2250 &apq_cpudai_afe_02_tx,
2251 &apq_pcm_afe,
2252 &apq_cpudai_auxpcm_rx,
2253 &apq_cpudai_auxpcm_tx,
Neema Shetty8427c262012-02-16 11:23:43 -08002254 &apq_cpudai_stub,
Neema Shetty3c9d2862012-03-11 01:25:32 -08002255 &apq_cpudai_slimbus_1_rx,
2256 &apq_cpudai_slimbus_1_tx,
Kiran Kandi97fe19d2012-05-20 22:34:04 -07002257 &apq_cpudai_slimbus_2_rx,
Kiran Kandi1e6371d2012-03-29 11:48:57 -07002258 &apq_cpudai_slimbus_2_tx,
Neema Shettyc9d86c32012-05-09 12:01:39 -07002259 &apq_cpudai_slimbus_3_rx,
Helen Zeng38c3c962012-05-17 14:56:20 -07002260 &apq_cpudai_slimbus_3_tx,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002261 &apq8064_rpm_device,
2262 &apq8064_rpm_log_device,
2263 &apq8064_rpm_stat_device,
Ramesh Masavarapuf31ff242012-05-10 18:55:21 -07002264 &apq_device_tz_log,
Gagan Mac8a7a5d32011-11-11 16:43:06 -07002265 &msm_bus_8064_apps_fabric,
2266 &msm_bus_8064_sys_fabric,
2267 &msm_bus_8064_mm_fabric,
2268 &msm_bus_8064_sys_fpb,
2269 &msm_bus_8064_cpss_fpb,
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08002270 &apq8064_msm_device_vidc,
Stephen Boyd25c4a0b2011-09-20 00:12:36 -07002271 &msm_pil_dsps,
Matt Wagantallb94b9a52012-02-02 21:59:54 -08002272 &msm_8960_q6_lpass,
Stephen Boyd7b973de2012-03-09 12:26:16 -08002273 &msm_pil_vidc,
Matt Wagantall292aace2012-01-26 19:12:34 -08002274 &msm_gss,
Laura Abbottb93525f2012-04-12 09:57:19 -07002275 &apq8064_rtb_device,
Praveen Chidambaram8ea3dcd2011-12-07 14:46:31 -07002276 &apq8064_cpu_idle_device,
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08002277 &apq8064_device_cache_erp,
Stepan Moskovchenko0f3de112012-06-08 18:11:46 -07002278 &msm8960_device_ebi1_ch0_erp,
2279 &msm8960_device_ebi1_ch1_erp,
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08002280 &epm_adc_device,
Pratik Patel3b0ca882012-06-01 16:54:14 -07002281 &coresight_tpiu_device,
2282 &coresight_etb_device,
2283 &apq8064_coresight_funnel_device,
2284 &coresight_etm0_device,
2285 &coresight_etm1_device,
2286 &coresight_etm2_device,
2287 &coresight_etm3_device,
Helen Zeng8f925502012-03-05 16:50:17 -08002288 &apq_cpudai_slim_4_rx,
2289 &apq_cpudai_slim_4_tx,
Steve Mucklef132c6c2012-06-06 18:30:57 -07002290#ifdef CONFIG_MSM_GEMINI
Jignesh Mehta921649d2012-04-19 06:57:23 -07002291 &msm8960_gemini_device,
Steve Mucklef132c6c2012-06-06 18:30:57 -07002292#endif
Laura Abbott0577d7b2012-04-17 11:14:30 -07002293 &apq8064_iommu_domain_device,
Siddartha Mohanadoss48cad912012-04-05 21:29:54 -07002294 &msm_tsens_device,
Laura Abbott93a4a352012-05-25 09:26:35 -07002295 &apq8064_cache_dump_device,
Joel Nider0e4a16d2012-08-05 14:20:11 +03002296 &msm_8064_device_tspp,
Harini Jayaramanc4c58692011-07-19 14:50:10 -06002297};
2298
Joel King82b7e3f2012-01-05 10:03:27 -08002299static struct platform_device *cdp_devices[] __initdata = {
2300 &apq8064_device_uart_gsbi1,
Jin Hong4bbbfba2012-02-02 21:48:07 -08002301 &apq8064_device_uart_gsbi7,
Joel King82b7e3f2012-01-05 10:03:27 -08002302 &msm_device_sps_apq8064,
Aravind Venkateswaran4ca27532012-02-16 14:27:05 -08002303#ifdef CONFIG_MSM_ROTATOR
2304 &msm_rotator_device,
2305#endif
Joel King82b7e3f2012-01-05 10:03:27 -08002306};
2307
Jay Chokshi1b7eaa92012-04-04 14:53:14 -07002308static struct platform_device
Jay Chokshi1b7eaa92012-04-04 14:53:14 -07002309mpq8064_device_ext_1p2_buck_vreg __devinitdata = {
2310 .name = GPIO_REGULATOR_DEV_NAME,
2311 .id = SX150X_GPIO(4, 2),
2312 .dev = {
2313 .platform_data =
2314 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_1P2V],
2315 },
2316};
2317
2318static struct platform_device
2319mpq8064_device_ext_1p8_buck_vreg __devinitdata = {
2320 .name = GPIO_REGULATOR_DEV_NAME,
2321 .id = SX150X_GPIO(4, 4),
2322 .dev = {
2323 .platform_data =
2324 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_1P8V],
2325 },
2326};
2327
2328static struct platform_device
2329mpq8064_device_ext_2p2_buck_vreg __devinitdata = {
2330 .name = GPIO_REGULATOR_DEV_NAME,
2331 .id = SX150X_GPIO(4, 14),
2332 .dev = {
2333 .platform_data =
2334 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_2P2V],
2335 },
2336};
2337
2338static struct platform_device
2339mpq8064_device_ext_5v_buck_vreg __devinitdata = {
2340 .name = GPIO_REGULATOR_DEV_NAME,
2341 .id = SX150X_GPIO(4, 3),
2342 .dev = {
2343 .platform_data =
2344 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_5V],
2345 },
2346};
2347
2348static struct platform_device
2349mpq8064_device_ext_3p3v_ldo_vreg __devinitdata = {
2350 .name = GPIO_REGULATOR_DEV_NAME,
2351 .id = SX150X_GPIO(4, 15),
2352 .dev = {
2353 .platform_data =
2354 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_3P3V],
2355 },
2356};
2357
Ravi Kumar V1c903012012-05-15 16:11:35 +05302358static struct platform_device rc_input_loopback_pdev = {
2359 .name = "rc-user-input",
2360 .id = -1,
2361};
2362
Ravi Kumar V040eeff2012-05-23 21:29:23 +05302363static int rf4ce_gpio_init(void)
2364{
2365 if (!machine_is_mpq8064_cdp())
2366 return -EINVAL;
2367
2368 /* CC2533 SRDY Input */
2369 if (!gpio_request(SX150X_GPIO(4, 6), "rf4ce_srdy")) {
2370 gpio_direction_input(SX150X_GPIO(4, 6));
2371 gpio_export(SX150X_GPIO(4, 6), true);
2372 }
2373
2374 /* CC2533 MRDY Output */
2375 if (!gpio_request(SX150X_GPIO(4, 5), "rf4ce_mrdy")) {
2376 gpio_direction_output(SX150X_GPIO(4, 5), 1);
2377 gpio_export(SX150X_GPIO(4, 5), true);
2378 }
2379
2380 /* CC2533 Reset Output */
2381 if (!gpio_request(SX150X_GPIO(4, 7), "rf4ce_reset")) {
2382 gpio_direction_output(SX150X_GPIO(4, 7), 0);
2383 gpio_export(SX150X_GPIO(4, 7), true);
2384 }
2385
2386 return 0;
2387}
2388late_initcall(rf4ce_gpio_init);
2389
Jay Chokshi1b7eaa92012-04-04 14:53:14 -07002390static struct platform_device *mpq_devices[] __initdata = {
2391 &msm_device_sps_apq8064,
2392 &mpq8064_device_qup_i2c_gsbi5,
2393#ifdef CONFIG_MSM_ROTATOR
2394 &msm_rotator_device,
2395#endif
Ravi Kumar V05931a22012-04-04 17:09:37 +05302396 &gpio_ir_recv_pdev,
Jay Chokshi1b7eaa92012-04-04 14:53:14 -07002397 &mpq8064_device_ext_1p2_buck_vreg,
2398 &mpq8064_device_ext_1p8_buck_vreg,
2399 &mpq8064_device_ext_2p2_buck_vreg,
2400 &mpq8064_device_ext_5v_buck_vreg,
2401 &mpq8064_device_ext_3p3v_ldo_vreg,
Terence Hampson2e1705f2012-04-11 19:55:29 -04002402#ifdef CONFIG_MSM_VCAP
2403 &msm8064_device_vcap,
2404#endif
Ravi Kumar V1c903012012-05-15 16:11:35 +05302405 &rc_input_loopback_pdev,
Jay Chokshi1b7eaa92012-04-04 14:53:14 -07002406};
2407
Harini Jayaramanc4c58692011-07-19 14:50:10 -06002408static struct msm_spi_platform_data apq8064_qup_spi_gsbi5_pdata = {
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -08002409 .max_clock_speed = 1100000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002410};
2411
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002412#define KS8851_IRQ_GPIO 43
2413
2414static struct spi_board_info spi_board_info[] __initdata = {
2415 {
2416 .modalias = "ks8851",
2417 .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
2418 .max_speed_hz = 19200000,
2419 .bus_num = 0,
2420 .chip_select = 2,
2421 .mode = SPI_MODE_0,
2422 },
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08002423 {
2424 .modalias = "epm_adc",
2425 .max_speed_hz = 1100000,
2426 .bus_num = 0,
2427 .chip_select = 3,
2428 .mode = SPI_MODE_0,
2429 },
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002430};
2431
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06002432static struct slim_boardinfo apq8064_slim_devices[] = {
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08002433 {
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08002434 .bus_num = 1,
2435 .slim_slave = &apq8064_slim_tabla,
2436 },
2437 {
2438 .bus_num = 1,
2439 .slim_slave = &apq8064_slim_tabla20,
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08002440 },
2441 /* add more slimbus slaves as needed */
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06002442};
2443
David Keitel3c40fc52012-02-09 17:53:52 -08002444static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi1_pdata = {
2445 .clk_freq = 100000,
2446 .src_clk_rate = 24000000,
2447};
2448
Jing Lin04601f92012-02-05 15:36:07 -08002449static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi3_pdata = {
Anirudh Ghayalc2163472012-04-10 14:58:14 +05302450 .clk_freq = 384000,
Jing Lin04601f92012-02-05 15:36:07 -08002451 .src_clk_rate = 24000000,
2452};
2453
Kenneth Heitke748593a2011-07-15 15:45:11 -06002454static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi4_pdata = {
2455 .clk_freq = 100000,
2456 .src_clk_rate = 24000000,
Kenneth Heitke748593a2011-07-15 15:45:11 -06002457};
2458
Joel King8f839b92012-04-01 14:37:46 -07002459static struct msm_i2c_platform_data mpq8064_i2c_qup_gsbi5_pdata = {
2460 .clk_freq = 100000,
2461 .src_clk_rate = 24000000,
2462};
2463
David Keitel3c40fc52012-02-09 17:53:52 -08002464#define GSBI_DUAL_MODE_CODE 0x60
2465#define MSM_GSBI1_PHYS 0x12440000
Kenneth Heitke748593a2011-07-15 15:45:11 -06002466static void __init apq8064_i2c_init(void)
2467{
David Keitel3c40fc52012-02-09 17:53:52 -08002468 void __iomem *gsbi_mem;
2469
2470 apq8064_device_qup_i2c_gsbi1.dev.platform_data =
2471 &apq8064_i2c_qup_gsbi1_pdata;
2472 gsbi_mem = ioremap_nocache(MSM_GSBI1_PHYS, 4);
2473 writel_relaxed(GSBI_DUAL_MODE_CODE, gsbi_mem);
2474 /* Ensure protocol code is written before proceeding */
2475 wmb();
2476 iounmap(gsbi_mem);
2477 apq8064_i2c_qup_gsbi1_pdata.use_gsbi_shared_mode = 1;
Jing Lin04601f92012-02-05 15:36:07 -08002478 apq8064_device_qup_i2c_gsbi3.dev.platform_data =
2479 &apq8064_i2c_qup_gsbi3_pdata;
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08002480 apq8064_device_qup_i2c_gsbi1.dev.platform_data =
2481 &apq8064_i2c_qup_gsbi1_pdata;
Kenneth Heitke748593a2011-07-15 15:45:11 -06002482 apq8064_device_qup_i2c_gsbi4.dev.platform_data =
2483 &apq8064_i2c_qup_gsbi4_pdata;
Joel King8f839b92012-04-01 14:37:46 -07002484 mpq8064_device_qup_i2c_gsbi5.dev.platform_data =
2485 &mpq8064_i2c_qup_gsbi5_pdata;
Kenneth Heitke748593a2011-07-15 15:45:11 -06002486}
2487
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -08002488#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002489static int ethernet_init(void)
2490{
2491 int ret;
2492 ret = gpio_request(KS8851_IRQ_GPIO, "ks8851_irq");
2493 if (ret) {
2494 pr_err("ks8851 gpio_request failed: %d\n", ret);
2495 goto fail;
2496 }
2497
2498 return 0;
2499fail:
2500 return ret;
2501}
2502#else
2503static int ethernet_init(void)
2504{
2505 return 0;
2506}
2507#endif
2508
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302509#define GPIO_KEY_HOME PM8921_GPIO_PM_TO_SYS(27)
2510#define GPIO_KEY_VOLUME_UP PM8921_GPIO_PM_TO_SYS(35)
2511#define GPIO_KEY_VOLUME_DOWN PM8921_GPIO_PM_TO_SYS(38)
2512#define GPIO_KEY_CAM_FOCUS PM8921_GPIO_PM_TO_SYS(3)
2513#define GPIO_KEY_CAM_SNAP PM8921_GPIO_PM_TO_SYS(4)
Jing Lin3f8f8422012-03-05 09:32:11 -08002514#define GPIO_KEY_ROTATION PM8921_GPIO_PM_TO_SYS(42)
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302515
2516static struct gpio_keys_button cdp_keys[] = {
2517 {
2518 .code = KEY_HOME,
2519 .gpio = GPIO_KEY_HOME,
2520 .desc = "home_key",
2521 .active_low = 1,
2522 .type = EV_KEY,
2523 .wakeup = 1,
2524 .debounce_interval = 15,
2525 },
2526 {
2527 .code = KEY_VOLUMEUP,
2528 .gpio = GPIO_KEY_VOLUME_UP,
2529 .desc = "volume_up_key",
2530 .active_low = 1,
2531 .type = EV_KEY,
2532 .wakeup = 1,
2533 .debounce_interval = 15,
2534 },
2535 {
2536 .code = KEY_VOLUMEDOWN,
2537 .gpio = GPIO_KEY_VOLUME_DOWN,
2538 .desc = "volume_down_key",
2539 .active_low = 1,
2540 .type = EV_KEY,
2541 .wakeup = 1,
2542 .debounce_interval = 15,
2543 },
2544 {
2545 .code = SW_ROTATE_LOCK,
2546 .gpio = GPIO_KEY_ROTATION,
2547 .desc = "rotate_key",
2548 .active_low = 1,
2549 .type = EV_SW,
2550 .debounce_interval = 15,
2551 },
2552};
2553
2554static struct gpio_keys_platform_data cdp_keys_data = {
2555 .buttons = cdp_keys,
2556 .nbuttons = ARRAY_SIZE(cdp_keys),
2557};
2558
2559static struct platform_device cdp_kp_pdev = {
2560 .name = "gpio-keys",
2561 .id = -1,
2562 .dev = {
2563 .platform_data = &cdp_keys_data,
2564 },
2565};
2566
2567static struct gpio_keys_button mtp_keys[] = {
2568 {
2569 .code = KEY_CAMERA_FOCUS,
2570 .gpio = GPIO_KEY_CAM_FOCUS,
2571 .desc = "cam_focus_key",
2572 .active_low = 1,
2573 .type = EV_KEY,
2574 .wakeup = 1,
2575 .debounce_interval = 15,
2576 },
2577 {
2578 .code = KEY_VOLUMEUP,
2579 .gpio = GPIO_KEY_VOLUME_UP,
2580 .desc = "volume_up_key",
2581 .active_low = 1,
2582 .type = EV_KEY,
2583 .wakeup = 1,
2584 .debounce_interval = 15,
2585 },
2586 {
2587 .code = KEY_VOLUMEDOWN,
2588 .gpio = GPIO_KEY_VOLUME_DOWN,
2589 .desc = "volume_down_key",
2590 .active_low = 1,
2591 .type = EV_KEY,
2592 .wakeup = 1,
2593 .debounce_interval = 15,
2594 },
2595 {
2596 .code = KEY_CAMERA_SNAPSHOT,
2597 .gpio = GPIO_KEY_CAM_SNAP,
2598 .desc = "cam_snap_key",
2599 .active_low = 1,
2600 .type = EV_KEY,
2601 .debounce_interval = 15,
2602 },
2603};
2604
2605static struct gpio_keys_platform_data mtp_keys_data = {
2606 .buttons = mtp_keys,
2607 .nbuttons = ARRAY_SIZE(mtp_keys),
2608};
2609
2610static struct platform_device mtp_kp_pdev = {
2611 .name = "gpio-keys",
2612 .id = -1,
2613 .dev = {
2614 .platform_data = &mtp_keys_data,
2615 },
2616};
2617
Anirudh Ghayal32ea6252012-04-26 16:39:50 +05302618static struct gpio_keys_button mpq_keys[] = {
2619 {
2620 .code = KEY_VOLUMEDOWN,
2621 .gpio = GPIO_KEY_VOLUME_DOWN,
2622 .desc = "volume_down_key",
2623 .active_low = 1,
2624 .type = EV_KEY,
2625 .wakeup = 1,
2626 .debounce_interval = 15,
2627 },
2628 {
2629 .code = KEY_VOLUMEUP,
2630 .gpio = GPIO_KEY_VOLUME_UP,
2631 .desc = "volume_up_key",
2632 .active_low = 1,
2633 .type = EV_KEY,
2634 .wakeup = 1,
2635 .debounce_interval = 15,
2636 },
2637};
2638
2639static struct gpio_keys_platform_data mpq_keys_data = {
2640 .buttons = mpq_keys,
2641 .nbuttons = ARRAY_SIZE(mpq_keys),
2642};
2643
2644static struct platform_device mpq_gpio_keys_pdev = {
2645 .name = "gpio-keys",
2646 .id = -1,
2647 .dev = {
2648 .platform_data = &mpq_keys_data,
2649 },
2650};
2651
2652#define MPQ_KP_ROW_BASE SX150X_EXP2_GPIO_BASE
2653#define MPQ_KP_COL_BASE (SX150X_EXP2_GPIO_BASE + 4)
2654
2655static unsigned int mpq_row_gpios[] = {MPQ_KP_ROW_BASE, MPQ_KP_ROW_BASE + 1,
2656 MPQ_KP_ROW_BASE + 2, MPQ_KP_ROW_BASE + 3};
2657static unsigned int mpq_col_gpios[] = {MPQ_KP_COL_BASE, MPQ_KP_COL_BASE + 1,
2658 MPQ_KP_COL_BASE + 2};
2659
2660static const unsigned int mpq_keymap[] = {
2661 KEY(0, 0, KEY_UP),
2662 KEY(0, 1, KEY_ENTER),
2663 KEY(0, 2, KEY_3),
2664
2665 KEY(1, 0, KEY_DOWN),
2666 KEY(1, 1, KEY_EXIT),
2667 KEY(1, 2, KEY_4),
2668
2669 KEY(2, 0, KEY_LEFT),
2670 KEY(2, 1, KEY_1),
2671 KEY(2, 2, KEY_5),
2672
2673 KEY(3, 0, KEY_RIGHT),
2674 KEY(3, 1, KEY_2),
2675 KEY(3, 2, KEY_6),
2676};
2677
2678static struct matrix_keymap_data mpq_keymap_data = {
2679 .keymap_size = ARRAY_SIZE(mpq_keymap),
2680 .keymap = mpq_keymap,
2681};
2682
2683static struct matrix_keypad_platform_data mpq_keypad_data = {
2684 .keymap_data = &mpq_keymap_data,
2685 .row_gpios = mpq_row_gpios,
2686 .col_gpios = mpq_col_gpios,
2687 .num_row_gpios = ARRAY_SIZE(mpq_row_gpios),
2688 .num_col_gpios = ARRAY_SIZE(mpq_col_gpios),
2689 .col_scan_delay_us = 32000,
2690 .debounce_ms = 20,
2691 .wakeup = 1,
2692 .active_low = 1,
2693 .no_autorepeat = 1,
2694};
2695
2696static struct platform_device mpq_keypad_device = {
2697 .name = "matrix-keypad",
2698 .id = -1,
2699 .dev = {
2700 .platform_data = &mpq_keypad_data,
2701 },
2702};
2703
Jin Hongd3024e62012-02-09 16:13:32 -08002704/* Sensors DSPS platform data */
2705#define DSPS_PIL_GENERIC_NAME "dsps"
2706static void __init apq8064_init_dsps(void)
2707{
2708 struct msm_dsps_platform_data *pdata =
2709 msm_dsps_device_8064.dev.platform_data;
2710 pdata->pil_name = DSPS_PIL_GENERIC_NAME;
2711 pdata->gpios = NULL;
2712 pdata->gpios_num = 0;
2713
2714 platform_device_register(&msm_dsps_device_8064);
2715}
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302716
Jing Lin417fa452012-02-05 14:31:06 -08002717#define I2C_SURF 1
2718#define I2C_FFA (1 << 1)
2719#define I2C_RUMI (1 << 2)
2720#define I2C_SIM (1 << 3)
2721#define I2C_LIQUID (1 << 4)
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002722#define I2C_MPQ_CDP BIT(5)
2723#define I2C_MPQ_HRD BIT(6)
2724#define I2C_MPQ_DTV BIT(7)
Jing Lin417fa452012-02-05 14:31:06 -08002725
2726struct i2c_registry {
2727 u8 machs;
2728 int bus;
2729 struct i2c_board_info *info;
2730 int len;
2731};
2732
2733static struct i2c_registry apq8064_i2c_devices[] __initdata = {
Jing Lin21ed4de2012-02-05 15:53:28 -08002734 {
David Keitel2f613d92012-02-15 11:29:16 -08002735 I2C_LIQUID,
2736 APQ_8064_GSBI1_QUP_I2C_BUS_ID,
2737 smb349_charger_i2c_info,
2738 ARRAY_SIZE(smb349_charger_i2c_info)
2739 },
2740 {
Jing Lin21ed4de2012-02-05 15:53:28 -08002741 I2C_SURF | I2C_LIQUID,
2742 APQ_8064_GSBI3_QUP_I2C_BUS_ID,
2743 mxt_device_info,
2744 ARRAY_SIZE(mxt_device_info),
2745 },
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08002746 {
2747 I2C_FFA,
2748 APQ_8064_GSBI3_QUP_I2C_BUS_ID,
2749 cyttsp_info,
2750 ARRAY_SIZE(cyttsp_info),
2751 },
Amy Maloche70090f992012-02-16 16:35:26 -08002752 {
2753 I2C_FFA | I2C_LIQUID,
2754 APQ_8064_GSBI1_QUP_I2C_BUS_ID,
2755 isa1200_board_info,
2756 ARRAY_SIZE(isa1200_board_info),
2757 },
Santosh Mardieff9a742012-04-09 23:23:39 +05302758 {
2759 I2C_MPQ_CDP,
2760 APQ_8064_GSBI5_QUP_I2C_BUS_ID,
2761 cs8427_device_info,
2762 ARRAY_SIZE(cs8427_device_info),
2763 },
Jing Lin417fa452012-02-05 14:31:06 -08002764};
2765
Jay Chokshi607f61b2012-04-25 18:21:21 -07002766#define SX150X_EXP1_INT_N PM8921_MPP_IRQ(PM8921_IRQ_BASE, 9)
Anirudh Ghayal9f1aaa72012-04-26 18:15:08 +05302767#define SX150X_EXP2_INT_N MSM_GPIO_TO_INT(81)
Jay Chokshi607f61b2012-04-25 18:21:21 -07002768
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002769struct sx150x_platform_data mpq8064_sx150x_pdata[] = {
2770 [SX150X_EXP1] = {
2771 .gpio_base = SX150X_EXP1_GPIO_BASE,
2772 .oscio_is_gpo = false,
2773 .io_pullup_ena = 0x0,
2774 .io_pulldn_ena = 0x0,
2775 .io_open_drain_ena = 0x0,
2776 .io_polarity = 0,
Jay Chokshi607f61b2012-04-25 18:21:21 -07002777 .irq_summary = SX150X_EXP1_INT_N,
2778 .irq_base = SX150X_EXP1_IRQ_BASE,
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002779 },
2780 [SX150X_EXP2] = {
2781 .gpio_base = SX150X_EXP2_GPIO_BASE,
2782 .oscio_is_gpo = false,
Anirudh Ghayal32ea6252012-04-26 16:39:50 +05302783 .io_pullup_ena = 0x0f,
2784 .io_pulldn_ena = 0x70,
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002785 .io_open_drain_ena = 0x0,
2786 .io_polarity = 0,
Anirudh Ghayal9f1aaa72012-04-26 18:15:08 +05302787 .irq_summary = SX150X_EXP2_INT_N,
2788 .irq_base = SX150X_EXP2_IRQ_BASE,
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002789 },
2790 [SX150X_EXP3] = {
2791 .gpio_base = SX150X_EXP3_GPIO_BASE,
2792 .oscio_is_gpo = false,
2793 .io_pullup_ena = 0x0,
2794 .io_pulldn_ena = 0x0,
2795 .io_open_drain_ena = 0x0,
2796 .io_polarity = 0,
2797 .irq_summary = -1,
2798 },
2799 [SX150X_EXP4] = {
2800 .gpio_base = SX150X_EXP4_GPIO_BASE,
2801 .oscio_is_gpo = false,
2802 .io_pullup_ena = 0x0,
2803 .io_pulldn_ena = 0x0,
2804 .io_open_drain_ena = 0x0,
2805 .io_polarity = 0,
2806 .irq_summary = -1,
2807 },
2808};
2809
2810static struct i2c_board_info sx150x_gpio_exp_info[] = {
2811 {
2812 I2C_BOARD_INFO("sx1509q", 0x70),
2813 .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP1],
2814 },
2815 {
2816 I2C_BOARD_INFO("sx1508q", 0x23),
2817 .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP2],
2818 },
2819 {
2820 I2C_BOARD_INFO("sx1508q", 0x22),
2821 .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP3],
2822 },
2823 {
2824 I2C_BOARD_INFO("sx1509q", 0x3E),
2825 .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP4],
2826 },
2827};
2828
2829#define MPQ8064_I2C_GSBI5_BUS_ID 5
2830
2831static struct i2c_registry mpq8064_i2c_devices[] __initdata = {
2832 {
2833 I2C_MPQ_CDP,
2834 MPQ8064_I2C_GSBI5_BUS_ID,
2835 sx150x_gpio_exp_info,
2836 ARRAY_SIZE(sx150x_gpio_exp_info),
2837 },
2838};
2839
Jing Lin417fa452012-02-05 14:31:06 -08002840static void __init register_i2c_devices(void)
2841{
2842 u8 mach_mask = 0;
2843 int i;
2844
Kevin Chand07220e2012-02-13 15:52:22 -08002845#ifdef CONFIG_MSM_CAMERA
2846 struct i2c_registry apq8064_camera_i2c_devices = {
2847 I2C_SURF | I2C_FFA | I2C_LIQUID | I2C_RUMI,
2848 APQ_8064_GSBI4_QUP_I2C_BUS_ID,
2849 apq8064_camera_board_info.board_info,
2850 apq8064_camera_board_info.num_i2c_board_info,
2851 };
2852#endif
Jing Lin417fa452012-02-05 14:31:06 -08002853 /* Build the matching 'supported_machs' bitmask */
2854 if (machine_is_apq8064_cdp())
2855 mach_mask = I2C_SURF;
2856 else if (machine_is_apq8064_mtp())
2857 mach_mask = I2C_FFA;
2858 else if (machine_is_apq8064_liquid())
2859 mach_mask = I2C_LIQUID;
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002860 else if (PLATFORM_IS_MPQ8064())
2861 mach_mask = I2C_MPQ_CDP;
Jing Lin417fa452012-02-05 14:31:06 -08002862 else
2863 pr_err("unmatched machine ID in register_i2c_devices\n");
2864
2865 /* Run the array and install devices as appropriate */
2866 for (i = 0; i < ARRAY_SIZE(apq8064_i2c_devices); ++i) {
2867 if (apq8064_i2c_devices[i].machs & mach_mask)
2868 i2c_register_board_info(apq8064_i2c_devices[i].bus,
2869 apq8064_i2c_devices[i].info,
2870 apq8064_i2c_devices[i].len);
2871 }
Kevin Chand07220e2012-02-13 15:52:22 -08002872#ifdef CONFIG_MSM_CAMERA
2873 if (apq8064_camera_i2c_devices.machs & mach_mask)
2874 i2c_register_board_info(apq8064_camera_i2c_devices.bus,
2875 apq8064_camera_i2c_devices.info,
2876 apq8064_camera_i2c_devices.len);
2877#endif
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002878
2879 for (i = 0; i < ARRAY_SIZE(mpq8064_i2c_devices); ++i) {
2880 if (mpq8064_i2c_devices[i].machs & mach_mask)
2881 i2c_register_board_info(
2882 mpq8064_i2c_devices[i].bus,
2883 mpq8064_i2c_devices[i].info,
2884 mpq8064_i2c_devices[i].len);
2885 }
Jing Lin417fa452012-02-05 14:31:06 -08002886}
2887
Jay Chokshi994ff122012-03-27 15:43:48 -07002888static void enable_ddr3_regulator(void)
2889{
2890 static struct regulator *ext_ddr3;
2891
2892 /* Use MPP7 output state as a flag for PCDDR3 presence. */
2893 if (gpio_get_value_cansleep(PM8921_MPP_PM_TO_SYS(7)) > 0) {
2894 ext_ddr3 = regulator_get(NULL, "ext_ddr3");
2895 if (IS_ERR(ext_ddr3) || ext_ddr3 == NULL)
2896 pr_err("Could not get MPP7 regulator\n");
2897 else
2898 regulator_enable(ext_ddr3);
2899 }
2900}
2901
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002902static void enable_avc_i2c_bus(void)
2903{
2904 int avc_i2c_en_mpp = PM8921_MPP_PM_TO_SYS(8);
2905 int rc;
2906
2907 rc = gpio_request(avc_i2c_en_mpp, "avc_i2c_en");
2908 if (rc)
2909 pr_err("request for avc_i2c_en mpp failed,"
2910 "rc=%d\n", rc);
2911 else
2912 gpio_set_value_cansleep(avc_i2c_en_mpp, 1);
2913}
2914
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002915static void __init apq8064_common_init(void)
2916{
Ameya Thakure155ece2012-07-09 12:08:37 -07002917 u32 platform_version;
Rohit Vaswanib1cc4932012-07-23 21:30:11 -07002918 platform_device_register(&msm_gpio_device);
Joel King8f839b92012-04-01 14:37:46 -07002919 msm_tsens_early_init(&apq_tsens_pdata);
Praveen Chidambaram877d7a42012-06-05 14:33:20 -06002920 msm_thermal_init(&msm_thermal_pdata);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002921 if (socinfo_init() < 0)
2922 pr_err("socinfo_init() failed!\n");
Praveen Chidambaram78499012011-11-01 17:15:17 -06002923 BUG_ON(msm_rpm_init(&apq8064_rpm_data));
2924 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
David Collins2782b5c2012-02-06 10:02:42 -08002925 regulator_suppress_info_printing();
2926 platform_device_register(&apq8064_device_rpm_regulator);
Stephen Boyd4d0d2582012-02-10 14:49:40 -08002927 if (msm_xo_init())
2928 pr_err("Failed to initialize XO votes\n");
Matt Wagantallc51e5602012-02-27 17:25:25 -08002929 msm_clock_init(&apq8064_clock_init_data);
Stepan Moskovchenko2327a952011-12-14 16:31:28 -08002930 apq8064_init_gpiomux();
Kenneth Heitke748593a2011-07-15 15:45:11 -06002931 apq8064_i2c_init();
Jing Lin417fa452012-02-05 14:31:06 -08002932 register_i2c_devices();
Kenneth Heitke36920d32011-07-20 16:44:30 -06002933
Harini Jayaramanc4c58692011-07-19 14:50:10 -06002934 apq8064_device_qup_spi_gsbi5.dev.platform_data =
2935 &apq8064_qup_spi_gsbi5_pdata;
Stepan Moskovchenkoc1074f02011-12-14 17:51:57 -08002936 apq8064_init_pmic();
Hemant Kumar94e7da22012-02-03 16:52:29 -08002937 if (machine_is_apq8064_liquid())
2938 msm_otg_pdata.mhl_enable = true;
Vamsi Krishnad9863eb2012-03-26 17:34:48 -07002939
Ofir Cohen94213a72012-05-03 14:26:32 +03002940 android_usb_pdata.swfi_latency =
2941 msm_rpmrs_levels[0].latency_us;
Vamsi Krishnad9863eb2012-03-26 17:34:48 -07002942
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002943 apq8064_device_otg.dev.platform_data = &msm_otg_pdata;
Manu Gautam91223e02011-11-08 15:27:22 +05302944 apq8064_ehci_host_init();
Gagan Mac8a7a5d32011-11-11 16:43:06 -07002945 apq8064_init_buses();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002946 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Terence Hampson36b70722012-05-10 13:18:16 -04002947 if (!(machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
2948 machine_is_mpq8064_dtv()))
2949 platform_add_devices(common_not_mpq_devices,
2950 ARRAY_SIZE(common_not_mpq_devices));
Jay Chokshi994ff122012-03-27 15:43:48 -07002951 enable_ddr3_regulator();
Hemant Kumarf1ca9192012-02-07 18:59:33 -08002952 if (machine_is_apq8064_mtp()) {
Hemant Kumar30d361c2012-08-20 14:44:40 -07002953 msm_hsic_pdata.log2_irq_thresh = 5,
Hemant Kumarf1ca9192012-02-07 18:59:33 -08002954 apq8064_device_hsic_host.dev.platform_data = &msm_hsic_pdata;
2955 device_initialize(&apq8064_device_hsic_host.dev);
2956 }
Jay Chokshie8741282012-01-25 15:22:55 -08002957 apq8064_pm8xxx_gpio_mpp_init();
Sahitya Tummala3586ed92011-08-03 09:13:23 +05302958 apq8064_init_mmc();
Swaminathan Sathappan144b4882012-02-06 17:01:20 -08002959
2960 if (machine_is_apq8064_mtp()) {
2961 mdm_8064_device.dev.platform_data = &mdm_platform_data;
Ameya Thakure155ece2012-07-09 12:08:37 -07002962 platform_version = socinfo_get_platform_version();
2963 if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
2964 i2s_mdm_8064_device.dev.platform_data =
2965 &mdm_platform_data;
2966 platform_device_register(&i2s_mdm_8064_device);
2967 } else {
2968 mdm_8064_device.dev.platform_data = &mdm_platform_data;
2969 platform_device_register(&mdm_8064_device);
2970 }
Swaminathan Sathappan144b4882012-02-06 17:01:20 -08002971 }
2972 platform_device_register(&apq8064_slim_ctrl);
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06002973 slim_register_board_info(apq8064_slim_devices,
2974 ARRAY_SIZE(apq8064_slim_devices));
Taniya Dasbbf633d2012-07-31 16:07:47 +05302975 if (!PLATFORM_IS_MPQ8064()) {
Taniya Das30cae292012-07-31 15:56:12 +05302976 apq8064_init_dsps();
Taniya Dasbbf633d2012-07-31 16:07:47 +05302977 platform_device_register(&msm_8960_riva);
2978 }
Praveen Chidambaram78499012011-11-01 17:15:17 -06002979 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
2980 msm_spm_l2_init(msm_spm_l2_data);
Praveen Chidambaram78499012011-11-01 17:15:17 -06002981 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08002982 apq8064_epm_adc_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002983}
2984
Huaibin Yang4a084e32011-12-15 15:25:52 -08002985static void __init apq8064_allocate_memory_regions(void)
2986{
2987 apq8064_allocate_fb_region();
2988}
2989
Joel King82b7e3f2012-01-05 10:03:27 -08002990static void __init apq8064_cdp_init(void)
2991{
Hanumant Singh50440d42012-04-23 19:27:16 -07002992 if (meminfo_init(SYS_MEMORY, SZ_256M) < 0)
2993 pr_err("meminfo_init() failed!\n");
Amy Maloche609bb5e2012-08-03 09:41:42 -07002994 if (machine_is_apq8064_mtp() &&
2995 SOCINFO_VERSION_MINOR(socinfo_get_platform_version()) == 1)
2996 cyttsp_pdata.sleep_gpio = CYTTSP_TS_GPIO_SLEEP_ALT;
Joel King82b7e3f2012-01-05 10:03:27 -08002997 apq8064_common_init();
Joel King8f839b92012-04-01 14:37:46 -07002998 if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
2999 machine_is_mpq8064_dtv()) {
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07003000 enable_avc_i2c_bus();
Olav Hauganef95ae32012-05-15 09:50:30 -07003001 msm_rotator_set_split_iommu_domain();
Joel King8f839b92012-04-01 14:37:46 -07003002 platform_add_devices(mpq_devices, ARRAY_SIZE(mpq_devices));
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06003003 mpq8064_pcie_init();
Joel King8f839b92012-04-01 14:37:46 -07003004 } else {
3005 ethernet_init();
Olav Hauganef95ae32012-05-15 09:50:30 -07003006 msm_rotator_set_split_iommu_domain();
Joel King8f839b92012-04-01 14:37:46 -07003007 platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
3008 spi_register_board_info(spi_board_info,
3009 ARRAY_SIZE(spi_board_info));
3010 }
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08003011 apq8064_init_fb();
Jordan Crouseb3115fe2012-02-01 22:11:12 -07003012 apq8064_init_gpu();
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07003013 platform_add_devices(apq8064_footswitch, apq8064_num_footswitch);
Steve Mucklef132c6c2012-06-06 18:30:57 -07003014#ifdef CONFIG_MSM_CAMERA
Kevin Chand07220e2012-02-13 15:52:22 -08003015 apq8064_init_cam();
Steve Mucklef132c6c2012-06-06 18:30:57 -07003016#endif
Mohan Pallaka474b94b2012-01-25 12:59:58 +05303017
3018 if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
3019 platform_device_register(&cdp_kp_pdev);
3020
3021 if (machine_is_apq8064_mtp())
3022 platform_device_register(&mtp_kp_pdev);
Hanumant Singh50440d42012-04-23 19:27:16 -07003023
3024 change_memory_power = &apq8064_change_memory_power;
Anirudh Ghayal32ea6252012-04-26 16:39:50 +05303025
3026 if (machine_is_mpq8064_cdp()) {
3027 platform_device_register(&mpq_gpio_keys_pdev);
3028 platform_device_register(&mpq_keypad_device);
3029 }
Joel King82b7e3f2012-01-05 10:03:27 -08003030}
3031
Joel King82b7e3f2012-01-05 10:03:27 -08003032MACHINE_START(APQ8064_CDP, "QCT APQ8064 CDP")
3033 .map_io = apq8064_map_io,
3034 .reserve = apq8064_reserve,
3035 .init_irq = apq8064_init_irq,
3036 .handle_irq = gic_handle_irq,
3037 .timer = &msm_timer,
3038 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08003039 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07003040 .init_very_early = apq8064_early_reserve,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003041 .restart = msm_restart,
Joel King82b7e3f2012-01-05 10:03:27 -08003042MACHINE_END
3043
3044MACHINE_START(APQ8064_MTP, "QCT APQ8064 MTP")
3045 .map_io = apq8064_map_io,
3046 .reserve = apq8064_reserve,
3047 .init_irq = apq8064_init_irq,
3048 .handle_irq = gic_handle_irq,
3049 .timer = &msm_timer,
3050 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08003051 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07003052 .init_very_early = apq8064_early_reserve,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003053 .restart = msm_restart,
Joel King82b7e3f2012-01-05 10:03:27 -08003054MACHINE_END
3055
3056MACHINE_START(APQ8064_LIQUID, "QCT APQ8064 LIQUID")
3057 .map_io = apq8064_map_io,
3058 .reserve = apq8064_reserve,
3059 .init_irq = apq8064_init_irq,
3060 .handle_irq = gic_handle_irq,
3061 .timer = &msm_timer,
3062 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08003063 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07003064 .init_very_early = apq8064_early_reserve,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003065 .restart = msm_restart,
Joel King82b7e3f2012-01-05 10:03:27 -08003066MACHINE_END
3067
Joel King064bbf82012-04-01 13:23:39 -07003068MACHINE_START(MPQ8064_CDP, "QCT MPQ8064 CDP")
3069 .map_io = apq8064_map_io,
3070 .reserve = apq8064_reserve,
3071 .init_irq = apq8064_init_irq,
3072 .handle_irq = gic_handle_irq,
3073 .timer = &msm_timer,
3074 .init_machine = apq8064_cdp_init,
3075 .init_early = apq8064_allocate_memory_regions,
3076 .init_very_early = apq8064_early_reserve,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003077 .restart = msm_restart,
Joel King064bbf82012-04-01 13:23:39 -07003078MACHINE_END
3079
Joel King11ca8202012-02-13 16:19:03 -08003080MACHINE_START(MPQ8064_HRD, "QCT MPQ8064 HRD")
3081 .map_io = apq8064_map_io,
3082 .reserve = apq8064_reserve,
3083 .init_irq = apq8064_init_irq,
3084 .handle_irq = gic_handle_irq,
3085 .timer = &msm_timer,
3086 .init_machine = apq8064_cdp_init,
Joel King3a57e772012-05-28 11:22:55 -07003087 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07003088 .init_very_early = apq8064_early_reserve,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003089 .restart = msm_restart,
Joel King11ca8202012-02-13 16:19:03 -08003090MACHINE_END
3091
3092MACHINE_START(MPQ8064_DTV, "QCT MPQ8064 DTV")
3093 .map_io = apq8064_map_io,
3094 .reserve = apq8064_reserve,
3095 .init_irq = apq8064_init_irq,
3096 .handle_irq = gic_handle_irq,
3097 .timer = &msm_timer,
3098 .init_machine = apq8064_cdp_init,
Joel King3a57e772012-05-28 11:22:55 -07003099 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07003100 .init_very_early = apq8064_early_reserve,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003101 .restart = msm_restart,
Joel King11ca8202012-02-13 16:19:03 -08003102MACHINE_END
3103