Skip to content

Commit 2c896fb

Browse files
SuperDavidWudavem330
authored andcommitted
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>
1 parent 45383f5 commit 2c896fb

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <linux/delay.h>
3131
#include <linux/mfd/syscon.h>
3232
#include <linux/regmap.h>
33+
#include <linux/pm_runtime.h>
3334

3435
#include "stmmac_platform.h"
3536

@@ -883,11 +884,19 @@ static int rk_gmac_powerup(struct rk_priv_data *bsp_priv)
883884
if (ret)
884885
return ret;
885886

887+
pm_runtime_enable(dev);
888+
pm_runtime_get_sync(dev);
889+
886890
return 0;
887891
}
888892

889893
static void rk_gmac_powerdown(struct rk_priv_data *gmac)
890894
{
895+
struct device *dev = &gmac->pdev->dev;
896+
897+
pm_runtime_put_sync(dev);
898+
pm_runtime_disable(dev);
899+
891900
phy_power_on(gmac, false);
892901
gmac_clk_enable(gmac, false);
893902
}

0 commit comments

Comments
 (0)