[PATCH v1 1/2] led: leds-lp50xx: Add max-brightness as in leds-pwm

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

 



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@xxxxxxxx>
---
 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




[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