diff mbox series

[v2,4/5] gpio: sysfs: emit chardev line-state events on active-low changes

Message ID 20241025-gpio-notify-sysfs-v2-4-5bd1b1b0b3e6@linaro.org
State Superseded
Headers show
Series gpio: sysfs: send character device notifications for sysfs class events | expand

Commit Message

Bartosz Golaszewski Oct. 25, 2024, 12:18 p.m. UTC
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

The sysfs active_low attribute doesn't go through the usual paths so it
doesn't emit the line-state event. Add the missing call to
gpiod_line_state_notify() to gpio_sysfs_set_active_low().

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 drivers/gpio/gpiolib-sysfs.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c
index de3ed75b097e..cc5c51ca9478 100644
--- a/drivers/gpio/gpiolib-sysfs.c
+++ b/drivers/gpio/gpiolib-sysfs.c
@@ -306,6 +306,8 @@  static int gpio_sysfs_set_active_low(struct device *dev, int value)
 		status = gpio_sysfs_request_irq(dev, flags);
 	}
 
+	gpiod_line_state_notify(desc, GPIO_V2_LINE_CHANGED_CONFIG);
+
 	return status;
 }