diff options
author | Jon Mason <jon.mason@broadcom.com> | 2016-11-04 06:10:56 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-07 19:11:21 +0100 |
commit | 5b4e2900512321435a5cd7dd77f58f23f3109950 (patch) | |
tree | 89b1a77887873f51633a0914b6e799cb8d24cafa /drivers/net/phy | |
parent | Merge branch 'dwmac-sti-refactor-cleanup' (diff) | |
download | linux-5b4e2900512321435a5cd7dd77f58f23f3109950.tar.xz linux-5b4e2900512321435a5cd7dd77f58f23f3109950.zip |
net: phy: broadcom: add bcm54xx_auxctl_read
Add a helper function to read the AUXCTL register for the BCM54xx. This
mirrors the bcm54xx_auxctl_write function already present in the code.
Signed-off-by: Jon Mason <jon.mason@broadcom.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/broadcom.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c index 583ef8a2ec8d..3a64b3d8eca8 100644 --- a/drivers/net/phy/broadcom.c +++ b/drivers/net/phy/broadcom.c @@ -30,6 +30,16 @@ MODULE_DESCRIPTION("Broadcom PHY driver"); MODULE_AUTHOR("Maciej W. Rozycki"); MODULE_LICENSE("GPL"); +static int bcm54xx_auxctl_read(struct phy_device *phydev, u16 regnum) +{ + /* The register must be written to both the Shadow Register Select and + * the Shadow Read Register Selector + */ + phy_write(phydev, MII_BCM54XX_AUX_CTL, regnum | + regnum << MII_BCM54XX_AUXCTL_SHDWSEL_READ_SHIFT); + return phy_read(phydev, MII_BCM54XX_AUX_CTL); +} + static int bcm54xx_auxctl_write(struct phy_device *phydev, u16 regnum, u16 val) { return phy_write(phydev, MII_BCM54XX_AUX_CTL, regnum | val); |