aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-sysfs.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-sysfs.c b/drivers/rtc/rtc-sysfs.c
index 2531ce4c9db0..7dd23a6fc825 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,
102 return n; 102 return n;
103} 103}
104 104
105static ssize_t
106rtc_sysfs_show_hctosys(struct device *dev, struct device_attribute *attr,
107 char *buf)
108{
109#ifdef CONFIG_RTC_HCTOSYS_DEVICE
110 if (strcmp(dev_name(&to_rtc_device(dev)->dev),
111 CONFIG_RTC_HCTOSYS_DEVICE) == 0)
112 return sprintf(buf, "1\n");
113 else
114#endif
115 return sprintf(buf, "0\n");
116}
117
105static struct device_attribute rtc_attrs[] = { 118static struct device_attribute rtc_attrs[] = {
106 __ATTR(name, S_IRUGO, rtc_sysfs_show_name, NULL), 119 __ATTR(name, S_IRUGO, rtc_sysfs_show_name, NULL),
107 __ATTR(date, S_IRUGO, rtc_sysfs_show_date, NULL), 120 __ATTR(date, S_IRUGO, rtc_sysfs_show_date, NULL),
@@ -109,6 +122,7 @@ static struct device_attribute rtc_attrs[] = {
109 __ATTR(since_epoch, S_IRUGO, rtc_sysfs_show_since_epoch, NULL), 122 __ATTR(since_epoch, S_IRUGO, rtc_sysfs_show_since_epoch, NULL),
110 __ATTR(max_user_freq, S_IRUGO | S_IWUSR, rtc_sysfs_show_max_user_freq, 123 __ATTR(max_user_freq, S_IRUGO | S_IWUSR, rtc_sysfs_show_max_user_freq,
111 rtc_sysfs_set_max_user_freq), 124 rtc_sysfs_set_max_user_freq),
125 __ATTR(hctosys, S_IRUGO, rtc_sysfs_show_hctosys, NULL),
112 { }, 126 { },
113}; 127};
114 128