]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/platforms/ps3/time.c
Merge branch 'omap-pool'
[linux-2.6-omap-h63xx.git] / arch / powerpc / platforms / ps3 / time.c
index d0daf7d6d3b26407d5ec87c0d5caef127943c4fe..b178a1e66c915e8ab6e85b0eec51830b6a05adf1 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/platform_device.h>
 
 #include <asm/rtc.h>
 #include <asm/lv1call.h>
@@ -74,23 +75,20 @@ static u64 read_rtc(void)
        return rtc_val;
 }
 
-int ps3_set_rtc_time(struct rtc_time *tm)
+unsigned long __init ps3_get_boot_time(void)
 {
-       u64 now = mktime(tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
-               tm->tm_hour, tm->tm_min, tm->tm_sec);
-
-       ps3_os_area_set_rtc_diff(now - read_rtc());
-       return 0;
+       return read_rtc() + ps3_os_area_get_rtc_diff();
 }
 
-void ps3_get_rtc_time(struct rtc_time *tm)
+static int __init ps3_rtc_init(void)
 {
-       to_tm(read_rtc() + ps3_os_area_get_rtc_diff(), tm);
-       tm->tm_year -= 1900;
-       tm->tm_mon -= 1;
-}
+       struct platform_device *pdev;
 
-unsigned long __init ps3_get_boot_time(void)
-{
-       return read_rtc() + ps3_os_area_get_rtc_diff();
+       pdev = platform_device_register_simple("rtc-ps3", -1, NULL, 0);
+       if (IS_ERR(pdev))
+               return PTR_ERR(pdev);
+
+       return 0;
 }
+
+module_init(ps3_rtc_init);