aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2014-09-24 20:05:19 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-28 17:14:09 -0400
commit7de1557ce7521e756974d5c28794c2375d28e3cc (patch)
treed8744be27bcc91ad7918e78db3220d9b9495a6c5 /drivers/net/dsa
parentb2f2af21e37f6d12bd735c27da8942331aa9b3d7 (diff)
net: dsa: bcm_sf2: disable RGMII interface(s) when link is down
When the link is down, disable the RGMII interface to conserve as much power as possible. We re-enable the RGMII interface whenever the link is detected. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa')
-rw-r--r--drivers/net/dsa/bcm_sf2.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index d9b7da545063..58b8fef25b96 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -506,6 +506,15 @@ static void bcm_sf2_sw_adjust_link(struct dsa_switch *ds, int port,
506 port_mode = EXT_REVMII; 506 port_mode = EXT_REVMII;
507 break; 507 break;
508 default: 508 default:
509 /* All other PHYs: internal and MoCA */
510 goto force_link;
511 }
512
513 /* If the link is down, just disable the interface to conserve power */
514 if (!phydev->link) {
515 reg = reg_readl(priv, REG_RGMII_CNTRL_P(port));
516 reg &= ~RGMII_MODE_EN;
517 reg_writel(priv, reg, REG_RGMII_CNTRL_P(port));
509 goto force_link; 518 goto force_link;
510 } 519 }
511 520