Re: GPIO Char device and tools/gpio/gpio-utils.c

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

 



2017-07-31 14:22 GMT+02:00 Linus Walleij <linus.walleij@xxxxxxxxxx>:
> On Fri, Jul 21, 2017 at 7:26 PM, Jonathan Bennett
> <jbennett@xxxxxxxxxxxxxx> wrote:
>
>> So to use GPIO pins through the chardev interface, one has to hold on to the file
>> descriptor to keep the pins from reverting to their initial state.  Is this a bug, or
>> intended behavior?
>
> I do not remember putting any code in that would explicitly return the
> GPIO line to
> the inital state.
>
> That said it makes some weird sense as people might be probing around with
> the tools and then it would be good behaviour to leave things in the room like
> they were arranged when you entered, don't you think?
>
> I'd like to hear Bartosz take on this though, he is more versed with userspace
> GPIO than me these days, and talk directly to users of this feature.
>
> Yours,
> Linus Walleij

Currently if a pin is driven low or high by HW design, it will return
to the default state after releasing the file descriptor. Floating
pins stay the way they were set even after closing the fd. While to me
this behavior looks correct, we could potentially add a new flag to
the request structure e.g. GPIO_REQUEST_RESTORE_STATE that would make
gpiolib explicitly restore the previous state even for floating pins
after close().

Best regards,
Bartosz Golaszewski
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux