blob: 1f5990943ef351f2723da0f94a96f51f724c149a [file] [log] [blame]
Manu Gautam5143b252012-01-05 19:25:23 -08001/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13#include <linux/kernel.h>
Niranjana Vishwanathapurac1edd402012-06-28 15:32:50 -060014#include <linux/bitops.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070015#include <linux/platform_device.h>
Steve Mucklef132c6c2012-06-06 18:30:57 -070016#include <linux/gpio.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070017#include <linux/io.h>
18#include <linux/irq.h>
Kenneth Heitke748593a2011-07-15 15:45:11 -060019#include <linux/i2c.h>
David Keitel2f613d92012-02-15 11:29:16 -080020#include <linux/i2c/smb349.h>
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -080021#include <linux/i2c/sx150x.h>
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -060022#include <linux/slimbus/slimbus.h>
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +053023#include <linux/mfd/wcd9xxx/core.h>
24#include <linux/mfd/wcd9xxx/pdata.h>
Amy Maloche70090f992012-02-16 16:35:26 -080025#include <linux/mfd/pm8xxx/misc.h>
Kenneth Heitke36920d32011-07-20 16:44:30 -060026#include <linux/msm_ssbi.h>
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -070027#include <linux/spi/spi.h>
Ramesh Masavarapu28311912011-10-27 11:04:12 -070028#include <linux/dma-mapping.h>
29#include <linux/platform_data/qcom_crypto_device.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080030#include <linux/ion.h>
Jack Cheung46bfffa2012-01-19 15:26:24 -080031#include <linux/memory.h>
Larry Bassel67b921d2012-04-06 10:23:27 -070032#include <linux/memblock.h>
Praveen Chidambaram877d7a42012-06-05 14:33:20 -060033#include <linux/msm_thermal.h>
Jing Lin21ed4de2012-02-05 15:53:28 -080034#include <linux/i2c/atmel_mxt_ts.h>
Steve Mucklef132c6c2012-06-06 18:30:57 -070035#include <linux/cyttsp-qc.h>
Amy Maloche70090f992012-02-16 16:35:26 -080036#include <linux/i2c/isa1200.h>
Mohan Pallaka474b94b2012-01-25 12:59:58 +053037#include <linux/gpio_keys.h>
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -080038#include <linux/epm_adc.h>
Jay Chokshie7d8d4f2012-04-04 14:47:57 -070039#include <linux/i2c/sx150x.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070040#include <asm/mach-types.h>
41#include <asm/mach/arch.h>
42#include <asm/hardware/gic.h>
Sahitya Tummala3586ed92011-08-03 09:13:23 +053043#include <asm/mach/mmc.h>
Ankit Verma6b7e2ba2012-01-26 15:48:54 -080044#include <linux/platform_data/qcom_wcnss_device.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070045
46#include <mach/board.h>
47#include <mach/msm_iomap.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080048#include <mach/ion.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070049#include <linux/usb/msm_hsusb.h>
50#include <linux/usb/android.h>
51#include <mach/socinfo.h>
Harini Jayaramanc4c58692011-07-19 14:50:10 -060052#include <mach/msm_spi.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070053#include "timer.h"
54#include "devices.h"
Joel King4ebccc62011-07-22 09:43:22 -070055#include <mach/gpiomux.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060056#include <mach/rpm.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080057#ifdef CONFIG_ANDROID_PMEM
Kevin Chan13be4e22011-10-20 11:30:32 -070058#include <linux/android_pmem.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080059#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070060#include <mach/msm_memtypes.h>
61#include <linux/bootmem.h>
62#include <asm/setup.h>
Ramesh Masavarapu28311912011-10-27 11:04:12 -070063#include <mach/dma.h>
Jin Hongd3024e62012-02-09 16:13:32 -080064#include <mach/msm_dsps.h>
Gagan Mac8a7a5d32011-11-11 16:43:06 -070065#include <mach/msm_bus_board.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060066#include <mach/cpuidle.h>
Joel Kingdacbc822012-01-25 13:30:57 -080067#include <mach/mdm2.h>
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -080068#include <linux/msm_tsens.h>
Stephen Boyd4d0d2582012-02-10 14:49:40 -080069#include <mach/msm_xo.h>
Laura Abbott350c8362012-02-28 14:46:52 -080070#include <mach/msm_rtb.h>
Santosh Mardieff9a742012-04-09 23:23:39 +053071#include <sound/cs8427.h>
Ravi Kumar V05931a22012-04-04 17:09:37 +053072#include <media/gpio-ir-recv.h>
Larry Bassel67b921d2012-04-06 10:23:27 -070073#include <linux/fmem.h>
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -060074#include <mach/msm_pcie.h>
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -070075#include <mach/restart.h>
Niranjana Vishwanathapurac1edd402012-06-28 15:32:50 -060076#include <mach/msm_iomap.h>
Joel King4ebccc62011-07-22 09:43:22 -070077
Jeff Ohlstein7e668552011-10-06 16:17:25 -070078#include "msm_watchdog.h"
Stepan Moskovchenko5a83dba2011-12-05 17:30:17 -080079#include "board-8064.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060080#include "spm.h"
Subhash Jadavani909e04f2012-04-12 10:52:50 +053081#include <mach/mpm.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060082#include "rpm_resources.h"
Matt Wagantall7cca4642012-02-01 16:43:24 -080083#include "pm.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060084#include "pm-boot.h"
Rajesh Sastrulaaee8af32012-01-20 11:46:31 -080085#include "devices-msm8x60.h"
Hanumant Singh50440d42012-04-23 19:27:16 -070086#include "smd_private.h"
Jay Chokshiea67c622011-07-29 17:12:26 -070087
Olav Haugan7c6aa742012-01-16 16:47:37 -080088#define MSM_PMEM_ADSP_SIZE 0x7800000
Bharath Ramachandramurthy2fd017a2012-03-13 10:21:09 -070089#define MSM_PMEM_AUDIO_SIZE 0x4CF000
Olav Haugan7c6aa742012-01-16 16:47:37 -080090#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
91#define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
92#else
Chetan Kalyan72aac4f2012-02-23 14:56:54 -080093#define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
Olav Haugan7c6aa742012-01-16 16:47:37 -080094#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070095
Olav Haugan7c6aa742012-01-16 16:47:37 -080096#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Hanumant Singheadb7502012-05-15 18:14:04 -070097#define HOLE_SIZE 0x20000
Bharath Ramachandramurthy2fd017a2012-03-13 10:21:09 -070098#define MSM_PMEM_KERNEL_EBI1_SIZE 0x65000
Olav Haugan129992c2012-03-22 09:54:01 -070099#ifdef CONFIG_MSM_IOMMU
100#define MSM_ION_MM_SIZE 0x3800000
101#define MSM_ION_SF_SIZE 0
Olav Haugan39477bb2012-05-14 16:05:36 -0700102#define MSM_ION_QSECOM_SIZE 0x780000 /* (7.5MB) */
Olav Haugan129992c2012-03-22 09:54:01 -0700103#define MSM_ION_HEAP_NUM 7
104#else
Olav Haugan7c6aa742012-01-16 16:47:37 -0800105#define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE
Olav Haugan129992c2012-03-22 09:54:01 -0700106#define MSM_ION_SF_SIZE MSM_PMEM_SIZE
Olav Haugan39477bb2012-05-14 16:05:36 -0700107#define MSM_ION_QSECOM_SIZE 0x600000 /* (6MB) */
Olav Haugan129992c2012-03-22 09:54:01 -0700108#define MSM_ION_HEAP_NUM 8
109#endif
Hanumant Singheadb7502012-05-15 18:14:04 -0700110#define MSM_ION_MM_FW_SIZE (0x200000 - HOLE_SIZE) /* (2MB - 128KB) */
Olav Haugan7c6aa742012-01-16 16:47:37 -0800111#define MSM_ION_MFC_SIZE SZ_8K
Olav Haugan2c43fac2012-01-19 11:06:37 -0800112#define MSM_ION_AUDIO_SIZE MSM_PMEM_AUDIO_SIZE
Olav Haugan7c6aa742012-01-16 16:47:37 -0800113#else
114#define MSM_PMEM_KERNEL_EBI1_SIZE 0x110C000
115#define MSM_ION_HEAP_NUM 1
116#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700117
Hanumant Singheadb7502012-05-15 18:14:04 -0700118#define APQ8064_FIXED_AREA_START (0xa0000000 - (MSM_ION_MM_FW_SIZE + \
119 HOLE_SIZE))
Larry Bassel67b921d2012-04-06 10:23:27 -0700120#define MAX_FIXED_AREA_SIZE 0x10000000
Hanumant Singheadb7502012-05-15 18:14:04 -0700121#define MSM_MM_FW_SIZE (0x200000 - HOLE_SIZE)
122#define APQ8064_FW_START APQ8064_FIXED_AREA_START
Larry Bassel67b921d2012-04-06 10:23:27 -0700123
Niranjana Vishwanathapurac1edd402012-06-28 15:32:50 -0600124#define QFPROM_RAW_FEAT_CONFIG_ROW0_MSB (MSM_QFPROM_BASE + 0x23c)
125#define QFPROM_RAW_OEM_CONFIG_ROW0_LSB (MSM_QFPROM_BASE + 0x220)
126
Niranjana Vishwanathapura68210ff2012-06-24 18:03:49 -0600127/* PCIE AXI address space */
128#define PCIE_AXI_BAR_PHYS 0x08000000
129#define PCIE_AXI_BAR_SIZE SZ_128M
130
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -0600131/* PCIe power enable pmic gpio */
132#define PCIE_PWR_EN_PMIC_GPIO 13
133#define PCIE_RST_N_PMIC_MPP 1
134
Olav Haugan7c6aa742012-01-16 16:47:37 -0800135#ifdef CONFIG_KERNEL_PMEM_EBI_REGION
136static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE;
137static int __init pmem_kernel_ebi1_size_setup(char *p)
Kevin Chan13be4e22011-10-20 11:30:32 -0700138{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800139 pmem_kernel_ebi1_size = memparse(p, NULL);
140 return 0;
Kevin Chan13be4e22011-10-20 11:30:32 -0700141}
Olav Haugan7c6aa742012-01-16 16:47:37 -0800142early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup);
143#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700144
Olav Haugan7c6aa742012-01-16 16:47:37 -0800145#ifdef CONFIG_ANDROID_PMEM
Kevin Chan13be4e22011-10-20 11:30:32 -0700146static unsigned pmem_size = MSM_PMEM_SIZE;
147static int __init pmem_size_setup(char *p)
148{
149 pmem_size = memparse(p, NULL);
150 return 0;
151}
152early_param("pmem_size", pmem_size_setup);
153
154static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
155
156static int __init pmem_adsp_size_setup(char *p)
157{
158 pmem_adsp_size = memparse(p, NULL);
159 return 0;
160}
161early_param("pmem_adsp_size", pmem_adsp_size_setup);
162
163static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
164
165static int __init pmem_audio_size_setup(char *p)
166{
167 pmem_audio_size = memparse(p, NULL);
168 return 0;
169}
170early_param("pmem_audio_size", pmem_audio_size_setup);
Olav Haugan7c6aa742012-01-16 16:47:37 -0800171#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700172
Olav Haugan7c6aa742012-01-16 16:47:37 -0800173#ifdef CONFIG_ANDROID_PMEM
174#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700175static struct android_pmem_platform_data android_pmem_pdata = {
176 .name = "pmem",
177 .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING,
178 .cached = 1,
179 .memory_type = MEMTYPE_EBI1,
180};
181
Laura Abbottb93525f2012-04-12 09:57:19 -0700182static struct platform_device apq8064_android_pmem_device = {
Kevin Chan13be4e22011-10-20 11:30:32 -0700183 .name = "android_pmem",
184 .id = 0,
185 .dev = {.platform_data = &android_pmem_pdata},
186};
187
188static struct android_pmem_platform_data android_pmem_adsp_pdata = {
189 .name = "pmem_adsp",
190 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
191 .cached = 0,
192 .memory_type = MEMTYPE_EBI1,
193};
Laura Abbottb93525f2012-04-12 09:57:19 -0700194static struct platform_device apq8064_android_pmem_adsp_device = {
Kevin Chan13be4e22011-10-20 11:30:32 -0700195 .name = "android_pmem",
196 .id = 2,
197 .dev = { .platform_data = &android_pmem_adsp_pdata },
198};
199
200static struct android_pmem_platform_data android_pmem_audio_pdata = {
201 .name = "pmem_audio",
202 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
203 .cached = 0,
204 .memory_type = MEMTYPE_EBI1,
205};
206
Laura Abbottb93525f2012-04-12 09:57:19 -0700207static struct platform_device apq8064_android_pmem_audio_device = {
Kevin Chan13be4e22011-10-20 11:30:32 -0700208 .name = "android_pmem",
209 .id = 4,
210 .dev = { .platform_data = &android_pmem_audio_pdata },
211};
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700212#endif /* CONFIG_MSM_MULTIMEDIA_USE_ION */
213#endif /* CONFIG_ANDROID_PMEM */
Olav Haugan7c6aa742012-01-16 16:47:37 -0800214
Larry Bassel67b921d2012-04-06 10:23:27 -0700215struct fmem_platform_data apq8064_fmem_pdata = {
216};
217
Olav Haugan7c6aa742012-01-16 16:47:37 -0800218static struct memtype_reserve apq8064_reserve_table[] __initdata = {
219 [MEMTYPE_SMI] = {
220 },
221 [MEMTYPE_EBI0] = {
222 .flags = MEMTYPE_FLAGS_1M_ALIGN,
223 },
224 [MEMTYPE_EBI1] = {
225 .flags = MEMTYPE_FLAGS_1M_ALIGN,
226 },
227};
Kevin Chan13be4e22011-10-20 11:30:32 -0700228
Laura Abbott350c8362012-02-28 14:46:52 -0800229static void __init reserve_rtb_memory(void)
230{
231#if defined(CONFIG_MSM_RTB)
Laura Abbottb93525f2012-04-12 09:57:19 -0700232 apq8064_reserve_table[MEMTYPE_EBI1].size += apq8064_rtb_pdata.size;
Laura Abbott350c8362012-02-28 14:46:52 -0800233#endif
234}
235
236
Kevin Chan13be4e22011-10-20 11:30:32 -0700237static void __init size_pmem_devices(void)
238{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800239#ifdef CONFIG_ANDROID_PMEM
240#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700241 android_pmem_adsp_pdata.size = pmem_adsp_size;
242 android_pmem_pdata.size = pmem_size;
243 android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE;
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700244#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
245#endif /*CONFIG_ANDROID_PMEM*/
Kevin Chan13be4e22011-10-20 11:30:32 -0700246}
247
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700248#ifdef CONFIG_ANDROID_PMEM
249#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700250static void __init reserve_memory_for(struct android_pmem_platform_data *p)
251{
252 apq8064_reserve_table[p->memory_type].size += p->size;
253}
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700254#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
255#endif /*CONFIG_ANDROID_PMEM*/
Kevin Chan13be4e22011-10-20 11:30:32 -0700256
Kevin Chan13be4e22011-10-20 11:30:32 -0700257static void __init reserve_pmem_memory(void)
258{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800259#ifdef CONFIG_ANDROID_PMEM
260#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700261 reserve_memory_for(&android_pmem_adsp_pdata);
262 reserve_memory_for(&android_pmem_pdata);
263 reserve_memory_for(&android_pmem_audio_pdata);
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700264#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
Kevin Chan13be4e22011-10-20 11:30:32 -0700265 apq8064_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size;
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700266#endif /*CONFIG_ANDROID_PMEM*/
Olav Haugan7c6aa742012-01-16 16:47:37 -0800267}
268
269static int apq8064_paddr_to_memtype(unsigned int paddr)
270{
271 return MEMTYPE_EBI1;
272}
273
Steve Mucklef132c6c2012-06-06 18:30:57 -0700274#define FMEM_ENABLED 0
Larry Bassel67b921d2012-04-06 10:23:27 -0700275
Olav Haugan7c6aa742012-01-16 16:47:37 -0800276#ifdef CONFIG_ION_MSM
277#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Laura Abbottb93525f2012-04-12 09:57:19 -0700278static struct ion_cp_heap_pdata cp_mm_apq8064_ion_pdata = {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800279 .permission_type = IPT_TYPE_MM_CARVEOUT,
Olav Haugand3d29682012-01-19 10:57:07 -0800280 .align = PAGE_SIZE,
Larry Bassel67b921d2012-04-06 10:23:27 -0700281 .reusable = FMEM_ENABLED,
282 .mem_is_fmem = FMEM_ENABLED,
283 .fixed_position = FIXED_MIDDLE,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800284};
285
Laura Abbottb93525f2012-04-12 09:57:19 -0700286static struct ion_cp_heap_pdata cp_mfc_apq8064_ion_pdata = {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800287 .permission_type = IPT_TYPE_MFC_SHAREDMEM,
Olav Haugand3d29682012-01-19 10:57:07 -0800288 .align = PAGE_SIZE,
Larry Bassel67b921d2012-04-06 10:23:27 -0700289 .reusable = 0,
290 .mem_is_fmem = FMEM_ENABLED,
291 .fixed_position = FIXED_HIGH,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800292};
293
Laura Abbottb93525f2012-04-12 09:57:19 -0700294static struct ion_co_heap_pdata co_apq8064_ion_pdata = {
Olav Haugand3d29682012-01-19 10:57:07 -0800295 .adjacent_mem_id = INVALID_HEAP_ID,
296 .align = PAGE_SIZE,
Larry Bassel67b921d2012-04-06 10:23:27 -0700297 .mem_is_fmem = 0,
Olav Haugand3d29682012-01-19 10:57:07 -0800298};
299
Laura Abbottb93525f2012-04-12 09:57:19 -0700300static struct ion_co_heap_pdata fw_co_apq8064_ion_pdata = {
Olav Haugand3d29682012-01-19 10:57:07 -0800301 .adjacent_mem_id = ION_CP_MM_HEAP_ID,
302 .align = SZ_128K,
Larry Bassel67b921d2012-04-06 10:23:27 -0700303 .mem_is_fmem = FMEM_ENABLED,
304 .fixed_position = FIXED_LOW,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800305};
306#endif
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800307
308/**
309 * These heaps are listed in the order they will be allocated. Due to
310 * video hardware restrictions and content protection the FW heap has to
311 * be allocated adjacent (below) the MM heap and the MFC heap has to be
312 * allocated after the MM heap to ensure MFC heap is not more than 256MB
313 * away from the base address of the FW heap.
314 * However, the order of FW heap and MM heap doesn't matter since these
315 * two heaps are taken care of by separate code to ensure they are adjacent
316 * to each other.
317 * Don't swap the order unless you know what you are doing!
318 */
Laura Abbottb93525f2012-04-12 09:57:19 -0700319static struct ion_platform_data apq8064_ion_pdata = {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800320 .nr = MSM_ION_HEAP_NUM,
321 .heaps = {
322 {
323 .id = ION_SYSTEM_HEAP_ID,
324 .type = ION_HEAP_TYPE_SYSTEM,
325 .name = ION_VMALLOC_HEAP_NAME,
326 },
327#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
328 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800329 .id = ION_CP_MM_HEAP_ID,
330 .type = ION_HEAP_TYPE_CP,
331 .name = ION_MM_HEAP_NAME,
332 .size = MSM_ION_MM_SIZE,
333 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700334 .extra_data = (void *) &cp_mm_apq8064_ion_pdata,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800335 },
336 {
Olav Haugand3d29682012-01-19 10:57:07 -0800337 .id = ION_MM_FIRMWARE_HEAP_ID,
338 .type = ION_HEAP_TYPE_CARVEOUT,
339 .name = ION_MM_FIRMWARE_HEAP_NAME,
340 .size = MSM_ION_MM_FW_SIZE,
341 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700342 .extra_data = (void *) &fw_co_apq8064_ion_pdata,
Olav Haugand3d29682012-01-19 10:57:07 -0800343 },
344 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800345 .id = ION_CP_MFC_HEAP_ID,
346 .type = ION_HEAP_TYPE_CP,
347 .name = ION_MFC_HEAP_NAME,
348 .size = MSM_ION_MFC_SIZE,
349 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700350 .extra_data = (void *) &cp_mfc_apq8064_ion_pdata,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800351 },
Olav Haugan129992c2012-03-22 09:54:01 -0700352#ifndef CONFIG_MSM_IOMMU
Olav Haugan7c6aa742012-01-16 16:47:37 -0800353 {
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800354 .id = ION_SF_HEAP_ID,
355 .type = ION_HEAP_TYPE_CARVEOUT,
356 .name = ION_SF_HEAP_NAME,
357 .size = MSM_ION_SF_SIZE,
358 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700359 .extra_data = (void *) &co_apq8064_ion_pdata,
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800360 },
Olav Haugan129992c2012-03-22 09:54:01 -0700361#endif
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800362 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800363 .id = ION_IOMMU_HEAP_ID,
364 .type = ION_HEAP_TYPE_IOMMU,
365 .name = ION_IOMMU_HEAP_NAME,
366 },
Olav Hauganf45e2142012-01-19 11:01:01 -0800367 {
368 .id = ION_QSECOM_HEAP_ID,
369 .type = ION_HEAP_TYPE_CARVEOUT,
370 .name = ION_QSECOM_HEAP_NAME,
371 .size = MSM_ION_QSECOM_SIZE,
372 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700373 .extra_data = (void *) &co_apq8064_ion_pdata,
Olav Hauganf45e2142012-01-19 11:01:01 -0800374 },
Olav Haugan2c43fac2012-01-19 11:06:37 -0800375 {
376 .id = ION_AUDIO_HEAP_ID,
377 .type = ION_HEAP_TYPE_CARVEOUT,
378 .name = ION_AUDIO_HEAP_NAME,
379 .size = MSM_ION_AUDIO_SIZE,
380 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700381 .extra_data = (void *) &co_apq8064_ion_pdata,
Olav Haugan2c43fac2012-01-19 11:06:37 -0800382 },
Olav Haugan7c6aa742012-01-16 16:47:37 -0800383#endif
384 }
385};
386
Laura Abbottb93525f2012-04-12 09:57:19 -0700387static struct platform_device apq8064_ion_dev = {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800388 .name = "ion-msm",
389 .id = 1,
Laura Abbottb93525f2012-04-12 09:57:19 -0700390 .dev = { .platform_data = &apq8064_ion_pdata },
Olav Haugan7c6aa742012-01-16 16:47:37 -0800391};
392#endif
393
Larry Bassel67b921d2012-04-06 10:23:27 -0700394static struct platform_device apq8064_fmem_device = {
395 .name = "fmem",
396 .id = 1,
397 .dev = { .platform_data = &apq8064_fmem_pdata },
398};
399
400static void __init reserve_mem_for_ion(enum ion_memory_types mem_type,
401 unsigned long size)
402{
403 apq8064_reserve_table[mem_type].size += size;
404}
405
406static void __init apq8064_reserve_fixed_area(unsigned long fixed_area_size)
407{
408#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
409 int ret;
410
411 if (fixed_area_size > MAX_FIXED_AREA_SIZE)
412 panic("fixed area size is larger than %dM\n",
413 MAX_FIXED_AREA_SIZE >> 20);
414
415 reserve_info->fixed_area_size = fixed_area_size;
416 reserve_info->fixed_area_start = APQ8064_FW_START;
417
418 ret = memblock_remove(reserve_info->fixed_area_start,
419 reserve_info->fixed_area_size);
420 BUG_ON(ret);
421#endif
422}
423
424/**
425 * Reserve memory for ION and calculate amount of reusable memory for fmem.
426 * We only reserve memory for heaps that are not reusable. However, we only
427 * support one reusable heap at the moment so we ignore the reusable flag for
428 * other than the first heap with reusable flag set. Also handle special case
429 * for video heaps (MM,FW, and MFC). Video requires heaps MM and MFC to be
430 * at a higher address than FW in addition to not more than 256MB away from the
431 * base address of the firmware. This means that if MM is reusable the other
432 * two heaps must be allocated in the same region as FW. This is handled by the
433 * mem_is_fmem flag in the platform data. In addition the MM heap must be
434 * adjacent to the FW heap for content protection purposes.
435 */
Stephen Boyd668d7652012-04-25 11:31:01 -0700436static void __init reserve_ion_memory(void)
Olav Haugan7c6aa742012-01-16 16:47:37 -0800437{
438#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
Larry Bassel67b921d2012-04-06 10:23:27 -0700439 unsigned int i;
440 unsigned int reusable_count = 0;
441 unsigned int fixed_size = 0;
442 unsigned int fixed_low_size, fixed_middle_size, fixed_high_size;
443 unsigned long fixed_low_start, fixed_middle_start, fixed_high_start;
444
445 apq8064_fmem_pdata.size = 0;
446 apq8064_fmem_pdata.reserved_size_low = 0;
447 apq8064_fmem_pdata.reserved_size_high = 0;
Olav Haugan62436252012-05-16 09:09:43 -0700448 apq8064_fmem_pdata.align = PAGE_SIZE;
Larry Bassel67b921d2012-04-06 10:23:27 -0700449 fixed_low_size = 0;
450 fixed_middle_size = 0;
451 fixed_high_size = 0;
452
453 /* We only support 1 reusable heap. Check if more than one heap
454 * is specified as reusable and set as non-reusable if found.
455 */
456 for (i = 0; i < apq8064_ion_pdata.nr; ++i) {
457 const struct ion_platform_heap *heap =
458 &(apq8064_ion_pdata.heaps[i]);
459
460 if (heap->type == ION_HEAP_TYPE_CP && heap->extra_data) {
461 struct ion_cp_heap_pdata *data = heap->extra_data;
462
463 reusable_count += (data->reusable) ? 1 : 0;
464
465 if (data->reusable && reusable_count > 1) {
466 pr_err("%s: Too many heaps specified as "
467 "reusable. Heap %s was not configured "
468 "as reusable.\n", __func__, heap->name);
469 data->reusable = 0;
470 }
471 }
472 }
473
474 for (i = 0; i < apq8064_ion_pdata.nr; ++i) {
475 const struct ion_platform_heap *heap =
476 &(apq8064_ion_pdata.heaps[i]);
477
478 if (heap->extra_data) {
479 int fixed_position = NOT_FIXED;
480 int mem_is_fmem = 0;
481
482 switch (heap->type) {
483 case ION_HEAP_TYPE_CP:
484 mem_is_fmem = ((struct ion_cp_heap_pdata *)
485 heap->extra_data)->mem_is_fmem;
486 fixed_position = ((struct ion_cp_heap_pdata *)
487 heap->extra_data)->fixed_position;
488 break;
489 case ION_HEAP_TYPE_CARVEOUT:
490 mem_is_fmem = ((struct ion_co_heap_pdata *)
491 heap->extra_data)->mem_is_fmem;
492 fixed_position = ((struct ion_co_heap_pdata *)
493 heap->extra_data)->fixed_position;
494 break;
495 default:
496 break;
497 }
498
499 if (fixed_position != NOT_FIXED)
500 fixed_size += heap->size;
501 else
502 reserve_mem_for_ion(MEMTYPE_EBI1, heap->size);
503
504 if (fixed_position == FIXED_LOW)
505 fixed_low_size += heap->size;
506 else if (fixed_position == FIXED_MIDDLE)
507 fixed_middle_size += heap->size;
508 else if (fixed_position == FIXED_HIGH)
509 fixed_high_size += heap->size;
510
511 if (mem_is_fmem)
512 apq8064_fmem_pdata.size += heap->size;
513 }
514 }
515
516 if (!fixed_size)
517 return;
518
519 if (apq8064_fmem_pdata.size) {
Hanumant Singheadb7502012-05-15 18:14:04 -0700520 apq8064_fmem_pdata.reserved_size_low = fixed_low_size +
521 HOLE_SIZE;
Larry Bassel67b921d2012-04-06 10:23:27 -0700522 apq8064_fmem_pdata.reserved_size_high = fixed_high_size;
523 }
524
525 /* Since the fixed area may be carved out of lowmem,
526 * make sure the length is a multiple of 1M.
527 */
Hanumant Singheadb7502012-05-15 18:14:04 -0700528 fixed_size = (fixed_size + HOLE_SIZE + SECTION_SIZE - 1)
Larry Bassel67b921d2012-04-06 10:23:27 -0700529 & SECTION_MASK;
530 apq8064_reserve_fixed_area(fixed_size);
531
532 fixed_low_start = APQ8064_FIXED_AREA_START;
Hanumant Singheadb7502012-05-15 18:14:04 -0700533 fixed_middle_start = fixed_low_start + fixed_low_size + HOLE_SIZE;
Larry Bassel67b921d2012-04-06 10:23:27 -0700534 fixed_high_start = fixed_middle_start + fixed_middle_size;
535
536 for (i = 0; i < apq8064_ion_pdata.nr; ++i) {
537 struct ion_platform_heap *heap = &(apq8064_ion_pdata.heaps[i]);
538
539 if (heap->extra_data) {
540 int fixed_position = NOT_FIXED;
Steve Mucklef132c6c2012-06-06 18:30:57 -0700541 struct ion_cp_heap_pdata *pdata = NULL;
Larry Bassel67b921d2012-04-06 10:23:27 -0700542
543 switch (heap->type) {
544 case ION_HEAP_TYPE_CP:
Hanumant Singheadb7502012-05-15 18:14:04 -0700545 pdata =
546 (struct ion_cp_heap_pdata *)heap->extra_data;
547 fixed_position = pdata->fixed_position;
Larry Bassel67b921d2012-04-06 10:23:27 -0700548 break;
549 case ION_HEAP_TYPE_CARVEOUT:
550 fixed_position = ((struct ion_co_heap_pdata *)
551 heap->extra_data)->fixed_position;
552 break;
553 default:
554 break;
555 }
556
557 switch (fixed_position) {
558 case FIXED_LOW:
559 heap->base = fixed_low_start;
560 break;
561 case FIXED_MIDDLE:
562 heap->base = fixed_middle_start;
Hanumant Singheadb7502012-05-15 18:14:04 -0700563 pdata->secure_base = fixed_middle_start
564 - HOLE_SIZE;
565 pdata->secure_size = HOLE_SIZE + heap->size;
Larry Bassel67b921d2012-04-06 10:23:27 -0700566 break;
567 case FIXED_HIGH:
568 heap->base = fixed_high_start;
569 break;
570 default:
571 break;
572 }
573 }
574 }
Olav Haugan7c6aa742012-01-16 16:47:37 -0800575#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700576}
577
Huaibin Yang4a084e32011-12-15 15:25:52 -0800578static void __init reserve_mdp_memory(void)
579{
580 apq8064_mdp_writeback(apq8064_reserve_table);
581}
582
Laura Abbott93a4a352012-05-25 09:26:35 -0700583static void __init reserve_cache_dump_memory(void)
584{
585#ifdef CONFIG_MSM_CACHE_DUMP
586 unsigned int total;
587
588 total = apq8064_cache_dump_pdata.l1_size +
589 apq8064_cache_dump_pdata.l2_size;
590 apq8064_reserve_table[MEMTYPE_EBI1].size += total;
591#endif
592}
593
Kevin Chan13be4e22011-10-20 11:30:32 -0700594static void __init apq8064_calculate_reserve_sizes(void)
595{
596 size_pmem_devices();
597 reserve_pmem_memory();
Olav Haugan7c6aa742012-01-16 16:47:37 -0800598 reserve_ion_memory();
Huaibin Yang4a084e32011-12-15 15:25:52 -0800599 reserve_mdp_memory();
Laura Abbott350c8362012-02-28 14:46:52 -0800600 reserve_rtb_memory();
Laura Abbott93a4a352012-05-25 09:26:35 -0700601 reserve_cache_dump_memory();
Kevin Chan13be4e22011-10-20 11:30:32 -0700602}
603
604static struct reserve_info apq8064_reserve_info __initdata = {
605 .memtype_reserve_table = apq8064_reserve_table,
606 .calculate_reserve_sizes = apq8064_calculate_reserve_sizes,
Larry Bassel67b921d2012-04-06 10:23:27 -0700607 .reserve_fixed_area = apq8064_reserve_fixed_area,
Kevin Chan13be4e22011-10-20 11:30:32 -0700608 .paddr_to_memtype = apq8064_paddr_to_memtype,
609};
610
611static int apq8064_memory_bank_size(void)
612{
613 return 1<<29;
614}
615
616static void __init locate_unstable_memory(void)
617{
618 struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1];
619 unsigned long bank_size;
620 unsigned long low, high;
621
622 bank_size = apq8064_memory_bank_size();
623 low = meminfo.bank[0].start;
624 high = mb->start + mb->size;
Olav Haugand76e3a82012-01-16 16:55:07 -0800625
626 /* Check if 32 bit overflow occured */
627 if (high < mb->start)
Larry Bassel67b921d2012-04-06 10:23:27 -0700628 high = -PAGE_SIZE;
Olav Haugand76e3a82012-01-16 16:55:07 -0800629
Kevin Chan13be4e22011-10-20 11:30:32 -0700630 low &= ~(bank_size - 1);
631
632 if (high - low <= bank_size)
Larry Bassel67b921d2012-04-06 10:23:27 -0700633 goto no_dmm;
634
635#ifdef CONFIG_ENABLE_DMM
Jack Cheung46bfffa2012-01-19 15:26:24 -0800636 apq8064_reserve_info.low_unstable_address = mb->start -
637 MIN_MEMORY_BLOCK_SIZE + mb->size;
638 apq8064_reserve_info.max_unstable_size = MIN_MEMORY_BLOCK_SIZE;
639
Kevin Chan13be4e22011-10-20 11:30:32 -0700640 apq8064_reserve_info.bank_size = bank_size;
641 pr_info("low unstable address %lx max size %lx bank size %lx\n",
642 apq8064_reserve_info.low_unstable_address,
643 apq8064_reserve_info.max_unstable_size,
644 apq8064_reserve_info.bank_size);
Larry Bassel67b921d2012-04-06 10:23:27 -0700645 return;
646#endif
647no_dmm:
648 apq8064_reserve_info.low_unstable_address = high;
649 apq8064_reserve_info.max_unstable_size = 0;
Kevin Chan13be4e22011-10-20 11:30:32 -0700650}
651
Hanumant Singh50440d42012-04-23 19:27:16 -0700652static int apq8064_change_memory_power(u64 start, u64 size,
653 int change_type)
654{
655 return soc_change_memory_power(start, size, change_type);
656}
657
Aravind Venkateswaran8ac7f412012-03-16 17:57:30 -0700658static char prim_panel_name[PANEL_NAME_MAX_LEN];
659static char ext_panel_name[PANEL_NAME_MAX_LEN];
Ajay Singh Parmar6b82d2b2012-07-19 17:23:26 +0530660
661static int ext_resolution;
662
Aravind Venkateswaran8ac7f412012-03-16 17:57:30 -0700663static int __init prim_display_setup(char *param)
664{
665 if (strnlen(param, PANEL_NAME_MAX_LEN))
666 strlcpy(prim_panel_name, param, PANEL_NAME_MAX_LEN);
667 return 0;
668}
669early_param("prim_display", prim_display_setup);
670
671static int __init ext_display_setup(char *param)
672{
673 if (strnlen(param, PANEL_NAME_MAX_LEN))
674 strlcpy(ext_panel_name, param, PANEL_NAME_MAX_LEN);
675 return 0;
676}
677early_param("ext_display", ext_display_setup);
678
Ajay Singh Parmar6b82d2b2012-07-19 17:23:26 +0530679static int __init hdmi_resulution_setup(char *param)
680{
681 int ret;
682 ret = kstrtoint(param, 10, &ext_resolution);
683 return ret;
684}
685early_param("ext_resolution", hdmi_resulution_setup);
686
Kevin Chan13be4e22011-10-20 11:30:32 -0700687static void __init apq8064_reserve(void)
688{
Ajay Singh Parmar6b82d2b2012-07-19 17:23:26 +0530689 apq8064_set_display_params(prim_panel_name, ext_panel_name,
690 ext_resolution);
Kevin Chan13be4e22011-10-20 11:30:32 -0700691 msm_reserve();
Larry Bassel67b921d2012-04-06 10:23:27 -0700692 if (apq8064_fmem_pdata.size) {
693#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
694 if (reserve_info->fixed_area_size) {
695 apq8064_fmem_pdata.phys =
696 reserve_info->fixed_area_start + MSM_MM_FW_SIZE;
697 pr_info("mm fw at %lx (fixed) size %x\n",
698 reserve_info->fixed_area_start, MSM_MM_FW_SIZE);
699 pr_info("fmem start %lx (fixed) size %lx\n",
700 apq8064_fmem_pdata.phys,
701 apq8064_fmem_pdata.size);
702 }
703#endif
704 }
Kevin Chan13be4e22011-10-20 11:30:32 -0700705}
706
Laura Abbott6988cef2012-03-15 14:27:13 -0700707static void __init place_movable_zone(void)
708{
Larry Bassel67b921d2012-04-06 10:23:27 -0700709#ifdef CONFIG_ENABLE_DMM
Laura Abbott6988cef2012-03-15 14:27:13 -0700710 movable_reserved_start = apq8064_reserve_info.low_unstable_address;
711 movable_reserved_size = apq8064_reserve_info.max_unstable_size;
712 pr_info("movable zone start %lx size %lx\n",
713 movable_reserved_start, movable_reserved_size);
Larry Bassel67b921d2012-04-06 10:23:27 -0700714#endif
Laura Abbott6988cef2012-03-15 14:27:13 -0700715}
716
717static void __init apq8064_early_reserve(void)
718{
719 reserve_info = &apq8064_reserve_info;
720 locate_unstable_memory();
721 place_movable_zone();
722
723}
Hemant Kumara945b472012-01-25 15:08:06 -0800724#ifdef CONFIG_USB_EHCI_MSM_HSIC
Hemant Kumare6275972012-02-29 20:06:21 -0800725/* Bandwidth requests (zero) if no vote placed */
726static struct msm_bus_vectors hsic_init_vectors[] = {
727 {
728 .src = MSM_BUS_MASTER_SPS,
729 .dst = MSM_BUS_SLAVE_EBI_CH0,
730 .ab = 0,
731 .ib = 0,
732 },
733 {
734 .src = MSM_BUS_MASTER_SPS,
735 .dst = MSM_BUS_SLAVE_SPS,
736 .ab = 0,
737 .ib = 0,
738 },
739};
740
741/* Bus bandwidth requests in Bytes/sec */
742static struct msm_bus_vectors hsic_max_vectors[] = {
743 {
744 .src = MSM_BUS_MASTER_SPS,
745 .dst = MSM_BUS_SLAVE_EBI_CH0,
746 .ab = 60000000, /* At least 480Mbps on bus. */
747 .ib = 960000000, /* MAX bursts rate */
748 },
749 {
750 .src = MSM_BUS_MASTER_SPS,
751 .dst = MSM_BUS_SLAVE_SPS,
752 .ab = 0,
753 .ib = 512000000, /*vote for 64Mhz dfab clk rate*/
754 },
755};
756
757static struct msm_bus_paths hsic_bus_scale_usecases[] = {
758 {
759 ARRAY_SIZE(hsic_init_vectors),
760 hsic_init_vectors,
761 },
762 {
763 ARRAY_SIZE(hsic_max_vectors),
764 hsic_max_vectors,
765 },
766};
767
768static struct msm_bus_scale_pdata hsic_bus_scale_pdata = {
769 hsic_bus_scale_usecases,
770 ARRAY_SIZE(hsic_bus_scale_usecases),
771 .name = "hsic",
772};
773
Hemant Kumara945b472012-01-25 15:08:06 -0800774static struct msm_hsic_host_platform_data msm_hsic_pdata = {
Hemant Kumare6275972012-02-29 20:06:21 -0800775 .strobe = 88,
776 .data = 89,
777 .bus_scale_table = &hsic_bus_scale_pdata,
Hemant Kumara945b472012-01-25 15:08:06 -0800778};
779#else
780static struct msm_hsic_host_platform_data msm_hsic_pdata;
781#endif
782
Hemant Kumarcb7d8a12012-01-25 12:25:55 -0800783#define PID_MAGIC_ID 0x71432909
784#define SERIAL_NUM_MAGIC_ID 0x61945374
785#define SERIAL_NUMBER_LENGTH 127
786#define DLOAD_USB_BASE_ADD 0x2A03F0C8
787
788struct magic_num_struct {
789 uint32_t pid;
790 uint32_t serial_num;
791};
792
793struct dload_struct {
794 uint32_t reserved1;
795 uint32_t reserved2;
796 uint32_t reserved3;
797 uint16_t reserved4;
798 uint16_t pid;
799 char serial_number[SERIAL_NUMBER_LENGTH];
800 uint16_t reserved5;
801 struct magic_num_struct magic_struct;
802};
803
804static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
805{
806 struct dload_struct __iomem *dload = 0;
807
808 dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload));
809 if (!dload) {
810 pr_err("%s: cannot remap I/O memory region: %08x\n",
811 __func__, DLOAD_USB_BASE_ADD);
812 return -ENXIO;
813 }
814
815 pr_debug("%s: dload:%p pid:%x serial_num:%s\n",
816 __func__, dload, pid, snum);
817 /* update pid */
818 dload->magic_struct.pid = PID_MAGIC_ID;
819 dload->pid = pid;
820
821 /* update serial number */
822 dload->magic_struct.serial_num = 0;
823 if (!snum) {
824 memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH);
825 goto out;
826 }
827
828 dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID;
829 strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH);
830out:
831 iounmap(dload);
832 return 0;
833}
834
835static struct android_usb_platform_data android_usb_pdata = {
836 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
837};
838
Hemant Kumar4933b072011-10-17 23:43:11 -0700839static struct platform_device android_usb_device = {
Hemant Kumarcb7d8a12012-01-25 12:25:55 -0800840 .name = "android_usb",
841 .id = -1,
842 .dev = {
843 .platform_data = &android_usb_pdata,
844 },
Hemant Kumar4933b072011-10-17 23:43:11 -0700845};
846
Hemant Kumar7620eed2012-02-26 09:08:43 -0800847/* Bandwidth requests (zero) if no vote placed */
848static struct msm_bus_vectors usb_init_vectors[] = {
849 {
850 .src = MSM_BUS_MASTER_SPS,
851 .dst = MSM_BUS_SLAVE_EBI_CH0,
852 .ab = 0,
853 .ib = 0,
854 },
855};
856
857/* Bus bandwidth requests in Bytes/sec */
858static struct msm_bus_vectors usb_max_vectors[] = {
859 {
860 .src = MSM_BUS_MASTER_SPS,
861 .dst = MSM_BUS_SLAVE_EBI_CH0,
862 .ab = 60000000, /* At least 480Mbps on bus. */
863 .ib = 960000000, /* MAX bursts rate */
864 },
865};
866
867static struct msm_bus_paths usb_bus_scale_usecases[] = {
868 {
869 ARRAY_SIZE(usb_init_vectors),
870 usb_init_vectors,
871 },
872 {
873 ARRAY_SIZE(usb_max_vectors),
874 usb_max_vectors,
875 },
876};
877
878static struct msm_bus_scale_pdata usb_bus_scale_pdata = {
879 usb_bus_scale_usecases,
880 ARRAY_SIZE(usb_bus_scale_usecases),
881 .name = "usb",
882};
883
Vamsi Krishna1f8704c2012-03-29 18:24:24 -0700884static int phy_init_seq[] = {
885 0x38, 0x81, /* update DC voltage level */
886 0x24, 0x82, /* set pre-emphasis and rise/fall time */
887 -1
888};
889
Hemant Kumar4933b072011-10-17 23:43:11 -0700890static struct msm_otg_platform_data msm_otg_pdata = {
Hemant Kumard86c4882012-01-24 19:39:37 -0800891 .mode = USB_OTG,
892 .otg_control = OTG_PMIC_CONTROL,
Hemant Kumar4933b072011-10-17 23:43:11 -0700893 .phy_type = SNPS_28NM_INTEGRATED_PHY,
Hemant Kumard86c4882012-01-24 19:39:37 -0800894 .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE),
895 .power_budget = 750,
Hemant Kumar7620eed2012-02-26 09:08:43 -0800896 .bus_scale_table = &usb_bus_scale_pdata,
Vamsi Krishna1f8704c2012-03-29 18:24:24 -0700897 .phy_init_seq = phy_init_seq,
Hemant Kumar4933b072011-10-17 23:43:11 -0700898};
899
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800900static struct msm_usb_host_platform_data msm_ehci_host_pdata3 = {
Manu Gautam91223e02011-11-08 15:27:22 +0530901 .power_budget = 500,
902};
903
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800904#ifdef CONFIG_USB_EHCI_MSM_HOST4
905static struct msm_usb_host_platform_data msm_ehci_host_pdata4;
906#endif
907
Manu Gautam91223e02011-11-08 15:27:22 +0530908static void __init apq8064_ehci_host_init(void)
909{
Chiranjeevi Velempatib822fa32012-05-23 22:05:59 +0530910 if (machine_is_apq8064_liquid() || machine_is_mpq8064_cdp() ||
911 machine_is_mpq8064_hrd() || machine_is_mpq8064_dtv()) {
912 if (machine_is_apq8064_liquid())
913 msm_ehci_host_pdata3.dock_connect_irq =
914 PM8921_MPP_IRQ(PM8921_IRQ_BASE, 9);
Hemant Kumar56925352012-02-13 16:59:52 -0800915
Manu Gautam91223e02011-11-08 15:27:22 +0530916 apq8064_device_ehci_host3.dev.platform_data =
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800917 &msm_ehci_host_pdata3;
Manu Gautam91223e02011-11-08 15:27:22 +0530918 platform_device_register(&apq8064_device_ehci_host3);
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800919
920#ifdef CONFIG_USB_EHCI_MSM_HOST4
921 apq8064_device_ehci_host4.dev.platform_data =
922 &msm_ehci_host_pdata4;
923 platform_device_register(&apq8064_device_ehci_host4);
924#endif
Manu Gautam91223e02011-11-08 15:27:22 +0530925 }
926}
927
David Keitel2f613d92012-02-15 11:29:16 -0800928static struct smb349_platform_data smb349_data __initdata = {
929 .en_n_gpio = PM8921_GPIO_PM_TO_SYS(37),
930 .chg_susp_gpio = PM8921_GPIO_PM_TO_SYS(30),
931 .chg_current_ma = 2200,
932};
933
934static struct i2c_board_info smb349_charger_i2c_info[] __initdata = {
935 {
936 I2C_BOARD_INFO(SMB349_NAME, 0x1B),
937 .platform_data = &smb349_data,
938 },
939};
940
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -0800941struct sx150x_platform_data apq8064_sx150x_data[] = {
942 [SX150X_EPM] = {
943 .gpio_base = GPIO_EPM_EXPANDER_BASE,
944 .oscio_is_gpo = false,
945 .io_pullup_ena = 0x0,
946 .io_pulldn_ena = 0x0,
947 .io_open_drain_ena = 0x0,
948 .io_polarity = 0,
949 .irq_summary = -1,
950 },
951};
952
953static struct epm_chan_properties ads_adc_channel_data[] = {
954 {10, 100}, {500, 50}, {1, 1}, {1, 1},
955 {20, 50}, {10, 100}, {1, 1}, {1, 1},
956 {10, 100}, {10, 100}, {100, 100}, {200, 100},
957 {100, 50}, {2000, 50}, {1000, 50}, {200, 50},
958 {200, 100}, {1, 1}, {20, 50}, {500, 50},
959 {50, 50}, {200, 100}, {500, 100}, {20, 50},
960 {200, 50}, {2000, 100}, {1000, 50}, {100, 50},
961 {200, 100}, {500, 50}, {1000, 100}, {200, 50},
962 {1000, 50}, {50, 50}, {100, 50}, {100, 50},
963 {1, 1}, {1, 1}, {20, 100}, {20, 50},
964 {500, 100}, {1000, 100}, {100, 50}, {1000, 50},
965 {100, 50}, {1000, 100}, {100, 50}, {100, 50},
966};
967
968static struct epm_adc_platform_data epm_adc_pdata = {
969 .channel = ads_adc_channel_data,
970 .bus_id = 0x0,
971 .epm_i2c_board_info = {
972 .type = "sx1509q",
973 .addr = 0x3e,
974 .platform_data = &apq8064_sx150x_data[SX150X_EPM],
975 },
976 .gpio_expander_base_addr = GPIO_EPM_EXPANDER_BASE,
977};
978
979static struct platform_device epm_adc_device = {
980 .name = "epm_adc",
981 .id = -1,
982 .dev = {
983 .platform_data = &epm_adc_pdata,
984 },
985};
986
987static void __init apq8064_epm_adc_init(void)
988{
989 epm_adc_pdata.num_channels = 32;
990 epm_adc_pdata.num_adc = 2;
991 epm_adc_pdata.chan_per_adc = 16;
992 epm_adc_pdata.chan_per_mux = 8;
993};
994
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800995/* Micbias setting is based on 8660 CDP/MTP/FLUID requirement
996 * 4 micbiases are used to power various analog and digital
997 * microphones operating at 1800 mV. Technically, all micbiases
998 * can source from single cfilter since all microphones operate
999 * at the same voltage level. The arrangement below is to make
1000 * sure all cfilters are exercised. LDO_H regulator ouput level
1001 * does not need to be as high as 2.85V. It is choosen for
1002 * microphone sensitivity purpose.
1003 */
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301004static struct wcd9xxx_pdata apq8064_tabla_platform_data = {
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001005 .slimbus_slave_device = {
1006 .name = "tabla-slave",
1007 .e_addr = {0, 0, 0x10, 0, 0x17, 2},
1008 },
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08001009 .irq = MSM_GPIO_TO_INT(42),
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001010 .irq_base = TABLA_INTERRUPT_BASE,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301011 .num_irqs = NR_WCD9XXX_IRQS,
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001012 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
1013 .micbias = {
1014 .ldoh_v = TABLA_LDOH_2P85_V,
1015 .cfilt1_mv = 1800,
1016 .cfilt2_mv = 1800,
1017 .cfilt3_mv = 1800,
1018 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
1019 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
1020 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
1021 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301022 },
1023 .regulator = {
1024 {
1025 .name = "CDC_VDD_CP",
1026 .min_uV = 1800000,
1027 .max_uV = 1800000,
1028 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
1029 },
1030 {
1031 .name = "CDC_VDDA_RX",
1032 .min_uV = 1800000,
1033 .max_uV = 1800000,
1034 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
1035 },
1036 {
1037 .name = "CDC_VDDA_TX",
1038 .min_uV = 1800000,
1039 .max_uV = 1800000,
1040 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
1041 },
1042 {
1043 .name = "VDDIO_CDC",
1044 .min_uV = 1800000,
1045 .max_uV = 1800000,
1046 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
1047 },
1048 {
1049 .name = "VDDD_CDC_D",
1050 .min_uV = 1225000,
David Collins62debe82012-06-06 17:01:03 -07001051 .max_uV = 1250000,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301052 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
1053 },
1054 {
1055 .name = "CDC_VDDA_A_1P2V",
1056 .min_uV = 1225000,
David Collins62debe82012-06-06 17:01:03 -07001057 .max_uV = 1250000,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301058 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
1059 },
1060 },
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001061};
1062
1063static struct slim_device apq8064_slim_tabla = {
1064 .name = "tabla-slim",
1065 .e_addr = {0, 1, 0x10, 0, 0x17, 2},
1066 .dev = {
1067 .platform_data = &apq8064_tabla_platform_data,
1068 },
1069};
1070
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301071static struct wcd9xxx_pdata apq8064_tabla20_platform_data = {
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08001072 .slimbus_slave_device = {
1073 .name = "tabla-slave",
1074 .e_addr = {0, 0, 0x60, 0, 0x17, 2},
1075 },
1076 .irq = MSM_GPIO_TO_INT(42),
1077 .irq_base = TABLA_INTERRUPT_BASE,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301078 .num_irqs = NR_WCD9XXX_IRQS,
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08001079 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
1080 .micbias = {
1081 .ldoh_v = TABLA_LDOH_2P85_V,
1082 .cfilt1_mv = 1800,
1083 .cfilt2_mv = 1800,
1084 .cfilt3_mv = 1800,
1085 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
1086 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
1087 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
1088 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301089 },
1090 .regulator = {
1091 {
1092 .name = "CDC_VDD_CP",
1093 .min_uV = 1800000,
1094 .max_uV = 1800000,
1095 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
1096 },
1097 {
1098 .name = "CDC_VDDA_RX",
1099 .min_uV = 1800000,
1100 .max_uV = 1800000,
1101 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
1102 },
1103 {
1104 .name = "CDC_VDDA_TX",
1105 .min_uV = 1800000,
1106 .max_uV = 1800000,
1107 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
1108 },
1109 {
1110 .name = "VDDIO_CDC",
1111 .min_uV = 1800000,
1112 .max_uV = 1800000,
1113 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
1114 },
1115 {
1116 .name = "VDDD_CDC_D",
1117 .min_uV = 1225000,
David Collins62debe82012-06-06 17:01:03 -07001118 .max_uV = 1250000,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301119 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
1120 },
1121 {
1122 .name = "CDC_VDDA_A_1P2V",
1123 .min_uV = 1225000,
David Collins62debe82012-06-06 17:01:03 -07001124 .max_uV = 1250000,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301125 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
1126 },
1127 },
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08001128};
1129
1130static struct slim_device apq8064_slim_tabla20 = {
1131 .name = "tabla2x-slim",
1132 .e_addr = {0, 1, 0x60, 0, 0x17, 2},
1133 .dev = {
1134 .platform_data = &apq8064_tabla20_platform_data,
1135 },
1136};
1137
Santosh Mardi695be0d2012-04-10 23:21:12 +05301138/* enable the level shifter for cs8427 to make sure the I2C
1139 * clock is running at 100KHz and voltage levels are at 3.3
1140 * and 5 volts
1141 */
1142static int enable_100KHz_ls(int enable)
1143{
1144 int ret = 0;
1145 if (enable) {
1146 ret = gpio_request(SX150X_GPIO(1, 10),
1147 "cs8427_100KHZ_ENABLE");
1148 if (ret) {
1149 pr_err("%s: Failed to request gpio %d\n", __func__,
1150 SX150X_GPIO(1, 10));
1151 return ret;
1152 }
1153 gpio_direction_output(SX150X_GPIO(1, 10), 1);
1154 } else
1155 gpio_free(SX150X_GPIO(1, 10));
1156 return ret;
1157}
1158
Santosh Mardieff9a742012-04-09 23:23:39 +05301159static struct cs8427_platform_data cs8427_i2c_platform_data = {
1160 .irq = SX150X_GPIO(1, 4),
1161 .reset_gpio = SX150X_GPIO(1, 6),
Santosh Mardi695be0d2012-04-10 23:21:12 +05301162 .enable = enable_100KHz_ls,
Santosh Mardieff9a742012-04-09 23:23:39 +05301163};
1164
1165static struct i2c_board_info cs8427_device_info[] __initdata = {
1166 {
1167 I2C_BOARD_INFO("cs8427", CS8427_ADDR4),
1168 .platform_data = &cs8427_i2c_platform_data,
1169 },
1170};
1171
Amy Maloche70090f992012-02-16 16:35:26 -08001172#define HAP_SHIFT_LVL_OE_GPIO PM8921_MPP_PM_TO_SYS(8)
1173#define ISA1200_HAP_EN_GPIO PM8921_GPIO_PM_TO_SYS(33)
1174#define ISA1200_HAP_LEN_GPIO PM8921_GPIO_PM_TO_SYS(20)
1175#define ISA1200_HAP_CLK PM8921_GPIO_PM_TO_SYS(44)
1176
Mohan Pallaka2d877602012-05-11 13:07:30 +05301177static int isa1200_clk_enable(bool on)
Amy Maloche70090f992012-02-16 16:35:26 -08001178{
Amy Maloche8f973892012-03-26 14:53:13 -07001179 int rc = 0;
1180
Mohan Pallaka2d877602012-05-11 13:07:30 +05301181 gpio_set_value_cansleep(ISA1200_HAP_CLK, on);
Amy Maloche70090f992012-02-16 16:35:26 -08001182
Mohan Pallaka2d877602012-05-11 13:07:30 +05301183 if (on) {
Amy Maloche8f973892012-03-26 14:53:13 -07001184 rc = pm8xxx_aux_clk_control(CLK_MP3_2, XO_DIV_1, true);
Mohan Pallaka2d877602012-05-11 13:07:30 +05301185 if (rc) {
1186 pr_err("%s: unable to write aux clock register(%d)\n",
1187 __func__, rc);
1188 goto err_gpio_dis;
1189 }
1190 } else {
Amy Maloche8f973892012-03-26 14:53:13 -07001191 rc = pm8xxx_aux_clk_control(CLK_MP3_2, XO_DIV_NONE, true);
Mohan Pallaka2d877602012-05-11 13:07:30 +05301192 if (rc)
1193 pr_err("%s: unable to write aux clock register(%d)\n",
1194 __func__, rc);
Amy Maloche8f973892012-03-26 14:53:13 -07001195 }
1196
1197 return rc;
Mohan Pallaka2d877602012-05-11 13:07:30 +05301198
1199err_gpio_dis:
1200 gpio_set_value_cansleep(ISA1200_HAP_CLK, !on);
1201 return rc;
Amy Maloche70090f992012-02-16 16:35:26 -08001202}
1203
1204static int isa1200_dev_setup(bool enable)
1205{
1206 int rc = 0;
1207
Amy Maloche70090f992012-02-16 16:35:26 -08001208 if (!enable)
1209 goto free_gpio;
1210
1211 rc = gpio_request(ISA1200_HAP_CLK, "haptics_clk");
1212 if (rc) {
1213 pr_err("%s: unable to request gpio %d config(%d)\n",
1214 __func__, ISA1200_HAP_CLK, rc);
1215 return rc;
1216 }
1217
1218 rc = gpio_direction_output(ISA1200_HAP_CLK, 0);
1219 if (rc) {
1220 pr_err("%s: unable to set direction\n", __func__);
1221 goto free_gpio;
1222 }
1223
1224 return 0;
1225
1226free_gpio:
1227 gpio_free(ISA1200_HAP_CLK);
1228 return rc;
1229}
1230
1231static struct isa1200_regulator isa1200_reg_data[] = {
1232 {
1233 .name = "vddp",
1234 .min_uV = ISA_I2C_VTG_MIN_UV,
1235 .max_uV = ISA_I2C_VTG_MAX_UV,
1236 .load_uA = ISA_I2C_CURR_UA,
1237 },
1238};
1239
1240static struct isa1200_platform_data isa1200_1_pdata = {
1241 .name = "vibrator",
1242 .dev_setup = isa1200_dev_setup,
Mohan Pallaka2d877602012-05-11 13:07:30 +05301243 .clk_enable = isa1200_clk_enable,
Mohan Pallaka32f20a72012-06-14 14:41:11 +05301244 .need_pwm_clk = true,
Amy Maloche70090f992012-02-16 16:35:26 -08001245 .hap_en_gpio = ISA1200_HAP_EN_GPIO,
1246 .hap_len_gpio = ISA1200_HAP_LEN_GPIO,
1247 .max_timeout = 15000,
1248 .mode_ctrl = PWM_GEN_MODE,
1249 .pwm_fd = {
1250 .pwm_div = 256,
1251 },
1252 .is_erm = false,
1253 .smart_en = true,
1254 .ext_clk_en = true,
1255 .chip_en = 1,
1256 .regulator_info = isa1200_reg_data,
1257 .num_regulators = ARRAY_SIZE(isa1200_reg_data),
1258};
1259
1260static struct i2c_board_info isa1200_board_info[] __initdata = {
1261 {
1262 I2C_BOARD_INFO("isa1200_1", 0x90>>1),
1263 .platform_data = &isa1200_1_pdata,
1264 },
1265};
Jing Lin21ed4de2012-02-05 15:53:28 -08001266/* configuration data for mxt1386e using V2.1 firmware */
1267static const u8 mxt1386e_config_data_v2_1[] = {
1268 /* T6 Object */
1269 0, 0, 0, 0, 0, 0,
1270 /* T38 Object */
Jing Lin943fcec2012-05-25 13:58:57 -07001271 14, 2, 0, 24, 5, 12, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001272 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1273 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1274 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1275 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1276 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1277 0, 0, 0, 0,
1278 /* T7 Object */
Jing Linf1208fd2012-02-23 11:15:42 -08001279 100, 10, 50,
Jing Lin21ed4de2012-02-05 15:53:28 -08001280 /* T8 Object */
Jing Linf1208fd2012-02-23 11:15:42 -08001281 25, 0, 20, 20, 0, 0, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001282 /* T9 Object */
Jing Lin943fcec2012-05-25 13:58:57 -07001283 139, 0, 0, 26, 42, 0, 32, 80, 2, 5,
Jing Lin21ed4de2012-02-05 15:53:28 -08001284 0, 5, 5, 0, 10, 30, 10, 10, 255, 2,
Jing Linf1208fd2012-02-23 11:15:42 -08001285 85, 5, 0, 5, 9, 5, 12, 35, 70, 40,
1286 20, 5, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001287 /* T18 Object */
1288 0, 0,
1289 /* T24 Object */
1290 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1291 0, 0, 0, 0, 0, 0, 0, 0, 0,
1292 /* T25 Object */
Jing Lin943fcec2012-05-25 13:58:57 -07001293 1, 0, 60, 115, 156, 99,
Jing Lin21ed4de2012-02-05 15:53:28 -08001294 /* T27 Object */
1295 0, 0, 0, 0, 0, 0, 0,
1296 /* T40 Object */
1297 0, 0, 0, 0, 0,
1298 /* T42 Object */
Jing Lin943fcec2012-05-25 13:58:57 -07001299 0, 0, 255, 0, 255, 0, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001300 /* T43 Object */
1301 0, 0, 0, 0, 0, 0, 0, 64, 0, 8,
1302 16,
1303 /* T46 Object */
Jing Linf1208fd2012-02-23 11:15:42 -08001304 68, 0, 16, 16, 0, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001305 /* T47 Object */
1306 0, 0, 0, 0, 0, 0, 3, 64, 66, 0,
1307 /* T48 Object */
Jing Lin943fcec2012-05-25 13:58:57 -07001308 1, 64, 64, 0, 0, 0, 0, 0, 0, 0,
Jing Linf1208fd2012-02-23 11:15:42 -08001309 32, 40, 0, 10, 10, 0, 0, 100, 10, 90,
1310 0, 0, 0, 0, 0, 0, 0, 10, 1, 10,
1311 52, 10, 12, 0, 33, 0, 1, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001312 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1313 0, 0, 0, 0,
1314 /* T56 Object */
1315 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1316 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1317 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1318 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Jing Linf1208fd2012-02-23 11:15:42 -08001319 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1320 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001321};
1322
1323#define MXT_TS_GPIO_IRQ 6
1324#define MXT_TS_PWR_EN_GPIO PM8921_GPIO_PM_TO_SYS(23)
1325#define MXT_TS_RESET_GPIO 33
1326
1327static struct mxt_config_info mxt_config_array[] = {
1328 {
1329 .config = mxt1386e_config_data_v2_1,
1330 .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1),
1331 .family_id = 0xA0,
1332 .variant_id = 0x7,
1333 .version = 0x21,
1334 .build = 0xAA,
Jing Linef4aa9b2012-03-26 12:01:41 -07001335 .bootldr_id = MXT_BOOTLOADER_ID_1386E,
1336 .fw_name = "atmel_8064_liquid_v2_2_AA.hex",
1337 },
1338 {
1339 /* The config data for V2.2.AA is the same as for V2.1.AA */
1340 .config = mxt1386e_config_data_v2_1,
1341 .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1),
1342 .family_id = 0xA0,
1343 .variant_id = 0x7,
1344 .version = 0x22,
1345 .build = 0xAA,
1346 .bootldr_id = MXT_BOOTLOADER_ID_1386E,
Jing Lin21ed4de2012-02-05 15:53:28 -08001347 },
1348};
1349
1350static struct mxt_platform_data mxt_platform_data = {
1351 .config_array = mxt_config_array,
1352 .config_array_size = ARRAY_SIZE(mxt_config_array),
Mohan Pallaka56a1a5d2012-02-23 12:05:13 -08001353 .panel_minx = 0,
1354 .panel_maxx = 1365,
1355 .panel_miny = 0,
1356 .panel_maxy = 767,
1357 .disp_minx = 0,
1358 .disp_maxx = 1365,
1359 .disp_miny = 0,
1360 .disp_maxy = 767,
Anirudh Ghayal39dbe3f2012-04-13 15:43:16 +05301361 .irqflags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
Jing Lin21ed4de2012-02-05 15:53:28 -08001362 .i2c_pull_up = true,
1363 .reset_gpio = MXT_TS_RESET_GPIO,
1364 .irq_gpio = MXT_TS_GPIO_IRQ,
1365};
1366
1367static struct i2c_board_info mxt_device_info[] __initdata = {
1368 {
1369 I2C_BOARD_INFO("atmel_mxt_ts", 0x5b),
1370 .platform_data = &mxt_platform_data,
1371 .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ),
1372 },
1373};
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001374#define CYTTSP_TS_GPIO_IRQ 6
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001375#define CYTTSP_TS_GPIO_SLEEP 33
1376
1377static ssize_t tma340_vkeys_show(struct kobject *kobj,
1378 struct kobj_attribute *attr, char *buf)
1379{
1380 return snprintf(buf, 200,
1381 __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97"
1382 ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97"
1383 ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97"
1384 ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97"
1385 "\n");
1386}
1387
1388static struct kobj_attribute tma340_vkeys_attr = {
1389 .attr = {
1390 .mode = S_IRUGO,
1391 },
1392 .show = &tma340_vkeys_show,
1393};
1394
1395static struct attribute *tma340_properties_attrs[] = {
1396 &tma340_vkeys_attr.attr,
1397 NULL
1398};
1399
1400static struct attribute_group tma340_properties_attr_group = {
1401 .attrs = tma340_properties_attrs,
1402};
1403
1404static int cyttsp_platform_init(struct i2c_client *client)
1405{
1406 int rc = 0;
1407 static struct kobject *tma340_properties_kobj;
1408
1409 tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c";
1410 tma340_properties_kobj = kobject_create_and_add("board_properties",
1411 NULL);
1412 if (tma340_properties_kobj)
1413 rc = sysfs_create_group(tma340_properties_kobj,
1414 &tma340_properties_attr_group);
1415 if (!tma340_properties_kobj || rc)
1416 pr_err("%s: failed to create board_properties\n",
1417 __func__);
1418
1419 return 0;
1420}
1421
1422static struct cyttsp_regulator cyttsp_regulator_data[] = {
1423 {
1424 .name = "vdd",
1425 .min_uV = CY_TMA300_VTG_MIN_UV,
1426 .max_uV = CY_TMA300_VTG_MAX_UV,
1427 .hpm_load_uA = CY_TMA300_CURR_24HZ_UA,
1428 .lpm_load_uA = CY_TMA300_CURR_24HZ_UA,
1429 },
1430 {
1431 .name = "vcc_i2c",
1432 .min_uV = CY_I2C_VTG_MIN_UV,
1433 .max_uV = CY_I2C_VTG_MAX_UV,
1434 .hpm_load_uA = CY_I2C_CURR_UA,
1435 .lpm_load_uA = CY_I2C_CURR_UA,
1436 },
1437};
1438
1439static struct cyttsp_platform_data cyttsp_pdata = {
1440 .panel_maxx = 634,
1441 .panel_maxy = 1166,
1442 .disp_maxx = 599,
1443 .disp_maxy = 1023,
1444 .disp_minx = 0,
1445 .disp_miny = 0,
1446 .flags = 0x01,
1447 .gen = CY_GEN3,
1448 .use_st = CY_USE_ST,
1449 .use_mt = CY_USE_MT,
1450 .use_hndshk = CY_SEND_HNDSHK,
1451 .use_trk_id = CY_USE_TRACKING_ID,
1452 .use_sleep = CY_USE_DEEP_SLEEP_SEL,
1453 .use_gestures = CY_USE_GESTURES,
1454 .fw_fname = "cyttsp_8064_mtp.hex",
1455 /* change act_intrvl to customize the Active power state
1456 * scanning/processing refresh interval for Operating mode
1457 */
1458 .act_intrvl = CY_ACT_INTRVL_DFLT,
1459 /* change tch_tmout to customize the touch timeout for the
1460 * Active power state for Operating mode
1461 */
1462 .tch_tmout = CY_TCH_TMOUT_DFLT,
1463 /* change lp_intrvl to customize the Low Power power state
1464 * scanning/processing refresh interval for Operating mode
1465 */
1466 .lp_intrvl = CY_LP_INTRVL_DFLT,
1467 .sleep_gpio = CYTTSP_TS_GPIO_SLEEP,
Amy Maloche9ba3ffe2012-04-26 10:31:20 -07001468 .resout_gpio = -1,
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001469 .irq_gpio = CYTTSP_TS_GPIO_IRQ,
1470 .regulator_info = cyttsp_regulator_data,
1471 .num_regulators = ARRAY_SIZE(cyttsp_regulator_data),
1472 .init = cyttsp_platform_init,
1473 .correct_fw_ver = 17,
1474};
1475
1476static struct i2c_board_info cyttsp_info[] __initdata = {
1477 {
1478 I2C_BOARD_INFO(CY_I2C_NAME, 0x24),
1479 .platform_data = &cyttsp_pdata,
1480 .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ),
1481 },
1482};
Jing Lin21ed4de2012-02-05 15:53:28 -08001483
Ankit Verma6b7e2ba2012-01-26 15:48:54 -08001484#define MSM_WCNSS_PHYS 0x03000000
1485#define MSM_WCNSS_SIZE 0x280000
1486
1487static struct resource resources_wcnss_wlan[] = {
1488 {
1489 .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1490 .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1491 .name = "wcnss_wlanrx_irq",
1492 .flags = IORESOURCE_IRQ,
1493 },
1494 {
1495 .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1496 .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1497 .name = "wcnss_wlantx_irq",
1498 .flags = IORESOURCE_IRQ,
1499 },
1500 {
1501 .start = MSM_WCNSS_PHYS,
1502 .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1,
1503 .name = "wcnss_mmio",
1504 .flags = IORESOURCE_MEM,
1505 },
1506 {
1507 .start = 64,
1508 .end = 68,
1509 .name = "wcnss_gpios_5wire",
1510 .flags = IORESOURCE_IO,
1511 },
1512};
1513
1514static struct qcom_wcnss_opts qcom_wcnss_pdata = {
1515 .has_48mhz_xo = 1,
1516};
1517
1518static struct platform_device msm_device_wcnss_wlan = {
1519 .name = "wcnss_wlan",
1520 .id = 0,
1521 .num_resources = ARRAY_SIZE(resources_wcnss_wlan),
1522 .resource = resources_wcnss_wlan,
1523 .dev = {.platform_data = &qcom_wcnss_pdata},
1524};
1525
Ankit Vermab7c26e62012-02-28 15:04:15 -08001526static struct platform_device msm_device_iris_fm __devinitdata = {
1527 .name = "iris_fm",
1528 .id = -1,
1529};
1530
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07001531#ifdef CONFIG_QSEECOM
1532/* qseecom bus scaling */
1533static struct msm_bus_vectors qseecom_clks_init_vectors[] = {
1534 {
1535 .src = MSM_BUS_MASTER_SPS,
1536 .dst = MSM_BUS_SLAVE_EBI_CH0,
1537 .ib = 0,
1538 .ab = 0,
1539 },
1540 {
1541 .src = MSM_BUS_MASTER_SPDM,
1542 .dst = MSM_BUS_SLAVE_SPDM,
1543 .ib = 0,
1544 .ab = 0,
1545 },
1546};
1547
1548static struct msm_bus_vectors qseecom_enable_dfab_vectors[] = {
1549 {
1550 .src = MSM_BUS_MASTER_SPS,
1551 .dst = MSM_BUS_SLAVE_EBI_CH0,
1552 .ib = (492 * 8) * 1000000UL,
1553 .ab = (492 * 8) * 100000UL,
1554 },
1555 {
1556 .src = MSM_BUS_MASTER_SPDM,
1557 .dst = MSM_BUS_SLAVE_SPDM,
1558 .ib = 0,
1559 .ab = 0,
1560 },
1561};
1562
1563static struct msm_bus_vectors qseecom_enable_sfpb_vectors[] = {
1564 {
1565 .src = MSM_BUS_MASTER_SPS,
1566 .dst = MSM_BUS_SLAVE_EBI_CH0,
1567 .ib = 0,
1568 .ab = 0,
1569 },
1570 {
1571 .src = MSM_BUS_MASTER_SPDM,
1572 .dst = MSM_BUS_SLAVE_SPDM,
1573 .ib = (64 * 8) * 1000000UL,
1574 .ab = (64 * 8) * 100000UL,
1575 },
1576};
1577
1578static struct msm_bus_paths qseecom_hw_bus_scale_usecases[] = {
1579 {
1580 ARRAY_SIZE(qseecom_clks_init_vectors),
1581 qseecom_clks_init_vectors,
1582 },
1583 {
1584 ARRAY_SIZE(qseecom_enable_dfab_vectors),
1585 qseecom_enable_sfpb_vectors,
1586 },
1587 {
1588 ARRAY_SIZE(qseecom_enable_sfpb_vectors),
1589 qseecom_enable_sfpb_vectors,
1590 },
1591};
1592
1593static struct msm_bus_scale_pdata qseecom_bus_pdata = {
1594 qseecom_hw_bus_scale_usecases,
1595 ARRAY_SIZE(qseecom_hw_bus_scale_usecases),
1596 .name = "qsee",
1597};
1598
1599static struct platform_device qseecom_device = {
1600 .name = "qseecom",
1601 .id = 0,
1602 .dev = {
1603 .platform_data = &qseecom_bus_pdata,
1604 },
1605};
1606#endif
1607
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001608#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1609 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
1610 defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1611 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1612
1613#define QCE_SIZE 0x10000
1614#define QCE_0_BASE 0x11000000
1615
1616#define QCE_HW_KEY_SUPPORT 0
1617#define QCE_SHA_HMAC_SUPPORT 1
1618#define QCE_SHARE_CE_RESOURCE 3
1619#define QCE_CE_SHARED 0
1620
1621static struct resource qcrypto_resources[] = {
1622 [0] = {
1623 .start = QCE_0_BASE,
1624 .end = QCE_0_BASE + QCE_SIZE - 1,
1625 .flags = IORESOURCE_MEM,
1626 },
1627 [1] = {
1628 .name = "crypto_channels",
1629 .start = DMOV8064_CE_IN_CHAN,
1630 .end = DMOV8064_CE_OUT_CHAN,
1631 .flags = IORESOURCE_DMA,
1632 },
1633 [2] = {
1634 .name = "crypto_crci_in",
1635 .start = DMOV8064_CE_IN_CRCI,
1636 .end = DMOV8064_CE_IN_CRCI,
1637 .flags = IORESOURCE_DMA,
1638 },
1639 [3] = {
1640 .name = "crypto_crci_out",
1641 .start = DMOV8064_CE_OUT_CRCI,
1642 .end = DMOV8064_CE_OUT_CRCI,
1643 .flags = IORESOURCE_DMA,
1644 },
1645};
1646
1647static struct resource qcedev_resources[] = {
1648 [0] = {
1649 .start = QCE_0_BASE,
1650 .end = QCE_0_BASE + QCE_SIZE - 1,
1651 .flags = IORESOURCE_MEM,
1652 },
1653 [1] = {
1654 .name = "crypto_channels",
1655 .start = DMOV8064_CE_IN_CHAN,
1656 .end = DMOV8064_CE_OUT_CHAN,
1657 .flags = IORESOURCE_DMA,
1658 },
1659 [2] = {
1660 .name = "crypto_crci_in",
1661 .start = DMOV8064_CE_IN_CRCI,
1662 .end = DMOV8064_CE_IN_CRCI,
1663 .flags = IORESOURCE_DMA,
1664 },
1665 [3] = {
1666 .name = "crypto_crci_out",
1667 .start = DMOV8064_CE_OUT_CRCI,
1668 .end = DMOV8064_CE_OUT_CRCI,
1669 .flags = IORESOURCE_DMA,
1670 },
1671};
1672
1673#endif
1674
1675#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1676 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1677
1678static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
1679 .ce_shared = QCE_CE_SHARED,
1680 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1681 .hw_key_support = QCE_HW_KEY_SUPPORT,
1682 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -08001683 .bus_scale_table = NULL,
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001684};
1685
1686static struct platform_device qcrypto_device = {
1687 .name = "qcrypto",
1688 .id = 0,
1689 .num_resources = ARRAY_SIZE(qcrypto_resources),
1690 .resource = qcrypto_resources,
1691 .dev = {
1692 .coherent_dma_mask = DMA_BIT_MASK(32),
1693 .platform_data = &qcrypto_ce_hw_suppport,
1694 },
1695};
1696#endif
1697
1698#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1699 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1700
1701static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
1702 .ce_shared = QCE_CE_SHARED,
1703 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1704 .hw_key_support = QCE_HW_KEY_SUPPORT,
1705 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -08001706 .bus_scale_table = NULL,
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001707};
1708
1709static struct platform_device qcedev_device = {
1710 .name = "qce",
1711 .id = 0,
1712 .num_resources = ARRAY_SIZE(qcedev_resources),
1713 .resource = qcedev_resources,
1714 .dev = {
1715 .coherent_dma_mask = DMA_BIT_MASK(32),
1716 .platform_data = &qcedev_ce_hw_suppport,
1717 },
1718};
1719#endif
1720
Joel Kingef390842012-05-23 16:42:48 -07001721static struct mdm_vddmin_resource mdm_vddmin_rscs = {
1722 .rpm_id = MSM_RPM_ID_VDDMIN_GPIO,
1723 .ap2mdm_vddmin_gpio = 30,
1724 .modes = 0x03,
1725 .drive_strength = 8,
1726 .mdm2ap_vddmin_gpio = 80,
1727};
1728
Joel Kingdacbc822012-01-25 13:30:57 -08001729static struct mdm_platform_data mdm_platform_data = {
1730 .mdm_version = "3.0",
1731 .ramdump_delay_ms = 2000,
Joel King14fe7fa2012-05-27 14:26:11 -07001732 .early_power_on = 1,
1733 .sfr_query = 1,
Joel Kingef390842012-05-23 16:42:48 -07001734 .vddmin_resource = &mdm_vddmin_rscs,
Hemant Kumara945b472012-01-25 15:08:06 -08001735 .peripheral_platform_device = &apq8064_device_hsic_host,
Ameya Thakurc9a7a842012-06-24 22:47:52 -07001736 .ramdump_timeout_ms = 120000,
Joel Kingdacbc822012-01-25 13:30:57 -08001737};
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001738
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -08001739static struct tsens_platform_data apq_tsens_pdata = {
1740 .tsens_factor = 1000,
1741 .hw_type = APQ_8064,
1742 .tsens_num_sensor = 11,
1743 .slope = {1176, 1176, 1154, 1176, 1111,
1744 1132, 1132, 1199, 1132, 1199, 1132},
1745};
1746
Siddartha Mohanadoss48cad912012-04-05 21:29:54 -07001747static struct platform_device msm_tsens_device = {
1748 .name = "tsens8960-tm",
1749 .id = -1,
1750};
1751
Praveen Chidambaram877d7a42012-06-05 14:33:20 -06001752static struct msm_thermal_data msm_thermal_pdata = {
1753 .sensor_id = 7,
1754 .poll_ms = 1000,
1755 .limit_temp = 60,
1756 .temp_hysteresis = 10,
1757 .limit_freq = 918000,
1758};
1759
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001760#define MSM_SHARED_RAM_PHYS 0x80000000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001761static void __init apq8064_map_io(void)
1762{
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001763 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001764 msm_map_apq8064_io();
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -07001765 if (socinfo_init() < 0)
1766 pr_err("socinfo_init() failed!\n");
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001767}
1768
1769static void __init apq8064_init_irq(void)
1770{
Praveen Chidambaram78499012011-11-01 17:15:17 -06001771 struct msm_mpm_device_data *data = NULL;
1772
1773#ifdef CONFIG_MSM_MPM
1774 data = &apq8064_mpm_dev_data;
1775#endif
1776
1777 msm_mpm_irq_extn_init(data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001778 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
1779 (void *)MSM_QGIC_CPU_BASE);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001780}
1781
Jay Chokshi7805b5a2011-11-07 15:55:30 -08001782static struct platform_device msm8064_device_saw_regulator_core0 = {
1783 .name = "saw-regulator",
1784 .id = 0,
1785 .dev = {
1786 .platform_data = &msm8064_saw_regulator_pdata_8921_s5,
1787 },
1788};
1789
1790static struct platform_device msm8064_device_saw_regulator_core1 = {
1791 .name = "saw-regulator",
1792 .id = 1,
1793 .dev = {
1794 .platform_data = &msm8064_saw_regulator_pdata_8921_s6,
1795 },
1796};
1797
1798static struct platform_device msm8064_device_saw_regulator_core2 = {
1799 .name = "saw-regulator",
1800 .id = 2,
1801 .dev = {
1802 .platform_data = &msm8064_saw_regulator_pdata_8821_s0,
1803 },
1804};
1805
1806static struct platform_device msm8064_device_saw_regulator_core3 = {
1807 .name = "saw-regulator",
1808 .id = 3,
1809 .dev = {
1810 .platform_data = &msm8064_saw_regulator_pdata_8821_s1,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001811
1812 },
1813};
1814
Oluwafemi Adeyemif5a31422012-03-08 16:58:45 -08001815static struct msm_rpmrs_level msm_rpmrs_levels[] = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06001816 {
1817 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
1818 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
1819 true,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06001820 1, 784, 180000, 100,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001821 },
1822
1823 {
1824 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
1825 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
1826 true,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06001827 1300, 228, 1200000, 2000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001828 },
1829
1830 {
1831 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1832 MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE),
1833 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06001834 2000, 138, 1208400, 3200,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001835 },
1836
1837 {
1838 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001839 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, ACTIVE, RET_HIGH),
1840 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06001841 6000, 119, 1850300, 9000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001842 },
1843
1844 {
1845 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1846 MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE),
1847 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06001848 9200, 68, 2839200, 16400,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001849 },
1850
1851 {
1852 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1853 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
1854 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06001855 10300, 63, 3128000, 18200,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001856 },
1857
1858 {
1859 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1860 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH),
1861 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06001862 18000, 10, 4602600, 27000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001863 },
1864
1865 {
1866 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1867 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
1868 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06001869 20000, 2, 5752000, 32000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001870 },
1871};
1872
1873static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
1874 .mode = MSM_PM_BOOT_CONFIG_TZ,
1875};
1876
1877static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = {
1878 .levels = &msm_rpmrs_levels[0],
1879 .num_levels = ARRAY_SIZE(msm_rpmrs_levels),
1880 .vdd_mem_levels = {
1881 [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000,
1882 [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000,
1883 [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000,
1884 [MSM_RPMRS_VDD_MEM_MAX] = 1150000,
1885 },
1886 .vdd_dig_levels = {
1887 [MSM_RPMRS_VDD_DIG_RET_LOW] = 500000,
1888 [MSM_RPMRS_VDD_DIG_RET_HIGH] = 750000,
1889 [MSM_RPMRS_VDD_DIG_ACTIVE] = 950000,
1890 [MSM_RPMRS_VDD_DIG_MAX] = 1150000,
1891 },
1892 .vdd_mask = 0x7FFFFF,
1893 .rpmrs_target_id = {
1894 [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK,
1895 [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST,
1896 [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_PM8921_S3_0,
1897 [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_PM8921_S3_1,
1898 [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8921_L24_0,
1899 [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8921_L24_1,
1900 [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL,
1901 },
1902};
1903
Praveen Chidambaram78499012011-11-01 17:15:17 -06001904static uint8_t spm_wfi_cmd_sequence[] __initdata = {
1905 0x03, 0x0f,
1906};
1907
1908static uint8_t spm_power_collapse_without_rpm[] __initdata = {
1909 0x00, 0x24, 0x54, 0x10,
1910 0x09, 0x03, 0x01,
1911 0x10, 0x54, 0x30, 0x0C,
1912 0x24, 0x30, 0x0f,
1913};
1914
1915static uint8_t spm_power_collapse_with_rpm[] __initdata = {
1916 0x00, 0x24, 0x54, 0x10,
1917 0x09, 0x07, 0x01, 0x0B,
1918 0x10, 0x54, 0x30, 0x0C,
1919 0x24, 0x30, 0x0f,
1920};
1921
1922static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
1923 [0] = {
1924 .mode = MSM_SPM_MODE_CLOCK_GATING,
1925 .notify_rpm = false,
1926 .cmd = spm_wfi_cmd_sequence,
1927 },
1928 [1] = {
1929 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1930 .notify_rpm = false,
1931 .cmd = spm_power_collapse_without_rpm,
1932 },
1933 [2] = {
1934 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1935 .notify_rpm = true,
1936 .cmd = spm_power_collapse_with_rpm,
1937 },
1938};
1939
1940static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = {
1941 0x00, 0x20, 0x03, 0x20,
1942 0x00, 0x0f,
1943};
1944
1945static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = {
1946 0x00, 0x20, 0x34, 0x64,
1947 0x48, 0x07, 0x48, 0x20,
1948 0x50, 0x64, 0x04, 0x34,
1949 0x50, 0x0f,
1950};
1951static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = {
1952 0x00, 0x10, 0x34, 0x64,
1953 0x48, 0x07, 0x48, 0x10,
1954 0x50, 0x64, 0x04, 0x34,
1955 0x50, 0x0F,
1956};
1957
1958static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = {
1959 [0] = {
1960 .mode = MSM_SPM_L2_MODE_RETENTION,
1961 .notify_rpm = false,
1962 .cmd = l2_spm_wfi_cmd_sequence,
1963 },
1964 [1] = {
1965 .mode = MSM_SPM_L2_MODE_GDHS,
1966 .notify_rpm = true,
1967 .cmd = l2_spm_gdhs_cmd_sequence,
1968 },
1969 [2] = {
1970 .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE,
1971 .notify_rpm = true,
1972 .cmd = l2_spm_power_off_cmd_sequence,
1973 },
1974};
1975
1976
1977static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = {
1978 [0] = {
1979 .reg_base_addr = MSM_SAW_L2_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001980 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001981 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001982 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE,
1983 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020,
1984 .modes = msm_spm_l2_seq_list,
1985 .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list),
1986 },
1987};
1988
1989static struct msm_spm_platform_data msm_spm_data[] __initdata = {
1990 [0] = {
1991 .reg_base_addr = MSM_SAW0_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001992 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001993#if defined(CONFIG_MSM_AVS_HW)
1994 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1995 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1996#endif
1997 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001998 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001999 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
2000 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
2001 .vctl_timeout_us = 50,
2002 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
2003 .modes = msm_spm_seq_list,
2004 },
2005 [1] = {
2006 .reg_base_addr = MSM_SAW1_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002007 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002008#if defined(CONFIG_MSM_AVS_HW)
2009 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
2010 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
2011#endif
2012 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07002013 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002014 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
2015 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
2016 .vctl_timeout_us = 50,
2017 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
2018 .modes = msm_spm_seq_list,
2019 },
2020 [2] = {
2021 .reg_base_addr = MSM_SAW2_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002022 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002023#if defined(CONFIG_MSM_AVS_HW)
2024 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
2025 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
2026#endif
2027 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07002028 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002029 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
2030 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
2031 .vctl_timeout_us = 50,
2032 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
2033 .modes = msm_spm_seq_list,
2034 },
2035 [3] = {
2036 .reg_base_addr = MSM_SAW3_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002037 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002038#if defined(CONFIG_MSM_AVS_HW)
2039 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
2040 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
2041#endif
2042 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07002043 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002044 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
2045 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
2046 .vctl_timeout_us = 50,
2047 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
2048 .modes = msm_spm_seq_list,
Jay Chokshi7805b5a2011-11-07 15:55:30 -08002049 },
2050};
2051
Praveen Chidambaram4d19be42012-04-03 18:05:52 -06002052static struct msm_pm_sleep_status_data msm_pm_slp_sts_data = {
2053 .base_addr = MSM_ACC0_BASE + 0x08,
2054 .cpu_offset = MSM_ACC1_BASE - MSM_ACC0_BASE,
2055 .mask = 1UL << 13,
2056};
2057
Gagan Mac8a7a5d32011-11-11 16:43:06 -07002058static void __init apq8064_init_buses(void)
2059{
2060 msm_bus_rpm_set_mt_mask();
2061 msm_bus_8064_apps_fabric_pdata.rpm_enabled = 1;
2062 msm_bus_8064_sys_fabric_pdata.rpm_enabled = 1;
2063 msm_bus_8064_mm_fabric_pdata.rpm_enabled = 1;
2064 msm_bus_8064_apps_fabric.dev.platform_data =
2065 &msm_bus_8064_apps_fabric_pdata;
2066 msm_bus_8064_sys_fabric.dev.platform_data =
2067 &msm_bus_8064_sys_fabric_pdata;
2068 msm_bus_8064_mm_fabric.dev.platform_data =
2069 &msm_bus_8064_mm_fabric_pdata;
2070 msm_bus_8064_sys_fpb.dev.platform_data = &msm_bus_8064_sys_fpb_pdata;
2071 msm_bus_8064_cpss_fpb.dev.platform_data = &msm_bus_8064_cpss_fpb_pdata;
2072}
2073
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06002074/* PCIe gpios */
2075static struct msm_pcie_gpio_info_t msm_pcie_gpio_info[MSM_PCIE_MAX_GPIO] = {
2076 {"rst_n", PM8921_MPP_PM_TO_SYS(PCIE_RST_N_PMIC_MPP), 0},
2077 {"pwr_en", PM8921_GPIO_PM_TO_SYS(PCIE_PWR_EN_PMIC_GPIO), 1},
2078};
2079
2080static struct msm_pcie_platform msm_pcie_platform_data = {
2081 .gpio = msm_pcie_gpio_info,
Niranjana Vishwanathapura68210ff2012-06-24 18:03:49 -06002082 .axi_addr = PCIE_AXI_BAR_PHYS,
2083 .axi_size = PCIE_AXI_BAR_SIZE,
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06002084};
2085
Niranjana Vishwanathapurac1edd402012-06-28 15:32:50 -06002086static int __init mpq8064_pcie_enabled(void)
2087{
2088 return !((readl_relaxed(QFPROM_RAW_FEAT_CONFIG_ROW0_MSB) & BIT(21)) ||
2089 (readl_relaxed(QFPROM_RAW_OEM_CONFIG_ROW0_LSB) & BIT(4)));
2090}
2091
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06002092static void __init mpq8064_pcie_init(void)
2093{
Niranjana Vishwanathapurac1edd402012-06-28 15:32:50 -06002094 if (mpq8064_pcie_enabled()) {
2095 msm_device_pcie.dev.platform_data = &msm_pcie_platform_data;
2096 platform_device_register(&msm_device_pcie);
2097 }
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06002098}
2099
David Collinsf0d00732012-01-25 15:46:50 -08002100static struct platform_device apq8064_device_ext_5v_vreg __devinitdata = {
2101 .name = GPIO_REGULATOR_DEV_NAME,
2102 .id = PM8921_MPP_PM_TO_SYS(7),
2103 .dev = {
2104 .platform_data
2105 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V],
2106 },
2107};
2108
Jay Chokshi1de4f9d2012-02-07 16:11:31 -08002109static struct platform_device apq8064_device_ext_mpp8_vreg __devinitdata = {
2110 .name = GPIO_REGULATOR_DEV_NAME,
2111 .id = PM8921_MPP_PM_TO_SYS(8),
2112 .dev = {
2113 .platform_data
2114 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_MPP8],
2115 },
2116};
2117
David Collinsf0d00732012-01-25 15:46:50 -08002118static struct platform_device apq8064_device_ext_3p3v_vreg __devinitdata = {
2119 .name = GPIO_REGULATOR_DEV_NAME,
2120 .id = APQ8064_EXT_3P3V_REG_EN_GPIO,
2121 .dev = {
2122 .platform_data =
2123 &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V],
2124 },
2125};
2126
David Collins390fc332012-02-07 14:38:16 -08002127static struct platform_device apq8064_device_ext_ts_sw_vreg __devinitdata = {
2128 .name = GPIO_REGULATOR_DEV_NAME,
2129 .id = PM8921_GPIO_PM_TO_SYS(23),
2130 .dev = {
2131 .platform_data
2132 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_TS_SW],
2133 },
2134};
2135
David Collins2782b5c2012-02-06 10:02:42 -08002136static struct platform_device apq8064_device_rpm_regulator __devinitdata = {
2137 .name = "rpm-regulator",
2138 .id = -1,
2139 .dev = {
2140 .platform_data = &apq8064_rpm_regulator_pdata,
2141 },
2142};
2143
Ravi Kumar V05931a22012-04-04 17:09:37 +05302144static struct gpio_ir_recv_platform_data gpio_ir_recv_pdata = {
2145 .gpio_nr = 88,
2146 .active_low = 1,
2147};
2148
2149static struct platform_device gpio_ir_recv_pdev = {
2150 .name = "gpio-rc-recv",
2151 .dev = {
2152 .platform_data = &gpio_ir_recv_pdata,
2153 },
2154};
2155
Terence Hampson36b70722012-05-10 13:18:16 -04002156static struct platform_device *common_not_mpq_devices[] __initdata = {
David Keitel3c40fc52012-02-09 17:53:52 -08002157 &apq8064_device_qup_i2c_gsbi1,
Jing Lin04601f92012-02-05 15:36:07 -08002158 &apq8064_device_qup_i2c_gsbi3,
Kenneth Heitke748593a2011-07-15 15:45:11 -06002159 &apq8064_device_qup_i2c_gsbi4,
Terence Hampson36b70722012-05-10 13:18:16 -04002160};
2161
2162static struct platform_device *common_devices[] __initdata = {
Matt Wagantallbf430eb2012-03-22 11:45:49 -07002163 &msm8960_device_acpuclk,
Terence Hampson36b70722012-05-10 13:18:16 -04002164 &apq8064_device_dmov,
Harini Jayaramanc4c58692011-07-19 14:50:10 -06002165 &apq8064_device_qup_spi_gsbi5,
David Collinsf0d00732012-01-25 15:46:50 -08002166 &apq8064_device_ext_5v_vreg,
Jay Chokshi1de4f9d2012-02-07 16:11:31 -08002167 &apq8064_device_ext_mpp8_vreg,
David Collinsf0d00732012-01-25 15:46:50 -08002168 &apq8064_device_ext_3p3v_vreg,
Jay Chokshi9c25f072011-09-23 18:19:15 -07002169 &apq8064_device_ssbi_pmic1,
2170 &apq8064_device_ssbi_pmic2,
Steve Mucklef132c6c2012-06-06 18:30:57 -07002171 &apq8064_device_ext_ts_sw_vreg,
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06002172 &msm_device_smd_apq8064,
Hemant Kumar4933b072011-10-17 23:43:11 -07002173 &apq8064_device_otg,
2174 &apq8064_device_gadget_peripheral,
Hemant Kumard86c4882012-01-24 19:39:37 -08002175 &apq8064_device_hsusb_host,
Hemant Kumar4933b072011-10-17 23:43:11 -07002176 &android_usb_device,
Ankit Verma6b7e2ba2012-01-26 15:48:54 -08002177 &msm_device_wcnss_wlan,
Ankit Vermab7c26e62012-02-28 15:04:15 -08002178 &msm_device_iris_fm,
Larry Bassel67b921d2012-04-06 10:23:27 -07002179 &apq8064_fmem_device,
Olav Haugan7c6aa742012-01-16 16:47:37 -08002180#ifdef CONFIG_ANDROID_PMEM
2181#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Laura Abbottb93525f2012-04-12 09:57:19 -07002182 &apq8064_android_pmem_device,
2183 &apq8064_android_pmem_adsp_device,
2184 &apq8064_android_pmem_audio_device,
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -07002185#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
2186#endif /*CONFIG_ANDROID_PMEM*/
Olav Haugan7c6aa742012-01-16 16:47:37 -08002187#ifdef CONFIG_ION_MSM
Laura Abbottb93525f2012-04-12 09:57:19 -07002188 &apq8064_ion_dev,
Olav Haugan7c6aa742012-01-16 16:47:37 -08002189#endif
Jeff Ohlstein7e668552011-10-06 16:17:25 -07002190 &msm8064_device_watchdog,
Jay Chokshi7805b5a2011-11-07 15:55:30 -08002191 &msm8064_device_saw_regulator_core0,
2192 &msm8064_device_saw_regulator_core1,
2193 &msm8064_device_saw_regulator_core2,
2194 &msm8064_device_saw_regulator_core3,
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07002195#if defined(CONFIG_QSEECOM)
2196 &qseecom_device,
2197#endif
2198
Ramesh Masavarapu28311912011-10-27 11:04:12 -07002199#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
2200 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
2201 &qcrypto_device,
2202#endif
2203
2204#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
2205 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
2206 &qcedev_device,
2207#endif
Ramesh Masavarapuf46be1b2011-11-03 11:13:41 -07002208
2209#ifdef CONFIG_HW_RANDOM_MSM
2210 &apq8064_device_rng,
2211#endif
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -08002212 &apq_pcm,
2213 &apq_pcm_routing,
2214 &apq_cpudai0,
2215 &apq_cpudai1,
Santosh Mardieff9a742012-04-09 23:23:39 +05302216 &mpq_cpudai_sec_i2s_rx,
Kuirong Wangf23f8c52012-03-31 12:34:51 -07002217 &mpq_cpudai_mi2s_tx,
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -08002218 &apq_cpudai_hdmi_rx,
2219 &apq_cpudai_bt_rx,
2220 &apq_cpudai_bt_tx,
2221 &apq_cpudai_fm_rx,
2222 &apq_cpudai_fm_tx,
2223 &apq_cpu_fe,
2224 &apq_stub_codec,
2225 &apq_voice,
2226 &apq_voip,
2227 &apq_lpa_pcm,
Krishnankutty Kolathappilly4374e332012-03-18 22:27:30 -07002228 &apq_compr_dsp,
2229 &apq_multi_ch_pcm,
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -08002230 &apq_pcm_hostless,
2231 &apq_cpudai_afe_01_rx,
2232 &apq_cpudai_afe_01_tx,
2233 &apq_cpudai_afe_02_rx,
2234 &apq_cpudai_afe_02_tx,
2235 &apq_pcm_afe,
2236 &apq_cpudai_auxpcm_rx,
2237 &apq_cpudai_auxpcm_tx,
Neema Shetty8427c262012-02-16 11:23:43 -08002238 &apq_cpudai_stub,
Neema Shetty3c9d2862012-03-11 01:25:32 -08002239 &apq_cpudai_slimbus_1_rx,
2240 &apq_cpudai_slimbus_1_tx,
Kiran Kandi97fe19d2012-05-20 22:34:04 -07002241 &apq_cpudai_slimbus_2_rx,
Kiran Kandi1e6371d2012-03-29 11:48:57 -07002242 &apq_cpudai_slimbus_2_tx,
Neema Shettyc9d86c32012-05-09 12:01:39 -07002243 &apq_cpudai_slimbus_3_rx,
Helen Zeng38c3c962012-05-17 14:56:20 -07002244 &apq_cpudai_slimbus_3_tx,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002245 &apq8064_rpm_device,
2246 &apq8064_rpm_log_device,
2247 &apq8064_rpm_stat_device,
Ramesh Masavarapuf31ff242012-05-10 18:55:21 -07002248 &apq_device_tz_log,
Gagan Mac8a7a5d32011-11-11 16:43:06 -07002249 &msm_bus_8064_apps_fabric,
2250 &msm_bus_8064_sys_fabric,
2251 &msm_bus_8064_mm_fabric,
2252 &msm_bus_8064_sys_fpb,
2253 &msm_bus_8064_cpss_fpb,
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08002254 &apq8064_msm_device_vidc,
Stephen Boyd25c4a0b2011-09-20 00:12:36 -07002255 &msm_pil_dsps,
Matt Wagantalled832652012-02-02 19:23:17 -08002256 &msm_8960_riva,
Matt Wagantallb94b9a52012-02-02 21:59:54 -08002257 &msm_8960_q6_lpass,
Stephen Boyd7b973de2012-03-09 12:26:16 -08002258 &msm_pil_vidc,
Matt Wagantall292aace2012-01-26 19:12:34 -08002259 &msm_gss,
Laura Abbottb93525f2012-04-12 09:57:19 -07002260 &apq8064_rtb_device,
Praveen Chidambaram8ea3dcd2011-12-07 14:46:31 -07002261 &apq8064_cpu_idle_device,
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07002262 &apq8064_msm_gov_device,
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08002263 &apq8064_device_cache_erp,
Stepan Moskovchenko0f3de112012-06-08 18:11:46 -07002264 &msm8960_device_ebi1_ch0_erp,
2265 &msm8960_device_ebi1_ch1_erp,
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08002266 &epm_adc_device,
Pratik Patel212ab362012-03-16 12:30:07 -07002267 &apq8064_qdss_device,
2268 &msm_etb_device,
2269 &msm_tpiu_device,
2270 &msm_funnel_device,
2271 &apq8064_etm_device,
Helen Zeng8f925502012-03-05 16:50:17 -08002272 &apq_cpudai_slim_4_rx,
2273 &apq_cpudai_slim_4_tx,
Steve Mucklef132c6c2012-06-06 18:30:57 -07002274#ifdef CONFIG_MSM_GEMINI
Jignesh Mehta921649d2012-04-19 06:57:23 -07002275 &msm8960_gemini_device,
Steve Mucklef132c6c2012-06-06 18:30:57 -07002276#endif
Laura Abbott0577d7b2012-04-17 11:14:30 -07002277 &apq8064_iommu_domain_device,
Siddartha Mohanadoss48cad912012-04-05 21:29:54 -07002278 &msm_tsens_device,
Laura Abbott93a4a352012-05-25 09:26:35 -07002279 &apq8064_cache_dump_device,
Harini Jayaramanc4c58692011-07-19 14:50:10 -06002280};
2281
Joel King4e7ad222011-08-17 15:47:38 -07002282static struct platform_device *sim_devices[] __initdata = {
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07002283 &apq8064_device_uart_gsbi3,
Yan He06913ce2011-08-26 16:33:46 -07002284 &msm_device_sps_apq8064,
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07002285};
2286
2287static struct platform_device *rumi3_devices[] __initdata = {
2288 &apq8064_device_uart_gsbi1,
Yan He435ed612011-11-23 17:34:59 -08002289 &msm_device_sps_apq8064,
Huaibin Yang4a084e32011-12-15 15:25:52 -08002290#ifdef CONFIG_MSM_ROTATOR
2291 &msm_rotator_device,
2292#endif
Joel King4e7ad222011-08-17 15:47:38 -07002293};
2294
Joel King82b7e3f2012-01-05 10:03:27 -08002295static struct platform_device *cdp_devices[] __initdata = {
2296 &apq8064_device_uart_gsbi1,
Jin Hong4bbbfba2012-02-02 21:48:07 -08002297 &apq8064_device_uart_gsbi7,
Joel King82b7e3f2012-01-05 10:03:27 -08002298 &msm_device_sps_apq8064,
Aravind Venkateswaran4ca27532012-02-16 14:27:05 -08002299#ifdef CONFIG_MSM_ROTATOR
2300 &msm_rotator_device,
2301#endif
Joel King82b7e3f2012-01-05 10:03:27 -08002302};
2303
Jay Chokshi1b7eaa92012-04-04 14:53:14 -07002304static struct platform_device
Jay Chokshi1b7eaa92012-04-04 14:53:14 -07002305mpq8064_device_ext_1p2_buck_vreg __devinitdata = {
2306 .name = GPIO_REGULATOR_DEV_NAME,
2307 .id = SX150X_GPIO(4, 2),
2308 .dev = {
2309 .platform_data =
2310 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_1P2V],
2311 },
2312};
2313
2314static struct platform_device
2315mpq8064_device_ext_1p8_buck_vreg __devinitdata = {
2316 .name = GPIO_REGULATOR_DEV_NAME,
2317 .id = SX150X_GPIO(4, 4),
2318 .dev = {
2319 .platform_data =
2320 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_1P8V],
2321 },
2322};
2323
2324static struct platform_device
2325mpq8064_device_ext_2p2_buck_vreg __devinitdata = {
2326 .name = GPIO_REGULATOR_DEV_NAME,
2327 .id = SX150X_GPIO(4, 14),
2328 .dev = {
2329 .platform_data =
2330 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_2P2V],
2331 },
2332};
2333
2334static struct platform_device
2335mpq8064_device_ext_5v_buck_vreg __devinitdata = {
2336 .name = GPIO_REGULATOR_DEV_NAME,
2337 .id = SX150X_GPIO(4, 3),
2338 .dev = {
2339 .platform_data =
2340 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_5V],
2341 },
2342};
2343
2344static struct platform_device
2345mpq8064_device_ext_3p3v_ldo_vreg __devinitdata = {
2346 .name = GPIO_REGULATOR_DEV_NAME,
2347 .id = SX150X_GPIO(4, 15),
2348 .dev = {
2349 .platform_data =
2350 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_3P3V],
2351 },
2352};
2353
Ravi Kumar V1c903012012-05-15 16:11:35 +05302354static struct platform_device rc_input_loopback_pdev = {
2355 .name = "rc-user-input",
2356 .id = -1,
2357};
2358
Ravi Kumar V040eeff2012-05-23 21:29:23 +05302359static int rf4ce_gpio_init(void)
2360{
2361 if (!machine_is_mpq8064_cdp())
2362 return -EINVAL;
2363
2364 /* CC2533 SRDY Input */
2365 if (!gpio_request(SX150X_GPIO(4, 6), "rf4ce_srdy")) {
2366 gpio_direction_input(SX150X_GPIO(4, 6));
2367 gpio_export(SX150X_GPIO(4, 6), true);
2368 }
2369
2370 /* CC2533 MRDY Output */
2371 if (!gpio_request(SX150X_GPIO(4, 5), "rf4ce_mrdy")) {
2372 gpio_direction_output(SX150X_GPIO(4, 5), 1);
2373 gpio_export(SX150X_GPIO(4, 5), true);
2374 }
2375
2376 /* CC2533 Reset Output */
2377 if (!gpio_request(SX150X_GPIO(4, 7), "rf4ce_reset")) {
2378 gpio_direction_output(SX150X_GPIO(4, 7), 0);
2379 gpio_export(SX150X_GPIO(4, 7), true);
2380 }
2381
2382 return 0;
2383}
2384late_initcall(rf4ce_gpio_init);
2385
Jay Chokshi1b7eaa92012-04-04 14:53:14 -07002386static struct platform_device *mpq_devices[] __initdata = {
2387 &msm_device_sps_apq8064,
2388 &mpq8064_device_qup_i2c_gsbi5,
2389#ifdef CONFIG_MSM_ROTATOR
2390 &msm_rotator_device,
2391#endif
Ravi Kumar V05931a22012-04-04 17:09:37 +05302392 &gpio_ir_recv_pdev,
Jay Chokshi1b7eaa92012-04-04 14:53:14 -07002393 &mpq8064_device_ext_1p2_buck_vreg,
2394 &mpq8064_device_ext_1p8_buck_vreg,
2395 &mpq8064_device_ext_2p2_buck_vreg,
2396 &mpq8064_device_ext_5v_buck_vreg,
2397 &mpq8064_device_ext_3p3v_ldo_vreg,
Terence Hampson2e1705f2012-04-11 19:55:29 -04002398#ifdef CONFIG_MSM_VCAP
2399 &msm8064_device_vcap,
2400#endif
Ravi Kumar V1c903012012-05-15 16:11:35 +05302401 &rc_input_loopback_pdev,
Jay Chokshi1b7eaa92012-04-04 14:53:14 -07002402};
2403
Harini Jayaramanc4c58692011-07-19 14:50:10 -06002404static struct msm_spi_platform_data apq8064_qup_spi_gsbi5_pdata = {
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -08002405 .max_clock_speed = 1100000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002406};
2407
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002408#define KS8851_IRQ_GPIO 43
2409
2410static struct spi_board_info spi_board_info[] __initdata = {
2411 {
2412 .modalias = "ks8851",
2413 .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
2414 .max_speed_hz = 19200000,
2415 .bus_num = 0,
2416 .chip_select = 2,
2417 .mode = SPI_MODE_0,
2418 },
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08002419 {
2420 .modalias = "epm_adc",
2421 .max_speed_hz = 1100000,
2422 .bus_num = 0,
2423 .chip_select = 3,
2424 .mode = SPI_MODE_0,
2425 },
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002426};
2427
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06002428static struct slim_boardinfo apq8064_slim_devices[] = {
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08002429 {
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08002430 .bus_num = 1,
2431 .slim_slave = &apq8064_slim_tabla,
2432 },
2433 {
2434 .bus_num = 1,
2435 .slim_slave = &apq8064_slim_tabla20,
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08002436 },
2437 /* add more slimbus slaves as needed */
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06002438};
2439
David Keitel3c40fc52012-02-09 17:53:52 -08002440static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi1_pdata = {
2441 .clk_freq = 100000,
2442 .src_clk_rate = 24000000,
2443};
2444
Jing Lin04601f92012-02-05 15:36:07 -08002445static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi3_pdata = {
Anirudh Ghayalc2163472012-04-10 14:58:14 +05302446 .clk_freq = 384000,
Jing Lin04601f92012-02-05 15:36:07 -08002447 .src_clk_rate = 24000000,
2448};
2449
Kenneth Heitke748593a2011-07-15 15:45:11 -06002450static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi4_pdata = {
2451 .clk_freq = 100000,
2452 .src_clk_rate = 24000000,
Kenneth Heitke748593a2011-07-15 15:45:11 -06002453};
2454
Joel King8f839b92012-04-01 14:37:46 -07002455static struct msm_i2c_platform_data mpq8064_i2c_qup_gsbi5_pdata = {
2456 .clk_freq = 100000,
2457 .src_clk_rate = 24000000,
2458};
2459
David Keitel3c40fc52012-02-09 17:53:52 -08002460#define GSBI_DUAL_MODE_CODE 0x60
2461#define MSM_GSBI1_PHYS 0x12440000
Kenneth Heitke748593a2011-07-15 15:45:11 -06002462static void __init apq8064_i2c_init(void)
2463{
David Keitel3c40fc52012-02-09 17:53:52 -08002464 void __iomem *gsbi_mem;
2465
2466 apq8064_device_qup_i2c_gsbi1.dev.platform_data =
2467 &apq8064_i2c_qup_gsbi1_pdata;
2468 gsbi_mem = ioremap_nocache(MSM_GSBI1_PHYS, 4);
2469 writel_relaxed(GSBI_DUAL_MODE_CODE, gsbi_mem);
2470 /* Ensure protocol code is written before proceeding */
2471 wmb();
2472 iounmap(gsbi_mem);
2473 apq8064_i2c_qup_gsbi1_pdata.use_gsbi_shared_mode = 1;
Jing Lin04601f92012-02-05 15:36:07 -08002474 apq8064_device_qup_i2c_gsbi3.dev.platform_data =
2475 &apq8064_i2c_qup_gsbi3_pdata;
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08002476 apq8064_device_qup_i2c_gsbi1.dev.platform_data =
2477 &apq8064_i2c_qup_gsbi1_pdata;
Kenneth Heitke748593a2011-07-15 15:45:11 -06002478 apq8064_device_qup_i2c_gsbi4.dev.platform_data =
2479 &apq8064_i2c_qup_gsbi4_pdata;
Joel King8f839b92012-04-01 14:37:46 -07002480 mpq8064_device_qup_i2c_gsbi5.dev.platform_data =
2481 &mpq8064_i2c_qup_gsbi5_pdata;
Kenneth Heitke748593a2011-07-15 15:45:11 -06002482}
2483
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -08002484#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002485static int ethernet_init(void)
2486{
2487 int ret;
2488 ret = gpio_request(KS8851_IRQ_GPIO, "ks8851_irq");
2489 if (ret) {
2490 pr_err("ks8851 gpio_request failed: %d\n", ret);
2491 goto fail;
2492 }
2493
2494 return 0;
2495fail:
2496 return ret;
2497}
2498#else
2499static int ethernet_init(void)
2500{
2501 return 0;
2502}
2503#endif
2504
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302505#define GPIO_KEY_HOME PM8921_GPIO_PM_TO_SYS(27)
2506#define GPIO_KEY_VOLUME_UP PM8921_GPIO_PM_TO_SYS(35)
2507#define GPIO_KEY_VOLUME_DOWN PM8921_GPIO_PM_TO_SYS(38)
2508#define GPIO_KEY_CAM_FOCUS PM8921_GPIO_PM_TO_SYS(3)
2509#define GPIO_KEY_CAM_SNAP PM8921_GPIO_PM_TO_SYS(4)
Jing Lin3f8f8422012-03-05 09:32:11 -08002510#define GPIO_KEY_ROTATION PM8921_GPIO_PM_TO_SYS(42)
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302511
2512static struct gpio_keys_button cdp_keys[] = {
2513 {
2514 .code = KEY_HOME,
2515 .gpio = GPIO_KEY_HOME,
2516 .desc = "home_key",
2517 .active_low = 1,
2518 .type = EV_KEY,
2519 .wakeup = 1,
2520 .debounce_interval = 15,
2521 },
2522 {
2523 .code = KEY_VOLUMEUP,
2524 .gpio = GPIO_KEY_VOLUME_UP,
2525 .desc = "volume_up_key",
2526 .active_low = 1,
2527 .type = EV_KEY,
2528 .wakeup = 1,
2529 .debounce_interval = 15,
2530 },
2531 {
2532 .code = KEY_VOLUMEDOWN,
2533 .gpio = GPIO_KEY_VOLUME_DOWN,
2534 .desc = "volume_down_key",
2535 .active_low = 1,
2536 .type = EV_KEY,
2537 .wakeup = 1,
2538 .debounce_interval = 15,
2539 },
2540 {
2541 .code = SW_ROTATE_LOCK,
2542 .gpio = GPIO_KEY_ROTATION,
2543 .desc = "rotate_key",
2544 .active_low = 1,
2545 .type = EV_SW,
2546 .debounce_interval = 15,
2547 },
2548};
2549
2550static struct gpio_keys_platform_data cdp_keys_data = {
2551 .buttons = cdp_keys,
2552 .nbuttons = ARRAY_SIZE(cdp_keys),
2553};
2554
2555static struct platform_device cdp_kp_pdev = {
2556 .name = "gpio-keys",
2557 .id = -1,
2558 .dev = {
2559 .platform_data = &cdp_keys_data,
2560 },
2561};
2562
2563static struct gpio_keys_button mtp_keys[] = {
2564 {
2565 .code = KEY_CAMERA_FOCUS,
2566 .gpio = GPIO_KEY_CAM_FOCUS,
2567 .desc = "cam_focus_key",
2568 .active_low = 1,
2569 .type = EV_KEY,
2570 .wakeup = 1,
2571 .debounce_interval = 15,
2572 },
2573 {
2574 .code = KEY_VOLUMEUP,
2575 .gpio = GPIO_KEY_VOLUME_UP,
2576 .desc = "volume_up_key",
2577 .active_low = 1,
2578 .type = EV_KEY,
2579 .wakeup = 1,
2580 .debounce_interval = 15,
2581 },
2582 {
2583 .code = KEY_VOLUMEDOWN,
2584 .gpio = GPIO_KEY_VOLUME_DOWN,
2585 .desc = "volume_down_key",
2586 .active_low = 1,
2587 .type = EV_KEY,
2588 .wakeup = 1,
2589 .debounce_interval = 15,
2590 },
2591 {
2592 .code = KEY_CAMERA_SNAPSHOT,
2593 .gpio = GPIO_KEY_CAM_SNAP,
2594 .desc = "cam_snap_key",
2595 .active_low = 1,
2596 .type = EV_KEY,
2597 .debounce_interval = 15,
2598 },
2599};
2600
2601static struct gpio_keys_platform_data mtp_keys_data = {
2602 .buttons = mtp_keys,
2603 .nbuttons = ARRAY_SIZE(mtp_keys),
2604};
2605
2606static struct platform_device mtp_kp_pdev = {
2607 .name = "gpio-keys",
2608 .id = -1,
2609 .dev = {
2610 .platform_data = &mtp_keys_data,
2611 },
2612};
2613
Anirudh Ghayal32ea6252012-04-26 16:39:50 +05302614static struct gpio_keys_button mpq_keys[] = {
2615 {
2616 .code = KEY_VOLUMEDOWN,
2617 .gpio = GPIO_KEY_VOLUME_DOWN,
2618 .desc = "volume_down_key",
2619 .active_low = 1,
2620 .type = EV_KEY,
2621 .wakeup = 1,
2622 .debounce_interval = 15,
2623 },
2624 {
2625 .code = KEY_VOLUMEUP,
2626 .gpio = GPIO_KEY_VOLUME_UP,
2627 .desc = "volume_up_key",
2628 .active_low = 1,
2629 .type = EV_KEY,
2630 .wakeup = 1,
2631 .debounce_interval = 15,
2632 },
2633};
2634
2635static struct gpio_keys_platform_data mpq_keys_data = {
2636 .buttons = mpq_keys,
2637 .nbuttons = ARRAY_SIZE(mpq_keys),
2638};
2639
2640static struct platform_device mpq_gpio_keys_pdev = {
2641 .name = "gpio-keys",
2642 .id = -1,
2643 .dev = {
2644 .platform_data = &mpq_keys_data,
2645 },
2646};
2647
2648#define MPQ_KP_ROW_BASE SX150X_EXP2_GPIO_BASE
2649#define MPQ_KP_COL_BASE (SX150X_EXP2_GPIO_BASE + 4)
2650
2651static unsigned int mpq_row_gpios[] = {MPQ_KP_ROW_BASE, MPQ_KP_ROW_BASE + 1,
2652 MPQ_KP_ROW_BASE + 2, MPQ_KP_ROW_BASE + 3};
2653static unsigned int mpq_col_gpios[] = {MPQ_KP_COL_BASE, MPQ_KP_COL_BASE + 1,
2654 MPQ_KP_COL_BASE + 2};
2655
2656static const unsigned int mpq_keymap[] = {
2657 KEY(0, 0, KEY_UP),
2658 KEY(0, 1, KEY_ENTER),
2659 KEY(0, 2, KEY_3),
2660
2661 KEY(1, 0, KEY_DOWN),
2662 KEY(1, 1, KEY_EXIT),
2663 KEY(1, 2, KEY_4),
2664
2665 KEY(2, 0, KEY_LEFT),
2666 KEY(2, 1, KEY_1),
2667 KEY(2, 2, KEY_5),
2668
2669 KEY(3, 0, KEY_RIGHT),
2670 KEY(3, 1, KEY_2),
2671 KEY(3, 2, KEY_6),
2672};
2673
2674static struct matrix_keymap_data mpq_keymap_data = {
2675 .keymap_size = ARRAY_SIZE(mpq_keymap),
2676 .keymap = mpq_keymap,
2677};
2678
2679static struct matrix_keypad_platform_data mpq_keypad_data = {
2680 .keymap_data = &mpq_keymap_data,
2681 .row_gpios = mpq_row_gpios,
2682 .col_gpios = mpq_col_gpios,
2683 .num_row_gpios = ARRAY_SIZE(mpq_row_gpios),
2684 .num_col_gpios = ARRAY_SIZE(mpq_col_gpios),
2685 .col_scan_delay_us = 32000,
2686 .debounce_ms = 20,
2687 .wakeup = 1,
2688 .active_low = 1,
2689 .no_autorepeat = 1,
2690};
2691
2692static struct platform_device mpq_keypad_device = {
2693 .name = "matrix-keypad",
2694 .id = -1,
2695 .dev = {
2696 .platform_data = &mpq_keypad_data,
2697 },
2698};
2699
Jin Hongd3024e62012-02-09 16:13:32 -08002700/* Sensors DSPS platform data */
2701#define DSPS_PIL_GENERIC_NAME "dsps"
2702static void __init apq8064_init_dsps(void)
2703{
2704 struct msm_dsps_platform_data *pdata =
2705 msm_dsps_device_8064.dev.platform_data;
2706 pdata->pil_name = DSPS_PIL_GENERIC_NAME;
2707 pdata->gpios = NULL;
2708 pdata->gpios_num = 0;
2709
2710 platform_device_register(&msm_dsps_device_8064);
2711}
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302712
Jing Lin417fa452012-02-05 14:31:06 -08002713#define I2C_SURF 1
2714#define I2C_FFA (1 << 1)
2715#define I2C_RUMI (1 << 2)
2716#define I2C_SIM (1 << 3)
2717#define I2C_LIQUID (1 << 4)
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002718#define I2C_MPQ_CDP BIT(5)
2719#define I2C_MPQ_HRD BIT(6)
2720#define I2C_MPQ_DTV BIT(7)
Jing Lin417fa452012-02-05 14:31:06 -08002721
2722struct i2c_registry {
2723 u8 machs;
2724 int bus;
2725 struct i2c_board_info *info;
2726 int len;
2727};
2728
2729static struct i2c_registry apq8064_i2c_devices[] __initdata = {
Jing Lin21ed4de2012-02-05 15:53:28 -08002730 {
David Keitel2f613d92012-02-15 11:29:16 -08002731 I2C_LIQUID,
2732 APQ_8064_GSBI1_QUP_I2C_BUS_ID,
2733 smb349_charger_i2c_info,
2734 ARRAY_SIZE(smb349_charger_i2c_info)
2735 },
2736 {
Jing Lin21ed4de2012-02-05 15:53:28 -08002737 I2C_SURF | I2C_LIQUID,
2738 APQ_8064_GSBI3_QUP_I2C_BUS_ID,
2739 mxt_device_info,
2740 ARRAY_SIZE(mxt_device_info),
2741 },
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08002742 {
2743 I2C_FFA,
2744 APQ_8064_GSBI3_QUP_I2C_BUS_ID,
2745 cyttsp_info,
2746 ARRAY_SIZE(cyttsp_info),
2747 },
Amy Maloche70090f992012-02-16 16:35:26 -08002748 {
2749 I2C_FFA | I2C_LIQUID,
2750 APQ_8064_GSBI1_QUP_I2C_BUS_ID,
2751 isa1200_board_info,
2752 ARRAY_SIZE(isa1200_board_info),
2753 },
Santosh Mardieff9a742012-04-09 23:23:39 +05302754 {
2755 I2C_MPQ_CDP,
2756 APQ_8064_GSBI5_QUP_I2C_BUS_ID,
2757 cs8427_device_info,
2758 ARRAY_SIZE(cs8427_device_info),
2759 },
Jing Lin417fa452012-02-05 14:31:06 -08002760};
2761
Jay Chokshi607f61b2012-04-25 18:21:21 -07002762#define SX150X_EXP1_INT_N PM8921_MPP_IRQ(PM8921_IRQ_BASE, 9)
Anirudh Ghayal9f1aaa72012-04-26 18:15:08 +05302763#define SX150X_EXP2_INT_N MSM_GPIO_TO_INT(81)
Jay Chokshi607f61b2012-04-25 18:21:21 -07002764
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002765struct sx150x_platform_data mpq8064_sx150x_pdata[] = {
2766 [SX150X_EXP1] = {
2767 .gpio_base = SX150X_EXP1_GPIO_BASE,
2768 .oscio_is_gpo = false,
2769 .io_pullup_ena = 0x0,
2770 .io_pulldn_ena = 0x0,
2771 .io_open_drain_ena = 0x0,
2772 .io_polarity = 0,
Jay Chokshi607f61b2012-04-25 18:21:21 -07002773 .irq_summary = SX150X_EXP1_INT_N,
2774 .irq_base = SX150X_EXP1_IRQ_BASE,
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002775 },
2776 [SX150X_EXP2] = {
2777 .gpio_base = SX150X_EXP2_GPIO_BASE,
2778 .oscio_is_gpo = false,
Anirudh Ghayal32ea6252012-04-26 16:39:50 +05302779 .io_pullup_ena = 0x0f,
2780 .io_pulldn_ena = 0x70,
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002781 .io_open_drain_ena = 0x0,
2782 .io_polarity = 0,
Anirudh Ghayal9f1aaa72012-04-26 18:15:08 +05302783 .irq_summary = SX150X_EXP2_INT_N,
2784 .irq_base = SX150X_EXP2_IRQ_BASE,
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002785 },
2786 [SX150X_EXP3] = {
2787 .gpio_base = SX150X_EXP3_GPIO_BASE,
2788 .oscio_is_gpo = false,
2789 .io_pullup_ena = 0x0,
2790 .io_pulldn_ena = 0x0,
2791 .io_open_drain_ena = 0x0,
2792 .io_polarity = 0,
2793 .irq_summary = -1,
2794 },
2795 [SX150X_EXP4] = {
2796 .gpio_base = SX150X_EXP4_GPIO_BASE,
2797 .oscio_is_gpo = false,
2798 .io_pullup_ena = 0x0,
2799 .io_pulldn_ena = 0x0,
2800 .io_open_drain_ena = 0x0,
2801 .io_polarity = 0,
2802 .irq_summary = -1,
2803 },
2804};
2805
2806static struct i2c_board_info sx150x_gpio_exp_info[] = {
2807 {
2808 I2C_BOARD_INFO("sx1509q", 0x70),
2809 .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP1],
2810 },
2811 {
2812 I2C_BOARD_INFO("sx1508q", 0x23),
2813 .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP2],
2814 },
2815 {
2816 I2C_BOARD_INFO("sx1508q", 0x22),
2817 .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP3],
2818 },
2819 {
2820 I2C_BOARD_INFO("sx1509q", 0x3E),
2821 .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP4],
2822 },
2823};
2824
2825#define MPQ8064_I2C_GSBI5_BUS_ID 5
2826
2827static struct i2c_registry mpq8064_i2c_devices[] __initdata = {
2828 {
2829 I2C_MPQ_CDP,
2830 MPQ8064_I2C_GSBI5_BUS_ID,
2831 sx150x_gpio_exp_info,
2832 ARRAY_SIZE(sx150x_gpio_exp_info),
2833 },
2834};
2835
Jing Lin417fa452012-02-05 14:31:06 -08002836static void __init register_i2c_devices(void)
2837{
2838 u8 mach_mask = 0;
2839 int i;
2840
Kevin Chand07220e2012-02-13 15:52:22 -08002841#ifdef CONFIG_MSM_CAMERA
2842 struct i2c_registry apq8064_camera_i2c_devices = {
2843 I2C_SURF | I2C_FFA | I2C_LIQUID | I2C_RUMI,
2844 APQ_8064_GSBI4_QUP_I2C_BUS_ID,
2845 apq8064_camera_board_info.board_info,
2846 apq8064_camera_board_info.num_i2c_board_info,
2847 };
2848#endif
Jing Lin417fa452012-02-05 14:31:06 -08002849 /* Build the matching 'supported_machs' bitmask */
2850 if (machine_is_apq8064_cdp())
2851 mach_mask = I2C_SURF;
2852 else if (machine_is_apq8064_mtp())
2853 mach_mask = I2C_FFA;
2854 else if (machine_is_apq8064_liquid())
2855 mach_mask = I2C_LIQUID;
2856 else if (machine_is_apq8064_rumi3())
2857 mach_mask = I2C_RUMI;
2858 else if (machine_is_apq8064_sim())
2859 mach_mask = I2C_SIM;
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002860 else if (PLATFORM_IS_MPQ8064())
2861 mach_mask = I2C_MPQ_CDP;
Jing Lin417fa452012-02-05 14:31:06 -08002862 else
2863 pr_err("unmatched machine ID in register_i2c_devices\n");
2864
2865 /* Run the array and install devices as appropriate */
2866 for (i = 0; i < ARRAY_SIZE(apq8064_i2c_devices); ++i) {
2867 if (apq8064_i2c_devices[i].machs & mach_mask)
2868 i2c_register_board_info(apq8064_i2c_devices[i].bus,
2869 apq8064_i2c_devices[i].info,
2870 apq8064_i2c_devices[i].len);
2871 }
Kevin Chand07220e2012-02-13 15:52:22 -08002872#ifdef CONFIG_MSM_CAMERA
2873 if (apq8064_camera_i2c_devices.machs & mach_mask)
2874 i2c_register_board_info(apq8064_camera_i2c_devices.bus,
2875 apq8064_camera_i2c_devices.info,
2876 apq8064_camera_i2c_devices.len);
2877#endif
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002878
2879 for (i = 0; i < ARRAY_SIZE(mpq8064_i2c_devices); ++i) {
2880 if (mpq8064_i2c_devices[i].machs & mach_mask)
2881 i2c_register_board_info(
2882 mpq8064_i2c_devices[i].bus,
2883 mpq8064_i2c_devices[i].info,
2884 mpq8064_i2c_devices[i].len);
2885 }
Jing Lin417fa452012-02-05 14:31:06 -08002886}
2887
Jay Chokshi994ff122012-03-27 15:43:48 -07002888static void enable_ddr3_regulator(void)
2889{
2890 static struct regulator *ext_ddr3;
2891
2892 /* Use MPP7 output state as a flag for PCDDR3 presence. */
2893 if (gpio_get_value_cansleep(PM8921_MPP_PM_TO_SYS(7)) > 0) {
2894 ext_ddr3 = regulator_get(NULL, "ext_ddr3");
2895 if (IS_ERR(ext_ddr3) || ext_ddr3 == NULL)
2896 pr_err("Could not get MPP7 regulator\n");
2897 else
2898 regulator_enable(ext_ddr3);
2899 }
2900}
2901
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002902static void enable_avc_i2c_bus(void)
2903{
2904 int avc_i2c_en_mpp = PM8921_MPP_PM_TO_SYS(8);
2905 int rc;
2906
2907 rc = gpio_request(avc_i2c_en_mpp, "avc_i2c_en");
2908 if (rc)
2909 pr_err("request for avc_i2c_en mpp failed,"
2910 "rc=%d\n", rc);
2911 else
2912 gpio_set_value_cansleep(avc_i2c_en_mpp, 1);
2913}
2914
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002915static void __init apq8064_common_init(void)
2916{
Joel King8f839b92012-04-01 14:37:46 -07002917 msm_tsens_early_init(&apq_tsens_pdata);
Praveen Chidambaram877d7a42012-06-05 14:33:20 -06002918 msm_thermal_init(&msm_thermal_pdata);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002919 if (socinfo_init() < 0)
2920 pr_err("socinfo_init() failed!\n");
Praveen Chidambaram78499012011-11-01 17:15:17 -06002921 BUG_ON(msm_rpm_init(&apq8064_rpm_data));
2922 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
David Collins2782b5c2012-02-06 10:02:42 -08002923 regulator_suppress_info_printing();
2924 platform_device_register(&apq8064_device_rpm_regulator);
Stephen Boyd4d0d2582012-02-10 14:49:40 -08002925 if (msm_xo_init())
2926 pr_err("Failed to initialize XO votes\n");
Matt Wagantallc51e5602012-02-27 17:25:25 -08002927 msm_clock_init(&apq8064_clock_init_data);
Stepan Moskovchenko2327a952011-12-14 16:31:28 -08002928 apq8064_init_gpiomux();
Kenneth Heitke748593a2011-07-15 15:45:11 -06002929 apq8064_i2c_init();
Jing Lin417fa452012-02-05 14:31:06 -08002930 register_i2c_devices();
Kenneth Heitke36920d32011-07-20 16:44:30 -06002931
Harini Jayaramanc4c58692011-07-19 14:50:10 -06002932 apq8064_device_qup_spi_gsbi5.dev.platform_data =
2933 &apq8064_qup_spi_gsbi5_pdata;
Stepan Moskovchenkoc1074f02011-12-14 17:51:57 -08002934 apq8064_init_pmic();
Hemant Kumar94e7da22012-02-03 16:52:29 -08002935 if (machine_is_apq8064_liquid())
2936 msm_otg_pdata.mhl_enable = true;
Vamsi Krishnad9863eb2012-03-26 17:34:48 -07002937
Ofir Cohen94213a72012-05-03 14:26:32 +03002938 android_usb_pdata.swfi_latency =
2939 msm_rpmrs_levels[0].latency_us;
Vamsi Krishnad9863eb2012-03-26 17:34:48 -07002940
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002941 apq8064_device_otg.dev.platform_data = &msm_otg_pdata;
Manu Gautam91223e02011-11-08 15:27:22 +05302942 apq8064_ehci_host_init();
Gagan Mac8a7a5d32011-11-11 16:43:06 -07002943 apq8064_init_buses();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002944 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Terence Hampson36b70722012-05-10 13:18:16 -04002945 if (!(machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
2946 machine_is_mpq8064_dtv()))
2947 platform_add_devices(common_not_mpq_devices,
2948 ARRAY_SIZE(common_not_mpq_devices));
Jay Chokshi994ff122012-03-27 15:43:48 -07002949 enable_ddr3_regulator();
Hemant Kumarf1ca9192012-02-07 18:59:33 -08002950 if (machine_is_apq8064_mtp()) {
2951 apq8064_device_hsic_host.dev.platform_data = &msm_hsic_pdata;
2952 device_initialize(&apq8064_device_hsic_host.dev);
2953 }
Jay Chokshie8741282012-01-25 15:22:55 -08002954 apq8064_pm8xxx_gpio_mpp_init();
Sahitya Tummala3586ed92011-08-03 09:13:23 +05302955 apq8064_init_mmc();
Swaminathan Sathappan144b4882012-02-06 17:01:20 -08002956
2957 if (machine_is_apq8064_mtp()) {
2958 mdm_8064_device.dev.platform_data = &mdm_platform_data;
2959 platform_device_register(&mdm_8064_device);
2960 }
2961 platform_device_register(&apq8064_slim_ctrl);
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06002962 slim_register_board_info(apq8064_slim_devices,
2963 ARRAY_SIZE(apq8064_slim_devices));
Jin Hongd3024e62012-02-09 16:13:32 -08002964 apq8064_init_dsps();
Praveen Chidambaram78499012011-11-01 17:15:17 -06002965 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
2966 msm_spm_l2_init(msm_spm_l2_data);
Praveen Chidambaram78499012011-11-01 17:15:17 -06002967 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Praveen Chidambaram4d19be42012-04-03 18:05:52 -06002968 msm_pm_init_sleep_status_data(&msm_pm_slp_sts_data);
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08002969 apq8064_epm_adc_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002970}
2971
Huaibin Yang4a084e32011-12-15 15:25:52 -08002972static void __init apq8064_allocate_memory_regions(void)
2973{
2974 apq8064_allocate_fb_region();
2975}
2976
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002977static void __init apq8064_sim_init(void)
2978{
Jeff Ohlstein7e668552011-10-06 16:17:25 -07002979 struct msm_watchdog_pdata *wdog_pdata = (struct msm_watchdog_pdata *)
2980 &msm8064_device_watchdog.dev.platform_data;
2981
2982 wdog_pdata->bark_time = 15000;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002983 apq8064_common_init();
Joel King4e7ad222011-08-17 15:47:38 -07002984 platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices));
2985}
2986
2987static void __init apq8064_rumi3_init(void)
2988{
2989 apq8064_common_init();
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002990 ethernet_init();
Olav Hauganef95ae32012-05-15 09:50:30 -07002991 msm_rotator_set_split_iommu_domain();
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07002992 platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002993 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002994}
2995
Joel King82b7e3f2012-01-05 10:03:27 -08002996static void __init apq8064_cdp_init(void)
2997{
Hanumant Singh50440d42012-04-23 19:27:16 -07002998 if (meminfo_init(SYS_MEMORY, SZ_256M) < 0)
2999 pr_err("meminfo_init() failed!\n");
Joel King82b7e3f2012-01-05 10:03:27 -08003000 apq8064_common_init();
Joel King8f839b92012-04-01 14:37:46 -07003001 if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
3002 machine_is_mpq8064_dtv()) {
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07003003 enable_avc_i2c_bus();
Olav Hauganef95ae32012-05-15 09:50:30 -07003004 msm_rotator_set_split_iommu_domain();
Joel King8f839b92012-04-01 14:37:46 -07003005 platform_add_devices(mpq_devices, ARRAY_SIZE(mpq_devices));
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06003006 mpq8064_pcie_init();
Joel King8f839b92012-04-01 14:37:46 -07003007 } else {
3008 ethernet_init();
Olav Hauganef95ae32012-05-15 09:50:30 -07003009 msm_rotator_set_split_iommu_domain();
Joel King8f839b92012-04-01 14:37:46 -07003010 platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
3011 spi_register_board_info(spi_board_info,
3012 ARRAY_SIZE(spi_board_info));
3013 }
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08003014 apq8064_init_fb();
Jordan Crouseb3115fe2012-02-01 22:11:12 -07003015 apq8064_init_gpu();
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07003016 platform_add_devices(apq8064_footswitch, apq8064_num_footswitch);
Steve Mucklef132c6c2012-06-06 18:30:57 -07003017#ifdef CONFIG_MSM_CAMERA
Kevin Chand07220e2012-02-13 15:52:22 -08003018 apq8064_init_cam();
Steve Mucklef132c6c2012-06-06 18:30:57 -07003019#endif
Mohan Pallaka474b94b2012-01-25 12:59:58 +05303020
3021 if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
3022 platform_device_register(&cdp_kp_pdev);
3023
3024 if (machine_is_apq8064_mtp())
3025 platform_device_register(&mtp_kp_pdev);
Hanumant Singh50440d42012-04-23 19:27:16 -07003026
3027 change_memory_power = &apq8064_change_memory_power;
Anirudh Ghayal32ea6252012-04-26 16:39:50 +05303028
3029 if (machine_is_mpq8064_cdp()) {
3030 platform_device_register(&mpq_gpio_keys_pdev);
3031 platform_device_register(&mpq_keypad_device);
3032 }
Joel King82b7e3f2012-01-05 10:03:27 -08003033}
3034
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003035MACHINE_START(APQ8064_SIM, "QCT APQ8064 SIMULATOR")
3036 .map_io = apq8064_map_io,
Kevin Chan13be4e22011-10-20 11:30:32 -07003037 .reserve = apq8064_reserve,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003038 .init_irq = apq8064_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05303039 .handle_irq = gic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003040 .timer = &msm_timer,
3041 .init_machine = apq8064_sim_init,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003042 .restart = msm_restart,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003043MACHINE_END
3044
Joel King4e7ad222011-08-17 15:47:38 -07003045MACHINE_START(APQ8064_RUMI3, "QCT APQ8064 RUMI3")
3046 .map_io = apq8064_map_io,
Kevin Chan13be4e22011-10-20 11:30:32 -07003047 .reserve = apq8064_reserve,
Joel King4e7ad222011-08-17 15:47:38 -07003048 .init_irq = apq8064_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05303049 .handle_irq = gic_handle_irq,
Joel King4e7ad222011-08-17 15:47:38 -07003050 .timer = &msm_timer,
3051 .init_machine = apq8064_rumi3_init,
Huaibin Yang4a084e32011-12-15 15:25:52 -08003052 .init_early = apq8064_allocate_memory_regions,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003053 .restart = msm_restart,
Joel King4e7ad222011-08-17 15:47:38 -07003054MACHINE_END
3055
Joel King82b7e3f2012-01-05 10:03:27 -08003056MACHINE_START(APQ8064_CDP, "QCT APQ8064 CDP")
3057 .map_io = apq8064_map_io,
3058 .reserve = apq8064_reserve,
3059 .init_irq = apq8064_init_irq,
3060 .handle_irq = gic_handle_irq,
3061 .timer = &msm_timer,
3062 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08003063 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07003064 .init_very_early = apq8064_early_reserve,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003065 .restart = msm_restart,
Joel King82b7e3f2012-01-05 10:03:27 -08003066MACHINE_END
3067
3068MACHINE_START(APQ8064_MTP, "QCT APQ8064 MTP")
3069 .map_io = apq8064_map_io,
3070 .reserve = apq8064_reserve,
3071 .init_irq = apq8064_init_irq,
3072 .handle_irq = gic_handle_irq,
3073 .timer = &msm_timer,
3074 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08003075 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07003076 .init_very_early = apq8064_early_reserve,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003077 .restart = msm_restart,
Joel King82b7e3f2012-01-05 10:03:27 -08003078MACHINE_END
3079
3080MACHINE_START(APQ8064_LIQUID, "QCT APQ8064 LIQUID")
3081 .map_io = apq8064_map_io,
3082 .reserve = apq8064_reserve,
3083 .init_irq = apq8064_init_irq,
3084 .handle_irq = gic_handle_irq,
3085 .timer = &msm_timer,
3086 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08003087 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07003088 .init_very_early = apq8064_early_reserve,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003089 .restart = msm_restart,
Joel King82b7e3f2012-01-05 10:03:27 -08003090MACHINE_END
3091
Joel King064bbf82012-04-01 13:23:39 -07003092MACHINE_START(MPQ8064_CDP, "QCT MPQ8064 CDP")
3093 .map_io = apq8064_map_io,
3094 .reserve = apq8064_reserve,
3095 .init_irq = apq8064_init_irq,
3096 .handle_irq = gic_handle_irq,
3097 .timer = &msm_timer,
3098 .init_machine = apq8064_cdp_init,
3099 .init_early = apq8064_allocate_memory_regions,
3100 .init_very_early = apq8064_early_reserve,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003101 .restart = msm_restart,
Joel King064bbf82012-04-01 13:23:39 -07003102MACHINE_END
3103
Joel King11ca8202012-02-13 16:19:03 -08003104MACHINE_START(MPQ8064_HRD, "QCT MPQ8064 HRD")
3105 .map_io = apq8064_map_io,
3106 .reserve = apq8064_reserve,
3107 .init_irq = apq8064_init_irq,
3108 .handle_irq = gic_handle_irq,
3109 .timer = &msm_timer,
3110 .init_machine = apq8064_cdp_init,
Joel King3a57e772012-05-28 11:22:55 -07003111 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07003112 .init_very_early = apq8064_early_reserve,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003113 .restart = msm_restart,
Joel King11ca8202012-02-13 16:19:03 -08003114MACHINE_END
3115
3116MACHINE_START(MPQ8064_DTV, "QCT MPQ8064 DTV")
3117 .map_io = apq8064_map_io,
3118 .reserve = apq8064_reserve,
3119 .init_irq = apq8064_init_irq,
3120 .handle_irq = gic_handle_irq,
3121 .timer = &msm_timer,
3122 .init_machine = apq8064_cdp_init,
Joel King3a57e772012-05-28 11:22:55 -07003123 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07003124 .init_very_early = apq8064_early_reserve,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003125 .restart = msm_restart,
Joel King11ca8202012-02-13 16:19:03 -08003126MACHINE_END
3127