aboutsummaryrefslogtreecommitdiff
path: root/arch/mips/lasat/ds1603.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/lasat/ds1603.c')
-rw-r--r--arch/mips/lasat/ds1603.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/arch/mips/lasat/ds1603.c b/arch/mips/lasat/ds1603.c
index 7dced67c55e..c6fd96ff118 100644
--- a/arch/mips/lasat/ds1603.c
+++ b/arch/mips/lasat/ds1603.c
@@ -18,7 +18,7 @@
#define TRIMMER_VALUE_MASK 0x38
#define TRIMMER_SHIFT 3
-struct ds_defs *ds1603 = NULL;
+struct ds_defs *ds1603;
/* HW specific register functions */
static void rtc_reg_write(unsigned long val)
@@ -91,7 +91,7 @@ static void rtc_write_byte(unsigned int byte)
{
int i;
- for (i = 0; i<=7; i++) {
+ for (i = 0; i <= 7; i++) {
rtc_write_databit(byte & 1L);
byte >>= 1;
}
@@ -101,7 +101,7 @@ static void rtc_write_word(unsigned long word)
{
int i;
- for (i = 0; i<=31; i++) {
+ for (i = 0; i <= 31; i++) {
rtc_write_databit(word & 1L);
word >>= 1;
}
@@ -113,7 +113,7 @@ static unsigned long rtc_read_word(void)
unsigned long word = 0;
unsigned long shift = 0;
- for (i = 0; i<=31; i++) {
+ for (i = 0; i <= 31; i++) {
word |= rtc_read_databit() << shift;
shift++;
}
@@ -135,8 +135,7 @@ static void rtc_end_op(void)
lasat_ndelay(1000);
}
-/* interface */
-unsigned long ds1603_read(void)
+void read_persistent_clock(struct timespec *ts)
{
unsigned long word;
unsigned long flags;
@@ -147,10 +146,12 @@ unsigned long ds1603_read(void)
word = rtc_read_word();
rtc_end_op();
spin_unlock_irqrestore(&rtc_lock, flags);
- return word;
+
+ ts->tv_sec = word;
+ ts->tv_nsec = 0;
}
-int ds1603_set(unsigned long time)
+int rtc_mips_set_mmss(unsigned long time)
{
unsigned long flags;