[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1472589008-7713-2-git-send-email-wxt@rock-chips.com>
Date: Wed, 31 Aug 2016 04:30:04 +0800
From: Caesar Wang <wxt@...k-chips.com>
To: Heiko Stuebner <heiko@...ech.de>, netdev@...r.kernel.org
Cc: linux-rockchip@...ts.infradead.org,
Brian Norris <briannorris@...omium.org>,
Douglas Anderson <dianders@...omium.org>,
dbasehore@...omium.org, Roger Chen <roger.chen@...k-chips.com>,
Caesar Wang <wxt@...k-chips.com>,
Giuseppe Cavallaro <peppe.cavallaro@...com>,
Alexandre Torgue <alexandre.torgue@...com>,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/4] net: stmmac: dwmac-rk: fixes the gmac resume after PD on/off
From: Roger Chen <roger.chen@...k-chips.com>
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@...k-chips.com>
Signed-off-by: Caesar Wang <wxt@...k-chips.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index 9210591..ea0e493 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
@@ -629,6 +629,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");
@@ -641,15 +652,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;
--
1.9.1
Powered by blists - more mailing lists