Embedded Linux DISCUSSION

Linux GPIO character-device API or a kernel driver: which fits a new sensor interface?

Started by kerrin embedded Linux GPIOkernel driverslibgpiodsensor interfaceuserspace timing
3 replies 248 views 4 participants
Latest activity · 27 Sep 2026

Linux GPIO character-device API or a kernel driver: which fits a new sensor interface?

kerrin Embedded Linux Forum
#1

Community replies 3

Re: Linux GPIO character-device API or a kernel driver: which fits a new sensor interface?

#2

Check the device's existing bus and subsystem support first. A kernel driver can provide standardized access, resource ownership and integration with power management. The GPIO character-device API is useful, but the kernel documentation advises using appropriate existing subsystem drivers for devices they cover.

Re: Linux GPIO character-device API or a kernel driver: which fits a new sensor interface?

#3

If userspace GPIO is appropriate, define direction, polarity, edge handling and line ownership explicitly. Consider the latency and event rate the application must tolerate. A line-event timestamp is not the same as the time a userspace handler gets scheduled to process it.

Re: Linux GPIO character-device API or a kernel driver: which fits a new sensor interface?

#4

Test disconnects, process restarts and suspend or resume behavior where applicable. Avoid direct register access that bypasses other drivers' ownership. Keep the exact kernel and libgpiod versions in deployment records so an API migration does not silently change the interface behavior.

TEP COMMUNITY