diff options
author | John Crispin <john@openwrt.org> | 2016-03-04 08:33:33 +0000 |
---|---|---|
committer | John Crispin <john@openwrt.org> | 2016-03-04 08:33:33 +0000 |
commit | 3a03c08c821d580881ddc1b8a62f45f3801860de (patch) | |
tree | d702a583638c58c7ad843c7d2c2ebf2f42b0d0e0 /target/linux/generic/files/drivers/net/phy/ar8327.c | |
parent | d3776bdfc98cee205b74b5775bb0e96ced7193f7 (diff) | |
download | upstream-3a03c08c821d580881ddc1b8a62f45f3801860de.tar.gz upstream-3a03c08c821d580881ddc1b8a62f45f3801860de.tar.bz2 upstream-3a03c08c821d580881ddc1b8a62f45f3801860de.zip |
AR8216: improve mmd register access
Combine all bus operations for one MMD access in one function.
Protecting all these bus operations with one lock also helps
to avoid potential issues due to bus operations intercepting
the register and data write.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
SVN-Revision: 48914
Diffstat (limited to 'target/linux/generic/files/drivers/net/phy/ar8327.c')
-rw-r--r-- | target/linux/generic/files/drivers/net/phy/ar8327.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/ar8327.c b/target/linux/generic/files/drivers/net/phy/ar8327.c index 9c232382b5..d8797820f2 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8327.c +++ b/target/linux/generic/files/drivers/net/phy/ar8327.c @@ -139,13 +139,10 @@ ar8327_phy_fixup(struct ar8xxx_priv *priv, int phy) break; case 2: - ar8xxx_phy_mmd_write(priv, phy, 0x7, 0x3c); - ar8xxx_phy_mmd_write(priv, phy, 0x4007, 0x0); + ar8xxx_phy_mmd_write(priv, phy, 0x7, 0x3c, 0x0); /* fallthrough */ case 4: - ar8xxx_phy_mmd_write(priv, phy, 0x3, 0x800d); - ar8xxx_phy_mmd_write(priv, phy, 0x4003, 0x803f); - + ar8xxx_phy_mmd_write(priv, phy, 0x3, 0x800d, 0x803f); ar8xxx_phy_dbg_write(priv, phy, 0x3d, 0x6860); ar8xxx_phy_dbg_write(priv, phy, 0x5, 0x2c46); ar8xxx_phy_dbg_write(priv, phy, 0x3c, 0x6000); @@ -744,8 +741,7 @@ ar8327_read_port_eee_status(struct ar8xxx_priv *priv, int port) phy = port - 1; /* EEE Ability Auto-negotiation Result */ - ar8xxx_phy_mmd_write(priv, phy, 0x7, 0x8000); - t = ar8xxx_phy_mmd_read(priv, phy, 0x4007); + t = ar8xxx_phy_mmd_read(priv, phy, 0x7, 0x8000); return mmd_eee_adv_to_ethtool_adv_t(t); } |