diff options
Diffstat (limited to 'arch/sh/boards/dreamcast/rtc.c')
-rw-r--r-- | arch/sh/boards/dreamcast/rtc.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/arch/sh/boards/dreamcast/rtc.c b/arch/sh/boards/dreamcast/rtc.c index 379de1629134..b3a876a3b859 100644 --- a/arch/sh/boards/dreamcast/rtc.c +++ b/arch/sh/boards/dreamcast/rtc.c | |||
@@ -1,4 +1,5 @@ | |||
1 | /* arch/sh/kernel/rtc-aica.c | 1 | /* |
2 | * arch/sh/boards/dreamcast/rtc.c | ||
2 | * | 3 | * |
3 | * Dreamcast AICA RTC routines. | 4 | * Dreamcast AICA RTC routines. |
4 | * | 5 | * |
@@ -10,15 +11,12 @@ | |||
10 | */ | 11 | */ |
11 | 12 | ||
12 | #include <linux/time.h> | 13 | #include <linux/time.h> |
13 | 14 | #include <asm/rtc.h> | |
14 | #include <asm/io.h> | 15 | #include <asm/io.h> |
15 | 16 | ||
16 | extern void (*rtc_get_time)(struct timespec *); | ||
17 | extern int (*rtc_set_time)(const time_t); | ||
18 | |||
19 | /* The AICA RTC has an Epoch of 1/1/1950, so we must subtract 20 years (in | 17 | /* The AICA RTC has an Epoch of 1/1/1950, so we must subtract 20 years (in |
20 | seconds to get the standard Unix Epoch when getting the time, and add 20 | 18 | seconds) to get the standard Unix Epoch when getting the time, and add |
21 | years when setting the time. */ | 19 | 20 years when setting the time. */ |
22 | #define TWENTY_YEARS ((20 * 365LU + 5) * 86400) | 20 | #define TWENTY_YEARS ((20 * 365LU + 5) * 86400) |
23 | 21 | ||
24 | /* The AICA RTC is represented by a 32-bit seconds counter stored in 2 16-bit | 22 | /* The AICA RTC is represented by a 32-bit seconds counter stored in 2 16-bit |
@@ -32,7 +30,8 @@ extern int (*rtc_set_time)(const time_t); | |||
32 | * | 30 | * |
33 | * Grabs the current RTC seconds counter and adjusts it to the Unix Epoch. | 31 | * Grabs the current RTC seconds counter and adjusts it to the Unix Epoch. |
34 | */ | 32 | */ |
35 | void aica_rtc_gettimeofday(struct timespec *ts) { | 33 | void aica_rtc_gettimeofday(struct timespec *ts) |
34 | { | ||
36 | unsigned long val1, val2; | 35 | unsigned long val1, val2; |
37 | 36 | ||
38 | do { | 37 | do { |
@@ -55,7 +54,8 @@ void aica_rtc_gettimeofday(struct timespec *ts) { | |||
55 | * | 54 | * |
56 | * Adjusts the given @tv to the AICA Epoch and sets the RTC seconds counter. | 55 | * Adjusts the given @tv to the AICA Epoch and sets the RTC seconds counter. |
57 | */ | 56 | */ |
58 | int aica_rtc_settimeofday(const time_t secs) { | 57 | int aica_rtc_settimeofday(const time_t secs) |
58 | { | ||
59 | unsigned long val1, val2; | 59 | unsigned long val1, val2; |
60 | unsigned long adj = secs + TWENTY_YEARS; | 60 | unsigned long adj = secs + TWENTY_YEARS; |
61 | 61 | ||
@@ -75,7 +75,7 @@ int aica_rtc_settimeofday(const time_t secs) { | |||
75 | 75 | ||
76 | void aica_time_init(void) | 76 | void aica_time_init(void) |
77 | { | 77 | { |
78 | rtc_get_time = aica_rtc_gettimeofday; | 78 | rtc_sh_get_time = aica_rtc_gettimeofday; |
79 | rtc_set_time = aica_rtc_settimeofday; | 79 | rtc_sh_set_time = aica_rtc_settimeofday; |
80 | } | 80 | } |
81 | 81 | ||