AW: [PATCH v1] leds: lp50xx: add setting of default intensity from DT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
sorry to ask but was someone able to look at this? Any thoughts?

Best Regards,

   Sven

> -----Ursprüngliche Nachricht-----
> Von: Sven Schuchmann <schuchmann@xxxxxxxxxxxxxxxxx>
> Gesendet: Dienstag, 19. Januar 2021 11:53
> An: Sven Schuchmann <schuchmann@xxxxxxxxxxxxxxxxx>
> Cc: Pavel Machek <pavel@xxxxxx>; Dan Murphy <dmurphy@xxxxxx>; Rob Herring <robh+dt@xxxxxxxxxx>; linux-
> leds@xxxxxxxxxxxxxxx; devicetree@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> Betreff: [PATCH v1] leds: lp50xx: add setting of default intensity from DT
> 
> In order to use a multicolor-led together with a trigger
> from DT 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@xxxxxxxxxxxxxxxxx>
> ---
>  Documentation/devicetree/bindings/leds/leds-lp50xx.yaml | 8 +++++++-
>  drivers/leds/leds-lp50xx.c                              | 4 ++++
>  2 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml b/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml
> index c192b5feadc7..5ad2a0c3c052 100644
> --- a/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml
> +++ b/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml
> @@ -69,7 +69,12 @@ patternProperties:
>      patternProperties:
>        "(^led-[0-9a-f]$|led)":
>          type: object
> -        $ref: common.yaml#
> +        allOf:
> +          - $ref: common.yaml#
> +        properties:
> +          default-intensity:
> +            maxItems: 1
> +            description: The intensity the LED gets initialised with.
> 
>  required:
>    - compatible
> @@ -102,6 +107,7 @@ examples:
> 
>                 led-0 {
>                     color = <LED_COLOR_ID_RED>;
> +                   default-intensity = <100>;
>                 };
> 
>                 led-1 {
> diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c
> index f13117eed976..ba760fa33bdc 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





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux