Re: [PATCH v2 1/3] usb: phy: generic: migrate to gpio_desc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 28, 2015 at 01:40:59PM -0200, Fabio Estevam wrote:
> On Wed, Jan 28, 2015 at 12:04 PM, Felipe Balbi <balbi@xxxxxx> wrote:
> 
> > 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.
> 
> We could do like that:
> 
> nop->gpiod_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
> 
> and it works.
> 
> However, the initial value can't be set to 0 always as it depends if
> the pin is active low or high.
> 
> I tried to do like this:
> 
>         nop->gpiod_reset = devm_gpiod_get_optional(dev, "reset");
>         if (gpiod_is_active_low(nop->gpiod_reset))
>             gpiod_direction_output(nop->gpiod_reset, GPIOD_OUT_LOW);
>         else
>             gpiod_direction_output(nop->gpiod_reset, GPIOD_OUT_HIGH);

won't the descriptor itself handle that for us ? Linus ?

> ,but then the kernel does not even boot.

hmm... weird.

> I have sent a formal patch to the list where I use
> gpiod_direction_output inside nop_reset_set().
> 
> Please let me know if you are happy with it.

I want to hear from Linus W first.

-- 
balbi

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux