rtl_writephy(tp, 0x1f, 0x0000);
}
-static void rtl8168g_disable_aldps(struct rtl8169_private *tp)
+static void rtl8168g_disable_aldps(struct phy_device *phydev)
{
- phy_modify_paged(tp->phydev, 0x0a43, 0x10, BIT(2), 0);
+ phy_modify_paged(phydev, 0x0a43, 0x10, BIT(2), 0);
}
-static void rtl8168g_phy_adjust_10m_aldps(struct rtl8169_private *tp)
+static void rtl8168g_phy_adjust_10m_aldps(struct phy_device *phydev)
{
- struct phy_device *phydev = tp->phydev;
-
phy_modify_paged(phydev, 0x0bcc, 0x14, BIT(8), 0);
phy_modify_paged(phydev, 0x0a44, 0x11, 0, BIT(7) | BIT(6));
r8168g_phy_param(phydev, 0x8084, 0x6000, 0x0000);
/* Enable PHY auto speed down */
phy_modify_paged(phydev, 0x0a44, 0x11, 0, BIT(3) | BIT(2));
- rtl8168g_phy_adjust_10m_aldps(tp);
+ rtl8168g_phy_adjust_10m_aldps(phydev);
/* EEE auto-fallback function */
phy_modify_paged(phydev, 0x0a4b, 0x11, 0, BIT(2));
rtl_writephy(tp, 0x14, 0x1065);
rtl_writephy(tp, 0x1f, 0x0000);
- rtl8168g_disable_aldps(tp);
+ rtl8168g_disable_aldps(phydev);
rtl8168g_config_eee_phy(phydev);
}
/* disable phy pfm mode */
phy_modify_paged(phydev, 0x0a44, 0x11, BIT(7), 0);
- rtl8168g_disable_aldps(tp);
+ rtl8168g_disable_aldps(phydev);
rtl8168h_config_eee_phy(phydev);
}
/* disable phy pfm mode */
phy_modify_paged(phydev, 0x0a44, 0x11, BIT(7), 0);
- rtl8168g_disable_aldps(tp);
+ rtl8168g_disable_aldps(phydev);
rtl8168g_config_eee_phy(phydev);
}
/* Enable PHY auto speed down */
phy_modify_paged(phydev, 0x0a44, 0x11, 0, BIT(3) | BIT(2));
- rtl8168g_phy_adjust_10m_aldps(tp);
+ rtl8168g_phy_adjust_10m_aldps(phydev);
/* Enable EEE auto-fallback function */
phy_modify_paged(phydev, 0x0a4b, 0x11, 0, BIT(2));
/* set rg_sel_sdm_rate */
phy_modify_paged(phydev, 0x0c42, 0x11, BIT(13), BIT(14));
- rtl8168g_disable_aldps(tp);
+ rtl8168g_disable_aldps(phydev);
rtl8168g_config_eee_phy(phydev);
}
static void rtl8168ep_2_hw_phy_config(struct rtl8169_private *tp,
struct phy_device *phydev)
{
- rtl8168g_phy_adjust_10m_aldps(tp);
+ rtl8168g_phy_adjust_10m_aldps(phydev);
/* Enable UC LPF tune function */
r8168g_phy_param(phydev, 0x8012, 0x0000, 0x8000);
rtl_writephy(tp, 0x14, 0x1065);
rtl_writephy(tp, 0x1f, 0x0000);
- rtl8168g_disable_aldps(tp);
+ rtl8168g_disable_aldps(phydev);
rtl8168g_config_eee_phy(phydev);
}
r8168g_phy_param(phydev, 0x8016, 0x0000, 0x0400);
- rtl8168g_disable_aldps(tp);
+ rtl8168g_disable_aldps(phydev);
rtl8168h_config_eee_phy(phydev);
}