Thread (66 messages) 66 messages, 13 authors, 2016-01-29

[PATCH 03/19] rtc: opal: enable support for the stardard "wakeup-source" property

STALE3901d

From: Sudeep Holla <hidden>
Date: 2015-10-21 10:10:47
Also in: linux-devicetree, linux-rtc, lkml
Subsystem: linux for powerpc (32-bit and 64-bit), real time clock (rtc) subsystem, the rest · Maintainers: Madhavan Srinivasan, Alexandre Belloni, Linus Torvalds

Though the opal rtc driver should and will continue to support the legacy
"has-tpo" property to enable RTC as the wakeup source, we need to add
support for the new standard property "wakeup-source"

This patch adds support for "wakeup-source" property in addition to the
existing "has-tpo" property.

Cc: Alessandro Zummo <redacted>
Cc: Alexandre Belloni <redacted>
Cc: rtc-linux at googlegroups.com
Signed-off-by: Sudeep Holla <redacted>
---
 drivers/rtc/rtc-opal.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-opal.c b/drivers/rtc/rtc-opal.c
index 6fbf9e617151..4087d53ecd73 100644
--- a/drivers/rtc/rtc-opal.c
+++ b/drivers/rtc/rtc-opal.c
@@ -199,8 +199,9 @@ static int opal_rtc_probe(struct platform_device *pdev)
 {
 	struct rtc_device *rtc;
 
-	if (pdev->dev.of_node && of_get_property(pdev->dev.of_node, "has-tpo",
-						 NULL)) {
+	if (pdev->dev.of_node &&
+	    (of_property_read_bool(pdev->dev.of_node, "wakeup-source") ||
+	     of_property_read_bool(pdev->dev.of_node, "has-tpo")/* legacy */)) {
 		device_set_wakeup_capable(&pdev->dev, true);
 		opal_rtc_ops.read_alarm	= opal_get_tpo_time;
 		opal_rtc_ops.set_alarm = opal_set_tpo_time;
-- 
1.9.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help