Messages in this thread | | | Date | Wed, 10 Jul 2019 21:16:37 +0200 | From | Pavel Machek <> | Subject | Re: [PATCH v3 4/4] backlight: add led-backlight driver |
| |
On Wed 2019-07-10 14:39:32, Jean-Jacques Hiblot wrote: > From: Tomi Valkeinen <tomi.valkeinen@ti.com> > > 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@ti.com> > Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
> + > + /* > + *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@ucw.cz> Pavel
-- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html [unhandled content-type:application/pgp-signature] | |