diff options
| author | Oleksij Rempel <[email protected]> | 2022-03-11 08:50:14 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2022-03-12 11:50:56 +0000 |
| commit | 4d17d43de9d186150b3289ce99d7a79fcff202f9 (patch) | |
| tree | 2b6b8ed0b5677f93c245a7a21ccc30b972c4983b /drivers/net/usb/asix_devices.c | |
| parent | net: usb: asix: make use of mdiobus_get_phy and phy_connect_direct (diff) | |
| download | kernel-4d17d43de9d186150b3289ce99d7a79fcff202f9.tar.gz kernel-4d17d43de9d186150b3289ce99d7a79fcff202f9.zip | |
net: usb: asix: suspend embedded PHY if external is used
In case external PHY is used, we need to take care of embedded PHY.
Since there are no methods to disable this PHY from the MAC side and
keeping RMII reference clock, we need to suspend it.
This patch will reduce electrical noise (PHY is continuing to send FLPs)
and power consumption by 0,22W.
Signed-off-by: Oleksij Rempel <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'drivers/net/usb/asix_devices.c')
| -rw-r--r-- | drivers/net/usb/asix_devices.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c index fb617eb551bb..38e47a93fb83 100644 --- a/drivers/net/usb/asix_devices.c +++ b/drivers/net/usb/asix_devices.c @@ -679,6 +679,22 @@ static int ax88772_init_phy(struct usbnet *dev) phy_attached_info(priv->phydev); + if (priv->embd_phy) + return 0; + + /* In case main PHY is not the embedded PHY and MAC is RMII clock + * provider, we need to suspend embedded PHY by keeping PLL enabled + * (AX_SWRESET_IPPD == 0). + */ + priv->phydev_int = mdiobus_get_phy(priv->mdio, AX_EMBD_PHY_ADDR); + if (!priv->phydev_int) { + netdev_err(dev->net, "Could not find internal PHY\n"); + return -ENODEV; + } + + priv->phydev_int->mac_managed_pm = 1; + phy_suspend(priv->phydev_int); + return 0; } @@ -734,7 +750,7 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) return ret; priv->phy_addr = ret; - priv->embd_phy = ((priv->phy_addr & 0x1f) == 0x10); + priv->embd_phy = ((priv->phy_addr & 0x1f) == AX_EMBD_PHY_ADDR); ret = asix_read_cmd(dev, AX_CMD_STATMNGSTS_REG, 0, 0, 1, &priv->chipcode, 0); |
