|
@@ -43,16 +43,25 @@ static int smsc_phy_ack_interrupt(struct phy_device *phydev)
|
|
|
|
|
|
static int smsc_phy_config_init(struct phy_device *phydev)
|
|
static int smsc_phy_config_init(struct phy_device *phydev)
|
|
{
|
|
{
|
|
|
|
+ int __maybe_unused len;
|
|
|
|
+ struct device *dev __maybe_unused = &phydev->dev;
|
|
|
|
+ struct device_node *of_node __maybe_unused = dev->of_node;
|
|
int rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS);
|
|
int rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS);
|
|
|
|
+ int enable_energy = 1;
|
|
|
|
|
|
if (rc < 0)
|
|
if (rc < 0)
|
|
return rc;
|
|
return rc;
|
|
|
|
|
|
- /* Enable energy detect mode for this SMSC Transceivers */
|
|
|
|
- rc = phy_write(phydev, MII_LAN83C185_CTRL_STATUS,
|
|
|
|
- rc | MII_LAN83C185_EDPWRDOWN);
|
|
|
|
- if (rc < 0)
|
|
|
|
- return rc;
|
|
|
|
|
|
+ if (of_find_property(of_node, "smsc,disable-energy-detect", &len))
|
|
|
|
+ enable_energy = 0;
|
|
|
|
+
|
|
|
|
+ if (enable_energy) {
|
|
|
|
+ /* Enable energy detect mode for this SMSC Transceivers */
|
|
|
|
+ rc = phy_write(phydev, MII_LAN83C185_CTRL_STATUS,
|
|
|
|
+ rc | MII_LAN83C185_EDPWRDOWN);
|
|
|
|
+ if (rc < 0)
|
|
|
|
+ return rc;
|
|
|
|
+ }
|
|
|
|
|
|
return smsc_phy_ack_interrupt(phydev);
|
|
return smsc_phy_ack_interrupt(phydev);
|
|
}
|
|
}
|