MLK-10919 net: phy: micrel: add ksz8081 resume function
Add ksz8081 resume function since the phy has some non-standard register init process that has some fixup. Signed-off-by: Fugang Duan <B38611@freescale.com> (cherry picked from commit: 65c6e997b8e020b9e87d1af23c94c15c13e3d2e3)pull/10/head
parent
ab841a45cf
commit
191dee93ac
|
@ -791,6 +791,22 @@ static int kszphy_probe(struct phy_device *phydev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int ksz8081_resume(struct phy_device *phydev)
|
||||
{
|
||||
int value;
|
||||
|
||||
mutex_lock(&phydev->lock);
|
||||
value = phy_read(phydev, MII_BMCR);
|
||||
phy_write(phydev, MII_BMCR, value & ~BMCR_PDOWN);
|
||||
|
||||
value = phy_scan_fixups(phydev);
|
||||
if (value < 0)
|
||||
return value;
|
||||
mutex_unlock(&phydev->lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct phy_driver ksphy_driver[] = {
|
||||
{
|
||||
.phy_id = PHY_ID_KS8737,
|
||||
|
@ -931,7 +947,7 @@ static struct phy_driver ksphy_driver[] = {
|
|||
.get_strings = kszphy_get_strings,
|
||||
.get_stats = kszphy_get_stats,
|
||||
.suspend = kszphy_suspend,
|
||||
.resume = kszphy_resume,
|
||||
.resume = ksz8081_resume,
|
||||
}, {
|
||||
.phy_id = PHY_ID_KSZ8061,
|
||||
.name = "Micrel KSZ8061",
|
||||
|
|
|
@ -295,7 +295,7 @@ static int phy_needs_fixup(struct phy_device *phydev, struct phy_fixup *fixup)
|
|||
}
|
||||
|
||||
/* Runs any matching fixups for this phydev */
|
||||
static int phy_scan_fixups(struct phy_device *phydev)
|
||||
int phy_scan_fixups(struct phy_device *phydev)
|
||||
{
|
||||
struct phy_fixup *fixup;
|
||||
|
||||
|
@ -315,6 +315,7 @@ static int phy_scan_fixups(struct phy_device *phydev)
|
|||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(phy_scan_fixups);
|
||||
|
||||
static int phy_bus_match(struct device *dev, struct device_driver *drv)
|
||||
{
|
||||
|
|
|
@ -910,6 +910,7 @@ int phy_start_interrupts(struct phy_device *phydev);
|
|||
void phy_print_status(struct phy_device *phydev);
|
||||
int phy_set_max_speed(struct phy_device *phydev, u32 max_speed);
|
||||
|
||||
int phy_scan_fixups(struct phy_device *phydev);
|
||||
int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,
|
||||
int (*run)(struct phy_device *));
|
||||
int phy_register_fixup_for_id(const char *bus_id,
|
||||
|
|
Loading…
Reference in New Issue