aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2014-08-22 21:55:41 -0400
committerDavid S. Miller <davem@davemloft.net>2014-08-23 14:39:09 -0400
commit9df54ddab9aa91d53b672b1c0efbeb5d07919e66 (patch)
treedaa76ee2db644598ba45f1d0da91d2532ba065b4 /drivers/net/phy
parent705314797b8b997554b7e9d0ea7b65a497356e53 (diff)
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/net/phy')
-rw-r--r--drivers/net/phy/bcm7xxx.c27
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)
146 return 0; 146 return 0;
147} 147}
148 148
149static int bcm7xxx_apd_enable(struct phy_device *phydev)
150{
151 int val;
152
153 /* Enable powering down of the DLL during auto-power down */
154 val = bcm54xx_shadow_read(phydev, BCM54XX_SHD_SCR3);
155 if (val < 0)
156 return val;
157
158 val |= BCM54XX_SHD_SCR3_DLLAPD_DIS;
159 bcm54xx_shadow_write(phydev, BCM54XX_SHD_SCR3, val);
160
161 /* Enable auto-power down */
162 val = bcm54xx_shadow_read(phydev, BCM54XX_SHD_APD);
163 if (val < 0)
164 return val;
165
166 val |= BCM54XX_SHD_APD_EN;
167 return bcm54xx_shadow_write(phydev, BCM54XX_SHD_APD, val);
168}
169
149static int bcm7xxx_28nm_config_init(struct phy_device *phydev) 170static int bcm7xxx_28nm_config_init(struct phy_device *phydev)
150{ 171{
151 int ret; 172 int ret;
@@ -154,7 +175,11 @@ static int bcm7xxx_28nm_config_init(struct phy_device *phydev)
154 if (ret) 175 if (ret)
155 return ret; 176 return ret;
156 177
157 return bcm7xxx_28nm_afe_config_init(phydev); 178 ret = bcm7xxx_28nm_afe_config_init(phydev);
179 if (ret)
180 return ret;
181
182 return bcm7xxx_apd_enable(phydev);
158} 183}
159 184
160static int bcm7xxx_28nm_resume(struct phy_device *phydev) 185static int bcm7xxx_28nm_resume(struct phy_device *phydev)