Commit b6907b0c authored by Daniel Mack's avatar Daniel Mack Committed by David S. Miller

net: smsc911x: add power management functions

This adds a power management implementation for smsc911x.c which assumes
the chips remains powered during suspend. The device is put in its D1
power saving mode.
Signed-off-by: default avatarDaniel Mack <>
Acked-by: default avatarSteve Glendinning <>
Signed-off-by: default avatarDavid S. Miller <>
parent c7ae011d
......@@ -2109,12 +2109,58 @@ out_0:
return retval;
#ifdef CONFIG_PM
/* This implementation assumes the devices remains powered on its VDDVARIO
* pins during suspend. */
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);
/* enable wake on LAN, energy detection and the external PME
* signal. */
smsc911x_reg_write(pdata, PMT_CTRL,
return 0;
static int smsc911x_resume(struct platform_device *pdev)
struct net_device *dev = platform_get_drvdata(pdev);
struct smsc911x_data *pdata = netdev_priv(dev);
unsigned int to = 100;
/* Note 3.11 from the datasheet:
* "When the LAN9220 is in a power saving state, a write of any
* data to the BYTE_TEST register will wake-up the device."
smsc911x_reg_write(pdata, BYTE_TEST, 0);
/* poll the READY bit in PMT_CTRL. Any other access to the device is
* forbidden while this bit isn't set. Try for 100ms and return -EIO
* if it failed. */
while (!(smsc911x_reg_read(pdata, PMT_CTRL) & PMT_CTRL_READY_) && --to)
return (to == 0) ? -EIO : 0;
#define smsc911x_suspend NULL
#define smsc911x_resume NULL
static struct platform_driver smsc911x_driver = {
.probe = smsc911x_drv_probe,
.remove = smsc911x_drv_remove,
.driver = {
.suspend = smsc911x_suspend,
.resume = smsc911x_resume,
/* Entry point for loading the module */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment