summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2014-11-11 11:46:09 +0000
committerJohn Crispin <john@openwrt.org>2014-11-11 11:46:09 +0000
commite39993137628e2ea53be7822fb106d3a89db69b5 (patch)
tree07cd95955eb97055d7857c62babd072447fb77cc
parent6623feb572f6f29a17fed94b8dcb0e9512aeec4d (diff)
downloadmtk-20170518-e39993137628e2ea53be7822fb106d3a89db69b5.zip
mtk-20170518-e39993137628e2ea53be7822fb106d3a89db69b5.tar.gz
mtk-20170518-e39993137628e2ea53be7822fb106d3a89db69b5.tar.bz2
ralink: fix mdio polling of external phys if only 1 phy exists
Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 43235
-rw-r--r--target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620a.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620a.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620a.c
index e31dd29..c0ec939 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620a.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620a.c
@@ -299,6 +299,9 @@ static void gsw_auto_poll(struct mt7620_gsw *gsw)
msb = phy;
}
+ if (lsb)
+ lsb--;
+
gsw_w32(gsw, PHY_AN_EN | PHY_PRE_EN | PMY_MDC_CONF(5) | (msb << 8) | lsb, ESW_PHY_POLLING);
}