]> git.sur5r.net Git - u-boot/commitdiff
Improve Power Management in SMC911X driver.
authorbertrand.cachet@heig-vd.ch <bertrand.cachet@heig-vd.ch>
Tue, 15 Nov 2011 03:40:53 +0000 (03:40 +0000)
committerStefano Babic <sbabic@denx.de>
Tue, 22 Nov 2011 07:39:27 +0000 (08:39 +0100)
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>
drivers/net/smc911x.h

index 8ce08a91e28e58011dd89a47c4e964c962c67a2a..a290073bb8b42814c8129aba4f25647c3ea93b7f 100644 (file)
@@ -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);