tg3 / broadcom: Refine AC131 APD support
authorMatt Carlson <mcarlson@broadcom.com>
Mon, 2 Nov 2009 14:31:11 +0000 (14:31 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Nov 2009 07:39:12 +0000 (23:39 -0800)
Auto power-down (APD) support is a power-saving feature.  It should be
selectively enabled since it might expose MAC bugs.  This patch changes
the code to enable APD only if the PHY_BRCM_AUTO_PWRDWN_ENABLE flag is
set.  The tg3 driver was changed to set this bit.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/broadcom.c
drivers/net/tg3.c

index 5d2a2e90aba88856f4457e67c57eaa8cabf0d27e..bddf4a42ae6826447717cba846d4616b1bb6d3a1 100644 (file)
@@ -561,9 +561,11 @@ static int brcm_fet_config_init(struct phy_device *phydev)
        if (err < 0)
                goto done;
 
-       /* Enable auto power down */
-       err = brcm_phy_setbits(phydev, MII_BRCM_FET_SHDW_AUXSTAT2,
-                                      MII_BRCM_FET_SHDW_AS2_APDE);
+       if (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE) {
+               /* Enable auto power down */
+               err = brcm_phy_setbits(phydev, MII_BRCM_FET_SHDW_AUXSTAT2,
+                                              MII_BRCM_FET_SHDW_AS2_APDE);
+       }
 
 done:
        /* Disable shadow register access */
index e7128f6ae2d8a9efff38bc3681bc6cce59579a47..592b5bf09e40124ab34c06ad4582964cd519962c 100644 (file)
@@ -1114,6 +1114,7 @@ static int tg3_mdio_init(struct tg3 *tp)
        case TG3_PHY_ID_RTL8201E:
        case TG3_PHY_ID_BCMAC131:
                phydev->interface = PHY_INTERFACE_MODE_MII;
+               phydev->dev_flags |= PHY_BRCM_AUTO_PWRDWN_ENABLE;
                tp->tg3_flags3 |= TG3_FLG3_PHY_IS_FET;
                break;
        }