diff mbox series

[1/2] can: flexcan: add support for DT property 'wakeup-source'

Message ID 20190409083949.27917-1-sean@geanix.com
State Awaiting Upstream
Delegated to: David Miller
Headers show
Series [1/2] can: flexcan: add support for DT property 'wakeup-source' | expand

Commit Message

Sean Nyekjaer April 9, 2019, 8:39 a.m. UTC
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>
---
 drivers/net/can/flexcan.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Sean Nyekjaer June 8, 2019, 5:36 p.m. UTC | #1
kind ping :-)

On 09/04/2019 10.39, Sean Nyekjaer wrote:
> 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>
> ---
>   drivers/net/can/flexcan.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
> index c46e6ce22701..df3d2abd98e4 100644
> --- a/drivers/net/can/flexcan.c
> +++ b/drivers/net/can/flexcan.c
> @@ -1373,6 +1373,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;
>   }
>   
>
diff mbox series

Patch

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index c46e6ce22701..df3d2abd98e4 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -1373,6 +1373,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;
 }