2 * linux/arch/arm/mach-omap1/devices.c
4 * OMAP1 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/config.h>
13 #include <linux/module.h>
14 #include <linux/kernel.h>
15 #include <linux/init.h>
16 #include <linux/platform_device.h>
18 #include <asm/hardware.h>
20 #include <asm/mach-types.h>
21 #include <asm/mach/map.h>
23 #include <asm/arch/tc.h>
24 #include <asm/arch/board.h>
25 #include <asm/arch/mux.h>
26 #include <asm/arch/gpio.h>
28 extern void omap_nop_release(struct device *dev);
30 /*-------------------------------------------------------------------------*/
32 #if defined(CONFIG_OMAP1610_IR) || defined(CONFIG_OMAP161O_IR_MODULE)
34 static u64 irda_dmamask = 0xffffffff;
36 static struct platform_device omap1610ir_device = {
37 .name = "omap1610-ir",
40 .release = omap_nop_release,
41 .dma_mask = &irda_dmamask,
45 static void omap_init_irda(void)
47 /* FIXME define and use a boot tag, members something like:
48 * u8 uart; // uart1, or uart3
49 * ... but driver only handles uart3 for now
50 * s16 fir_sel; // gpio for SIR vs FIR
51 * ... may prefer a callback for SIR/MIR/FIR mode select;
52 * while h2 uses a GPIO, H3 uses a gpio expander
54 if (machine_is_omap_h2()
55 || machine_is_omap_h3())
56 (void) platform_device_register(&omap1610ir_device);
59 static inline void omap_init_irda(void) {}
62 /*-------------------------------------------------------------------------*/
64 #if defined(CONFIG_OMAP_RTC) || defined(CONFIG_OMAP_RTC)
66 #define OMAP_RTC_BASE 0xfffb4800
68 static struct resource rtc_resources[] = {
70 .start = OMAP_RTC_BASE,
71 .end = OMAP_RTC_BASE + 0x5f,
72 .flags = IORESOURCE_MEM,
75 .start = INT_RTC_TIMER,
76 .flags = IORESOURCE_IRQ,
79 .start = INT_RTC_ALARM,
80 .flags = IORESOURCE_IRQ,
84 static struct platform_device omap_rtc_device = {
88 .release = omap_nop_release,
90 .num_resources = ARRAY_SIZE(rtc_resources),
91 .resource = rtc_resources,
94 static void omap_init_rtc(void)
96 (void) platform_device_register(&omap_rtc_device);
99 static inline void omap_init_rtc(void) {}
103 /*-------------------------------------------------------------------------*/
106 * This gets called after board-specific INIT_MACHINE, and initializes most
107 * on-chip peripherals accessible on this board (except for few like USB):
109 * (a) Does any "standard config" pin muxing needed. Board-specific
110 * code will have muxed GPIO pins and done "nonstandard" setup;
111 * that code could live in the boot loader.
112 * (b) Populating board-specific platform_data with the data drivers
113 * rely on to handle wiring variations.
114 * (c) Creating platform devices as meaningful on this board and
115 * with this kernel configuration.
117 * Claiming GPIOs, and setting their direction and initial values, is the
118 * responsibility of the device drivers. So is responding to probe().
120 * Board-specific knowlege like creating devices or pin setup is to be
121 * kept out of drivers as much as possible. In particular, pin setup
122 * may be handled by the boot loader, and drivers should expect it will
123 * normally have been done by the time they're probed.
125 static int __init omap1_init_devices(void)
127 /* please keep these calls, and their implementations above,
128 * in alphabetical order so they're easier to sort through.
135 arch_initcall(omap1_init_devices);