blob: 261bbba4497ca893e2acd8d3d70f662d08755667 [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
Stephen Boyd986c9632012-04-24 16:31:45 -0700684void __init msm_pm_register_irqs(void)
Murali Nalajala2a0bbda2012-03-28 12:12:54 +0530685{
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,
Mohan Kumar Gubbihalli Lachma Naiked9dc912012-03-01 19:11:14 -0800958 .disable_dmx = 0,
959 .cont_mode_dpb_count = 8
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700960};
961
962struct platform_device msm_device_vidc_720p = {
963 .name = "msm_vidc",
964 .id = 0,
965 .num_resources = ARRAY_SIZE(msm_vidc_720p_resources),
966 .resource = msm_vidc_720p_resources,
967 .dev = {
968 .platform_data = &vidc_platform_data,
969 },
970};
971
972#if defined(CONFIG_FB_MSM_MDP40)
973#define MDP_BASE 0xA3F00000
974#define PMDH_BASE 0xAD600000
975#define EMDH_BASE 0xAD700000
976#define TVENC_BASE 0xAD400000
977#else
978#define MDP_BASE 0xAA200000
979#define PMDH_BASE 0xAA600000
980#define EMDH_BASE 0xAA700000
981#define TVENC_BASE 0xAA400000
982#endif
983
984static struct resource msm_mdp_resources[] = {
985 {
986 .name = "mdp",
987 .start = MDP_BASE,
988 .end = MDP_BASE + 0x000F0000 - 1,
989 .flags = IORESOURCE_MEM,
990 },
991 {
992 .start = INT_MDP,
993 .end = INT_MDP,
994 .flags = IORESOURCE_IRQ,
995 },
996};
997
998static struct resource msm_mddi_resources[] = {
999 {
1000 .name = "pmdh",
1001 .start = PMDH_BASE,
1002 .end = PMDH_BASE + PAGE_SIZE - 1,
1003 .flags = IORESOURCE_MEM,
1004 }
1005};
1006
1007static struct resource msm_mddi_ext_resources[] = {
1008 {
1009 .name = "emdh",
1010 .start = EMDH_BASE,
1011 .end = EMDH_BASE + PAGE_SIZE - 1,
1012 .flags = IORESOURCE_MEM,
1013 }
1014};
1015
1016static struct resource msm_ebi2_lcd_resources[] = {
1017 {
1018 .name = "base",
1019 .start = 0xa0d00000,
1020 .end = 0xa0d00000 + PAGE_SIZE - 1,
1021 .flags = IORESOURCE_MEM,
1022 },
1023 {
1024 .name = "lcd01",
1025 .start = 0x98000000,
1026 .end = 0x98000000 + 0x80000 - 1,
1027 .flags = IORESOURCE_MEM,
1028 },
1029 {
1030 .name = "lcd02",
1031 .start = 0x9c000000,
1032 .end = 0x9c000000 + 0x80000 - 1,
1033 .flags = IORESOURCE_MEM,
1034 },
1035};
1036
1037static struct resource msm_tvenc_resources[] = {
1038 {
1039 .name = "tvenc",
1040 .start = TVENC_BASE,
1041 .end = TVENC_BASE + PAGE_SIZE - 1,
1042 .flags = IORESOURCE_MEM,
1043 }
1044};
1045
1046#ifdef CONFIG_FB_MSM_TVOUT
1047static struct resource tvout_device_resources[] = {
1048 {
1049 .name = "tvout_device_irq",
1050 .start = INT_TV_ENC,
1051 .end = INT_TV_ENC,
1052 .flags = IORESOURCE_IRQ,
1053 },
1054};
1055#endif
1056
1057static struct platform_device msm_mdp_device = {
1058 .name = "mdp",
1059 .id = 0,
1060 .num_resources = ARRAY_SIZE(msm_mdp_resources),
1061 .resource = msm_mdp_resources,
1062};
1063
1064static struct platform_device msm_mddi_device = {
1065 .name = "mddi",
1066 .id = 0,
1067 .num_resources = ARRAY_SIZE(msm_mddi_resources),
1068 .resource = msm_mddi_resources,
1069};
1070
1071static struct platform_device msm_mddi_ext_device = {
1072 .name = "mddi_ext",
1073 .id = 0,
1074 .num_resources = ARRAY_SIZE(msm_mddi_ext_resources),
1075 .resource = msm_mddi_ext_resources,
1076};
1077
1078static struct platform_device msm_ebi2_lcd_device = {
1079 .name = "ebi2_lcd",
1080 .id = 0,
1081 .num_resources = ARRAY_SIZE(msm_ebi2_lcd_resources),
1082 .resource = msm_ebi2_lcd_resources,
1083};
1084
1085static struct platform_device msm_lcdc_device = {
1086 .name = "lcdc",
1087 .id = 0,
1088};
1089
1090static struct platform_device msm_dtv_device = {
1091 .name = "dtv",
1092 .id = 0,
1093};
1094
1095static struct platform_device msm_tvenc_device = {
1096 .name = "tvenc",
1097 .id = 0,
1098 .num_resources = ARRAY_SIZE(msm_tvenc_resources),
1099 .resource = msm_tvenc_resources,
1100};
1101
1102#ifdef CONFIG_FB_MSM_TVOUT
1103static struct platform_device tvout_msm_device = {
1104 .name = "tvout_device",
1105 .id = 0,
1106 .num_resources = ARRAY_SIZE(tvout_device_resources),
1107 .resource = tvout_device_resources,
1108};
1109#endif
1110
1111/* TSIF begin */
1112#if defined(CONFIG_TSIF) || defined(CONFIG_TSIF_MODULE)
1113
1114#define MSM_TSIF_PHYS (0xa3400000)
1115#define MSM_TSIF_SIZE (0x200)
1116
1117static struct resource tsif_resources[] = {
1118 [0] = {
1119 .flags = IORESOURCE_IRQ,
1120 .start = INT_TSIF,
1121 .end = INT_TSIF,
1122 },
1123 [1] = {
1124 .flags = IORESOURCE_MEM,
1125 .start = MSM_TSIF_PHYS,
1126 .end = MSM_TSIF_PHYS + MSM_TSIF_SIZE - 1,
1127 },
1128 [2] = {
1129 .flags = IORESOURCE_DMA,
1130 .start = DMOV_TSIF_CHAN,
1131 .end = DMOV_TSIF_CRCI,
1132 },
1133};
1134
1135static void tsif_release(struct device *dev)
1136{
1137 dev_info(dev, "release\n");
1138}
1139
1140struct platform_device msm_device_tsif = {
1141 .name = "msm_tsif",
1142 .id = 0,
1143 .num_resources = ARRAY_SIZE(tsif_resources),
1144 .resource = tsif_resources,
1145 .dev = {
1146 .release = tsif_release,
1147 },
1148};
1149#endif /* defined(CONFIG_TSIF) || defined(CONFIG_TSIF_MODULE) */
1150/* TSIF end */
1151
1152
1153
1154#ifdef CONFIG_MSM_ROTATOR
1155static struct resource resources_msm_rotator[] = {
1156 {
1157 .start = 0xA3E00000,
1158 .end = 0xA3F00000 - 1,
1159 .flags = IORESOURCE_MEM,
1160 },
1161 {
1162 .start = INT_ROTATOR,
1163 .end = INT_ROTATOR,
1164 .flags = IORESOURCE_IRQ,
1165 },
1166};
1167
1168static struct msm_rot_clocks rotator_clocks[] = {
1169 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07001170 .clk_name = "core_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001171 .clk_type = ROTATOR_CORE_CLK,
1172 .clk_rate = 0,
1173 },
1174 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07001175 .clk_name = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001176 .clk_type = ROTATOR_PCLK,
1177 .clk_rate = 0,
1178 },
1179 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07001180 .clk_name = "mem_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001181 .clk_type = ROTATOR_IMEM_CLK,
1182 .clk_rate = 0,
1183 },
1184};
1185
1186static struct msm_rotator_platform_data rotator_pdata = {
1187 .number_of_clocks = ARRAY_SIZE(rotator_clocks),
1188 .hardware_version_number = 0x1000303,
1189 .rotator_clks = rotator_clocks,
1190 .regulator_name = "fs_rot",
1191};
1192
1193struct platform_device msm_rotator_device = {
1194 .name = "msm_rotator",
1195 .id = 0,
1196 .num_resources = ARRAY_SIZE(resources_msm_rotator),
1197 .resource = resources_msm_rotator,
1198 .dev = {
1199 .platform_data = &rotator_pdata,
1200 },
1201};
1202#endif
1203
1204static void __init msm_register_device(struct platform_device *pdev, void *data)
1205{
1206 int ret;
1207
1208 pdev->dev.platform_data = data;
1209
1210 ret = platform_device_register(pdev);
1211 if (ret)
1212 dev_err(&pdev->dev,
1213 "%s: platform_device_register() failed = %d\n",
1214 __func__, ret);
1215}
1216
1217void __init msm_fb_register_device(char *name, void *data)
1218{
1219 if (!strncmp(name, "mdp", 3))
1220 msm_register_device(&msm_mdp_device, data);
1221 else if (!strncmp(name, "pmdh", 4))
1222 msm_register_device(&msm_mddi_device, data);
1223 else if (!strncmp(name, "emdh", 4))
1224 msm_register_device(&msm_mddi_ext_device, data);
1225 else if (!strncmp(name, "ebi2", 4))
1226 msm_register_device(&msm_ebi2_lcd_device, data);
1227 else if (!strncmp(name, "tvenc", 5))
1228 msm_register_device(&msm_tvenc_device, data);
1229 else if (!strncmp(name, "lcdc", 4))
1230 msm_register_device(&msm_lcdc_device, data);
1231 else if (!strncmp(name, "dtv", 3))
1232 msm_register_device(&msm_dtv_device, data);
1233#ifdef CONFIG_FB_MSM_TVOUT
1234 else if (!strncmp(name, "tvout_device", 12))
1235 msm_register_device(&tvout_msm_device, data);
1236#endif
1237 else
1238 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
1239}
1240
1241static struct platform_device msm_camera_device = {
1242 .name = "msm_camera",
1243 .id = 0,
1244};
1245
1246void __init msm_camera_register_device(void *res, uint32_t num,
1247 void *data)
1248{
1249 msm_camera_device.num_resources = num;
1250 msm_camera_device.resource = res;
1251
1252 msm_register_device(&msm_camera_device, data);
1253}
1254
1255struct resource kgsl_3d0_resources[] = {
1256 {
1257 .name = KGSL_3D0_REG_MEMORY,
1258 .start = 0xA3500000, /* 3D GRP address */
1259 .end = 0xA351ffff,
1260 .flags = IORESOURCE_MEM,
1261 },
1262 {
1263 .name = KGSL_3D0_IRQ,
1264 .start = INT_GRP_3D,
1265 .end = INT_GRP_3D,
1266 .flags = IORESOURCE_IRQ,
1267 },
1268};
1269
1270static struct kgsl_device_platform_data kgsl_3d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06001271 .pwrlevel = {
1272 {
1273 .gpu_freq = 245760000,
1274 .bus_freq = 192000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001275 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06001276 {
1277 .gpu_freq = 192000000,
1278 .bus_freq = 152000000,
1279 },
1280 {
1281 .gpu_freq = 192000000,
1282 .bus_freq = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001283 },
1284 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06001285 .init_level = 0,
1286 .num_levels = 3,
1287 .set_grp_async = set_grp3d_async,
1288 .idle_timeout = HZ/20,
1289 .nap_allowed = true,
Kedar Joshic11d0982012-02-07 10:59:49 +05301290 .idle_needed = true,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06001291 .clk_map = KGSL_CLK_SRC | KGSL_CLK_CORE |
1292 KGSL_CLK_IFACE | KGSL_CLK_MEM,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001293};
1294
1295struct platform_device msm_kgsl_3d0 = {
1296 .name = "kgsl-3d0",
1297 .id = 0,
1298 .num_resources = ARRAY_SIZE(kgsl_3d0_resources),
1299 .resource = kgsl_3d0_resources,
1300 .dev = {
1301 .platform_data = &kgsl_3d0_pdata,
1302 },
1303};
1304
1305static struct resource kgsl_2d0_resources[] = {
1306 {
1307 .name = KGSL_2D0_REG_MEMORY,
1308 .start = 0xA3900000, /* Z180 base address */
1309 .end = 0xA3900FFF,
1310 .flags = IORESOURCE_MEM,
1311 },
1312 {
1313 .name = KGSL_2D0_IRQ,
1314 .start = INT_GRP_2D,
1315 .end = INT_GRP_2D,
1316 .flags = IORESOURCE_IRQ,
1317 },
1318};
1319
1320static struct kgsl_device_platform_data kgsl_2d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06001321 .pwrlevel = {
1322 {
1323 .gpu_freq = 0,
1324 .bus_freq = 192000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001325 },
1326 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06001327 .init_level = 0,
1328 .num_levels = 1,
1329 /* HW workaround, run Z180 SYNC @ 192 MHZ */
1330 .set_grp_async = NULL,
1331 .idle_timeout = HZ/10,
1332 .nap_allowed = true,
Kedar Joshic11d0982012-02-07 10:59:49 +05301333 .idle_needed = true,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06001334 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001335};
1336
1337struct platform_device msm_kgsl_2d0 = {
1338 .name = "kgsl-2d0",
1339 .id = 0,
1340 .num_resources = ARRAY_SIZE(kgsl_2d0_resources),
1341 .resource = kgsl_2d0_resources,
1342 .dev = {
1343 .platform_data = &kgsl_2d0_pdata,
1344 },
1345};
1346
1347struct platform_device *msm_footswitch_devices[] = {
Matt Wagantall5c922112012-05-03 19:25:28 -07001348 FS_PCOM(FS_GFX2D0, "fs_gfx2d0", NULL),
1349 FS_PCOM(FS_GFX3D, "fs_gfx3d", NULL),
1350 FS_PCOM(FS_MDP, "fs_mdp", NULL),
1351 FS_PCOM(FS_MFC, "fs_mfc", NULL),
1352 FS_PCOM(FS_ROT, "fs_rot", NULL),
1353 FS_PCOM(FS_VFE, "fs_vfe", NULL),
1354 FS_PCOM(FS_VPE, "fs_vpe", NULL),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001355};
1356unsigned msm_num_footswitch_devices = ARRAY_SIZE(msm_footswitch_devices);
Taniya Das2e948192011-12-20 11:15:13 +05301357
1358static struct resource gpio_resources[] = {
1359 {
1360 .start = INT_GPIO_GROUP1,
1361 .flags = IORESOURCE_IRQ,
1362 },
1363 {
1364 .start = INT_GPIO_GROUP2,
1365 .flags = IORESOURCE_IRQ,
1366 },
1367};
1368
1369static struct platform_device msm_device_gpio = {
1370 .name = "msmgpio",
1371 .id = -1,
1372 .resource = gpio_resources,
1373 .num_resources = ARRAY_SIZE(gpio_resources),
1374};
1375
1376static int __init msm7630_init_gpio(void)
1377{
1378 platform_device_register(&msm_device_gpio);
1379 return 0;
1380}
1381
1382postcore_initcall(msm7630_init_gpio);