|
@@ -679,6 +679,30 @@ void phy_detach(struct phy_device *phydev)
|
|
|
}
|
|
|
EXPORT_SYMBOL(phy_detach);
|
|
|
|
|
|
+int phy_suspend(struct phy_device *phydev)
|
|
|
+{
|
|
|
+ struct phy_driver *phydrv = to_phy_driver(phydev->dev.driver);
|
|
|
+ struct ethtool_wolinfo wol;
|
|
|
+
|
|
|
+ /* If the device has WOL enabled, we cannot suspend the PHY */
|
|
|
+ wol.cmd = ETHTOOL_GWOL;
|
|
|
+ phy_ethtool_get_wol(phydev, &wol);
|
|
|
+ if (wol.wolopts)
|
|
|
+ return -EBUSY;
|
|
|
+
|
|
|
+ if (phydrv->suspend)
|
|
|
+ return phydrv->suspend(phydev);
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int phy_resume(struct phy_device *phydev)
|
|
|
+{
|
|
|
+ struct phy_driver *phydrv = to_phy_driver(phydev->dev.driver);
|
|
|
+
|
|
|
+ if (phydrv->resume)
|
|
|
+ return phydrv->resume(phydev);
|
|
|
+ return 0;
|
|
|
+}
|
|
|
|
|
|
/* Generic PHY support and helper functions */
|
|
|
|