From: Igor Velkov via B4 Relay <devnull+iav.iav.lv@kernel.org>
To: John Stultz <jstultz@google.com>,
Thomas Gleixner <tglx@kernel.org>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Kevin Hilman <khilman@baylibre.com>
Cc: Stephen Boyd <sboyd@kernel.org>,
Miroslav Lichvar <mlichvar@redhat.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
linux-rtc@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org,
Igor Velkov <iav@iav.lv>
Subject: [PATCH RFC 1/3] dt-bindings: rtc: Add linux,wakeup-states and linux,alarmtimer-priority
Date: Wed, 04 Nov 2026 05:54:37 +0000 [thread overview]
Message-ID: <20261104-b4-alarmtimer-rtc-priority-v1-1-e996681b8086@iav.lv> (raw)
In-Reply-To: <20261104-b4-alarmtimer-rtc-priority-v1-0-e996681b8086@iav.lv>
From: Igor Velkov <iav@iav.lv>
A board can have more than one RTC with an alarm that wakes the system,
for example an I2C RTC next to an RTC in the PMIC or the SoC firmware.
Which of them wakes the system depends on the sleep state and on the
board's firmware: amlogic,meson-vrtc is a register the firmware reads
when the application processors suspend, so it wakes the system from
deep sleep only, and whether an I2C RTC wakes the system from deep
sleep depends on the firmware handling its interrupt line.
Add two properties to describe this per RTC. linux,wakeup-states lists
the sleep states an alarm of the RTC wakes the system from, named as in
/sys/power/mem_sleep, plus hibernate and off, or none for an RTC whose
alarm wakes the system from no state. linux,alarmtimer-priority weights
the RTC among those that wake the system from the target state.
List both in nxp,pcf8563.yaml and amlogic,meson-vrtc.yaml, which do not
allow unlisted properties.
Signed-off-by: Igor Velkov <iav@iav.lv>
---
.../bindings/rtc/amlogic,meson-vrtc.yaml | 3 +++
.../devicetree/bindings/rtc/nxp,pcf8563.yaml | 3 +++
Documentation/devicetree/bindings/rtc/rtc.yaml | 29 ++++++++++++++++++++++
3 files changed, 35 insertions(+)
diff --git a/Documentation/devicetree/bindings/rtc/amlogic,meson-vrtc.yaml b/Documentation/devicetree/bindings/rtc/amlogic,meson-vrtc.yaml
index a89865fa676a..bc4a1916f600 100644
--- a/Documentation/devicetree/bindings/rtc/amlogic,meson-vrtc.yaml
+++ b/Documentation/devicetree/bindings/rtc/amlogic,meson-vrtc.yaml
@@ -30,6 +30,9 @@ properties:
reg:
maxItems: 1
+ linux,alarmtimer-priority: true
+ linux,wakeup-states: true
+
required:
- compatible
- reg
diff --git a/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml b/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
index 22909a96123e..5aabeb074c82 100644
--- a/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
+++ b/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
@@ -32,6 +32,9 @@ properties:
interrupts:
maxItems: 1
+ linux,alarmtimer-priority: true
+ linux,wakeup-states: true
+
start-year: true
wakeup-source: true
diff --git a/Documentation/devicetree/bindings/rtc/rtc.yaml b/Documentation/devicetree/bindings/rtc/rtc.yaml
index efb66df82782..3b4b8ff90ada 100644
--- a/Documentation/devicetree/bindings/rtc/rtc.yaml
+++ b/Documentation/devicetree/bindings/rtc/rtc.yaml
@@ -26,6 +26,35 @@ properties:
0: not chargeable
1: chargeable
+ linux,alarmtimer-priority:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description:
+ Weight of this RTC for waking the system on alarmtimer alarms.
+ Among the RTCs that can wake the system from the target sleep
+ state, the one with the highest value is used; on a tie, the
+ operating system decides. An RTC without this property has
+ priority 0.
+
+ linux,wakeup-states:
+ $ref: /schemas/types.yaml#/definitions/string-array
+ description:
+ System sleep states an alarm of this RTC wakes the system from,
+ given the board and its firmware. s2idle, shallow and deep are the
+ states of /sys/power/mem_sleep, hibernate is suspend-to-disk and
+ off is the powered-off system, and none, given alone, means the
+ alarm wakes the system from no state. An RTC without this property
+ is taken to wake the system from every state.
+ oneOf:
+ - items:
+ enum:
+ - s2idle
+ - shallow
+ - deep
+ - hibernate
+ - "off"
+ - items:
+ - const: none
+
quartz-load-femtofarads:
description:
The capacitive load of the quartz(x-tal), expressed in femto
--
2.43.0
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2026-11-04 5:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 5:54 [PATCH RFC 0/3] alarmtimer: Choose the wakeup RTC per sleep state from the device tree Igor Velkov via B4 Relay
2026-11-04 5:54 ` Igor Velkov via B4 Relay [this message]
2026-11-04 6:06 ` [PATCH RFC 1/3] dt-bindings: rtc: Add linux,wakeup-states and linux,alarmtimer-priority sashiko-bot
2026-11-04 5:54 ` [PATCH RFC 2/3] alarmtimer: Choose the wakeup RTC by sleep state and priority Igor Velkov via B4 Relay
2026-11-04 5:54 ` [PATCH RFC 3/3] arm64: dts: amlogic: meson-sm1-odroid-hc4: Describe which RTC wakes the board Igor Velkov via B4 Relay
2026-11-04 8:50 ` [PATCH RFC 0/3] alarmtimer: Choose the wakeup RTC per sleep state from the device tree Neil Armstrong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261104-b4-alarmtimer-rtc-priority-v1-1-e996681b8086@iav.lv \
--to=devnull+iav.iav.lv@kernel.org \
--cc=alexandre.belloni@bootlin.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=iav@iav.lv \
--cc=jbrunet@baylibre.com \
--cc=jstultz@google.com \
--cc=khilman@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=mlichvar@redhat.com \
--cc=neil.armstrong@linaro.org \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=tglx@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®