From: Caesar Wang <wxt@rock-chips.com>
To: Heiko Stuebner <heiko@sntech.de>, netdev@vger.kernel.org
Cc: linux-rockchip@lists.infradead.org,
Brian Norris <briannorris@chromium.org>,
Douglas Anderson <dianders@chromium.org>,
dbasehore@chromium.org, David Wu <david.wu@rock-chips.com>,
Caesar Wang <wxt@rock-chips.com>,
Giuseppe Cavallaro <peppe.cavallaro@st.com>,
Alexandre Torgue <alexandre.torgue@st.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/4] net: stmmac: dwmac-rk: add pd_gmac support for rk3399
Date: Wed, 31 Aug 2016 04:30:05 +0800 [thread overview]
Message-ID: <1472589008-7713-3-git-send-email-wxt@rock-chips.com> (raw)
In-Reply-To: <1472589008-7713-1-git-send-email-wxt@rock-chips.com>
From: David Wu <david.wu@rock-chips.com>
Add the gmac power domain support for rk3399, in order to save more
power consumption.
Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index ea0e493..71a1ca5 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
@@ -30,6 +30,7 @@
#include <linux/delay.h>
#include <linux/mfd/syscon.h>
#include <linux/regmap.h>
+#include <linux/pm_runtime.h>
#include "stmmac_platform.h"
@@ -660,11 +661,17 @@ static int rk_gmac_init(struct platform_device *pdev, void *priv)
if (ret)
return ret;
+ pm_runtime_enable(&pdev->dev);
+ pm_runtime_get_sync(&pdev->dev);
+
return 0;
}
static void rk_gmac_powerdown(struct rk_priv_data *gmac)
{
+ pm_runtime_put_sync(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
+
phy_power_on(gmac, false);
gmac_clk_enable(gmac, false);
}
--
1.9.1
next prev parent reply other threads:[~2016-08-30 20:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-30 20:30 [PATCH 0/4] Support the rk3399 gmac pd function Caesar Wang
2016-08-30 20:30 ` [PATCH 1/4] net: stmmac: dwmac-rk: fixes the gmac resume after PD on/off Caesar Wang
2016-08-30 20:30 ` Caesar Wang [this message]
2016-08-30 21:07 ` [PATCH 2/4] net: stmmac: dwmac-rk: add pd_gmac support for rk3399 kbuild test robot
2016-08-30 20:30 ` [PATCH 3/4] arm64: dts: rockchip: support gmac " Caesar Wang
2016-08-30 22:07 ` Heiko Stübner
2016-08-30 20:30 ` [PATCH 4/4] arm64: dts: rockchip: enable the gmac for rk3399 evb board Caesar Wang
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=1472589008-7713-3-git-send-email-wxt@rock-chips.com \
--to=wxt@rock-chips.com \
--cc=alexandre.torgue@st.com \
--cc=briannorris@chromium.org \
--cc=david.wu@rock-chips.com \
--cc=dbasehore@chromium.org \
--cc=dianders@chromium.org \
--cc=heiko@sntech.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=netdev@vger.kernel.org \
--cc=peppe.cavallaro@st.com \
/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
Powered by JetHome