Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1473049 > unrolled thread

[RESEND PATCH 2/4] net: stmmac: dwmac-rk: add pd_gmac support for rk3399

Started byCaesar Wang <wxt@rock-chips.com>
First post2016-08-31 08:20 +0200
Last post2016-08-31 08:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [RESEND PATCH 2/4] net: stmmac: dwmac-rk: add pd_gmac support for rk3399 Caesar Wang <wxt@rock-chips.com> - 2016-08-31 08:20 +0200

#1473049 — [RESEND PATCH 2/4] net: stmmac: dwmac-rk: add pd_gmac support for rk3399

FromCaesar Wang <wxt@rock-chips.com>
Date2016-08-31 08:20 +0200
Subject[RESEND PATCH 2/4] net: stmmac: dwmac-rk: add pd_gmac support for rk3399
Message-ID<sc72p-7cd-9@gated-at.bofh.it>
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 | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index 289e7a6..406573d 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"
 
@@ -659,11 +660,19 @@ static int rk_gmac_powerup(struct rk_priv_data *bsp_priv)
 	if (ret)
 		return ret;
 
+	pm_runtime_enable(dev);
+	pm_runtime_get_sync(dev);
+
 	return 0;
 }
 
 static void rk_gmac_powerdown(struct rk_priv_data *gmac)
 {
+	struct device *dev = &gmac->pdev->dev;
+
+	pm_runtime_put_sync(dev);
+	pm_runtime_disable(dev);
+
 	phy_power_on(gmac, false);
 	gmac_clk_enable(gmac, false);
 }
-- 
1.9.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web