* [PATCH] leds: lp50xx: add setting of default intensity from DT
@ 2021-01-18 14:09 Sven Schuchmann
2021-01-19 2:19 ` Rob Herring
0 siblings, 1 reply; 2+ messages in thread
From: Sven Schuchmann @ 2021-01-18 14:09 UTC (permalink / raw)
To: schuchmann
Cc: Pavel Machek, Dan Murphy, Rob Herring, linux-leds, devicetree,
linux-kernel
In order to use a multicolor-led together with a trigger
the led needs to have an intensity set to see something.
The trigger changes the brightness of the led but if there
is no intensity we actually see nothing.
This patch adds the ability to set the default intensity
of each led so that it is turned on from DT.
Signed-off-by: Sven Schuchmann <schuchmann@schleissheimer.de>
---
Documentation/devicetree/bindings/leds/leds-lp50xx.yaml | 6 +++++-
drivers/leds/leds-lp50xx.c | 4 ++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml b/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml
index c192b5feadc7..f810c4e84c44 100644
--- a/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml
+++ b/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml
@@ -69,7 +69,11 @@ patternProperties:
patternProperties:
"(^led-[0-9a-f]$|led)":
type: object
- $ref: common.yaml#
+ allOf:
+ - $ref: common.yaml#
+ properties:
+ default-intensity:
+ The intensity the LED get initialised with.
required:
- compatible
diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c
index f13117eed976..55b9e0c9e737 100644
--- a/drivers/leds/leds-lp50xx.c
+++ b/drivers/leds/leds-lp50xx.c
@@ -501,6 +501,10 @@ static int lp50xx_probe_dt(struct lp50xx *priv)
}
mc_led_info[num_colors].color_index = color_id;
+
+ fwnode_property_read_u32(led_node, "default-intensity",
+ &mc_led_info[num_colors].intensity);
+
num_colors++;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] leds: lp50xx: add setting of default intensity from DT
2021-01-18 14:09 [PATCH] leds: lp50xx: add setting of default intensity from DT Sven Schuchmann
@ 2021-01-19 2:19 ` Rob Herring
0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2021-01-19 2:19 UTC (permalink / raw)
To: Sven Schuchmann
Cc: Rob Herring, devicetree, Pavel Machek, linux-kernel, Dan Murphy,
linux-leds
On Mon, 18 Jan 2021 14:09:47 +0000, Sven Schuchmann wrote:
> In order to use a multicolor-led together with a trigger
> the led needs to have an intensity set to see something.
> The trigger changes the brightness of the led but if there
> is no intensity we actually see nothing.
>
> This patch adds the ability to set the default intensity
> of each led so that it is turned on from DT.
>
> Signed-off-by: Sven Schuchmann <schuchmann@schleissheimer.de>
> ---
> Documentation/devicetree/bindings/leds/leds-lp50xx.yaml | 6 +++++-
> drivers/leds/leds-lp50xx.c | 4 ++++
> 2 files changed, 9 insertions(+), 1 deletion(-)
>
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml: patternProperties:^multi-led@[0-9a-f]$:patternProperties:(^led-[0-9a-f]$|led):properties:default-intensity: 'The intensity the LED get initialised with.' is not of type 'object', 'boolean'
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml: ignoring, error in schema: patternProperties: ^multi-led@[0-9a-f]$: patternProperties: (^led-[0-9a-f]$|led): properties: default-intensity
warning: no schema found in file: ./Documentation/devicetree/bindings/leds/leds-lp50xx.yaml
See https://patchwork.ozlabs.org/patch/1428176
This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:
pip3 install dtschema --upgrade
Please check and re-submit.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-01-19 2:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-18 14:09 [PATCH] leds: lp50xx: add setting of default intensity from DT Sven Schuchmann
2021-01-19 2:19 ` Rob Herring
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).