diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2014-08-22 21:55:40 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-23 14:38:53 -0400 |
commit | 705314797b8b997554b7e9d0ea7b65a497356e53 (patch) | |
tree | d687efea56072223575739944125a7fc1ebae871 /include/linux/brcmphy.h | |
parent | 3af20efc0f83cdc65ce56ec108c0e81f602364df (diff) |
net: phy: broadcom: move shadow 0x1C register accessors to brcmphy.h
The shadow register 0x1C is used both by the BCM54xxx PHYs and the
BCM7xxx internal PHYs, move the accessors to a common location so both
drivers can use them.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/brcmphy.h')
-rw-r--r-- | include/linux/brcmphy.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h index be31bf9f60c2..722cf26567fa 100644 --- a/include/linux/brcmphy.h +++ b/include/linux/brcmphy.h | |||
@@ -195,4 +195,24 @@ | |||
195 | #define MII_BRCM_FET_SHDW_AUXSTAT2 0x1b /* Auxiliary status 2 */ | 195 | #define MII_BRCM_FET_SHDW_AUXSTAT2 0x1b /* Auxiliary status 2 */ |
196 | #define MII_BRCM_FET_SHDW_AS2_APDE 0x0020 /* Auto power down enable */ | 196 | #define MII_BRCM_FET_SHDW_AS2_APDE 0x0020 /* Auto power down enable */ |
197 | 197 | ||
198 | /* | ||
199 | * Indirect register access functions for the 1000BASE-T/100BASE-TX/10BASE-T | ||
200 | * 0x1c shadow registers. | ||
201 | */ | ||
202 | static inline int bcm54xx_shadow_read(struct phy_device *phydev, u16 shadow) | ||
203 | { | ||
204 | phy_write(phydev, MII_BCM54XX_SHD, MII_BCM54XX_SHD_VAL(shadow)); | ||
205 | return MII_BCM54XX_SHD_DATA(phy_read(phydev, MII_BCM54XX_SHD)); | ||
206 | } | ||
207 | |||
208 | static inline int bcm54xx_shadow_write(struct phy_device *phydev, u16 shadow, | ||
209 | u16 val) | ||
210 | { | ||
211 | return phy_write(phydev, MII_BCM54XX_SHD, | ||
212 | MII_BCM54XX_SHD_WRITE | | ||
213 | MII_BCM54XX_SHD_VAL(shadow) | | ||
214 | MII_BCM54XX_SHD_DATA(val)); | ||
215 | } | ||
216 | |||
217 | |||
198 | #endif /* _LINUX_BRCMPHY_H */ | 218 | #endif /* _LINUX_BRCMPHY_H */ |