12 #include <linux/module.h>
13 #include <linux/rtc.h>
43 retval =
sprintf(buf,
"%04d-%02d-%02d\n",
59 retval =
sprintf(buf,
"%02d:%02d:%02d\n",
77 retval =
sprintf(buf,
"%lu\n", time);
92 const char *buf,
size_t n)
97 if (val >= 4096 || val == 0)
115 #ifdef CONFIG_RTC_HCTOSYS_DEVICE
118 CONFIG_RTC_HCTOSYS_DEVICE) == 0)
131 rtc_sysfs_set_max_user_freq),
153 if (retval == 0 && alm.enabled) {
155 retval =
sprintf(buf,
"%lu\n", alarm);
163 const char *buf,
size_t n)
166 unsigned long now,
alarm;
180 buf_ptr = (
char *)buf;
181 if (*buf_ptr ==
'+') {
212 return (retval < 0) ? retval :
n;
215 rtc_sysfs_show_wakealarm, rtc_sysfs_set_wakealarm);
223 static inline int rtc_does_wakealarm(
struct rtc_device *rtc)
225 if (!device_can_wakeup(rtc->
dev.parent))
227 return rtc->
ops->set_alarm !=
NULL;
236 if (!rtc_does_wakealarm(rtc))
242 "failed to create alarm attribute, %d\n", err);
248 if (rtc_does_wakealarm(rtc))