forked from luck/tmp_suning_uos_patched
sh: Rename rtc_get/set_time() to avoid RTC_CLASS conflict.
We have a clash with RTC_CLASS over these names, so we change them.. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
This commit is contained in:
parent
2991be7252
commit
af514ca7d2
|
@ -75,7 +75,7 @@ int aica_rtc_settimeofday(const time_t secs)
|
||||||
|
|
||||||
void aica_time_init(void)
|
void aica_time_init(void)
|
||||||
{
|
{
|
||||||
rtc_get_time = aica_rtc_gettimeofday;
|
rtc_sh_get_time = aica_rtc_gettimeofday;
|
||||||
rtc_set_time = aica_rtc_settimeofday;
|
rtc_sh_set_time = aica_rtc_settimeofday;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,17 +16,9 @@
|
||||||
#include <linux/time.h>
|
#include <linux/time.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/spinlock.h>
|
#include <linux/spinlock.h>
|
||||||
|
#include <linux/bcd.h>
|
||||||
|
#include <asm/rtc.h>
|
||||||
|
|
||||||
#ifndef BCD_TO_BIN
|
|
||||||
#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef BIN_TO_BCD
|
|
||||||
#define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern void (*rtc_get_time) (struct timespec *);
|
|
||||||
extern int (*rtc_set_time) (const time_t);
|
|
||||||
extern spinlock_t rtc_lock;
|
extern spinlock_t rtc_lock;
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
|
@ -94,9 +86,8 @@ int landisk_rtc_settimeofday(const time_t secs)
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void landisk_time_init(void)
|
void landisk_time_init(void)
|
||||||
{
|
{
|
||||||
rtc_get_time = landisk_rtc_gettimeofday;
|
rtc_sh_get_time = landisk_rtc_gettimeofday;
|
||||||
rtc_set_time = landisk_rtc_settimeofday;
|
rtc_sh_set_time = landisk_rtc_settimeofday;
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,7 +130,7 @@ int mpc1211_rtc_settimeofday(const struct timeval *tv)
|
||||||
|
|
||||||
void mpc1211_time_init(void)
|
void mpc1211_time_init(void)
|
||||||
{
|
{
|
||||||
rtc_get_time = mpc1211_rtc_gettimeofday;
|
rtc_sh_get_time = mpc1211_rtc_gettimeofday;
|
||||||
rtc_set_time = mpc1211_rtc_settimeofday;
|
rtc_sh_set_time = mpc1211_rtc_settimeofday;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,10 @@
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <linux/time.h>
|
#include <linux/time.h>
|
||||||
#include <linux/bcd.h>
|
#include <linux/bcd.h>
|
||||||
#include <asm/io.h>
|
|
||||||
#include <linux/rtc.h>
|
#include <linux/rtc.h>
|
||||||
#include <linux/spinlock.h>
|
#include <linux/spinlock.h>
|
||||||
|
#include <asm/io.h>
|
||||||
|
#include <asm/rtc.h>
|
||||||
|
|
||||||
#define RTC_BASE 0xb0000000
|
#define RTC_BASE 0xb0000000
|
||||||
#define RTC_SEC1 (RTC_BASE + 0)
|
#define RTC_SEC1 (RTC_BASE + 0)
|
||||||
|
@ -34,8 +35,6 @@
|
||||||
#define RTC_BUSY 1
|
#define RTC_BUSY 1
|
||||||
#define RTC_STOP 2
|
#define RTC_STOP 2
|
||||||
|
|
||||||
extern void (*rtc_get_time)(struct timespec *);
|
|
||||||
extern int (*rtc_set_time)(const time_t);
|
|
||||||
extern spinlock_t rtc_lock;
|
extern spinlock_t rtc_lock;
|
||||||
|
|
||||||
unsigned long get_cmos_time(void)
|
unsigned long get_cmos_time(void)
|
||||||
|
@ -128,6 +127,6 @@ int sh03_rtc_settimeofday(const time_t secs)
|
||||||
|
|
||||||
void sh03_time_init(void)
|
void sh03_time_init(void)
|
||||||
{
|
{
|
||||||
rtc_get_time = sh03_rtc_gettimeofday;
|
rtc_sh_get_time = sh03_rtc_gettimeofday;
|
||||||
rtc_set_time = sh03_rtc_settimeofday;
|
rtc_sh_set_time = sh03_rtc_settimeofday;
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,11 +165,11 @@ void __init secureedge5410_rtc_init(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (use_ds1302) {
|
if (use_ds1302) {
|
||||||
rtc_get_time = snapgear_rtc_gettimeofday;
|
rtc_sh_get_time = snapgear_rtc_gettimeofday;
|
||||||
rtc_set_time = snapgear_rtc_settimeofday;
|
rtc_sh_set_time = snapgear_rtc_settimeofday;
|
||||||
} else {
|
} else {
|
||||||
rtc_get_time = sh_rtc_gettimeofday;
|
rtc_sh_get_time = sh_rtc_gettimeofday;
|
||||||
rtc_set_time = sh_rtc_settimeofday;
|
rtc_sh_set_time = sh_rtc_settimeofday;
|
||||||
}
|
}
|
||||||
|
|
||||||
printk("SnapGear RTC: using %s rtc.\n", use_ds1302 ? "ds1302" : "internal");
|
printk("SnapGear RTC: using %s rtc.\n", use_ds1302 ? "ds1302" : "internal");
|
||||||
|
|
|
@ -29,11 +29,11 @@ EXPORT_SYMBOL(rtc_lock);
|
||||||
/* XXX: Can we initialize this in a routine somewhere? Dreamcast doesn't want
|
/* XXX: Can we initialize this in a routine somewhere? Dreamcast doesn't want
|
||||||
* these routines anywhere... */
|
* these routines anywhere... */
|
||||||
#ifdef CONFIG_SH_RTC
|
#ifdef CONFIG_SH_RTC
|
||||||
void (*rtc_get_time)(struct timespec *) = sh_rtc_gettimeofday;
|
void (*rtc_sh_get_time)(struct timespec *) = sh_rtc_gettimeofday;
|
||||||
int (*rtc_set_time)(const time_t) = sh_rtc_settimeofday;
|
int (*rtc_sh_set_time)(const time_t) = sh_rtc_settimeofday;
|
||||||
#else
|
#else
|
||||||
void (*rtc_get_time)(struct timespec *);
|
void (*rtc_sh_get_time)(struct timespec *);
|
||||||
int (*rtc_set_time)(const time_t);
|
int (*rtc_sh_set_time)(const time_t);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -135,7 +135,7 @@ void handle_timer_tick(struct pt_regs *regs)
|
||||||
xtime.tv_sec > last_rtc_update + 660 &&
|
xtime.tv_sec > last_rtc_update + 660 &&
|
||||||
(xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 &&
|
(xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 &&
|
||||||
(xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) {
|
(xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) {
|
||||||
if (rtc_set_time(xtime.tv_sec) == 0)
|
if (rtc_sh_set_time(xtime.tv_sec) == 0)
|
||||||
last_rtc_update = xtime.tv_sec;
|
last_rtc_update = xtime.tv_sec;
|
||||||
else
|
else
|
||||||
/* do it again in 60s */
|
/* do it again in 60s */
|
||||||
|
@ -193,8 +193,8 @@ void __init time_init(void)
|
||||||
|
|
||||||
clk_init();
|
clk_init();
|
||||||
|
|
||||||
if (rtc_get_time) {
|
if (rtc_sh_get_time) {
|
||||||
rtc_get_time(&xtime);
|
rtc_sh_get_time(&xtime);
|
||||||
} else {
|
} else {
|
||||||
xtime.tv_sec = mktime(2000, 1, 1, 0, 0, 0);
|
xtime.tv_sec = mktime(2000, 1, 1, 0, 0, 0);
|
||||||
xtime.tv_nsec = 0;
|
xtime.tv_nsec = 0;
|
||||||
|
|
|
@ -132,17 +132,17 @@ static unsigned long tmu_timer_get_frequency(void)
|
||||||
ctrl_outl(0xffffffff, TMU0_TCOR);
|
ctrl_outl(0xffffffff, TMU0_TCOR);
|
||||||
ctrl_outl(0xffffffff, TMU0_TCNT);
|
ctrl_outl(0xffffffff, TMU0_TCNT);
|
||||||
|
|
||||||
rtc_get_time(&ts2);
|
rtc_sh_get_time(&ts2);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
rtc_get_time(&ts1);
|
rtc_sh_get_time(&ts1);
|
||||||
} while (ts1.tv_nsec == ts2.tv_nsec && ts1.tv_sec == ts2.tv_sec);
|
} while (ts1.tv_nsec == ts2.tv_nsec && ts1.tv_sec == ts2.tv_sec);
|
||||||
|
|
||||||
/* actually start the timer */
|
/* actually start the timer */
|
||||||
ctrl_outb(TMU_TSTR_INIT, TMU_TSTR);
|
ctrl_outb(TMU_TSTR_INIT, TMU_TSTR);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
rtc_get_time(&ts2);
|
rtc_sh_get_time(&ts2);
|
||||||
} while (ts1.tv_nsec == ts2.tv_nsec && ts1.tv_sec == ts2.tv_sec);
|
} while (ts1.tv_nsec == ts2.tv_nsec && ts1.tv_sec == ts2.tv_sec);
|
||||||
|
|
||||||
freq = 0xffffffff - ctrl_inl(TMU0_TCNT);
|
freq = 0xffffffff - ctrl_inl(TMU0_TCNT);
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
extern void sh_rtc_gettimeofday(struct timespec *ts);
|
extern void sh_rtc_gettimeofday(struct timespec *ts);
|
||||||
extern int sh_rtc_settimeofday(const time_t secs);
|
extern int sh_rtc_settimeofday(const time_t secs);
|
||||||
extern void (*board_time_init)(void);
|
extern void (*board_time_init)(void);
|
||||||
extern void (*rtc_get_time)(struct timespec *);
|
extern void (*rtc_sh_get_time)(struct timespec *);
|
||||||
extern int (*rtc_set_time)(const time_t);
|
extern int (*rtc_sh_set_time)(const time_t);
|
||||||
|
|
||||||
/* RCR1 Bits */
|
/* RCR1 Bits */
|
||||||
#define RCR1_CF 0x80 /* Carry Flag */
|
#define RCR1_CF 0x80 /* Carry Flag */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user