[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250903235615.134520-1-alex@vinarskis.com>
Date: Thu, 4 Sep 2025 01:56:15 +0200
From: Aleksandrs Vinarskis <alex@...arskis.com>
To: robh@...nel.org,
Aleksandrs Vinarskis <alex@...arskis.com>
Cc: bryan.odonoghue@...aro.org,
conor+dt@...nel.org,
devicetree@...r.kernel.org,
hansg@...nel.org,
krzk+dt@...nel.org,
lee@...nel.org,
linux-kernel@...r.kernel.org,
linux-leds@...r.kernel.org,
pavel@...nel.org
Subject: Re: [PATCH 1/2] dt-bindings: leds: add generic LED consumer documentation
> On Tue, Sep 02, 2025 at 11:10:51AM +0000, Aleksandrs Vinarskis wrote:
> > Currently supports passing 'led-names' used to map LED devices to their
> > respective functions.
> >
> > Signed-off-by: Aleksandrs Vinarskis <alex@...arskis.com>
> > ---
> > .../devicetree/bindings/leds/leds-consumer.yaml | 69 ++++++++++++++++++++++
> > 1 file changed, 69 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/leds/leds-consumer.yaml b/Documentation/devicetree/bindings/leds/leds-consumer.yaml
> > new file mode 100644
> > index 0000000000000000000000000000000000000000..a63e78417df84609e279835f7dae62e3ad2f0bf5
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/leds/leds-consumer.yaml
> > @@ -0,0 +1,69 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/leds/leds-consumer.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Common leds consumer
> > +
> > +maintainers:
> > + - Aleksandrs Vinarskis <alex@...arskis.com>
> > +
> > +description:
> > + Some LED defined in DT are required by other DT consumers, for example
> > + v4l2 subnode may require privacy or flash LED.
> > +
> > + Document LED properties that its consumers may define.
>
> We already have the trigger-source binding for "attaching" LEDs to
> devices. Why does that not work here?
I have not actually considered this, as the existing privacy-led solution
from the original series is not trigger based. At least one of the reasons
for that is that trigger source can be rather easily altered from user
space, which would've been bad for this use case. If v4l2 acquires control
over the LED it actually removes triggers and disables sysfs on that LED.
Regarding DT check that is failing because 'ovti,ov02e10.yaml' does not
allow for additional properties - the same issue would apply to basically
any camera, I missed it. So would need to either include this new binding
in 'video-interface-devices.yaml', or drop new binding and directly include
these new generic LED related properties in the video one. However, in this
case it gets a bit ugly, as the latter already contains 'flash-leds' for
flash specifically, and we would be adding a more generic way only used for
privacy LED, at least for now... not too sure whats the best way here,
leaning towards 1st option.
Let me know what you think,
Alex
>
> Rob
>
> > +
> > +properties:
> > + leds:
> > + description:
> > + Phandle to LED device(s) required by particular consumer.
> > + $ref: /schemas/types.yaml#/definitions/phandle
> > + led-names:
> > + description:
> > + List of device name(s). Used to map LED devices to their respective
> > + functions, when consumer requires more than one LED.
> > +
> > +additionalProperties: true
> > +
> > +examples:
> > + - |
> > + #include <dt-bindings/gpio/gpio.h>
> > + #include <dt-bindings/leds/common.h>
> > +
> > + i2c {
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > +
> > + camera@36 {
> > + compatible = "ovti,ov02c10";
> > + reg = <0x36>;
> > +
> > + reset-gpios = <&tlmm 237 GPIO_ACTIVE_LOW>;
> > + pinctrl-names = "default";
> > + pinctrl-0 = <&cam_rgb_default>;
> > +
> > + led-names = "privacy-led";
> > + leds = <&privacy_led>;
> > +
> > + clocks = <&ov02e10_clk>;
> > +
> > + assigned-clocks = <&ov02e10_clk>;
> > + assigned-clock-rates = <19200000>;
> > +
> > + avdd-supply = <&vreg_l7b_2p8>;
> > + dvdd-supply = <&vreg_l7b_2p8>;
> > + dovdd-supply = <&vreg_cam_1p8>;
> > +
> > + port {
> > + ov02e10_ep: endpoint {
> > + data-lanes = <1 2>;
> > + link-frequencies = /bits/ 64 <400000000>;
> > + remote-endpoint = <&csiphy4_ep>;
> > + };
> > + };
> > + };
> > + };
> > +
> > +...
> >
> > --
> > 2.48.1
> >
Powered by blists - more mailing lists