blob: beed02d4099c50bb58a8149dfcf4648e0e197bd2 [file] [log] [blame]
Manu Gautam5143b252012-01-05 19:25:23 -08001/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13#include <linux/kernel.h>
14#include <linux/platform_device.h>
15#include <linux/io.h>
16#include <linux/irq.h>
Kenneth Heitke748593a2011-07-15 15:45:11 -060017#include <linux/i2c.h>
David Keitel2f613d92012-02-15 11:29:16 -080018#include <linux/i2c/smb349.h>
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -080019#include <linux/i2c/sx150x.h>
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -060020#include <linux/slimbus/slimbus.h>
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +053021#include <linux/mfd/wcd9xxx/core.h>
22#include <linux/mfd/wcd9xxx/pdata.h>
Amy Maloche70090f992012-02-16 16:35:26 -080023#include <linux/mfd/pm8xxx/misc.h>
Kenneth Heitke36920d32011-07-20 16:44:30 -060024#include <linux/msm_ssbi.h>
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -070025#include <linux/spi/spi.h>
Ramesh Masavarapu28311912011-10-27 11:04:12 -070026#include <linux/dma-mapping.h>
27#include <linux/platform_data/qcom_crypto_device.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080028#include <linux/ion.h>
Jack Cheung46bfffa2012-01-19 15:26:24 -080029#include <linux/memory.h>
Jing Lin21ed4de2012-02-05 15:53:28 -080030#include <linux/i2c/atmel_mxt_ts.h>
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -080031#include <linux/cyttsp.h>
Amy Maloche70090f992012-02-16 16:35:26 -080032#include <linux/i2c/isa1200.h>
Mohan Pallaka474b94b2012-01-25 12:59:58 +053033#include <linux/gpio_keys.h>
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -080034#include <linux/epm_adc.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070035#include <asm/mach-types.h>
36#include <asm/mach/arch.h>
37#include <asm/hardware/gic.h>
Sahitya Tummala3586ed92011-08-03 09:13:23 +053038#include <asm/mach/mmc.h>
Ankit Verma6b7e2ba2012-01-26 15:48:54 -080039#include <linux/platform_data/qcom_wcnss_device.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070040
41#include <mach/board.h>
42#include <mach/msm_iomap.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080043#include <mach/ion.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070044#include <linux/usb/msm_hsusb.h>
45#include <linux/usb/android.h>
46#include <mach/socinfo.h>
Harini Jayaramanc4c58692011-07-19 14:50:10 -060047#include <mach/msm_spi.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070048#include "timer.h"
49#include "devices.h"
Joel King4ebccc62011-07-22 09:43:22 -070050#include <mach/gpio.h>
51#include <mach/gpiomux.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060052#include <mach/rpm.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080053#ifdef CONFIG_ANDROID_PMEM
Kevin Chan13be4e22011-10-20 11:30:32 -070054#include <linux/android_pmem.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080055#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070056#include <mach/msm_memtypes.h>
57#include <linux/bootmem.h>
58#include <asm/setup.h>
Ramesh Masavarapu28311912011-10-27 11:04:12 -070059#include <mach/dma.h>
Jin Hongd3024e62012-02-09 16:13:32 -080060#include <mach/msm_dsps.h>
Gagan Mac8a7a5d32011-11-11 16:43:06 -070061#include <mach/msm_bus_board.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060062#include <mach/cpuidle.h>
Joel Kingdacbc822012-01-25 13:30:57 -080063#include <mach/mdm2.h>
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -080064#include <linux/msm_tsens.h>
Stephen Boyd4d0d2582012-02-10 14:49:40 -080065#include <mach/msm_xo.h>
Laura Abbott350c8362012-02-28 14:46:52 -080066#include <mach/msm_rtb.h>
Joel King4ebccc62011-07-22 09:43:22 -070067
Jeff Ohlstein7e668552011-10-06 16:17:25 -070068#include "msm_watchdog.h"
Stepan Moskovchenko5a83dba2011-12-05 17:30:17 -080069#include "board-8064.h"
Vikram Mulukutlabc2e9572011-11-04 03:41:38 -070070#include "acpuclock.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060071#include "spm.h"
72#include "mpm.h"
73#include "rpm_resources.h"
Matt Wagantall7cca4642012-02-01 16:43:24 -080074#include "pm.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060075#include "pm-boot.h"
Rajesh Sastrulaaee8af32012-01-20 11:46:31 -080076#include "devices-msm8x60.h"
Jay Chokshiea67c622011-07-29 17:12:26 -070077
Olav Haugan7c6aa742012-01-16 16:47:37 -080078#define MSM_PMEM_ADSP_SIZE 0x7800000
Bharath Ramachandramurthy2fd017a2012-03-13 10:21:09 -070079#define MSM_PMEM_AUDIO_SIZE 0x4CF000
Olav Haugan7c6aa742012-01-16 16:47:37 -080080#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
81#define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
82#else
Chetan Kalyan72aac4f2012-02-23 14:56:54 -080083#define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
Olav Haugan7c6aa742012-01-16 16:47:37 -080084#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070085
Olav Haugan7c6aa742012-01-16 16:47:37 -080086#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Bharath Ramachandramurthy2fd017a2012-03-13 10:21:09 -070087#define MSM_PMEM_KERNEL_EBI1_SIZE 0x65000
Olav Haugan7c6aa742012-01-16 16:47:37 -080088#define MSM_ION_SF_SIZE MSM_PMEM_SIZE
Olav Haugand3d29682012-01-19 10:57:07 -080089#define MSM_ION_MM_FW_SIZE 0x200000 /* (2MB) */
Olav Haugan7c6aa742012-01-16 16:47:37 -080090#define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE
Olav Haugan3a9bd232012-02-15 14:23:27 -080091#define MSM_ION_QSECOM_SIZE 0x300000 /* (3MB) */
Olav Haugan7c6aa742012-01-16 16:47:37 -080092#define MSM_ION_MFC_SIZE SZ_8K
Olav Haugan2c43fac2012-01-19 11:06:37 -080093#define MSM_ION_AUDIO_SIZE MSM_PMEM_AUDIO_SIZE
94#define MSM_ION_HEAP_NUM 8
Olav Haugan7c6aa742012-01-16 16:47:37 -080095#else
96#define MSM_PMEM_KERNEL_EBI1_SIZE 0x110C000
97#define MSM_ION_HEAP_NUM 1
98#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070099
Siddartha Mohanadoss9c658982012-02-28 15:11:48 -0800100#define GPIO_EXPANDER_IRQ_BASE (PM8821_IRQ_BASE + PM8821_NR_IRQS)
101#define GPIO_EXPANDER_GPIO_BASE (PM8821_MPP_BASE + PM8821_NR_MPPS)
102#define GPIO_EPM_EXPANDER_BASE GPIO_EXPANDER_GPIO_BASE
103
104enum {
105 SX150X_EPM,
106};
107
Olav Haugan7c6aa742012-01-16 16:47:37 -0800108#ifdef CONFIG_KERNEL_PMEM_EBI_REGION
109static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE;
110static int __init pmem_kernel_ebi1_size_setup(char *p)
Kevin Chan13be4e22011-10-20 11:30:32 -0700111{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800112 pmem_kernel_ebi1_size = memparse(p, NULL);
113 return 0;
Kevin Chan13be4e22011-10-20 11:30:32 -0700114}
Olav Haugan7c6aa742012-01-16 16:47:37 -0800115early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup);
116#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700117
Olav Haugan7c6aa742012-01-16 16:47:37 -0800118#ifdef CONFIG_ANDROID_PMEM
Kevin Chan13be4e22011-10-20 11:30:32 -0700119static unsigned pmem_size = MSM_PMEM_SIZE;
120static int __init pmem_size_setup(char *p)
121{
122 pmem_size = memparse(p, NULL);
123 return 0;
124}
125early_param("pmem_size", pmem_size_setup);
126
127static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
128
129static int __init pmem_adsp_size_setup(char *p)
130{
131 pmem_adsp_size = memparse(p, NULL);
132 return 0;
133}
134early_param("pmem_adsp_size", pmem_adsp_size_setup);
135
136static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
137
138static int __init pmem_audio_size_setup(char *p)
139{
140 pmem_audio_size = memparse(p, NULL);
141 return 0;
142}
143early_param("pmem_audio_size", pmem_audio_size_setup);
Olav Haugan7c6aa742012-01-16 16:47:37 -0800144#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700145
Olav Haugan7c6aa742012-01-16 16:47:37 -0800146#ifdef CONFIG_ANDROID_PMEM
147#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700148static struct android_pmem_platform_data android_pmem_pdata = {
149 .name = "pmem",
150 .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING,
151 .cached = 1,
152 .memory_type = MEMTYPE_EBI1,
153};
154
155static struct platform_device android_pmem_device = {
156 .name = "android_pmem",
157 .id = 0,
158 .dev = {.platform_data = &android_pmem_pdata},
159};
160
161static struct android_pmem_platform_data android_pmem_adsp_pdata = {
162 .name = "pmem_adsp",
163 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
164 .cached = 0,
165 .memory_type = MEMTYPE_EBI1,
166};
Kevin Chan13be4e22011-10-20 11:30:32 -0700167static struct platform_device android_pmem_adsp_device = {
168 .name = "android_pmem",
169 .id = 2,
170 .dev = { .platform_data = &android_pmem_adsp_pdata },
171};
172
173static struct android_pmem_platform_data android_pmem_audio_pdata = {
174 .name = "pmem_audio",
175 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
176 .cached = 0,
177 .memory_type = MEMTYPE_EBI1,
178};
179
180static struct platform_device android_pmem_audio_device = {
181 .name = "android_pmem",
182 .id = 4,
183 .dev = { .platform_data = &android_pmem_audio_pdata },
184};
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700185#endif /* CONFIG_MSM_MULTIMEDIA_USE_ION */
186#endif /* CONFIG_ANDROID_PMEM */
Olav Haugan7c6aa742012-01-16 16:47:37 -0800187
188static struct memtype_reserve apq8064_reserve_table[] __initdata = {
189 [MEMTYPE_SMI] = {
190 },
191 [MEMTYPE_EBI0] = {
192 .flags = MEMTYPE_FLAGS_1M_ALIGN,
193 },
194 [MEMTYPE_EBI1] = {
195 .flags = MEMTYPE_FLAGS_1M_ALIGN,
196 },
197};
Kevin Chan13be4e22011-10-20 11:30:32 -0700198
Laura Abbott350c8362012-02-28 14:46:52 -0800199#if defined(CONFIG_MSM_RTB)
200static struct msm_rtb_platform_data msm_rtb_pdata = {
201 .size = SZ_1M,
202};
203
204static int __init msm_rtb_set_buffer_size(char *p)
205{
206 int s;
207
208 s = memparse(p, NULL);
209 msm_rtb_pdata.size = ALIGN(s, SZ_4K);
210 return 0;
211}
212early_param("msm_rtb_size", msm_rtb_set_buffer_size);
213
214
215static struct platform_device msm_rtb_device = {
216 .name = "msm_rtb",
217 .id = -1,
218 .dev = {
219 .platform_data = &msm_rtb_pdata,
220 },
221};
222#endif
223
224static void __init reserve_rtb_memory(void)
225{
226#if defined(CONFIG_MSM_RTB)
227 apq8064_reserve_table[MEMTYPE_EBI1].size += msm_rtb_pdata.size;
228#endif
229}
230
231
Kevin Chan13be4e22011-10-20 11:30:32 -0700232static void __init size_pmem_devices(void)
233{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800234#ifdef CONFIG_ANDROID_PMEM
235#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700236 android_pmem_adsp_pdata.size = pmem_adsp_size;
237 android_pmem_pdata.size = pmem_size;
238 android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE;
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700239#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
240#endif /*CONFIG_ANDROID_PMEM*/
Kevin Chan13be4e22011-10-20 11:30:32 -0700241}
242
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700243#ifdef CONFIG_ANDROID_PMEM
244#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700245static void __init reserve_memory_for(struct android_pmem_platform_data *p)
246{
247 apq8064_reserve_table[p->memory_type].size += p->size;
248}
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700249#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
250#endif /*CONFIG_ANDROID_PMEM*/
Kevin Chan13be4e22011-10-20 11:30:32 -0700251
Kevin Chan13be4e22011-10-20 11:30:32 -0700252static void __init reserve_pmem_memory(void)
253{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800254#ifdef CONFIG_ANDROID_PMEM
255#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700256 reserve_memory_for(&android_pmem_adsp_pdata);
257 reserve_memory_for(&android_pmem_pdata);
258 reserve_memory_for(&android_pmem_audio_pdata);
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700259#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
Kevin Chan13be4e22011-10-20 11:30:32 -0700260 apq8064_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size;
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700261#endif /*CONFIG_ANDROID_PMEM*/
Olav Haugan7c6aa742012-01-16 16:47:37 -0800262}
263
264static int apq8064_paddr_to_memtype(unsigned int paddr)
265{
266 return MEMTYPE_EBI1;
267}
268
269#ifdef CONFIG_ION_MSM
270#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
271static struct ion_cp_heap_pdata cp_mm_ion_pdata = {
272 .permission_type = IPT_TYPE_MM_CARVEOUT,
Olav Haugand3d29682012-01-19 10:57:07 -0800273 .align = PAGE_SIZE,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800274};
275
276static struct ion_cp_heap_pdata cp_mfc_ion_pdata = {
277 .permission_type = IPT_TYPE_MFC_SHAREDMEM,
Olav Haugand3d29682012-01-19 10:57:07 -0800278 .align = PAGE_SIZE,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800279};
280
281static struct ion_co_heap_pdata co_ion_pdata = {
Olav Haugand3d29682012-01-19 10:57:07 -0800282 .adjacent_mem_id = INVALID_HEAP_ID,
283 .align = PAGE_SIZE,
284};
285
286static struct ion_co_heap_pdata fw_co_ion_pdata = {
287 .adjacent_mem_id = ION_CP_MM_HEAP_ID,
288 .align = SZ_128K,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800289};
290#endif
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800291
292/**
293 * These heaps are listed in the order they will be allocated. Due to
294 * video hardware restrictions and content protection the FW heap has to
295 * be allocated adjacent (below) the MM heap and the MFC heap has to be
296 * allocated after the MM heap to ensure MFC heap is not more than 256MB
297 * away from the base address of the FW heap.
298 * However, the order of FW heap and MM heap doesn't matter since these
299 * two heaps are taken care of by separate code to ensure they are adjacent
300 * to each other.
301 * Don't swap the order unless you know what you are doing!
302 */
Olav Haugan7c6aa742012-01-16 16:47:37 -0800303static struct ion_platform_data ion_pdata = {
304 .nr = MSM_ION_HEAP_NUM,
305 .heaps = {
306 {
307 .id = ION_SYSTEM_HEAP_ID,
308 .type = ION_HEAP_TYPE_SYSTEM,
309 .name = ION_VMALLOC_HEAP_NAME,
310 },
311#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
312 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800313 .id = ION_CP_MM_HEAP_ID,
314 .type = ION_HEAP_TYPE_CP,
315 .name = ION_MM_HEAP_NAME,
316 .size = MSM_ION_MM_SIZE,
317 .memory_type = ION_EBI_TYPE,
318 .extra_data = (void *) &cp_mm_ion_pdata,
319 },
320 {
Olav Haugand3d29682012-01-19 10:57:07 -0800321 .id = ION_MM_FIRMWARE_HEAP_ID,
322 .type = ION_HEAP_TYPE_CARVEOUT,
323 .name = ION_MM_FIRMWARE_HEAP_NAME,
324 .size = MSM_ION_MM_FW_SIZE,
325 .memory_type = ION_EBI_TYPE,
326 .extra_data = (void *) &fw_co_ion_pdata,
327 },
328 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800329 .id = ION_CP_MFC_HEAP_ID,
330 .type = ION_HEAP_TYPE_CP,
331 .name = ION_MFC_HEAP_NAME,
332 .size = MSM_ION_MFC_SIZE,
333 .memory_type = ION_EBI_TYPE,
334 .extra_data = (void *) &cp_mfc_ion_pdata,
335 },
336 {
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800337 .id = ION_SF_HEAP_ID,
338 .type = ION_HEAP_TYPE_CARVEOUT,
339 .name = ION_SF_HEAP_NAME,
340 .size = MSM_ION_SF_SIZE,
341 .memory_type = ION_EBI_TYPE,
342 .extra_data = (void *) &co_ion_pdata,
343 },
344 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800345 .id = ION_IOMMU_HEAP_ID,
346 .type = ION_HEAP_TYPE_IOMMU,
347 .name = ION_IOMMU_HEAP_NAME,
348 },
Olav Hauganf45e2142012-01-19 11:01:01 -0800349 {
350 .id = ION_QSECOM_HEAP_ID,
351 .type = ION_HEAP_TYPE_CARVEOUT,
352 .name = ION_QSECOM_HEAP_NAME,
353 .size = MSM_ION_QSECOM_SIZE,
354 .memory_type = ION_EBI_TYPE,
355 .extra_data = (void *) &co_ion_pdata,
356 },
Olav Haugan2c43fac2012-01-19 11:06:37 -0800357 {
358 .id = ION_AUDIO_HEAP_ID,
359 .type = ION_HEAP_TYPE_CARVEOUT,
360 .name = ION_AUDIO_HEAP_NAME,
361 .size = MSM_ION_AUDIO_SIZE,
362 .memory_type = ION_EBI_TYPE,
363 .extra_data = (void *) &co_ion_pdata,
364 },
Olav Haugan7c6aa742012-01-16 16:47:37 -0800365#endif
366 }
367};
368
369static struct platform_device ion_dev = {
370 .name = "ion-msm",
371 .id = 1,
372 .dev = { .platform_data = &ion_pdata },
373};
374#endif
375
376static void reserve_ion_memory(void)
377{
378#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
379 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_SIZE;
Olav Haugand3d29682012-01-19 10:57:07 -0800380 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_FW_SIZE;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800381 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_SF_SIZE;
382 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MFC_SIZE;
Olav Hauganf45e2142012-01-19 11:01:01 -0800383 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_QSECOM_SIZE;
Olav Haugan2c43fac2012-01-19 11:06:37 -0800384 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_AUDIO_SIZE;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800385#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700386}
387
Huaibin Yang4a084e32011-12-15 15:25:52 -0800388static void __init reserve_mdp_memory(void)
389{
390 apq8064_mdp_writeback(apq8064_reserve_table);
391}
392
Kevin Chan13be4e22011-10-20 11:30:32 -0700393static void __init apq8064_calculate_reserve_sizes(void)
394{
395 size_pmem_devices();
396 reserve_pmem_memory();
Olav Haugan7c6aa742012-01-16 16:47:37 -0800397 reserve_ion_memory();
Huaibin Yang4a084e32011-12-15 15:25:52 -0800398 reserve_mdp_memory();
Laura Abbott350c8362012-02-28 14:46:52 -0800399 reserve_rtb_memory();
Kevin Chan13be4e22011-10-20 11:30:32 -0700400}
401
402static struct reserve_info apq8064_reserve_info __initdata = {
403 .memtype_reserve_table = apq8064_reserve_table,
404 .calculate_reserve_sizes = apq8064_calculate_reserve_sizes,
405 .paddr_to_memtype = apq8064_paddr_to_memtype,
406};
407
408static int apq8064_memory_bank_size(void)
409{
410 return 1<<29;
411}
412
413static void __init locate_unstable_memory(void)
414{
415 struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1];
416 unsigned long bank_size;
417 unsigned long low, high;
418
419 bank_size = apq8064_memory_bank_size();
420 low = meminfo.bank[0].start;
421 high = mb->start + mb->size;
Olav Haugand76e3a82012-01-16 16:55:07 -0800422
423 /* Check if 32 bit overflow occured */
424 if (high < mb->start)
425 high = ~0UL;
426
Kevin Chan13be4e22011-10-20 11:30:32 -0700427 low &= ~(bank_size - 1);
428
429 if (high - low <= bank_size)
430 return;
Jack Cheung46bfffa2012-01-19 15:26:24 -0800431 apq8064_reserve_info.low_unstable_address = mb->start -
432 MIN_MEMORY_BLOCK_SIZE + mb->size;
433 apq8064_reserve_info.max_unstable_size = MIN_MEMORY_BLOCK_SIZE;
434
Kevin Chan13be4e22011-10-20 11:30:32 -0700435 apq8064_reserve_info.bank_size = bank_size;
436 pr_info("low unstable address %lx max size %lx bank size %lx\n",
437 apq8064_reserve_info.low_unstable_address,
438 apq8064_reserve_info.max_unstable_size,
439 apq8064_reserve_info.bank_size);
440}
441
Aravind Venkateswaran8ac7f412012-03-16 17:57:30 -0700442static char prim_panel_name[PANEL_NAME_MAX_LEN];
443static char ext_panel_name[PANEL_NAME_MAX_LEN];
444static int __init prim_display_setup(char *param)
445{
446 if (strnlen(param, PANEL_NAME_MAX_LEN))
447 strlcpy(prim_panel_name, param, PANEL_NAME_MAX_LEN);
448 return 0;
449}
450early_param("prim_display", prim_display_setup);
451
452static int __init ext_display_setup(char *param)
453{
454 if (strnlen(param, PANEL_NAME_MAX_LEN))
455 strlcpy(ext_panel_name, param, PANEL_NAME_MAX_LEN);
456 return 0;
457}
458early_param("ext_display", ext_display_setup);
459
Kevin Chan13be4e22011-10-20 11:30:32 -0700460static void __init apq8064_reserve(void)
461{
Aravind Venkateswaran8ac7f412012-03-16 17:57:30 -0700462 apq8064_set_display_params(prim_panel_name, ext_panel_name);
Kevin Chan13be4e22011-10-20 11:30:32 -0700463 msm_reserve();
464}
465
Laura Abbott6988cef2012-03-15 14:27:13 -0700466static void __init place_movable_zone(void)
467{
468 movable_reserved_start = apq8064_reserve_info.low_unstable_address;
469 movable_reserved_size = apq8064_reserve_info.max_unstable_size;
470 pr_info("movable zone start %lx size %lx\n",
471 movable_reserved_start, movable_reserved_size);
472}
473
474static void __init apq8064_early_reserve(void)
475{
476 reserve_info = &apq8064_reserve_info;
477 locate_unstable_memory();
478 place_movable_zone();
479
480}
Hemant Kumara945b472012-01-25 15:08:06 -0800481#ifdef CONFIG_USB_EHCI_MSM_HSIC
482static struct msm_hsic_host_platform_data msm_hsic_pdata = {
483 .strobe = 88,
484 .data = 89,
485};
486#else
487static struct msm_hsic_host_platform_data msm_hsic_pdata;
488#endif
489
Hemant Kumarcb7d8a12012-01-25 12:25:55 -0800490#define PID_MAGIC_ID 0x71432909
491#define SERIAL_NUM_MAGIC_ID 0x61945374
492#define SERIAL_NUMBER_LENGTH 127
493#define DLOAD_USB_BASE_ADD 0x2A03F0C8
494
495struct magic_num_struct {
496 uint32_t pid;
497 uint32_t serial_num;
498};
499
500struct dload_struct {
501 uint32_t reserved1;
502 uint32_t reserved2;
503 uint32_t reserved3;
504 uint16_t reserved4;
505 uint16_t pid;
506 char serial_number[SERIAL_NUMBER_LENGTH];
507 uint16_t reserved5;
508 struct magic_num_struct magic_struct;
509};
510
511static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
512{
513 struct dload_struct __iomem *dload = 0;
514
515 dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload));
516 if (!dload) {
517 pr_err("%s: cannot remap I/O memory region: %08x\n",
518 __func__, DLOAD_USB_BASE_ADD);
519 return -ENXIO;
520 }
521
522 pr_debug("%s: dload:%p pid:%x serial_num:%s\n",
523 __func__, dload, pid, snum);
524 /* update pid */
525 dload->magic_struct.pid = PID_MAGIC_ID;
526 dload->pid = pid;
527
528 /* update serial number */
529 dload->magic_struct.serial_num = 0;
530 if (!snum) {
531 memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH);
532 goto out;
533 }
534
535 dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID;
536 strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH);
537out:
538 iounmap(dload);
539 return 0;
540}
541
542static struct android_usb_platform_data android_usb_pdata = {
543 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
544};
545
Hemant Kumar4933b072011-10-17 23:43:11 -0700546static struct platform_device android_usb_device = {
Hemant Kumarcb7d8a12012-01-25 12:25:55 -0800547 .name = "android_usb",
548 .id = -1,
549 .dev = {
550 .platform_data = &android_usb_pdata,
551 },
Hemant Kumar4933b072011-10-17 23:43:11 -0700552};
553
Hemant Kumar7620eed2012-02-26 09:08:43 -0800554/* Bandwidth requests (zero) if no vote placed */
555static struct msm_bus_vectors usb_init_vectors[] = {
556 {
557 .src = MSM_BUS_MASTER_SPS,
558 .dst = MSM_BUS_SLAVE_EBI_CH0,
559 .ab = 0,
560 .ib = 0,
561 },
562};
563
564/* Bus bandwidth requests in Bytes/sec */
565static struct msm_bus_vectors usb_max_vectors[] = {
566 {
567 .src = MSM_BUS_MASTER_SPS,
568 .dst = MSM_BUS_SLAVE_EBI_CH0,
569 .ab = 60000000, /* At least 480Mbps on bus. */
570 .ib = 960000000, /* MAX bursts rate */
571 },
572};
573
574static struct msm_bus_paths usb_bus_scale_usecases[] = {
575 {
576 ARRAY_SIZE(usb_init_vectors),
577 usb_init_vectors,
578 },
579 {
580 ARRAY_SIZE(usb_max_vectors),
581 usb_max_vectors,
582 },
583};
584
585static struct msm_bus_scale_pdata usb_bus_scale_pdata = {
586 usb_bus_scale_usecases,
587 ARRAY_SIZE(usb_bus_scale_usecases),
588 .name = "usb",
589};
590
Hemant Kumar4933b072011-10-17 23:43:11 -0700591static struct msm_otg_platform_data msm_otg_pdata = {
Hemant Kumard86c4882012-01-24 19:39:37 -0800592 .mode = USB_OTG,
593 .otg_control = OTG_PMIC_CONTROL,
Hemant Kumar4933b072011-10-17 23:43:11 -0700594 .phy_type = SNPS_28NM_INTEGRATED_PHY,
Hemant Kumard86c4882012-01-24 19:39:37 -0800595 .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE),
596 .power_budget = 750,
Hemant Kumar7620eed2012-02-26 09:08:43 -0800597 .bus_scale_table = &usb_bus_scale_pdata,
Hemant Kumar4933b072011-10-17 23:43:11 -0700598};
599
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800600static struct msm_usb_host_platform_data msm_ehci_host_pdata3 = {
Manu Gautam91223e02011-11-08 15:27:22 +0530601 .power_budget = 500,
602};
603
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800604#ifdef CONFIG_USB_EHCI_MSM_HOST4
605static struct msm_usb_host_platform_data msm_ehci_host_pdata4;
606#endif
607
Manu Gautam91223e02011-11-08 15:27:22 +0530608static void __init apq8064_ehci_host_init(void)
609{
610 if (machine_is_apq8064_liquid()) {
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800611 msm_ehci_host_pdata3.dock_connect_irq =
Hemant Kumar56925352012-02-13 16:59:52 -0800612 PM8921_MPP_IRQ(PM8921_IRQ_BASE, 9);
613
Manu Gautam91223e02011-11-08 15:27:22 +0530614 apq8064_device_ehci_host3.dev.platform_data =
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800615 &msm_ehci_host_pdata3;
Manu Gautam91223e02011-11-08 15:27:22 +0530616 platform_device_register(&apq8064_device_ehci_host3);
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800617
618#ifdef CONFIG_USB_EHCI_MSM_HOST4
619 apq8064_device_ehci_host4.dev.platform_data =
620 &msm_ehci_host_pdata4;
621 platform_device_register(&apq8064_device_ehci_host4);
622#endif
Manu Gautam91223e02011-11-08 15:27:22 +0530623 }
624}
625
David Keitel2f613d92012-02-15 11:29:16 -0800626static struct smb349_platform_data smb349_data __initdata = {
627 .en_n_gpio = PM8921_GPIO_PM_TO_SYS(37),
628 .chg_susp_gpio = PM8921_GPIO_PM_TO_SYS(30),
629 .chg_current_ma = 2200,
630};
631
632static struct i2c_board_info smb349_charger_i2c_info[] __initdata = {
633 {
634 I2C_BOARD_INFO(SMB349_NAME, 0x1B),
635 .platform_data = &smb349_data,
636 },
637};
638
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -0800639struct sx150x_platform_data apq8064_sx150x_data[] = {
640 [SX150X_EPM] = {
641 .gpio_base = GPIO_EPM_EXPANDER_BASE,
642 .oscio_is_gpo = false,
643 .io_pullup_ena = 0x0,
644 .io_pulldn_ena = 0x0,
645 .io_open_drain_ena = 0x0,
646 .io_polarity = 0,
647 .irq_summary = -1,
648 },
649};
650
651static struct epm_chan_properties ads_adc_channel_data[] = {
652 {10, 100}, {500, 50}, {1, 1}, {1, 1},
653 {20, 50}, {10, 100}, {1, 1}, {1, 1},
654 {10, 100}, {10, 100}, {100, 100}, {200, 100},
655 {100, 50}, {2000, 50}, {1000, 50}, {200, 50},
656 {200, 100}, {1, 1}, {20, 50}, {500, 50},
657 {50, 50}, {200, 100}, {500, 100}, {20, 50},
658 {200, 50}, {2000, 100}, {1000, 50}, {100, 50},
659 {200, 100}, {500, 50}, {1000, 100}, {200, 50},
660 {1000, 50}, {50, 50}, {100, 50}, {100, 50},
661 {1, 1}, {1, 1}, {20, 100}, {20, 50},
662 {500, 100}, {1000, 100}, {100, 50}, {1000, 50},
663 {100, 50}, {1000, 100}, {100, 50}, {100, 50},
664};
665
666static struct epm_adc_platform_data epm_adc_pdata = {
667 .channel = ads_adc_channel_data,
668 .bus_id = 0x0,
669 .epm_i2c_board_info = {
670 .type = "sx1509q",
671 .addr = 0x3e,
672 .platform_data = &apq8064_sx150x_data[SX150X_EPM],
673 },
674 .gpio_expander_base_addr = GPIO_EPM_EXPANDER_BASE,
675};
676
677static struct platform_device epm_adc_device = {
678 .name = "epm_adc",
679 .id = -1,
680 .dev = {
681 .platform_data = &epm_adc_pdata,
682 },
683};
684
685static void __init apq8064_epm_adc_init(void)
686{
687 epm_adc_pdata.num_channels = 32;
688 epm_adc_pdata.num_adc = 2;
689 epm_adc_pdata.chan_per_adc = 16;
690 epm_adc_pdata.chan_per_mux = 8;
691};
692
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800693/* Micbias setting is based on 8660 CDP/MTP/FLUID requirement
694 * 4 micbiases are used to power various analog and digital
695 * microphones operating at 1800 mV. Technically, all micbiases
696 * can source from single cfilter since all microphones operate
697 * at the same voltage level. The arrangement below is to make
698 * sure all cfilters are exercised. LDO_H regulator ouput level
699 * does not need to be as high as 2.85V. It is choosen for
700 * microphone sensitivity purpose.
701 */
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530702static struct wcd9xxx_pdata apq8064_tabla_platform_data = {
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800703 .slimbus_slave_device = {
704 .name = "tabla-slave",
705 .e_addr = {0, 0, 0x10, 0, 0x17, 2},
706 },
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800707 .irq = MSM_GPIO_TO_INT(42),
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800708 .irq_base = TABLA_INTERRUPT_BASE,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530709 .num_irqs = NR_WCD9XXX_IRQS,
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800710 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
711 .micbias = {
712 .ldoh_v = TABLA_LDOH_2P85_V,
713 .cfilt1_mv = 1800,
714 .cfilt2_mv = 1800,
715 .cfilt3_mv = 1800,
716 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
717 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
718 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
719 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530720 },
721 .regulator = {
722 {
723 .name = "CDC_VDD_CP",
724 .min_uV = 1800000,
725 .max_uV = 1800000,
726 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
727 },
728 {
729 .name = "CDC_VDDA_RX",
730 .min_uV = 1800000,
731 .max_uV = 1800000,
732 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
733 },
734 {
735 .name = "CDC_VDDA_TX",
736 .min_uV = 1800000,
737 .max_uV = 1800000,
738 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
739 },
740 {
741 .name = "VDDIO_CDC",
742 .min_uV = 1800000,
743 .max_uV = 1800000,
744 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
745 },
746 {
747 .name = "VDDD_CDC_D",
748 .min_uV = 1225000,
749 .max_uV = 1225000,
750 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
751 },
752 {
753 .name = "CDC_VDDA_A_1P2V",
754 .min_uV = 1225000,
755 .max_uV = 1225000,
756 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
757 },
758 },
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800759};
760
761static struct slim_device apq8064_slim_tabla = {
762 .name = "tabla-slim",
763 .e_addr = {0, 1, 0x10, 0, 0x17, 2},
764 .dev = {
765 .platform_data = &apq8064_tabla_platform_data,
766 },
767};
768
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530769static struct wcd9xxx_pdata apq8064_tabla20_platform_data = {
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800770 .slimbus_slave_device = {
771 .name = "tabla-slave",
772 .e_addr = {0, 0, 0x60, 0, 0x17, 2},
773 },
774 .irq = MSM_GPIO_TO_INT(42),
775 .irq_base = TABLA_INTERRUPT_BASE,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530776 .num_irqs = NR_WCD9XXX_IRQS,
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800777 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
778 .micbias = {
779 .ldoh_v = TABLA_LDOH_2P85_V,
780 .cfilt1_mv = 1800,
781 .cfilt2_mv = 1800,
782 .cfilt3_mv = 1800,
783 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
784 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
785 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
786 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530787 },
788 .regulator = {
789 {
790 .name = "CDC_VDD_CP",
791 .min_uV = 1800000,
792 .max_uV = 1800000,
793 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
794 },
795 {
796 .name = "CDC_VDDA_RX",
797 .min_uV = 1800000,
798 .max_uV = 1800000,
799 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
800 },
801 {
802 .name = "CDC_VDDA_TX",
803 .min_uV = 1800000,
804 .max_uV = 1800000,
805 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
806 },
807 {
808 .name = "VDDIO_CDC",
809 .min_uV = 1800000,
810 .max_uV = 1800000,
811 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
812 },
813 {
814 .name = "VDDD_CDC_D",
815 .min_uV = 1225000,
816 .max_uV = 1225000,
817 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
818 },
819 {
820 .name = "CDC_VDDA_A_1P2V",
821 .min_uV = 1225000,
822 .max_uV = 1225000,
823 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
824 },
825 },
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800826};
827
828static struct slim_device apq8064_slim_tabla20 = {
829 .name = "tabla2x-slim",
830 .e_addr = {0, 1, 0x60, 0, 0x17, 2},
831 .dev = {
832 .platform_data = &apq8064_tabla20_platform_data,
833 },
834};
835
Amy Maloche70090f992012-02-16 16:35:26 -0800836#define HAP_SHIFT_LVL_OE_GPIO PM8921_MPP_PM_TO_SYS(8)
837#define ISA1200_HAP_EN_GPIO PM8921_GPIO_PM_TO_SYS(33)
838#define ISA1200_HAP_LEN_GPIO PM8921_GPIO_PM_TO_SYS(20)
839#define ISA1200_HAP_CLK PM8921_GPIO_PM_TO_SYS(44)
840
841static int isa1200_power(int on)
842{
843 gpio_set_value_cansleep(ISA1200_HAP_CLK, !!on);
844
845 return 0;
846}
847
848static int isa1200_dev_setup(bool enable)
849{
850 int rc = 0;
851
852 rc = pm8xxx_aux_clk_control(CLK_MP3_2, XO_DIV_1, enable);
853 if (rc) {
854 pr_err("%s: unable to write aux clock register(%d)\n",
855 __func__, rc);
856 return rc;
857 }
858
859 if (!enable)
860 goto free_gpio;
861
862 rc = gpio_request(ISA1200_HAP_CLK, "haptics_clk");
863 if (rc) {
864 pr_err("%s: unable to request gpio %d config(%d)\n",
865 __func__, ISA1200_HAP_CLK, rc);
866 return rc;
867 }
868
869 rc = gpio_direction_output(ISA1200_HAP_CLK, 0);
870 if (rc) {
871 pr_err("%s: unable to set direction\n", __func__);
872 goto free_gpio;
873 }
874
875 return 0;
876
877free_gpio:
878 gpio_free(ISA1200_HAP_CLK);
879 return rc;
880}
881
882static struct isa1200_regulator isa1200_reg_data[] = {
883 {
884 .name = "vddp",
885 .min_uV = ISA_I2C_VTG_MIN_UV,
886 .max_uV = ISA_I2C_VTG_MAX_UV,
887 .load_uA = ISA_I2C_CURR_UA,
888 },
889};
890
891static struct isa1200_platform_data isa1200_1_pdata = {
892 .name = "vibrator",
893 .dev_setup = isa1200_dev_setup,
894 .power_on = isa1200_power,
895 .hap_en_gpio = ISA1200_HAP_EN_GPIO,
896 .hap_len_gpio = ISA1200_HAP_LEN_GPIO,
897 .max_timeout = 15000,
898 .mode_ctrl = PWM_GEN_MODE,
899 .pwm_fd = {
900 .pwm_div = 256,
901 },
902 .is_erm = false,
903 .smart_en = true,
904 .ext_clk_en = true,
905 .chip_en = 1,
906 .regulator_info = isa1200_reg_data,
907 .num_regulators = ARRAY_SIZE(isa1200_reg_data),
908};
909
910static struct i2c_board_info isa1200_board_info[] __initdata = {
911 {
912 I2C_BOARD_INFO("isa1200_1", 0x90>>1),
913 .platform_data = &isa1200_1_pdata,
914 },
915};
Jing Lin21ed4de2012-02-05 15:53:28 -0800916/* configuration data for mxt1386e using V2.1 firmware */
917static const u8 mxt1386e_config_data_v2_1[] = {
918 /* T6 Object */
919 0, 0, 0, 0, 0, 0,
920 /* T38 Object */
Jing Linf1208fd2012-02-23 11:15:42 -0800921 14, 1, 0, 22, 2, 12, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -0800922 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
923 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
924 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
925 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
926 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
927 0, 0, 0, 0,
928 /* T7 Object */
Jing Linf1208fd2012-02-23 11:15:42 -0800929 100, 10, 50,
Jing Lin21ed4de2012-02-05 15:53:28 -0800930 /* T8 Object */
Jing Linf1208fd2012-02-23 11:15:42 -0800931 25, 0, 20, 20, 0, 0, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -0800932 /* T9 Object */
933 131, 0, 0, 26, 42, 0, 32, 80, 2, 5,
934 0, 5, 5, 0, 10, 30, 10, 10, 255, 2,
Jing Linf1208fd2012-02-23 11:15:42 -0800935 85, 5, 0, 5, 9, 5, 12, 35, 70, 40,
936 20, 5, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -0800937 /* T18 Object */
938 0, 0,
939 /* T24 Object */
940 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
941 0, 0, 0, 0, 0, 0, 0, 0, 0,
942 /* T25 Object */
943 3, 0, 60, 115, 156, 99,
944 /* T27 Object */
945 0, 0, 0, 0, 0, 0, 0,
946 /* T40 Object */
947 0, 0, 0, 0, 0,
948 /* T42 Object */
949 2, 0, 255, 0, 255, 0, 0, 0, 0, 0,
950 /* T43 Object */
951 0, 0, 0, 0, 0, 0, 0, 64, 0, 8,
952 16,
953 /* T46 Object */
Jing Linf1208fd2012-02-23 11:15:42 -0800954 68, 0, 16, 16, 0, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -0800955 /* T47 Object */
956 0, 0, 0, 0, 0, 0, 3, 64, 66, 0,
957 /* T48 Object */
958 31, 64, 64, 0, 0, 0, 0, 0, 0, 0,
Jing Linf1208fd2012-02-23 11:15:42 -0800959 32, 40, 0, 10, 10, 0, 0, 100, 10, 90,
960 0, 0, 0, 0, 0, 0, 0, 10, 1, 10,
961 52, 10, 12, 0, 33, 0, 1, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -0800962 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
963 0, 0, 0, 0,
964 /* T56 Object */
965 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
966 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
967 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
968 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Jing Linf1208fd2012-02-23 11:15:42 -0800969 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
970 0,
Jing Lin21ed4de2012-02-05 15:53:28 -0800971};
972
973#define MXT_TS_GPIO_IRQ 6
974#define MXT_TS_PWR_EN_GPIO PM8921_GPIO_PM_TO_SYS(23)
975#define MXT_TS_RESET_GPIO 33
976
977static struct mxt_config_info mxt_config_array[] = {
978 {
979 .config = mxt1386e_config_data_v2_1,
980 .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1),
981 .family_id = 0xA0,
982 .variant_id = 0x7,
983 .version = 0x21,
984 .build = 0xAA,
985 },
986};
987
988static struct mxt_platform_data mxt_platform_data = {
989 .config_array = mxt_config_array,
990 .config_array_size = ARRAY_SIZE(mxt_config_array),
Mohan Pallaka56a1a5d2012-02-23 12:05:13 -0800991 .panel_minx = 0,
992 .panel_maxx = 1365,
993 .panel_miny = 0,
994 .panel_maxy = 767,
995 .disp_minx = 0,
996 .disp_maxx = 1365,
997 .disp_miny = 0,
998 .disp_maxy = 767,
Jing Lin21ed4de2012-02-05 15:53:28 -0800999 .irqflags = IRQF_TRIGGER_FALLING,
1000 .i2c_pull_up = true,
1001 .reset_gpio = MXT_TS_RESET_GPIO,
1002 .irq_gpio = MXT_TS_GPIO_IRQ,
1003};
1004
1005static struct i2c_board_info mxt_device_info[] __initdata = {
1006 {
1007 I2C_BOARD_INFO("atmel_mxt_ts", 0x5b),
1008 .platform_data = &mxt_platform_data,
1009 .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ),
1010 },
1011};
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001012#define CYTTSP_TS_GPIO_IRQ 6
1013#define CYTTSP_TS_GPIO_RESOUT 7
1014#define CYTTSP_TS_GPIO_SLEEP 33
1015
1016static ssize_t tma340_vkeys_show(struct kobject *kobj,
1017 struct kobj_attribute *attr, char *buf)
1018{
1019 return snprintf(buf, 200,
1020 __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97"
1021 ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97"
1022 ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97"
1023 ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97"
1024 "\n");
1025}
1026
1027static struct kobj_attribute tma340_vkeys_attr = {
1028 .attr = {
1029 .mode = S_IRUGO,
1030 },
1031 .show = &tma340_vkeys_show,
1032};
1033
1034static struct attribute *tma340_properties_attrs[] = {
1035 &tma340_vkeys_attr.attr,
1036 NULL
1037};
1038
1039static struct attribute_group tma340_properties_attr_group = {
1040 .attrs = tma340_properties_attrs,
1041};
1042
1043static int cyttsp_platform_init(struct i2c_client *client)
1044{
1045 int rc = 0;
1046 static struct kobject *tma340_properties_kobj;
1047
1048 tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c";
1049 tma340_properties_kobj = kobject_create_and_add("board_properties",
1050 NULL);
1051 if (tma340_properties_kobj)
1052 rc = sysfs_create_group(tma340_properties_kobj,
1053 &tma340_properties_attr_group);
1054 if (!tma340_properties_kobj || rc)
1055 pr_err("%s: failed to create board_properties\n",
1056 __func__);
1057
1058 return 0;
1059}
1060
1061static struct cyttsp_regulator cyttsp_regulator_data[] = {
1062 {
1063 .name = "vdd",
1064 .min_uV = CY_TMA300_VTG_MIN_UV,
1065 .max_uV = CY_TMA300_VTG_MAX_UV,
1066 .hpm_load_uA = CY_TMA300_CURR_24HZ_UA,
1067 .lpm_load_uA = CY_TMA300_CURR_24HZ_UA,
1068 },
1069 {
1070 .name = "vcc_i2c",
1071 .min_uV = CY_I2C_VTG_MIN_UV,
1072 .max_uV = CY_I2C_VTG_MAX_UV,
1073 .hpm_load_uA = CY_I2C_CURR_UA,
1074 .lpm_load_uA = CY_I2C_CURR_UA,
1075 },
1076};
1077
1078static struct cyttsp_platform_data cyttsp_pdata = {
1079 .panel_maxx = 634,
1080 .panel_maxy = 1166,
1081 .disp_maxx = 599,
1082 .disp_maxy = 1023,
1083 .disp_minx = 0,
1084 .disp_miny = 0,
1085 .flags = 0x01,
1086 .gen = CY_GEN3,
1087 .use_st = CY_USE_ST,
1088 .use_mt = CY_USE_MT,
1089 .use_hndshk = CY_SEND_HNDSHK,
1090 .use_trk_id = CY_USE_TRACKING_ID,
1091 .use_sleep = CY_USE_DEEP_SLEEP_SEL,
1092 .use_gestures = CY_USE_GESTURES,
1093 .fw_fname = "cyttsp_8064_mtp.hex",
1094 /* change act_intrvl to customize the Active power state
1095 * scanning/processing refresh interval for Operating mode
1096 */
1097 .act_intrvl = CY_ACT_INTRVL_DFLT,
1098 /* change tch_tmout to customize the touch timeout for the
1099 * Active power state for Operating mode
1100 */
1101 .tch_tmout = CY_TCH_TMOUT_DFLT,
1102 /* change lp_intrvl to customize the Low Power power state
1103 * scanning/processing refresh interval for Operating mode
1104 */
1105 .lp_intrvl = CY_LP_INTRVL_DFLT,
1106 .sleep_gpio = CYTTSP_TS_GPIO_SLEEP,
1107 .resout_gpio = CYTTSP_TS_GPIO_RESOUT,
1108 .irq_gpio = CYTTSP_TS_GPIO_IRQ,
1109 .regulator_info = cyttsp_regulator_data,
1110 .num_regulators = ARRAY_SIZE(cyttsp_regulator_data),
1111 .init = cyttsp_platform_init,
1112 .correct_fw_ver = 17,
1113};
1114
1115static struct i2c_board_info cyttsp_info[] __initdata = {
1116 {
1117 I2C_BOARD_INFO(CY_I2C_NAME, 0x24),
1118 .platform_data = &cyttsp_pdata,
1119 .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ),
1120 },
1121};
Jing Lin21ed4de2012-02-05 15:53:28 -08001122
Ankit Verma6b7e2ba2012-01-26 15:48:54 -08001123#define MSM_WCNSS_PHYS 0x03000000
1124#define MSM_WCNSS_SIZE 0x280000
1125
1126static struct resource resources_wcnss_wlan[] = {
1127 {
1128 .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1129 .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1130 .name = "wcnss_wlanrx_irq",
1131 .flags = IORESOURCE_IRQ,
1132 },
1133 {
1134 .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1135 .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1136 .name = "wcnss_wlantx_irq",
1137 .flags = IORESOURCE_IRQ,
1138 },
1139 {
1140 .start = MSM_WCNSS_PHYS,
1141 .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1,
1142 .name = "wcnss_mmio",
1143 .flags = IORESOURCE_MEM,
1144 },
1145 {
1146 .start = 64,
1147 .end = 68,
1148 .name = "wcnss_gpios_5wire",
1149 .flags = IORESOURCE_IO,
1150 },
1151};
1152
1153static struct qcom_wcnss_opts qcom_wcnss_pdata = {
1154 .has_48mhz_xo = 1,
1155};
1156
1157static struct platform_device msm_device_wcnss_wlan = {
1158 .name = "wcnss_wlan",
1159 .id = 0,
1160 .num_resources = ARRAY_SIZE(resources_wcnss_wlan),
1161 .resource = resources_wcnss_wlan,
1162 .dev = {.platform_data = &qcom_wcnss_pdata},
1163};
1164
Ankit Vermab7c26e62012-02-28 15:04:15 -08001165static struct platform_device msm_device_iris_fm __devinitdata = {
1166 .name = "iris_fm",
1167 .id = -1,
1168};
1169
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001170#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1171 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
1172 defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1173 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1174
1175#define QCE_SIZE 0x10000
1176#define QCE_0_BASE 0x11000000
1177
1178#define QCE_HW_KEY_SUPPORT 0
1179#define QCE_SHA_HMAC_SUPPORT 1
1180#define QCE_SHARE_CE_RESOURCE 3
1181#define QCE_CE_SHARED 0
1182
1183static struct resource qcrypto_resources[] = {
1184 [0] = {
1185 .start = QCE_0_BASE,
1186 .end = QCE_0_BASE + QCE_SIZE - 1,
1187 .flags = IORESOURCE_MEM,
1188 },
1189 [1] = {
1190 .name = "crypto_channels",
1191 .start = DMOV8064_CE_IN_CHAN,
1192 .end = DMOV8064_CE_OUT_CHAN,
1193 .flags = IORESOURCE_DMA,
1194 },
1195 [2] = {
1196 .name = "crypto_crci_in",
1197 .start = DMOV8064_CE_IN_CRCI,
1198 .end = DMOV8064_CE_IN_CRCI,
1199 .flags = IORESOURCE_DMA,
1200 },
1201 [3] = {
1202 .name = "crypto_crci_out",
1203 .start = DMOV8064_CE_OUT_CRCI,
1204 .end = DMOV8064_CE_OUT_CRCI,
1205 .flags = IORESOURCE_DMA,
1206 },
1207};
1208
1209static struct resource qcedev_resources[] = {
1210 [0] = {
1211 .start = QCE_0_BASE,
1212 .end = QCE_0_BASE + QCE_SIZE - 1,
1213 .flags = IORESOURCE_MEM,
1214 },
1215 [1] = {
1216 .name = "crypto_channels",
1217 .start = DMOV8064_CE_IN_CHAN,
1218 .end = DMOV8064_CE_OUT_CHAN,
1219 .flags = IORESOURCE_DMA,
1220 },
1221 [2] = {
1222 .name = "crypto_crci_in",
1223 .start = DMOV8064_CE_IN_CRCI,
1224 .end = DMOV8064_CE_IN_CRCI,
1225 .flags = IORESOURCE_DMA,
1226 },
1227 [3] = {
1228 .name = "crypto_crci_out",
1229 .start = DMOV8064_CE_OUT_CRCI,
1230 .end = DMOV8064_CE_OUT_CRCI,
1231 .flags = IORESOURCE_DMA,
1232 },
1233};
1234
1235#endif
1236
1237#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1238 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1239
1240static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
1241 .ce_shared = QCE_CE_SHARED,
1242 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1243 .hw_key_support = QCE_HW_KEY_SUPPORT,
1244 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -08001245 .bus_scale_table = NULL,
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001246};
1247
1248static struct platform_device qcrypto_device = {
1249 .name = "qcrypto",
1250 .id = 0,
1251 .num_resources = ARRAY_SIZE(qcrypto_resources),
1252 .resource = qcrypto_resources,
1253 .dev = {
1254 .coherent_dma_mask = DMA_BIT_MASK(32),
1255 .platform_data = &qcrypto_ce_hw_suppport,
1256 },
1257};
1258#endif
1259
1260#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1261 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1262
1263static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
1264 .ce_shared = QCE_CE_SHARED,
1265 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1266 .hw_key_support = QCE_HW_KEY_SUPPORT,
1267 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -08001268 .bus_scale_table = NULL,
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001269};
1270
1271static struct platform_device qcedev_device = {
1272 .name = "qce",
1273 .id = 0,
1274 .num_resources = ARRAY_SIZE(qcedev_resources),
1275 .resource = qcedev_resources,
1276 .dev = {
1277 .coherent_dma_mask = DMA_BIT_MASK(32),
1278 .platform_data = &qcedev_ce_hw_suppport,
1279 },
1280};
1281#endif
1282
Joel Kingdacbc822012-01-25 13:30:57 -08001283static struct mdm_platform_data mdm_platform_data = {
1284 .mdm_version = "3.0",
1285 .ramdump_delay_ms = 2000,
Hemant Kumara945b472012-01-25 15:08:06 -08001286 .peripheral_platform_device = &apq8064_device_hsic_host,
Joel Kingdacbc822012-01-25 13:30:57 -08001287};
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001288
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -08001289static struct tsens_platform_data apq_tsens_pdata = {
1290 .tsens_factor = 1000,
1291 .hw_type = APQ_8064,
1292 .tsens_num_sensor = 11,
1293 .slope = {1176, 1176, 1154, 1176, 1111,
1294 1132, 1132, 1199, 1132, 1199, 1132},
1295};
1296
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001297#define MSM_SHARED_RAM_PHYS 0x80000000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001298static void __init apq8064_map_io(void)
1299{
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001300 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001301 msm_map_apq8064_io();
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -07001302 if (socinfo_init() < 0)
1303 pr_err("socinfo_init() failed!\n");
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001304}
1305
1306static void __init apq8064_init_irq(void)
1307{
Praveen Chidambaram78499012011-11-01 17:15:17 -06001308 struct msm_mpm_device_data *data = NULL;
1309
1310#ifdef CONFIG_MSM_MPM
1311 data = &apq8064_mpm_dev_data;
1312#endif
1313
1314 msm_mpm_irq_extn_init(data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001315 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
1316 (void *)MSM_QGIC_CPU_BASE);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001317}
1318
Jay Chokshi7805b5a2011-11-07 15:55:30 -08001319static struct platform_device msm8064_device_saw_regulator_core0 = {
1320 .name = "saw-regulator",
1321 .id = 0,
1322 .dev = {
1323 .platform_data = &msm8064_saw_regulator_pdata_8921_s5,
1324 },
1325};
1326
1327static struct platform_device msm8064_device_saw_regulator_core1 = {
1328 .name = "saw-regulator",
1329 .id = 1,
1330 .dev = {
1331 .platform_data = &msm8064_saw_regulator_pdata_8921_s6,
1332 },
1333};
1334
1335static struct platform_device msm8064_device_saw_regulator_core2 = {
1336 .name = "saw-regulator",
1337 .id = 2,
1338 .dev = {
1339 .platform_data = &msm8064_saw_regulator_pdata_8821_s0,
1340 },
1341};
1342
1343static struct platform_device msm8064_device_saw_regulator_core3 = {
1344 .name = "saw-regulator",
1345 .id = 3,
1346 .dev = {
1347 .platform_data = &msm8064_saw_regulator_pdata_8821_s1,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001348
1349 },
1350};
1351
Oluwafemi Adeyemif5a31422012-03-08 16:58:45 -08001352static struct msm_rpmrs_level msm_rpmrs_levels[] = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06001353 {
1354 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
1355 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
1356 true,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001357 100, 650, 801, 200,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001358 },
1359
1360 {
1361 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
1362 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
1363 true,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001364 2000, 200, 576000, 2000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001365 },
1366
1367 {
1368 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1369 MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE),
1370 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001371 8500, 51, 1122000, 8500,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001372 },
1373
1374 {
1375 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1376 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, MAX, ACTIVE),
1377 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001378 9000, 51, 1130300, 9000,
1379 },
1380 {
1381 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1382 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, ACTIVE, RET_HIGH),
1383 false,
1384 10000, 51, 1130300, 10000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001385 },
1386
1387 {
1388 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1389 MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE),
1390 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001391 12000, 14, 2205900, 12000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001392 },
1393
1394 {
1395 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1396 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
1397 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001398 18000, 12, 2364250, 18000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001399 },
1400
1401 {
1402 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1403 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH),
1404 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001405 23500, 10, 2667000, 23500,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001406 },
1407
1408 {
1409 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1410 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
1411 false,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001412 29700, 5, 2867000, 30000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001413 },
1414};
1415
Oluwafemi Adeyemif5a31422012-03-08 16:58:45 -08001416uint32_t apq8064_rpm_get_swfi_latency(void)
1417{
1418 int i;
1419
1420 for (i = 0; i < ARRAY_SIZE(msm_rpmrs_levels); i++) {
1421 if (msm_rpmrs_levels[i].sleep_mode ==
1422 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)
1423 return msm_rpmrs_levels[i].latency_us;
1424 }
1425
1426 return 0;
1427}
1428
Praveen Chidambaram78499012011-11-01 17:15:17 -06001429static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
1430 .mode = MSM_PM_BOOT_CONFIG_TZ,
1431};
1432
1433static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = {
1434 .levels = &msm_rpmrs_levels[0],
1435 .num_levels = ARRAY_SIZE(msm_rpmrs_levels),
1436 .vdd_mem_levels = {
1437 [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000,
1438 [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000,
1439 [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000,
1440 [MSM_RPMRS_VDD_MEM_MAX] = 1150000,
1441 },
1442 .vdd_dig_levels = {
1443 [MSM_RPMRS_VDD_DIG_RET_LOW] = 500000,
1444 [MSM_RPMRS_VDD_DIG_RET_HIGH] = 750000,
1445 [MSM_RPMRS_VDD_DIG_ACTIVE] = 950000,
1446 [MSM_RPMRS_VDD_DIG_MAX] = 1150000,
1447 },
1448 .vdd_mask = 0x7FFFFF,
1449 .rpmrs_target_id = {
1450 [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK,
1451 [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST,
1452 [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_PM8921_S3_0,
1453 [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_PM8921_S3_1,
1454 [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8921_L24_0,
1455 [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8921_L24_1,
1456 [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL,
1457 },
1458};
1459
1460static struct msm_cpuidle_state msm_cstates[] __initdata = {
1461 {0, 0, "C0", "WFI",
1462 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
1463
1464 {0, 1, "C1", "STANDALONE_POWER_COLLAPSE",
1465 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
1466
1467 {0, 2, "C2", "POWER_COLLAPSE",
1468 MSM_PM_SLEEP_MODE_POWER_COLLAPSE},
1469
1470 {1, 0, "C0", "WFI",
1471 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
1472
1473 {1, 1, "C1", "STANDALONE_POWER_COLLAPSE",
1474 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
1475
1476 {2, 0, "C0", "WFI",
1477 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
1478
1479 {2, 1, "C1", "STANDALONE_POWER_COLLAPSE",
1480 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
1481
1482 {3, 0, "C0", "WFI",
1483 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
1484
1485 {3, 1, "C1", "STANDALONE_POWER_COLLAPSE",
1486 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
1487};
1488
1489static struct msm_pm_platform_data msm_pm_data[] = {
1490 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
1491 .idle_supported = 1,
1492 .suspend_supported = 1,
1493 .idle_enabled = 0,
1494 .suspend_enabled = 0,
1495 },
1496
1497 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
1498 .idle_supported = 1,
1499 .suspend_supported = 1,
1500 .idle_enabled = 0,
1501 .suspend_enabled = 0,
1502 },
1503
1504 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
1505 .idle_supported = 1,
1506 .suspend_supported = 1,
1507 .idle_enabled = 1,
1508 .suspend_enabled = 1,
1509 },
1510
1511 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
1512 .idle_supported = 0,
1513 .suspend_supported = 1,
1514 .idle_enabled = 0,
1515 .suspend_enabled = 0,
1516 },
1517
1518 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
1519 .idle_supported = 1,
1520 .suspend_supported = 1,
1521 .idle_enabled = 0,
1522 .suspend_enabled = 0,
1523 },
1524
1525 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
1526 .idle_supported = 1,
1527 .suspend_supported = 0,
1528 .idle_enabled = 1,
1529 .suspend_enabled = 0,
1530 },
1531
1532 [MSM_PM_MODE(2, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
1533 .idle_supported = 0,
1534 .suspend_supported = 1,
1535 .idle_enabled = 0,
1536 .suspend_enabled = 0,
1537 },
1538
1539 [MSM_PM_MODE(2, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
1540 .idle_supported = 1,
1541 .suspend_supported = 1,
1542 .idle_enabled = 0,
1543 .suspend_enabled = 0,
1544 },
1545
1546 [MSM_PM_MODE(2, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
1547 .idle_supported = 1,
1548 .suspend_supported = 0,
1549 .idle_enabled = 1,
1550 .suspend_enabled = 0,
1551 },
1552
1553 [MSM_PM_MODE(3, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
1554 .idle_supported = 0,
1555 .suspend_supported = 1,
1556 .idle_enabled = 0,
1557 .suspend_enabled = 0,
1558 },
1559
1560 [MSM_PM_MODE(3, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
1561 .idle_supported = 1,
1562 .suspend_supported = 1,
1563 .idle_enabled = 0,
1564 .suspend_enabled = 0,
1565 },
1566
1567 [MSM_PM_MODE(3, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
1568 .idle_supported = 1,
1569 .suspend_supported = 0,
1570 .idle_enabled = 1,
1571 .suspend_enabled = 0,
1572 },
1573};
1574
1575static uint8_t spm_wfi_cmd_sequence[] __initdata = {
1576 0x03, 0x0f,
1577};
1578
1579static uint8_t spm_power_collapse_without_rpm[] __initdata = {
1580 0x00, 0x24, 0x54, 0x10,
1581 0x09, 0x03, 0x01,
1582 0x10, 0x54, 0x30, 0x0C,
1583 0x24, 0x30, 0x0f,
1584};
1585
1586static uint8_t spm_power_collapse_with_rpm[] __initdata = {
1587 0x00, 0x24, 0x54, 0x10,
1588 0x09, 0x07, 0x01, 0x0B,
1589 0x10, 0x54, 0x30, 0x0C,
1590 0x24, 0x30, 0x0f,
1591};
1592
1593static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
1594 [0] = {
1595 .mode = MSM_SPM_MODE_CLOCK_GATING,
1596 .notify_rpm = false,
1597 .cmd = spm_wfi_cmd_sequence,
1598 },
1599 [1] = {
1600 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1601 .notify_rpm = false,
1602 .cmd = spm_power_collapse_without_rpm,
1603 },
1604 [2] = {
1605 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1606 .notify_rpm = true,
1607 .cmd = spm_power_collapse_with_rpm,
1608 },
1609};
1610
1611static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = {
1612 0x00, 0x20, 0x03, 0x20,
1613 0x00, 0x0f,
1614};
1615
1616static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = {
1617 0x00, 0x20, 0x34, 0x64,
1618 0x48, 0x07, 0x48, 0x20,
1619 0x50, 0x64, 0x04, 0x34,
1620 0x50, 0x0f,
1621};
1622static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = {
1623 0x00, 0x10, 0x34, 0x64,
1624 0x48, 0x07, 0x48, 0x10,
1625 0x50, 0x64, 0x04, 0x34,
1626 0x50, 0x0F,
1627};
1628
1629static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = {
1630 [0] = {
1631 .mode = MSM_SPM_L2_MODE_RETENTION,
1632 .notify_rpm = false,
1633 .cmd = l2_spm_wfi_cmd_sequence,
1634 },
1635 [1] = {
1636 .mode = MSM_SPM_L2_MODE_GDHS,
1637 .notify_rpm = true,
1638 .cmd = l2_spm_gdhs_cmd_sequence,
1639 },
1640 [2] = {
1641 .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE,
1642 .notify_rpm = true,
1643 .cmd = l2_spm_power_off_cmd_sequence,
1644 },
1645};
1646
1647
1648static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = {
1649 [0] = {
1650 .reg_base_addr = MSM_SAW_L2_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001651 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001652 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001653 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE,
1654 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020,
1655 .modes = msm_spm_l2_seq_list,
1656 .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list),
1657 },
1658};
1659
1660static struct msm_spm_platform_data msm_spm_data[] __initdata = {
1661 [0] = {
1662 .reg_base_addr = MSM_SAW0_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001663 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001664#if defined(CONFIG_MSM_AVS_HW)
1665 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1666 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1667#endif
1668 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001669 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001670 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1671 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1672 .vctl_timeout_us = 50,
1673 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1674 .modes = msm_spm_seq_list,
1675 },
1676 [1] = {
1677 .reg_base_addr = MSM_SAW1_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001678 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001679#if defined(CONFIG_MSM_AVS_HW)
1680 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1681 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1682#endif
1683 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001684 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001685 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1686 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1687 .vctl_timeout_us = 50,
1688 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1689 .modes = msm_spm_seq_list,
1690 },
1691 [2] = {
1692 .reg_base_addr = MSM_SAW2_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001693 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001694#if defined(CONFIG_MSM_AVS_HW)
1695 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1696 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1697#endif
1698 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001699 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001700 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1701 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1702 .vctl_timeout_us = 50,
1703 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1704 .modes = msm_spm_seq_list,
1705 },
1706 [3] = {
1707 .reg_base_addr = MSM_SAW3_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001708 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001709#if defined(CONFIG_MSM_AVS_HW)
1710 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1711 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1712#endif
1713 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001714 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001715 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1716 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1717 .vctl_timeout_us = 50,
1718 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1719 .modes = msm_spm_seq_list,
Jay Chokshi7805b5a2011-11-07 15:55:30 -08001720 },
1721};
1722
Gagan Mac8a7a5d32011-11-11 16:43:06 -07001723static void __init apq8064_init_buses(void)
1724{
1725 msm_bus_rpm_set_mt_mask();
1726 msm_bus_8064_apps_fabric_pdata.rpm_enabled = 1;
1727 msm_bus_8064_sys_fabric_pdata.rpm_enabled = 1;
1728 msm_bus_8064_mm_fabric_pdata.rpm_enabled = 1;
1729 msm_bus_8064_apps_fabric.dev.platform_data =
1730 &msm_bus_8064_apps_fabric_pdata;
1731 msm_bus_8064_sys_fabric.dev.platform_data =
1732 &msm_bus_8064_sys_fabric_pdata;
1733 msm_bus_8064_mm_fabric.dev.platform_data =
1734 &msm_bus_8064_mm_fabric_pdata;
1735 msm_bus_8064_sys_fpb.dev.platform_data = &msm_bus_8064_sys_fpb_pdata;
1736 msm_bus_8064_cpss_fpb.dev.platform_data = &msm_bus_8064_cpss_fpb_pdata;
1737}
1738
David Collinsf0d00732012-01-25 15:46:50 -08001739static struct platform_device apq8064_device_ext_5v_vreg __devinitdata = {
1740 .name = GPIO_REGULATOR_DEV_NAME,
1741 .id = PM8921_MPP_PM_TO_SYS(7),
1742 .dev = {
1743 .platform_data
1744 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V],
1745 },
1746};
1747
Jay Chokshi1de4f9d2012-02-07 16:11:31 -08001748static struct platform_device apq8064_device_ext_mpp8_vreg __devinitdata = {
1749 .name = GPIO_REGULATOR_DEV_NAME,
1750 .id = PM8921_MPP_PM_TO_SYS(8),
1751 .dev = {
1752 .platform_data
1753 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_MPP8],
1754 },
1755};
1756
David Collinsf0d00732012-01-25 15:46:50 -08001757static struct platform_device apq8064_device_ext_3p3v_vreg __devinitdata = {
1758 .name = GPIO_REGULATOR_DEV_NAME,
1759 .id = APQ8064_EXT_3P3V_REG_EN_GPIO,
1760 .dev = {
1761 .platform_data =
1762 &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V],
1763 },
1764};
1765
David Collins390fc332012-02-07 14:38:16 -08001766static struct platform_device apq8064_device_ext_ts_sw_vreg __devinitdata = {
1767 .name = GPIO_REGULATOR_DEV_NAME,
1768 .id = PM8921_GPIO_PM_TO_SYS(23),
1769 .dev = {
1770 .platform_data
1771 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_TS_SW],
1772 },
1773};
1774
David Collins2782b5c2012-02-06 10:02:42 -08001775static struct platform_device apq8064_device_rpm_regulator __devinitdata = {
1776 .name = "rpm-regulator",
1777 .id = -1,
1778 .dev = {
1779 .platform_data = &apq8064_rpm_regulator_pdata,
1780 },
1781};
1782
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001783static struct platform_device *common_devices[] __initdata = {
Jin Hong01f2dbb2011-11-03 22:13:51 -07001784 &apq8064_device_dmov,
David Keitel3c40fc52012-02-09 17:53:52 -08001785 &apq8064_device_qup_i2c_gsbi1,
Jing Lin04601f92012-02-05 15:36:07 -08001786 &apq8064_device_qup_i2c_gsbi3,
Kenneth Heitke748593a2011-07-15 15:45:11 -06001787 &apq8064_device_qup_i2c_gsbi4,
Harini Jayaramanc4c58692011-07-19 14:50:10 -06001788 &apq8064_device_qup_spi_gsbi5,
David Collinsf0d00732012-01-25 15:46:50 -08001789 &apq8064_device_ext_5v_vreg,
Jay Chokshi1de4f9d2012-02-07 16:11:31 -08001790 &apq8064_device_ext_mpp8_vreg,
David Collinsf0d00732012-01-25 15:46:50 -08001791 &apq8064_device_ext_3p3v_vreg,
David Collins390fc332012-02-07 14:38:16 -08001792 &apq8064_device_ext_ts_sw_vreg,
Jay Chokshi9c25f072011-09-23 18:19:15 -07001793 &apq8064_device_ssbi_pmic1,
1794 &apq8064_device_ssbi_pmic2,
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001795 &msm_device_smd_apq8064,
Hemant Kumar4933b072011-10-17 23:43:11 -07001796 &apq8064_device_otg,
1797 &apq8064_device_gadget_peripheral,
Hemant Kumard86c4882012-01-24 19:39:37 -08001798 &apq8064_device_hsusb_host,
Hemant Kumar4933b072011-10-17 23:43:11 -07001799 &android_usb_device,
Ankit Verma6b7e2ba2012-01-26 15:48:54 -08001800 &msm_device_wcnss_wlan,
Ankit Vermab7c26e62012-02-28 15:04:15 -08001801 &msm_device_iris_fm,
Olav Haugan7c6aa742012-01-16 16:47:37 -08001802#ifdef CONFIG_ANDROID_PMEM
1803#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -07001804 &android_pmem_device,
1805 &android_pmem_adsp_device,
1806 &android_pmem_audio_device,
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -07001807#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
1808#endif /*CONFIG_ANDROID_PMEM*/
Olav Haugan7c6aa742012-01-16 16:47:37 -08001809#ifdef CONFIG_ION_MSM
1810 &ion_dev,
1811#endif
Jeff Ohlstein7e668552011-10-06 16:17:25 -07001812 &msm8064_device_watchdog,
Jay Chokshi7805b5a2011-11-07 15:55:30 -08001813 &msm8064_device_saw_regulator_core0,
1814 &msm8064_device_saw_regulator_core1,
1815 &msm8064_device_saw_regulator_core2,
1816 &msm8064_device_saw_regulator_core3,
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001817#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1818 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1819 &qcrypto_device,
1820#endif
1821
1822#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1823 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1824 &qcedev_device,
1825#endif
Ramesh Masavarapuf46be1b2011-11-03 11:13:41 -07001826
1827#ifdef CONFIG_HW_RANDOM_MSM
1828 &apq8064_device_rng,
1829#endif
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -08001830 &apq_pcm,
1831 &apq_pcm_routing,
1832 &apq_cpudai0,
1833 &apq_cpudai1,
1834 &apq_cpudai_hdmi_rx,
1835 &apq_cpudai_bt_rx,
1836 &apq_cpudai_bt_tx,
1837 &apq_cpudai_fm_rx,
1838 &apq_cpudai_fm_tx,
1839 &apq_cpu_fe,
1840 &apq_stub_codec,
1841 &apq_voice,
1842 &apq_voip,
1843 &apq_lpa_pcm,
1844 &apq_pcm_hostless,
1845 &apq_cpudai_afe_01_rx,
1846 &apq_cpudai_afe_01_tx,
1847 &apq_cpudai_afe_02_rx,
1848 &apq_cpudai_afe_02_tx,
1849 &apq_pcm_afe,
1850 &apq_cpudai_auxpcm_rx,
1851 &apq_cpudai_auxpcm_tx,
Neema Shetty8427c262012-02-16 11:23:43 -08001852 &apq_cpudai_stub,
Neema Shetty3c9d2862012-03-11 01:25:32 -08001853 &apq_cpudai_slimbus_1_rx,
1854 &apq_cpudai_slimbus_1_tx,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001855 &apq8064_rpm_device,
1856 &apq8064_rpm_log_device,
1857 &apq8064_rpm_stat_device,
Gagan Mac8a7a5d32011-11-11 16:43:06 -07001858 &msm_bus_8064_apps_fabric,
1859 &msm_bus_8064_sys_fabric,
1860 &msm_bus_8064_mm_fabric,
1861 &msm_bus_8064_sys_fpb,
1862 &msm_bus_8064_cpss_fpb,
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08001863 &apq8064_msm_device_vidc,
Stephen Boyd25c4a0b2011-09-20 00:12:36 -07001864 &msm_pil_dsps,
Matt Wagantalled832652012-02-02 19:23:17 -08001865 &msm_8960_riva,
Matt Wagantallb94b9a52012-02-02 21:59:54 -08001866 &msm_8960_q6_lpass,
Matt Wagantall292aace2012-01-26 19:12:34 -08001867 &msm_gss,
Laura Abbott350c8362012-02-28 14:46:52 -08001868#ifdef CONFIG_MSM_RTB
1869 &msm_rtb_device,
1870#endif
Praveen Chidambaram8ea3dcd2011-12-07 14:46:31 -07001871 &apq8064_cpu_idle_device,
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07001872 &apq8064_msm_gov_device,
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08001873 &apq8064_device_cache_erp,
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08001874 &epm_adc_device,
Pratik Patel212ab362012-03-16 12:30:07 -07001875 &apq8064_qdss_device,
1876 &msm_etb_device,
1877 &msm_tpiu_device,
1878 &msm_funnel_device,
1879 &apq8064_etm_device,
Harini Jayaramanc4c58692011-07-19 14:50:10 -06001880};
1881
Joel King4e7ad222011-08-17 15:47:38 -07001882static struct platform_device *sim_devices[] __initdata = {
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07001883 &apq8064_device_uart_gsbi3,
Yan He06913ce2011-08-26 16:33:46 -07001884 &msm_device_sps_apq8064,
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07001885};
1886
1887static struct platform_device *rumi3_devices[] __initdata = {
1888 &apq8064_device_uart_gsbi1,
Yan He435ed612011-11-23 17:34:59 -08001889 &msm_device_sps_apq8064,
Huaibin Yang4a084e32011-12-15 15:25:52 -08001890#ifdef CONFIG_MSM_ROTATOR
1891 &msm_rotator_device,
1892#endif
Joel King4e7ad222011-08-17 15:47:38 -07001893};
1894
Joel King82b7e3f2012-01-05 10:03:27 -08001895static struct platform_device *cdp_devices[] __initdata = {
1896 &apq8064_device_uart_gsbi1,
Jin Hong4bbbfba2012-02-02 21:48:07 -08001897 &apq8064_device_uart_gsbi7,
Joel King82b7e3f2012-01-05 10:03:27 -08001898 &msm_device_sps_apq8064,
Aravind Venkateswaran4ca27532012-02-16 14:27:05 -08001899#ifdef CONFIG_MSM_ROTATOR
1900 &msm_rotator_device,
1901#endif
Joel King82b7e3f2012-01-05 10:03:27 -08001902};
1903
Harini Jayaramanc4c58692011-07-19 14:50:10 -06001904static struct msm_spi_platform_data apq8064_qup_spi_gsbi5_pdata = {
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -08001905 .max_clock_speed = 1100000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001906};
1907
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07001908#define KS8851_IRQ_GPIO 43
1909
1910static struct spi_board_info spi_board_info[] __initdata = {
1911 {
1912 .modalias = "ks8851",
1913 .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
1914 .max_speed_hz = 19200000,
1915 .bus_num = 0,
1916 .chip_select = 2,
1917 .mode = SPI_MODE_0,
1918 },
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08001919 {
1920 .modalias = "epm_adc",
1921 .max_speed_hz = 1100000,
1922 .bus_num = 0,
1923 .chip_select = 3,
1924 .mode = SPI_MODE_0,
1925 },
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07001926};
1927
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06001928static struct slim_boardinfo apq8064_slim_devices[] = {
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001929 {
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08001930 .bus_num = 1,
1931 .slim_slave = &apq8064_slim_tabla,
1932 },
1933 {
1934 .bus_num = 1,
1935 .slim_slave = &apq8064_slim_tabla20,
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001936 },
1937 /* add more slimbus slaves as needed */
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06001938};
1939
David Keitel3c40fc52012-02-09 17:53:52 -08001940static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi1_pdata = {
1941 .clk_freq = 100000,
1942 .src_clk_rate = 24000000,
1943};
1944
Jing Lin04601f92012-02-05 15:36:07 -08001945static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi3_pdata = {
1946 .clk_freq = 100000,
1947 .src_clk_rate = 24000000,
1948};
1949
Kenneth Heitke748593a2011-07-15 15:45:11 -06001950static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi4_pdata = {
1951 .clk_freq = 100000,
1952 .src_clk_rate = 24000000,
Kenneth Heitke748593a2011-07-15 15:45:11 -06001953};
1954
David Keitel3c40fc52012-02-09 17:53:52 -08001955#define GSBI_DUAL_MODE_CODE 0x60
1956#define MSM_GSBI1_PHYS 0x12440000
Kenneth Heitke748593a2011-07-15 15:45:11 -06001957static void __init apq8064_i2c_init(void)
1958{
David Keitel3c40fc52012-02-09 17:53:52 -08001959 void __iomem *gsbi_mem;
1960
1961 apq8064_device_qup_i2c_gsbi1.dev.platform_data =
1962 &apq8064_i2c_qup_gsbi1_pdata;
1963 gsbi_mem = ioremap_nocache(MSM_GSBI1_PHYS, 4);
1964 writel_relaxed(GSBI_DUAL_MODE_CODE, gsbi_mem);
1965 /* Ensure protocol code is written before proceeding */
1966 wmb();
1967 iounmap(gsbi_mem);
1968 apq8064_i2c_qup_gsbi1_pdata.use_gsbi_shared_mode = 1;
Jing Lin04601f92012-02-05 15:36:07 -08001969 apq8064_device_qup_i2c_gsbi3.dev.platform_data =
1970 &apq8064_i2c_qup_gsbi3_pdata;
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08001971 apq8064_device_qup_i2c_gsbi1.dev.platform_data =
1972 &apq8064_i2c_qup_gsbi1_pdata;
Kenneth Heitke748593a2011-07-15 15:45:11 -06001973 apq8064_device_qup_i2c_gsbi4.dev.platform_data =
1974 &apq8064_i2c_qup_gsbi4_pdata;
1975}
1976
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -08001977#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07001978static int ethernet_init(void)
1979{
1980 int ret;
1981 ret = gpio_request(KS8851_IRQ_GPIO, "ks8851_irq");
1982 if (ret) {
1983 pr_err("ks8851 gpio_request failed: %d\n", ret);
1984 goto fail;
1985 }
1986
1987 return 0;
1988fail:
1989 return ret;
1990}
1991#else
1992static int ethernet_init(void)
1993{
1994 return 0;
1995}
1996#endif
1997
Mohan Pallaka474b94b2012-01-25 12:59:58 +05301998#define GPIO_KEY_HOME PM8921_GPIO_PM_TO_SYS(27)
1999#define GPIO_KEY_VOLUME_UP PM8921_GPIO_PM_TO_SYS(35)
2000#define GPIO_KEY_VOLUME_DOWN PM8921_GPIO_PM_TO_SYS(38)
2001#define GPIO_KEY_CAM_FOCUS PM8921_GPIO_PM_TO_SYS(3)
2002#define GPIO_KEY_CAM_SNAP PM8921_GPIO_PM_TO_SYS(4)
Jing Lin3f8f8422012-03-05 09:32:11 -08002003#define GPIO_KEY_ROTATION PM8921_GPIO_PM_TO_SYS(42)
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302004
2005static struct gpio_keys_button cdp_keys[] = {
2006 {
2007 .code = KEY_HOME,
2008 .gpio = GPIO_KEY_HOME,
2009 .desc = "home_key",
2010 .active_low = 1,
2011 .type = EV_KEY,
2012 .wakeup = 1,
2013 .debounce_interval = 15,
2014 },
2015 {
2016 .code = KEY_VOLUMEUP,
2017 .gpio = GPIO_KEY_VOLUME_UP,
2018 .desc = "volume_up_key",
2019 .active_low = 1,
2020 .type = EV_KEY,
2021 .wakeup = 1,
2022 .debounce_interval = 15,
2023 },
2024 {
2025 .code = KEY_VOLUMEDOWN,
2026 .gpio = GPIO_KEY_VOLUME_DOWN,
2027 .desc = "volume_down_key",
2028 .active_low = 1,
2029 .type = EV_KEY,
2030 .wakeup = 1,
2031 .debounce_interval = 15,
2032 },
2033 {
2034 .code = SW_ROTATE_LOCK,
2035 .gpio = GPIO_KEY_ROTATION,
2036 .desc = "rotate_key",
2037 .active_low = 1,
2038 .type = EV_SW,
2039 .debounce_interval = 15,
2040 },
2041};
2042
2043static struct gpio_keys_platform_data cdp_keys_data = {
2044 .buttons = cdp_keys,
2045 .nbuttons = ARRAY_SIZE(cdp_keys),
2046};
2047
2048static struct platform_device cdp_kp_pdev = {
2049 .name = "gpio-keys",
2050 .id = -1,
2051 .dev = {
2052 .platform_data = &cdp_keys_data,
2053 },
2054};
2055
2056static struct gpio_keys_button mtp_keys[] = {
2057 {
2058 .code = KEY_CAMERA_FOCUS,
2059 .gpio = GPIO_KEY_CAM_FOCUS,
2060 .desc = "cam_focus_key",
2061 .active_low = 1,
2062 .type = EV_KEY,
2063 .wakeup = 1,
2064 .debounce_interval = 15,
2065 },
2066 {
2067 .code = KEY_VOLUMEUP,
2068 .gpio = GPIO_KEY_VOLUME_UP,
2069 .desc = "volume_up_key",
2070 .active_low = 1,
2071 .type = EV_KEY,
2072 .wakeup = 1,
2073 .debounce_interval = 15,
2074 },
2075 {
2076 .code = KEY_VOLUMEDOWN,
2077 .gpio = GPIO_KEY_VOLUME_DOWN,
2078 .desc = "volume_down_key",
2079 .active_low = 1,
2080 .type = EV_KEY,
2081 .wakeup = 1,
2082 .debounce_interval = 15,
2083 },
2084 {
2085 .code = KEY_CAMERA_SNAPSHOT,
2086 .gpio = GPIO_KEY_CAM_SNAP,
2087 .desc = "cam_snap_key",
2088 .active_low = 1,
2089 .type = EV_KEY,
2090 .debounce_interval = 15,
2091 },
2092};
2093
2094static struct gpio_keys_platform_data mtp_keys_data = {
2095 .buttons = mtp_keys,
2096 .nbuttons = ARRAY_SIZE(mtp_keys),
2097};
2098
2099static struct platform_device mtp_kp_pdev = {
2100 .name = "gpio-keys",
2101 .id = -1,
2102 .dev = {
2103 .platform_data = &mtp_keys_data,
2104 },
2105};
2106
Jin Hongd3024e62012-02-09 16:13:32 -08002107/* Sensors DSPS platform data */
2108#define DSPS_PIL_GENERIC_NAME "dsps"
2109static void __init apq8064_init_dsps(void)
2110{
2111 struct msm_dsps_platform_data *pdata =
2112 msm_dsps_device_8064.dev.platform_data;
2113 pdata->pil_name = DSPS_PIL_GENERIC_NAME;
2114 pdata->gpios = NULL;
2115 pdata->gpios_num = 0;
2116
2117 platform_device_register(&msm_dsps_device_8064);
2118}
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302119
Tianyi Gou41515e22011-09-01 19:37:43 -07002120static void __init apq8064_clock_init(void)
2121{
Tianyi Gouacb588d2012-01-27 18:24:05 -08002122 if (machine_is_apq8064_rumi3())
Tianyi Gou41515e22011-09-01 19:37:43 -07002123 msm_clock_init(&apq8064_dummy_clock_init_data);
Tianyi Gouacb588d2012-01-27 18:24:05 -08002124 else
2125 msm_clock_init(&apq8064_clock_init_data);
Tianyi Gou41515e22011-09-01 19:37:43 -07002126}
2127
Jing Lin417fa452012-02-05 14:31:06 -08002128#define I2C_SURF 1
2129#define I2C_FFA (1 << 1)
2130#define I2C_RUMI (1 << 2)
2131#define I2C_SIM (1 << 3)
2132#define I2C_LIQUID (1 << 4)
2133
2134struct i2c_registry {
2135 u8 machs;
2136 int bus;
2137 struct i2c_board_info *info;
2138 int len;
2139};
2140
2141static struct i2c_registry apq8064_i2c_devices[] __initdata = {
Jing Lin21ed4de2012-02-05 15:53:28 -08002142 {
David Keitel2f613d92012-02-15 11:29:16 -08002143 I2C_LIQUID,
2144 APQ_8064_GSBI1_QUP_I2C_BUS_ID,
2145 smb349_charger_i2c_info,
2146 ARRAY_SIZE(smb349_charger_i2c_info)
2147 },
2148 {
Jing Lin21ed4de2012-02-05 15:53:28 -08002149 I2C_SURF | I2C_LIQUID,
2150 APQ_8064_GSBI3_QUP_I2C_BUS_ID,
2151 mxt_device_info,
2152 ARRAY_SIZE(mxt_device_info),
2153 },
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08002154 {
2155 I2C_FFA,
2156 APQ_8064_GSBI3_QUP_I2C_BUS_ID,
2157 cyttsp_info,
2158 ARRAY_SIZE(cyttsp_info),
2159 },
Amy Maloche70090f992012-02-16 16:35:26 -08002160 {
2161 I2C_FFA | I2C_LIQUID,
2162 APQ_8064_GSBI1_QUP_I2C_BUS_ID,
2163 isa1200_board_info,
2164 ARRAY_SIZE(isa1200_board_info),
2165 },
Jing Lin417fa452012-02-05 14:31:06 -08002166};
2167
2168static void __init register_i2c_devices(void)
2169{
2170 u8 mach_mask = 0;
2171 int i;
2172
Kevin Chand07220e2012-02-13 15:52:22 -08002173#ifdef CONFIG_MSM_CAMERA
2174 struct i2c_registry apq8064_camera_i2c_devices = {
2175 I2C_SURF | I2C_FFA | I2C_LIQUID | I2C_RUMI,
2176 APQ_8064_GSBI4_QUP_I2C_BUS_ID,
2177 apq8064_camera_board_info.board_info,
2178 apq8064_camera_board_info.num_i2c_board_info,
2179 };
2180#endif
Jing Lin417fa452012-02-05 14:31:06 -08002181 /* Build the matching 'supported_machs' bitmask */
2182 if (machine_is_apq8064_cdp())
2183 mach_mask = I2C_SURF;
2184 else if (machine_is_apq8064_mtp())
2185 mach_mask = I2C_FFA;
2186 else if (machine_is_apq8064_liquid())
2187 mach_mask = I2C_LIQUID;
2188 else if (machine_is_apq8064_rumi3())
2189 mach_mask = I2C_RUMI;
2190 else if (machine_is_apq8064_sim())
2191 mach_mask = I2C_SIM;
2192 else
2193 pr_err("unmatched machine ID in register_i2c_devices\n");
2194
2195 /* Run the array and install devices as appropriate */
2196 for (i = 0; i < ARRAY_SIZE(apq8064_i2c_devices); ++i) {
2197 if (apq8064_i2c_devices[i].machs & mach_mask)
2198 i2c_register_board_info(apq8064_i2c_devices[i].bus,
2199 apq8064_i2c_devices[i].info,
2200 apq8064_i2c_devices[i].len);
2201 }
Kevin Chand07220e2012-02-13 15:52:22 -08002202#ifdef CONFIG_MSM_CAMERA
2203 if (apq8064_camera_i2c_devices.machs & mach_mask)
2204 i2c_register_board_info(apq8064_camera_i2c_devices.bus,
2205 apq8064_camera_i2c_devices.info,
2206 apq8064_camera_i2c_devices.len);
2207#endif
Jing Lin417fa452012-02-05 14:31:06 -08002208}
2209
Jay Chokshi994ff122012-03-27 15:43:48 -07002210static void enable_ddr3_regulator(void)
2211{
2212 static struct regulator *ext_ddr3;
2213
2214 /* Use MPP7 output state as a flag for PCDDR3 presence. */
2215 if (gpio_get_value_cansleep(PM8921_MPP_PM_TO_SYS(7)) > 0) {
2216 ext_ddr3 = regulator_get(NULL, "ext_ddr3");
2217 if (IS_ERR(ext_ddr3) || ext_ddr3 == NULL)
2218 pr_err("Could not get MPP7 regulator\n");
2219 else
2220 regulator_enable(ext_ddr3);
2221 }
2222}
2223
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002224static void __init apq8064_common_init(void)
2225{
2226 if (socinfo_init() < 0)
2227 pr_err("socinfo_init() failed!\n");
Praveen Chidambaram78499012011-11-01 17:15:17 -06002228 BUG_ON(msm_rpm_init(&apq8064_rpm_data));
2229 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
David Collins2782b5c2012-02-06 10:02:42 -08002230 regulator_suppress_info_printing();
2231 platform_device_register(&apq8064_device_rpm_regulator);
Stephen Boyd4d0d2582012-02-10 14:49:40 -08002232 if (msm_xo_init())
2233 pr_err("Failed to initialize XO votes\n");
Tianyi Gou41515e22011-09-01 19:37:43 -07002234 apq8064_clock_init();
Stepan Moskovchenko2327a952011-12-14 16:31:28 -08002235 apq8064_init_gpiomux();
Kenneth Heitke748593a2011-07-15 15:45:11 -06002236 apq8064_i2c_init();
Jing Lin417fa452012-02-05 14:31:06 -08002237 register_i2c_devices();
Kenneth Heitke36920d32011-07-20 16:44:30 -06002238
Harini Jayaramanc4c58692011-07-19 14:50:10 -06002239 apq8064_device_qup_spi_gsbi5.dev.platform_data =
2240 &apq8064_qup_spi_gsbi5_pdata;
Stepan Moskovchenkoc1074f02011-12-14 17:51:57 -08002241 apq8064_init_pmic();
Hemant Kumar94e7da22012-02-03 16:52:29 -08002242 if (machine_is_apq8064_liquid())
2243 msm_otg_pdata.mhl_enable = true;
Vamsi Krishnad9863eb2012-03-26 17:34:48 -07002244
2245 msm_otg_pdata.swfi_latency =
2246 msm_rpmrs_levels[0].latency_us + 1;
2247
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002248 apq8064_device_otg.dev.platform_data = &msm_otg_pdata;
Manu Gautam91223e02011-11-08 15:27:22 +05302249 apq8064_ehci_host_init();
Gagan Mac8a7a5d32011-11-11 16:43:06 -07002250 apq8064_init_buses();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002251 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Jay Chokshi994ff122012-03-27 15:43:48 -07002252 enable_ddr3_regulator();
Hemant Kumarf1ca9192012-02-07 18:59:33 -08002253 if (machine_is_apq8064_mtp()) {
2254 apq8064_device_hsic_host.dev.platform_data = &msm_hsic_pdata;
2255 device_initialize(&apq8064_device_hsic_host.dev);
2256 }
Jay Chokshie8741282012-01-25 15:22:55 -08002257 apq8064_pm8xxx_gpio_mpp_init();
Sahitya Tummala3586ed92011-08-03 09:13:23 +05302258 apq8064_init_mmc();
Swaminathan Sathappan144b4882012-02-06 17:01:20 -08002259
2260 if (machine_is_apq8064_mtp()) {
2261 mdm_8064_device.dev.platform_data = &mdm_platform_data;
2262 platform_device_register(&mdm_8064_device);
2263 }
2264 platform_device_register(&apq8064_slim_ctrl);
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06002265 slim_register_board_info(apq8064_slim_devices,
2266 ARRAY_SIZE(apq8064_slim_devices));
Jin Hongd3024e62012-02-09 16:13:32 -08002267 apq8064_init_dsps();
Praveen Chidambaram78499012011-11-01 17:15:17 -06002268 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
Mahesh Sivasubramaniancbce1ec2012-01-24 10:32:44 -07002269 acpuclk_init(&acpuclk_8064_soc_data);
Praveen Chidambaram78499012011-11-01 17:15:17 -06002270 msm_spm_l2_init(msm_spm_l2_data);
2271 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
2272 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
2273 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
2274 msm_pm_data);
2275 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08002276 apq8064_epm_adc_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002277}
2278
Huaibin Yang4a084e32011-12-15 15:25:52 -08002279static void __init apq8064_allocate_memory_regions(void)
2280{
2281 apq8064_allocate_fb_region();
2282}
2283
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002284static void __init apq8064_sim_init(void)
2285{
Jeff Ohlstein7e668552011-10-06 16:17:25 -07002286 struct msm_watchdog_pdata *wdog_pdata = (struct msm_watchdog_pdata *)
2287 &msm8064_device_watchdog.dev.platform_data;
2288
2289 wdog_pdata->bark_time = 15000;
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -08002290 msm_tsens_early_init(&apq_tsens_pdata);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002291 apq8064_common_init();
Joel King4e7ad222011-08-17 15:47:38 -07002292 platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices));
2293}
2294
2295static void __init apq8064_rumi3_init(void)
2296{
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -08002297 msm_tsens_early_init(&apq_tsens_pdata);
Joel King4e7ad222011-08-17 15:47:38 -07002298 apq8064_common_init();
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002299 ethernet_init();
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07002300 platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002301 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
Huaibin Yang4a084e32011-12-15 15:25:52 -08002302 apq8064_init_fb();
Jordan Crouseb3115fe2012-02-01 22:11:12 -07002303 apq8064_init_gpu();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002304}
2305
Joel King82b7e3f2012-01-05 10:03:27 -08002306static void __init apq8064_cdp_init(void)
2307{
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -08002308 msm_tsens_early_init(&apq_tsens_pdata);
Joel King82b7e3f2012-01-05 10:03:27 -08002309 apq8064_common_init();
2310 ethernet_init();
2311 platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
2312 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002313 apq8064_init_fb();
Jordan Crouseb3115fe2012-02-01 22:11:12 -07002314 apq8064_init_gpu();
Matt Wagantall1875d322012-02-22 16:11:33 -08002315 platform_add_devices(apq8064_fs_devices, apq8064_num_fs_devices);
Kevin Chand07220e2012-02-13 15:52:22 -08002316 apq8064_init_cam();
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302317
2318 if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
2319 platform_device_register(&cdp_kp_pdev);
2320
2321 if (machine_is_apq8064_mtp())
2322 platform_device_register(&mtp_kp_pdev);
Joel King82b7e3f2012-01-05 10:03:27 -08002323}
2324
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002325MACHINE_START(APQ8064_SIM, "QCT APQ8064 SIMULATOR")
2326 .map_io = apq8064_map_io,
Kevin Chan13be4e22011-10-20 11:30:32 -07002327 .reserve = apq8064_reserve,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002328 .init_irq = apq8064_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302329 .handle_irq = gic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002330 .timer = &msm_timer,
2331 .init_machine = apq8064_sim_init,
2332MACHINE_END
2333
Joel King4e7ad222011-08-17 15:47:38 -07002334MACHINE_START(APQ8064_RUMI3, "QCT APQ8064 RUMI3")
2335 .map_io = apq8064_map_io,
Kevin Chan13be4e22011-10-20 11:30:32 -07002336 .reserve = apq8064_reserve,
Joel King4e7ad222011-08-17 15:47:38 -07002337 .init_irq = apq8064_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302338 .handle_irq = gic_handle_irq,
Joel King4e7ad222011-08-17 15:47:38 -07002339 .timer = &msm_timer,
2340 .init_machine = apq8064_rumi3_init,
Huaibin Yang4a084e32011-12-15 15:25:52 -08002341 .init_early = apq8064_allocate_memory_regions,
Joel King4e7ad222011-08-17 15:47:38 -07002342MACHINE_END
2343
Joel King82b7e3f2012-01-05 10:03:27 -08002344MACHINE_START(APQ8064_CDP, "QCT APQ8064 CDP")
2345 .map_io = apq8064_map_io,
2346 .reserve = apq8064_reserve,
2347 .init_irq = apq8064_init_irq,
2348 .handle_irq = gic_handle_irq,
2349 .timer = &msm_timer,
2350 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002351 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07002352 .init_very_early = apq8064_early_reserve,
Joel King82b7e3f2012-01-05 10:03:27 -08002353MACHINE_END
2354
2355MACHINE_START(APQ8064_MTP, "QCT APQ8064 MTP")
2356 .map_io = apq8064_map_io,
2357 .reserve = apq8064_reserve,
2358 .init_irq = apq8064_init_irq,
2359 .handle_irq = gic_handle_irq,
2360 .timer = &msm_timer,
2361 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002362 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07002363 .init_very_early = apq8064_early_reserve,
Joel King82b7e3f2012-01-05 10:03:27 -08002364MACHINE_END
2365
2366MACHINE_START(APQ8064_LIQUID, "QCT APQ8064 LIQUID")
2367 .map_io = apq8064_map_io,
2368 .reserve = apq8064_reserve,
2369 .init_irq = apq8064_init_irq,
2370 .handle_irq = gic_handle_irq,
2371 .timer = &msm_timer,
2372 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002373 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07002374 .init_very_early = apq8064_early_reserve,
Joel King82b7e3f2012-01-05 10:03:27 -08002375MACHINE_END
2376
Joel King064bbf82012-04-01 13:23:39 -07002377MACHINE_START(MPQ8064_CDP, "QCT MPQ8064 CDP")
2378 .map_io = apq8064_map_io,
2379 .reserve = apq8064_reserve,
2380 .init_irq = apq8064_init_irq,
2381 .handle_irq = gic_handle_irq,
2382 .timer = &msm_timer,
2383 .init_machine = apq8064_cdp_init,
2384 .init_early = apq8064_allocate_memory_regions,
2385 .init_very_early = apq8064_early_reserve,
2386MACHINE_END
2387
Joel King11ca8202012-02-13 16:19:03 -08002388MACHINE_START(MPQ8064_HRD, "QCT MPQ8064 HRD")
2389 .map_io = apq8064_map_io,
2390 .reserve = apq8064_reserve,
2391 .init_irq = apq8064_init_irq,
2392 .handle_irq = gic_handle_irq,
2393 .timer = &msm_timer,
2394 .init_machine = apq8064_cdp_init,
Laura Abbott6988cef2012-03-15 14:27:13 -07002395 .init_very_early = apq8064_early_reserve,
Joel King11ca8202012-02-13 16:19:03 -08002396MACHINE_END
2397
2398MACHINE_START(MPQ8064_DTV, "QCT MPQ8064 DTV")
2399 .map_io = apq8064_map_io,
2400 .reserve = apq8064_reserve,
2401 .init_irq = apq8064_init_irq,
2402 .handle_irq = gic_handle_irq,
2403 .timer = &msm_timer,
2404 .init_machine = apq8064_cdp_init,
Laura Abbott6988cef2012-03-15 14:27:13 -07002405 .init_very_early = apq8064_early_reserve,
Joel King11ca8202012-02-13 16:19:03 -08002406MACHINE_END
2407