On Sun, Dec 2, 2018, 8:42 PM Ken Shirriff <[email protected] wrote:

> /sys/class/gpio/export will unexport a pin if accessed twice. Is this a
> bug?
>
> $ echo 13 > /sys/class/gpio/export
> $ ls /sys/class/gpio/gpio13
> active_low  device  direction  edge  label  power  subsystem  uevent  value
> $ echo 13 > /sys/class/gpio/export
> -bash: echo: write error: Operation not permitted
> $ ls /sys/class/gpio/gpio13
> ls: cannot access '/sys/class/gpio/gpio13': No such file or directory
>
> Expected behavior: gpio13 should still be there after the second export.
> Observed behavior: gpio13 disappears after the second export.
>
> This is with the latest Debian kernel (4.14.71-ti-r80).
>
> Is there a recommended way to export a gpio pin if it may already exist? I
> want to write a script to set up the pins. I could check if each pin
> already exists, but that's a recipe for race conditions as well as being
> inconvenient.
>

Don't use that interface...

https://blog.adafruit.com/2018/12/02/update-new-gpio-interface-for-linux-user-space-gpio-character-device-api-and-libgpiod-linuxpiter/

Regards,

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAOCHtYg3E_Dm29%2B-4TMbWFxXEtjWQE9vk0ZHVc2e_53QQJ6_Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to