diff mbox series

[net-next,2/2] net: phy: smsc: add EEE support to LAN8740/LAN8742 PHYs.

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

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next, async
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 3 this patch: 3
netdev/cc_maintainers warning 6 maintainers not CCed: linux@armlinux.org.uk hkallweit1@gmail.com pabeni@redhat.com kuba@kernel.org edumazet@google.com andrew@lunn.ch
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 3 this patch: 3
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 20 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Tristram.Ha@microchip.com July 2, 2022, 10:58 p.m. UTC
From: Tristram Ha <Tristram.Ha@microchip.com>

EEE feature is enabled in LAN8740/LAN8742 during initialization.

Signed-off-by: Tristram Ha <Tristram.Ha@microchip.com>
---
 drivers/net/phy/smsc.c  | 5 +++++
 include/linux/smscphy.h | 3 +++
 2 files changed, 8 insertions(+)

Comments

Andrew Lunn July 3, 2022, 4:43 p.m. UTC | #1
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 mbox series

Patch

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