blob: 0e15a4fcada711a7e3010eff73b2c21cb686db75 [file] [log] [blame]
Daniel Walker10932762010-05-12 12:02:25 -07001/*
2 * Copyright (C) 2008 Google, Inc.
Taniya Das2e948192011-12-20 11:15:13 +05303 * Copyright (c) 2008-2012, Code Aurora Forum. All rights reserved.
Daniel Walker10932762010-05-12 12:02:25 -07004 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15
16#include <linux/kernel.h>
17#include <linux/platform_device.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070018#include <linux/msm_rotator.h>
Daniel Walker10932762010-05-12 12:02:25 -070019#include <linux/dma-mapping.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070020#include <linux/msm_kgsl.h>
21#include <linux/android_pmem.h>
22#include <linux/regulator/machine.h>
Taniya Das2e948192011-12-20 11:15:13 +053023#include <linux/init.h>
Daniel Walker10932762010-05-12 12:02:25 -070024#include <mach/irqs.h>
25#include <mach/msm_iomap.h>
26#include <mach/dma.h>
27#include <mach/board.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070028#include <asm/clkdev.h>
Daniel Walker10932762010-05-12 12:02:25 -070029
30#include "devices.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070031#include "gpio_hw.h"
32#include "footswitch.h"
Daniel Walker10932762010-05-12 12:02:25 -070033
34#include <asm/mach/flash.h>
35
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070036#include <asm/mach/mmc.h>
37#include <mach/msm_hsusb.h>
38#ifdef CONFIG_PMIC8058
39#include <linux/mfd/pmic8058.h>
40#endif
41#include <mach/dal_axi.h>
42#include <mach/msm_memtypes.h>
Murali Nalajala2a0bbda2012-03-28 12:12:54 +053043#include "pm.h"
44#include "irq.h"
Daniel Walker10932762010-05-12 12:02:25 -070045
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070046/* EBI THERMAL DRIVER */
47static struct resource msm_ebi0_thermal_resources[] = {
48 {
49 .start = 0xA8600000,
50 .end = 0xA86005FF,
51 .name = "physbase",
52 .flags = IORESOURCE_MEM
53 }
54};
55
56struct platform_device msm_ebi0_thermal = {
57 .name = "msm_popmem-tm",
58 .id = 0,
59 .num_resources = 1,
60 .resource = msm_ebi0_thermal_resources
61};
62
63static struct resource msm_ebi1_thermal_resources[] = {
64 {
65 .start = 0xA8700000,
66 .end = 0xA87005FF,
67 .name = "physbase",
68 .flags = IORESOURCE_MEM
69 }
70};
71
72struct platform_device msm_ebi1_thermal = {
73 .name = "msm_popmem-tm",
74 .id = 1,
75 .num_resources = 1,
76 .resource = msm_ebi1_thermal_resources
77};
78
Laxminath Kasam1d8255d2012-02-15 13:10:19 +053079static struct resource resources_adsp[] = {
80{
81 .start = INT_ADSP_A9_A11,
82 .end = INT_ADSP_A9_A11,
83 .flags = IORESOURCE_IRQ,
84},
85};
86
87struct platform_device msm_adsp_device = {
88 .name = "msm_adsp",
89 .id = -1,
90 .num_resources = ARRAY_SIZE(resources_adsp),
91 .resource = resources_adsp,
92};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070093
94static struct resource resources_uart1[] = {
95 {
96 .start = INT_UART1,
97 .end = INT_UART1,
98 .flags = IORESOURCE_IRQ,
99 },
100 {
Taniya Das298de8c2012-02-16 11:45:31 +0530101 .start = MSM7X30_UART1_PHYS,
102 .end = MSM7X30_UART1_PHYS + MSM7X30_UART1_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700103 .flags = IORESOURCE_MEM,
104 },
105};
Daniel Walker10932762010-05-12 12:02:25 -0700106
107static struct resource resources_uart2[] = {
108 {
109 .start = INT_UART2,
110 .end = INT_UART2,
111 .flags = IORESOURCE_IRQ,
112 },
113 {
Taniya Das298de8c2012-02-16 11:45:31 +0530114 .start = MSM7X30_UART2_PHYS,
115 .end = MSM7X30_UART2_PHYS + MSM7X30_UART2_SIZE - 1,
Daniel Walker10932762010-05-12 12:02:25 -0700116 .flags = IORESOURCE_MEM,
Stepan Moskovchenkod41cb8c2011-01-17 20:33:32 -0800117 .name = "uart_resource"
Daniel Walker10932762010-05-12 12:02:25 -0700118 },
119};
120
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700121static struct resource resources_uart3[] = {
122 {
123 .start = INT_UART3,
124 .end = INT_UART3,
125 .flags = IORESOURCE_IRQ,
126 },
127 {
Taniya Das298de8c2012-02-16 11:45:31 +0530128 .start = MSM7X30_UART3_PHYS,
129 .end = MSM7X30_UART3_PHYS + MSM7X30_UART3_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700130 .flags = IORESOURCE_MEM,
131 },
132};
133
134struct platform_device msm_device_uart1 = {
135 .name = "msm_serial",
136 .id = 0,
137 .num_resources = ARRAY_SIZE(resources_uart1),
138 .resource = resources_uart1,
139};
140
Daniel Walker10932762010-05-12 12:02:25 -0700141struct platform_device msm_device_uart2 = {
142 .name = "msm_serial",
143 .id = 1,
144 .num_resources = ARRAY_SIZE(resources_uart2),
145 .resource = resources_uart2,
146};
147
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700148struct platform_device msm_device_uart3 = {
149 .name = "msm_serial",
150 .id = 2,
151 .num_resources = ARRAY_SIZE(resources_uart3),
152 .resource = resources_uart3,
Niranjana Vishwanathapuraa8855e92010-10-06 13:52:10 -0700153};
154
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700155#define MSM_UART1DM_PHYS 0xA3300000
156#define MSM_UART2DM_PHYS 0xA3200000
157static struct resource msm_uart1_dm_resources[] = {
158 {
159 .start = MSM_UART1DM_PHYS,
160 .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1,
161 .flags = IORESOURCE_MEM,
162 },
163 {
164 .start = INT_UART1DM_IRQ,
165 .end = INT_UART1DM_IRQ,
166 .flags = IORESOURCE_IRQ,
167 },
168 {
169 .start = INT_UART1DM_RX,
170 .end = INT_UART1DM_RX,
171 .flags = IORESOURCE_IRQ,
172 },
173 {
174 .start = DMOV_HSUART1_TX_CHAN,
175 .end = DMOV_HSUART1_RX_CHAN,
176 .name = "uartdm_channels",
177 .flags = IORESOURCE_DMA,
178 },
179 {
180 .start = DMOV_HSUART1_TX_CRCI,
181 .end = DMOV_HSUART1_RX_CRCI,
182 .name = "uartdm_crci",
183 .flags = IORESOURCE_DMA,
184 },
185};
186
187static u64 msm_uart_dm1_dma_mask = DMA_BIT_MASK(32);
188
189struct platform_device msm_device_uart_dm1 = {
190 .name = "msm_serial_hs",
191 .id = 0,
192 .num_resources = ARRAY_SIZE(msm_uart1_dm_resources),
193 .resource = msm_uart1_dm_resources,
194 .dev = {
195 .dma_mask = &msm_uart_dm1_dma_mask,
196 .coherent_dma_mask = DMA_BIT_MASK(32),
197 },
198};
199
200static struct resource msm_uart2_dm_resources[] = {
201 {
202 .start = MSM_UART2DM_PHYS,
203 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
204 .flags = IORESOURCE_MEM,
205 },
206 {
207 .start = INT_UART2DM_IRQ,
208 .end = INT_UART2DM_IRQ,
209 .flags = IORESOURCE_IRQ,
210 },
211 {
212 .start = INT_UART2DM_RX,
213 .end = INT_UART2DM_RX,
214 .flags = IORESOURCE_IRQ,
215 },
216 {
217 .start = DMOV_HSUART2_TX_CHAN,
218 .end = DMOV_HSUART2_RX_CHAN,
219 .name = "uartdm_channels",
220 .flags = IORESOURCE_DMA,
221 },
222 {
223 .start = DMOV_HSUART2_TX_CRCI,
224 .end = DMOV_HSUART2_RX_CRCI,
225 .name = "uartdm_crci",
226 .flags = IORESOURCE_DMA,
227 },
228};
229
230static u64 msm_uart_dm2_dma_mask = DMA_BIT_MASK(32);
231
232struct platform_device msm_device_uart_dm2 = {
233 .name = "msm_serial_hs",
234 .id = 1,
235 .num_resources = ARRAY_SIZE(msm_uart2_dm_resources),
236 .resource = msm_uart2_dm_resources,
237 .dev = {
238 .dma_mask = &msm_uart_dm2_dma_mask,
239 .coherent_dma_mask = DMA_BIT_MASK(32),
240 },
241};
242
243#define MSM_I2C_SIZE SZ_4K
244#define MSM_I2C_PHYS 0xACD00000
245#define MSM_I2C_2_PHYS 0xACF00000
246static struct resource resources_i2c_2[] = {
247 {
248 .start = MSM_I2C_2_PHYS,
249 .end = MSM_I2C_2_PHYS + MSM_I2C_SIZE - 1,
250 .flags = IORESOURCE_MEM,
251 },
252 {
253 .start = INT_PWB_I2C_2,
254 .end = INT_PWB_I2C_2,
255 .flags = IORESOURCE_IRQ,
256 },
257};
258
259struct platform_device msm_device_i2c_2 = {
260 .name = "msm_i2c",
261 .id = 2,
262 .num_resources = ARRAY_SIZE(resources_i2c_2),
263 .resource = resources_i2c_2,
264};
265
266static struct resource resources_i2c[] = {
267 {
268 .start = MSM_I2C_PHYS,
269 .end = MSM_I2C_PHYS + MSM_I2C_SIZE - 1,
270 .flags = IORESOURCE_MEM,
271 },
272 {
273 .start = INT_PWB_I2C,
274 .end = INT_PWB_I2C,
275 .flags = IORESOURCE_IRQ,
276 },
277};
278
279struct platform_device msm_device_i2c = {
280 .name = "msm_i2c",
281 .id = 0,
282 .num_resources = ARRAY_SIZE(resources_i2c),
283 .resource = resources_i2c,
284};
285
Kiran Kumar H N305c53b2012-03-24 14:14:13 -0700286#ifdef CONFIG_MSM_CAMERA_V4L2
287static struct resource msm_csic_resources[] = {
288 {
289 .name = "csic",
290 .start = 0xA6100000,
291 .end = 0xA6100000 + 0x00000400 - 1,
292 .flags = IORESOURCE_MEM,
293 },
294 {
295 .name = "csic",
296 .start = INT_CSI,
297 .end = INT_CSI,
298 .flags = IORESOURCE_IRQ,
299 },
300};
301
302struct resource msm_vfe_resources[] = {
303 {
304 .name = "msm_vfe",
305 .start = 0xA6000000,
306 .end = 0xA6000000 + SZ_1M - 1,
307 .flags = IORESOURCE_MEM,
308 },
309 {
310 .name = "msm_vfe",
311 .start = INT_VFE,
312 .end = INT_VFE,
313 .flags = IORESOURCE_IRQ,
314 },
315 {
316 .name = "msm_camif",
317 .start = 0xAB000000,
318 .end = 0xAB000000 + SZ_1K - 1,
319 .flags = IORESOURCE_MEM,
320 },
321};
322
323static struct resource msm_vpe_resources[] = {
324 {
325 .name = "vpe",
326 .start = 0xAD200000,
327 .end = 0xAD200000 + SZ_1M - 1,
328 .flags = IORESOURCE_MEM,
329 },
330 {
331 .name = "vpe",
332 .start = INT_VPE,
333 .end = INT_VPE,
334 .flags = IORESOURCE_IRQ,
335 },
336};
337
338struct platform_device msm_device_csic0 = {
339 .name = "msm_csic",
340 .id = 0,
341 .resource = msm_csic_resources,
342 .num_resources = ARRAY_SIZE(msm_csic_resources),
343};
344
345struct platform_device msm_device_vfe = {
346 .name = "msm_vfe",
347 .id = 0,
348 .resource = msm_vfe_resources,
349 .num_resources = ARRAY_SIZE(msm_vfe_resources),
350};
351
352struct platform_device msm_device_vpe = {
353 .name = "msm_vpe",
354 .id = 0,
355 .resource = msm_vpe_resources,
356 .num_resources = ARRAY_SIZE(msm_vpe_resources),
357};
358#endif
359
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700360#define MSM_QUP_PHYS 0xA8301000
361#define MSM_GSBI_QUP_I2C_PHYS 0xA8300000
362#define MSM_QUP_SIZE SZ_4K
363static struct resource resources_qup[] = {
364 {
365 .name = "qup_phys_addr",
366 .start = MSM_QUP_PHYS,
367 .end = MSM_QUP_PHYS + MSM_QUP_SIZE - 1,
368 .flags = IORESOURCE_MEM,
369 },
370 {
371 .name = "gsbi_qup_i2c_addr",
372 .start = MSM_GSBI_QUP_I2C_PHYS,
373 .end = MSM_GSBI_QUP_I2C_PHYS + 4 - 1,
374 .flags = IORESOURCE_MEM,
375 },
376 {
377 .name = "qup_in_intr",
378 .start = INT_PWB_QUP_IN,
379 .end = INT_PWB_QUP_IN,
380 .flags = IORESOURCE_IRQ,
381 },
382 {
383 .name = "qup_out_intr",
384 .start = INT_PWB_QUP_OUT,
385 .end = INT_PWB_QUP_OUT,
386 .flags = IORESOURCE_IRQ,
387 },
388 {
389 .name = "qup_err_intr",
390 .start = INT_PWB_QUP_ERR,
391 .end = INT_PWB_QUP_ERR,
392 .flags = IORESOURCE_IRQ,
393 },
394};
395
396struct platform_device qup_device_i2c = {
397 .name = "qup_i2c",
398 .id = 4,
399 .num_resources = ARRAY_SIZE(resources_qup),
400 .resource = resources_qup,
401};
402
Anirudh Ghayal9d9cdc22011-10-10 17:17:07 +0530403#ifdef CONFIG_MSM_SSBI
404#define MSM_SSBI_PMIC1_PHYS 0xAD900000
405static struct resource msm_ssbi_pmic1_resources[] = {
406 {
407 .start = MSM_SSBI_PMIC1_PHYS,
408 .end = MSM_SSBI_PMIC1_PHYS + SZ_4K - 1,
409 .flags = IORESOURCE_MEM,
410 },
411};
412
413struct platform_device msm_device_ssbi_pmic1 = {
414 .name = "msm_ssbi",
415 .id = 0,
416 .resource = msm_ssbi_pmic1_resources,
417 .num_resources = ARRAY_SIZE(msm_ssbi_pmic1_resources),
418};
419#endif
420
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700421#ifdef CONFIG_I2C_SSBI
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700422#define MSM_SSBI7_PHYS 0xAC800000
423static struct resource msm_ssbi7_resources[] = {
424 {
425 .name = "ssbi_base",
426 .start = MSM_SSBI7_PHYS,
427 .end = MSM_SSBI7_PHYS + SZ_4K - 1,
428 .flags = IORESOURCE_MEM,
429 },
430};
431
432struct platform_device msm_device_ssbi7 = {
433 .name = "i2c_ssbi",
434 .id = 7,
435 .num_resources = ARRAY_SIZE(msm_ssbi7_resources),
436 .resource = msm_ssbi7_resources,
437};
438#endif /* CONFIG_I2C_SSBI */
439
440#define MSM_HSUSB_PHYS 0xA3600000
441static struct resource resources_hsusb_otg[] = {
Pavankumar Kondeti5155e2c2010-12-08 13:37:08 +0530442 {
443 .start = MSM_HSUSB_PHYS,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700444 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
Pavankumar Kondeti5155e2c2010-12-08 13:37:08 +0530445 .flags = IORESOURCE_MEM,
446 },
447 {
448 .start = INT_USB_HS,
449 .end = INT_USB_HS,
450 .flags = IORESOURCE_IRQ,
451 },
452};
453
Pavankumar Kondeti5155e2c2010-12-08 13:37:08 +0530454static u64 dma_mask = 0xffffffffULL;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700455struct platform_device msm_device_hsusb_otg = {
456 .name = "msm_hsusb_otg",
457 .id = -1,
458 .num_resources = ARRAY_SIZE(resources_hsusb_otg),
459 .resource = resources_hsusb_otg,
460 .dev = {
461 .dma_mask = &dma_mask,
462 .coherent_dma_mask = 0xffffffffULL,
463 },
464};
465
466static struct resource resources_hsusb_peripheral[] = {
467 {
468 .start = MSM_HSUSB_PHYS,
469 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
470 .flags = IORESOURCE_MEM,
471 },
472 {
473 .start = INT_USB_HS,
474 .end = INT_USB_HS,
475 .flags = IORESOURCE_IRQ,
476 },
477};
478
479static struct resource resources_gadget_peripheral[] = {
480 {
481 .start = MSM_HSUSB_PHYS,
482 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
483 .flags = IORESOURCE_MEM,
484 },
485 {
486 .start = INT_USB_HS,
487 .end = INT_USB_HS,
488 .flags = IORESOURCE_IRQ,
489 },
490};
491
492struct platform_device msm_device_hsusb_peripheral = {
493 .name = "msm_hsusb_peripheral",
494 .id = -1,
495 .num_resources = ARRAY_SIZE(resources_hsusb_peripheral),
496 .resource = resources_hsusb_peripheral,
497 .dev = {
498 .dma_mask = &dma_mask,
499 .coherent_dma_mask = 0xffffffffULL,
500 },
501};
502
503struct platform_device msm_device_gadget_peripheral = {
504 .name = "msm_hsusb",
505 .id = -1,
506 .num_resources = ARRAY_SIZE(resources_gadget_peripheral),
507 .resource = resources_gadget_peripheral,
508 .dev = {
509 .dma_mask = &dma_mask,
510 .coherent_dma_mask = 0xffffffffULL,
511 },
512};
513
Pavankumar Kondeti5155e2c2010-12-08 13:37:08 +0530514static struct resource resources_hsusb_host[] = {
515 {
516 .start = MSM_HSUSB_PHYS,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700517 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
Pavankumar Kondeti5155e2c2010-12-08 13:37:08 +0530518 .flags = IORESOURCE_MEM,
519 },
520 {
521 .start = INT_USB_HS,
522 .end = INT_USB_HS,
523 .flags = IORESOURCE_IRQ,
524 },
525};
526
527struct platform_device msm_device_hsusb_host = {
528 .name = "msm_hsusb_host",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700529 .id = 0,
Pavankumar Kondeti5155e2c2010-12-08 13:37:08 +0530530 .num_resources = ARRAY_SIZE(resources_hsusb_host),
531 .resource = resources_hsusb_host,
532 .dev = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700533 .dma_mask = &dma_mask,
534 .coherent_dma_mask = 0xffffffffULL,
Pavankumar Kondeti5155e2c2010-12-08 13:37:08 +0530535 },
536};
537
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700538static struct platform_device *msm_host_devices[] = {
539 &msm_device_hsusb_host,
Daniel Walker10932762010-05-12 12:02:25 -0700540};
541
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700542int msm_add_host(unsigned int host, struct msm_usb_host_platform_data *plat)
543{
544 struct platform_device *pdev;
Daniel Walker10932762010-05-12 12:02:25 -0700545
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700546 pdev = msm_host_devices[host];
547 if (!pdev)
548 return -ENODEV;
549 pdev->dev.platform_data = plat;
550 return platform_device_register(pdev);
551}
552
553struct platform_device asoc_msm_pcm = {
554 .name = "msm-dsp-audio",
555 .id = 0,
556};
557
558struct platform_device asoc_msm_dai0 = {
559 .name = "msm-codec-dai",
560 .id = 0,
561};
562
563struct platform_device asoc_msm_dai1 = {
564 .name = "msm-cpu-dai",
565 .id = 0,
566};
567
568#if defined (CONFIG_SND_MSM_MVS_DAI_SOC)
569struct platform_device asoc_msm_mvs = {
570 .name = "msm-mvs-audio",
571 .id = 0,
572};
573
574struct platform_device asoc_mvs_dai0 = {
575 .name = "mvs-codec-dai",
576 .id = 0,
577};
578
579struct platform_device asoc_mvs_dai1 = {
580 .name = "mvs-cpu-dai",
581 .id = 0,
582};
583#endif
584
585#define MSM_NAND_PHYS 0xA0200000
586#define MSM_NANDC01_PHYS 0xA0240000
587#define MSM_NANDC10_PHYS 0xA0280000
588#define MSM_NANDC11_PHYS 0xA02C0000
589#define EBI2_REG_BASE 0xA0000000
590static struct resource resources_nand[] = {
591 [0] = {
592 .name = "msm_nand_dmac",
593 .start = DMOV_NAND_CHAN,
594 .end = DMOV_NAND_CHAN,
595 .flags = IORESOURCE_DMA,
596 },
597 [1] = {
598 .name = "msm_nand_phys",
599 .start = MSM_NAND_PHYS,
600 .end = MSM_NAND_PHYS + 0x7FF,
601 .flags = IORESOURCE_MEM,
602 },
603 [2] = {
604 .name = "msm_nandc01_phys",
605 .start = MSM_NANDC01_PHYS,
606 .end = MSM_NANDC01_PHYS + 0x7FF,
607 .flags = IORESOURCE_MEM,
608 },
609 [3] = {
610 .name = "msm_nandc10_phys",
611 .start = MSM_NANDC10_PHYS,
612 .end = MSM_NANDC10_PHYS + 0x7FF,
613 .flags = IORESOURCE_MEM,
614 },
615 [4] = {
616 .name = "msm_nandc11_phys",
617 .start = MSM_NANDC11_PHYS,
618 .end = MSM_NANDC11_PHYS + 0x7FF,
619 .flags = IORESOURCE_MEM,
620 },
621 [5] = {
622 .name = "ebi2_reg_base",
623 .start = EBI2_REG_BASE,
624 .end = EBI2_REG_BASE + 0x60,
625 .flags = IORESOURCE_MEM,
626 },
627};
628
629static struct resource resources_otg[] = {
630 {
631 .start = MSM_HSUSB_PHYS,
632 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
633 .flags = IORESOURCE_MEM,
634 },
635 {
636 .start = INT_USB_HS,
637 .end = INT_USB_HS,
638 .flags = IORESOURCE_IRQ,
639 },
640 {
641 .name = "vbus_on",
Anirudh Ghayalc2019332011-11-12 06:29:10 +0530642 .start = PMIC8058_IRQ_BASE + PM8058_CHGVAL_IRQ,
643 .end = PMIC8058_IRQ_BASE + PM8058_CHGVAL_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700644 .flags = IORESOURCE_IRQ,
645 },
646};
647
648struct platform_device msm_device_otg = {
649 .name = "msm_otg",
650 .id = -1,
651 .num_resources = ARRAY_SIZE(resources_otg),
652 .resource = resources_otg,
653 .dev = {
654 .coherent_dma_mask = 0xffffffffULL,
655 },
656};
657
658struct flash_platform_data msm_nand_data = {
659 .parts = NULL,
660 .nr_parts = 0,
661 .interleave = 0,
662};
663
664struct platform_device msm_device_nand = {
665 .name = "msm_nand",
666 .id = -1,
667 .num_resources = ARRAY_SIZE(resources_nand),
668 .resource = resources_nand,
669 .dev = {
670 .platform_data = &msm_nand_data,
671 },
672};
673
Murali Nalajala2a0bbda2012-03-28 12:12:54 +0530674static struct msm_pm_irq_calls msm7x30_pm_irq_calls = {
675 .irq_pending = msm_irq_pending,
676 .idle_sleep_allowed = msm_irq_idle_sleep_allowed,
677 .enter_sleep1 = msm_irq_enter_sleep1,
678 .enter_sleep2 = msm_irq_enter_sleep2,
679 .exit_sleep1 = msm_irq_exit_sleep1,
680 .exit_sleep2 = msm_irq_exit_sleep2,
681 .exit_sleep3 = msm_irq_exit_sleep3,
682};
683
684void msm_pm_register_irqs(void)
685{
686 msm_pm_set_irq_extns(&msm7x30_pm_irq_calls);
687}
688
Angshuman Sarkarbad32df2012-02-01 19:52:52 +0530689static struct resource smd_resource[] = {
690 {
691 .name = "a9_m2a_0",
692 .start = INT_A9_M2A_0,
693 .flags = IORESOURCE_IRQ,
694 },
695 {
696 .name = "a9_m2a_5",
697 .start = INT_A9_M2A_5,
698 .flags = IORESOURCE_IRQ,
699 },
700 {
701 .name = "adsp_a11_smsm",
702 .start = INT_ADSP_A11,
703 .flags = IORESOURCE_IRQ,
704 },
705};
706
707static struct smd_subsystem_config smd_config_list[] = {
708 {
709 .irq_config_id = SMD_MODEM,
710 .subsys_name = "modem",
711 .edge = SMD_APPS_MODEM,
712
713 .smd_int.irq_name = "a9_m2a_0",
714 .smd_int.flags = IRQF_TRIGGER_RISING,
715 .smd_int.irq_id = -1,
716 .smd_int.device_name = "smd_dev",
717 .smd_int.dev_id = 0,
718
719 .smd_int.out_bit_pos = 1 << 0,
Taniya Das298de8c2012-02-16 11:45:31 +0530720 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
Angshuman Sarkarbad32df2012-02-01 19:52:52 +0530721 .smd_int.out_offset = 0x8,
722
723 .smsm_int.irq_name = "a9_m2a_5",
724 .smsm_int.flags = IRQF_TRIGGER_RISING,
725 .smsm_int.irq_id = -1,
726 .smsm_int.device_name = "smd_dev",
727 .smsm_int.dev_id = 0,
728
729 .smsm_int.out_bit_pos = 1 << 5,
Taniya Das298de8c2012-02-16 11:45:31 +0530730 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
Angshuman Sarkarbad32df2012-02-01 19:52:52 +0530731 .smsm_int.out_offset = 0x8,
732
733 }
734};
735
736static struct smd_platform smd_platform_data = {
737 .num_ss_configs = ARRAY_SIZE(smd_config_list),
738 .smd_ss_configs = smd_config_list,
739};
740
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700741struct platform_device msm_device_smd = {
742 .name = "msm_smd",
743 .id = -1,
Angshuman Sarkarbad32df2012-02-01 19:52:52 +0530744 .resource = smd_resource,
745 .num_resources = ARRAY_SIZE(smd_resource),
746 .dev = {
747 .platform_data = &smd_platform_data,
748 }
749
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700750};
751
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700752static struct resource msm_dmov_resource[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700753 {
754 .start = INT_ADM_AARM,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700755 .flags = IORESOURCE_IRQ,
756 },
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700757 {
758 .start = 0xAC400000,
759 .end = 0xAC400000 + SZ_4K - 1,
760 .flags = IORESOURCE_MEM,
761 },
762};
763
764static struct msm_dmov_pdata msm_dmov_pdata = {
765 .sd = 2,
766 .sd_size = 0x400,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700767};
768
769struct platform_device msm_device_dmov = {
770 .name = "msm_dmov",
771 .id = -1,
772 .resource = msm_dmov_resource,
773 .num_resources = ARRAY_SIZE(msm_dmov_resource),
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700774 .dev = {
775 .platform_data = &msm_dmov_pdata,
776 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700777};
778
779#define MSM_SDC1_BASE 0xA0400000
780#define MSM_SDC2_BASE 0xA0500000
781#define MSM_SDC3_BASE 0xA3000000
782#define MSM_SDC4_BASE 0xA3100000
783static struct resource resources_sdc1[] = {
784 {
785 .start = MSM_SDC1_BASE,
786 .end = MSM_SDC1_BASE + SZ_4K - 1,
787 .flags = IORESOURCE_MEM,
788 },
789 {
790 .start = INT_SDC1_0,
791 .end = INT_SDC1_1,
792 .flags = IORESOURCE_IRQ,
793 },
794 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700795 .name = "sdcc_dma_chnl",
796 .start = DMOV_SDC1_CHAN,
797 .end = DMOV_SDC1_CHAN,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700798 .flags = IORESOURCE_DMA,
799 },
Krishna Konda25786ec2011-07-25 16:21:36 -0700800 {
801 .name = "sdcc_dma_crci",
802 .start = DMOV_SDC1_CRCI,
803 .end = DMOV_SDC1_CRCI,
804 .flags = IORESOURCE_DMA,
805 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700806};
807
808static struct resource resources_sdc2[] = {
809 {
810 .start = MSM_SDC2_BASE,
811 .end = MSM_SDC2_BASE + SZ_4K - 1,
812 .flags = IORESOURCE_MEM,
813 },
814 {
815 .start = INT_SDC2_0,
816 .end = INT_SDC2_1,
817 .flags = IORESOURCE_IRQ,
818 },
819 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700820 .name = "sdcc_dma_chnl",
821 .start = DMOV_SDC2_CHAN,
822 .end = DMOV_SDC2_CHAN,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700823 .flags = IORESOURCE_DMA,
824 },
Krishna Konda25786ec2011-07-25 16:21:36 -0700825 {
826 .name = "sdcc_dma_crci",
827 .start = DMOV_SDC2_CRCI,
828 .end = DMOV_SDC2_CRCI,
829 .flags = IORESOURCE_DMA,
830 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700831};
832
833static struct resource resources_sdc3[] = {
834 {
835 .start = MSM_SDC3_BASE,
836 .end = MSM_SDC3_BASE + SZ_4K - 1,
837 .flags = IORESOURCE_MEM,
838 },
839 {
840 .start = INT_SDC3_0,
841 .end = INT_SDC3_1,
842 .flags = IORESOURCE_IRQ,
843 },
844 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700845 .name = "sdcc_dma_chnl",
Pankaj Kumare657b9f2011-10-12 20:11:12 +0530846 .start = DMOV_SDC3_CHAN,
847 .end = DMOV_SDC3_CHAN,
Krishna Konda25786ec2011-07-25 16:21:36 -0700848 .flags = IORESOURCE_DMA,
849 },
850 {
851 .name = "sdcc_dma_crci",
Pankaj Kumare657b9f2011-10-12 20:11:12 +0530852 .start = DMOV_SDC3_CRCI,
853 .end = DMOV_SDC3_CRCI,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700854 .flags = IORESOURCE_DMA,
855 },
856};
857
858static struct resource resources_sdc4[] = {
859 {
860 .start = MSM_SDC4_BASE,
861 .end = MSM_SDC4_BASE + SZ_4K - 1,
862 .flags = IORESOURCE_MEM,
863 },
864 {
865 .start = INT_SDC4_0,
866 .end = INT_SDC4_1,
867 .flags = IORESOURCE_IRQ,
868 },
869 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700870 .name = "sdcc_dma_chnl",
Pankaj Kumare657b9f2011-10-12 20:11:12 +0530871 .start = DMOV_SDC4_CHAN,
872 .end = DMOV_SDC4_CHAN,
Krishna Konda25786ec2011-07-25 16:21:36 -0700873 .flags = IORESOURCE_DMA,
874 },
875 {
876 .name = "sdcc_dma_crci",
Pankaj Kumare657b9f2011-10-12 20:11:12 +0530877 .start = DMOV_SDC4_CRCI,
878 .end = DMOV_SDC4_CRCI,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700879 .flags = IORESOURCE_DMA,
880 },
881};
882
883struct platform_device msm_device_sdc1 = {
884 .name = "msm_sdcc",
885 .id = 1,
886 .num_resources = ARRAY_SIZE(resources_sdc1),
887 .resource = resources_sdc1,
888 .dev = {
889 .coherent_dma_mask = 0xffffffff,
890 },
891};
892
893struct platform_device msm_device_sdc2 = {
894 .name = "msm_sdcc",
895 .id = 2,
896 .num_resources = ARRAY_SIZE(resources_sdc2),
897 .resource = resources_sdc2,
898 .dev = {
899 .coherent_dma_mask = 0xffffffff,
900 },
901};
902
903struct platform_device msm_device_sdc3 = {
904 .name = "msm_sdcc",
905 .id = 3,
906 .num_resources = ARRAY_SIZE(resources_sdc3),
907 .resource = resources_sdc3,
908 .dev = {
909 .coherent_dma_mask = 0xffffffff,
910 },
911};
912
913struct platform_device msm_device_sdc4 = {
914 .name = "msm_sdcc",
915 .id = 4,
916 .num_resources = ARRAY_SIZE(resources_sdc4),
917 .resource = resources_sdc4,
918 .dev = {
919 .coherent_dma_mask = 0xffffffff,
920 },
921};
922
923static struct platform_device *msm_sdcc_devices[] __initdata = {
924 &msm_device_sdc1,
925 &msm_device_sdc2,
926 &msm_device_sdc3,
927 &msm_device_sdc4,
928};
929
930int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
931{
932 struct platform_device *pdev;
933
934 if (controller < 1 || controller > 4)
935 return -EINVAL;
936
937 pdev = msm_sdcc_devices[controller-1];
938 pdev->dev.platform_data = plat;
939 return platform_device_register(pdev);
940}
941
942static struct resource msm_vidc_720p_resources[] = {
943 {
944 .start = 0xA3B00000,
945 .end = 0xA3B00000 + SZ_4K - 1,
946 .flags = IORESOURCE_MEM,
947 },
948 {
949 .start = INT_MFC720,
950 .end = INT_MFC720,
951 .flags = IORESOURCE_IRQ,
952 },
953};
954
955struct msm_vidc_platform_data vidc_platform_data = {
Deepak Koturcb4f6722011-10-31 14:06:57 -0700956 .memtype = MEMTYPE_EBI0,
Deepika Pepakayalabebc7622011-12-01 15:13:43 -0800957 .enable_ion = 0,
958 .disable_dmx = 0
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700959};
960
961struct platform_device msm_device_vidc_720p = {
962 .name = "msm_vidc",
963 .id = 0,
964 .num_resources = ARRAY_SIZE(msm_vidc_720p_resources),
965 .resource = msm_vidc_720p_resources,
966 .dev = {
967 .platform_data = &vidc_platform_data,
968 },
969};
970
971#if defined(CONFIG_FB_MSM_MDP40)
972#define MDP_BASE 0xA3F00000
973#define PMDH_BASE 0xAD600000
974#define EMDH_BASE 0xAD700000
975#define TVENC_BASE 0xAD400000
976#else
977#define MDP_BASE 0xAA200000
978#define PMDH_BASE 0xAA600000
979#define EMDH_BASE 0xAA700000
980#define TVENC_BASE 0xAA400000
981#endif
982
983static struct resource msm_mdp_resources[] = {
984 {
985 .name = "mdp",
986 .start = MDP_BASE,
987 .end = MDP_BASE + 0x000F0000 - 1,
988 .flags = IORESOURCE_MEM,
989 },
990 {
991 .start = INT_MDP,
992 .end = INT_MDP,
993 .flags = IORESOURCE_IRQ,
994 },
995};
996
997static struct resource msm_mddi_resources[] = {
998 {
999 .name = "pmdh",
1000 .start = PMDH_BASE,
1001 .end = PMDH_BASE + PAGE_SIZE - 1,
1002 .flags = IORESOURCE_MEM,
1003 }
1004};
1005
1006static struct resource msm_mddi_ext_resources[] = {
1007 {
1008 .name = "emdh",
1009 .start = EMDH_BASE,
1010 .end = EMDH_BASE + PAGE_SIZE - 1,
1011 .flags = IORESOURCE_MEM,
1012 }
1013};
1014
1015static struct resource msm_ebi2_lcd_resources[] = {
1016 {
1017 .name = "base",
1018 .start = 0xa0d00000,
1019 .end = 0xa0d00000 + PAGE_SIZE - 1,
1020 .flags = IORESOURCE_MEM,
1021 },
1022 {
1023 .name = "lcd01",
1024 .start = 0x98000000,
1025 .end = 0x98000000 + 0x80000 - 1,
1026 .flags = IORESOURCE_MEM,
1027 },
1028 {
1029 .name = "lcd02",
1030 .start = 0x9c000000,
1031 .end = 0x9c000000 + 0x80000 - 1,
1032 .flags = IORESOURCE_MEM,
1033 },
1034};
1035
1036static struct resource msm_tvenc_resources[] = {
1037 {
1038 .name = "tvenc",
1039 .start = TVENC_BASE,
1040 .end = TVENC_BASE + PAGE_SIZE - 1,
1041 .flags = IORESOURCE_MEM,
1042 }
1043};
1044
1045#ifdef CONFIG_FB_MSM_TVOUT
1046static struct resource tvout_device_resources[] = {
1047 {
1048 .name = "tvout_device_irq",
1049 .start = INT_TV_ENC,
1050 .end = INT_TV_ENC,
1051 .flags = IORESOURCE_IRQ,
1052 },
1053};
1054#endif
1055
1056static struct platform_device msm_mdp_device = {
1057 .name = "mdp",
1058 .id = 0,
1059 .num_resources = ARRAY_SIZE(msm_mdp_resources),
1060 .resource = msm_mdp_resources,
1061};
1062
1063static struct platform_device msm_mddi_device = {
1064 .name = "mddi",
1065 .id = 0,
1066 .num_resources = ARRAY_SIZE(msm_mddi_resources),
1067 .resource = msm_mddi_resources,
1068};
1069
1070static struct platform_device msm_mddi_ext_device = {
1071 .name = "mddi_ext",
1072 .id = 0,
1073 .num_resources = ARRAY_SIZE(msm_mddi_ext_resources),
1074 .resource = msm_mddi_ext_resources,
1075};
1076
1077static struct platform_device msm_ebi2_lcd_device = {
1078 .name = "ebi2_lcd",
1079 .id = 0,
1080 .num_resources = ARRAY_SIZE(msm_ebi2_lcd_resources),
1081 .resource = msm_ebi2_lcd_resources,
1082};
1083
1084static struct platform_device msm_lcdc_device = {
1085 .name = "lcdc",
1086 .id = 0,
1087};
1088
1089static struct platform_device msm_dtv_device = {
1090 .name = "dtv",
1091 .id = 0,
1092};
1093
1094static struct platform_device msm_tvenc_device = {
1095 .name = "tvenc",
1096 .id = 0,
1097 .num_resources = ARRAY_SIZE(msm_tvenc_resources),
1098 .resource = msm_tvenc_resources,
1099};
1100
1101#ifdef CONFIG_FB_MSM_TVOUT
1102static struct platform_device tvout_msm_device = {
1103 .name = "tvout_device",
1104 .id = 0,
1105 .num_resources = ARRAY_SIZE(tvout_device_resources),
1106 .resource = tvout_device_resources,
1107};
1108#endif
1109
1110/* TSIF begin */
1111#if defined(CONFIG_TSIF) || defined(CONFIG_TSIF_MODULE)
1112
1113#define MSM_TSIF_PHYS (0xa3400000)
1114#define MSM_TSIF_SIZE (0x200)
1115
1116static struct resource tsif_resources[] = {
1117 [0] = {
1118 .flags = IORESOURCE_IRQ,
1119 .start = INT_TSIF,
1120 .end = INT_TSIF,
1121 },
1122 [1] = {
1123 .flags = IORESOURCE_MEM,
1124 .start = MSM_TSIF_PHYS,
1125 .end = MSM_TSIF_PHYS + MSM_TSIF_SIZE - 1,
1126 },
1127 [2] = {
1128 .flags = IORESOURCE_DMA,
1129 .start = DMOV_TSIF_CHAN,
1130 .end = DMOV_TSIF_CRCI,
1131 },
1132};
1133
1134static void tsif_release(struct device *dev)
1135{
1136 dev_info(dev, "release\n");
1137}
1138
1139struct platform_device msm_device_tsif = {
1140 .name = "msm_tsif",
1141 .id = 0,
1142 .num_resources = ARRAY_SIZE(tsif_resources),
1143 .resource = tsif_resources,
1144 .dev = {
1145 .release = tsif_release,
1146 },
1147};
1148#endif /* defined(CONFIG_TSIF) || defined(CONFIG_TSIF_MODULE) */
1149/* TSIF end */
1150
1151
1152
1153#ifdef CONFIG_MSM_ROTATOR
1154static struct resource resources_msm_rotator[] = {
1155 {
1156 .start = 0xA3E00000,
1157 .end = 0xA3F00000 - 1,
1158 .flags = IORESOURCE_MEM,
1159 },
1160 {
1161 .start = INT_ROTATOR,
1162 .end = INT_ROTATOR,
1163 .flags = IORESOURCE_IRQ,
1164 },
1165};
1166
1167static struct msm_rot_clocks rotator_clocks[] = {
1168 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07001169 .clk_name = "core_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001170 .clk_type = ROTATOR_CORE_CLK,
1171 .clk_rate = 0,
1172 },
1173 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07001174 .clk_name = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001175 .clk_type = ROTATOR_PCLK,
1176 .clk_rate = 0,
1177 },
1178 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07001179 .clk_name = "mem_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001180 .clk_type = ROTATOR_IMEM_CLK,
1181 .clk_rate = 0,
1182 },
1183};
1184
1185static struct msm_rotator_platform_data rotator_pdata = {
1186 .number_of_clocks = ARRAY_SIZE(rotator_clocks),
1187 .hardware_version_number = 0x1000303,
1188 .rotator_clks = rotator_clocks,
1189 .regulator_name = "fs_rot",
1190};
1191
1192struct platform_device msm_rotator_device = {
1193 .name = "msm_rotator",
1194 .id = 0,
1195 .num_resources = ARRAY_SIZE(resources_msm_rotator),
1196 .resource = resources_msm_rotator,
1197 .dev = {
1198 .platform_data = &rotator_pdata,
1199 },
1200};
1201#endif
1202
1203static void __init msm_register_device(struct platform_device *pdev, void *data)
1204{
1205 int ret;
1206
1207 pdev->dev.platform_data = data;
1208
1209 ret = platform_device_register(pdev);
1210 if (ret)
1211 dev_err(&pdev->dev,
1212 "%s: platform_device_register() failed = %d\n",
1213 __func__, ret);
1214}
1215
1216void __init msm_fb_register_device(char *name, void *data)
1217{
1218 if (!strncmp(name, "mdp", 3))
1219 msm_register_device(&msm_mdp_device, data);
1220 else if (!strncmp(name, "pmdh", 4))
1221 msm_register_device(&msm_mddi_device, data);
1222 else if (!strncmp(name, "emdh", 4))
1223 msm_register_device(&msm_mddi_ext_device, data);
1224 else if (!strncmp(name, "ebi2", 4))
1225 msm_register_device(&msm_ebi2_lcd_device, data);
1226 else if (!strncmp(name, "tvenc", 5))
1227 msm_register_device(&msm_tvenc_device, data);
1228 else if (!strncmp(name, "lcdc", 4))
1229 msm_register_device(&msm_lcdc_device, data);
1230 else if (!strncmp(name, "dtv", 3))
1231 msm_register_device(&msm_dtv_device, data);
1232#ifdef CONFIG_FB_MSM_TVOUT
1233 else if (!strncmp(name, "tvout_device", 12))
1234 msm_register_device(&tvout_msm_device, data);
1235#endif
1236 else
1237 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
1238}
1239
1240static struct platform_device msm_camera_device = {
1241 .name = "msm_camera",
1242 .id = 0,
1243};
1244
1245void __init msm_camera_register_device(void *res, uint32_t num,
1246 void *data)
1247{
1248 msm_camera_device.num_resources = num;
1249 msm_camera_device.resource = res;
1250
1251 msm_register_device(&msm_camera_device, data);
1252}
1253
1254struct resource kgsl_3d0_resources[] = {
1255 {
1256 .name = KGSL_3D0_REG_MEMORY,
1257 .start = 0xA3500000, /* 3D GRP address */
1258 .end = 0xA351ffff,
1259 .flags = IORESOURCE_MEM,
1260 },
1261 {
1262 .name = KGSL_3D0_IRQ,
1263 .start = INT_GRP_3D,
1264 .end = INT_GRP_3D,
1265 .flags = IORESOURCE_IRQ,
1266 },
1267};
1268
1269static struct kgsl_device_platform_data kgsl_3d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06001270 .pwrlevel = {
1271 {
1272 .gpu_freq = 245760000,
1273 .bus_freq = 192000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001274 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06001275 {
1276 .gpu_freq = 192000000,
1277 .bus_freq = 152000000,
1278 },
1279 {
1280 .gpu_freq = 192000000,
1281 .bus_freq = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001282 },
1283 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06001284 .init_level = 0,
1285 .num_levels = 3,
1286 .set_grp_async = set_grp3d_async,
1287 .idle_timeout = HZ/20,
1288 .nap_allowed = true,
Kedar Joshic11d0982012-02-07 10:59:49 +05301289 .idle_needed = true,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06001290 .clk_map = KGSL_CLK_SRC | KGSL_CLK_CORE |
1291 KGSL_CLK_IFACE | KGSL_CLK_MEM,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001292};
1293
1294struct platform_device msm_kgsl_3d0 = {
1295 .name = "kgsl-3d0",
1296 .id = 0,
1297 .num_resources = ARRAY_SIZE(kgsl_3d0_resources),
1298 .resource = kgsl_3d0_resources,
1299 .dev = {
1300 .platform_data = &kgsl_3d0_pdata,
1301 },
1302};
1303
1304static struct resource kgsl_2d0_resources[] = {
1305 {
1306 .name = KGSL_2D0_REG_MEMORY,
1307 .start = 0xA3900000, /* Z180 base address */
1308 .end = 0xA3900FFF,
1309 .flags = IORESOURCE_MEM,
1310 },
1311 {
1312 .name = KGSL_2D0_IRQ,
1313 .start = INT_GRP_2D,
1314 .end = INT_GRP_2D,
1315 .flags = IORESOURCE_IRQ,
1316 },
1317};
1318
1319static struct kgsl_device_platform_data kgsl_2d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06001320 .pwrlevel = {
1321 {
1322 .gpu_freq = 0,
1323 .bus_freq = 192000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001324 },
1325 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06001326 .init_level = 0,
1327 .num_levels = 1,
1328 /* HW workaround, run Z180 SYNC @ 192 MHZ */
1329 .set_grp_async = NULL,
1330 .idle_timeout = HZ/10,
1331 .nap_allowed = true,
Kedar Joshic11d0982012-02-07 10:59:49 +05301332 .idle_needed = true,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06001333 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001334};
1335
1336struct platform_device msm_kgsl_2d0 = {
1337 .name = "kgsl-2d0",
1338 .id = 0,
1339 .num_resources = ARRAY_SIZE(kgsl_2d0_resources),
1340 .resource = kgsl_2d0_resources,
1341 .dev = {
1342 .platform_data = &kgsl_2d0_pdata,
1343 },
1344};
1345
1346struct platform_device *msm_footswitch_devices[] = {
1347 FS_PCOM(FS_GFX2D0, "fs_gfx2d0"),
1348 FS_PCOM(FS_GFX3D, "fs_gfx3d"),
1349 FS_PCOM(FS_MDP, "fs_mdp"),
1350 FS_PCOM(FS_MFC, "fs_mfc"),
1351 FS_PCOM(FS_ROT, "fs_rot"),
1352 FS_PCOM(FS_VFE, "fs_vfe"),
1353 FS_PCOM(FS_VPE, "fs_vpe"),
1354};
1355unsigned msm_num_footswitch_devices = ARRAY_SIZE(msm_footswitch_devices);
Taniya Das2e948192011-12-20 11:15:13 +05301356
1357static struct resource gpio_resources[] = {
1358 {
1359 .start = INT_GPIO_GROUP1,
1360 .flags = IORESOURCE_IRQ,
1361 },
1362 {
1363 .start = INT_GPIO_GROUP2,
1364 .flags = IORESOURCE_IRQ,
1365 },
1366};
1367
1368static struct platform_device msm_device_gpio = {
1369 .name = "msmgpio",
1370 .id = -1,
1371 .resource = gpio_resources,
1372 .num_resources = ARRAY_SIZE(gpio_resources),
1373};
1374
1375static int __init msm7630_init_gpio(void)
1376{
1377 platform_device_register(&msm_device_gpio);
1378 return 0;
1379}
1380
1381postcore_initcall(msm7630_init_gpio);