diff options
Diffstat (limited to 'drivers/net/phy/mdio_device.c')
-rw-r--r-- | drivers/net/phy/mdio_device.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/phy/mdio_device.c b/drivers/net/phy/mdio_device.c index 887076292e50..e282600bd83e 100644 --- a/drivers/net/phy/mdio_device.c +++ b/drivers/net/phy/mdio_device.c @@ -16,6 +16,7 @@ #include <linux/mii.h> #include <linux/module.h> #include <linux/phy.h> +#include <linux/reset.h> #include <linux/slab.h> #include <linux/string.h> #include <linux/unistd.h> @@ -116,10 +117,18 @@ void mdio_device_reset(struct mdio_device *mdiodev, int value) { unsigned int d; - if (!mdiodev->reset) + if (!mdiodev->reset_gpio && !mdiodev->reset_ctrl) return; - gpiod_set_value(mdiodev->reset, value); + if (mdiodev->reset_gpio) + gpiod_set_value(mdiodev->reset_gpio, value); + + if (mdiodev->reset_ctrl) { + if (value) + reset_control_assert(mdiodev->reset_ctrl); + else + reset_control_deassert(mdiodev->reset_ctrl); + } d = value ? mdiodev->reset_assert_delay : mdiodev->reset_deassert_delay; if (d) |