gpio: provide gpiod_is_shared()
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 12 Nov 2025 13:55:35 +0000 (14:55 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 17 Nov 2025 09:16:51 +0000 (10:16 +0100)
commiteb374f764a7012eda28019266a6d9191670c4fa5
tree95af5d515b7797c05613a65b787c7820082a6ff3
parent1e4f6db614a310cc34d07ffbf031c76ea9581bcf
gpio: provide gpiod_is_shared()

Provide an interface allowing consumers to check if a GPIO descriptor
represents a GPIO that can potentially be shared by multiple consumers
at the same time. This is exposed to allow subsystems that already
work around the limitations of the current non-exclusive GPIO handling
in some ways, to gradually convert to relying on the new shared GPIO
feature of GPIOLIB.

Extend the gpiolib-shared module to mark the GPIO shared proxy
descriptors with a flag checked by the new interface.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20251112-gpio-shared-v4-6-b51f97b1abd8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpiolib-shared.c
drivers/gpio/gpiolib.c
drivers/gpio/gpiolib.h
include/linux/gpio/consumer.h