diff options
author | Vaibhav Hiremath <hvaibhav@ti.com> | 2010-02-13 06:47:56 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-02-19 18:22:17 -0500 |
commit | f2afbbb82e263086d02a772e43f5290b1a6f673e (patch) | |
tree | b8980a6bd42f1d9d0eaf0631d3f7ffef7c979cb4 | |
parent | 1f738dc306c86a8293c7ea929d07f55f32d52ff6 (diff) |
AM3517: Enable RTC driver support for AM3517EVM
Add platform hook-up interface to support RTC driver (S35390A).
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r-- | arch/arm/mach-omap2/board-am3517evm.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index af99faf2cced..fe2446ded5ad 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c | |||
@@ -38,6 +38,39 @@ | |||
38 | #define LCD_PANEL_BKLIGHT_PWR 182 | 38 | #define LCD_PANEL_BKLIGHT_PWR 182 |
39 | #define LCD_PANEL_PWM 181 | 39 | #define LCD_PANEL_PWM 181 |
40 | 40 | ||
41 | static struct i2c_board_info __initdata am3517evm_i2c_boardinfo[] = { | ||
42 | { | ||
43 | I2C_BOARD_INFO("s35390a", 0x30), | ||
44 | .type = "s35390a", | ||
45 | }, | ||
46 | }; | ||
47 | |||
48 | /* | ||
49 | * RTC - S35390A | ||
50 | */ | ||
51 | #define GPIO_RTCS35390A_IRQ 55 | ||
52 | |||
53 | static void __init am3517_evm_rtc_init(void) | ||
54 | { | ||
55 | int r; | ||
56 | |||
57 | omap_mux_init_gpio(GPIO_RTCS35390A_IRQ, OMAP_PIN_INPUT_PULLUP); | ||
58 | r = gpio_request(GPIO_RTCS35390A_IRQ, "rtcs35390a-irq"); | ||
59 | if (r < 0) { | ||
60 | printk(KERN_WARNING "failed to request GPIO#%d\n", | ||
61 | GPIO_RTCS35390A_IRQ); | ||
62 | return; | ||
63 | } | ||
64 | r = gpio_direction_input(GPIO_RTCS35390A_IRQ); | ||
65 | if (r < 0) { | ||
66 | printk(KERN_WARNING "GPIO#%d cannot be configured as input\n", | ||
67 | GPIO_RTCS35390A_IRQ); | ||
68 | gpio_free(GPIO_RTCS35390A_IRQ); | ||
69 | return; | ||
70 | } | ||
71 | am3517evm_i2c_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ); | ||
72 | } | ||
73 | |||
41 | static int __init am3517_evm_i2c_init(void) | 74 | static int __init am3517_evm_i2c_init(void) |
42 | { | 75 | { |
43 | omap_register_i2c_bus(1, 400, NULL, 0); | 76 | omap_register_i2c_bus(1, 400, NULL, 0); |
@@ -235,6 +268,12 @@ static void __init am3517_evm_init(void) | |||
235 | usb_ehci_init(&ehci_pdata); | 268 | usb_ehci_init(&ehci_pdata); |
236 | /* DSS */ | 269 | /* DSS */ |
237 | am3517_evm_display_init(); | 270 | am3517_evm_display_init(); |
271 | |||
272 | /* RTC - S35390A */ | ||
273 | am3517_evm_rtc_init(); | ||
274 | |||
275 | i2c_register_board_info(1, am3517evm_i2c_boardinfo, | ||
276 | ARRAY_SIZE(am3517evm_i2c_boardinfo)); | ||
238 | } | 277 | } |
239 | 278 | ||
240 | static void __init am3517_evm_map_io(void) | 279 | static void __init am3517_evm_map_io(void) |