Re: [PATCH] usb: pass flags parameter to gpiod_get functions

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

 



On 03/28/2015 07:22 PM, Uwe Kleine-König wrote:
Hello,

On Sat, Mar 28, 2015 at 09:38:12AM +0100, Robert Jarzmik wrote:
Alexandre Courbot <acourbot@xxxxxxxxxx> writes:

On 03/28/2015 04:30 AM, Uwe Kleine-König wrote:
Looks good, but can't we also merge the call to gpiod_direction to avoid using
GPIOD_ASIS? The golden rule is that a direction should not remain in an unknown
state after being requested.

This would also require adding a flag to the alternative calls to
gpio_request_one(). At first sight it seems to be doable, but I don't know these
drivers well enough to have an informed opinion.
Is the following information enough to grant the "doable" ? :
  - gpiod_reset is always an output gpio
  - gpiod_vbus is aslways an input gpio

Moreover, I seem to remember there was a bit of back and forth around the reset
gpio, so there's something subtle I don't remember (Fabio maybe your memory is
better than mine here) ...
I looked at simplifying here, but didn't understand the whole picture
here. As my focus is on removing the hack to make the fourth argument to
gpiod_get optional I just kept the status quo here.

Please dont worry then, we would like to discourage the use of GPIOD_ASIS to avoid having GPIOs in an unknown state, but if there is some hackery involved somewhere, then your change will at least bring us closer to the point where we can remove our own macro hackery in gpiolib.
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
--
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