aboutsummaryrefslogtreecommitdiff
path: root/drivers/rtc/class.c
AgeCommit message (Collapse)AuthorFilesLines
2009-01-06rtc: struct device: replace bus_id with dev_name(), dev_set_name()Kay Sievers1-10/+6
Acked-by: Alessandro Zummo <[email protected]> Acked-By: Greg Kroah-Hartman <[email protected]> Signed-off-by: Kay Sievers <[email protected]> Cc: David Brownell <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-10-16RTC: periodic irq fixAlessandro Zummo1-0/+1
Add kernel/kernel and kernel/user locking for the periodic irq feature of the rtc class. PIE ioctls are also supported. Signed-off-by: Alessandro Zummo <[email protected]> Cc: David Brownell <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-07-25Cleanup non-arch xtime uses, use get_seconds() or current_kernel_time().john stultz1-2/+3
This avoids use of the kernel-internal "xtime" variable directly outside of the actual time-related functions. Instead, use the helper functions that we already have available to us. This doesn't actually change any behaviour, but this will allow us to fix the fact that "xtime" isn't updated very often with CONFIG_NO_HZ (because much of the realtime information is maintained as separate offsets to 'xtime'), which has caused interfaces that use xtime directly to get a time that is out of sync with the real-time clock by up to a third of a second or so. Signed-off-by: John Stultz <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Thomas Gleixner <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-05-08rtc: update to class device removal patchesDavid Brownell1-0/+2
Fix a goof in the revised classdev support for RTCs: make sure the /dev node info is ready before the device is registered, not after. Otherwise the /sys/class/rtc/rtcN/dev attribute won't be created and then udev won't have the information it needs to create the /dev/rtcN node. Signed-off-by: David Brownell <[email protected]> Cc: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-05-08rtc: suspend()/resume() restores system clockDavid Brownell1-0/+74
RTC class suspend/resume support, re-initializing the system clock on resume from the clock used to initialize it at boot time. - The reinit-on-resume is hooked to the existing RTC_HCTOSYS config option, on the grounds that a clock good enough for init must also be good enough for re-init. - Inlining a version of the code used by ARM, to save and restore the delta between a selected RTC and the current system wall-clock time. - Removes calls to that ARM code from AT91, OMAP1, and S3C RTCs. This means that systems using those RTCs across suspend/resume will likely want to change their kernel configs to enable RTC_HCTOSYS. If HCTOSYS isn't using a second RTC (with battery?), this changes the system's initial date from Jan 1970 to the epoch this hardware uses: 1998 for AT91, 2000 for OMAP1 (assuming no split power mode), etc. This goes on top of the patch series removing "struct class_device" usage from the RTC framework. That's all needed for class suspend()/resume(). Signed-off-by: David Brownell <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Acked-By: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-05-08rtc: remove rest of class_deviceDavid Brownell1-11/+11
Finish converting the RTC framework so it no longer uses class_device. Signed-off-by: David Brownell <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Acked-By: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-05-08rtc: simplified /proc/driver/rtc handlingDavid Brownell1-7/+2
This simplifies the RTC procfs support by removing the class_interface that hooks it into the rtc core. If it's configured, then sysfs support is now part of the RTC core, and is never a separate module. It also removes the class_interface hook, now that its last remaining user is gone. (That API is usable only with a "struct class_device".) It's another step towards being able to remove "struct class_device". Signed-off-by: David Brownell <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Acked-By: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-05-08rtc: simplified rtc sysfs attribute handlingDavid Brownell1-0/+3
This simplifies the RTC sysfs support by removing the class_interface that hooks it into the rtc core. If it's configured, then sysfs support is now part of the RTC core, and is never a separate module. It's another step towards being able to remove "struct class_device". Signed-off-by: David Brownell <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Acked-By: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-05-08rtc: remove /sys/class/rtc-dev/*David Brownell1-0/+8
This simplifies the /dev support by removing a superfluous class_device (the /sys/class/rtc-dev stuff) and the class_interface that hooks it into the rtc core. Accordingly, if it's configured then /dev support is now part of the RTC core, and is never a separate module. It's another step towards being able to remove "struct class_device". [[email protected]: drivers/rtc/rtc-dev.c should #include "rtc-core.h"] Signed-off-by: David Brownell <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Acked-By: Alessandro Zummo <[email protected]> Signed-off-by: Adrian Bunk <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-03-01[PATCH] rtc_cmos oops fixDavid Brownell1-4/+10
Fix an oops on the rtc_device_unregister() path by waiting until the last moment before nulling the rtc->ops vector. Fix some potential oopses by having the rtc_class_open()/rtc_class_close() interface increase the RTC's reference count while an RTC handle is available outside the RTC framework. Signed-off-by: David Brownell <[email protected]> Cc: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-10-01[PATCH] constify rtc_class_ops: update driversDavid Brownell1-1/+1
Update RTC framework so that drivers can constify their method tables, moving them from ".data" to ".rodata". Then update the drivers. Signed-off-by: David Brownell <[email protected]> Cc: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-10-01[PATCH] RTC class uses subsys_initDavid Brownell1-2/+2
This makes RTC core components use "subsys_init" instead of "module_init", as appropriate for subsystem infrastructure. This is mostly useful for statically linking drivers in other parts of the tree that may provide an RTC interface as a secondary functionality (e.g. part of a multifunction chip); they won't need to worry so much about drivers/Makefile link order. Signed-off-by: David Brownell <[email protected]> Cc: Alessandro Zummo <[email protected]> Acked-by: Oleg Verych <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-06-27[PATCH] rtc: fix idr lockingSonny Rao1-0/+2
We need to serialize access to the global rtc_idr even in this error path. Signed-off-by: Sonny Rao <[email protected]> Acked-by: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-06-25[PATCH] rtc subsystem: add capability checksAlessandro Zummo1-0/+1
Centralize CAP_SYS_XXX checks to avoid duplicate code and missing checks in the drivers. Signed-off-by: Alessandro Zummo <[email protected]> Cc: Richard Purdie <[email protected]> Cc: Yoichi Yuasa <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-04-11[PATCH] RTC subsystem: compact error messagesAlessandro Zummo1-0/+2
Move registration error message from drivers to core. Signed-off-by: Alessandro Zummo <[email protected]> Cc: Lennert Buytenhek <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-03-27[PATCH] RTC subsystem: classAlessandro Zummo1-0/+145
Add the basic RTC subsystem infrastructure to the kernel. rtc/class.c - registration facilities for RTC drivers rtc/interface.c - kernel/rtc interface functions rtc/hctosys.c - snippet of code that copies hw clock to sw clock at bootup, if configured to do so. Signed-off-by: Alessandro Zummo <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>