can: flexcan: add support for DT property 'wakeup-source'
authorSean Nyekjaer <sean@geanix.com>
Tue, 9 Apr 2019 08:39:48 +0000 (10:39 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 24 Jul 2019 08:31:55 +0000 (10:31 +0200)
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>
drivers/net/can/flexcan.c

index bcc39512f3422ebb336314f20b66b2f2b04e3908..09d8e623dcf637e25ccded9566133c31d7ceef26 100644 (file)
@@ -1473,6 +1473,9 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev)
 
        device_set_wakeup_capable(&pdev->dev, true);
 
+       if (of_property_read_bool(np, "wakeup-source"))
+               device_set_wakeup_enable(&pdev->dev, true);
+
        return 0;
 }