- phy-reset-active-high : If present then the reset sequence using the GPIO
specified in the "phy-reset-gpios" property is reversed (H=reset state,
L=operation state).
+- phy-reset-in-suspend : keeps the phy in reset during suspend mode to
+ avoid back-drives through the reset line.
- phy-supply : regulator that powers the Ethernet PHY.
- phy-handle : phandle to the PHY device connected to this device.
- fixed-link : Assume a fixed link. See fixed-link.txt in the same directory.
dev_err(&pdev->dev, "failed to get phy-reset-gpios: %d\n", err);
return err;
}
+ fep->phy_reset_in_suspend = of_find_property(np,
+ "phy-reset-in-suspend",
+ NULL);
/* Enable PHY and wait for stabilization */
gpio_set_value_cansleep(fep->phy_reset_gpio, !fep->active_high);
if (fep->phy_reset_duration < 20)
if (!(fep->wol_flag & FEC_WOL_FLAG_ENABLE)) {
fec_irqs_disable(ndev);
pinctrl_pm_select_sleep_state(&fep->pdev->dev);
+ if (fep->phy_reset_in_suspend)
+ gpio_set_value_cansleep(fep->phy_reset_gpio, fep->active_high);
} else {
disable_irq(fep->wake_irq);
enable_irq_wake(fep->wake_irq);
return ret;
} else if (fep->mii_bus_share && !ndev->phydev) {
pinctrl_pm_select_sleep_state(&fep->pdev->dev);
+ if (fep->phy_reset_in_suspend)
+ gpio_set_value_cansleep(fep->phy_reset_gpio, fep->active_high);
}
rtnl_unlock();
fep->wol_flag &= ~FEC_WOL_FLAG_SLEEP_ON;
} else {
pinctrl_pm_select_default_state(&fep->pdev->dev);
+ if (fep->phy_reset_in_suspend)
+ gpio_set_value_cansleep(fep->phy_reset_gpio, !fep->active_high);
}
fec_restart(ndev);
netif_tx_lock_bh(ndev);
phy_start(ndev->phydev);
} else if (fep->mii_bus_share && !ndev->phydev) {
pinctrl_pm_select_default_state(&fep->pdev->dev);
+ if (fep->phy_reset_in_suspend)
+ gpio_set_value_cansleep(fep->phy_reset_gpio, !fep->active_high);
/* And then recovery mii bus */
ret = fec_restore_mii_bus(ndev);
}