Skip to content

gpio: add new SET_CONFIG ioctl() to gpio chardev

Kent Gibson linux-gpio 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 2 repliesIn review
  2. v11 patch 2 repliesSuperseded

Changes in v2 from the cover letter

Address v1 review comments, specifically refactoring line handle flag validation out of linehandle_create in a separate patch, and refactoring the set_config itself to improve readability and minimize changes to existing code.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2gpiolib: move validation of line handle flags into helper functiondrivers/gpio/gpiolib.c+51 -420 replies
2/2gpio: add new SET_CONFIG ioctl() to gpio chardevdrivers/gpio/gpiolib.c include/uapi/linux/gpio.h+87 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] gpio: add new SET_CONFIG ioctl() to gpio chardev

Changes from v1:
Address v1 review comments, specifically refactoring line handle flag validation out of linehandle_create in a separate patch, and refactoring the set_config itself to improve readability and minimize changes to existing code.

Add the GPIOHANDLE_SET_CONFIG_IOCTL to the gpio chardev. The ioctl allows some of the configuration of a requested handle to be changed without having to release the line.
The primary use case is the changing of direction for bi-directional lines.

The patch series is against Bart's gpio/for-next branch[1] with v4 of my bias patch series "gpio: expose line bias flags to userspace" applied. This is necessary to support setting of the bias flags introduced there.

The patch has been successfully tested against gpio-mockup using the feature/pud_set_config branch of my Go gpiod library[2], as libgpiod has not yet been updated with the uAPI change.

Kent Gibson (2):
gpiolib: move validation of line handle flags into helper function
gpio: add new SET_CONFIG ioctl() to gpio chardev

 drivers/gpio/gpiolib.c    | 162 ++++++++++++++++++++++++++++----------
 include/uapi/linux/gpio.h |  18 +++++
 2 files changed, 138 insertions(+), 42 deletions(-)
Signature · 4 lines
2.23.0

[1] git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git
[2] https://github.com/warthog618/gpiod.git