Commit 73654945 authored by Marco Felsch's avatar Marco Felsch Committed by David S. Miller

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: default avatarMarco Felsch <m.felsch@pengutronix.de>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 74c654a8
...@@ -48,10 +48,17 @@ struct smsc_phy_priv { ...@@ -48,10 +48,17 @@ struct smsc_phy_priv {
static int smsc_phy_config_intr(struct phy_device *phydev) static int smsc_phy_config_intr(struct phy_device *phydev)
{ {
int rc = phy_write (phydev, MII_LAN83C185_IM, struct smsc_phy_priv *priv = phydev->priv;
((PHY_INTERRUPT_ENABLED == phydev->interrupts) u16 intmask = 0;
? MII_LAN83C185_ISF_INT_PHYLIB_EVENTS int rc;
: 0));
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; return rc < 0 ? rc : 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment