From: Roger Chen Date: Mon, 11 Jul 2016 02:05:18 +0000 (+0800) Subject: net: stmmac: dwmac-rk: fix for GMAC resume after PD off/on X-Git-Tag: firefly_0821_release~2186 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5e313262445a599546749e796fa4fe0eb3c35b07;p=firefly-linux-kernel-4.4.55.git net: stmmac: dwmac-rk: fix for GMAC resume after PD off/on 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. Change-Id: I9ca541c4599299bad309b810994824d364c2a510 Signed-off-by: Roger Chen --- diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c index 4ce2ef1e5d49..4957618c3b80 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c @@ -852,6 +852,17 @@ 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_init(struct platform_device *pdev, void *priv) +{ + struct rk_priv_data *bsp_priv = priv; + int ret; + struct device *dev = &pdev->dev; + /*rmii or rgmii*/ if (bsp_priv->phy_iface == PHY_INTERFACE_MODE_RGMII) { dev_info(dev, "init for RGMII\n"); @@ -864,16 +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_init(struct platform_device *pdev, void *priv) -{ - struct rk_priv_data *bsp_priv = priv; - int ret; - ret = phy_power_on(bsp_priv, true); if (ret) return ret;