[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7d0f8382-a23c-d298-6d0f-82b561af2eac@st.com>
Date: Mon, 12 Mar 2018 10:30:24 +0000
From: Bich HEMON <bich.hemon@...com>
To: Marc Kleine-Budde <mkl@...gutronix.de>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC: "davem@...emloft.net" <davem@...emloft.net>,
"linux-can@...r.kernel.org" <linux-can@...r.kernel.org>,
"kernel@...gutronix.de" <kernel@...gutronix.de>
Subject: Re: [PATCH 6/6] can: m_can: select pinctrl state in each
suspend/resume function
Hi Mark,
Thanks for the fix.
On 03/12/2018 11:04 AM, Marc Kleine-Budde wrote:
> From: Bich HEMON <bich.hemon@...com>
>
> Make sure to apply the correct pin state in suspend/resume callbacks.
> Putting pins in sleep state saves power.
>
> Signed-off-by: Bich Hemon <bich.hemon@...com>
> Signed-off-by: Marc Kleine-Budde <mkl@...gutronix.de>
> ---
> drivers/net/can/m_can/m_can.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
> index 74170b0d23cf..b397a33f3d32 100644
> --- a/drivers/net/can/m_can/m_can.c
> +++ b/drivers/net/can/m_can/m_can.c
> @@ -26,6 +26,7 @@
> #include <linux/pm_runtime.h>
> #include <linux/iopoll.h>
> #include <linux/can/dev.h>
> +#include <linux/pinctrl/consumer.h>
>
> /* napi related */
> #define M_CAN_NAPI_WEIGHT 64
> @@ -1700,6 +1701,8 @@ static __maybe_unused int m_can_suspend(struct device *dev)
> m_can_clk_stop(priv);
> }
>
> + pinctrl_pm_select_sleep_state(dev);
> +
> priv->can.state = CAN_STATE_SLEEPING;
>
> return 0;
> @@ -1710,6 +1713,8 @@ static __maybe_unused int m_can_resume(struct device *dev)
> struct net_device *ndev = dev_get_drvdata(dev);
> struct m_can_priv *priv = netdev_priv(ndev);
>
> + pinctrl_pm_select_default_state(dev);
> +
> m_can_init_ram(priv);
>
> priv->can.state = CAN_STATE_ERROR_ACTIVE;
>
Acked-by: Bich Hemon <bich.hemon@...com>
Powered by blists - more mailing lists