diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2023-09-26 23:48:13 +0200 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2023-11-01 12:28:58 +0100 |
commit | 4a11dbf04f31c71eb458c062129e95b7aa308464 (patch) | |
tree | 38e82c600838e2d32ac66e259cfab6c27f4f1ff6 /drivers/leds/trigger/Kconfig | |
parent | dt-bindings: leds: Mention GPIO triggers (diff) | |
download | linux-4a11dbf04f31c71eb458c062129e95b7aa308464.tar.xz linux-4a11dbf04f31c71eb458c062129e95b7aa308464.zip |
leds: triggers: gpio: Rewrite to use trigger-sources
By providing a GPIO line as "trigger-sources" in the FWNODE
(such as from the device tree) and combining with the
GPIO trigger, we can support a GPIO LED trigger in a natural
way from the hardware description instead of using the
custom sysfs and deprecated global GPIO numberspace.
Example:
gpio: gpio@0 {
compatible "my-gpio";
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <2>;
#trigger-source-cells = <2>;
};
leds {
compatible = "gpio-leds";
led-my-gpio {
label = "device:blue:myled";
gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
default-state = "off";
linux,default-trigger = "gpio";
trigger-sources = <&gpio 1 GPIO_ACTIVE_HIGH>;
};
};
Make this the norm, unmark the driver as broken.
Delete the sysfs handling of GPIOs.
Since GPIO descriptors inherently can describe inversion,
the inversion handling can just be deleted.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230926-gpio-led-trigger-dt-v2-3-e06e458b788e@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/leds/trigger/Kconfig')
-rw-r--r-- | drivers/leds/trigger/Kconfig | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/leds/trigger/Kconfig b/drivers/leds/trigger/Kconfig index 2a57328eca20..d11d80176fc0 100644 --- a/drivers/leds/trigger/Kconfig +++ b/drivers/leds/trigger/Kconfig @@ -83,13 +83,10 @@ config LEDS_TRIGGER_ACTIVITY config LEDS_TRIGGER_GPIO tristate "LED GPIO Trigger" depends on GPIOLIB || COMPILE_TEST - depends on BROKEN help This allows LEDs to be controlled by gpio events. It's good when using gpios as switches and triggering the needed LEDs - from there. One use case is n810's keypad LEDs that could - be triggered by this trigger when user slides up to show - keypad. + from there. Triggers are defined as device properties. If unsure, say N. |