return of_node->child;
}
-static int ytphy_inverted(struct phy_device *phydev)
+static void ytphy_link_change_notify(struct phy_device *phydev)
{
u32 val;
struct ytphy_priv_t *ytphy_priv = phydev->priv;
+ if (phydev->speed < 0)
+ return;
+
val = ytphy_read_ext(phydev, YTPHY_EXTREG_RGMII_CONFIG1);
switch (phydev->speed) {
case SPEED_1000:
default:
break;
}
-
- return ytphy_write_ext(phydev, YTPHY_EXTREG_RGMII_CONFIG1, val);
+ ytphy_write_ext(phydev, YTPHY_EXTREG_RGMII_CONFIG1, val);
}
-
static int ytphy_of_config(struct phy_device *phydev)
{
const struct device_node *of_node;
phydev->speed = speed;
phydev->duplex = duplex;
- ytphy_inverted(phydev);
-
return 0;
}
return ret;
}
-static int yt8531_read_status(struct phy_device *phydev)
-{
- int ret;
-
- ret = genphy_read_status(phydev);
- if (ret)
- return ret;
-
- return ytphy_inverted(phydev);
-}
-
static int ytphy_probe(struct phy_device *phydev)
{
struct device *dev = &phydev->mdio.dev;
.read_status = yt8521_read_status,
.suspend = yt8521_suspend,
.resume = yt8521_resume,
+ .link_change_notify = ytphy_link_change_notify,
#if (YTPHY_WOL_FEATURE_ENABLE)
.get_wol = &ytphy_wol_feature_get,
.set_wol = &ytphy_wol_feature_set,
.probe = ytphy_probe,
.config_aneg = genphy_config_aneg,
.config_init = yt8531_config_init,
- .read_status = yt8531_read_status,
+ .read_status = genphy_read_status,
.suspend = genphy_suspend,
.resume = genphy_resume,
+ .link_change_notify = ytphy_link_change_notify,
#if (YTPHY_WOL_FEATURE_ENABLE)
.get_wol = &ytphy_wol_feature_get,
.set_wol = &ytphy_wol_feature_set,