Re: [PATCH v3 4/4] backlight: add led-backlight driver

From: Pavel Machek
Date: Wed Jul 10 2019 - 15:16:42 EST


On Wed 2019-07-10 14:39:32, Jean-Jacques Hiblot wrote:
> From: Tomi Valkeinen <tomi.valkeinen@xxxxxx>
>
> This patch adds a led-backlight driver (led_bl), which is similar to
> pwm_bl except the driver uses a LED class driver to adjust the
> brightness in the HW. Multiple LEDs can be used for a single backlight.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@xxxxxx>
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@xxxxxx>

> +
> + /*
> + *try to map actual LED brightness to backlight brightness
> + * level
> + */

"* Try"

> + db = priv->default_brightness;
> + for (i = 0 ; i < num_levels; i++) {
> + if ((i && db > levels[i-1]) && db <= levels[i])
> + break;
> + }
> + priv->default_brightness = i;
> + priv->max_brightness = num_levels - 1;
> + priv->levels = levels;
> + } else if (num_levels >= 0)
> + dev_warn(dev, "not enought levels defined\n");

"Not enough"

> + ret = of_property_read_u32(node, "default-brightness-level", &value);
> + if (!ret && value <= priv->max_brightness)
> + priv->default_brightness = value;
> + else if (!ret && value > priv->max_brightness)
> + dev_warn(dev, "invalid default brightness. ignoring it\n");

"Invalid... Ignoring it."

Acked-by: Pavel Machek <pavel@xxxxxx>
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