aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHayes Wang <hayeswang@realtek.com>2012-03-30 02:33:00 -0400
committerFrancois Romieu <romieu@fr.zoreil.com>2012-04-17 05:22:40 -0400
commit0004299ad41885a0a1fd321715fe7396be17ce35 (patch)
tree4962e3107819b4e8552e26b25ca63006deabc614
parentd387b427c973974dd619a33549c070ac5d0e089f (diff)
r8169: modify pll power function
Adjust r810x_pll_power_down, r810x_pll_power_up, and r8168_pll_power_up. Always power up device during rtl_open. For r810x, turn off more power when the WOL is disabled. Signed-off-by: Hayes Wang <hayeswang@realtek.com>
-rw-r--r--drivers/net/ethernet/realtek/r8169.c37
1 files changed, 30 insertions, 7 deletions
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 207aadcd37f2..d9bae307c144 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -3525,15 +3525,45 @@ static void r810x_phy_power_up(struct rtl8169_private *tp)
3525 3525
3526static void r810x_pll_power_down(struct rtl8169_private *tp) 3526static void r810x_pll_power_down(struct rtl8169_private *tp)
3527{ 3527{
3528 void __iomem *ioaddr = tp->mmio_addr;
3529
3528 if (rtl_wol_pll_power_down(tp)) 3530 if (rtl_wol_pll_power_down(tp))
3529 return; 3531 return;
3530 3532
3531 r810x_phy_power_down(tp); 3533 r810x_phy_power_down(tp);
3534
3535 switch (tp->mac_version) {
3536 case RTL_GIGA_MAC_VER_07:
3537 case RTL_GIGA_MAC_VER_08:
3538 case RTL_GIGA_MAC_VER_09:
3539 case RTL_GIGA_MAC_VER_10:
3540 case RTL_GIGA_MAC_VER_13:
3541 case RTL_GIGA_MAC_VER_16:
3542 break;
3543 default:
3544 RTL_W8(PMCH, RTL_R8(PMCH) & ~0x80);
3545 break;
3546 }
3532} 3547}
3533 3548
3534static void r810x_pll_power_up(struct rtl8169_private *tp) 3549static void r810x_pll_power_up(struct rtl8169_private *tp)
3535{ 3550{
3551 void __iomem *ioaddr = tp->mmio_addr;
3552
3536 r810x_phy_power_up(tp); 3553 r810x_phy_power_up(tp);
3554
3555 switch (tp->mac_version) {
3556 case RTL_GIGA_MAC_VER_07:
3557 case RTL_GIGA_MAC_VER_08:
3558 case RTL_GIGA_MAC_VER_09:
3559 case RTL_GIGA_MAC_VER_10:
3560 case RTL_GIGA_MAC_VER_13:
3561 case RTL_GIGA_MAC_VER_16:
3562 break;
3563 default:
3564 RTL_W8(PMCH, RTL_R8(PMCH) | 0x80);
3565 break;
3566 }
3537} 3567}
3538 3568
3539static void r8168_phy_power_up(struct rtl8169_private *tp) 3569static void r8168_phy_power_up(struct rtl8169_private *tp)
@@ -3637,13 +3667,6 @@ static void r8168_pll_power_up(struct rtl8169_private *tp)
3637{ 3667{
3638 void __iomem *ioaddr = tp->mmio_addr; 3668 void __iomem *ioaddr = tp->mmio_addr;
3639 3669
3640 if ((tp->mac_version == RTL_GIGA_MAC_VER_27 ||
3641 tp->mac_version == RTL_GIGA_MAC_VER_28 ||
3642 tp->mac_version == RTL_GIGA_MAC_VER_31) &&
3643 r8168dp_check_dash(tp)) {
3644 return;
3645 }
3646
3647 switch (tp->mac_version) { 3670 switch (tp->mac_version) {
3648 case RTL_GIGA_MAC_VER_25: 3671 case RTL_GIGA_MAC_VER_25:
3649 case RTL_GIGA_MAC_VER_26: 3672 case RTL_GIGA_MAC_VER_26: