RFC gpio: move interfaces into their own files
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest3 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | gpio: always compile label supportdrivers/ | +2 | 1 reply | |
| 2/3 | gpio: move sysfs support to its own filedrivers/ drivers/ drivers/ +1 more | +925 | 2 replies | |
| 3/3 | gpio: move integer GPIO support to its own filedrivers/ drivers/ drivers/ | +113 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC 0/3] gpio: move interfaces into their own files
Hi Linus,
I was thinking of doing this since a while already but the recent discussion on shared GPIOs made me think I should push this to you and see what you think.
Right now we have 3 different interfaces for GPIO:
- The core gpiod interface
- The legacy integer interface, which mostly relies on gpiod
- The sysfs interface, which relies on gpiod but should probably rely on the integer interface instead
This series separates the code for the interfaces into their own source file and shares what needs to be through the private gpiolib.h header. Label support is made mandatory in order to reduce the amount of things added into gpiolib.h.
Separating the code should make the various interfaces easier to grasp, and will make it easier to implement interface-specific features. It also points out some direct usages of descriptors/gpiolib core functions that should be gotten rid of in order to make these real "consumers" of the gpiod interface.
This series has been tested and I'm fine with it being merged now if you agree with the idea. It would probably be preferable from a cosmetic point of view to first turn fix the extra consumers and then separate them so less things end up being exported in gpiolib.h, but moving things first has the advantage of clearly highlighting what needs to be done and spares us some rebasing hassle.
Alexandre Courbot (3):
gpio: always compile label support
gpio: move sysfs support to its own file
gpio: move integer GPIO support to its own file
drivers/gpio/Makefile | 2 + drivers/gpio/gpiolib-legacy.c | 112 +++++ drivers/gpio/gpiolib-sysfs.c | 829 ++++++++++++++++++++++++++++++++ drivers/gpio/gpiolib.c | 1043 +---------------------------------------- drivers/gpio/gpiolib.h | 91 ++++ 5 files changed, 1040 insertions(+), 1037 deletions(-) create mode 100644 drivers/gpio/gpiolib-legacy.c create mode 100644 drivers/gpio/gpiolib-sysfs.c
Signature · 1 line
2.0.0