[PATCH net-next v2 2/4] net: stmmac: stm32: add WoL from PHY support
Gatien Chevallier
gatien.chevallier at foss.st.com
Wed Sep 17 08:36:37 PDT 2025
If the "st,phy-wol" property is present in the device tree node,
set the STMMAC_FLAG_USE_PHY_WOL flag to use the WoL capability of
the PHY.
Signed-off-by: Gatien Chevallier <gatien.chevallier at foss.st.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
index 77a04c4579c9dbae886a0b387f69610a932b7b9e..6f197789cc2e8018d6959158b795e4bca46869c5 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
@@ -106,6 +106,7 @@ struct stm32_dwmac {
u32 speed;
const struct stm32_ops *ops;
struct device *dev;
+ bool phy_wol;
};
struct stm32_ops {
@@ -433,6 +434,8 @@ static int stm32_dwmac_parse_data(struct stm32_dwmac *dwmac,
}
}
+ dwmac->phy_wol = of_property_read_bool(np, "st,phy-wol");
+
return err;
}
@@ -557,6 +560,8 @@ static int stm32_dwmac_probe(struct platform_device *pdev)
plat_dat->bsp_priv = dwmac;
plat_dat->suspend = stm32_dwmac_suspend;
plat_dat->resume = stm32_dwmac_resume;
+ if (dwmac->phy_wol)
+ plat_dat->flags |= STMMAC_FLAG_USE_PHY_WOL;
ret = stm32_dwmac_init(plat_dat);
if (ret)
--
2.35.3
More information about the linux-arm-kernel
mailing list