summaryrefslogtreecommitdiff
path: root/drivers/net/phy
diff options
context:
space:
mode:
authorMarco Felsch <m.felsch@pengutronix.de>2020-09-09 15:44:57 +0200
committerDavid S. Miller <davem@davemloft.net>2020-09-09 14:15:02 -0700
commit7365494550f6e96b8e444201bf5fdaec40e7e007 (patch)
treef5b118f8e002fc728b36574fe44b38475f16d2e5 /drivers/net/phy
parent74c654a852fe94f7d5ea5ebc49f2ce6fd1a551e6 (diff)
net: phy: smsc: skip ENERGYON interrupt if disabled
Don't enable the interrupt if the platform disable the energy detection by "smsc,disable-energy-detect". Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r--drivers/net/phy/smsc.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
index 638e8c3d1f4a..19ab2821cff0 100644
--- a/drivers/net/phy/smsc.c
+++ b/drivers/net/phy/smsc.c
@@ -48,10 +48,17 @@ struct smsc_phy_priv {
static int smsc_phy_config_intr(struct phy_device *phydev)
{
- int rc = phy_write (phydev, MII_LAN83C185_IM,
- ((PHY_INTERRUPT_ENABLED == phydev->interrupts)
- ? MII_LAN83C185_ISF_INT_PHYLIB_EVENTS
- : 0));
+ struct smsc_phy_priv *priv = phydev->priv;
+ u16 intmask = 0;
+ int rc;
+
+ if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
+ intmask = MII_LAN83C185_ISF_INT4 | MII_LAN83C185_ISF_INT6;
+ if (priv->energy_enable)
+ intmask |= MII_LAN83C185_ISF_INT7;
+ }
+
+ rc = phy_write(phydev, MII_LAN83C185_IM, intmask);
return rc < 0 ? rc : 0;
}