GPIO interface uses deprecated GPIO sysfs interface and should use the GPIO character device
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| snapd |
Fix Released
|
High
|
Samuele Pedroni | ||
| snapd (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
| Jammy |
Fix Released
|
Undecided
|
Unassigned | ||
| Noble |
Fix Released
|
Undecided
|
Unassigned | ||
| Plucky |
Fix Released
|
Undecided
|
Unassigned | ||
| Questing |
Fix Released
|
Undecided
|
Unassigned | ||
Bug Description
[SRU] 2.72: https:/
[ Impact ]
sysfs GPIO
----------
User-mode GPIO (General Purpose Input/Output) has historically been performed via the legacy “integer-
chardev GPIO
------------
The new way of doing GPIO is via the “descriptor-based” character device ABI (Application Binary Interface). The interface is exposed at /dev/gpiochipN or /sys/bus/gpiochipN where N is the chip number.
Support for the GPIO character device is now available through:
- gpio-control interface (snapd 2.65): https:/
- gpio-chardev interface (snapd 2.72): https:/
[ Test Plan ]
1. Reproduce with snapd snap < 2.72
Not relevant.
2. Prove fixed with snapd snap 2.72
The functionality is covered by snapd spread test: tests/core/
Ensure the spread test completes for all relevant systems.
---original---
The snapd builtin gpio interface provides access to the GPIO sysfs Interface for userspace at sys/class/gpio/gpio
The GPIO sysfs interface has however been deprecated since version 4.8 of the kernel and the snapd GPIO interface should provide access to /sys/bus/gpiochipN (or /dev/gpiochipN) as well.
Reference:
1) https:/
"Warning
THIS ABI IS DEPRECATED, THE ABI DOCUMENTATION HAS BEEN MOVED TO Documentation/
2)https:/
"This ABI is deprecated and will be removed after 2020. It is
replaced with the GPIO character device."
3) https:/
The descriptor-based interface is the preferred way to manipulate GPIOs, and is described by all the files in this directory excepted gpio-legacy.txt.
The legacy integer-based interface which is considered deprecated (but still usable for compatibility reasons) is documented in gpio-legacy.txt.
4) https:/
sysfs GPIO
User-mode GPIO (General Purpose Input/Output) has historically been performed via the legacy “integer-
# echo out > /sys/class/
# echo 1 > /sys/class/
GPIO access via this legacy sysfs interface has been deprecated since version 4.8 of the Linux kernel.
chardev GPIO
The new way of doing GPIO is via the “descriptor-based” character device ABI (Application Binary Interface). The interface is exposed at /dev/gpiochipN or /sys/bus/gpiochipN where N is the chip number.
| description: | updated |
| Changed in snapd: | |
| assignee: | nobody → Samuele Pedroni (pedronis) |
| Changed in snapd: | |
| status: | New → Confirmed |
| importance: | Undecided → High |
| Changed in snapd: | |
| status: | Confirmed → Fix Committed |
| description: | updated |
| description: | updated |
| Changed in snapd: | |
| status: | Fix Committed → Fix Released |
Support for the GPIO character device is now available through: /snapcraft. io/docs/ gpio-control- interface /snapcraft. io/docs/ gpio-chardev- interface
- gpio-control interface (snapd 2.65): https:/
- gpio-chardev interface (snapd 2.72): https:/