Re: [PATCH] usb: phy: phy-generic: No need to call gpiod_direction_output() twice

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

 



Hi Felipe,

On Fri, Jan 30, 2015 at 7:59 PM, Felipe Balbi <balbi@xxxxxx> wrote:

>> -     gpiod_direction_output(nop->gpiod_reset, !asserted);
>> +     if (asserted)
>> +             goto skip_delay;
>
> why skip it ?

Let's suppose we have an active-low GPIO USB phy reset pin.

In usb_gen_phy_init() we call nop_reset_set(nop, 0); and 'assert' is zero.

Then we do:

- Put the GPIO into 0
- Wait a bit
- Put it back to 1.

In usb_gen_phy_shutdown, we call nop_reset_set(nop, 1) and assert is one.

Then we should simply do:

- Put GPIO reset into 0.

,as we the PHY is no more in usage.

That's the reason we don't need the delay when assert is one.

Also, the code prior to the gpiod introduction also skips the delay
for the assert == 1 case, so this patch restores the original
behaviour.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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

  Powered by Linux