diff options
-rw-r--r-- | drivers/usb/phy/phy-generic.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c index 48af0687bf11..70be50b734b2 100644 --- a/drivers/usb/phy/phy-generic.c +++ b/drivers/usb/phy/phy-generic.c @@ -64,11 +64,12 @@ static int nop_set_suspend(struct usb_phy *x, int suspend) static void nop_reset_set(struct usb_phy_generic *nop, int asserted) { - if (nop->gpiod_reset) - gpiod_set_value(nop->gpiod_reset, asserted); + if (!nop->gpiod_reset) + return; - if (!asserted) - usleep_range(10000, 20000); + gpiod_direction_output(nop->gpiod_reset, !asserted); + usleep_range(10000, 20000); + gpiod_set_value(nop->gpiod_reset, asserted); } /* interface to regulator framework */ |