diff options
author | Rob Herring <r.herring@freescale.com> | 2009-09-15 22:21:26 -0500 |
---|---|---|
committer | Alejandro Gonzalez <alex.gonzalez@digi.com> | 2010-02-12 17:19:12 +0100 |
commit | 54bf8285fe72db7cdb3dab2fde2f2e9ee5717fdc (patch) | |
tree | a148fd178cb109e3c1dbae8f7cb61ae5ee6df0f4 /drivers/net | |
parent | 9037e7e400eacdf6ca8a4bf8fc9d0aef53fb3903 (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>
Diffstat (limited to 'drivers/net')
-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 94b6d2658ddc..e8b0d5e6e4bd 100644 --- a/drivers/net/smsc911x.c +++ b/drivers/net/smsc911x.c @@ -2118,6 +2118,9 @@ static int smsc911x_suspend(struct platform_device *pdev, pm_message_t state) { struct net_device *dev = platform_get_drvdata(pdev); struct smsc911x_data *pdata = netdev_priv(dev); + 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. */ @@ -2132,6 +2135,7 @@ static int smsc911x_resume(struct platform_device *pdev) { struct net_device *dev = platform_get_drvdata(pdev); struct smsc911x_data *pdata = netdev_priv(dev); + struct phy_device *phy_dev = pdata->phy_dev; unsigned int to = 100; /* Note 3.11 from the datasheet: @@ -2146,6 +2150,8 @@ static int smsc911x_resume(struct platform_device *pdev) 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; } |