From: Rob Herring <robh@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "Jan Kundrát" <jan.kundrat@cesnet.cz>,
"Pavel Machek" <pavel@ucw.cz>, "Lee Jones" <lee@kernel.org>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Jacek Anaszewski" <jacek.anaszewski@gmail.com>,
linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] dt-bindings: leds: Mention GPIO triggers
Date: Wed, 13 Sep 2023 08:34:51 -0500 [thread overview]
Message-ID: <20230913133451.GA2841610-robh@kernel.org> (raw)
In-Reply-To: <20230912-gpio-led-trigger-dt-v1-1-1b50e3756dda@linaro.org>
On Tue, Sep 12, 2023 at 03:44:30PM +0200, Linus Walleij wrote:
> 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>;
BTW, this is not documented for any GPIO binding. If we want to specify
the cell size, then it has to be added to every GPIO controller binding.
If not, we then need to reference gpio.yaml in every GPIO controller
binding (along with unevaluatedProperties). Doesn't have to be done for
this patch to go in though.
> };
>
> 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>
> ---
> Documentation/devicetree/bindings/leds/common.yaml | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/leds/common.yaml b/Documentation/devicetree/bindings/leds/common.yaml
> index 5fb7007f3618..b42950643b9d 100644
> --- a/Documentation/devicetree/bindings/leds/common.yaml
> +++ b/Documentation/devicetree/bindings/leds/common.yaml
> @@ -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
>
> --
> 2.34.1
>
next prev parent reply other threads:[~2023-09-13 13:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-12 13:44 [PATCH 0/2] Rewrite GPIO LED trigger to use trigger-sources Linus Walleij
2023-09-12 13:44 ` [PATCH 1/2] dt-bindings: leds: Mention GPIO triggers Linus Walleij
2023-09-12 17:11 ` Conor Dooley
2023-09-13 13:34 ` Rob Herring [this message]
2023-09-14 8:40 ` Linus Walleij
2023-09-14 14:27 ` Rob Herring
2023-09-15 12:01 ` Linus Walleij
2023-09-15 14:10 ` Rob Herring
2023-09-12 13:44 ` [PATCH 2/2] leds: triggers: gpio: Rewrite to use trigger-sources Linus Walleij
2023-09-14 9:10 ` Dan Carpenter
2023-09-15 14:15 ` Rob Herring
2023-09-15 18:14 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230913133451.GA2841610-robh@kernel.org \
--to=robh@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jacek.anaszewski@gmail.com \
--cc=jan.kundrat@cesnet.cz \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lee@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).