I am using the SAMA5D27 SoM1 Ek Board (Microchip) and am using Yocto.
My linux-at91 is 4.14 version.
In this linux-at91 kernel by default sysfs gpio export
and userspace control support is removed.
How do I enable export gpio in sysfs?
I am using the SAMA5D27 SoM1 Ek Board (Microchip) and am using Yocto.
My linux-at91 is 4.14 version.
In this linux-at91 kernel by default sysfs gpio export
and userspace control support is removed.
How do I enable export gpio in sysfs?
Straight (but bad) answer: you'll need to rebuild your kernel with CONFIG_GPIO_SYSFS
option enabled (=y
).
Good answer: using GPIO via sysfs is considered obsolete now (starting from July 2008) and it's discouraged to use it. That's why it was disabled in kernel by default (in v4.10). See this commit message from Linus Walleij (who is GPIO maintainer in Linux kernel):
ARM: defconfig: drop GPIO_SYSFS on multiplatforms
The sysfs ABI to GPIO is marked obsolete and should not be
encouraged. Users should be encouraged to switch to using the
character device.
Let's begin by removing it from the multi defconfigs. Then
as time goes by I can aggressively remove it from other
defconfigs.
So basically it's recommended to use /dev/gpiochip*
character device files now for GPIO manipulations (instead of sysfs way). For example, you can build user-space utils from tools/gpio/ and use them to test GPIO via that character device. You might want to write some custom user-space app to work with GPIO via character device, for your particular task. Read Documentation/ABI/testing/gpio-cdev file for details. This way you won't need to rebuild the kernel. Also, old sysfs ABI will be removed in 2020, as stated here.