summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-04-03 21:45:49 -0700
committerDavid S. Miller <davem@davemloft.net>2019-04-03 21:45:49 -0700
commit49ffba361d5b3637d3b926d8bfe79dde9710272c (patch)
treed3143e68fbda3127868515c492efeee68ad97119
parent0fd128428a1494d01b826d201dad4cc6571bf2b5 (diff)
parente02c4a9d9b0dea1fcdecef38710e9602d5ffdba6 (diff)
downloadlinux-49ffba361d5b3637d3b926d8bfe79dde9710272c.tar.gz
linux-49ffba361d5b3637d3b926d8bfe79dde9710272c.tar.bz2
linux-49ffba361d5b3637d3b926d8bfe79dde9710272c.zip
Merge branch 'marvel10g-suspend-resume'
Antoine Tenart says: ==================== net: phy: marvell10g: implement suspend/resume callbacks This series implements the suspend/resume callbacks in the marvell10g PHY driver. Thanks, Antoine Since v3: - Use the new phy_set/clear_bits_mmd() instead of phy_modify_mmd(). - Use VEND2.f001.11 to power down the port instead of the per-mode LPOWER. Since v2: - Removed the third patch, setting the PHY in low power by default, as the change was controversial. - Rebased on the latest net-next. Since v1: - Fixed a mix up in the patches where two implementations of the suspend/resume callbacks were kept in the driver. - Rebased on the latest net-next. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/phy/marvell10g.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 100b401b1f4a..fc06e8c9a64b 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -48,6 +48,8 @@ enum {
MV_AN_STAT1000 = 0x8001, /* 1000base-T status register */
/* Vendor2 MMD registers */
+ MV_V2_PORT_CTRL = 0xf001,
+ MV_V2_PORT_CTRL_PWRDOWN = 0x0800,
MV_V2_TEMP_CTRL = 0xf08a,
MV_V2_TEMP_CTRL_MASK = 0xc000,
MV_V2_TEMP_CTRL_SAMPLE = 0x0000,
@@ -226,11 +228,19 @@ static int mv3310_probe(struct phy_device *phydev)
static int mv3310_suspend(struct phy_device *phydev)
{
- return 0;
+ return phy_set_bits_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL,
+ MV_V2_PORT_CTRL_PWRDOWN);
}
static int mv3310_resume(struct phy_device *phydev)
{
+ int ret;
+
+ ret = phy_clear_bits_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL,
+ MV_V2_PORT_CTRL_PWRDOWN);
+ if (ret)
+ return ret;
+
return mv3310_hwmon_config(phydev, true);
}
@@ -474,6 +484,8 @@ static struct phy_driver mv3310_drivers[] = {
.name = "mv88x2110",
.get_features = genphy_c45_pma_read_abilities,
.probe = mv3310_probe,
+ .suspend = mv3310_suspend,
+ .resume = mv3310_resume,
.soft_reset = genphy_no_soft_reset,
.config_init = mv3310_config_init,
.config_aneg = mv3310_config_aneg,