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


Groups > linux.kernel > #1473969

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

From Caesar Wang <wxt@rock-chips.com>
Newsgroups linux.kernel
Subject [PATCH v3 2/5] net: stmmac: dwmac-rk: add pd_gmac support for rk3399
Date 2016-09-01 01:40 +0200
Message-ID <scngR-sq-5@gated-at.bofh.it> (permalink)
References <scn7c-pj-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---

Changes in v3: None
Changes in v2:
- fixes the build error on next kernel.

 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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/5] Support the rk3399 gmac pd function Caesar Wang <wxt@rock-chips.com> - 2016-09-01 01:30 +0200
  [PATCH v3 1/5] net: stmmac: dwmac-rk: fixes the gmac resume after PD on/off Caesar Wang <wxt@rock-chips.com> - 2016-09-01 01:30 +0200
  [PATCH v3 3/5] arm64: dts: rockchip: add the gmac power domain on rk3399 Caesar Wang <wxt@rock-chips.com> - 2016-09-01 01:30 +0200
    Re: [PATCH v3 3/5] arm64: dts: rockchip: add the gmac power domain on rk3399 Heiko Stübner <heiko@sntech.de> - 2016-09-01 14:30 +0200
  [PATCH v3 2/5] net: stmmac: dwmac-rk: add pd_gmac support for rk3399 Caesar Wang <wxt@rock-chips.com> - 2016-09-01 01:40 +0200
  [PATCH v3 4/5] arm64: dts: rockchip: add the gmac needed node for rk3399 Caesar Wang <wxt@rock-chips.com> - 2016-09-01 01:40 +0200
    Re: [PATCH v3 4/5] arm64: dts: rockchip: add the gmac needed node for rk3399 Heiko Stübner <heiko@sntech.de> - 2016-09-01 14:30 +0200
  [PATCH v3 5/5] arm64: dts: rockchip: enable the gmac for rk3399 evb board Caesar Wang <wxt@rock-chips.com> - 2016-09-01 01:40 +0200

csiph-web