diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2014-08-23 03:55:41 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-23 20:39:09 +0200 |
commit | 9df54ddab9aa91d53b672b1c0efbeb5d07919e66 (patch) | |
tree | daa76ee2db644598ba45f1d0da91d2532ba065b4 /drivers | |
parent | net: phy: broadcom: move shadow 0x1C register accessors to brcmphy.h (diff) | |
download | linux-9df54ddab9aa91d53b672b1c0efbeb5d07919e66.tar.xz linux-9df54ddab9aa91d53b672b1c0efbeb5d07919e66.zip |
net: phy: bcm7xxx: enable auto power down
The 28nm process BCM7xxx internal Gigabit PHYs all support automatic
power down, turn on that feature as part of the configuration
initialization callback.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/phy/bcm7xxx.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c index fdce1ea28790..29e256a4ed57 100644 --- a/drivers/net/phy/bcm7xxx.c +++ b/drivers/net/phy/bcm7xxx.c @@ -146,6 +146,27 @@ static int bcm7xxx_28nm_afe_config_init(struct phy_device *phydev) return 0; } +static int bcm7xxx_apd_enable(struct phy_device *phydev) +{ + int val; + + /* Enable powering down of the DLL during auto-power down */ + val = bcm54xx_shadow_read(phydev, BCM54XX_SHD_SCR3); + if (val < 0) + return val; + + val |= BCM54XX_SHD_SCR3_DLLAPD_DIS; + bcm54xx_shadow_write(phydev, BCM54XX_SHD_SCR3, val); + + /* Enable auto-power down */ + val = bcm54xx_shadow_read(phydev, BCM54XX_SHD_APD); + if (val < 0) + return val; + + val |= BCM54XX_SHD_APD_EN; + return bcm54xx_shadow_write(phydev, BCM54XX_SHD_APD, val); +} + static int bcm7xxx_28nm_config_init(struct phy_device *phydev) { int ret; @@ -154,7 +175,11 @@ static int bcm7xxx_28nm_config_init(struct phy_device *phydev) if (ret) return ret; - return bcm7xxx_28nm_afe_config_init(phydev); + ret = bcm7xxx_28nm_afe_config_init(phydev); + if (ret) + return ret; + + return bcm7xxx_apd_enable(phydev); } static int bcm7xxx_28nm_resume(struct phy_device *phydev) |