[PATCH net-next v2 5/8] net: phy: at803x: Indicate SmartEEE support for AR8035 and AR8031 PHYs

From: Oleksij Rempel
Date: Mon Mar 27 2023 - 10:24:19 EST


This commit adds SmartEEE support indication for the AR8035 and AR8031
PHYs in the at803x driver. These PHYs support the SmartEEE
functionality, which is a Low Power Idle (LPI) implementation on the PHY
side, typically handled by the MAC.

By indicating SmartEEE support for these PHYs, the at803x driver and the
PHYlib framework can provide proper configuration and management of EEE
and LPI features. This allows for improved power management and energy
efficiency in devices using AR8035 and AR8031 PHYs.

Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
---
drivers/net/phy/at803x.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
index 656136628ffd..653d27a2e62b 100644
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
@@ -856,6 +856,12 @@ static int at803x_probe(struct phy_device *phydev)
if (ret)
return ret;

+ if (phydev->drv->phy_id == ATH8035_PHY_ID ||
+ phydev->drv->phy_id == ATH8031_PHY_ID) {
+ if (!(priv->flags & AT803X_DISABLE_SMARTEEE))
+ phydev->is_smart_eee_phy = true;
+ }
+
if (priv->vddio) {
ret = regulator_enable(priv->vddio);
if (ret < 0)
--
2.30.2