Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v2 net-next] net: phy: realtek: enable ALDPS to save power for RTL8211F
@ 2020-09-21 1:13 Jisheng Zhang
2020-09-21 15:13 ` Andrew Lunn
2020-09-21 21:50 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Jisheng Zhang @ 2020-09-21 1:13 UTC (permalink / raw)
To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
Jakub Kicinski
Cc: netdev, linux-kernel
Enable ALDPS(Advanced Link Down Power Saving) to save power when
link down.
Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
---
Since v1:
- add what does ALDPS mean.
- replace magic number 0x18 with RTL8211F_PHYCR1 macro.
drivers/net/phy/realtek.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
index 95dbe5e8e1d8..4bf54cded48a 100644
--- a/drivers/net/phy/realtek.c
+++ b/drivers/net/phy/realtek.c
@@ -27,11 +27,16 @@
#define RTL821x_EXT_PAGE_SELECT 0x1e
#define RTL821x_PAGE_SELECT 0x1f
+#define RTL8211F_PHYCR1 0x18
#define RTL8211F_INSR 0x1d
#define RTL8211F_TX_DELAY BIT(8)
#define RTL8211F_RX_DELAY BIT(3)
+#define RTL8211F_ALDPS_PLL_OFF BIT(1)
+#define RTL8211F_ALDPS_ENABLE BIT(2)
+#define RTL8211F_ALDPS_XTAL_OFF BIT(12)
+
#define RTL8211E_TX_DELAY BIT(1)
#define RTL8211E_RX_DELAY BIT(2)
#define RTL8211E_MODE_MII_GMII BIT(3)
@@ -178,8 +183,12 @@ static int rtl8211f_config_init(struct phy_device *phydev)
{
struct device *dev = &phydev->mdio.dev;
u16 val_txdly, val_rxdly;
+ u16 val;
int ret;
+ val = RTL8211F_ALDPS_ENABLE | RTL8211F_ALDPS_PLL_OFF | RTL8211F_ALDPS_XTAL_OFF;
+ phy_modify_paged_changed(phydev, 0xa43, RTL8211F_PHYCR1, val, val);
+
switch (phydev->interface) {
case PHY_INTERFACE_MODE_RGMII:
val_txdly = 0;
--
2.28.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2 net-next] net: phy: realtek: enable ALDPS to save power for RTL8211F
2020-09-21 1:13 [PATCH v2 net-next] net: phy: realtek: enable ALDPS to save power for RTL8211F Jisheng Zhang
@ 2020-09-21 15:13 ` Andrew Lunn
2020-09-21 21:50 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2020-09-21 15:13 UTC (permalink / raw)
To: Jisheng Zhang
Cc: Heiner Kallweit, Russell King, David S. Miller, Jakub Kicinski,
netdev, linux-kernel
On Mon, Sep 21, 2020 at 09:13:54AM +0800, Jisheng Zhang wrote:
> Enable ALDPS(Advanced Link Down Power Saving) to save power when
> link down.
>
> Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 net-next] net: phy: realtek: enable ALDPS to save power for RTL8211F
2020-09-21 1:13 [PATCH v2 net-next] net: phy: realtek: enable ALDPS to save power for RTL8211F Jisheng Zhang
2020-09-21 15:13 ` Andrew Lunn
@ 2020-09-21 21:50 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-09-21 21:50 UTC (permalink / raw)
To: Jisheng.Zhang; +Cc: andrew, hkallweit1, linux, kuba, netdev, linux-kernel
From: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Date: Mon, 21 Sep 2020 09:13:54 +0800
> Enable ALDPS(Advanced Link Down Power Saving) to save power when
> link down.
>
> Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
> ---
> Since v1:
> - add what does ALDPS mean.
> - replace magic number 0x18 with RTL8211F_PHYCR1 macro.
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-21 21:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-21 1:13 [PATCH v2 net-next] net: phy: realtek: enable ALDPS to save power for RTL8211F Jisheng Zhang
2020-09-21 15:13 ` Andrew Lunn
2020-09-21 21:50 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).