summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
diff options
context:
space:
mode:
authorRoger Chen <roger.chen@rock-chips.com>2016-09-02 01:50:00 +0800
committerDavid S. Miller <davem@davemloft.net>2016-09-02 17:08:56 -0700
commit45383f528fcf417539892440dd0eb9fb96990ef7 (patch)
tree65f315f48e3501a72af0e98e26fe7561385dd8f2 /drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
parentba289af8020a6e81eac424e1d4ef3fcc8ff1b23d (diff)
downloadlinux-stable-45383f528fcf417539892440dd0eb9fb96990ef7.tar.gz
linux-stable-45383f528fcf417539892440dd0eb9fb96990ef7.tar.bz2
linux-stable-45383f528fcf417539892440dd0eb9fb96990ef7.zip
net: stmmac: dwmac-rk: fixes the gmac resume after PD on/off
GMAC Power Domain(PD) will be disabled during suspend. That will causes GRF registers reset. So corresponding GRF registers for GMAC must be setup again. Signed-off-by: Roger Chen <roger.chen@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.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index 4e6a27088313..e2ba6c4619fd 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
@@ -853,6 +853,16 @@ static struct rk_priv_data *rk_gmac_setup(struct platform_device *pdev,
"rockchip,grf");
bsp_priv->pdev = pdev;
+ gmac_clk_init(bsp_priv);
+
+ return bsp_priv;
+}
+
+static int rk_gmac_powerup(struct rk_priv_data *bsp_priv)
+{
+ int ret;
+ struct device *dev = &bsp_priv->pdev->dev;
+
/*rmii or rgmii*/
if (bsp_priv->phy_iface == PHY_INTERFACE_MODE_RGMII) {
dev_info(dev, "init for RGMII\n");
@@ -865,15 +875,6 @@ static struct rk_priv_data *rk_gmac_setup(struct platform_device *pdev,
dev_err(dev, "NO interface defined!\n");
}
- gmac_clk_init(bsp_priv);
-
- return bsp_priv;
-}
-
-static int rk_gmac_powerup(struct rk_priv_data *bsp_priv)
-{
- int ret;
-
ret = phy_power_on(bsp_priv, true);
if (ret)
return ret;