aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/devices.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/arm/mach-omap1/devices.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'arch/arm/mach-omap1/devices.c')
-rw-r--r--arch/arm/mach-omap1/devices.c101
1 files changed, 100 insertions, 1 deletions
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index aa0725608fb1..36f26c3fa25e 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -9,6 +9,7 @@
9 * (at your option) any later version. 9 * (at your option) any later version.
10 */ 10 */
11 11
12#include <linux/dma-mapping.h>
12#include <linux/module.h> 13#include <linux/module.h>
13#include <linux/kernel.h> 14#include <linux/kernel.h>
14#include <linux/init.h> 15#include <linux/init.h>
@@ -16,6 +17,7 @@
16#include <linux/io.h> 17#include <linux/io.h>
17#include <linux/spi/spi.h> 18#include <linux/spi/spi.h>
18 19
20#include <mach/camera.h>
19#include <mach/hardware.h> 21#include <mach/hardware.h>
20#include <asm/mach/map.h> 22#include <asm/mach/map.h>
21 23
@@ -25,6 +27,7 @@
25#include <mach/gpio.h> 27#include <mach/gpio.h>
26#include <plat/mmc.h> 28#include <plat/mmc.h>
27#include <plat/omap7xx.h> 29#include <plat/omap7xx.h>
30#include <plat/mcbsp.h>
28 31
29/*-------------------------------------------------------------------------*/ 32/*-------------------------------------------------------------------------*/
30 33
@@ -191,10 +194,76 @@ static inline void omap_init_spi100k(void)
191} 194}
192#endif 195#endif
193 196
197
198#define OMAP1_CAMERA_BASE 0xfffb6800
199#define OMAP1_CAMERA_IOSIZE 0x1c
200
201static struct resource omap1_camera_resources[] = {
202 [0] = {
203 .start = OMAP1_CAMERA_BASE,
204 .end = OMAP1_CAMERA_BASE + OMAP1_CAMERA_IOSIZE - 1,
205 .flags = IORESOURCE_MEM,
206 },
207 [1] = {
208 .start = INT_CAMERA,
209 .flags = IORESOURCE_IRQ,
210 },
211};
212
213static u64 omap1_camera_dma_mask = DMA_BIT_MASK(32);
214
215static struct platform_device omap1_camera_device = {
216 .name = "omap1-camera",
217 .id = 0, /* This is used to put cameras on this interface */
218 .dev = {
219 .dma_mask = &omap1_camera_dma_mask,
220 .coherent_dma_mask = DMA_BIT_MASK(32),
221 },
222 .num_resources = ARRAY_SIZE(omap1_camera_resources),
223 .resource = omap1_camera_resources,
224};
225
226void __init omap1_camera_init(void *info)
227{
228 struct platform_device *dev = &omap1_camera_device;
229 int ret;
230
231 dev->dev.platform_data = info;
232
233 ret = platform_device_register(dev);
234 if (ret)
235 dev_err(&dev->dev, "unable to register device: %d\n", ret);
236}
237
238
194/*-------------------------------------------------------------------------*/ 239/*-------------------------------------------------------------------------*/
195 240
196static inline void omap_init_sti(void) {} 241static inline void omap_init_sti(void) {}
197 242
243#if defined(CONFIG_SND_SOC) || defined(CONFIG_SND_SOC_MODULE)
244
245static struct platform_device omap_pcm = {
246 .name = "omap-pcm-audio",
247 .id = -1,
248};
249
250OMAP_MCBSP_PLATFORM_DEVICE(1);
251OMAP_MCBSP_PLATFORM_DEVICE(2);
252OMAP_MCBSP_PLATFORM_DEVICE(3);
253
254static void omap_init_audio(void)
255{
256 platform_device_register(&omap_mcbsp1);
257 platform_device_register(&omap_mcbsp2);
258 if (!cpu_is_omap7xx())
259 platform_device_register(&omap_mcbsp3);
260 platform_device_register(&omap_pcm);
261}
262
263#else
264static inline void omap_init_audio(void) {}
265#endif
266
198/*-------------------------------------------------------------------------*/ 267/*-------------------------------------------------------------------------*/
199 268
200/* 269/*
@@ -212,13 +281,16 @@ static inline void omap_init_sti(void) {}
212 * Claiming GPIOs, and setting their direction and initial values, is the 281 * Claiming GPIOs, and setting their direction and initial values, is the
213 * responsibility of the device drivers. So is responding to probe(). 282 * responsibility of the device drivers. So is responding to probe().
214 * 283 *
215 * Board-specific knowlege like creating devices or pin setup is to be 284 * Board-specific knowledge like creating devices or pin setup is to be
216 * kept out of drivers as much as possible. In particular, pin setup 285 * kept out of drivers as much as possible. In particular, pin setup
217 * may be handled by the boot loader, and drivers should expect it will 286 * may be handled by the boot loader, and drivers should expect it will
218 * normally have been done by the time they're probed. 287 * normally have been done by the time they're probed.
219 */ 288 */
220static int __init omap1_init_devices(void) 289static int __init omap1_init_devices(void)
221{ 290{
291 if (!cpu_class_is_omap1())
292 return -ENODEV;
293
222 /* please keep these calls, and their implementations above, 294 /* please keep these calls, and their implementations above,
223 * in alphabetical order so they're easier to sort through. 295 * in alphabetical order so they're easier to sort through.
224 */ 296 */
@@ -227,8 +299,35 @@ static int __init omap1_init_devices(void)
227 omap_init_rtc(); 299 omap_init_rtc();
228 omap_init_spi100k(); 300 omap_init_spi100k();
229 omap_init_sti(); 301 omap_init_sti();
302 omap_init_audio();
230 303
231 return 0; 304 return 0;
232} 305}
233arch_initcall(omap1_init_devices); 306arch_initcall(omap1_init_devices);
234 307
308#if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE)
309
310static struct resource wdt_resources[] = {
311 {
312 .start = 0xfffeb000,
313 .end = 0xfffeb07F,
314 .flags = IORESOURCE_MEM,
315 },
316};
317
318static struct platform_device omap_wdt_device = {
319 .name = "omap_wdt",
320 .id = -1,
321 .num_resources = ARRAY_SIZE(wdt_resources),
322 .resource = wdt_resources,
323};
324
325static int __init omap_init_wdt(void)
326{
327 if (!cpu_is_omap16xx())
328 return -ENODEV;
329
330 return platform_device_register(&omap_wdt_device);
331}
332subsys_initcall(omap_init_wdt);
333#endif