Skip to content

Commit 93585e8

Browse files
grygoriySgregkh
authored andcommitted
net: phy: dp83867: fix irq generation
[ Upstream commit 5ca7d1ca77dc23934504b95a96d2660d345f83c2 ] For proper IRQ generation by DP83867 phy the INT/PWDN pin has to be programmed as an interrupt output instead of a Powerdown input in Configuration Register 3 (CFG3), Address 0x001E, bit 7 INT_OE = 1. The current driver doesn't do this and as result IRQs will not be generated by DP83867 phy even if they are properly configured in DT. Hence, fix IRQ generation by properly configuring CFG3.INT_OE bit and ensure that Link Status Change (LINK_STATUS_CHNG_INT) and Auto-Negotiation Complete (AUTONEG_COMP_INT) interrupt are enabled. After this the DP83867 driver will work properly in interrupt enabled mode. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 41433e3 commit 93585e8

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

drivers/net/phy/dp83867.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#define MII_DP83867_MICR 0x12
3030
#define MII_DP83867_ISR 0x13
3131
#define DP83867_CTRL 0x1f
32+
#define DP83867_CFG3 0x1e
3233

3334
/* Extended Registers */
3435
#define DP83867_RGMIICTL 0x0032
@@ -89,6 +90,8 @@ static int dp83867_config_intr(struct phy_device *phydev)
8990
micr_status |=
9091
(MII_DP83867_MICR_AN_ERR_INT_EN |
9192
MII_DP83867_MICR_SPEED_CHNG_INT_EN |
93+
MII_DP83867_MICR_AUTONEG_COMP_INT_EN |
94+
MII_DP83867_MICR_LINK_STS_CHNG_INT_EN |
9295
MII_DP83867_MICR_DUP_MODE_CHNG_INT_EN |
9396
MII_DP83867_MICR_SLEEP_MODE_CHNG_INT_EN);
9497

@@ -184,6 +187,13 @@ static int dp83867_config_init(struct phy_device *phydev)
184187
DP83867_DEVADDR, phydev->addr, delay);
185188
}
186189

190+
/* Enable Interrupt output INT_OE in CFG3 register */
191+
if (phy_interrupt_is_valid(phydev)) {
192+
val = phy_read(phydev, DP83867_CFG3);
193+
val |= BIT(7);
194+
phy_write(phydev, DP83867_CFG3, val);
195+
}
196+
187197
return 0;
188198
}
189199

0 commit comments

Comments
 (0)