Closed ukleinek closed 4 years ago
FTR: My suggestion to use /dev/gpioctl is actually #13 I think. (The issue isn't very verbose, so I'm not sure.)
Yeah, this has come up before with Atmel kernels on the other periphery projects, but unfortunately there is no platform agnostic way to map GPIO pin number to the exported pin directory, especially when drivers invent their own directory names in a hard-coded kasprintf()
. See also vsergeev/c-periphery#8.
Character device GPIOs are the way to go. They're implemented in devel
and will be released imminently in v2.0.0, along with other improvements and fixes (including your timeout=None fix).
Note: it would technically be possible to pass in an extra parameter to the constructor with the expected exported pin name, but it just doesn't seem right to sully the API for a non-compliant driver.
Hello,
running periphery on an Arietta G25:
This fails because the gpio directory appears with the name
pioB13
. That's because the driver sets names for the gpiochip in the kernel. See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/pinctrl/pinctrl-at91.c#n1896I don't know how this can be (easily) handled in periphery, probably the sanest approach is to use /dev/gpioctl instead of the (deprecated) /sys/class/gpio approach.