lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230629134722.3908637-2-astrid.rost@axis.com>
Date:   Thu, 29 Jun 2023 15:47:21 +0200
From:   Astrid Rost <astrid.rost@...s.com>
To:     Dan Murphy <dmurphy@...com>, Andrew Davis <afd@...com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Pavel Machek <pavel@....cz>, Lee Jones <lee@...nel.org>
CC:     <kernel@...s.com>, Astrid Rost <astrid.rost@...s.com>,
        <linux-leds@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH v1 1/2] led: leds-lp50xx: Add max-brightness as in leds-pwm

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@...s.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ