diff options
author | David Wu <david.wu@rock-chips.com> | 2016-09-02 01:50:01 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-09-02 17:08:57 -0700 |
commit | 2c896fb02e7f65299646f295a007bda043e0f382 (patch) | |
tree | 1b7aea076c2be9e8bf4ea0392c295e2a878b8626 /drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | |
parent | 45383f528fcf417539892440dd0eb9fb96990ef7 (diff) | |
download | linux-2c896fb02e7f65299646f295a007bda043e0f382.tar.bz2 |
net: stmmac: dwmac-rk: add pd_gmac support for rk3399
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c index e2ba6c4619fd..3740a4417fa0 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" @@ -883,11 +884,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); } |