blob: f9b1e2efec0b3f8101bf165911044bd20f24ae1e [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>
14#include <linux/platform_device.h>
15#include <linux/io.h>
16#include <linux/irq.h>
Kenneth Heitke748593a2011-07-15 15:45:11 -060017#include <linux/i2c.h>
David Keitel2f613d92012-02-15 11:29:16 -080018#include <linux/i2c/smb349.h>
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -080019#include <linux/i2c/sx150x.h>
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -060020#include <linux/slimbus/slimbus.h>
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +053021#include <linux/mfd/wcd9xxx/core.h>
22#include <linux/mfd/wcd9xxx/pdata.h>
Amy Maloche70090f992012-02-16 16:35:26 -080023#include <linux/mfd/pm8xxx/misc.h>
Kenneth Heitke36920d32011-07-20 16:44:30 -060024#include <linux/msm_ssbi.h>
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -070025#include <linux/spi/spi.h>
Ramesh Masavarapu28311912011-10-27 11:04:12 -070026#include <linux/dma-mapping.h>
27#include <linux/platform_data/qcom_crypto_device.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080028#include <linux/ion.h>
Jack Cheung46bfffa2012-01-19 15:26:24 -080029#include <linux/memory.h>
Jing Lin21ed4de2012-02-05 15:53:28 -080030#include <linux/i2c/atmel_mxt_ts.h>
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -080031#include <linux/cyttsp.h>
Amy Maloche70090f992012-02-16 16:35:26 -080032#include <linux/i2c/isa1200.h>
Mohan Pallaka474b94b2012-01-25 12:59:58 +053033#include <linux/gpio_keys.h>
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -080034#include <linux/epm_adc.h>
Jay Chokshie7d8d4f2012-04-04 14:47:57 -070035#include <linux/i2c/sx150x.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070036#include <asm/mach-types.h>
37#include <asm/mach/arch.h>
38#include <asm/hardware/gic.h>
Sahitya Tummala3586ed92011-08-03 09:13:23 +053039#include <asm/mach/mmc.h>
Ankit Verma6b7e2ba2012-01-26 15:48:54 -080040#include <linux/platform_data/qcom_wcnss_device.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070041
42#include <mach/board.h>
43#include <mach/msm_iomap.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080044#include <mach/ion.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070045#include <linux/usb/msm_hsusb.h>
46#include <linux/usb/android.h>
47#include <mach/socinfo.h>
Harini Jayaramanc4c58692011-07-19 14:50:10 -060048#include <mach/msm_spi.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070049#include "timer.h"
50#include "devices.h"
Joel King4ebccc62011-07-22 09:43:22 -070051#include <mach/gpio.h>
52#include <mach/gpiomux.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060053#include <mach/rpm.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080054#ifdef CONFIG_ANDROID_PMEM
Kevin Chan13be4e22011-10-20 11:30:32 -070055#include <linux/android_pmem.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080056#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070057#include <mach/msm_memtypes.h>
58#include <linux/bootmem.h>
59#include <asm/setup.h>
Ramesh Masavarapu28311912011-10-27 11:04:12 -070060#include <mach/dma.h>
Jin Hongd3024e62012-02-09 16:13:32 -080061#include <mach/msm_dsps.h>
Gagan Mac8a7a5d32011-11-11 16:43:06 -070062#include <mach/msm_bus_board.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060063#include <mach/cpuidle.h>
Joel Kingdacbc822012-01-25 13:30:57 -080064#include <mach/mdm2.h>
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -080065#include <linux/msm_tsens.h>
Stephen Boyd4d0d2582012-02-10 14:49:40 -080066#include <mach/msm_xo.h>
Laura Abbott350c8362012-02-28 14:46:52 -080067#include <mach/msm_rtb.h>
Santosh Mardieff9a742012-04-09 23:23:39 +053068#include <sound/cs8427.h>
Ravi Kumar V05931a22012-04-04 17:09:37 +053069#include <media/gpio-ir-recv.h>
Joel King4ebccc62011-07-22 09:43:22 -070070
Jeff Ohlstein7e668552011-10-06 16:17:25 -070071#include "msm_watchdog.h"
Stepan Moskovchenko5a83dba2011-12-05 17:30:17 -080072#include "board-8064.h"
Vikram Mulukutlabc2e9572011-11-04 03:41:38 -070073#include "acpuclock.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060074#include "spm.h"
Subhash Jadavani909e04f2012-04-12 10:52:50 +053075#include <mach/mpm.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060076#include "rpm_resources.h"
Matt Wagantall7cca4642012-02-01 16:43:24 -080077#include "pm.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060078#include "pm-boot.h"
Rajesh Sastrulaaee8af32012-01-20 11:46:31 -080079#include "devices-msm8x60.h"
Hanumant Singh50440d42012-04-23 19:27:16 -070080#include "smd_private.h"
Jay Chokshiea67c622011-07-29 17:12:26 -070081
Olav Haugan7c6aa742012-01-16 16:47:37 -080082#define MSM_PMEM_ADSP_SIZE 0x7800000
Bharath Ramachandramurthy2fd017a2012-03-13 10:21:09 -070083#define MSM_PMEM_AUDIO_SIZE 0x4CF000
Olav Haugan7c6aa742012-01-16 16:47:37 -080084#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
85#define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
86#else
Chetan Kalyan72aac4f2012-02-23 14:56:54 -080087#define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
Olav Haugan7c6aa742012-01-16 16:47:37 -080088#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070089
Olav Haugan7c6aa742012-01-16 16:47:37 -080090#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Bharath Ramachandramurthy2fd017a2012-03-13 10:21:09 -070091#define MSM_PMEM_KERNEL_EBI1_SIZE 0x65000
Olav Haugan129992c2012-03-22 09:54:01 -070092#ifdef CONFIG_MSM_IOMMU
93#define MSM_ION_MM_SIZE 0x3800000
94#define MSM_ION_SF_SIZE 0
95#define MSM_ION_HEAP_NUM 7
96#else
Olav Haugan7c6aa742012-01-16 16:47:37 -080097#define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE
Olav Haugan129992c2012-03-22 09:54:01 -070098#define MSM_ION_SF_SIZE MSM_PMEM_SIZE
99#define MSM_ION_HEAP_NUM 8
100#endif
101#define MSM_ION_MM_FW_SIZE 0x200000 /* (2MB) */
Olav Haugan3a9bd232012-02-15 14:23:27 -0800102#define MSM_ION_QSECOM_SIZE 0x300000 /* (3MB) */
Olav Haugan7c6aa742012-01-16 16:47:37 -0800103#define MSM_ION_MFC_SIZE SZ_8K
Olav Haugan2c43fac2012-01-19 11:06:37 -0800104#define MSM_ION_AUDIO_SIZE MSM_PMEM_AUDIO_SIZE
Olav Haugan7c6aa742012-01-16 16:47:37 -0800105#else
106#define MSM_PMEM_KERNEL_EBI1_SIZE 0x110C000
107#define MSM_ION_HEAP_NUM 1
108#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700109
Olav Haugan7c6aa742012-01-16 16:47:37 -0800110#ifdef CONFIG_KERNEL_PMEM_EBI_REGION
111static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE;
112static int __init pmem_kernel_ebi1_size_setup(char *p)
Kevin Chan13be4e22011-10-20 11:30:32 -0700113{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800114 pmem_kernel_ebi1_size = memparse(p, NULL);
115 return 0;
Kevin Chan13be4e22011-10-20 11:30:32 -0700116}
Olav Haugan7c6aa742012-01-16 16:47:37 -0800117early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup);
118#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700119
Olav Haugan7c6aa742012-01-16 16:47:37 -0800120#ifdef CONFIG_ANDROID_PMEM
Kevin Chan13be4e22011-10-20 11:30:32 -0700121static unsigned pmem_size = MSM_PMEM_SIZE;
122static int __init pmem_size_setup(char *p)
123{
124 pmem_size = memparse(p, NULL);
125 return 0;
126}
127early_param("pmem_size", pmem_size_setup);
128
129static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
130
131static int __init pmem_adsp_size_setup(char *p)
132{
133 pmem_adsp_size = memparse(p, NULL);
134 return 0;
135}
136early_param("pmem_adsp_size", pmem_adsp_size_setup);
137
138static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
139
140static int __init pmem_audio_size_setup(char *p)
141{
142 pmem_audio_size = memparse(p, NULL);
143 return 0;
144}
145early_param("pmem_audio_size", pmem_audio_size_setup);
Olav Haugan7c6aa742012-01-16 16:47:37 -0800146#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700147
Olav Haugan7c6aa742012-01-16 16:47:37 -0800148#ifdef CONFIG_ANDROID_PMEM
149#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700150static struct android_pmem_platform_data android_pmem_pdata = {
151 .name = "pmem",
152 .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING,
153 .cached = 1,
154 .memory_type = MEMTYPE_EBI1,
155};
156
Laura Abbottb93525f2012-04-12 09:57:19 -0700157static struct platform_device apq8064_android_pmem_device = {
Kevin Chan13be4e22011-10-20 11:30:32 -0700158 .name = "android_pmem",
159 .id = 0,
160 .dev = {.platform_data = &android_pmem_pdata},
161};
162
163static struct android_pmem_platform_data android_pmem_adsp_pdata = {
164 .name = "pmem_adsp",
165 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
166 .cached = 0,
167 .memory_type = MEMTYPE_EBI1,
168};
Laura Abbottb93525f2012-04-12 09:57:19 -0700169static struct platform_device apq8064_android_pmem_adsp_device = {
Kevin Chan13be4e22011-10-20 11:30:32 -0700170 .name = "android_pmem",
171 .id = 2,
172 .dev = { .platform_data = &android_pmem_adsp_pdata },
173};
174
175static struct android_pmem_platform_data android_pmem_audio_pdata = {
176 .name = "pmem_audio",
177 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
178 .cached = 0,
179 .memory_type = MEMTYPE_EBI1,
180};
181
Laura Abbottb93525f2012-04-12 09:57:19 -0700182static struct platform_device apq8064_android_pmem_audio_device = {
Kevin Chan13be4e22011-10-20 11:30:32 -0700183 .name = "android_pmem",
184 .id = 4,
185 .dev = { .platform_data = &android_pmem_audio_pdata },
186};
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700187#endif /* CONFIG_MSM_MULTIMEDIA_USE_ION */
188#endif /* CONFIG_ANDROID_PMEM */
Olav Haugan7c6aa742012-01-16 16:47:37 -0800189
190static struct memtype_reserve apq8064_reserve_table[] __initdata = {
191 [MEMTYPE_SMI] = {
192 },
193 [MEMTYPE_EBI0] = {
194 .flags = MEMTYPE_FLAGS_1M_ALIGN,
195 },
196 [MEMTYPE_EBI1] = {
197 .flags = MEMTYPE_FLAGS_1M_ALIGN,
198 },
199};
Kevin Chan13be4e22011-10-20 11:30:32 -0700200
Laura Abbott350c8362012-02-28 14:46:52 -0800201static void __init reserve_rtb_memory(void)
202{
203#if defined(CONFIG_MSM_RTB)
Laura Abbottb93525f2012-04-12 09:57:19 -0700204 apq8064_reserve_table[MEMTYPE_EBI1].size += apq8064_rtb_pdata.size;
Laura Abbott350c8362012-02-28 14:46:52 -0800205#endif
206}
207
208
Kevin Chan13be4e22011-10-20 11:30:32 -0700209static void __init size_pmem_devices(void)
210{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800211#ifdef CONFIG_ANDROID_PMEM
212#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700213 android_pmem_adsp_pdata.size = pmem_adsp_size;
214 android_pmem_pdata.size = pmem_size;
215 android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE;
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700216#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
217#endif /*CONFIG_ANDROID_PMEM*/
Kevin Chan13be4e22011-10-20 11:30:32 -0700218}
219
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700220#ifdef CONFIG_ANDROID_PMEM
221#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700222static void __init reserve_memory_for(struct android_pmem_platform_data *p)
223{
224 apq8064_reserve_table[p->memory_type].size += p->size;
225}
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700226#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
227#endif /*CONFIG_ANDROID_PMEM*/
Kevin Chan13be4e22011-10-20 11:30:32 -0700228
Kevin Chan13be4e22011-10-20 11:30:32 -0700229static void __init reserve_pmem_memory(void)
230{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800231#ifdef CONFIG_ANDROID_PMEM
232#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700233 reserve_memory_for(&android_pmem_adsp_pdata);
234 reserve_memory_for(&android_pmem_pdata);
235 reserve_memory_for(&android_pmem_audio_pdata);
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700236#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
Kevin Chan13be4e22011-10-20 11:30:32 -0700237 apq8064_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size;
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700238#endif /*CONFIG_ANDROID_PMEM*/
Olav Haugan7c6aa742012-01-16 16:47:37 -0800239}
240
241static int apq8064_paddr_to_memtype(unsigned int paddr)
242{
243 return MEMTYPE_EBI1;
244}
245
246#ifdef CONFIG_ION_MSM
247#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Laura Abbottb93525f2012-04-12 09:57:19 -0700248static struct ion_cp_heap_pdata cp_mm_apq8064_ion_pdata = {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800249 .permission_type = IPT_TYPE_MM_CARVEOUT,
Olav Haugand3d29682012-01-19 10:57:07 -0800250 .align = PAGE_SIZE,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800251};
252
Laura Abbottb93525f2012-04-12 09:57:19 -0700253static struct ion_cp_heap_pdata cp_mfc_apq8064_ion_pdata = {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800254 .permission_type = IPT_TYPE_MFC_SHAREDMEM,
Olav Haugand3d29682012-01-19 10:57:07 -0800255 .align = PAGE_SIZE,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800256};
257
Laura Abbottb93525f2012-04-12 09:57:19 -0700258static struct ion_co_heap_pdata co_apq8064_ion_pdata = {
Olav Haugand3d29682012-01-19 10:57:07 -0800259 .adjacent_mem_id = INVALID_HEAP_ID,
260 .align = PAGE_SIZE,
261};
262
Laura Abbottb93525f2012-04-12 09:57:19 -0700263static struct ion_co_heap_pdata fw_co_apq8064_ion_pdata = {
Olav Haugand3d29682012-01-19 10:57:07 -0800264 .adjacent_mem_id = ION_CP_MM_HEAP_ID,
265 .align = SZ_128K,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800266};
267#endif
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800268
269/**
270 * These heaps are listed in the order they will be allocated. Due to
271 * video hardware restrictions and content protection the FW heap has to
272 * be allocated adjacent (below) the MM heap and the MFC heap has to be
273 * allocated after the MM heap to ensure MFC heap is not more than 256MB
274 * away from the base address of the FW heap.
275 * However, the order of FW heap and MM heap doesn't matter since these
276 * two heaps are taken care of by separate code to ensure they are adjacent
277 * to each other.
278 * Don't swap the order unless you know what you are doing!
279 */
Laura Abbottb93525f2012-04-12 09:57:19 -0700280static struct ion_platform_data apq8064_ion_pdata = {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800281 .nr = MSM_ION_HEAP_NUM,
282 .heaps = {
283 {
284 .id = ION_SYSTEM_HEAP_ID,
285 .type = ION_HEAP_TYPE_SYSTEM,
286 .name = ION_VMALLOC_HEAP_NAME,
287 },
288#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
289 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800290 .id = ION_CP_MM_HEAP_ID,
291 .type = ION_HEAP_TYPE_CP,
292 .name = ION_MM_HEAP_NAME,
293 .size = MSM_ION_MM_SIZE,
294 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700295 .extra_data = (void *) &cp_mm_apq8064_ion_pdata,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800296 },
297 {
Olav Haugand3d29682012-01-19 10:57:07 -0800298 .id = ION_MM_FIRMWARE_HEAP_ID,
299 .type = ION_HEAP_TYPE_CARVEOUT,
300 .name = ION_MM_FIRMWARE_HEAP_NAME,
301 .size = MSM_ION_MM_FW_SIZE,
302 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700303 .extra_data = (void *) &fw_co_apq8064_ion_pdata,
Olav Haugand3d29682012-01-19 10:57:07 -0800304 },
305 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800306 .id = ION_CP_MFC_HEAP_ID,
307 .type = ION_HEAP_TYPE_CP,
308 .name = ION_MFC_HEAP_NAME,
309 .size = MSM_ION_MFC_SIZE,
310 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700311 .extra_data = (void *) &cp_mfc_apq8064_ion_pdata,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800312 },
Olav Haugan129992c2012-03-22 09:54:01 -0700313#ifndef CONFIG_MSM_IOMMU
Olav Haugan7c6aa742012-01-16 16:47:37 -0800314 {
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800315 .id = ION_SF_HEAP_ID,
316 .type = ION_HEAP_TYPE_CARVEOUT,
317 .name = ION_SF_HEAP_NAME,
318 .size = MSM_ION_SF_SIZE,
319 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700320 .extra_data = (void *) &co_apq8064_ion_pdata,
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800321 },
Olav Haugan129992c2012-03-22 09:54:01 -0700322#endif
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800323 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800324 .id = ION_IOMMU_HEAP_ID,
325 .type = ION_HEAP_TYPE_IOMMU,
326 .name = ION_IOMMU_HEAP_NAME,
327 },
Olav Hauganf45e2142012-01-19 11:01:01 -0800328 {
329 .id = ION_QSECOM_HEAP_ID,
330 .type = ION_HEAP_TYPE_CARVEOUT,
331 .name = ION_QSECOM_HEAP_NAME,
332 .size = MSM_ION_QSECOM_SIZE,
333 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700334 .extra_data = (void *) &co_apq8064_ion_pdata,
Olav Hauganf45e2142012-01-19 11:01:01 -0800335 },
Olav Haugan2c43fac2012-01-19 11:06:37 -0800336 {
337 .id = ION_AUDIO_HEAP_ID,
338 .type = ION_HEAP_TYPE_CARVEOUT,
339 .name = ION_AUDIO_HEAP_NAME,
340 .size = MSM_ION_AUDIO_SIZE,
341 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700342 .extra_data = (void *) &co_apq8064_ion_pdata,
Olav Haugan2c43fac2012-01-19 11:06:37 -0800343 },
Olav Haugan7c6aa742012-01-16 16:47:37 -0800344#endif
345 }
346};
347
Laura Abbottb93525f2012-04-12 09:57:19 -0700348static struct platform_device apq8064_ion_dev = {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800349 .name = "ion-msm",
350 .id = 1,
Laura Abbottb93525f2012-04-12 09:57:19 -0700351 .dev = { .platform_data = &apq8064_ion_pdata },
Olav Haugan7c6aa742012-01-16 16:47:37 -0800352};
353#endif
354
Stephen Boyd668d7652012-04-25 11:31:01 -0700355static void __init reserve_ion_memory(void)
Olav Haugan7c6aa742012-01-16 16:47:37 -0800356{
357#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
358 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_SIZE;
Olav Haugand3d29682012-01-19 10:57:07 -0800359 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_FW_SIZE;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800360 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_SF_SIZE;
361 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MFC_SIZE;
Olav Hauganf45e2142012-01-19 11:01:01 -0800362 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_QSECOM_SIZE;
Olav Haugan2c43fac2012-01-19 11:06:37 -0800363 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_AUDIO_SIZE;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800364#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700365}
366
Huaibin Yang4a084e32011-12-15 15:25:52 -0800367static void __init reserve_mdp_memory(void)
368{
369 apq8064_mdp_writeback(apq8064_reserve_table);
370}
371
Kevin Chan13be4e22011-10-20 11:30:32 -0700372static void __init apq8064_calculate_reserve_sizes(void)
373{
374 size_pmem_devices();
375 reserve_pmem_memory();
Olav Haugan7c6aa742012-01-16 16:47:37 -0800376 reserve_ion_memory();
Huaibin Yang4a084e32011-12-15 15:25:52 -0800377 reserve_mdp_memory();
Laura Abbott350c8362012-02-28 14:46:52 -0800378 reserve_rtb_memory();
Kevin Chan13be4e22011-10-20 11:30:32 -0700379}
380
381static struct reserve_info apq8064_reserve_info __initdata = {
382 .memtype_reserve_table = apq8064_reserve_table,
383 .calculate_reserve_sizes = apq8064_calculate_reserve_sizes,
384 .paddr_to_memtype = apq8064_paddr_to_memtype,
385};
386
387static int apq8064_memory_bank_size(void)
388{
389 return 1<<29;
390}
391
392static void __init locate_unstable_memory(void)
393{
394 struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1];
395 unsigned long bank_size;
396 unsigned long low, high;
397
398 bank_size = apq8064_memory_bank_size();
399 low = meminfo.bank[0].start;
400 high = mb->start + mb->size;
Olav Haugand76e3a82012-01-16 16:55:07 -0800401
402 /* Check if 32 bit overflow occured */
403 if (high < mb->start)
404 high = ~0UL;
405
Kevin Chan13be4e22011-10-20 11:30:32 -0700406 low &= ~(bank_size - 1);
407
408 if (high - low <= bank_size)
409 return;
Jack Cheung46bfffa2012-01-19 15:26:24 -0800410 apq8064_reserve_info.low_unstable_address = mb->start -
411 MIN_MEMORY_BLOCK_SIZE + mb->size;
412 apq8064_reserve_info.max_unstable_size = MIN_MEMORY_BLOCK_SIZE;
413
Kevin Chan13be4e22011-10-20 11:30:32 -0700414 apq8064_reserve_info.bank_size = bank_size;
415 pr_info("low unstable address %lx max size %lx bank size %lx\n",
416 apq8064_reserve_info.low_unstable_address,
417 apq8064_reserve_info.max_unstable_size,
418 apq8064_reserve_info.bank_size);
419}
420
Hanumant Singh50440d42012-04-23 19:27:16 -0700421static int apq8064_change_memory_power(u64 start, u64 size,
422 int change_type)
423{
424 return soc_change_memory_power(start, size, change_type);
425}
426
Aravind Venkateswaran8ac7f412012-03-16 17:57:30 -0700427static char prim_panel_name[PANEL_NAME_MAX_LEN];
428static char ext_panel_name[PANEL_NAME_MAX_LEN];
429static int __init prim_display_setup(char *param)
430{
431 if (strnlen(param, PANEL_NAME_MAX_LEN))
432 strlcpy(prim_panel_name, param, PANEL_NAME_MAX_LEN);
433 return 0;
434}
435early_param("prim_display", prim_display_setup);
436
437static int __init ext_display_setup(char *param)
438{
439 if (strnlen(param, PANEL_NAME_MAX_LEN))
440 strlcpy(ext_panel_name, param, PANEL_NAME_MAX_LEN);
441 return 0;
442}
443early_param("ext_display", ext_display_setup);
444
Kevin Chan13be4e22011-10-20 11:30:32 -0700445static void __init apq8064_reserve(void)
446{
Aravind Venkateswaran8ac7f412012-03-16 17:57:30 -0700447 apq8064_set_display_params(prim_panel_name, ext_panel_name);
Kevin Chan13be4e22011-10-20 11:30:32 -0700448 msm_reserve();
449}
450
Laura Abbott6988cef2012-03-15 14:27:13 -0700451static void __init place_movable_zone(void)
452{
453 movable_reserved_start = apq8064_reserve_info.low_unstable_address;
454 movable_reserved_size = apq8064_reserve_info.max_unstable_size;
455 pr_info("movable zone start %lx size %lx\n",
456 movable_reserved_start, movable_reserved_size);
457}
458
459static void __init apq8064_early_reserve(void)
460{
461 reserve_info = &apq8064_reserve_info;
462 locate_unstable_memory();
463 place_movable_zone();
464
465}
Hemant Kumara945b472012-01-25 15:08:06 -0800466#ifdef CONFIG_USB_EHCI_MSM_HSIC
Hemant Kumare6275972012-02-29 20:06:21 -0800467/* Bandwidth requests (zero) if no vote placed */
468static struct msm_bus_vectors hsic_init_vectors[] = {
469 {
470 .src = MSM_BUS_MASTER_SPS,
471 .dst = MSM_BUS_SLAVE_EBI_CH0,
472 .ab = 0,
473 .ib = 0,
474 },
475 {
476 .src = MSM_BUS_MASTER_SPS,
477 .dst = MSM_BUS_SLAVE_SPS,
478 .ab = 0,
479 .ib = 0,
480 },
481};
482
483/* Bus bandwidth requests in Bytes/sec */
484static struct msm_bus_vectors hsic_max_vectors[] = {
485 {
486 .src = MSM_BUS_MASTER_SPS,
487 .dst = MSM_BUS_SLAVE_EBI_CH0,
488 .ab = 60000000, /* At least 480Mbps on bus. */
489 .ib = 960000000, /* MAX bursts rate */
490 },
491 {
492 .src = MSM_BUS_MASTER_SPS,
493 .dst = MSM_BUS_SLAVE_SPS,
494 .ab = 0,
495 .ib = 512000000, /*vote for 64Mhz dfab clk rate*/
496 },
497};
498
499static struct msm_bus_paths hsic_bus_scale_usecases[] = {
500 {
501 ARRAY_SIZE(hsic_init_vectors),
502 hsic_init_vectors,
503 },
504 {
505 ARRAY_SIZE(hsic_max_vectors),
506 hsic_max_vectors,
507 },
508};
509
510static struct msm_bus_scale_pdata hsic_bus_scale_pdata = {
511 hsic_bus_scale_usecases,
512 ARRAY_SIZE(hsic_bus_scale_usecases),
513 .name = "hsic",
514};
515
Hemant Kumara945b472012-01-25 15:08:06 -0800516static struct msm_hsic_host_platform_data msm_hsic_pdata = {
Hemant Kumare6275972012-02-29 20:06:21 -0800517 .strobe = 88,
518 .data = 89,
519 .bus_scale_table = &hsic_bus_scale_pdata,
Hemant Kumara945b472012-01-25 15:08:06 -0800520};
521#else
522static struct msm_hsic_host_platform_data msm_hsic_pdata;
523#endif
524
Hemant Kumarcb7d8a12012-01-25 12:25:55 -0800525#define PID_MAGIC_ID 0x71432909
526#define SERIAL_NUM_MAGIC_ID 0x61945374
527#define SERIAL_NUMBER_LENGTH 127
528#define DLOAD_USB_BASE_ADD 0x2A03F0C8
529
530struct magic_num_struct {
531 uint32_t pid;
532 uint32_t serial_num;
533};
534
535struct dload_struct {
536 uint32_t reserved1;
537 uint32_t reserved2;
538 uint32_t reserved3;
539 uint16_t reserved4;
540 uint16_t pid;
541 char serial_number[SERIAL_NUMBER_LENGTH];
542 uint16_t reserved5;
543 struct magic_num_struct magic_struct;
544};
545
546static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
547{
548 struct dload_struct __iomem *dload = 0;
549
550 dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload));
551 if (!dload) {
552 pr_err("%s: cannot remap I/O memory region: %08x\n",
553 __func__, DLOAD_USB_BASE_ADD);
554 return -ENXIO;
555 }
556
557 pr_debug("%s: dload:%p pid:%x serial_num:%s\n",
558 __func__, dload, pid, snum);
559 /* update pid */
560 dload->magic_struct.pid = PID_MAGIC_ID;
561 dload->pid = pid;
562
563 /* update serial number */
564 dload->magic_struct.serial_num = 0;
565 if (!snum) {
566 memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH);
567 goto out;
568 }
569
570 dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID;
571 strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH);
572out:
573 iounmap(dload);
574 return 0;
575}
576
577static struct android_usb_platform_data android_usb_pdata = {
578 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
579};
580
Hemant Kumar4933b072011-10-17 23:43:11 -0700581static struct platform_device android_usb_device = {
Hemant Kumarcb7d8a12012-01-25 12:25:55 -0800582 .name = "android_usb",
583 .id = -1,
584 .dev = {
585 .platform_data = &android_usb_pdata,
586 },
Hemant Kumar4933b072011-10-17 23:43:11 -0700587};
588
Hemant Kumar7620eed2012-02-26 09:08:43 -0800589/* Bandwidth requests (zero) if no vote placed */
590static struct msm_bus_vectors usb_init_vectors[] = {
591 {
592 .src = MSM_BUS_MASTER_SPS,
593 .dst = MSM_BUS_SLAVE_EBI_CH0,
594 .ab = 0,
595 .ib = 0,
596 },
597};
598
599/* Bus bandwidth requests in Bytes/sec */
600static struct msm_bus_vectors usb_max_vectors[] = {
601 {
602 .src = MSM_BUS_MASTER_SPS,
603 .dst = MSM_BUS_SLAVE_EBI_CH0,
604 .ab = 60000000, /* At least 480Mbps on bus. */
605 .ib = 960000000, /* MAX bursts rate */
606 },
607};
608
609static struct msm_bus_paths usb_bus_scale_usecases[] = {
610 {
611 ARRAY_SIZE(usb_init_vectors),
612 usb_init_vectors,
613 },
614 {
615 ARRAY_SIZE(usb_max_vectors),
616 usb_max_vectors,
617 },
618};
619
620static struct msm_bus_scale_pdata usb_bus_scale_pdata = {
621 usb_bus_scale_usecases,
622 ARRAY_SIZE(usb_bus_scale_usecases),
623 .name = "usb",
624};
625
Vamsi Krishna1f8704c2012-03-29 18:24:24 -0700626static int phy_init_seq[] = {
627 0x38, 0x81, /* update DC voltage level */
628 0x24, 0x82, /* set pre-emphasis and rise/fall time */
629 -1
630};
631
Hemant Kumar4933b072011-10-17 23:43:11 -0700632static struct msm_otg_platform_data msm_otg_pdata = {
Hemant Kumard86c4882012-01-24 19:39:37 -0800633 .mode = USB_OTG,
634 .otg_control = OTG_PMIC_CONTROL,
Hemant Kumar4933b072011-10-17 23:43:11 -0700635 .phy_type = SNPS_28NM_INTEGRATED_PHY,
Hemant Kumard86c4882012-01-24 19:39:37 -0800636 .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE),
637 .power_budget = 750,
Hemant Kumar7620eed2012-02-26 09:08:43 -0800638 .bus_scale_table = &usb_bus_scale_pdata,
Vamsi Krishna1f8704c2012-03-29 18:24:24 -0700639 .phy_init_seq = phy_init_seq,
Hemant Kumar4933b072011-10-17 23:43:11 -0700640};
641
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800642static struct msm_usb_host_platform_data msm_ehci_host_pdata3 = {
Manu Gautam91223e02011-11-08 15:27:22 +0530643 .power_budget = 500,
644};
645
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800646#ifdef CONFIG_USB_EHCI_MSM_HOST4
647static struct msm_usb_host_platform_data msm_ehci_host_pdata4;
648#endif
649
Manu Gautam91223e02011-11-08 15:27:22 +0530650static void __init apq8064_ehci_host_init(void)
651{
652 if (machine_is_apq8064_liquid()) {
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800653 msm_ehci_host_pdata3.dock_connect_irq =
Hemant Kumar56925352012-02-13 16:59:52 -0800654 PM8921_MPP_IRQ(PM8921_IRQ_BASE, 9);
655
Manu Gautam91223e02011-11-08 15:27:22 +0530656 apq8064_device_ehci_host3.dev.platform_data =
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800657 &msm_ehci_host_pdata3;
Manu Gautam91223e02011-11-08 15:27:22 +0530658 platform_device_register(&apq8064_device_ehci_host3);
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800659
660#ifdef CONFIG_USB_EHCI_MSM_HOST4
661 apq8064_device_ehci_host4.dev.platform_data =
662 &msm_ehci_host_pdata4;
663 platform_device_register(&apq8064_device_ehci_host4);
664#endif
Manu Gautam91223e02011-11-08 15:27:22 +0530665 }
666}
667
David Keitel2f613d92012-02-15 11:29:16 -0800668static struct smb349_platform_data smb349_data __initdata = {
669 .en_n_gpio = PM8921_GPIO_PM_TO_SYS(37),
670 .chg_susp_gpio = PM8921_GPIO_PM_TO_SYS(30),
671 .chg_current_ma = 2200,
672};
673
674static struct i2c_board_info smb349_charger_i2c_info[] __initdata = {
675 {
676 I2C_BOARD_INFO(SMB349_NAME, 0x1B),
677 .platform_data = &smb349_data,
678 },
679};
680
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -0800681struct sx150x_platform_data apq8064_sx150x_data[] = {
682 [SX150X_EPM] = {
683 .gpio_base = GPIO_EPM_EXPANDER_BASE,
684 .oscio_is_gpo = false,
685 .io_pullup_ena = 0x0,
686 .io_pulldn_ena = 0x0,
687 .io_open_drain_ena = 0x0,
688 .io_polarity = 0,
689 .irq_summary = -1,
690 },
691};
692
693static struct epm_chan_properties ads_adc_channel_data[] = {
694 {10, 100}, {500, 50}, {1, 1}, {1, 1},
695 {20, 50}, {10, 100}, {1, 1}, {1, 1},
696 {10, 100}, {10, 100}, {100, 100}, {200, 100},
697 {100, 50}, {2000, 50}, {1000, 50}, {200, 50},
698 {200, 100}, {1, 1}, {20, 50}, {500, 50},
699 {50, 50}, {200, 100}, {500, 100}, {20, 50},
700 {200, 50}, {2000, 100}, {1000, 50}, {100, 50},
701 {200, 100}, {500, 50}, {1000, 100}, {200, 50},
702 {1000, 50}, {50, 50}, {100, 50}, {100, 50},
703 {1, 1}, {1, 1}, {20, 100}, {20, 50},
704 {500, 100}, {1000, 100}, {100, 50}, {1000, 50},
705 {100, 50}, {1000, 100}, {100, 50}, {100, 50},
706};
707
708static struct epm_adc_platform_data epm_adc_pdata = {
709 .channel = ads_adc_channel_data,
710 .bus_id = 0x0,
711 .epm_i2c_board_info = {
712 .type = "sx1509q",
713 .addr = 0x3e,
714 .platform_data = &apq8064_sx150x_data[SX150X_EPM],
715 },
716 .gpio_expander_base_addr = GPIO_EPM_EXPANDER_BASE,
717};
718
719static struct platform_device epm_adc_device = {
720 .name = "epm_adc",
721 .id = -1,
722 .dev = {
723 .platform_data = &epm_adc_pdata,
724 },
725};
726
727static void __init apq8064_epm_adc_init(void)
728{
729 epm_adc_pdata.num_channels = 32;
730 epm_adc_pdata.num_adc = 2;
731 epm_adc_pdata.chan_per_adc = 16;
732 epm_adc_pdata.chan_per_mux = 8;
733};
734
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800735/* Micbias setting is based on 8660 CDP/MTP/FLUID requirement
736 * 4 micbiases are used to power various analog and digital
737 * microphones operating at 1800 mV. Technically, all micbiases
738 * can source from single cfilter since all microphones operate
739 * at the same voltage level. The arrangement below is to make
740 * sure all cfilters are exercised. LDO_H regulator ouput level
741 * does not need to be as high as 2.85V. It is choosen for
742 * microphone sensitivity purpose.
743 */
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530744static struct wcd9xxx_pdata apq8064_tabla_platform_data = {
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800745 .slimbus_slave_device = {
746 .name = "tabla-slave",
747 .e_addr = {0, 0, 0x10, 0, 0x17, 2},
748 },
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800749 .irq = MSM_GPIO_TO_INT(42),
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800750 .irq_base = TABLA_INTERRUPT_BASE,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530751 .num_irqs = NR_WCD9XXX_IRQS,
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800752 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
753 .micbias = {
754 .ldoh_v = TABLA_LDOH_2P85_V,
755 .cfilt1_mv = 1800,
756 .cfilt2_mv = 1800,
757 .cfilt3_mv = 1800,
758 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
759 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
760 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
761 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530762 },
763 .regulator = {
764 {
765 .name = "CDC_VDD_CP",
766 .min_uV = 1800000,
767 .max_uV = 1800000,
768 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
769 },
770 {
771 .name = "CDC_VDDA_RX",
772 .min_uV = 1800000,
773 .max_uV = 1800000,
774 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
775 },
776 {
777 .name = "CDC_VDDA_TX",
778 .min_uV = 1800000,
779 .max_uV = 1800000,
780 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
781 },
782 {
783 .name = "VDDIO_CDC",
784 .min_uV = 1800000,
785 .max_uV = 1800000,
786 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
787 },
788 {
789 .name = "VDDD_CDC_D",
790 .min_uV = 1225000,
791 .max_uV = 1225000,
792 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
793 },
794 {
795 .name = "CDC_VDDA_A_1P2V",
796 .min_uV = 1225000,
797 .max_uV = 1225000,
798 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
799 },
800 },
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800801};
802
803static struct slim_device apq8064_slim_tabla = {
804 .name = "tabla-slim",
805 .e_addr = {0, 1, 0x10, 0, 0x17, 2},
806 .dev = {
807 .platform_data = &apq8064_tabla_platform_data,
808 },
809};
810
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530811static struct wcd9xxx_pdata apq8064_tabla20_platform_data = {
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800812 .slimbus_slave_device = {
813 .name = "tabla-slave",
814 .e_addr = {0, 0, 0x60, 0, 0x17, 2},
815 },
816 .irq = MSM_GPIO_TO_INT(42),
817 .irq_base = TABLA_INTERRUPT_BASE,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530818 .num_irqs = NR_WCD9XXX_IRQS,
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800819 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
820 .micbias = {
821 .ldoh_v = TABLA_LDOH_2P85_V,
822 .cfilt1_mv = 1800,
823 .cfilt2_mv = 1800,
824 .cfilt3_mv = 1800,
825 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
826 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
827 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
828 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530829 },
830 .regulator = {
831 {
832 .name = "CDC_VDD_CP",
833 .min_uV = 1800000,
834 .max_uV = 1800000,
835 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
836 },
837 {
838 .name = "CDC_VDDA_RX",
839 .min_uV = 1800000,
840 .max_uV = 1800000,
841 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
842 },
843 {
844 .name = "CDC_VDDA_TX",
845 .min_uV = 1800000,
846 .max_uV = 1800000,
847 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
848 },
849 {
850 .name = "VDDIO_CDC",
851 .min_uV = 1800000,
852 .max_uV = 1800000,
853 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
854 },
855 {
856 .name = "VDDD_CDC_D",
857 .min_uV = 1225000,
858 .max_uV = 1225000,
859 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
860 },
861 {
862 .name = "CDC_VDDA_A_1P2V",
863 .min_uV = 1225000,
864 .max_uV = 1225000,
865 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
866 },
867 },
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800868};
869
870static struct slim_device apq8064_slim_tabla20 = {
871 .name = "tabla2x-slim",
872 .e_addr = {0, 1, 0x60, 0, 0x17, 2},
873 .dev = {
874 .platform_data = &apq8064_tabla20_platform_data,
875 },
876};
877
Santosh Mardi695be0d2012-04-10 23:21:12 +0530878/* enable the level shifter for cs8427 to make sure the I2C
879 * clock is running at 100KHz and voltage levels are at 3.3
880 * and 5 volts
881 */
882static int enable_100KHz_ls(int enable)
883{
884 int ret = 0;
885 if (enable) {
886 ret = gpio_request(SX150X_GPIO(1, 10),
887 "cs8427_100KHZ_ENABLE");
888 if (ret) {
889 pr_err("%s: Failed to request gpio %d\n", __func__,
890 SX150X_GPIO(1, 10));
891 return ret;
892 }
893 gpio_direction_output(SX150X_GPIO(1, 10), 1);
894 } else
895 gpio_free(SX150X_GPIO(1, 10));
896 return ret;
897}
898
Santosh Mardieff9a742012-04-09 23:23:39 +0530899static struct cs8427_platform_data cs8427_i2c_platform_data = {
900 .irq = SX150X_GPIO(1, 4),
901 .reset_gpio = SX150X_GPIO(1, 6),
Santosh Mardi695be0d2012-04-10 23:21:12 +0530902 .enable = enable_100KHz_ls,
Santosh Mardieff9a742012-04-09 23:23:39 +0530903};
904
905static struct i2c_board_info cs8427_device_info[] __initdata = {
906 {
907 I2C_BOARD_INFO("cs8427", CS8427_ADDR4),
908 .platform_data = &cs8427_i2c_platform_data,
909 },
910};
911
Amy Maloche70090f992012-02-16 16:35:26 -0800912#define HAP_SHIFT_LVL_OE_GPIO PM8921_MPP_PM_TO_SYS(8)
913#define ISA1200_HAP_EN_GPIO PM8921_GPIO_PM_TO_SYS(33)
914#define ISA1200_HAP_LEN_GPIO PM8921_GPIO_PM_TO_SYS(20)
915#define ISA1200_HAP_CLK PM8921_GPIO_PM_TO_SYS(44)
916
917static int isa1200_power(int on)
918{
Amy Maloche8f973892012-03-26 14:53:13 -0700919 int rc = 0;
920
Amy Maloche70090f992012-02-16 16:35:26 -0800921 gpio_set_value_cansleep(ISA1200_HAP_CLK, !!on);
922
Amy Maloche8f973892012-03-26 14:53:13 -0700923 if (on)
924 rc = pm8xxx_aux_clk_control(CLK_MP3_2, XO_DIV_1, true);
925 else
926 rc = pm8xxx_aux_clk_control(CLK_MP3_2, XO_DIV_NONE, true);
927
928 if (rc) {
929 pr_err("%s: unable to write aux clock register(%d)\n",
930 __func__, rc);
931 }
932
933 return rc;
Amy Maloche70090f992012-02-16 16:35:26 -0800934}
935
936static int isa1200_dev_setup(bool enable)
937{
938 int rc = 0;
939
Amy Maloche70090f992012-02-16 16:35:26 -0800940 if (!enable)
941 goto free_gpio;
942
943 rc = gpio_request(ISA1200_HAP_CLK, "haptics_clk");
944 if (rc) {
945 pr_err("%s: unable to request gpio %d config(%d)\n",
946 __func__, ISA1200_HAP_CLK, rc);
947 return rc;
948 }
949
950 rc = gpio_direction_output(ISA1200_HAP_CLK, 0);
951 if (rc) {
952 pr_err("%s: unable to set direction\n", __func__);
953 goto free_gpio;
954 }
955
956 return 0;
957
958free_gpio:
959 gpio_free(ISA1200_HAP_CLK);
960 return rc;
961}
962
963static struct isa1200_regulator isa1200_reg_data[] = {
964 {
965 .name = "vddp",
966 .min_uV = ISA_I2C_VTG_MIN_UV,
967 .max_uV = ISA_I2C_VTG_MAX_UV,
968 .load_uA = ISA_I2C_CURR_UA,
969 },
970};
971
972static struct isa1200_platform_data isa1200_1_pdata = {
973 .name = "vibrator",
974 .dev_setup = isa1200_dev_setup,
975 .power_on = isa1200_power,
976 .hap_en_gpio = ISA1200_HAP_EN_GPIO,
977 .hap_len_gpio = ISA1200_HAP_LEN_GPIO,
978 .max_timeout = 15000,
979 .mode_ctrl = PWM_GEN_MODE,
980 .pwm_fd = {
981 .pwm_div = 256,
982 },
983 .is_erm = false,
984 .smart_en = true,
985 .ext_clk_en = true,
986 .chip_en = 1,
987 .regulator_info = isa1200_reg_data,
988 .num_regulators = ARRAY_SIZE(isa1200_reg_data),
989};
990
991static struct i2c_board_info isa1200_board_info[] __initdata = {
992 {
993 I2C_BOARD_INFO("isa1200_1", 0x90>>1),
994 .platform_data = &isa1200_1_pdata,
995 },
996};
Jing Lin21ed4de2012-02-05 15:53:28 -0800997/* configuration data for mxt1386e using V2.1 firmware */
998static const u8 mxt1386e_config_data_v2_1[] = {
999 /* T6 Object */
1000 0, 0, 0, 0, 0, 0,
1001 /* T38 Object */
Jing Linf1208fd2012-02-23 11:15:42 -08001002 14, 1, 0, 22, 2, 12, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001003 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1004 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1005 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1006 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1007 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1008 0, 0, 0, 0,
1009 /* T7 Object */
Jing Linf1208fd2012-02-23 11:15:42 -08001010 100, 10, 50,
Jing Lin21ed4de2012-02-05 15:53:28 -08001011 /* T8 Object */
Jing Linf1208fd2012-02-23 11:15:42 -08001012 25, 0, 20, 20, 0, 0, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001013 /* T9 Object */
1014 131, 0, 0, 26, 42, 0, 32, 80, 2, 5,
1015 0, 5, 5, 0, 10, 30, 10, 10, 255, 2,
Jing Linf1208fd2012-02-23 11:15:42 -08001016 85, 5, 0, 5, 9, 5, 12, 35, 70, 40,
1017 20, 5, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001018 /* T18 Object */
1019 0, 0,
1020 /* T24 Object */
1021 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1022 0, 0, 0, 0, 0, 0, 0, 0, 0,
1023 /* T25 Object */
1024 3, 0, 60, 115, 156, 99,
1025 /* T27 Object */
1026 0, 0, 0, 0, 0, 0, 0,
1027 /* T40 Object */
1028 0, 0, 0, 0, 0,
1029 /* T42 Object */
1030 2, 0, 255, 0, 255, 0, 0, 0, 0, 0,
1031 /* T43 Object */
1032 0, 0, 0, 0, 0, 0, 0, 64, 0, 8,
1033 16,
1034 /* T46 Object */
Jing Linf1208fd2012-02-23 11:15:42 -08001035 68, 0, 16, 16, 0, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001036 /* T47 Object */
1037 0, 0, 0, 0, 0, 0, 3, 64, 66, 0,
1038 /* T48 Object */
1039 31, 64, 64, 0, 0, 0, 0, 0, 0, 0,
Jing Linf1208fd2012-02-23 11:15:42 -08001040 32, 40, 0, 10, 10, 0, 0, 100, 10, 90,
1041 0, 0, 0, 0, 0, 0, 0, 10, 1, 10,
1042 52, 10, 12, 0, 33, 0, 1, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001043 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1044 0, 0, 0, 0,
1045 /* T56 Object */
1046 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1047 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1048 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1049 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Jing Linf1208fd2012-02-23 11:15:42 -08001050 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1051 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001052};
1053
Terence Hampson2e1705f2012-04-11 19:55:29 -04001054#ifndef CONFIG_MSM_VCAP
Jing Lin21ed4de2012-02-05 15:53:28 -08001055#define MXT_TS_GPIO_IRQ 6
1056#define MXT_TS_PWR_EN_GPIO PM8921_GPIO_PM_TO_SYS(23)
1057#define MXT_TS_RESET_GPIO 33
1058
1059static struct mxt_config_info mxt_config_array[] = {
1060 {
1061 .config = mxt1386e_config_data_v2_1,
1062 .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1),
1063 .family_id = 0xA0,
1064 .variant_id = 0x7,
1065 .version = 0x21,
1066 .build = 0xAA,
Jing Linef4aa9b2012-03-26 12:01:41 -07001067 .bootldr_id = MXT_BOOTLOADER_ID_1386E,
1068 .fw_name = "atmel_8064_liquid_v2_2_AA.hex",
1069 },
1070 {
1071 /* The config data for V2.2.AA is the same as for V2.1.AA */
1072 .config = mxt1386e_config_data_v2_1,
1073 .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1),
1074 .family_id = 0xA0,
1075 .variant_id = 0x7,
1076 .version = 0x22,
1077 .build = 0xAA,
1078 .bootldr_id = MXT_BOOTLOADER_ID_1386E,
Jing Lin21ed4de2012-02-05 15:53:28 -08001079 },
1080};
1081
1082static struct mxt_platform_data mxt_platform_data = {
1083 .config_array = mxt_config_array,
1084 .config_array_size = ARRAY_SIZE(mxt_config_array),
Mohan Pallaka56a1a5d2012-02-23 12:05:13 -08001085 .panel_minx = 0,
1086 .panel_maxx = 1365,
1087 .panel_miny = 0,
1088 .panel_maxy = 767,
1089 .disp_minx = 0,
1090 .disp_maxx = 1365,
1091 .disp_miny = 0,
1092 .disp_maxy = 767,
Anirudh Ghayal39dbe3f2012-04-13 15:43:16 +05301093 .irqflags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
Jing Lin21ed4de2012-02-05 15:53:28 -08001094 .i2c_pull_up = true,
1095 .reset_gpio = MXT_TS_RESET_GPIO,
1096 .irq_gpio = MXT_TS_GPIO_IRQ,
1097};
1098
1099static struct i2c_board_info mxt_device_info[] __initdata = {
1100 {
1101 I2C_BOARD_INFO("atmel_mxt_ts", 0x5b),
1102 .platform_data = &mxt_platform_data,
1103 .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ),
1104 },
1105};
Terence Hampson2e1705f2012-04-11 19:55:29 -04001106#endif
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001107#define CYTTSP_TS_GPIO_IRQ 6
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001108#define CYTTSP_TS_GPIO_SLEEP 33
1109
1110static ssize_t tma340_vkeys_show(struct kobject *kobj,
1111 struct kobj_attribute *attr, char *buf)
1112{
1113 return snprintf(buf, 200,
1114 __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97"
1115 ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97"
1116 ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97"
1117 ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97"
1118 "\n");
1119}
1120
1121static struct kobj_attribute tma340_vkeys_attr = {
1122 .attr = {
1123 .mode = S_IRUGO,
1124 },
1125 .show = &tma340_vkeys_show,
1126};
1127
1128static struct attribute *tma340_properties_attrs[] = {
1129 &tma340_vkeys_attr.attr,
1130 NULL
1131};
1132
1133static struct attribute_group tma340_properties_attr_group = {
1134 .attrs = tma340_properties_attrs,
1135};
1136
1137static int cyttsp_platform_init(struct i2c_client *client)
1138{
1139 int rc = 0;
1140 static struct kobject *tma340_properties_kobj;
1141
1142 tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c";
1143 tma340_properties_kobj = kobject_create_and_add("board_properties",
1144 NULL);
1145 if (tma340_properties_kobj)
1146 rc = sysfs_create_group(tma340_properties_kobj,
1147 &tma340_properties_attr_group);
1148 if (!tma340_properties_kobj || rc)
1149 pr_err("%s: failed to create board_properties\n",
1150 __func__);
1151
1152 return 0;
1153}
1154
1155static struct cyttsp_regulator cyttsp_regulator_data[] = {
1156 {
1157 .name = "vdd",
1158 .min_uV = CY_TMA300_VTG_MIN_UV,
1159 .max_uV = CY_TMA300_VTG_MAX_UV,
1160 .hpm_load_uA = CY_TMA300_CURR_24HZ_UA,
1161 .lpm_load_uA = CY_TMA300_CURR_24HZ_UA,
1162 },
1163 {
1164 .name = "vcc_i2c",
1165 .min_uV = CY_I2C_VTG_MIN_UV,
1166 .max_uV = CY_I2C_VTG_MAX_UV,
1167 .hpm_load_uA = CY_I2C_CURR_UA,
1168 .lpm_load_uA = CY_I2C_CURR_UA,
1169 },
1170};
1171
1172static struct cyttsp_platform_data cyttsp_pdata = {
1173 .panel_maxx = 634,
1174 .panel_maxy = 1166,
1175 .disp_maxx = 599,
1176 .disp_maxy = 1023,
1177 .disp_minx = 0,
1178 .disp_miny = 0,
1179 .flags = 0x01,
1180 .gen = CY_GEN3,
1181 .use_st = CY_USE_ST,
1182 .use_mt = CY_USE_MT,
1183 .use_hndshk = CY_SEND_HNDSHK,
1184 .use_trk_id = CY_USE_TRACKING_ID,
1185 .use_sleep = CY_USE_DEEP_SLEEP_SEL,
1186 .use_gestures = CY_USE_GESTURES,
1187 .fw_fname = "cyttsp_8064_mtp.hex",
1188 /* change act_intrvl to customize the Active power state
1189 * scanning/processing refresh interval for Operating mode
1190 */
1191 .act_intrvl = CY_ACT_INTRVL_DFLT,
1192 /* change tch_tmout to customize the touch timeout for the
1193 * Active power state for Operating mode
1194 */
1195 .tch_tmout = CY_TCH_TMOUT_DFLT,
1196 /* change lp_intrvl to customize the Low Power power state
1197 * scanning/processing refresh interval for Operating mode
1198 */
1199 .lp_intrvl = CY_LP_INTRVL_DFLT,
1200 .sleep_gpio = CYTTSP_TS_GPIO_SLEEP,
Amy Maloche9ba3ffe2012-04-26 10:31:20 -07001201 .resout_gpio = -1,
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001202 .irq_gpio = CYTTSP_TS_GPIO_IRQ,
1203 .regulator_info = cyttsp_regulator_data,
1204 .num_regulators = ARRAY_SIZE(cyttsp_regulator_data),
1205 .init = cyttsp_platform_init,
1206 .correct_fw_ver = 17,
1207};
1208
1209static struct i2c_board_info cyttsp_info[] __initdata = {
1210 {
1211 I2C_BOARD_INFO(CY_I2C_NAME, 0x24),
1212 .platform_data = &cyttsp_pdata,
1213 .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ),
1214 },
1215};
Jing Lin21ed4de2012-02-05 15:53:28 -08001216
Ankit Verma6b7e2ba2012-01-26 15:48:54 -08001217#define MSM_WCNSS_PHYS 0x03000000
1218#define MSM_WCNSS_SIZE 0x280000
1219
1220static struct resource resources_wcnss_wlan[] = {
1221 {
1222 .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1223 .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1224 .name = "wcnss_wlanrx_irq",
1225 .flags = IORESOURCE_IRQ,
1226 },
1227 {
1228 .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1229 .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1230 .name = "wcnss_wlantx_irq",
1231 .flags = IORESOURCE_IRQ,
1232 },
1233 {
1234 .start = MSM_WCNSS_PHYS,
1235 .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1,
1236 .name = "wcnss_mmio",
1237 .flags = IORESOURCE_MEM,
1238 },
1239 {
1240 .start = 64,
1241 .end = 68,
1242 .name = "wcnss_gpios_5wire",
1243 .flags = IORESOURCE_IO,
1244 },
1245};
1246
1247static struct qcom_wcnss_opts qcom_wcnss_pdata = {
1248 .has_48mhz_xo = 1,
1249};
1250
1251static struct platform_device msm_device_wcnss_wlan = {
1252 .name = "wcnss_wlan",
1253 .id = 0,
1254 .num_resources = ARRAY_SIZE(resources_wcnss_wlan),
1255 .resource = resources_wcnss_wlan,
1256 .dev = {.platform_data = &qcom_wcnss_pdata},
1257};
1258
Ankit Vermab7c26e62012-02-28 15:04:15 -08001259static struct platform_device msm_device_iris_fm __devinitdata = {
1260 .name = "iris_fm",
1261 .id = -1,
1262};
1263
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07001264#ifdef CONFIG_QSEECOM
1265/* qseecom bus scaling */
1266static struct msm_bus_vectors qseecom_clks_init_vectors[] = {
1267 {
1268 .src = MSM_BUS_MASTER_SPS,
1269 .dst = MSM_BUS_SLAVE_EBI_CH0,
1270 .ib = 0,
1271 .ab = 0,
1272 },
1273 {
1274 .src = MSM_BUS_MASTER_SPDM,
1275 .dst = MSM_BUS_SLAVE_SPDM,
1276 .ib = 0,
1277 .ab = 0,
1278 },
1279};
1280
1281static struct msm_bus_vectors qseecom_enable_dfab_vectors[] = {
1282 {
1283 .src = MSM_BUS_MASTER_SPS,
1284 .dst = MSM_BUS_SLAVE_EBI_CH0,
1285 .ib = (492 * 8) * 1000000UL,
1286 .ab = (492 * 8) * 100000UL,
1287 },
1288 {
1289 .src = MSM_BUS_MASTER_SPDM,
1290 .dst = MSM_BUS_SLAVE_SPDM,
1291 .ib = 0,
1292 .ab = 0,
1293 },
1294};
1295
1296static struct msm_bus_vectors qseecom_enable_sfpb_vectors[] = {
1297 {
1298 .src = MSM_BUS_MASTER_SPS,
1299 .dst = MSM_BUS_SLAVE_EBI_CH0,
1300 .ib = 0,
1301 .ab = 0,
1302 },
1303 {
1304 .src = MSM_BUS_MASTER_SPDM,
1305 .dst = MSM_BUS_SLAVE_SPDM,
1306 .ib = (64 * 8) * 1000000UL,
1307 .ab = (64 * 8) * 100000UL,
1308 },
1309};
1310
1311static struct msm_bus_paths qseecom_hw_bus_scale_usecases[] = {
1312 {
1313 ARRAY_SIZE(qseecom_clks_init_vectors),
1314 qseecom_clks_init_vectors,
1315 },
1316 {
1317 ARRAY_SIZE(qseecom_enable_dfab_vectors),
1318 qseecom_enable_sfpb_vectors,
1319 },
1320 {
1321 ARRAY_SIZE(qseecom_enable_sfpb_vectors),
1322 qseecom_enable_sfpb_vectors,
1323 },
1324};
1325
1326static struct msm_bus_scale_pdata qseecom_bus_pdata = {
1327 qseecom_hw_bus_scale_usecases,
1328 ARRAY_SIZE(qseecom_hw_bus_scale_usecases),
1329 .name = "qsee",
1330};
1331
1332static struct platform_device qseecom_device = {
1333 .name = "qseecom",
1334 .id = 0,
1335 .dev = {
1336 .platform_data = &qseecom_bus_pdata,
1337 },
1338};
1339#endif
1340
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001341#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1342 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
1343 defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1344 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1345
1346#define QCE_SIZE 0x10000
1347#define QCE_0_BASE 0x11000000
1348
1349#define QCE_HW_KEY_SUPPORT 0
1350#define QCE_SHA_HMAC_SUPPORT 1
1351#define QCE_SHARE_CE_RESOURCE 3
1352#define QCE_CE_SHARED 0
1353
1354static struct resource qcrypto_resources[] = {
1355 [0] = {
1356 .start = QCE_0_BASE,
1357 .end = QCE_0_BASE + QCE_SIZE - 1,
1358 .flags = IORESOURCE_MEM,
1359 },
1360 [1] = {
1361 .name = "crypto_channels",
1362 .start = DMOV8064_CE_IN_CHAN,
1363 .end = DMOV8064_CE_OUT_CHAN,
1364 .flags = IORESOURCE_DMA,
1365 },
1366 [2] = {
1367 .name = "crypto_crci_in",
1368 .start = DMOV8064_CE_IN_CRCI,
1369 .end = DMOV8064_CE_IN_CRCI,
1370 .flags = IORESOURCE_DMA,
1371 },
1372 [3] = {
1373 .name = "crypto_crci_out",
1374 .start = DMOV8064_CE_OUT_CRCI,
1375 .end = DMOV8064_CE_OUT_CRCI,
1376 .flags = IORESOURCE_DMA,
1377 },
1378};
1379
1380static struct resource qcedev_resources[] = {
1381 [0] = {
1382 .start = QCE_0_BASE,
1383 .end = QCE_0_BASE + QCE_SIZE - 1,
1384 .flags = IORESOURCE_MEM,
1385 },
1386 [1] = {
1387 .name = "crypto_channels",
1388 .start = DMOV8064_CE_IN_CHAN,
1389 .end = DMOV8064_CE_OUT_CHAN,
1390 .flags = IORESOURCE_DMA,
1391 },
1392 [2] = {
1393 .name = "crypto_crci_in",
1394 .start = DMOV8064_CE_IN_CRCI,
1395 .end = DMOV8064_CE_IN_CRCI,
1396 .flags = IORESOURCE_DMA,
1397 },
1398 [3] = {
1399 .name = "crypto_crci_out",
1400 .start = DMOV8064_CE_OUT_CRCI,
1401 .end = DMOV8064_CE_OUT_CRCI,
1402 .flags = IORESOURCE_DMA,
1403 },
1404};
1405
1406#endif
1407
1408#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1409 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1410
1411static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
1412 .ce_shared = QCE_CE_SHARED,
1413 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1414 .hw_key_support = QCE_HW_KEY_SUPPORT,
1415 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -08001416 .bus_scale_table = NULL,
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001417};
1418
1419static struct platform_device qcrypto_device = {
1420 .name = "qcrypto",
1421 .id = 0,
1422 .num_resources = ARRAY_SIZE(qcrypto_resources),
1423 .resource = qcrypto_resources,
1424 .dev = {
1425 .coherent_dma_mask = DMA_BIT_MASK(32),
1426 .platform_data = &qcrypto_ce_hw_suppport,
1427 },
1428};
1429#endif
1430
1431#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1432 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1433
1434static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
1435 .ce_shared = QCE_CE_SHARED,
1436 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1437 .hw_key_support = QCE_HW_KEY_SUPPORT,
1438 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -08001439 .bus_scale_table = NULL,
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001440};
1441
1442static struct platform_device qcedev_device = {
1443 .name = "qce",
1444 .id = 0,
1445 .num_resources = ARRAY_SIZE(qcedev_resources),
1446 .resource = qcedev_resources,
1447 .dev = {
1448 .coherent_dma_mask = DMA_BIT_MASK(32),
1449 .platform_data = &qcedev_ce_hw_suppport,
1450 },
1451};
1452#endif
1453
Joel Kingdacbc822012-01-25 13:30:57 -08001454static struct mdm_platform_data mdm_platform_data = {
1455 .mdm_version = "3.0",
1456 .ramdump_delay_ms = 2000,
Hemant Kumara945b472012-01-25 15:08:06 -08001457 .peripheral_platform_device = &apq8064_device_hsic_host,
Joel Kingdacbc822012-01-25 13:30:57 -08001458};
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001459
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -08001460static struct tsens_platform_data apq_tsens_pdata = {
1461 .tsens_factor = 1000,
1462 .hw_type = APQ_8064,
1463 .tsens_num_sensor = 11,
1464 .slope = {1176, 1176, 1154, 1176, 1111,
1465 1132, 1132, 1199, 1132, 1199, 1132},
1466};
1467
Siddartha Mohanadoss48cad912012-04-05 21:29:54 -07001468static struct platform_device msm_tsens_device = {
1469 .name = "tsens8960-tm",
1470 .id = -1,
1471};
1472
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001473#define MSM_SHARED_RAM_PHYS 0x80000000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001474static void __init apq8064_map_io(void)
1475{
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001476 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001477 msm_map_apq8064_io();
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -07001478 if (socinfo_init() < 0)
1479 pr_err("socinfo_init() failed!\n");
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001480}
1481
1482static void __init apq8064_init_irq(void)
1483{
Praveen Chidambaram78499012011-11-01 17:15:17 -06001484 struct msm_mpm_device_data *data = NULL;
1485
1486#ifdef CONFIG_MSM_MPM
1487 data = &apq8064_mpm_dev_data;
1488#endif
1489
1490 msm_mpm_irq_extn_init(data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001491 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
1492 (void *)MSM_QGIC_CPU_BASE);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001493}
1494
Jay Chokshi7805b5a2011-11-07 15:55:30 -08001495static struct platform_device msm8064_device_saw_regulator_core0 = {
1496 .name = "saw-regulator",
1497 .id = 0,
1498 .dev = {
1499 .platform_data = &msm8064_saw_regulator_pdata_8921_s5,
1500 },
1501};
1502
1503static struct platform_device msm8064_device_saw_regulator_core1 = {
1504 .name = "saw-regulator",
1505 .id = 1,
1506 .dev = {
1507 .platform_data = &msm8064_saw_regulator_pdata_8921_s6,
1508 },
1509};
1510
1511static struct platform_device msm8064_device_saw_regulator_core2 = {
1512 .name = "saw-regulator",
1513 .id = 2,
1514 .dev = {
1515 .platform_data = &msm8064_saw_regulator_pdata_8821_s0,
1516 },
1517};
1518
1519static struct platform_device msm8064_device_saw_regulator_core3 = {
1520 .name = "saw-regulator",
1521 .id = 3,
1522 .dev = {
1523 .platform_data = &msm8064_saw_regulator_pdata_8821_s1,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001524
1525 },
1526};
1527
Oluwafemi Adeyemif5a31422012-03-08 16:58:45 -08001528static struct msm_rpmrs_level msm_rpmrs_levels[] = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06001529 {
1530 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
1531 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
1532 true,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001533 100, 650, 801, 200,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001534 },
1535
1536 {
1537 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
1538 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
1539 true,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001540 2000, 200, 576000, 2000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001541 },
1542
1543 {
1544 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1545 MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE),
1546 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001547 8500, 51, 1122000, 8500,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001548 },
1549
1550 {
1551 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1552 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, MAX, ACTIVE),
1553 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001554 9000, 51, 1130300, 9000,
1555 },
1556 {
1557 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1558 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, ACTIVE, RET_HIGH),
1559 false,
1560 10000, 51, 1130300, 10000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001561 },
1562
1563 {
1564 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1565 MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE),
1566 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001567 12000, 14, 2205900, 12000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001568 },
1569
1570 {
1571 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1572 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
1573 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001574 18000, 12, 2364250, 18000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001575 },
1576
1577 {
1578 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1579 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH),
1580 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001581 23500, 10, 2667000, 23500,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001582 },
1583
1584 {
1585 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1586 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
1587 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001588 29700, 5, 2867000, 30000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001589 },
1590};
1591
1592static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
1593 .mode = MSM_PM_BOOT_CONFIG_TZ,
1594};
1595
1596static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = {
1597 .levels = &msm_rpmrs_levels[0],
1598 .num_levels = ARRAY_SIZE(msm_rpmrs_levels),
1599 .vdd_mem_levels = {
1600 [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000,
1601 [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000,
1602 [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000,
1603 [MSM_RPMRS_VDD_MEM_MAX] = 1150000,
1604 },
1605 .vdd_dig_levels = {
1606 [MSM_RPMRS_VDD_DIG_RET_LOW] = 500000,
1607 [MSM_RPMRS_VDD_DIG_RET_HIGH] = 750000,
1608 [MSM_RPMRS_VDD_DIG_ACTIVE] = 950000,
1609 [MSM_RPMRS_VDD_DIG_MAX] = 1150000,
1610 },
1611 .vdd_mask = 0x7FFFFF,
1612 .rpmrs_target_id = {
1613 [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK,
1614 [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST,
1615 [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_PM8921_S3_0,
1616 [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_PM8921_S3_1,
1617 [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8921_L24_0,
1618 [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8921_L24_1,
1619 [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL,
1620 },
1621};
1622
Praveen Chidambaram78499012011-11-01 17:15:17 -06001623static uint8_t spm_wfi_cmd_sequence[] __initdata = {
1624 0x03, 0x0f,
1625};
1626
1627static uint8_t spm_power_collapse_without_rpm[] __initdata = {
1628 0x00, 0x24, 0x54, 0x10,
1629 0x09, 0x03, 0x01,
1630 0x10, 0x54, 0x30, 0x0C,
1631 0x24, 0x30, 0x0f,
1632};
1633
1634static uint8_t spm_power_collapse_with_rpm[] __initdata = {
1635 0x00, 0x24, 0x54, 0x10,
1636 0x09, 0x07, 0x01, 0x0B,
1637 0x10, 0x54, 0x30, 0x0C,
1638 0x24, 0x30, 0x0f,
1639};
1640
1641static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
1642 [0] = {
1643 .mode = MSM_SPM_MODE_CLOCK_GATING,
1644 .notify_rpm = false,
1645 .cmd = spm_wfi_cmd_sequence,
1646 },
1647 [1] = {
1648 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1649 .notify_rpm = false,
1650 .cmd = spm_power_collapse_without_rpm,
1651 },
1652 [2] = {
1653 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1654 .notify_rpm = true,
1655 .cmd = spm_power_collapse_with_rpm,
1656 },
1657};
1658
1659static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = {
1660 0x00, 0x20, 0x03, 0x20,
1661 0x00, 0x0f,
1662};
1663
1664static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = {
1665 0x00, 0x20, 0x34, 0x64,
1666 0x48, 0x07, 0x48, 0x20,
1667 0x50, 0x64, 0x04, 0x34,
1668 0x50, 0x0f,
1669};
1670static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = {
1671 0x00, 0x10, 0x34, 0x64,
1672 0x48, 0x07, 0x48, 0x10,
1673 0x50, 0x64, 0x04, 0x34,
1674 0x50, 0x0F,
1675};
1676
1677static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = {
1678 [0] = {
1679 .mode = MSM_SPM_L2_MODE_RETENTION,
1680 .notify_rpm = false,
1681 .cmd = l2_spm_wfi_cmd_sequence,
1682 },
1683 [1] = {
1684 .mode = MSM_SPM_L2_MODE_GDHS,
1685 .notify_rpm = true,
1686 .cmd = l2_spm_gdhs_cmd_sequence,
1687 },
1688 [2] = {
1689 .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE,
1690 .notify_rpm = true,
1691 .cmd = l2_spm_power_off_cmd_sequence,
1692 },
1693};
1694
1695
1696static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = {
1697 [0] = {
1698 .reg_base_addr = MSM_SAW_L2_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001699 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001700 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001701 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE,
1702 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020,
1703 .modes = msm_spm_l2_seq_list,
1704 .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list),
1705 },
1706};
1707
1708static struct msm_spm_platform_data msm_spm_data[] __initdata = {
1709 [0] = {
1710 .reg_base_addr = MSM_SAW0_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001711 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001712#if defined(CONFIG_MSM_AVS_HW)
1713 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1714 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1715#endif
1716 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001717 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001718 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1719 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1720 .vctl_timeout_us = 50,
1721 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1722 .modes = msm_spm_seq_list,
1723 },
1724 [1] = {
1725 .reg_base_addr = MSM_SAW1_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001726 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001727#if defined(CONFIG_MSM_AVS_HW)
1728 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1729 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1730#endif
1731 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001732 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001733 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1734 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1735 .vctl_timeout_us = 50,
1736 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1737 .modes = msm_spm_seq_list,
1738 },
1739 [2] = {
1740 .reg_base_addr = MSM_SAW2_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001741 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001742#if defined(CONFIG_MSM_AVS_HW)
1743 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1744 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1745#endif
1746 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001747 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001748 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1749 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1750 .vctl_timeout_us = 50,
1751 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1752 .modes = msm_spm_seq_list,
1753 },
1754 [3] = {
1755 .reg_base_addr = MSM_SAW3_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001756 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001757#if defined(CONFIG_MSM_AVS_HW)
1758 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1759 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1760#endif
1761 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001762 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001763 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1764 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1765 .vctl_timeout_us = 50,
1766 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1767 .modes = msm_spm_seq_list,
Jay Chokshi7805b5a2011-11-07 15:55:30 -08001768 },
1769};
1770
Praveen Chidambaram4d19be42012-04-03 18:05:52 -06001771static struct msm_pm_sleep_status_data msm_pm_slp_sts_data = {
1772 .base_addr = MSM_ACC0_BASE + 0x08,
1773 .cpu_offset = MSM_ACC1_BASE - MSM_ACC0_BASE,
1774 .mask = 1UL << 13,
1775};
1776
Gagan Mac8a7a5d32011-11-11 16:43:06 -07001777static void __init apq8064_init_buses(void)
1778{
1779 msm_bus_rpm_set_mt_mask();
1780 msm_bus_8064_apps_fabric_pdata.rpm_enabled = 1;
1781 msm_bus_8064_sys_fabric_pdata.rpm_enabled = 1;
1782 msm_bus_8064_mm_fabric_pdata.rpm_enabled = 1;
1783 msm_bus_8064_apps_fabric.dev.platform_data =
1784 &msm_bus_8064_apps_fabric_pdata;
1785 msm_bus_8064_sys_fabric.dev.platform_data =
1786 &msm_bus_8064_sys_fabric_pdata;
1787 msm_bus_8064_mm_fabric.dev.platform_data =
1788 &msm_bus_8064_mm_fabric_pdata;
1789 msm_bus_8064_sys_fpb.dev.platform_data = &msm_bus_8064_sys_fpb_pdata;
1790 msm_bus_8064_cpss_fpb.dev.platform_data = &msm_bus_8064_cpss_fpb_pdata;
1791}
1792
David Collinsf0d00732012-01-25 15:46:50 -08001793static struct platform_device apq8064_device_ext_5v_vreg __devinitdata = {
1794 .name = GPIO_REGULATOR_DEV_NAME,
1795 .id = PM8921_MPP_PM_TO_SYS(7),
1796 .dev = {
1797 .platform_data
1798 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V],
1799 },
1800};
1801
Jay Chokshi1de4f9d2012-02-07 16:11:31 -08001802static struct platform_device apq8064_device_ext_mpp8_vreg __devinitdata = {
1803 .name = GPIO_REGULATOR_DEV_NAME,
1804 .id = PM8921_MPP_PM_TO_SYS(8),
1805 .dev = {
1806 .platform_data
1807 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_MPP8],
1808 },
1809};
1810
David Collinsf0d00732012-01-25 15:46:50 -08001811static struct platform_device apq8064_device_ext_3p3v_vreg __devinitdata = {
1812 .name = GPIO_REGULATOR_DEV_NAME,
1813 .id = APQ8064_EXT_3P3V_REG_EN_GPIO,
1814 .dev = {
1815 .platform_data =
1816 &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V],
1817 },
1818};
1819
David Collins390fc332012-02-07 14:38:16 -08001820static struct platform_device apq8064_device_ext_ts_sw_vreg __devinitdata = {
1821 .name = GPIO_REGULATOR_DEV_NAME,
1822 .id = PM8921_GPIO_PM_TO_SYS(23),
1823 .dev = {
1824 .platform_data
1825 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_TS_SW],
1826 },
1827};
1828
David Collins2782b5c2012-02-06 10:02:42 -08001829static struct platform_device apq8064_device_rpm_regulator __devinitdata = {
1830 .name = "rpm-regulator",
1831 .id = -1,
1832 .dev = {
1833 .platform_data = &apq8064_rpm_regulator_pdata,
1834 },
1835};
1836
Ravi Kumar V05931a22012-04-04 17:09:37 +05301837static struct gpio_ir_recv_platform_data gpio_ir_recv_pdata = {
1838 .gpio_nr = 88,
1839 .active_low = 1,
1840};
1841
1842static struct platform_device gpio_ir_recv_pdev = {
1843 .name = "gpio-rc-recv",
1844 .dev = {
1845 .platform_data = &gpio_ir_recv_pdata,
1846 },
1847};
1848
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001849static struct platform_device *common_devices[] __initdata = {
Jin Hong01f2dbb2011-11-03 22:13:51 -07001850 &apq8064_device_dmov,
Terence Hampson2e1705f2012-04-11 19:55:29 -04001851#ifndef CONFIG_MSM_VCAP
David Keitel3c40fc52012-02-09 17:53:52 -08001852 &apq8064_device_qup_i2c_gsbi1,
Jing Lin04601f92012-02-05 15:36:07 -08001853 &apq8064_device_qup_i2c_gsbi3,
Kenneth Heitke748593a2011-07-15 15:45:11 -06001854 &apq8064_device_qup_i2c_gsbi4,
Terence Hampson2e1705f2012-04-11 19:55:29 -04001855#endif
Harini Jayaramanc4c58692011-07-19 14:50:10 -06001856 &apq8064_device_qup_spi_gsbi5,
David Collinsf0d00732012-01-25 15:46:50 -08001857 &apq8064_device_ext_5v_vreg,
Jay Chokshi1de4f9d2012-02-07 16:11:31 -08001858 &apq8064_device_ext_mpp8_vreg,
David Collinsf0d00732012-01-25 15:46:50 -08001859 &apq8064_device_ext_3p3v_vreg,
David Collins390fc332012-02-07 14:38:16 -08001860 &apq8064_device_ext_ts_sw_vreg,
Jay Chokshi9c25f072011-09-23 18:19:15 -07001861 &apq8064_device_ssbi_pmic1,
1862 &apq8064_device_ssbi_pmic2,
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001863 &msm_device_smd_apq8064,
Hemant Kumar4933b072011-10-17 23:43:11 -07001864 &apq8064_device_otg,
1865 &apq8064_device_gadget_peripheral,
Hemant Kumard86c4882012-01-24 19:39:37 -08001866 &apq8064_device_hsusb_host,
Hemant Kumar4933b072011-10-17 23:43:11 -07001867 &android_usb_device,
Ankit Verma6b7e2ba2012-01-26 15:48:54 -08001868 &msm_device_wcnss_wlan,
Ankit Vermab7c26e62012-02-28 15:04:15 -08001869 &msm_device_iris_fm,
Olav Haugan7c6aa742012-01-16 16:47:37 -08001870#ifdef CONFIG_ANDROID_PMEM
1871#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Laura Abbottb93525f2012-04-12 09:57:19 -07001872 &apq8064_android_pmem_device,
1873 &apq8064_android_pmem_adsp_device,
1874 &apq8064_android_pmem_audio_device,
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -07001875#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
1876#endif /*CONFIG_ANDROID_PMEM*/
Olav Haugan7c6aa742012-01-16 16:47:37 -08001877#ifdef CONFIG_ION_MSM
Laura Abbottb93525f2012-04-12 09:57:19 -07001878 &apq8064_ion_dev,
Olav Haugan7c6aa742012-01-16 16:47:37 -08001879#endif
Jeff Ohlstein7e668552011-10-06 16:17:25 -07001880 &msm8064_device_watchdog,
Jay Chokshi7805b5a2011-11-07 15:55:30 -08001881 &msm8064_device_saw_regulator_core0,
1882 &msm8064_device_saw_regulator_core1,
1883 &msm8064_device_saw_regulator_core2,
1884 &msm8064_device_saw_regulator_core3,
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07001885#if defined(CONFIG_QSEECOM)
1886 &qseecom_device,
1887#endif
1888
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001889#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1890 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1891 &qcrypto_device,
1892#endif
1893
1894#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1895 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1896 &qcedev_device,
1897#endif
Ramesh Masavarapuf46be1b2011-11-03 11:13:41 -07001898
1899#ifdef CONFIG_HW_RANDOM_MSM
1900 &apq8064_device_rng,
1901#endif
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -08001902 &apq_pcm,
1903 &apq_pcm_routing,
1904 &apq_cpudai0,
1905 &apq_cpudai1,
Santosh Mardieff9a742012-04-09 23:23:39 +05301906 &mpq_cpudai_sec_i2s_rx,
Kuirong Wangf23f8c52012-03-31 12:34:51 -07001907 &mpq_cpudai_mi2s_tx,
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -08001908 &apq_cpudai_hdmi_rx,
1909 &apq_cpudai_bt_rx,
1910 &apq_cpudai_bt_tx,
1911 &apq_cpudai_fm_rx,
1912 &apq_cpudai_fm_tx,
1913 &apq_cpu_fe,
1914 &apq_stub_codec,
1915 &apq_voice,
1916 &apq_voip,
1917 &apq_lpa_pcm,
Krishnankutty Kolathappilly4374e332012-03-18 22:27:30 -07001918 &apq_compr_dsp,
1919 &apq_multi_ch_pcm,
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -08001920 &apq_pcm_hostless,
1921 &apq_cpudai_afe_01_rx,
1922 &apq_cpudai_afe_01_tx,
1923 &apq_cpudai_afe_02_rx,
1924 &apq_cpudai_afe_02_tx,
1925 &apq_pcm_afe,
1926 &apq_cpudai_auxpcm_rx,
1927 &apq_cpudai_auxpcm_tx,
Neema Shetty8427c262012-02-16 11:23:43 -08001928 &apq_cpudai_stub,
Neema Shetty3c9d2862012-03-11 01:25:32 -08001929 &apq_cpudai_slimbus_1_rx,
1930 &apq_cpudai_slimbus_1_tx,
Kiran Kandi1e6371d2012-03-29 11:48:57 -07001931 &apq_cpudai_slimbus_2_tx,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001932 &apq8064_rpm_device,
1933 &apq8064_rpm_log_device,
1934 &apq8064_rpm_stat_device,
Gagan Mac8a7a5d32011-11-11 16:43:06 -07001935 &msm_bus_8064_apps_fabric,
1936 &msm_bus_8064_sys_fabric,
1937 &msm_bus_8064_mm_fabric,
1938 &msm_bus_8064_sys_fpb,
1939 &msm_bus_8064_cpss_fpb,
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08001940 &apq8064_msm_device_vidc,
Stephen Boyd25c4a0b2011-09-20 00:12:36 -07001941 &msm_pil_dsps,
Matt Wagantalled832652012-02-02 19:23:17 -08001942 &msm_8960_riva,
Matt Wagantallb94b9a52012-02-02 21:59:54 -08001943 &msm_8960_q6_lpass,
Stephen Boyd7b973de2012-03-09 12:26:16 -08001944 &msm_pil_vidc,
Matt Wagantall292aace2012-01-26 19:12:34 -08001945 &msm_gss,
Laura Abbottb93525f2012-04-12 09:57:19 -07001946 &apq8064_rtb_device,
Praveen Chidambaram8ea3dcd2011-12-07 14:46:31 -07001947 &apq8064_cpu_idle_device,
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07001948 &apq8064_msm_gov_device,
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08001949 &apq8064_device_cache_erp,
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08001950 &epm_adc_device,
Pratik Patel212ab362012-03-16 12:30:07 -07001951 &apq8064_qdss_device,
1952 &msm_etb_device,
1953 &msm_tpiu_device,
1954 &msm_funnel_device,
1955 &apq8064_etm_device,
Helen Zeng8f925502012-03-05 16:50:17 -08001956 &apq_cpudai_slim_4_rx,
1957 &apq_cpudai_slim_4_tx,
Jignesh Mehta921649d2012-04-19 06:57:23 -07001958 &msm8960_gemini_device,
Laura Abbott0577d7b2012-04-17 11:14:30 -07001959 &apq8064_iommu_domain_device,
Siddartha Mohanadoss48cad912012-04-05 21:29:54 -07001960 &msm_tsens_device,
Harini Jayaramanc4c58692011-07-19 14:50:10 -06001961};
1962
Joel King4e7ad222011-08-17 15:47:38 -07001963static struct platform_device *sim_devices[] __initdata = {
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07001964 &apq8064_device_uart_gsbi3,
Yan He06913ce2011-08-26 16:33:46 -07001965 &msm_device_sps_apq8064,
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07001966};
1967
1968static struct platform_device *rumi3_devices[] __initdata = {
1969 &apq8064_device_uart_gsbi1,
Yan He435ed612011-11-23 17:34:59 -08001970 &msm_device_sps_apq8064,
Huaibin Yang4a084e32011-12-15 15:25:52 -08001971#ifdef CONFIG_MSM_ROTATOR
1972 &msm_rotator_device,
1973#endif
Joel King4e7ad222011-08-17 15:47:38 -07001974};
1975
Joel King82b7e3f2012-01-05 10:03:27 -08001976static struct platform_device *cdp_devices[] __initdata = {
1977 &apq8064_device_uart_gsbi1,
Jin Hong4bbbfba2012-02-02 21:48:07 -08001978 &apq8064_device_uart_gsbi7,
Joel King82b7e3f2012-01-05 10:03:27 -08001979 &msm_device_sps_apq8064,
Aravind Venkateswaran4ca27532012-02-16 14:27:05 -08001980#ifdef CONFIG_MSM_ROTATOR
1981 &msm_rotator_device,
1982#endif
Joel King82b7e3f2012-01-05 10:03:27 -08001983};
1984
Jay Chokshi1b7eaa92012-04-04 14:53:14 -07001985static struct platform_device
1986mpq8064_device_ext_5v_frc_vreg __devinitdata = {
1987 .name = GPIO_REGULATOR_DEV_NAME,
1988 .id = SX150X_GPIO(4, 10),
1989 .dev = {
1990 .platform_data =
1991 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_FRC_5V],
1992 },
1993};
1994
1995static struct platform_device
1996mpq8064_device_ext_1p2_buck_vreg __devinitdata = {
1997 .name = GPIO_REGULATOR_DEV_NAME,
1998 .id = SX150X_GPIO(4, 2),
1999 .dev = {
2000 .platform_data =
2001 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_1P2V],
2002 },
2003};
2004
2005static struct platform_device
2006mpq8064_device_ext_1p8_buck_vreg __devinitdata = {
2007 .name = GPIO_REGULATOR_DEV_NAME,
2008 .id = SX150X_GPIO(4, 4),
2009 .dev = {
2010 .platform_data =
2011 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_1P8V],
2012 },
2013};
2014
2015static struct platform_device
2016mpq8064_device_ext_2p2_buck_vreg __devinitdata = {
2017 .name = GPIO_REGULATOR_DEV_NAME,
2018 .id = SX150X_GPIO(4, 14),
2019 .dev = {
2020 .platform_data =
2021 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_2P2V],
2022 },
2023};
2024
2025static struct platform_device
2026mpq8064_device_ext_5v_buck_vreg __devinitdata = {
2027 .name = GPIO_REGULATOR_DEV_NAME,
2028 .id = SX150X_GPIO(4, 3),
2029 .dev = {
2030 .platform_data =
2031 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_5V],
2032 },
2033};
2034
2035static struct platform_device
2036mpq8064_device_ext_3p3v_ldo_vreg __devinitdata = {
2037 .name = GPIO_REGULATOR_DEV_NAME,
2038 .id = SX150X_GPIO(4, 15),
2039 .dev = {
2040 .platform_data =
2041 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_3P3V],
2042 },
2043};
2044
2045static struct platform_device *mpq_devices[] __initdata = {
2046 &msm_device_sps_apq8064,
2047 &mpq8064_device_qup_i2c_gsbi5,
2048#ifdef CONFIG_MSM_ROTATOR
2049 &msm_rotator_device,
2050#endif
Ravi Kumar V05931a22012-04-04 17:09:37 +05302051 &gpio_ir_recv_pdev,
Jay Chokshi1b7eaa92012-04-04 14:53:14 -07002052 &mpq8064_device_ext_5v_frc_vreg,
2053 &mpq8064_device_ext_1p2_buck_vreg,
2054 &mpq8064_device_ext_1p8_buck_vreg,
2055 &mpq8064_device_ext_2p2_buck_vreg,
2056 &mpq8064_device_ext_5v_buck_vreg,
2057 &mpq8064_device_ext_3p3v_ldo_vreg,
Terence Hampson2e1705f2012-04-11 19:55:29 -04002058#ifdef CONFIG_MSM_VCAP
2059 &msm8064_device_vcap,
2060#endif
Jay Chokshi1b7eaa92012-04-04 14:53:14 -07002061};
2062
Harini Jayaramanc4c58692011-07-19 14:50:10 -06002063static struct msm_spi_platform_data apq8064_qup_spi_gsbi5_pdata = {
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -08002064 .max_clock_speed = 1100000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002065};
2066
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002067#define KS8851_IRQ_GPIO 43
2068
2069static struct spi_board_info spi_board_info[] __initdata = {
2070 {
2071 .modalias = "ks8851",
2072 .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
2073 .max_speed_hz = 19200000,
2074 .bus_num = 0,
2075 .chip_select = 2,
2076 .mode = SPI_MODE_0,
2077 },
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08002078 {
2079 .modalias = "epm_adc",
2080 .max_speed_hz = 1100000,
2081 .bus_num = 0,
2082 .chip_select = 3,
2083 .mode = SPI_MODE_0,
2084 },
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002085};
2086
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06002087static struct slim_boardinfo apq8064_slim_devices[] = {
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08002088 {
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08002089 .bus_num = 1,
2090 .slim_slave = &apq8064_slim_tabla,
2091 },
2092 {
2093 .bus_num = 1,
2094 .slim_slave = &apq8064_slim_tabla20,
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08002095 },
2096 /* add more slimbus slaves as needed */
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06002097};
2098
David Keitel3c40fc52012-02-09 17:53:52 -08002099static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi1_pdata = {
2100 .clk_freq = 100000,
2101 .src_clk_rate = 24000000,
2102};
2103
Jing Lin04601f92012-02-05 15:36:07 -08002104static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi3_pdata = {
Anirudh Ghayalc2163472012-04-10 14:58:14 +05302105 .clk_freq = 384000,
Jing Lin04601f92012-02-05 15:36:07 -08002106 .src_clk_rate = 24000000,
2107};
2108
Kenneth Heitke748593a2011-07-15 15:45:11 -06002109static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi4_pdata = {
2110 .clk_freq = 100000,
2111 .src_clk_rate = 24000000,
Kenneth Heitke748593a2011-07-15 15:45:11 -06002112};
2113
Joel King8f839b92012-04-01 14:37:46 -07002114static struct msm_i2c_platform_data mpq8064_i2c_qup_gsbi5_pdata = {
2115 .clk_freq = 100000,
2116 .src_clk_rate = 24000000,
2117};
2118
David Keitel3c40fc52012-02-09 17:53:52 -08002119#define GSBI_DUAL_MODE_CODE 0x60
2120#define MSM_GSBI1_PHYS 0x12440000
Kenneth Heitke748593a2011-07-15 15:45:11 -06002121static void __init apq8064_i2c_init(void)
2122{
David Keitel3c40fc52012-02-09 17:53:52 -08002123 void __iomem *gsbi_mem;
2124
2125 apq8064_device_qup_i2c_gsbi1.dev.platform_data =
2126 &apq8064_i2c_qup_gsbi1_pdata;
2127 gsbi_mem = ioremap_nocache(MSM_GSBI1_PHYS, 4);
2128 writel_relaxed(GSBI_DUAL_MODE_CODE, gsbi_mem);
2129 /* Ensure protocol code is written before proceeding */
2130 wmb();
2131 iounmap(gsbi_mem);
2132 apq8064_i2c_qup_gsbi1_pdata.use_gsbi_shared_mode = 1;
Jing Lin04601f92012-02-05 15:36:07 -08002133 apq8064_device_qup_i2c_gsbi3.dev.platform_data =
2134 &apq8064_i2c_qup_gsbi3_pdata;
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08002135 apq8064_device_qup_i2c_gsbi1.dev.platform_data =
2136 &apq8064_i2c_qup_gsbi1_pdata;
Kenneth Heitke748593a2011-07-15 15:45:11 -06002137 apq8064_device_qup_i2c_gsbi4.dev.platform_data =
2138 &apq8064_i2c_qup_gsbi4_pdata;
Joel King8f839b92012-04-01 14:37:46 -07002139 mpq8064_device_qup_i2c_gsbi5.dev.platform_data =
2140 &mpq8064_i2c_qup_gsbi5_pdata;
Kenneth Heitke748593a2011-07-15 15:45:11 -06002141}
2142
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -08002143#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002144static int ethernet_init(void)
2145{
2146 int ret;
2147 ret = gpio_request(KS8851_IRQ_GPIO, "ks8851_irq");
2148 if (ret) {
2149 pr_err("ks8851 gpio_request failed: %d\n", ret);
2150 goto fail;
2151 }
2152
2153 return 0;
2154fail:
2155 return ret;
2156}
2157#else
2158static int ethernet_init(void)
2159{
2160 return 0;
2161}
2162#endif
2163
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302164#define GPIO_KEY_HOME PM8921_GPIO_PM_TO_SYS(27)
2165#define GPIO_KEY_VOLUME_UP PM8921_GPIO_PM_TO_SYS(35)
2166#define GPIO_KEY_VOLUME_DOWN PM8921_GPIO_PM_TO_SYS(38)
2167#define GPIO_KEY_CAM_FOCUS PM8921_GPIO_PM_TO_SYS(3)
2168#define GPIO_KEY_CAM_SNAP PM8921_GPIO_PM_TO_SYS(4)
Jing Lin3f8f8422012-03-05 09:32:11 -08002169#define GPIO_KEY_ROTATION PM8921_GPIO_PM_TO_SYS(42)
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302170
2171static struct gpio_keys_button cdp_keys[] = {
2172 {
2173 .code = KEY_HOME,
2174 .gpio = GPIO_KEY_HOME,
2175 .desc = "home_key",
2176 .active_low = 1,
2177 .type = EV_KEY,
2178 .wakeup = 1,
2179 .debounce_interval = 15,
2180 },
2181 {
2182 .code = KEY_VOLUMEUP,
2183 .gpio = GPIO_KEY_VOLUME_UP,
2184 .desc = "volume_up_key",
2185 .active_low = 1,
2186 .type = EV_KEY,
2187 .wakeup = 1,
2188 .debounce_interval = 15,
2189 },
2190 {
2191 .code = KEY_VOLUMEDOWN,
2192 .gpio = GPIO_KEY_VOLUME_DOWN,
2193 .desc = "volume_down_key",
2194 .active_low = 1,
2195 .type = EV_KEY,
2196 .wakeup = 1,
2197 .debounce_interval = 15,
2198 },
2199 {
2200 .code = SW_ROTATE_LOCK,
2201 .gpio = GPIO_KEY_ROTATION,
2202 .desc = "rotate_key",
2203 .active_low = 1,
2204 .type = EV_SW,
2205 .debounce_interval = 15,
2206 },
2207};
2208
2209static struct gpio_keys_platform_data cdp_keys_data = {
2210 .buttons = cdp_keys,
2211 .nbuttons = ARRAY_SIZE(cdp_keys),
2212};
2213
2214static struct platform_device cdp_kp_pdev = {
2215 .name = "gpio-keys",
2216 .id = -1,
2217 .dev = {
2218 .platform_data = &cdp_keys_data,
2219 },
2220};
2221
2222static struct gpio_keys_button mtp_keys[] = {
2223 {
2224 .code = KEY_CAMERA_FOCUS,
2225 .gpio = GPIO_KEY_CAM_FOCUS,
2226 .desc = "cam_focus_key",
2227 .active_low = 1,
2228 .type = EV_KEY,
2229 .wakeup = 1,
2230 .debounce_interval = 15,
2231 },
2232 {
2233 .code = KEY_VOLUMEUP,
2234 .gpio = GPIO_KEY_VOLUME_UP,
2235 .desc = "volume_up_key",
2236 .active_low = 1,
2237 .type = EV_KEY,
2238 .wakeup = 1,
2239 .debounce_interval = 15,
2240 },
2241 {
2242 .code = KEY_VOLUMEDOWN,
2243 .gpio = GPIO_KEY_VOLUME_DOWN,
2244 .desc = "volume_down_key",
2245 .active_low = 1,
2246 .type = EV_KEY,
2247 .wakeup = 1,
2248 .debounce_interval = 15,
2249 },
2250 {
2251 .code = KEY_CAMERA_SNAPSHOT,
2252 .gpio = GPIO_KEY_CAM_SNAP,
2253 .desc = "cam_snap_key",
2254 .active_low = 1,
2255 .type = EV_KEY,
2256 .debounce_interval = 15,
2257 },
2258};
2259
2260static struct gpio_keys_platform_data mtp_keys_data = {
2261 .buttons = mtp_keys,
2262 .nbuttons = ARRAY_SIZE(mtp_keys),
2263};
2264
2265static struct platform_device mtp_kp_pdev = {
2266 .name = "gpio-keys",
2267 .id = -1,
2268 .dev = {
2269 .platform_data = &mtp_keys_data,
2270 },
2271};
2272
Anirudh Ghayal32ea6252012-04-26 16:39:50 +05302273static struct gpio_keys_button mpq_keys[] = {
2274 {
2275 .code = KEY_VOLUMEDOWN,
2276 .gpio = GPIO_KEY_VOLUME_DOWN,
2277 .desc = "volume_down_key",
2278 .active_low = 1,
2279 .type = EV_KEY,
2280 .wakeup = 1,
2281 .debounce_interval = 15,
2282 },
2283 {
2284 .code = KEY_VOLUMEUP,
2285 .gpio = GPIO_KEY_VOLUME_UP,
2286 .desc = "volume_up_key",
2287 .active_low = 1,
2288 .type = EV_KEY,
2289 .wakeup = 1,
2290 .debounce_interval = 15,
2291 },
2292};
2293
2294static struct gpio_keys_platform_data mpq_keys_data = {
2295 .buttons = mpq_keys,
2296 .nbuttons = ARRAY_SIZE(mpq_keys),
2297};
2298
2299static struct platform_device mpq_gpio_keys_pdev = {
2300 .name = "gpio-keys",
2301 .id = -1,
2302 .dev = {
2303 .platform_data = &mpq_keys_data,
2304 },
2305};
2306
2307#define MPQ_KP_ROW_BASE SX150X_EXP2_GPIO_BASE
2308#define MPQ_KP_COL_BASE (SX150X_EXP2_GPIO_BASE + 4)
2309
2310static unsigned int mpq_row_gpios[] = {MPQ_KP_ROW_BASE, MPQ_KP_ROW_BASE + 1,
2311 MPQ_KP_ROW_BASE + 2, MPQ_KP_ROW_BASE + 3};
2312static unsigned int mpq_col_gpios[] = {MPQ_KP_COL_BASE, MPQ_KP_COL_BASE + 1,
2313 MPQ_KP_COL_BASE + 2};
2314
2315static const unsigned int mpq_keymap[] = {
2316 KEY(0, 0, KEY_UP),
2317 KEY(0, 1, KEY_ENTER),
2318 KEY(0, 2, KEY_3),
2319
2320 KEY(1, 0, KEY_DOWN),
2321 KEY(1, 1, KEY_EXIT),
2322 KEY(1, 2, KEY_4),
2323
2324 KEY(2, 0, KEY_LEFT),
2325 KEY(2, 1, KEY_1),
2326 KEY(2, 2, KEY_5),
2327
2328 KEY(3, 0, KEY_RIGHT),
2329 KEY(3, 1, KEY_2),
2330 KEY(3, 2, KEY_6),
2331};
2332
2333static struct matrix_keymap_data mpq_keymap_data = {
2334 .keymap_size = ARRAY_SIZE(mpq_keymap),
2335 .keymap = mpq_keymap,
2336};
2337
2338static struct matrix_keypad_platform_data mpq_keypad_data = {
2339 .keymap_data = &mpq_keymap_data,
2340 .row_gpios = mpq_row_gpios,
2341 .col_gpios = mpq_col_gpios,
2342 .num_row_gpios = ARRAY_SIZE(mpq_row_gpios),
2343 .num_col_gpios = ARRAY_SIZE(mpq_col_gpios),
2344 .col_scan_delay_us = 32000,
2345 .debounce_ms = 20,
2346 .wakeup = 1,
2347 .active_low = 1,
2348 .no_autorepeat = 1,
2349};
2350
2351static struct platform_device mpq_keypad_device = {
2352 .name = "matrix-keypad",
2353 .id = -1,
2354 .dev = {
2355 .platform_data = &mpq_keypad_data,
2356 },
2357};
2358
Jin Hongd3024e62012-02-09 16:13:32 -08002359/* Sensors DSPS platform data */
2360#define DSPS_PIL_GENERIC_NAME "dsps"
2361static void __init apq8064_init_dsps(void)
2362{
2363 struct msm_dsps_platform_data *pdata =
2364 msm_dsps_device_8064.dev.platform_data;
2365 pdata->pil_name = DSPS_PIL_GENERIC_NAME;
2366 pdata->gpios = NULL;
2367 pdata->gpios_num = 0;
2368
2369 platform_device_register(&msm_dsps_device_8064);
2370}
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302371
Jing Lin417fa452012-02-05 14:31:06 -08002372#define I2C_SURF 1
2373#define I2C_FFA (1 << 1)
2374#define I2C_RUMI (1 << 2)
2375#define I2C_SIM (1 << 3)
2376#define I2C_LIQUID (1 << 4)
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002377#define I2C_MPQ_CDP BIT(5)
2378#define I2C_MPQ_HRD BIT(6)
2379#define I2C_MPQ_DTV BIT(7)
Jing Lin417fa452012-02-05 14:31:06 -08002380
2381struct i2c_registry {
2382 u8 machs;
2383 int bus;
2384 struct i2c_board_info *info;
2385 int len;
2386};
2387
2388static struct i2c_registry apq8064_i2c_devices[] __initdata = {
Jing Lin21ed4de2012-02-05 15:53:28 -08002389 {
David Keitel2f613d92012-02-15 11:29:16 -08002390 I2C_LIQUID,
2391 APQ_8064_GSBI1_QUP_I2C_BUS_ID,
2392 smb349_charger_i2c_info,
2393 ARRAY_SIZE(smb349_charger_i2c_info)
2394 },
Terence Hampson2e1705f2012-04-11 19:55:29 -04002395#ifndef CONFIG_MSM_VCAP
David Keitel2f613d92012-02-15 11:29:16 -08002396 {
Jing Lin21ed4de2012-02-05 15:53:28 -08002397 I2C_SURF | I2C_LIQUID,
2398 APQ_8064_GSBI3_QUP_I2C_BUS_ID,
2399 mxt_device_info,
2400 ARRAY_SIZE(mxt_device_info),
2401 },
Terence Hampson2e1705f2012-04-11 19:55:29 -04002402#endif
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08002403 {
2404 I2C_FFA,
2405 APQ_8064_GSBI3_QUP_I2C_BUS_ID,
2406 cyttsp_info,
2407 ARRAY_SIZE(cyttsp_info),
2408 },
Amy Maloche70090f992012-02-16 16:35:26 -08002409 {
2410 I2C_FFA | I2C_LIQUID,
2411 APQ_8064_GSBI1_QUP_I2C_BUS_ID,
2412 isa1200_board_info,
2413 ARRAY_SIZE(isa1200_board_info),
2414 },
Santosh Mardieff9a742012-04-09 23:23:39 +05302415 {
2416 I2C_MPQ_CDP,
2417 APQ_8064_GSBI5_QUP_I2C_BUS_ID,
2418 cs8427_device_info,
2419 ARRAY_SIZE(cs8427_device_info),
2420 },
Jing Lin417fa452012-02-05 14:31:06 -08002421};
2422
Jay Chokshi607f61b2012-04-25 18:21:21 -07002423#define SX150X_EXP1_INT_N PM8921_MPP_IRQ(PM8921_IRQ_BASE, 9)
Anirudh Ghayal9f1aaa72012-04-26 18:15:08 +05302424#define SX150X_EXP2_INT_N MSM_GPIO_TO_INT(81)
Jay Chokshi607f61b2012-04-25 18:21:21 -07002425
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002426struct sx150x_platform_data mpq8064_sx150x_pdata[] = {
2427 [SX150X_EXP1] = {
2428 .gpio_base = SX150X_EXP1_GPIO_BASE,
2429 .oscio_is_gpo = false,
2430 .io_pullup_ena = 0x0,
2431 .io_pulldn_ena = 0x0,
2432 .io_open_drain_ena = 0x0,
2433 .io_polarity = 0,
Jay Chokshi607f61b2012-04-25 18:21:21 -07002434 .irq_summary = SX150X_EXP1_INT_N,
2435 .irq_base = SX150X_EXP1_IRQ_BASE,
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002436 },
2437 [SX150X_EXP2] = {
2438 .gpio_base = SX150X_EXP2_GPIO_BASE,
2439 .oscio_is_gpo = false,
Anirudh Ghayal32ea6252012-04-26 16:39:50 +05302440 .io_pullup_ena = 0x0f,
2441 .io_pulldn_ena = 0x70,
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002442 .io_open_drain_ena = 0x0,
2443 .io_polarity = 0,
Anirudh Ghayal9f1aaa72012-04-26 18:15:08 +05302444 .irq_summary = SX150X_EXP2_INT_N,
2445 .irq_base = SX150X_EXP2_IRQ_BASE,
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002446 },
2447 [SX150X_EXP3] = {
2448 .gpio_base = SX150X_EXP3_GPIO_BASE,
2449 .oscio_is_gpo = false,
2450 .io_pullup_ena = 0x0,
2451 .io_pulldn_ena = 0x0,
2452 .io_open_drain_ena = 0x0,
2453 .io_polarity = 0,
2454 .irq_summary = -1,
2455 },
2456 [SX150X_EXP4] = {
2457 .gpio_base = SX150X_EXP4_GPIO_BASE,
2458 .oscio_is_gpo = false,
2459 .io_pullup_ena = 0x0,
2460 .io_pulldn_ena = 0x0,
2461 .io_open_drain_ena = 0x0,
2462 .io_polarity = 0,
2463 .irq_summary = -1,
2464 },
2465};
2466
2467static struct i2c_board_info sx150x_gpio_exp_info[] = {
2468 {
2469 I2C_BOARD_INFO("sx1509q", 0x70),
2470 .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP1],
2471 },
2472 {
2473 I2C_BOARD_INFO("sx1508q", 0x23),
2474 .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP2],
2475 },
2476 {
2477 I2C_BOARD_INFO("sx1508q", 0x22),
2478 .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP3],
2479 },
2480 {
2481 I2C_BOARD_INFO("sx1509q", 0x3E),
2482 .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP4],
2483 },
2484};
2485
2486#define MPQ8064_I2C_GSBI5_BUS_ID 5
2487
2488static struct i2c_registry mpq8064_i2c_devices[] __initdata = {
2489 {
2490 I2C_MPQ_CDP,
2491 MPQ8064_I2C_GSBI5_BUS_ID,
2492 sx150x_gpio_exp_info,
2493 ARRAY_SIZE(sx150x_gpio_exp_info),
2494 },
2495};
2496
Jing Lin417fa452012-02-05 14:31:06 -08002497static void __init register_i2c_devices(void)
2498{
2499 u8 mach_mask = 0;
2500 int i;
2501
Kevin Chand07220e2012-02-13 15:52:22 -08002502#ifdef CONFIG_MSM_CAMERA
2503 struct i2c_registry apq8064_camera_i2c_devices = {
2504 I2C_SURF | I2C_FFA | I2C_LIQUID | I2C_RUMI,
2505 APQ_8064_GSBI4_QUP_I2C_BUS_ID,
2506 apq8064_camera_board_info.board_info,
2507 apq8064_camera_board_info.num_i2c_board_info,
2508 };
2509#endif
Jing Lin417fa452012-02-05 14:31:06 -08002510 /* Build the matching 'supported_machs' bitmask */
2511 if (machine_is_apq8064_cdp())
2512 mach_mask = I2C_SURF;
2513 else if (machine_is_apq8064_mtp())
2514 mach_mask = I2C_FFA;
2515 else if (machine_is_apq8064_liquid())
2516 mach_mask = I2C_LIQUID;
2517 else if (machine_is_apq8064_rumi3())
2518 mach_mask = I2C_RUMI;
2519 else if (machine_is_apq8064_sim())
2520 mach_mask = I2C_SIM;
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002521 else if (PLATFORM_IS_MPQ8064())
2522 mach_mask = I2C_MPQ_CDP;
Jing Lin417fa452012-02-05 14:31:06 -08002523 else
2524 pr_err("unmatched machine ID in register_i2c_devices\n");
2525
2526 /* Run the array and install devices as appropriate */
2527 for (i = 0; i < ARRAY_SIZE(apq8064_i2c_devices); ++i) {
2528 if (apq8064_i2c_devices[i].machs & mach_mask)
2529 i2c_register_board_info(apq8064_i2c_devices[i].bus,
2530 apq8064_i2c_devices[i].info,
2531 apq8064_i2c_devices[i].len);
2532 }
Kevin Chand07220e2012-02-13 15:52:22 -08002533#ifdef CONFIG_MSM_CAMERA
2534 if (apq8064_camera_i2c_devices.machs & mach_mask)
2535 i2c_register_board_info(apq8064_camera_i2c_devices.bus,
2536 apq8064_camera_i2c_devices.info,
2537 apq8064_camera_i2c_devices.len);
2538#endif
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002539
2540 for (i = 0; i < ARRAY_SIZE(mpq8064_i2c_devices); ++i) {
2541 if (mpq8064_i2c_devices[i].machs & mach_mask)
2542 i2c_register_board_info(
2543 mpq8064_i2c_devices[i].bus,
2544 mpq8064_i2c_devices[i].info,
2545 mpq8064_i2c_devices[i].len);
2546 }
Jing Lin417fa452012-02-05 14:31:06 -08002547}
2548
Jay Chokshi994ff122012-03-27 15:43:48 -07002549static void enable_ddr3_regulator(void)
2550{
2551 static struct regulator *ext_ddr3;
2552
2553 /* Use MPP7 output state as a flag for PCDDR3 presence. */
2554 if (gpio_get_value_cansleep(PM8921_MPP_PM_TO_SYS(7)) > 0) {
2555 ext_ddr3 = regulator_get(NULL, "ext_ddr3");
2556 if (IS_ERR(ext_ddr3) || ext_ddr3 == NULL)
2557 pr_err("Could not get MPP7 regulator\n");
2558 else
2559 regulator_enable(ext_ddr3);
2560 }
2561}
2562
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002563static void enable_avc_i2c_bus(void)
2564{
2565 int avc_i2c_en_mpp = PM8921_MPP_PM_TO_SYS(8);
2566 int rc;
2567
2568 rc = gpio_request(avc_i2c_en_mpp, "avc_i2c_en");
2569 if (rc)
2570 pr_err("request for avc_i2c_en mpp failed,"
2571 "rc=%d\n", rc);
2572 else
2573 gpio_set_value_cansleep(avc_i2c_en_mpp, 1);
2574}
2575
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002576static void __init apq8064_common_init(void)
2577{
Joel King8f839b92012-04-01 14:37:46 -07002578 msm_tsens_early_init(&apq_tsens_pdata);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002579 if (socinfo_init() < 0)
2580 pr_err("socinfo_init() failed!\n");
Praveen Chidambaram78499012011-11-01 17:15:17 -06002581 BUG_ON(msm_rpm_init(&apq8064_rpm_data));
2582 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
David Collins2782b5c2012-02-06 10:02:42 -08002583 regulator_suppress_info_printing();
2584 platform_device_register(&apq8064_device_rpm_regulator);
Stephen Boyd4d0d2582012-02-10 14:49:40 -08002585 if (msm_xo_init())
2586 pr_err("Failed to initialize XO votes\n");
Matt Wagantallc51e5602012-02-27 17:25:25 -08002587 msm_clock_init(&apq8064_clock_init_data);
Stepan Moskovchenko2327a952011-12-14 16:31:28 -08002588 apq8064_init_gpiomux();
Kenneth Heitke748593a2011-07-15 15:45:11 -06002589 apq8064_i2c_init();
Jing Lin417fa452012-02-05 14:31:06 -08002590 register_i2c_devices();
Kenneth Heitke36920d32011-07-20 16:44:30 -06002591
Harini Jayaramanc4c58692011-07-19 14:50:10 -06002592 apq8064_device_qup_spi_gsbi5.dev.platform_data =
2593 &apq8064_qup_spi_gsbi5_pdata;
Stepan Moskovchenkoc1074f02011-12-14 17:51:57 -08002594 apq8064_init_pmic();
Hemant Kumar94e7da22012-02-03 16:52:29 -08002595 if (machine_is_apq8064_liquid())
2596 msm_otg_pdata.mhl_enable = true;
Vamsi Krishnad9863eb2012-03-26 17:34:48 -07002597
Ofir Cohen94213a72012-05-03 14:26:32 +03002598 android_usb_pdata.swfi_latency =
2599 msm_rpmrs_levels[0].latency_us;
Vamsi Krishnad9863eb2012-03-26 17:34:48 -07002600
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002601 apq8064_device_otg.dev.platform_data = &msm_otg_pdata;
Manu Gautam91223e02011-11-08 15:27:22 +05302602 apq8064_ehci_host_init();
Gagan Mac8a7a5d32011-11-11 16:43:06 -07002603 apq8064_init_buses();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002604 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Jay Chokshi994ff122012-03-27 15:43:48 -07002605 enable_ddr3_regulator();
Hemant Kumarf1ca9192012-02-07 18:59:33 -08002606 if (machine_is_apq8064_mtp()) {
2607 apq8064_device_hsic_host.dev.platform_data = &msm_hsic_pdata;
2608 device_initialize(&apq8064_device_hsic_host.dev);
2609 }
Jay Chokshie8741282012-01-25 15:22:55 -08002610 apq8064_pm8xxx_gpio_mpp_init();
Sahitya Tummala3586ed92011-08-03 09:13:23 +05302611 apq8064_init_mmc();
Swaminathan Sathappan144b4882012-02-06 17:01:20 -08002612
2613 if (machine_is_apq8064_mtp()) {
2614 mdm_8064_device.dev.platform_data = &mdm_platform_data;
2615 platform_device_register(&mdm_8064_device);
2616 }
2617 platform_device_register(&apq8064_slim_ctrl);
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06002618 slim_register_board_info(apq8064_slim_devices,
2619 ARRAY_SIZE(apq8064_slim_devices));
Jin Hongd3024e62012-02-09 16:13:32 -08002620 apq8064_init_dsps();
Praveen Chidambaram78499012011-11-01 17:15:17 -06002621 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
Mahesh Sivasubramaniancbce1ec2012-01-24 10:32:44 -07002622 acpuclk_init(&acpuclk_8064_soc_data);
Praveen Chidambaram78499012011-11-01 17:15:17 -06002623 msm_spm_l2_init(msm_spm_l2_data);
Praveen Chidambaram78499012011-11-01 17:15:17 -06002624 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Praveen Chidambaram4d19be42012-04-03 18:05:52 -06002625 msm_pm_init_sleep_status_data(&msm_pm_slp_sts_data);
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08002626 apq8064_epm_adc_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002627}
2628
Huaibin Yang4a084e32011-12-15 15:25:52 -08002629static void __init apq8064_allocate_memory_regions(void)
2630{
2631 apq8064_allocate_fb_region();
2632}
2633
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002634static void __init apq8064_sim_init(void)
2635{
Jeff Ohlstein7e668552011-10-06 16:17:25 -07002636 struct msm_watchdog_pdata *wdog_pdata = (struct msm_watchdog_pdata *)
2637 &msm8064_device_watchdog.dev.platform_data;
2638
2639 wdog_pdata->bark_time = 15000;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002640 apq8064_common_init();
Joel King4e7ad222011-08-17 15:47:38 -07002641 platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices));
2642}
2643
2644static void __init apq8064_rumi3_init(void)
2645{
2646 apq8064_common_init();
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002647 ethernet_init();
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07002648 platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002649 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002650}
2651
Joel King82b7e3f2012-01-05 10:03:27 -08002652static void __init apq8064_cdp_init(void)
2653{
Hanumant Singh50440d42012-04-23 19:27:16 -07002654 if (meminfo_init(SYS_MEMORY, SZ_256M) < 0)
2655 pr_err("meminfo_init() failed!\n");
Joel King82b7e3f2012-01-05 10:03:27 -08002656 apq8064_common_init();
Joel King8f839b92012-04-01 14:37:46 -07002657 if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
2658 machine_is_mpq8064_dtv()) {
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002659 enable_avc_i2c_bus();
Joel King8f839b92012-04-01 14:37:46 -07002660 platform_add_devices(mpq_devices, ARRAY_SIZE(mpq_devices));
2661 } else {
2662 ethernet_init();
2663 platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
2664 spi_register_board_info(spi_board_info,
2665 ARRAY_SIZE(spi_board_info));
2666 }
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002667 apq8064_init_fb();
Jordan Crouseb3115fe2012-02-01 22:11:12 -07002668 apq8064_init_gpu();
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07002669 platform_add_devices(apq8064_footswitch, apq8064_num_footswitch);
Kevin Chand07220e2012-02-13 15:52:22 -08002670 apq8064_init_cam();
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302671
2672 if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
2673 platform_device_register(&cdp_kp_pdev);
2674
2675 if (machine_is_apq8064_mtp())
2676 platform_device_register(&mtp_kp_pdev);
Hanumant Singh50440d42012-04-23 19:27:16 -07002677
2678 change_memory_power = &apq8064_change_memory_power;
Anirudh Ghayal32ea6252012-04-26 16:39:50 +05302679
2680 if (machine_is_mpq8064_cdp()) {
2681 platform_device_register(&mpq_gpio_keys_pdev);
2682 platform_device_register(&mpq_keypad_device);
2683 }
Joel King82b7e3f2012-01-05 10:03:27 -08002684}
2685
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002686MACHINE_START(APQ8064_SIM, "QCT APQ8064 SIMULATOR")
2687 .map_io = apq8064_map_io,
Kevin Chan13be4e22011-10-20 11:30:32 -07002688 .reserve = apq8064_reserve,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002689 .init_irq = apq8064_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302690 .handle_irq = gic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002691 .timer = &msm_timer,
2692 .init_machine = apq8064_sim_init,
2693MACHINE_END
2694
Joel King4e7ad222011-08-17 15:47:38 -07002695MACHINE_START(APQ8064_RUMI3, "QCT APQ8064 RUMI3")
2696 .map_io = apq8064_map_io,
Kevin Chan13be4e22011-10-20 11:30:32 -07002697 .reserve = apq8064_reserve,
Joel King4e7ad222011-08-17 15:47:38 -07002698 .init_irq = apq8064_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302699 .handle_irq = gic_handle_irq,
Joel King4e7ad222011-08-17 15:47:38 -07002700 .timer = &msm_timer,
2701 .init_machine = apq8064_rumi3_init,
Huaibin Yang4a084e32011-12-15 15:25:52 -08002702 .init_early = apq8064_allocate_memory_regions,
Joel King4e7ad222011-08-17 15:47:38 -07002703MACHINE_END
2704
Joel King82b7e3f2012-01-05 10:03:27 -08002705MACHINE_START(APQ8064_CDP, "QCT APQ8064 CDP")
2706 .map_io = apq8064_map_io,
2707 .reserve = apq8064_reserve,
2708 .init_irq = apq8064_init_irq,
2709 .handle_irq = gic_handle_irq,
2710 .timer = &msm_timer,
2711 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002712 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07002713 .init_very_early = apq8064_early_reserve,
Joel King82b7e3f2012-01-05 10:03:27 -08002714MACHINE_END
2715
2716MACHINE_START(APQ8064_MTP, "QCT APQ8064 MTP")
2717 .map_io = apq8064_map_io,
2718 .reserve = apq8064_reserve,
2719 .init_irq = apq8064_init_irq,
2720 .handle_irq = gic_handle_irq,
2721 .timer = &msm_timer,
2722 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002723 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07002724 .init_very_early = apq8064_early_reserve,
Joel King82b7e3f2012-01-05 10:03:27 -08002725MACHINE_END
2726
2727MACHINE_START(APQ8064_LIQUID, "QCT APQ8064 LIQUID")
2728 .map_io = apq8064_map_io,
2729 .reserve = apq8064_reserve,
2730 .init_irq = apq8064_init_irq,
2731 .handle_irq = gic_handle_irq,
2732 .timer = &msm_timer,
2733 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002734 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07002735 .init_very_early = apq8064_early_reserve,
Joel King82b7e3f2012-01-05 10:03:27 -08002736MACHINE_END
2737
Joel King064bbf82012-04-01 13:23:39 -07002738MACHINE_START(MPQ8064_CDP, "QCT MPQ8064 CDP")
2739 .map_io = apq8064_map_io,
2740 .reserve = apq8064_reserve,
2741 .init_irq = apq8064_init_irq,
2742 .handle_irq = gic_handle_irq,
2743 .timer = &msm_timer,
2744 .init_machine = apq8064_cdp_init,
2745 .init_early = apq8064_allocate_memory_regions,
2746 .init_very_early = apq8064_early_reserve,
2747MACHINE_END
2748
Joel King11ca8202012-02-13 16:19:03 -08002749MACHINE_START(MPQ8064_HRD, "QCT MPQ8064 HRD")
2750 .map_io = apq8064_map_io,
2751 .reserve = apq8064_reserve,
2752 .init_irq = apq8064_init_irq,
2753 .handle_irq = gic_handle_irq,
2754 .timer = &msm_timer,
2755 .init_machine = apq8064_cdp_init,
Laura Abbott6988cef2012-03-15 14:27:13 -07002756 .init_very_early = apq8064_early_reserve,
Joel King11ca8202012-02-13 16:19:03 -08002757MACHINE_END
2758
2759MACHINE_START(MPQ8064_DTV, "QCT MPQ8064 DTV")
2760 .map_io = apq8064_map_io,
2761 .reserve = apq8064_reserve,
2762 .init_irq = apq8064_init_irq,
2763 .handle_irq = gic_handle_irq,
2764 .timer = &msm_timer,
2765 .init_machine = apq8064_cdp_init,
Laura Abbott6988cef2012-03-15 14:27:13 -07002766 .init_very_early = apq8064_early_reserve,
Joel King11ca8202012-02-13 16:19:03 -08002767MACHINE_END
2768