gpio: aggregator: handle runtime registration of gpio_desc in gpiochip_fwd
authorThomas Richard <thomas.richard@bootlin.com>
Mon, 11 Aug 2025 13:25:50 +0000 (15:25 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 11 Aug 2025 13:39:31 +0000 (15:39 +0200)
commitb31c68fd851e74526ad963362ea205eb97b9a710
treeb82d68ce0e89af90f2b882fa2dbd5f5738e1d421
parent6e986f8852f56cf9214ea2ec02b4b432e201d02c
gpio: aggregator: handle runtime registration of gpio_desc in gpiochip_fwd

Add request() callback to check if the GPIO descriptor was well registered
in the gpiochip_fwd before using it. This is done to handle the case where
GPIO descriptor is added at runtime in the forwarder.

If at least one GPIO descriptor was not added before the forwarder
registration, we assume the forwarder can sleep as if a GPIO is added at
runtime it may sleep.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://lore.kernel.org/r/20250811-aaeon-up-board-pinctrl-support-v9-7-29f0cbbdfb30@bootlin.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-aggregator.c
include/linux/gpio/forwarder.h