Commit 96be41d7 authored by Samuel Holland's avatar Samuel Holland Committed by David S. Miller

net: stmmac: dwmac-sun8i: Add a shutdown callback

The Ethernet MAC and PHY are usually major consumers of power on boards
which may not be able to fully power off (those with no PMIC). Powering
down the MAC and internal PHY saves power while these boards are "off".
Reviewed-by: default avatarChen-Yu Tsai <wens@csie.org>
Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2743aa24
...@@ -1284,6 +1284,15 @@ static int sun8i_dwmac_remove(struct platform_device *pdev) ...@@ -1284,6 +1284,15 @@ static int sun8i_dwmac_remove(struct platform_device *pdev)
return 0; return 0;
} }
static void sun8i_dwmac_shutdown(struct platform_device *pdev)
{
struct net_device *ndev = platform_get_drvdata(pdev);
struct stmmac_priv *priv = netdev_priv(ndev);
struct sunxi_priv_data *gmac = priv->plat->bsp_priv;
sun8i_dwmac_exit(pdev, gmac);
}
static const struct of_device_id sun8i_dwmac_match[] = { static const struct of_device_id sun8i_dwmac_match[] = {
{ .compatible = "allwinner,sun8i-h3-emac", { .compatible = "allwinner,sun8i-h3-emac",
.data = &emac_variant_h3 }, .data = &emac_variant_h3 },
...@@ -1304,6 +1313,7 @@ MODULE_DEVICE_TABLE(of, sun8i_dwmac_match); ...@@ -1304,6 +1313,7 @@ MODULE_DEVICE_TABLE(of, sun8i_dwmac_match);
static struct platform_driver sun8i_dwmac_driver = { static struct platform_driver sun8i_dwmac_driver = {
.probe = sun8i_dwmac_probe, .probe = sun8i_dwmac_probe,
.remove = sun8i_dwmac_remove, .remove = sun8i_dwmac_remove,
.shutdown = sun8i_dwmac_shutdown,
.driver = { .driver = {
.name = "dwmac-sun8i", .name = "dwmac-sun8i",
.pm = &stmmac_pltfr_pm_ops, .pm = &stmmac_pltfr_pm_ops,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment