Re: [PATCH v2 6/6] leds: lm3692x: Make sure we don't exceed the maximum led current

From: Pavel Machek
Date: Thu Dec 26 2019 - 05:13:42 EST


On Wed 2019-12-25 12:07:19, Guido Günther wrote:
1;2802;0c> The current is given by the formular from page 12 of
> https://www.ti.com/lit/ds/symlink/lm36922.pdf. We use this to limit the
> led's max_brightness using the led-max-microamp DT property.
>
> The formular for the lm36923 is identical according to the data
sheet.

formula?

> static int lm3692x_probe_dt(struct lm3692x_led *led)
> {
> struct fwnode_handle *child = NULL;
> struct led_init_data init_data = {};
> - u32 ovp;
> + u32 ovp, max_cur;
> bool exp_mode;
> int ret;
>
> @@ -397,6 +416,10 @@ static int lm3692x_probe_dt(struct lm3692x_led *led)
> return ret;
> }
>
> + fwnode_property_read_u32(child, "led-max-microamp", &max_cur);
> + led->led_dev.max_brightness = ret ? LED_FULL :
> + lm3692x_max_brightness(led, max_cur);
> +

Umm. Should ret come from this fwnode_property_read_u32()?

With that fixed,

Acked-by: Pavel Machek <pavel@xxxxxx>

(Feel free to wait for Rob before resending the series, and I guess
you can merge it with the next one).

Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Attachment: signature.asc
Description: Digital signature