blob: 069714a629cc0c44fc639f82190f13c395dac014 [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 = {
Sujit Reddy Thummaec9b3252012-04-23 15:53:45 +0530659 .version = VERSION_2,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700660};
661
662struct platform_device msm_device_nand = {
663 .name = "msm_nand",
664 .id = -1,
665 .num_resources = ARRAY_SIZE(resources_nand),
666 .resource = resources_nand,
667 .dev = {
668 .platform_data = &msm_nand_data,
669 },
670};
671
Murali Nalajala2a0bbda2012-03-28 12:12:54 +0530672static struct msm_pm_irq_calls msm7x30_pm_irq_calls = {
673 .irq_pending = msm_irq_pending,
674 .idle_sleep_allowed = msm_irq_idle_sleep_allowed,
675 .enter_sleep1 = msm_irq_enter_sleep1,
676 .enter_sleep2 = msm_irq_enter_sleep2,
677 .exit_sleep1 = msm_irq_exit_sleep1,
678 .exit_sleep2 = msm_irq_exit_sleep2,
679 .exit_sleep3 = msm_irq_exit_sleep3,
680};
681
Stephen Boyd986c9632012-04-24 16:31:45 -0700682void __init msm_pm_register_irqs(void)
Murali Nalajala2a0bbda2012-03-28 12:12:54 +0530683{
684 msm_pm_set_irq_extns(&msm7x30_pm_irq_calls);
685}
686
Angshuman Sarkarbad32df2012-02-01 19:52:52 +0530687static struct resource smd_resource[] = {
688 {
689 .name = "a9_m2a_0",
690 .start = INT_A9_M2A_0,
691 .flags = IORESOURCE_IRQ,
692 },
693 {
694 .name = "a9_m2a_5",
695 .start = INT_A9_M2A_5,
696 .flags = IORESOURCE_IRQ,
697 },
698 {
699 .name = "adsp_a11_smsm",
700 .start = INT_ADSP_A11,
701 .flags = IORESOURCE_IRQ,
702 },
703};
704
705static struct smd_subsystem_config smd_config_list[] = {
706 {
707 .irq_config_id = SMD_MODEM,
708 .subsys_name = "modem",
709 .edge = SMD_APPS_MODEM,
710
711 .smd_int.irq_name = "a9_m2a_0",
712 .smd_int.flags = IRQF_TRIGGER_RISING,
713 .smd_int.irq_id = -1,
714 .smd_int.device_name = "smd_dev",
715 .smd_int.dev_id = 0,
716
717 .smd_int.out_bit_pos = 1 << 0,
Taniya Das298de8c2012-02-16 11:45:31 +0530718 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
Angshuman Sarkarbad32df2012-02-01 19:52:52 +0530719 .smd_int.out_offset = 0x8,
720
721 .smsm_int.irq_name = "a9_m2a_5",
722 .smsm_int.flags = IRQF_TRIGGER_RISING,
723 .smsm_int.irq_id = -1,
724 .smsm_int.device_name = "smd_dev",
725 .smsm_int.dev_id = 0,
726
727 .smsm_int.out_bit_pos = 1 << 5,
Taniya Das298de8c2012-02-16 11:45:31 +0530728 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
Angshuman Sarkarbad32df2012-02-01 19:52:52 +0530729 .smsm_int.out_offset = 0x8,
730
731 }
732};
733
734static struct smd_platform smd_platform_data = {
735 .num_ss_configs = ARRAY_SIZE(smd_config_list),
736 .smd_ss_configs = smd_config_list,
737};
738
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700739struct platform_device msm_device_smd = {
740 .name = "msm_smd",
741 .id = -1,
Angshuman Sarkarbad32df2012-02-01 19:52:52 +0530742 .resource = smd_resource,
743 .num_resources = ARRAY_SIZE(smd_resource),
744 .dev = {
745 .platform_data = &smd_platform_data,
746 }
747
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700748};
749
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700750static struct resource msm_dmov_resource[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700751 {
752 .start = INT_ADM_AARM,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700753 .flags = IORESOURCE_IRQ,
754 },
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700755 {
756 .start = 0xAC400000,
757 .end = 0xAC400000 + SZ_4K - 1,
758 .flags = IORESOURCE_MEM,
759 },
760};
761
762static struct msm_dmov_pdata msm_dmov_pdata = {
763 .sd = 2,
764 .sd_size = 0x400,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700765};
766
767struct platform_device msm_device_dmov = {
768 .name = "msm_dmov",
769 .id = -1,
770 .resource = msm_dmov_resource,
771 .num_resources = ARRAY_SIZE(msm_dmov_resource),
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700772 .dev = {
773 .platform_data = &msm_dmov_pdata,
774 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700775};
776
777#define MSM_SDC1_BASE 0xA0400000
778#define MSM_SDC2_BASE 0xA0500000
779#define MSM_SDC3_BASE 0xA3000000
780#define MSM_SDC4_BASE 0xA3100000
781static struct resource resources_sdc1[] = {
782 {
783 .start = MSM_SDC1_BASE,
784 .end = MSM_SDC1_BASE + SZ_4K - 1,
785 .flags = IORESOURCE_MEM,
786 },
787 {
788 .start = INT_SDC1_0,
789 .end = INT_SDC1_1,
790 .flags = IORESOURCE_IRQ,
791 },
792 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700793 .name = "sdcc_dma_chnl",
794 .start = DMOV_SDC1_CHAN,
795 .end = DMOV_SDC1_CHAN,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700796 .flags = IORESOURCE_DMA,
797 },
Krishna Konda25786ec2011-07-25 16:21:36 -0700798 {
799 .name = "sdcc_dma_crci",
800 .start = DMOV_SDC1_CRCI,
801 .end = DMOV_SDC1_CRCI,
802 .flags = IORESOURCE_DMA,
803 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700804};
805
806static struct resource resources_sdc2[] = {
807 {
808 .start = MSM_SDC2_BASE,
809 .end = MSM_SDC2_BASE + SZ_4K - 1,
810 .flags = IORESOURCE_MEM,
811 },
812 {
813 .start = INT_SDC2_0,
814 .end = INT_SDC2_1,
815 .flags = IORESOURCE_IRQ,
816 },
817 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700818 .name = "sdcc_dma_chnl",
819 .start = DMOV_SDC2_CHAN,
820 .end = DMOV_SDC2_CHAN,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700821 .flags = IORESOURCE_DMA,
822 },
Krishna Konda25786ec2011-07-25 16:21:36 -0700823 {
824 .name = "sdcc_dma_crci",
825 .start = DMOV_SDC2_CRCI,
826 .end = DMOV_SDC2_CRCI,
827 .flags = IORESOURCE_DMA,
828 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700829};
830
831static struct resource resources_sdc3[] = {
832 {
833 .start = MSM_SDC3_BASE,
834 .end = MSM_SDC3_BASE + SZ_4K - 1,
835 .flags = IORESOURCE_MEM,
836 },
837 {
838 .start = INT_SDC3_0,
839 .end = INT_SDC3_1,
840 .flags = IORESOURCE_IRQ,
841 },
842 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700843 .name = "sdcc_dma_chnl",
Pankaj Kumare657b9f2011-10-12 20:11:12 +0530844 .start = DMOV_SDC3_CHAN,
845 .end = DMOV_SDC3_CHAN,
Krishna Konda25786ec2011-07-25 16:21:36 -0700846 .flags = IORESOURCE_DMA,
847 },
848 {
849 .name = "sdcc_dma_crci",
Pankaj Kumare657b9f2011-10-12 20:11:12 +0530850 .start = DMOV_SDC3_CRCI,
851 .end = DMOV_SDC3_CRCI,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700852 .flags = IORESOURCE_DMA,
853 },
854};
855
856static struct resource resources_sdc4[] = {
857 {
858 .start = MSM_SDC4_BASE,
859 .end = MSM_SDC4_BASE + SZ_4K - 1,
860 .flags = IORESOURCE_MEM,
861 },
862 {
863 .start = INT_SDC4_0,
864 .end = INT_SDC4_1,
865 .flags = IORESOURCE_IRQ,
866 },
867 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700868 .name = "sdcc_dma_chnl",
Pankaj Kumare657b9f2011-10-12 20:11:12 +0530869 .start = DMOV_SDC4_CHAN,
870 .end = DMOV_SDC4_CHAN,
Krishna Konda25786ec2011-07-25 16:21:36 -0700871 .flags = IORESOURCE_DMA,
872 },
873 {
874 .name = "sdcc_dma_crci",
Pankaj Kumare657b9f2011-10-12 20:11:12 +0530875 .start = DMOV_SDC4_CRCI,
876 .end = DMOV_SDC4_CRCI,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700877 .flags = IORESOURCE_DMA,
878 },
879};
880
881struct platform_device msm_device_sdc1 = {
882 .name = "msm_sdcc",
883 .id = 1,
884 .num_resources = ARRAY_SIZE(resources_sdc1),
885 .resource = resources_sdc1,
886 .dev = {
887 .coherent_dma_mask = 0xffffffff,
888 },
889};
890
891struct platform_device msm_device_sdc2 = {
892 .name = "msm_sdcc",
893 .id = 2,
894 .num_resources = ARRAY_SIZE(resources_sdc2),
895 .resource = resources_sdc2,
896 .dev = {
897 .coherent_dma_mask = 0xffffffff,
898 },
899};
900
901struct platform_device msm_device_sdc3 = {
902 .name = "msm_sdcc",
903 .id = 3,
904 .num_resources = ARRAY_SIZE(resources_sdc3),
905 .resource = resources_sdc3,
906 .dev = {
907 .coherent_dma_mask = 0xffffffff,
908 },
909};
910
911struct platform_device msm_device_sdc4 = {
912 .name = "msm_sdcc",
913 .id = 4,
914 .num_resources = ARRAY_SIZE(resources_sdc4),
915 .resource = resources_sdc4,
916 .dev = {
917 .coherent_dma_mask = 0xffffffff,
918 },
919};
920
921static struct platform_device *msm_sdcc_devices[] __initdata = {
922 &msm_device_sdc1,
923 &msm_device_sdc2,
924 &msm_device_sdc3,
925 &msm_device_sdc4,
926};
927
928int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
929{
930 struct platform_device *pdev;
931
932 if (controller < 1 || controller > 4)
933 return -EINVAL;
934
935 pdev = msm_sdcc_devices[controller-1];
936 pdev->dev.platform_data = plat;
937 return platform_device_register(pdev);
938}
939
940static struct resource msm_vidc_720p_resources[] = {
941 {
942 .start = 0xA3B00000,
943 .end = 0xA3B00000 + SZ_4K - 1,
944 .flags = IORESOURCE_MEM,
945 },
946 {
947 .start = INT_MFC720,
948 .end = INT_MFC720,
949 .flags = IORESOURCE_IRQ,
950 },
951};
952
953struct msm_vidc_platform_data vidc_platform_data = {
Deepak Koturcb4f6722011-10-31 14:06:57 -0700954 .memtype = MEMTYPE_EBI0,
Deepika Pepakayalabebc7622011-12-01 15:13:43 -0800955 .enable_ion = 0,
Mohan Kumar Gubbihalli Lachma Naiked9dc912012-03-01 19:11:14 -0800956 .disable_dmx = 0,
957 .cont_mode_dpb_count = 8
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700958};
959
960struct platform_device msm_device_vidc_720p = {
961 .name = "msm_vidc",
962 .id = 0,
963 .num_resources = ARRAY_SIZE(msm_vidc_720p_resources),
964 .resource = msm_vidc_720p_resources,
965 .dev = {
966 .platform_data = &vidc_platform_data,
967 },
968};
969
970#if defined(CONFIG_FB_MSM_MDP40)
971#define MDP_BASE 0xA3F00000
972#define PMDH_BASE 0xAD600000
973#define EMDH_BASE 0xAD700000
974#define TVENC_BASE 0xAD400000
975#else
976#define MDP_BASE 0xAA200000
977#define PMDH_BASE 0xAA600000
978#define EMDH_BASE 0xAA700000
979#define TVENC_BASE 0xAA400000
980#endif
981
982static struct resource msm_mdp_resources[] = {
983 {
984 .name = "mdp",
985 .start = MDP_BASE,
986 .end = MDP_BASE + 0x000F0000 - 1,
987 .flags = IORESOURCE_MEM,
988 },
989 {
990 .start = INT_MDP,
991 .end = INT_MDP,
992 .flags = IORESOURCE_IRQ,
993 },
994};
995
996static struct resource msm_mddi_resources[] = {
997 {
998 .name = "pmdh",
999 .start = PMDH_BASE,
1000 .end = PMDH_BASE + PAGE_SIZE - 1,
1001 .flags = IORESOURCE_MEM,
1002 }
1003};
1004
1005static struct resource msm_mddi_ext_resources[] = {
1006 {
1007 .name = "emdh",
1008 .start = EMDH_BASE,
1009 .end = EMDH_BASE + PAGE_SIZE - 1,
1010 .flags = IORESOURCE_MEM,
1011 }
1012};
1013
1014static struct resource msm_ebi2_lcd_resources[] = {
1015 {
1016 .name = "base",
1017 .start = 0xa0d00000,
1018 .end = 0xa0d00000 + PAGE_SIZE - 1,
1019 .flags = IORESOURCE_MEM,
1020 },
1021 {
1022 .name = "lcd01",
1023 .start = 0x98000000,
1024 .end = 0x98000000 + 0x80000 - 1,
1025 .flags = IORESOURCE_MEM,
1026 },
1027 {
1028 .name = "lcd02",
1029 .start = 0x9c000000,
1030 .end = 0x9c000000 + 0x80000 - 1,
1031 .flags = IORESOURCE_MEM,
1032 },
1033};
1034
1035static struct resource msm_tvenc_resources[] = {
1036 {
1037 .name = "tvenc",
1038 .start = TVENC_BASE,
1039 .end = TVENC_BASE + PAGE_SIZE - 1,
1040 .flags = IORESOURCE_MEM,
1041 }
1042};
1043
1044#ifdef CONFIG_FB_MSM_TVOUT
1045static struct resource tvout_device_resources[] = {
1046 {
1047 .name = "tvout_device_irq",
1048 .start = INT_TV_ENC,
1049 .end = INT_TV_ENC,
1050 .flags = IORESOURCE_IRQ,
1051 },
1052};
1053#endif
1054
1055static struct platform_device msm_mdp_device = {
1056 .name = "mdp",
1057 .id = 0,
1058 .num_resources = ARRAY_SIZE(msm_mdp_resources),
1059 .resource = msm_mdp_resources,
1060};
1061
1062static struct platform_device msm_mddi_device = {
1063 .name = "mddi",
1064 .id = 0,
1065 .num_resources = ARRAY_SIZE(msm_mddi_resources),
1066 .resource = msm_mddi_resources,
1067};
1068
1069static struct platform_device msm_mddi_ext_device = {
1070 .name = "mddi_ext",
1071 .id = 0,
1072 .num_resources = ARRAY_SIZE(msm_mddi_ext_resources),
1073 .resource = msm_mddi_ext_resources,
1074};
1075
1076static struct platform_device msm_ebi2_lcd_device = {
1077 .name = "ebi2_lcd",
1078 .id = 0,
1079 .num_resources = ARRAY_SIZE(msm_ebi2_lcd_resources),
1080 .resource = msm_ebi2_lcd_resources,
1081};
1082
1083static struct platform_device msm_lcdc_device = {
1084 .name = "lcdc",
1085 .id = 0,
1086};
1087
1088static struct platform_device msm_dtv_device = {
1089 .name = "dtv",
1090 .id = 0,
1091};
1092
1093static struct platform_device msm_tvenc_device = {
1094 .name = "tvenc",
1095 .id = 0,
1096 .num_resources = ARRAY_SIZE(msm_tvenc_resources),
1097 .resource = msm_tvenc_resources,
1098};
1099
1100#ifdef CONFIG_FB_MSM_TVOUT
1101static struct platform_device tvout_msm_device = {
1102 .name = "tvout_device",
1103 .id = 0,
1104 .num_resources = ARRAY_SIZE(tvout_device_resources),
1105 .resource = tvout_device_resources,
1106};
1107#endif
1108
1109/* TSIF begin */
1110#if defined(CONFIG_TSIF) || defined(CONFIG_TSIF_MODULE)
1111
1112#define MSM_TSIF_PHYS (0xa3400000)
1113#define MSM_TSIF_SIZE (0x200)
1114
1115static struct resource tsif_resources[] = {
1116 [0] = {
1117 .flags = IORESOURCE_IRQ,
1118 .start = INT_TSIF,
1119 .end = INT_TSIF,
1120 },
1121 [1] = {
1122 .flags = IORESOURCE_MEM,
1123 .start = MSM_TSIF_PHYS,
1124 .end = MSM_TSIF_PHYS + MSM_TSIF_SIZE - 1,
1125 },
1126 [2] = {
1127 .flags = IORESOURCE_DMA,
1128 .start = DMOV_TSIF_CHAN,
1129 .end = DMOV_TSIF_CRCI,
1130 },
1131};
1132
1133static void tsif_release(struct device *dev)
1134{
1135 dev_info(dev, "release\n");
1136}
1137
1138struct platform_device msm_device_tsif = {
1139 .name = "msm_tsif",
1140 .id = 0,
1141 .num_resources = ARRAY_SIZE(tsif_resources),
1142 .resource = tsif_resources,
1143 .dev = {
1144 .release = tsif_release,
1145 },
1146};
1147#endif /* defined(CONFIG_TSIF) || defined(CONFIG_TSIF_MODULE) */
1148/* TSIF end */
1149
1150
1151
1152#ifdef CONFIG_MSM_ROTATOR
1153static struct resource resources_msm_rotator[] = {
1154 {
1155 .start = 0xA3E00000,
1156 .end = 0xA3F00000 - 1,
1157 .flags = IORESOURCE_MEM,
1158 },
1159 {
1160 .start = INT_ROTATOR,
1161 .end = INT_ROTATOR,
1162 .flags = IORESOURCE_IRQ,
1163 },
1164};
1165
1166static struct msm_rot_clocks rotator_clocks[] = {
1167 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07001168 .clk_name = "core_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001169 .clk_type = ROTATOR_CORE_CLK,
1170 .clk_rate = 0,
1171 },
1172 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07001173 .clk_name = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001174 .clk_type = ROTATOR_PCLK,
1175 .clk_rate = 0,
1176 },
1177 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07001178 .clk_name = "mem_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001179 .clk_type = ROTATOR_IMEM_CLK,
1180 .clk_rate = 0,
1181 },
1182};
1183
1184static struct msm_rotator_platform_data rotator_pdata = {
1185 .number_of_clocks = ARRAY_SIZE(rotator_clocks),
1186 .hardware_version_number = 0x1000303,
1187 .rotator_clks = rotator_clocks,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001188};
1189
1190struct platform_device msm_rotator_device = {
1191 .name = "msm_rotator",
1192 .id = 0,
1193 .num_resources = ARRAY_SIZE(resources_msm_rotator),
1194 .resource = resources_msm_rotator,
1195 .dev = {
1196 .platform_data = &rotator_pdata,
1197 },
1198};
1199#endif
1200
1201static void __init msm_register_device(struct platform_device *pdev, void *data)
1202{
1203 int ret;
1204
1205 pdev->dev.platform_data = data;
1206
1207 ret = platform_device_register(pdev);
1208 if (ret)
1209 dev_err(&pdev->dev,
1210 "%s: platform_device_register() failed = %d\n",
1211 __func__, ret);
1212}
1213
1214void __init msm_fb_register_device(char *name, void *data)
1215{
1216 if (!strncmp(name, "mdp", 3))
1217 msm_register_device(&msm_mdp_device, data);
1218 else if (!strncmp(name, "pmdh", 4))
1219 msm_register_device(&msm_mddi_device, data);
1220 else if (!strncmp(name, "emdh", 4))
1221 msm_register_device(&msm_mddi_ext_device, data);
1222 else if (!strncmp(name, "ebi2", 4))
1223 msm_register_device(&msm_ebi2_lcd_device, data);
1224 else if (!strncmp(name, "tvenc", 5))
1225 msm_register_device(&msm_tvenc_device, data);
1226 else if (!strncmp(name, "lcdc", 4))
1227 msm_register_device(&msm_lcdc_device, data);
1228 else if (!strncmp(name, "dtv", 3))
1229 msm_register_device(&msm_dtv_device, data);
1230#ifdef CONFIG_FB_MSM_TVOUT
1231 else if (!strncmp(name, "tvout_device", 12))
1232 msm_register_device(&tvout_msm_device, data);
1233#endif
1234 else
1235 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
1236}
1237
1238static struct platform_device msm_camera_device = {
1239 .name = "msm_camera",
1240 .id = 0,
1241};
1242
1243void __init msm_camera_register_device(void *res, uint32_t num,
1244 void *data)
1245{
1246 msm_camera_device.num_resources = num;
1247 msm_camera_device.resource = res;
1248
1249 msm_register_device(&msm_camera_device, data);
1250}
1251
1252struct resource kgsl_3d0_resources[] = {
1253 {
1254 .name = KGSL_3D0_REG_MEMORY,
1255 .start = 0xA3500000, /* 3D GRP address */
1256 .end = 0xA351ffff,
1257 .flags = IORESOURCE_MEM,
1258 },
1259 {
1260 .name = KGSL_3D0_IRQ,
1261 .start = INT_GRP_3D,
1262 .end = INT_GRP_3D,
1263 .flags = IORESOURCE_IRQ,
1264 },
1265};
1266
1267static struct kgsl_device_platform_data kgsl_3d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06001268 .pwrlevel = {
1269 {
1270 .gpu_freq = 245760000,
1271 .bus_freq = 192000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001272 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06001273 {
1274 .gpu_freq = 192000000,
1275 .bus_freq = 152000000,
1276 },
1277 {
1278 .gpu_freq = 192000000,
1279 .bus_freq = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001280 },
1281 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06001282 .init_level = 0,
1283 .num_levels = 3,
1284 .set_grp_async = set_grp3d_async,
1285 .idle_timeout = HZ/20,
1286 .nap_allowed = true,
Kedar Joshic11d0982012-02-07 10:59:49 +05301287 .idle_needed = true,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06001288 .clk_map = KGSL_CLK_SRC | KGSL_CLK_CORE |
1289 KGSL_CLK_IFACE | KGSL_CLK_MEM,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001290};
1291
1292struct platform_device msm_kgsl_3d0 = {
1293 .name = "kgsl-3d0",
1294 .id = 0,
1295 .num_resources = ARRAY_SIZE(kgsl_3d0_resources),
1296 .resource = kgsl_3d0_resources,
1297 .dev = {
1298 .platform_data = &kgsl_3d0_pdata,
1299 },
1300};
1301
1302static struct resource kgsl_2d0_resources[] = {
1303 {
1304 .name = KGSL_2D0_REG_MEMORY,
1305 .start = 0xA3900000, /* Z180 base address */
1306 .end = 0xA3900FFF,
1307 .flags = IORESOURCE_MEM,
1308 },
1309 {
1310 .name = KGSL_2D0_IRQ,
1311 .start = INT_GRP_2D,
1312 .end = INT_GRP_2D,
1313 .flags = IORESOURCE_IRQ,
1314 },
1315};
1316
1317static struct kgsl_device_platform_data kgsl_2d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06001318 .pwrlevel = {
1319 {
1320 .gpu_freq = 0,
1321 .bus_freq = 192000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001322 },
1323 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06001324 .init_level = 0,
1325 .num_levels = 1,
1326 /* HW workaround, run Z180 SYNC @ 192 MHZ */
1327 .set_grp_async = NULL,
1328 .idle_timeout = HZ/10,
1329 .nap_allowed = true,
Kedar Joshic11d0982012-02-07 10:59:49 +05301330 .idle_needed = true,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06001331 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001332};
1333
1334struct platform_device msm_kgsl_2d0 = {
1335 .name = "kgsl-2d0",
1336 .id = 0,
1337 .num_resources = ARRAY_SIZE(kgsl_2d0_resources),
1338 .resource = kgsl_2d0_resources,
1339 .dev = {
1340 .platform_data = &kgsl_2d0_pdata,
1341 },
1342};
1343
1344struct platform_device *msm_footswitch_devices[] = {
Matt Wagantalld6fbf232012-05-03 20:09:28 -07001345 FS_PCOM(FS_GFX2D0, "vdd", "kgsl-2d0.0"),
1346 FS_PCOM(FS_GFX3D, "vdd", "kgsl-3d0.0"),
Matt Wagantalld4aab1e2012-05-03 20:26:56 -07001347 FS_PCOM(FS_MDP, "vdd", "mdp.0"),
Matt Wagantall5c922112012-05-03 19:25:28 -07001348 FS_PCOM(FS_MFC, "fs_mfc", NULL),
Matt Wagantall316f2fc2012-05-03 20:41:42 -07001349 FS_PCOM(FS_ROT, "vdd", "msm_rotator.0"),
Matt Wagantall5c922112012-05-03 19:25:28 -07001350 FS_PCOM(FS_VFE, "fs_vfe", NULL),
1351 FS_PCOM(FS_VPE, "fs_vpe", NULL),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001352};
1353unsigned msm_num_footswitch_devices = ARRAY_SIZE(msm_footswitch_devices);
Taniya Das2e948192011-12-20 11:15:13 +05301354
1355static struct resource gpio_resources[] = {
1356 {
1357 .start = INT_GPIO_GROUP1,
1358 .flags = IORESOURCE_IRQ,
1359 },
1360 {
1361 .start = INT_GPIO_GROUP2,
1362 .flags = IORESOURCE_IRQ,
1363 },
1364};
1365
1366static struct platform_device msm_device_gpio = {
1367 .name = "msmgpio",
1368 .id = -1,
1369 .resource = gpio_resources,
1370 .num_resources = ARRAY_SIZE(gpio_resources),
1371};
1372
1373static int __init msm7630_init_gpio(void)
1374{
1375 platform_device_register(&msm_device_gpio);
1376 return 0;
1377}
1378
1379postcore_initcall(msm7630_init_gpio);