Commit 6c599044 authored by Dan Murphy's avatar Dan Murphy Committed by David S. Miller

net: phy: DP83TC811: Fix WoL in config init to be disabled

The WoL feature should be disabled when config_init is called and the
feature should turned on or off  when set_wol is called.

In addition updated the calls to modify the registers to use the set_bit
and clear_bit function calls.

Fixes: 6d749428788b ("net: phy: DP83TC811: Introduce support for the
DP83TC811 phy")
Signed-off-by: default avatarDan Murphy <dmurphy@ti.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 600ac36b
...@@ -139,16 +139,19 @@ static int dp83811_set_wol(struct phy_device *phydev, ...@@ -139,16 +139,19 @@ static int dp83811_set_wol(struct phy_device *phydev,
value &= ~DP83811_WOL_SECURE_ON; value &= ~DP83811_WOL_SECURE_ON;
} }
value |= (DP83811_WOL_EN | DP83811_WOL_INDICATION_SEL | /* Clear any pending WoL interrupt */
DP83811_WOL_CLR_INDICATION); phy_read(phydev, MII_DP83811_INT_STAT1);
phy_write_mmd(phydev, DP83811_DEVADDR, MII_DP83811_WOL_CFG,
value); value |= DP83811_WOL_EN | DP83811_WOL_INDICATION_SEL |
DP83811_WOL_CLR_INDICATION;
return phy_write_mmd(phydev, DP83811_DEVADDR,
MII_DP83811_WOL_CFG, value);
} else { } else {
phy_clear_bits_mmd(phydev, DP83811_DEVADDR, MII_DP83811_WOL_CFG, return phy_clear_bits_mmd(phydev, DP83811_DEVADDR,
DP83811_WOL_EN); MII_DP83811_WOL_CFG, DP83811_WOL_EN);
} }
return 0;
} }
static void dp83811_get_wol(struct phy_device *phydev, static void dp83811_get_wol(struct phy_device *phydev,
...@@ -292,8 +295,8 @@ static int dp83811_config_init(struct phy_device *phydev) ...@@ -292,8 +295,8 @@ static int dp83811_config_init(struct phy_device *phydev)
value = DP83811_WOL_MAGIC_EN | DP83811_WOL_SECURE_ON | DP83811_WOL_EN; value = DP83811_WOL_MAGIC_EN | DP83811_WOL_SECURE_ON | DP83811_WOL_EN;
return phy_write_mmd(phydev, DP83811_DEVADDR, MII_DP83811_WOL_CFG, return phy_clear_bits_mmd(phydev, DP83811_DEVADDR, MII_DP83811_WOL_CFG,
value); value);
} }
static int dp83811_phy_reset(struct phy_device *phydev) static int dp83811_phy_reset(struct phy_device *phydev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment