Message ID | 1656802708-7918-3-git-send-email-Tristram.Ha@microchip.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: phy: smsc: add WoL and EEE support to LAN8740/LAN8742 | expand |
On Sat, Jul 02, 2022 at 03:58:28PM -0700, Tristram.Ha@microchip.com wrote: > From: Tristram Ha <Tristram.Ha@microchip.com> > > EEE feature is enabled in LAN8740/LAN8742 during initialization. EEE is auto-negotiated. Are you enabling the negotiation of it? Andrew
diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c index 5b77f0c..7d485bc 100644 --- a/drivers/net/phy/smsc.c +++ b/drivers/net/phy/smsc.c @@ -272,6 +272,11 @@ static int lan874x_phy_config_init(struct phy_device *phydev) if (rc < 0) return rc; + /* enable EEE */ + val = phy_read(phydev, MII_LAN874X_PHY_EEE_CFG); + val |= MII_LAN874X_PHY_PHYEEEEN; + phy_write(phydev, MII_LAN874X_PHY_EEE_CFG, val); + return smsc_phy_config_init(phydev); } diff --git a/include/linux/smscphy.h b/include/linux/smscphy.h index f5e123b..645b0f4 100644 --- a/include/linux/smscphy.h +++ b/include/linux/smscphy.h @@ -28,6 +28,9 @@ #define MII_LAN83C185_MODE_POWERDOWN 0xC0 /* Power Down mode */ #define MII_LAN83C185_MODE_ALL 0xE0 /* All capable mode */ +#define MII_LAN874X_PHY_EEE_CFG 16 +#define MII_LAN874X_PHY_PHYEEEEN BIT(2) + #define MII_LAN874X_PHY_MMD_WOL_WUCSR 0x8010 #define MII_LAN874X_PHY_MMD_WOL_WUF_CFGA 0x8011 #define MII_LAN874X_PHY_MMD_WOL_WUF_CFGB 0x8012