On Tue, Jul 15, 2014 at 04:36:20PM +0900, Alexandre Courbot wrote:

> Direction and initial value, on the other hand, are clearly properties
> that ought to be set by the driver itself. Thus my expectation here
> would be that the driver sets the GPIO direction and initial value as
> soon as it gets it using gpiod_direction_output(). In other words,

Well, it's a bit of a mix really - from a hardware point of view they
normally are actually often fixed.

> there is no replacement for gpio_request_one() with the gpiod
> interface. Is there any use-case that cannot be covered by calling
> gpiod_direction_output() right after gpiod_get()? AFAICT this is what
> gpio_request_one() was doing anyway.

Right, the original goal was to provide a better interface for
requesting a GPIO - it saves a lot of error handling code throughout the
kernel and avoids the possibility of bugs due to users forgetting to
mark the directio for the GPIO.  Having a direct replacement also makes
conversions to gpiod easier.

Attachment: signature.asc
Description: Digital signature

Reply via email to