]> git.itanic.dy.fi Git - linux-stable/commitdiff
dt-bindings: leds: Mention GPIO triggers
authorLinus Walleij <linus.walleij@linaro.org>
Tue, 26 Sep 2023 21:48:12 +0000 (23:48 +0200)
committerLee Jones <lee@kernel.org>
Wed, 1 Nov 2023 11:28:57 +0000 (11:28 +0000)
We reuse the trigger-sources phandle to just point to
GPIOs we may want to use as LED triggers.

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>;
    };
};

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20230926-gpio-led-trigger-dt-v2-2-e06e458b788e@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
Documentation/devicetree/bindings/leds/common.yaml

index 5fb7007f36189b9ee05ae93d94ca922a6e9bd98e..b42950643b9d6189000b9399169343bb4ad0c422 100644 (file)
@@ -191,6 +191,8 @@ properties:
       each of them having its own LED assigned (assuming they are not
       hardwired). In such cases this property should contain phandle(s) of
       related source device(s).
+      Another example is a GPIO line that will be monitored and mirror the
+      state of the line (with or without inversion flags) to the LED.
       In many cases LED can be related to more than one device (e.g. one USB LED
       vs. multiple USB ports). Each source should be represented by a node in
       the device tree and be referenced by a phandle and a set of phandle