diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c index 48af0687bf110ab8f869cd563478dca34e619922..70be50b734b28972a89c426028c7166744d7581a 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 */