aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/phy_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/phy/phy_device.c')
-rw-r--r--drivers/net/phy/phy_device.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 29546a206045..4cc75a290c06 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -779,7 +779,35 @@ static int genphy_config_init(struct phy_device *phydev)
779 779
780 return 0; 780 return 0;
781} 781}
782int genphy_suspend(struct phy_device *phydev)
783{
784 int value;
785
786 mutex_lock(&phydev->lock);
787
788 value = phy_read(phydev, MII_BMCR);
789 phy_write(phydev, MII_BMCR, (value | BMCR_PDOWN));
790
791 mutex_unlock(&phydev->lock);
792
793 return 0;
794}
795EXPORT_SYMBOL(genphy_suspend);
782 796
797int genphy_resume(struct phy_device *phydev)
798{
799 int value;
800
801 mutex_lock(&phydev->lock);
802
803 value = phy_read(phydev, MII_BMCR);
804 phy_write(phydev, MII_BMCR, (value & ~BMCR_PDOWN));
805
806 mutex_unlock(&phydev->lock);
807
808 return 0;
809}
810EXPORT_SYMBOL(genphy_resume);
783 811
784/** 812/**
785 * phy_probe - probe and init a PHY device 813 * phy_probe - probe and init a PHY device
@@ -855,7 +883,6 @@ int phy_driver_register(struct phy_driver *new_driver)
855{ 883{
856 int retval; 884 int retval;
857 885
858 memset(&new_driver->driver, 0, sizeof(new_driver->driver));
859 new_driver->driver.name = new_driver->name; 886 new_driver->driver.name = new_driver->name;
860 new_driver->driver.bus = &mdio_bus_type; 887 new_driver->driver.bus = &mdio_bus_type;
861 new_driver->driver.probe = phy_probe; 888 new_driver->driver.probe = phy_probe;
@@ -890,6 +917,8 @@ static struct phy_driver genphy_driver = {
890 .features = 0, 917 .features = 0,
891 .config_aneg = genphy_config_aneg, 918 .config_aneg = genphy_config_aneg,
892 .read_status = genphy_read_status, 919 .read_status = genphy_read_status,
920 .suspend = genphy_suspend,
921 .resume = genphy_resume,
893 .driver = {.owner= THIS_MODULE, }, 922 .driver = {.owner= THIS_MODULE, },
894}; 923};
895 924