Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38182
b: refs/heads/master
c: 7a69af6
h: refs/heads/master
v: v3
  • Loading branch information
Kim Phillips authored and Paul Mackerras committed Oct 2, 2006
1 parent 628588d commit 0ca1d5c
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 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: 2bf118197cb4d9a5e7a9e45b5b007235fdc9f402
refs/heads/master: 7a69af63e788a324d162201a0b23df41bcf158dd
42 changes: 42 additions & 0 deletions trunk/arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,48 @@ void __init time_init(void)
set_dec(tb_ticks_per_jiffy);
}

#ifdef CONFIG_RTC_CLASS
static int set_rtc_class_time(struct rtc_time *tm)
{
int err;
struct class_device *class_dev =
rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);

if (class_dev == NULL)
return -ENODEV;

err = rtc_set_time(class_dev, tm);

rtc_class_close(class_dev);

return 0;
}

static void get_rtc_class_time(struct rtc_time *tm)
{
int err;
struct class_device *class_dev =
rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);

if (class_dev == NULL)
return;

err = rtc_read_time(class_dev, tm);

rtc_class_close(class_dev);

return;
}

int __init rtc_class_hookup(void)
{
ppc_md.get_rtc_time = get_rtc_class_time;
ppc_md.set_rtc_time = set_rtc_class_time;

return 0;
}
#endif /* CONFIG_RTC_CLASS */


#define FEBRUARY 2
#define STARTOFTIME 1970
Expand Down
6 changes: 5 additions & 1 deletion trunk/include/asm-powerpc/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ extern void generic_calibrate_decr(void);
extern void wakeup_decrementer(void);
extern void snapshot_timebase(void);

#ifdef CONFIG_RTC_CLASS
extern int __init rtc_class_hookup(void);
#endif

/* Some sane defaults: 125 MHz timebase, 1GHz processor */
extern unsigned long ppc_proc_freq;
#define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8)
Expand Down Expand Up @@ -234,4 +238,4 @@ extern void snapshot_timebases(void);
#endif

#endif /* __KERNEL__ */
#endif /* __PPC64_TIME_H */
#endif /* __POWERPC_TIME_H */

0 comments on commit 0ca1d5c

Please sign in to comment.