lkml.org 
[lkml]   [2023]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 1/2] led: leds-lp50xx: Add max-brightness as in leds-pwm
Date
Add max-brightness in order to reduce the current on the connected LEDs.
Normally, the maximum brightness is determined by the hardware, and this
property is not required. This property is used to set a software limit.
It could happen that an LED is made so bright that it gets damaged or
causes damage due to restrictions in a specific system, such as mounting
conditions.

Signed-off-by: Astrid Rost <astrid.rost@axis.com>
---
drivers/leds/leds-lp50xx.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c
index 28d6b39fa72d..1cb54c0524a1 100644
--- a/drivers/leds/leds-lp50xx.c
+++ b/drivers/leds/leds-lp50xx.c
@@ -502,6 +502,8 @@ static int lp50xx_probe_dt(struct lp50xx *priv)
led->mc_cdev.num_colors = num_colors;
led->mc_cdev.subled_info = mc_led_info;
led_cdev = &led->mc_cdev.led_cdev;
+ fwnode_property_read_u32(child, "max-brightness",
+ &led_cdev->max_brightness);
led_cdev->brightness_set_blocking = lp50xx_brightness_set;

ret = devm_led_classdev_multicolor_register_ext(priv->dev,
--
2.30.2
\
 
 \ /
  Last update: 2023-06-29 15:48    [W:0.022 / U:0.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site