diff options
author | Rob Herring <r.herring@freescale.com> | 2009-09-15 22:21:26 -0500 |
---|---|---|
committer | Alan Tull <r80115@freescale.com> | 2010-08-25 11:51:27 -0500 |
commit | b23468da828e3cbbe73c26af081c98c7595240b5 (patch) | |
tree | 7258fa98afa8acc4e9ac65d0f6331dd29e83dd76 | |
parent | f1beff8f7ff279c72aa4d68db8084eb55a3702f3 (diff) |
smsc911x: Add phy suspend and resume
Most of the smsc9xxx power consumption is in the phy, so
we need to suspend the phy.
Signed-off-by: Rob Herring <r.herring@freescale.com>
-rw-r--r-- | drivers/net/smsc911x.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c index 7a7b01a0fff8..e7e8f9f6ec5a 100644 --- a/drivers/net/smsc911x.c +++ b/drivers/net/smsc911x.c @@ -2120,6 +2120,9 @@ static int smsc911x_suspend(struct device *dev) { struct net_device *ndev = dev_get_drvdata(dev); struct smsc911x_data *pdata = netdev_priv(ndev); + struct phy_device *phy_dev = pdata->phy_dev; + + smsc911x_mii_write(phy_dev->bus, phy_dev->addr, MII_BMCR, BMCR_PDOWN); /* enable wake on LAN, energy detection and the external PME * signal. */ @@ -2134,6 +2137,7 @@ static int smsc911x_resume(struct device *dev) { struct net_device *ndev = dev_get_drvdata(dev); struct smsc911x_data *pdata = netdev_priv(ndev); + struct phy_device *phy_dev = pdata->phy_dev; unsigned int to = 100; /* Note 3.11 from the datasheet: @@ -2148,6 +2152,8 @@ static int smsc911x_resume(struct device *dev) while (!(smsc911x_reg_read(pdata, PMT_CTRL) & PMT_CTRL_READY_) && --to) udelay(1000); + smsc911x_mii_write(phy_dev->bus, phy_dev->addr, MII_BMCR, BMCR_ANENABLE | BMCR_ANRESTART); + return (to == 0) ? -EIO : 0; } |