blob: 13c98db2d8ef71e1680fdd1ddaa5cfc5c5b166f8 [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>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070035#include <asm/mach-types.h>
36#include <asm/mach/arch.h>
37#include <asm/hardware/gic.h>
Sahitya Tummala3586ed92011-08-03 09:13:23 +053038#include <asm/mach/mmc.h>
Ankit Verma6b7e2ba2012-01-26 15:48:54 -080039#include <linux/platform_data/qcom_wcnss_device.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070040
41#include <mach/board.h>
42#include <mach/msm_iomap.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080043#include <mach/ion.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070044#include <linux/usb/msm_hsusb.h>
45#include <linux/usb/android.h>
46#include <mach/socinfo.h>
Harini Jayaramanc4c58692011-07-19 14:50:10 -060047#include <mach/msm_spi.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070048#include "timer.h"
49#include "devices.h"
Joel King4ebccc62011-07-22 09:43:22 -070050#include <mach/gpio.h>
51#include <mach/gpiomux.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060052#include <mach/rpm.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080053#ifdef CONFIG_ANDROID_PMEM
Kevin Chan13be4e22011-10-20 11:30:32 -070054#include <linux/android_pmem.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080055#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070056#include <mach/msm_memtypes.h>
57#include <linux/bootmem.h>
58#include <asm/setup.h>
Ramesh Masavarapu28311912011-10-27 11:04:12 -070059#include <mach/dma.h>
Jin Hongd3024e62012-02-09 16:13:32 -080060#include <mach/msm_dsps.h>
Gagan Mac8a7a5d32011-11-11 16:43:06 -070061#include <mach/msm_bus_board.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060062#include <mach/cpuidle.h>
Joel Kingdacbc822012-01-25 13:30:57 -080063#include <mach/mdm2.h>
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -080064#include <linux/msm_tsens.h>
Stephen Boyd4d0d2582012-02-10 14:49:40 -080065#include <mach/msm_xo.h>
Laura Abbott350c8362012-02-28 14:46:52 -080066#include <mach/msm_rtb.h>
Joel King4ebccc62011-07-22 09:43:22 -070067
Jeff Ohlstein7e668552011-10-06 16:17:25 -070068#include "msm_watchdog.h"
Stepan Moskovchenko5a83dba2011-12-05 17:30:17 -080069#include "board-8064.h"
Vikram Mulukutlabc2e9572011-11-04 03:41:38 -070070#include "acpuclock.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060071#include "spm.h"
72#include "mpm.h"
73#include "rpm_resources.h"
Matt Wagantall7cca4642012-02-01 16:43:24 -080074#include "pm.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060075#include "pm-boot.h"
Rajesh Sastrulaaee8af32012-01-20 11:46:31 -080076#include "devices-msm8x60.h"
Jay Chokshiea67c622011-07-29 17:12:26 -070077
Olav Haugan7c6aa742012-01-16 16:47:37 -080078#define MSM_PMEM_ADSP_SIZE 0x7800000
Bharath Ramachandramurthy2fd017a2012-03-13 10:21:09 -070079#define MSM_PMEM_AUDIO_SIZE 0x4CF000
Olav Haugan7c6aa742012-01-16 16:47:37 -080080#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
81#define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
82#else
Chetan Kalyan72aac4f2012-02-23 14:56:54 -080083#define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
Olav Haugan7c6aa742012-01-16 16:47:37 -080084#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070085
Olav Haugan7c6aa742012-01-16 16:47:37 -080086#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Bharath Ramachandramurthy2fd017a2012-03-13 10:21:09 -070087#define MSM_PMEM_KERNEL_EBI1_SIZE 0x65000
Olav Haugan7c6aa742012-01-16 16:47:37 -080088#define MSM_ION_SF_SIZE MSM_PMEM_SIZE
Olav Haugand3d29682012-01-19 10:57:07 -080089#define MSM_ION_MM_FW_SIZE 0x200000 /* (2MB) */
Olav Haugan7c6aa742012-01-16 16:47:37 -080090#define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE
Olav Haugan3a9bd232012-02-15 14:23:27 -080091#define MSM_ION_QSECOM_SIZE 0x300000 /* (3MB) */
Olav Haugan7c6aa742012-01-16 16:47:37 -080092#define MSM_ION_MFC_SIZE SZ_8K
Olav Haugan2c43fac2012-01-19 11:06:37 -080093#define MSM_ION_AUDIO_SIZE MSM_PMEM_AUDIO_SIZE
94#define MSM_ION_HEAP_NUM 8
Olav Haugan7c6aa742012-01-16 16:47:37 -080095#else
96#define MSM_PMEM_KERNEL_EBI1_SIZE 0x110C000
97#define MSM_ION_HEAP_NUM 1
98#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070099
Siddartha Mohanadoss9c658982012-02-28 15:11:48 -0800100#define GPIO_EXPANDER_IRQ_BASE (PM8821_IRQ_BASE + PM8821_NR_IRQS)
101#define GPIO_EXPANDER_GPIO_BASE (PM8821_MPP_BASE + PM8821_NR_MPPS)
102#define GPIO_EPM_EXPANDER_BASE GPIO_EXPANDER_GPIO_BASE
103
104enum {
105 SX150X_EPM,
106};
107
Olav Haugan7c6aa742012-01-16 16:47:37 -0800108#ifdef CONFIG_KERNEL_PMEM_EBI_REGION
109static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE;
110static int __init pmem_kernel_ebi1_size_setup(char *p)
Kevin Chan13be4e22011-10-20 11:30:32 -0700111{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800112 pmem_kernel_ebi1_size = memparse(p, NULL);
113 return 0;
Kevin Chan13be4e22011-10-20 11:30:32 -0700114}
Olav Haugan7c6aa742012-01-16 16:47:37 -0800115early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup);
116#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700117
Olav Haugan7c6aa742012-01-16 16:47:37 -0800118#ifdef CONFIG_ANDROID_PMEM
Kevin Chan13be4e22011-10-20 11:30:32 -0700119static unsigned pmem_size = MSM_PMEM_SIZE;
120static int __init pmem_size_setup(char *p)
121{
122 pmem_size = memparse(p, NULL);
123 return 0;
124}
125early_param("pmem_size", pmem_size_setup);
126
127static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
128
129static int __init pmem_adsp_size_setup(char *p)
130{
131 pmem_adsp_size = memparse(p, NULL);
132 return 0;
133}
134early_param("pmem_adsp_size", pmem_adsp_size_setup);
135
136static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
137
138static int __init pmem_audio_size_setup(char *p)
139{
140 pmem_audio_size = memparse(p, NULL);
141 return 0;
142}
143early_param("pmem_audio_size", pmem_audio_size_setup);
Olav Haugan7c6aa742012-01-16 16:47:37 -0800144#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700145
Olav Haugan7c6aa742012-01-16 16:47:37 -0800146#ifdef CONFIG_ANDROID_PMEM
147#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700148static struct android_pmem_platform_data android_pmem_pdata = {
149 .name = "pmem",
150 .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING,
151 .cached = 1,
152 .memory_type = MEMTYPE_EBI1,
153};
154
155static struct platform_device android_pmem_device = {
156 .name = "android_pmem",
157 .id = 0,
158 .dev = {.platform_data = &android_pmem_pdata},
159};
160
161static struct android_pmem_platform_data android_pmem_adsp_pdata = {
162 .name = "pmem_adsp",
163 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
164 .cached = 0,
165 .memory_type = MEMTYPE_EBI1,
166};
Kevin Chan13be4e22011-10-20 11:30:32 -0700167static struct platform_device android_pmem_adsp_device = {
168 .name = "android_pmem",
169 .id = 2,
170 .dev = { .platform_data = &android_pmem_adsp_pdata },
171};
Olav Haugan7c6aa742012-01-16 16:47:37 -0800172#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700173
174static struct android_pmem_platform_data android_pmem_audio_pdata = {
175 .name = "pmem_audio",
176 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
177 .cached = 0,
178 .memory_type = MEMTYPE_EBI1,
179};
180
181static struct platform_device android_pmem_audio_device = {
182 .name = "android_pmem",
183 .id = 4,
184 .dev = { .platform_data = &android_pmem_audio_pdata },
185};
Olav Haugan7c6aa742012-01-16 16:47:37 -0800186#endif
187
188static struct memtype_reserve apq8064_reserve_table[] __initdata = {
189 [MEMTYPE_SMI] = {
190 },
191 [MEMTYPE_EBI0] = {
192 .flags = MEMTYPE_FLAGS_1M_ALIGN,
193 },
194 [MEMTYPE_EBI1] = {
195 .flags = MEMTYPE_FLAGS_1M_ALIGN,
196 },
197};
Kevin Chan13be4e22011-10-20 11:30:32 -0700198
Laura Abbott350c8362012-02-28 14:46:52 -0800199#if defined(CONFIG_MSM_RTB)
200static struct msm_rtb_platform_data msm_rtb_pdata = {
201 .size = SZ_1M,
202};
203
204static int __init msm_rtb_set_buffer_size(char *p)
205{
206 int s;
207
208 s = memparse(p, NULL);
209 msm_rtb_pdata.size = ALIGN(s, SZ_4K);
210 return 0;
211}
212early_param("msm_rtb_size", msm_rtb_set_buffer_size);
213
214
215static struct platform_device msm_rtb_device = {
216 .name = "msm_rtb",
217 .id = -1,
218 .dev = {
219 .platform_data = &msm_rtb_pdata,
220 },
221};
222#endif
223
224static void __init reserve_rtb_memory(void)
225{
226#if defined(CONFIG_MSM_RTB)
227 apq8064_reserve_table[MEMTYPE_EBI1].size += msm_rtb_pdata.size;
228#endif
229}
230
231
Kevin Chan13be4e22011-10-20 11:30:32 -0700232static void __init size_pmem_devices(void)
233{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800234#ifdef CONFIG_ANDROID_PMEM
235#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700236 android_pmem_adsp_pdata.size = pmem_adsp_size;
237 android_pmem_pdata.size = pmem_size;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800238#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700239 android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800240#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700241}
242
243static void __init reserve_memory_for(struct android_pmem_platform_data *p)
244{
245 apq8064_reserve_table[p->memory_type].size += p->size;
246}
247
Kevin Chan13be4e22011-10-20 11:30:32 -0700248static void __init reserve_pmem_memory(void)
249{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800250#ifdef CONFIG_ANDROID_PMEM
251#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700252 reserve_memory_for(&android_pmem_adsp_pdata);
253 reserve_memory_for(&android_pmem_pdata);
Olav Haugan7c6aa742012-01-16 16:47:37 -0800254#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700255 reserve_memory_for(&android_pmem_audio_pdata);
256 apq8064_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800257#endif
258}
259
260static int apq8064_paddr_to_memtype(unsigned int paddr)
261{
262 return MEMTYPE_EBI1;
263}
264
265#ifdef CONFIG_ION_MSM
266#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
267static struct ion_cp_heap_pdata cp_mm_ion_pdata = {
268 .permission_type = IPT_TYPE_MM_CARVEOUT,
Olav Haugand3d29682012-01-19 10:57:07 -0800269 .align = PAGE_SIZE,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800270};
271
272static struct ion_cp_heap_pdata cp_mfc_ion_pdata = {
273 .permission_type = IPT_TYPE_MFC_SHAREDMEM,
Olav Haugand3d29682012-01-19 10:57:07 -0800274 .align = PAGE_SIZE,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800275};
276
277static struct ion_co_heap_pdata co_ion_pdata = {
Olav Haugand3d29682012-01-19 10:57:07 -0800278 .adjacent_mem_id = INVALID_HEAP_ID,
279 .align = PAGE_SIZE,
280};
281
282static struct ion_co_heap_pdata fw_co_ion_pdata = {
283 .adjacent_mem_id = ION_CP_MM_HEAP_ID,
284 .align = SZ_128K,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800285};
286#endif
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800287
288/**
289 * These heaps are listed in the order they will be allocated. Due to
290 * video hardware restrictions and content protection the FW heap has to
291 * be allocated adjacent (below) the MM heap and the MFC heap has to be
292 * allocated after the MM heap to ensure MFC heap is not more than 256MB
293 * away from the base address of the FW heap.
294 * However, the order of FW heap and MM heap doesn't matter since these
295 * two heaps are taken care of by separate code to ensure they are adjacent
296 * to each other.
297 * Don't swap the order unless you know what you are doing!
298 */
Olav Haugan7c6aa742012-01-16 16:47:37 -0800299static struct ion_platform_data ion_pdata = {
300 .nr = MSM_ION_HEAP_NUM,
301 .heaps = {
302 {
303 .id = ION_SYSTEM_HEAP_ID,
304 .type = ION_HEAP_TYPE_SYSTEM,
305 .name = ION_VMALLOC_HEAP_NAME,
306 },
307#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
308 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800309 .id = ION_CP_MM_HEAP_ID,
310 .type = ION_HEAP_TYPE_CP,
311 .name = ION_MM_HEAP_NAME,
312 .size = MSM_ION_MM_SIZE,
313 .memory_type = ION_EBI_TYPE,
314 .extra_data = (void *) &cp_mm_ion_pdata,
315 },
316 {
Olav Haugand3d29682012-01-19 10:57:07 -0800317 .id = ION_MM_FIRMWARE_HEAP_ID,
318 .type = ION_HEAP_TYPE_CARVEOUT,
319 .name = ION_MM_FIRMWARE_HEAP_NAME,
320 .size = MSM_ION_MM_FW_SIZE,
321 .memory_type = ION_EBI_TYPE,
322 .extra_data = (void *) &fw_co_ion_pdata,
323 },
324 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800325 .id = ION_CP_MFC_HEAP_ID,
326 .type = ION_HEAP_TYPE_CP,
327 .name = ION_MFC_HEAP_NAME,
328 .size = MSM_ION_MFC_SIZE,
329 .memory_type = ION_EBI_TYPE,
330 .extra_data = (void *) &cp_mfc_ion_pdata,
331 },
332 {
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800333 .id = ION_SF_HEAP_ID,
334 .type = ION_HEAP_TYPE_CARVEOUT,
335 .name = ION_SF_HEAP_NAME,
336 .size = MSM_ION_SF_SIZE,
337 .memory_type = ION_EBI_TYPE,
338 .extra_data = (void *) &co_ion_pdata,
339 },
340 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800341 .id = ION_IOMMU_HEAP_ID,
342 .type = ION_HEAP_TYPE_IOMMU,
343 .name = ION_IOMMU_HEAP_NAME,
344 },
Olav Hauganf45e2142012-01-19 11:01:01 -0800345 {
346 .id = ION_QSECOM_HEAP_ID,
347 .type = ION_HEAP_TYPE_CARVEOUT,
348 .name = ION_QSECOM_HEAP_NAME,
349 .size = MSM_ION_QSECOM_SIZE,
350 .memory_type = ION_EBI_TYPE,
351 .extra_data = (void *) &co_ion_pdata,
352 },
Olav Haugan2c43fac2012-01-19 11:06:37 -0800353 {
354 .id = ION_AUDIO_HEAP_ID,
355 .type = ION_HEAP_TYPE_CARVEOUT,
356 .name = ION_AUDIO_HEAP_NAME,
357 .size = MSM_ION_AUDIO_SIZE,
358 .memory_type = ION_EBI_TYPE,
359 .extra_data = (void *) &co_ion_pdata,
360 },
Olav Haugan7c6aa742012-01-16 16:47:37 -0800361#endif
362 }
363};
364
365static struct platform_device ion_dev = {
366 .name = "ion-msm",
367 .id = 1,
368 .dev = { .platform_data = &ion_pdata },
369};
370#endif
371
372static void reserve_ion_memory(void)
373{
374#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
375 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_SIZE;
Olav Haugand3d29682012-01-19 10:57:07 -0800376 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_FW_SIZE;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800377 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_SF_SIZE;
378 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MFC_SIZE;
Olav Hauganf45e2142012-01-19 11:01:01 -0800379 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_QSECOM_SIZE;
Olav Haugan2c43fac2012-01-19 11:06:37 -0800380 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_AUDIO_SIZE;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800381#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700382}
383
Huaibin Yang4a084e32011-12-15 15:25:52 -0800384static void __init reserve_mdp_memory(void)
385{
386 apq8064_mdp_writeback(apq8064_reserve_table);
387}
388
Kevin Chan13be4e22011-10-20 11:30:32 -0700389static void __init apq8064_calculate_reserve_sizes(void)
390{
391 size_pmem_devices();
392 reserve_pmem_memory();
Olav Haugan7c6aa742012-01-16 16:47:37 -0800393 reserve_ion_memory();
Huaibin Yang4a084e32011-12-15 15:25:52 -0800394 reserve_mdp_memory();
Laura Abbott350c8362012-02-28 14:46:52 -0800395 reserve_rtb_memory();
Kevin Chan13be4e22011-10-20 11:30:32 -0700396}
397
398static struct reserve_info apq8064_reserve_info __initdata = {
399 .memtype_reserve_table = apq8064_reserve_table,
400 .calculate_reserve_sizes = apq8064_calculate_reserve_sizes,
401 .paddr_to_memtype = apq8064_paddr_to_memtype,
402};
403
404static int apq8064_memory_bank_size(void)
405{
406 return 1<<29;
407}
408
409static void __init locate_unstable_memory(void)
410{
411 struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1];
412 unsigned long bank_size;
413 unsigned long low, high;
414
415 bank_size = apq8064_memory_bank_size();
416 low = meminfo.bank[0].start;
417 high = mb->start + mb->size;
Olav Haugand76e3a82012-01-16 16:55:07 -0800418
419 /* Check if 32 bit overflow occured */
420 if (high < mb->start)
421 high = ~0UL;
422
Kevin Chan13be4e22011-10-20 11:30:32 -0700423 low &= ~(bank_size - 1);
424
425 if (high - low <= bank_size)
426 return;
Jack Cheung46bfffa2012-01-19 15:26:24 -0800427 apq8064_reserve_info.low_unstable_address = mb->start -
428 MIN_MEMORY_BLOCK_SIZE + mb->size;
429 apq8064_reserve_info.max_unstable_size = MIN_MEMORY_BLOCK_SIZE;
430
Kevin Chan13be4e22011-10-20 11:30:32 -0700431 apq8064_reserve_info.bank_size = bank_size;
432 pr_info("low unstable address %lx max size %lx bank size %lx\n",
433 apq8064_reserve_info.low_unstable_address,
434 apq8064_reserve_info.max_unstable_size,
435 apq8064_reserve_info.bank_size);
436}
437
Aravind Venkateswaran8ac7f412012-03-16 17:57:30 -0700438static char prim_panel_name[PANEL_NAME_MAX_LEN];
439static char ext_panel_name[PANEL_NAME_MAX_LEN];
440static int __init prim_display_setup(char *param)
441{
442 if (strnlen(param, PANEL_NAME_MAX_LEN))
443 strlcpy(prim_panel_name, param, PANEL_NAME_MAX_LEN);
444 return 0;
445}
446early_param("prim_display", prim_display_setup);
447
448static int __init ext_display_setup(char *param)
449{
450 if (strnlen(param, PANEL_NAME_MAX_LEN))
451 strlcpy(ext_panel_name, param, PANEL_NAME_MAX_LEN);
452 return 0;
453}
454early_param("ext_display", ext_display_setup);
455
Kevin Chan13be4e22011-10-20 11:30:32 -0700456static void __init apq8064_reserve(void)
457{
Aravind Venkateswaran8ac7f412012-03-16 17:57:30 -0700458 apq8064_set_display_params(prim_panel_name, ext_panel_name);
Kevin Chan13be4e22011-10-20 11:30:32 -0700459 msm_reserve();
460}
461
Laura Abbott6988cef2012-03-15 14:27:13 -0700462static void __init place_movable_zone(void)
463{
464 movable_reserved_start = apq8064_reserve_info.low_unstable_address;
465 movable_reserved_size = apq8064_reserve_info.max_unstable_size;
466 pr_info("movable zone start %lx size %lx\n",
467 movable_reserved_start, movable_reserved_size);
468}
469
470static void __init apq8064_early_reserve(void)
471{
472 reserve_info = &apq8064_reserve_info;
473 locate_unstable_memory();
474 place_movable_zone();
475
476}
Hemant Kumara945b472012-01-25 15:08:06 -0800477#ifdef CONFIG_USB_EHCI_MSM_HSIC
478static struct msm_hsic_host_platform_data msm_hsic_pdata = {
479 .strobe = 88,
480 .data = 89,
481};
482#else
483static struct msm_hsic_host_platform_data msm_hsic_pdata;
484#endif
485
Hemant Kumarcb7d8a12012-01-25 12:25:55 -0800486#define PID_MAGIC_ID 0x71432909
487#define SERIAL_NUM_MAGIC_ID 0x61945374
488#define SERIAL_NUMBER_LENGTH 127
489#define DLOAD_USB_BASE_ADD 0x2A03F0C8
490
491struct magic_num_struct {
492 uint32_t pid;
493 uint32_t serial_num;
494};
495
496struct dload_struct {
497 uint32_t reserved1;
498 uint32_t reserved2;
499 uint32_t reserved3;
500 uint16_t reserved4;
501 uint16_t pid;
502 char serial_number[SERIAL_NUMBER_LENGTH];
503 uint16_t reserved5;
504 struct magic_num_struct magic_struct;
505};
506
507static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
508{
509 struct dload_struct __iomem *dload = 0;
510
511 dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload));
512 if (!dload) {
513 pr_err("%s: cannot remap I/O memory region: %08x\n",
514 __func__, DLOAD_USB_BASE_ADD);
515 return -ENXIO;
516 }
517
518 pr_debug("%s: dload:%p pid:%x serial_num:%s\n",
519 __func__, dload, pid, snum);
520 /* update pid */
521 dload->magic_struct.pid = PID_MAGIC_ID;
522 dload->pid = pid;
523
524 /* update serial number */
525 dload->magic_struct.serial_num = 0;
526 if (!snum) {
527 memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH);
528 goto out;
529 }
530
531 dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID;
532 strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH);
533out:
534 iounmap(dload);
535 return 0;
536}
537
538static struct android_usb_platform_data android_usb_pdata = {
539 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
540};
541
Hemant Kumar4933b072011-10-17 23:43:11 -0700542static struct platform_device android_usb_device = {
Hemant Kumarcb7d8a12012-01-25 12:25:55 -0800543 .name = "android_usb",
544 .id = -1,
545 .dev = {
546 .platform_data = &android_usb_pdata,
547 },
Hemant Kumar4933b072011-10-17 23:43:11 -0700548};
549
Hemant Kumar7620eed2012-02-26 09:08:43 -0800550/* Bandwidth requests (zero) if no vote placed */
551static struct msm_bus_vectors usb_init_vectors[] = {
552 {
553 .src = MSM_BUS_MASTER_SPS,
554 .dst = MSM_BUS_SLAVE_EBI_CH0,
555 .ab = 0,
556 .ib = 0,
557 },
558};
559
560/* Bus bandwidth requests in Bytes/sec */
561static struct msm_bus_vectors usb_max_vectors[] = {
562 {
563 .src = MSM_BUS_MASTER_SPS,
564 .dst = MSM_BUS_SLAVE_EBI_CH0,
565 .ab = 60000000, /* At least 480Mbps on bus. */
566 .ib = 960000000, /* MAX bursts rate */
567 },
568};
569
570static struct msm_bus_paths usb_bus_scale_usecases[] = {
571 {
572 ARRAY_SIZE(usb_init_vectors),
573 usb_init_vectors,
574 },
575 {
576 ARRAY_SIZE(usb_max_vectors),
577 usb_max_vectors,
578 },
579};
580
581static struct msm_bus_scale_pdata usb_bus_scale_pdata = {
582 usb_bus_scale_usecases,
583 ARRAY_SIZE(usb_bus_scale_usecases),
584 .name = "usb",
585};
586
Hemant Kumar4933b072011-10-17 23:43:11 -0700587static struct msm_otg_platform_data msm_otg_pdata = {
Hemant Kumard86c4882012-01-24 19:39:37 -0800588 .mode = USB_OTG,
589 .otg_control = OTG_PMIC_CONTROL,
Hemant Kumar4933b072011-10-17 23:43:11 -0700590 .phy_type = SNPS_28NM_INTEGRATED_PHY,
Hemant Kumard86c4882012-01-24 19:39:37 -0800591 .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE),
592 .power_budget = 750,
Hemant Kumar7620eed2012-02-26 09:08:43 -0800593 .bus_scale_table = &usb_bus_scale_pdata,
Hemant Kumar4933b072011-10-17 23:43:11 -0700594};
595
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800596static struct msm_usb_host_platform_data msm_ehci_host_pdata3 = {
Manu Gautam91223e02011-11-08 15:27:22 +0530597 .power_budget = 500,
598};
599
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800600#ifdef CONFIG_USB_EHCI_MSM_HOST4
601static struct msm_usb_host_platform_data msm_ehci_host_pdata4;
602#endif
603
Manu Gautam91223e02011-11-08 15:27:22 +0530604static void __init apq8064_ehci_host_init(void)
605{
606 if (machine_is_apq8064_liquid()) {
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800607 msm_ehci_host_pdata3.dock_connect_irq =
Hemant Kumar56925352012-02-13 16:59:52 -0800608 PM8921_MPP_IRQ(PM8921_IRQ_BASE, 9);
609
Manu Gautam91223e02011-11-08 15:27:22 +0530610 apq8064_device_ehci_host3.dev.platform_data =
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800611 &msm_ehci_host_pdata3;
Manu Gautam91223e02011-11-08 15:27:22 +0530612 platform_device_register(&apq8064_device_ehci_host3);
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800613
614#ifdef CONFIG_USB_EHCI_MSM_HOST4
615 apq8064_device_ehci_host4.dev.platform_data =
616 &msm_ehci_host_pdata4;
617 platform_device_register(&apq8064_device_ehci_host4);
618#endif
Manu Gautam91223e02011-11-08 15:27:22 +0530619 }
620}
621
David Keitel2f613d92012-02-15 11:29:16 -0800622static struct smb349_platform_data smb349_data __initdata = {
623 .en_n_gpio = PM8921_GPIO_PM_TO_SYS(37),
624 .chg_susp_gpio = PM8921_GPIO_PM_TO_SYS(30),
625 .chg_current_ma = 2200,
626};
627
628static struct i2c_board_info smb349_charger_i2c_info[] __initdata = {
629 {
630 I2C_BOARD_INFO(SMB349_NAME, 0x1B),
631 .platform_data = &smb349_data,
632 },
633};
634
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -0800635struct sx150x_platform_data apq8064_sx150x_data[] = {
636 [SX150X_EPM] = {
637 .gpio_base = GPIO_EPM_EXPANDER_BASE,
638 .oscio_is_gpo = false,
639 .io_pullup_ena = 0x0,
640 .io_pulldn_ena = 0x0,
641 .io_open_drain_ena = 0x0,
642 .io_polarity = 0,
643 .irq_summary = -1,
644 },
645};
646
647static struct epm_chan_properties ads_adc_channel_data[] = {
648 {10, 100}, {500, 50}, {1, 1}, {1, 1},
649 {20, 50}, {10, 100}, {1, 1}, {1, 1},
650 {10, 100}, {10, 100}, {100, 100}, {200, 100},
651 {100, 50}, {2000, 50}, {1000, 50}, {200, 50},
652 {200, 100}, {1, 1}, {20, 50}, {500, 50},
653 {50, 50}, {200, 100}, {500, 100}, {20, 50},
654 {200, 50}, {2000, 100}, {1000, 50}, {100, 50},
655 {200, 100}, {500, 50}, {1000, 100}, {200, 50},
656 {1000, 50}, {50, 50}, {100, 50}, {100, 50},
657 {1, 1}, {1, 1}, {20, 100}, {20, 50},
658 {500, 100}, {1000, 100}, {100, 50}, {1000, 50},
659 {100, 50}, {1000, 100}, {100, 50}, {100, 50},
660};
661
662static struct epm_adc_platform_data epm_adc_pdata = {
663 .channel = ads_adc_channel_data,
664 .bus_id = 0x0,
665 .epm_i2c_board_info = {
666 .type = "sx1509q",
667 .addr = 0x3e,
668 .platform_data = &apq8064_sx150x_data[SX150X_EPM],
669 },
670 .gpio_expander_base_addr = GPIO_EPM_EXPANDER_BASE,
671};
672
673static struct platform_device epm_adc_device = {
674 .name = "epm_adc",
675 .id = -1,
676 .dev = {
677 .platform_data = &epm_adc_pdata,
678 },
679};
680
681static void __init apq8064_epm_adc_init(void)
682{
683 epm_adc_pdata.num_channels = 32;
684 epm_adc_pdata.num_adc = 2;
685 epm_adc_pdata.chan_per_adc = 16;
686 epm_adc_pdata.chan_per_mux = 8;
687};
688
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800689#define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS)
690
691/* Micbias setting is based on 8660 CDP/MTP/FLUID requirement
692 * 4 micbiases are used to power various analog and digital
693 * microphones operating at 1800 mV. Technically, all micbiases
694 * can source from single cfilter since all microphones operate
695 * at the same voltage level. The arrangement below is to make
696 * sure all cfilters are exercised. LDO_H regulator ouput level
697 * does not need to be as high as 2.85V. It is choosen for
698 * microphone sensitivity purpose.
699 */
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530700static struct wcd9xxx_pdata apq8064_tabla_platform_data = {
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800701 .slimbus_slave_device = {
702 .name = "tabla-slave",
703 .e_addr = {0, 0, 0x10, 0, 0x17, 2},
704 },
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800705 .irq = MSM_GPIO_TO_INT(42),
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800706 .irq_base = TABLA_INTERRUPT_BASE,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530707 .num_irqs = NR_WCD9XXX_IRQS,
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800708 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
709 .micbias = {
710 .ldoh_v = TABLA_LDOH_2P85_V,
711 .cfilt1_mv = 1800,
712 .cfilt2_mv = 1800,
713 .cfilt3_mv = 1800,
714 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
715 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
716 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
717 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530718 },
719 .regulator = {
720 {
721 .name = "CDC_VDD_CP",
722 .min_uV = 1800000,
723 .max_uV = 1800000,
724 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
725 },
726 {
727 .name = "CDC_VDDA_RX",
728 .min_uV = 1800000,
729 .max_uV = 1800000,
730 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
731 },
732 {
733 .name = "CDC_VDDA_TX",
734 .min_uV = 1800000,
735 .max_uV = 1800000,
736 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
737 },
738 {
739 .name = "VDDIO_CDC",
740 .min_uV = 1800000,
741 .max_uV = 1800000,
742 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
743 },
744 {
745 .name = "VDDD_CDC_D",
746 .min_uV = 1225000,
747 .max_uV = 1225000,
748 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
749 },
750 {
751 .name = "CDC_VDDA_A_1P2V",
752 .min_uV = 1225000,
753 .max_uV = 1225000,
754 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
755 },
756 },
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800757};
758
759static struct slim_device apq8064_slim_tabla = {
760 .name = "tabla-slim",
761 .e_addr = {0, 1, 0x10, 0, 0x17, 2},
762 .dev = {
763 .platform_data = &apq8064_tabla_platform_data,
764 },
765};
766
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530767static struct wcd9xxx_pdata apq8064_tabla20_platform_data = {
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800768 .slimbus_slave_device = {
769 .name = "tabla-slave",
770 .e_addr = {0, 0, 0x60, 0, 0x17, 2},
771 },
772 .irq = MSM_GPIO_TO_INT(42),
773 .irq_base = TABLA_INTERRUPT_BASE,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530774 .num_irqs = NR_WCD9XXX_IRQS,
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800775 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
776 .micbias = {
777 .ldoh_v = TABLA_LDOH_2P85_V,
778 .cfilt1_mv = 1800,
779 .cfilt2_mv = 1800,
780 .cfilt3_mv = 1800,
781 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
782 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
783 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
784 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530785 },
786 .regulator = {
787 {
788 .name = "CDC_VDD_CP",
789 .min_uV = 1800000,
790 .max_uV = 1800000,
791 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
792 },
793 {
794 .name = "CDC_VDDA_RX",
795 .min_uV = 1800000,
796 .max_uV = 1800000,
797 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
798 },
799 {
800 .name = "CDC_VDDA_TX",
801 .min_uV = 1800000,
802 .max_uV = 1800000,
803 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
804 },
805 {
806 .name = "VDDIO_CDC",
807 .min_uV = 1800000,
808 .max_uV = 1800000,
809 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
810 },
811 {
812 .name = "VDDD_CDC_D",
813 .min_uV = 1225000,
814 .max_uV = 1225000,
815 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
816 },
817 {
818 .name = "CDC_VDDA_A_1P2V",
819 .min_uV = 1225000,
820 .max_uV = 1225000,
821 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
822 },
823 },
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800824};
825
826static struct slim_device apq8064_slim_tabla20 = {
827 .name = "tabla2x-slim",
828 .e_addr = {0, 1, 0x60, 0, 0x17, 2},
829 .dev = {
830 .platform_data = &apq8064_tabla20_platform_data,
831 },
832};
833
Amy Maloche70090f992012-02-16 16:35:26 -0800834#define HAP_SHIFT_LVL_OE_GPIO PM8921_MPP_PM_TO_SYS(8)
835#define ISA1200_HAP_EN_GPIO PM8921_GPIO_PM_TO_SYS(33)
836#define ISA1200_HAP_LEN_GPIO PM8921_GPIO_PM_TO_SYS(20)
837#define ISA1200_HAP_CLK PM8921_GPIO_PM_TO_SYS(44)
838
839static int isa1200_power(int on)
840{
841 gpio_set_value_cansleep(ISA1200_HAP_CLK, !!on);
842
843 return 0;
844}
845
846static int isa1200_dev_setup(bool enable)
847{
848 int rc = 0;
849
850 rc = pm8xxx_aux_clk_control(CLK_MP3_2, XO_DIV_1, enable);
851 if (rc) {
852 pr_err("%s: unable to write aux clock register(%d)\n",
853 __func__, rc);
854 return rc;
855 }
856
857 if (!enable)
858 goto free_gpio;
859
860 rc = gpio_request(ISA1200_HAP_CLK, "haptics_clk");
861 if (rc) {
862 pr_err("%s: unable to request gpio %d config(%d)\n",
863 __func__, ISA1200_HAP_CLK, rc);
864 return rc;
865 }
866
867 rc = gpio_direction_output(ISA1200_HAP_CLK, 0);
868 if (rc) {
869 pr_err("%s: unable to set direction\n", __func__);
870 goto free_gpio;
871 }
872
873 return 0;
874
875free_gpio:
876 gpio_free(ISA1200_HAP_CLK);
877 return rc;
878}
879
880static struct isa1200_regulator isa1200_reg_data[] = {
881 {
882 .name = "vddp",
883 .min_uV = ISA_I2C_VTG_MIN_UV,
884 .max_uV = ISA_I2C_VTG_MAX_UV,
885 .load_uA = ISA_I2C_CURR_UA,
886 },
887};
888
889static struct isa1200_platform_data isa1200_1_pdata = {
890 .name = "vibrator",
891 .dev_setup = isa1200_dev_setup,
892 .power_on = isa1200_power,
893 .hap_en_gpio = ISA1200_HAP_EN_GPIO,
894 .hap_len_gpio = ISA1200_HAP_LEN_GPIO,
895 .max_timeout = 15000,
896 .mode_ctrl = PWM_GEN_MODE,
897 .pwm_fd = {
898 .pwm_div = 256,
899 },
900 .is_erm = false,
901 .smart_en = true,
902 .ext_clk_en = true,
903 .chip_en = 1,
904 .regulator_info = isa1200_reg_data,
905 .num_regulators = ARRAY_SIZE(isa1200_reg_data),
906};
907
908static struct i2c_board_info isa1200_board_info[] __initdata = {
909 {
910 I2C_BOARD_INFO("isa1200_1", 0x90>>1),
911 .platform_data = &isa1200_1_pdata,
912 },
913};
Jing Lin21ed4de2012-02-05 15:53:28 -0800914/* configuration data for mxt1386e using V2.1 firmware */
915static const u8 mxt1386e_config_data_v2_1[] = {
916 /* T6 Object */
917 0, 0, 0, 0, 0, 0,
918 /* T38 Object */
Jing Linf1208fd2012-02-23 11:15:42 -0800919 14, 1, 0, 22, 2, 12, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -0800920 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
921 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
922 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
923 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
924 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
925 0, 0, 0, 0,
926 /* T7 Object */
Jing Linf1208fd2012-02-23 11:15:42 -0800927 100, 10, 50,
Jing Lin21ed4de2012-02-05 15:53:28 -0800928 /* T8 Object */
Jing Linf1208fd2012-02-23 11:15:42 -0800929 25, 0, 20, 20, 0, 0, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -0800930 /* T9 Object */
931 131, 0, 0, 26, 42, 0, 32, 80, 2, 5,
932 0, 5, 5, 0, 10, 30, 10, 10, 255, 2,
Jing Linf1208fd2012-02-23 11:15:42 -0800933 85, 5, 0, 5, 9, 5, 12, 35, 70, 40,
934 20, 5, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -0800935 /* T18 Object */
936 0, 0,
937 /* T24 Object */
938 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
939 0, 0, 0, 0, 0, 0, 0, 0, 0,
940 /* T25 Object */
941 3, 0, 60, 115, 156, 99,
942 /* T27 Object */
943 0, 0, 0, 0, 0, 0, 0,
944 /* T40 Object */
945 0, 0, 0, 0, 0,
946 /* T42 Object */
947 2, 0, 255, 0, 255, 0, 0, 0, 0, 0,
948 /* T43 Object */
949 0, 0, 0, 0, 0, 0, 0, 64, 0, 8,
950 16,
951 /* T46 Object */
Jing Linf1208fd2012-02-23 11:15:42 -0800952 68, 0, 16, 16, 0, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -0800953 /* T47 Object */
954 0, 0, 0, 0, 0, 0, 3, 64, 66, 0,
955 /* T48 Object */
956 31, 64, 64, 0, 0, 0, 0, 0, 0, 0,
Jing Linf1208fd2012-02-23 11:15:42 -0800957 32, 40, 0, 10, 10, 0, 0, 100, 10, 90,
958 0, 0, 0, 0, 0, 0, 0, 10, 1, 10,
959 52, 10, 12, 0, 33, 0, 1, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -0800960 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
961 0, 0, 0, 0,
962 /* T56 Object */
963 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
964 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
965 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
966 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Jing Linf1208fd2012-02-23 11:15:42 -0800967 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
968 0,
Jing Lin21ed4de2012-02-05 15:53:28 -0800969};
970
971#define MXT_TS_GPIO_IRQ 6
972#define MXT_TS_PWR_EN_GPIO PM8921_GPIO_PM_TO_SYS(23)
973#define MXT_TS_RESET_GPIO 33
974
975static struct mxt_config_info mxt_config_array[] = {
976 {
977 .config = mxt1386e_config_data_v2_1,
978 .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1),
979 .family_id = 0xA0,
980 .variant_id = 0x7,
981 .version = 0x21,
982 .build = 0xAA,
983 },
984};
985
986static struct mxt_platform_data mxt_platform_data = {
987 .config_array = mxt_config_array,
988 .config_array_size = ARRAY_SIZE(mxt_config_array),
Mohan Pallaka56a1a5d2012-02-23 12:05:13 -0800989 .panel_minx = 0,
990 .panel_maxx = 1365,
991 .panel_miny = 0,
992 .panel_maxy = 767,
993 .disp_minx = 0,
994 .disp_maxx = 1365,
995 .disp_miny = 0,
996 .disp_maxy = 767,
Jing Lin21ed4de2012-02-05 15:53:28 -0800997 .irqflags = IRQF_TRIGGER_FALLING,
998 .i2c_pull_up = true,
999 .reset_gpio = MXT_TS_RESET_GPIO,
1000 .irq_gpio = MXT_TS_GPIO_IRQ,
1001};
1002
1003static struct i2c_board_info mxt_device_info[] __initdata = {
1004 {
1005 I2C_BOARD_INFO("atmel_mxt_ts", 0x5b),
1006 .platform_data = &mxt_platform_data,
1007 .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ),
1008 },
1009};
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001010#define CYTTSP_TS_GPIO_IRQ 6
1011#define CYTTSP_TS_GPIO_RESOUT 7
1012#define CYTTSP_TS_GPIO_SLEEP 33
1013
1014static ssize_t tma340_vkeys_show(struct kobject *kobj,
1015 struct kobj_attribute *attr, char *buf)
1016{
1017 return snprintf(buf, 200,
1018 __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97"
1019 ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97"
1020 ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97"
1021 ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97"
1022 "\n");
1023}
1024
1025static struct kobj_attribute tma340_vkeys_attr = {
1026 .attr = {
1027 .mode = S_IRUGO,
1028 },
1029 .show = &tma340_vkeys_show,
1030};
1031
1032static struct attribute *tma340_properties_attrs[] = {
1033 &tma340_vkeys_attr.attr,
1034 NULL
1035};
1036
1037static struct attribute_group tma340_properties_attr_group = {
1038 .attrs = tma340_properties_attrs,
1039};
1040
1041static int cyttsp_platform_init(struct i2c_client *client)
1042{
1043 int rc = 0;
1044 static struct kobject *tma340_properties_kobj;
1045
1046 tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c";
1047 tma340_properties_kobj = kobject_create_and_add("board_properties",
1048 NULL);
1049 if (tma340_properties_kobj)
1050 rc = sysfs_create_group(tma340_properties_kobj,
1051 &tma340_properties_attr_group);
1052 if (!tma340_properties_kobj || rc)
1053 pr_err("%s: failed to create board_properties\n",
1054 __func__);
1055
1056 return 0;
1057}
1058
1059static struct cyttsp_regulator cyttsp_regulator_data[] = {
1060 {
1061 .name = "vdd",
1062 .min_uV = CY_TMA300_VTG_MIN_UV,
1063 .max_uV = CY_TMA300_VTG_MAX_UV,
1064 .hpm_load_uA = CY_TMA300_CURR_24HZ_UA,
1065 .lpm_load_uA = CY_TMA300_CURR_24HZ_UA,
1066 },
1067 {
1068 .name = "vcc_i2c",
1069 .min_uV = CY_I2C_VTG_MIN_UV,
1070 .max_uV = CY_I2C_VTG_MAX_UV,
1071 .hpm_load_uA = CY_I2C_CURR_UA,
1072 .lpm_load_uA = CY_I2C_CURR_UA,
1073 },
1074};
1075
1076static struct cyttsp_platform_data cyttsp_pdata = {
1077 .panel_maxx = 634,
1078 .panel_maxy = 1166,
1079 .disp_maxx = 599,
1080 .disp_maxy = 1023,
1081 .disp_minx = 0,
1082 .disp_miny = 0,
1083 .flags = 0x01,
1084 .gen = CY_GEN3,
1085 .use_st = CY_USE_ST,
1086 .use_mt = CY_USE_MT,
1087 .use_hndshk = CY_SEND_HNDSHK,
1088 .use_trk_id = CY_USE_TRACKING_ID,
1089 .use_sleep = CY_USE_DEEP_SLEEP_SEL,
1090 .use_gestures = CY_USE_GESTURES,
1091 .fw_fname = "cyttsp_8064_mtp.hex",
1092 /* change act_intrvl to customize the Active power state
1093 * scanning/processing refresh interval for Operating mode
1094 */
1095 .act_intrvl = CY_ACT_INTRVL_DFLT,
1096 /* change tch_tmout to customize the touch timeout for the
1097 * Active power state for Operating mode
1098 */
1099 .tch_tmout = CY_TCH_TMOUT_DFLT,
1100 /* change lp_intrvl to customize the Low Power power state
1101 * scanning/processing refresh interval for Operating mode
1102 */
1103 .lp_intrvl = CY_LP_INTRVL_DFLT,
1104 .sleep_gpio = CYTTSP_TS_GPIO_SLEEP,
1105 .resout_gpio = CYTTSP_TS_GPIO_RESOUT,
1106 .irq_gpio = CYTTSP_TS_GPIO_IRQ,
1107 .regulator_info = cyttsp_regulator_data,
1108 .num_regulators = ARRAY_SIZE(cyttsp_regulator_data),
1109 .init = cyttsp_platform_init,
1110 .correct_fw_ver = 17,
1111};
1112
1113static struct i2c_board_info cyttsp_info[] __initdata = {
1114 {
1115 I2C_BOARD_INFO(CY_I2C_NAME, 0x24),
1116 .platform_data = &cyttsp_pdata,
1117 .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ),
1118 },
1119};
Jing Lin21ed4de2012-02-05 15:53:28 -08001120
Ankit Verma6b7e2ba2012-01-26 15:48:54 -08001121#define MSM_WCNSS_PHYS 0x03000000
1122#define MSM_WCNSS_SIZE 0x280000
1123
1124static struct resource resources_wcnss_wlan[] = {
1125 {
1126 .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1127 .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1128 .name = "wcnss_wlanrx_irq",
1129 .flags = IORESOURCE_IRQ,
1130 },
1131 {
1132 .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1133 .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1134 .name = "wcnss_wlantx_irq",
1135 .flags = IORESOURCE_IRQ,
1136 },
1137 {
1138 .start = MSM_WCNSS_PHYS,
1139 .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1,
1140 .name = "wcnss_mmio",
1141 .flags = IORESOURCE_MEM,
1142 },
1143 {
1144 .start = 64,
1145 .end = 68,
1146 .name = "wcnss_gpios_5wire",
1147 .flags = IORESOURCE_IO,
1148 },
1149};
1150
1151static struct qcom_wcnss_opts qcom_wcnss_pdata = {
1152 .has_48mhz_xo = 1,
1153};
1154
1155static struct platform_device msm_device_wcnss_wlan = {
1156 .name = "wcnss_wlan",
1157 .id = 0,
1158 .num_resources = ARRAY_SIZE(resources_wcnss_wlan),
1159 .resource = resources_wcnss_wlan,
1160 .dev = {.platform_data = &qcom_wcnss_pdata},
1161};
1162
Ankit Vermab7c26e62012-02-28 15:04:15 -08001163static struct platform_device msm_device_iris_fm __devinitdata = {
1164 .name = "iris_fm",
1165 .id = -1,
1166};
1167
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001168#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1169 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
1170 defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1171 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1172
1173#define QCE_SIZE 0x10000
1174#define QCE_0_BASE 0x11000000
1175
1176#define QCE_HW_KEY_SUPPORT 0
1177#define QCE_SHA_HMAC_SUPPORT 1
1178#define QCE_SHARE_CE_RESOURCE 3
1179#define QCE_CE_SHARED 0
1180
1181static struct resource qcrypto_resources[] = {
1182 [0] = {
1183 .start = QCE_0_BASE,
1184 .end = QCE_0_BASE + QCE_SIZE - 1,
1185 .flags = IORESOURCE_MEM,
1186 },
1187 [1] = {
1188 .name = "crypto_channels",
1189 .start = DMOV8064_CE_IN_CHAN,
1190 .end = DMOV8064_CE_OUT_CHAN,
1191 .flags = IORESOURCE_DMA,
1192 },
1193 [2] = {
1194 .name = "crypto_crci_in",
1195 .start = DMOV8064_CE_IN_CRCI,
1196 .end = DMOV8064_CE_IN_CRCI,
1197 .flags = IORESOURCE_DMA,
1198 },
1199 [3] = {
1200 .name = "crypto_crci_out",
1201 .start = DMOV8064_CE_OUT_CRCI,
1202 .end = DMOV8064_CE_OUT_CRCI,
1203 .flags = IORESOURCE_DMA,
1204 },
1205};
1206
1207static struct resource qcedev_resources[] = {
1208 [0] = {
1209 .start = QCE_0_BASE,
1210 .end = QCE_0_BASE + QCE_SIZE - 1,
1211 .flags = IORESOURCE_MEM,
1212 },
1213 [1] = {
1214 .name = "crypto_channels",
1215 .start = DMOV8064_CE_IN_CHAN,
1216 .end = DMOV8064_CE_OUT_CHAN,
1217 .flags = IORESOURCE_DMA,
1218 },
1219 [2] = {
1220 .name = "crypto_crci_in",
1221 .start = DMOV8064_CE_IN_CRCI,
1222 .end = DMOV8064_CE_IN_CRCI,
1223 .flags = IORESOURCE_DMA,
1224 },
1225 [3] = {
1226 .name = "crypto_crci_out",
1227 .start = DMOV8064_CE_OUT_CRCI,
1228 .end = DMOV8064_CE_OUT_CRCI,
1229 .flags = IORESOURCE_DMA,
1230 },
1231};
1232
1233#endif
1234
1235#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1236 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1237
1238static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
1239 .ce_shared = QCE_CE_SHARED,
1240 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1241 .hw_key_support = QCE_HW_KEY_SUPPORT,
1242 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -08001243 .bus_scale_table = NULL,
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001244};
1245
1246static struct platform_device qcrypto_device = {
1247 .name = "qcrypto",
1248 .id = 0,
1249 .num_resources = ARRAY_SIZE(qcrypto_resources),
1250 .resource = qcrypto_resources,
1251 .dev = {
1252 .coherent_dma_mask = DMA_BIT_MASK(32),
1253 .platform_data = &qcrypto_ce_hw_suppport,
1254 },
1255};
1256#endif
1257
1258#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1259 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1260
1261static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
1262 .ce_shared = QCE_CE_SHARED,
1263 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1264 .hw_key_support = QCE_HW_KEY_SUPPORT,
1265 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -08001266 .bus_scale_table = NULL,
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001267};
1268
1269static struct platform_device qcedev_device = {
1270 .name = "qce",
1271 .id = 0,
1272 .num_resources = ARRAY_SIZE(qcedev_resources),
1273 .resource = qcedev_resources,
1274 .dev = {
1275 .coherent_dma_mask = DMA_BIT_MASK(32),
1276 .platform_data = &qcedev_ce_hw_suppport,
1277 },
1278};
1279#endif
1280
Joel Kingdacbc822012-01-25 13:30:57 -08001281static struct mdm_platform_data mdm_platform_data = {
1282 .mdm_version = "3.0",
1283 .ramdump_delay_ms = 2000,
Hemant Kumara945b472012-01-25 15:08:06 -08001284 .peripheral_platform_device = &apq8064_device_hsic_host,
Joel Kingdacbc822012-01-25 13:30:57 -08001285};
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001286
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -08001287static struct tsens_platform_data apq_tsens_pdata = {
1288 .tsens_factor = 1000,
1289 .hw_type = APQ_8064,
1290 .tsens_num_sensor = 11,
1291 .slope = {1176, 1176, 1154, 1176, 1111,
1292 1132, 1132, 1199, 1132, 1199, 1132},
1293};
1294
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001295#define MSM_SHARED_RAM_PHYS 0x80000000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001296static void __init apq8064_map_io(void)
1297{
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001298 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001299 msm_map_apq8064_io();
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -07001300 if (socinfo_init() < 0)
1301 pr_err("socinfo_init() failed!\n");
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001302}
1303
1304static void __init apq8064_init_irq(void)
1305{
Praveen Chidambaram78499012011-11-01 17:15:17 -06001306 struct msm_mpm_device_data *data = NULL;
1307
1308#ifdef CONFIG_MSM_MPM
1309 data = &apq8064_mpm_dev_data;
1310#endif
1311
1312 msm_mpm_irq_extn_init(data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001313 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
1314 (void *)MSM_QGIC_CPU_BASE);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001315}
1316
Jay Chokshi7805b5a2011-11-07 15:55:30 -08001317static struct platform_device msm8064_device_saw_regulator_core0 = {
1318 .name = "saw-regulator",
1319 .id = 0,
1320 .dev = {
1321 .platform_data = &msm8064_saw_regulator_pdata_8921_s5,
1322 },
1323};
1324
1325static struct platform_device msm8064_device_saw_regulator_core1 = {
1326 .name = "saw-regulator",
1327 .id = 1,
1328 .dev = {
1329 .platform_data = &msm8064_saw_regulator_pdata_8921_s6,
1330 },
1331};
1332
1333static struct platform_device msm8064_device_saw_regulator_core2 = {
1334 .name = "saw-regulator",
1335 .id = 2,
1336 .dev = {
1337 .platform_data = &msm8064_saw_regulator_pdata_8821_s0,
1338 },
1339};
1340
1341static struct platform_device msm8064_device_saw_regulator_core3 = {
1342 .name = "saw-regulator",
1343 .id = 3,
1344 .dev = {
1345 .platform_data = &msm8064_saw_regulator_pdata_8821_s1,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001346
1347 },
1348};
1349
Oluwafemi Adeyemif5a31422012-03-08 16:58:45 -08001350static struct msm_rpmrs_level msm_rpmrs_levels[] = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06001351 {
1352 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
1353 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
1354 true,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001355 100, 650, 801, 200,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001356 },
1357
1358 {
1359 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
1360 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
1361 true,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001362 2000, 200, 576000, 2000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001363 },
1364
1365 {
1366 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1367 MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE),
1368 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001369 8500, 51, 1122000, 8500,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001370 },
1371
1372 {
1373 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1374 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, MAX, ACTIVE),
1375 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001376 9000, 51, 1130300, 9000,
1377 },
1378 {
1379 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1380 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, ACTIVE, RET_HIGH),
1381 false,
1382 10000, 51, 1130300, 10000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001383 },
1384
1385 {
1386 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1387 MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE),
1388 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001389 12000, 14, 2205900, 12000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001390 },
1391
1392 {
1393 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1394 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
1395 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001396 18000, 12, 2364250, 18000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001397 },
1398
1399 {
1400 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1401 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH),
1402 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001403 23500, 10, 2667000, 23500,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001404 },
1405
1406 {
1407 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1408 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
1409 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001410 29700, 5, 2867000, 30000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001411 },
1412};
1413
Oluwafemi Adeyemif5a31422012-03-08 16:58:45 -08001414uint32_t apq8064_rpm_get_swfi_latency(void)
1415{
1416 int i;
1417
1418 for (i = 0; i < ARRAY_SIZE(msm_rpmrs_levels); i++) {
1419 if (msm_rpmrs_levels[i].sleep_mode ==
1420 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)
1421 return msm_rpmrs_levels[i].latency_us;
1422 }
1423
1424 return 0;
1425}
1426
Praveen Chidambaram78499012011-11-01 17:15:17 -06001427static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
1428 .mode = MSM_PM_BOOT_CONFIG_TZ,
1429};
1430
1431static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = {
1432 .levels = &msm_rpmrs_levels[0],
1433 .num_levels = ARRAY_SIZE(msm_rpmrs_levels),
1434 .vdd_mem_levels = {
1435 [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000,
1436 [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000,
1437 [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000,
1438 [MSM_RPMRS_VDD_MEM_MAX] = 1150000,
1439 },
1440 .vdd_dig_levels = {
1441 [MSM_RPMRS_VDD_DIG_RET_LOW] = 500000,
1442 [MSM_RPMRS_VDD_DIG_RET_HIGH] = 750000,
1443 [MSM_RPMRS_VDD_DIG_ACTIVE] = 950000,
1444 [MSM_RPMRS_VDD_DIG_MAX] = 1150000,
1445 },
1446 .vdd_mask = 0x7FFFFF,
1447 .rpmrs_target_id = {
1448 [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK,
1449 [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST,
1450 [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_PM8921_S3_0,
1451 [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_PM8921_S3_1,
1452 [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8921_L24_0,
1453 [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8921_L24_1,
1454 [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL,
1455 },
1456};
1457
1458static struct msm_cpuidle_state msm_cstates[] __initdata = {
1459 {0, 0, "C0", "WFI",
1460 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
1461
1462 {0, 1, "C1", "STANDALONE_POWER_COLLAPSE",
1463 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
1464
1465 {0, 2, "C2", "POWER_COLLAPSE",
1466 MSM_PM_SLEEP_MODE_POWER_COLLAPSE},
1467
1468 {1, 0, "C0", "WFI",
1469 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
1470
1471 {1, 1, "C1", "STANDALONE_POWER_COLLAPSE",
1472 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
1473
1474 {2, 0, "C0", "WFI",
1475 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
1476
1477 {2, 1, "C1", "STANDALONE_POWER_COLLAPSE",
1478 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
1479
1480 {3, 0, "C0", "WFI",
1481 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
1482
1483 {3, 1, "C1", "STANDALONE_POWER_COLLAPSE",
1484 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
1485};
1486
1487static struct msm_pm_platform_data msm_pm_data[] = {
1488 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
1489 .idle_supported = 1,
1490 .suspend_supported = 1,
1491 .idle_enabled = 0,
1492 .suspend_enabled = 0,
1493 },
1494
1495 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
1496 .idle_supported = 1,
1497 .suspend_supported = 1,
1498 .idle_enabled = 0,
1499 .suspend_enabled = 0,
1500 },
1501
1502 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
1503 .idle_supported = 1,
1504 .suspend_supported = 1,
1505 .idle_enabled = 1,
1506 .suspend_enabled = 1,
1507 },
1508
1509 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
1510 .idle_supported = 0,
1511 .suspend_supported = 1,
1512 .idle_enabled = 0,
1513 .suspend_enabled = 0,
1514 },
1515
1516 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
1517 .idle_supported = 1,
1518 .suspend_supported = 1,
1519 .idle_enabled = 0,
1520 .suspend_enabled = 0,
1521 },
1522
1523 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
1524 .idle_supported = 1,
1525 .suspend_supported = 0,
1526 .idle_enabled = 1,
1527 .suspend_enabled = 0,
1528 },
1529
1530 [MSM_PM_MODE(2, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
1531 .idle_supported = 0,
1532 .suspend_supported = 1,
1533 .idle_enabled = 0,
1534 .suspend_enabled = 0,
1535 },
1536
1537 [MSM_PM_MODE(2, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
1538 .idle_supported = 1,
1539 .suspend_supported = 1,
1540 .idle_enabled = 0,
1541 .suspend_enabled = 0,
1542 },
1543
1544 [MSM_PM_MODE(2, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
1545 .idle_supported = 1,
1546 .suspend_supported = 0,
1547 .idle_enabled = 1,
1548 .suspend_enabled = 0,
1549 },
1550
1551 [MSM_PM_MODE(3, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
1552 .idle_supported = 0,
1553 .suspend_supported = 1,
1554 .idle_enabled = 0,
1555 .suspend_enabled = 0,
1556 },
1557
1558 [MSM_PM_MODE(3, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
1559 .idle_supported = 1,
1560 .suspend_supported = 1,
1561 .idle_enabled = 0,
1562 .suspend_enabled = 0,
1563 },
1564
1565 [MSM_PM_MODE(3, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
1566 .idle_supported = 1,
1567 .suspend_supported = 0,
1568 .idle_enabled = 1,
1569 .suspend_enabled = 0,
1570 },
1571};
1572
1573static uint8_t spm_wfi_cmd_sequence[] __initdata = {
1574 0x03, 0x0f,
1575};
1576
1577static uint8_t spm_power_collapse_without_rpm[] __initdata = {
1578 0x00, 0x24, 0x54, 0x10,
1579 0x09, 0x03, 0x01,
1580 0x10, 0x54, 0x30, 0x0C,
1581 0x24, 0x30, 0x0f,
1582};
1583
1584static uint8_t spm_power_collapse_with_rpm[] __initdata = {
1585 0x00, 0x24, 0x54, 0x10,
1586 0x09, 0x07, 0x01, 0x0B,
1587 0x10, 0x54, 0x30, 0x0C,
1588 0x24, 0x30, 0x0f,
1589};
1590
1591static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
1592 [0] = {
1593 .mode = MSM_SPM_MODE_CLOCK_GATING,
1594 .notify_rpm = false,
1595 .cmd = spm_wfi_cmd_sequence,
1596 },
1597 [1] = {
1598 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1599 .notify_rpm = false,
1600 .cmd = spm_power_collapse_without_rpm,
1601 },
1602 [2] = {
1603 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1604 .notify_rpm = true,
1605 .cmd = spm_power_collapse_with_rpm,
1606 },
1607};
1608
1609static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = {
1610 0x00, 0x20, 0x03, 0x20,
1611 0x00, 0x0f,
1612};
1613
1614static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = {
1615 0x00, 0x20, 0x34, 0x64,
1616 0x48, 0x07, 0x48, 0x20,
1617 0x50, 0x64, 0x04, 0x34,
1618 0x50, 0x0f,
1619};
1620static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = {
1621 0x00, 0x10, 0x34, 0x64,
1622 0x48, 0x07, 0x48, 0x10,
1623 0x50, 0x64, 0x04, 0x34,
1624 0x50, 0x0F,
1625};
1626
1627static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = {
1628 [0] = {
1629 .mode = MSM_SPM_L2_MODE_RETENTION,
1630 .notify_rpm = false,
1631 .cmd = l2_spm_wfi_cmd_sequence,
1632 },
1633 [1] = {
1634 .mode = MSM_SPM_L2_MODE_GDHS,
1635 .notify_rpm = true,
1636 .cmd = l2_spm_gdhs_cmd_sequence,
1637 },
1638 [2] = {
1639 .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE,
1640 .notify_rpm = true,
1641 .cmd = l2_spm_power_off_cmd_sequence,
1642 },
1643};
1644
1645
1646static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = {
1647 [0] = {
1648 .reg_base_addr = MSM_SAW_L2_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001649 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00,
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] = 0x00A000AE,
1652 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020,
1653 .modes = msm_spm_l2_seq_list,
1654 .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list),
1655 },
1656};
1657
1658static struct msm_spm_platform_data msm_spm_data[] __initdata = {
1659 [0] = {
1660 .reg_base_addr = MSM_SAW0_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001661 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001662#if defined(CONFIG_MSM_AVS_HW)
1663 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1664 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1665#endif
1666 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001667 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001668 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1669 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1670 .vctl_timeout_us = 50,
1671 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1672 .modes = msm_spm_seq_list,
1673 },
1674 [1] = {
1675 .reg_base_addr = MSM_SAW1_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001676 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001677#if defined(CONFIG_MSM_AVS_HW)
1678 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1679 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1680#endif
1681 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001682 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001683 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1684 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1685 .vctl_timeout_us = 50,
1686 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1687 .modes = msm_spm_seq_list,
1688 },
1689 [2] = {
1690 .reg_base_addr = MSM_SAW2_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001691 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001692#if defined(CONFIG_MSM_AVS_HW)
1693 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1694 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1695#endif
1696 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001697 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001698 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1699 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1700 .vctl_timeout_us = 50,
1701 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1702 .modes = msm_spm_seq_list,
1703 },
1704 [3] = {
1705 .reg_base_addr = MSM_SAW3_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001706 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001707#if defined(CONFIG_MSM_AVS_HW)
1708 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1709 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1710#endif
1711 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001712 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001713 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1714 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1715 .vctl_timeout_us = 50,
1716 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1717 .modes = msm_spm_seq_list,
Jay Chokshi7805b5a2011-11-07 15:55:30 -08001718 },
1719};
1720
Gagan Mac8a7a5d32011-11-11 16:43:06 -07001721static void __init apq8064_init_buses(void)
1722{
1723 msm_bus_rpm_set_mt_mask();
1724 msm_bus_8064_apps_fabric_pdata.rpm_enabled = 1;
1725 msm_bus_8064_sys_fabric_pdata.rpm_enabled = 1;
1726 msm_bus_8064_mm_fabric_pdata.rpm_enabled = 1;
1727 msm_bus_8064_apps_fabric.dev.platform_data =
1728 &msm_bus_8064_apps_fabric_pdata;
1729 msm_bus_8064_sys_fabric.dev.platform_data =
1730 &msm_bus_8064_sys_fabric_pdata;
1731 msm_bus_8064_mm_fabric.dev.platform_data =
1732 &msm_bus_8064_mm_fabric_pdata;
1733 msm_bus_8064_sys_fpb.dev.platform_data = &msm_bus_8064_sys_fpb_pdata;
1734 msm_bus_8064_cpss_fpb.dev.platform_data = &msm_bus_8064_cpss_fpb_pdata;
1735}
1736
David Collinsf0d00732012-01-25 15:46:50 -08001737static struct platform_device apq8064_device_ext_5v_vreg __devinitdata = {
1738 .name = GPIO_REGULATOR_DEV_NAME,
1739 .id = PM8921_MPP_PM_TO_SYS(7),
1740 .dev = {
1741 .platform_data
1742 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V],
1743 },
1744};
1745
Jay Chokshi1de4f9d2012-02-07 16:11:31 -08001746static struct platform_device apq8064_device_ext_mpp8_vreg __devinitdata = {
1747 .name = GPIO_REGULATOR_DEV_NAME,
1748 .id = PM8921_MPP_PM_TO_SYS(8),
1749 .dev = {
1750 .platform_data
1751 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_MPP8],
1752 },
1753};
1754
David Collinsf0d00732012-01-25 15:46:50 -08001755static struct platform_device apq8064_device_ext_3p3v_vreg __devinitdata = {
1756 .name = GPIO_REGULATOR_DEV_NAME,
1757 .id = APQ8064_EXT_3P3V_REG_EN_GPIO,
1758 .dev = {
1759 .platform_data =
1760 &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V],
1761 },
1762};
1763
David Collins390fc332012-02-07 14:38:16 -08001764static struct platform_device apq8064_device_ext_ts_sw_vreg __devinitdata = {
1765 .name = GPIO_REGULATOR_DEV_NAME,
1766 .id = PM8921_GPIO_PM_TO_SYS(23),
1767 .dev = {
1768 .platform_data
1769 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_TS_SW],
1770 },
1771};
1772
David Collins2782b5c2012-02-06 10:02:42 -08001773static struct platform_device apq8064_device_rpm_regulator __devinitdata = {
1774 .name = "rpm-regulator",
1775 .id = -1,
1776 .dev = {
1777 .platform_data = &apq8064_rpm_regulator_pdata,
1778 },
1779};
1780
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001781static struct platform_device *common_devices[] __initdata = {
Jin Hong01f2dbb2011-11-03 22:13:51 -07001782 &apq8064_device_dmov,
David Keitel3c40fc52012-02-09 17:53:52 -08001783 &apq8064_device_qup_i2c_gsbi1,
Jing Lin04601f92012-02-05 15:36:07 -08001784 &apq8064_device_qup_i2c_gsbi3,
Kenneth Heitke748593a2011-07-15 15:45:11 -06001785 &apq8064_device_qup_i2c_gsbi4,
Harini Jayaramanc4c58692011-07-19 14:50:10 -06001786 &apq8064_device_qup_spi_gsbi5,
David Collinsf0d00732012-01-25 15:46:50 -08001787 &apq8064_device_ext_5v_vreg,
Jay Chokshi1de4f9d2012-02-07 16:11:31 -08001788 &apq8064_device_ext_mpp8_vreg,
David Collinsf0d00732012-01-25 15:46:50 -08001789 &apq8064_device_ext_3p3v_vreg,
David Collins390fc332012-02-07 14:38:16 -08001790 &apq8064_device_ext_ts_sw_vreg,
Jay Chokshi9c25f072011-09-23 18:19:15 -07001791 &apq8064_device_ssbi_pmic1,
1792 &apq8064_device_ssbi_pmic2,
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001793 &msm_device_smd_apq8064,
Hemant Kumar4933b072011-10-17 23:43:11 -07001794 &apq8064_device_otg,
1795 &apq8064_device_gadget_peripheral,
Hemant Kumard86c4882012-01-24 19:39:37 -08001796 &apq8064_device_hsusb_host,
Hemant Kumar4933b072011-10-17 23:43:11 -07001797 &android_usb_device,
Ankit Verma6b7e2ba2012-01-26 15:48:54 -08001798 &msm_device_wcnss_wlan,
Ankit Vermab7c26e62012-02-28 15:04:15 -08001799 &msm_device_iris_fm,
Olav Haugan7c6aa742012-01-16 16:47:37 -08001800#ifdef CONFIG_ANDROID_PMEM
1801#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -07001802 &android_pmem_device,
1803 &android_pmem_adsp_device,
Olav Haugan7c6aa742012-01-16 16:47:37 -08001804#endif
Kevin Chan13be4e22011-10-20 11:30:32 -07001805 &android_pmem_audio_device,
Olav Haugan7c6aa742012-01-16 16:47:37 -08001806#endif
1807#ifdef CONFIG_ION_MSM
1808 &ion_dev,
1809#endif
Jeff Ohlstein7e668552011-10-06 16:17:25 -07001810 &msm8064_device_watchdog,
Jay Chokshi7805b5a2011-11-07 15:55:30 -08001811 &msm8064_device_saw_regulator_core0,
1812 &msm8064_device_saw_regulator_core1,
1813 &msm8064_device_saw_regulator_core2,
1814 &msm8064_device_saw_regulator_core3,
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001815#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1816 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1817 &qcrypto_device,
1818#endif
1819
1820#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1821 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1822 &qcedev_device,
1823#endif
Ramesh Masavarapuf46be1b2011-11-03 11:13:41 -07001824
1825#ifdef CONFIG_HW_RANDOM_MSM
1826 &apq8064_device_rng,
1827#endif
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -08001828 &apq_pcm,
1829 &apq_pcm_routing,
1830 &apq_cpudai0,
1831 &apq_cpudai1,
1832 &apq_cpudai_hdmi_rx,
1833 &apq_cpudai_bt_rx,
1834 &apq_cpudai_bt_tx,
1835 &apq_cpudai_fm_rx,
1836 &apq_cpudai_fm_tx,
1837 &apq_cpu_fe,
1838 &apq_stub_codec,
1839 &apq_voice,
1840 &apq_voip,
1841 &apq_lpa_pcm,
1842 &apq_pcm_hostless,
1843 &apq_cpudai_afe_01_rx,
1844 &apq_cpudai_afe_01_tx,
1845 &apq_cpudai_afe_02_rx,
1846 &apq_cpudai_afe_02_tx,
1847 &apq_pcm_afe,
1848 &apq_cpudai_auxpcm_rx,
1849 &apq_cpudai_auxpcm_tx,
Neema Shetty8427c262012-02-16 11:23:43 -08001850 &apq_cpudai_stub,
Neema Shetty3c9d2862012-03-11 01:25:32 -08001851 &apq_cpudai_slimbus_1_rx,
1852 &apq_cpudai_slimbus_1_tx,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001853 &apq8064_rpm_device,
1854 &apq8064_rpm_log_device,
1855 &apq8064_rpm_stat_device,
Gagan Mac8a7a5d32011-11-11 16:43:06 -07001856 &msm_bus_8064_apps_fabric,
1857 &msm_bus_8064_sys_fabric,
1858 &msm_bus_8064_mm_fabric,
1859 &msm_bus_8064_sys_fpb,
1860 &msm_bus_8064_cpss_fpb,
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08001861 &apq8064_msm_device_vidc,
Matt Wagantalled832652012-02-02 19:23:17 -08001862 &msm_8960_riva,
Matt Wagantallb94b9a52012-02-02 21:59:54 -08001863 &msm_8960_q6_lpass,
Matt Wagantall292aace2012-01-26 19:12:34 -08001864 &msm_gss,
Laura Abbott350c8362012-02-28 14:46:52 -08001865#ifdef CONFIG_MSM_RTB
1866 &msm_rtb_device,
1867#endif
Praveen Chidambaram8ea3dcd2011-12-07 14:46:31 -07001868 &apq8064_cpu_idle_device,
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07001869 &apq8064_msm_gov_device,
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08001870 &apq8064_device_cache_erp,
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08001871 &epm_adc_device,
Harini Jayaramanc4c58692011-07-19 14:50:10 -06001872};
1873
Joel King4e7ad222011-08-17 15:47:38 -07001874static struct platform_device *sim_devices[] __initdata = {
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07001875 &apq8064_device_uart_gsbi3,
Yan He06913ce2011-08-26 16:33:46 -07001876 &msm_device_sps_apq8064,
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07001877};
1878
1879static struct platform_device *rumi3_devices[] __initdata = {
1880 &apq8064_device_uart_gsbi1,
Yan He435ed612011-11-23 17:34:59 -08001881 &msm_device_sps_apq8064,
Huaibin Yang4a084e32011-12-15 15:25:52 -08001882#ifdef CONFIG_MSM_ROTATOR
1883 &msm_rotator_device,
1884#endif
Joel King4e7ad222011-08-17 15:47:38 -07001885};
1886
Joel King82b7e3f2012-01-05 10:03:27 -08001887static struct platform_device *cdp_devices[] __initdata = {
1888 &apq8064_device_uart_gsbi1,
Jin Hong4bbbfba2012-02-02 21:48:07 -08001889 &apq8064_device_uart_gsbi7,
Joel King82b7e3f2012-01-05 10:03:27 -08001890 &msm_device_sps_apq8064,
Aravind Venkateswaran4ca27532012-02-16 14:27:05 -08001891#ifdef CONFIG_MSM_ROTATOR
1892 &msm_rotator_device,
1893#endif
Joel King82b7e3f2012-01-05 10:03:27 -08001894};
1895
Harini Jayaramanc4c58692011-07-19 14:50:10 -06001896static struct msm_spi_platform_data apq8064_qup_spi_gsbi5_pdata = {
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -08001897 .max_clock_speed = 1100000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001898};
1899
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07001900#define KS8851_IRQ_GPIO 43
1901
1902static struct spi_board_info spi_board_info[] __initdata = {
1903 {
1904 .modalias = "ks8851",
1905 .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
1906 .max_speed_hz = 19200000,
1907 .bus_num = 0,
1908 .chip_select = 2,
1909 .mode = SPI_MODE_0,
1910 },
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08001911 {
1912 .modalias = "epm_adc",
1913 .max_speed_hz = 1100000,
1914 .bus_num = 0,
1915 .chip_select = 3,
1916 .mode = SPI_MODE_0,
1917 },
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07001918};
1919
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06001920static struct slim_boardinfo apq8064_slim_devices[] = {
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001921 {
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08001922 .bus_num = 1,
1923 .slim_slave = &apq8064_slim_tabla,
1924 },
1925 {
1926 .bus_num = 1,
1927 .slim_slave = &apq8064_slim_tabla20,
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001928 },
1929 /* add more slimbus slaves as needed */
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06001930};
1931
David Keitel3c40fc52012-02-09 17:53:52 -08001932static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi1_pdata = {
1933 .clk_freq = 100000,
1934 .src_clk_rate = 24000000,
1935};
1936
Jing Lin04601f92012-02-05 15:36:07 -08001937static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi3_pdata = {
1938 .clk_freq = 100000,
1939 .src_clk_rate = 24000000,
1940};
1941
Kenneth Heitke748593a2011-07-15 15:45:11 -06001942static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi4_pdata = {
1943 .clk_freq = 100000,
1944 .src_clk_rate = 24000000,
Kenneth Heitke748593a2011-07-15 15:45:11 -06001945};
1946
David Keitel3c40fc52012-02-09 17:53:52 -08001947#define GSBI_DUAL_MODE_CODE 0x60
1948#define MSM_GSBI1_PHYS 0x12440000
Kenneth Heitke748593a2011-07-15 15:45:11 -06001949static void __init apq8064_i2c_init(void)
1950{
David Keitel3c40fc52012-02-09 17:53:52 -08001951 void __iomem *gsbi_mem;
1952
1953 apq8064_device_qup_i2c_gsbi1.dev.platform_data =
1954 &apq8064_i2c_qup_gsbi1_pdata;
1955 gsbi_mem = ioremap_nocache(MSM_GSBI1_PHYS, 4);
1956 writel_relaxed(GSBI_DUAL_MODE_CODE, gsbi_mem);
1957 /* Ensure protocol code is written before proceeding */
1958 wmb();
1959 iounmap(gsbi_mem);
1960 apq8064_i2c_qup_gsbi1_pdata.use_gsbi_shared_mode = 1;
Jing Lin04601f92012-02-05 15:36:07 -08001961 apq8064_device_qup_i2c_gsbi3.dev.platform_data =
1962 &apq8064_i2c_qup_gsbi3_pdata;
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08001963 apq8064_device_qup_i2c_gsbi1.dev.platform_data =
1964 &apq8064_i2c_qup_gsbi1_pdata;
Kenneth Heitke748593a2011-07-15 15:45:11 -06001965 apq8064_device_qup_i2c_gsbi4.dev.platform_data =
1966 &apq8064_i2c_qup_gsbi4_pdata;
1967}
1968
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -08001969#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07001970static int ethernet_init(void)
1971{
1972 int ret;
1973 ret = gpio_request(KS8851_IRQ_GPIO, "ks8851_irq");
1974 if (ret) {
1975 pr_err("ks8851 gpio_request failed: %d\n", ret);
1976 goto fail;
1977 }
1978
1979 return 0;
1980fail:
1981 return ret;
1982}
1983#else
1984static int ethernet_init(void)
1985{
1986 return 0;
1987}
1988#endif
1989
Mohan Pallaka474b94b2012-01-25 12:59:58 +05301990#define GPIO_KEY_HOME PM8921_GPIO_PM_TO_SYS(27)
1991#define GPIO_KEY_VOLUME_UP PM8921_GPIO_PM_TO_SYS(35)
1992#define GPIO_KEY_VOLUME_DOWN PM8921_GPIO_PM_TO_SYS(38)
1993#define GPIO_KEY_CAM_FOCUS PM8921_GPIO_PM_TO_SYS(3)
1994#define GPIO_KEY_CAM_SNAP PM8921_GPIO_PM_TO_SYS(4)
Jing Lin3f8f8422012-03-05 09:32:11 -08001995#define GPIO_KEY_ROTATION PM8921_GPIO_PM_TO_SYS(42)
Mohan Pallaka474b94b2012-01-25 12:59:58 +05301996
1997static struct gpio_keys_button cdp_keys[] = {
1998 {
1999 .code = KEY_HOME,
2000 .gpio = GPIO_KEY_HOME,
2001 .desc = "home_key",
2002 .active_low = 1,
2003 .type = EV_KEY,
2004 .wakeup = 1,
2005 .debounce_interval = 15,
2006 },
2007 {
2008 .code = KEY_VOLUMEUP,
2009 .gpio = GPIO_KEY_VOLUME_UP,
2010 .desc = "volume_up_key",
2011 .active_low = 1,
2012 .type = EV_KEY,
2013 .wakeup = 1,
2014 .debounce_interval = 15,
2015 },
2016 {
2017 .code = KEY_VOLUMEDOWN,
2018 .gpio = GPIO_KEY_VOLUME_DOWN,
2019 .desc = "volume_down_key",
2020 .active_low = 1,
2021 .type = EV_KEY,
2022 .wakeup = 1,
2023 .debounce_interval = 15,
2024 },
2025 {
2026 .code = SW_ROTATE_LOCK,
2027 .gpio = GPIO_KEY_ROTATION,
2028 .desc = "rotate_key",
2029 .active_low = 1,
2030 .type = EV_SW,
2031 .debounce_interval = 15,
2032 },
2033};
2034
2035static struct gpio_keys_platform_data cdp_keys_data = {
2036 .buttons = cdp_keys,
2037 .nbuttons = ARRAY_SIZE(cdp_keys),
2038};
2039
2040static struct platform_device cdp_kp_pdev = {
2041 .name = "gpio-keys",
2042 .id = -1,
2043 .dev = {
2044 .platform_data = &cdp_keys_data,
2045 },
2046};
2047
2048static struct gpio_keys_button mtp_keys[] = {
2049 {
2050 .code = KEY_CAMERA_FOCUS,
2051 .gpio = GPIO_KEY_CAM_FOCUS,
2052 .desc = "cam_focus_key",
2053 .active_low = 1,
2054 .type = EV_KEY,
2055 .wakeup = 1,
2056 .debounce_interval = 15,
2057 },
2058 {
2059 .code = KEY_VOLUMEUP,
2060 .gpio = GPIO_KEY_VOLUME_UP,
2061 .desc = "volume_up_key",
2062 .active_low = 1,
2063 .type = EV_KEY,
2064 .wakeup = 1,
2065 .debounce_interval = 15,
2066 },
2067 {
2068 .code = KEY_VOLUMEDOWN,
2069 .gpio = GPIO_KEY_VOLUME_DOWN,
2070 .desc = "volume_down_key",
2071 .active_low = 1,
2072 .type = EV_KEY,
2073 .wakeup = 1,
2074 .debounce_interval = 15,
2075 },
2076 {
2077 .code = KEY_CAMERA_SNAPSHOT,
2078 .gpio = GPIO_KEY_CAM_SNAP,
2079 .desc = "cam_snap_key",
2080 .active_low = 1,
2081 .type = EV_KEY,
2082 .debounce_interval = 15,
2083 },
2084};
2085
2086static struct gpio_keys_platform_data mtp_keys_data = {
2087 .buttons = mtp_keys,
2088 .nbuttons = ARRAY_SIZE(mtp_keys),
2089};
2090
2091static struct platform_device mtp_kp_pdev = {
2092 .name = "gpio-keys",
2093 .id = -1,
2094 .dev = {
2095 .platform_data = &mtp_keys_data,
2096 },
2097};
2098
Jin Hongd3024e62012-02-09 16:13:32 -08002099/* Sensors DSPS platform data */
2100#define DSPS_PIL_GENERIC_NAME "dsps"
2101static void __init apq8064_init_dsps(void)
2102{
2103 struct msm_dsps_platform_data *pdata =
2104 msm_dsps_device_8064.dev.platform_data;
2105 pdata->pil_name = DSPS_PIL_GENERIC_NAME;
2106 pdata->gpios = NULL;
2107 pdata->gpios_num = 0;
2108
2109 platform_device_register(&msm_dsps_device_8064);
2110}
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302111
Tianyi Gou41515e22011-09-01 19:37:43 -07002112static void __init apq8064_clock_init(void)
2113{
Tianyi Gouacb588d2012-01-27 18:24:05 -08002114 if (machine_is_apq8064_rumi3())
Tianyi Gou41515e22011-09-01 19:37:43 -07002115 msm_clock_init(&apq8064_dummy_clock_init_data);
Tianyi Gouacb588d2012-01-27 18:24:05 -08002116 else
2117 msm_clock_init(&apq8064_clock_init_data);
Tianyi Gou41515e22011-09-01 19:37:43 -07002118}
2119
Jing Lin417fa452012-02-05 14:31:06 -08002120#define I2C_SURF 1
2121#define I2C_FFA (1 << 1)
2122#define I2C_RUMI (1 << 2)
2123#define I2C_SIM (1 << 3)
2124#define I2C_LIQUID (1 << 4)
2125
2126struct i2c_registry {
2127 u8 machs;
2128 int bus;
2129 struct i2c_board_info *info;
2130 int len;
2131};
2132
2133static struct i2c_registry apq8064_i2c_devices[] __initdata = {
Jing Lin21ed4de2012-02-05 15:53:28 -08002134 {
David Keitel2f613d92012-02-15 11:29:16 -08002135 I2C_LIQUID,
2136 APQ_8064_GSBI1_QUP_I2C_BUS_ID,
2137 smb349_charger_i2c_info,
2138 ARRAY_SIZE(smb349_charger_i2c_info)
2139 },
2140 {
Jing Lin21ed4de2012-02-05 15:53:28 -08002141 I2C_SURF | I2C_LIQUID,
2142 APQ_8064_GSBI3_QUP_I2C_BUS_ID,
2143 mxt_device_info,
2144 ARRAY_SIZE(mxt_device_info),
2145 },
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08002146 {
2147 I2C_FFA,
2148 APQ_8064_GSBI3_QUP_I2C_BUS_ID,
2149 cyttsp_info,
2150 ARRAY_SIZE(cyttsp_info),
2151 },
Amy Maloche70090f992012-02-16 16:35:26 -08002152 {
2153 I2C_FFA | I2C_LIQUID,
2154 APQ_8064_GSBI1_QUP_I2C_BUS_ID,
2155 isa1200_board_info,
2156 ARRAY_SIZE(isa1200_board_info),
2157 },
Jing Lin417fa452012-02-05 14:31:06 -08002158};
2159
2160static void __init register_i2c_devices(void)
2161{
2162 u8 mach_mask = 0;
2163 int i;
2164
Kevin Chand07220e2012-02-13 15:52:22 -08002165#ifdef CONFIG_MSM_CAMERA
2166 struct i2c_registry apq8064_camera_i2c_devices = {
2167 I2C_SURF | I2C_FFA | I2C_LIQUID | I2C_RUMI,
2168 APQ_8064_GSBI4_QUP_I2C_BUS_ID,
2169 apq8064_camera_board_info.board_info,
2170 apq8064_camera_board_info.num_i2c_board_info,
2171 };
2172#endif
Jing Lin417fa452012-02-05 14:31:06 -08002173 /* Build the matching 'supported_machs' bitmask */
2174 if (machine_is_apq8064_cdp())
2175 mach_mask = I2C_SURF;
2176 else if (machine_is_apq8064_mtp())
2177 mach_mask = I2C_FFA;
2178 else if (machine_is_apq8064_liquid())
2179 mach_mask = I2C_LIQUID;
2180 else if (machine_is_apq8064_rumi3())
2181 mach_mask = I2C_RUMI;
2182 else if (machine_is_apq8064_sim())
2183 mach_mask = I2C_SIM;
2184 else
2185 pr_err("unmatched machine ID in register_i2c_devices\n");
2186
2187 /* Run the array and install devices as appropriate */
2188 for (i = 0; i < ARRAY_SIZE(apq8064_i2c_devices); ++i) {
2189 if (apq8064_i2c_devices[i].machs & mach_mask)
2190 i2c_register_board_info(apq8064_i2c_devices[i].bus,
2191 apq8064_i2c_devices[i].info,
2192 apq8064_i2c_devices[i].len);
2193 }
Kevin Chand07220e2012-02-13 15:52:22 -08002194#ifdef CONFIG_MSM_CAMERA
2195 if (apq8064_camera_i2c_devices.machs & mach_mask)
2196 i2c_register_board_info(apq8064_camera_i2c_devices.bus,
2197 apq8064_camera_i2c_devices.info,
2198 apq8064_camera_i2c_devices.len);
2199#endif
Jing Lin417fa452012-02-05 14:31:06 -08002200}
2201
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002202static void __init apq8064_common_init(void)
2203{
2204 if (socinfo_init() < 0)
2205 pr_err("socinfo_init() failed!\n");
Praveen Chidambaram78499012011-11-01 17:15:17 -06002206 BUG_ON(msm_rpm_init(&apq8064_rpm_data));
2207 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
David Collins2782b5c2012-02-06 10:02:42 -08002208 regulator_suppress_info_printing();
2209 platform_device_register(&apq8064_device_rpm_regulator);
Stephen Boyd4d0d2582012-02-10 14:49:40 -08002210 if (msm_xo_init())
2211 pr_err("Failed to initialize XO votes\n");
Tianyi Gou41515e22011-09-01 19:37:43 -07002212 apq8064_clock_init();
Stepan Moskovchenko2327a952011-12-14 16:31:28 -08002213 apq8064_init_gpiomux();
Kenneth Heitke748593a2011-07-15 15:45:11 -06002214 apq8064_i2c_init();
Jing Lin417fa452012-02-05 14:31:06 -08002215 register_i2c_devices();
Kenneth Heitke36920d32011-07-20 16:44:30 -06002216
Harini Jayaramanc4c58692011-07-19 14:50:10 -06002217 apq8064_device_qup_spi_gsbi5.dev.platform_data =
2218 &apq8064_qup_spi_gsbi5_pdata;
Stepan Moskovchenkoc1074f02011-12-14 17:51:57 -08002219 apq8064_init_pmic();
Hemant Kumar94e7da22012-02-03 16:52:29 -08002220 if (machine_is_apq8064_liquid())
2221 msm_otg_pdata.mhl_enable = true;
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002222 apq8064_device_otg.dev.platform_data = &msm_otg_pdata;
Manu Gautam91223e02011-11-08 15:27:22 +05302223 apq8064_ehci_host_init();
Gagan Mac8a7a5d32011-11-11 16:43:06 -07002224 apq8064_init_buses();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002225 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Hemant Kumarf1ca9192012-02-07 18:59:33 -08002226 if (machine_is_apq8064_mtp()) {
2227 apq8064_device_hsic_host.dev.platform_data = &msm_hsic_pdata;
2228 device_initialize(&apq8064_device_hsic_host.dev);
2229 }
Jay Chokshie8741282012-01-25 15:22:55 -08002230 apq8064_pm8xxx_gpio_mpp_init();
Sahitya Tummala3586ed92011-08-03 09:13:23 +05302231 apq8064_init_mmc();
Swaminathan Sathappan144b4882012-02-06 17:01:20 -08002232
2233 if (machine_is_apq8064_mtp()) {
2234 mdm_8064_device.dev.platform_data = &mdm_platform_data;
2235 platform_device_register(&mdm_8064_device);
2236 }
2237 platform_device_register(&apq8064_slim_ctrl);
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06002238 slim_register_board_info(apq8064_slim_devices,
2239 ARRAY_SIZE(apq8064_slim_devices));
Jin Hongd3024e62012-02-09 16:13:32 -08002240 apq8064_init_dsps();
Praveen Chidambaram78499012011-11-01 17:15:17 -06002241 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
Mahesh Sivasubramaniancbce1ec2012-01-24 10:32:44 -07002242 acpuclk_init(&acpuclk_8064_soc_data);
Praveen Chidambaram78499012011-11-01 17:15:17 -06002243 msm_spm_l2_init(msm_spm_l2_data);
2244 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
2245 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
2246 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
2247 msm_pm_data);
2248 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08002249 apq8064_epm_adc_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002250}
2251
Huaibin Yang4a084e32011-12-15 15:25:52 -08002252static void __init apq8064_allocate_memory_regions(void)
2253{
2254 apq8064_allocate_fb_region();
2255}
2256
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002257static void __init apq8064_sim_init(void)
2258{
Jeff Ohlstein7e668552011-10-06 16:17:25 -07002259 struct msm_watchdog_pdata *wdog_pdata = (struct msm_watchdog_pdata *)
2260 &msm8064_device_watchdog.dev.platform_data;
2261
2262 wdog_pdata->bark_time = 15000;
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -08002263 msm_tsens_early_init(&apq_tsens_pdata);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002264 apq8064_common_init();
Joel King4e7ad222011-08-17 15:47:38 -07002265 platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices));
2266}
2267
2268static void __init apq8064_rumi3_init(void)
2269{
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -08002270 msm_tsens_early_init(&apq_tsens_pdata);
Joel King4e7ad222011-08-17 15:47:38 -07002271 apq8064_common_init();
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002272 ethernet_init();
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07002273 platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002274 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
Huaibin Yang4a084e32011-12-15 15:25:52 -08002275 apq8064_init_fb();
Jordan Crouseb3115fe2012-02-01 22:11:12 -07002276 apq8064_init_gpu();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002277}
2278
Joel King82b7e3f2012-01-05 10:03:27 -08002279static void __init apq8064_cdp_init(void)
2280{
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -08002281 msm_tsens_early_init(&apq_tsens_pdata);
Joel King82b7e3f2012-01-05 10:03:27 -08002282 apq8064_common_init();
2283 ethernet_init();
2284 platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
2285 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002286 apq8064_init_fb();
Jordan Crouseb3115fe2012-02-01 22:11:12 -07002287 apq8064_init_gpu();
Matt Wagantall1875d322012-02-22 16:11:33 -08002288 platform_add_devices(apq8064_fs_devices, apq8064_num_fs_devices);
Kevin Chand07220e2012-02-13 15:52:22 -08002289 apq8064_init_cam();
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302290
2291 if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
2292 platform_device_register(&cdp_kp_pdev);
2293
2294 if (machine_is_apq8064_mtp())
2295 platform_device_register(&mtp_kp_pdev);
Joel King82b7e3f2012-01-05 10:03:27 -08002296}
2297
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002298MACHINE_START(APQ8064_SIM, "QCT APQ8064 SIMULATOR")
2299 .map_io = apq8064_map_io,
Kevin Chan13be4e22011-10-20 11:30:32 -07002300 .reserve = apq8064_reserve,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002301 .init_irq = apq8064_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302302 .handle_irq = gic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002303 .timer = &msm_timer,
2304 .init_machine = apq8064_sim_init,
2305MACHINE_END
2306
Joel King4e7ad222011-08-17 15:47:38 -07002307MACHINE_START(APQ8064_RUMI3, "QCT APQ8064 RUMI3")
2308 .map_io = apq8064_map_io,
Kevin Chan13be4e22011-10-20 11:30:32 -07002309 .reserve = apq8064_reserve,
Joel King4e7ad222011-08-17 15:47:38 -07002310 .init_irq = apq8064_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302311 .handle_irq = gic_handle_irq,
Joel King4e7ad222011-08-17 15:47:38 -07002312 .timer = &msm_timer,
2313 .init_machine = apq8064_rumi3_init,
Huaibin Yang4a084e32011-12-15 15:25:52 -08002314 .init_early = apq8064_allocate_memory_regions,
Joel King4e7ad222011-08-17 15:47:38 -07002315MACHINE_END
2316
Joel King82b7e3f2012-01-05 10:03:27 -08002317MACHINE_START(APQ8064_CDP, "QCT APQ8064 CDP")
2318 .map_io = apq8064_map_io,
2319 .reserve = apq8064_reserve,
2320 .init_irq = apq8064_init_irq,
2321 .handle_irq = gic_handle_irq,
2322 .timer = &msm_timer,
2323 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002324 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07002325 .init_very_early = apq8064_early_reserve,
Joel King82b7e3f2012-01-05 10:03:27 -08002326MACHINE_END
2327
2328MACHINE_START(APQ8064_MTP, "QCT APQ8064 MTP")
2329 .map_io = apq8064_map_io,
2330 .reserve = apq8064_reserve,
2331 .init_irq = apq8064_init_irq,
2332 .handle_irq = gic_handle_irq,
2333 .timer = &msm_timer,
2334 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002335 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07002336 .init_very_early = apq8064_early_reserve,
Joel King82b7e3f2012-01-05 10:03:27 -08002337MACHINE_END
2338
2339MACHINE_START(APQ8064_LIQUID, "QCT APQ8064 LIQUID")
2340 .map_io = apq8064_map_io,
2341 .reserve = apq8064_reserve,
2342 .init_irq = apq8064_init_irq,
2343 .handle_irq = gic_handle_irq,
2344 .timer = &msm_timer,
2345 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002346 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07002347 .init_very_early = apq8064_early_reserve,
Joel King82b7e3f2012-01-05 10:03:27 -08002348MACHINE_END
2349
Joel King11ca8202012-02-13 16:19:03 -08002350MACHINE_START(MPQ8064_HRD, "QCT MPQ8064 HRD")
2351 .map_io = apq8064_map_io,
2352 .reserve = apq8064_reserve,
2353 .init_irq = apq8064_init_irq,
2354 .handle_irq = gic_handle_irq,
2355 .timer = &msm_timer,
2356 .init_machine = apq8064_cdp_init,
Laura Abbott6988cef2012-03-15 14:27:13 -07002357 .init_very_early = apq8064_early_reserve,
Joel King11ca8202012-02-13 16:19:03 -08002358MACHINE_END
2359
2360MACHINE_START(MPQ8064_DTV, "QCT MPQ8064 DTV")
2361 .map_io = apq8064_map_io,
2362 .reserve = apq8064_reserve,
2363 .init_irq = apq8064_init_irq,
2364 .handle_irq = gic_handle_irq,
2365 .timer = &msm_timer,
2366 .init_machine = apq8064_cdp_init,
Laura Abbott6988cef2012-03-15 14:27:13 -07002367 .init_very_early = apq8064_early_reserve,
Joel King11ca8202012-02-13 16:19:03 -08002368MACHINE_END
2369