rpms/kernel/devel linux-2.6-rtc-show-hctosys.patch, NONE, 1.1 kernel.spec, 1.1790, 1.1791
Matthew Garrett
mjg59 at fedoraproject.org
Thu Sep 10 16:49:21 UTC 2009
Author: mjg59
Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv12967
Modified Files:
kernel.spec
Added Files:
linux-2.6-rtc-show-hctosys.patch
Log Message:
* Thu Sep 10 2009 Matthew Garrett <mjg at redhat.com>
- linux-2.6-ahci-export-capabilities.patch: Backport from upstream
- linux-2.6-rtc-show-hctosys.patch: Export the hctosys state of an rtc
linux-2.6-rtc-show-hctosys.patch:
Documentation/rtc.txt | 2 ++
b/Documentation/rtc.txt | 22 ++++++++++++++++++++++
b/drivers/rtc/rtc-sysfs.c | 14 ++++++++++++++
3 files changed, 38 insertions(+)
--- NEW FILE linux-2.6-rtc-show-hctosys.patch ---
diff --git a/Documentation/rtc.txt b/Documentation/rtc.txt
index 8deffcd..216bb8c 100644
--- a/Documentation/rtc.txt
+++ b/Documentation/rtc.txt
@@ -135,6 +135,28 @@ a high functionality RTC is integrated into the SOC. That system might read
the system clock from the discrete RTC, but use the integrated one for all
other tasks, because of its greater functionality.
+SYSFS INTERFACE
+---------------
+
+The sysfs interface under /sys/class/rtc/rtcN provides access to various
+rtc attributes without requiring the use of ioctls. All dates and times
+are in the RTC's timezone, rather than in system time.
+
+date: RTC-provided date
+max_user_freq: The maximum interrupt rate an unprivileged user may request
+ from this RTC.
+name: The name of the RTC corresponding to this sysfs directory
+since_epoch: The number of seconds since the epoch according to the RTC
+time: RTC-provided time
+wakealarm: The time at which the clock will generate a system wakeup
+ event. This is a one shot wakeup event, so must be reset
+ after wake if a daily wakeup is required. Format is either
+ seconds since the epoch or, if there's a leading +, seconds
+ in the future.
+
+IOCTL INTERFACE
+---------------
+
The ioctl() calls supported by /dev/rtc are also supported by the RTC class
framework. However, because the chips and systems are not standardized,
some PC/AT functionality might not be provided. And in the same way, some
diff --git a/Documentation/rtc.txt b/Documentation/rtc.txt
index 216bb8c..baac51f 100644
--- a/Documentation/rtc.txt
+++ b/Documentation/rtc.txt
@@ -143,6 +143,8 @@ rtc attributes without requiring the use of ioctls. All dates and times
are in the RTC's timezone, rather than in system time.
date: RTC-provided date
+hctosys: 1 if the RTC provided the system time at boot via the
+ CONFIG_RTC_HCTOSYS kernel option, 0 otherwise
max_user_freq: The maximum interrupt rate an unprivileged user may request
from this RTC.
name: The name of the RTC corresponding to this sysfs directory
diff --git a/drivers/rtc/rtc-sysfs.c b/drivers/rtc/rtc-sysfs.c
index 2531ce4..7dd23a6 100644
--- a/drivers/rtc/rtc-sysfs.c
+++ b/drivers/rtc/rtc-sysfs.c
@@ -102,6 +102,19 @@ rtc_sysfs_set_max_user_freq(struct device *dev, struct device_attribute *attr,
return n;
}
+static ssize_t
+rtc_sysfs_show_hctosys(struct device *dev, struct device_attribute *attr,
+ char *buf)
+{
+#ifdef CONFIG_RTC_HCTOSYS_DEVICE
+ if (strcmp(dev_name(&to_rtc_device(dev)->dev),
+ CONFIG_RTC_HCTOSYS_DEVICE) == 0)
+ return sprintf(buf, "1\n");
+ else
+#endif
+ return sprintf(buf, "0\n");
+}
+
static struct device_attribute rtc_attrs[] = {
__ATTR(name, S_IRUGO, rtc_sysfs_show_name, NULL),
__ATTR(date, S_IRUGO, rtc_sysfs_show_date, NULL),
@@ -109,6 +122,7 @@ static struct device_attribute rtc_attrs[] = {
__ATTR(since_epoch, S_IRUGO, rtc_sysfs_show_since_epoch, NULL),
__ATTR(max_user_freq, S_IRUGO | S_IWUSR, rtc_sysfs_show_max_user_freq,
rtc_sysfs_set_max_user_freq),
+ __ATTR(hctosys, S_IRUGO, rtc_sysfs_show_hctosys, NULL),
{ },
};
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1790
retrieving revision 1.1791
diff -u -p -r1.1790 -r1.1791
--- kernel.spec 10 Sep 2009 16:11:31 -0000 1.1790
+++ kernel.spec 10 Sep 2009 16:49:20 -0000 1.1791
@@ -729,6 +729,7 @@ Patch11010: via-hwmon-temp-sensor.patch
# patches headed upstream
Patch12010: linux-2.6-dell-laptop-rfkill-fix.patch
Patch12011: linux-2.6-block-silently-error-unsupported-empty-barriers-too.patch
+Patch12012: linux-2.6-rtc-show-hctosys.patch
%endif
@@ -1357,6 +1358,7 @@ ApplyPatch linux-2.6-silence-acpi-blackl
ApplyPatch v4l-dvb-fix-cx25840-firmware-loading.patch
# Patches headed upstream
+ApplyPatch linux-2.6-rtc-show-hctosys.patch
# END OF PATCH APPLICATIONS
@@ -2016,6 +2018,7 @@ fi
%changelog
* Thu Sep 10 2009 Matthew Garrett <mjg at redhat.com>
- linux-2.6-ahci-export-capabilities.patch: Backport from upstream
+- linux-2.6-rtc-show-hctosys.patch: Export the hctosys state of an rtc
* Thu Sep 10 2009 Ben Skeggs <bskeggs at redhat.com>
- drm-nouveau.patch: add some scaler-only modes for LVDS, GEM/TTM fixes
More information about the scm-commits
mailing list