2 * linux/arch/arm/mach-omap2/devices.c
4 * OMAP2 platform device setup/initialization
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
12 #include <linux/module.h>
13 #include <linux/kernel.h>
14 #include <linux/init.h>
15 #include <linux/platform_device.h>
17 #include <asm/hardware.h>
19 #include <asm/mach-types.h>
20 #include <asm/mach/map.h>
22 #include <asm/arch/tc.h>
23 #include <asm/arch/board.h>
24 #include <asm/arch/mux.h>
25 #include <asm/arch/gpio.h>
26 #include <asm/arch/eac.h>
28 #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
30 static struct resource cam_resources[] = {
32 .start = OMAP24XX_CAMERA_BASE,
33 .end = OMAP24XX_CAMERA_BASE + 0xfff,
34 .flags = IORESOURCE_MEM,
37 .start = INT_24XX_CAM_IRQ,
38 .flags = IORESOURCE_IRQ,
42 static struct platform_device omap_cam_device = {
43 .name = "omap24xxcam",
45 .num_resources = ARRAY_SIZE(cam_resources),
46 .resource = cam_resources,
49 static inline void omap_init_camera(void)
51 platform_device_register(&omap_cam_device);
54 static inline void omap_init_camera(void)
59 #if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE)
60 #define OMAP2_MBOX_BASE IO_ADDRESS(OMAP24XX_MAILBOX_BASE)
62 static struct resource mbox_resources[] = {
64 .start = OMAP2_MBOX_BASE,
65 .end = OMAP2_MBOX_BASE + 0x11f,
66 .flags = IORESOURCE_MEM,
69 .start = INT_24XX_MAIL_U0_MPU,
70 .flags = IORESOURCE_IRQ,
73 .start = INT_24XX_MAIL_U3_MPU,
74 .flags = IORESOURCE_IRQ,
78 static struct platform_device mbox_device = {
81 .num_resources = ARRAY_SIZE(mbox_resources),
82 .resource = mbox_resources,
85 static inline void omap_init_mbox(void)
87 platform_device_register(&mbox_device);
90 static inline void omap_init_mbox(void) { }
93 #if defined(CONFIG_OMAP_STI)
95 #define OMAP2_STI_BASE IO_ADDRESS(0x48068000)
96 #define OMAP2_STI_CHANNEL_BASE 0x54000000
97 #define OMAP2_STI_IRQ 4
99 static struct resource sti_resources[] = {
101 .start = OMAP2_STI_BASE,
102 .end = OMAP2_STI_BASE + 0x7ff,
103 .flags = IORESOURCE_MEM,
106 .start = OMAP2_STI_CHANNEL_BASE,
107 .end = OMAP2_STI_CHANNEL_BASE + SZ_64K - 1,
108 .flags = IORESOURCE_MEM,
111 .start = OMAP2_STI_IRQ,
112 .flags = IORESOURCE_IRQ,
116 static struct platform_device sti_device = {
119 .num_resources = ARRAY_SIZE(sti_resources),
120 .resource = sti_resources,
123 static inline void omap_init_sti(void)
125 platform_device_register(&sti_device);
128 static inline void omap_init_sti(void) {}
131 #if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE)
133 #include <asm/arch/mcspi.h>
135 #define OMAP2_MCSPI1_BASE 0x48098000
136 #define OMAP2_MCSPI2_BASE 0x4809a000
138 static struct omap2_mcspi_platform_config omap2_mcspi1_config = {
142 static struct resource omap2_mcspi1_resources[] = {
144 .start = OMAP2_MCSPI1_BASE,
145 .end = OMAP2_MCSPI1_BASE + 0xff,
146 .flags = IORESOURCE_MEM,
150 struct platform_device omap2_mcspi1 = {
151 .name = "omap2_mcspi",
153 .num_resources = ARRAY_SIZE(omap2_mcspi1_resources),
154 .resource = omap2_mcspi1_resources,
156 .platform_data = &omap2_mcspi1_config,
160 static struct omap2_mcspi_platform_config omap2_mcspi2_config = {
164 static struct resource omap2_mcspi2_resources[] = {
166 .start = OMAP2_MCSPI2_BASE,
167 .end = OMAP2_MCSPI2_BASE + 0xff,
168 .flags = IORESOURCE_MEM,
172 struct platform_device omap2_mcspi2 = {
173 .name = "omap2_mcspi",
175 .num_resources = ARRAY_SIZE(omap2_mcspi2_resources),
176 .resource = omap2_mcspi2_resources,
178 .platform_data = &omap2_mcspi2_config,
182 static void omap_init_mcspi(void)
184 platform_device_register(&omap2_mcspi1);
185 platform_device_register(&omap2_mcspi2);
189 static inline void omap_init_mcspi(void) {}
192 #ifdef CONFIG_SND_OMAP24XX_EAC
194 #define OMAP2_EAC_BASE 0x48090000
196 static struct resource omap2_eac_resources[] = {
198 .start = OMAP2_EAC_BASE,
199 .end = OMAP2_EAC_BASE + 0x109,
200 .flags = IORESOURCE_MEM,
204 static struct platform_device omap2_eac_device = {
205 .name = "omap24xx-eac",
207 .num_resources = ARRAY_SIZE(omap2_eac_resources),
208 .resource = omap2_eac_resources,
210 .platform_data = NULL,
214 void omap_init_eac(struct eac_platform_data *pdata)
216 omap2_eac_device.dev.platform_data = pdata;
217 platform_device_register(&omap2_eac_device);
221 void omap_init_eac(struct eac_platform_data *pdata) {}
224 /*-------------------------------------------------------------------------*/
226 static int __init omap2_init_devices(void)
228 /* please keep these calls, and their implementations above,
229 * in alphabetical order so they're easier to sort through.
238 arch_initcall(omap2_init_devices);