From: Sean Nyekjaer <sean@geanix.com>
Date: Tue, 9 Apr 2019 10:39:48 +0200
Subject: can: flexcan: add support for DT property 'wakeup-source'
Git-commit: 915f9666421cf65cc30668fd42760b6f78f9744d
Patch-mainline: v5.4-rc1
References: jsc#SLE-12251
The flexcan controller can be forced as a wakeup source by
stating that explicitly in the device's .dts file using the
"wakeup-source" boolean property.
Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Mian Yousaf Kaukab <ykaukab@suse.de>
---
drivers/net/can/flexcan.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -1491,6 +1491,11 @@ static int flexcan_setup_stop_mode(struc
device_set_wakeup_capable(&pdev->dev, true);
+ if (of_property_read_bool(np, "wakeup-source"))
+ device_set_wakeup_enable(&pdev->dev, true);
+
+ return 0;
+
out_put_node:
of_node_put(gpr_np);
return ret;