Skip to content

Commit dd9a122

Browse files
Esben Haabendaldavem330
authored andcommitted
net: phy: marvell: Enable interrupt function on LED2 pin
The LED2[2]/INTn pin on Marvell 88E1318S as well as 88E1510/12/14/18 needs to be configured to be usable as interrupt not only when WOL is enabled, but whenever we rely on interrupts from the PHY. Signed-off-by: Esben Haabendal <[email protected]> Cc: Rasmus Villemoes <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent eb19248 commit dd9a122

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

drivers/net/phy/marvell.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,22 @@ static int m88e1121_config_init(struct phy_device *phydev)
828828
return marvell_config_init(phydev);
829829
}
830830

831+
static int m88e1318_config_init(struct phy_device *phydev)
832+
{
833+
if (phy_interrupt_is_valid(phydev)) {
834+
int err = phy_modify_paged(
835+
phydev, MII_MARVELL_LED_PAGE,
836+
MII_88E1318S_PHY_LED_TCR,
837+
MII_88E1318S_PHY_LED_TCR_FORCE_INT,
838+
MII_88E1318S_PHY_LED_TCR_INTn_ENABLE |
839+
MII_88E1318S_PHY_LED_TCR_INT_ACTIVE_LOW);
840+
if (err < 0)
841+
return err;
842+
}
843+
844+
return m88e1121_config_init(phydev);
845+
}
846+
831847
static int m88e1510_config_init(struct phy_device *phydev)
832848
{
833849
int err;
@@ -870,7 +886,7 @@ static int m88e1510_config_init(struct phy_device *phydev)
870886
phydev->advertising &= ~pause;
871887
}
872888

873-
return m88e1121_config_init(phydev);
889+
return m88e1318_config_init(phydev);
874890
}
875891

876892
static int m88e1118_config_aneg(struct phy_device *phydev)
@@ -2086,7 +2102,7 @@ static struct phy_driver marvell_drivers[] = {
20862102
.features = PHY_GBIT_FEATURES,
20872103
.flags = PHY_HAS_INTERRUPT,
20882104
.probe = marvell_probe,
2089-
.config_init = &m88e1121_config_init,
2105+
.config_init = &m88e1318_config_init,
20902106
.config_aneg = &m88e1318_config_aneg,
20912107
.read_status = &marvell_read_status,
20922108
.ack_interrupt = &marvell_ack_interrupt,

0 commit comments

Comments
 (0)