51 lines
1.3 KiB
Diff
51 lines
1.3 KiB
Diff
diff --git a/drivers/net/phy/meson-gxl.c b/drivers/net/phy/meson-gxl.c
|
|
index 3a84a03..8442edc 100644
|
|
--- a/drivers/net/phy/meson-gxl.c
|
|
+++ b/drivers/net/phy/meson-gxl.c
|
|
@@ -201,17 +201,44 @@ int meson_gxl_read_status(struct phy_device *phydev)
|
|
return genphy_read_status(phydev);
|
|
}
|
|
|
|
+static int meson_gxl_ack_interrupt(struct phy_device *phydev)
|
|
+{
|
|
+ int ret = phy_read(phydev, INTSRC_FLAG);
|
|
+
|
|
+ return ret < 0 ? ret : 0;
|
|
+}
|
|
+
|
|
+static int meson_gxl_config_intr(struct phy_device *phydev)
|
|
+{
|
|
+ u16 val;
|
|
+
|
|
+ if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
|
|
+ val = INTSRC_ANEG_PR
|
|
+ | INTSRC_PARALLEL_FAULT
|
|
+ | INTSRC_ANEG_LP_ACK
|
|
+ | INTSRC_LINK_DOWN
|
|
+ | INTSRC_REMOTE_FAULT
|
|
+ | INTSRC_ANEG_COMPLETE;
|
|
+ } else {
|
|
+ val = 0;
|
|
+ }
|
|
+
|
|
+ return phy_write(phydev, INTSRC_MASK, val);
|
|
+}
|
|
+
|
|
static struct phy_driver meson_gxl_phy[] = {
|
|
{
|
|
.phy_id = 0x01814400,
|
|
.phy_id_mask = 0xfffffff0,
|
|
.name = "Meson GXL Internal PHY",
|
|
.features = PHY_BASIC_FEATURES,
|
|
- .flags = PHY_IS_INTERNAL,
|
|
+ .flags = PHY_IS_INTERNAL | PHY_HAS_INTERRUPT,
|
|
.config_init = meson_gxl_config_init,
|
|
.config_aneg = genphy_config_aneg,
|
|
.aneg_done = genphy_aneg_done,
|
|
.read_status = meson_gxl_read_status,
|
|
+ .ack_interrupt = meson_gxl_ack_interrupt,
|
|
+ .config_intr = meson_gxl_config_intr,
|
|
.suspend = genphy_suspend,
|
|
.resume = genphy_resume,
|
|
},
|