blob: 786ec013f4314efa11381ab1046d5da51279591a [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
Stepan Moskovchenkofc70d902011-11-30 12:39:36 -0800333static struct ion_platform_data ion_pdata = {
Laura Abbott2d1760b2011-09-29 21:31:24 -0700334 .nr = MSM_ION_HEAP_NUM,
Laura Abbottd6183792011-08-19 13:42:24 -0700335 .heaps = {
336 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800337 .id = ION_SYSTEM_HEAP_ID,
Laura Abbottd6183792011-08-19 13:42:24 -0700338 .type = ION_HEAP_TYPE_SYSTEM,
Laura Abbottd6183792011-08-19 13:42:24 -0700339 .name = ION_VMALLOC_HEAP_NAME,
340 },
Laura Abbott2d1760b2011-09-29 21:31:24 -0700341#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Laura Abbottd6183792011-08-19 13:42:24 -0700342 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800343 .id = ION_SF_HEAP_ID,
Laura Abbottd6183792011-08-19 13:42:24 -0700344 .type = ION_HEAP_TYPE_CARVEOUT,
Olav Hauganb5be7992011-11-18 14:29:02 -0800345 .name = ION_SF_HEAP_NAME,
346 .size = MSM_ION_SF_SIZE,
Laura Abbottd6183792011-08-19 13:42:24 -0700347 .memory_type = ION_EBI_TYPE,
Olav Haugan42ebe712012-01-10 16:30:58 -0800348 .extra_data = (void *) &co_ion_pdata,
Laura Abbottd6183792011-08-19 13:42:24 -0700349 },
Laura Abbott2d1760b2011-09-29 21:31:24 -0700350 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800351 .id = ION_CP_MM_HEAP_ID,
Olav Haugan0a852512012-01-09 10:20:55 -0800352 .type = ION_HEAP_TYPE_CP,
Olav Hauganb5be7992011-11-18 14:29:02 -0800353 .name = ION_MM_HEAP_NAME,
354 .size = MSM_ION_MM_SIZE,
Laura Abbott2d1760b2011-09-29 21:31:24 -0700355 .memory_type = ION_EBI_TYPE,
Olav Haugan0703dbf2011-12-19 17:53:38 -0800356 .extra_data = (void *) &cp_mm_ion_pdata,
Laura Abbott2d1760b2011-09-29 21:31:24 -0700357 },
Laura Abbott8c017362011-09-22 20:59:12 -0700358 {
Olav Haugan42ebe712012-01-10 16:30:58 -0800359 .id = ION_MM_FIRMWARE_HEAP_ID,
360 .type = ION_HEAP_TYPE_CARVEOUT,
361 .name = ION_MM_FIRMWARE_HEAP_NAME,
362 .size = MSM_ION_MM_FW_SIZE,
363 .memory_type = ION_EBI_TYPE,
364 .extra_data = (void *) &fw_co_ion_pdata,
365 },
366 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800367 .id = ION_CP_MFC_HEAP_ID,
Olav Haugan0a852512012-01-09 10:20:55 -0800368 .type = ION_HEAP_TYPE_CP,
Olav Hauganb5be7992011-11-18 14:29:02 -0800369 .name = ION_MFC_HEAP_NAME,
370 .size = MSM_ION_MFC_SIZE,
371 .memory_type = ION_EBI_TYPE,
Olav Haugan0703dbf2011-12-19 17:53:38 -0800372 .extra_data = (void *) &cp_mfc_ion_pdata,
Olav Hauganb5be7992011-11-18 14:29:02 -0800373 },
374 {
375 .id = ION_IOMMU_HEAP_ID,
Laura Abbott8c017362011-09-22 20:59:12 -0700376 .type = ION_HEAP_TYPE_IOMMU,
377 .name = ION_IOMMU_HEAP_NAME,
378 },
Olav Haugan80854eb2012-01-12 12:00:23 -0800379 {
380 .id = ION_QSECOM_HEAP_ID,
381 .type = ION_HEAP_TYPE_CARVEOUT,
382 .name = ION_QSECOM_HEAP_NAME,
383 .size = MSM_ION_QSECOM_SIZE,
384 .memory_type = ION_EBI_TYPE,
385 .extra_data = (void *) &co_ion_pdata,
386 },
Olav Haugan7355db02012-01-13 16:59:13 -0800387 {
388 .id = ION_AUDIO_HEAP_ID,
389 .type = ION_HEAP_TYPE_CARVEOUT,
390 .name = ION_AUDIO_HEAP_NAME,
391 .size = MSM_ION_AUDIO_SIZE,
392 .memory_type = ION_EBI_TYPE,
393 .extra_data = (void *) &co_ion_pdata,
394 },
Laura Abbott2d1760b2011-09-29 21:31:24 -0700395#endif
Laura Abbottd6183792011-08-19 13:42:24 -0700396 }
397};
398
Stepan Moskovchenkofc70d902011-11-30 12:39:36 -0800399static struct platform_device ion_dev = {
Laura Abbottd6183792011-08-19 13:42:24 -0700400 .name = "ion-msm",
401 .id = 1,
402 .dev = { .platform_data = &ion_pdata },
403};
404#endif
405
Larry Bassel41a055b2011-12-06 16:15:14 -0800406struct platform_device fmem_device = {
407 .name = "fmem",
408 .id = 1,
409 .dev = { .platform_data = &fmem_pdata },
410};
411
Olav Haugan65f4bd82011-12-13 11:50:08 -0800412static void __init adjust_mem_for_liquid(void)
Laura Abbottd6183792011-08-19 13:42:24 -0700413{
Ravishangar Kalyanam671f5ce2011-12-06 20:25:29 -0800414 unsigned int i;
415
416 if (!pmem_param_set && machine_is_msm8960_liquid()) {
Olav Hauganb5be7992011-11-18 14:29:02 -0800417 msm_ion_cp_mm_size = MSM_LIQUID_ION_MM_SIZE;
Ravishangar Kalyanam671f5ce2011-12-06 20:25:29 -0800418 for (i = 0; i < ion_pdata.nr; i++) {
Olav Hauganb5be7992011-11-18 14:29:02 -0800419 if (ion_pdata.heaps[i].id == ION_CP_MM_HEAP_ID) {
420 ion_pdata.heaps[i].size = msm_ion_cp_mm_size;
421 pr_debug("msm_ion_cp_mm_size 0x%x\n",
422 msm_ion_cp_mm_size);
Ravishangar Kalyanam671f5ce2011-12-06 20:25:29 -0800423 break;
424 }
425 }
426 }
Olav Haugan65f4bd82011-12-13 11:50:08 -0800427}
428
429static void __init reserve_mem_for_ion(enum ion_memory_types mem_type,
430 unsigned long size)
431{
432 msm8960_reserve_table[mem_type].size += size;
433}
434
435static __init const struct ion_platform_heap *find_ion_heap(int heap_id)
436{
437 unsigned int i;
438 for (i = 0; i < ion_pdata.nr; ++i) {
439 const struct ion_platform_heap *heap = &(ion_pdata.heaps[i]);
440 if (heap->id == heap_id)
441 return (const struct ion_platform_heap *) heap;
442 }
443 return 0;
444}
445
446/**
447 * Reserve memory for ION and calculate amount of reusable memory for fmem.
448 * We only reserve memory for heaps that are not reusable. However, we only
449 * support one reusable heap at the moment so we ignore the reusable flag for
450 * other than the first heap with reusable flag set. Also handle special case
451 * for adjacent heap when the adjacent heap is adjacent to a reusable heap.
452 */
453static void __init reserve_ion_memory(void)
454{
455#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
456 unsigned int i;
457 unsigned int reusable_count = 0;
458
459 adjust_mem_for_liquid();
460 fmem_pdata.size = 0;
461 fmem_pdata.reserved_size = 0;
462
463 /* We only support 1 reusable heap. Check if more than one heap
464 * is specified as reusable and set as non-reusable if found.
465 */
466 for (i = 0; i < ion_pdata.nr; ++i) {
467 const struct ion_platform_heap *heap = &(ion_pdata.heaps[i]);
468
469 if (heap->type == ION_HEAP_TYPE_CP && heap->extra_data) {
470 struct ion_cp_heap_pdata *data = heap->extra_data;
471
472 reusable_count += (data->reusable) ? 1 : 0;
473
474 if (data->reusable && reusable_count > 1) {
475 pr_err("%s: Too many heaps specified as "
476 "reusable. Heap %s was not configured "
477 "as reusable.\n", __func__, heap->name);
478 data->reusable = 0;
479 }
480 }
481 }
482
483 for (i = 0; i < ion_pdata.nr; ++i) {
484 int reusable = 0;
485 int adjacent_heap_id = INVALID_HEAP_ID;
486 int adj_reusable = 0;
487 const struct ion_platform_heap *heap = &(ion_pdata.heaps[i]);
488
489 if (heap->extra_data) {
490 switch (heap->type) {
491 case ION_HEAP_TYPE_CP:
492 reusable = ((struct ion_cp_heap_pdata *)
493 heap->extra_data)->reusable;
494 break;
495 case ION_HEAP_TYPE_CARVEOUT:
496 adjacent_heap_id = ((struct ion_co_heap_pdata *)
497 heap->extra_data)->adjacent_mem_id;
498 break;
499 default:
500 break;
501 }
502 }
503
504 if (adjacent_heap_id != INVALID_HEAP_ID) {
505 const struct ion_platform_heap *adj_heap =
506 find_ion_heap(adjacent_heap_id);
507 if (adj_heap) {
508 adj_reusable = ((struct ion_cp_heap_pdata *)
509 adj_heap->extra_data)->reusable;
510 if (adj_reusable)
511 fmem_pdata.reserved_size += heap->size;
512 }
513 }
514
515 if (!reusable && !adj_reusable)
516 reserve_mem_for_ion(MEMTYPE_EBI1, heap->size);
517 else
518 fmem_pdata.size += heap->size;
519 }
Laura Abbottd6183792011-08-19 13:42:24 -0700520#endif
521}
Huaibin Yanga5419422011-12-08 23:52:10 -0800522
523static void __init reserve_mdp_memory(void)
524{
525 msm8960_mdp_writeback(msm8960_reserve_table);
526}
527
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700528static void __init msm8960_calculate_reserve_sizes(void)
529{
530 size_pmem_devices();
531 reserve_pmem_memory();
Laura Abbottd6183792011-08-19 13:42:24 -0700532 reserve_ion_memory();
Huaibin Yanga5419422011-12-08 23:52:10 -0800533 reserve_mdp_memory();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700534}
535
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700536static struct reserve_info msm8960_reserve_info __initdata = {
537 .memtype_reserve_table = msm8960_reserve_table,
538 .calculate_reserve_sizes = msm8960_calculate_reserve_sizes,
539 .paddr_to_memtype = msm8960_paddr_to_memtype,
540};
541
Larry Basselb4126da2011-07-18 14:31:33 -0700542static int msm8960_memory_bank_size(void)
543{
544 return 1<<29;
545}
546
547static void __init locate_unstable_memory(void)
548{
549 struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1];
550 unsigned long bank_size;
551 unsigned long low, high;
552
553 bank_size = msm8960_memory_bank_size();
554 low = meminfo.bank[0].start;
555 high = mb->start + mb->size;
Olav Haugan62052e42011-10-28 14:28:32 -0700556
557 /* Check if 32 bit overflow occured */
558 if (high < mb->start)
559 high = ~0UL;
560
Larry Basselb4126da2011-07-18 14:31:33 -0700561 low &= ~(bank_size - 1);
562
563 if (high - low <= bank_size)
564 return;
Jack Cheung60eaeab2012-01-09 16:40:26 -0800565 msm8960_reserve_info.low_unstable_address = mb->start -
566 MIN_MEMORY_BLOCK_SIZE + mb->size;
Jack Cheung0b1987e2011-11-18 13:36:29 -0800567 msm8960_reserve_info.max_unstable_size = MIN_MEMORY_BLOCK_SIZE;
Olav Haugan62052e42011-10-28 14:28:32 -0700568
Larry Basselb4126da2011-07-18 14:31:33 -0700569 msm8960_reserve_info.bank_size = bank_size;
570 pr_info("low unstable address %lx max size %lx bank size %lx\n",
571 msm8960_reserve_info.low_unstable_address,
572 msm8960_reserve_info.max_unstable_size,
573 msm8960_reserve_info.bank_size);
574}
575
Larry Basselb830e182011-10-14 10:46:55 -0700576static void __init place_movable_zone(void)
577{
578 movable_reserved_start = msm8960_reserve_info.low_unstable_address;
579 movable_reserved_size = msm8960_reserve_info.max_unstable_size;
580 pr_info("movable zone start %lx size %lx\n",
581 movable_reserved_start, movable_reserved_size);
582}
583
584static void __init msm8960_early_memory(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700585{
586 reserve_info = &msm8960_reserve_info;
Larry Basselb4126da2011-07-18 14:31:33 -0700587 locate_unstable_memory();
Larry Basselb830e182011-10-14 10:46:55 -0700588 place_movable_zone();
589}
590
591static void __init msm8960_reserve(void)
592{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700593 msm_reserve();
Larry Bassel41a055b2011-12-06 16:15:14 -0800594 fmem_pdata.phys = reserve_memory_for_fmem(fmem_pdata.size);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700595}
596
Larry Bassela4414b12011-08-04 11:11:02 -0700597static int msm8960_change_memory_power(u64 start, u64 size,
598 int change_type)
Larry Bassela7eadea2011-07-14 10:46:00 -0700599{
Naveen Ramarajb03bb1b2011-09-12 14:34:31 -0700600 return soc_change_memory_power(start, size, change_type);
Larry Bassela7eadea2011-07-14 10:46:00 -0700601}
602
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700603static void __init msm8960_allocate_memory_regions(void)
604{
Stepan Moskovchenko24cd8642011-11-29 13:07:53 -0800605 msm8960_allocate_fb_region();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700606}
Stepan Moskovchenko24cd8642011-11-29 13:07:53 -0800607
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700608#ifdef CONFIG_WCD9310_CODEC
609
610#define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS)
611
Patrick Lai3043fba2011-08-01 14:15:57 -0700612/* Micbias setting is based on 8660 CDP/MTP/FLUID requirement
613 * 4 micbiases are used to power various analog and digital
614 * microphones operating at 1800 mV. Technically, all micbiases
615 * can source from single cfilter since all microphones operate
616 * at the same voltage level. The arrangement below is to make
617 * sure all cfilters are exercised. LDO_H regulator ouput level
618 * does not need to be as high as 2.85V. It is choosen for
619 * microphone sensitivity purpose.
620 */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700621static struct tabla_pdata tabla_platform_data = {
622 .slimbus_slave_device = {
623 .name = "tabla-slave",
624 .e_addr = {0, 0, 0x10, 0, 0x17, 2},
625 },
626 .irq = MSM_GPIO_TO_INT(62),
627 .irq_base = TABLA_INTERRUPT_BASE,
628 .num_irqs = NR_TABLA_IRQS,
629 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
Patrick Lai3043fba2011-08-01 14:15:57 -0700630 .micbias = {
631 .ldoh_v = TABLA_LDOH_2P85_V,
632 .cfilt1_mv = 1800,
633 .cfilt2_mv = 1800,
634 .cfilt3_mv = 1800,
635 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
636 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
637 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
638 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
639 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700640};
641
642static struct slim_device msm_slim_tabla = {
643 .name = "tabla-slim",
644 .e_addr = {0, 1, 0x10, 0, 0x17, 2},
645 .dev = {
646 .platform_data = &tabla_platform_data,
647 },
648};
Santosh Mardi60e19d92011-10-28 01:15:14 +0530649
650static struct tabla_pdata tabla20_platform_data = {
651 .slimbus_slave_device = {
652 .name = "tabla-slave",
653 .e_addr = {0, 0, 0x60, 0, 0x17, 2},
654 },
655 .irq = MSM_GPIO_TO_INT(62),
656 .irq_base = TABLA_INTERRUPT_BASE,
657 .num_irqs = NR_TABLA_IRQS,
658 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
659 .micbias = {
660 .ldoh_v = TABLA_LDOH_2P85_V,
661 .cfilt1_mv = 1800,
662 .cfilt2_mv = 1800,
663 .cfilt3_mv = 1800,
664 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
665 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
666 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
667 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
668 }
669};
670
671static struct slim_device msm_slim_tabla20 = {
672 .name = "tabla2x-slim",
673 .e_addr = {0, 1, 0x60, 0, 0x17, 2},
674 .dev = {
675 .platform_data = &tabla20_platform_data,
676 },
677};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700678#endif
679
680static struct slim_boardinfo msm_slim_devices[] = {
681#ifdef CONFIG_WCD9310_CODEC
682 {
683 .bus_num = 1,
684 .slim_slave = &msm_slim_tabla,
685 },
Santosh Mardi60e19d92011-10-28 01:15:14 +0530686 {
687 .bus_num = 1,
688 .slim_slave = &msm_slim_tabla20,
689 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700690#endif
691 /* add more slimbus slaves as needed */
692};
693
Yunsen Wang5c1a7392011-07-09 19:10:16 -0700694#define MSM_WCNSS_PHYS 0x03000000
695#define MSM_WCNSS_SIZE 0x280000
696
697static struct resource resources_wcnss_wlan[] = {
698 {
699 .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
700 .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
701 .name = "wcnss_wlanrx_irq",
702 .flags = IORESOURCE_IRQ,
703 },
704 {
705 .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
706 .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
707 .name = "wcnss_wlantx_irq",
708 .flags = IORESOURCE_IRQ,
709 },
710 {
711 .start = MSM_WCNSS_PHYS,
712 .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1,
713 .name = "wcnss_mmio",
714 .flags = IORESOURCE_MEM,
715 },
Ankur Nandwaniad0d9ac2011-09-26 11:49:25 -0700716 {
717 .start = 84,
718 .end = 88,
719 .name = "wcnss_gpios_5wire",
720 .flags = IORESOURCE_IO,
721 },
Yunsen Wang5c1a7392011-07-09 19:10:16 -0700722};
723
Ankur Nandwanib0039b02011-08-09 14:00:45 -0700724static struct qcom_wcnss_opts qcom_wcnss_pdata = {
725 .has_48mhz_xo = 1,
726};
727
Yunsen Wang5c1a7392011-07-09 19:10:16 -0700728static struct platform_device msm_device_wcnss_wlan = {
729 .name = "wcnss_wlan",
730 .id = 0,
731 .num_resources = ARRAY_SIZE(resources_wcnss_wlan),
732 .resource = resources_wcnss_wlan,
Ankur Nandwanib0039b02011-08-09 14:00:45 -0700733 .dev = {.platform_data = &qcom_wcnss_pdata},
Yunsen Wang5c1a7392011-07-09 19:10:16 -0700734};
735
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700736#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
737 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
738 defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
739 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
740
741#define QCE_SIZE 0x10000
742#define QCE_0_BASE 0x18500000
743
744#define QCE_HW_KEY_SUPPORT 0
745#define QCE_SHA_HMAC_SUPPORT 1
746#define QCE_SHARE_CE_RESOURCE 1
747#define QCE_CE_SHARED 0
748
Ramesh Masavarapu49259682011-12-02 14:00:18 -0800749/* Begin Bus scaling definitions */
750static struct msm_bus_vectors crypto_hw_init_vectors[] = {
751 {
752 .src = MSM_BUS_MASTER_ADM_PORT0,
753 .dst = MSM_BUS_SLAVE_EBI_CH0,
754 .ab = 0,
755 .ib = 0,
756 },
757 {
758 .src = MSM_BUS_MASTER_ADM_PORT1,
759 .dst = MSM_BUS_SLAVE_GSBI1_UART,
760 .ab = 0,
761 .ib = 0,
762 },
763};
764
765static struct msm_bus_vectors crypto_hw_active_vectors[] = {
766 {
767 .src = MSM_BUS_MASTER_ADM_PORT0,
768 .dst = MSM_BUS_SLAVE_EBI_CH0,
769 .ab = 70000000UL,
770 .ib = 70000000UL,
771 },
772 {
773 .src = MSM_BUS_MASTER_ADM_PORT1,
774 .dst = MSM_BUS_SLAVE_GSBI1_UART,
775 .ab = 2480000000UL,
776 .ib = 2480000000UL,
777 },
778};
779
780static struct msm_bus_paths crypto_hw_bus_scale_usecases[] = {
781 {
782 ARRAY_SIZE(crypto_hw_init_vectors),
783 crypto_hw_init_vectors,
784 },
785 {
786 ARRAY_SIZE(crypto_hw_active_vectors),
787 crypto_hw_active_vectors,
788 },
789};
790
791static struct msm_bus_scale_pdata crypto_hw_bus_scale_pdata = {
792 crypto_hw_bus_scale_usecases,
793 ARRAY_SIZE(crypto_hw_bus_scale_usecases),
794 .name = "cryptohw",
795};
796/* End Bus Scaling Definitions*/
797
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700798static struct resource qcrypto_resources[] = {
799 [0] = {
800 .start = QCE_0_BASE,
801 .end = QCE_0_BASE + QCE_SIZE - 1,
802 .flags = IORESOURCE_MEM,
803 },
804 [1] = {
805 .name = "crypto_channels",
806 .start = DMOV_CE_IN_CHAN,
807 .end = DMOV_CE_OUT_CHAN,
808 .flags = IORESOURCE_DMA,
809 },
810 [2] = {
811 .name = "crypto_crci_in",
812 .start = DMOV_CE_IN_CRCI,
813 .end = DMOV_CE_IN_CRCI,
814 .flags = IORESOURCE_DMA,
815 },
816 [3] = {
817 .name = "crypto_crci_out",
818 .start = DMOV_CE_OUT_CRCI,
819 .end = DMOV_CE_OUT_CRCI,
820 .flags = IORESOURCE_DMA,
821 },
822};
823
824static struct resource qcedev_resources[] = {
825 [0] = {
826 .start = QCE_0_BASE,
827 .end = QCE_0_BASE + QCE_SIZE - 1,
828 .flags = IORESOURCE_MEM,
829 },
830 [1] = {
831 .name = "crypto_channels",
832 .start = DMOV_CE_IN_CHAN,
833 .end = DMOV_CE_OUT_CHAN,
834 .flags = IORESOURCE_DMA,
835 },
836 [2] = {
837 .name = "crypto_crci_in",
838 .start = DMOV_CE_IN_CRCI,
839 .end = DMOV_CE_IN_CRCI,
840 .flags = IORESOURCE_DMA,
841 },
842 [3] = {
843 .name = "crypto_crci_out",
844 .start = DMOV_CE_OUT_CRCI,
845 .end = DMOV_CE_OUT_CRCI,
846 .flags = IORESOURCE_DMA,
847 },
848};
849
850#endif
851
852#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
853 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
854
855static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
856 .ce_shared = QCE_CE_SHARED,
857 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
858 .hw_key_support = QCE_HW_KEY_SUPPORT,
859 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -0800860 .bus_scale_table = &crypto_hw_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700861};
862
863static struct platform_device qcrypto_device = {
864 .name = "qcrypto",
865 .id = 0,
866 .num_resources = ARRAY_SIZE(qcrypto_resources),
867 .resource = qcrypto_resources,
868 .dev = {
869 .coherent_dma_mask = DMA_BIT_MASK(32),
870 .platform_data = &qcrypto_ce_hw_suppport,
871 },
872};
873#endif
874
875#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
876 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
877
878static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
879 .ce_shared = QCE_CE_SHARED,
880 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
881 .hw_key_support = QCE_HW_KEY_SUPPORT,
882 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -0800883 .bus_scale_table = &crypto_hw_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700884};
885
886static struct platform_device qcedev_device = {
887 .name = "qce",
888 .id = 0,
889 .num_resources = ARRAY_SIZE(qcedev_resources),
890 .resource = qcedev_resources,
891 .dev = {
892 .coherent_dma_mask = DMA_BIT_MASK(32),
893 .platform_data = &qcedev_ce_hw_suppport,
894 },
895};
896#endif
897
Joel Kingb8352a12011-11-15 18:46:24 -0800898#define MDM2AP_ERRFATAL 70
899#define AP2MDM_ERRFATAL 95
900#define MDM2AP_STATUS 69
901#define AP2MDM_STATUS 94
902#define AP2MDM_PMIC_RESET_N 80
903#define AP2MDM_KPDPWR_N 81
904
Joel Kingb8352a12011-11-15 18:46:24 -0800905static struct resource mdm_resources[] = {
906 {
907 .start = MDM2AP_ERRFATAL,
908 .end = MDM2AP_ERRFATAL,
909 .name = "MDM2AP_ERRFATAL",
910 .flags = IORESOURCE_IO,
911 },
912 {
913 .start = AP2MDM_ERRFATAL,
914 .end = AP2MDM_ERRFATAL,
915 .name = "AP2MDM_ERRFATAL",
916 .flags = IORESOURCE_IO,
917 },
918 {
919 .start = MDM2AP_STATUS,
920 .end = MDM2AP_STATUS,
921 .name = "MDM2AP_STATUS",
922 .flags = IORESOURCE_IO,
923 },
924 {
925 .start = AP2MDM_STATUS,
926 .end = AP2MDM_STATUS,
927 .name = "AP2MDM_STATUS",
928 .flags = IORESOURCE_IO,
929 },
930 {
931 .start = AP2MDM_PMIC_RESET_N,
932 .end = AP2MDM_PMIC_RESET_N,
933 .name = "AP2MDM_PMIC_RESET_N",
934 .flags = IORESOURCE_IO,
935 },
936 {
937 .start = AP2MDM_KPDPWR_N,
938 .end = AP2MDM_KPDPWR_N,
939 .name = "AP2MDM_KPDPWR_N",
940 .flags = IORESOURCE_IO,
941 },
942};
943
944static struct mdm_platform_data mdm_platform_data = {
945 .mdm_version = "2.5",
946};
947
Stepan Moskovchenkofc70d902011-11-30 12:39:36 -0800948static struct platform_device mdm_device = {
Joel Kingb8352a12011-11-15 18:46:24 -0800949 .name = "mdm2_modem",
950 .id = -1,
951 .num_resources = ARRAY_SIZE(mdm_resources),
952 .resource = mdm_resources,
953 .dev = {
954 .platform_data = &mdm_platform_data,
955 },
956};
957
958static struct platform_device *mdm_devices[] __initdata = {
959 &mdm_device,
960};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700961
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700962#define MSM_SHARED_RAM_PHYS 0x80000000
963
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -0800964static void __init msm8960_map_io(void)
965{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700966 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -0800967 msm_map_msm8960_io();
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -0700968
969 if (socinfo_init() < 0)
970 pr_err("socinfo_init() failed!\n");
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -0800971}
972
973static void __init msm8960_init_irq(void)
974{
Praveen Chidambaram78499012011-11-01 17:15:17 -0600975 struct msm_mpm_device_data *data = NULL;
976
977#ifdef CONFIG_MSM_MPM
978 data = &msm8960_mpm_dev_data;
979#endif
980
981 msm_mpm_irq_extn_init(data);
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -0800982 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700983 (void *)MSM_QGIC_CPU_BASE);
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -0800984}
985
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700986static void __init msm8960_init_buses(void)
987{
988#ifdef CONFIG_MSM_BUS_SCALING
Gagan Macdc1dc142011-09-16 15:13:35 -0600989 msm_bus_rpm_set_mt_mask();
Gagan Macae154c4b2011-10-05 19:24:43 -0600990 msm_bus_8960_apps_fabric_pdata.rpm_enabled = 1;
991 msm_bus_8960_sys_fabric_pdata.rpm_enabled = 1;
992 msm_bus_8960_mm_fabric_pdata.rpm_enabled = 1;
993 msm_bus_apps_fabric.dev.platform_data =
994 &msm_bus_8960_apps_fabric_pdata;
995 msm_bus_sys_fabric.dev.platform_data = &msm_bus_8960_sys_fabric_pdata;
996 msm_bus_mm_fabric.dev.platform_data = &msm_bus_8960_mm_fabric_pdata;
997 msm_bus_sys_fpb.dev.platform_data = &msm_bus_8960_sys_fpb_pdata;
998 msm_bus_cpss_fpb.dev.platform_data = &msm_bus_8960_cpss_fpb_pdata;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700999#endif
1000}
1001
1002static struct msm_spi_platform_data msm8960_qup_spi_gsbi1_pdata = {
1003 .max_clock_speed = 15060000,
1004};
1005
1006#ifdef CONFIG_USB_MSM_OTG_72K
1007static struct msm_otg_platform_data msm_otg_pdata;
1008#else
Anji jonnalaa8b8d732011-12-06 10:03:24 +05301009static int wr_phy_init_seq[] = {
1010 0x44, 0x80, /* set VBUS valid threshold
1011 and disconnect valid threshold */
1012 0x38, 0x81, /* update DC voltage level */
1013 0x14, 0x82, /* set preemphasis and rise/fall time */
1014 0x13, 0x83, /* set source impedance adjusment */
1015 -1};
1016
1017static int liquid_v1_phy_init_seq[] = {
1018 0x44, 0x80,/* set VBUS valid threshold
1019 and disconnect valid threshold */
1020 0x3C, 0x81,/* update DC voltage level */
1021 0x18, 0x82,/* set preemphasis and rise/fall time */
1022 0x23, 0x83,/* set source impedance sdjusment */
1023 -1};
1024
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001025static struct msm_otg_platform_data msm_otg_pdata = {
1026 .mode = USB_OTG,
1027 .otg_control = OTG_PMIC_CONTROL,
1028 .phy_type = SNPS_28NM_INTEGRATED_PHY,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001029 .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE),
Anji jonnala4e3e6772011-09-15 18:53:42 +05301030 .power_budget = 750,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001031};
1032#endif
1033
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +05301034#ifdef CONFIG_USB_EHCI_MSM_HSIC
Vijayavardhan Vennapusa2b592824f2011-11-02 19:51:32 +05301035#define HSIC_HUB_RESET_GPIO 91
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +05301036static struct msm_hsic_host_platform_data msm_hsic_pdata = {
1037 .strobe = 150,
1038 .data = 151,
1039};
1040#else
1041static struct msm_hsic_host_platform_data msm_hsic_pdata;
1042#endif
1043
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001044#define PID_MAGIC_ID 0x71432909
1045#define SERIAL_NUM_MAGIC_ID 0x61945374
1046#define SERIAL_NUMBER_LENGTH 127
1047#define DLOAD_USB_BASE_ADD 0x2A03F0C8
1048
1049struct magic_num_struct {
1050 uint32_t pid;
1051 uint32_t serial_num;
1052};
1053
1054struct dload_struct {
1055 uint32_t reserved1;
1056 uint32_t reserved2;
1057 uint32_t reserved3;
1058 uint16_t reserved4;
1059 uint16_t pid;
1060 char serial_number[SERIAL_NUMBER_LENGTH];
1061 uint16_t reserved5;
1062 struct magic_num_struct magic_struct;
1063};
1064
1065static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
1066{
1067 struct dload_struct __iomem *dload = 0;
1068
1069 dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload));
1070 if (!dload) {
1071 pr_err("%s: cannot remap I/O memory region: %08x\n",
1072 __func__, DLOAD_USB_BASE_ADD);
1073 return -ENXIO;
1074 }
1075
1076 pr_debug("%s: dload:%p pid:%x serial_num:%s\n",
1077 __func__, dload, pid, snum);
1078 /* update pid */
1079 dload->magic_struct.pid = PID_MAGIC_ID;
1080 dload->pid = pid;
1081
1082 /* update serial number */
1083 dload->magic_struct.serial_num = 0;
1084 if (!snum) {
1085 memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH);
1086 goto out;
1087 }
1088
1089 dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID;
Jin Honge49b1482011-10-03 11:15:50 -07001090 strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001091out:
1092 iounmap(dload);
1093 return 0;
1094}
1095
1096static struct android_usb_platform_data android_usb_pdata = {
1097 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
1098};
1099
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07001100static struct platform_device android_usb_device = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001101 .name = "android_usb",
1102 .id = -1,
1103 .dev = {
1104 .platform_data = &android_usb_pdata,
1105 },
1106};
1107
1108static uint8_t spm_wfi_cmd_sequence[] __initdata = {
1109 0x03, 0x0f,
1110};
1111
1112static uint8_t spm_power_collapse_without_rpm[] __initdata = {
1113 0x00, 0x24, 0x54, 0x10,
1114 0x09, 0x03, 0x01,
1115 0x10, 0x54, 0x30, 0x0C,
1116 0x24, 0x30, 0x0f,
1117};
1118
1119static uint8_t spm_power_collapse_with_rpm[] __initdata = {
1120 0x00, 0x24, 0x54, 0x10,
1121 0x09, 0x07, 0x01, 0x0B,
1122 0x10, 0x54, 0x30, 0x0C,
1123 0x24, 0x30, 0x0f,
1124};
1125
1126static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
1127 [0] = {
1128 .mode = MSM_SPM_MODE_CLOCK_GATING,
1129 .notify_rpm = false,
1130 .cmd = spm_wfi_cmd_sequence,
1131 },
1132 [1] = {
1133 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1134 .notify_rpm = false,
1135 .cmd = spm_power_collapse_without_rpm,
1136 },
1137 [2] = {
1138 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1139 .notify_rpm = true,
1140 .cmd = spm_power_collapse_with_rpm,
1141 },
1142};
1143
1144static struct msm_spm_platform_data msm_spm_data[] __initdata = {
1145 [0] = {
1146 .reg_base_addr = MSM_SAW0_BASE,
1147 .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00,
1148 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Stephen Boyd9ac587a2011-12-09 22:55:10 -08001149 .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0xB0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001150#if defined(CONFIG_MSM_AVS_HW)
1151 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1152 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1153#endif
1154 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
1155 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
1156 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1157 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1158 .vctl_timeout_us = 50,
1159 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1160 .modes = msm_spm_seq_list,
1161 },
1162 [1] = {
1163 .reg_base_addr = MSM_SAW1_BASE,
1164 .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00,
1165 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Stephen Boyd9ac587a2011-12-09 22:55:10 -08001166 .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0xB0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001167#if defined(CONFIG_MSM_AVS_HW)
1168 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1169 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1170#endif
1171 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
1172 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
1173 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1174 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1175 .vctl_timeout_us = 50,
1176 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1177 .modes = msm_spm_seq_list,
1178 },
1179};
1180
1181static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = {
1182 0x00, 0x20, 0x03, 0x20,
1183 0x00, 0x0f,
1184};
1185
1186static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = {
1187 0x00, 0x20, 0x34, 0x64,
1188 0x48, 0x07, 0x48, 0x20,
1189 0x50, 0x64, 0x04, 0x34,
1190 0x50, 0x0f,
1191};
1192static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = {
1193 0x00, 0x10, 0x34, 0x64,
1194 0x48, 0x07, 0x48, 0x10,
1195 0x50, 0x64, 0x04, 0x34,
1196 0x50, 0x0F,
1197};
1198
1199static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = {
1200 [0] = {
1201 .mode = MSM_SPM_L2_MODE_RETENTION,
1202 .notify_rpm = false,
1203 .cmd = l2_spm_wfi_cmd_sequence,
1204 },
1205 [1] = {
1206 .mode = MSM_SPM_L2_MODE_GDHS,
1207 .notify_rpm = true,
1208 .cmd = l2_spm_gdhs_cmd_sequence,
1209 },
1210 [2] = {
1211 .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE,
1212 .notify_rpm = true,
1213 .cmd = l2_spm_power_off_cmd_sequence,
1214 },
1215};
1216
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001217static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = {
1218 [0] = {
1219 .reg_base_addr = MSM_SAW_L2_BASE,
1220 .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00,
1221 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00,
1222 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
1223 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE,
1224 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020,
1225 .modes = msm_spm_l2_seq_list,
1226 .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list),
1227 },
1228};
1229
Mohan Pallaka5e490392011-09-09 15:18:41 +05301230#define PM_HAP_EN_GPIO PM8921_GPIO_PM_TO_SYS(33)
1231#define PM_HAP_LEN_GPIO PM8921_GPIO_PM_TO_SYS(20)
1232
1233static struct msm_xo_voter *xo_handle_d1;
1234
1235static int isa1200_power(int on)
1236{
1237 int rc = 0;
1238
1239 gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, !!on);
1240
1241 rc = on ? msm_xo_mode_vote(xo_handle_d1, MSM_XO_MODE_ON) :
1242 msm_xo_mode_vote(xo_handle_d1, MSM_XO_MODE_OFF);
1243 if (rc < 0) {
1244 pr_err("%s: failed to %svote for TCXO D1 buffer%d\n",
1245 __func__, on ? "" : "de-", rc);
1246 goto err_xo_vote;
1247 }
1248
1249 return 0;
1250
1251err_xo_vote:
1252 gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, !on);
1253 return rc;
1254}
1255
1256static int isa1200_dev_setup(bool enable)
1257{
1258 int rc = 0;
1259
1260 struct pm_gpio hap_gpio_config = {
1261 .direction = PM_GPIO_DIR_OUT,
1262 .pull = PM_GPIO_PULL_NO,
1263 .out_strength = PM_GPIO_STRENGTH_HIGH,
1264 .function = PM_GPIO_FUNC_NORMAL,
1265 .inv_int_pol = 0,
1266 .vin_sel = 2,
1267 .output_buffer = PM_GPIO_OUT_BUF_CMOS,
1268 .output_value = 0,
1269 };
1270
1271 if (enable == true) {
1272 rc = pm8xxx_gpio_config(PM_HAP_EN_GPIO, &hap_gpio_config);
1273 if (rc) {
1274 pr_err("%s: pm8921 gpio %d config failed(%d)\n",
1275 __func__, PM_HAP_EN_GPIO, rc);
1276 return rc;
1277 }
1278
1279 rc = pm8xxx_gpio_config(PM_HAP_LEN_GPIO, &hap_gpio_config);
1280 if (rc) {
1281 pr_err("%s: pm8921 gpio %d config failed(%d)\n",
1282 __func__, PM_HAP_LEN_GPIO, rc);
1283 return rc;
1284 }
1285
1286 rc = gpio_request(HAP_SHIFT_LVL_OE_GPIO, "hap_shft_lvl_oe");
1287 if (rc) {
1288 pr_err("%s: unable to request gpio %d (%d)\n",
1289 __func__, HAP_SHIFT_LVL_OE_GPIO, rc);
1290 return rc;
1291 }
1292
1293 rc = gpio_direction_output(HAP_SHIFT_LVL_OE_GPIO, 0);
1294 if (rc) {
1295 pr_err("%s: Unable to set direction\n", __func__);
1296 goto free_gpio;
1297 }
1298
1299 xo_handle_d1 = msm_xo_get(MSM_XO_TCXO_D1, "isa1200");
1300 if (IS_ERR(xo_handle_d1)) {
1301 rc = PTR_ERR(xo_handle_d1);
1302 pr_err("%s: failed to get the handle for D1(%d)\n",
1303 __func__, rc);
1304 goto gpio_set_dir;
1305 }
1306 } else {
1307 gpio_free(HAP_SHIFT_LVL_OE_GPIO);
1308
1309 msm_xo_put(xo_handle_d1);
1310 }
1311
1312 return 0;
1313
1314gpio_set_dir:
1315 gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, 0);
1316free_gpio:
1317 gpio_free(HAP_SHIFT_LVL_OE_GPIO);
1318 return rc;
1319}
1320
1321static struct isa1200_regulator isa1200_reg_data[] = {
1322 {
1323 .name = "vcc_i2c",
1324 .min_uV = ISA_I2C_VTG_MIN_UV,
1325 .max_uV = ISA_I2C_VTG_MAX_UV,
1326 .load_uA = ISA_I2C_CURR_UA,
1327 },
1328};
1329
1330static struct isa1200_platform_data isa1200_1_pdata = {
1331 .name = "vibrator",
1332 .dev_setup = isa1200_dev_setup,
1333 .power_on = isa1200_power,
1334 .hap_en_gpio = PM_HAP_EN_GPIO,
1335 .hap_len_gpio = PM_HAP_LEN_GPIO,
1336 .max_timeout = 15000,
1337 .mode_ctrl = PWM_GEN_MODE,
1338 .pwm_fd = {
1339 .pwm_div = 256,
1340 },
1341 .is_erm = false,
1342 .smart_en = true,
1343 .ext_clk_en = true,
1344 .chip_en = 1,
1345 .regulator_info = isa1200_reg_data,
1346 .num_regulators = ARRAY_SIZE(isa1200_reg_data),
1347};
1348
1349static struct i2c_board_info msm_isa1200_board_info[] __initdata = {
1350 {
1351 I2C_BOARD_INFO("isa1200_1", 0x90>>1),
Mohan Pallaka5e490392011-09-09 15:18:41 +05301352 },
1353};
1354
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001355#define CYTTSP_TS_GPIO_IRQ 11
1356#define CYTTSP_TS_SLEEP_GPIO 50
1357#define CYTTSP_TS_RESOUT_N_GPIO 52
1358
1359/*virtual key support */
1360static ssize_t tma340_vkeys_show(struct kobject *kobj,
1361 struct kobj_attribute *attr, char *buf)
1362{
1363 return snprintf(buf, 200,
1364 __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97"
1365 ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97"
1366 ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97"
1367 ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97"
1368 "\n");
1369}
1370
1371static struct kobj_attribute tma340_vkeys_attr = {
1372 .attr = {
1373 .mode = S_IRUGO,
1374 },
1375 .show = &tma340_vkeys_show,
1376};
1377
1378static struct attribute *tma340_properties_attrs[] = {
1379 &tma340_vkeys_attr.attr,
1380 NULL
1381};
1382
1383static struct attribute_group tma340_properties_attr_group = {
1384 .attrs = tma340_properties_attrs,
1385};
1386
1387
1388static int cyttsp_platform_init(struct i2c_client *client)
1389{
1390 int rc = 0;
1391 static struct kobject *tma340_properties_kobj;
1392
1393 tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c";
1394 tma340_properties_kobj = kobject_create_and_add("board_properties",
1395 NULL);
1396 if (tma340_properties_kobj)
1397 rc = sysfs_create_group(tma340_properties_kobj,
1398 &tma340_properties_attr_group);
1399 if (!tma340_properties_kobj || rc)
1400 pr_err("%s: failed to create board_properties\n",
1401 __func__);
1402
1403 return 0;
1404}
1405
1406static struct cyttsp_regulator regulator_data[] = {
1407 {
1408 .name = "vdd",
1409 .min_uV = CY_TMA300_VTG_MIN_UV,
1410 .max_uV = CY_TMA300_VTG_MAX_UV,
Anirudh Ghayalf9929b12011-09-07 15:57:36 +05301411 .hpm_load_uA = CY_TMA300_CURR_24HZ_UA,
1412 .lpm_load_uA = CY_TMA300_SLEEP_CURR_UA,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001413 },
1414 /* TODO: Remove after runtime PM is enabled in I2C driver */
1415 {
1416 .name = "vcc_i2c",
1417 .min_uV = CY_I2C_VTG_MIN_UV,
1418 .max_uV = CY_I2C_VTG_MAX_UV,
Anirudh Ghayalf9929b12011-09-07 15:57:36 +05301419 .hpm_load_uA = CY_I2C_CURR_UA,
1420 .lpm_load_uA = CY_I2C_SLEEP_CURR_UA,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001421 },
1422};
1423
1424static struct cyttsp_platform_data cyttsp_pdata = {
1425 .panel_maxx = 634,
1426 .panel_maxy = 1166,
1427 .disp_maxx = 616,
1428 .disp_maxy = 1023,
1429 .disp_minx = 0,
1430 .disp_miny = 16,
1431 .flags = 0x01,
1432 .gen = CY_GEN3, /* or */
1433 .use_st = CY_USE_ST,
1434 .use_mt = CY_USE_MT,
1435 .use_hndshk = CY_SEND_HNDSHK,
1436 .use_trk_id = CY_USE_TRACKING_ID,
Anirudh Ghayale96f66d2011-08-11 14:06:38 +05301437 .use_sleep = CY_USE_DEEP_SLEEP_SEL | CY_USE_LOW_POWER_SEL,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001438 .use_gestures = CY_USE_GESTURES,
1439 .fw_fname = "cyttsp_8960_cdp.hex",
1440 /* activate up to 4 groups
1441 * and set active distance
1442 */
1443 .gest_set = CY_GEST_GRP1 | CY_GEST_GRP2 |
1444 CY_GEST_GRP3 | CY_GEST_GRP4 |
1445 CY_ACT_DIST,
1446 /* change act_intrvl to customize the Active power state
1447 * scanning/processing refresh interval for Operating mode
1448 */
1449 .act_intrvl = CY_ACT_INTRVL_DFLT,
1450 /* change tch_tmout to customize the touch timeout for the
1451 * Active power state for Operating mode
1452 */
1453 .tch_tmout = CY_TCH_TMOUT_DFLT,
1454 /* change lp_intrvl to customize the Low Power power state
1455 * scanning/processing refresh interval for Operating mode
1456 */
1457 .lp_intrvl = CY_LP_INTRVL_DFLT,
1458 .sleep_gpio = CYTTSP_TS_SLEEP_GPIO,
1459 .resout_gpio = CYTTSP_TS_RESOUT_N_GPIO,
1460 .irq_gpio = CYTTSP_TS_GPIO_IRQ,
1461 .regulator_info = regulator_data,
1462 .num_regulators = ARRAY_SIZE(regulator_data),
1463 .init = cyttsp_platform_init,
Mohan Pallaka49c37d62011-08-01 11:52:00 +05301464 .correct_fw_ver = 9,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001465};
1466
1467static struct i2c_board_info cyttsp_info[] __initdata = {
1468 {
1469 I2C_BOARD_INFO(CY_I2C_NAME, 0x24),
1470 .platform_data = &cyttsp_pdata,
1471#ifndef CY_USE_TIMER
1472 .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ),
1473#endif /* CY_USE_TIMER */
1474 },
1475};
1476
Jing Lindc4413c2012-01-16 15:22:52 -08001477/* configuration data for mxt1386 */
1478static const u8 mxt1386_config_data[] = {
Mohan Pallaka50837382011-09-07 11:00:57 +05301479 /* T6 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001480 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301481 /* T38 Object */
Jing Lin93f07082011-11-11 15:53:54 -08001482 11, 2, 0, 11, 11, 11, 0, 0, 0, 0,
Jing Lin2f863172011-10-17 10:56:58 -07001483 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1484 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1485 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1486 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1487 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1488 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301489 /* T7 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001490 100, 16, 50,
Mohan Pallaka50837382011-09-07 11:00:57 +05301491 /* T8 Object */
Jing Lin93f07082011-11-11 15:53:54 -08001492 8, 0, 0, 0, 0, 0, 8, 14, 50, 215,
Mohan Pallaka50837382011-09-07 11:00:57 +05301493 /* T9 Object */
Jing Lin93f07082011-11-11 15:53:54 -08001494 131, 0, 0, 26, 42, 0, 32, 63, 3, 5,
1495 0, 2, 1, 113, 10, 10, 8, 10, 255, 2,
1496 85, 5, 0, 0, 20, 20, 75, 25, 202, 29,
1497 10, 10, 45, 46,
Mohan Pallaka50837382011-09-07 11:00:57 +05301498 /* T15 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001499 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1500 0,
Anirudh Ghayaldab4e0d2012-01-09 14:59:27 +05301501 /* T18 Object */
1502 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301503 /* T22 Object */
Jing Lin93f07082011-11-11 15:53:54 -08001504 5, 0, 0, 0, 0, 0, 0, 0, 30, 0,
1505 0, 0, 5, 8, 10, 13, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301506 /* T24 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001507 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1508 0, 0, 0, 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301509 /* T25 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001510 3, 0, 188, 52, 52, 33, 0, 0, 0, 0,
1511 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301512 /* T27 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001513 0, 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301514 /* T28 Object */
Jing Lin93f07082011-11-11 15:53:54 -08001515 0, 0, 0, 8, 12, 60,
Mohan Pallaka50837382011-09-07 11:00:57 +05301516 /* T40 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001517 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301518 /* T41 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001519 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301520 /* T43 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001521 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301522};
1523
Jing Lin33b007d2011-12-21 17:40:23 -08001524/* configuration data for mxt1386e using V1.0 firmware */
1525static const u8 mxt1386e_config_data_v1_0[] = {
1526 /* T6 Object */
1527 0, 0, 0, 0, 0, 0,
1528 /* T38 Object */
1529 12, 1, 0, 17, 1, 12, 0, 0, 0, 0,
1530 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1531 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1532 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,
1536 /* T7 Object */
1537 100, 16, 50,
1538 /* T8 Object */
1539 25, 0, 20, 20, 0, 0, 20, 50, 0, 0,
1540 /* T9 Object */
1541 131, 0, 0, 26, 42, 0, 32, 80, 2, 5,
1542 0, 5, 5, 0, 10, 30, 10, 10, 255, 2,
1543 85, 5, 10, 10, 10, 10, 135, 55, 70, 40,
1544 10, 5, 0, 0, 0,
1545 /* T18 Object */
1546 0, 0,
1547 /* T24 Object */
1548 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1549 0, 0, 0, 0, 0, 0, 0, 0, 0,
1550 /* T25 Object */
1551 3, 0, 60, 115, 156, 99,
1552 /* T27 Object */
1553 0, 0, 0, 0, 0, 0, 0,
1554 /* T40 Object */
1555 0, 0, 0, 0, 0,
1556 /* T42 Object */
1557 2, 0, 255, 0, 255, 0, 0, 0, 0, 0,
1558 /* T43 Object */
1559 0, 0, 0, 0, 0, 0, 0,
1560 /* T46 Object */
1561 64, 0, 20, 20, 0, 0, 0, 0, 0,
1562 /* T47 Object */
1563 0, 0, 0, 0, 0, 0, 3, 64, 66, 0,
1564 /* T48 Object */
1565 31, 64, 64, 0, 0, 0, 0, 0, 0, 0,
1566 48, 40, 0, 10, 10, 0, 0, 100, 10, 80,
1567 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
1568 52, 0, 12, 0, 17, 0, 1, 0, 0, 0,
1569 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1570 0, 0, 0, 0,
1571 /* T56 Object */
1572 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1573 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1574 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1575 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1576 2, 99, 33,
1577};
1578
1579/* configuration data for mxt1386e using V2.1 firmware */
1580static const u8 mxt1386e_config_data_v2_1[] = {
1581 /* T6 Object */
1582 0, 0, 0, 0, 0, 0,
1583 /* T38 Object */
1584 12, 2, 0, 17, 1, 12, 0, 0, 0, 0,
1585 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1586 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1587 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1588 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1589 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1590 0, 0, 0, 0,
1591 /* T7 Object */
1592 100, 16, 50,
1593 /* T8 Object */
1594 25, 0, 20, 20, 0, 0, 20, 50, 0, 0,
1595 /* T9 Object */
1596 131, 0, 0, 26, 42, 0, 32, 80, 2, 5,
1597 0, 5, 5, 0, 10, 30, 10, 10, 255, 2,
1598 85, 5, 10, 10, 10, 10, 135, 55, 70, 40,
1599 10, 5, 0, 0, 0,
1600 /* T18 Object */
1601 0, 0,
1602 /* T24 Object */
1603 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1604 0, 0, 0, 0, 0, 0, 0, 0, 0,
1605 /* T25 Object */
1606 3, 0, 60, 115, 156, 99,
1607 /* T27 Object */
1608 0, 0, 0, 0, 0, 0, 0,
1609 /* T40 Object */
1610 0, 0, 0, 0, 0,
1611 /* T42 Object */
1612 2, 0, 255, 0, 255, 0, 0, 0, 0, 0,
1613 /* T43 Object */
1614 0, 0, 0, 0, 0, 0, 0, 64, 0, 8,
1615 16,
1616 /* T46 Object */
1617 64, 0, 20, 20, 0, 0, 0, 0, 0,
1618 /* T47 Object */
1619 0, 0, 0, 0, 0, 0, 3, 64, 66, 0,
1620 /* T48 Object */
1621 31, 64, 64, 0, 0, 0, 0, 0, 0, 0,
1622 48, 40, 0, 10, 10, 0, 0, 100, 10, 80,
1623 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
1624 52, 0, 12, 0, 17, 0, 1, 0, 0, 0,
1625 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1626 0, 0, 0, 0,
1627 /* T56 Object */
1628 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1629 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1630 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1631 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1632 2, 99, 33, 0, 149, 24, 193, 255, 255, 255,
1633 255,
1634};
1635
Amy Maloche08266db2011-11-04 11:07:16 -07001636#define MXT_TS_GPIO_IRQ 11
1637#define MXT_TS_LDO_EN_GPIO 50
1638#define MXT_TS_RESET_GPIO 52
Mohan Pallaka50837382011-09-07 11:00:57 +05301639
1640static void mxt_init_hw_liquid(void)
1641{
1642 int rc;
1643
Mohan Pallaka50837382011-09-07 11:00:57 +05301644 rc = gpio_request(MXT_TS_LDO_EN_GPIO, "mxt_ldo_en_gpio");
1645 if (rc) {
Amy Maloche08266db2011-11-04 11:07:16 -07001646 pr_err("%s: unable to request mxt_ldo_en_gpio [%d]\n",
1647 __func__, MXT_TS_LDO_EN_GPIO);
1648 return;
Mohan Pallaka50837382011-09-07 11:00:57 +05301649 }
1650
1651 rc = gpio_direction_output(MXT_TS_LDO_EN_GPIO, 1);
1652 if (rc) {
Amy Maloche08266db2011-11-04 11:07:16 -07001653 pr_err("%s: unable to set_direction for mxt_ldo_en_gpio [%d]\n",
1654 __func__, MXT_TS_LDO_EN_GPIO);
Mohan Pallaka50837382011-09-07 11:00:57 +05301655 goto err_ldo_gpio_req;
1656 }
1657
Mohan Pallaka50837382011-09-07 11:00:57 +05301658 return;
1659
Mohan Pallaka50837382011-09-07 11:00:57 +05301660err_ldo_gpio_req:
1661 gpio_free(MXT_TS_LDO_EN_GPIO);
Mohan Pallaka50837382011-09-07 11:00:57 +05301662}
1663
Jing Lindc4413c2012-01-16 15:22:52 -08001664static struct mxt_config_info mxt_config_array[] = {
1665 {
1666 .config = mxt1386_config_data,
1667 .config_length = ARRAY_SIZE(mxt1386_config_data),
1668 .family_id = 0xA0,
1669 .variant_id = 0x0,
1670 .version = 0x10,
1671 .build = 0xAA,
1672 },
Jing Lin33b007d2011-12-21 17:40:23 -08001673 {
1674 .config = mxt1386e_config_data_v1_0,
1675 .config_length = ARRAY_SIZE(mxt1386e_config_data_v1_0),
1676 .family_id = 0xA0,
1677 .variant_id = 0x2,
1678 .version = 0x10,
1679 .build = 0xAA,
1680 },
1681 {
1682 .config = mxt1386e_config_data_v2_1,
1683 .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1),
1684 .family_id = 0xA0,
1685 .variant_id = 0x7,
1686 .version = 0x21,
1687 .build = 0xAA,
1688 },
Jing Lindc4413c2012-01-16 15:22:52 -08001689};
1690
Mohan Pallaka50837382011-09-07 11:00:57 +05301691static struct mxt_platform_data mxt_platform_data = {
Jing Lindc4413c2012-01-16 15:22:52 -08001692 .config_array = mxt_config_array,
1693 .config_array_size = ARRAY_SIZE(mxt_config_array),
Jing Lin2f863172011-10-17 10:56:58 -07001694 .x_size = 1365,
1695 .y_size = 767,
Mohan Pallaka50837382011-09-07 11:00:57 +05301696 .irqflags = IRQF_TRIGGER_FALLING,
Jing Lin2f863172011-10-17 10:56:58 -07001697 .i2c_pull_up = true,
Amy Maloche08266db2011-11-04 11:07:16 -07001698 .reset_gpio = MXT_TS_RESET_GPIO,
1699 .irq_gpio = MXT_TS_GPIO_IRQ,
Mohan Pallaka50837382011-09-07 11:00:57 +05301700};
1701
1702static struct i2c_board_info mxt_device_info[] __initdata = {
1703 {
1704 I2C_BOARD_INFO("atmel_mxt_ts", 0x5b),
1705 .platform_data = &mxt_platform_data,
1706 .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ),
1707 },
1708};
1709
Eugene Yasmand2316b82011-12-07 18:23:48 +02001710static struct i2c_board_info sii_device_info[] __initdata = {
1711 {
1712 I2C_BOARD_INFO("Sil-9244", 0x39),
1713 .flags = I2C_CLIENT_WAKE,
1714 .irq = MSM_GPIO_TO_INT(15),
1715 },
1716};
1717
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001718static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi4_pdata = {
1719 .clk_freq = 100000,
1720 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001721};
1722
1723static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi3_pdata = {
1724 .clk_freq = 100000,
1725 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001726};
1727
1728static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi10_pdata = {
1729 .clk_freq = 100000,
1730 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001731};
1732
1733static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi12_pdata = {
1734 .clk_freq = 100000,
1735 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001736};
1737
Maheshkumar Sivasubramanian6866b1c2011-06-07 14:20:33 -06001738static struct msm_pm_sleep_status_data msm_pm_slp_sts_data = {
1739 .base_addr = MSM_ACC0_BASE + 0x08,
1740 .cpu_offset = MSM_ACC1_BASE - MSM_ACC0_BASE,
1741 .mask = 1UL << 13,
1742};
1743
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -07001744static struct ks8851_pdata spi_eth_pdata = {
1745 .irq_gpio = KS8851_IRQ_GPIO,
1746 .rst_gpio = KS8851_RST_GPIO,
1747};
Praveen Chidambaram043f4ce2011-08-02 09:37:59 -06001748
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001749static struct spi_board_info spi_board_info[] __initdata = {
1750 {
1751 .modalias = "ks8851",
1752 .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
1753 .max_speed_hz = 19200000,
1754 .bus_num = 0,
1755 .chip_select = 0,
1756 .mode = SPI_MODE_0,
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -07001757 .platform_data = &spi_eth_pdata
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001758 },
Chandan Uddaraju15e54b92011-09-12 10:52:36 -07001759 {
1760 .modalias = "dsi_novatek_3d_panel_spi",
1761 .max_speed_hz = 10800000,
1762 .bus_num = 0,
1763 .chip_select = 1,
1764 .mode = SPI_MODE_0,
1765 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001766};
1767
1768static struct platform_device msm_device_saw_core0 = {
1769 .name = "saw-regulator",
1770 .id = 0,
1771 .dev = {
1772 .platform_data = &msm_saw_regulator_pdata_s5,
1773 },
1774};
1775
1776static struct platform_device msm_device_saw_core1 = {
1777 .name = "saw-regulator",
1778 .id = 1,
1779 .dev = {
1780 .platform_data = &msm_saw_regulator_pdata_s6,
1781 },
1782};
1783
Siddartha Mohanadossba21fdd2011-08-18 10:05:27 -07001784static struct tsens_platform_data msm_tsens_pdata = {
1785 .slope = 910,
1786 .tsens_factor = 1000,
1787 .hw_type = MSM_8960,
1788 .tsens_num_sensor = 5,
1789};
1790
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001791#ifdef CONFIG_MSM_FAKE_BATTERY
1792static struct platform_device fish_battery_device = {
1793 .name = "fish_battery",
1794};
1795#endif
1796
David Collins26f05562011-06-20 09:56:28 -07001797static struct platform_device msm8960_device_ext_5v_vreg __devinitdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001798 .name = GPIO_REGULATOR_DEV_NAME,
1799 .id = PM8921_MPP_PM_TO_SYS(7),
1800 .dev = {
1801 .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V],
1802 },
1803};
1804
David Collins26f05562011-06-20 09:56:28 -07001805static struct platform_device msm8960_device_ext_l2_vreg __devinitdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001806 .name = GPIO_REGULATOR_DEV_NAME,
1807 .id = 91,
1808 .dev = {
1809 .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_L2],
1810 },
1811};
1812
David Collinsb10be1d2011-09-02 10:29:31 -07001813static struct platform_device msm8960_device_ext_3p3v_vreg __devinitdata = {
1814 .name = GPIO_REGULATOR_DEV_NAME,
1815 .id = PM8921_GPIO_PM_TO_SYS(17),
1816 .dev = {
1817 .platform_data =
1818 &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V],
1819 },
1820};
1821
David Collins35a78f52011-12-14 15:54:25 -08001822static struct platform_device msm8960_device_ext_otg_sw_vreg __devinitdata = {
1823 .name = GPIO_REGULATOR_DEV_NAME,
1824 .id = PM8921_GPIO_PM_TO_SYS(42),
1825 .dev = {
1826 .platform_data =
1827 &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_OTG_SW],
1828 },
1829};
1830
David Collins26f05562011-06-20 09:56:28 -07001831static struct platform_device msm8960_device_rpm_regulator __devinitdata = {
1832 .name = "rpm-regulator",
1833 .id = -1,
1834 .dev = {
1835 .platform_data = &msm_rpm_regulator_pdata,
1836 },
1837};
1838
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001839static struct platform_device *common_devices[] __initdata = {
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -07001840 &msm8960_device_dmov,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001841 &msm_device_smd,
1842 &msm8960_device_uart_gsbi5,
Mayank Rana9f51f582011-08-04 18:35:59 +05301843 &msm_device_uart_dm6,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001844 &msm_device_saw_core0,
1845 &msm_device_saw_core1,
1846 &msm8960_device_ext_5v_vreg,
David Collins35a78f52011-12-14 15:54:25 -08001847 &msm8960_device_ext_otg_sw_vreg,
David Collins87579612012-01-30 16:00:15 -08001848 &msm8960_device_ssbi_pmic,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001849 &msm8960_device_qup_spi_gsbi1,
1850 &msm8960_device_qup_i2c_gsbi3,
1851 &msm8960_device_qup_i2c_gsbi4,
1852 &msm8960_device_qup_i2c_gsbi10,
1853#ifndef CONFIG_MSM_DSPS
1854 &msm8960_device_qup_i2c_gsbi12,
1855#endif
1856 &msm_slim_ctrl,
1857 &msm_device_wcnss_wlan,
1858#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1859 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1860 &qcrypto_device,
1861#endif
1862
1863#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1864 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1865 &qcedev_device,
1866#endif
1867#ifdef CONFIG_MSM_ROTATOR
1868 &msm_rotator_device,
1869#endif
1870 &msm_device_sps,
1871#ifdef CONFIG_MSM_FAKE_BATTERY
1872 &fish_battery_device,
1873#endif
Larry Bassel41a055b2011-12-06 16:15:14 -08001874 &fmem_device,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001875#ifdef CONFIG_ANDROID_PMEM
Laura Abbott2d1760b2011-09-29 21:31:24 -07001876#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001877 &android_pmem_device,
1878 &android_pmem_adsp_device,
Laura Abbott2d1760b2011-09-29 21:31:24 -07001879#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001880 &android_pmem_audio_device,
1881#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001882 &msm_device_vidc,
1883 &msm_device_bam_dmux,
1884 &msm_fm_platform_init,
Mona Hossain9c430e32011-07-27 11:04:47 -07001885
1886#ifdef CONFIG_HW_RANDOM_MSM
1887 &msm_device_rng,
1888#endif
Laura Abbottd6183792011-08-19 13:42:24 -07001889#ifdef CONFIG_ION_MSM
1890 &ion_dev,
1891#endif
Praveen Chidambaram78499012011-11-01 17:15:17 -06001892 &msm8960_rpm_device,
1893 &msm8960_rpm_log_device,
1894 &msm8960_rpm_stat_device,
Mona Hossain11c03ac2011-10-26 12:42:10 -07001895 &msm_device_tz_log,
Pratik Patel7831c082011-06-08 21:44:37 -07001896#ifdef CONFIG_MSM_QDSS
1897 &msm_etb_device,
1898 &msm_tpiu_device,
1899 &msm_funnel_device,
1900 &msm_ptm_device,
1901#endif
Swaminathan Sathappanb77c65e92011-09-30 18:36:09 -07001902 &msm_device_dspcrashd_8960,
Jeff Ohlstein7e668552011-10-06 16:17:25 -07001903 &msm8960_device_watchdog,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001904};
1905
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08001906static struct platform_device *sim_devices[] __initdata = {
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07001907 &msm8960_device_otg,
1908 &msm8960_device_gadget_peripheral,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001909 &msm_device_hsusb_host,
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +05301910 &msm_device_hsic_host,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001911 &android_usb_device,
1912 &msm_device_vidc,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001913 &msm_bus_apps_fabric,
1914 &msm_bus_sys_fabric,
1915 &msm_bus_mm_fabric,
1916 &msm_bus_sys_fpb,
1917 &msm_bus_cpss_fpb,
1918 &msm_pcm,
1919 &msm_pcm_routing,
1920 &msm_cpudai0,
1921 &msm_cpudai1,
1922 &msm_cpudai_hdmi_rx,
1923 &msm_cpudai_bt_rx,
1924 &msm_cpudai_bt_tx,
1925 &msm_cpudai_fm_rx,
1926 &msm_cpudai_fm_tx,
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001927 &msm_cpudai_auxpcm_rx,
1928 &msm_cpudai_auxpcm_tx,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001929 &msm_cpu_fe,
1930 &msm_stub_codec,
1931 &msm_voice,
1932 &msm_voip,
1933 &msm_lpa_pcm,
Asish Bhattacharya96bb6f42011-11-01 20:36:09 +05301934 &msm_compr_dsp,
Helen Zeng0705a5f2011-10-14 15:29:52 -07001935 &msm_cpudai_incall_music_rx,
Helen Zenge3d716a2011-10-14 16:32:16 -07001936 &msm_cpudai_incall_record_rx,
1937 &msm_cpudai_incall_record_tx,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001938
1939#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1940 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1941 &qcrypto_device,
1942#endif
1943
1944#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1945 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1946 &qcedev_device,
1947#endif
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08001948};
1949
1950static struct platform_device *rumi3_devices[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001951 &msm_kgsl_3d0,
1952 &msm_kgsl_2d0,
1953 &msm_kgsl_2d1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001954#ifdef CONFIG_MSM_GEMINI
1955 &msm8960_gemini_device,
1956#endif
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08001957};
1958
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001959static struct platform_device *cdp_devices[] __initdata = {
Stephen Boydeb819882011-08-29 14:46:30 -07001960 &msm_8960_q6_lpass,
1961 &msm_8960_q6_mss_fw,
1962 &msm_8960_q6_mss_sw,
Stephen Boyd322a9922011-09-20 01:05:54 -07001963 &msm_8960_riva,
Stephen Boydd89eebe2011-09-28 23:28:11 -07001964 &msm_pil_tzapps,
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07001965 &msm8960_device_otg,
1966 &msm8960_device_gadget_peripheral,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001967 &msm_device_hsusb_host,
1968 &android_usb_device,
1969 &msm_pcm,
1970 &msm_pcm_routing,
1971 &msm_cpudai0,
1972 &msm_cpudai1,
1973 &msm_cpudai_hdmi_rx,
1974 &msm_cpudai_bt_rx,
1975 &msm_cpudai_bt_tx,
1976 &msm_cpudai_fm_rx,
1977 &msm_cpudai_fm_tx,
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001978 &msm_cpudai_auxpcm_rx,
1979 &msm_cpudai_auxpcm_tx,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001980 &msm_cpu_fe,
1981 &msm_stub_codec,
1982 &msm_kgsl_3d0,
1983#ifdef CONFIG_MSM_KGSL_2D
1984 &msm_kgsl_2d0,
1985 &msm_kgsl_2d1,
1986#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001987#ifdef CONFIG_MSM_GEMINI
1988 &msm8960_gemini_device,
1989#endif
1990 &msm_voice,
1991 &msm_voip,
1992 &msm_lpa_pcm,
Laxminath Kasamcee1d602011-08-01 19:26:57 +05301993 &msm_cpudai_afe_01_rx,
1994 &msm_cpudai_afe_01_tx,
1995 &msm_cpudai_afe_02_rx,
1996 &msm_cpudai_afe_02_tx,
1997 &msm_pcm_afe,
Asish Bhattacharya96bb6f42011-11-01 20:36:09 +05301998 &msm_compr_dsp,
Helen Zeng0705a5f2011-10-14 15:29:52 -07001999 &msm_cpudai_incall_music_rx,
Helen Zenge3d716a2011-10-14 16:32:16 -07002000 &msm_cpudai_incall_record_rx,
2001 &msm_cpudai_incall_record_tx,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002002 &msm_pcm_hostless,
2003 &msm_bus_apps_fabric,
2004 &msm_bus_sys_fabric,
2005 &msm_bus_mm_fabric,
2006 &msm_bus_sys_fpb,
2007 &msm_bus_cpss_fpb,
2008};
2009
2010static void __init msm8960_i2c_init(void)
2011{
2012 msm8960_device_qup_i2c_gsbi4.dev.platform_data =
2013 &msm8960_i2c_qup_gsbi4_pdata;
2014
2015 msm8960_device_qup_i2c_gsbi3.dev.platform_data =
2016 &msm8960_i2c_qup_gsbi3_pdata;
2017
2018 msm8960_device_qup_i2c_gsbi10.dev.platform_data =
2019 &msm8960_i2c_qup_gsbi10_pdata;
2020
2021 msm8960_device_qup_i2c_gsbi12.dev.platform_data =
2022 &msm8960_i2c_qup_gsbi12_pdata;
2023}
2024
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002025static void __init msm8960_gfx_init(void)
2026{
Jeremy Gebben58b2dce2011-10-13 11:14:19 -06002027 uint32_t soc_platform_version = socinfo_get_version();
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002028 if (SOCINFO_VERSION_MAJOR(soc_platform_version) == 1) {
2029 struct kgsl_device_platform_data *kgsl_3d0_pdata =
2030 msm_kgsl_3d0.dev.platform_data;
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002031 kgsl_3d0_pdata->pwrlevel[0].gpu_freq = 320000000;
2032 kgsl_3d0_pdata->pwrlevel[1].gpu_freq = 266667000;
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002033 }
2034}
2035
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002036static struct msm_cpuidle_state msm_cstates[] __initdata = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06002037
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002038 {0, 0, "C0", "WFI",
2039 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
2040
2041 {0, 1, "C1", "STANDALONE_POWER_COLLAPSE",
2042 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
2043
2044 {0, 2, "C2", "POWER_COLLAPSE",
2045 MSM_PM_SLEEP_MODE_POWER_COLLAPSE},
2046
2047 {1, 0, "C0", "WFI",
2048 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
2049
2050 {1, 1, "C1", "STANDALONE_POWER_COLLAPSE",
2051 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
2052};
2053
2054static struct msm_pm_platform_data msm_pm_data[MSM_PM_SLEEP_MODE_NR * 2] = {
2055 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
2056 .idle_supported = 1,
2057 .suspend_supported = 1,
2058 .idle_enabled = 0,
2059 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002060 },
2061
2062 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
2063 .idle_supported = 1,
2064 .suspend_supported = 1,
2065 .idle_enabled = 0,
2066 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002067 },
2068
2069 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
2070 .idle_supported = 1,
2071 .suspend_supported = 1,
2072 .idle_enabled = 1,
2073 .suspend_enabled = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002074 },
2075
2076 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
2077 .idle_supported = 0,
2078 .suspend_supported = 1,
2079 .idle_enabled = 0,
2080 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002081 },
2082
2083 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
2084 .idle_supported = 1,
2085 .suspend_supported = 1,
2086 .idle_enabled = 0,
2087 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002088 },
2089
2090 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
2091 .idle_supported = 1,
2092 .suspend_supported = 0,
2093 .idle_enabled = 1,
2094 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002095 },
2096};
2097
Subhash Jadavani933e6a62011-12-26 18:05:04 +05302098static struct msm_rpmrs_level msm_rpmrs_levels[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002099 {
2100 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
2101 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
2102 true,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06002103 100, 8000, 100000, 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002104 },
2105
2106 {
2107 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
2108 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
2109 true,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06002110 2000, 6000, 60100000, 3000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002111 },
2112
2113 {
2114 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2115 MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE),
2116 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06002117 4200, 5000, 60350000, 3500,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002118 },
2119
2120 {
2121 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2122 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, MAX, ACTIVE),
2123 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06002124 6300, 4500, 65350000, 4800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002125 },
Maheshkumar Sivasubramanian7df12362011-11-02 08:25:49 -06002126 {
2127 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2128 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, ACTIVE, RET_HIGH),
2129 false,
2130 7000, 3500, 66600000, 5150,
2131 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002132
2133 {
2134 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2135 MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE),
2136 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06002137 11700, 2500, 67850000, 5500,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002138 },
2139
2140 {
2141 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2142 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
2143 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06002144 13800, 2000, 71850000, 6800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002145 },
2146
2147 {
2148 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2149 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH),
2150 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06002151 29700, 500, 75850000, 8800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002152 },
2153
2154 {
2155 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2156 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
2157 false,
Maheshkumar Sivasubramanianef101a02011-09-19 16:34:30 -06002158 29700, 0, 76350000, 9800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002159 },
2160};
2161
Praveen Chidambaram78499012011-11-01 17:15:17 -06002162static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = {
2163 .levels = &msm_rpmrs_levels[0],
2164 .num_levels = ARRAY_SIZE(msm_rpmrs_levels),
2165 .vdd_mem_levels = {
2166 [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000,
2167 [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000,
2168 [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000,
2169 [MSM_RPMRS_VDD_MEM_MAX] = 1150000,
2170 },
2171 .vdd_dig_levels = {
2172 [MSM_RPMRS_VDD_DIG_RET_LOW] = 500000,
2173 [MSM_RPMRS_VDD_DIG_RET_HIGH] = 750000,
2174 [MSM_RPMRS_VDD_DIG_ACTIVE] = 950000,
2175 [MSM_RPMRS_VDD_DIG_MAX] = 1150000,
2176 },
2177 .vdd_mask = 0x7FFFFF,
2178 .rpmrs_target_id = {
2179 [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK,
2180 [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST,
2181 [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_PM8921_S3_0,
2182 [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_PM8921_S3_1,
2183 [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8921_L24_0,
2184 [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8921_L24_1,
2185 [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL,
2186 },
2187};
2188
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -06002189static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
2190 .mode = MSM_PM_BOOT_CONFIG_TZ,
2191};
2192
Subhash Jadavani933e6a62011-12-26 18:05:04 +05302193uint32_t msm_rpm_get_swfi_latency(void)
2194{
2195 int i;
2196
2197 for (i = 0; i < ARRAY_SIZE(msm_rpmrs_levels); i++) {
2198 if (msm_rpmrs_levels[i].sleep_mode ==
2199 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)
2200 return msm_rpmrs_levels[i].latency_us;
2201 }
2202
2203 return 0;
2204}
2205
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002206#ifdef CONFIG_I2C
2207#define I2C_SURF 1
2208#define I2C_FFA (1 << 1)
2209#define I2C_RUMI (1 << 2)
2210#define I2C_SIM (1 << 3)
2211#define I2C_FLUID (1 << 4)
Amir Samuelov05f87802011-08-27 18:30:12 +03002212#define I2C_LIQUID (1 << 5)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002213
2214struct i2c_registry {
2215 u8 machs;
2216 int bus;
2217 struct i2c_board_info *info;
2218 int len;
2219};
2220
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002221/* Sensors DSPS platform data */
2222#ifdef CONFIG_MSM_DSPS
2223#define DSPS_PIL_GENERIC_NAME "dsps"
2224#endif /* CONFIG_MSM_DSPS */
2225
2226static void __init msm8960_init_dsps(void)
2227{
2228#ifdef CONFIG_MSM_DSPS
2229 struct msm_dsps_platform_data *pdata =
2230 msm_dsps_device.dev.platform_data;
2231 pdata->pil_name = DSPS_PIL_GENERIC_NAME;
2232 pdata->gpios = NULL;
2233 pdata->gpios_num = 0;
2234
2235 platform_device_register(&msm_dsps_device);
2236#endif /* CONFIG_MSM_DSPS */
2237}
2238
Vamsi Krishna6aa6b1f2011-12-14 22:55:20 -08002239static int hsic_peripheral_status = 1;
2240static DEFINE_MUTEX(hsic_status_lock);
2241
2242void peripheral_connect()
2243{
2244 mutex_lock(&hsic_status_lock);
2245 if (hsic_peripheral_status)
2246 goto out;
2247 platform_device_add(&msm_device_hsic_host);
2248 hsic_peripheral_status = 1;
2249out:
2250 mutex_unlock(&hsic_status_lock);
2251}
2252EXPORT_SYMBOL(peripheral_connect);
2253
2254void peripheral_disconnect()
2255{
2256 mutex_lock(&hsic_status_lock);
2257 if (!hsic_peripheral_status)
2258 goto out;
2259 platform_device_del(&msm_device_hsic_host);
2260 hsic_peripheral_status = 0;
2261out:
2262 mutex_unlock(&hsic_status_lock);
2263}
2264EXPORT_SYMBOL(peripheral_disconnect);
2265
Vamsi Krishna98f54fb2011-11-02 14:55:41 -07002266static void __init msm8960_init_hsic(void)
2267{
2268#ifdef CONFIG_USB_EHCI_MSM_HSIC
2269 uint32_t version = socinfo_get_version();
2270
Vamsi Krishnaf74d2edb2011-12-02 10:41:11 -08002271 if (SOCINFO_VERSION_MAJOR(version) == 1)
Vamsi Krishna98f54fb2011-11-02 14:55:41 -07002272 return;
2273
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08002274 if (PLATFORM_IS_CHARM25() || machine_is_msm8960_liquid())
Vamsi Krishnaf74d2edb2011-12-02 10:41:11 -08002275 platform_device_register(&msm_device_hsic_host);
Vamsi Krishna98f54fb2011-11-02 14:55:41 -07002276#endif
2277}
2278
Amir Samuelov5137e392011-09-21 17:31:25 +03002279#ifdef CONFIG_ISL9519_CHARGER
2280static struct isl_platform_data isl_data __initdata = {
2281 .valid_n_gpio = 0, /* Not required when notify-by-pmic */
2282 .chg_detection_config = NULL, /* Not required when notify-by-pmic */
2283 .max_system_voltage = 4200,
2284 .min_system_voltage = 3200,
Amir Samuelov95f49ff2012-01-29 09:14:08 +02002285 .chgcurrent = 1900,
2286 .term_current = 0,
Amir Samuelov5137e392011-09-21 17:31:25 +03002287 .input_current = 2048,
2288};
2289
2290static struct i2c_board_info isl_charger_i2c_info[] __initdata = {
2291 {
2292 I2C_BOARD_INFO("isl9519q", 0x9),
2293 .irq = 0, /* Not required when notify-by-pmic */
2294 .platform_data = &isl_data,
2295 },
2296};
2297#endif /* CONFIG_ISL9519_CHARGER */
2298
Amir Samuelov755616d2011-12-13 16:34:46 +02002299static struct i2c_board_info liquid_io_expander_i2c_info[] __initdata = {
2300 {
2301 I2C_BOARD_INFO("sx1508q", 0x20),
2302 .platform_data = &msm8960_sx150x_data[SX150X_LIQUID]
2303 },
2304};
2305
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002306static struct i2c_registry msm8960_i2c_devices[] __initdata = {
Amir Samuelov5137e392011-09-21 17:31:25 +03002307#ifdef CONFIG_ISL9519_CHARGER
2308 {
2309 I2C_LIQUID,
2310 MSM_8960_GSBI10_QUP_I2C_BUS_ID,
2311 isl_charger_i2c_info,
2312 ARRAY_SIZE(isl_charger_i2c_info),
2313 },
2314#endif /* CONFIG_ISL9519_CHARGER */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002315 {
2316 I2C_SURF | I2C_FFA | I2C_FLUID,
2317 MSM_8960_GSBI3_QUP_I2C_BUS_ID,
2318 cyttsp_info,
2319 ARRAY_SIZE(cyttsp_info),
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -07002320 },
Mohan Pallaka50837382011-09-07 11:00:57 +05302321 {
2322 I2C_LIQUID,
2323 MSM_8960_GSBI3_QUP_I2C_BUS_ID,
2324 mxt_device_info,
2325 ARRAY_SIZE(mxt_device_info),
2326 },
Mohan Pallaka5e490392011-09-09 15:18:41 +05302327 {
Mohan Pallakaf69f0492011-11-21 13:08:33 +05302328 I2C_FFA | I2C_LIQUID,
Mohan Pallaka5e490392011-09-09 15:18:41 +05302329 MSM_8960_GSBI10_QUP_I2C_BUS_ID,
Eugene Yasmand2316b82011-12-07 18:23:48 +02002330 sii_device_info,
2331 ARRAY_SIZE(sii_device_info),
2332 },
2333 {
2334 I2C_LIQUID,
2335 MSM_8960_GSBI10_QUP_I2C_BUS_ID,
Mohan Pallaka5e490392011-09-09 15:18:41 +05302336 msm_isa1200_board_info,
2337 ARRAY_SIZE(msm_isa1200_board_info),
2338 },
Amir Samuelov755616d2011-12-13 16:34:46 +02002339 {
2340 I2C_LIQUID,
2341 MSM_8960_GSBI10_QUP_I2C_BUS_ID,
2342 liquid_io_expander_i2c_info,
2343 ARRAY_SIZE(liquid_io_expander_i2c_info),
2344 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002345};
2346#endif /* CONFIG_I2C */
2347
2348static void __init register_i2c_devices(void)
2349{
2350#ifdef CONFIG_I2C
2351 u8 mach_mask = 0;
2352 int i;
Kevin Chan09f4e662011-12-16 08:17:02 -08002353#ifdef CONFIG_MSM_CAMERA
2354 struct i2c_registry msm8960_camera_i2c_devices = {
2355 I2C_SURF | I2C_FFA | I2C_FLUID | I2C_LIQUID | I2C_RUMI,
2356 MSM_8960_GSBI4_QUP_I2C_BUS_ID,
2357 msm8960_camera_board_info.board_info,
2358 msm8960_camera_board_info.num_i2c_board_info,
2359 };
2360#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002361
2362 /* Build the matching 'supported_machs' bitmask */
2363 if (machine_is_msm8960_cdp())
2364 mach_mask = I2C_SURF;
2365 else if (machine_is_msm8960_rumi3())
2366 mach_mask = I2C_RUMI;
2367 else if (machine_is_msm8960_sim())
2368 mach_mask = I2C_SIM;
Amy Maloche2d028032011-07-20 14:08:06 -07002369 else if (machine_is_msm8960_fluid())
2370 mach_mask = I2C_FLUID;
Amir Samuelov05f87802011-08-27 18:30:12 +03002371 else if (machine_is_msm8960_liquid())
2372 mach_mask = I2C_LIQUID;
Amy Maloche1b0663f2011-08-02 16:46:22 -07002373 else if (machine_is_msm8960_mtp())
2374 mach_mask = I2C_FFA;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002375 else
2376 pr_err("unmatched machine ID in register_i2c_devices\n");
2377
2378 /* Run the array and install devices as appropriate */
2379 for (i = 0; i < ARRAY_SIZE(msm8960_i2c_devices); ++i) {
2380 if (msm8960_i2c_devices[i].machs & mach_mask)
2381 i2c_register_board_info(msm8960_i2c_devices[i].bus,
2382 msm8960_i2c_devices[i].info,
2383 msm8960_i2c_devices[i].len);
2384 }
Kevin Chan09f4e662011-12-16 08:17:02 -08002385#ifdef CONFIG_MSM_CAMERA
2386 if (msm8960_camera_i2c_devices.machs & mach_mask)
2387 i2c_register_board_info(msm8960_camera_i2c_devices.bus,
2388 msm8960_camera_i2c_devices.info,
2389 msm8960_camera_i2c_devices.len);
2390#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002391#endif
2392}
2393
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002394static void __init msm8960_sim_init(void)
2395{
Jeff Ohlstein7e668552011-10-06 16:17:25 -07002396 struct msm_watchdog_pdata *wdog_pdata = (struct msm_watchdog_pdata *)
2397 &msm8960_device_watchdog.dev.platform_data;
2398
2399 wdog_pdata->bark_time = 15000;
Siddartha Mohanadossfad0af12012-01-20 15:08:38 -08002400 msm_tsens_early_init(&msm_tsens_pdata);
Praveen Chidambaram78499012011-11-01 17:15:17 -06002401 BUG_ON(msm_rpm_init(&msm8960_rpm_data));
2402 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002403 regulator_suppress_info_printing();
David Collins26f05562011-06-20 09:56:28 -07002404 platform_device_register(&msm8960_device_rpm_regulator);
Stephen Boydbb600ae2011-08-02 20:11:40 -07002405 msm_clock_init(&msm8960_clock_init_data);
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08002406 msm8960_init_pmic();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002407
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002408 msm8960_device_otg.dev.platform_data = &msm_otg_pdata;
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08002409 msm8960_init_gpiomux();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002410 msm8960_i2c_init();
2411 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
2412 msm_spm_l2_init(msm_spm_l2_data);
2413 msm8960_init_buses();
2414 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08002415 msm8960_pm8921_gpio_mpp_init();
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002416 platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices));
Matt Wagantallec57f062011-08-16 23:54:46 -07002417 acpuclk_init(&acpuclk_8960_soc_data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002418
2419 msm8960_device_qup_spi_gsbi1.dev.platform_data =
2420 &msm8960_qup_spi_gsbi1_pdata;
2421 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
2422
2423 msm8960_init_mmc();
Stepan Moskovchenko24cd8642011-11-29 13:07:53 -08002424 msm8960_init_fb();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002425 slim_register_board_info(msm_slim_devices,
2426 ARRAY_SIZE(msm_slim_devices));
2427 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
2428 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
2429 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
2430 msm_pm_data);
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -06002431 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Maheshkumar Sivasubramanian6866b1c2011-06-07 14:20:33 -06002432 msm_pm_init_sleep_status_data(&msm_pm_slp_sts_data);
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002433}
2434
2435static void __init msm8960_rumi3_init(void)
2436{
Siddartha Mohanadossfad0af12012-01-20 15:08:38 -08002437 msm_tsens_early_init(&msm_tsens_pdata);
Praveen Chidambaram78499012011-11-01 17:15:17 -06002438 BUG_ON(msm_rpm_init(&msm8960_rpm_data));
2439 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002440 regulator_suppress_info_printing();
David Collins26f05562011-06-20 09:56:28 -07002441 platform_device_register(&msm8960_device_rpm_regulator);
Stephen Boydbb600ae2011-08-02 20:11:40 -07002442 msm_clock_init(&msm8960_dummy_clock_init_data);
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08002443 msm8960_init_gpiomux();
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08002444 msm8960_init_pmic();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002445 msm8960_device_qup_spi_gsbi1.dev.platform_data =
2446 &msm8960_qup_spi_gsbi1_pdata;
2447 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
2448 msm8960_i2c_init();
2449 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
2450 msm_spm_l2_init(msm_spm_l2_data);
2451 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08002452 msm8960_pm8921_gpio_mpp_init();
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002453 platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002454 msm8960_init_mmc();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002455 register_i2c_devices();
Stepan Moskovchenko24cd8642011-11-29 13:07:53 -08002456 msm8960_init_fb();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002457 slim_register_board_info(msm_slim_devices,
2458 ARRAY_SIZE(msm_slim_devices));
2459 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
2460 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
2461 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
2462 msm_pm_data);
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -06002463 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Maheshkumar Sivasubramanian6866b1c2011-06-07 14:20:33 -06002464 msm_pm_init_sleep_status_data(&msm_pm_slp_sts_data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002465}
2466
2467static void __init msm8960_cdp_init(void)
2468{
Naveen Ramaraj76483ad2011-09-06 14:25:44 -07002469 if (meminfo_init(SYS_MEMORY, SZ_256M) < 0)
2470 pr_err("meminfo_init() failed!\n");
2471
Siddartha Mohanadossfad0af12012-01-20 15:08:38 -08002472 msm_tsens_early_init(&msm_tsens_pdata);
Praveen Chidambaram78499012011-11-01 17:15:17 -06002473 BUG_ON(msm_rpm_init(&msm8960_rpm_data));
2474 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
Abhijeet Dharmapurikar6d565fd2011-09-15 18:49:56 -07002475
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002476 regulator_suppress_info_printing();
2477 if (msm_xo_init())
2478 pr_err("Failed to initialize XO votes\n");
David Collins26f05562011-06-20 09:56:28 -07002479 platform_device_register(&msm8960_device_rpm_regulator);
Stephen Boydbb600ae2011-08-02 20:11:40 -07002480 msm_clock_init(&msm8960_clock_init_data);
Vijayavardhan Vennapusafc464f02011-11-04 21:54:00 +05302481 if (machine_is_msm8960_liquid())
2482 msm_otg_pdata.mhl_enable = true;
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002483 msm8960_device_otg.dev.platform_data = &msm_otg_pdata;
Anji jonnalaa8b8d732011-12-06 10:03:24 +05302484 if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() ||
2485 machine_is_msm8960_cdp()) {
2486 msm_otg_pdata.phy_init_seq = wr_phy_init_seq;
2487 } else if (machine_is_msm8960_liquid()) {
2488 msm_otg_pdata.phy_init_seq =
2489 liquid_v1_phy_init_seq;
2490 }
Anji jonnalaa7c1c5c2011-12-12 12:20:36 +05302491 msm_otg_pdata.swfi_latency =
2492 msm_rpmrs_levels[0].latency_us;
Vijayavardhan Vennapusa2b592824f2011-11-02 19:51:32 +05302493#ifdef CONFIG_USB_EHCI_MSM_HSIC
2494 if (machine_is_msm8960_liquid()) {
2495 if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 2)
2496 msm_hsic_pdata.hub_reset = HSIC_HUB_RESET_GPIO;
2497 }
2498#endif
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +05302499 msm_device_hsic_host.dev.platform_data = &msm_hsic_pdata;
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08002500 msm8960_init_gpiomux();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002501 msm8960_device_qup_spi_gsbi1.dev.platform_data =
2502 &msm8960_qup_spi_gsbi1_pdata;
2503 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08002504
2505 msm8960_init_pmic();
Mohan Pallakaf69f0492011-11-21 13:08:33 +05302506 if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 2 &&
2507 (machine_is_msm8960_mtp())) || machine_is_msm8960_liquid())
2508 msm_isa1200_board_info[0].platform_data = &isa1200_1_pdata;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002509 msm8960_i2c_init();
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002510 msm8960_gfx_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002511 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
2512 msm_spm_l2_init(msm_spm_l2_data);
2513 msm8960_init_buses();
2514 platform_add_devices(msm_footswitch_devices,
2515 msm_num_footswitch_devices);
David Collinsb10be1d2011-09-02 10:29:31 -07002516 if (machine_is_msm8960_liquid())
2517 platform_device_register(&msm8960_device_ext_3p3v_vreg);
David Collinsd5a40732011-11-29 15:53:56 -08002518 if (machine_is_msm8960_cdp())
2519 platform_device_register(&msm8960_device_ext_l2_vreg);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002520 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08002521 msm8960_pm8921_gpio_mpp_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002522 platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
Vamsi Krishna98f54fb2011-11-02 14:55:41 -07002523 msm8960_init_hsic();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002524 msm8960_init_cam();
2525 msm8960_init_mmc();
Matt Wagantallec57f062011-08-16 23:54:46 -07002526 acpuclk_init(&acpuclk_8960_soc_data);
Mohan Pallaka50837382011-09-07 11:00:57 +05302527 if (machine_is_msm8960_liquid())
2528 mxt_init_hw_liquid();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002529 register_i2c_devices();
Stepan Moskovchenko24cd8642011-11-29 13:07:53 -08002530 msm8960_init_fb();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002531 slim_register_board_info(msm_slim_devices,
2532 ARRAY_SIZE(msm_slim_devices));
2533 msm8960_init_dsps();
2534 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
2535 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
2536 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
2537 msm_pm_data);
Larry Bassela7eadea2011-07-14 10:46:00 -07002538 change_memory_power = &msm8960_change_memory_power;
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -06002539 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Maheshkumar Sivasubramanian6866b1c2011-06-07 14:20:33 -06002540 msm_pm_init_sleep_status_data(&msm_pm_slp_sts_data);
Joel Kingb8352a12011-11-15 18:46:24 -08002541 if (PLATFORM_IS_CHARM25())
2542 platform_add_devices(mdm_devices, ARRAY_SIZE(mdm_devices));
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002543}
2544
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002545MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
2546 .map_io = msm8960_map_io,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002547 .reserve = msm8960_reserve,
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002548 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302549 .handle_irq = gic_handle_irq,
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002550 .timer = &msm_timer,
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002551 .init_machine = msm8960_sim_init,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002552 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07002553 .init_very_early = msm8960_early_memory,
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002554MACHINE_END
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08002555
2556MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3")
2557 .map_io = msm8960_map_io,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002558 .reserve = msm8960_reserve,
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08002559 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302560 .handle_irq = gic_handle_irq,
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08002561 .timer = &msm_timer,
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002562 .init_machine = msm8960_rumi3_init,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002563 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07002564 .init_very_early = msm8960_early_memory,
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08002565MACHINE_END
2566
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002567MACHINE_START(MSM8960_CDP, "QCT MSM8960 CDP")
2568 .map_io = msm8960_map_io,
2569 .reserve = msm8960_reserve,
2570 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302571 .handle_irq = gic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002572 .timer = &msm_timer,
2573 .init_machine = msm8960_cdp_init,
2574 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07002575 .init_very_early = msm8960_early_memory,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002576MACHINE_END
2577
2578MACHINE_START(MSM8960_MTP, "QCT MSM8960 MTP")
2579 .map_io = msm8960_map_io,
2580 .reserve = msm8960_reserve,
2581 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302582 .handle_irq = gic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002583 .timer = &msm_timer,
2584 .init_machine = msm8960_cdp_init,
2585 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07002586 .init_very_early = msm8960_early_memory,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002587MACHINE_END
2588
2589MACHINE_START(MSM8960_FLUID, "QCT MSM8960 FLUID")
2590 .map_io = msm8960_map_io,
2591 .reserve = msm8960_reserve,
2592 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302593 .handle_irq = gic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002594 .timer = &msm_timer,
2595 .init_machine = msm8960_cdp_init,
2596 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07002597 .init_very_early = msm8960_early_memory,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002598MACHINE_END
Amir Samuelov0d1f8ae2011-07-28 11:13:58 +03002599
2600MACHINE_START(MSM8960_LIQUID, "QCT MSM8960 LIQUID")
2601 .map_io = msm8960_map_io,
2602 .reserve = msm8960_reserve,
2603 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302604 .handle_irq = gic_handle_irq,
Amir Samuelov0d1f8ae2011-07-28 11:13:58 +03002605 .timer = &msm_timer,
2606 .init_machine = msm8960_cdp_init,
2607 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07002608 .init_very_early = msm8960_early_memory,
Amir Samuelov0d1f8ae2011-07-28 11:13:58 +03002609MACHINE_END