android_kernel_xiaomi_sm8350/drivers/rtc
David Brownell 3925a5ce44 [PATCH] RTC gets sysfs wakealarm attribute
This adds a new "wakealarm" sysfs attribute to RTC class devices which support
alarm operations and are wakeup-capable:

 - It reads as either empty, or the scheduled alarm time as seconds
   since the POSIX epoch.  (That time may already have passed, since
   nothing currently enforces one-shot alarm semantics.)

 - It can be written with an alarm time in the future, again seconds
   since the POSIX epoch, which enables the alarm.

 - It can be written with an alarm time not in the future (such as 0,
   the start of the POSIX epoch) to disable the alarm.

Usage examples (some need GNU date) after "cd /sys/class/rtc/rtcN":

    alarm after 10 minutes:
	# echo $(( $(cat since_epoch) + 10 * 60 )) > wakealarm
    alarm tuesday evening 10pm:
	# date -d '10pm tuesday' "+%s" > wakealarm
    disable alarm:
    	# echo 0 > wakealarm

This resembles the /proc/acpi/alarm file in that nothing happens when the
alarm triggers ...  except possibly waking the system from sleep.  It's also
like that in a nasty way: not much can be done to prevent one task from
clobbering another task's alarm settings.

It differs from that file in that there's no in-kernel date parser.

Note that a few RTCs ignore rtc_wkalrm.enabled when setting alarms, or aren't
set up correctly, so they won't yet behave with this attribute.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-12 09:48:31 -08:00
..
class.c [PATCH] constify rtc_class_ops: update drivers 2006-10-01 00:39:25 -07:00
hctosys.c
interface.c [PATCH] rtc class locking bugfixes 2006-11-25 13:28:33 -08:00
Kconfig [PATCH] RTC framework driver for CMOS RTCs 2007-02-11 10:51:32 -08:00
Makefile [PATCH] RTC framework driver for CMOS RTCs 2007-02-11 10:51:32 -08:00
rtc-at91rm9200.c [PATCH] rtc-at91rm9200 build fix 2007-01-05 23:55:22 -08:00
rtc-cmos.c [PATCH] RTC framework driver for CMOS RTCs 2007-02-11 10:51:32 -08:00
rtc-dev.c [PATCH] trivial __user annotations - rtc-dev 2007-02-09 09:14:06 -08:00
rtc-ds1307.c [PATCH] RTC: build fixes 2006-10-04 08:15:14 -07:00
rtc-ds1553.c [PATCH] change __init to __devinit in 2 rtc drivers 2007-02-12 09:48:30 -08:00
rtc-ds1672.c [PATCH] RTCs don't use i2c_adapter.dev 2006-12-10 09:55:40 -08:00
rtc-ds1742.c [PATCH] change __init to __devinit in 2 rtc drivers 2007-02-12 09:48:30 -08:00
rtc-ep93xx.c [PATCH] constify rtc_class_ops: update drivers 2006-10-01 00:39:25 -07:00
rtc-isl1208.c [PATCH] constify rtc_class_ops: update drivers 2006-10-01 00:39:25 -07:00
rtc-lib.c [PATCH] rtc: Add rtc_merge_alarm() 2006-12-10 09:55:40 -08:00
rtc-m48t86.c [PATCH] constify rtc_class_ops: update drivers 2006-10-01 00:39:25 -07:00
rtc-max6902.c [PATCH] rtc-max6902: month conversion fix 2006-10-17 08:18:44 -07:00
rtc-omap.c [PATCH] rtc framewok: rtc_wkalrm.enabled reporting updates 2006-12-13 09:05:52 -08:00
rtc-pcf8563.c [PATCH] rtc-pcf8563: detect polarity of century bit automatically 2007-02-09 09:25:46 -08:00
rtc-pcf8583.c [PATCH] constify rtc_class_ops: update drivers 2006-10-01 00:39:25 -07:00
rtc-pl031.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
rtc-proc.c [PATCH] rtc framewok: rtc_wkalrm.enabled reporting updates 2006-12-13 09:05:52 -08:00
rtc-rs5c348.c [PATCH] constify rtc_class_ops: update drivers 2006-10-01 00:39:25 -07:00
rtc-rs5c372.c [PATCH] Update the rtc-rs5c372 driver 2007-01-05 23:55:23 -08:00
rtc-s3c.c [PATCH] rtc framewok: rtc_wkalrm.enabled reporting updates 2006-12-13 09:05:52 -08:00
rtc-sa1100.c [PATCH] rtc framewok: rtc_wkalrm.enabled reporting updates 2006-12-13 09:05:52 -08:00
rtc-sh.c [PATCH] rtc-sh: act on rtc_wkalrm.enabled when setting an alarm 2007-01-23 07:52:06 -08:00
rtc-sysfs.c [PATCH] RTC gets sysfs wakealarm attribute 2007-02-12 09:48:31 -08:00
rtc-test.c [PATCH] RTC: handle sysfs errors 2006-12-07 08:39:31 -08:00
rtc-v3020.c [PATCH] rtc: fix printk of 64-bit res on 32-bit platform 2006-10-17 08:18:47 -07:00
rtc-vr41xx.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
rtc-x1205.c [PATCH] RTCs don't use i2c_adapter.dev 2006-12-10 09:55:40 -08:00