1 From: Florian Fainelli <f.fainelli@gmail.com>
2 Date: Tue, 22 Nov 2016 11:40:54 -0800
3 Subject: [PATCH] net: phy: broadcom: Move bcm54xx_auxctl_{read, write} to
6 We are going to need these functions to implement support for Broadcom
7 Wirespeed, aka downshift.
9 Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
10 Signed-off-by: David S. Miller <davem@davemloft.net>
13 --- a/drivers/net/phy/bcm-phy-lib.c
14 +++ b/drivers/net/phy/bcm-phy-lib.c
15 @@ -50,6 +50,23 @@ int bcm_phy_read_exp(struct phy_device *
17 EXPORT_SYMBOL_GPL(bcm_phy_read_exp);
19 +int bcm54xx_auxctl_read(struct phy_device *phydev, u16 regnum)
21 + /* The register must be written to both the Shadow Register Select and
22 + * the Shadow Read Register Selector
24 + phy_write(phydev, MII_BCM54XX_AUX_CTL, regnum |
25 + regnum << MII_BCM54XX_AUXCTL_SHDWSEL_READ_SHIFT);
26 + return phy_read(phydev, MII_BCM54XX_AUX_CTL);
28 +EXPORT_SYMBOL_GPL(bcm54xx_auxctl_read);
30 +int bcm54xx_auxctl_write(struct phy_device *phydev, u16 regnum, u16 val)
32 + return phy_write(phydev, MII_BCM54XX_AUX_CTL, regnum | val);
34 +EXPORT_SYMBOL(bcm54xx_auxctl_write);
36 int bcm_phy_write_misc(struct phy_device *phydev,
37 u16 reg, u16 chl, u16 val)
39 --- a/drivers/net/phy/bcm-phy-lib.h
40 +++ b/drivers/net/phy/bcm-phy-lib.h
42 int bcm_phy_write_exp(struct phy_device *phydev, u16 reg, u16 val);
43 int bcm_phy_read_exp(struct phy_device *phydev, u16 reg);
45 +int bcm54xx_auxctl_write(struct phy_device *phydev, u16 regnum, u16 val);
46 +int bcm54xx_auxctl_read(struct phy_device *phydev, u16 regnum);
48 int bcm_phy_write_misc(struct phy_device *phydev,
49 u16 reg, u16 chl, u16 value);
50 int bcm_phy_read_misc(struct phy_device *phydev,
51 --- a/drivers/net/phy/broadcom.c
52 +++ b/drivers/net/phy/broadcom.c
53 @@ -30,21 +30,6 @@ MODULE_DESCRIPTION("Broadcom PHY driver"
54 MODULE_AUTHOR("Maciej W. Rozycki");
55 MODULE_LICENSE("GPL");
57 -static int bcm54xx_auxctl_read(struct phy_device *phydev, u16 regnum)
59 - /* The register must be written to both the Shadow Register Select and
60 - * the Shadow Read Register Selector
62 - phy_write(phydev, MII_BCM54XX_AUX_CTL, regnum |
63 - regnum << MII_BCM54XX_AUXCTL_SHDWSEL_READ_SHIFT);
64 - return phy_read(phydev, MII_BCM54XX_AUX_CTL);
67 -static int bcm54xx_auxctl_write(struct phy_device *phydev, u16 regnum, u16 val)
69 - return phy_write(phydev, MII_BCM54XX_AUX_CTL, regnum | val);
72 static int bcm54810_config(struct phy_device *phydev)