554e3117d8448a54f93ed19f81989bed92d0c6a2
[librecmc/librecmc.git] /
1 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
2 Date: Wed, 25 Jan 2017 21:00:25 +0100
3 Subject: [PATCH] net: phy: broadcom: use auxctl reading helper in BCM54612E
4  code
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Starting with commit 5b4e29005123 ("net: phy: broadcom: add
10 bcm54xx_auxctl_read") we have a reading helper so use it and avoid code
11 duplication.
12 It also means we don't need MII_BCM54XX_AUXCTL_SHDWSEL_MISC define as
13 it's the same as MII_BCM54XX_AUXCTL_SHDWSEL_MISC just for reading needs
14 (same value shifted by 12 bits).
15
16 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
17 Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
18 Signed-off-by: David S. Miller <davem@davemloft.net>
19 ---
20
21 --- a/drivers/net/phy/broadcom.c
22 +++ b/drivers/net/phy/broadcom.c
23 @@ -395,10 +395,8 @@ static int bcm54612e_config_aneg(struct
24             (phydev->interface != PHY_INTERFACE_MODE_RGMII_RXID)) {
25                 u16 reg;
26  
27 -               /* Errata: reads require filling in the write selector field */
28 -               bcm54xx_auxctl_write(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC,
29 -                                    MII_BCM54XX_AUXCTL_MISC_RDSEL_MISC);
30 -               reg = phy_read(phydev, MII_BCM54XX_AUX_CTL);
31 +               reg = bcm54xx_auxctl_read(phydev,
32 +                                         MII_BCM54XX_AUXCTL_SHDWSEL_MISC);
33                 /* Disable RXD to RXC delay (default set) */
34                 reg &= ~MII_BCM54XX_AUXCTL_MISC_RXD_RXC_SKEW;
35                 /* Clear shadow selector field */
36 --- a/include/linux/brcmphy.h
37 +++ b/include/linux/brcmphy.h
38 @@ -111,7 +111,6 @@
39  
40  #define MII_BCM54XX_AUXCTL_MISC_WREN   0x8000
41  #define MII_BCM54XX_AUXCTL_MISC_FORCE_AMDIX    0x0200
42 -#define MII_BCM54XX_AUXCTL_MISC_RDSEL_MISC     0x7000
43  #define MII_BCM54XX_AUXCTL_SHDWSEL_MISC        0x0007
44  #define MII_BCM54XX_AUXCTL_SHDWSEL_READ_SHIFT  12
45  #define MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RGMII_SKEW_EN  (1 << 8)