summaryrefslogtreecommitdiff
path: root/drivers/net/smc911x.h
diff options
context:
space:
mode:
authorbertrand.cachet@heig-vd.ch <bertrand.cachet@heig-vd.ch>2011-11-15 03:40:53 +0000
committerStefano Babic <sbabic@denx.de>2011-11-22 08:39:27 +0100
commit3c8849df5f2954944578cd2e2af31c001283dbf2 (patch)
tree2b64cb0548aaf51c9a7e7485bc0f447e34f8be8e /drivers/net/smc911x.h
parent27aafe988e1ee7b246c46031283113bdafcb4f75 (diff)
downloadu-boot-imx-3c8849df5f2954944578cd2e2af31c001283dbf2.zip
u-boot-imx-3c8849df5f2954944578cd2e2af31c001283dbf2.tar.gz
u-boot-imx-3c8849df5f2954944578cd2e2af31c001283dbf2.tar.bz2
Improve Power Management in SMC911X driver.
device is already in *normal* (D0) mode => it doesn't need to be wake-up. With this patch, we only wake-up (writing on TEST_BYTE register) if PM_MODE bits of PM_CTRL register is in sleep (D1/D2) mode. Signed-off-by: Bertrand Cachet <bertrand.cachet@heig-vd.ch>
Diffstat (limited to 'drivers/net/smc911x.h')
-rw-r--r--drivers/net/smc911x.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/smc911x.h b/drivers/net/smc911x.h
index 8ce08a9..a290073 100644
--- a/drivers/net/smc911x.h
+++ b/drivers/net/smc911x.h
@@ -471,8 +471,11 @@ static void smc911x_reset(struct eth_device *dev)
{
int timeout;
- /* Take out of PM setting first */
- if (smc911x_reg_read(dev, PMT_CTRL) & PMT_CTRL_READY) {
+ /*
+ * Take out of PM setting first
+ * Device is already wake up if PMT_CTRL_READY bit is set
+ */
+ if ((smc911x_reg_read(dev, PMT_CTRL) & PMT_CTRL_READY) == 0) {
/* Write to the bytetest will take out of powerdown */
smc911x_reg_write(dev, BYTE_TEST, 0x0);