You need to sign in or sign up before continuing.
提交 26a2ad8a 编写于 作者: S Sean Wang 提交者: David S. Miller

net: ethernet: mediatek: add controlling power domain the ethernet belongs to

introduce power domain control which the digital circuit of
the ethernet belongs to inside the flow of hardware initialization
and deinitialization which helps the entire ethernet hardware block
could restart cleanly and completely as being back to the initial
state when the whole machine reboot.
Signed-off-by: NSean Wang <sean.wang@mediatek.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 8a8a9e89
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <linux/mfd/syscon.h> #include <linux/mfd/syscon.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/pm_runtime.h>
#include <linux/if_vlan.h> #include <linux/if_vlan.h>
#include <linux/reset.h> #include <linux/reset.h>
#include <linux/tcp.h> #include <linux/tcp.h>
...@@ -1417,6 +1418,9 @@ static int __init mtk_hw_init(struct mtk_eth *eth) ...@@ -1417,6 +1418,9 @@ static int __init mtk_hw_init(struct mtk_eth *eth)
{ {
int i; int i;
pm_runtime_enable(eth->dev);
pm_runtime_get_sync(eth->dev);
clk_prepare_enable(eth->clks[MTK_CLK_ETHIF]); clk_prepare_enable(eth->clks[MTK_CLK_ETHIF]);
clk_prepare_enable(eth->clks[MTK_CLK_ESW]); clk_prepare_enable(eth->clks[MTK_CLK_ESW]);
clk_prepare_enable(eth->clks[MTK_CLK_GP1]); clk_prepare_enable(eth->clks[MTK_CLK_GP1]);
...@@ -1484,6 +1488,9 @@ static int mtk_hw_deinit(struct mtk_eth *eth) ...@@ -1484,6 +1488,9 @@ static int mtk_hw_deinit(struct mtk_eth *eth)
clk_disable_unprepare(eth->clks[MTK_CLK_ESW]); clk_disable_unprepare(eth->clks[MTK_CLK_ESW]);
clk_disable_unprepare(eth->clks[MTK_CLK_ETHIF]); clk_disable_unprepare(eth->clks[MTK_CLK_ETHIF]);
pm_runtime_put_sync(eth->dev);
pm_runtime_disable(eth->dev);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册