rust-embedded / linux-embedded-hal

Implementation of the `embedded-hal` traits for Linux devices
Apache License 2.0
236 stars 40 forks source link

Request: Replace sysfs-gpio with gpio-cdev #20

Closed drinkdhmo closed 3 years ago

drinkdhmo commented 5 years ago

Since sysfs is now deprecated, we should migrate dependence to gpio-cdev.

posborne commented 5 years ago

While deprecated, the reality in the field is that there are still kernels being deployed that do not yet have support for gpio-cdev. This is increasingly changing but I wanted to provide that perspective. I believe the last of the major changes to the cdev userspace ABI landed in 4.8. With 4.9 LTS kernel being common for newer projects it might be safe to start pushing cdev. There will be people running existing devices on older kernels, however, and jumping might leave those people in the cold.

That being said, for what the embedded-hal project is, I think moving to gpio-cdev (which I will revisit placing under wg maintainership) in the next half year probably makes sense and is the right move as kernels.

ryankurte commented 5 years ago

i was wondering about this too. i think switching to cdev is the right move, but perhaps given the long tail of kernels for embedded hardware it might be worth including both with a feature flag or something to regress?

RandomInsano commented 5 years ago

+1 for a feature flag. I have a few devices that are going to be locked to Linux 4.4 indefinitely.

ryankurte commented 3 years ago

howdy, we have deployed feature flags to switch between implementations in v0.3.0 and provide both in v0.4.0-alpha.X (with feature-flags to disable each as required).

so i think we can close this, thanks folks! we don't (at the moment) have a way to automagically choose at runtime, but if there is a need for this behaviour we can open a new issue / PR.