From 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 16 Apr 2005 15:20:36 -0700 Subject: Linux-2.6.12-rc2 Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip! --- arch/m68k/sun3/intersil.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 arch/m68k/sun3/intersil.c (limited to 'arch/m68k/sun3/intersil.c') diff --git a/arch/m68k/sun3/intersil.c b/arch/m68k/sun3/intersil.c new file mode 100644 index 000000000000..db359d7402a6 --- /dev/null +++ b/arch/m68k/sun3/intersil.c @@ -0,0 +1,76 @@ +/* + * arch/m68k/sun3/intersil.c + * + * basic routines for accessing the intersil clock within the sun3 machines + * + * started 11/12/1999 Sam Creasey + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive + * for more details. + */ + +#include +#include + +#include +#include +#include +#include +#include + + +/* bits to set for start/run of the intersil */ +#define STOP_VAL (INTERSIL_STOP | INTERSIL_INT_ENABLE | INTERSIL_24H_MODE) +#define START_VAL (INTERSIL_RUN | INTERSIL_INT_ENABLE | INTERSIL_24H_MODE) + +/* does this need to be implemented? */ +unsigned long sun3_gettimeoffset(void) +{ + return 1; +} + + +/* get/set hwclock */ + +int sun3_hwclk(int set, struct rtc_time *t) +{ + volatile struct intersil_dt *todintersil; + unsigned long flags; + + todintersil = (struct intersil_dt *) &intersil_clock->counter; + + local_irq_save(flags); + + intersil_clock->cmd_reg = STOP_VAL; + + /* set or read the clock */ + if(set) { + todintersil->csec = 0; + todintersil->hour = t->tm_hour; + todintersil->minute = t->tm_min; + todintersil->second = t->tm_sec; + todintersil->month = t->tm_mon; + todintersil->day = t->tm_mday; + todintersil->year = t->tm_year - 68; + todintersil->weekday = t->tm_wday; + } else { + /* read clock */ + t->tm_sec = todintersil->csec; + t->tm_hour = todintersil->hour; + t->tm_min = todintersil->minute; + t->tm_sec = todintersil->second; + t->tm_mon = todintersil->month; + t->tm_mday = todintersil->day; + t->tm_year = todintersil->year + 68; + t->tm_wday = todintersil->weekday; + } + + intersil_clock->cmd_reg = START_VAL; + + local_irq_restore(flags); + + return 0; + +} + -- cgit v1.2.2