blob: 106d2ef8dd3f47842d3e6d739f5d17170e2d23ec [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
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +053073#include <linux/mfd/wcd9xxx/core.h>
74#include <linux/mfd/wcd9xxx/pdata.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070075#endif
76
Laura Abbottd6183792011-08-19 13:42:24 -070077#include <linux/ion.h>
78#include <mach/ion.h>
Joel Kingb8352a12011-11-15 18:46:24 -080079#include <mach/mdm2.h>
Vamsi Krishna6aa6b1f2011-12-14 22:55:20 -080080#include <mach/mdm-peripheral.h>
Laura Abbottf8c03b92012-02-16 14:57:58 -080081#include <mach/msm_rtb.h>
Laura Abbott306bcc22012-03-08 11:24:53 -080082#include <mach/msm_cache_dump.h>
83#include <mach/scm.h>
Laura Abbottd6183792011-08-19 13:42:24 -070084
Larry Bassel41a055b2011-12-06 16:15:14 -080085#include <linux/fmem.h>
86
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070087#include "timer.h"
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -080088#include "devices.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070089#include "devices-msm8x60.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070090#include "spm.h"
Stepan Moskovchenko5a83dba2011-12-05 17:30:17 -080091#include "board-8960.h"
Matt Wagantall7cca4642012-02-01 16:43:24 -080092#include "pm.h"
Abhijeet Dharmapurikarefaca4f2011-12-27 16:24:07 -080093#include <mach/cpuidle.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070094#include "rpm_resources.h"
95#include "mpm.h"
Matt Wagantall6d9ebee2011-08-26 12:15:24 -070096#include "acpuclock.h"
Naveen Ramaraj76483ad2011-09-06 14:25:44 -070097#include "smd_private.h"
Maheshkumar Sivasubramanian8ccc16e2011-10-25 15:59:57 -060098#include "pm-boot.h"
Jeff Ohlstein7e668552011-10-06 16:17:25 -070099#include "msm_watchdog.h"
Stepan Moskovchenkoc6ada422011-11-28 19:31:16 -0800100
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700101static struct platform_device msm_fm_platform_init = {
102 .name = "iris_fm",
103 .id = -1,
104};
105
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700106#define KS8851_RST_GPIO 89
107#define KS8851_IRQ_GPIO 90
Mohan Pallaka5e490392011-09-09 15:18:41 +0530108#define HAP_SHIFT_LVL_OE_GPIO 47
109
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700110#if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700111
Stepan Moskovchenkoc6ada422011-11-28 19:31:16 -0800112struct sx150x_platform_data msm8960_sx150x_data[] = {
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700113 [SX150X_CAM] = {
114 .gpio_base = GPIO_CAM_EXPANDER_BASE,
115 .oscio_is_gpo = false,
116 .io_pullup_ena = 0x0,
Nishant Pandit474f2252011-07-23 23:17:56 +0530117 .io_pulldn_ena = 0xc0,
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700118 .io_open_drain_ena = 0x0,
119 .irq_summary = -1,
120 },
Amir Samuelov755616d2011-12-13 16:34:46 +0200121 [SX150X_LIQUID] = {
122 .gpio_base = GPIO_LIQUID_EXPANDER_BASE,
123 .oscio_is_gpo = false,
124 .io_pullup_ena = 0x0c08,
125 .io_pulldn_ena = 0x4060,
126 .io_open_drain_ena = 0x000c,
127 .io_polarity = 0,
128 .irq_summary = -1,
129 },
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700130};
Nishant Pandit474f2252011-07-23 23:17:56 +0530131
132#endif
133
Olav Haugana21169d2012-01-04 09:17:06 -0800134#define MSM_PMEM_ADSP_SIZE 0x7800000
Bharath Ramachandramurthy2fd017a2012-03-13 10:21:09 -0700135#define MSM_PMEM_AUDIO_SIZE 0x4CF000
Mathew Karimpanal15fa5c42011-12-14 21:28:10 -0800136#define MSM_PMEM_SIZE 0x2800000 /* 40 Mbytes */
Ravishangar Kalyanam671f5ce2011-12-06 20:25:29 -0800137#define MSM_LIQUID_PMEM_SIZE 0x4000000 /* 64 Mbytes */
Ravishangar Kalyanam8c79ead2011-12-02 21:05:01 -0800138#define MSM_HDMI_PRIM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
Laura Abbott2d1760b2011-09-29 21:31:24 -0700139
140#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Bharath Ramachandramurthy2fd017a2012-03-13 10:21:09 -0700141#define MSM_PMEM_KERNEL_EBI1_SIZE 0x65000
Olav Haugan32594552012-03-13 11:40:05 -0700142#ifdef CONFIG_MSM_IOMMU
143#define MSM_ION_MM_SIZE 0x3800000
144#define MSM_ION_SF_SIZE 0x0
Olav Hauganfbbf05b2012-04-05 14:33:41 -0700145#define MSM_ION_QSECOM_SIZE 0x780000 /* (7.5MB) */
Olav Haugan32594552012-03-13 11:40:05 -0700146#define MSM_ION_HEAP_NUM 7
147#else
148#define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE
149#define MSM_ION_SF_SIZE MSM_PMEM_SIZE
Olav Hauganfbbf05b2012-04-05 14:33:41 -0700150#define MSM_ION_QSECOM_SIZE 0x600000 /* (6MB) */
Olav Haugan32594552012-03-13 11:40:05 -0700151#define MSM_ION_HEAP_NUM 8
152#endif
Olav Haugan42ebe712012-01-10 16:30:58 -0800153#define MSM_ION_MM_FW_SIZE 0x200000 /* (2MB) */
Olav Hauganb5be7992011-11-18 14:29:02 -0800154#define MSM_ION_MFC_SIZE SZ_8K
Olav Haugan7355db02012-01-13 16:59:13 -0800155#define MSM_ION_AUDIO_SIZE MSM_PMEM_AUDIO_SIZE
Olav Haugan32594552012-03-13 11:40:05 -0700156
Olav Hauganb5be7992011-11-18 14:29:02 -0800157#define MSM_LIQUID_ION_MM_SIZE (MSM_ION_MM_SIZE + 0x600000)
Ravishangar Kalyanam8c79ead2011-12-02 21:05:01 -0800158#define MSM_LIQUID_ION_SF_SIZE MSM_LIQUID_PMEM_SIZE
159#define MSM_HDMI_PRIM_ION_SF_SIZE MSM_HDMI_PRIM_PMEM_SIZE
160static unsigned msm_ion_sf_size = MSM_ION_SF_SIZE;
Laura Abbott2d1760b2011-09-29 21:31:24 -0700161#else
Laura Abbott6db11c92011-11-04 10:31:43 -0700162#define MSM_PMEM_KERNEL_EBI1_SIZE 0x110C000
Olav Hauganb5be7992011-11-18 14:29:02 -0800163#define MSM_ION_HEAP_NUM 1
Laura Abbott2d1760b2011-09-29 21:31:24 -0700164#endif
Laura Abbottd6183792011-08-19 13:42:24 -0700165
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700166#ifdef CONFIG_KERNEL_PMEM_EBI_REGION
167static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE;
168static int __init pmem_kernel_ebi1_size_setup(char *p)
169{
170 pmem_kernel_ebi1_size = memparse(p, NULL);
171 return 0;
172}
173early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup);
174#endif
175
176#ifdef CONFIG_ANDROID_PMEM
177static unsigned pmem_size = MSM_PMEM_SIZE;
Ravishangar Kalyanam671f5ce2011-12-06 20:25:29 -0800178static unsigned pmem_param_set;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700179static int __init pmem_size_setup(char *p)
180{
181 pmem_size = memparse(p, NULL);
Ravishangar Kalyanam671f5ce2011-12-06 20:25:29 -0800182 pmem_param_set = 1;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700183 return 0;
184}
185early_param("pmem_size", pmem_size_setup);
186
187static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
188
189static int __init pmem_adsp_size_setup(char *p)
190{
191 pmem_adsp_size = memparse(p, NULL);
192 return 0;
193}
194early_param("pmem_adsp_size", pmem_adsp_size_setup);
195
196static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
197
198static int __init pmem_audio_size_setup(char *p)
199{
200 pmem_audio_size = memparse(p, NULL);
201 return 0;
202}
203early_param("pmem_audio_size", pmem_audio_size_setup);
204#endif
205
206#ifdef CONFIG_ANDROID_PMEM
Laura Abbott2d1760b2011-09-29 21:31:24 -0700207#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700208static struct android_pmem_platform_data android_pmem_pdata = {
209 .name = "pmem",
210 .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING,
211 .cached = 1,
212 .memory_type = MEMTYPE_EBI1,
213};
214
215static struct platform_device android_pmem_device = {
216 .name = "android_pmem",
217 .id = 0,
218 .dev = {.platform_data = &android_pmem_pdata},
219};
220
221static struct android_pmem_platform_data android_pmem_adsp_pdata = {
222 .name = "pmem_adsp",
223 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
224 .cached = 0,
225 .memory_type = MEMTYPE_EBI1,
226};
227static struct platform_device android_pmem_adsp_device = {
228 .name = "android_pmem",
229 .id = 2,
230 .dev = { .platform_data = &android_pmem_adsp_pdata },
231};
232
233static struct android_pmem_platform_data android_pmem_audio_pdata = {
234 .name = "pmem_audio",
235 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
236 .cached = 0,
237 .memory_type = MEMTYPE_EBI1,
238};
239
240static struct platform_device android_pmem_audio_device = {
241 .name = "android_pmem",
242 .id = 4,
243 .dev = { .platform_data = &android_pmem_audio_pdata },
244};
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700245#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
246#endif /*CONFIG_ANDROID_PMEM*/
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700247
Larry Bassel41a055b2011-12-06 16:15:14 -0800248struct fmem_platform_data fmem_pdata = {
249};
250
Swaminathan Sathappanb77c65e92011-09-30 18:36:09 -0700251#define DSP_RAM_BASE_8960 0x8da00000
252#define DSP_RAM_SIZE_8960 0x1800000
253static int dspcrashd_pdata_8960 = 0xDEADDEAD;
254
255static struct resource resources_dspcrashd_8960[] = {
256 {
257 .name = "msm_dspcrashd",
258 .start = DSP_RAM_BASE_8960,
259 .end = DSP_RAM_BASE_8960 + DSP_RAM_SIZE_8960,
260 .flags = IORESOURCE_DMA,
261 },
262};
263
Stepan Moskovchenkofc70d902011-11-30 12:39:36 -0800264static struct platform_device msm_device_dspcrashd_8960 = {
Swaminathan Sathappanb77c65e92011-09-30 18:36:09 -0700265 .name = "msm_dspcrashd",
266 .num_resources = ARRAY_SIZE(resources_dspcrashd_8960),
267 .resource = resources_dspcrashd_8960,
268 .dev = { .platform_data = &dspcrashd_pdata_8960 },
269};
270
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700271static struct memtype_reserve msm8960_reserve_table[] __initdata = {
272 [MEMTYPE_SMI] = {
273 },
274 [MEMTYPE_EBI0] = {
275 .flags = MEMTYPE_FLAGS_1M_ALIGN,
276 },
277 [MEMTYPE_EBI1] = {
278 .flags = MEMTYPE_FLAGS_1M_ALIGN,
279 },
280};
281
Laura Abbottf8c03b92012-02-16 14:57:58 -0800282#if defined(CONFIG_MSM_RTB)
283static struct msm_rtb_platform_data msm_rtb_pdata = {
284 .size = SZ_1M,
285};
286
287static int __init msm_rtb_set_buffer_size(char *p)
288{
289 int s;
290
291 s = memparse(p, NULL);
292 msm_rtb_pdata.size = ALIGN(s, SZ_4K);
293 return 0;
294}
295early_param("msm_rtb_size", msm_rtb_set_buffer_size);
296
297
298static struct platform_device msm_rtb_device = {
299 .name = "msm_rtb",
300 .id = -1,
301 .dev = {
302 .platform_data = &msm_rtb_pdata,
303 },
304};
305#endif
306
307static void __init reserve_rtb_memory(void)
308{
309#if defined(CONFIG_MSM_RTB)
310 msm8960_reserve_table[MEMTYPE_EBI1].size += msm_rtb_pdata.size;
311#endif
312}
313
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700314static void __init size_pmem_devices(void)
315{
316#ifdef CONFIG_ANDROID_PMEM
Laura Abbott2d1760b2011-09-29 21:31:24 -0700317#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700318 android_pmem_adsp_pdata.size = pmem_adsp_size;
Ravishangar Kalyanam671f5ce2011-12-06 20:25:29 -0800319
Ravishangar Kalyanam8c79ead2011-12-02 21:05:01 -0800320 if (!pmem_param_set) {
321 if (machine_is_msm8960_liquid())
322 pmem_size = MSM_LIQUID_PMEM_SIZE;
Ravishangar Kalyanamfda36c42012-03-26 16:28:19 -0700323 if (msm8960_hdmi_as_primary_selected())
Ravishangar Kalyanam8c79ead2011-12-02 21:05:01 -0800324 pmem_size = MSM_HDMI_PRIM_PMEM_SIZE;
325 }
326
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700327 android_pmem_pdata.size = pmem_size;
328 android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE;
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700329#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
330#endif /*CONFIG_ANDROID_PMEM*/
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700331}
332
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700333#ifdef CONFIG_ANDROID_PMEM
334#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700335static void __init reserve_memory_for(struct android_pmem_platform_data *p)
336{
337 msm8960_reserve_table[p->memory_type].size += p->size;
338}
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700339#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
340#endif /*CONFIG_ANDROID_PMEM*/
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700341
342static void __init reserve_pmem_memory(void)
343{
344#ifdef CONFIG_ANDROID_PMEM
Laura Abbott2d1760b2011-09-29 21:31:24 -0700345#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700346 reserve_memory_for(&android_pmem_adsp_pdata);
347 reserve_memory_for(&android_pmem_pdata);
348 reserve_memory_for(&android_pmem_audio_pdata);
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700349#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700350 msm8960_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size;
351#endif
352}
353
Larry Basselb4126da2011-07-18 14:31:33 -0700354static int msm8960_paddr_to_memtype(unsigned int paddr)
355{
356 return MEMTYPE_EBI1;
357}
358
Olav Hauganf6dc7742012-02-15 09:11:55 -0800359#define FMEM_ENABLED 1
360
Laura Abbottd6183792011-08-19 13:42:24 -0700361#ifdef CONFIG_ION_MSM
Olav Haugan0703dbf2011-12-19 17:53:38 -0800362#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
363static struct ion_cp_heap_pdata cp_mm_ion_pdata = {
364 .permission_type = IPT_TYPE_MM_CARVEOUT,
Olav Haugan42ebe712012-01-10 16:30:58 -0800365 .align = PAGE_SIZE,
Olav Hauganf6dc7742012-02-15 09:11:55 -0800366 .reusable = FMEM_ENABLED,
367 .mem_is_fmem = FMEM_ENABLED,
Olav Haugan0703dbf2011-12-19 17:53:38 -0800368};
369
370static struct ion_cp_heap_pdata cp_mfc_ion_pdata = {
371 .permission_type = IPT_TYPE_MFC_SHAREDMEM,
Olav Haugan42ebe712012-01-10 16:30:58 -0800372 .align = PAGE_SIZE,
Olav Haugan65f4bd82011-12-13 11:50:08 -0800373 .reusable = 0,
Olav Hauganf6dc7742012-02-15 09:11:55 -0800374 .mem_is_fmem = FMEM_ENABLED,
Olav Haugan0703dbf2011-12-19 17:53:38 -0800375};
376
377static struct ion_co_heap_pdata co_ion_pdata = {
Olav Haugan42ebe712012-01-10 16:30:58 -0800378 .adjacent_mem_id = INVALID_HEAP_ID,
379 .align = PAGE_SIZE,
Olav Hauganf6dc7742012-02-15 09:11:55 -0800380 .mem_is_fmem = 0,
Olav Haugan42ebe712012-01-10 16:30:58 -0800381};
382
383static struct ion_co_heap_pdata fw_co_ion_pdata = {
384 .adjacent_mem_id = ION_CP_MM_HEAP_ID,
385 .align = SZ_128K,
Olav Hauganf6dc7742012-02-15 09:11:55 -0800386 .mem_is_fmem = FMEM_ENABLED,
Olav Haugan0703dbf2011-12-19 17:53:38 -0800387};
388#endif
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800389
390/**
391 * These heaps are listed in the order they will be allocated. Due to
392 * video hardware restrictions and content protection the FW heap has to
393 * be allocated adjacent (below) the MM heap and the MFC heap has to be
394 * allocated after the MM heap to ensure MFC heap is not more than 256MB
395 * away from the base address of the FW heap.
396 * However, the order of FW heap and MM heap doesn't matter since these
397 * two heaps are taken care of by separate code to ensure they are adjacent
398 * to each other.
399 * Don't swap the order unless you know what you are doing!
400 */
Stepan Moskovchenkofc70d902011-11-30 12:39:36 -0800401static struct ion_platform_data ion_pdata = {
Laura Abbott2d1760b2011-09-29 21:31:24 -0700402 .nr = MSM_ION_HEAP_NUM,
Laura Abbottd6183792011-08-19 13:42:24 -0700403 .heaps = {
404 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800405 .id = ION_SYSTEM_HEAP_ID,
Laura Abbottd6183792011-08-19 13:42:24 -0700406 .type = ION_HEAP_TYPE_SYSTEM,
Laura Abbottd6183792011-08-19 13:42:24 -0700407 .name = ION_VMALLOC_HEAP_NAME,
408 },
Laura Abbott2d1760b2011-09-29 21:31:24 -0700409#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Laura Abbottd6183792011-08-19 13:42:24 -0700410 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800411 .id = ION_CP_MM_HEAP_ID,
Olav Haugan0a852512012-01-09 10:20:55 -0800412 .type = ION_HEAP_TYPE_CP,
Olav Hauganb5be7992011-11-18 14:29:02 -0800413 .name = ION_MM_HEAP_NAME,
414 .size = MSM_ION_MM_SIZE,
Laura Abbott2d1760b2011-09-29 21:31:24 -0700415 .memory_type = ION_EBI_TYPE,
Olav Haugan0703dbf2011-12-19 17:53:38 -0800416 .extra_data = (void *) &cp_mm_ion_pdata,
Laura Abbott2d1760b2011-09-29 21:31:24 -0700417 },
Laura Abbott8c017362011-09-22 20:59:12 -0700418 {
Olav Haugan42ebe712012-01-10 16:30:58 -0800419 .id = ION_MM_FIRMWARE_HEAP_ID,
420 .type = ION_HEAP_TYPE_CARVEOUT,
421 .name = ION_MM_FIRMWARE_HEAP_NAME,
422 .size = MSM_ION_MM_FW_SIZE,
423 .memory_type = ION_EBI_TYPE,
424 .extra_data = (void *) &fw_co_ion_pdata,
425 },
426 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800427 .id = ION_CP_MFC_HEAP_ID,
Olav Haugan0a852512012-01-09 10:20:55 -0800428 .type = ION_HEAP_TYPE_CP,
Olav Hauganb5be7992011-11-18 14:29:02 -0800429 .name = ION_MFC_HEAP_NAME,
430 .size = MSM_ION_MFC_SIZE,
431 .memory_type = ION_EBI_TYPE,
Olav Haugan0703dbf2011-12-19 17:53:38 -0800432 .extra_data = (void *) &cp_mfc_ion_pdata,
Olav Hauganb5be7992011-11-18 14:29:02 -0800433 },
Olav Haugan32594552012-03-13 11:40:05 -0700434#ifndef CONFIG_MSM_IOMMU
Olav Hauganb5be7992011-11-18 14:29:02 -0800435 {
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800436 .id = ION_SF_HEAP_ID,
437 .type = ION_HEAP_TYPE_CARVEOUT,
438 .name = ION_SF_HEAP_NAME,
439 .size = MSM_ION_SF_SIZE,
440 .memory_type = ION_EBI_TYPE,
441 .extra_data = (void *) &co_ion_pdata,
442 },
Olav Haugan32594552012-03-13 11:40:05 -0700443#endif
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800444 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800445 .id = ION_IOMMU_HEAP_ID,
Laura Abbott8c017362011-09-22 20:59:12 -0700446 .type = ION_HEAP_TYPE_IOMMU,
447 .name = ION_IOMMU_HEAP_NAME,
448 },
Olav Haugan80854eb2012-01-12 12:00:23 -0800449 {
450 .id = ION_QSECOM_HEAP_ID,
451 .type = ION_HEAP_TYPE_CARVEOUT,
452 .name = ION_QSECOM_HEAP_NAME,
453 .size = MSM_ION_QSECOM_SIZE,
454 .memory_type = ION_EBI_TYPE,
455 .extra_data = (void *) &co_ion_pdata,
456 },
Olav Haugan7355db02012-01-13 16:59:13 -0800457 {
458 .id = ION_AUDIO_HEAP_ID,
459 .type = ION_HEAP_TYPE_CARVEOUT,
460 .name = ION_AUDIO_HEAP_NAME,
461 .size = MSM_ION_AUDIO_SIZE,
462 .memory_type = ION_EBI_TYPE,
463 .extra_data = (void *) &co_ion_pdata,
464 },
Laura Abbott2d1760b2011-09-29 21:31:24 -0700465#endif
Laura Abbottd6183792011-08-19 13:42:24 -0700466 }
467};
468
Stepan Moskovchenkofc70d902011-11-30 12:39:36 -0800469static struct platform_device ion_dev = {
Laura Abbottd6183792011-08-19 13:42:24 -0700470 .name = "ion-msm",
471 .id = 1,
472 .dev = { .platform_data = &ion_pdata },
473};
474#endif
475
Larry Bassel41a055b2011-12-06 16:15:14 -0800476struct platform_device fmem_device = {
477 .name = "fmem",
478 .id = 1,
479 .dev = { .platform_data = &fmem_pdata },
480};
481
Olav Haugan65f4bd82011-12-13 11:50:08 -0800482static void __init adjust_mem_for_liquid(void)
Laura Abbottd6183792011-08-19 13:42:24 -0700483{
Ravishangar Kalyanam671f5ce2011-12-06 20:25:29 -0800484 unsigned int i;
485
Ravishangar Kalyanam8c79ead2011-12-02 21:05:01 -0800486 if (!pmem_param_set) {
487 if (machine_is_msm8960_liquid())
488 msm_ion_sf_size = MSM_LIQUID_ION_SF_SIZE;
489
Ravishangar Kalyanamfda36c42012-03-26 16:28:19 -0700490 if (msm8960_hdmi_as_primary_selected())
Ravishangar Kalyanam8c79ead2011-12-02 21:05:01 -0800491 msm_ion_sf_size = MSM_HDMI_PRIM_ION_SF_SIZE;
492
Ravishangar Kalyanamfda36c42012-03-26 16:28:19 -0700493 if (machine_is_msm8960_liquid() ||
494 msm8960_hdmi_as_primary_selected()) {
Ravishangar Kalyanam8c79ead2011-12-02 21:05:01 -0800495 for (i = 0; i < ion_pdata.nr; i++) {
496 if (ion_pdata.heaps[i].id == ION_SF_HEAP_ID) {
497 ion_pdata.heaps[i].size =
498 msm_ion_sf_size;
499 pr_debug("msm_ion_sf_size 0x%x\n",
500 msm_ion_sf_size);
501 break;
502 }
Ravishangar Kalyanam671f5ce2011-12-06 20:25:29 -0800503 }
504 }
505 }
Olav Haugan65f4bd82011-12-13 11:50:08 -0800506}
507
508static void __init reserve_mem_for_ion(enum ion_memory_types mem_type,
509 unsigned long size)
510{
511 msm8960_reserve_table[mem_type].size += size;
512}
513
Olav Haugan65f4bd82011-12-13 11:50:08 -0800514/**
515 * Reserve memory for ION and calculate amount of reusable memory for fmem.
516 * We only reserve memory for heaps that are not reusable. However, we only
517 * support one reusable heap at the moment so we ignore the reusable flag for
518 * other than the first heap with reusable flag set. Also handle special case
Olav Hauganf6dc7742012-02-15 09:11:55 -0800519 * for video heaps (MM,FW, and MFC). Video requires heaps MM and MFC to be
520 * at a higher address than FW in addition to not more than 256MB away from the
521 * base address of the firmware. This means that if MM is reusable the other
522 * two heaps must be allocated in the same region as FW. This is handled by the
523 * mem_is_fmem flag in the platform data. In addition the MM heap must be
524 * adjacent to the FW heap for content protection purposes.
Olav Haugan65f4bd82011-12-13 11:50:08 -0800525 */
526static void __init reserve_ion_memory(void)
527{
528#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
529 unsigned int i;
530 unsigned int reusable_count = 0;
531
532 adjust_mem_for_liquid();
533 fmem_pdata.size = 0;
Olav Hauganf6dc7742012-02-15 09:11:55 -0800534 fmem_pdata.reserved_size_low = 0;
535 fmem_pdata.reserved_size_high = 0;
Olav Haugan65f4bd82011-12-13 11:50:08 -0800536
537 /* We only support 1 reusable heap. Check if more than one heap
538 * is specified as reusable and set as non-reusable if found.
539 */
540 for (i = 0; i < ion_pdata.nr; ++i) {
541 const struct ion_platform_heap *heap = &(ion_pdata.heaps[i]);
542
543 if (heap->type == ION_HEAP_TYPE_CP && heap->extra_data) {
544 struct ion_cp_heap_pdata *data = heap->extra_data;
545
546 reusable_count += (data->reusable) ? 1 : 0;
547
548 if (data->reusable && reusable_count > 1) {
549 pr_err("%s: Too many heaps specified as "
550 "reusable. Heap %s was not configured "
551 "as reusable.\n", __func__, heap->name);
552 data->reusable = 0;
553 }
554 }
555 }
556
557 for (i = 0; i < ion_pdata.nr; ++i) {
558 int reusable = 0;
559 int adjacent_heap_id = INVALID_HEAP_ID;
Olav Hauganf6dc7742012-02-15 09:11:55 -0800560 int mem_is_fmem = 0;
Olav Haugan65f4bd82011-12-13 11:50:08 -0800561 const struct ion_platform_heap *heap = &(ion_pdata.heaps[i]);
562
563 if (heap->extra_data) {
564 switch (heap->type) {
565 case ION_HEAP_TYPE_CP:
566 reusable = ((struct ion_cp_heap_pdata *)
567 heap->extra_data)->reusable;
Olav Hauganf6dc7742012-02-15 09:11:55 -0800568 mem_is_fmem = ((struct ion_cp_heap_pdata *)
569 heap->extra_data)->mem_is_fmem;
Olav Haugan65f4bd82011-12-13 11:50:08 -0800570 break;
571 case ION_HEAP_TYPE_CARVEOUT:
572 adjacent_heap_id = ((struct ion_co_heap_pdata *)
573 heap->extra_data)->adjacent_mem_id;
Olav Hauganf6dc7742012-02-15 09:11:55 -0800574 mem_is_fmem = ((struct ion_co_heap_pdata *)
575 heap->extra_data)->mem_is_fmem;
Olav Haugan65f4bd82011-12-13 11:50:08 -0800576 break;
577 default:
578 break;
579 }
580 }
581
Olav Hauganf6dc7742012-02-15 09:11:55 -0800582 if (mem_is_fmem && !reusable) {
583 if (adjacent_heap_id != INVALID_HEAP_ID)
584 fmem_pdata.reserved_size_low += heap->size;
585 else
586 fmem_pdata.reserved_size_high += heap->size;
Olav Haugan65f4bd82011-12-13 11:50:08 -0800587 }
Olav Hauganf6dc7742012-02-15 09:11:55 -0800588 if (mem_is_fmem)
Olav Haugan65f4bd82011-12-13 11:50:08 -0800589 fmem_pdata.size += heap->size;
Olav Hauganf6dc7742012-02-15 09:11:55 -0800590 else
591 reserve_mem_for_ion(MEMTYPE_EBI1, heap->size);
Olav Haugan65f4bd82011-12-13 11:50:08 -0800592 }
Laura Abbottd6183792011-08-19 13:42:24 -0700593#endif
594}
Huaibin Yanga5419422011-12-08 23:52:10 -0800595
596static void __init reserve_mdp_memory(void)
597{
598 msm8960_mdp_writeback(msm8960_reserve_table);
599}
600
Laura Abbott306bcc22012-03-08 11:24:53 -0800601#if defined(CONFIG_MSM_CACHE_DUMP)
602static struct msm_cache_dump_platform_data msm_cache_dump_pdata = {
603 .l2_size = L2_BUFFER_SIZE,
604};
605
606static struct platform_device msm_cache_dump_device = {
607 .name = "msm_cache_dump",
608 .id = -1,
609 .dev = {
610 .platform_data = &msm_cache_dump_pdata,
611 },
612};
613
614#endif
615
616static void reserve_cache_dump_memory(void)
617{
618#ifdef CONFIG_MSM_CACHE_DUMP
619 unsigned int spare;
620 unsigned int l1_size;
Laura Abbott7b637362012-03-29 16:43:49 -0700621 unsigned int l2_size;
Laura Abbott306bcc22012-03-08 11:24:53 -0800622 unsigned int total;
623 int ret;
624
625 ret = scm_call(L1C_SERVICE_ID, L1C_BUFFER_GET_SIZE_COMMAND_ID, &spare,
626 sizeof(spare), &l1_size, sizeof(l1_size));
627
628 if (ret)
629 /* Fall back to something reasonable here */
630 l1_size = L1_BUFFER_SIZE;
631
Laura Abbott7b637362012-03-29 16:43:49 -0700632 ret = scm_call(L1C_SERVICE_ID, L2C_BUFFER_GET_SIZE_COMMAND_ID, &spare,
633 sizeof(spare), &l2_size, sizeof(l2_size));
634
635 if (ret)
636 /* Fall back to something reasonable here */
637 l2_size = L2_BUFFER_SIZE;
638
639 total = l1_size + l2_size;
Laura Abbott306bcc22012-03-08 11:24:53 -0800640
641 msm8960_reserve_table[MEMTYPE_EBI1].size += total;
642 msm_cache_dump_pdata.l1_size = l1_size;
Laura Abbott7b637362012-03-29 16:43:49 -0700643 msm_cache_dump_pdata.l2_size = l2_size;
Laura Abbott306bcc22012-03-08 11:24:53 -0800644#endif
645}
646
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700647static void __init msm8960_calculate_reserve_sizes(void)
648{
649 size_pmem_devices();
650 reserve_pmem_memory();
Laura Abbottd6183792011-08-19 13:42:24 -0700651 reserve_ion_memory();
Huaibin Yanga5419422011-12-08 23:52:10 -0800652 reserve_mdp_memory();
Laura Abbottf8c03b92012-02-16 14:57:58 -0800653 reserve_rtb_memory();
Laura Abbott306bcc22012-03-08 11:24:53 -0800654 reserve_cache_dump_memory();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700655}
656
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700657static struct reserve_info msm8960_reserve_info __initdata = {
658 .memtype_reserve_table = msm8960_reserve_table,
659 .calculate_reserve_sizes = msm8960_calculate_reserve_sizes,
660 .paddr_to_memtype = msm8960_paddr_to_memtype,
661};
662
Larry Basselb4126da2011-07-18 14:31:33 -0700663static int msm8960_memory_bank_size(void)
664{
665 return 1<<29;
666}
667
668static void __init locate_unstable_memory(void)
669{
670 struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1];
671 unsigned long bank_size;
672 unsigned long low, high;
673
674 bank_size = msm8960_memory_bank_size();
675 low = meminfo.bank[0].start;
676 high = mb->start + mb->size;
Olav Haugan62052e42011-10-28 14:28:32 -0700677
678 /* Check if 32 bit overflow occured */
679 if (high < mb->start)
680 high = ~0UL;
681
Larry Basselb4126da2011-07-18 14:31:33 -0700682 low &= ~(bank_size - 1);
683
684 if (high - low <= bank_size)
685 return;
Larry Basselb8d61022012-02-24 10:49:45 -0800686
687 msm8960_reserve_info.bank_size = bank_size;
688#ifdef CONFIG_ENABLE_DMM
Jack Cheung60eaeab2012-01-09 16:40:26 -0800689 msm8960_reserve_info.low_unstable_address = mb->start -
690 MIN_MEMORY_BLOCK_SIZE + mb->size;
Jack Cheung0b1987e2011-11-18 13:36:29 -0800691 msm8960_reserve_info.max_unstable_size = MIN_MEMORY_BLOCK_SIZE;
Larry Basselb4126da2011-07-18 14:31:33 -0700692 pr_info("low unstable address %lx max size %lx bank size %lx\n",
693 msm8960_reserve_info.low_unstable_address,
694 msm8960_reserve_info.max_unstable_size,
695 msm8960_reserve_info.bank_size);
Larry Basselb8d61022012-02-24 10:49:45 -0800696#else
697 msm8960_reserve_info.low_unstable_address = 0;
698 msm8960_reserve_info.max_unstable_size = 0;
699#endif
Larry Basselb4126da2011-07-18 14:31:33 -0700700}
701
Larry Basselb830e182011-10-14 10:46:55 -0700702static void __init place_movable_zone(void)
703{
Larry Basselb8d61022012-02-24 10:49:45 -0800704#ifdef CONFIG_ENABLE_DMM
Larry Basselb830e182011-10-14 10:46:55 -0700705 movable_reserved_start = msm8960_reserve_info.low_unstable_address;
706 movable_reserved_size = msm8960_reserve_info.max_unstable_size;
707 pr_info("movable zone start %lx size %lx\n",
708 movable_reserved_start, movable_reserved_size);
Larry Basselb8d61022012-02-24 10:49:45 -0800709#endif
Larry Basselb830e182011-10-14 10:46:55 -0700710}
711
712static void __init msm8960_early_memory(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700713{
714 reserve_info = &msm8960_reserve_info;
Larry Basselb4126da2011-07-18 14:31:33 -0700715 locate_unstable_memory();
Larry Basselb830e182011-10-14 10:46:55 -0700716 place_movable_zone();
717}
718
Ravishangar Kalyanam8c79ead2011-12-02 21:05:01 -0800719static char prim_panel_name[PANEL_NAME_MAX_LEN];
720static char ext_panel_name[PANEL_NAME_MAX_LEN];
721static int __init prim_display_setup(char *param)
722{
723 if (strnlen(param, PANEL_NAME_MAX_LEN))
724 strlcpy(prim_panel_name, param, PANEL_NAME_MAX_LEN);
725 return 0;
726}
727early_param("prim_display", prim_display_setup);
728
729static int __init ext_display_setup(char *param)
730{
731 if (strnlen(param, PANEL_NAME_MAX_LEN))
732 strlcpy(ext_panel_name, param, PANEL_NAME_MAX_LEN);
733 return 0;
734}
735early_param("ext_display", ext_display_setup);
736
Larry Basselb830e182011-10-14 10:46:55 -0700737static void __init msm8960_reserve(void)
738{
Ravishangar Kalyanam8c79ead2011-12-02 21:05:01 -0800739 msm8960_set_display_params(prim_panel_name, ext_panel_name);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700740 msm_reserve();
Larry Bassel41a055b2011-12-06 16:15:14 -0800741 fmem_pdata.phys = reserve_memory_for_fmem(fmem_pdata.size);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700742}
743
Larry Bassela4414b12011-08-04 11:11:02 -0700744static int msm8960_change_memory_power(u64 start, u64 size,
745 int change_type)
Larry Bassela7eadea2011-07-14 10:46:00 -0700746{
Naveen Ramarajb03bb1b2011-09-12 14:34:31 -0700747 return soc_change_memory_power(start, size, change_type);
Larry Bassela7eadea2011-07-14 10:46:00 -0700748}
749
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700750static void __init msm8960_allocate_memory_regions(void)
751{
Stepan Moskovchenko24cd8642011-11-29 13:07:53 -0800752 msm8960_allocate_fb_region();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700753}
Stepan Moskovchenko24cd8642011-11-29 13:07:53 -0800754
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700755#ifdef CONFIG_WCD9310_CODEC
756
757#define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS)
758
Patrick Lai3043fba2011-08-01 14:15:57 -0700759/* Micbias setting is based on 8660 CDP/MTP/FLUID requirement
760 * 4 micbiases are used to power various analog and digital
761 * microphones operating at 1800 mV. Technically, all micbiases
762 * can source from single cfilter since all microphones operate
763 * at the same voltage level. The arrangement below is to make
764 * sure all cfilters are exercised. LDO_H regulator ouput level
765 * does not need to be as high as 2.85V. It is choosen for
766 * microphone sensitivity purpose.
767 */
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530768static struct wcd9xxx_pdata tabla_platform_data = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700769 .slimbus_slave_device = {
770 .name = "tabla-slave",
771 .e_addr = {0, 0, 0x10, 0, 0x17, 2},
772 },
773 .irq = MSM_GPIO_TO_INT(62),
774 .irq_base = TABLA_INTERRUPT_BASE,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530775 .num_irqs = NR_WCD9XXX_IRQS,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700776 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
Patrick Lai3043fba2011-08-01 14:15:57 -0700777 .micbias = {
778 .ldoh_v = TABLA_LDOH_2P85_V,
779 .cfilt1_mv = 1800,
Joonwoo Parkcf473b42012-03-29 19:48:16 -0700780 .cfilt2_mv = 2700,
Patrick Lai3043fba2011-08-01 14:15:57 -0700781 .cfilt3_mv = 1800,
782 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
783 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
784 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
785 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530786 },
787 .regulator = {
788 {
789 .name = "CDC_VDD_CP",
790 .min_uV = 1800000,
791 .max_uV = 1800000,
792 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
793 },
794 {
795 .name = "CDC_VDDA_RX",
796 .min_uV = 1800000,
797 .max_uV = 1800000,
798 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
799 },
800 {
801 .name = "CDC_VDDA_TX",
802 .min_uV = 1800000,
803 .max_uV = 1800000,
804 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
805 },
806 {
807 .name = "VDDIO_CDC",
808 .min_uV = 1800000,
809 .max_uV = 1800000,
810 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
811 },
812 {
813 .name = "VDDD_CDC_D",
814 .min_uV = 1225000,
815 .max_uV = 1225000,
816 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
817 },
818 {
819 .name = "CDC_VDDA_A_1P2V",
820 .min_uV = 1225000,
821 .max_uV = 1225000,
822 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
823 },
824 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700825};
826
827static struct slim_device msm_slim_tabla = {
828 .name = "tabla-slim",
829 .e_addr = {0, 1, 0x10, 0, 0x17, 2},
830 .dev = {
831 .platform_data = &tabla_platform_data,
832 },
833};
Santosh Mardi60e19d92011-10-28 01:15:14 +0530834
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530835static struct wcd9xxx_pdata tabla20_platform_data = {
Santosh Mardi60e19d92011-10-28 01:15:14 +0530836 .slimbus_slave_device = {
837 .name = "tabla-slave",
838 .e_addr = {0, 0, 0x60, 0, 0x17, 2},
839 },
840 .irq = MSM_GPIO_TO_INT(62),
841 .irq_base = TABLA_INTERRUPT_BASE,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530842 .num_irqs = NR_WCD9XXX_IRQS,
Santosh Mardi60e19d92011-10-28 01:15:14 +0530843 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
844 .micbias = {
845 .ldoh_v = TABLA_LDOH_2P85_V,
846 .cfilt1_mv = 1800,
Joonwoo Parkcf473b42012-03-29 19:48:16 -0700847 .cfilt2_mv = 2700,
Santosh Mardi60e19d92011-10-28 01:15:14 +0530848 .cfilt3_mv = 1800,
849 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
850 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
851 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
852 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530853 },
854 .regulator = {
855 {
856 .name = "CDC_VDD_CP",
857 .min_uV = 1800000,
858 .max_uV = 1800000,
859 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
860 },
861 {
862 .name = "CDC_VDDA_RX",
863 .min_uV = 1800000,
864 .max_uV = 1800000,
865 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
866 },
867 {
868 .name = "CDC_VDDA_TX",
869 .min_uV = 1800000,
870 .max_uV = 1800000,
871 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
872 },
873 {
874 .name = "VDDIO_CDC",
875 .min_uV = 1800000,
876 .max_uV = 1800000,
877 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
878 },
879 {
880 .name = "VDDD_CDC_D",
881 .min_uV = 1225000,
882 .max_uV = 1225000,
883 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
884 },
885 {
886 .name = "CDC_VDDA_A_1P2V",
887 .min_uV = 1225000,
888 .max_uV = 1225000,
889 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
890 },
891 },
Santosh Mardi60e19d92011-10-28 01:15:14 +0530892};
893
894static struct slim_device msm_slim_tabla20 = {
895 .name = "tabla2x-slim",
896 .e_addr = {0, 1, 0x60, 0, 0x17, 2},
897 .dev = {
898 .platform_data = &tabla20_platform_data,
899 },
900};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700901#endif
902
903static struct slim_boardinfo msm_slim_devices[] = {
904#ifdef CONFIG_WCD9310_CODEC
905 {
906 .bus_num = 1,
907 .slim_slave = &msm_slim_tabla,
908 },
Santosh Mardi60e19d92011-10-28 01:15:14 +0530909 {
910 .bus_num = 1,
911 .slim_slave = &msm_slim_tabla20,
912 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700913#endif
914 /* add more slimbus slaves as needed */
915};
916
Yunsen Wang5c1a7392011-07-09 19:10:16 -0700917#define MSM_WCNSS_PHYS 0x03000000
918#define MSM_WCNSS_SIZE 0x280000
919
920static struct resource resources_wcnss_wlan[] = {
921 {
922 .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
923 .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
924 .name = "wcnss_wlanrx_irq",
925 .flags = IORESOURCE_IRQ,
926 },
927 {
928 .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
929 .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
930 .name = "wcnss_wlantx_irq",
931 .flags = IORESOURCE_IRQ,
932 },
933 {
934 .start = MSM_WCNSS_PHYS,
935 .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1,
936 .name = "wcnss_mmio",
937 .flags = IORESOURCE_MEM,
938 },
Ankur Nandwaniad0d9ac2011-09-26 11:49:25 -0700939 {
940 .start = 84,
941 .end = 88,
942 .name = "wcnss_gpios_5wire",
943 .flags = IORESOURCE_IO,
944 },
Yunsen Wang5c1a7392011-07-09 19:10:16 -0700945};
946
Ankur Nandwanib0039b02011-08-09 14:00:45 -0700947static struct qcom_wcnss_opts qcom_wcnss_pdata = {
948 .has_48mhz_xo = 1,
949};
950
Yunsen Wang5c1a7392011-07-09 19:10:16 -0700951static struct platform_device msm_device_wcnss_wlan = {
952 .name = "wcnss_wlan",
953 .id = 0,
954 .num_resources = ARRAY_SIZE(resources_wcnss_wlan),
955 .resource = resources_wcnss_wlan,
Ankur Nandwanib0039b02011-08-09 14:00:45 -0700956 .dev = {.platform_data = &qcom_wcnss_pdata},
Yunsen Wang5c1a7392011-07-09 19:10:16 -0700957};
958
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700959#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
960 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
961 defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
962 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
963
964#define QCE_SIZE 0x10000
965#define QCE_0_BASE 0x18500000
966
967#define QCE_HW_KEY_SUPPORT 0
968#define QCE_SHA_HMAC_SUPPORT 1
969#define QCE_SHARE_CE_RESOURCE 1
970#define QCE_CE_SHARED 0
971
Ramesh Masavarapu49259682011-12-02 14:00:18 -0800972/* Begin Bus scaling definitions */
973static struct msm_bus_vectors crypto_hw_init_vectors[] = {
974 {
975 .src = MSM_BUS_MASTER_ADM_PORT0,
976 .dst = MSM_BUS_SLAVE_EBI_CH0,
977 .ab = 0,
978 .ib = 0,
979 },
980 {
981 .src = MSM_BUS_MASTER_ADM_PORT1,
982 .dst = MSM_BUS_SLAVE_GSBI1_UART,
983 .ab = 0,
984 .ib = 0,
985 },
986};
987
988static struct msm_bus_vectors crypto_hw_active_vectors[] = {
989 {
990 .src = MSM_BUS_MASTER_ADM_PORT0,
991 .dst = MSM_BUS_SLAVE_EBI_CH0,
992 .ab = 70000000UL,
993 .ib = 70000000UL,
994 },
995 {
996 .src = MSM_BUS_MASTER_ADM_PORT1,
997 .dst = MSM_BUS_SLAVE_GSBI1_UART,
998 .ab = 2480000000UL,
999 .ib = 2480000000UL,
1000 },
1001};
1002
1003static struct msm_bus_paths crypto_hw_bus_scale_usecases[] = {
1004 {
1005 ARRAY_SIZE(crypto_hw_init_vectors),
1006 crypto_hw_init_vectors,
1007 },
1008 {
1009 ARRAY_SIZE(crypto_hw_active_vectors),
1010 crypto_hw_active_vectors,
1011 },
1012};
1013
1014static struct msm_bus_scale_pdata crypto_hw_bus_scale_pdata = {
1015 crypto_hw_bus_scale_usecases,
1016 ARRAY_SIZE(crypto_hw_bus_scale_usecases),
1017 .name = "cryptohw",
1018};
1019/* End Bus Scaling Definitions*/
1020
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001021static struct resource qcrypto_resources[] = {
1022 [0] = {
1023 .start = QCE_0_BASE,
1024 .end = QCE_0_BASE + QCE_SIZE - 1,
1025 .flags = IORESOURCE_MEM,
1026 },
1027 [1] = {
1028 .name = "crypto_channels",
1029 .start = DMOV_CE_IN_CHAN,
1030 .end = DMOV_CE_OUT_CHAN,
1031 .flags = IORESOURCE_DMA,
1032 },
1033 [2] = {
1034 .name = "crypto_crci_in",
1035 .start = DMOV_CE_IN_CRCI,
1036 .end = DMOV_CE_IN_CRCI,
1037 .flags = IORESOURCE_DMA,
1038 },
1039 [3] = {
1040 .name = "crypto_crci_out",
1041 .start = DMOV_CE_OUT_CRCI,
1042 .end = DMOV_CE_OUT_CRCI,
1043 .flags = IORESOURCE_DMA,
1044 },
1045};
1046
1047static struct resource qcedev_resources[] = {
1048 [0] = {
1049 .start = QCE_0_BASE,
1050 .end = QCE_0_BASE + QCE_SIZE - 1,
1051 .flags = IORESOURCE_MEM,
1052 },
1053 [1] = {
1054 .name = "crypto_channels",
1055 .start = DMOV_CE_IN_CHAN,
1056 .end = DMOV_CE_OUT_CHAN,
1057 .flags = IORESOURCE_DMA,
1058 },
1059 [2] = {
1060 .name = "crypto_crci_in",
1061 .start = DMOV_CE_IN_CRCI,
1062 .end = DMOV_CE_IN_CRCI,
1063 .flags = IORESOURCE_DMA,
1064 },
1065 [3] = {
1066 .name = "crypto_crci_out",
1067 .start = DMOV_CE_OUT_CRCI,
1068 .end = DMOV_CE_OUT_CRCI,
1069 .flags = IORESOURCE_DMA,
1070 },
1071};
1072
1073#endif
1074
1075#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1076 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1077
1078static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
1079 .ce_shared = QCE_CE_SHARED,
1080 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1081 .hw_key_support = QCE_HW_KEY_SUPPORT,
1082 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -08001083 .bus_scale_table = &crypto_hw_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001084};
1085
1086static struct platform_device qcrypto_device = {
1087 .name = "qcrypto",
1088 .id = 0,
1089 .num_resources = ARRAY_SIZE(qcrypto_resources),
1090 .resource = qcrypto_resources,
1091 .dev = {
1092 .coherent_dma_mask = DMA_BIT_MASK(32),
1093 .platform_data = &qcrypto_ce_hw_suppport,
1094 },
1095};
1096#endif
1097
1098#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1099 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1100
1101static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
1102 .ce_shared = QCE_CE_SHARED,
1103 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1104 .hw_key_support = QCE_HW_KEY_SUPPORT,
1105 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -08001106 .bus_scale_table = &crypto_hw_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001107};
1108
1109static struct platform_device qcedev_device = {
1110 .name = "qce",
1111 .id = 0,
1112 .num_resources = ARRAY_SIZE(qcedev_resources),
1113 .resource = qcedev_resources,
1114 .dev = {
1115 .coherent_dma_mask = DMA_BIT_MASK(32),
1116 .platform_data = &qcedev_ce_hw_suppport,
1117 },
1118};
1119#endif
1120
Joel Kingb8352a12011-11-15 18:46:24 -08001121#define MDM2AP_ERRFATAL 70
1122#define AP2MDM_ERRFATAL 95
1123#define MDM2AP_STATUS 69
1124#define AP2MDM_STATUS 94
1125#define AP2MDM_PMIC_RESET_N 80
1126#define AP2MDM_KPDPWR_N 81
1127
Joel Kingb8352a12011-11-15 18:46:24 -08001128static struct resource mdm_resources[] = {
1129 {
1130 .start = MDM2AP_ERRFATAL,
1131 .end = MDM2AP_ERRFATAL,
1132 .name = "MDM2AP_ERRFATAL",
1133 .flags = IORESOURCE_IO,
1134 },
1135 {
1136 .start = AP2MDM_ERRFATAL,
1137 .end = AP2MDM_ERRFATAL,
1138 .name = "AP2MDM_ERRFATAL",
1139 .flags = IORESOURCE_IO,
1140 },
1141 {
1142 .start = MDM2AP_STATUS,
1143 .end = MDM2AP_STATUS,
1144 .name = "MDM2AP_STATUS",
1145 .flags = IORESOURCE_IO,
1146 },
1147 {
1148 .start = AP2MDM_STATUS,
1149 .end = AP2MDM_STATUS,
1150 .name = "AP2MDM_STATUS",
1151 .flags = IORESOURCE_IO,
1152 },
1153 {
1154 .start = AP2MDM_PMIC_RESET_N,
1155 .end = AP2MDM_PMIC_RESET_N,
1156 .name = "AP2MDM_PMIC_RESET_N",
1157 .flags = IORESOURCE_IO,
1158 },
1159 {
1160 .start = AP2MDM_KPDPWR_N,
1161 .end = AP2MDM_KPDPWR_N,
1162 .name = "AP2MDM_KPDPWR_N",
1163 .flags = IORESOURCE_IO,
1164 },
1165};
1166
1167static struct mdm_platform_data mdm_platform_data = {
1168 .mdm_version = "2.5",
1169};
1170
Stepan Moskovchenkofc70d902011-11-30 12:39:36 -08001171static struct platform_device mdm_device = {
Joel Kingb8352a12011-11-15 18:46:24 -08001172 .name = "mdm2_modem",
1173 .id = -1,
1174 .num_resources = ARRAY_SIZE(mdm_resources),
1175 .resource = mdm_resources,
1176 .dev = {
1177 .platform_data = &mdm_platform_data,
1178 },
1179};
1180
1181static struct platform_device *mdm_devices[] __initdata = {
1182 &mdm_device,
1183};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001184
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001185#define MSM_SHARED_RAM_PHYS 0x80000000
1186
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001187static void __init msm8960_map_io(void)
1188{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001189 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001190 msm_map_msm8960_io();
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -07001191
1192 if (socinfo_init() < 0)
1193 pr_err("socinfo_init() failed!\n");
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001194}
1195
1196static void __init msm8960_init_irq(void)
1197{
Praveen Chidambaram78499012011-11-01 17:15:17 -06001198 struct msm_mpm_device_data *data = NULL;
1199
1200#ifdef CONFIG_MSM_MPM
1201 data = &msm8960_mpm_dev_data;
1202#endif
1203
1204 msm_mpm_irq_extn_init(data);
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001205 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001206 (void *)MSM_QGIC_CPU_BASE);
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001207}
1208
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001209static void __init msm8960_init_buses(void)
1210{
1211#ifdef CONFIG_MSM_BUS_SCALING
Gagan Macdc1dc142011-09-16 15:13:35 -06001212 msm_bus_rpm_set_mt_mask();
Gagan Macae154c4b2011-10-05 19:24:43 -06001213 msm_bus_8960_apps_fabric_pdata.rpm_enabled = 1;
1214 msm_bus_8960_sys_fabric_pdata.rpm_enabled = 1;
1215 msm_bus_8960_mm_fabric_pdata.rpm_enabled = 1;
1216 msm_bus_apps_fabric.dev.platform_data =
1217 &msm_bus_8960_apps_fabric_pdata;
1218 msm_bus_sys_fabric.dev.platform_data = &msm_bus_8960_sys_fabric_pdata;
1219 msm_bus_mm_fabric.dev.platform_data = &msm_bus_8960_mm_fabric_pdata;
1220 msm_bus_sys_fpb.dev.platform_data = &msm_bus_8960_sys_fpb_pdata;
1221 msm_bus_cpss_fpb.dev.platform_data = &msm_bus_8960_cpss_fpb_pdata;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001222#endif
1223}
1224
1225static struct msm_spi_platform_data msm8960_qup_spi_gsbi1_pdata = {
1226 .max_clock_speed = 15060000,
1227};
1228
1229#ifdef CONFIG_USB_MSM_OTG_72K
1230static struct msm_otg_platform_data msm_otg_pdata;
1231#else
Anji jonnalaa8b8d732011-12-06 10:03:24 +05301232static int wr_phy_init_seq[] = {
1233 0x44, 0x80, /* set VBUS valid threshold
1234 and disconnect valid threshold */
1235 0x38, 0x81, /* update DC voltage level */
1236 0x14, 0x82, /* set preemphasis and rise/fall time */
1237 0x13, 0x83, /* set source impedance adjusment */
1238 -1};
1239
1240static int liquid_v1_phy_init_seq[] = {
1241 0x44, 0x80,/* set VBUS valid threshold
1242 and disconnect valid threshold */
1243 0x3C, 0x81,/* update DC voltage level */
1244 0x18, 0x82,/* set preemphasis and rise/fall time */
1245 0x23, 0x83,/* set source impedance sdjusment */
1246 -1};
1247
Manu Gautamcd82e9d2011-12-20 14:17:28 +05301248#ifdef CONFIG_MSM_BUS_SCALING
1249/* Bandwidth requests (zero) if no vote placed */
1250static struct msm_bus_vectors usb_init_vectors[] = {
1251 {
1252 .src = MSM_BUS_MASTER_SPS,
1253 .dst = MSM_BUS_SLAVE_EBI_CH0,
1254 .ab = 0,
1255 .ib = 0,
1256 },
1257};
1258
1259/* Bus bandwidth requests in Bytes/sec */
1260static struct msm_bus_vectors usb_max_vectors[] = {
1261 {
1262 .src = MSM_BUS_MASTER_SPS,
1263 .dst = MSM_BUS_SLAVE_EBI_CH0,
1264 .ab = 60000000, /* At least 480Mbps on bus. */
1265 .ib = 960000000, /* MAX bursts rate */
1266 },
1267};
1268
1269static struct msm_bus_paths usb_bus_scale_usecases[] = {
1270 {
1271 ARRAY_SIZE(usb_init_vectors),
1272 usb_init_vectors,
1273 },
1274 {
1275 ARRAY_SIZE(usb_max_vectors),
1276 usb_max_vectors,
1277 },
1278};
1279
1280static struct msm_bus_scale_pdata usb_bus_scale_pdata = {
1281 usb_bus_scale_usecases,
1282 ARRAY_SIZE(usb_bus_scale_usecases),
1283 .name = "usb",
1284};
1285#endif
1286
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001287static struct msm_otg_platform_data msm_otg_pdata = {
1288 .mode = USB_OTG,
1289 .otg_control = OTG_PMIC_CONTROL,
1290 .phy_type = SNPS_28NM_INTEGRATED_PHY,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001291 .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE),
Anji jonnala4e3e6772011-09-15 18:53:42 +05301292 .power_budget = 750,
Manu Gautamcd82e9d2011-12-20 14:17:28 +05301293#ifdef CONFIG_MSM_BUS_SCALING
1294 .bus_scale_table = &usb_bus_scale_pdata,
1295#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001296};
1297#endif
1298
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +05301299#ifdef CONFIG_USB_EHCI_MSM_HSIC
Vijayavardhan Vennapusa2b592824f2011-11-02 19:51:32 +05301300#define HSIC_HUB_RESET_GPIO 91
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +05301301static struct msm_hsic_host_platform_data msm_hsic_pdata = {
1302 .strobe = 150,
1303 .data = 151,
1304};
1305#else
1306static struct msm_hsic_host_platform_data msm_hsic_pdata;
1307#endif
1308
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001309#define PID_MAGIC_ID 0x71432909
1310#define SERIAL_NUM_MAGIC_ID 0x61945374
1311#define SERIAL_NUMBER_LENGTH 127
1312#define DLOAD_USB_BASE_ADD 0x2A03F0C8
1313
1314struct magic_num_struct {
1315 uint32_t pid;
1316 uint32_t serial_num;
1317};
1318
1319struct dload_struct {
1320 uint32_t reserved1;
1321 uint32_t reserved2;
1322 uint32_t reserved3;
1323 uint16_t reserved4;
1324 uint16_t pid;
1325 char serial_number[SERIAL_NUMBER_LENGTH];
1326 uint16_t reserved5;
1327 struct magic_num_struct magic_struct;
1328};
1329
1330static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
1331{
1332 struct dload_struct __iomem *dload = 0;
1333
1334 dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload));
1335 if (!dload) {
1336 pr_err("%s: cannot remap I/O memory region: %08x\n",
1337 __func__, DLOAD_USB_BASE_ADD);
1338 return -ENXIO;
1339 }
1340
1341 pr_debug("%s: dload:%p pid:%x serial_num:%s\n",
1342 __func__, dload, pid, snum);
1343 /* update pid */
1344 dload->magic_struct.pid = PID_MAGIC_ID;
1345 dload->pid = pid;
1346
1347 /* update serial number */
1348 dload->magic_struct.serial_num = 0;
1349 if (!snum) {
1350 memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH);
1351 goto out;
1352 }
1353
1354 dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID;
Jin Honge49b1482011-10-03 11:15:50 -07001355 strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001356out:
1357 iounmap(dload);
1358 return 0;
1359}
1360
1361static struct android_usb_platform_data android_usb_pdata = {
1362 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
1363};
1364
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07001365static struct platform_device android_usb_device = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001366 .name = "android_usb",
1367 .id = -1,
1368 .dev = {
1369 .platform_data = &android_usb_pdata,
1370 },
1371};
1372
1373static uint8_t spm_wfi_cmd_sequence[] __initdata = {
1374 0x03, 0x0f,
1375};
1376
1377static uint8_t spm_power_collapse_without_rpm[] __initdata = {
1378 0x00, 0x24, 0x54, 0x10,
1379 0x09, 0x03, 0x01,
1380 0x10, 0x54, 0x30, 0x0C,
1381 0x24, 0x30, 0x0f,
1382};
1383
1384static uint8_t spm_power_collapse_with_rpm[] __initdata = {
1385 0x00, 0x24, 0x54, 0x10,
1386 0x09, 0x07, 0x01, 0x0B,
1387 0x10, 0x54, 0x30, 0x0C,
1388 0x24, 0x30, 0x0f,
1389};
1390
1391static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
1392 [0] = {
1393 .mode = MSM_SPM_MODE_CLOCK_GATING,
1394 .notify_rpm = false,
1395 .cmd = spm_wfi_cmd_sequence,
1396 },
1397 [1] = {
1398 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1399 .notify_rpm = false,
1400 .cmd = spm_power_collapse_without_rpm,
1401 },
1402 [2] = {
1403 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1404 .notify_rpm = true,
1405 .cmd = spm_power_collapse_with_rpm,
1406 },
1407};
1408
1409static struct msm_spm_platform_data msm_spm_data[] __initdata = {
1410 [0] = {
1411 .reg_base_addr = MSM_SAW0_BASE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001412 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001413#if defined(CONFIG_MSM_AVS_HW)
1414 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1415 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1416#endif
1417 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001418 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001419 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1420 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1421 .vctl_timeout_us = 50,
1422 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1423 .modes = msm_spm_seq_list,
1424 },
1425 [1] = {
1426 .reg_base_addr = MSM_SAW1_BASE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001427 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001428#if defined(CONFIG_MSM_AVS_HW)
1429 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1430 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1431#endif
1432 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001433 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001434 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1435 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1436 .vctl_timeout_us = 50,
1437 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1438 .modes = msm_spm_seq_list,
1439 },
1440};
1441
1442static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = {
1443 0x00, 0x20, 0x03, 0x20,
1444 0x00, 0x0f,
1445};
1446
1447static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = {
1448 0x00, 0x20, 0x34, 0x64,
1449 0x48, 0x07, 0x48, 0x20,
1450 0x50, 0x64, 0x04, 0x34,
1451 0x50, 0x0f,
1452};
1453static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = {
1454 0x00, 0x10, 0x34, 0x64,
1455 0x48, 0x07, 0x48, 0x10,
1456 0x50, 0x64, 0x04, 0x34,
1457 0x50, 0x0F,
1458};
1459
1460static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = {
1461 [0] = {
1462 .mode = MSM_SPM_L2_MODE_RETENTION,
1463 .notify_rpm = false,
1464 .cmd = l2_spm_wfi_cmd_sequence,
1465 },
1466 [1] = {
1467 .mode = MSM_SPM_L2_MODE_GDHS,
1468 .notify_rpm = true,
1469 .cmd = l2_spm_gdhs_cmd_sequence,
1470 },
1471 [2] = {
1472 .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE,
1473 .notify_rpm = true,
1474 .cmd = l2_spm_power_off_cmd_sequence,
1475 },
1476};
1477
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001478static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = {
1479 [0] = {
1480 .reg_base_addr = MSM_SAW_L2_BASE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001481 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001482 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001483 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE,
1484 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020,
1485 .modes = msm_spm_l2_seq_list,
1486 .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list),
1487 },
1488};
1489
Mohan Pallaka5e490392011-09-09 15:18:41 +05301490#define PM_HAP_EN_GPIO PM8921_GPIO_PM_TO_SYS(33)
1491#define PM_HAP_LEN_GPIO PM8921_GPIO_PM_TO_SYS(20)
1492
1493static struct msm_xo_voter *xo_handle_d1;
1494
1495static int isa1200_power(int on)
1496{
1497 int rc = 0;
1498
1499 gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, !!on);
1500
1501 rc = on ? msm_xo_mode_vote(xo_handle_d1, MSM_XO_MODE_ON) :
1502 msm_xo_mode_vote(xo_handle_d1, MSM_XO_MODE_OFF);
1503 if (rc < 0) {
1504 pr_err("%s: failed to %svote for TCXO D1 buffer%d\n",
1505 __func__, on ? "" : "de-", rc);
1506 goto err_xo_vote;
1507 }
1508
1509 return 0;
1510
1511err_xo_vote:
1512 gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, !on);
1513 return rc;
1514}
1515
1516static int isa1200_dev_setup(bool enable)
1517{
1518 int rc = 0;
1519
1520 struct pm_gpio hap_gpio_config = {
1521 .direction = PM_GPIO_DIR_OUT,
1522 .pull = PM_GPIO_PULL_NO,
1523 .out_strength = PM_GPIO_STRENGTH_HIGH,
1524 .function = PM_GPIO_FUNC_NORMAL,
1525 .inv_int_pol = 0,
1526 .vin_sel = 2,
1527 .output_buffer = PM_GPIO_OUT_BUF_CMOS,
1528 .output_value = 0,
1529 };
1530
1531 if (enable == true) {
1532 rc = pm8xxx_gpio_config(PM_HAP_EN_GPIO, &hap_gpio_config);
1533 if (rc) {
1534 pr_err("%s: pm8921 gpio %d config failed(%d)\n",
1535 __func__, PM_HAP_EN_GPIO, rc);
1536 return rc;
1537 }
1538
1539 rc = pm8xxx_gpio_config(PM_HAP_LEN_GPIO, &hap_gpio_config);
1540 if (rc) {
1541 pr_err("%s: pm8921 gpio %d config failed(%d)\n",
1542 __func__, PM_HAP_LEN_GPIO, rc);
1543 return rc;
1544 }
1545
1546 rc = gpio_request(HAP_SHIFT_LVL_OE_GPIO, "hap_shft_lvl_oe");
1547 if (rc) {
1548 pr_err("%s: unable to request gpio %d (%d)\n",
1549 __func__, HAP_SHIFT_LVL_OE_GPIO, rc);
1550 return rc;
1551 }
1552
1553 rc = gpio_direction_output(HAP_SHIFT_LVL_OE_GPIO, 0);
1554 if (rc) {
1555 pr_err("%s: Unable to set direction\n", __func__);
1556 goto free_gpio;
1557 }
1558
1559 xo_handle_d1 = msm_xo_get(MSM_XO_TCXO_D1, "isa1200");
1560 if (IS_ERR(xo_handle_d1)) {
1561 rc = PTR_ERR(xo_handle_d1);
1562 pr_err("%s: failed to get the handle for D1(%d)\n",
1563 __func__, rc);
1564 goto gpio_set_dir;
1565 }
1566 } else {
1567 gpio_free(HAP_SHIFT_LVL_OE_GPIO);
1568
1569 msm_xo_put(xo_handle_d1);
1570 }
1571
1572 return 0;
1573
1574gpio_set_dir:
1575 gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, 0);
1576free_gpio:
1577 gpio_free(HAP_SHIFT_LVL_OE_GPIO);
1578 return rc;
1579}
1580
1581static struct isa1200_regulator isa1200_reg_data[] = {
1582 {
1583 .name = "vcc_i2c",
1584 .min_uV = ISA_I2C_VTG_MIN_UV,
1585 .max_uV = ISA_I2C_VTG_MAX_UV,
1586 .load_uA = ISA_I2C_CURR_UA,
1587 },
1588};
1589
1590static struct isa1200_platform_data isa1200_1_pdata = {
1591 .name = "vibrator",
1592 .dev_setup = isa1200_dev_setup,
1593 .power_on = isa1200_power,
1594 .hap_en_gpio = PM_HAP_EN_GPIO,
1595 .hap_len_gpio = PM_HAP_LEN_GPIO,
1596 .max_timeout = 15000,
1597 .mode_ctrl = PWM_GEN_MODE,
1598 .pwm_fd = {
1599 .pwm_div = 256,
1600 },
1601 .is_erm = false,
1602 .smart_en = true,
1603 .ext_clk_en = true,
1604 .chip_en = 1,
1605 .regulator_info = isa1200_reg_data,
1606 .num_regulators = ARRAY_SIZE(isa1200_reg_data),
1607};
1608
1609static struct i2c_board_info msm_isa1200_board_info[] __initdata = {
1610 {
1611 I2C_BOARD_INFO("isa1200_1", 0x90>>1),
Mohan Pallaka5e490392011-09-09 15:18:41 +05301612 },
1613};
1614
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001615#define CYTTSP_TS_GPIO_IRQ 11
1616#define CYTTSP_TS_SLEEP_GPIO 50
1617#define CYTTSP_TS_RESOUT_N_GPIO 52
1618
1619/*virtual key support */
1620static ssize_t tma340_vkeys_show(struct kobject *kobj,
1621 struct kobj_attribute *attr, char *buf)
1622{
1623 return snprintf(buf, 200,
1624 __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97"
1625 ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97"
1626 ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97"
1627 ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97"
1628 "\n");
1629}
1630
1631static struct kobj_attribute tma340_vkeys_attr = {
1632 .attr = {
1633 .mode = S_IRUGO,
1634 },
1635 .show = &tma340_vkeys_show,
1636};
1637
1638static struct attribute *tma340_properties_attrs[] = {
1639 &tma340_vkeys_attr.attr,
1640 NULL
1641};
1642
1643static struct attribute_group tma340_properties_attr_group = {
1644 .attrs = tma340_properties_attrs,
1645};
1646
1647
1648static int cyttsp_platform_init(struct i2c_client *client)
1649{
1650 int rc = 0;
1651 static struct kobject *tma340_properties_kobj;
1652
1653 tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c";
1654 tma340_properties_kobj = kobject_create_and_add("board_properties",
1655 NULL);
1656 if (tma340_properties_kobj)
1657 rc = sysfs_create_group(tma340_properties_kobj,
1658 &tma340_properties_attr_group);
1659 if (!tma340_properties_kobj || rc)
1660 pr_err("%s: failed to create board_properties\n",
1661 __func__);
1662
1663 return 0;
1664}
1665
1666static struct cyttsp_regulator regulator_data[] = {
1667 {
1668 .name = "vdd",
1669 .min_uV = CY_TMA300_VTG_MIN_UV,
1670 .max_uV = CY_TMA300_VTG_MAX_UV,
Anirudh Ghayalf9929b12011-09-07 15:57:36 +05301671 .hpm_load_uA = CY_TMA300_CURR_24HZ_UA,
1672 .lpm_load_uA = CY_TMA300_SLEEP_CURR_UA,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001673 },
1674 /* TODO: Remove after runtime PM is enabled in I2C driver */
1675 {
1676 .name = "vcc_i2c",
1677 .min_uV = CY_I2C_VTG_MIN_UV,
1678 .max_uV = CY_I2C_VTG_MAX_UV,
Anirudh Ghayalf9929b12011-09-07 15:57:36 +05301679 .hpm_load_uA = CY_I2C_CURR_UA,
1680 .lpm_load_uA = CY_I2C_SLEEP_CURR_UA,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001681 },
1682};
1683
1684static struct cyttsp_platform_data cyttsp_pdata = {
1685 .panel_maxx = 634,
1686 .panel_maxy = 1166,
1687 .disp_maxx = 616,
1688 .disp_maxy = 1023,
1689 .disp_minx = 0,
1690 .disp_miny = 16,
1691 .flags = 0x01,
1692 .gen = CY_GEN3, /* or */
1693 .use_st = CY_USE_ST,
1694 .use_mt = CY_USE_MT,
1695 .use_hndshk = CY_SEND_HNDSHK,
1696 .use_trk_id = CY_USE_TRACKING_ID,
Anirudh Ghayale96f66d2011-08-11 14:06:38 +05301697 .use_sleep = CY_USE_DEEP_SLEEP_SEL | CY_USE_LOW_POWER_SEL,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001698 .use_gestures = CY_USE_GESTURES,
1699 .fw_fname = "cyttsp_8960_cdp.hex",
1700 /* activate up to 4 groups
1701 * and set active distance
1702 */
1703 .gest_set = CY_GEST_GRP1 | CY_GEST_GRP2 |
1704 CY_GEST_GRP3 | CY_GEST_GRP4 |
1705 CY_ACT_DIST,
1706 /* change act_intrvl to customize the Active power state
1707 * scanning/processing refresh interval for Operating mode
1708 */
1709 .act_intrvl = CY_ACT_INTRVL_DFLT,
1710 /* change tch_tmout to customize the touch timeout for the
1711 * Active power state for Operating mode
1712 */
1713 .tch_tmout = CY_TCH_TMOUT_DFLT,
1714 /* change lp_intrvl to customize the Low Power power state
1715 * scanning/processing refresh interval for Operating mode
1716 */
1717 .lp_intrvl = CY_LP_INTRVL_DFLT,
1718 .sleep_gpio = CYTTSP_TS_SLEEP_GPIO,
1719 .resout_gpio = CYTTSP_TS_RESOUT_N_GPIO,
1720 .irq_gpio = CYTTSP_TS_GPIO_IRQ,
1721 .regulator_info = regulator_data,
1722 .num_regulators = ARRAY_SIZE(regulator_data),
1723 .init = cyttsp_platform_init,
Mohan Pallaka49c37d62011-08-01 11:52:00 +05301724 .correct_fw_ver = 9,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001725};
1726
1727static struct i2c_board_info cyttsp_info[] __initdata = {
1728 {
1729 I2C_BOARD_INFO(CY_I2C_NAME, 0x24),
1730 .platform_data = &cyttsp_pdata,
1731#ifndef CY_USE_TIMER
1732 .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ),
1733#endif /* CY_USE_TIMER */
1734 },
1735};
1736
Jing Lindc4413c2012-01-16 15:22:52 -08001737/* configuration data for mxt1386 */
1738static const u8 mxt1386_config_data[] = {
Mohan Pallaka50837382011-09-07 11:00:57 +05301739 /* T6 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001740 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301741 /* T38 Object */
Jing Lin93f07082011-11-11 15:53:54 -08001742 11, 2, 0, 11, 11, 11, 0, 0, 0, 0,
Jing Lin2f863172011-10-17 10:56:58 -07001743 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1744 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1745 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1746 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1747 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1748 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301749 /* T7 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001750 100, 16, 50,
Mohan Pallaka50837382011-09-07 11:00:57 +05301751 /* T8 Object */
Jing Lin93f07082011-11-11 15:53:54 -08001752 8, 0, 0, 0, 0, 0, 8, 14, 50, 215,
Mohan Pallaka50837382011-09-07 11:00:57 +05301753 /* T9 Object */
Jing Lin93f07082011-11-11 15:53:54 -08001754 131, 0, 0, 26, 42, 0, 32, 63, 3, 5,
1755 0, 2, 1, 113, 10, 10, 8, 10, 255, 2,
1756 85, 5, 0, 0, 20, 20, 75, 25, 202, 29,
1757 10, 10, 45, 46,
Mohan Pallaka50837382011-09-07 11:00:57 +05301758 /* T15 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001759 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1760 0,
Anirudh Ghayaldab4e0d2012-01-09 14:59:27 +05301761 /* T18 Object */
1762 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301763 /* T22 Object */
Jing Lin93f07082011-11-11 15:53:54 -08001764 5, 0, 0, 0, 0, 0, 0, 0, 30, 0,
1765 0, 0, 5, 8, 10, 13, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301766 /* T24 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001767 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1768 0, 0, 0, 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301769 /* T25 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001770 3, 0, 188, 52, 52, 33, 0, 0, 0, 0,
1771 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301772 /* T27 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001773 0, 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301774 /* T28 Object */
Jing Lin93f07082011-11-11 15:53:54 -08001775 0, 0, 0, 8, 12, 60,
Mohan Pallaka50837382011-09-07 11:00:57 +05301776 /* T40 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001777 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301778 /* T41 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001779 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301780 /* T43 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001781 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301782};
1783
Jing Lin33b007d2011-12-21 17:40:23 -08001784/* configuration data for mxt1386e using V1.0 firmware */
1785static const u8 mxt1386e_config_data_v1_0[] = {
1786 /* T6 Object */
1787 0, 0, 0, 0, 0, 0,
1788 /* T38 Object */
1789 12, 1, 0, 17, 1, 12, 0, 0, 0, 0,
1790 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1791 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1792 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1793 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1794 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1795 0, 0, 0, 0,
1796 /* T7 Object */
1797 100, 16, 50,
1798 /* T8 Object */
1799 25, 0, 20, 20, 0, 0, 20, 50, 0, 0,
1800 /* T9 Object */
1801 131, 0, 0, 26, 42, 0, 32, 80, 2, 5,
1802 0, 5, 5, 0, 10, 30, 10, 10, 255, 2,
1803 85, 5, 10, 10, 10, 10, 135, 55, 70, 40,
1804 10, 5, 0, 0, 0,
1805 /* T18 Object */
1806 0, 0,
1807 /* T24 Object */
1808 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1809 0, 0, 0, 0, 0, 0, 0, 0, 0,
1810 /* T25 Object */
1811 3, 0, 60, 115, 156, 99,
1812 /* T27 Object */
1813 0, 0, 0, 0, 0, 0, 0,
1814 /* T40 Object */
1815 0, 0, 0, 0, 0,
1816 /* T42 Object */
1817 2, 0, 255, 0, 255, 0, 0, 0, 0, 0,
1818 /* T43 Object */
1819 0, 0, 0, 0, 0, 0, 0,
1820 /* T46 Object */
1821 64, 0, 20, 20, 0, 0, 0, 0, 0,
1822 /* T47 Object */
1823 0, 0, 0, 0, 0, 0, 3, 64, 66, 0,
1824 /* T48 Object */
1825 31, 64, 64, 0, 0, 0, 0, 0, 0, 0,
1826 48, 40, 0, 10, 10, 0, 0, 100, 10, 80,
1827 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
1828 52, 0, 12, 0, 17, 0, 1, 0, 0, 0,
1829 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1830 0, 0, 0, 0,
1831 /* T56 Object */
1832 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1833 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1834 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1835 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1836 2, 99, 33,
1837};
1838
1839/* configuration data for mxt1386e using V2.1 firmware */
1840static const u8 mxt1386e_config_data_v2_1[] = {
1841 /* T6 Object */
1842 0, 0, 0, 0, 0, 0,
1843 /* T38 Object */
1844 12, 2, 0, 17, 1, 12, 0, 0, 0, 0,
1845 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1846 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1847 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1848 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1849 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1850 0, 0, 0, 0,
1851 /* T7 Object */
1852 100, 16, 50,
1853 /* T8 Object */
1854 25, 0, 20, 20, 0, 0, 20, 50, 0, 0,
1855 /* T9 Object */
1856 131, 0, 0, 26, 42, 0, 32, 80, 2, 5,
1857 0, 5, 5, 0, 10, 30, 10, 10, 255, 2,
1858 85, 5, 10, 10, 10, 10, 135, 55, 70, 40,
1859 10, 5, 0, 0, 0,
1860 /* T18 Object */
1861 0, 0,
1862 /* T24 Object */
1863 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1864 0, 0, 0, 0, 0, 0, 0, 0, 0,
1865 /* T25 Object */
1866 3, 0, 60, 115, 156, 99,
1867 /* T27 Object */
1868 0, 0, 0, 0, 0, 0, 0,
1869 /* T40 Object */
1870 0, 0, 0, 0, 0,
1871 /* T42 Object */
1872 2, 0, 255, 0, 255, 0, 0, 0, 0, 0,
1873 /* T43 Object */
1874 0, 0, 0, 0, 0, 0, 0, 64, 0, 8,
1875 16,
1876 /* T46 Object */
1877 64, 0, 20, 20, 0, 0, 0, 0, 0,
1878 /* T47 Object */
1879 0, 0, 0, 0, 0, 0, 3, 64, 66, 0,
1880 /* T48 Object */
1881 31, 64, 64, 0, 0, 0, 0, 0, 0, 0,
1882 48, 40, 0, 10, 10, 0, 0, 100, 10, 80,
1883 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
1884 52, 0, 12, 0, 17, 0, 1, 0, 0, 0,
1885 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1886 0, 0, 0, 0,
1887 /* T56 Object */
1888 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1889 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1890 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1891 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1892 2, 99, 33, 0, 149, 24, 193, 255, 255, 255,
1893 255,
1894};
1895
Jing Lineec88ca2012-02-08 11:18:30 -08001896/* configuration data for mxt1386e on 3D SKU using V2.1 firmware */
1897static const u8 mxt1386e_config_data_3d[] = {
1898 /* T6 Object */
1899 0, 0, 0, 0, 0, 0,
1900 /* T38 Object */
Jing Lin66ba78b2012-02-24 21:25:12 -08001901 13, 1, 0, 23, 2, 12, 0, 0, 0, 0,
Jing Lineec88ca2012-02-08 11:18:30 -08001902 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1903 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1904 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1905 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1906 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1907 0, 0, 0, 0,
1908 /* T7 Object */
Jing Lin66ba78b2012-02-24 21:25:12 -08001909 100, 10, 50,
Jing Lineec88ca2012-02-08 11:18:30 -08001910 /* T8 Object */
Jing Lin66ba78b2012-02-24 21:25:12 -08001911 25, 0, 20, 20, 0, 0, 0, 0, 0, 0,
Jing Lineec88ca2012-02-08 11:18:30 -08001912 /* T9 Object */
1913 131, 0, 0, 26, 42, 0, 32, 80, 2, 5,
1914 0, 5, 5, 0, 10, 30, 10, 10, 175, 4,
Jing Lin66ba78b2012-02-24 21:25:12 -08001915 127, 7, 26, 21, 17, 19, 143, 35, 207, 40,
1916 20, 5, 54, 49, 0,
Jing Lineec88ca2012-02-08 11:18:30 -08001917 /* T18 Object */
1918 0, 0,
1919 /* T24 Object */
1920 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1921 0, 0, 0, 0, 0, 0, 0, 0, 0,
1922 /* T25 Object */
Jing Lin66ba78b2012-02-24 21:25:12 -08001923 0, 0, 72, 113, 168, 97,
Jing Lineec88ca2012-02-08 11:18:30 -08001924 /* T27 Object */
1925 0, 0, 0, 0, 0, 0, 0,
1926 /* T40 Object */
1927 0, 0, 0, 0, 0,
1928 /* T42 Object */
Jing Lin66ba78b2012-02-24 21:25:12 -08001929 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Jing Lineec88ca2012-02-08 11:18:30 -08001930 /* T43 Object */
Jing Lin66ba78b2012-02-24 21:25:12 -08001931 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1932 0,
Jing Lineec88ca2012-02-08 11:18:30 -08001933 /* T46 Object */
Jing Lin66ba78b2012-02-24 21:25:12 -08001934 68, 0, 16, 16, 0, 0, 0, 0, 0,
Jing Lineec88ca2012-02-08 11:18:30 -08001935 /* T47 Object */
1936 0, 0, 0, 0, 0, 0, 3, 64, 66, 0,
1937 /* T48 Object */
1938 31, 64, 64, 0, 0, 0, 0, 0, 0, 0,
Jing Lin66ba78b2012-02-24 21:25:12 -08001939 32, 50, 0, 10, 10, 0, 0, 100, 10, 90,
1940 0, 0, 0, 0, 0, 0, 0, 10, 1, 30,
1941 52, 10, 5, 0, 33, 0, 1, 0, 0, 0,
Jing Lineec88ca2012-02-08 11:18:30 -08001942 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1943 0, 0, 0, 0,
1944 /* T56 Object */
1945 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1946 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1947 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1948 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Jing Lin66ba78b2012-02-24 21:25:12 -08001949 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1950 0,
Jing Lineec88ca2012-02-08 11:18:30 -08001951};
1952
Amy Maloche08266db2011-11-04 11:07:16 -07001953#define MXT_TS_GPIO_IRQ 11
1954#define MXT_TS_LDO_EN_GPIO 50
1955#define MXT_TS_RESET_GPIO 52
Mohan Pallaka50837382011-09-07 11:00:57 +05301956
1957static void mxt_init_hw_liquid(void)
1958{
1959 int rc;
1960
Mohan Pallaka50837382011-09-07 11:00:57 +05301961 rc = gpio_request(MXT_TS_LDO_EN_GPIO, "mxt_ldo_en_gpio");
1962 if (rc) {
Amy Maloche08266db2011-11-04 11:07:16 -07001963 pr_err("%s: unable to request mxt_ldo_en_gpio [%d]\n",
1964 __func__, MXT_TS_LDO_EN_GPIO);
1965 return;
Mohan Pallaka50837382011-09-07 11:00:57 +05301966 }
1967
1968 rc = gpio_direction_output(MXT_TS_LDO_EN_GPIO, 1);
1969 if (rc) {
Amy Maloche08266db2011-11-04 11:07:16 -07001970 pr_err("%s: unable to set_direction for mxt_ldo_en_gpio [%d]\n",
1971 __func__, MXT_TS_LDO_EN_GPIO);
Mohan Pallaka50837382011-09-07 11:00:57 +05301972 goto err_ldo_gpio_req;
1973 }
1974
Mohan Pallaka50837382011-09-07 11:00:57 +05301975 return;
1976
Mohan Pallaka50837382011-09-07 11:00:57 +05301977err_ldo_gpio_req:
1978 gpio_free(MXT_TS_LDO_EN_GPIO);
Mohan Pallaka50837382011-09-07 11:00:57 +05301979}
1980
Jing Lineec88ca2012-02-08 11:18:30 -08001981static struct mxt_config_info mxt_config_array_2d[] = {
Jing Lindc4413c2012-01-16 15:22:52 -08001982 {
1983 .config = mxt1386_config_data,
1984 .config_length = ARRAY_SIZE(mxt1386_config_data),
1985 .family_id = 0xA0,
1986 .variant_id = 0x0,
1987 .version = 0x10,
1988 .build = 0xAA,
Anirudh Ghayala77941e2012-02-23 19:12:26 -08001989 .bootldr_id = MXT_BOOTLOADER_ID_1386,
Jing Lindc4413c2012-01-16 15:22:52 -08001990 },
Jing Lin33b007d2011-12-21 17:40:23 -08001991 {
1992 .config = mxt1386e_config_data_v1_0,
1993 .config_length = ARRAY_SIZE(mxt1386e_config_data_v1_0),
1994 .family_id = 0xA0,
1995 .variant_id = 0x2,
1996 .version = 0x10,
1997 .build = 0xAA,
Anirudh Ghayala77941e2012-02-23 19:12:26 -08001998 .bootldr_id = MXT_BOOTLOADER_ID_1386E,
Jing Linaeaeed52012-03-26 14:57:15 -07001999 .fw_name = "atmel_8960_liquid_v2_2_AA.hex",
Jing Lin33b007d2011-12-21 17:40:23 -08002000 },
2001 {
2002 .config = mxt1386e_config_data_v2_1,
2003 .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1),
2004 .family_id = 0xA0,
2005 .variant_id = 0x7,
2006 .version = 0x21,
2007 .build = 0xAA,
Anirudh Ghayala77941e2012-02-23 19:12:26 -08002008 .bootldr_id = MXT_BOOTLOADER_ID_1386E,
Jing Linaeaeed52012-03-26 14:57:15 -07002009 .fw_name = "atmel_8960_liquid_v2_2_AA.hex",
2010 },
2011 {
2012 /* The config data for V2.2.AA is the same as for V2.1.AA */
2013 .config = mxt1386e_config_data_v2_1,
2014 .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1),
2015 .family_id = 0xA0,
2016 .variant_id = 0x7,
2017 .version = 0x22,
2018 .build = 0xAA,
2019 .bootldr_id = MXT_BOOTLOADER_ID_1386E,
Jing Lin33b007d2011-12-21 17:40:23 -08002020 },
Jing Lindc4413c2012-01-16 15:22:52 -08002021};
2022
Jing Lineec88ca2012-02-08 11:18:30 -08002023static struct mxt_platform_data mxt_platform_data_2d = {
2024 .config_array = mxt_config_array_2d,
2025 .config_array_size = ARRAY_SIZE(mxt_config_array_2d),
Mohan Pallaka56a1a5d2012-02-23 12:05:13 -08002026 .panel_minx = 0,
2027 .panel_maxx = 1365,
2028 .panel_miny = 0,
2029 .panel_maxy = 767,
2030 .disp_minx = 0,
2031 .disp_maxx = 1365,
2032 .disp_miny = 0,
2033 .disp_maxy = 767,
Mohan Pallaka50837382011-09-07 11:00:57 +05302034 .irqflags = IRQF_TRIGGER_FALLING,
Jing Lin2f863172011-10-17 10:56:58 -07002035 .i2c_pull_up = true,
Amy Maloche08266db2011-11-04 11:07:16 -07002036 .reset_gpio = MXT_TS_RESET_GPIO,
2037 .irq_gpio = MXT_TS_GPIO_IRQ,
Mohan Pallaka50837382011-09-07 11:00:57 +05302038};
2039
Jing Lineec88ca2012-02-08 11:18:30 -08002040static struct mxt_config_info mxt_config_array_3d[] = {
2041 {
2042 .config = mxt1386e_config_data_3d,
2043 .config_length = ARRAY_SIZE(mxt1386e_config_data_3d),
2044 .family_id = 0xA0,
2045 .variant_id = 0x7,
2046 .version = 0x21,
2047 .build = 0xAA,
2048 },
2049};
2050
2051static struct mxt_platform_data mxt_platform_data_3d = {
2052 .config_array = mxt_config_array_3d,
2053 .config_array_size = ARRAY_SIZE(mxt_config_array_3d),
Mohan Pallaka56a1a5d2012-02-23 12:05:13 -08002054 .panel_minx = 0,
2055 .panel_maxx = 1919,
2056 .panel_miny = 0,
2057 .panel_maxy = 1199,
2058 .disp_minx = 0,
2059 .disp_maxx = 1919,
2060 .disp_miny = 0,
2061 .disp_maxy = 1199,
Jing Lineec88ca2012-02-08 11:18:30 -08002062 .irqflags = IRQF_TRIGGER_FALLING,
2063 .i2c_pull_up = true,
2064 .reset_gpio = MXT_TS_RESET_GPIO,
2065 .irq_gpio = MXT_TS_GPIO_IRQ,
2066};
2067
Mohan Pallaka50837382011-09-07 11:00:57 +05302068static struct i2c_board_info mxt_device_info[] __initdata = {
2069 {
2070 I2C_BOARD_INFO("atmel_mxt_ts", 0x5b),
Mohan Pallaka50837382011-09-07 11:00:57 +05302071 .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ),
2072 },
2073};
2074
Eugene Yasmand2316b82011-12-07 18:23:48 +02002075static struct i2c_board_info sii_device_info[] __initdata = {
2076 {
2077 I2C_BOARD_INFO("Sil-9244", 0x39),
2078 .flags = I2C_CLIENT_WAKE,
2079 .irq = MSM_GPIO_TO_INT(15),
2080 },
2081};
2082
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002083static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi4_pdata = {
2084 .clk_freq = 100000,
2085 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002086};
2087
2088static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi3_pdata = {
2089 .clk_freq = 100000,
2090 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002091};
2092
2093static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi10_pdata = {
2094 .clk_freq = 100000,
2095 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002096};
2097
2098static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi12_pdata = {
2099 .clk_freq = 100000,
2100 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002101};
2102
Maheshkumar Sivasubramanian6866b1c2011-06-07 14:20:33 -06002103static struct msm_pm_sleep_status_data msm_pm_slp_sts_data = {
2104 .base_addr = MSM_ACC0_BASE + 0x08,
2105 .cpu_offset = MSM_ACC1_BASE - MSM_ACC0_BASE,
2106 .mask = 1UL << 13,
2107};
2108
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -07002109static struct ks8851_pdata spi_eth_pdata = {
2110 .irq_gpio = KS8851_IRQ_GPIO,
2111 .rst_gpio = KS8851_RST_GPIO,
2112};
Praveen Chidambaram043f4ce2011-08-02 09:37:59 -06002113
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002114static struct spi_board_info spi_board_info[] __initdata = {
2115 {
2116 .modalias = "ks8851",
2117 .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
2118 .max_speed_hz = 19200000,
2119 .bus_num = 0,
2120 .chip_select = 0,
2121 .mode = SPI_MODE_0,
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -07002122 .platform_data = &spi_eth_pdata
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002123 },
Chandan Uddaraju15e54b92011-09-12 10:52:36 -07002124 {
2125 .modalias = "dsi_novatek_3d_panel_spi",
2126 .max_speed_hz = 10800000,
2127 .bus_num = 0,
2128 .chip_select = 1,
2129 .mode = SPI_MODE_0,
2130 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002131};
2132
2133static struct platform_device msm_device_saw_core0 = {
2134 .name = "saw-regulator",
2135 .id = 0,
2136 .dev = {
2137 .platform_data = &msm_saw_regulator_pdata_s5,
2138 },
2139};
2140
2141static struct platform_device msm_device_saw_core1 = {
2142 .name = "saw-regulator",
2143 .id = 1,
2144 .dev = {
2145 .platform_data = &msm_saw_regulator_pdata_s6,
2146 },
2147};
2148
Siddartha Mohanadossba21fdd2011-08-18 10:05:27 -07002149static struct tsens_platform_data msm_tsens_pdata = {
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -08002150 .slope = {910, 910, 910, 910, 910},
Siddartha Mohanadossba21fdd2011-08-18 10:05:27 -07002151 .tsens_factor = 1000,
2152 .hw_type = MSM_8960,
2153 .tsens_num_sensor = 5,
2154};
2155
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002156#ifdef CONFIG_MSM_FAKE_BATTERY
2157static struct platform_device fish_battery_device = {
2158 .name = "fish_battery",
2159};
2160#endif
2161
David Collins26f05562011-06-20 09:56:28 -07002162static struct platform_device msm8960_device_ext_5v_vreg __devinitdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002163 .name = GPIO_REGULATOR_DEV_NAME,
2164 .id = PM8921_MPP_PM_TO_SYS(7),
2165 .dev = {
2166 .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V],
2167 },
2168};
2169
David Collins26f05562011-06-20 09:56:28 -07002170static struct platform_device msm8960_device_ext_l2_vreg __devinitdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002171 .name = GPIO_REGULATOR_DEV_NAME,
2172 .id = 91,
2173 .dev = {
2174 .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_L2],
2175 },
2176};
2177
David Collinsb10be1d2011-09-02 10:29:31 -07002178static struct platform_device msm8960_device_ext_3p3v_vreg __devinitdata = {
2179 .name = GPIO_REGULATOR_DEV_NAME,
2180 .id = PM8921_GPIO_PM_TO_SYS(17),
2181 .dev = {
2182 .platform_data =
2183 &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V],
2184 },
2185};
2186
David Collins35a78f52011-12-14 15:54:25 -08002187static struct platform_device msm8960_device_ext_otg_sw_vreg __devinitdata = {
2188 .name = GPIO_REGULATOR_DEV_NAME,
2189 .id = PM8921_GPIO_PM_TO_SYS(42),
2190 .dev = {
2191 .platform_data =
2192 &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_OTG_SW],
2193 },
2194};
2195
David Collins26f05562011-06-20 09:56:28 -07002196static struct platform_device msm8960_device_rpm_regulator __devinitdata = {
2197 .name = "rpm-regulator",
2198 .id = -1,
2199 .dev = {
2200 .platform_data = &msm_rpm_regulator_pdata,
2201 },
2202};
2203
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002204static struct platform_device *common_devices[] __initdata = {
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -07002205 &msm8960_device_dmov,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002206 &msm_device_smd,
Mayank Rana9f51f582011-08-04 18:35:59 +05302207 &msm_device_uart_dm6,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002208 &msm_device_saw_core0,
2209 &msm_device_saw_core1,
2210 &msm8960_device_ext_5v_vreg,
David Collins87579612012-01-30 16:00:15 -08002211 &msm8960_device_ssbi_pmic,
David Collins96aa3e12012-02-29 10:31:34 -08002212 &msm8960_device_ext_otg_sw_vreg,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002213 &msm8960_device_qup_spi_gsbi1,
2214 &msm8960_device_qup_i2c_gsbi3,
2215 &msm8960_device_qup_i2c_gsbi4,
2216 &msm8960_device_qup_i2c_gsbi10,
2217#ifndef CONFIG_MSM_DSPS
2218 &msm8960_device_qup_i2c_gsbi12,
2219#endif
2220 &msm_slim_ctrl,
2221 &msm_device_wcnss_wlan,
2222#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
2223 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
2224 &qcrypto_device,
2225#endif
2226
2227#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
2228 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
2229 &qcedev_device,
2230#endif
2231#ifdef CONFIG_MSM_ROTATOR
2232 &msm_rotator_device,
2233#endif
2234 &msm_device_sps,
2235#ifdef CONFIG_MSM_FAKE_BATTERY
2236 &fish_battery_device,
2237#endif
Larry Bassel41a055b2011-12-06 16:15:14 -08002238 &fmem_device,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002239#ifdef CONFIG_ANDROID_PMEM
Laura Abbott2d1760b2011-09-29 21:31:24 -07002240#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002241 &android_pmem_device,
2242 &android_pmem_adsp_device,
2243 &android_pmem_audio_device,
2244#endif
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -07002245#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002246 &msm_device_vidc,
2247 &msm_device_bam_dmux,
2248 &msm_fm_platform_init,
Mona Hossain9c430e32011-07-27 11:04:47 -07002249
Joel Nidera1261942011-09-12 16:30:09 +03002250#if defined(CONFIG_TSIF) || defined(CONFIG_TSIF_MODULE)
2251#ifdef CONFIG_MSM_USE_TSIF1
2252 &msm_device_tsif[1],
2253#else
2254 &msm_device_tsif[0],
2255#endif
2256#endif
2257
Mona Hossain9c430e32011-07-27 11:04:47 -07002258#ifdef CONFIG_HW_RANDOM_MSM
2259 &msm_device_rng,
2260#endif
Laura Abbottd6183792011-08-19 13:42:24 -07002261#ifdef CONFIG_ION_MSM
2262 &ion_dev,
2263#endif
Praveen Chidambaram78499012011-11-01 17:15:17 -06002264 &msm8960_rpm_device,
2265 &msm8960_rpm_log_device,
2266 &msm8960_rpm_stat_device,
Mona Hossain11c03ac2011-10-26 12:42:10 -07002267 &msm_device_tz_log,
Pratik Patel7831c082011-06-08 21:44:37 -07002268#ifdef CONFIG_MSM_QDSS
Pratik Patel1403f2a2012-03-21 10:10:00 -07002269 &msm_qdss_device,
Pratik Patel7831c082011-06-08 21:44:37 -07002270 &msm_etb_device,
2271 &msm_tpiu_device,
2272 &msm_funnel_device,
Pratik Patel492b3012012-03-06 14:22:30 -08002273 &msm_etm_device,
Pratik Patel7831c082011-06-08 21:44:37 -07002274#endif
Swaminathan Sathappanb77c65e92011-09-30 18:36:09 -07002275 &msm_device_dspcrashd_8960,
Jeff Ohlstein7e668552011-10-06 16:17:25 -07002276 &msm8960_device_watchdog,
Laura Abbottf8c03b92012-02-16 14:57:58 -08002277#ifdef CONFIG_MSM_RTB
2278 &msm_rtb_device,
2279#endif
Praveen Chidambaram8ea3dcd2011-12-07 14:46:31 -07002280 &msm8960_cpu_idle_device,
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07002281 &msm8960_msm_gov_device,
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08002282 &msm8960_device_cache_erp,
Laura Abbott306bcc22012-03-08 11:24:53 -08002283#ifdef CONFIG_MSM_CACHE_DUMP
2284 &msm_cache_dump_device,
2285#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002286};
2287
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002288static struct platform_device *sim_devices[] __initdata = {
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -07002289 &msm8960_device_uart_gsbi5,
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002290 &msm8960_device_otg,
2291 &msm8960_device_gadget_peripheral,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002292 &msm_device_hsusb_host,
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +05302293 &msm_device_hsic_host,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002294 &android_usb_device,
2295 &msm_device_vidc,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002296 &msm_bus_apps_fabric,
2297 &msm_bus_sys_fabric,
2298 &msm_bus_mm_fabric,
2299 &msm_bus_sys_fpb,
2300 &msm_bus_cpss_fpb,
2301 &msm_pcm,
Kiran Kandi5e809b02012-01-31 00:24:33 -08002302 &msm_multi_ch_pcm,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002303 &msm_pcm_routing,
2304 &msm_cpudai0,
2305 &msm_cpudai1,
2306 &msm_cpudai_hdmi_rx,
2307 &msm_cpudai_bt_rx,
2308 &msm_cpudai_bt_tx,
2309 &msm_cpudai_fm_rx,
2310 &msm_cpudai_fm_tx,
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07002311 &msm_cpudai_auxpcm_rx,
2312 &msm_cpudai_auxpcm_tx,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002313 &msm_cpu_fe,
2314 &msm_stub_codec,
2315 &msm_voice,
2316 &msm_voip,
2317 &msm_lpa_pcm,
Asish Bhattacharya96bb6f42011-11-01 20:36:09 +05302318 &msm_compr_dsp,
Helen Zeng0705a5f2011-10-14 15:29:52 -07002319 &msm_cpudai_incall_music_rx,
Helen Zenge3d716a2011-10-14 16:32:16 -07002320 &msm_cpudai_incall_record_rx,
2321 &msm_cpudai_incall_record_tx,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002322
2323#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
2324 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
2325 &qcrypto_device,
2326#endif
2327
2328#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
2329 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
2330 &qcedev_device,
2331#endif
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002332};
2333
2334static struct platform_device *rumi3_devices[] __initdata = {
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -07002335 &msm8960_device_uart_gsbi5,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002336 &msm_kgsl_3d0,
2337 &msm_kgsl_2d0,
2338 &msm_kgsl_2d1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002339#ifdef CONFIG_MSM_GEMINI
2340 &msm8960_gemini_device,
2341#endif
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002342};
2343
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002344static struct platform_device *cdp_devices[] __initdata = {
Stephen Boydeb819882011-08-29 14:46:30 -07002345 &msm_8960_q6_lpass,
2346 &msm_8960_q6_mss_fw,
2347 &msm_8960_q6_mss_sw,
Stephen Boyd322a9922011-09-20 01:05:54 -07002348 &msm_8960_riva,
Stephen Boydd89eebe2011-09-28 23:28:11 -07002349 &msm_pil_tzapps,
Stephen Boyd25c4a0b2011-09-20 00:12:36 -07002350 &msm_pil_dsps,
Stephen Boyd7b973de2012-03-09 12:26:16 -08002351 &msm_pil_vidc,
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002352 &msm8960_device_otg,
2353 &msm8960_device_gadget_peripheral,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002354 &msm_device_hsusb_host,
2355 &android_usb_device,
2356 &msm_pcm,
Kiran Kandi5e809b02012-01-31 00:24:33 -08002357 &msm_multi_ch_pcm,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002358 &msm_pcm_routing,
2359 &msm_cpudai0,
2360 &msm_cpudai1,
2361 &msm_cpudai_hdmi_rx,
2362 &msm_cpudai_bt_rx,
2363 &msm_cpudai_bt_tx,
2364 &msm_cpudai_fm_rx,
2365 &msm_cpudai_fm_tx,
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07002366 &msm_cpudai_auxpcm_rx,
2367 &msm_cpudai_auxpcm_tx,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002368 &msm_cpu_fe,
2369 &msm_stub_codec,
2370 &msm_kgsl_3d0,
2371#ifdef CONFIG_MSM_KGSL_2D
2372 &msm_kgsl_2d0,
2373 &msm_kgsl_2d1,
2374#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002375#ifdef CONFIG_MSM_GEMINI
2376 &msm8960_gemini_device,
2377#endif
2378 &msm_voice,
2379 &msm_voip,
2380 &msm_lpa_pcm,
Laxminath Kasamcee1d602011-08-01 19:26:57 +05302381 &msm_cpudai_afe_01_rx,
2382 &msm_cpudai_afe_01_tx,
2383 &msm_cpudai_afe_02_rx,
2384 &msm_cpudai_afe_02_tx,
2385 &msm_pcm_afe,
Asish Bhattacharya96bb6f42011-11-01 20:36:09 +05302386 &msm_compr_dsp,
Helen Zeng0705a5f2011-10-14 15:29:52 -07002387 &msm_cpudai_incall_music_rx,
Helen Zenge3d716a2011-10-14 16:32:16 -07002388 &msm_cpudai_incall_record_rx,
2389 &msm_cpudai_incall_record_tx,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002390 &msm_pcm_hostless,
2391 &msm_bus_apps_fabric,
2392 &msm_bus_sys_fabric,
2393 &msm_bus_mm_fabric,
2394 &msm_bus_sys_fpb,
2395 &msm_bus_cpss_fpb,
2396};
2397
2398static void __init msm8960_i2c_init(void)
2399{
2400 msm8960_device_qup_i2c_gsbi4.dev.platform_data =
2401 &msm8960_i2c_qup_gsbi4_pdata;
2402
2403 msm8960_device_qup_i2c_gsbi3.dev.platform_data =
2404 &msm8960_i2c_qup_gsbi3_pdata;
2405
2406 msm8960_device_qup_i2c_gsbi10.dev.platform_data =
2407 &msm8960_i2c_qup_gsbi10_pdata;
2408
2409 msm8960_device_qup_i2c_gsbi12.dev.platform_data =
2410 &msm8960_i2c_qup_gsbi12_pdata;
2411}
2412
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002413static void __init msm8960_gfx_init(void)
2414{
Jeremy Gebben58b2dce2011-10-13 11:14:19 -06002415 uint32_t soc_platform_version = socinfo_get_version();
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002416 if (SOCINFO_VERSION_MAJOR(soc_platform_version) == 1) {
2417 struct kgsl_device_platform_data *kgsl_3d0_pdata =
2418 msm_kgsl_3d0.dev.platform_data;
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002419 kgsl_3d0_pdata->pwrlevel[0].gpu_freq = 320000000;
2420 kgsl_3d0_pdata->pwrlevel[1].gpu_freq = 266667000;
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002421 }
2422}
2423
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002424static struct msm_cpuidle_state msm_cstates[] __initdata = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06002425
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002426 {0, 0, "C0", "WFI",
2427 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
2428
2429 {0, 1, "C1", "STANDALONE_POWER_COLLAPSE",
2430 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
2431
2432 {0, 2, "C2", "POWER_COLLAPSE",
2433 MSM_PM_SLEEP_MODE_POWER_COLLAPSE},
2434
2435 {1, 0, "C0", "WFI",
2436 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
2437
2438 {1, 1, "C1", "STANDALONE_POWER_COLLAPSE",
2439 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
2440};
2441
2442static struct msm_pm_platform_data msm_pm_data[MSM_PM_SLEEP_MODE_NR * 2] = {
2443 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
2444 .idle_supported = 1,
2445 .suspend_supported = 1,
2446 .idle_enabled = 0,
2447 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002448 },
2449
2450 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
2451 .idle_supported = 1,
2452 .suspend_supported = 1,
2453 .idle_enabled = 0,
2454 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002455 },
2456
2457 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
2458 .idle_supported = 1,
2459 .suspend_supported = 1,
2460 .idle_enabled = 1,
2461 .suspend_enabled = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002462 },
2463
2464 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
2465 .idle_supported = 0,
2466 .suspend_supported = 1,
2467 .idle_enabled = 0,
2468 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002469 },
2470
2471 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
2472 .idle_supported = 1,
2473 .suspend_supported = 1,
2474 .idle_enabled = 0,
2475 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002476 },
2477
2478 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
2479 .idle_supported = 1,
2480 .suspend_supported = 0,
2481 .idle_enabled = 1,
2482 .suspend_enabled = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002483 },
2484};
2485
Subhash Jadavani933e6a62011-12-26 18:05:04 +05302486static struct msm_rpmrs_level msm_rpmrs_levels[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002487 {
2488 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
2489 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
2490 true,
Praveen Chidambaram8e499d42012-02-08 10:32:27 -07002491 100, 650, 801, 200,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002492 },
2493
2494 {
2495 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
2496 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
2497 true,
Praveen Chidambaram8e499d42012-02-08 10:32:27 -07002498 2000, 200, 576000, 2000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002499 },
2500
2501 {
2502 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2503 MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE),
2504 false,
Praveen Chidambaram8e499d42012-02-08 10:32:27 -07002505 8500, 51, 1122000, 8500,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002506 },
2507
2508 {
2509 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2510 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, MAX, ACTIVE),
2511 false,
Praveen Chidambaram8e499d42012-02-08 10:32:27 -07002512 9000, 51, 1130300, 9000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002513 },
Maheshkumar Sivasubramanian7df12362011-11-02 08:25:49 -06002514 {
2515 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2516 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, ACTIVE, RET_HIGH),
2517 false,
Praveen Chidambaram8e499d42012-02-08 10:32:27 -07002518 10000, 51, 1130300, 10000,
Maheshkumar Sivasubramanian7df12362011-11-02 08:25:49 -06002519 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002520
2521 {
2522 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2523 MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE),
2524 false,
Praveen Chidambaram8e499d42012-02-08 10:32:27 -07002525 12000, 14, 2205900, 12000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002526 },
2527
2528 {
2529 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2530 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
2531 false,
Praveen Chidambaram8e499d42012-02-08 10:32:27 -07002532 18000, 12, 2364250, 18000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002533 },
2534
2535 {
2536 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2537 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH),
2538 false,
Praveen Chidambaram8e499d42012-02-08 10:32:27 -07002539 23500, 10, 2667000, 23500,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002540 },
2541
2542 {
2543 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2544 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
2545 false,
Praveen Chidambaram8e499d42012-02-08 10:32:27 -07002546 29700, 5, 2867000, 30000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002547 },
2548};
2549
Praveen Chidambaram78499012011-11-01 17:15:17 -06002550static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = {
2551 .levels = &msm_rpmrs_levels[0],
2552 .num_levels = ARRAY_SIZE(msm_rpmrs_levels),
2553 .vdd_mem_levels = {
2554 [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000,
2555 [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000,
2556 [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000,
2557 [MSM_RPMRS_VDD_MEM_MAX] = 1150000,
2558 },
2559 .vdd_dig_levels = {
2560 [MSM_RPMRS_VDD_DIG_RET_LOW] = 500000,
2561 [MSM_RPMRS_VDD_DIG_RET_HIGH] = 750000,
2562 [MSM_RPMRS_VDD_DIG_ACTIVE] = 950000,
2563 [MSM_RPMRS_VDD_DIG_MAX] = 1150000,
2564 },
2565 .vdd_mask = 0x7FFFFF,
2566 .rpmrs_target_id = {
2567 [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK,
2568 [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST,
2569 [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_PM8921_S3_0,
2570 [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_PM8921_S3_1,
2571 [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8921_L24_0,
2572 [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8921_L24_1,
2573 [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL,
2574 },
2575};
2576
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -06002577static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
2578 .mode = MSM_PM_BOOT_CONFIG_TZ,
2579};
2580
Subhash Jadavani933e6a62011-12-26 18:05:04 +05302581uint32_t msm_rpm_get_swfi_latency(void)
2582{
2583 int i;
2584
2585 for (i = 0; i < ARRAY_SIZE(msm_rpmrs_levels); i++) {
2586 if (msm_rpmrs_levels[i].sleep_mode ==
2587 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)
2588 return msm_rpmrs_levels[i].latency_us;
2589 }
2590
2591 return 0;
2592}
2593
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002594#ifdef CONFIG_I2C
2595#define I2C_SURF 1
2596#define I2C_FFA (1 << 1)
2597#define I2C_RUMI (1 << 2)
2598#define I2C_SIM (1 << 3)
2599#define I2C_FLUID (1 << 4)
Amir Samuelov05f87802011-08-27 18:30:12 +03002600#define I2C_LIQUID (1 << 5)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002601
2602struct i2c_registry {
2603 u8 machs;
2604 int bus;
2605 struct i2c_board_info *info;
2606 int len;
2607};
2608
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002609/* Sensors DSPS platform data */
2610#ifdef CONFIG_MSM_DSPS
2611#define DSPS_PIL_GENERIC_NAME "dsps"
2612#endif /* CONFIG_MSM_DSPS */
2613
2614static void __init msm8960_init_dsps(void)
2615{
2616#ifdef CONFIG_MSM_DSPS
2617 struct msm_dsps_platform_data *pdata =
2618 msm_dsps_device.dev.platform_data;
2619 pdata->pil_name = DSPS_PIL_GENERIC_NAME;
2620 pdata->gpios = NULL;
2621 pdata->gpios_num = 0;
2622
2623 platform_device_register(&msm_dsps_device);
2624#endif /* CONFIG_MSM_DSPS */
2625}
2626
Vamsi Krishna6aa6b1f2011-12-14 22:55:20 -08002627static int hsic_peripheral_status = 1;
2628static DEFINE_MUTEX(hsic_status_lock);
2629
2630void peripheral_connect()
2631{
2632 mutex_lock(&hsic_status_lock);
2633 if (hsic_peripheral_status)
2634 goto out;
2635 platform_device_add(&msm_device_hsic_host);
2636 hsic_peripheral_status = 1;
2637out:
2638 mutex_unlock(&hsic_status_lock);
2639}
2640EXPORT_SYMBOL(peripheral_connect);
2641
2642void peripheral_disconnect()
2643{
2644 mutex_lock(&hsic_status_lock);
2645 if (!hsic_peripheral_status)
2646 goto out;
2647 platform_device_del(&msm_device_hsic_host);
2648 hsic_peripheral_status = 0;
2649out:
2650 mutex_unlock(&hsic_status_lock);
2651}
2652EXPORT_SYMBOL(peripheral_disconnect);
2653
Vamsi Krishna98f54fb2011-11-02 14:55:41 -07002654static void __init msm8960_init_hsic(void)
2655{
2656#ifdef CONFIG_USB_EHCI_MSM_HSIC
2657 uint32_t version = socinfo_get_version();
2658
Vamsi Krishnaf74d2edb2011-12-02 10:41:11 -08002659 if (SOCINFO_VERSION_MAJOR(version) == 1)
Vamsi Krishna98f54fb2011-11-02 14:55:41 -07002660 return;
2661
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08002662 if (PLATFORM_IS_CHARM25() || machine_is_msm8960_liquid())
Vamsi Krishnaf74d2edb2011-12-02 10:41:11 -08002663 platform_device_register(&msm_device_hsic_host);
Vamsi Krishna98f54fb2011-11-02 14:55:41 -07002664#endif
2665}
2666
Amir Samuelov5137e392011-09-21 17:31:25 +03002667#ifdef CONFIG_ISL9519_CHARGER
2668static struct isl_platform_data isl_data __initdata = {
2669 .valid_n_gpio = 0, /* Not required when notify-by-pmic */
2670 .chg_detection_config = NULL, /* Not required when notify-by-pmic */
2671 .max_system_voltage = 4200,
2672 .min_system_voltage = 3200,
Amir Samuelov95f49ff2012-01-29 09:14:08 +02002673 .chgcurrent = 1900,
2674 .term_current = 0,
Amir Samuelov5137e392011-09-21 17:31:25 +03002675 .input_current = 2048,
2676};
2677
2678static struct i2c_board_info isl_charger_i2c_info[] __initdata = {
2679 {
2680 I2C_BOARD_INFO("isl9519q", 0x9),
2681 .irq = 0, /* Not required when notify-by-pmic */
2682 .platform_data = &isl_data,
2683 },
2684};
2685#endif /* CONFIG_ISL9519_CHARGER */
2686
Amir Samuelov755616d2011-12-13 16:34:46 +02002687static struct i2c_board_info liquid_io_expander_i2c_info[] __initdata = {
2688 {
2689 I2C_BOARD_INFO("sx1508q", 0x20),
2690 .platform_data = &msm8960_sx150x_data[SX150X_LIQUID]
2691 },
2692};
2693
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002694static struct i2c_registry msm8960_i2c_devices[] __initdata = {
Amir Samuelov5137e392011-09-21 17:31:25 +03002695#ifdef CONFIG_ISL9519_CHARGER
2696 {
2697 I2C_LIQUID,
2698 MSM_8960_GSBI10_QUP_I2C_BUS_ID,
2699 isl_charger_i2c_info,
2700 ARRAY_SIZE(isl_charger_i2c_info),
2701 },
2702#endif /* CONFIG_ISL9519_CHARGER */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002703 {
2704 I2C_SURF | I2C_FFA | I2C_FLUID,
2705 MSM_8960_GSBI3_QUP_I2C_BUS_ID,
2706 cyttsp_info,
2707 ARRAY_SIZE(cyttsp_info),
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -07002708 },
Mohan Pallaka50837382011-09-07 11:00:57 +05302709 {
2710 I2C_LIQUID,
2711 MSM_8960_GSBI3_QUP_I2C_BUS_ID,
2712 mxt_device_info,
2713 ARRAY_SIZE(mxt_device_info),
2714 },
Mohan Pallaka5e490392011-09-09 15:18:41 +05302715 {
Mohan Pallakaf69f0492011-11-21 13:08:33 +05302716 I2C_FFA | I2C_LIQUID,
Mohan Pallaka5e490392011-09-09 15:18:41 +05302717 MSM_8960_GSBI10_QUP_I2C_BUS_ID,
Eugene Yasmand2316b82011-12-07 18:23:48 +02002718 sii_device_info,
2719 ARRAY_SIZE(sii_device_info),
2720 },
2721 {
2722 I2C_LIQUID,
2723 MSM_8960_GSBI10_QUP_I2C_BUS_ID,
Mohan Pallaka5e490392011-09-09 15:18:41 +05302724 msm_isa1200_board_info,
2725 ARRAY_SIZE(msm_isa1200_board_info),
2726 },
Amir Samuelov755616d2011-12-13 16:34:46 +02002727 {
2728 I2C_LIQUID,
2729 MSM_8960_GSBI10_QUP_I2C_BUS_ID,
2730 liquid_io_expander_i2c_info,
2731 ARRAY_SIZE(liquid_io_expander_i2c_info),
2732 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002733};
2734#endif /* CONFIG_I2C */
2735
2736static void __init register_i2c_devices(void)
2737{
2738#ifdef CONFIG_I2C
2739 u8 mach_mask = 0;
2740 int i;
Kevin Chan09f4e662011-12-16 08:17:02 -08002741#ifdef CONFIG_MSM_CAMERA
2742 struct i2c_registry msm8960_camera_i2c_devices = {
2743 I2C_SURF | I2C_FFA | I2C_FLUID | I2C_LIQUID | I2C_RUMI,
2744 MSM_8960_GSBI4_QUP_I2C_BUS_ID,
2745 msm8960_camera_board_info.board_info,
2746 msm8960_camera_board_info.num_i2c_board_info,
2747 };
2748#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002749
2750 /* Build the matching 'supported_machs' bitmask */
2751 if (machine_is_msm8960_cdp())
2752 mach_mask = I2C_SURF;
2753 else if (machine_is_msm8960_rumi3())
2754 mach_mask = I2C_RUMI;
2755 else if (machine_is_msm8960_sim())
2756 mach_mask = I2C_SIM;
Amy Maloche2d028032011-07-20 14:08:06 -07002757 else if (machine_is_msm8960_fluid())
2758 mach_mask = I2C_FLUID;
Amir Samuelov05f87802011-08-27 18:30:12 +03002759 else if (machine_is_msm8960_liquid())
2760 mach_mask = I2C_LIQUID;
Amy Maloche1b0663f2011-08-02 16:46:22 -07002761 else if (machine_is_msm8960_mtp())
2762 mach_mask = I2C_FFA;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002763 else
2764 pr_err("unmatched machine ID in register_i2c_devices\n");
2765
Jing Lineec88ca2012-02-08 11:18:30 -08002766 if (machine_is_msm8960_liquid()) {
2767 if (SOCINFO_VERSION_MAJOR(socinfo_get_platform_version()) == 3)
2768 mxt_device_info[0].platform_data =
2769 &mxt_platform_data_3d;
2770 else
2771 mxt_device_info[0].platform_data =
2772 &mxt_platform_data_2d;
2773 }
2774
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002775 /* Run the array and install devices as appropriate */
2776 for (i = 0; i < ARRAY_SIZE(msm8960_i2c_devices); ++i) {
2777 if (msm8960_i2c_devices[i].machs & mach_mask)
2778 i2c_register_board_info(msm8960_i2c_devices[i].bus,
2779 msm8960_i2c_devices[i].info,
2780 msm8960_i2c_devices[i].len);
2781 }
Kevin Chan09f4e662011-12-16 08:17:02 -08002782#ifdef CONFIG_MSM_CAMERA
2783 if (msm8960_camera_i2c_devices.machs & mach_mask)
2784 i2c_register_board_info(msm8960_camera_i2c_devices.bus,
2785 msm8960_camera_i2c_devices.info,
2786 msm8960_camera_i2c_devices.len);
2787#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002788#endif
2789}
2790
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002791static void __init msm8960_sim_init(void)
2792{
Jeff Ohlstein7e668552011-10-06 16:17:25 -07002793 struct msm_watchdog_pdata *wdog_pdata = (struct msm_watchdog_pdata *)
2794 &msm8960_device_watchdog.dev.platform_data;
2795
2796 wdog_pdata->bark_time = 15000;
Siddartha Mohanadossfad0af12012-01-20 15:08:38 -08002797 msm_tsens_early_init(&msm_tsens_pdata);
Praveen Chidambaram78499012011-11-01 17:15:17 -06002798 BUG_ON(msm_rpm_init(&msm8960_rpm_data));
2799 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002800 regulator_suppress_info_printing();
David Collins26f05562011-06-20 09:56:28 -07002801 platform_device_register(&msm8960_device_rpm_regulator);
Stephen Boydbb600ae2011-08-02 20:11:40 -07002802 msm_clock_init(&msm8960_clock_init_data);
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08002803 msm8960_init_pmic();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002804
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002805 msm8960_device_otg.dev.platform_data = &msm_otg_pdata;
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08002806 msm8960_init_gpiomux();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002807 msm8960_i2c_init();
2808 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
2809 msm_spm_l2_init(msm_spm_l2_data);
2810 msm8960_init_buses();
2811 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08002812 msm8960_pm8921_gpio_mpp_init();
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002813 platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices));
Matt Wagantallec57f062011-08-16 23:54:46 -07002814 acpuclk_init(&acpuclk_8960_soc_data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002815
2816 msm8960_device_qup_spi_gsbi1.dev.platform_data =
2817 &msm8960_qup_spi_gsbi1_pdata;
2818 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
2819
2820 msm8960_init_mmc();
Stepan Moskovchenko24cd8642011-11-29 13:07:53 -08002821 msm8960_init_fb();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002822 slim_register_board_info(msm_slim_devices,
2823 ARRAY_SIZE(msm_slim_devices));
2824 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
2825 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
2826 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
2827 msm_pm_data);
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -06002828 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Maheshkumar Sivasubramanian6866b1c2011-06-07 14:20:33 -06002829 msm_pm_init_sleep_status_data(&msm_pm_slp_sts_data);
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002830}
2831
2832static void __init msm8960_rumi3_init(void)
2833{
Siddartha Mohanadossfad0af12012-01-20 15:08:38 -08002834 msm_tsens_early_init(&msm_tsens_pdata);
Praveen Chidambaram78499012011-11-01 17:15:17 -06002835 BUG_ON(msm_rpm_init(&msm8960_rpm_data));
2836 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002837 regulator_suppress_info_printing();
David Collins26f05562011-06-20 09:56:28 -07002838 platform_device_register(&msm8960_device_rpm_regulator);
Stephen Boydbb600ae2011-08-02 20:11:40 -07002839 msm_clock_init(&msm8960_dummy_clock_init_data);
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08002840 msm8960_init_gpiomux();
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08002841 msm8960_init_pmic();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002842 msm8960_device_qup_spi_gsbi1.dev.platform_data =
2843 &msm8960_qup_spi_gsbi1_pdata;
2844 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
2845 msm8960_i2c_init();
2846 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
2847 msm_spm_l2_init(msm_spm_l2_data);
2848 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08002849 msm8960_pm8921_gpio_mpp_init();
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002850 platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002851 msm8960_init_mmc();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002852 register_i2c_devices();
Stepan Moskovchenko24cd8642011-11-29 13:07:53 -08002853 msm8960_init_fb();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002854 slim_register_board_info(msm_slim_devices,
2855 ARRAY_SIZE(msm_slim_devices));
2856 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
2857 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
2858 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
2859 msm_pm_data);
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -06002860 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Maheshkumar Sivasubramanian6866b1c2011-06-07 14:20:33 -06002861 msm_pm_init_sleep_status_data(&msm_pm_slp_sts_data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002862}
2863
2864static void __init msm8960_cdp_init(void)
2865{
Naveen Ramaraj76483ad2011-09-06 14:25:44 -07002866 if (meminfo_init(SYS_MEMORY, SZ_256M) < 0)
2867 pr_err("meminfo_init() failed!\n");
2868
Siddartha Mohanadossfad0af12012-01-20 15:08:38 -08002869 msm_tsens_early_init(&msm_tsens_pdata);
Praveen Chidambaram78499012011-11-01 17:15:17 -06002870 BUG_ON(msm_rpm_init(&msm8960_rpm_data));
2871 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
Abhijeet Dharmapurikar6d565fd2011-09-15 18:49:56 -07002872
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002873 regulator_suppress_info_printing();
2874 if (msm_xo_init())
2875 pr_err("Failed to initialize XO votes\n");
David Collins26f05562011-06-20 09:56:28 -07002876 platform_device_register(&msm8960_device_rpm_regulator);
Stephen Boydbb600ae2011-08-02 20:11:40 -07002877 msm_clock_init(&msm8960_clock_init_data);
Vijayavardhan Vennapusafc464f02011-11-04 21:54:00 +05302878 if (machine_is_msm8960_liquid())
2879 msm_otg_pdata.mhl_enable = true;
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002880 msm8960_device_otg.dev.platform_data = &msm_otg_pdata;
Anji jonnalaa8b8d732011-12-06 10:03:24 +05302881 if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() ||
2882 machine_is_msm8960_cdp()) {
2883 msm_otg_pdata.phy_init_seq = wr_phy_init_seq;
2884 } else if (machine_is_msm8960_liquid()) {
2885 msm_otg_pdata.phy_init_seq =
2886 liquid_v1_phy_init_seq;
2887 }
Anji jonnalaa7c1c5c2011-12-12 12:20:36 +05302888 msm_otg_pdata.swfi_latency =
2889 msm_rpmrs_levels[0].latency_us;
Vijayavardhan Vennapusa2b592824f2011-11-02 19:51:32 +05302890#ifdef CONFIG_USB_EHCI_MSM_HSIC
2891 if (machine_is_msm8960_liquid()) {
2892 if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 2)
2893 msm_hsic_pdata.hub_reset = HSIC_HUB_RESET_GPIO;
2894 }
2895#endif
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +05302896 msm_device_hsic_host.dev.platform_data = &msm_hsic_pdata;
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08002897 msm8960_init_gpiomux();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002898 msm8960_device_qup_spi_gsbi1.dev.platform_data =
2899 &msm8960_qup_spi_gsbi1_pdata;
2900 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08002901
2902 msm8960_init_pmic();
Mohan Pallakaf69f0492011-11-21 13:08:33 +05302903 if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 2 &&
2904 (machine_is_msm8960_mtp())) || machine_is_msm8960_liquid())
2905 msm_isa1200_board_info[0].platform_data = &isa1200_1_pdata;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002906 msm8960_i2c_init();
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002907 msm8960_gfx_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002908 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
2909 msm_spm_l2_init(msm_spm_l2_data);
2910 msm8960_init_buses();
2911 platform_add_devices(msm_footswitch_devices,
2912 msm_num_footswitch_devices);
David Collinsb10be1d2011-09-02 10:29:31 -07002913 if (machine_is_msm8960_liquid())
2914 platform_device_register(&msm8960_device_ext_3p3v_vreg);
David Collinsd5a40732011-11-29 15:53:56 -08002915 if (machine_is_msm8960_cdp())
2916 platform_device_register(&msm8960_device_ext_l2_vreg);
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -07002917
2918 if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE)
2919 platform_device_register(&msm8960_device_uart_gsbi8);
2920 else
2921 platform_device_register(&msm8960_device_uart_gsbi5);
2922
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002923 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08002924 msm8960_pm8921_gpio_mpp_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002925 platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
Vamsi Krishna98f54fb2011-11-02 14:55:41 -07002926 msm8960_init_hsic();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002927 msm8960_init_cam();
2928 msm8960_init_mmc();
Matt Wagantallec57f062011-08-16 23:54:46 -07002929 acpuclk_init(&acpuclk_8960_soc_data);
Mohan Pallaka50837382011-09-07 11:00:57 +05302930 if (machine_is_msm8960_liquid())
2931 mxt_init_hw_liquid();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002932 register_i2c_devices();
Stepan Moskovchenko24cd8642011-11-29 13:07:53 -08002933 msm8960_init_fb();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002934 slim_register_board_info(msm_slim_devices,
2935 ARRAY_SIZE(msm_slim_devices));
2936 msm8960_init_dsps();
2937 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
2938 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
2939 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
2940 msm_pm_data);
Larry Bassela7eadea2011-07-14 10:46:00 -07002941 change_memory_power = &msm8960_change_memory_power;
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -06002942 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Maheshkumar Sivasubramanian6866b1c2011-06-07 14:20:33 -06002943 msm_pm_init_sleep_status_data(&msm_pm_slp_sts_data);
Joel Kingb8352a12011-11-15 18:46:24 -08002944 if (PLATFORM_IS_CHARM25())
2945 platform_add_devices(mdm_devices, ARRAY_SIZE(mdm_devices));
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002946}
2947
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002948MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
2949 .map_io = msm8960_map_io,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002950 .reserve = msm8960_reserve,
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002951 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302952 .handle_irq = gic_handle_irq,
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002953 .timer = &msm_timer,
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002954 .init_machine = msm8960_sim_init,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002955 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07002956 .init_very_early = msm8960_early_memory,
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08002957MACHINE_END
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08002958
2959MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3")
2960 .map_io = msm8960_map_io,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002961 .reserve = msm8960_reserve,
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08002962 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302963 .handle_irq = gic_handle_irq,
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08002964 .timer = &msm_timer,
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002965 .init_machine = msm8960_rumi3_init,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002966 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07002967 .init_very_early = msm8960_early_memory,
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08002968MACHINE_END
2969
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002970MACHINE_START(MSM8960_CDP, "QCT MSM8960 CDP")
2971 .map_io = msm8960_map_io,
2972 .reserve = msm8960_reserve,
2973 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302974 .handle_irq = gic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002975 .timer = &msm_timer,
2976 .init_machine = msm8960_cdp_init,
2977 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07002978 .init_very_early = msm8960_early_memory,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002979MACHINE_END
2980
2981MACHINE_START(MSM8960_MTP, "QCT MSM8960 MTP")
2982 .map_io = msm8960_map_io,
2983 .reserve = msm8960_reserve,
2984 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302985 .handle_irq = gic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002986 .timer = &msm_timer,
2987 .init_machine = msm8960_cdp_init,
2988 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07002989 .init_very_early = msm8960_early_memory,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002990MACHINE_END
2991
2992MACHINE_START(MSM8960_FLUID, "QCT MSM8960 FLUID")
2993 .map_io = msm8960_map_io,
2994 .reserve = msm8960_reserve,
2995 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302996 .handle_irq = gic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002997 .timer = &msm_timer,
2998 .init_machine = msm8960_cdp_init,
2999 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07003000 .init_very_early = msm8960_early_memory,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003001MACHINE_END
Amir Samuelov0d1f8ae2011-07-28 11:13:58 +03003002
3003MACHINE_START(MSM8960_LIQUID, "QCT MSM8960 LIQUID")
3004 .map_io = msm8960_map_io,
3005 .reserve = msm8960_reserve,
3006 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05303007 .handle_irq = gic_handle_irq,
Amir Samuelov0d1f8ae2011-07-28 11:13:58 +03003008 .timer = &msm_timer,
3009 .init_machine = msm8960_cdp_init,
3010 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07003011 .init_very_early = msm8960_early_memory,
Amir Samuelov0d1f8ae2011-07-28 11:13:58 +03003012MACHINE_END