mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2026-01-27 23:47:19 +01:00
realtek: phy: save RTL8214FC extended page during power set
Changing the fibre/copper power of a RTL8214FC changes the extended page via register 29. This is the write only companion of register 30. The register is afterwards overwritten to 0. Use the proper extended page register 30 and preserve its content during the operation. Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21582 Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
parent
07bb4f5115
commit
121f4d90d0
1 changed files with 3 additions and 2 deletions
|
|
@ -466,14 +466,15 @@ static bool rtl8214fc_media_is_fibre(struct phy_device *phydev)
|
|||
static void rtl8214fc_power_set(struct phy_device *phydev, int port, bool on)
|
||||
{
|
||||
int page = port == PORT_FIBRE ? RTL821X_MEDIA_PAGE_FIBRE : RTL821X_MEDIA_PAGE_COPPER;
|
||||
int oldxpage = __phy_read(phydev, RTL821XEXT_MEDIA_PAGE_SELECT);
|
||||
int pdown = on ? 0 : BMCR_PDOWN;
|
||||
|
||||
phydev_info(phydev, "power %s %s\n", on ? "on" : "off",
|
||||
port == PORT_FIBRE ? "fibre" : "copper");
|
||||
|
||||
phy_write(phydev, RTL821XINT_MEDIA_PAGE_SELECT, page);
|
||||
phy_write(phydev, RTL821XEXT_MEDIA_PAGE_SELECT, page);
|
||||
phy_modify_paged(phydev, RTL821X_PAGE_POWER, 0x10, BMCR_PDOWN, pdown);
|
||||
phy_write(phydev, RTL821XINT_MEDIA_PAGE_SELECT, RTL821X_MEDIA_PAGE_AUTO);
|
||||
phy_write(phydev, RTL821XEXT_MEDIA_PAGE_SELECT, oldxpage);
|
||||
}
|
||||
|
||||
static int rtl8214fc_suspend(struct phy_device *phydev)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue