diff options
author | Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> | 2009-02-24 16:04:20 +0300 |
---|---|---|
committer | Kyle McMartin <kyle@mcmartin.ca> | 2009-04-02 05:05:32 +0400 |
commit | 0b5f037a4dc495f9c40eed7f076fc6c23af3359b (patch) | |
tree | 0b4f3388c2ad47ba2310e3e8c1feafcd800f2e72 /arch/powerpc/platforms/ps3/time.c | |
parent | bcd68a70cb0eee556d86d93133aa150319bd9f53 (diff) | |
download | linux-0b5f037a4dc495f9c40eed7f076fc6c23af3359b.tar.xz |
powerpc/ps3: Add rtc-ps3
Create a real RTC driver for PS3, and unhook the deprecated
ppc_md.[gs]et_rtc_time.
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Acked-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
Diffstat (limited to 'arch/powerpc/platforms/ps3/time.c')
-rw-r--r-- | arch/powerpc/platforms/ps3/time.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/arch/powerpc/platforms/ps3/time.c b/arch/powerpc/platforms/ps3/time.c index d0daf7d6d3b2..b178a1e66c91 100644 --- a/arch/powerpc/platforms/ps3/time.c +++ b/arch/powerpc/platforms/ps3/time.c @@ -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); |