blob: a28ba9f8b798263cb5bbab6809ed23824002003d [file] [log] [blame]
Harini Jayaramana9873ab2011-12-20 17:29:48 -07001/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002 *
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 *
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -080012 */
13#include <linux/kernel.h>
14#include <linux/platform_device.h>
15#include <linux/io.h>
16#include <linux/irq.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070017#include <linux/i2c.h>
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -070018#include <linux/i2c/sx150x.h>
Amir Samuelov5137e392011-09-21 17:31:25 +030019#include <linux/i2c/isl9519.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070020#include <linux/gpio.h>
21#include <linux/msm_ssbi.h>
22#include <linux/regulator/gpio-regulator.h>
23#include <linux/mfd/pm8xxx/pm8921.h>
Siddartha Mohanadossaf91d902011-10-20 10:23:34 -070024#include <linux/mfd/pm8xxx/pm8xxx-adc.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070025#include <linux/regulator/consumer.h>
26#include <linux/spi/spi.h>
27#include <linux/slimbus/slimbus.h>
28#include <linux/bootmem.h>
Lucille Sylvester34ec3692011-08-16 16:28:04 -060029#include <linux/msm_kgsl.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070030#ifdef CONFIG_ANDROID_PMEM
31#include <linux/android_pmem.h>
32#endif
33#include <linux/cyttsp.h>
34#include <linux/dma-mapping.h>
35#include <linux/platform_data/qcom_crypto_device.h>
Ankur Nandwanib0039b02011-08-09 14:00:45 -070036#include <linux/platform_data/qcom_wcnss_device.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070037#include <linux/leds.h>
38#include <linux/leds-pm8xxx.h>
Mohan Pallaka50837382011-09-07 11:00:57 +053039#include <linux/i2c/atmel_mxt_ts.h>
Siddartha Mohanadossba21fdd2011-08-18 10:05:27 -070040#include <linux/msm_tsens.h>
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -070041#include <linux/ks8851.h>
Mohan Pallaka5e490392011-09-09 15:18:41 +053042#include <linux/i2c/isa1200.h>
Jack Cheung0b1987e2011-11-18 13:36:29 -080043#include <linux/memory.h>
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -080044
45#include <asm/mach-types.h>
46#include <asm/mach/arch.h>
Larry Basselb4126da2011-07-18 14:31:33 -070047#include <asm/setup.h>
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -080048#include <asm/hardware/gic.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070049#include <asm/mach/mmc.h>
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -080050
51#include <mach/board.h>
52#include <mach/msm_iomap.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070053#include <mach/msm_spi.h>
54#ifdef CONFIG_USB_MSM_OTG_72K
55#include <mach/msm_hsusb.h>
56#else
57#include <linux/usb/msm_hsusb.h>
58#endif
59#include <linux/usb/android.h>
60#include <mach/usbdiag.h>
61#include <mach/socinfo.h>
62#include <mach/rpm.h>
63#include <mach/gpio.h>
Rohit Vaswania513aa8d2011-07-18 15:14:28 -070064#include <mach/gpiomux.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070065#include <mach/msm_bus_board.h>
66#include <mach/msm_memtypes.h>
67#include <mach/dma.h>
68#include <mach/msm_dsps.h>
69#include <mach/msm_xo.h>
Abhijeet Dharmapurikar6d565fd2011-09-15 18:49:56 -070070#include <mach/restart.h>
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -080071
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070072#ifdef CONFIG_WCD9310_CODEC
73#include <linux/slimbus/slimbus.h>
74#include <linux/mfd/wcd9310/core.h>
75#include <linux/mfd/wcd9310/pdata.h>
76#endif
77
Laura Abbottd6183792011-08-19 13:42:24 -070078#include <linux/ion.h>
79#include <mach/ion.h>
Joel Kingb8352a12011-11-15 18:46:24 -080080#include <mach/mdm2.h>
Vamsi Krishna6aa6b1f2011-12-14 22:55:20 -080081#include <mach/mdm-peripheral.h>
Laura Abbottd6183792011-08-19 13:42:24 -070082
Larry Bassel41a055b2011-12-06 16:15:14 -080083#include <linux/fmem.h>
84
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070085#include "timer.h"
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -080086#include "devices.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070087#include "devices-msm8x60.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070088#include "spm.h"
Stepan Moskovchenko5a83dba2011-12-05 17:30:17 -080089#include "board-8960.h"
Matt Wagantall7cca4642012-02-01 16:43:24 -080090#include "pm.h"
Abhijeet Dharmapurikarefaca4f2011-12-27 16:24:07 -080091#include <mach/cpuidle.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070092#include "rpm_resources.h"
93#include "mpm.h"
Matt Wagantall6d9ebee2011-08-26 12:15:24 -070094#include "acpuclock.h"
Naveen Ramaraj76483ad2011-09-06 14:25:44 -070095#include "smd_private.h"
Maheshkumar Sivasubramanian8ccc16e2011-10-25 15:59:57 -060096#include "pm-boot.h"
Jeff Ohlstein7e668552011-10-06 16:17:25 -070097#include "msm_watchdog.h"
Stepan Moskovchenkoc6ada422011-11-28 19:31:16 -080098
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070099static struct platform_device msm_fm_platform_init = {
100 .name = "iris_fm",
101 .id = -1,
102};
103
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700104#define KS8851_RST_GPIO 89
105#define KS8851_IRQ_GPIO 90
Mohan Pallaka5e490392011-09-09 15:18:41 +0530106#define HAP_SHIFT_LVL_OE_GPIO 47
107
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700108#if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700109
Stepan Moskovchenkoc6ada422011-11-28 19:31:16 -0800110struct sx150x_platform_data msm8960_sx150x_data[] = {
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700111 [SX150X_CAM] = {
112 .gpio_base = GPIO_CAM_EXPANDER_BASE,
113 .oscio_is_gpo = false,
114 .io_pullup_ena = 0x0,
Nishant Pandit474f2252011-07-23 23:17:56 +0530115 .io_pulldn_ena = 0xc0,
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700116 .io_open_drain_ena = 0x0,
117 .irq_summary = -1,
118 },
Amir Samuelov755616d2011-12-13 16:34:46 +0200119 [SX150X_LIQUID] = {
120 .gpio_base = GPIO_LIQUID_EXPANDER_BASE,
121 .oscio_is_gpo = false,
122 .io_pullup_ena = 0x0c08,
123 .io_pulldn_ena = 0x4060,
124 .io_open_drain_ena = 0x000c,
125 .io_polarity = 0,
126 .irq_summary = -1,
127 },
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700128};
Nishant Pandit474f2252011-07-23 23:17:56 +0530129
130#endif
131
Olav Haugana21169d2012-01-04 09:17:06 -0800132#define MSM_PMEM_ADSP_SIZE 0x7800000
Ben Romberger3ffcd812011-12-08 19:12:10 -0800133#define MSM_PMEM_AUDIO_SIZE 0x2B4000
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -0700134#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
135#define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
136#else
Mathew Karimpanal15fa5c42011-12-14 21:28:10 -0800137#define MSM_PMEM_SIZE 0x2800000 /* 40 Mbytes */
Ravishangar Kalyanamf4ef7282011-10-10 17:39:48 -0700138#endif
Ravishangar Kalyanam671f5ce2011-12-06 20:25:29 -0800139#define MSM_LIQUID_PMEM_SIZE 0x4000000 /* 64 Mbytes */
Laura Abbott2d1760b2011-09-29 21:31:24 -0700140
141#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Olav Hauganedcf6832012-01-24 08:35:41 -0800142#define MSM_PMEM_KERNEL_EBI1_SIZE 0x280000
Olav Hauganb88eef12012-01-15 10:59:26 -0800143#define MSM_ION_SF_SIZE MSM_PMEM_SIZE
Olav Haugan42ebe712012-01-10 16:30:58 -0800144#define MSM_ION_MM_FW_SIZE 0x200000 /* (2MB) */
Olav Hauganb88eef12012-01-15 10:59:26 -0800145#define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE
Olav Haugan80854eb2012-01-12 12:00:23 -0800146#define MSM_ION_QSECOM_SIZE 0x100000 /* (1MB) */
Olav Hauganb5be7992011-11-18 14:29:02 -0800147#define MSM_ION_MFC_SIZE SZ_8K
Olav Haugan7355db02012-01-13 16:59:13 -0800148#define MSM_ION_AUDIO_SIZE MSM_PMEM_AUDIO_SIZE
149#define MSM_ION_HEAP_NUM 8
Olav Hauganb5be7992011-11-18 14:29:02 -0800150#define MSM_LIQUID_ION_MM_SIZE (MSM_ION_MM_SIZE + 0x600000)
151static unsigned int msm_ion_cp_mm_size = MSM_ION_MM_SIZE;
Laura Abbott2d1760b2011-09-29 21:31:24 -0700152#else
Laura Abbott6db11c92011-11-04 10:31:43 -0700153#define MSM_PMEM_KERNEL_EBI1_SIZE 0x110C000
Olav Hauganb5be7992011-11-18 14:29:02 -0800154#define MSM_ION_HEAP_NUM 1
Laura Abbott2d1760b2011-09-29 21:31:24 -0700155#endif
Laura Abbottd6183792011-08-19 13:42:24 -0700156
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700157#ifdef CONFIG_KERNEL_PMEM_EBI_REGION
158static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE;
159static int __init pmem_kernel_ebi1_size_setup(char *p)
160{
161 pmem_kernel_ebi1_size = memparse(p, NULL);
162 return 0;
163}
164early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup);
165#endif
166
167#ifdef CONFIG_ANDROID_PMEM
168static unsigned pmem_size = MSM_PMEM_SIZE;
Ravishangar Kalyanam671f5ce2011-12-06 20:25:29 -0800169static unsigned pmem_param_set;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700170static int __init pmem_size_setup(char *p)
171{
172 pmem_size = memparse(p, NULL);
Ravishangar Kalyanam671f5ce2011-12-06 20:25:29 -0800173 pmem_param_set = 1;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700174 return 0;
175}
176early_param("pmem_size", pmem_size_setup);
177
178static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
179
180static int __init pmem_adsp_size_setup(char *p)
181{
182 pmem_adsp_size = memparse(p, NULL);
183 return 0;
184}
185early_param("pmem_adsp_size", pmem_adsp_size_setup);
186
187static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
188
189static int __init pmem_audio_size_setup(char *p)
190{
191 pmem_audio_size = memparse(p, NULL);
192 return 0;
193}
194early_param("pmem_audio_size", pmem_audio_size_setup);
195#endif
196
197#ifdef CONFIG_ANDROID_PMEM
Laura Abbott2d1760b2011-09-29 21:31:24 -0700198#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700199static struct android_pmem_platform_data android_pmem_pdata = {
200 .name = "pmem",
201 .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING,
202 .cached = 1,
203 .memory_type = MEMTYPE_EBI1,
204};
205
206static struct platform_device android_pmem_device = {
207 .name = "android_pmem",
208 .id = 0,
209 .dev = {.platform_data = &android_pmem_pdata},
210};
211
212static struct android_pmem_platform_data android_pmem_adsp_pdata = {
213 .name = "pmem_adsp",
214 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
215 .cached = 0,
216 .memory_type = MEMTYPE_EBI1,
217};
218static struct platform_device android_pmem_adsp_device = {
219 .name = "android_pmem",
220 .id = 2,
221 .dev = { .platform_data = &android_pmem_adsp_pdata },
222};
Laura Abbott2d1760b2011-09-29 21:31:24 -0700223#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700224
225static struct android_pmem_platform_data android_pmem_audio_pdata = {
226 .name = "pmem_audio",
227 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
228 .cached = 0,
229 .memory_type = MEMTYPE_EBI1,
230};
231
232static struct platform_device android_pmem_audio_device = {
233 .name = "android_pmem",
234 .id = 4,
235 .dev = { .platform_data = &android_pmem_audio_pdata },
236};
237#endif
238
Larry Bassel41a055b2011-12-06 16:15:14 -0800239struct fmem_platform_data fmem_pdata = {
240};
241
Swaminathan Sathappanb77c65e92011-09-30 18:36:09 -0700242#define DSP_RAM_BASE_8960 0x8da00000
243#define DSP_RAM_SIZE_8960 0x1800000
244static int dspcrashd_pdata_8960 = 0xDEADDEAD;
245
246static struct resource resources_dspcrashd_8960[] = {
247 {
248 .name = "msm_dspcrashd",
249 .start = DSP_RAM_BASE_8960,
250 .end = DSP_RAM_BASE_8960 + DSP_RAM_SIZE_8960,
251 .flags = IORESOURCE_DMA,
252 },
253};
254
Stepan Moskovchenkofc70d902011-11-30 12:39:36 -0800255static struct platform_device msm_device_dspcrashd_8960 = {
Swaminathan Sathappanb77c65e92011-09-30 18:36:09 -0700256 .name = "msm_dspcrashd",
257 .num_resources = ARRAY_SIZE(resources_dspcrashd_8960),
258 .resource = resources_dspcrashd_8960,
259 .dev = { .platform_data = &dspcrashd_pdata_8960 },
260};
261
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700262static struct memtype_reserve msm8960_reserve_table[] __initdata = {
263 [MEMTYPE_SMI] = {
264 },
265 [MEMTYPE_EBI0] = {
266 .flags = MEMTYPE_FLAGS_1M_ALIGN,
267 },
268 [MEMTYPE_EBI1] = {
269 .flags = MEMTYPE_FLAGS_1M_ALIGN,
270 },
271};
272
273static void __init size_pmem_devices(void)
274{
275#ifdef CONFIG_ANDROID_PMEM
Laura Abbott2d1760b2011-09-29 21:31:24 -0700276#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700277 android_pmem_adsp_pdata.size = pmem_adsp_size;
Ravishangar Kalyanam671f5ce2011-12-06 20:25:29 -0800278
279 if (!pmem_param_set && machine_is_msm8960_liquid())
280 pmem_size = MSM_LIQUID_PMEM_SIZE;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700281 android_pmem_pdata.size = pmem_size;
Laura Abbott2d1760b2011-09-29 21:31:24 -0700282#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700283 android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE;
284#endif
285}
286
287static void __init reserve_memory_for(struct android_pmem_platform_data *p)
288{
289 msm8960_reserve_table[p->memory_type].size += p->size;
290}
291
292static void __init reserve_pmem_memory(void)
293{
294#ifdef CONFIG_ANDROID_PMEM
Laura Abbott2d1760b2011-09-29 21:31:24 -0700295#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700296 reserve_memory_for(&android_pmem_adsp_pdata);
297 reserve_memory_for(&android_pmem_pdata);
Laura Abbott2d1760b2011-09-29 21:31:24 -0700298#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700299 reserve_memory_for(&android_pmem_audio_pdata);
300 msm8960_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size;
301#endif
302}
303
Larry Basselb4126da2011-07-18 14:31:33 -0700304static int msm8960_paddr_to_memtype(unsigned int paddr)
305{
306 return MEMTYPE_EBI1;
307}
308
Laura Abbottd6183792011-08-19 13:42:24 -0700309#ifdef CONFIG_ION_MSM
Olav Haugan0703dbf2011-12-19 17:53:38 -0800310#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
311static struct ion_cp_heap_pdata cp_mm_ion_pdata = {
312 .permission_type = IPT_TYPE_MM_CARVEOUT,
Olav Haugan42ebe712012-01-10 16:30:58 -0800313 .align = PAGE_SIZE,
Olav Haugan65f4bd82011-12-13 11:50:08 -0800314 .reusable = 1,
Olav Haugan0703dbf2011-12-19 17:53:38 -0800315};
316
317static struct ion_cp_heap_pdata cp_mfc_ion_pdata = {
318 .permission_type = IPT_TYPE_MFC_SHAREDMEM,
Olav Haugan42ebe712012-01-10 16:30:58 -0800319 .align = PAGE_SIZE,
Olav Haugan65f4bd82011-12-13 11:50:08 -0800320 .reusable = 0,
Olav Haugan0703dbf2011-12-19 17:53:38 -0800321};
322
323static struct ion_co_heap_pdata co_ion_pdata = {
Olav Haugan42ebe712012-01-10 16:30:58 -0800324 .adjacent_mem_id = INVALID_HEAP_ID,
325 .align = PAGE_SIZE,
326};
327
328static struct ion_co_heap_pdata fw_co_ion_pdata = {
329 .adjacent_mem_id = ION_CP_MM_HEAP_ID,
330 .align = SZ_128K,
Olav Haugan0703dbf2011-12-19 17:53:38 -0800331};
332#endif
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800333
334/**
335 * These heaps are listed in the order they will be allocated. Due to
336 * video hardware restrictions and content protection the FW heap has to
337 * be allocated adjacent (below) the MM heap and the MFC heap has to be
338 * allocated after the MM heap to ensure MFC heap is not more than 256MB
339 * away from the base address of the FW heap.
340 * However, the order of FW heap and MM heap doesn't matter since these
341 * two heaps are taken care of by separate code to ensure they are adjacent
342 * to each other.
343 * Don't swap the order unless you know what you are doing!
344 */
Stepan Moskovchenkofc70d902011-11-30 12:39:36 -0800345static struct ion_platform_data ion_pdata = {
Laura Abbott2d1760b2011-09-29 21:31:24 -0700346 .nr = MSM_ION_HEAP_NUM,
Laura Abbottd6183792011-08-19 13:42:24 -0700347 .heaps = {
348 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800349 .id = ION_SYSTEM_HEAP_ID,
Laura Abbottd6183792011-08-19 13:42:24 -0700350 .type = ION_HEAP_TYPE_SYSTEM,
Laura Abbottd6183792011-08-19 13:42:24 -0700351 .name = ION_VMALLOC_HEAP_NAME,
352 },
Laura Abbott2d1760b2011-09-29 21:31:24 -0700353#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Laura Abbottd6183792011-08-19 13:42:24 -0700354 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800355 .id = ION_CP_MM_HEAP_ID,
Olav Haugan0a852512012-01-09 10:20:55 -0800356 .type = ION_HEAP_TYPE_CP,
Olav Hauganb5be7992011-11-18 14:29:02 -0800357 .name = ION_MM_HEAP_NAME,
358 .size = MSM_ION_MM_SIZE,
Laura Abbott2d1760b2011-09-29 21:31:24 -0700359 .memory_type = ION_EBI_TYPE,
Olav Haugan0703dbf2011-12-19 17:53:38 -0800360 .extra_data = (void *) &cp_mm_ion_pdata,
Laura Abbott2d1760b2011-09-29 21:31:24 -0700361 },
Laura Abbott8c017362011-09-22 20:59:12 -0700362 {
Olav Haugan42ebe712012-01-10 16:30:58 -0800363 .id = ION_MM_FIRMWARE_HEAP_ID,
364 .type = ION_HEAP_TYPE_CARVEOUT,
365 .name = ION_MM_FIRMWARE_HEAP_NAME,
366 .size = MSM_ION_MM_FW_SIZE,
367 .memory_type = ION_EBI_TYPE,
368 .extra_data = (void *) &fw_co_ion_pdata,
369 },
370 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800371 .id = ION_CP_MFC_HEAP_ID,
Olav Haugan0a852512012-01-09 10:20:55 -0800372 .type = ION_HEAP_TYPE_CP,
Olav Hauganb5be7992011-11-18 14:29:02 -0800373 .name = ION_MFC_HEAP_NAME,
374 .size = MSM_ION_MFC_SIZE,
375 .memory_type = ION_EBI_TYPE,
Olav Haugan0703dbf2011-12-19 17:53:38 -0800376 .extra_data = (void *) &cp_mfc_ion_pdata,
Olav Hauganb5be7992011-11-18 14:29:02 -0800377 },
378 {
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800379 .id = ION_SF_HEAP_ID,
380 .type = ION_HEAP_TYPE_CARVEOUT,
381 .name = ION_SF_HEAP_NAME,
382 .size = MSM_ION_SF_SIZE,
383 .memory_type = ION_EBI_TYPE,
384 .extra_data = (void *) &co_ion_pdata,
385 },
386 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800387 .id = ION_IOMMU_HEAP_ID,
Laura Abbott8c017362011-09-22 20:59:12 -0700388 .type = ION_HEAP_TYPE_IOMMU,
389 .name = ION_IOMMU_HEAP_NAME,
390 },
Olav Haugan80854eb2012-01-12 12:00:23 -0800391 {
392 .id = ION_QSECOM_HEAP_ID,
393 .type = ION_HEAP_TYPE_CARVEOUT,
394 .name = ION_QSECOM_HEAP_NAME,
395 .size = MSM_ION_QSECOM_SIZE,
396 .memory_type = ION_EBI_TYPE,
397 .extra_data = (void *) &co_ion_pdata,
398 },
Olav Haugan7355db02012-01-13 16:59:13 -0800399 {
400 .id = ION_AUDIO_HEAP_ID,
401 .type = ION_HEAP_TYPE_CARVEOUT,
402 .name = ION_AUDIO_HEAP_NAME,
403 .size = MSM_ION_AUDIO_SIZE,
404 .memory_type = ION_EBI_TYPE,
405 .extra_data = (void *) &co_ion_pdata,
406 },
Laura Abbott2d1760b2011-09-29 21:31:24 -0700407#endif
Laura Abbottd6183792011-08-19 13:42:24 -0700408 }
409};
410
Stepan Moskovchenkofc70d902011-11-30 12:39:36 -0800411static struct platform_device ion_dev = {
Laura Abbottd6183792011-08-19 13:42:24 -0700412 .name = "ion-msm",
413 .id = 1,
414 .dev = { .platform_data = &ion_pdata },
415};
416#endif
417
Larry Bassel41a055b2011-12-06 16:15:14 -0800418struct platform_device fmem_device = {
419 .name = "fmem",
420 .id = 1,
421 .dev = { .platform_data = &fmem_pdata },
422};
423
Olav Haugan65f4bd82011-12-13 11:50:08 -0800424static void __init adjust_mem_for_liquid(void)
Laura Abbottd6183792011-08-19 13:42:24 -0700425{
Ravishangar Kalyanam671f5ce2011-12-06 20:25:29 -0800426 unsigned int i;
427
428 if (!pmem_param_set && machine_is_msm8960_liquid()) {
Olav Hauganb5be7992011-11-18 14:29:02 -0800429 msm_ion_cp_mm_size = MSM_LIQUID_ION_MM_SIZE;
Ravishangar Kalyanam671f5ce2011-12-06 20:25:29 -0800430 for (i = 0; i < ion_pdata.nr; i++) {
Olav Hauganb5be7992011-11-18 14:29:02 -0800431 if (ion_pdata.heaps[i].id == ION_CP_MM_HEAP_ID) {
432 ion_pdata.heaps[i].size = msm_ion_cp_mm_size;
433 pr_debug("msm_ion_cp_mm_size 0x%x\n",
434 msm_ion_cp_mm_size);
Ravishangar Kalyanam671f5ce2011-12-06 20:25:29 -0800435 break;
436 }
437 }
438 }
Olav Haugan65f4bd82011-12-13 11:50:08 -0800439}
440
441static void __init reserve_mem_for_ion(enum ion_memory_types mem_type,
442 unsigned long size)
443{
444 msm8960_reserve_table[mem_type].size += size;
445}
446
447static __init const struct ion_platform_heap *find_ion_heap(int heap_id)
448{
449 unsigned int i;
450 for (i = 0; i < ion_pdata.nr; ++i) {
451 const struct ion_platform_heap *heap = &(ion_pdata.heaps[i]);
452 if (heap->id == heap_id)
453 return (const struct ion_platform_heap *) heap;
454 }
455 return 0;
456}
457
458/**
459 * Reserve memory for ION and calculate amount of reusable memory for fmem.
460 * We only reserve memory for heaps that are not reusable. However, we only
461 * support one reusable heap at the moment so we ignore the reusable flag for
462 * other than the first heap with reusable flag set. Also handle special case
463 * for adjacent heap when the adjacent heap is adjacent to a reusable heap.
464 */
465static void __init reserve_ion_memory(void)
466{
467#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
468 unsigned int i;
469 unsigned int reusable_count = 0;
470
471 adjust_mem_for_liquid();
472 fmem_pdata.size = 0;
473 fmem_pdata.reserved_size = 0;
474
475 /* We only support 1 reusable heap. Check if more than one heap
476 * is specified as reusable and set as non-reusable if found.
477 */
478 for (i = 0; i < ion_pdata.nr; ++i) {
479 const struct ion_platform_heap *heap = &(ion_pdata.heaps[i]);
480
481 if (heap->type == ION_HEAP_TYPE_CP && heap->extra_data) {
482 struct ion_cp_heap_pdata *data = heap->extra_data;
483
484 reusable_count += (data->reusable) ? 1 : 0;
485
486 if (data->reusable && reusable_count > 1) {
487 pr_err("%s: Too many heaps specified as "
488 "reusable. Heap %s was not configured "
489 "as reusable.\n", __func__, heap->name);
490 data->reusable = 0;
491 }
492 }
493 }
494
495 for (i = 0; i < ion_pdata.nr; ++i) {
496 int reusable = 0;
497 int adjacent_heap_id = INVALID_HEAP_ID;
498 int adj_reusable = 0;
499 const struct ion_platform_heap *heap = &(ion_pdata.heaps[i]);
500
501 if (heap->extra_data) {
502 switch (heap->type) {
503 case ION_HEAP_TYPE_CP:
504 reusable = ((struct ion_cp_heap_pdata *)
505 heap->extra_data)->reusable;
506 break;
507 case ION_HEAP_TYPE_CARVEOUT:
508 adjacent_heap_id = ((struct ion_co_heap_pdata *)
509 heap->extra_data)->adjacent_mem_id;
510 break;
511 default:
512 break;
513 }
514 }
515
516 if (adjacent_heap_id != INVALID_HEAP_ID) {
517 const struct ion_platform_heap *adj_heap =
518 find_ion_heap(adjacent_heap_id);
519 if (adj_heap) {
520 adj_reusable = ((struct ion_cp_heap_pdata *)
521 adj_heap->extra_data)->reusable;
522 if (adj_reusable)
523 fmem_pdata.reserved_size += heap->size;
524 }
525 }
526
527 if (!reusable && !adj_reusable)
528 reserve_mem_for_ion(MEMTYPE_EBI1, heap->size);
529 else
530 fmem_pdata.size += heap->size;
531 }
Laura Abbottd6183792011-08-19 13:42:24 -0700532#endif
533}
Huaibin Yanga5419422011-12-08 23:52:10 -0800534
535static void __init reserve_mdp_memory(void)
536{
537 msm8960_mdp_writeback(msm8960_reserve_table);
538}
539
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700540static void __init msm8960_calculate_reserve_sizes(void)
541{
542 size_pmem_devices();
543 reserve_pmem_memory();
Laura Abbottd6183792011-08-19 13:42:24 -0700544 reserve_ion_memory();
Huaibin Yanga5419422011-12-08 23:52:10 -0800545 reserve_mdp_memory();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700546}
547
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700548static struct reserve_info msm8960_reserve_info __initdata = {
549 .memtype_reserve_table = msm8960_reserve_table,
550 .calculate_reserve_sizes = msm8960_calculate_reserve_sizes,
551 .paddr_to_memtype = msm8960_paddr_to_memtype,
552};
553
Larry Basselb4126da2011-07-18 14:31:33 -0700554static int msm8960_memory_bank_size(void)
555{
556 return 1<<29;
557}
558
559static void __init locate_unstable_memory(void)
560{
561 struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1];
562 unsigned long bank_size;
563 unsigned long low, high;
564
565 bank_size = msm8960_memory_bank_size();
566 low = meminfo.bank[0].start;
567 high = mb->start + mb->size;
Olav Haugan62052e42011-10-28 14:28:32 -0700568
569 /* Check if 32 bit overflow occured */
570 if (high < mb->start)
571 high = ~0UL;
572
Larry Basselb4126da2011-07-18 14:31:33 -0700573 low &= ~(bank_size - 1);
574
575 if (high - low <= bank_size)
576 return;
Jack Cheung60eaeab2012-01-09 16:40:26 -0800577 msm8960_reserve_info.low_unstable_address = mb->start -
578 MIN_MEMORY_BLOCK_SIZE + mb->size;
Jack Cheung0b1987e2011-11-18 13:36:29 -0800579 msm8960_reserve_info.max_unstable_size = MIN_MEMORY_BLOCK_SIZE;
Olav Haugan62052e42011-10-28 14:28:32 -0700580
Larry Basselb4126da2011-07-18 14:31:33 -0700581 msm8960_reserve_info.bank_size = bank_size;
582 pr_info("low unstable address %lx max size %lx bank size %lx\n",
583 msm8960_reserve_info.low_unstable_address,
584 msm8960_reserve_info.max_unstable_size,
585 msm8960_reserve_info.bank_size);
586}
587
Larry Basselb830e182011-10-14 10:46:55 -0700588static void __init place_movable_zone(void)
589{
590 movable_reserved_start = msm8960_reserve_info.low_unstable_address;
591 movable_reserved_size = msm8960_reserve_info.max_unstable_size;
592 pr_info("movable zone start %lx size %lx\n",
593 movable_reserved_start, movable_reserved_size);
594}
595
596static void __init msm8960_early_memory(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700597{
598 reserve_info = &msm8960_reserve_info;
Larry Basselb4126da2011-07-18 14:31:33 -0700599 locate_unstable_memory();
Larry Basselb830e182011-10-14 10:46:55 -0700600 place_movable_zone();
601}
602
603static void __init msm8960_reserve(void)
604{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700605 msm_reserve();
Larry Bassel41a055b2011-12-06 16:15:14 -0800606 fmem_pdata.phys = reserve_memory_for_fmem(fmem_pdata.size);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700607}
608
Larry Bassela4414b12011-08-04 11:11:02 -0700609static int msm8960_change_memory_power(u64 start, u64 size,
610 int change_type)
Larry Bassela7eadea2011-07-14 10:46:00 -0700611{
Naveen Ramarajb03bb1b2011-09-12 14:34:31 -0700612 return soc_change_memory_power(start, size, change_type);
Larry Bassela7eadea2011-07-14 10:46:00 -0700613}
614
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700615static void __init msm8960_allocate_memory_regions(void)
616{
Stepan Moskovchenko24cd8642011-11-29 13:07:53 -0800617 msm8960_allocate_fb_region();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700618}
Stepan Moskovchenko24cd8642011-11-29 13:07:53 -0800619
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700620#ifdef CONFIG_WCD9310_CODEC
621
622#define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS)
623
Patrick Lai3043fba2011-08-01 14:15:57 -0700624/* Micbias setting is based on 8660 CDP/MTP/FLUID requirement
625 * 4 micbiases are used to power various analog and digital
626 * microphones operating at 1800 mV. Technically, all micbiases
627 * can source from single cfilter since all microphones operate
628 * at the same voltage level. The arrangement below is to make
629 * sure all cfilters are exercised. LDO_H regulator ouput level
630 * does not need to be as high as 2.85V. It is choosen for
631 * microphone sensitivity purpose.
632 */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700633static struct tabla_pdata tabla_platform_data = {
634 .slimbus_slave_device = {
635 .name = "tabla-slave",
636 .e_addr = {0, 0, 0x10, 0, 0x17, 2},
637 },
638 .irq = MSM_GPIO_TO_INT(62),
639 .irq_base = TABLA_INTERRUPT_BASE,
640 .num_irqs = NR_TABLA_IRQS,
641 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
Patrick Lai3043fba2011-08-01 14:15:57 -0700642 .micbias = {
643 .ldoh_v = TABLA_LDOH_2P85_V,
644 .cfilt1_mv = 1800,
645 .cfilt2_mv = 1800,
646 .cfilt3_mv = 1800,
647 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
648 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
649 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
650 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
651 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700652};
653
654static struct slim_device msm_slim_tabla = {
655 .name = "tabla-slim",
656 .e_addr = {0, 1, 0x10, 0, 0x17, 2},
657 .dev = {
658 .platform_data = &tabla_platform_data,
659 },
660};
Santosh Mardi60e19d92011-10-28 01:15:14 +0530661
662static struct tabla_pdata tabla20_platform_data = {
663 .slimbus_slave_device = {
664 .name = "tabla-slave",
665 .e_addr = {0, 0, 0x60, 0, 0x17, 2},
666 },
667 .irq = MSM_GPIO_TO_INT(62),
668 .irq_base = TABLA_INTERRUPT_BASE,
669 .num_irqs = NR_TABLA_IRQS,
670 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
671 .micbias = {
672 .ldoh_v = TABLA_LDOH_2P85_V,
673 .cfilt1_mv = 1800,
674 .cfilt2_mv = 1800,
675 .cfilt3_mv = 1800,
676 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
677 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
678 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
679 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
680 }
681};
682
683static struct slim_device msm_slim_tabla20 = {
684 .name = "tabla2x-slim",
685 .e_addr = {0, 1, 0x60, 0, 0x17, 2},
686 .dev = {
687 .platform_data = &tabla20_platform_data,
688 },
689};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700690#endif
691
692static struct slim_boardinfo msm_slim_devices[] = {
693#ifdef CONFIG_WCD9310_CODEC
694 {
695 .bus_num = 1,
696 .slim_slave = &msm_slim_tabla,
697 },
Santosh Mardi60e19d92011-10-28 01:15:14 +0530698 {
699 .bus_num = 1,
700 .slim_slave = &msm_slim_tabla20,
701 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700702#endif
703 /* add more slimbus slaves as needed */
704};
705
Yunsen Wang5c1a7392011-07-09 19:10:16 -0700706#define MSM_WCNSS_PHYS 0x03000000
707#define MSM_WCNSS_SIZE 0x280000
708
709static struct resource resources_wcnss_wlan[] = {
710 {
711 .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
712 .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
713 .name = "wcnss_wlanrx_irq",
714 .flags = IORESOURCE_IRQ,
715 },
716 {
717 .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
718 .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
719 .name = "wcnss_wlantx_irq",
720 .flags = IORESOURCE_IRQ,
721 },
722 {
723 .start = MSM_WCNSS_PHYS,
724 .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1,
725 .name = "wcnss_mmio",
726 .flags = IORESOURCE_MEM,
727 },
Ankur Nandwaniad0d9ac2011-09-26 11:49:25 -0700728 {
729 .start = 84,
730 .end = 88,
731 .name = "wcnss_gpios_5wire",
732 .flags = IORESOURCE_IO,
733 },
Yunsen Wang5c1a7392011-07-09 19:10:16 -0700734};
735
Ankur Nandwanib0039b02011-08-09 14:00:45 -0700736static struct qcom_wcnss_opts qcom_wcnss_pdata = {
737 .has_48mhz_xo = 1,
738};
739
Yunsen Wang5c1a7392011-07-09 19:10:16 -0700740static struct platform_device msm_device_wcnss_wlan = {
741 .name = "wcnss_wlan",
742 .id = 0,
743 .num_resources = ARRAY_SIZE(resources_wcnss_wlan),
744 .resource = resources_wcnss_wlan,
Ankur Nandwanib0039b02011-08-09 14:00:45 -0700745 .dev = {.platform_data = &qcom_wcnss_pdata},
Yunsen Wang5c1a7392011-07-09 19:10:16 -0700746};
747
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700748#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
749 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
750 defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
751 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
752
753#define QCE_SIZE 0x10000
754#define QCE_0_BASE 0x18500000
755
756#define QCE_HW_KEY_SUPPORT 0
757#define QCE_SHA_HMAC_SUPPORT 1
758#define QCE_SHARE_CE_RESOURCE 1
759#define QCE_CE_SHARED 0
760
Ramesh Masavarapu49259682011-12-02 14:00:18 -0800761/* Begin Bus scaling definitions */
762static struct msm_bus_vectors crypto_hw_init_vectors[] = {
763 {
764 .src = MSM_BUS_MASTER_ADM_PORT0,
765 .dst = MSM_BUS_SLAVE_EBI_CH0,
766 .ab = 0,
767 .ib = 0,
768 },
769 {
770 .src = MSM_BUS_MASTER_ADM_PORT1,
771 .dst = MSM_BUS_SLAVE_GSBI1_UART,
772 .ab = 0,
773 .ib = 0,
774 },
775};
776
777static struct msm_bus_vectors crypto_hw_active_vectors[] = {
778 {
779 .src = MSM_BUS_MASTER_ADM_PORT0,
780 .dst = MSM_BUS_SLAVE_EBI_CH0,
781 .ab = 70000000UL,
782 .ib = 70000000UL,
783 },
784 {
785 .src = MSM_BUS_MASTER_ADM_PORT1,
786 .dst = MSM_BUS_SLAVE_GSBI1_UART,
787 .ab = 2480000000UL,
788 .ib = 2480000000UL,
789 },
790};
791
792static struct msm_bus_paths crypto_hw_bus_scale_usecases[] = {
793 {
794 ARRAY_SIZE(crypto_hw_init_vectors),
795 crypto_hw_init_vectors,
796 },
797 {
798 ARRAY_SIZE(crypto_hw_active_vectors),
799 crypto_hw_active_vectors,
800 },
801};
802
803static struct msm_bus_scale_pdata crypto_hw_bus_scale_pdata = {
804 crypto_hw_bus_scale_usecases,
805 ARRAY_SIZE(crypto_hw_bus_scale_usecases),
806 .name = "cryptohw",
807};
808/* End Bus Scaling Definitions*/
809
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700810static struct resource qcrypto_resources[] = {
811 [0] = {
812 .start = QCE_0_BASE,
813 .end = QCE_0_BASE + QCE_SIZE - 1,
814 .flags = IORESOURCE_MEM,
815 },
816 [1] = {
817 .name = "crypto_channels",
818 .start = DMOV_CE_IN_CHAN,
819 .end = DMOV_CE_OUT_CHAN,
820 .flags = IORESOURCE_DMA,
821 },
822 [2] = {
823 .name = "crypto_crci_in",
824 .start = DMOV_CE_IN_CRCI,
825 .end = DMOV_CE_IN_CRCI,
826 .flags = IORESOURCE_DMA,
827 },
828 [3] = {
829 .name = "crypto_crci_out",
830 .start = DMOV_CE_OUT_CRCI,
831 .end = DMOV_CE_OUT_CRCI,
832 .flags = IORESOURCE_DMA,
833 },
834};
835
836static struct resource qcedev_resources[] = {
837 [0] = {
838 .start = QCE_0_BASE,
839 .end = QCE_0_BASE + QCE_SIZE - 1,
840 .flags = IORESOURCE_MEM,
841 },
842 [1] = {
843 .name = "crypto_channels",
844 .start = DMOV_CE_IN_CHAN,
845 .end = DMOV_CE_OUT_CHAN,
846 .flags = IORESOURCE_DMA,
847 },
848 [2] = {
849 .name = "crypto_crci_in",
850 .start = DMOV_CE_IN_CRCI,
851 .end = DMOV_CE_IN_CRCI,
852 .flags = IORESOURCE_DMA,
853 },
854 [3] = {
855 .name = "crypto_crci_out",
856 .start = DMOV_CE_OUT_CRCI,
857 .end = DMOV_CE_OUT_CRCI,
858 .flags = IORESOURCE_DMA,
859 },
860};
861
862#endif
863
864#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
865 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
866
867static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
868 .ce_shared = QCE_CE_SHARED,
869 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
870 .hw_key_support = QCE_HW_KEY_SUPPORT,
871 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -0800872 .bus_scale_table = &crypto_hw_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700873};
874
875static struct platform_device qcrypto_device = {
876 .name = "qcrypto",
877 .id = 0,
878 .num_resources = ARRAY_SIZE(qcrypto_resources),
879 .resource = qcrypto_resources,
880 .dev = {
881 .coherent_dma_mask = DMA_BIT_MASK(32),
882 .platform_data = &qcrypto_ce_hw_suppport,
883 },
884};
885#endif
886
887#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
888 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
889
890static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
891 .ce_shared = QCE_CE_SHARED,
892 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
893 .hw_key_support = QCE_HW_KEY_SUPPORT,
894 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -0800895 .bus_scale_table = &crypto_hw_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700896};
897
898static struct platform_device qcedev_device = {
899 .name = "qce",
900 .id = 0,
901 .num_resources = ARRAY_SIZE(qcedev_resources),
902 .resource = qcedev_resources,
903 .dev = {
904 .coherent_dma_mask = DMA_BIT_MASK(32),
905 .platform_data = &qcedev_ce_hw_suppport,
906 },
907};
908#endif
909
Joel Kingb8352a12011-11-15 18:46:24 -0800910#define MDM2AP_ERRFATAL 70
911#define AP2MDM_ERRFATAL 95
912#define MDM2AP_STATUS 69
913#define AP2MDM_STATUS 94
914#define AP2MDM_PMIC_RESET_N 80
915#define AP2MDM_KPDPWR_N 81
916
Joel Kingb8352a12011-11-15 18:46:24 -0800917static struct resource mdm_resources[] = {
918 {
919 .start = MDM2AP_ERRFATAL,
920 .end = MDM2AP_ERRFATAL,
921 .name = "MDM2AP_ERRFATAL",
922 .flags = IORESOURCE_IO,
923 },
924 {
925 .start = AP2MDM_ERRFATAL,
926 .end = AP2MDM_ERRFATAL,
927 .name = "AP2MDM_ERRFATAL",
928 .flags = IORESOURCE_IO,
929 },
930 {
931 .start = MDM2AP_STATUS,
932 .end = MDM2AP_STATUS,
933 .name = "MDM2AP_STATUS",
934 .flags = IORESOURCE_IO,
935 },
936 {
937 .start = AP2MDM_STATUS,
938 .end = AP2MDM_STATUS,
939 .name = "AP2MDM_STATUS",
940 .flags = IORESOURCE_IO,
941 },
942 {
943 .start = AP2MDM_PMIC_RESET_N,
944 .end = AP2MDM_PMIC_RESET_N,
945 .name = "AP2MDM_PMIC_RESET_N",
946 .flags = IORESOURCE_IO,
947 },
948 {
949 .start = AP2MDM_KPDPWR_N,
950 .end = AP2MDM_KPDPWR_N,
951 .name = "AP2MDM_KPDPWR_N",
952 .flags = IORESOURCE_IO,
953 },
954};
955
956static struct mdm_platform_data mdm_platform_data = {
957 .mdm_version = "2.5",
958};
959
Stepan Moskovchenkofc70d902011-11-30 12:39:36 -0800960static struct platform_device mdm_device = {
Joel Kingb8352a12011-11-15 18:46:24 -0800961 .name = "mdm2_modem",
962 .id = -1,
963 .num_resources = ARRAY_SIZE(mdm_resources),
964 .resource = mdm_resources,
965 .dev = {
966 .platform_data = &mdm_platform_data,
967 },
968};
969
970static struct platform_device *mdm_devices[] __initdata = {
971 &mdm_device,
972};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700973
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700974#define MSM_SHARED_RAM_PHYS 0x80000000
975
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -0800976static void __init msm8960_map_io(void)
977{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700978 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -0800979 msm_map_msm8960_io();
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -0700980
981 if (socinfo_init() < 0)
982 pr_err("socinfo_init() failed!\n");
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -0800983}
984
985static void __init msm8960_init_irq(void)
986{
Praveen Chidambaram78499012011-11-01 17:15:17 -0600987 struct msm_mpm_device_data *data = NULL;
988
989#ifdef CONFIG_MSM_MPM
990 data = &msm8960_mpm_dev_data;
991#endif
992
993 msm_mpm_irq_extn_init(data);
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -0800994 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700995 (void *)MSM_QGIC_CPU_BASE);
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -0800996}
997
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700998static void __init msm8960_init_buses(void)
999{
1000#ifdef CONFIG_MSM_BUS_SCALING
Gagan Macdc1dc142011-09-16 15:13:35 -06001001 msm_bus_rpm_set_mt_mask();
Gagan Macae154c4b2011-10-05 19:24:43 -06001002 msm_bus_8960_apps_fabric_pdata.rpm_enabled = 1;
1003 msm_bus_8960_sys_fabric_pdata.rpm_enabled = 1;
1004 msm_bus_8960_mm_fabric_pdata.rpm_enabled = 1;
1005 msm_bus_apps_fabric.dev.platform_data =
1006 &msm_bus_8960_apps_fabric_pdata;
1007 msm_bus_sys_fabric.dev.platform_data = &msm_bus_8960_sys_fabric_pdata;
1008 msm_bus_mm_fabric.dev.platform_data = &msm_bus_8960_mm_fabric_pdata;
1009 msm_bus_sys_fpb.dev.platform_data = &msm_bus_8960_sys_fpb_pdata;
1010 msm_bus_cpss_fpb.dev.platform_data = &msm_bus_8960_cpss_fpb_pdata;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001011#endif
1012}
1013
1014static struct msm_spi_platform_data msm8960_qup_spi_gsbi1_pdata = {
1015 .max_clock_speed = 15060000,
1016};
1017
1018#ifdef CONFIG_USB_MSM_OTG_72K
1019static struct msm_otg_platform_data msm_otg_pdata;
1020#else
Anji jonnalaa8b8d732011-12-06 10:03:24 +05301021static int wr_phy_init_seq[] = {
1022 0x44, 0x80, /* set VBUS valid threshold
1023 and disconnect valid threshold */
1024 0x38, 0x81, /* update DC voltage level */
1025 0x14, 0x82, /* set preemphasis and rise/fall time */
1026 0x13, 0x83, /* set source impedance adjusment */
1027 -1};
1028
1029static int liquid_v1_phy_init_seq[] = {
1030 0x44, 0x80,/* set VBUS valid threshold
1031 and disconnect valid threshold */
1032 0x3C, 0x81,/* update DC voltage level */
1033 0x18, 0x82,/* set preemphasis and rise/fall time */
1034 0x23, 0x83,/* set source impedance sdjusment */
1035 -1};
1036
Manu Gautamcd82e9d2011-12-20 14:17:28 +05301037#ifdef CONFIG_MSM_BUS_SCALING
1038/* Bandwidth requests (zero) if no vote placed */
1039static struct msm_bus_vectors usb_init_vectors[] = {
1040 {
1041 .src = MSM_BUS_MASTER_SPS,
1042 .dst = MSM_BUS_SLAVE_EBI_CH0,
1043 .ab = 0,
1044 .ib = 0,
1045 },
1046};
1047
1048/* Bus bandwidth requests in Bytes/sec */
1049static struct msm_bus_vectors usb_max_vectors[] = {
1050 {
1051 .src = MSM_BUS_MASTER_SPS,
1052 .dst = MSM_BUS_SLAVE_EBI_CH0,
1053 .ab = 60000000, /* At least 480Mbps on bus. */
1054 .ib = 960000000, /* MAX bursts rate */
1055 },
1056};
1057
1058static struct msm_bus_paths usb_bus_scale_usecases[] = {
1059 {
1060 ARRAY_SIZE(usb_init_vectors),
1061 usb_init_vectors,
1062 },
1063 {
1064 ARRAY_SIZE(usb_max_vectors),
1065 usb_max_vectors,
1066 },
1067};
1068
1069static struct msm_bus_scale_pdata usb_bus_scale_pdata = {
1070 usb_bus_scale_usecases,
1071 ARRAY_SIZE(usb_bus_scale_usecases),
1072 .name = "usb",
1073};
1074#endif
1075
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001076static struct msm_otg_platform_data msm_otg_pdata = {
1077 .mode = USB_OTG,
1078 .otg_control = OTG_PMIC_CONTROL,
1079 .phy_type = SNPS_28NM_INTEGRATED_PHY,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001080 .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE),
Anji jonnala4e3e6772011-09-15 18:53:42 +05301081 .power_budget = 750,
Manu Gautamcd82e9d2011-12-20 14:17:28 +05301082#ifdef CONFIG_MSM_BUS_SCALING
1083 .bus_scale_table = &usb_bus_scale_pdata,
1084#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001085};
1086#endif
1087
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +05301088#ifdef CONFIG_USB_EHCI_MSM_HSIC
Vijayavardhan Vennapusa2b592824f2011-11-02 19:51:32 +05301089#define HSIC_HUB_RESET_GPIO 91
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +05301090static struct msm_hsic_host_platform_data msm_hsic_pdata = {
1091 .strobe = 150,
1092 .data = 151,
1093};
1094#else
1095static struct msm_hsic_host_platform_data msm_hsic_pdata;
1096#endif
1097
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001098#define PID_MAGIC_ID 0x71432909
1099#define SERIAL_NUM_MAGIC_ID 0x61945374
1100#define SERIAL_NUMBER_LENGTH 127
1101#define DLOAD_USB_BASE_ADD 0x2A03F0C8
1102
1103struct magic_num_struct {
1104 uint32_t pid;
1105 uint32_t serial_num;
1106};
1107
1108struct dload_struct {
1109 uint32_t reserved1;
1110 uint32_t reserved2;
1111 uint32_t reserved3;
1112 uint16_t reserved4;
1113 uint16_t pid;
1114 char serial_number[SERIAL_NUMBER_LENGTH];
1115 uint16_t reserved5;
1116 struct magic_num_struct magic_struct;
1117};
1118
1119static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
1120{
1121 struct dload_struct __iomem *dload = 0;
1122
1123 dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload));
1124 if (!dload) {
1125 pr_err("%s: cannot remap I/O memory region: %08x\n",
1126 __func__, DLOAD_USB_BASE_ADD);
1127 return -ENXIO;
1128 }
1129
1130 pr_debug("%s: dload:%p pid:%x serial_num:%s\n",
1131 __func__, dload, pid, snum);
1132 /* update pid */
1133 dload->magic_struct.pid = PID_MAGIC_ID;
1134 dload->pid = pid;
1135
1136 /* update serial number */
1137 dload->magic_struct.serial_num = 0;
1138 if (!snum) {
1139 memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH);
1140 goto out;
1141 }
1142
1143 dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID;
Jin Honge49b1482011-10-03 11:15:50 -07001144 strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001145out:
1146 iounmap(dload);
1147 return 0;
1148}
1149
1150static struct android_usb_platform_data android_usb_pdata = {
1151 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
1152};
1153
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07001154static struct platform_device android_usb_device = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001155 .name = "android_usb",
1156 .id = -1,
1157 .dev = {
1158 .platform_data = &android_usb_pdata,
1159 },
1160};
1161
1162static uint8_t spm_wfi_cmd_sequence[] __initdata = {
1163 0x03, 0x0f,
1164};
1165
1166static uint8_t spm_power_collapse_without_rpm[] __initdata = {
1167 0x00, 0x24, 0x54, 0x10,
1168 0x09, 0x03, 0x01,
1169 0x10, 0x54, 0x30, 0x0C,
1170 0x24, 0x30, 0x0f,
1171};
1172
1173static uint8_t spm_power_collapse_with_rpm[] __initdata = {
1174 0x00, 0x24, 0x54, 0x10,
1175 0x09, 0x07, 0x01, 0x0B,
1176 0x10, 0x54, 0x30, 0x0C,
1177 0x24, 0x30, 0x0f,
1178};
1179
1180static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
1181 [0] = {
1182 .mode = MSM_SPM_MODE_CLOCK_GATING,
1183 .notify_rpm = false,
1184 .cmd = spm_wfi_cmd_sequence,
1185 },
1186 [1] = {
1187 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1188 .notify_rpm = false,
1189 .cmd = spm_power_collapse_without_rpm,
1190 },
1191 [2] = {
1192 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1193 .notify_rpm = true,
1194 .cmd = spm_power_collapse_with_rpm,
1195 },
1196};
1197
1198static struct msm_spm_platform_data msm_spm_data[] __initdata = {
1199 [0] = {
1200 .reg_base_addr = MSM_SAW0_BASE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001201 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001202#if defined(CONFIG_MSM_AVS_HW)
1203 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1204 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1205#endif
1206 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
1207 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
1208 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1209 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1210 .vctl_timeout_us = 50,
1211 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1212 .modes = msm_spm_seq_list,
1213 },
1214 [1] = {
1215 .reg_base_addr = MSM_SAW1_BASE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001216 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001217#if defined(CONFIG_MSM_AVS_HW)
1218 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1219 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1220#endif
1221 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
1222 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
1223 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1224 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1225 .vctl_timeout_us = 50,
1226 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1227 .modes = msm_spm_seq_list,
1228 },
1229};
1230
1231static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = {
1232 0x00, 0x20, 0x03, 0x20,
1233 0x00, 0x0f,
1234};
1235
1236static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = {
1237 0x00, 0x20, 0x34, 0x64,
1238 0x48, 0x07, 0x48, 0x20,
1239 0x50, 0x64, 0x04, 0x34,
1240 0x50, 0x0f,
1241};
1242static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = {
1243 0x00, 0x10, 0x34, 0x64,
1244 0x48, 0x07, 0x48, 0x10,
1245 0x50, 0x64, 0x04, 0x34,
1246 0x50, 0x0F,
1247};
1248
1249static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = {
1250 [0] = {
1251 .mode = MSM_SPM_L2_MODE_RETENTION,
1252 .notify_rpm = false,
1253 .cmd = l2_spm_wfi_cmd_sequence,
1254 },
1255 [1] = {
1256 .mode = MSM_SPM_L2_MODE_GDHS,
1257 .notify_rpm = true,
1258 .cmd = l2_spm_gdhs_cmd_sequence,
1259 },
1260 [2] = {
1261 .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE,
1262 .notify_rpm = true,
1263 .cmd = l2_spm_power_off_cmd_sequence,
1264 },
1265};
1266
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001267static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = {
1268 [0] = {
1269 .reg_base_addr = MSM_SAW_L2_BASE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001270 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00,
1271 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
1272 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE,
1273 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020,
1274 .modes = msm_spm_l2_seq_list,
1275 .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list),
1276 },
1277};
1278
Mohan Pallaka5e490392011-09-09 15:18:41 +05301279#define PM_HAP_EN_GPIO PM8921_GPIO_PM_TO_SYS(33)
1280#define PM_HAP_LEN_GPIO PM8921_GPIO_PM_TO_SYS(20)
1281
1282static struct msm_xo_voter *xo_handle_d1;
1283
1284static int isa1200_power(int on)
1285{
1286 int rc = 0;
1287
1288 gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, !!on);
1289
1290 rc = on ? msm_xo_mode_vote(xo_handle_d1, MSM_XO_MODE_ON) :
1291 msm_xo_mode_vote(xo_handle_d1, MSM_XO_MODE_OFF);
1292 if (rc < 0) {
1293 pr_err("%s: failed to %svote for TCXO D1 buffer%d\n",
1294 __func__, on ? "" : "de-", rc);
1295 goto err_xo_vote;
1296 }
1297
1298 return 0;
1299
1300err_xo_vote:
1301 gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, !on);
1302 return rc;
1303}
1304
1305static int isa1200_dev_setup(bool enable)
1306{
1307 int rc = 0;
1308
1309 struct pm_gpio hap_gpio_config = {
1310 .direction = PM_GPIO_DIR_OUT,
1311 .pull = PM_GPIO_PULL_NO,
1312 .out_strength = PM_GPIO_STRENGTH_HIGH,
1313 .function = PM_GPIO_FUNC_NORMAL,
1314 .inv_int_pol = 0,
1315 .vin_sel = 2,
1316 .output_buffer = PM_GPIO_OUT_BUF_CMOS,
1317 .output_value = 0,
1318 };
1319
1320 if (enable == true) {
1321 rc = pm8xxx_gpio_config(PM_HAP_EN_GPIO, &hap_gpio_config);
1322 if (rc) {
1323 pr_err("%s: pm8921 gpio %d config failed(%d)\n",
1324 __func__, PM_HAP_EN_GPIO, rc);
1325 return rc;
1326 }
1327
1328 rc = pm8xxx_gpio_config(PM_HAP_LEN_GPIO, &hap_gpio_config);
1329 if (rc) {
1330 pr_err("%s: pm8921 gpio %d config failed(%d)\n",
1331 __func__, PM_HAP_LEN_GPIO, rc);
1332 return rc;
1333 }
1334
1335 rc = gpio_request(HAP_SHIFT_LVL_OE_GPIO, "hap_shft_lvl_oe");
1336 if (rc) {
1337 pr_err("%s: unable to request gpio %d (%d)\n",
1338 __func__, HAP_SHIFT_LVL_OE_GPIO, rc);
1339 return rc;
1340 }
1341
1342 rc = gpio_direction_output(HAP_SHIFT_LVL_OE_GPIO, 0);
1343 if (rc) {
1344 pr_err("%s: Unable to set direction\n", __func__);
1345 goto free_gpio;
1346 }
1347
1348 xo_handle_d1 = msm_xo_get(MSM_XO_TCXO_D1, "isa1200");
1349 if (IS_ERR(xo_handle_d1)) {
1350 rc = PTR_ERR(xo_handle_d1);
1351 pr_err("%s: failed to get the handle for D1(%d)\n",
1352 __func__, rc);
1353 goto gpio_set_dir;
1354 }
1355 } else {
1356 gpio_free(HAP_SHIFT_LVL_OE_GPIO);
1357
1358 msm_xo_put(xo_handle_d1);
1359 }
1360
1361 return 0;
1362
1363gpio_set_dir:
1364 gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, 0);
1365free_gpio:
1366 gpio_free(HAP_SHIFT_LVL_OE_GPIO);
1367 return rc;
1368}
1369
1370static struct isa1200_regulator isa1200_reg_data[] = {
1371 {
1372 .name = "vcc_i2c",
1373 .min_uV = ISA_I2C_VTG_MIN_UV,
1374 .max_uV = ISA_I2C_VTG_MAX_UV,
1375 .load_uA = ISA_I2C_CURR_UA,
1376 },
1377};
1378
1379static struct isa1200_platform_data isa1200_1_pdata = {
1380 .name = "vibrator",
1381 .dev_setup = isa1200_dev_setup,
1382 .power_on = isa1200_power,
1383 .hap_en_gpio = PM_HAP_EN_GPIO,
1384 .hap_len_gpio = PM_HAP_LEN_GPIO,
1385 .max_timeout = 15000,
1386 .mode_ctrl = PWM_GEN_MODE,
1387 .pwm_fd = {
1388 .pwm_div = 256,
1389 },
1390 .is_erm = false,
1391 .smart_en = true,
1392 .ext_clk_en = true,
1393 .chip_en = 1,
1394 .regulator_info = isa1200_reg_data,
1395 .num_regulators = ARRAY_SIZE(isa1200_reg_data),
1396};
1397
1398static struct i2c_board_info msm_isa1200_board_info[] __initdata = {
1399 {
1400 I2C_BOARD_INFO("isa1200_1", 0x90>>1),
Mohan Pallaka5e490392011-09-09 15:18:41 +05301401 },
1402};
1403
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001404#define CYTTSP_TS_GPIO_IRQ 11
1405#define CYTTSP_TS_SLEEP_GPIO 50
1406#define CYTTSP_TS_RESOUT_N_GPIO 52
1407
1408/*virtual key support */
1409static ssize_t tma340_vkeys_show(struct kobject *kobj,
1410 struct kobj_attribute *attr, char *buf)
1411{
1412 return snprintf(buf, 200,
1413 __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97"
1414 ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97"
1415 ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97"
1416 ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97"
1417 "\n");
1418}
1419
1420static struct kobj_attribute tma340_vkeys_attr = {
1421 .attr = {
1422 .mode = S_IRUGO,
1423 },
1424 .show = &tma340_vkeys_show,
1425};
1426
1427static struct attribute *tma340_properties_attrs[] = {
1428 &tma340_vkeys_attr.attr,
1429 NULL
1430};
1431
1432static struct attribute_group tma340_properties_attr_group = {
1433 .attrs = tma340_properties_attrs,
1434};
1435
1436
1437static int cyttsp_platform_init(struct i2c_client *client)
1438{
1439 int rc = 0;
1440 static struct kobject *tma340_properties_kobj;
1441
1442 tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c";
1443 tma340_properties_kobj = kobject_create_and_add("board_properties",
1444 NULL);
1445 if (tma340_properties_kobj)
1446 rc = sysfs_create_group(tma340_properties_kobj,
1447 &tma340_properties_attr_group);
1448 if (!tma340_properties_kobj || rc)
1449 pr_err("%s: failed to create board_properties\n",
1450 __func__);
1451
1452 return 0;
1453}
1454
1455static struct cyttsp_regulator regulator_data[] = {
1456 {
1457 .name = "vdd",
1458 .min_uV = CY_TMA300_VTG_MIN_UV,
1459 .max_uV = CY_TMA300_VTG_MAX_UV,
Anirudh Ghayalf9929b12011-09-07 15:57:36 +05301460 .hpm_load_uA = CY_TMA300_CURR_24HZ_UA,
1461 .lpm_load_uA = CY_TMA300_SLEEP_CURR_UA,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001462 },
1463 /* TODO: Remove after runtime PM is enabled in I2C driver */
1464 {
1465 .name = "vcc_i2c",
1466 .min_uV = CY_I2C_VTG_MIN_UV,
1467 .max_uV = CY_I2C_VTG_MAX_UV,
Anirudh Ghayalf9929b12011-09-07 15:57:36 +05301468 .hpm_load_uA = CY_I2C_CURR_UA,
1469 .lpm_load_uA = CY_I2C_SLEEP_CURR_UA,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001470 },
1471};
1472
1473static struct cyttsp_platform_data cyttsp_pdata = {
1474 .panel_maxx = 634,
1475 .panel_maxy = 1166,
1476 .disp_maxx = 616,
1477 .disp_maxy = 1023,
1478 .disp_minx = 0,
1479 .disp_miny = 16,
1480 .flags = 0x01,
1481 .gen = CY_GEN3, /* or */
1482 .use_st = CY_USE_ST,
1483 .use_mt = CY_USE_MT,
1484 .use_hndshk = CY_SEND_HNDSHK,
1485 .use_trk_id = CY_USE_TRACKING_ID,
Anirudh Ghayale96f66d2011-08-11 14:06:38 +05301486 .use_sleep = CY_USE_DEEP_SLEEP_SEL | CY_USE_LOW_POWER_SEL,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001487 .use_gestures = CY_USE_GESTURES,
1488 .fw_fname = "cyttsp_8960_cdp.hex",
1489 /* activate up to 4 groups
1490 * and set active distance
1491 */
1492 .gest_set = CY_GEST_GRP1 | CY_GEST_GRP2 |
1493 CY_GEST_GRP3 | CY_GEST_GRP4 |
1494 CY_ACT_DIST,
1495 /* change act_intrvl to customize the Active power state
1496 * scanning/processing refresh interval for Operating mode
1497 */
1498 .act_intrvl = CY_ACT_INTRVL_DFLT,
1499 /* change tch_tmout to customize the touch timeout for the
1500 * Active power state for Operating mode
1501 */
1502 .tch_tmout = CY_TCH_TMOUT_DFLT,
1503 /* change lp_intrvl to customize the Low Power power state
1504 * scanning/processing refresh interval for Operating mode
1505 */
1506 .lp_intrvl = CY_LP_INTRVL_DFLT,
1507 .sleep_gpio = CYTTSP_TS_SLEEP_GPIO,
1508 .resout_gpio = CYTTSP_TS_RESOUT_N_GPIO,
1509 .irq_gpio = CYTTSP_TS_GPIO_IRQ,
1510 .regulator_info = regulator_data,
1511 .num_regulators = ARRAY_SIZE(regulator_data),
1512 .init = cyttsp_platform_init,
Mohan Pallaka49c37d62011-08-01 11:52:00 +05301513 .correct_fw_ver = 9,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001514};
1515
1516static struct i2c_board_info cyttsp_info[] __initdata = {
1517 {
1518 I2C_BOARD_INFO(CY_I2C_NAME, 0x24),
1519 .platform_data = &cyttsp_pdata,
1520#ifndef CY_USE_TIMER
1521 .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ),
1522#endif /* CY_USE_TIMER */
1523 },
1524};
1525
Jing Lindc4413c2012-01-16 15:22:52 -08001526/* configuration data for mxt1386 */
1527static const u8 mxt1386_config_data[] = {
Mohan Pallaka50837382011-09-07 11:00:57 +05301528 /* T6 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001529 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301530 /* T38 Object */
Jing Lin93f07082011-11-11 15:53:54 -08001531 11, 2, 0, 11, 11, 11, 0, 0, 0, 0,
Jing Lin2f863172011-10-17 10:56:58 -07001532 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1533 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1534 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1535 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1536 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1537 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301538 /* T7 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001539 100, 16, 50,
Mohan Pallaka50837382011-09-07 11:00:57 +05301540 /* T8 Object */
Jing Lin93f07082011-11-11 15:53:54 -08001541 8, 0, 0, 0, 0, 0, 8, 14, 50, 215,
Mohan Pallaka50837382011-09-07 11:00:57 +05301542 /* T9 Object */
Jing Lin93f07082011-11-11 15:53:54 -08001543 131, 0, 0, 26, 42, 0, 32, 63, 3, 5,
1544 0, 2, 1, 113, 10, 10, 8, 10, 255, 2,
1545 85, 5, 0, 0, 20, 20, 75, 25, 202, 29,
1546 10, 10, 45, 46,
Mohan Pallaka50837382011-09-07 11:00:57 +05301547 /* T15 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001548 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1549 0,
Anirudh Ghayaldab4e0d2012-01-09 14:59:27 +05301550 /* T18 Object */
1551 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301552 /* T22 Object */
Jing Lin93f07082011-11-11 15:53:54 -08001553 5, 0, 0, 0, 0, 0, 0, 0, 30, 0,
1554 0, 0, 5, 8, 10, 13, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301555 /* T24 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001556 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1557 0, 0, 0, 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301558 /* T25 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001559 3, 0, 188, 52, 52, 33, 0, 0, 0, 0,
1560 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301561 /* T27 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001562 0, 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301563 /* T28 Object */
Jing Lin93f07082011-11-11 15:53:54 -08001564 0, 0, 0, 8, 12, 60,
Mohan Pallaka50837382011-09-07 11:00:57 +05301565 /* T40 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001566 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301567 /* T41 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001568 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301569 /* T43 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001570 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301571};
1572
Jing Lin33b007d2011-12-21 17:40:23 -08001573/* configuration data for mxt1386e using V1.0 firmware */
1574static const u8 mxt1386e_config_data_v1_0[] = {
1575 /* T6 Object */
1576 0, 0, 0, 0, 0, 0,
1577 /* T38 Object */
1578 12, 1, 0, 17, 1, 12, 0, 0, 0, 0,
1579 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1580 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1581 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1582 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1583 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1584 0, 0, 0, 0,
1585 /* T7 Object */
1586 100, 16, 50,
1587 /* T8 Object */
1588 25, 0, 20, 20, 0, 0, 20, 50, 0, 0,
1589 /* T9 Object */
1590 131, 0, 0, 26, 42, 0, 32, 80, 2, 5,
1591 0, 5, 5, 0, 10, 30, 10, 10, 255, 2,
1592 85, 5, 10, 10, 10, 10, 135, 55, 70, 40,
1593 10, 5, 0, 0, 0,
1594 /* T18 Object */
1595 0, 0,
1596 /* T24 Object */
1597 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1598 0, 0, 0, 0, 0, 0, 0, 0, 0,
1599 /* T25 Object */
1600 3, 0, 60, 115, 156, 99,
1601 /* T27 Object */
1602 0, 0, 0, 0, 0, 0, 0,
1603 /* T40 Object */
1604 0, 0, 0, 0, 0,
1605 /* T42 Object */
1606 2, 0, 255, 0, 255, 0, 0, 0, 0, 0,
1607 /* T43 Object */
1608 0, 0, 0, 0, 0, 0, 0,
1609 /* T46 Object */
1610 64, 0, 20, 20, 0, 0, 0, 0, 0,
1611 /* T47 Object */
1612 0, 0, 0, 0, 0, 0, 3, 64, 66, 0,
1613 /* T48 Object */
1614 31, 64, 64, 0, 0, 0, 0, 0, 0, 0,
1615 48, 40, 0, 10, 10, 0, 0, 100, 10, 80,
1616 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
1617 52, 0, 12, 0, 17, 0, 1, 0, 0, 0,
1618 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1619 0, 0, 0, 0,
1620 /* T56 Object */
1621 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1622 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1623 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1624 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1625 2, 99, 33,
1626};
1627
1628/* configuration data for mxt1386e using V2.1 firmware */
1629static const u8 mxt1386e_config_data_v2_1[] = {
1630 /* T6 Object */
1631 0, 0, 0, 0, 0, 0,
1632 /* T38 Object */
1633 12, 2, 0, 17, 1, 12, 0, 0, 0, 0,
1634 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1635 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1636 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1637 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1638 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1639 0, 0, 0, 0,
1640 /* T7 Object */
1641 100, 16, 50,
1642 /* T8 Object */
1643 25, 0, 20, 20, 0, 0, 20, 50, 0, 0,
1644 /* T9 Object */
1645 131, 0, 0, 26, 42, 0, 32, 80, 2, 5,
1646 0, 5, 5, 0, 10, 30, 10, 10, 255, 2,
1647 85, 5, 10, 10, 10, 10, 135, 55, 70, 40,
1648 10, 5, 0, 0, 0,
1649 /* T18 Object */
1650 0, 0,
1651 /* T24 Object */
1652 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1653 0, 0, 0, 0, 0, 0, 0, 0, 0,
1654 /* T25 Object */
1655 3, 0, 60, 115, 156, 99,
1656 /* T27 Object */
1657 0, 0, 0, 0, 0, 0, 0,
1658 /* T40 Object */
1659 0, 0, 0, 0, 0,
1660 /* T42 Object */
1661 2, 0, 255, 0, 255, 0, 0, 0, 0, 0,
1662 /* T43 Object */
1663 0, 0, 0, 0, 0, 0, 0, 64, 0, 8,
1664 16,
1665 /* T46 Object */
1666 64, 0, 20, 20, 0, 0, 0, 0, 0,
1667 /* T47 Object */
1668 0, 0, 0, 0, 0, 0, 3, 64, 66, 0,
1669 /* T48 Object */
1670 31, 64, 64, 0, 0, 0, 0, 0, 0, 0,
1671 48, 40, 0, 10, 10, 0, 0, 100, 10, 80,
1672 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
1673 52, 0, 12, 0, 17, 0, 1, 0, 0, 0,
1674 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1675 0, 0, 0, 0,
1676 /* T56 Object */
1677 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1678 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1679 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1680 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1681 2, 99, 33, 0, 149, 24, 193, 255, 255, 255,
1682 255,
1683};
1684
Amy Maloche08266db2011-11-04 11:07:16 -07001685#define MXT_TS_GPIO_IRQ 11
1686#define MXT_TS_LDO_EN_GPIO 50
1687#define MXT_TS_RESET_GPIO 52
Mohan Pallaka50837382011-09-07 11:00:57 +05301688
1689static void mxt_init_hw_liquid(void)
1690{
1691 int rc;
1692
Mohan Pallaka50837382011-09-07 11:00:57 +05301693 rc = gpio_request(MXT_TS_LDO_EN_GPIO, "mxt_ldo_en_gpio");
1694 if (rc) {
Amy Maloche08266db2011-11-04 11:07:16 -07001695 pr_err("%s: unable to request mxt_ldo_en_gpio [%d]\n",
1696 __func__, MXT_TS_LDO_EN_GPIO);
1697 return;
Mohan Pallaka50837382011-09-07 11:00:57 +05301698 }
1699
1700 rc = gpio_direction_output(MXT_TS_LDO_EN_GPIO, 1);
1701 if (rc) {
Amy Maloche08266db2011-11-04 11:07:16 -07001702 pr_err("%s: unable to set_direction for mxt_ldo_en_gpio [%d]\n",
1703 __func__, MXT_TS_LDO_EN_GPIO);
Mohan Pallaka50837382011-09-07 11:00:57 +05301704 goto err_ldo_gpio_req;
1705 }
1706
Mohan Pallaka50837382011-09-07 11:00:57 +05301707 return;
1708
Mohan Pallaka50837382011-09-07 11:00:57 +05301709err_ldo_gpio_req:
1710 gpio_free(MXT_TS_LDO_EN_GPIO);
Mohan Pallaka50837382011-09-07 11:00:57 +05301711}
1712
Jing Lindc4413c2012-01-16 15:22:52 -08001713static struct mxt_config_info mxt_config_array[] = {
1714 {
1715 .config = mxt1386_config_data,
1716 .config_length = ARRAY_SIZE(mxt1386_config_data),
1717 .family_id = 0xA0,
1718 .variant_id = 0x0,
1719 .version = 0x10,
1720 .build = 0xAA,
1721 },
Jing Lin33b007d2011-12-21 17:40:23 -08001722 {
1723 .config = mxt1386e_config_data_v1_0,
1724 .config_length = ARRAY_SIZE(mxt1386e_config_data_v1_0),
1725 .family_id = 0xA0,
1726 .variant_id = 0x2,
1727 .version = 0x10,
1728 .build = 0xAA,
1729 },
1730 {
1731 .config = mxt1386e_config_data_v2_1,
1732 .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1),
1733 .family_id = 0xA0,
1734 .variant_id = 0x7,
1735 .version = 0x21,
1736 .build = 0xAA,
1737 },
Jing Lindc4413c2012-01-16 15:22:52 -08001738};
1739
Mohan Pallaka50837382011-09-07 11:00:57 +05301740static struct mxt_platform_data mxt_platform_data = {
Jing Lindc4413c2012-01-16 15:22:52 -08001741 .config_array = mxt_config_array,
1742 .config_array_size = ARRAY_SIZE(mxt_config_array),
Jing Lin2f863172011-10-17 10:56:58 -07001743 .x_size = 1365,
1744 .y_size = 767,
Mohan Pallaka50837382011-09-07 11:00:57 +05301745 .irqflags = IRQF_TRIGGER_FALLING,
Jing Lin2f863172011-10-17 10:56:58 -07001746 .i2c_pull_up = true,
Amy Maloche08266db2011-11-04 11:07:16 -07001747 .reset_gpio = MXT_TS_RESET_GPIO,
1748 .irq_gpio = MXT_TS_GPIO_IRQ,
Mohan Pallaka50837382011-09-07 11:00:57 +05301749};
1750
1751static struct i2c_board_info mxt_device_info[] __initdata = {
1752 {
1753 I2C_BOARD_INFO("atmel_mxt_ts", 0x5b),
1754 .platform_data = &mxt_platform_data,
1755 .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ),
1756 },
1757};
1758
Eugene Yasmand2316b82011-12-07 18:23:48 +02001759static struct i2c_board_info sii_device_info[] __initdata = {
1760 {
1761 I2C_BOARD_INFO("Sil-9244", 0x39),
1762 .flags = I2C_CLIENT_WAKE,
1763 .irq = MSM_GPIO_TO_INT(15),
1764 },
1765};
1766
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001767static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi4_pdata = {
1768 .clk_freq = 100000,
1769 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001770};
1771
1772static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi3_pdata = {
1773 .clk_freq = 100000,
1774 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001775};
1776
1777static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi10_pdata = {
1778 .clk_freq = 100000,
1779 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001780};
1781
1782static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi12_pdata = {
1783 .clk_freq = 100000,
1784 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001785};
1786
Maheshkumar Sivasubramanian6866b1c2011-06-07 14:20:33 -06001787static struct msm_pm_sleep_status_data msm_pm_slp_sts_data = {
1788 .base_addr = MSM_ACC0_BASE + 0x08,
1789 .cpu_offset = MSM_ACC1_BASE - MSM_ACC0_BASE,
1790 .mask = 1UL << 13,
1791};
1792
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -07001793static struct ks8851_pdata spi_eth_pdata = {
1794 .irq_gpio = KS8851_IRQ_GPIO,
1795 .rst_gpio = KS8851_RST_GPIO,
1796};
Praveen Chidambaram043f4ce2011-08-02 09:37:59 -06001797
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001798static struct spi_board_info spi_board_info[] __initdata = {
1799 {
1800 .modalias = "ks8851",
1801 .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
1802 .max_speed_hz = 19200000,
1803 .bus_num = 0,
1804 .chip_select = 0,
1805 .mode = SPI_MODE_0,
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -07001806 .platform_data = &spi_eth_pdata
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001807 },
Chandan Uddaraju15e54b92011-09-12 10:52:36 -07001808 {
1809 .modalias = "dsi_novatek_3d_panel_spi",
1810 .max_speed_hz = 10800000,
1811 .bus_num = 0,
1812 .chip_select = 1,
1813 .mode = SPI_MODE_0,
1814 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001815};
1816
1817static struct platform_device msm_device_saw_core0 = {
1818 .name = "saw-regulator",
1819 .id = 0,
1820 .dev = {
1821 .platform_data = &msm_saw_regulator_pdata_s5,
1822 },
1823};
1824
1825static struct platform_device msm_device_saw_core1 = {
1826 .name = "saw-regulator",
1827 .id = 1,
1828 .dev = {
1829 .platform_data = &msm_saw_regulator_pdata_s6,
1830 },
1831};
1832
Siddartha Mohanadossba21fdd2011-08-18 10:05:27 -07001833static struct tsens_platform_data msm_tsens_pdata = {
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -08001834 .slope = {910, 910, 910, 910, 910},
Siddartha Mohanadossba21fdd2011-08-18 10:05:27 -07001835 .tsens_factor = 1000,
1836 .hw_type = MSM_8960,
1837 .tsens_num_sensor = 5,
1838};
1839
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001840#ifdef CONFIG_MSM_FAKE_BATTERY
1841static struct platform_device fish_battery_device = {
1842 .name = "fish_battery",
1843};
1844#endif
1845
David Collins26f05562011-06-20 09:56:28 -07001846static struct platform_device msm8960_device_ext_5v_vreg __devinitdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001847 .name = GPIO_REGULATOR_DEV_NAME,
1848 .id = PM8921_MPP_PM_TO_SYS(7),
1849 .dev = {
1850 .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V],
1851 },
1852};
1853
David Collins26f05562011-06-20 09:56:28 -07001854static struct platform_device msm8960_device_ext_l2_vreg __devinitdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001855 .name = GPIO_REGULATOR_DEV_NAME,
1856 .id = 91,
1857 .dev = {
1858 .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_L2],
1859 },
1860};
1861
David Collinsb10be1d2011-09-02 10:29:31 -07001862static struct platform_device msm8960_device_ext_3p3v_vreg __devinitdata = {
1863 .name = GPIO_REGULATOR_DEV_NAME,
1864 .id = PM8921_GPIO_PM_TO_SYS(17),
1865 .dev = {
1866 .platform_data =
1867 &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V],
1868 },
1869};
1870
David Collins35a78f52011-12-14 15:54:25 -08001871static struct platform_device msm8960_device_ext_otg_sw_vreg __devinitdata = {
1872 .name = GPIO_REGULATOR_DEV_NAME,
1873 .id = PM8921_GPIO_PM_TO_SYS(42),
1874 .dev = {
1875 .platform_data =
1876 &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_OTG_SW],
1877 },
1878};
1879
David Collins26f05562011-06-20 09:56:28 -07001880static struct platform_device msm8960_device_rpm_regulator __devinitdata = {
1881 .name = "rpm-regulator",
1882 .id = -1,
1883 .dev = {
1884 .platform_data = &msm_rpm_regulator_pdata,
1885 },
1886};
1887
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001888static struct platform_device *common_devices[] __initdata = {
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -07001889 &msm8960_device_dmov,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001890 &msm_device_smd,
1891 &msm8960_device_uart_gsbi5,
Mayank Rana9f51f582011-08-04 18:35:59 +05301892 &msm_device_uart_dm6,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001893 &msm_device_saw_core0,
1894 &msm_device_saw_core1,
1895 &msm8960_device_ext_5v_vreg,
David Collins35a78f52011-12-14 15:54:25 -08001896 &msm8960_device_ext_otg_sw_vreg,
David Collins87579612012-01-30 16:00:15 -08001897 &msm8960_device_ssbi_pmic,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001898 &msm8960_device_qup_spi_gsbi1,
1899 &msm8960_device_qup_i2c_gsbi3,
1900 &msm8960_device_qup_i2c_gsbi4,
1901 &msm8960_device_qup_i2c_gsbi10,
1902#ifndef CONFIG_MSM_DSPS
1903 &msm8960_device_qup_i2c_gsbi12,
1904#endif
1905 &msm_slim_ctrl,
1906 &msm_device_wcnss_wlan,
1907#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1908 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1909 &qcrypto_device,
1910#endif
1911
1912#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1913 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1914 &qcedev_device,
1915#endif
1916#ifdef CONFIG_MSM_ROTATOR
1917 &msm_rotator_device,
1918#endif
1919 &msm_device_sps,
1920#ifdef CONFIG_MSM_FAKE_BATTERY
1921 &fish_battery_device,
1922#endif
Larry Bassel41a055b2011-12-06 16:15:14 -08001923 &fmem_device,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001924#ifdef CONFIG_ANDROID_PMEM
Laura Abbott2d1760b2011-09-29 21:31:24 -07001925#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001926 &android_pmem_device,
1927 &android_pmem_adsp_device,
Laura Abbott2d1760b2011-09-29 21:31:24 -07001928#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001929 &android_pmem_audio_device,
1930#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001931 &msm_device_vidc,
1932 &msm_device_bam_dmux,
1933 &msm_fm_platform_init,
Mona Hossain9c430e32011-07-27 11:04:47 -07001934
1935#ifdef CONFIG_HW_RANDOM_MSM
1936 &msm_device_rng,
1937#endif
Laura Abbottd6183792011-08-19 13:42:24 -07001938#ifdef CONFIG_ION_MSM
1939 &ion_dev,
1940#endif
Praveen Chidambaram78499012011-11-01 17:15:17 -06001941 &msm8960_rpm_device,
1942 &msm8960_rpm_log_device,
1943 &msm8960_rpm_stat_device,
Mona Hossain11c03ac2011-10-26 12:42:10 -07001944 &msm_device_tz_log,
Pratik Patel7831c082011-06-08 21:44:37 -07001945#ifdef CONFIG_MSM_QDSS
1946 &msm_etb_device,
1947 &msm_tpiu_device,
1948 &msm_funnel_device,
1949 &msm_ptm_device,
1950#endif
Swaminathan Sathappanb77c65e92011-09-30 18:36:09 -07001951 &msm_device_dspcrashd_8960,
Jeff Ohlstein7e668552011-10-06 16:17:25 -07001952 &msm8960_device_watchdog,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001953};
1954
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08001955static struct platform_device *sim_devices[] __initdata = {
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07001956 &msm8960_device_otg,
1957 &msm8960_device_gadget_peripheral,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001958 &msm_device_hsusb_host,
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +05301959 &msm_device_hsic_host,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001960 &android_usb_device,
1961 &msm_device_vidc,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001962 &msm_bus_apps_fabric,
1963 &msm_bus_sys_fabric,
1964 &msm_bus_mm_fabric,
1965 &msm_bus_sys_fpb,
1966 &msm_bus_cpss_fpb,
1967 &msm_pcm,
Kiran Kandi5e809b02012-01-31 00:24:33 -08001968 &msm_multi_ch_pcm,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001969 &msm_pcm_routing,
1970 &msm_cpudai0,
1971 &msm_cpudai1,
1972 &msm_cpudai_hdmi_rx,
1973 &msm_cpudai_bt_rx,
1974 &msm_cpudai_bt_tx,
1975 &msm_cpudai_fm_rx,
1976 &msm_cpudai_fm_tx,
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001977 &msm_cpudai_auxpcm_rx,
1978 &msm_cpudai_auxpcm_tx,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001979 &msm_cpu_fe,
1980 &msm_stub_codec,
1981 &msm_voice,
1982 &msm_voip,
1983 &msm_lpa_pcm,
Asish Bhattacharya96bb6f42011-11-01 20:36:09 +05301984 &msm_compr_dsp,
Helen Zeng0705a5f2011-10-14 15:29:52 -07001985 &msm_cpudai_incall_music_rx,
Helen Zenge3d716a2011-10-14 16:32:16 -07001986 &msm_cpudai_incall_record_rx,
1987 &msm_cpudai_incall_record_tx,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001988
1989#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1990 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1991 &qcrypto_device,
1992#endif
1993
1994#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1995 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1996 &qcedev_device,
1997#endif
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08001998};
1999
2000static struct platform_device *rumi3_devices[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002001 &msm_kgsl_3d0,
2002 &msm_kgsl_2d0,
2003 &msm_kgsl_2d1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002004#ifdef CONFIG_MSM_GEMINI
2005 &msm8960_gemini_device,
2006#endif
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002007};
2008
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002009static struct platform_device *cdp_devices[] __initdata = {
Stephen Boydeb819882011-08-29 14:46:30 -07002010 &msm_8960_q6_lpass,
2011 &msm_8960_q6_mss_fw,
2012 &msm_8960_q6_mss_sw,
Stephen Boyd322a9922011-09-20 01:05:54 -07002013 &msm_8960_riva,
Stephen Boydd89eebe2011-09-28 23:28:11 -07002014 &msm_pil_tzapps,
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002015 &msm8960_device_otg,
2016 &msm8960_device_gadget_peripheral,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002017 &msm_device_hsusb_host,
2018 &android_usb_device,
2019 &msm_pcm,
Kiran Kandi5e809b02012-01-31 00:24:33 -08002020 &msm_multi_ch_pcm,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002021 &msm_pcm_routing,
2022 &msm_cpudai0,
2023 &msm_cpudai1,
2024 &msm_cpudai_hdmi_rx,
2025 &msm_cpudai_bt_rx,
2026 &msm_cpudai_bt_tx,
2027 &msm_cpudai_fm_rx,
2028 &msm_cpudai_fm_tx,
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07002029 &msm_cpudai_auxpcm_rx,
2030 &msm_cpudai_auxpcm_tx,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002031 &msm_cpu_fe,
2032 &msm_stub_codec,
2033 &msm_kgsl_3d0,
2034#ifdef CONFIG_MSM_KGSL_2D
2035 &msm_kgsl_2d0,
2036 &msm_kgsl_2d1,
2037#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002038#ifdef CONFIG_MSM_GEMINI
2039 &msm8960_gemini_device,
2040#endif
2041 &msm_voice,
2042 &msm_voip,
2043 &msm_lpa_pcm,
Laxminath Kasamcee1d602011-08-01 19:26:57 +05302044 &msm_cpudai_afe_01_rx,
2045 &msm_cpudai_afe_01_tx,
2046 &msm_cpudai_afe_02_rx,
2047 &msm_cpudai_afe_02_tx,
2048 &msm_pcm_afe,
Asish Bhattacharya96bb6f42011-11-01 20:36:09 +05302049 &msm_compr_dsp,
Helen Zeng0705a5f2011-10-14 15:29:52 -07002050 &msm_cpudai_incall_music_rx,
Helen Zenge3d716a2011-10-14 16:32:16 -07002051 &msm_cpudai_incall_record_rx,
2052 &msm_cpudai_incall_record_tx,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002053 &msm_pcm_hostless,
2054 &msm_bus_apps_fabric,
2055 &msm_bus_sys_fabric,
2056 &msm_bus_mm_fabric,
2057 &msm_bus_sys_fpb,
2058 &msm_bus_cpss_fpb,
2059};
2060
2061static void __init msm8960_i2c_init(void)
2062{
2063 msm8960_device_qup_i2c_gsbi4.dev.platform_data =
2064 &msm8960_i2c_qup_gsbi4_pdata;
2065
2066 msm8960_device_qup_i2c_gsbi3.dev.platform_data =
2067 &msm8960_i2c_qup_gsbi3_pdata;
2068
2069 msm8960_device_qup_i2c_gsbi10.dev.platform_data =
2070 &msm8960_i2c_qup_gsbi10_pdata;
2071
2072 msm8960_device_qup_i2c_gsbi12.dev.platform_data =
2073 &msm8960_i2c_qup_gsbi12_pdata;
2074}
2075
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002076static void __init msm8960_gfx_init(void)
2077{
Jeremy Gebben58b2dce2011-10-13 11:14:19 -06002078 uint32_t soc_platform_version = socinfo_get_version();
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002079 if (SOCINFO_VERSION_MAJOR(soc_platform_version) == 1) {
2080 struct kgsl_device_platform_data *kgsl_3d0_pdata =
2081 msm_kgsl_3d0.dev.platform_data;
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002082 kgsl_3d0_pdata->pwrlevel[0].gpu_freq = 320000000;
2083 kgsl_3d0_pdata->pwrlevel[1].gpu_freq = 266667000;
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002084 }
2085}
2086
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002087static struct msm_cpuidle_state msm_cstates[] __initdata = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06002088
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002089 {0, 0, "C0", "WFI",
2090 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
2091
2092 {0, 1, "C1", "STANDALONE_POWER_COLLAPSE",
2093 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
2094
2095 {0, 2, "C2", "POWER_COLLAPSE",
2096 MSM_PM_SLEEP_MODE_POWER_COLLAPSE},
2097
2098 {1, 0, "C0", "WFI",
2099 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
2100
2101 {1, 1, "C1", "STANDALONE_POWER_COLLAPSE",
2102 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
2103};
2104
2105static struct msm_pm_platform_data msm_pm_data[MSM_PM_SLEEP_MODE_NR * 2] = {
2106 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
2107 .idle_supported = 1,
2108 .suspend_supported = 1,
2109 .idle_enabled = 0,
2110 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002111 },
2112
2113 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
2114 .idle_supported = 1,
2115 .suspend_supported = 1,
2116 .idle_enabled = 0,
2117 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002118 },
2119
2120 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
2121 .idle_supported = 1,
2122 .suspend_supported = 1,
2123 .idle_enabled = 1,
2124 .suspend_enabled = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002125 },
2126
2127 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
2128 .idle_supported = 0,
2129 .suspend_supported = 1,
2130 .idle_enabled = 0,
2131 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002132 },
2133
2134 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
2135 .idle_supported = 1,
2136 .suspend_supported = 1,
2137 .idle_enabled = 0,
2138 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002139 },
2140
2141 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
2142 .idle_supported = 1,
2143 .suspend_supported = 0,
2144 .idle_enabled = 1,
2145 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002146 },
2147};
2148
Subhash Jadavani933e6a62011-12-26 18:05:04 +05302149static struct msm_rpmrs_level msm_rpmrs_levels[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002150 {
2151 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
2152 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
2153 true,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06002154 100, 8000, 100000, 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002155 },
2156
2157 {
2158 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
2159 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
2160 true,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06002161 2000, 6000, 60100000, 3000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002162 },
2163
2164 {
2165 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2166 MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE),
2167 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06002168 4200, 5000, 60350000, 3500,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002169 },
2170
2171 {
2172 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2173 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, MAX, ACTIVE),
2174 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06002175 6300, 4500, 65350000, 4800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002176 },
Maheshkumar Sivasubramanian7df12362011-11-02 08:25:49 -06002177 {
2178 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2179 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, ACTIVE, RET_HIGH),
2180 false,
2181 7000, 3500, 66600000, 5150,
2182 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002183
2184 {
2185 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2186 MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE),
2187 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06002188 11700, 2500, 67850000, 5500,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002189 },
2190
2191 {
2192 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2193 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
2194 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06002195 13800, 2000, 71850000, 6800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002196 },
2197
2198 {
2199 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2200 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH),
2201 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06002202 29700, 500, 75850000, 8800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002203 },
2204
2205 {
2206 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2207 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
2208 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06002209 29700, 0, 76350000, 9800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002210 },
2211};
2212
Praveen Chidambaram78499012011-11-01 17:15:17 -06002213static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = {
2214 .levels = &msm_rpmrs_levels[0],
2215 .num_levels = ARRAY_SIZE(msm_rpmrs_levels),
2216 .vdd_mem_levels = {
2217 [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000,
2218 [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000,
2219 [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000,
2220 [MSM_RPMRS_VDD_MEM_MAX] = 1150000,
2221 },
2222 .vdd_dig_levels = {
2223 [MSM_RPMRS_VDD_DIG_RET_LOW] = 500000,
2224 [MSM_RPMRS_VDD_DIG_RET_HIGH] = 750000,
2225 [MSM_RPMRS_VDD_DIG_ACTIVE] = 950000,
2226 [MSM_RPMRS_VDD_DIG_MAX] = 1150000,
2227 },
2228 .vdd_mask = 0x7FFFFF,
2229 .rpmrs_target_id = {
2230 [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK,
2231 [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST,
2232 [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_PM8921_S3_0,
2233 [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_PM8921_S3_1,
2234 [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8921_L24_0,
2235 [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8921_L24_1,
2236 [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL,
2237 },
2238};
2239
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -06002240static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
2241 .mode = MSM_PM_BOOT_CONFIG_TZ,
2242};
2243
Subhash Jadavani933e6a62011-12-26 18:05:04 +05302244uint32_t msm_rpm_get_swfi_latency(void)
2245{
2246 int i;
2247
2248 for (i = 0; i < ARRAY_SIZE(msm_rpmrs_levels); i++) {
2249 if (msm_rpmrs_levels[i].sleep_mode ==
2250 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)
2251 return msm_rpmrs_levels[i].latency_us;
2252 }
2253
2254 return 0;
2255}
2256
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002257#ifdef CONFIG_I2C
2258#define I2C_SURF 1
2259#define I2C_FFA (1 << 1)
2260#define I2C_RUMI (1 << 2)
2261#define I2C_SIM (1 << 3)
2262#define I2C_FLUID (1 << 4)
Amir Samuelov05f87802011-08-27 18:30:12 +03002263#define I2C_LIQUID (1 << 5)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002264
2265struct i2c_registry {
2266 u8 machs;
2267 int bus;
2268 struct i2c_board_info *info;
2269 int len;
2270};
2271
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002272/* Sensors DSPS platform data */
2273#ifdef CONFIG_MSM_DSPS
2274#define DSPS_PIL_GENERIC_NAME "dsps"
2275#endif /* CONFIG_MSM_DSPS */
2276
2277static void __init msm8960_init_dsps(void)
2278{
2279#ifdef CONFIG_MSM_DSPS
2280 struct msm_dsps_platform_data *pdata =
2281 msm_dsps_device.dev.platform_data;
2282 pdata->pil_name = DSPS_PIL_GENERIC_NAME;
2283 pdata->gpios = NULL;
2284 pdata->gpios_num = 0;
2285
2286 platform_device_register(&msm_dsps_device);
2287#endif /* CONFIG_MSM_DSPS */
2288}
2289
Vamsi Krishna6aa6b1f2011-12-14 22:55:20 -08002290static int hsic_peripheral_status = 1;
2291static DEFINE_MUTEX(hsic_status_lock);
2292
2293void peripheral_connect()
2294{
2295 mutex_lock(&hsic_status_lock);
2296 if (hsic_peripheral_status)
2297 goto out;
2298 platform_device_add(&msm_device_hsic_host);
2299 hsic_peripheral_status = 1;
2300out:
2301 mutex_unlock(&hsic_status_lock);
2302}
2303EXPORT_SYMBOL(peripheral_connect);
2304
2305void peripheral_disconnect()
2306{
2307 mutex_lock(&hsic_status_lock);
2308 if (!hsic_peripheral_status)
2309 goto out;
2310 platform_device_del(&msm_device_hsic_host);
2311 hsic_peripheral_status = 0;
2312out:
2313 mutex_unlock(&hsic_status_lock);
2314}
2315EXPORT_SYMBOL(peripheral_disconnect);
2316
Vamsi Krishna98f54fb2011-11-02 14:55:41 -07002317static void __init msm8960_init_hsic(void)
2318{
2319#ifdef CONFIG_USB_EHCI_MSM_HSIC
2320 uint32_t version = socinfo_get_version();
2321
Vamsi Krishnaf74d2edb2011-12-02 10:41:11 -08002322 if (SOCINFO_VERSION_MAJOR(version) == 1)
Vamsi Krishna98f54fb2011-11-02 14:55:41 -07002323 return;
2324
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08002325 if (PLATFORM_IS_CHARM25() || machine_is_msm8960_liquid())
Vamsi Krishnaf74d2edb2011-12-02 10:41:11 -08002326 platform_device_register(&msm_device_hsic_host);
Vamsi Krishna98f54fb2011-11-02 14:55:41 -07002327#endif
2328}
2329
Amir Samuelov5137e392011-09-21 17:31:25 +03002330#ifdef CONFIG_ISL9519_CHARGER
2331static struct isl_platform_data isl_data __initdata = {
2332 .valid_n_gpio = 0, /* Not required when notify-by-pmic */
2333 .chg_detection_config = NULL, /* Not required when notify-by-pmic */
2334 .max_system_voltage = 4200,
2335 .min_system_voltage = 3200,
Amir Samuelov95f49ff2012-01-29 09:14:08 +02002336 .chgcurrent = 1900,
2337 .term_current = 0,
Amir Samuelov5137e392011-09-21 17:31:25 +03002338 .input_current = 2048,
2339};
2340
2341static struct i2c_board_info isl_charger_i2c_info[] __initdata = {
2342 {
2343 I2C_BOARD_INFO("isl9519q", 0x9),
2344 .irq = 0, /* Not required when notify-by-pmic */
2345 .platform_data = &isl_data,
2346 },
2347};
2348#endif /* CONFIG_ISL9519_CHARGER */
2349
Amir Samuelov755616d2011-12-13 16:34:46 +02002350static struct i2c_board_info liquid_io_expander_i2c_info[] __initdata = {
2351 {
2352 I2C_BOARD_INFO("sx1508q", 0x20),
2353 .platform_data = &msm8960_sx150x_data[SX150X_LIQUID]
2354 },
2355};
2356
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002357static struct i2c_registry msm8960_i2c_devices[] __initdata = {
Amir Samuelov5137e392011-09-21 17:31:25 +03002358#ifdef CONFIG_ISL9519_CHARGER
2359 {
2360 I2C_LIQUID,
2361 MSM_8960_GSBI10_QUP_I2C_BUS_ID,
2362 isl_charger_i2c_info,
2363 ARRAY_SIZE(isl_charger_i2c_info),
2364 },
2365#endif /* CONFIG_ISL9519_CHARGER */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002366 {
2367 I2C_SURF | I2C_FFA | I2C_FLUID,
2368 MSM_8960_GSBI3_QUP_I2C_BUS_ID,
2369 cyttsp_info,
2370 ARRAY_SIZE(cyttsp_info),
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -07002371 },
Mohan Pallaka50837382011-09-07 11:00:57 +05302372 {
2373 I2C_LIQUID,
2374 MSM_8960_GSBI3_QUP_I2C_BUS_ID,
2375 mxt_device_info,
2376 ARRAY_SIZE(mxt_device_info),
2377 },
Mohan Pallaka5e490392011-09-09 15:18:41 +05302378 {
Mohan Pallakaf69f0492011-11-21 13:08:33 +05302379 I2C_FFA | I2C_LIQUID,
Mohan Pallaka5e490392011-09-09 15:18:41 +05302380 MSM_8960_GSBI10_QUP_I2C_BUS_ID,
Eugene Yasmand2316b82011-12-07 18:23:48 +02002381 sii_device_info,
2382 ARRAY_SIZE(sii_device_info),
2383 },
2384 {
2385 I2C_LIQUID,
2386 MSM_8960_GSBI10_QUP_I2C_BUS_ID,
Mohan Pallaka5e490392011-09-09 15:18:41 +05302387 msm_isa1200_board_info,
2388 ARRAY_SIZE(msm_isa1200_board_info),
2389 },
Amir Samuelov755616d2011-12-13 16:34:46 +02002390 {
2391 I2C_LIQUID,
2392 MSM_8960_GSBI10_QUP_I2C_BUS_ID,
2393 liquid_io_expander_i2c_info,
2394 ARRAY_SIZE(liquid_io_expander_i2c_info),
2395 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002396};
2397#endif /* CONFIG_I2C */
2398
2399static void __init register_i2c_devices(void)
2400{
2401#ifdef CONFIG_I2C
2402 u8 mach_mask = 0;
2403 int i;
Kevin Chan09f4e662011-12-16 08:17:02 -08002404#ifdef CONFIG_MSM_CAMERA
2405 struct i2c_registry msm8960_camera_i2c_devices = {
2406 I2C_SURF | I2C_FFA | I2C_FLUID | I2C_LIQUID | I2C_RUMI,
2407 MSM_8960_GSBI4_QUP_I2C_BUS_ID,
2408 msm8960_camera_board_info.board_info,
2409 msm8960_camera_board_info.num_i2c_board_info,
2410 };
2411#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002412
2413 /* Build the matching 'supported_machs' bitmask */
2414 if (machine_is_msm8960_cdp())
2415 mach_mask = I2C_SURF;
2416 else if (machine_is_msm8960_rumi3())
2417 mach_mask = I2C_RUMI;
2418 else if (machine_is_msm8960_sim())
2419 mach_mask = I2C_SIM;
Amy Maloche2d028032011-07-20 14:08:06 -07002420 else if (machine_is_msm8960_fluid())
2421 mach_mask = I2C_FLUID;
Amir Samuelov05f87802011-08-27 18:30:12 +03002422 else if (machine_is_msm8960_liquid())
2423 mach_mask = I2C_LIQUID;
Amy Maloche1b0663f2011-08-02 16:46:22 -07002424 else if (machine_is_msm8960_mtp())
2425 mach_mask = I2C_FFA;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002426 else
2427 pr_err("unmatched machine ID in register_i2c_devices\n");
2428
2429 /* Run the array and install devices as appropriate */
2430 for (i = 0; i < ARRAY_SIZE(msm8960_i2c_devices); ++i) {
2431 if (msm8960_i2c_devices[i].machs & mach_mask)
2432 i2c_register_board_info(msm8960_i2c_devices[i].bus,
2433 msm8960_i2c_devices[i].info,
2434 msm8960_i2c_devices[i].len);
2435 }
Kevin Chan09f4e662011-12-16 08:17:02 -08002436#ifdef CONFIG_MSM_CAMERA
2437 if (msm8960_camera_i2c_devices.machs & mach_mask)
2438 i2c_register_board_info(msm8960_camera_i2c_devices.bus,
2439 msm8960_camera_i2c_devices.info,
2440 msm8960_camera_i2c_devices.len);
2441#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002442#endif
2443}
2444
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002445static void __init msm8960_sim_init(void)
2446{
Jeff Ohlstein7e668552011-10-06 16:17:25 -07002447 struct msm_watchdog_pdata *wdog_pdata = (struct msm_watchdog_pdata *)
2448 &msm8960_device_watchdog.dev.platform_data;
2449
2450 wdog_pdata->bark_time = 15000;
Siddartha Mohanadossfad0af12012-01-20 15:08:38 -08002451 msm_tsens_early_init(&msm_tsens_pdata);
Praveen Chidambaram78499012011-11-01 17:15:17 -06002452 BUG_ON(msm_rpm_init(&msm8960_rpm_data));
2453 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002454 regulator_suppress_info_printing();
David Collins26f05562011-06-20 09:56:28 -07002455 platform_device_register(&msm8960_device_rpm_regulator);
Stephen Boydbb600ae2011-08-02 20:11:40 -07002456 msm_clock_init(&msm8960_clock_init_data);
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08002457 msm8960_init_pmic();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002458
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002459 msm8960_device_otg.dev.platform_data = &msm_otg_pdata;
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08002460 msm8960_init_gpiomux();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002461 msm8960_i2c_init();
2462 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
2463 msm_spm_l2_init(msm_spm_l2_data);
2464 msm8960_init_buses();
2465 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08002466 msm8960_pm8921_gpio_mpp_init();
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002467 platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices));
Matt Wagantallec57f062011-08-16 23:54:46 -07002468 acpuclk_init(&acpuclk_8960_soc_data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002469
2470 msm8960_device_qup_spi_gsbi1.dev.platform_data =
2471 &msm8960_qup_spi_gsbi1_pdata;
2472 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
2473
2474 msm8960_init_mmc();
Stepan Moskovchenko24cd8642011-11-29 13:07:53 -08002475 msm8960_init_fb();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002476 slim_register_board_info(msm_slim_devices,
2477 ARRAY_SIZE(msm_slim_devices));
2478 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
2479 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
2480 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
2481 msm_pm_data);
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -06002482 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Maheshkumar Sivasubramanian6866b1c2011-06-07 14:20:33 -06002483 msm_pm_init_sleep_status_data(&msm_pm_slp_sts_data);
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002484}
2485
2486static void __init msm8960_rumi3_init(void)
2487{
Siddartha Mohanadossfad0af12012-01-20 15:08:38 -08002488 msm_tsens_early_init(&msm_tsens_pdata);
Praveen Chidambaram78499012011-11-01 17:15:17 -06002489 BUG_ON(msm_rpm_init(&msm8960_rpm_data));
2490 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002491 regulator_suppress_info_printing();
David Collins26f05562011-06-20 09:56:28 -07002492 platform_device_register(&msm8960_device_rpm_regulator);
Stephen Boydbb600ae2011-08-02 20:11:40 -07002493 msm_clock_init(&msm8960_dummy_clock_init_data);
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08002494 msm8960_init_gpiomux();
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08002495 msm8960_init_pmic();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002496 msm8960_device_qup_spi_gsbi1.dev.platform_data =
2497 &msm8960_qup_spi_gsbi1_pdata;
2498 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
2499 msm8960_i2c_init();
2500 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
2501 msm_spm_l2_init(msm_spm_l2_data);
2502 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08002503 msm8960_pm8921_gpio_mpp_init();
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002504 platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002505 msm8960_init_mmc();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002506 register_i2c_devices();
Stepan Moskovchenko24cd8642011-11-29 13:07:53 -08002507 msm8960_init_fb();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002508 slim_register_board_info(msm_slim_devices,
2509 ARRAY_SIZE(msm_slim_devices));
2510 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
2511 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
2512 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
2513 msm_pm_data);
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -06002514 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Maheshkumar Sivasubramanian6866b1c2011-06-07 14:20:33 -06002515 msm_pm_init_sleep_status_data(&msm_pm_slp_sts_data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002516}
2517
2518static void __init msm8960_cdp_init(void)
2519{
Naveen Ramaraj76483ad2011-09-06 14:25:44 -07002520 if (meminfo_init(SYS_MEMORY, SZ_256M) < 0)
2521 pr_err("meminfo_init() failed!\n");
2522
Siddartha Mohanadossfad0af12012-01-20 15:08:38 -08002523 msm_tsens_early_init(&msm_tsens_pdata);
Praveen Chidambaram78499012011-11-01 17:15:17 -06002524 BUG_ON(msm_rpm_init(&msm8960_rpm_data));
2525 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
Abhijeet Dharmapurikar6d565fd2011-09-15 18:49:56 -07002526
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002527 regulator_suppress_info_printing();
2528 if (msm_xo_init())
2529 pr_err("Failed to initialize XO votes\n");
David Collins26f05562011-06-20 09:56:28 -07002530 platform_device_register(&msm8960_device_rpm_regulator);
Stephen Boydbb600ae2011-08-02 20:11:40 -07002531 msm_clock_init(&msm8960_clock_init_data);
Vijayavardhan Vennapusafc464f02011-11-04 21:54:00 +05302532 if (machine_is_msm8960_liquid())
2533 msm_otg_pdata.mhl_enable = true;
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002534 msm8960_device_otg.dev.platform_data = &msm_otg_pdata;
Anji jonnalaa8b8d732011-12-06 10:03:24 +05302535 if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() ||
2536 machine_is_msm8960_cdp()) {
2537 msm_otg_pdata.phy_init_seq = wr_phy_init_seq;
2538 } else if (machine_is_msm8960_liquid()) {
2539 msm_otg_pdata.phy_init_seq =
2540 liquid_v1_phy_init_seq;
2541 }
Anji jonnalaa7c1c5c2011-12-12 12:20:36 +05302542 msm_otg_pdata.swfi_latency =
2543 msm_rpmrs_levels[0].latency_us;
Vijayavardhan Vennapusa2b592824f2011-11-02 19:51:32 +05302544#ifdef CONFIG_USB_EHCI_MSM_HSIC
2545 if (machine_is_msm8960_liquid()) {
2546 if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 2)
2547 msm_hsic_pdata.hub_reset = HSIC_HUB_RESET_GPIO;
2548 }
2549#endif
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +05302550 msm_device_hsic_host.dev.platform_data = &msm_hsic_pdata;
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08002551 msm8960_init_gpiomux();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002552 msm8960_device_qup_spi_gsbi1.dev.platform_data =
2553 &msm8960_qup_spi_gsbi1_pdata;
2554 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08002555
2556 msm8960_init_pmic();
Mohan Pallakaf69f0492011-11-21 13:08:33 +05302557 if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 2 &&
2558 (machine_is_msm8960_mtp())) || machine_is_msm8960_liquid())
2559 msm_isa1200_board_info[0].platform_data = &isa1200_1_pdata;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002560 msm8960_i2c_init();
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002561 msm8960_gfx_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002562 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
2563 msm_spm_l2_init(msm_spm_l2_data);
2564 msm8960_init_buses();
2565 platform_add_devices(msm_footswitch_devices,
2566 msm_num_footswitch_devices);
David Collinsb10be1d2011-09-02 10:29:31 -07002567 if (machine_is_msm8960_liquid())
2568 platform_device_register(&msm8960_device_ext_3p3v_vreg);
David Collinsd5a40732011-11-29 15:53:56 -08002569 if (machine_is_msm8960_cdp())
2570 platform_device_register(&msm8960_device_ext_l2_vreg);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002571 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08002572 msm8960_pm8921_gpio_mpp_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002573 platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
Vamsi Krishna98f54fb2011-11-02 14:55:41 -07002574 msm8960_init_hsic();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002575 msm8960_init_cam();
2576 msm8960_init_mmc();
Matt Wagantallec57f062011-08-16 23:54:46 -07002577 acpuclk_init(&acpuclk_8960_soc_data);
Mohan Pallaka50837382011-09-07 11:00:57 +05302578 if (machine_is_msm8960_liquid())
2579 mxt_init_hw_liquid();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002580 register_i2c_devices();
Stepan Moskovchenko24cd8642011-11-29 13:07:53 -08002581 msm8960_init_fb();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002582 slim_register_board_info(msm_slim_devices,
2583 ARRAY_SIZE(msm_slim_devices));
2584 msm8960_init_dsps();
2585 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
2586 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
2587 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
2588 msm_pm_data);
Larry Bassela7eadea2011-07-14 10:46:00 -07002589 change_memory_power = &msm8960_change_memory_power;
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -06002590 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Maheshkumar Sivasubramanian6866b1c2011-06-07 14:20:33 -06002591 msm_pm_init_sleep_status_data(&msm_pm_slp_sts_data);
Joel Kingb8352a12011-11-15 18:46:24 -08002592 if (PLATFORM_IS_CHARM25())
2593 platform_add_devices(mdm_devices, ARRAY_SIZE(mdm_devices));
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002594}
2595
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002596MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
2597 .map_io = msm8960_map_io,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002598 .reserve = msm8960_reserve,
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002599 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302600 .handle_irq = gic_handle_irq,
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002601 .timer = &msm_timer,
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002602 .init_machine = msm8960_sim_init,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002603 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07002604 .init_very_early = msm8960_early_memory,
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002605MACHINE_END
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08002606
2607MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3")
2608 .map_io = msm8960_map_io,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002609 .reserve = msm8960_reserve,
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08002610 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302611 .handle_irq = gic_handle_irq,
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08002612 .timer = &msm_timer,
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002613 .init_machine = msm8960_rumi3_init,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002614 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07002615 .init_very_early = msm8960_early_memory,
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08002616MACHINE_END
2617
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002618MACHINE_START(MSM8960_CDP, "QCT MSM8960 CDP")
2619 .map_io = msm8960_map_io,
2620 .reserve = msm8960_reserve,
2621 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302622 .handle_irq = gic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002623 .timer = &msm_timer,
2624 .init_machine = msm8960_cdp_init,
2625 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07002626 .init_very_early = msm8960_early_memory,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002627MACHINE_END
2628
2629MACHINE_START(MSM8960_MTP, "QCT MSM8960 MTP")
2630 .map_io = msm8960_map_io,
2631 .reserve = msm8960_reserve,
2632 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302633 .handle_irq = gic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002634 .timer = &msm_timer,
2635 .init_machine = msm8960_cdp_init,
2636 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07002637 .init_very_early = msm8960_early_memory,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002638MACHINE_END
2639
2640MACHINE_START(MSM8960_FLUID, "QCT MSM8960 FLUID")
2641 .map_io = msm8960_map_io,
2642 .reserve = msm8960_reserve,
2643 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302644 .handle_irq = gic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002645 .timer = &msm_timer,
2646 .init_machine = msm8960_cdp_init,
2647 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07002648 .init_very_early = msm8960_early_memory,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002649MACHINE_END
Amir Samuelov0d1f8ae2011-07-28 11:13:58 +03002650
2651MACHINE_START(MSM8960_LIQUID, "QCT MSM8960 LIQUID")
2652 .map_io = msm8960_map_io,
2653 .reserve = msm8960_reserve,
2654 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302655 .handle_irq = gic_handle_irq,
Amir Samuelov0d1f8ae2011-07-28 11:13:58 +03002656 .timer = &msm_timer,
2657 .init_machine = msm8960_cdp_init,
2658 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07002659 .init_very_early = msm8960_early_memory,
Amir Samuelov0d1f8ae2011-07-28 11:13:58 +03002660MACHINE_END