]> git.hungrycats.org Git - linux/commitdiff
[PATCH] M68k genrtc updates
authorGeert Uytterhoeven <geert@linux-m68k.org>
Sun, 3 Nov 2002 07:51:56 +0000 (23:51 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Sun, 3 Nov 2002 07:51:56 +0000 (23:51 -0800)
Genrtc updates:
  - Add genrtc wrappers
  - Export mach_hwclk for modular genrtc

arch/m68k/kernel/m68k_ksyms.c
include/asm-m68k/rtc.h

index 9465dcb734c7ccf15f69bcc4a7079d8a21a0443c..e45bc8edd89020d62dbde6520b8cddd0c37fa322 100644 (file)
@@ -49,6 +49,7 @@ EXPORT_SYMBOL(iounmap);
 EXPORT_SYMBOL(kernel_set_cachemode);
 #endif /* !CONFIG_SUN3 */
 EXPORT_SYMBOL(m68k_debug_device);
+EXPORT_SYMBOL(mach_hwclk);
 EXPORT_SYMBOL(dump_fpu);
 EXPORT_SYMBOL(dump_thread);
 EXPORT_SYMBOL(strnlen);
index b28f54735a722a5f19f01b4920bac214f7d3b41c..674d7ccf80015107068453711ee91111f6cfc91f 100644 (file)
@@ -33,6 +33,36 @@ extern void gen_rtc_interrupt(unsigned long);
 #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 */
 
+static inline void get_rtc_time(struct rtc_time *time)
+{
+       /*
+        * Only the values that we read from the RTC are set. We leave
+        * tm_wday, tm_yday and tm_isdst untouched. Even though the
+        * RTC has RTC_DAY_OF_WEEK, we ignore it, as it is only updated
+        * by the RTC when initially set to a non-zero value.
+        */
+       mach_hwclk(0, time);
+}
+
+static inline int set_rtc_time(struct rtc_time *time)
+{
+       return mach_hwclk(1, time);
+}
+
+static inline int get_rtc_pll(struct rtc_pll_info *pll)
+{
+       if (mach_get_rtc_pll)
+               return mach_get_rtc_pll(pll);
+       else
+               return -EINVAL;
+}
+static inline int set_rtc_pll(struct rtc_pll_info *pll)
+{
+       if (mach_set_rtc_pll)
+               return mach_set_rtc_pll(pll);
+       else
+               return -EINVAL;
+}
 
 #endif /* __KERNEL__ */