]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ACPI: TAD: Add alarm support to the RTC class device interface
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 31 Mar 2026 19:38:52 +0000 (21:38 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 4 Apr 2026 18:37:25 +0000 (20:37 +0200)
commit7572dcabe38d904dd501e652b504a9ad364ba1cc
tree5951a438256c9bf10064beadb4ff587209d36c68
parent2ffc8bf29e4d7dff0e6c94f245d5a757be6c013d
ACPI: TAD: Add alarm support to the RTC class device interface

Add alarm support, based on Section 9.17 of ACPI 6.6 [1], to the RTC
class device interface of the driver.

The ACPI time and alarm device (TAD) can support two separate alarm
timers, one for waking up the system when it is on AC power, and one
for waking it up when it is on DC power.  In principle, each of them
can be set to a different value representing the number of seconds
till the given alarm timer expires.

However, the RTC class device can only set one alarm, so it will set
both the alarm timers of the ACPI TAD (if the DC one is supported) to
the same value.  That is somewhat cumbersome because there is no way in
the ACPI TAD firmware interface to set both timers in one go, so they
need to be set sequentially, but that's how it goes.

On the alarm read side, the driver assumes that both timers have been
set to the same value, so it is sufficient to access one of them (the
AC one specifically).

Link: https://uefi.org/specs/ACPI/6.6/09_ACPI_Defined_Devices_and_Device_Specific_Objects.html#time-and-alarm-device
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://patch.msgid.link/2076980.usQuhbGJ8B@rafael.j.wysocki
drivers/acpi/acpi_tad.c