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
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 Starting with commit 5b4e29005123 ("net: phy: broadcom: add
10 bcm54xx_auxctl_read") we have a reading helper so use it and avoid code
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).
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>
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)) {
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
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)