On Wed, Jan 28, 2015 at 10:43:11AM -0200, Fabio Estevam wrote: > On Wed, Jan 28, 2015 at 10:21 AM, Fabio Estevam <festevam@xxxxxxxxx> wrote: > > Hi Felipe, > > > > On Tue, Jan 27, 2015 at 7:35 PM, Felipe Balbi <balbi@xxxxxx> wrote: > > > >> sounds like a bug in chipidea now. There are no errors from the PHY, > >> which means that the PHY is code is behaving. > > > > Not sure it is a bug in the chipidea driver. > > > > The phy-generic driver is not putting the reset gpio back to 1 as I > > can confirm with a scope. It stays forever at 0 and then I get a hang. > > > > If I reset the PHY in the bootloader, then the kernel boots fine and > > USB host works. > > > > Also, if I revert the patch that introduces the gpiod API then the > > gpio reset is correctly put at 1 and things work fine. > > > > All I need is to put the gpio phy reset into logic level 1 :-) > > If I add the following change on top of Robert's patch then the PHY > reset GPIO goes to 1 and things work again: > > --- a/drivers/usb/phy/phy-generic.c > +++ b/drivers/usb/phy/phy-generic.c > @@ -64,7 +64,7 @@ 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); > + gpiod_direction_output(nop->gpiod_reset, !asserted); I don't want to change direction all the time, some controllers might not be glitch free, but I agree that direction has to be set. It looks like we're missing a gpiod_direction_output() call from probe() so that this gpiod_set_value() works fine. cheers -- balbi
Attachment:
signature.asc
Description: Digital signature