Merge tag 'drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[sfrench/cifs-2.6.git] / arch / arm / mach-ux500 / devices-db8500.c
1 /*
2  * Copyright (C) ST-Ericsson SA 2010
3  *
4  * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
5  * License terms: GNU General Public License (GPL) version 2
6  */
7
8 #include <linux/kernel.h>
9 #include <linux/platform_device.h>
10 #include <linux/interrupt.h>
11 #include <linux/io.h>
12 #include <linux/gpio.h>
13 #include <linux/amba/bus.h>
14 #include <linux/amba/pl022.h>
15 #include <linux/platform_data/dma-ste-dma40.h>
16 #include <linux/mfd/dbx500-prcmu.h>
17
18 #include "setup.h"
19 #include "irqs.h"
20
21 #include "db8500-regs.h"
22 #include "devices-db8500.h"
23 #include "ste-dma40-db8500.h"
24
25 static struct resource dma40_resources[] = {
26         [0] = {
27                 .start = U8500_DMA_BASE,
28                 .end   = U8500_DMA_BASE + SZ_4K - 1,
29                 .flags = IORESOURCE_MEM,
30                 .name  = "base",
31         },
32         [1] = {
33                 .start = U8500_DMA_LCPA_BASE,
34                 .end   = U8500_DMA_LCPA_BASE + 2 * SZ_1K - 1,
35                 .flags = IORESOURCE_MEM,
36                 .name  = "lcpa",
37         },
38         [2] = {
39                 .start = IRQ_DB8500_DMA,
40                 .end   = IRQ_DB8500_DMA,
41                 .flags = IORESOURCE_IRQ,
42         }
43 };
44
45 struct stedma40_platform_data dma40_plat_data = {
46         .disabled_channels = {-1},
47 };
48
49 struct platform_device u8500_dma40_device = {
50         .dev = {
51                 .platform_data = &dma40_plat_data,
52         },
53         .name = "dma40",
54         .id = 0,
55         .num_resources = ARRAY_SIZE(dma40_resources),
56         .resource = dma40_resources
57 };
58
59 struct resource keypad_resources[] = {
60         [0] = {
61                 .start = U8500_SKE_BASE,
62                 .end = U8500_SKE_BASE + SZ_4K - 1,
63                 .flags = IORESOURCE_MEM,
64         },
65         [1] = {
66                 .start = IRQ_DB8500_KB,
67                 .end = IRQ_DB8500_KB,
68                 .flags = IORESOURCE_IRQ,
69         },
70 };
71
72 struct platform_device u8500_ske_keypad_device = {
73         .name = "nmk-ske-keypad",
74         .id = -1,
75         .num_resources = ARRAY_SIZE(keypad_resources),
76         .resource = keypad_resources,
77 };
78
79 struct prcmu_pdata db8500_prcmu_pdata = {
80         .ab_platdata    = &ab8500_platdata,
81         .ab_irq         = IRQ_DB8500_AB8500,
82         .irq_base       = IRQ_PRCMU_BASE,
83         .version_offset = DB8500_PRCMU_FW_VERSION_OFFSET,
84         .legacy_offset  = DB8500_PRCMU_LEGACY_OFFSET,
85 };
86
87 static struct resource db8500_prcmu_res[] = {
88         {
89                 .name  = "prcmu",
90                 .start = U8500_PRCMU_BASE,
91                 .end   = U8500_PRCMU_BASE + SZ_8K - 1,
92                 .flags = IORESOURCE_MEM,
93         },
94         {
95                 .name  = "prcmu-tcdm",
96                 .start = U8500_PRCMU_TCDM_BASE,
97                 .end   = U8500_PRCMU_TCDM_BASE + SZ_4K - 1,
98                 .flags = IORESOURCE_MEM,
99         },
100         {
101                 .name  = "irq",
102                 .start = IRQ_DB8500_PRCMU1,
103                 .end   = IRQ_DB8500_PRCMU1,
104                 .flags = IORESOURCE_IRQ,
105         },
106         {
107                 .name  = "prcmu-tcpm",
108                 .start = U8500_PRCMU_TCPM_BASE,
109                 .end   = U8500_PRCMU_TCPM_BASE + SZ_32K - 1,
110                 .flags = IORESOURCE_MEM,
111         },
112 };
113
114 struct platform_device db8500_prcmu_device = {
115         .name                   = "db8500-prcmu",
116         .resource               = db8500_prcmu_res,
117         .num_resources          = ARRAY_SIZE(db8500_prcmu_res),
118         .dev = {
119                 .platform_data = &db8500_prcmu_pdata,
120         },
121 };