blob: d0045e2fa734de9edeef22cd9a12605d3f9347e5 [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>
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -060019#include <linux/slimbus/slimbus.h>
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +053020#include <linux/mfd/wcd9xxx/core.h>
21#include <linux/mfd/wcd9xxx/pdata.h>
Amy Maloche70090f992012-02-16 16:35:26 -080022#include <linux/mfd/pm8xxx/misc.h>
Kenneth Heitke36920d32011-07-20 16:44:30 -060023#include <linux/msm_ssbi.h>
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -070024#include <linux/spi/spi.h>
Ramesh Masavarapu28311912011-10-27 11:04:12 -070025#include <linux/dma-mapping.h>
26#include <linux/platform_data/qcom_crypto_device.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080027#include <linux/ion.h>
Jack Cheung46bfffa2012-01-19 15:26:24 -080028#include <linux/memory.h>
Jing Lin21ed4de2012-02-05 15:53:28 -080029#include <linux/i2c/atmel_mxt_ts.h>
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -080030#include <linux/cyttsp.h>
Amy Maloche70090f992012-02-16 16:35:26 -080031#include <linux/i2c/isa1200.h>
Mohan Pallaka474b94b2012-01-25 12:59:58 +053032#include <linux/gpio_keys.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070033#include <asm/mach-types.h>
34#include <asm/mach/arch.h>
35#include <asm/hardware/gic.h>
Sahitya Tummala3586ed92011-08-03 09:13:23 +053036#include <asm/mach/mmc.h>
Ankit Verma6b7e2ba2012-01-26 15:48:54 -080037#include <linux/platform_data/qcom_wcnss_device.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070038
39#include <mach/board.h>
40#include <mach/msm_iomap.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080041#include <mach/ion.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070042#include <linux/usb/msm_hsusb.h>
43#include <linux/usb/android.h>
44#include <mach/socinfo.h>
Harini Jayaramanc4c58692011-07-19 14:50:10 -060045#include <mach/msm_spi.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070046#include "timer.h"
47#include "devices.h"
Joel King4ebccc62011-07-22 09:43:22 -070048#include <mach/gpio.h>
49#include <mach/gpiomux.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060050#include <mach/rpm.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080051#ifdef CONFIG_ANDROID_PMEM
Kevin Chan13be4e22011-10-20 11:30:32 -070052#include <linux/android_pmem.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080053#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070054#include <mach/msm_memtypes.h>
55#include <linux/bootmem.h>
56#include <asm/setup.h>
Ramesh Masavarapu28311912011-10-27 11:04:12 -070057#include <mach/dma.h>
Jin Hongd3024e62012-02-09 16:13:32 -080058#include <mach/msm_dsps.h>
Gagan Mac8a7a5d32011-11-11 16:43:06 -070059#include <mach/msm_bus_board.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060060#include <mach/cpuidle.h>
Joel Kingdacbc822012-01-25 13:30:57 -080061#include <mach/mdm2.h>
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -080062#include <linux/msm_tsens.h>
Stephen Boyd4d0d2582012-02-10 14:49:40 -080063#include <mach/msm_xo.h>
Laura Abbott350c8362012-02-28 14:46:52 -080064#include <mach/msm_rtb.h>
Joel King4ebccc62011-07-22 09:43:22 -070065
Jeff Ohlstein7e668552011-10-06 16:17:25 -070066#include "msm_watchdog.h"
Stepan Moskovchenko5a83dba2011-12-05 17:30:17 -080067#include "board-8064.h"
Vikram Mulukutlabc2e9572011-11-04 03:41:38 -070068#include "acpuclock.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060069#include "spm.h"
70#include "mpm.h"
71#include "rpm_resources.h"
Matt Wagantall7cca4642012-02-01 16:43:24 -080072#include "pm.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060073#include "pm-boot.h"
Rajesh Sastrulaaee8af32012-01-20 11:46:31 -080074#include "devices-msm8x60.h"
Jay Chokshiea67c622011-07-29 17:12:26 -070075
Olav Haugan7c6aa742012-01-16 16:47:37 -080076#define MSM_PMEM_ADSP_SIZE 0x7800000
Ben Romberger3ffcd812011-12-08 19:12:10 -080077#define MSM_PMEM_AUDIO_SIZE 0x2B4000
Olav Haugan7c6aa742012-01-16 16:47:37 -080078#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
79#define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
80#else
Chetan Kalyan72aac4f2012-02-23 14:56:54 -080081#define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
Olav Haugan7c6aa742012-01-16 16:47:37 -080082#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070083
Olav Haugan7c6aa742012-01-16 16:47:37 -080084#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Olav Hauganedcf6832012-01-24 08:35:41 -080085#define MSM_PMEM_KERNEL_EBI1_SIZE 0x280000
Olav Haugan7c6aa742012-01-16 16:47:37 -080086#define MSM_ION_SF_SIZE MSM_PMEM_SIZE
Olav Haugand3d29682012-01-19 10:57:07 -080087#define MSM_ION_MM_FW_SIZE 0x200000 /* (2MB) */
Olav Haugan7c6aa742012-01-16 16:47:37 -080088#define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE
Olav Haugan3a9bd232012-02-15 14:23:27 -080089#define MSM_ION_QSECOM_SIZE 0x300000 /* (3MB) */
Olav Haugan7c6aa742012-01-16 16:47:37 -080090#define MSM_ION_MFC_SIZE SZ_8K
Olav Haugan2c43fac2012-01-19 11:06:37 -080091#define MSM_ION_AUDIO_SIZE MSM_PMEM_AUDIO_SIZE
92#define MSM_ION_HEAP_NUM 8
Olav Haugan7c6aa742012-01-16 16:47:37 -080093#else
94#define MSM_PMEM_KERNEL_EBI1_SIZE 0x110C000
95#define MSM_ION_HEAP_NUM 1
96#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070097
Siddartha Mohanadoss9c658982012-02-28 15:11:48 -080098#define GPIO_EXPANDER_IRQ_BASE (PM8821_IRQ_BASE + PM8821_NR_IRQS)
99#define GPIO_EXPANDER_GPIO_BASE (PM8821_MPP_BASE + PM8821_NR_MPPS)
100#define GPIO_EPM_EXPANDER_BASE GPIO_EXPANDER_GPIO_BASE
101
102enum {
103 SX150X_EPM,
104};
105
Olav Haugan7c6aa742012-01-16 16:47:37 -0800106#ifdef CONFIG_KERNEL_PMEM_EBI_REGION
107static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE;
108static int __init pmem_kernel_ebi1_size_setup(char *p)
Kevin Chan13be4e22011-10-20 11:30:32 -0700109{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800110 pmem_kernel_ebi1_size = memparse(p, NULL);
111 return 0;
Kevin Chan13be4e22011-10-20 11:30:32 -0700112}
Olav Haugan7c6aa742012-01-16 16:47:37 -0800113early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup);
114#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700115
Olav Haugan7c6aa742012-01-16 16:47:37 -0800116#ifdef CONFIG_ANDROID_PMEM
Kevin Chan13be4e22011-10-20 11:30:32 -0700117static unsigned pmem_size = MSM_PMEM_SIZE;
118static int __init pmem_size_setup(char *p)
119{
120 pmem_size = memparse(p, NULL);
121 return 0;
122}
123early_param("pmem_size", pmem_size_setup);
124
125static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
126
127static int __init pmem_adsp_size_setup(char *p)
128{
129 pmem_adsp_size = memparse(p, NULL);
130 return 0;
131}
132early_param("pmem_adsp_size", pmem_adsp_size_setup);
133
134static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
135
136static int __init pmem_audio_size_setup(char *p)
137{
138 pmem_audio_size = memparse(p, NULL);
139 return 0;
140}
141early_param("pmem_audio_size", pmem_audio_size_setup);
Olav Haugan7c6aa742012-01-16 16:47:37 -0800142#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700143
Olav Haugan7c6aa742012-01-16 16:47:37 -0800144#ifdef CONFIG_ANDROID_PMEM
145#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700146static struct android_pmem_platform_data android_pmem_pdata = {
147 .name = "pmem",
148 .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING,
149 .cached = 1,
150 .memory_type = MEMTYPE_EBI1,
151};
152
153static struct platform_device android_pmem_device = {
154 .name = "android_pmem",
155 .id = 0,
156 .dev = {.platform_data = &android_pmem_pdata},
157};
158
159static struct android_pmem_platform_data android_pmem_adsp_pdata = {
160 .name = "pmem_adsp",
161 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
162 .cached = 0,
163 .memory_type = MEMTYPE_EBI1,
164};
Kevin Chan13be4e22011-10-20 11:30:32 -0700165static struct platform_device android_pmem_adsp_device = {
166 .name = "android_pmem",
167 .id = 2,
168 .dev = { .platform_data = &android_pmem_adsp_pdata },
169};
Olav Haugan7c6aa742012-01-16 16:47:37 -0800170#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700171
172static struct android_pmem_platform_data android_pmem_audio_pdata = {
173 .name = "pmem_audio",
174 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
175 .cached = 0,
176 .memory_type = MEMTYPE_EBI1,
177};
178
179static struct platform_device android_pmem_audio_device = {
180 .name = "android_pmem",
181 .id = 4,
182 .dev = { .platform_data = &android_pmem_audio_pdata },
183};
Olav Haugan7c6aa742012-01-16 16:47:37 -0800184#endif
185
186static struct memtype_reserve apq8064_reserve_table[] __initdata = {
187 [MEMTYPE_SMI] = {
188 },
189 [MEMTYPE_EBI0] = {
190 .flags = MEMTYPE_FLAGS_1M_ALIGN,
191 },
192 [MEMTYPE_EBI1] = {
193 .flags = MEMTYPE_FLAGS_1M_ALIGN,
194 },
195};
Kevin Chan13be4e22011-10-20 11:30:32 -0700196
Laura Abbott350c8362012-02-28 14:46:52 -0800197#if defined(CONFIG_MSM_RTB)
198static struct msm_rtb_platform_data msm_rtb_pdata = {
199 .size = SZ_1M,
200};
201
202static int __init msm_rtb_set_buffer_size(char *p)
203{
204 int s;
205
206 s = memparse(p, NULL);
207 msm_rtb_pdata.size = ALIGN(s, SZ_4K);
208 return 0;
209}
210early_param("msm_rtb_size", msm_rtb_set_buffer_size);
211
212
213static struct platform_device msm_rtb_device = {
214 .name = "msm_rtb",
215 .id = -1,
216 .dev = {
217 .platform_data = &msm_rtb_pdata,
218 },
219};
220#endif
221
222static void __init reserve_rtb_memory(void)
223{
224#if defined(CONFIG_MSM_RTB)
225 apq8064_reserve_table[MEMTYPE_EBI1].size += msm_rtb_pdata.size;
226#endif
227}
228
229
Kevin Chan13be4e22011-10-20 11:30:32 -0700230static void __init size_pmem_devices(void)
231{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800232#ifdef CONFIG_ANDROID_PMEM
233#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700234 android_pmem_adsp_pdata.size = pmem_adsp_size;
235 android_pmem_pdata.size = pmem_size;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800236#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700237 android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800238#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700239}
240
241static void __init reserve_memory_for(struct android_pmem_platform_data *p)
242{
243 apq8064_reserve_table[p->memory_type].size += p->size;
244}
245
Kevin Chan13be4e22011-10-20 11:30:32 -0700246static void __init reserve_pmem_memory(void)
247{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800248#ifdef CONFIG_ANDROID_PMEM
249#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700250 reserve_memory_for(&android_pmem_adsp_pdata);
251 reserve_memory_for(&android_pmem_pdata);
Olav Haugan7c6aa742012-01-16 16:47:37 -0800252#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700253 reserve_memory_for(&android_pmem_audio_pdata);
254 apq8064_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800255#endif
256}
257
258static int apq8064_paddr_to_memtype(unsigned int paddr)
259{
260 return MEMTYPE_EBI1;
261}
262
263#ifdef CONFIG_ION_MSM
264#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
265static struct ion_cp_heap_pdata cp_mm_ion_pdata = {
266 .permission_type = IPT_TYPE_MM_CARVEOUT,
Olav Haugand3d29682012-01-19 10:57:07 -0800267 .align = PAGE_SIZE,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800268};
269
270static struct ion_cp_heap_pdata cp_mfc_ion_pdata = {
271 .permission_type = IPT_TYPE_MFC_SHAREDMEM,
Olav Haugand3d29682012-01-19 10:57:07 -0800272 .align = PAGE_SIZE,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800273};
274
275static struct ion_co_heap_pdata co_ion_pdata = {
Olav Haugand3d29682012-01-19 10:57:07 -0800276 .adjacent_mem_id = INVALID_HEAP_ID,
277 .align = PAGE_SIZE,
278};
279
280static struct ion_co_heap_pdata fw_co_ion_pdata = {
281 .adjacent_mem_id = ION_CP_MM_HEAP_ID,
282 .align = SZ_128K,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800283};
284#endif
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800285
286/**
287 * These heaps are listed in the order they will be allocated. Due to
288 * video hardware restrictions and content protection the FW heap has to
289 * be allocated adjacent (below) the MM heap and the MFC heap has to be
290 * allocated after the MM heap to ensure MFC heap is not more than 256MB
291 * away from the base address of the FW heap.
292 * However, the order of FW heap and MM heap doesn't matter since these
293 * two heaps are taken care of by separate code to ensure they are adjacent
294 * to each other.
295 * Don't swap the order unless you know what you are doing!
296 */
Olav Haugan7c6aa742012-01-16 16:47:37 -0800297static struct ion_platform_data ion_pdata = {
298 .nr = MSM_ION_HEAP_NUM,
299 .heaps = {
300 {
301 .id = ION_SYSTEM_HEAP_ID,
302 .type = ION_HEAP_TYPE_SYSTEM,
303 .name = ION_VMALLOC_HEAP_NAME,
304 },
305#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
306 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800307 .id = ION_CP_MM_HEAP_ID,
308 .type = ION_HEAP_TYPE_CP,
309 .name = ION_MM_HEAP_NAME,
310 .size = MSM_ION_MM_SIZE,
311 .memory_type = ION_EBI_TYPE,
312 .extra_data = (void *) &cp_mm_ion_pdata,
313 },
314 {
Olav Haugand3d29682012-01-19 10:57:07 -0800315 .id = ION_MM_FIRMWARE_HEAP_ID,
316 .type = ION_HEAP_TYPE_CARVEOUT,
317 .name = ION_MM_FIRMWARE_HEAP_NAME,
318 .size = MSM_ION_MM_FW_SIZE,
319 .memory_type = ION_EBI_TYPE,
320 .extra_data = (void *) &fw_co_ion_pdata,
321 },
322 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800323 .id = ION_CP_MFC_HEAP_ID,
324 .type = ION_HEAP_TYPE_CP,
325 .name = ION_MFC_HEAP_NAME,
326 .size = MSM_ION_MFC_SIZE,
327 .memory_type = ION_EBI_TYPE,
328 .extra_data = (void *) &cp_mfc_ion_pdata,
329 },
330 {
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800331 .id = ION_SF_HEAP_ID,
332 .type = ION_HEAP_TYPE_CARVEOUT,
333 .name = ION_SF_HEAP_NAME,
334 .size = MSM_ION_SF_SIZE,
335 .memory_type = ION_EBI_TYPE,
336 .extra_data = (void *) &co_ion_pdata,
337 },
338 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800339 .id = ION_IOMMU_HEAP_ID,
340 .type = ION_HEAP_TYPE_IOMMU,
341 .name = ION_IOMMU_HEAP_NAME,
342 },
Olav Hauganf45e2142012-01-19 11:01:01 -0800343 {
344 .id = ION_QSECOM_HEAP_ID,
345 .type = ION_HEAP_TYPE_CARVEOUT,
346 .name = ION_QSECOM_HEAP_NAME,
347 .size = MSM_ION_QSECOM_SIZE,
348 .memory_type = ION_EBI_TYPE,
349 .extra_data = (void *) &co_ion_pdata,
350 },
Olav Haugan2c43fac2012-01-19 11:06:37 -0800351 {
352 .id = ION_AUDIO_HEAP_ID,
353 .type = ION_HEAP_TYPE_CARVEOUT,
354 .name = ION_AUDIO_HEAP_NAME,
355 .size = MSM_ION_AUDIO_SIZE,
356 .memory_type = ION_EBI_TYPE,
357 .extra_data = (void *) &co_ion_pdata,
358 },
Olav Haugan7c6aa742012-01-16 16:47:37 -0800359#endif
360 }
361};
362
363static struct platform_device ion_dev = {
364 .name = "ion-msm",
365 .id = 1,
366 .dev = { .platform_data = &ion_pdata },
367};
368#endif
369
370static void reserve_ion_memory(void)
371{
372#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
373 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_SIZE;
Olav Haugand3d29682012-01-19 10:57:07 -0800374 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_FW_SIZE;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800375 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_SF_SIZE;
376 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MFC_SIZE;
Olav Hauganf45e2142012-01-19 11:01:01 -0800377 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_QSECOM_SIZE;
Olav Haugan2c43fac2012-01-19 11:06:37 -0800378 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_AUDIO_SIZE;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800379#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700380}
381
Huaibin Yang4a084e32011-12-15 15:25:52 -0800382static void __init reserve_mdp_memory(void)
383{
384 apq8064_mdp_writeback(apq8064_reserve_table);
385}
386
Kevin Chan13be4e22011-10-20 11:30:32 -0700387static void __init apq8064_calculate_reserve_sizes(void)
388{
389 size_pmem_devices();
390 reserve_pmem_memory();
Olav Haugan7c6aa742012-01-16 16:47:37 -0800391 reserve_ion_memory();
Huaibin Yang4a084e32011-12-15 15:25:52 -0800392 reserve_mdp_memory();
Laura Abbott350c8362012-02-28 14:46:52 -0800393 reserve_rtb_memory();
Kevin Chan13be4e22011-10-20 11:30:32 -0700394}
395
396static struct reserve_info apq8064_reserve_info __initdata = {
397 .memtype_reserve_table = apq8064_reserve_table,
398 .calculate_reserve_sizes = apq8064_calculate_reserve_sizes,
399 .paddr_to_memtype = apq8064_paddr_to_memtype,
400};
401
402static int apq8064_memory_bank_size(void)
403{
404 return 1<<29;
405}
406
407static void __init locate_unstable_memory(void)
408{
409 struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1];
410 unsigned long bank_size;
411 unsigned long low, high;
412
413 bank_size = apq8064_memory_bank_size();
414 low = meminfo.bank[0].start;
415 high = mb->start + mb->size;
Olav Haugand76e3a82012-01-16 16:55:07 -0800416
417 /* Check if 32 bit overflow occured */
418 if (high < mb->start)
419 high = ~0UL;
420
Kevin Chan13be4e22011-10-20 11:30:32 -0700421 low &= ~(bank_size - 1);
422
423 if (high - low <= bank_size)
424 return;
Jack Cheung46bfffa2012-01-19 15:26:24 -0800425 apq8064_reserve_info.low_unstable_address = mb->start -
426 MIN_MEMORY_BLOCK_SIZE + mb->size;
427 apq8064_reserve_info.max_unstable_size = MIN_MEMORY_BLOCK_SIZE;
428
Kevin Chan13be4e22011-10-20 11:30:32 -0700429 apq8064_reserve_info.bank_size = bank_size;
430 pr_info("low unstable address %lx max size %lx bank size %lx\n",
431 apq8064_reserve_info.low_unstable_address,
432 apq8064_reserve_info.max_unstable_size,
433 apq8064_reserve_info.bank_size);
434}
435
Aravind Venkateswaran8ac7f412012-03-16 17:57:30 -0700436static char prim_panel_name[PANEL_NAME_MAX_LEN];
437static char ext_panel_name[PANEL_NAME_MAX_LEN];
438static int __init prim_display_setup(char *param)
439{
440 if (strnlen(param, PANEL_NAME_MAX_LEN))
441 strlcpy(prim_panel_name, param, PANEL_NAME_MAX_LEN);
442 return 0;
443}
444early_param("prim_display", prim_display_setup);
445
446static int __init ext_display_setup(char *param)
447{
448 if (strnlen(param, PANEL_NAME_MAX_LEN))
449 strlcpy(ext_panel_name, param, PANEL_NAME_MAX_LEN);
450 return 0;
451}
452early_param("ext_display", ext_display_setup);
453
Kevin Chan13be4e22011-10-20 11:30:32 -0700454static void __init apq8064_reserve(void)
455{
Aravind Venkateswaran8ac7f412012-03-16 17:57:30 -0700456 apq8064_set_display_params(prim_panel_name, ext_panel_name);
Kevin Chan13be4e22011-10-20 11:30:32 -0700457 msm_reserve();
458}
459
Laura Abbott6988cef2012-03-15 14:27:13 -0700460static void __init place_movable_zone(void)
461{
462 movable_reserved_start = apq8064_reserve_info.low_unstable_address;
463 movable_reserved_size = apq8064_reserve_info.max_unstable_size;
464 pr_info("movable zone start %lx size %lx\n",
465 movable_reserved_start, movable_reserved_size);
466}
467
468static void __init apq8064_early_reserve(void)
469{
470 reserve_info = &apq8064_reserve_info;
471 locate_unstable_memory();
472 place_movable_zone();
473
474}
Hemant Kumara945b472012-01-25 15:08:06 -0800475#ifdef CONFIG_USB_EHCI_MSM_HSIC
476static struct msm_hsic_host_platform_data msm_hsic_pdata = {
477 .strobe = 88,
478 .data = 89,
479};
480#else
481static struct msm_hsic_host_platform_data msm_hsic_pdata;
482#endif
483
Hemant Kumarcb7d8a12012-01-25 12:25:55 -0800484#define PID_MAGIC_ID 0x71432909
485#define SERIAL_NUM_MAGIC_ID 0x61945374
486#define SERIAL_NUMBER_LENGTH 127
487#define DLOAD_USB_BASE_ADD 0x2A03F0C8
488
489struct magic_num_struct {
490 uint32_t pid;
491 uint32_t serial_num;
492};
493
494struct dload_struct {
495 uint32_t reserved1;
496 uint32_t reserved2;
497 uint32_t reserved3;
498 uint16_t reserved4;
499 uint16_t pid;
500 char serial_number[SERIAL_NUMBER_LENGTH];
501 uint16_t reserved5;
502 struct magic_num_struct magic_struct;
503};
504
505static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
506{
507 struct dload_struct __iomem *dload = 0;
508
509 dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload));
510 if (!dload) {
511 pr_err("%s: cannot remap I/O memory region: %08x\n",
512 __func__, DLOAD_USB_BASE_ADD);
513 return -ENXIO;
514 }
515
516 pr_debug("%s: dload:%p pid:%x serial_num:%s\n",
517 __func__, dload, pid, snum);
518 /* update pid */
519 dload->magic_struct.pid = PID_MAGIC_ID;
520 dload->pid = pid;
521
522 /* update serial number */
523 dload->magic_struct.serial_num = 0;
524 if (!snum) {
525 memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH);
526 goto out;
527 }
528
529 dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID;
530 strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH);
531out:
532 iounmap(dload);
533 return 0;
534}
535
536static struct android_usb_platform_data android_usb_pdata = {
537 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
538};
539
Hemant Kumar4933b072011-10-17 23:43:11 -0700540static struct platform_device android_usb_device = {
Hemant Kumarcb7d8a12012-01-25 12:25:55 -0800541 .name = "android_usb",
542 .id = -1,
543 .dev = {
544 .platform_data = &android_usb_pdata,
545 },
Hemant Kumar4933b072011-10-17 23:43:11 -0700546};
547
Hemant Kumar7620eed2012-02-26 09:08:43 -0800548/* Bandwidth requests (zero) if no vote placed */
549static struct msm_bus_vectors usb_init_vectors[] = {
550 {
551 .src = MSM_BUS_MASTER_SPS,
552 .dst = MSM_BUS_SLAVE_EBI_CH0,
553 .ab = 0,
554 .ib = 0,
555 },
556};
557
558/* Bus bandwidth requests in Bytes/sec */
559static struct msm_bus_vectors usb_max_vectors[] = {
560 {
561 .src = MSM_BUS_MASTER_SPS,
562 .dst = MSM_BUS_SLAVE_EBI_CH0,
563 .ab = 60000000, /* At least 480Mbps on bus. */
564 .ib = 960000000, /* MAX bursts rate */
565 },
566};
567
568static struct msm_bus_paths usb_bus_scale_usecases[] = {
569 {
570 ARRAY_SIZE(usb_init_vectors),
571 usb_init_vectors,
572 },
573 {
574 ARRAY_SIZE(usb_max_vectors),
575 usb_max_vectors,
576 },
577};
578
579static struct msm_bus_scale_pdata usb_bus_scale_pdata = {
580 usb_bus_scale_usecases,
581 ARRAY_SIZE(usb_bus_scale_usecases),
582 .name = "usb",
583};
584
Hemant Kumar4933b072011-10-17 23:43:11 -0700585static struct msm_otg_platform_data msm_otg_pdata = {
Hemant Kumard86c4882012-01-24 19:39:37 -0800586 .mode = USB_OTG,
587 .otg_control = OTG_PMIC_CONTROL,
Hemant Kumar4933b072011-10-17 23:43:11 -0700588 .phy_type = SNPS_28NM_INTEGRATED_PHY,
Hemant Kumard86c4882012-01-24 19:39:37 -0800589 .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE),
590 .power_budget = 750,
Hemant Kumar7620eed2012-02-26 09:08:43 -0800591 .bus_scale_table = &usb_bus_scale_pdata,
Hemant Kumar4933b072011-10-17 23:43:11 -0700592};
593
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800594static struct msm_usb_host_platform_data msm_ehci_host_pdata3 = {
Manu Gautam91223e02011-11-08 15:27:22 +0530595 .power_budget = 500,
596};
597
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800598#ifdef CONFIG_USB_EHCI_MSM_HOST4
599static struct msm_usb_host_platform_data msm_ehci_host_pdata4;
600#endif
601
Manu Gautam91223e02011-11-08 15:27:22 +0530602static void __init apq8064_ehci_host_init(void)
603{
604 if (machine_is_apq8064_liquid()) {
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800605 msm_ehci_host_pdata3.dock_connect_irq =
Hemant Kumar56925352012-02-13 16:59:52 -0800606 PM8921_MPP_IRQ(PM8921_IRQ_BASE, 9);
607
Manu Gautam91223e02011-11-08 15:27:22 +0530608 apq8064_device_ehci_host3.dev.platform_data =
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800609 &msm_ehci_host_pdata3;
Manu Gautam91223e02011-11-08 15:27:22 +0530610 platform_device_register(&apq8064_device_ehci_host3);
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800611
612#ifdef CONFIG_USB_EHCI_MSM_HOST4
613 apq8064_device_ehci_host4.dev.platform_data =
614 &msm_ehci_host_pdata4;
615 platform_device_register(&apq8064_device_ehci_host4);
616#endif
Manu Gautam91223e02011-11-08 15:27:22 +0530617 }
618}
619
David Keitel2f613d92012-02-15 11:29:16 -0800620static struct smb349_platform_data smb349_data __initdata = {
621 .en_n_gpio = PM8921_GPIO_PM_TO_SYS(37),
622 .chg_susp_gpio = PM8921_GPIO_PM_TO_SYS(30),
623 .chg_current_ma = 2200,
624};
625
626static struct i2c_board_info smb349_charger_i2c_info[] __initdata = {
627 {
628 I2C_BOARD_INFO(SMB349_NAME, 0x1B),
629 .platform_data = &smb349_data,
630 },
631};
632
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800633#define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS)
634
635/* Micbias setting is based on 8660 CDP/MTP/FLUID requirement
636 * 4 micbiases are used to power various analog and digital
637 * microphones operating at 1800 mV. Technically, all micbiases
638 * can source from single cfilter since all microphones operate
639 * at the same voltage level. The arrangement below is to make
640 * sure all cfilters are exercised. LDO_H regulator ouput level
641 * does not need to be as high as 2.85V. It is choosen for
642 * microphone sensitivity purpose.
643 */
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530644static struct wcd9xxx_pdata apq8064_tabla_platform_data = {
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800645 .slimbus_slave_device = {
646 .name = "tabla-slave",
647 .e_addr = {0, 0, 0x10, 0, 0x17, 2},
648 },
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800649 .irq = MSM_GPIO_TO_INT(42),
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800650 .irq_base = TABLA_INTERRUPT_BASE,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530651 .num_irqs = NR_WCD9XXX_IRQS,
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800652 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
653 .micbias = {
654 .ldoh_v = TABLA_LDOH_2P85_V,
655 .cfilt1_mv = 1800,
656 .cfilt2_mv = 1800,
657 .cfilt3_mv = 1800,
658 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
659 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
660 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
661 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530662 },
663 .regulator = {
664 {
665 .name = "CDC_VDD_CP",
666 .min_uV = 1800000,
667 .max_uV = 1800000,
668 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
669 },
670 {
671 .name = "CDC_VDDA_RX",
672 .min_uV = 1800000,
673 .max_uV = 1800000,
674 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
675 },
676 {
677 .name = "CDC_VDDA_TX",
678 .min_uV = 1800000,
679 .max_uV = 1800000,
680 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
681 },
682 {
683 .name = "VDDIO_CDC",
684 .min_uV = 1800000,
685 .max_uV = 1800000,
686 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
687 },
688 {
689 .name = "VDDD_CDC_D",
690 .min_uV = 1225000,
691 .max_uV = 1225000,
692 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
693 },
694 {
695 .name = "CDC_VDDA_A_1P2V",
696 .min_uV = 1225000,
697 .max_uV = 1225000,
698 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
699 },
700 },
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800701};
702
703static struct slim_device apq8064_slim_tabla = {
704 .name = "tabla-slim",
705 .e_addr = {0, 1, 0x10, 0, 0x17, 2},
706 .dev = {
707 .platform_data = &apq8064_tabla_platform_data,
708 },
709};
710
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530711static struct wcd9xxx_pdata apq8064_tabla20_platform_data = {
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800712 .slimbus_slave_device = {
713 .name = "tabla-slave",
714 .e_addr = {0, 0, 0x60, 0, 0x17, 2},
715 },
716 .irq = MSM_GPIO_TO_INT(42),
717 .irq_base = TABLA_INTERRUPT_BASE,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530718 .num_irqs = NR_WCD9XXX_IRQS,
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800719 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
720 .micbias = {
721 .ldoh_v = TABLA_LDOH_2P85_V,
722 .cfilt1_mv = 1800,
723 .cfilt2_mv = 1800,
724 .cfilt3_mv = 1800,
725 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
726 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
727 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
728 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530729 },
730 .regulator = {
731 {
732 .name = "CDC_VDD_CP",
733 .min_uV = 1800000,
734 .max_uV = 1800000,
735 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
736 },
737 {
738 .name = "CDC_VDDA_RX",
739 .min_uV = 1800000,
740 .max_uV = 1800000,
741 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
742 },
743 {
744 .name = "CDC_VDDA_TX",
745 .min_uV = 1800000,
746 .max_uV = 1800000,
747 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
748 },
749 {
750 .name = "VDDIO_CDC",
751 .min_uV = 1800000,
752 .max_uV = 1800000,
753 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
754 },
755 {
756 .name = "VDDD_CDC_D",
757 .min_uV = 1225000,
758 .max_uV = 1225000,
759 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
760 },
761 {
762 .name = "CDC_VDDA_A_1P2V",
763 .min_uV = 1225000,
764 .max_uV = 1225000,
765 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
766 },
767 },
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800768};
769
770static struct slim_device apq8064_slim_tabla20 = {
771 .name = "tabla2x-slim",
772 .e_addr = {0, 1, 0x60, 0, 0x17, 2},
773 .dev = {
774 .platform_data = &apq8064_tabla20_platform_data,
775 },
776};
777
Amy Maloche70090f992012-02-16 16:35:26 -0800778#define HAP_SHIFT_LVL_OE_GPIO PM8921_MPP_PM_TO_SYS(8)
779#define ISA1200_HAP_EN_GPIO PM8921_GPIO_PM_TO_SYS(33)
780#define ISA1200_HAP_LEN_GPIO PM8921_GPIO_PM_TO_SYS(20)
781#define ISA1200_HAP_CLK PM8921_GPIO_PM_TO_SYS(44)
782
783static int isa1200_power(int on)
784{
785 gpio_set_value_cansleep(ISA1200_HAP_CLK, !!on);
786
787 return 0;
788}
789
790static int isa1200_dev_setup(bool enable)
791{
792 int rc = 0;
793
794 rc = pm8xxx_aux_clk_control(CLK_MP3_2, XO_DIV_1, enable);
795 if (rc) {
796 pr_err("%s: unable to write aux clock register(%d)\n",
797 __func__, rc);
798 return rc;
799 }
800
801 if (!enable)
802 goto free_gpio;
803
804 rc = gpio_request(ISA1200_HAP_CLK, "haptics_clk");
805 if (rc) {
806 pr_err("%s: unable to request gpio %d config(%d)\n",
807 __func__, ISA1200_HAP_CLK, rc);
808 return rc;
809 }
810
811 rc = gpio_direction_output(ISA1200_HAP_CLK, 0);
812 if (rc) {
813 pr_err("%s: unable to set direction\n", __func__);
814 goto free_gpio;
815 }
816
817 return 0;
818
819free_gpio:
820 gpio_free(ISA1200_HAP_CLK);
821 return rc;
822}
823
824static struct isa1200_regulator isa1200_reg_data[] = {
825 {
826 .name = "vddp",
827 .min_uV = ISA_I2C_VTG_MIN_UV,
828 .max_uV = ISA_I2C_VTG_MAX_UV,
829 .load_uA = ISA_I2C_CURR_UA,
830 },
831};
832
833static struct isa1200_platform_data isa1200_1_pdata = {
834 .name = "vibrator",
835 .dev_setup = isa1200_dev_setup,
836 .power_on = isa1200_power,
837 .hap_en_gpio = ISA1200_HAP_EN_GPIO,
838 .hap_len_gpio = ISA1200_HAP_LEN_GPIO,
839 .max_timeout = 15000,
840 .mode_ctrl = PWM_GEN_MODE,
841 .pwm_fd = {
842 .pwm_div = 256,
843 },
844 .is_erm = false,
845 .smart_en = true,
846 .ext_clk_en = true,
847 .chip_en = 1,
848 .regulator_info = isa1200_reg_data,
849 .num_regulators = ARRAY_SIZE(isa1200_reg_data),
850};
851
852static struct i2c_board_info isa1200_board_info[] __initdata = {
853 {
854 I2C_BOARD_INFO("isa1200_1", 0x90>>1),
855 .platform_data = &isa1200_1_pdata,
856 },
857};
Jing Lin21ed4de2012-02-05 15:53:28 -0800858/* configuration data for mxt1386e using V2.1 firmware */
859static const u8 mxt1386e_config_data_v2_1[] = {
860 /* T6 Object */
861 0, 0, 0, 0, 0, 0,
862 /* T38 Object */
Jing Linf1208fd2012-02-23 11:15:42 -0800863 14, 1, 0, 22, 2, 12, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -0800864 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
865 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
866 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
867 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
868 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
869 0, 0, 0, 0,
870 /* T7 Object */
Jing Linf1208fd2012-02-23 11:15:42 -0800871 100, 10, 50,
Jing Lin21ed4de2012-02-05 15:53:28 -0800872 /* T8 Object */
Jing Linf1208fd2012-02-23 11:15:42 -0800873 25, 0, 20, 20, 0, 0, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -0800874 /* T9 Object */
875 131, 0, 0, 26, 42, 0, 32, 80, 2, 5,
876 0, 5, 5, 0, 10, 30, 10, 10, 255, 2,
Jing Linf1208fd2012-02-23 11:15:42 -0800877 85, 5, 0, 5, 9, 5, 12, 35, 70, 40,
878 20, 5, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -0800879 /* T18 Object */
880 0, 0,
881 /* T24 Object */
882 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
883 0, 0, 0, 0, 0, 0, 0, 0, 0,
884 /* T25 Object */
885 3, 0, 60, 115, 156, 99,
886 /* T27 Object */
887 0, 0, 0, 0, 0, 0, 0,
888 /* T40 Object */
889 0, 0, 0, 0, 0,
890 /* T42 Object */
891 2, 0, 255, 0, 255, 0, 0, 0, 0, 0,
892 /* T43 Object */
893 0, 0, 0, 0, 0, 0, 0, 64, 0, 8,
894 16,
895 /* T46 Object */
Jing Linf1208fd2012-02-23 11:15:42 -0800896 68, 0, 16, 16, 0, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -0800897 /* T47 Object */
898 0, 0, 0, 0, 0, 0, 3, 64, 66, 0,
899 /* T48 Object */
900 31, 64, 64, 0, 0, 0, 0, 0, 0, 0,
Jing Linf1208fd2012-02-23 11:15:42 -0800901 32, 40, 0, 10, 10, 0, 0, 100, 10, 90,
902 0, 0, 0, 0, 0, 0, 0, 10, 1, 10,
903 52, 10, 12, 0, 33, 0, 1, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -0800904 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
905 0, 0, 0, 0,
906 /* T56 Object */
907 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
908 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
909 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
910 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Jing Linf1208fd2012-02-23 11:15:42 -0800911 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
912 0,
Jing Lin21ed4de2012-02-05 15:53:28 -0800913};
914
915#define MXT_TS_GPIO_IRQ 6
916#define MXT_TS_PWR_EN_GPIO PM8921_GPIO_PM_TO_SYS(23)
917#define MXT_TS_RESET_GPIO 33
918
919static struct mxt_config_info mxt_config_array[] = {
920 {
921 .config = mxt1386e_config_data_v2_1,
922 .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1),
923 .family_id = 0xA0,
924 .variant_id = 0x7,
925 .version = 0x21,
926 .build = 0xAA,
927 },
928};
929
930static struct mxt_platform_data mxt_platform_data = {
931 .config_array = mxt_config_array,
932 .config_array_size = ARRAY_SIZE(mxt_config_array),
933 .x_size = 1365,
934 .y_size = 767,
935 .irqflags = IRQF_TRIGGER_FALLING,
936 .i2c_pull_up = true,
937 .reset_gpio = MXT_TS_RESET_GPIO,
938 .irq_gpio = MXT_TS_GPIO_IRQ,
939};
940
941static struct i2c_board_info mxt_device_info[] __initdata = {
942 {
943 I2C_BOARD_INFO("atmel_mxt_ts", 0x5b),
944 .platform_data = &mxt_platform_data,
945 .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ),
946 },
947};
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -0800948#define CYTTSP_TS_GPIO_IRQ 6
949#define CYTTSP_TS_GPIO_RESOUT 7
950#define CYTTSP_TS_GPIO_SLEEP 33
951
952static ssize_t tma340_vkeys_show(struct kobject *kobj,
953 struct kobj_attribute *attr, char *buf)
954{
955 return snprintf(buf, 200,
956 __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97"
957 ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97"
958 ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97"
959 ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97"
960 "\n");
961}
962
963static struct kobj_attribute tma340_vkeys_attr = {
964 .attr = {
965 .mode = S_IRUGO,
966 },
967 .show = &tma340_vkeys_show,
968};
969
970static struct attribute *tma340_properties_attrs[] = {
971 &tma340_vkeys_attr.attr,
972 NULL
973};
974
975static struct attribute_group tma340_properties_attr_group = {
976 .attrs = tma340_properties_attrs,
977};
978
979static int cyttsp_platform_init(struct i2c_client *client)
980{
981 int rc = 0;
982 static struct kobject *tma340_properties_kobj;
983
984 tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c";
985 tma340_properties_kobj = kobject_create_and_add("board_properties",
986 NULL);
987 if (tma340_properties_kobj)
988 rc = sysfs_create_group(tma340_properties_kobj,
989 &tma340_properties_attr_group);
990 if (!tma340_properties_kobj || rc)
991 pr_err("%s: failed to create board_properties\n",
992 __func__);
993
994 return 0;
995}
996
997static struct cyttsp_regulator cyttsp_regulator_data[] = {
998 {
999 .name = "vdd",
1000 .min_uV = CY_TMA300_VTG_MIN_UV,
1001 .max_uV = CY_TMA300_VTG_MAX_UV,
1002 .hpm_load_uA = CY_TMA300_CURR_24HZ_UA,
1003 .lpm_load_uA = CY_TMA300_CURR_24HZ_UA,
1004 },
1005 {
1006 .name = "vcc_i2c",
1007 .min_uV = CY_I2C_VTG_MIN_UV,
1008 .max_uV = CY_I2C_VTG_MAX_UV,
1009 .hpm_load_uA = CY_I2C_CURR_UA,
1010 .lpm_load_uA = CY_I2C_CURR_UA,
1011 },
1012};
1013
1014static struct cyttsp_platform_data cyttsp_pdata = {
1015 .panel_maxx = 634,
1016 .panel_maxy = 1166,
1017 .disp_maxx = 599,
1018 .disp_maxy = 1023,
1019 .disp_minx = 0,
1020 .disp_miny = 0,
1021 .flags = 0x01,
1022 .gen = CY_GEN3,
1023 .use_st = CY_USE_ST,
1024 .use_mt = CY_USE_MT,
1025 .use_hndshk = CY_SEND_HNDSHK,
1026 .use_trk_id = CY_USE_TRACKING_ID,
1027 .use_sleep = CY_USE_DEEP_SLEEP_SEL,
1028 .use_gestures = CY_USE_GESTURES,
1029 .fw_fname = "cyttsp_8064_mtp.hex",
1030 /* change act_intrvl to customize the Active power state
1031 * scanning/processing refresh interval for Operating mode
1032 */
1033 .act_intrvl = CY_ACT_INTRVL_DFLT,
1034 /* change tch_tmout to customize the touch timeout for the
1035 * Active power state for Operating mode
1036 */
1037 .tch_tmout = CY_TCH_TMOUT_DFLT,
1038 /* change lp_intrvl to customize the Low Power power state
1039 * scanning/processing refresh interval for Operating mode
1040 */
1041 .lp_intrvl = CY_LP_INTRVL_DFLT,
1042 .sleep_gpio = CYTTSP_TS_GPIO_SLEEP,
1043 .resout_gpio = CYTTSP_TS_GPIO_RESOUT,
1044 .irq_gpio = CYTTSP_TS_GPIO_IRQ,
1045 .regulator_info = cyttsp_regulator_data,
1046 .num_regulators = ARRAY_SIZE(cyttsp_regulator_data),
1047 .init = cyttsp_platform_init,
1048 .correct_fw_ver = 17,
1049};
1050
1051static struct i2c_board_info cyttsp_info[] __initdata = {
1052 {
1053 I2C_BOARD_INFO(CY_I2C_NAME, 0x24),
1054 .platform_data = &cyttsp_pdata,
1055 .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ),
1056 },
1057};
Jing Lin21ed4de2012-02-05 15:53:28 -08001058
Ankit Verma6b7e2ba2012-01-26 15:48:54 -08001059#define MSM_WCNSS_PHYS 0x03000000
1060#define MSM_WCNSS_SIZE 0x280000
1061
1062static struct resource resources_wcnss_wlan[] = {
1063 {
1064 .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1065 .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1066 .name = "wcnss_wlanrx_irq",
1067 .flags = IORESOURCE_IRQ,
1068 },
1069 {
1070 .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1071 .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1072 .name = "wcnss_wlantx_irq",
1073 .flags = IORESOURCE_IRQ,
1074 },
1075 {
1076 .start = MSM_WCNSS_PHYS,
1077 .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1,
1078 .name = "wcnss_mmio",
1079 .flags = IORESOURCE_MEM,
1080 },
1081 {
1082 .start = 64,
1083 .end = 68,
1084 .name = "wcnss_gpios_5wire",
1085 .flags = IORESOURCE_IO,
1086 },
1087};
1088
1089static struct qcom_wcnss_opts qcom_wcnss_pdata = {
1090 .has_48mhz_xo = 1,
1091};
1092
1093static struct platform_device msm_device_wcnss_wlan = {
1094 .name = "wcnss_wlan",
1095 .id = 0,
1096 .num_resources = ARRAY_SIZE(resources_wcnss_wlan),
1097 .resource = resources_wcnss_wlan,
1098 .dev = {.platform_data = &qcom_wcnss_pdata},
1099};
1100
Ankit Vermab7c26e62012-02-28 15:04:15 -08001101static struct platform_device msm_device_iris_fm __devinitdata = {
1102 .name = "iris_fm",
1103 .id = -1,
1104};
1105
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001106#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1107 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
1108 defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1109 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1110
1111#define QCE_SIZE 0x10000
1112#define QCE_0_BASE 0x11000000
1113
1114#define QCE_HW_KEY_SUPPORT 0
1115#define QCE_SHA_HMAC_SUPPORT 1
1116#define QCE_SHARE_CE_RESOURCE 3
1117#define QCE_CE_SHARED 0
1118
1119static struct resource qcrypto_resources[] = {
1120 [0] = {
1121 .start = QCE_0_BASE,
1122 .end = QCE_0_BASE + QCE_SIZE - 1,
1123 .flags = IORESOURCE_MEM,
1124 },
1125 [1] = {
1126 .name = "crypto_channels",
1127 .start = DMOV8064_CE_IN_CHAN,
1128 .end = DMOV8064_CE_OUT_CHAN,
1129 .flags = IORESOURCE_DMA,
1130 },
1131 [2] = {
1132 .name = "crypto_crci_in",
1133 .start = DMOV8064_CE_IN_CRCI,
1134 .end = DMOV8064_CE_IN_CRCI,
1135 .flags = IORESOURCE_DMA,
1136 },
1137 [3] = {
1138 .name = "crypto_crci_out",
1139 .start = DMOV8064_CE_OUT_CRCI,
1140 .end = DMOV8064_CE_OUT_CRCI,
1141 .flags = IORESOURCE_DMA,
1142 },
1143};
1144
1145static struct resource qcedev_resources[] = {
1146 [0] = {
1147 .start = QCE_0_BASE,
1148 .end = QCE_0_BASE + QCE_SIZE - 1,
1149 .flags = IORESOURCE_MEM,
1150 },
1151 [1] = {
1152 .name = "crypto_channels",
1153 .start = DMOV8064_CE_IN_CHAN,
1154 .end = DMOV8064_CE_OUT_CHAN,
1155 .flags = IORESOURCE_DMA,
1156 },
1157 [2] = {
1158 .name = "crypto_crci_in",
1159 .start = DMOV8064_CE_IN_CRCI,
1160 .end = DMOV8064_CE_IN_CRCI,
1161 .flags = IORESOURCE_DMA,
1162 },
1163 [3] = {
1164 .name = "crypto_crci_out",
1165 .start = DMOV8064_CE_OUT_CRCI,
1166 .end = DMOV8064_CE_OUT_CRCI,
1167 .flags = IORESOURCE_DMA,
1168 },
1169};
1170
1171#endif
1172
1173#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1174 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1175
1176static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
1177 .ce_shared = QCE_CE_SHARED,
1178 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1179 .hw_key_support = QCE_HW_KEY_SUPPORT,
1180 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -08001181 .bus_scale_table = NULL,
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001182};
1183
1184static struct platform_device qcrypto_device = {
1185 .name = "qcrypto",
1186 .id = 0,
1187 .num_resources = ARRAY_SIZE(qcrypto_resources),
1188 .resource = qcrypto_resources,
1189 .dev = {
1190 .coherent_dma_mask = DMA_BIT_MASK(32),
1191 .platform_data = &qcrypto_ce_hw_suppport,
1192 },
1193};
1194#endif
1195
1196#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1197 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1198
1199static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
1200 .ce_shared = QCE_CE_SHARED,
1201 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1202 .hw_key_support = QCE_HW_KEY_SUPPORT,
1203 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -08001204 .bus_scale_table = NULL,
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001205};
1206
1207static struct platform_device qcedev_device = {
1208 .name = "qce",
1209 .id = 0,
1210 .num_resources = ARRAY_SIZE(qcedev_resources),
1211 .resource = qcedev_resources,
1212 .dev = {
1213 .coherent_dma_mask = DMA_BIT_MASK(32),
1214 .platform_data = &qcedev_ce_hw_suppport,
1215 },
1216};
1217#endif
1218
Joel Kingdacbc822012-01-25 13:30:57 -08001219static struct mdm_platform_data mdm_platform_data = {
1220 .mdm_version = "3.0",
1221 .ramdump_delay_ms = 2000,
Hemant Kumara945b472012-01-25 15:08:06 -08001222 .peripheral_platform_device = &apq8064_device_hsic_host,
Joel Kingdacbc822012-01-25 13:30:57 -08001223};
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001224
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -08001225static struct tsens_platform_data apq_tsens_pdata = {
1226 .tsens_factor = 1000,
1227 .hw_type = APQ_8064,
1228 .tsens_num_sensor = 11,
1229 .slope = {1176, 1176, 1154, 1176, 1111,
1230 1132, 1132, 1199, 1132, 1199, 1132},
1231};
1232
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001233#define MSM_SHARED_RAM_PHYS 0x80000000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001234static void __init apq8064_map_io(void)
1235{
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001236 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001237 msm_map_apq8064_io();
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -07001238 if (socinfo_init() < 0)
1239 pr_err("socinfo_init() failed!\n");
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001240}
1241
1242static void __init apq8064_init_irq(void)
1243{
Praveen Chidambaram78499012011-11-01 17:15:17 -06001244 struct msm_mpm_device_data *data = NULL;
1245
1246#ifdef CONFIG_MSM_MPM
1247 data = &apq8064_mpm_dev_data;
1248#endif
1249
1250 msm_mpm_irq_extn_init(data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001251 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
1252 (void *)MSM_QGIC_CPU_BASE);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001253}
1254
Jay Chokshi7805b5a2011-11-07 15:55:30 -08001255static struct platform_device msm8064_device_saw_regulator_core0 = {
1256 .name = "saw-regulator",
1257 .id = 0,
1258 .dev = {
1259 .platform_data = &msm8064_saw_regulator_pdata_8921_s5,
1260 },
1261};
1262
1263static struct platform_device msm8064_device_saw_regulator_core1 = {
1264 .name = "saw-regulator",
1265 .id = 1,
1266 .dev = {
1267 .platform_data = &msm8064_saw_regulator_pdata_8921_s6,
1268 },
1269};
1270
1271static struct platform_device msm8064_device_saw_regulator_core2 = {
1272 .name = "saw-regulator",
1273 .id = 2,
1274 .dev = {
1275 .platform_data = &msm8064_saw_regulator_pdata_8821_s0,
1276 },
1277};
1278
1279static struct platform_device msm8064_device_saw_regulator_core3 = {
1280 .name = "saw-regulator",
1281 .id = 3,
1282 .dev = {
1283 .platform_data = &msm8064_saw_regulator_pdata_8821_s1,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001284
1285 },
1286};
1287
Oluwafemi Adeyemif5a31422012-03-08 16:58:45 -08001288static struct msm_rpmrs_level msm_rpmrs_levels[] = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06001289 {
1290 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
1291 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
1292 true,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001293 100, 650, 801, 200,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001294 },
1295
1296 {
1297 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
1298 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
1299 true,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001300 2000, 200, 576000, 2000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001301 },
1302
1303 {
1304 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1305 MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE),
1306 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001307 8500, 51, 1122000, 8500,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001308 },
1309
1310 {
1311 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1312 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, MAX, ACTIVE),
1313 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001314 9000, 51, 1130300, 9000,
1315 },
1316 {
1317 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1318 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, ACTIVE, RET_HIGH),
1319 false,
1320 10000, 51, 1130300, 10000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001321 },
1322
1323 {
1324 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1325 MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE),
1326 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001327 12000, 14, 2205900, 12000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001328 },
1329
1330 {
1331 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1332 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
1333 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001334 18000, 12, 2364250, 18000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001335 },
1336
1337 {
1338 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1339 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH),
1340 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001341 23500, 10, 2667000, 23500,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001342 },
1343
1344 {
1345 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1346 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
1347 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001348 29700, 5, 2867000, 30000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001349 },
1350};
1351
Oluwafemi Adeyemif5a31422012-03-08 16:58:45 -08001352uint32_t apq8064_rpm_get_swfi_latency(void)
1353{
1354 int i;
1355
1356 for (i = 0; i < ARRAY_SIZE(msm_rpmrs_levels); i++) {
1357 if (msm_rpmrs_levels[i].sleep_mode ==
1358 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)
1359 return msm_rpmrs_levels[i].latency_us;
1360 }
1361
1362 return 0;
1363}
1364
Praveen Chidambaram78499012011-11-01 17:15:17 -06001365static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
1366 .mode = MSM_PM_BOOT_CONFIG_TZ,
1367};
1368
1369static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = {
1370 .levels = &msm_rpmrs_levels[0],
1371 .num_levels = ARRAY_SIZE(msm_rpmrs_levels),
1372 .vdd_mem_levels = {
1373 [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000,
1374 [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000,
1375 [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000,
1376 [MSM_RPMRS_VDD_MEM_MAX] = 1150000,
1377 },
1378 .vdd_dig_levels = {
1379 [MSM_RPMRS_VDD_DIG_RET_LOW] = 500000,
1380 [MSM_RPMRS_VDD_DIG_RET_HIGH] = 750000,
1381 [MSM_RPMRS_VDD_DIG_ACTIVE] = 950000,
1382 [MSM_RPMRS_VDD_DIG_MAX] = 1150000,
1383 },
1384 .vdd_mask = 0x7FFFFF,
1385 .rpmrs_target_id = {
1386 [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK,
1387 [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST,
1388 [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_PM8921_S3_0,
1389 [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_PM8921_S3_1,
1390 [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8921_L24_0,
1391 [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8921_L24_1,
1392 [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL,
1393 },
1394};
1395
1396static struct msm_cpuidle_state msm_cstates[] __initdata = {
1397 {0, 0, "C0", "WFI",
1398 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
1399
1400 {0, 1, "C1", "STANDALONE_POWER_COLLAPSE",
1401 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
1402
1403 {0, 2, "C2", "POWER_COLLAPSE",
1404 MSM_PM_SLEEP_MODE_POWER_COLLAPSE},
1405
1406 {1, 0, "C0", "WFI",
1407 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
1408
1409 {1, 1, "C1", "STANDALONE_POWER_COLLAPSE",
1410 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
1411
1412 {2, 0, "C0", "WFI",
1413 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
1414
1415 {2, 1, "C1", "STANDALONE_POWER_COLLAPSE",
1416 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
1417
1418 {3, 0, "C0", "WFI",
1419 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
1420
1421 {3, 1, "C1", "STANDALONE_POWER_COLLAPSE",
1422 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
1423};
1424
1425static struct msm_pm_platform_data msm_pm_data[] = {
1426 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
1427 .idle_supported = 1,
1428 .suspend_supported = 1,
1429 .idle_enabled = 0,
1430 .suspend_enabled = 0,
1431 },
1432
1433 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
1434 .idle_supported = 1,
1435 .suspend_supported = 1,
1436 .idle_enabled = 0,
1437 .suspend_enabled = 0,
1438 },
1439
1440 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
1441 .idle_supported = 1,
1442 .suspend_supported = 1,
1443 .idle_enabled = 1,
1444 .suspend_enabled = 1,
1445 },
1446
1447 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
1448 .idle_supported = 0,
1449 .suspend_supported = 1,
1450 .idle_enabled = 0,
1451 .suspend_enabled = 0,
1452 },
1453
1454 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
1455 .idle_supported = 1,
1456 .suspend_supported = 1,
1457 .idle_enabled = 0,
1458 .suspend_enabled = 0,
1459 },
1460
1461 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
1462 .idle_supported = 1,
1463 .suspend_supported = 0,
1464 .idle_enabled = 1,
1465 .suspend_enabled = 0,
1466 },
1467
1468 [MSM_PM_MODE(2, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
1469 .idle_supported = 0,
1470 .suspend_supported = 1,
1471 .idle_enabled = 0,
1472 .suspend_enabled = 0,
1473 },
1474
1475 [MSM_PM_MODE(2, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
1476 .idle_supported = 1,
1477 .suspend_supported = 1,
1478 .idle_enabled = 0,
1479 .suspend_enabled = 0,
1480 },
1481
1482 [MSM_PM_MODE(2, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
1483 .idle_supported = 1,
1484 .suspend_supported = 0,
1485 .idle_enabled = 1,
1486 .suspend_enabled = 0,
1487 },
1488
1489 [MSM_PM_MODE(3, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
1490 .idle_supported = 0,
1491 .suspend_supported = 1,
1492 .idle_enabled = 0,
1493 .suspend_enabled = 0,
1494 },
1495
1496 [MSM_PM_MODE(3, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
1497 .idle_supported = 1,
1498 .suspend_supported = 1,
1499 .idle_enabled = 0,
1500 .suspend_enabled = 0,
1501 },
1502
1503 [MSM_PM_MODE(3, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
1504 .idle_supported = 1,
1505 .suspend_supported = 0,
1506 .idle_enabled = 1,
1507 .suspend_enabled = 0,
1508 },
1509};
1510
1511static uint8_t spm_wfi_cmd_sequence[] __initdata = {
1512 0x03, 0x0f,
1513};
1514
1515static uint8_t spm_power_collapse_without_rpm[] __initdata = {
1516 0x00, 0x24, 0x54, 0x10,
1517 0x09, 0x03, 0x01,
1518 0x10, 0x54, 0x30, 0x0C,
1519 0x24, 0x30, 0x0f,
1520};
1521
1522static uint8_t spm_power_collapse_with_rpm[] __initdata = {
1523 0x00, 0x24, 0x54, 0x10,
1524 0x09, 0x07, 0x01, 0x0B,
1525 0x10, 0x54, 0x30, 0x0C,
1526 0x24, 0x30, 0x0f,
1527};
1528
1529static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
1530 [0] = {
1531 .mode = MSM_SPM_MODE_CLOCK_GATING,
1532 .notify_rpm = false,
1533 .cmd = spm_wfi_cmd_sequence,
1534 },
1535 [1] = {
1536 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1537 .notify_rpm = false,
1538 .cmd = spm_power_collapse_without_rpm,
1539 },
1540 [2] = {
1541 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1542 .notify_rpm = true,
1543 .cmd = spm_power_collapse_with_rpm,
1544 },
1545};
1546
1547static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = {
1548 0x00, 0x20, 0x03, 0x20,
1549 0x00, 0x0f,
1550};
1551
1552static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = {
1553 0x00, 0x20, 0x34, 0x64,
1554 0x48, 0x07, 0x48, 0x20,
1555 0x50, 0x64, 0x04, 0x34,
1556 0x50, 0x0f,
1557};
1558static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = {
1559 0x00, 0x10, 0x34, 0x64,
1560 0x48, 0x07, 0x48, 0x10,
1561 0x50, 0x64, 0x04, 0x34,
1562 0x50, 0x0F,
1563};
1564
1565static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = {
1566 [0] = {
1567 .mode = MSM_SPM_L2_MODE_RETENTION,
1568 .notify_rpm = false,
1569 .cmd = l2_spm_wfi_cmd_sequence,
1570 },
1571 [1] = {
1572 .mode = MSM_SPM_L2_MODE_GDHS,
1573 .notify_rpm = true,
1574 .cmd = l2_spm_gdhs_cmd_sequence,
1575 },
1576 [2] = {
1577 .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE,
1578 .notify_rpm = true,
1579 .cmd = l2_spm_power_off_cmd_sequence,
1580 },
1581};
1582
1583
1584static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = {
1585 [0] = {
1586 .reg_base_addr = MSM_SAW_L2_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001587 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001588 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001589 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE,
1590 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020,
1591 .modes = msm_spm_l2_seq_list,
1592 .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list),
1593 },
1594};
1595
1596static struct msm_spm_platform_data msm_spm_data[] __initdata = {
1597 [0] = {
1598 .reg_base_addr = MSM_SAW0_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001599 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001600#if defined(CONFIG_MSM_AVS_HW)
1601 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1602 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1603#endif
1604 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001605 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001606 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1607 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1608 .vctl_timeout_us = 50,
1609 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1610 .modes = msm_spm_seq_list,
1611 },
1612 [1] = {
1613 .reg_base_addr = MSM_SAW1_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001614 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001615#if defined(CONFIG_MSM_AVS_HW)
1616 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1617 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1618#endif
1619 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001620 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001621 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1622 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1623 .vctl_timeout_us = 50,
1624 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1625 .modes = msm_spm_seq_list,
1626 },
1627 [2] = {
1628 .reg_base_addr = MSM_SAW2_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001629 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001630#if defined(CONFIG_MSM_AVS_HW)
1631 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1632 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1633#endif
1634 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001635 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001636 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1637 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1638 .vctl_timeout_us = 50,
1639 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1640 .modes = msm_spm_seq_list,
1641 },
1642 [3] = {
1643 .reg_base_addr = MSM_SAW3_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001644 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001645#if defined(CONFIG_MSM_AVS_HW)
1646 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1647 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1648#endif
1649 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001650 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001651 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1652 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1653 .vctl_timeout_us = 50,
1654 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1655 .modes = msm_spm_seq_list,
Jay Chokshi7805b5a2011-11-07 15:55:30 -08001656 },
1657};
1658
Gagan Mac8a7a5d32011-11-11 16:43:06 -07001659static void __init apq8064_init_buses(void)
1660{
1661 msm_bus_rpm_set_mt_mask();
1662 msm_bus_8064_apps_fabric_pdata.rpm_enabled = 1;
1663 msm_bus_8064_sys_fabric_pdata.rpm_enabled = 1;
1664 msm_bus_8064_mm_fabric_pdata.rpm_enabled = 1;
1665 msm_bus_8064_apps_fabric.dev.platform_data =
1666 &msm_bus_8064_apps_fabric_pdata;
1667 msm_bus_8064_sys_fabric.dev.platform_data =
1668 &msm_bus_8064_sys_fabric_pdata;
1669 msm_bus_8064_mm_fabric.dev.platform_data =
1670 &msm_bus_8064_mm_fabric_pdata;
1671 msm_bus_8064_sys_fpb.dev.platform_data = &msm_bus_8064_sys_fpb_pdata;
1672 msm_bus_8064_cpss_fpb.dev.platform_data = &msm_bus_8064_cpss_fpb_pdata;
1673}
1674
David Collinsf0d00732012-01-25 15:46:50 -08001675static struct platform_device apq8064_device_ext_5v_vreg __devinitdata = {
1676 .name = GPIO_REGULATOR_DEV_NAME,
1677 .id = PM8921_MPP_PM_TO_SYS(7),
1678 .dev = {
1679 .platform_data
1680 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V],
1681 },
1682};
1683
Jay Chokshi1de4f9d2012-02-07 16:11:31 -08001684static struct platform_device apq8064_device_ext_mpp8_vreg __devinitdata = {
1685 .name = GPIO_REGULATOR_DEV_NAME,
1686 .id = PM8921_MPP_PM_TO_SYS(8),
1687 .dev = {
1688 .platform_data
1689 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_MPP8],
1690 },
1691};
1692
David Collinsf0d00732012-01-25 15:46:50 -08001693static struct platform_device apq8064_device_ext_3p3v_vreg __devinitdata = {
1694 .name = GPIO_REGULATOR_DEV_NAME,
1695 .id = APQ8064_EXT_3P3V_REG_EN_GPIO,
1696 .dev = {
1697 .platform_data =
1698 &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V],
1699 },
1700};
1701
David Collins390fc332012-02-07 14:38:16 -08001702static struct platform_device apq8064_device_ext_ts_sw_vreg __devinitdata = {
1703 .name = GPIO_REGULATOR_DEV_NAME,
1704 .id = PM8921_GPIO_PM_TO_SYS(23),
1705 .dev = {
1706 .platform_data
1707 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_TS_SW],
1708 },
1709};
1710
David Collins2782b5c2012-02-06 10:02:42 -08001711static struct platform_device apq8064_device_rpm_regulator __devinitdata = {
1712 .name = "rpm-regulator",
1713 .id = -1,
1714 .dev = {
1715 .platform_data = &apq8064_rpm_regulator_pdata,
1716 },
1717};
1718
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001719static struct platform_device *common_devices[] __initdata = {
Jin Hong01f2dbb2011-11-03 22:13:51 -07001720 &apq8064_device_dmov,
David Keitel3c40fc52012-02-09 17:53:52 -08001721 &apq8064_device_qup_i2c_gsbi1,
Jing Lin04601f92012-02-05 15:36:07 -08001722 &apq8064_device_qup_i2c_gsbi3,
Kenneth Heitke748593a2011-07-15 15:45:11 -06001723 &apq8064_device_qup_i2c_gsbi4,
Harini Jayaramanc4c58692011-07-19 14:50:10 -06001724 &apq8064_device_qup_spi_gsbi5,
David Collinsf0d00732012-01-25 15:46:50 -08001725 &apq8064_device_ext_5v_vreg,
Jay Chokshi1de4f9d2012-02-07 16:11:31 -08001726 &apq8064_device_ext_mpp8_vreg,
David Collinsf0d00732012-01-25 15:46:50 -08001727 &apq8064_device_ext_3p3v_vreg,
David Collins390fc332012-02-07 14:38:16 -08001728 &apq8064_device_ext_ts_sw_vreg,
Jay Chokshi9c25f072011-09-23 18:19:15 -07001729 &apq8064_device_ssbi_pmic1,
1730 &apq8064_device_ssbi_pmic2,
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001731 &msm_device_smd_apq8064,
Hemant Kumar4933b072011-10-17 23:43:11 -07001732 &apq8064_device_otg,
1733 &apq8064_device_gadget_peripheral,
Hemant Kumard86c4882012-01-24 19:39:37 -08001734 &apq8064_device_hsusb_host,
Hemant Kumar4933b072011-10-17 23:43:11 -07001735 &android_usb_device,
Ankit Verma6b7e2ba2012-01-26 15:48:54 -08001736 &msm_device_wcnss_wlan,
Ankit Vermab7c26e62012-02-28 15:04:15 -08001737 &msm_device_iris_fm,
Olav Haugan7c6aa742012-01-16 16:47:37 -08001738#ifdef CONFIG_ANDROID_PMEM
1739#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -07001740 &android_pmem_device,
1741 &android_pmem_adsp_device,
Olav Haugan7c6aa742012-01-16 16:47:37 -08001742#endif
Kevin Chan13be4e22011-10-20 11:30:32 -07001743 &android_pmem_audio_device,
Olav Haugan7c6aa742012-01-16 16:47:37 -08001744#endif
1745#ifdef CONFIG_ION_MSM
1746 &ion_dev,
1747#endif
Jeff Ohlstein7e668552011-10-06 16:17:25 -07001748 &msm8064_device_watchdog,
Jay Chokshi7805b5a2011-11-07 15:55:30 -08001749 &msm8064_device_saw_regulator_core0,
1750 &msm8064_device_saw_regulator_core1,
1751 &msm8064_device_saw_regulator_core2,
1752 &msm8064_device_saw_regulator_core3,
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001753#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1754 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1755 &qcrypto_device,
1756#endif
1757
1758#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1759 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1760 &qcedev_device,
1761#endif
Ramesh Masavarapuf46be1b2011-11-03 11:13:41 -07001762
1763#ifdef CONFIG_HW_RANDOM_MSM
1764 &apq8064_device_rng,
1765#endif
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -08001766 &apq_pcm,
1767 &apq_pcm_routing,
1768 &apq_cpudai0,
1769 &apq_cpudai1,
1770 &apq_cpudai_hdmi_rx,
1771 &apq_cpudai_bt_rx,
1772 &apq_cpudai_bt_tx,
1773 &apq_cpudai_fm_rx,
1774 &apq_cpudai_fm_tx,
1775 &apq_cpu_fe,
1776 &apq_stub_codec,
1777 &apq_voice,
1778 &apq_voip,
1779 &apq_lpa_pcm,
1780 &apq_pcm_hostless,
1781 &apq_cpudai_afe_01_rx,
1782 &apq_cpudai_afe_01_tx,
1783 &apq_cpudai_afe_02_rx,
1784 &apq_cpudai_afe_02_tx,
1785 &apq_pcm_afe,
1786 &apq_cpudai_auxpcm_rx,
1787 &apq_cpudai_auxpcm_tx,
Neema Shetty8427c262012-02-16 11:23:43 -08001788 &apq_cpudai_stub,
Neema Shetty3c9d2862012-03-11 01:25:32 -08001789 &apq_cpudai_slimbus_1_rx,
1790 &apq_cpudai_slimbus_1_tx,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001791 &apq8064_rpm_device,
1792 &apq8064_rpm_log_device,
1793 &apq8064_rpm_stat_device,
Gagan Mac8a7a5d32011-11-11 16:43:06 -07001794 &msm_bus_8064_apps_fabric,
1795 &msm_bus_8064_sys_fabric,
1796 &msm_bus_8064_mm_fabric,
1797 &msm_bus_8064_sys_fpb,
1798 &msm_bus_8064_cpss_fpb,
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08001799 &apq8064_msm_device_vidc,
Matt Wagantalled832652012-02-02 19:23:17 -08001800 &msm_8960_riva,
Matt Wagantallb94b9a52012-02-02 21:59:54 -08001801 &msm_8960_q6_lpass,
Matt Wagantall292aace2012-01-26 19:12:34 -08001802 &msm_gss,
Laura Abbott350c8362012-02-28 14:46:52 -08001803#ifdef CONFIG_MSM_RTB
1804 &msm_rtb_device,
1805#endif
Praveen Chidambaram8ea3dcd2011-12-07 14:46:31 -07001806 &apq8064_cpu_idle_device,
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07001807 &apq8064_msm_gov_device,
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08001808 &apq8064_device_cache_erp,
Harini Jayaramanc4c58692011-07-19 14:50:10 -06001809};
1810
Joel King4e7ad222011-08-17 15:47:38 -07001811static struct platform_device *sim_devices[] __initdata = {
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07001812 &apq8064_device_uart_gsbi3,
Yan He06913ce2011-08-26 16:33:46 -07001813 &msm_device_sps_apq8064,
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07001814};
1815
1816static struct platform_device *rumi3_devices[] __initdata = {
1817 &apq8064_device_uart_gsbi1,
Yan He435ed612011-11-23 17:34:59 -08001818 &msm_device_sps_apq8064,
Huaibin Yang4a084e32011-12-15 15:25:52 -08001819#ifdef CONFIG_MSM_ROTATOR
1820 &msm_rotator_device,
1821#endif
Joel King4e7ad222011-08-17 15:47:38 -07001822};
1823
Joel King82b7e3f2012-01-05 10:03:27 -08001824static struct platform_device *cdp_devices[] __initdata = {
1825 &apq8064_device_uart_gsbi1,
Jin Hong4bbbfba2012-02-02 21:48:07 -08001826 &apq8064_device_uart_gsbi7,
Joel King82b7e3f2012-01-05 10:03:27 -08001827 &msm_device_sps_apq8064,
Aravind Venkateswaran4ca27532012-02-16 14:27:05 -08001828#ifdef CONFIG_MSM_ROTATOR
1829 &msm_rotator_device,
1830#endif
Joel King82b7e3f2012-01-05 10:03:27 -08001831};
1832
Harini Jayaramanc4c58692011-07-19 14:50:10 -06001833static struct msm_spi_platform_data apq8064_qup_spi_gsbi5_pdata = {
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -08001834 .max_clock_speed = 1100000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001835};
1836
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07001837#define KS8851_IRQ_GPIO 43
1838
1839static struct spi_board_info spi_board_info[] __initdata = {
1840 {
1841 .modalias = "ks8851",
1842 .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
1843 .max_speed_hz = 19200000,
1844 .bus_num = 0,
1845 .chip_select = 2,
1846 .mode = SPI_MODE_0,
1847 },
1848};
1849
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06001850static struct slim_boardinfo apq8064_slim_devices[] = {
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001851 {
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08001852 .bus_num = 1,
1853 .slim_slave = &apq8064_slim_tabla,
1854 },
1855 {
1856 .bus_num = 1,
1857 .slim_slave = &apq8064_slim_tabla20,
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001858 },
1859 /* add more slimbus slaves as needed */
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06001860};
1861
David Keitel3c40fc52012-02-09 17:53:52 -08001862static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi1_pdata = {
1863 .clk_freq = 100000,
1864 .src_clk_rate = 24000000,
1865};
1866
Jing Lin04601f92012-02-05 15:36:07 -08001867static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi3_pdata = {
1868 .clk_freq = 100000,
1869 .src_clk_rate = 24000000,
1870};
1871
Kenneth Heitke748593a2011-07-15 15:45:11 -06001872static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi4_pdata = {
1873 .clk_freq = 100000,
1874 .src_clk_rate = 24000000,
Kenneth Heitke748593a2011-07-15 15:45:11 -06001875};
1876
David Keitel3c40fc52012-02-09 17:53:52 -08001877#define GSBI_DUAL_MODE_CODE 0x60
1878#define MSM_GSBI1_PHYS 0x12440000
Kenneth Heitke748593a2011-07-15 15:45:11 -06001879static void __init apq8064_i2c_init(void)
1880{
David Keitel3c40fc52012-02-09 17:53:52 -08001881 void __iomem *gsbi_mem;
1882
1883 apq8064_device_qup_i2c_gsbi1.dev.platform_data =
1884 &apq8064_i2c_qup_gsbi1_pdata;
1885 gsbi_mem = ioremap_nocache(MSM_GSBI1_PHYS, 4);
1886 writel_relaxed(GSBI_DUAL_MODE_CODE, gsbi_mem);
1887 /* Ensure protocol code is written before proceeding */
1888 wmb();
1889 iounmap(gsbi_mem);
1890 apq8064_i2c_qup_gsbi1_pdata.use_gsbi_shared_mode = 1;
Jing Lin04601f92012-02-05 15:36:07 -08001891 apq8064_device_qup_i2c_gsbi3.dev.platform_data =
1892 &apq8064_i2c_qup_gsbi3_pdata;
Kenneth Heitke748593a2011-07-15 15:45:11 -06001893 apq8064_device_qup_i2c_gsbi4.dev.platform_data =
1894 &apq8064_i2c_qup_gsbi4_pdata;
1895}
1896
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -08001897#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07001898static int ethernet_init(void)
1899{
1900 int ret;
1901 ret = gpio_request(KS8851_IRQ_GPIO, "ks8851_irq");
1902 if (ret) {
1903 pr_err("ks8851 gpio_request failed: %d\n", ret);
1904 goto fail;
1905 }
1906
1907 return 0;
1908fail:
1909 return ret;
1910}
1911#else
1912static int ethernet_init(void)
1913{
1914 return 0;
1915}
1916#endif
1917
Mohan Pallaka474b94b2012-01-25 12:59:58 +05301918#define GPIO_KEY_HOME PM8921_GPIO_PM_TO_SYS(27)
1919#define GPIO_KEY_VOLUME_UP PM8921_GPIO_PM_TO_SYS(35)
1920#define GPIO_KEY_VOLUME_DOWN PM8921_GPIO_PM_TO_SYS(38)
1921#define GPIO_KEY_CAM_FOCUS PM8921_GPIO_PM_TO_SYS(3)
1922#define GPIO_KEY_CAM_SNAP PM8921_GPIO_PM_TO_SYS(4)
Jing Lin3f8f8422012-03-05 09:32:11 -08001923#define GPIO_KEY_ROTATION PM8921_GPIO_PM_TO_SYS(42)
Mohan Pallaka474b94b2012-01-25 12:59:58 +05301924
1925static struct gpio_keys_button cdp_keys[] = {
1926 {
1927 .code = KEY_HOME,
1928 .gpio = GPIO_KEY_HOME,
1929 .desc = "home_key",
1930 .active_low = 1,
1931 .type = EV_KEY,
1932 .wakeup = 1,
1933 .debounce_interval = 15,
1934 },
1935 {
1936 .code = KEY_VOLUMEUP,
1937 .gpio = GPIO_KEY_VOLUME_UP,
1938 .desc = "volume_up_key",
1939 .active_low = 1,
1940 .type = EV_KEY,
1941 .wakeup = 1,
1942 .debounce_interval = 15,
1943 },
1944 {
1945 .code = KEY_VOLUMEDOWN,
1946 .gpio = GPIO_KEY_VOLUME_DOWN,
1947 .desc = "volume_down_key",
1948 .active_low = 1,
1949 .type = EV_KEY,
1950 .wakeup = 1,
1951 .debounce_interval = 15,
1952 },
1953 {
1954 .code = SW_ROTATE_LOCK,
1955 .gpio = GPIO_KEY_ROTATION,
1956 .desc = "rotate_key",
1957 .active_low = 1,
1958 .type = EV_SW,
1959 .debounce_interval = 15,
1960 },
1961};
1962
1963static struct gpio_keys_platform_data cdp_keys_data = {
1964 .buttons = cdp_keys,
1965 .nbuttons = ARRAY_SIZE(cdp_keys),
1966};
1967
1968static struct platform_device cdp_kp_pdev = {
1969 .name = "gpio-keys",
1970 .id = -1,
1971 .dev = {
1972 .platform_data = &cdp_keys_data,
1973 },
1974};
1975
1976static struct gpio_keys_button mtp_keys[] = {
1977 {
1978 .code = KEY_CAMERA_FOCUS,
1979 .gpio = GPIO_KEY_CAM_FOCUS,
1980 .desc = "cam_focus_key",
1981 .active_low = 1,
1982 .type = EV_KEY,
1983 .wakeup = 1,
1984 .debounce_interval = 15,
1985 },
1986 {
1987 .code = KEY_VOLUMEUP,
1988 .gpio = GPIO_KEY_VOLUME_UP,
1989 .desc = "volume_up_key",
1990 .active_low = 1,
1991 .type = EV_KEY,
1992 .wakeup = 1,
1993 .debounce_interval = 15,
1994 },
1995 {
1996 .code = KEY_VOLUMEDOWN,
1997 .gpio = GPIO_KEY_VOLUME_DOWN,
1998 .desc = "volume_down_key",
1999 .active_low = 1,
2000 .type = EV_KEY,
2001 .wakeup = 1,
2002 .debounce_interval = 15,
2003 },
2004 {
2005 .code = KEY_CAMERA_SNAPSHOT,
2006 .gpio = GPIO_KEY_CAM_SNAP,
2007 .desc = "cam_snap_key",
2008 .active_low = 1,
2009 .type = EV_KEY,
2010 .debounce_interval = 15,
2011 },
2012};
2013
2014static struct gpio_keys_platform_data mtp_keys_data = {
2015 .buttons = mtp_keys,
2016 .nbuttons = ARRAY_SIZE(mtp_keys),
2017};
2018
2019static struct platform_device mtp_kp_pdev = {
2020 .name = "gpio-keys",
2021 .id = -1,
2022 .dev = {
2023 .platform_data = &mtp_keys_data,
2024 },
2025};
2026
Jin Hongd3024e62012-02-09 16:13:32 -08002027/* Sensors DSPS platform data */
2028#define DSPS_PIL_GENERIC_NAME "dsps"
2029static void __init apq8064_init_dsps(void)
2030{
2031 struct msm_dsps_platform_data *pdata =
2032 msm_dsps_device_8064.dev.platform_data;
2033 pdata->pil_name = DSPS_PIL_GENERIC_NAME;
2034 pdata->gpios = NULL;
2035 pdata->gpios_num = 0;
2036
2037 platform_device_register(&msm_dsps_device_8064);
2038}
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302039
Tianyi Gou41515e22011-09-01 19:37:43 -07002040static void __init apq8064_clock_init(void)
2041{
Tianyi Gouacb588d2012-01-27 18:24:05 -08002042 if (machine_is_apq8064_rumi3())
Tianyi Gou41515e22011-09-01 19:37:43 -07002043 msm_clock_init(&apq8064_dummy_clock_init_data);
Tianyi Gouacb588d2012-01-27 18:24:05 -08002044 else
2045 msm_clock_init(&apq8064_clock_init_data);
Tianyi Gou41515e22011-09-01 19:37:43 -07002046}
2047
Jing Lin417fa452012-02-05 14:31:06 -08002048#define I2C_SURF 1
2049#define I2C_FFA (1 << 1)
2050#define I2C_RUMI (1 << 2)
2051#define I2C_SIM (1 << 3)
2052#define I2C_LIQUID (1 << 4)
2053
2054struct i2c_registry {
2055 u8 machs;
2056 int bus;
2057 struct i2c_board_info *info;
2058 int len;
2059};
2060
2061static struct i2c_registry apq8064_i2c_devices[] __initdata = {
Jing Lin21ed4de2012-02-05 15:53:28 -08002062 {
David Keitel2f613d92012-02-15 11:29:16 -08002063 I2C_LIQUID,
2064 APQ_8064_GSBI1_QUP_I2C_BUS_ID,
2065 smb349_charger_i2c_info,
2066 ARRAY_SIZE(smb349_charger_i2c_info)
2067 },
2068 {
Jing Lin21ed4de2012-02-05 15:53:28 -08002069 I2C_SURF | I2C_LIQUID,
2070 APQ_8064_GSBI3_QUP_I2C_BUS_ID,
2071 mxt_device_info,
2072 ARRAY_SIZE(mxt_device_info),
2073 },
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08002074 {
2075 I2C_FFA,
2076 APQ_8064_GSBI3_QUP_I2C_BUS_ID,
2077 cyttsp_info,
2078 ARRAY_SIZE(cyttsp_info),
2079 },
Amy Maloche70090f992012-02-16 16:35:26 -08002080 {
2081 I2C_FFA | I2C_LIQUID,
2082 APQ_8064_GSBI1_QUP_I2C_BUS_ID,
2083 isa1200_board_info,
2084 ARRAY_SIZE(isa1200_board_info),
2085 },
Jing Lin417fa452012-02-05 14:31:06 -08002086};
2087
2088static void __init register_i2c_devices(void)
2089{
2090 u8 mach_mask = 0;
2091 int i;
2092
Kevin Chand07220e2012-02-13 15:52:22 -08002093#ifdef CONFIG_MSM_CAMERA
2094 struct i2c_registry apq8064_camera_i2c_devices = {
2095 I2C_SURF | I2C_FFA | I2C_LIQUID | I2C_RUMI,
2096 APQ_8064_GSBI4_QUP_I2C_BUS_ID,
2097 apq8064_camera_board_info.board_info,
2098 apq8064_camera_board_info.num_i2c_board_info,
2099 };
2100#endif
Jing Lin417fa452012-02-05 14:31:06 -08002101 /* Build the matching 'supported_machs' bitmask */
2102 if (machine_is_apq8064_cdp())
2103 mach_mask = I2C_SURF;
2104 else if (machine_is_apq8064_mtp())
2105 mach_mask = I2C_FFA;
2106 else if (machine_is_apq8064_liquid())
2107 mach_mask = I2C_LIQUID;
2108 else if (machine_is_apq8064_rumi3())
2109 mach_mask = I2C_RUMI;
2110 else if (machine_is_apq8064_sim())
2111 mach_mask = I2C_SIM;
2112 else
2113 pr_err("unmatched machine ID in register_i2c_devices\n");
2114
2115 /* Run the array and install devices as appropriate */
2116 for (i = 0; i < ARRAY_SIZE(apq8064_i2c_devices); ++i) {
2117 if (apq8064_i2c_devices[i].machs & mach_mask)
2118 i2c_register_board_info(apq8064_i2c_devices[i].bus,
2119 apq8064_i2c_devices[i].info,
2120 apq8064_i2c_devices[i].len);
2121 }
Kevin Chand07220e2012-02-13 15:52:22 -08002122#ifdef CONFIG_MSM_CAMERA
2123 if (apq8064_camera_i2c_devices.machs & mach_mask)
2124 i2c_register_board_info(apq8064_camera_i2c_devices.bus,
2125 apq8064_camera_i2c_devices.info,
2126 apq8064_camera_i2c_devices.len);
2127#endif
Jing Lin417fa452012-02-05 14:31:06 -08002128}
2129
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002130static void __init apq8064_common_init(void)
2131{
2132 if (socinfo_init() < 0)
2133 pr_err("socinfo_init() failed!\n");
Praveen Chidambaram78499012011-11-01 17:15:17 -06002134 BUG_ON(msm_rpm_init(&apq8064_rpm_data));
2135 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
David Collins2782b5c2012-02-06 10:02:42 -08002136 regulator_suppress_info_printing();
2137 platform_device_register(&apq8064_device_rpm_regulator);
Stephen Boyd4d0d2582012-02-10 14:49:40 -08002138 if (msm_xo_init())
2139 pr_err("Failed to initialize XO votes\n");
Tianyi Gou41515e22011-09-01 19:37:43 -07002140 apq8064_clock_init();
Stepan Moskovchenko2327a952011-12-14 16:31:28 -08002141 apq8064_init_gpiomux();
Kenneth Heitke748593a2011-07-15 15:45:11 -06002142 apq8064_i2c_init();
Jing Lin417fa452012-02-05 14:31:06 -08002143 register_i2c_devices();
Kenneth Heitke36920d32011-07-20 16:44:30 -06002144
Harini Jayaramanc4c58692011-07-19 14:50:10 -06002145 apq8064_device_qup_spi_gsbi5.dev.platform_data =
2146 &apq8064_qup_spi_gsbi5_pdata;
Stepan Moskovchenkoc1074f02011-12-14 17:51:57 -08002147 apq8064_init_pmic();
Hemant Kumar94e7da22012-02-03 16:52:29 -08002148 if (machine_is_apq8064_liquid())
2149 msm_otg_pdata.mhl_enable = true;
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002150 apq8064_device_otg.dev.platform_data = &msm_otg_pdata;
Manu Gautam91223e02011-11-08 15:27:22 +05302151 apq8064_ehci_host_init();
Gagan Mac8a7a5d32011-11-11 16:43:06 -07002152 apq8064_init_buses();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002153 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Hemant Kumarf1ca9192012-02-07 18:59:33 -08002154 if (machine_is_apq8064_mtp()) {
2155 apq8064_device_hsic_host.dev.platform_data = &msm_hsic_pdata;
2156 device_initialize(&apq8064_device_hsic_host.dev);
2157 }
Jay Chokshie8741282012-01-25 15:22:55 -08002158 apq8064_pm8xxx_gpio_mpp_init();
Sahitya Tummala3586ed92011-08-03 09:13:23 +05302159 apq8064_init_mmc();
Swaminathan Sathappan144b4882012-02-06 17:01:20 -08002160
2161 if (machine_is_apq8064_mtp()) {
2162 mdm_8064_device.dev.platform_data = &mdm_platform_data;
2163 platform_device_register(&mdm_8064_device);
2164 }
2165 platform_device_register(&apq8064_slim_ctrl);
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06002166 slim_register_board_info(apq8064_slim_devices,
2167 ARRAY_SIZE(apq8064_slim_devices));
Jin Hongd3024e62012-02-09 16:13:32 -08002168 apq8064_init_dsps();
Praveen Chidambaram78499012011-11-01 17:15:17 -06002169 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
Mahesh Sivasubramaniancbce1ec2012-01-24 10:32:44 -07002170 acpuclk_init(&acpuclk_8064_soc_data);
Praveen Chidambaram78499012011-11-01 17:15:17 -06002171 msm_spm_l2_init(msm_spm_l2_data);
2172 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
2173 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
2174 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
2175 msm_pm_data);
2176 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002177}
2178
Huaibin Yang4a084e32011-12-15 15:25:52 -08002179static void __init apq8064_allocate_memory_regions(void)
2180{
2181 apq8064_allocate_fb_region();
2182}
2183
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002184static void __init apq8064_sim_init(void)
2185{
Jeff Ohlstein7e668552011-10-06 16:17:25 -07002186 struct msm_watchdog_pdata *wdog_pdata = (struct msm_watchdog_pdata *)
2187 &msm8064_device_watchdog.dev.platform_data;
2188
2189 wdog_pdata->bark_time = 15000;
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -08002190 msm_tsens_early_init(&apq_tsens_pdata);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002191 apq8064_common_init();
Joel King4e7ad222011-08-17 15:47:38 -07002192 platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices));
2193}
2194
2195static void __init apq8064_rumi3_init(void)
2196{
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -08002197 msm_tsens_early_init(&apq_tsens_pdata);
Joel King4e7ad222011-08-17 15:47:38 -07002198 apq8064_common_init();
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002199 ethernet_init();
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07002200 platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002201 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
Huaibin Yang4a084e32011-12-15 15:25:52 -08002202 apq8064_init_fb();
Jordan Crouseb3115fe2012-02-01 22:11:12 -07002203 apq8064_init_gpu();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002204}
2205
Joel King82b7e3f2012-01-05 10:03:27 -08002206static void __init apq8064_cdp_init(void)
2207{
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -08002208 msm_tsens_early_init(&apq_tsens_pdata);
Joel King82b7e3f2012-01-05 10:03:27 -08002209 apq8064_common_init();
2210 ethernet_init();
2211 platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
2212 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002213 apq8064_init_fb();
Jordan Crouseb3115fe2012-02-01 22:11:12 -07002214 apq8064_init_gpu();
Matt Wagantall1875d322012-02-22 16:11:33 -08002215 platform_add_devices(apq8064_fs_devices, apq8064_num_fs_devices);
Kevin Chand07220e2012-02-13 15:52:22 -08002216 apq8064_init_cam();
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302217
2218 if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
2219 platform_device_register(&cdp_kp_pdev);
2220
2221 if (machine_is_apq8064_mtp())
2222 platform_device_register(&mtp_kp_pdev);
Joel King82b7e3f2012-01-05 10:03:27 -08002223}
2224
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002225MACHINE_START(APQ8064_SIM, "QCT APQ8064 SIMULATOR")
2226 .map_io = apq8064_map_io,
Kevin Chan13be4e22011-10-20 11:30:32 -07002227 .reserve = apq8064_reserve,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002228 .init_irq = apq8064_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302229 .handle_irq = gic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002230 .timer = &msm_timer,
2231 .init_machine = apq8064_sim_init,
2232MACHINE_END
2233
Joel King4e7ad222011-08-17 15:47:38 -07002234MACHINE_START(APQ8064_RUMI3, "QCT APQ8064 RUMI3")
2235 .map_io = apq8064_map_io,
Kevin Chan13be4e22011-10-20 11:30:32 -07002236 .reserve = apq8064_reserve,
Joel King4e7ad222011-08-17 15:47:38 -07002237 .init_irq = apq8064_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302238 .handle_irq = gic_handle_irq,
Joel King4e7ad222011-08-17 15:47:38 -07002239 .timer = &msm_timer,
2240 .init_machine = apq8064_rumi3_init,
Huaibin Yang4a084e32011-12-15 15:25:52 -08002241 .init_early = apq8064_allocate_memory_regions,
Joel King4e7ad222011-08-17 15:47:38 -07002242MACHINE_END
2243
Joel King82b7e3f2012-01-05 10:03:27 -08002244MACHINE_START(APQ8064_CDP, "QCT APQ8064 CDP")
2245 .map_io = apq8064_map_io,
2246 .reserve = apq8064_reserve,
2247 .init_irq = apq8064_init_irq,
2248 .handle_irq = gic_handle_irq,
2249 .timer = &msm_timer,
2250 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002251 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07002252 .init_very_early = apq8064_early_reserve,
Joel King82b7e3f2012-01-05 10:03:27 -08002253MACHINE_END
2254
2255MACHINE_START(APQ8064_MTP, "QCT APQ8064 MTP")
2256 .map_io = apq8064_map_io,
2257 .reserve = apq8064_reserve,
2258 .init_irq = apq8064_init_irq,
2259 .handle_irq = gic_handle_irq,
2260 .timer = &msm_timer,
2261 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002262 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07002263 .init_very_early = apq8064_early_reserve,
Joel King82b7e3f2012-01-05 10:03:27 -08002264MACHINE_END
2265
2266MACHINE_START(APQ8064_LIQUID, "QCT APQ8064 LIQUID")
2267 .map_io = apq8064_map_io,
2268 .reserve = apq8064_reserve,
2269 .init_irq = apq8064_init_irq,
2270 .handle_irq = gic_handle_irq,
2271 .timer = &msm_timer,
2272 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002273 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07002274 .init_very_early = apq8064_early_reserve,
Joel King82b7e3f2012-01-05 10:03:27 -08002275MACHINE_END
2276
Joel King11ca8202012-02-13 16:19:03 -08002277MACHINE_START(MPQ8064_HRD, "QCT MPQ8064 HRD")
2278 .map_io = apq8064_map_io,
2279 .reserve = apq8064_reserve,
2280 .init_irq = apq8064_init_irq,
2281 .handle_irq = gic_handle_irq,
2282 .timer = &msm_timer,
2283 .init_machine = apq8064_cdp_init,
Laura Abbott6988cef2012-03-15 14:27:13 -07002284 .init_very_early = apq8064_early_reserve,
Joel King11ca8202012-02-13 16:19:03 -08002285MACHINE_END
2286
2287MACHINE_START(MPQ8064_DTV, "QCT MPQ8064 DTV")
2288 .map_io = apq8064_map_io,
2289 .reserve = apq8064_reserve,
2290 .init_irq = apq8064_init_irq,
2291 .handle_irq = gic_handle_irq,
2292 .timer = &msm_timer,
2293 .init_machine = apq8064_cdp_init,
Laura Abbott6988cef2012-03-15 14:27:13 -07002294 .init_very_early = apq8064_early_reserve,
Joel King11ca8202012-02-13 16:19:03 -08002295MACHINE_END
2296