All of lore.kernel.org
 help / color / mirror / Atom feed
From: <Tristram.Ha@microchip.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: Tristram Ha <Tristram.Ha@microchip.com>, <netdev@vger.kernel.org>,
	<UNGLinuxDriver@microchip.com>
Subject: [PATCH net-next 2/2] net: phy: smsc: add EEE support to LAN8740/LAN8742 PHYs.
Date: Sat, 2 Jul 2022 15:58:28 -0700	[thread overview]
Message-ID: <1656802708-7918-3-git-send-email-Tristram.Ha@microchip.com> (raw)
In-Reply-To: <1656802708-7918-1-git-send-email-Tristram.Ha@microchip.com>

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(+)

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
-- 
1.9.1


  parent reply	other threads:[~2022-07-02 22:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-02 22:58 [PATCH net-next 0/2] net: phy: smsc: add WoL and EEE support to LAN8740/LAN8742 Tristram.Ha
2022-07-02 22:58 ` [PATCH net-next 1/2] net: phy: smsc: add WoL support to LAN8740/LAN8742 PHYs Tristram.Ha
2022-07-03 16:38   ` Andrew Lunn
2022-07-02 22:58 ` Tristram.Ha [this message]
2022-07-03 16:43   ` [PATCH net-next 2/2] net: phy: smsc: add EEE " Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1656802708-7918-3-git-send-email-Tristram.Ha@microchip.com \
    --to=tristram.ha@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.