aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/time.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 11:52:26 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 11:52:26 -0400
commitccaa36f73544163ef6e15eb29a620130755f6001 (patch)
treeb5cf50592c45e25edbd66fea451e6941e455fa83 /arch/powerpc/kernel/time.c
parentb4a9071af62f95dc6d22040a0b37ac7225ce4d54 (diff)
parent5e980823581682d1566e7b5089cf827ddd5f3c94 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (29 commits) [POWERPC] Fix rheap alignment problem [POWERPC] Use check_legacy_ioport() for ISAPnP [POWERPC] Avoid NULL pointer in gpio1_interrupt [POWERPC] Enable generic rtc hook for the MPC8349 mITX [POWERPC] Add powerpc get/set_rtc_time interface to new generic rtc class [POWERPC] Create a "wrapper" script and use it in arch/powerpc/boot [POWERPC] fix spin lock nesting in hvc_iseries [POWERPC] EEH failure to mark pci slot as frozen. [POWERPC] update powerpc defconfig files after libata kconfig breakage [POWERPC] enable sysrq in pmac32_defconfig [POWERPC] UPIO_TSI cleanup [POWERPC] rewrite mkprep and mkbugboot in sane C [POWERPC] maple/pci iomem annotations [POWERPC] powerpc oprofile __user annotations [POWERPC] cell spufs iomem annotations [POWERPC] NULL noise removal: spufs [POWERPC] ppc math-emu needs -fno-builtin-fabs for math.c and fabs.c [POWERPC] update mpc8349_itx_defconfig and remove some debug settings [POWERPC] Always call cede in pseries dedicated idle loop [POWERPC] Fix loop logic in irq_alloc_virt() ...
Diffstat (limited to 'arch/powerpc/kernel/time.c')
-rw-r--r--arch/powerpc/kernel/time.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 8b278d85ca4e..85b9244a098c 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -1041,6 +1041,48 @@ void __init time_init(void)
1041 set_dec(tb_ticks_per_jiffy); 1041 set_dec(tb_ticks_per_jiffy);
1042} 1042}
1043 1043
1044#ifdef CONFIG_RTC_CLASS
1045static int set_rtc_class_time(struct rtc_time *tm)
1046{
1047 int err;
1048 struct class_device *class_dev =
1049 rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
1050
1051 if (class_dev == NULL)
1052 return -ENODEV;
1053
1054 err = rtc_set_time(class_dev, tm);
1055
1056 rtc_class_close(class_dev);
1057
1058 return 0;
1059}
1060
1061static void get_rtc_class_time(struct rtc_time *tm)
1062{
1063 int err;
1064 struct class_device *class_dev =
1065 rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
1066
1067 if (class_dev == NULL)
1068 return;
1069
1070 err = rtc_read_time(class_dev, tm);
1071
1072 rtc_class_close(class_dev);
1073
1074 return;
1075}
1076
1077int __init rtc_class_hookup(void)
1078{
1079 ppc_md.get_rtc_time = get_rtc_class_time;
1080 ppc_md.set_rtc_time = set_rtc_class_time;
1081
1082 return 0;
1083}
1084#endif /* CONFIG_RTC_CLASS */
1085
1044 1086
1045#define FEBRUARY 2 1087#define FEBRUARY 2
1046#define STARTOFTIME 1970 1088#define STARTOFTIME 1970