[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230217034230.1249661-13-andrew@lunn.ch>
Date: Fri, 17 Feb 2023 04:42:24 +0100
From: Andrew Lunn <andrew@...n.ch>
To: netdev <netdev@...r.kernel.org>
Cc: Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <vladimir.oltean@....com>,
Sean Wang <sean.wang@...iatek.com>,
Landen Chao <Landen.Chao@...iatek.com>,
DENG Qingfang <dqfext@...il.com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Doug Berger <opendmb@...il.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>,
Wei Fang <wei.fang@....com>,
Shenwei Wang <shenwei.wang@....com>,
Clark Wang <xiaoning.wang@....com>,
NXP Linux Team <linux-imx@....com>,
UNGLinuxDriver@...rochip.com, Byungho An <bh74.an@...sung.com>,
Giuseppe Cavallaro <peppe.cavallaro@...com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <rmk+kernel@...linux.org.uk>,
Woojung Huh <woojung.huh@...rochip.com>,
Oleksij Rempel <linux@...pel-privat.de>,
Andrew Lunn <andrew@...n.ch>
Subject: [PATCH RFC 12/18] net: dsa: mt7530: Call phylib for set_eee and get_eee
phylib should be called in order to manage the EEE settings in the
PHY, and to return EEE status such are supported link modes, and what
the link peer supports.
Signed-off-by: Andrew Lunn <andrew@...n.ch>
---
drivers/net/dsa/mt7530.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index 214450378978..a472353f14f8 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -3124,10 +3124,13 @@ static int mt753x_get_mac_eee(struct dsa_switch *ds, int port,
{
struct mt7530_priv *priv = ds->priv;
u32 eeecr = mt7530_read(priv, MT7530_PMEEECR_P(port));
+ struct dsa_port *dp = dsa_to_port(ds, port);
e->tx_lpi_enabled = !(eeecr & LPI_MODE_EN);
e->tx_lpi_timer = GET_LPI_THRESH(eeecr);
+ if (dp->slave->phydev)
+ return phy_ethtool_get_eee(dp->slave->phydev, e);
return 0;
}
@@ -3136,6 +3139,7 @@ static int mt753x_set_mac_eee(struct dsa_switch *ds, int port,
{
struct mt7530_priv *priv = ds->priv;
u32 set, mask = LPI_THRESH_MASK | LPI_MODE_EN;
+ struct dsa_port *dp = dsa_to_port(ds, port);
if (e->tx_lpi_timer > 0xFFF)
return -EINVAL;
@@ -3146,6 +3150,8 @@ static int mt753x_set_mac_eee(struct dsa_switch *ds, int port,
set |= LPI_MODE_EN;
mt7530_rmw(priv, MT7530_PMEEECR_P(port), mask, set);
+ if (dp->slave->phydev)
+ return phy_ethtool_set_eee(dp->slave->phydev, e);
return 0;
}
--
2.39.1
Powered by blists - more mailing lists