Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11207
b: refs/heads/master
c: 5bcb9a5
h: refs/heads/master
i:
  11205: 8832554
  11203: fd1c749
  11199: 81a41b3
v: v3
  • Loading branch information
Ralf Baechle committed Oct 29, 2005
1 parent 1a609cd commit d59c514
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 72 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 330cfe016bec3cdf517a626083bcb0d7b1854744
refs/heads/master: 5bcb9a58e6e3eda4af87193c8746d15e45f51628
2 changes: 0 additions & 2 deletions trunk/arch/mips/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ obj-$(CONFIG_PROC_FS) += proc.o

obj-$(CONFIG_64BIT) += cpu-bugs64.o

obj-$(CONFIG_GEN_RTC) += genrtc.o

CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi)
CFLAGS_ioctl32.o += -Ifs/

Expand Down
64 changes: 0 additions & 64 deletions trunk/arch/mips/kernel/genrtc.c

This file was deleted.

53 changes: 48 additions & 5 deletions trunk/include/asm-mips/rtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

#ifdef __KERNEL__

#include <linux/spinlock.h>
#include <linux/rtc.h>
#include <asm/time.h>

#define RTC_PIE 0x40 /* periodic interrupt enable */
#define RTC_AIE 0x20 /* alarm interrupt enable */
Expand All @@ -27,11 +29,52 @@
#define RTC_24H 0x02 /* 24 hour mode - else hours bit 7 means pm */
#define RTC_DST_EN 0x01 /* auto switch DST - works f. USA only */

unsigned int get_rtc_time(struct rtc_time *time);
int set_rtc_time(struct rtc_time *time);
unsigned int get_rtc_ss(void);
int get_rtc_pll(struct rtc_pll_info *pll);
int set_rtc_pll(struct rtc_pll_info *pll);
static DEFINE_SPINLOCK(mips_rtc_lock);

static inline unsigned int get_rtc_time(struct rtc_time *time)
{
unsigned long nowtime;

spin_lock(&mips_rtc_lock);
nowtime = rtc_get_time();
to_tm(nowtime, time);
time->tm_year -= 1900;
spin_unlock(&mips_rtc_lock);

return RTC_24H;
}

static inline int set_rtc_time(struct rtc_time *time)
{
unsigned long nowtime;
int ret;

spin_lock(&mips_rtc_lock);
nowtime = mktime(time->tm_year+1900, time->tm_mon+1,
time->tm_mday, time->tm_hour, time->tm_min,
time->tm_sec);
ret = rtc_set_time(nowtime);
spin_unlock(&mips_rtc_lock);

return ret;
}

static inline unsigned int get_rtc_ss(void)
{
struct rtc_time h;

get_rtc_time(&h);
return h.tm_sec;
}

static inline int get_rtc_pll(struct rtc_pll_info *pll)
{
return -EINVAL;
}

static inline int set_rtc_pll(struct rtc_pll_info *pll)
{
return -EINVAL;
}
#endif
#endif

0 comments on commit d59c514

Please sign in to comment.