lkml.org 
[lkml]   [2019]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH net-next v2 1/3] net: phy: marvell10g: implement suspend/resume callbacks
Date
This patch adds the suspend/resume callbacks for Marvell 10G PHYs. The
three PCS (base-t, base-r and 1000base-x) are set in low power (the PCS
are powered down) when the PHY isn't used.

Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
---
drivers/net/phy/marvell10g.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 79106e70010f..92462344c5ad 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -226,11 +226,25 @@ static int mv3310_probe(struct phy_device *phydev)

static int mv3310_suspend(struct phy_device *phydev)
{
+ phy_modify_mmd(phydev, MDIO_MMD_PCS, MV_PCS_BASE_T + MDIO_CTRL1,
+ MDIO_CTRL1_LPOWER, MDIO_CTRL1_LPOWER);
+ phy_modify_mmd(phydev, MDIO_MMD_PCS, MV_PCS_BASE_R + MDIO_CTRL1,
+ MDIO_CTRL1_LPOWER, MDIO_CTRL1_LPOWER);
+ phy_modify_mmd(phydev, MDIO_MMD_PCS, MV_PCS_1000BASEX + MDIO_CTRL1,
+ MDIO_CTRL1_LPOWER, MDIO_CTRL1_LPOWER);
+
return 0;
}

static int mv3310_resume(struct phy_device *phydev)
{
+ phy_modify_mmd(phydev, MDIO_MMD_PCS, MV_PCS_BASE_T + MDIO_CTRL1,
+ MDIO_CTRL1_LPOWER, 0);
+ phy_modify_mmd(phydev, MDIO_MMD_PCS, MV_PCS_BASE_R + MDIO_CTRL1,
+ MDIO_CTRL1_LPOWER, 0);
+ phy_modify_mmd(phydev, MDIO_MMD_PCS, MV_PCS_1000BASEX + MDIO_CTRL1,
+ MDIO_CTRL1_LPOWER, 0);
+
return mv3310_hwmon_config(phydev, true);
}

--
2.20.1
\
 
 \ /
  Last update: 2019-03-01 12:01    [W:0.209 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site