From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, linux-can@vger.kernel.org,
kernel@pengutronix.de, Bich HEMON <bich.hemon@st.com>,
Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH 6/6] can: m_can: select pinctrl state in each suspend/resume function
Date: Mon, 12 Mar 2018 11:04:10 +0100 [thread overview]
Message-ID: <20180312100410.10404-7-mkl@pengutronix.de> (raw)
In-Reply-To: <20180312100410.10404-1-mkl@pengutronix.de>
From: Bich HEMON <bich.hemon@st.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@st.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.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;
--
2.16.1
next prev parent reply other threads:[~2018-03-12 10:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-12 10:04 pull-request: can 2018-03-12 Marc Kleine-Budde
2018-03-12 10:04 ` [PATCH 1/6] can: m_can: change comparison to bitshift when dealing with a mask Marc Kleine-Budde
2018-03-12 10:04 ` [PATCH 2/6] can: ifi: Check core revision upon probe Marc Kleine-Budde
2018-03-12 10:04 ` [PATCH 3/6] can: ifi: Repair the error handling Marc Kleine-Budde
2018-03-12 10:04 ` [PATCH 4/6] can: peak/pcie_fd: fix echo_skb is occupied! bug Marc Kleine-Budde
2018-03-12 10:04 ` [PATCH 5/6] can: peak/pcie_fd: remove useless code when interface starts Marc Kleine-Budde
2018-03-12 10:04 ` Marc Kleine-Budde [this message]
2018-03-12 10:30 ` [PATCH 6/6] can: m_can: select pinctrl state in each suspend/resume function Bich HEMON
2018-03-12 15:17 ` pull-request: can 2018-03-12 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180312100410.10404-7-mkl@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=bich.hemon@st.com \
--cc=davem@davemloft.net \
--cc=kernel@pengutronix.de \
--cc=linux-can@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).