blob: fbfd191fd9231647df1ba1927beca3c51f6d16fe [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 -0800201#if defined(CONFIG_MSM_RTB)
Laura Abbottb93525f2012-04-12 09:57:19 -0700202static struct msm_rtb_platform_data apq8064_rtb_pdata = {
Laura Abbott350c8362012-02-28 14:46:52 -0800203 .size = SZ_1M,
204};
205
206static int __init msm_rtb_set_buffer_size(char *p)
207{
208 int s;
209
210 s = memparse(p, NULL);
Laura Abbottb93525f2012-04-12 09:57:19 -0700211 apq8064_rtb_pdata.size = ALIGN(s, SZ_4K);
Laura Abbott350c8362012-02-28 14:46:52 -0800212 return 0;
213}
214early_param("msm_rtb_size", msm_rtb_set_buffer_size);
215
216
Laura Abbottb93525f2012-04-12 09:57:19 -0700217static struct platform_device apq8064_rtb_device = {
Laura Abbott350c8362012-02-28 14:46:52 -0800218 .name = "msm_rtb",
219 .id = -1,
220 .dev = {
Laura Abbottb93525f2012-04-12 09:57:19 -0700221 .platform_data = &apq8064_rtb_pdata,
Laura Abbott350c8362012-02-28 14:46:52 -0800222 },
223};
224#endif
225
226static void __init reserve_rtb_memory(void)
227{
228#if defined(CONFIG_MSM_RTB)
Laura Abbottb93525f2012-04-12 09:57:19 -0700229 apq8064_reserve_table[MEMTYPE_EBI1].size += apq8064_rtb_pdata.size;
Laura Abbott350c8362012-02-28 14:46:52 -0800230#endif
231}
232
233
Kevin Chan13be4e22011-10-20 11:30:32 -0700234static void __init size_pmem_devices(void)
235{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800236#ifdef CONFIG_ANDROID_PMEM
237#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700238 android_pmem_adsp_pdata.size = pmem_adsp_size;
239 android_pmem_pdata.size = pmem_size;
240 android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE;
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700241#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
242#endif /*CONFIG_ANDROID_PMEM*/
Kevin Chan13be4e22011-10-20 11:30:32 -0700243}
244
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700245#ifdef CONFIG_ANDROID_PMEM
246#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700247static void __init reserve_memory_for(struct android_pmem_platform_data *p)
248{
249 apq8064_reserve_table[p->memory_type].size += p->size;
250}
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700251#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
252#endif /*CONFIG_ANDROID_PMEM*/
Kevin Chan13be4e22011-10-20 11:30:32 -0700253
Kevin Chan13be4e22011-10-20 11:30:32 -0700254static void __init reserve_pmem_memory(void)
255{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800256#ifdef CONFIG_ANDROID_PMEM
257#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700258 reserve_memory_for(&android_pmem_adsp_pdata);
259 reserve_memory_for(&android_pmem_pdata);
260 reserve_memory_for(&android_pmem_audio_pdata);
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700261#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
Kevin Chan13be4e22011-10-20 11:30:32 -0700262 apq8064_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size;
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700263#endif /*CONFIG_ANDROID_PMEM*/
Olav Haugan7c6aa742012-01-16 16:47:37 -0800264}
265
266static int apq8064_paddr_to_memtype(unsigned int paddr)
267{
268 return MEMTYPE_EBI1;
269}
270
271#ifdef CONFIG_ION_MSM
272#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Laura Abbottb93525f2012-04-12 09:57:19 -0700273static struct ion_cp_heap_pdata cp_mm_apq8064_ion_pdata = {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800274 .permission_type = IPT_TYPE_MM_CARVEOUT,
Olav Haugand3d29682012-01-19 10:57:07 -0800275 .align = PAGE_SIZE,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800276};
277
Laura Abbottb93525f2012-04-12 09:57:19 -0700278static struct ion_cp_heap_pdata cp_mfc_apq8064_ion_pdata = {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800279 .permission_type = IPT_TYPE_MFC_SHAREDMEM,
Olav Haugand3d29682012-01-19 10:57:07 -0800280 .align = PAGE_SIZE,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800281};
282
Laura Abbottb93525f2012-04-12 09:57:19 -0700283static struct ion_co_heap_pdata co_apq8064_ion_pdata = {
Olav Haugand3d29682012-01-19 10:57:07 -0800284 .adjacent_mem_id = INVALID_HEAP_ID,
285 .align = PAGE_SIZE,
286};
287
Laura Abbottb93525f2012-04-12 09:57:19 -0700288static struct ion_co_heap_pdata fw_co_apq8064_ion_pdata = {
Olav Haugand3d29682012-01-19 10:57:07 -0800289 .adjacent_mem_id = ION_CP_MM_HEAP_ID,
290 .align = SZ_128K,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800291};
292#endif
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800293
294/**
295 * These heaps are listed in the order they will be allocated. Due to
296 * video hardware restrictions and content protection the FW heap has to
297 * be allocated adjacent (below) the MM heap and the MFC heap has to be
298 * allocated after the MM heap to ensure MFC heap is not more than 256MB
299 * away from the base address of the FW heap.
300 * However, the order of FW heap and MM heap doesn't matter since these
301 * two heaps are taken care of by separate code to ensure they are adjacent
302 * to each other.
303 * Don't swap the order unless you know what you are doing!
304 */
Laura Abbottb93525f2012-04-12 09:57:19 -0700305static struct ion_platform_data apq8064_ion_pdata = {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800306 .nr = MSM_ION_HEAP_NUM,
307 .heaps = {
308 {
309 .id = ION_SYSTEM_HEAP_ID,
310 .type = ION_HEAP_TYPE_SYSTEM,
311 .name = ION_VMALLOC_HEAP_NAME,
312 },
313#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
314 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800315 .id = ION_CP_MM_HEAP_ID,
316 .type = ION_HEAP_TYPE_CP,
317 .name = ION_MM_HEAP_NAME,
318 .size = MSM_ION_MM_SIZE,
319 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700320 .extra_data = (void *) &cp_mm_apq8064_ion_pdata,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800321 },
322 {
Olav Haugand3d29682012-01-19 10:57:07 -0800323 .id = ION_MM_FIRMWARE_HEAP_ID,
324 .type = ION_HEAP_TYPE_CARVEOUT,
325 .name = ION_MM_FIRMWARE_HEAP_NAME,
326 .size = MSM_ION_MM_FW_SIZE,
327 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700328 .extra_data = (void *) &fw_co_apq8064_ion_pdata,
Olav Haugand3d29682012-01-19 10:57:07 -0800329 },
330 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800331 .id = ION_CP_MFC_HEAP_ID,
332 .type = ION_HEAP_TYPE_CP,
333 .name = ION_MFC_HEAP_NAME,
334 .size = MSM_ION_MFC_SIZE,
335 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700336 .extra_data = (void *) &cp_mfc_apq8064_ion_pdata,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800337 },
Olav Haugan129992c2012-03-22 09:54:01 -0700338#ifndef CONFIG_MSM_IOMMU
Olav Haugan7c6aa742012-01-16 16:47:37 -0800339 {
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800340 .id = ION_SF_HEAP_ID,
341 .type = ION_HEAP_TYPE_CARVEOUT,
342 .name = ION_SF_HEAP_NAME,
343 .size = MSM_ION_SF_SIZE,
344 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700345 .extra_data = (void *) &co_apq8064_ion_pdata,
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800346 },
Olav Haugan129992c2012-03-22 09:54:01 -0700347#endif
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800348 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800349 .id = ION_IOMMU_HEAP_ID,
350 .type = ION_HEAP_TYPE_IOMMU,
351 .name = ION_IOMMU_HEAP_NAME,
352 },
Olav Hauganf45e2142012-01-19 11:01:01 -0800353 {
354 .id = ION_QSECOM_HEAP_ID,
355 .type = ION_HEAP_TYPE_CARVEOUT,
356 .name = ION_QSECOM_HEAP_NAME,
357 .size = MSM_ION_QSECOM_SIZE,
358 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700359 .extra_data = (void *) &co_apq8064_ion_pdata,
Olav Hauganf45e2142012-01-19 11:01:01 -0800360 },
Olav Haugan2c43fac2012-01-19 11:06:37 -0800361 {
362 .id = ION_AUDIO_HEAP_ID,
363 .type = ION_HEAP_TYPE_CARVEOUT,
364 .name = ION_AUDIO_HEAP_NAME,
365 .size = MSM_ION_AUDIO_SIZE,
366 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700367 .extra_data = (void *) &co_apq8064_ion_pdata,
Olav Haugan2c43fac2012-01-19 11:06:37 -0800368 },
Olav Haugan7c6aa742012-01-16 16:47:37 -0800369#endif
370 }
371};
372
Laura Abbottb93525f2012-04-12 09:57:19 -0700373static struct platform_device apq8064_ion_dev = {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800374 .name = "ion-msm",
375 .id = 1,
Laura Abbottb93525f2012-04-12 09:57:19 -0700376 .dev = { .platform_data = &apq8064_ion_pdata },
Olav Haugan7c6aa742012-01-16 16:47:37 -0800377};
378#endif
379
Stephen Boyd668d7652012-04-25 11:31:01 -0700380static void __init reserve_ion_memory(void)
Olav Haugan7c6aa742012-01-16 16:47:37 -0800381{
382#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
383 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_SIZE;
Olav Haugand3d29682012-01-19 10:57:07 -0800384 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_FW_SIZE;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800385 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_SF_SIZE;
386 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MFC_SIZE;
Olav Hauganf45e2142012-01-19 11:01:01 -0800387 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_QSECOM_SIZE;
Olav Haugan2c43fac2012-01-19 11:06:37 -0800388 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_AUDIO_SIZE;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800389#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700390}
391
Huaibin Yang4a084e32011-12-15 15:25:52 -0800392static void __init reserve_mdp_memory(void)
393{
394 apq8064_mdp_writeback(apq8064_reserve_table);
395}
396
Kevin Chan13be4e22011-10-20 11:30:32 -0700397static void __init apq8064_calculate_reserve_sizes(void)
398{
399 size_pmem_devices();
400 reserve_pmem_memory();
Olav Haugan7c6aa742012-01-16 16:47:37 -0800401 reserve_ion_memory();
Huaibin Yang4a084e32011-12-15 15:25:52 -0800402 reserve_mdp_memory();
Laura Abbott350c8362012-02-28 14:46:52 -0800403 reserve_rtb_memory();
Kevin Chan13be4e22011-10-20 11:30:32 -0700404}
405
406static struct reserve_info apq8064_reserve_info __initdata = {
407 .memtype_reserve_table = apq8064_reserve_table,
408 .calculate_reserve_sizes = apq8064_calculate_reserve_sizes,
409 .paddr_to_memtype = apq8064_paddr_to_memtype,
410};
411
412static int apq8064_memory_bank_size(void)
413{
414 return 1<<29;
415}
416
417static void __init locate_unstable_memory(void)
418{
419 struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1];
420 unsigned long bank_size;
421 unsigned long low, high;
422
423 bank_size = apq8064_memory_bank_size();
424 low = meminfo.bank[0].start;
425 high = mb->start + mb->size;
Olav Haugand76e3a82012-01-16 16:55:07 -0800426
427 /* Check if 32 bit overflow occured */
428 if (high < mb->start)
429 high = ~0UL;
430
Kevin Chan13be4e22011-10-20 11:30:32 -0700431 low &= ~(bank_size - 1);
432
433 if (high - low <= bank_size)
434 return;
Jack Cheung46bfffa2012-01-19 15:26:24 -0800435 apq8064_reserve_info.low_unstable_address = mb->start -
436 MIN_MEMORY_BLOCK_SIZE + mb->size;
437 apq8064_reserve_info.max_unstable_size = MIN_MEMORY_BLOCK_SIZE;
438
Kevin Chan13be4e22011-10-20 11:30:32 -0700439 apq8064_reserve_info.bank_size = bank_size;
440 pr_info("low unstable address %lx max size %lx bank size %lx\n",
441 apq8064_reserve_info.low_unstable_address,
442 apq8064_reserve_info.max_unstable_size,
443 apq8064_reserve_info.bank_size);
444}
445
Hanumant Singh50440d42012-04-23 19:27:16 -0700446static int apq8064_change_memory_power(u64 start, u64 size,
447 int change_type)
448{
449 return soc_change_memory_power(start, size, change_type);
450}
451
Aravind Venkateswaran8ac7f412012-03-16 17:57:30 -0700452static char prim_panel_name[PANEL_NAME_MAX_LEN];
453static char ext_panel_name[PANEL_NAME_MAX_LEN];
454static int __init prim_display_setup(char *param)
455{
456 if (strnlen(param, PANEL_NAME_MAX_LEN))
457 strlcpy(prim_panel_name, param, PANEL_NAME_MAX_LEN);
458 return 0;
459}
460early_param("prim_display", prim_display_setup);
461
462static int __init ext_display_setup(char *param)
463{
464 if (strnlen(param, PANEL_NAME_MAX_LEN))
465 strlcpy(ext_panel_name, param, PANEL_NAME_MAX_LEN);
466 return 0;
467}
468early_param("ext_display", ext_display_setup);
469
Kevin Chan13be4e22011-10-20 11:30:32 -0700470static void __init apq8064_reserve(void)
471{
Aravind Venkateswaran8ac7f412012-03-16 17:57:30 -0700472 apq8064_set_display_params(prim_panel_name, ext_panel_name);
Kevin Chan13be4e22011-10-20 11:30:32 -0700473 msm_reserve();
474}
475
Laura Abbott6988cef2012-03-15 14:27:13 -0700476static void __init place_movable_zone(void)
477{
478 movable_reserved_start = apq8064_reserve_info.low_unstable_address;
479 movable_reserved_size = apq8064_reserve_info.max_unstable_size;
480 pr_info("movable zone start %lx size %lx\n",
481 movable_reserved_start, movable_reserved_size);
482}
483
484static void __init apq8064_early_reserve(void)
485{
486 reserve_info = &apq8064_reserve_info;
487 locate_unstable_memory();
488 place_movable_zone();
489
490}
Hemant Kumara945b472012-01-25 15:08:06 -0800491#ifdef CONFIG_USB_EHCI_MSM_HSIC
Hemant Kumare6275972012-02-29 20:06:21 -0800492/* Bandwidth requests (zero) if no vote placed */
493static struct msm_bus_vectors hsic_init_vectors[] = {
494 {
495 .src = MSM_BUS_MASTER_SPS,
496 .dst = MSM_BUS_SLAVE_EBI_CH0,
497 .ab = 0,
498 .ib = 0,
499 },
500 {
501 .src = MSM_BUS_MASTER_SPS,
502 .dst = MSM_BUS_SLAVE_SPS,
503 .ab = 0,
504 .ib = 0,
505 },
506};
507
508/* Bus bandwidth requests in Bytes/sec */
509static struct msm_bus_vectors hsic_max_vectors[] = {
510 {
511 .src = MSM_BUS_MASTER_SPS,
512 .dst = MSM_BUS_SLAVE_EBI_CH0,
513 .ab = 60000000, /* At least 480Mbps on bus. */
514 .ib = 960000000, /* MAX bursts rate */
515 },
516 {
517 .src = MSM_BUS_MASTER_SPS,
518 .dst = MSM_BUS_SLAVE_SPS,
519 .ab = 0,
520 .ib = 512000000, /*vote for 64Mhz dfab clk rate*/
521 },
522};
523
524static struct msm_bus_paths hsic_bus_scale_usecases[] = {
525 {
526 ARRAY_SIZE(hsic_init_vectors),
527 hsic_init_vectors,
528 },
529 {
530 ARRAY_SIZE(hsic_max_vectors),
531 hsic_max_vectors,
532 },
533};
534
535static struct msm_bus_scale_pdata hsic_bus_scale_pdata = {
536 hsic_bus_scale_usecases,
537 ARRAY_SIZE(hsic_bus_scale_usecases),
538 .name = "hsic",
539};
540
Hemant Kumara945b472012-01-25 15:08:06 -0800541static struct msm_hsic_host_platform_data msm_hsic_pdata = {
Hemant Kumare6275972012-02-29 20:06:21 -0800542 .strobe = 88,
543 .data = 89,
544 .bus_scale_table = &hsic_bus_scale_pdata,
Hemant Kumara945b472012-01-25 15:08:06 -0800545};
546#else
547static struct msm_hsic_host_platform_data msm_hsic_pdata;
548#endif
549
Hemant Kumarcb7d8a12012-01-25 12:25:55 -0800550#define PID_MAGIC_ID 0x71432909
551#define SERIAL_NUM_MAGIC_ID 0x61945374
552#define SERIAL_NUMBER_LENGTH 127
553#define DLOAD_USB_BASE_ADD 0x2A03F0C8
554
555struct magic_num_struct {
556 uint32_t pid;
557 uint32_t serial_num;
558};
559
560struct dload_struct {
561 uint32_t reserved1;
562 uint32_t reserved2;
563 uint32_t reserved3;
564 uint16_t reserved4;
565 uint16_t pid;
566 char serial_number[SERIAL_NUMBER_LENGTH];
567 uint16_t reserved5;
568 struct magic_num_struct magic_struct;
569};
570
571static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
572{
573 struct dload_struct __iomem *dload = 0;
574
575 dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload));
576 if (!dload) {
577 pr_err("%s: cannot remap I/O memory region: %08x\n",
578 __func__, DLOAD_USB_BASE_ADD);
579 return -ENXIO;
580 }
581
582 pr_debug("%s: dload:%p pid:%x serial_num:%s\n",
583 __func__, dload, pid, snum);
584 /* update pid */
585 dload->magic_struct.pid = PID_MAGIC_ID;
586 dload->pid = pid;
587
588 /* update serial number */
589 dload->magic_struct.serial_num = 0;
590 if (!snum) {
591 memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH);
592 goto out;
593 }
594
595 dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID;
596 strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH);
597out:
598 iounmap(dload);
599 return 0;
600}
601
602static struct android_usb_platform_data android_usb_pdata = {
603 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
604};
605
Hemant Kumar4933b072011-10-17 23:43:11 -0700606static struct platform_device android_usb_device = {
Hemant Kumarcb7d8a12012-01-25 12:25:55 -0800607 .name = "android_usb",
608 .id = -1,
609 .dev = {
610 .platform_data = &android_usb_pdata,
611 },
Hemant Kumar4933b072011-10-17 23:43:11 -0700612};
613
Hemant Kumar7620eed2012-02-26 09:08:43 -0800614/* Bandwidth requests (zero) if no vote placed */
615static struct msm_bus_vectors usb_init_vectors[] = {
616 {
617 .src = MSM_BUS_MASTER_SPS,
618 .dst = MSM_BUS_SLAVE_EBI_CH0,
619 .ab = 0,
620 .ib = 0,
621 },
622};
623
624/* Bus bandwidth requests in Bytes/sec */
625static struct msm_bus_vectors usb_max_vectors[] = {
626 {
627 .src = MSM_BUS_MASTER_SPS,
628 .dst = MSM_BUS_SLAVE_EBI_CH0,
629 .ab = 60000000, /* At least 480Mbps on bus. */
630 .ib = 960000000, /* MAX bursts rate */
631 },
632};
633
634static struct msm_bus_paths usb_bus_scale_usecases[] = {
635 {
636 ARRAY_SIZE(usb_init_vectors),
637 usb_init_vectors,
638 },
639 {
640 ARRAY_SIZE(usb_max_vectors),
641 usb_max_vectors,
642 },
643};
644
645static struct msm_bus_scale_pdata usb_bus_scale_pdata = {
646 usb_bus_scale_usecases,
647 ARRAY_SIZE(usb_bus_scale_usecases),
648 .name = "usb",
649};
650
Vamsi Krishna1f8704c2012-03-29 18:24:24 -0700651static int phy_init_seq[] = {
652 0x38, 0x81, /* update DC voltage level */
653 0x24, 0x82, /* set pre-emphasis and rise/fall time */
654 -1
655};
656
Hemant Kumar4933b072011-10-17 23:43:11 -0700657static struct msm_otg_platform_data msm_otg_pdata = {
Hemant Kumard86c4882012-01-24 19:39:37 -0800658 .mode = USB_OTG,
659 .otg_control = OTG_PMIC_CONTROL,
Hemant Kumar4933b072011-10-17 23:43:11 -0700660 .phy_type = SNPS_28NM_INTEGRATED_PHY,
Hemant Kumard86c4882012-01-24 19:39:37 -0800661 .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE),
662 .power_budget = 750,
Hemant Kumar7620eed2012-02-26 09:08:43 -0800663 .bus_scale_table = &usb_bus_scale_pdata,
Vamsi Krishna1f8704c2012-03-29 18:24:24 -0700664 .phy_init_seq = phy_init_seq,
Hemant Kumar4933b072011-10-17 23:43:11 -0700665};
666
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800667static struct msm_usb_host_platform_data msm_ehci_host_pdata3 = {
Manu Gautam91223e02011-11-08 15:27:22 +0530668 .power_budget = 500,
669};
670
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800671#ifdef CONFIG_USB_EHCI_MSM_HOST4
672static struct msm_usb_host_platform_data msm_ehci_host_pdata4;
673#endif
674
Manu Gautam91223e02011-11-08 15:27:22 +0530675static void __init apq8064_ehci_host_init(void)
676{
677 if (machine_is_apq8064_liquid()) {
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800678 msm_ehci_host_pdata3.dock_connect_irq =
Hemant Kumar56925352012-02-13 16:59:52 -0800679 PM8921_MPP_IRQ(PM8921_IRQ_BASE, 9);
680
Manu Gautam91223e02011-11-08 15:27:22 +0530681 apq8064_device_ehci_host3.dev.platform_data =
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800682 &msm_ehci_host_pdata3;
Manu Gautam91223e02011-11-08 15:27:22 +0530683 platform_device_register(&apq8064_device_ehci_host3);
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800684
685#ifdef CONFIG_USB_EHCI_MSM_HOST4
686 apq8064_device_ehci_host4.dev.platform_data =
687 &msm_ehci_host_pdata4;
688 platform_device_register(&apq8064_device_ehci_host4);
689#endif
Manu Gautam91223e02011-11-08 15:27:22 +0530690 }
691}
692
David Keitel2f613d92012-02-15 11:29:16 -0800693static struct smb349_platform_data smb349_data __initdata = {
694 .en_n_gpio = PM8921_GPIO_PM_TO_SYS(37),
695 .chg_susp_gpio = PM8921_GPIO_PM_TO_SYS(30),
696 .chg_current_ma = 2200,
697};
698
699static struct i2c_board_info smb349_charger_i2c_info[] __initdata = {
700 {
701 I2C_BOARD_INFO(SMB349_NAME, 0x1B),
702 .platform_data = &smb349_data,
703 },
704};
705
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -0800706struct sx150x_platform_data apq8064_sx150x_data[] = {
707 [SX150X_EPM] = {
708 .gpio_base = GPIO_EPM_EXPANDER_BASE,
709 .oscio_is_gpo = false,
710 .io_pullup_ena = 0x0,
711 .io_pulldn_ena = 0x0,
712 .io_open_drain_ena = 0x0,
713 .io_polarity = 0,
714 .irq_summary = -1,
715 },
716};
717
718static struct epm_chan_properties ads_adc_channel_data[] = {
719 {10, 100}, {500, 50}, {1, 1}, {1, 1},
720 {20, 50}, {10, 100}, {1, 1}, {1, 1},
721 {10, 100}, {10, 100}, {100, 100}, {200, 100},
722 {100, 50}, {2000, 50}, {1000, 50}, {200, 50},
723 {200, 100}, {1, 1}, {20, 50}, {500, 50},
724 {50, 50}, {200, 100}, {500, 100}, {20, 50},
725 {200, 50}, {2000, 100}, {1000, 50}, {100, 50},
726 {200, 100}, {500, 50}, {1000, 100}, {200, 50},
727 {1000, 50}, {50, 50}, {100, 50}, {100, 50},
728 {1, 1}, {1, 1}, {20, 100}, {20, 50},
729 {500, 100}, {1000, 100}, {100, 50}, {1000, 50},
730 {100, 50}, {1000, 100}, {100, 50}, {100, 50},
731};
732
733static struct epm_adc_platform_data epm_adc_pdata = {
734 .channel = ads_adc_channel_data,
735 .bus_id = 0x0,
736 .epm_i2c_board_info = {
737 .type = "sx1509q",
738 .addr = 0x3e,
739 .platform_data = &apq8064_sx150x_data[SX150X_EPM],
740 },
741 .gpio_expander_base_addr = GPIO_EPM_EXPANDER_BASE,
742};
743
744static struct platform_device epm_adc_device = {
745 .name = "epm_adc",
746 .id = -1,
747 .dev = {
748 .platform_data = &epm_adc_pdata,
749 },
750};
751
752static void __init apq8064_epm_adc_init(void)
753{
754 epm_adc_pdata.num_channels = 32;
755 epm_adc_pdata.num_adc = 2;
756 epm_adc_pdata.chan_per_adc = 16;
757 epm_adc_pdata.chan_per_mux = 8;
758};
759
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800760/* Micbias setting is based on 8660 CDP/MTP/FLUID requirement
761 * 4 micbiases are used to power various analog and digital
762 * microphones operating at 1800 mV. Technically, all micbiases
763 * can source from single cfilter since all microphones operate
764 * at the same voltage level. The arrangement below is to make
765 * sure all cfilters are exercised. LDO_H regulator ouput level
766 * does not need to be as high as 2.85V. It is choosen for
767 * microphone sensitivity purpose.
768 */
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530769static struct wcd9xxx_pdata apq8064_tabla_platform_data = {
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800770 .slimbus_slave_device = {
771 .name = "tabla-slave",
772 .e_addr = {0, 0, 0x10, 0, 0x17, 2},
773 },
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800774 .irq = MSM_GPIO_TO_INT(42),
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800775 .irq_base = TABLA_INTERRUPT_BASE,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530776 .num_irqs = NR_WCD9XXX_IRQS,
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800777 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
778 .micbias = {
779 .ldoh_v = TABLA_LDOH_2P85_V,
780 .cfilt1_mv = 1800,
781 .cfilt2_mv = 1800,
782 .cfilt3_mv = 1800,
783 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
784 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
785 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
786 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530787 },
788 .regulator = {
789 {
790 .name = "CDC_VDD_CP",
791 .min_uV = 1800000,
792 .max_uV = 1800000,
793 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
794 },
795 {
796 .name = "CDC_VDDA_RX",
797 .min_uV = 1800000,
798 .max_uV = 1800000,
799 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
800 },
801 {
802 .name = "CDC_VDDA_TX",
803 .min_uV = 1800000,
804 .max_uV = 1800000,
805 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
806 },
807 {
808 .name = "VDDIO_CDC",
809 .min_uV = 1800000,
810 .max_uV = 1800000,
811 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
812 },
813 {
814 .name = "VDDD_CDC_D",
815 .min_uV = 1225000,
816 .max_uV = 1225000,
817 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
818 },
819 {
820 .name = "CDC_VDDA_A_1P2V",
821 .min_uV = 1225000,
822 .max_uV = 1225000,
823 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
824 },
825 },
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800826};
827
828static struct slim_device apq8064_slim_tabla = {
829 .name = "tabla-slim",
830 .e_addr = {0, 1, 0x10, 0, 0x17, 2},
831 .dev = {
832 .platform_data = &apq8064_tabla_platform_data,
833 },
834};
835
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530836static struct wcd9xxx_pdata apq8064_tabla20_platform_data = {
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800837 .slimbus_slave_device = {
838 .name = "tabla-slave",
839 .e_addr = {0, 0, 0x60, 0, 0x17, 2},
840 },
841 .irq = MSM_GPIO_TO_INT(42),
842 .irq_base = TABLA_INTERRUPT_BASE,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530843 .num_irqs = NR_WCD9XXX_IRQS,
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800844 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
845 .micbias = {
846 .ldoh_v = TABLA_LDOH_2P85_V,
847 .cfilt1_mv = 1800,
848 .cfilt2_mv = 1800,
849 .cfilt3_mv = 1800,
850 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
851 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
852 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
853 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530854 },
855 .regulator = {
856 {
857 .name = "CDC_VDD_CP",
858 .min_uV = 1800000,
859 .max_uV = 1800000,
860 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
861 },
862 {
863 .name = "CDC_VDDA_RX",
864 .min_uV = 1800000,
865 .max_uV = 1800000,
866 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
867 },
868 {
869 .name = "CDC_VDDA_TX",
870 .min_uV = 1800000,
871 .max_uV = 1800000,
872 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
873 },
874 {
875 .name = "VDDIO_CDC",
876 .min_uV = 1800000,
877 .max_uV = 1800000,
878 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
879 },
880 {
881 .name = "VDDD_CDC_D",
882 .min_uV = 1225000,
883 .max_uV = 1225000,
884 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
885 },
886 {
887 .name = "CDC_VDDA_A_1P2V",
888 .min_uV = 1225000,
889 .max_uV = 1225000,
890 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
891 },
892 },
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800893};
894
895static struct slim_device apq8064_slim_tabla20 = {
896 .name = "tabla2x-slim",
897 .e_addr = {0, 1, 0x60, 0, 0x17, 2},
898 .dev = {
899 .platform_data = &apq8064_tabla20_platform_data,
900 },
901};
902
Santosh Mardi695be0d2012-04-10 23:21:12 +0530903/* enable the level shifter for cs8427 to make sure the I2C
904 * clock is running at 100KHz and voltage levels are at 3.3
905 * and 5 volts
906 */
907static int enable_100KHz_ls(int enable)
908{
909 int ret = 0;
910 if (enable) {
911 ret = gpio_request(SX150X_GPIO(1, 10),
912 "cs8427_100KHZ_ENABLE");
913 if (ret) {
914 pr_err("%s: Failed to request gpio %d\n", __func__,
915 SX150X_GPIO(1, 10));
916 return ret;
917 }
918 gpio_direction_output(SX150X_GPIO(1, 10), 1);
919 } else
920 gpio_free(SX150X_GPIO(1, 10));
921 return ret;
922}
923
Santosh Mardieff9a742012-04-09 23:23:39 +0530924static struct cs8427_platform_data cs8427_i2c_platform_data = {
925 .irq = SX150X_GPIO(1, 4),
926 .reset_gpio = SX150X_GPIO(1, 6),
Santosh Mardi695be0d2012-04-10 23:21:12 +0530927 .enable = enable_100KHz_ls,
Santosh Mardieff9a742012-04-09 23:23:39 +0530928};
929
930static struct i2c_board_info cs8427_device_info[] __initdata = {
931 {
932 I2C_BOARD_INFO("cs8427", CS8427_ADDR4),
933 .platform_data = &cs8427_i2c_platform_data,
934 },
935};
936
Amy Maloche70090f992012-02-16 16:35:26 -0800937#define HAP_SHIFT_LVL_OE_GPIO PM8921_MPP_PM_TO_SYS(8)
938#define ISA1200_HAP_EN_GPIO PM8921_GPIO_PM_TO_SYS(33)
939#define ISA1200_HAP_LEN_GPIO PM8921_GPIO_PM_TO_SYS(20)
940#define ISA1200_HAP_CLK PM8921_GPIO_PM_TO_SYS(44)
941
942static int isa1200_power(int on)
943{
Amy Maloche8f973892012-03-26 14:53:13 -0700944 int rc = 0;
945
Amy Maloche70090f992012-02-16 16:35:26 -0800946 gpio_set_value_cansleep(ISA1200_HAP_CLK, !!on);
947
Amy Maloche8f973892012-03-26 14:53:13 -0700948 if (on)
949 rc = pm8xxx_aux_clk_control(CLK_MP3_2, XO_DIV_1, true);
950 else
951 rc = pm8xxx_aux_clk_control(CLK_MP3_2, XO_DIV_NONE, true);
952
953 if (rc) {
954 pr_err("%s: unable to write aux clock register(%d)\n",
955 __func__, rc);
956 }
957
958 return rc;
Amy Maloche70090f992012-02-16 16:35:26 -0800959}
960
961static int isa1200_dev_setup(bool enable)
962{
963 int rc = 0;
964
Amy Maloche70090f992012-02-16 16:35:26 -0800965 if (!enable)
966 goto free_gpio;
967
968 rc = gpio_request(ISA1200_HAP_CLK, "haptics_clk");
969 if (rc) {
970 pr_err("%s: unable to request gpio %d config(%d)\n",
971 __func__, ISA1200_HAP_CLK, rc);
972 return rc;
973 }
974
975 rc = gpio_direction_output(ISA1200_HAP_CLK, 0);
976 if (rc) {
977 pr_err("%s: unable to set direction\n", __func__);
978 goto free_gpio;
979 }
980
981 return 0;
982
983free_gpio:
984 gpio_free(ISA1200_HAP_CLK);
985 return rc;
986}
987
988static struct isa1200_regulator isa1200_reg_data[] = {
989 {
990 .name = "vddp",
991 .min_uV = ISA_I2C_VTG_MIN_UV,
992 .max_uV = ISA_I2C_VTG_MAX_UV,
993 .load_uA = ISA_I2C_CURR_UA,
994 },
995};
996
997static struct isa1200_platform_data isa1200_1_pdata = {
998 .name = "vibrator",
999 .dev_setup = isa1200_dev_setup,
1000 .power_on = isa1200_power,
1001 .hap_en_gpio = ISA1200_HAP_EN_GPIO,
1002 .hap_len_gpio = ISA1200_HAP_LEN_GPIO,
1003 .max_timeout = 15000,
1004 .mode_ctrl = PWM_GEN_MODE,
1005 .pwm_fd = {
1006 .pwm_div = 256,
1007 },
1008 .is_erm = false,
1009 .smart_en = true,
1010 .ext_clk_en = true,
1011 .chip_en = 1,
1012 .regulator_info = isa1200_reg_data,
1013 .num_regulators = ARRAY_SIZE(isa1200_reg_data),
1014};
1015
1016static struct i2c_board_info isa1200_board_info[] __initdata = {
1017 {
1018 I2C_BOARD_INFO("isa1200_1", 0x90>>1),
1019 .platform_data = &isa1200_1_pdata,
1020 },
1021};
Jing Lin21ed4de2012-02-05 15:53:28 -08001022/* configuration data for mxt1386e using V2.1 firmware */
1023static const u8 mxt1386e_config_data_v2_1[] = {
1024 /* T6 Object */
1025 0, 0, 0, 0, 0, 0,
1026 /* T38 Object */
Jing Linf1208fd2012-02-23 11:15:42 -08001027 14, 1, 0, 22, 2, 12, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001028 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1029 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1030 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1031 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1032 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1033 0, 0, 0, 0,
1034 /* T7 Object */
Jing Linf1208fd2012-02-23 11:15:42 -08001035 100, 10, 50,
Jing Lin21ed4de2012-02-05 15:53:28 -08001036 /* T8 Object */
Jing Linf1208fd2012-02-23 11:15:42 -08001037 25, 0, 20, 20, 0, 0, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001038 /* T9 Object */
1039 131, 0, 0, 26, 42, 0, 32, 80, 2, 5,
1040 0, 5, 5, 0, 10, 30, 10, 10, 255, 2,
Jing Linf1208fd2012-02-23 11:15:42 -08001041 85, 5, 0, 5, 9, 5, 12, 35, 70, 40,
1042 20, 5, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001043 /* T18 Object */
1044 0, 0,
1045 /* T24 Object */
1046 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1047 0, 0, 0, 0, 0, 0, 0, 0, 0,
1048 /* T25 Object */
1049 3, 0, 60, 115, 156, 99,
1050 /* T27 Object */
1051 0, 0, 0, 0, 0, 0, 0,
1052 /* T40 Object */
1053 0, 0, 0, 0, 0,
1054 /* T42 Object */
1055 2, 0, 255, 0, 255, 0, 0, 0, 0, 0,
1056 /* T43 Object */
1057 0, 0, 0, 0, 0, 0, 0, 64, 0, 8,
1058 16,
1059 /* T46 Object */
Jing Linf1208fd2012-02-23 11:15:42 -08001060 68, 0, 16, 16, 0, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001061 /* T47 Object */
1062 0, 0, 0, 0, 0, 0, 3, 64, 66, 0,
1063 /* T48 Object */
1064 31, 64, 64, 0, 0, 0, 0, 0, 0, 0,
Jing Linf1208fd2012-02-23 11:15:42 -08001065 32, 40, 0, 10, 10, 0, 0, 100, 10, 90,
1066 0, 0, 0, 0, 0, 0, 0, 10, 1, 10,
1067 52, 10, 12, 0, 33, 0, 1, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001068 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1069 0, 0, 0, 0,
1070 /* T56 Object */
1071 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1072 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1073 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1074 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Jing Linf1208fd2012-02-23 11:15:42 -08001075 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1076 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001077};
1078
Terence Hampson2e1705f2012-04-11 19:55:29 -04001079#ifndef CONFIG_MSM_VCAP
Jing Lin21ed4de2012-02-05 15:53:28 -08001080#define MXT_TS_GPIO_IRQ 6
1081#define MXT_TS_PWR_EN_GPIO PM8921_GPIO_PM_TO_SYS(23)
1082#define MXT_TS_RESET_GPIO 33
1083
1084static struct mxt_config_info mxt_config_array[] = {
1085 {
1086 .config = mxt1386e_config_data_v2_1,
1087 .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1),
1088 .family_id = 0xA0,
1089 .variant_id = 0x7,
1090 .version = 0x21,
1091 .build = 0xAA,
Jing Linef4aa9b2012-03-26 12:01:41 -07001092 .bootldr_id = MXT_BOOTLOADER_ID_1386E,
1093 .fw_name = "atmel_8064_liquid_v2_2_AA.hex",
1094 },
1095 {
1096 /* The config data for V2.2.AA is the same as for V2.1.AA */
1097 .config = mxt1386e_config_data_v2_1,
1098 .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1),
1099 .family_id = 0xA0,
1100 .variant_id = 0x7,
1101 .version = 0x22,
1102 .build = 0xAA,
1103 .bootldr_id = MXT_BOOTLOADER_ID_1386E,
Jing Lin21ed4de2012-02-05 15:53:28 -08001104 },
1105};
1106
1107static struct mxt_platform_data mxt_platform_data = {
1108 .config_array = mxt_config_array,
1109 .config_array_size = ARRAY_SIZE(mxt_config_array),
Mohan Pallaka56a1a5d2012-02-23 12:05:13 -08001110 .panel_minx = 0,
1111 .panel_maxx = 1365,
1112 .panel_miny = 0,
1113 .panel_maxy = 767,
1114 .disp_minx = 0,
1115 .disp_maxx = 1365,
1116 .disp_miny = 0,
1117 .disp_maxy = 767,
Anirudh Ghayal39dbe3f2012-04-13 15:43:16 +05301118 .irqflags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
Jing Lin21ed4de2012-02-05 15:53:28 -08001119 .i2c_pull_up = true,
1120 .reset_gpio = MXT_TS_RESET_GPIO,
1121 .irq_gpio = MXT_TS_GPIO_IRQ,
1122};
1123
1124static struct i2c_board_info mxt_device_info[] __initdata = {
1125 {
1126 I2C_BOARD_INFO("atmel_mxt_ts", 0x5b),
1127 .platform_data = &mxt_platform_data,
1128 .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ),
1129 },
1130};
Terence Hampson2e1705f2012-04-11 19:55:29 -04001131#endif
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001132#define CYTTSP_TS_GPIO_IRQ 6
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001133#define CYTTSP_TS_GPIO_SLEEP 33
1134
1135static ssize_t tma340_vkeys_show(struct kobject *kobj,
1136 struct kobj_attribute *attr, char *buf)
1137{
1138 return snprintf(buf, 200,
1139 __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97"
1140 ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97"
1141 ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97"
1142 ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97"
1143 "\n");
1144}
1145
1146static struct kobj_attribute tma340_vkeys_attr = {
1147 .attr = {
1148 .mode = S_IRUGO,
1149 },
1150 .show = &tma340_vkeys_show,
1151};
1152
1153static struct attribute *tma340_properties_attrs[] = {
1154 &tma340_vkeys_attr.attr,
1155 NULL
1156};
1157
1158static struct attribute_group tma340_properties_attr_group = {
1159 .attrs = tma340_properties_attrs,
1160};
1161
1162static int cyttsp_platform_init(struct i2c_client *client)
1163{
1164 int rc = 0;
1165 static struct kobject *tma340_properties_kobj;
1166
1167 tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c";
1168 tma340_properties_kobj = kobject_create_and_add("board_properties",
1169 NULL);
1170 if (tma340_properties_kobj)
1171 rc = sysfs_create_group(tma340_properties_kobj,
1172 &tma340_properties_attr_group);
1173 if (!tma340_properties_kobj || rc)
1174 pr_err("%s: failed to create board_properties\n",
1175 __func__);
1176
1177 return 0;
1178}
1179
1180static struct cyttsp_regulator cyttsp_regulator_data[] = {
1181 {
1182 .name = "vdd",
1183 .min_uV = CY_TMA300_VTG_MIN_UV,
1184 .max_uV = CY_TMA300_VTG_MAX_UV,
1185 .hpm_load_uA = CY_TMA300_CURR_24HZ_UA,
1186 .lpm_load_uA = CY_TMA300_CURR_24HZ_UA,
1187 },
1188 {
1189 .name = "vcc_i2c",
1190 .min_uV = CY_I2C_VTG_MIN_UV,
1191 .max_uV = CY_I2C_VTG_MAX_UV,
1192 .hpm_load_uA = CY_I2C_CURR_UA,
1193 .lpm_load_uA = CY_I2C_CURR_UA,
1194 },
1195};
1196
1197static struct cyttsp_platform_data cyttsp_pdata = {
1198 .panel_maxx = 634,
1199 .panel_maxy = 1166,
1200 .disp_maxx = 599,
1201 .disp_maxy = 1023,
1202 .disp_minx = 0,
1203 .disp_miny = 0,
1204 .flags = 0x01,
1205 .gen = CY_GEN3,
1206 .use_st = CY_USE_ST,
1207 .use_mt = CY_USE_MT,
1208 .use_hndshk = CY_SEND_HNDSHK,
1209 .use_trk_id = CY_USE_TRACKING_ID,
1210 .use_sleep = CY_USE_DEEP_SLEEP_SEL,
1211 .use_gestures = CY_USE_GESTURES,
1212 .fw_fname = "cyttsp_8064_mtp.hex",
1213 /* change act_intrvl to customize the Active power state
1214 * scanning/processing refresh interval for Operating mode
1215 */
1216 .act_intrvl = CY_ACT_INTRVL_DFLT,
1217 /* change tch_tmout to customize the touch timeout for the
1218 * Active power state for Operating mode
1219 */
1220 .tch_tmout = CY_TCH_TMOUT_DFLT,
1221 /* change lp_intrvl to customize the Low Power power state
1222 * scanning/processing refresh interval for Operating mode
1223 */
1224 .lp_intrvl = CY_LP_INTRVL_DFLT,
1225 .sleep_gpio = CYTTSP_TS_GPIO_SLEEP,
Amy Maloche9ba3ffe2012-04-26 10:31:20 -07001226 .resout_gpio = -1,
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001227 .irq_gpio = CYTTSP_TS_GPIO_IRQ,
1228 .regulator_info = cyttsp_regulator_data,
1229 .num_regulators = ARRAY_SIZE(cyttsp_regulator_data),
1230 .init = cyttsp_platform_init,
1231 .correct_fw_ver = 17,
1232};
1233
1234static struct i2c_board_info cyttsp_info[] __initdata = {
1235 {
1236 I2C_BOARD_INFO(CY_I2C_NAME, 0x24),
1237 .platform_data = &cyttsp_pdata,
1238 .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ),
1239 },
1240};
Jing Lin21ed4de2012-02-05 15:53:28 -08001241
Ankit Verma6b7e2ba2012-01-26 15:48:54 -08001242#define MSM_WCNSS_PHYS 0x03000000
1243#define MSM_WCNSS_SIZE 0x280000
1244
1245static struct resource resources_wcnss_wlan[] = {
1246 {
1247 .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1248 .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1249 .name = "wcnss_wlanrx_irq",
1250 .flags = IORESOURCE_IRQ,
1251 },
1252 {
1253 .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1254 .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1255 .name = "wcnss_wlantx_irq",
1256 .flags = IORESOURCE_IRQ,
1257 },
1258 {
1259 .start = MSM_WCNSS_PHYS,
1260 .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1,
1261 .name = "wcnss_mmio",
1262 .flags = IORESOURCE_MEM,
1263 },
1264 {
1265 .start = 64,
1266 .end = 68,
1267 .name = "wcnss_gpios_5wire",
1268 .flags = IORESOURCE_IO,
1269 },
1270};
1271
1272static struct qcom_wcnss_opts qcom_wcnss_pdata = {
1273 .has_48mhz_xo = 1,
1274};
1275
1276static struct platform_device msm_device_wcnss_wlan = {
1277 .name = "wcnss_wlan",
1278 .id = 0,
1279 .num_resources = ARRAY_SIZE(resources_wcnss_wlan),
1280 .resource = resources_wcnss_wlan,
1281 .dev = {.platform_data = &qcom_wcnss_pdata},
1282};
1283
Ankit Vermab7c26e62012-02-28 15:04:15 -08001284static struct platform_device msm_device_iris_fm __devinitdata = {
1285 .name = "iris_fm",
1286 .id = -1,
1287};
1288
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07001289#ifdef CONFIG_QSEECOM
1290/* qseecom bus scaling */
1291static struct msm_bus_vectors qseecom_clks_init_vectors[] = {
1292 {
1293 .src = MSM_BUS_MASTER_SPS,
1294 .dst = MSM_BUS_SLAVE_EBI_CH0,
1295 .ib = 0,
1296 .ab = 0,
1297 },
1298 {
1299 .src = MSM_BUS_MASTER_SPDM,
1300 .dst = MSM_BUS_SLAVE_SPDM,
1301 .ib = 0,
1302 .ab = 0,
1303 },
1304};
1305
1306static struct msm_bus_vectors qseecom_enable_dfab_vectors[] = {
1307 {
1308 .src = MSM_BUS_MASTER_SPS,
1309 .dst = MSM_BUS_SLAVE_EBI_CH0,
1310 .ib = (492 * 8) * 1000000UL,
1311 .ab = (492 * 8) * 100000UL,
1312 },
1313 {
1314 .src = MSM_BUS_MASTER_SPDM,
1315 .dst = MSM_BUS_SLAVE_SPDM,
1316 .ib = 0,
1317 .ab = 0,
1318 },
1319};
1320
1321static struct msm_bus_vectors qseecom_enable_sfpb_vectors[] = {
1322 {
1323 .src = MSM_BUS_MASTER_SPS,
1324 .dst = MSM_BUS_SLAVE_EBI_CH0,
1325 .ib = 0,
1326 .ab = 0,
1327 },
1328 {
1329 .src = MSM_BUS_MASTER_SPDM,
1330 .dst = MSM_BUS_SLAVE_SPDM,
1331 .ib = (64 * 8) * 1000000UL,
1332 .ab = (64 * 8) * 100000UL,
1333 },
1334};
1335
1336static struct msm_bus_paths qseecom_hw_bus_scale_usecases[] = {
1337 {
1338 ARRAY_SIZE(qseecom_clks_init_vectors),
1339 qseecom_clks_init_vectors,
1340 },
1341 {
1342 ARRAY_SIZE(qseecom_enable_dfab_vectors),
1343 qseecom_enable_sfpb_vectors,
1344 },
1345 {
1346 ARRAY_SIZE(qseecom_enable_sfpb_vectors),
1347 qseecom_enable_sfpb_vectors,
1348 },
1349};
1350
1351static struct msm_bus_scale_pdata qseecom_bus_pdata = {
1352 qseecom_hw_bus_scale_usecases,
1353 ARRAY_SIZE(qseecom_hw_bus_scale_usecases),
1354 .name = "qsee",
1355};
1356
1357static struct platform_device qseecom_device = {
1358 .name = "qseecom",
1359 .id = 0,
1360 .dev = {
1361 .platform_data = &qseecom_bus_pdata,
1362 },
1363};
1364#endif
1365
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001366#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1367 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
1368 defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1369 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1370
1371#define QCE_SIZE 0x10000
1372#define QCE_0_BASE 0x11000000
1373
1374#define QCE_HW_KEY_SUPPORT 0
1375#define QCE_SHA_HMAC_SUPPORT 1
1376#define QCE_SHARE_CE_RESOURCE 3
1377#define QCE_CE_SHARED 0
1378
1379static struct resource qcrypto_resources[] = {
1380 [0] = {
1381 .start = QCE_0_BASE,
1382 .end = QCE_0_BASE + QCE_SIZE - 1,
1383 .flags = IORESOURCE_MEM,
1384 },
1385 [1] = {
1386 .name = "crypto_channels",
1387 .start = DMOV8064_CE_IN_CHAN,
1388 .end = DMOV8064_CE_OUT_CHAN,
1389 .flags = IORESOURCE_DMA,
1390 },
1391 [2] = {
1392 .name = "crypto_crci_in",
1393 .start = DMOV8064_CE_IN_CRCI,
1394 .end = DMOV8064_CE_IN_CRCI,
1395 .flags = IORESOURCE_DMA,
1396 },
1397 [3] = {
1398 .name = "crypto_crci_out",
1399 .start = DMOV8064_CE_OUT_CRCI,
1400 .end = DMOV8064_CE_OUT_CRCI,
1401 .flags = IORESOURCE_DMA,
1402 },
1403};
1404
1405static struct resource qcedev_resources[] = {
1406 [0] = {
1407 .start = QCE_0_BASE,
1408 .end = QCE_0_BASE + QCE_SIZE - 1,
1409 .flags = IORESOURCE_MEM,
1410 },
1411 [1] = {
1412 .name = "crypto_channels",
1413 .start = DMOV8064_CE_IN_CHAN,
1414 .end = DMOV8064_CE_OUT_CHAN,
1415 .flags = IORESOURCE_DMA,
1416 },
1417 [2] = {
1418 .name = "crypto_crci_in",
1419 .start = DMOV8064_CE_IN_CRCI,
1420 .end = DMOV8064_CE_IN_CRCI,
1421 .flags = IORESOURCE_DMA,
1422 },
1423 [3] = {
1424 .name = "crypto_crci_out",
1425 .start = DMOV8064_CE_OUT_CRCI,
1426 .end = DMOV8064_CE_OUT_CRCI,
1427 .flags = IORESOURCE_DMA,
1428 },
1429};
1430
1431#endif
1432
1433#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1434 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1435
1436static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
1437 .ce_shared = QCE_CE_SHARED,
1438 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1439 .hw_key_support = QCE_HW_KEY_SUPPORT,
1440 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -08001441 .bus_scale_table = NULL,
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001442};
1443
1444static struct platform_device qcrypto_device = {
1445 .name = "qcrypto",
1446 .id = 0,
1447 .num_resources = ARRAY_SIZE(qcrypto_resources),
1448 .resource = qcrypto_resources,
1449 .dev = {
1450 .coherent_dma_mask = DMA_BIT_MASK(32),
1451 .platform_data = &qcrypto_ce_hw_suppport,
1452 },
1453};
1454#endif
1455
1456#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1457 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1458
1459static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
1460 .ce_shared = QCE_CE_SHARED,
1461 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1462 .hw_key_support = QCE_HW_KEY_SUPPORT,
1463 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -08001464 .bus_scale_table = NULL,
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001465};
1466
1467static struct platform_device qcedev_device = {
1468 .name = "qce",
1469 .id = 0,
1470 .num_resources = ARRAY_SIZE(qcedev_resources),
1471 .resource = qcedev_resources,
1472 .dev = {
1473 .coherent_dma_mask = DMA_BIT_MASK(32),
1474 .platform_data = &qcedev_ce_hw_suppport,
1475 },
1476};
1477#endif
1478
Joel Kingdacbc822012-01-25 13:30:57 -08001479static struct mdm_platform_data mdm_platform_data = {
1480 .mdm_version = "3.0",
1481 .ramdump_delay_ms = 2000,
Hemant Kumara945b472012-01-25 15:08:06 -08001482 .peripheral_platform_device = &apq8064_device_hsic_host,
Joel Kingdacbc822012-01-25 13:30:57 -08001483};
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001484
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -08001485static struct tsens_platform_data apq_tsens_pdata = {
1486 .tsens_factor = 1000,
1487 .hw_type = APQ_8064,
1488 .tsens_num_sensor = 11,
1489 .slope = {1176, 1176, 1154, 1176, 1111,
1490 1132, 1132, 1199, 1132, 1199, 1132},
1491};
1492
Siddartha Mohanadoss48cad912012-04-05 21:29:54 -07001493static struct platform_device msm_tsens_device = {
1494 .name = "tsens8960-tm",
1495 .id = -1,
1496};
1497
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001498#define MSM_SHARED_RAM_PHYS 0x80000000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001499static void __init apq8064_map_io(void)
1500{
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001501 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001502 msm_map_apq8064_io();
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -07001503 if (socinfo_init() < 0)
1504 pr_err("socinfo_init() failed!\n");
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001505}
1506
1507static void __init apq8064_init_irq(void)
1508{
Praveen Chidambaram78499012011-11-01 17:15:17 -06001509 struct msm_mpm_device_data *data = NULL;
1510
1511#ifdef CONFIG_MSM_MPM
1512 data = &apq8064_mpm_dev_data;
1513#endif
1514
1515 msm_mpm_irq_extn_init(data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001516 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
1517 (void *)MSM_QGIC_CPU_BASE);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001518}
1519
Jay Chokshi7805b5a2011-11-07 15:55:30 -08001520static struct platform_device msm8064_device_saw_regulator_core0 = {
1521 .name = "saw-regulator",
1522 .id = 0,
1523 .dev = {
1524 .platform_data = &msm8064_saw_regulator_pdata_8921_s5,
1525 },
1526};
1527
1528static struct platform_device msm8064_device_saw_regulator_core1 = {
1529 .name = "saw-regulator",
1530 .id = 1,
1531 .dev = {
1532 .platform_data = &msm8064_saw_regulator_pdata_8921_s6,
1533 },
1534};
1535
1536static struct platform_device msm8064_device_saw_regulator_core2 = {
1537 .name = "saw-regulator",
1538 .id = 2,
1539 .dev = {
1540 .platform_data = &msm8064_saw_regulator_pdata_8821_s0,
1541 },
1542};
1543
1544static struct platform_device msm8064_device_saw_regulator_core3 = {
1545 .name = "saw-regulator",
1546 .id = 3,
1547 .dev = {
1548 .platform_data = &msm8064_saw_regulator_pdata_8821_s1,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001549
1550 },
1551};
1552
Oluwafemi Adeyemif5a31422012-03-08 16:58:45 -08001553static struct msm_rpmrs_level msm_rpmrs_levels[] = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06001554 {
1555 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
1556 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
1557 true,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001558 100, 650, 801, 200,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001559 },
1560
1561 {
1562 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
1563 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
1564 true,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001565 2000, 200, 576000, 2000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001566 },
1567
1568 {
1569 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1570 MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE),
1571 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001572 8500, 51, 1122000, 8500,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001573 },
1574
1575 {
1576 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1577 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, MAX, ACTIVE),
1578 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001579 9000, 51, 1130300, 9000,
1580 },
1581 {
1582 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1583 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, ACTIVE, RET_HIGH),
1584 false,
1585 10000, 51, 1130300, 10000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001586 },
1587
1588 {
1589 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1590 MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE),
1591 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001592 12000, 14, 2205900, 12000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001593 },
1594
1595 {
1596 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1597 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
1598 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001599 18000, 12, 2364250, 18000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001600 },
1601
1602 {
1603 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1604 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH),
1605 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001606 23500, 10, 2667000, 23500,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001607 },
1608
1609 {
1610 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1611 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
1612 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001613 29700, 5, 2867000, 30000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001614 },
1615};
1616
1617static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
1618 .mode = MSM_PM_BOOT_CONFIG_TZ,
1619};
1620
1621static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = {
1622 .levels = &msm_rpmrs_levels[0],
1623 .num_levels = ARRAY_SIZE(msm_rpmrs_levels),
1624 .vdd_mem_levels = {
1625 [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000,
1626 [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000,
1627 [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000,
1628 [MSM_RPMRS_VDD_MEM_MAX] = 1150000,
1629 },
1630 .vdd_dig_levels = {
1631 [MSM_RPMRS_VDD_DIG_RET_LOW] = 500000,
1632 [MSM_RPMRS_VDD_DIG_RET_HIGH] = 750000,
1633 [MSM_RPMRS_VDD_DIG_ACTIVE] = 950000,
1634 [MSM_RPMRS_VDD_DIG_MAX] = 1150000,
1635 },
1636 .vdd_mask = 0x7FFFFF,
1637 .rpmrs_target_id = {
1638 [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK,
1639 [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST,
1640 [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_PM8921_S3_0,
1641 [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_PM8921_S3_1,
1642 [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8921_L24_0,
1643 [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8921_L24_1,
1644 [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL,
1645 },
1646};
1647
Praveen Chidambaram78499012011-11-01 17:15:17 -06001648static uint8_t spm_wfi_cmd_sequence[] __initdata = {
1649 0x03, 0x0f,
1650};
1651
1652static uint8_t spm_power_collapse_without_rpm[] __initdata = {
1653 0x00, 0x24, 0x54, 0x10,
1654 0x09, 0x03, 0x01,
1655 0x10, 0x54, 0x30, 0x0C,
1656 0x24, 0x30, 0x0f,
1657};
1658
1659static uint8_t spm_power_collapse_with_rpm[] __initdata = {
1660 0x00, 0x24, 0x54, 0x10,
1661 0x09, 0x07, 0x01, 0x0B,
1662 0x10, 0x54, 0x30, 0x0C,
1663 0x24, 0x30, 0x0f,
1664};
1665
1666static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
1667 [0] = {
1668 .mode = MSM_SPM_MODE_CLOCK_GATING,
1669 .notify_rpm = false,
1670 .cmd = spm_wfi_cmd_sequence,
1671 },
1672 [1] = {
1673 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1674 .notify_rpm = false,
1675 .cmd = spm_power_collapse_without_rpm,
1676 },
1677 [2] = {
1678 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1679 .notify_rpm = true,
1680 .cmd = spm_power_collapse_with_rpm,
1681 },
1682};
1683
1684static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = {
1685 0x00, 0x20, 0x03, 0x20,
1686 0x00, 0x0f,
1687};
1688
1689static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = {
1690 0x00, 0x20, 0x34, 0x64,
1691 0x48, 0x07, 0x48, 0x20,
1692 0x50, 0x64, 0x04, 0x34,
1693 0x50, 0x0f,
1694};
1695static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = {
1696 0x00, 0x10, 0x34, 0x64,
1697 0x48, 0x07, 0x48, 0x10,
1698 0x50, 0x64, 0x04, 0x34,
1699 0x50, 0x0F,
1700};
1701
1702static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = {
1703 [0] = {
1704 .mode = MSM_SPM_L2_MODE_RETENTION,
1705 .notify_rpm = false,
1706 .cmd = l2_spm_wfi_cmd_sequence,
1707 },
1708 [1] = {
1709 .mode = MSM_SPM_L2_MODE_GDHS,
1710 .notify_rpm = true,
1711 .cmd = l2_spm_gdhs_cmd_sequence,
1712 },
1713 [2] = {
1714 .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE,
1715 .notify_rpm = true,
1716 .cmd = l2_spm_power_off_cmd_sequence,
1717 },
1718};
1719
1720
1721static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = {
1722 [0] = {
1723 .reg_base_addr = MSM_SAW_L2_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001724 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001725 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001726 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE,
1727 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020,
1728 .modes = msm_spm_l2_seq_list,
1729 .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list),
1730 },
1731};
1732
1733static struct msm_spm_platform_data msm_spm_data[] __initdata = {
1734 [0] = {
1735 .reg_base_addr = MSM_SAW0_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001736 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001737#if defined(CONFIG_MSM_AVS_HW)
1738 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1739 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1740#endif
1741 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001742 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001743 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1744 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1745 .vctl_timeout_us = 50,
1746 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1747 .modes = msm_spm_seq_list,
1748 },
1749 [1] = {
1750 .reg_base_addr = MSM_SAW1_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001751 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001752#if defined(CONFIG_MSM_AVS_HW)
1753 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1754 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1755#endif
1756 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001757 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001758 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1759 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1760 .vctl_timeout_us = 50,
1761 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1762 .modes = msm_spm_seq_list,
1763 },
1764 [2] = {
1765 .reg_base_addr = MSM_SAW2_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001766 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001767#if defined(CONFIG_MSM_AVS_HW)
1768 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1769 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1770#endif
1771 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001772 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001773 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1774 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1775 .vctl_timeout_us = 50,
1776 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1777 .modes = msm_spm_seq_list,
1778 },
1779 [3] = {
1780 .reg_base_addr = MSM_SAW3_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001781 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001782#if defined(CONFIG_MSM_AVS_HW)
1783 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1784 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1785#endif
1786 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001787 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001788 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1789 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1790 .vctl_timeout_us = 50,
1791 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1792 .modes = msm_spm_seq_list,
Jay Chokshi7805b5a2011-11-07 15:55:30 -08001793 },
1794};
1795
Praveen Chidambaram4d19be42012-04-03 18:05:52 -06001796static struct msm_pm_sleep_status_data msm_pm_slp_sts_data = {
1797 .base_addr = MSM_ACC0_BASE + 0x08,
1798 .cpu_offset = MSM_ACC1_BASE - MSM_ACC0_BASE,
1799 .mask = 1UL << 13,
1800};
1801
Gagan Mac8a7a5d32011-11-11 16:43:06 -07001802static void __init apq8064_init_buses(void)
1803{
1804 msm_bus_rpm_set_mt_mask();
1805 msm_bus_8064_apps_fabric_pdata.rpm_enabled = 1;
1806 msm_bus_8064_sys_fabric_pdata.rpm_enabled = 1;
1807 msm_bus_8064_mm_fabric_pdata.rpm_enabled = 1;
1808 msm_bus_8064_apps_fabric.dev.platform_data =
1809 &msm_bus_8064_apps_fabric_pdata;
1810 msm_bus_8064_sys_fabric.dev.platform_data =
1811 &msm_bus_8064_sys_fabric_pdata;
1812 msm_bus_8064_mm_fabric.dev.platform_data =
1813 &msm_bus_8064_mm_fabric_pdata;
1814 msm_bus_8064_sys_fpb.dev.platform_data = &msm_bus_8064_sys_fpb_pdata;
1815 msm_bus_8064_cpss_fpb.dev.platform_data = &msm_bus_8064_cpss_fpb_pdata;
1816}
1817
David Collinsf0d00732012-01-25 15:46:50 -08001818static struct platform_device apq8064_device_ext_5v_vreg __devinitdata = {
1819 .name = GPIO_REGULATOR_DEV_NAME,
1820 .id = PM8921_MPP_PM_TO_SYS(7),
1821 .dev = {
1822 .platform_data
1823 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V],
1824 },
1825};
1826
Jay Chokshi1de4f9d2012-02-07 16:11:31 -08001827static struct platform_device apq8064_device_ext_mpp8_vreg __devinitdata = {
1828 .name = GPIO_REGULATOR_DEV_NAME,
1829 .id = PM8921_MPP_PM_TO_SYS(8),
1830 .dev = {
1831 .platform_data
1832 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_MPP8],
1833 },
1834};
1835
David Collinsf0d00732012-01-25 15:46:50 -08001836static struct platform_device apq8064_device_ext_3p3v_vreg __devinitdata = {
1837 .name = GPIO_REGULATOR_DEV_NAME,
1838 .id = APQ8064_EXT_3P3V_REG_EN_GPIO,
1839 .dev = {
1840 .platform_data =
1841 &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V],
1842 },
1843};
1844
David Collins390fc332012-02-07 14:38:16 -08001845static struct platform_device apq8064_device_ext_ts_sw_vreg __devinitdata = {
1846 .name = GPIO_REGULATOR_DEV_NAME,
1847 .id = PM8921_GPIO_PM_TO_SYS(23),
1848 .dev = {
1849 .platform_data
1850 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_TS_SW],
1851 },
1852};
1853
David Collins2782b5c2012-02-06 10:02:42 -08001854static struct platform_device apq8064_device_rpm_regulator __devinitdata = {
1855 .name = "rpm-regulator",
1856 .id = -1,
1857 .dev = {
1858 .platform_data = &apq8064_rpm_regulator_pdata,
1859 },
1860};
1861
Ravi Kumar V05931a22012-04-04 17:09:37 +05301862static struct gpio_ir_recv_platform_data gpio_ir_recv_pdata = {
1863 .gpio_nr = 88,
1864 .active_low = 1,
1865};
1866
1867static struct platform_device gpio_ir_recv_pdev = {
1868 .name = "gpio-rc-recv",
1869 .dev = {
1870 .platform_data = &gpio_ir_recv_pdata,
1871 },
1872};
1873
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001874static struct platform_device *common_devices[] __initdata = {
Jin Hong01f2dbb2011-11-03 22:13:51 -07001875 &apq8064_device_dmov,
Terence Hampson2e1705f2012-04-11 19:55:29 -04001876#ifndef CONFIG_MSM_VCAP
David Keitel3c40fc52012-02-09 17:53:52 -08001877 &apq8064_device_qup_i2c_gsbi1,
Jing Lin04601f92012-02-05 15:36:07 -08001878 &apq8064_device_qup_i2c_gsbi3,
Kenneth Heitke748593a2011-07-15 15:45:11 -06001879 &apq8064_device_qup_i2c_gsbi4,
Terence Hampson2e1705f2012-04-11 19:55:29 -04001880#endif
Harini Jayaramanc4c58692011-07-19 14:50:10 -06001881 &apq8064_device_qup_spi_gsbi5,
David Collinsf0d00732012-01-25 15:46:50 -08001882 &apq8064_device_ext_5v_vreg,
Jay Chokshi1de4f9d2012-02-07 16:11:31 -08001883 &apq8064_device_ext_mpp8_vreg,
David Collinsf0d00732012-01-25 15:46:50 -08001884 &apq8064_device_ext_3p3v_vreg,
David Collins390fc332012-02-07 14:38:16 -08001885 &apq8064_device_ext_ts_sw_vreg,
Jay Chokshi9c25f072011-09-23 18:19:15 -07001886 &apq8064_device_ssbi_pmic1,
1887 &apq8064_device_ssbi_pmic2,
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001888 &msm_device_smd_apq8064,
Hemant Kumar4933b072011-10-17 23:43:11 -07001889 &apq8064_device_otg,
1890 &apq8064_device_gadget_peripheral,
Hemant Kumard86c4882012-01-24 19:39:37 -08001891 &apq8064_device_hsusb_host,
Hemant Kumar4933b072011-10-17 23:43:11 -07001892 &android_usb_device,
Ankit Verma6b7e2ba2012-01-26 15:48:54 -08001893 &msm_device_wcnss_wlan,
Ankit Vermab7c26e62012-02-28 15:04:15 -08001894 &msm_device_iris_fm,
Olav Haugan7c6aa742012-01-16 16:47:37 -08001895#ifdef CONFIG_ANDROID_PMEM
1896#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Laura Abbottb93525f2012-04-12 09:57:19 -07001897 &apq8064_android_pmem_device,
1898 &apq8064_android_pmem_adsp_device,
1899 &apq8064_android_pmem_audio_device,
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -07001900#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
1901#endif /*CONFIG_ANDROID_PMEM*/
Olav Haugan7c6aa742012-01-16 16:47:37 -08001902#ifdef CONFIG_ION_MSM
Laura Abbottb93525f2012-04-12 09:57:19 -07001903 &apq8064_ion_dev,
Olav Haugan7c6aa742012-01-16 16:47:37 -08001904#endif
Jeff Ohlstein7e668552011-10-06 16:17:25 -07001905 &msm8064_device_watchdog,
Jay Chokshi7805b5a2011-11-07 15:55:30 -08001906 &msm8064_device_saw_regulator_core0,
1907 &msm8064_device_saw_regulator_core1,
1908 &msm8064_device_saw_regulator_core2,
1909 &msm8064_device_saw_regulator_core3,
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07001910#if defined(CONFIG_QSEECOM)
1911 &qseecom_device,
1912#endif
1913
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001914#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1915 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1916 &qcrypto_device,
1917#endif
1918
1919#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1920 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1921 &qcedev_device,
1922#endif
Ramesh Masavarapuf46be1b2011-11-03 11:13:41 -07001923
1924#ifdef CONFIG_HW_RANDOM_MSM
1925 &apq8064_device_rng,
1926#endif
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -08001927 &apq_pcm,
1928 &apq_pcm_routing,
1929 &apq_cpudai0,
1930 &apq_cpudai1,
Santosh Mardieff9a742012-04-09 23:23:39 +05301931 &mpq_cpudai_sec_i2s_rx,
Kuirong Wangf23f8c52012-03-31 12:34:51 -07001932 &mpq_cpudai_mi2s_tx,
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -08001933 &apq_cpudai_hdmi_rx,
1934 &apq_cpudai_bt_rx,
1935 &apq_cpudai_bt_tx,
1936 &apq_cpudai_fm_rx,
1937 &apq_cpudai_fm_tx,
1938 &apq_cpu_fe,
1939 &apq_stub_codec,
1940 &apq_voice,
1941 &apq_voip,
1942 &apq_lpa_pcm,
Krishnankutty Kolathappilly4374e332012-03-18 22:27:30 -07001943 &apq_compr_dsp,
1944 &apq_multi_ch_pcm,
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -08001945 &apq_pcm_hostless,
1946 &apq_cpudai_afe_01_rx,
1947 &apq_cpudai_afe_01_tx,
1948 &apq_cpudai_afe_02_rx,
1949 &apq_cpudai_afe_02_tx,
1950 &apq_pcm_afe,
1951 &apq_cpudai_auxpcm_rx,
1952 &apq_cpudai_auxpcm_tx,
Neema Shetty8427c262012-02-16 11:23:43 -08001953 &apq_cpudai_stub,
Neema Shetty3c9d2862012-03-11 01:25:32 -08001954 &apq_cpudai_slimbus_1_rx,
1955 &apq_cpudai_slimbus_1_tx,
Kiran Kandi1e6371d2012-03-29 11:48:57 -07001956 &apq_cpudai_slimbus_2_tx,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001957 &apq8064_rpm_device,
1958 &apq8064_rpm_log_device,
1959 &apq8064_rpm_stat_device,
Gagan Mac8a7a5d32011-11-11 16:43:06 -07001960 &msm_bus_8064_apps_fabric,
1961 &msm_bus_8064_sys_fabric,
1962 &msm_bus_8064_mm_fabric,
1963 &msm_bus_8064_sys_fpb,
1964 &msm_bus_8064_cpss_fpb,
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08001965 &apq8064_msm_device_vidc,
Stephen Boyd25c4a0b2011-09-20 00:12:36 -07001966 &msm_pil_dsps,
Matt Wagantalled832652012-02-02 19:23:17 -08001967 &msm_8960_riva,
Matt Wagantallb94b9a52012-02-02 21:59:54 -08001968 &msm_8960_q6_lpass,
Stephen Boyd7b973de2012-03-09 12:26:16 -08001969 &msm_pil_vidc,
Matt Wagantall292aace2012-01-26 19:12:34 -08001970 &msm_gss,
Laura Abbott350c8362012-02-28 14:46:52 -08001971#ifdef CONFIG_MSM_RTB
Laura Abbottb93525f2012-04-12 09:57:19 -07001972 &apq8064_rtb_device,
Laura Abbott350c8362012-02-28 14:46:52 -08001973#endif
Praveen Chidambaram8ea3dcd2011-12-07 14:46:31 -07001974 &apq8064_cpu_idle_device,
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07001975 &apq8064_msm_gov_device,
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08001976 &apq8064_device_cache_erp,
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08001977 &epm_adc_device,
Pratik Patel212ab362012-03-16 12:30:07 -07001978 &apq8064_qdss_device,
1979 &msm_etb_device,
1980 &msm_tpiu_device,
1981 &msm_funnel_device,
1982 &apq8064_etm_device,
Helen Zeng8f925502012-03-05 16:50:17 -08001983 &apq_cpudai_slim_4_rx,
1984 &apq_cpudai_slim_4_tx,
Jignesh Mehta921649d2012-04-19 06:57:23 -07001985 &msm8960_gemini_device,
Laura Abbott0577d7b2012-04-17 11:14:30 -07001986 &apq8064_iommu_domain_device,
Siddartha Mohanadoss48cad912012-04-05 21:29:54 -07001987 &msm_tsens_device,
Harini Jayaramanc4c58692011-07-19 14:50:10 -06001988};
1989
Joel King4e7ad222011-08-17 15:47:38 -07001990static struct platform_device *sim_devices[] __initdata = {
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07001991 &apq8064_device_uart_gsbi3,
Yan He06913ce2011-08-26 16:33:46 -07001992 &msm_device_sps_apq8064,
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07001993};
1994
1995static struct platform_device *rumi3_devices[] __initdata = {
1996 &apq8064_device_uart_gsbi1,
Yan He435ed612011-11-23 17:34:59 -08001997 &msm_device_sps_apq8064,
Huaibin Yang4a084e32011-12-15 15:25:52 -08001998#ifdef CONFIG_MSM_ROTATOR
1999 &msm_rotator_device,
2000#endif
Joel King4e7ad222011-08-17 15:47:38 -07002001};
2002
Joel King82b7e3f2012-01-05 10:03:27 -08002003static struct platform_device *cdp_devices[] __initdata = {
2004 &apq8064_device_uart_gsbi1,
Jin Hong4bbbfba2012-02-02 21:48:07 -08002005 &apq8064_device_uart_gsbi7,
Joel King82b7e3f2012-01-05 10:03:27 -08002006 &msm_device_sps_apq8064,
Aravind Venkateswaran4ca27532012-02-16 14:27:05 -08002007#ifdef CONFIG_MSM_ROTATOR
2008 &msm_rotator_device,
2009#endif
Joel King82b7e3f2012-01-05 10:03:27 -08002010};
2011
Jay Chokshi1b7eaa92012-04-04 14:53:14 -07002012static struct platform_device
2013mpq8064_device_ext_5v_frc_vreg __devinitdata = {
2014 .name = GPIO_REGULATOR_DEV_NAME,
2015 .id = SX150X_GPIO(4, 10),
2016 .dev = {
2017 .platform_data =
2018 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_FRC_5V],
2019 },
2020};
2021
2022static struct platform_device
2023mpq8064_device_ext_1p2_buck_vreg __devinitdata = {
2024 .name = GPIO_REGULATOR_DEV_NAME,
2025 .id = SX150X_GPIO(4, 2),
2026 .dev = {
2027 .platform_data =
2028 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_1P2V],
2029 },
2030};
2031
2032static struct platform_device
2033mpq8064_device_ext_1p8_buck_vreg __devinitdata = {
2034 .name = GPIO_REGULATOR_DEV_NAME,
2035 .id = SX150X_GPIO(4, 4),
2036 .dev = {
2037 .platform_data =
2038 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_1P8V],
2039 },
2040};
2041
2042static struct platform_device
2043mpq8064_device_ext_2p2_buck_vreg __devinitdata = {
2044 .name = GPIO_REGULATOR_DEV_NAME,
2045 .id = SX150X_GPIO(4, 14),
2046 .dev = {
2047 .platform_data =
2048 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_2P2V],
2049 },
2050};
2051
2052static struct platform_device
2053mpq8064_device_ext_5v_buck_vreg __devinitdata = {
2054 .name = GPIO_REGULATOR_DEV_NAME,
2055 .id = SX150X_GPIO(4, 3),
2056 .dev = {
2057 .platform_data =
2058 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_5V],
2059 },
2060};
2061
2062static struct platform_device
2063mpq8064_device_ext_3p3v_ldo_vreg __devinitdata = {
2064 .name = GPIO_REGULATOR_DEV_NAME,
2065 .id = SX150X_GPIO(4, 15),
2066 .dev = {
2067 .platform_data =
2068 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_3P3V],
2069 },
2070};
2071
2072static struct platform_device *mpq_devices[] __initdata = {
2073 &msm_device_sps_apq8064,
2074 &mpq8064_device_qup_i2c_gsbi5,
2075#ifdef CONFIG_MSM_ROTATOR
2076 &msm_rotator_device,
2077#endif
Ravi Kumar V05931a22012-04-04 17:09:37 +05302078 &gpio_ir_recv_pdev,
Jay Chokshi1b7eaa92012-04-04 14:53:14 -07002079 &mpq8064_device_ext_5v_frc_vreg,
2080 &mpq8064_device_ext_1p2_buck_vreg,
2081 &mpq8064_device_ext_1p8_buck_vreg,
2082 &mpq8064_device_ext_2p2_buck_vreg,
2083 &mpq8064_device_ext_5v_buck_vreg,
2084 &mpq8064_device_ext_3p3v_ldo_vreg,
Terence Hampson2e1705f2012-04-11 19:55:29 -04002085#ifdef CONFIG_MSM_VCAP
2086 &msm8064_device_vcap,
2087#endif
Jay Chokshi1b7eaa92012-04-04 14:53:14 -07002088};
2089
Harini Jayaramanc4c58692011-07-19 14:50:10 -06002090static struct msm_spi_platform_data apq8064_qup_spi_gsbi5_pdata = {
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -08002091 .max_clock_speed = 1100000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002092};
2093
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002094#define KS8851_IRQ_GPIO 43
2095
2096static struct spi_board_info spi_board_info[] __initdata = {
2097 {
2098 .modalias = "ks8851",
2099 .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
2100 .max_speed_hz = 19200000,
2101 .bus_num = 0,
2102 .chip_select = 2,
2103 .mode = SPI_MODE_0,
2104 },
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08002105 {
2106 .modalias = "epm_adc",
2107 .max_speed_hz = 1100000,
2108 .bus_num = 0,
2109 .chip_select = 3,
2110 .mode = SPI_MODE_0,
2111 },
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002112};
2113
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06002114static struct slim_boardinfo apq8064_slim_devices[] = {
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08002115 {
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08002116 .bus_num = 1,
2117 .slim_slave = &apq8064_slim_tabla,
2118 },
2119 {
2120 .bus_num = 1,
2121 .slim_slave = &apq8064_slim_tabla20,
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08002122 },
2123 /* add more slimbus slaves as needed */
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06002124};
2125
David Keitel3c40fc52012-02-09 17:53:52 -08002126static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi1_pdata = {
2127 .clk_freq = 100000,
2128 .src_clk_rate = 24000000,
2129};
2130
Jing Lin04601f92012-02-05 15:36:07 -08002131static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi3_pdata = {
Anirudh Ghayalc2163472012-04-10 14:58:14 +05302132 .clk_freq = 384000,
Jing Lin04601f92012-02-05 15:36:07 -08002133 .src_clk_rate = 24000000,
2134};
2135
Kenneth Heitke748593a2011-07-15 15:45:11 -06002136static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi4_pdata = {
2137 .clk_freq = 100000,
2138 .src_clk_rate = 24000000,
Kenneth Heitke748593a2011-07-15 15:45:11 -06002139};
2140
Joel King8f839b92012-04-01 14:37:46 -07002141static struct msm_i2c_platform_data mpq8064_i2c_qup_gsbi5_pdata = {
2142 .clk_freq = 100000,
2143 .src_clk_rate = 24000000,
2144};
2145
David Keitel3c40fc52012-02-09 17:53:52 -08002146#define GSBI_DUAL_MODE_CODE 0x60
2147#define MSM_GSBI1_PHYS 0x12440000
Kenneth Heitke748593a2011-07-15 15:45:11 -06002148static void __init apq8064_i2c_init(void)
2149{
David Keitel3c40fc52012-02-09 17:53:52 -08002150 void __iomem *gsbi_mem;
2151
2152 apq8064_device_qup_i2c_gsbi1.dev.platform_data =
2153 &apq8064_i2c_qup_gsbi1_pdata;
2154 gsbi_mem = ioremap_nocache(MSM_GSBI1_PHYS, 4);
2155 writel_relaxed(GSBI_DUAL_MODE_CODE, gsbi_mem);
2156 /* Ensure protocol code is written before proceeding */
2157 wmb();
2158 iounmap(gsbi_mem);
2159 apq8064_i2c_qup_gsbi1_pdata.use_gsbi_shared_mode = 1;
Jing Lin04601f92012-02-05 15:36:07 -08002160 apq8064_device_qup_i2c_gsbi3.dev.platform_data =
2161 &apq8064_i2c_qup_gsbi3_pdata;
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08002162 apq8064_device_qup_i2c_gsbi1.dev.platform_data =
2163 &apq8064_i2c_qup_gsbi1_pdata;
Kenneth Heitke748593a2011-07-15 15:45:11 -06002164 apq8064_device_qup_i2c_gsbi4.dev.platform_data =
2165 &apq8064_i2c_qup_gsbi4_pdata;
Joel King8f839b92012-04-01 14:37:46 -07002166 mpq8064_device_qup_i2c_gsbi5.dev.platform_data =
2167 &mpq8064_i2c_qup_gsbi5_pdata;
Kenneth Heitke748593a2011-07-15 15:45:11 -06002168}
2169
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -08002170#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002171static int ethernet_init(void)
2172{
2173 int ret;
2174 ret = gpio_request(KS8851_IRQ_GPIO, "ks8851_irq");
2175 if (ret) {
2176 pr_err("ks8851 gpio_request failed: %d\n", ret);
2177 goto fail;
2178 }
2179
2180 return 0;
2181fail:
2182 return ret;
2183}
2184#else
2185static int ethernet_init(void)
2186{
2187 return 0;
2188}
2189#endif
2190
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302191#define GPIO_KEY_HOME PM8921_GPIO_PM_TO_SYS(27)
2192#define GPIO_KEY_VOLUME_UP PM8921_GPIO_PM_TO_SYS(35)
2193#define GPIO_KEY_VOLUME_DOWN PM8921_GPIO_PM_TO_SYS(38)
2194#define GPIO_KEY_CAM_FOCUS PM8921_GPIO_PM_TO_SYS(3)
2195#define GPIO_KEY_CAM_SNAP PM8921_GPIO_PM_TO_SYS(4)
Jing Lin3f8f8422012-03-05 09:32:11 -08002196#define GPIO_KEY_ROTATION PM8921_GPIO_PM_TO_SYS(42)
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302197
2198static struct gpio_keys_button cdp_keys[] = {
2199 {
2200 .code = KEY_HOME,
2201 .gpio = GPIO_KEY_HOME,
2202 .desc = "home_key",
2203 .active_low = 1,
2204 .type = EV_KEY,
2205 .wakeup = 1,
2206 .debounce_interval = 15,
2207 },
2208 {
2209 .code = KEY_VOLUMEUP,
2210 .gpio = GPIO_KEY_VOLUME_UP,
2211 .desc = "volume_up_key",
2212 .active_low = 1,
2213 .type = EV_KEY,
2214 .wakeup = 1,
2215 .debounce_interval = 15,
2216 },
2217 {
2218 .code = KEY_VOLUMEDOWN,
2219 .gpio = GPIO_KEY_VOLUME_DOWN,
2220 .desc = "volume_down_key",
2221 .active_low = 1,
2222 .type = EV_KEY,
2223 .wakeup = 1,
2224 .debounce_interval = 15,
2225 },
2226 {
2227 .code = SW_ROTATE_LOCK,
2228 .gpio = GPIO_KEY_ROTATION,
2229 .desc = "rotate_key",
2230 .active_low = 1,
2231 .type = EV_SW,
2232 .debounce_interval = 15,
2233 },
2234};
2235
2236static struct gpio_keys_platform_data cdp_keys_data = {
2237 .buttons = cdp_keys,
2238 .nbuttons = ARRAY_SIZE(cdp_keys),
2239};
2240
2241static struct platform_device cdp_kp_pdev = {
2242 .name = "gpio-keys",
2243 .id = -1,
2244 .dev = {
2245 .platform_data = &cdp_keys_data,
2246 },
2247};
2248
2249static struct gpio_keys_button mtp_keys[] = {
2250 {
2251 .code = KEY_CAMERA_FOCUS,
2252 .gpio = GPIO_KEY_CAM_FOCUS,
2253 .desc = "cam_focus_key",
2254 .active_low = 1,
2255 .type = EV_KEY,
2256 .wakeup = 1,
2257 .debounce_interval = 15,
2258 },
2259 {
2260 .code = KEY_VOLUMEUP,
2261 .gpio = GPIO_KEY_VOLUME_UP,
2262 .desc = "volume_up_key",
2263 .active_low = 1,
2264 .type = EV_KEY,
2265 .wakeup = 1,
2266 .debounce_interval = 15,
2267 },
2268 {
2269 .code = KEY_VOLUMEDOWN,
2270 .gpio = GPIO_KEY_VOLUME_DOWN,
2271 .desc = "volume_down_key",
2272 .active_low = 1,
2273 .type = EV_KEY,
2274 .wakeup = 1,
2275 .debounce_interval = 15,
2276 },
2277 {
2278 .code = KEY_CAMERA_SNAPSHOT,
2279 .gpio = GPIO_KEY_CAM_SNAP,
2280 .desc = "cam_snap_key",
2281 .active_low = 1,
2282 .type = EV_KEY,
2283 .debounce_interval = 15,
2284 },
2285};
2286
2287static struct gpio_keys_platform_data mtp_keys_data = {
2288 .buttons = mtp_keys,
2289 .nbuttons = ARRAY_SIZE(mtp_keys),
2290};
2291
2292static struct platform_device mtp_kp_pdev = {
2293 .name = "gpio-keys",
2294 .id = -1,
2295 .dev = {
2296 .platform_data = &mtp_keys_data,
2297 },
2298};
2299
Anirudh Ghayal32ea6252012-04-26 16:39:50 +05302300static struct gpio_keys_button mpq_keys[] = {
2301 {
2302 .code = KEY_VOLUMEDOWN,
2303 .gpio = GPIO_KEY_VOLUME_DOWN,
2304 .desc = "volume_down_key",
2305 .active_low = 1,
2306 .type = EV_KEY,
2307 .wakeup = 1,
2308 .debounce_interval = 15,
2309 },
2310 {
2311 .code = KEY_VOLUMEUP,
2312 .gpio = GPIO_KEY_VOLUME_UP,
2313 .desc = "volume_up_key",
2314 .active_low = 1,
2315 .type = EV_KEY,
2316 .wakeup = 1,
2317 .debounce_interval = 15,
2318 },
2319};
2320
2321static struct gpio_keys_platform_data mpq_keys_data = {
2322 .buttons = mpq_keys,
2323 .nbuttons = ARRAY_SIZE(mpq_keys),
2324};
2325
2326static struct platform_device mpq_gpio_keys_pdev = {
2327 .name = "gpio-keys",
2328 .id = -1,
2329 .dev = {
2330 .platform_data = &mpq_keys_data,
2331 },
2332};
2333
2334#define MPQ_KP_ROW_BASE SX150X_EXP2_GPIO_BASE
2335#define MPQ_KP_COL_BASE (SX150X_EXP2_GPIO_BASE + 4)
2336
2337static unsigned int mpq_row_gpios[] = {MPQ_KP_ROW_BASE, MPQ_KP_ROW_BASE + 1,
2338 MPQ_KP_ROW_BASE + 2, MPQ_KP_ROW_BASE + 3};
2339static unsigned int mpq_col_gpios[] = {MPQ_KP_COL_BASE, MPQ_KP_COL_BASE + 1,
2340 MPQ_KP_COL_BASE + 2};
2341
2342static const unsigned int mpq_keymap[] = {
2343 KEY(0, 0, KEY_UP),
2344 KEY(0, 1, KEY_ENTER),
2345 KEY(0, 2, KEY_3),
2346
2347 KEY(1, 0, KEY_DOWN),
2348 KEY(1, 1, KEY_EXIT),
2349 KEY(1, 2, KEY_4),
2350
2351 KEY(2, 0, KEY_LEFT),
2352 KEY(2, 1, KEY_1),
2353 KEY(2, 2, KEY_5),
2354
2355 KEY(3, 0, KEY_RIGHT),
2356 KEY(3, 1, KEY_2),
2357 KEY(3, 2, KEY_6),
2358};
2359
2360static struct matrix_keymap_data mpq_keymap_data = {
2361 .keymap_size = ARRAY_SIZE(mpq_keymap),
2362 .keymap = mpq_keymap,
2363};
2364
2365static struct matrix_keypad_platform_data mpq_keypad_data = {
2366 .keymap_data = &mpq_keymap_data,
2367 .row_gpios = mpq_row_gpios,
2368 .col_gpios = mpq_col_gpios,
2369 .num_row_gpios = ARRAY_SIZE(mpq_row_gpios),
2370 .num_col_gpios = ARRAY_SIZE(mpq_col_gpios),
2371 .col_scan_delay_us = 32000,
2372 .debounce_ms = 20,
2373 .wakeup = 1,
2374 .active_low = 1,
2375 .no_autorepeat = 1,
2376};
2377
2378static struct platform_device mpq_keypad_device = {
2379 .name = "matrix-keypad",
2380 .id = -1,
2381 .dev = {
2382 .platform_data = &mpq_keypad_data,
2383 },
2384};
2385
Jin Hongd3024e62012-02-09 16:13:32 -08002386/* Sensors DSPS platform data */
2387#define DSPS_PIL_GENERIC_NAME "dsps"
2388static void __init apq8064_init_dsps(void)
2389{
2390 struct msm_dsps_platform_data *pdata =
2391 msm_dsps_device_8064.dev.platform_data;
2392 pdata->pil_name = DSPS_PIL_GENERIC_NAME;
2393 pdata->gpios = NULL;
2394 pdata->gpios_num = 0;
2395
2396 platform_device_register(&msm_dsps_device_8064);
2397}
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302398
Jing Lin417fa452012-02-05 14:31:06 -08002399#define I2C_SURF 1
2400#define I2C_FFA (1 << 1)
2401#define I2C_RUMI (1 << 2)
2402#define I2C_SIM (1 << 3)
2403#define I2C_LIQUID (1 << 4)
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002404#define I2C_MPQ_CDP BIT(5)
2405#define I2C_MPQ_HRD BIT(6)
2406#define I2C_MPQ_DTV BIT(7)
Jing Lin417fa452012-02-05 14:31:06 -08002407
2408struct i2c_registry {
2409 u8 machs;
2410 int bus;
2411 struct i2c_board_info *info;
2412 int len;
2413};
2414
2415static struct i2c_registry apq8064_i2c_devices[] __initdata = {
Jing Lin21ed4de2012-02-05 15:53:28 -08002416 {
David Keitel2f613d92012-02-15 11:29:16 -08002417 I2C_LIQUID,
2418 APQ_8064_GSBI1_QUP_I2C_BUS_ID,
2419 smb349_charger_i2c_info,
2420 ARRAY_SIZE(smb349_charger_i2c_info)
2421 },
Terence Hampson2e1705f2012-04-11 19:55:29 -04002422#ifndef CONFIG_MSM_VCAP
David Keitel2f613d92012-02-15 11:29:16 -08002423 {
Jing Lin21ed4de2012-02-05 15:53:28 -08002424 I2C_SURF | I2C_LIQUID,
2425 APQ_8064_GSBI3_QUP_I2C_BUS_ID,
2426 mxt_device_info,
2427 ARRAY_SIZE(mxt_device_info),
2428 },
Terence Hampson2e1705f2012-04-11 19:55:29 -04002429#endif
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08002430 {
2431 I2C_FFA,
2432 APQ_8064_GSBI3_QUP_I2C_BUS_ID,
2433 cyttsp_info,
2434 ARRAY_SIZE(cyttsp_info),
2435 },
Amy Maloche70090f992012-02-16 16:35:26 -08002436 {
2437 I2C_FFA | I2C_LIQUID,
2438 APQ_8064_GSBI1_QUP_I2C_BUS_ID,
2439 isa1200_board_info,
2440 ARRAY_SIZE(isa1200_board_info),
2441 },
Santosh Mardieff9a742012-04-09 23:23:39 +05302442 {
2443 I2C_MPQ_CDP,
2444 APQ_8064_GSBI5_QUP_I2C_BUS_ID,
2445 cs8427_device_info,
2446 ARRAY_SIZE(cs8427_device_info),
2447 },
Jing Lin417fa452012-02-05 14:31:06 -08002448};
2449
Jay Chokshi607f61b2012-04-25 18:21:21 -07002450#define SX150X_EXP1_INT_N PM8921_MPP_IRQ(PM8921_IRQ_BASE, 9)
Anirudh Ghayal9f1aaa72012-04-26 18:15:08 +05302451#define SX150X_EXP2_INT_N MSM_GPIO_TO_INT(81)
Jay Chokshi607f61b2012-04-25 18:21:21 -07002452
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002453struct sx150x_platform_data mpq8064_sx150x_pdata[] = {
2454 [SX150X_EXP1] = {
2455 .gpio_base = SX150X_EXP1_GPIO_BASE,
2456 .oscio_is_gpo = false,
2457 .io_pullup_ena = 0x0,
2458 .io_pulldn_ena = 0x0,
2459 .io_open_drain_ena = 0x0,
2460 .io_polarity = 0,
Jay Chokshi607f61b2012-04-25 18:21:21 -07002461 .irq_summary = SX150X_EXP1_INT_N,
2462 .irq_base = SX150X_EXP1_IRQ_BASE,
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002463 },
2464 [SX150X_EXP2] = {
2465 .gpio_base = SX150X_EXP2_GPIO_BASE,
2466 .oscio_is_gpo = false,
Anirudh Ghayal32ea6252012-04-26 16:39:50 +05302467 .io_pullup_ena = 0x0f,
2468 .io_pulldn_ena = 0x70,
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002469 .io_open_drain_ena = 0x0,
2470 .io_polarity = 0,
Anirudh Ghayal9f1aaa72012-04-26 18:15:08 +05302471 .irq_summary = SX150X_EXP2_INT_N,
2472 .irq_base = SX150X_EXP2_IRQ_BASE,
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002473 },
2474 [SX150X_EXP3] = {
2475 .gpio_base = SX150X_EXP3_GPIO_BASE,
2476 .oscio_is_gpo = false,
2477 .io_pullup_ena = 0x0,
2478 .io_pulldn_ena = 0x0,
2479 .io_open_drain_ena = 0x0,
2480 .io_polarity = 0,
2481 .irq_summary = -1,
2482 },
2483 [SX150X_EXP4] = {
2484 .gpio_base = SX150X_EXP4_GPIO_BASE,
2485 .oscio_is_gpo = false,
2486 .io_pullup_ena = 0x0,
2487 .io_pulldn_ena = 0x0,
2488 .io_open_drain_ena = 0x0,
2489 .io_polarity = 0,
2490 .irq_summary = -1,
2491 },
2492};
2493
2494static struct i2c_board_info sx150x_gpio_exp_info[] = {
2495 {
2496 I2C_BOARD_INFO("sx1509q", 0x70),
2497 .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP1],
2498 },
2499 {
2500 I2C_BOARD_INFO("sx1508q", 0x23),
2501 .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP2],
2502 },
2503 {
2504 I2C_BOARD_INFO("sx1508q", 0x22),
2505 .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP3],
2506 },
2507 {
2508 I2C_BOARD_INFO("sx1509q", 0x3E),
2509 .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP4],
2510 },
2511};
2512
2513#define MPQ8064_I2C_GSBI5_BUS_ID 5
2514
2515static struct i2c_registry mpq8064_i2c_devices[] __initdata = {
2516 {
2517 I2C_MPQ_CDP,
2518 MPQ8064_I2C_GSBI5_BUS_ID,
2519 sx150x_gpio_exp_info,
2520 ARRAY_SIZE(sx150x_gpio_exp_info),
2521 },
2522};
2523
Jing Lin417fa452012-02-05 14:31:06 -08002524static void __init register_i2c_devices(void)
2525{
2526 u8 mach_mask = 0;
2527 int i;
2528
Kevin Chand07220e2012-02-13 15:52:22 -08002529#ifdef CONFIG_MSM_CAMERA
2530 struct i2c_registry apq8064_camera_i2c_devices = {
2531 I2C_SURF | I2C_FFA | I2C_LIQUID | I2C_RUMI,
2532 APQ_8064_GSBI4_QUP_I2C_BUS_ID,
2533 apq8064_camera_board_info.board_info,
2534 apq8064_camera_board_info.num_i2c_board_info,
2535 };
2536#endif
Jing Lin417fa452012-02-05 14:31:06 -08002537 /* Build the matching 'supported_machs' bitmask */
2538 if (machine_is_apq8064_cdp())
2539 mach_mask = I2C_SURF;
2540 else if (machine_is_apq8064_mtp())
2541 mach_mask = I2C_FFA;
2542 else if (machine_is_apq8064_liquid())
2543 mach_mask = I2C_LIQUID;
2544 else if (machine_is_apq8064_rumi3())
2545 mach_mask = I2C_RUMI;
2546 else if (machine_is_apq8064_sim())
2547 mach_mask = I2C_SIM;
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002548 else if (PLATFORM_IS_MPQ8064())
2549 mach_mask = I2C_MPQ_CDP;
Jing Lin417fa452012-02-05 14:31:06 -08002550 else
2551 pr_err("unmatched machine ID in register_i2c_devices\n");
2552
2553 /* Run the array and install devices as appropriate */
2554 for (i = 0; i < ARRAY_SIZE(apq8064_i2c_devices); ++i) {
2555 if (apq8064_i2c_devices[i].machs & mach_mask)
2556 i2c_register_board_info(apq8064_i2c_devices[i].bus,
2557 apq8064_i2c_devices[i].info,
2558 apq8064_i2c_devices[i].len);
2559 }
Kevin Chand07220e2012-02-13 15:52:22 -08002560#ifdef CONFIG_MSM_CAMERA
2561 if (apq8064_camera_i2c_devices.machs & mach_mask)
2562 i2c_register_board_info(apq8064_camera_i2c_devices.bus,
2563 apq8064_camera_i2c_devices.info,
2564 apq8064_camera_i2c_devices.len);
2565#endif
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002566
2567 for (i = 0; i < ARRAY_SIZE(mpq8064_i2c_devices); ++i) {
2568 if (mpq8064_i2c_devices[i].machs & mach_mask)
2569 i2c_register_board_info(
2570 mpq8064_i2c_devices[i].bus,
2571 mpq8064_i2c_devices[i].info,
2572 mpq8064_i2c_devices[i].len);
2573 }
Jing Lin417fa452012-02-05 14:31:06 -08002574}
2575
Jay Chokshi994ff122012-03-27 15:43:48 -07002576static void enable_ddr3_regulator(void)
2577{
2578 static struct regulator *ext_ddr3;
2579
2580 /* Use MPP7 output state as a flag for PCDDR3 presence. */
2581 if (gpio_get_value_cansleep(PM8921_MPP_PM_TO_SYS(7)) > 0) {
2582 ext_ddr3 = regulator_get(NULL, "ext_ddr3");
2583 if (IS_ERR(ext_ddr3) || ext_ddr3 == NULL)
2584 pr_err("Could not get MPP7 regulator\n");
2585 else
2586 regulator_enable(ext_ddr3);
2587 }
2588}
2589
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002590static void enable_avc_i2c_bus(void)
2591{
2592 int avc_i2c_en_mpp = PM8921_MPP_PM_TO_SYS(8);
2593 int rc;
2594
2595 rc = gpio_request(avc_i2c_en_mpp, "avc_i2c_en");
2596 if (rc)
2597 pr_err("request for avc_i2c_en mpp failed,"
2598 "rc=%d\n", rc);
2599 else
2600 gpio_set_value_cansleep(avc_i2c_en_mpp, 1);
2601}
2602
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002603static void __init apq8064_common_init(void)
2604{
Joel King8f839b92012-04-01 14:37:46 -07002605 msm_tsens_early_init(&apq_tsens_pdata);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002606 if (socinfo_init() < 0)
2607 pr_err("socinfo_init() failed!\n");
Praveen Chidambaram78499012011-11-01 17:15:17 -06002608 BUG_ON(msm_rpm_init(&apq8064_rpm_data));
2609 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
David Collins2782b5c2012-02-06 10:02:42 -08002610 regulator_suppress_info_printing();
2611 platform_device_register(&apq8064_device_rpm_regulator);
Stephen Boyd4d0d2582012-02-10 14:49:40 -08002612 if (msm_xo_init())
2613 pr_err("Failed to initialize XO votes\n");
Matt Wagantallc51e5602012-02-27 17:25:25 -08002614 msm_clock_init(&apq8064_clock_init_data);
Stepan Moskovchenko2327a952011-12-14 16:31:28 -08002615 apq8064_init_gpiomux();
Kenneth Heitke748593a2011-07-15 15:45:11 -06002616 apq8064_i2c_init();
Jing Lin417fa452012-02-05 14:31:06 -08002617 register_i2c_devices();
Kenneth Heitke36920d32011-07-20 16:44:30 -06002618
Harini Jayaramanc4c58692011-07-19 14:50:10 -06002619 apq8064_device_qup_spi_gsbi5.dev.platform_data =
2620 &apq8064_qup_spi_gsbi5_pdata;
Stepan Moskovchenkoc1074f02011-12-14 17:51:57 -08002621 apq8064_init_pmic();
Hemant Kumar94e7da22012-02-03 16:52:29 -08002622 if (machine_is_apq8064_liquid())
2623 msm_otg_pdata.mhl_enable = true;
Vamsi Krishnad9863eb2012-03-26 17:34:48 -07002624
2625 msm_otg_pdata.swfi_latency =
2626 msm_rpmrs_levels[0].latency_us + 1;
2627
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002628 apq8064_device_otg.dev.platform_data = &msm_otg_pdata;
Manu Gautam91223e02011-11-08 15:27:22 +05302629 apq8064_ehci_host_init();
Gagan Mac8a7a5d32011-11-11 16:43:06 -07002630 apq8064_init_buses();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002631 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Jay Chokshi994ff122012-03-27 15:43:48 -07002632 enable_ddr3_regulator();
Hemant Kumarf1ca9192012-02-07 18:59:33 -08002633 if (machine_is_apq8064_mtp()) {
2634 apq8064_device_hsic_host.dev.platform_data = &msm_hsic_pdata;
2635 device_initialize(&apq8064_device_hsic_host.dev);
2636 }
Jay Chokshie8741282012-01-25 15:22:55 -08002637 apq8064_pm8xxx_gpio_mpp_init();
Sahitya Tummala3586ed92011-08-03 09:13:23 +05302638 apq8064_init_mmc();
Swaminathan Sathappan144b4882012-02-06 17:01:20 -08002639
2640 if (machine_is_apq8064_mtp()) {
2641 mdm_8064_device.dev.platform_data = &mdm_platform_data;
2642 platform_device_register(&mdm_8064_device);
2643 }
2644 platform_device_register(&apq8064_slim_ctrl);
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06002645 slim_register_board_info(apq8064_slim_devices,
2646 ARRAY_SIZE(apq8064_slim_devices));
Jin Hongd3024e62012-02-09 16:13:32 -08002647 apq8064_init_dsps();
Praveen Chidambaram78499012011-11-01 17:15:17 -06002648 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
Mahesh Sivasubramaniancbce1ec2012-01-24 10:32:44 -07002649 acpuclk_init(&acpuclk_8064_soc_data);
Praveen Chidambaram78499012011-11-01 17:15:17 -06002650 msm_spm_l2_init(msm_spm_l2_data);
Praveen Chidambaram78499012011-11-01 17:15:17 -06002651 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Praveen Chidambaram4d19be42012-04-03 18:05:52 -06002652 msm_pm_init_sleep_status_data(&msm_pm_slp_sts_data);
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08002653 apq8064_epm_adc_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002654}
2655
Huaibin Yang4a084e32011-12-15 15:25:52 -08002656static void __init apq8064_allocate_memory_regions(void)
2657{
2658 apq8064_allocate_fb_region();
2659}
2660
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002661static void __init apq8064_sim_init(void)
2662{
Jeff Ohlstein7e668552011-10-06 16:17:25 -07002663 struct msm_watchdog_pdata *wdog_pdata = (struct msm_watchdog_pdata *)
2664 &msm8064_device_watchdog.dev.platform_data;
2665
2666 wdog_pdata->bark_time = 15000;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002667 apq8064_common_init();
Joel King4e7ad222011-08-17 15:47:38 -07002668 platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices));
2669}
2670
2671static void __init apq8064_rumi3_init(void)
2672{
2673 apq8064_common_init();
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002674 ethernet_init();
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07002675 platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002676 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002677}
2678
Joel King82b7e3f2012-01-05 10:03:27 -08002679static void __init apq8064_cdp_init(void)
2680{
Hanumant Singh50440d42012-04-23 19:27:16 -07002681 if (meminfo_init(SYS_MEMORY, SZ_256M) < 0)
2682 pr_err("meminfo_init() failed!\n");
Joel King82b7e3f2012-01-05 10:03:27 -08002683 apq8064_common_init();
Joel King8f839b92012-04-01 14:37:46 -07002684 if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
2685 machine_is_mpq8064_dtv()) {
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002686 enable_avc_i2c_bus();
Joel King8f839b92012-04-01 14:37:46 -07002687 platform_add_devices(mpq_devices, ARRAY_SIZE(mpq_devices));
2688 } else {
2689 ethernet_init();
2690 platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
2691 spi_register_board_info(spi_board_info,
2692 ARRAY_SIZE(spi_board_info));
2693 }
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002694 apq8064_init_fb();
Jordan Crouseb3115fe2012-02-01 22:11:12 -07002695 apq8064_init_gpu();
Matt Wagantall1875d322012-02-22 16:11:33 -08002696 platform_add_devices(apq8064_fs_devices, apq8064_num_fs_devices);
Kevin Chand07220e2012-02-13 15:52:22 -08002697 apq8064_init_cam();
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302698
2699 if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
2700 platform_device_register(&cdp_kp_pdev);
2701
2702 if (machine_is_apq8064_mtp())
2703 platform_device_register(&mtp_kp_pdev);
Hanumant Singh50440d42012-04-23 19:27:16 -07002704
2705 change_memory_power = &apq8064_change_memory_power;
Anirudh Ghayal32ea6252012-04-26 16:39:50 +05302706
2707 if (machine_is_mpq8064_cdp()) {
2708 platform_device_register(&mpq_gpio_keys_pdev);
2709 platform_device_register(&mpq_keypad_device);
2710 }
Joel King82b7e3f2012-01-05 10:03:27 -08002711}
2712
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002713MACHINE_START(APQ8064_SIM, "QCT APQ8064 SIMULATOR")
2714 .map_io = apq8064_map_io,
Kevin Chan13be4e22011-10-20 11:30:32 -07002715 .reserve = apq8064_reserve,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002716 .init_irq = apq8064_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302717 .handle_irq = gic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002718 .timer = &msm_timer,
2719 .init_machine = apq8064_sim_init,
2720MACHINE_END
2721
Joel King4e7ad222011-08-17 15:47:38 -07002722MACHINE_START(APQ8064_RUMI3, "QCT APQ8064 RUMI3")
2723 .map_io = apq8064_map_io,
Kevin Chan13be4e22011-10-20 11:30:32 -07002724 .reserve = apq8064_reserve,
Joel King4e7ad222011-08-17 15:47:38 -07002725 .init_irq = apq8064_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302726 .handle_irq = gic_handle_irq,
Joel King4e7ad222011-08-17 15:47:38 -07002727 .timer = &msm_timer,
2728 .init_machine = apq8064_rumi3_init,
Huaibin Yang4a084e32011-12-15 15:25:52 -08002729 .init_early = apq8064_allocate_memory_regions,
Joel King4e7ad222011-08-17 15:47:38 -07002730MACHINE_END
2731
Joel King82b7e3f2012-01-05 10:03:27 -08002732MACHINE_START(APQ8064_CDP, "QCT APQ8064 CDP")
2733 .map_io = apq8064_map_io,
2734 .reserve = apq8064_reserve,
2735 .init_irq = apq8064_init_irq,
2736 .handle_irq = gic_handle_irq,
2737 .timer = &msm_timer,
2738 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002739 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07002740 .init_very_early = apq8064_early_reserve,
Joel King82b7e3f2012-01-05 10:03:27 -08002741MACHINE_END
2742
2743MACHINE_START(APQ8064_MTP, "QCT APQ8064 MTP")
2744 .map_io = apq8064_map_io,
2745 .reserve = apq8064_reserve,
2746 .init_irq = apq8064_init_irq,
2747 .handle_irq = gic_handle_irq,
2748 .timer = &msm_timer,
2749 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002750 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07002751 .init_very_early = apq8064_early_reserve,
Joel King82b7e3f2012-01-05 10:03:27 -08002752MACHINE_END
2753
2754MACHINE_START(APQ8064_LIQUID, "QCT APQ8064 LIQUID")
2755 .map_io = apq8064_map_io,
2756 .reserve = apq8064_reserve,
2757 .init_irq = apq8064_init_irq,
2758 .handle_irq = gic_handle_irq,
2759 .timer = &msm_timer,
2760 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002761 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07002762 .init_very_early = apq8064_early_reserve,
Joel King82b7e3f2012-01-05 10:03:27 -08002763MACHINE_END
2764
Joel King064bbf82012-04-01 13:23:39 -07002765MACHINE_START(MPQ8064_CDP, "QCT MPQ8064 CDP")
2766 .map_io = apq8064_map_io,
2767 .reserve = apq8064_reserve,
2768 .init_irq = apq8064_init_irq,
2769 .handle_irq = gic_handle_irq,
2770 .timer = &msm_timer,
2771 .init_machine = apq8064_cdp_init,
2772 .init_early = apq8064_allocate_memory_regions,
2773 .init_very_early = apq8064_early_reserve,
2774MACHINE_END
2775
Joel King11ca8202012-02-13 16:19:03 -08002776MACHINE_START(MPQ8064_HRD, "QCT MPQ8064 HRD")
2777 .map_io = apq8064_map_io,
2778 .reserve = apq8064_reserve,
2779 .init_irq = apq8064_init_irq,
2780 .handle_irq = gic_handle_irq,
2781 .timer = &msm_timer,
2782 .init_machine = apq8064_cdp_init,
Laura Abbott6988cef2012-03-15 14:27:13 -07002783 .init_very_early = apq8064_early_reserve,
Joel King11ca8202012-02-13 16:19:03 -08002784MACHINE_END
2785
2786MACHINE_START(MPQ8064_DTV, "QCT MPQ8064 DTV")
2787 .map_io = apq8064_map_io,
2788 .reserve = apq8064_reserve,
2789 .init_irq = apq8064_init_irq,
2790 .handle_irq = gic_handle_irq,
2791 .timer = &msm_timer,
2792 .init_machine = apq8064_cdp_init,
Laura Abbott6988cef2012-03-15 14:27:13 -07002793 .init_very_early = apq8064_early_reserve,
Joel King11ca8202012-02-13 16:19:03 -08002794MACHINE_END
2795