]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
r8152: clear BMCR_PDOWN
authorhayeswang <hayeswang@realtek.com>
Tue, 18 Feb 2014 13:49:03 +0000 (21:49 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Feb 2014 21:40:01 +0000 (16:40 -0500)
Modify the method of enabling the PHY to clear BMCR_PDOWN only.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/r8152.c

index 2a778faa96307888fd53e9a8b76b845dce8853cb..c7bae3920038f829e84c84e102dc5f354dfe53c7 100644 (file)
@@ -1845,7 +1845,14 @@ static inline void r8152b_enable_aldps(struct r8152 *tp)
 
 static void r8152b_hw_phy_cfg(struct r8152 *tp)
 {
-       r8152_mdio_write(tp, MII_BMCR, BMCR_ANENABLE);
+       u16 data;
+
+       data = r8152_mdio_read(tp, MII_BMCR);
+       if (data & BMCR_PDOWN) {
+               data &= ~BMCR_PDOWN;
+               r8152_mdio_write(tp, MII_BMCR, data);
+       }
+
        r8152b_disable_aldps(tp);
 }
 
@@ -1995,7 +2002,11 @@ static void r8153_hw_phy_cfg(struct r8152 *tp)
        u16 data;
 
        ocp_reg_write(tp, OCP_ADC_CFG, CKADSEL_L | ADC_EN | EN_EMI_L);
-       r8152_mdio_write(tp, MII_BMCR, BMCR_ANENABLE);
+       data = r8152_mdio_read(tp, MII_BMCR);
+       if (data & BMCR_PDOWN) {
+               data &= ~BMCR_PDOWN;
+               r8152_mdio_write(tp, MII_BMCR, data);
+       }
 
        if (tp->version == RTL_VER_03) {
                data = ocp_reg_read(tp, OCP_EEE_CFG);