diff mbox series

[RFC,WIP,2/2] net: stmmac: dwmac-rk: add support for PHY wake on LAN

Message ID 20231123-dwmac-rk_phy_wol-v1-2-bf4e718081b9@wolfvision.net (mailing list archive)
State New, archived
Headers show
Series net: stmmac: dwmac-rk: add support for PHY wake on LAN | expand

Commit Message

Javier Carrasco Nov. 23, 2023, 12:14 p.m. UTC
PHY WOL will be used if the rockhip,phy-wol property is defined. MAC WOL
will be preferred otherwise.

Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index 382e8de1255d..c543566b4f90 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
@@ -1694,6 +1694,11 @@  static struct rk_priv_data *rk_gmac_setup(struct platform_device *pdev,
 	dev_info(dev, "integrated PHY? (%s).\n",
 		 bsp_priv->integrated_phy ? "yes" : "no");
 
+	if (of_property_read_bool(dev->of_node, "rockchip,phy-wol"))
+		plat->flags |= STMMAC_FLAG_USE_PHY_WOL;
+	else
+		plat->flags &= ~STMMAC_FLAG_USE_PHY_WOL;
+
 	bsp_priv->pdev = pdev;
 
 	return bsp_priv;