]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
net: phy: broadcom: Move bcm54xx_auxctl_{read, write} to common library
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 22 Nov 2016 19:40:54 +0000 (11:40 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Nov 2016 20:45:53 +0000 (15:45 -0500)
We are going to need these functions to implement support for Broadcom
Wirespeed, aka downshift.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/bcm-phy-lib.c
drivers/net/phy/bcm-phy-lib.h
drivers/net/phy/broadcom.c

index df0416db0b88fce5899cae9cc9f3e9df5c7c624a..18e11b3a0f4141121fb88e65069ff264c41760c4 100644 (file)
@@ -50,6 +50,23 @@ int bcm_phy_read_exp(struct phy_device *phydev, u16 reg)
 }
 EXPORT_SYMBOL_GPL(bcm_phy_read_exp);
 
+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);
+}
+EXPORT_SYMBOL_GPL(bcm54xx_auxctl_read);
+
+int bcm54xx_auxctl_write(struct phy_device *phydev, u16 regnum, u16 val)
+{
+       return phy_write(phydev, MII_BCM54XX_AUX_CTL, regnum | val);
+}
+EXPORT_SYMBOL(bcm54xx_auxctl_write);
+
 int bcm_phy_write_misc(struct phy_device *phydev,
                       u16 reg, u16 chl, u16 val)
 {
index b2091c88b44dbbef9a4d1623a02b8b4add5f4f72..31cb4fdf5d5a09063e9bb53ece814ec7b8aa3cd4 100644 (file)
@@ -19,6 +19,9 @@
 int bcm_phy_write_exp(struct phy_device *phydev, u16 reg, u16 val);
 int bcm_phy_read_exp(struct phy_device *phydev, u16 reg);
 
+int bcm54xx_auxctl_write(struct phy_device *phydev, u16 regnum, u16 val);
+int bcm54xx_auxctl_read(struct phy_device *phydev, u16 regnum);
+
 int bcm_phy_write_misc(struct phy_device *phydev,
                       u16 reg, u16 chl, u16 value);
 int bcm_phy_read_misc(struct phy_device *phydev,
index b1e32e9be1b3bc35689523a1f7a25d2881100560..409b365f12b1e3421a9889c3dd113bd75283cd88 100644 (file)
@@ -30,21 +30,6 @@ 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);
-}
-
 static int bcm54810_config(struct phy_device *phydev)
 {
        int rc, val;