diff options
author | Igor Grinberg <grinberg@compulab.co.il> | 2010-09-21 12:03:10 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-09-27 18:14:51 -0400 |
commit | 46893a56aad011764003703b06303515ea670c57 (patch) | |
tree | ccb9999fc88b34d4e1bc5eb51628dcfe66ee91d7 /arch/arm | |
parent | d04b620e6e6e72a95b7b88ccb7b002cb8f6b8113 (diff) |
omap3: cm-t3517: add support for v3020 rtc
add support for v3020 rtc.
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/board-cm-t3517.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c index 507d2d510787..2b41c6de274d 100644 --- a/arch/arm/mach-omap2/board-cm-t3517.c +++ b/arch/arm/mach-omap2/board-cm-t3517.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/platform_device.h> | 27 | #include <linux/platform_device.h> |
28 | #include <linux/gpio.h> | 28 | #include <linux/gpio.h> |
29 | #include <linux/leds.h> | 29 | #include <linux/leds.h> |
30 | #include <linux/rtc-v3020.h> | ||
30 | 31 | ||
31 | #include <asm/mach-types.h> | 32 | #include <asm/mach-types.h> |
32 | #include <asm/mach/arch.h> | 33 | #include <asm/mach/arch.h> |
@@ -69,6 +70,35 @@ static void __init cm_t3517_init_leds(void) | |||
69 | static inline void cm_t3517_init_leds(void) {} | 70 | static inline void cm_t3517_init_leds(void) {} |
70 | #endif | 71 | #endif |
71 | 72 | ||
73 | #if defined(CONFIG_RTC_DRV_V3020) || defined(CONFIG_RTC_DRV_V3020_MODULE) | ||
74 | #define RTC_IO_GPIO (153) | ||
75 | #define RTC_WR_GPIO (154) | ||
76 | #define RTC_RD_GPIO (160) | ||
77 | #define RTC_CS_GPIO (163) | ||
78 | |||
79 | struct v3020_platform_data cm_t3517_v3020_pdata = { | ||
80 | .use_gpio = 1, | ||
81 | .gpio_cs = RTC_CS_GPIO, | ||
82 | .gpio_wr = RTC_WR_GPIO, | ||
83 | .gpio_rd = RTC_RD_GPIO, | ||
84 | .gpio_io = RTC_IO_GPIO, | ||
85 | }; | ||
86 | |||
87 | static struct platform_device cm_t3517_rtc_device = { | ||
88 | .name = "v3020", | ||
89 | .id = -1, | ||
90 | .dev = { | ||
91 | .platform_data = &cm_t3517_v3020_pdata, | ||
92 | } | ||
93 | }; | ||
94 | |||
95 | static void __init cm_t3517_init_rtc(void) | ||
96 | { | ||
97 | platform_device_register(&cm_t3517_rtc_device); | ||
98 | } | ||
99 | #else | ||
100 | static inline void cm_t3517_init_rtc(void) {} | ||
101 | #endif | ||
72 | 102 | ||
73 | static struct omap_board_config_kernel cm_t3517_config[] __initdata = { | 103 | static struct omap_board_config_kernel cm_t3517_config[] __initdata = { |
74 | }; | 104 | }; |
@@ -86,6 +116,11 @@ static void __init cm_t3517_init_irq(void) | |||
86 | static struct omap_board_mux board_mux[] __initdata = { | 116 | static struct omap_board_mux board_mux[] __initdata = { |
87 | /* GPIO186 - Green LED */ | 117 | /* GPIO186 - Green LED */ |
88 | OMAP3_MUX(SYS_CLKOUT2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), | 118 | OMAP3_MUX(SYS_CLKOUT2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), |
119 | /* RTC GPIOs: IO, WR#, RD#, CS# */ | ||
120 | OMAP3_MUX(MCBSP4_DR, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), | ||
121 | OMAP3_MUX(MCBSP4_DX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), | ||
122 | OMAP3_MUX(MCBSP_CLKS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), | ||
123 | OMAP3_MUX(UART3_CTS_RCTX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), | ||
89 | 124 | ||
90 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 125 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
91 | }; | 126 | }; |
@@ -95,6 +130,7 @@ static void __init cm_t3517_init(void) | |||
95 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 130 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
96 | omap_serial_init(); | 131 | omap_serial_init(); |
97 | cm_t3517_init_leds(); | 132 | cm_t3517_init_leds(); |
133 | cm_t3517_init_rtc(); | ||
98 | } | 134 | } |
99 | 135 | ||
100 | MACHINE_START(CM_T3517, "Compulab CM-T3517") | 136 | MACHINE_START(CM_T3517, "Compulab CM-T3517") |