backlight: lm3530: add level setting to bl_set_intensity()

When application calls FBIOBLANK ioctl without backlight control,
even though bl_set_intensity() is called by fb_notifier_callback,
the backlight level cannot be set properly. So this patch add the
level changing to bl_set_intensity().

Change-Id: Id512c2f1bffbde2d47186d40071d05bc1388dc03
This commit is contained in:
choongryeol.lee 2012-07-26 14:09:57 -07:00 committed by Iliyan Malchev
parent dc93c5a1ec
commit 20c283689b

View file

@ -201,7 +201,15 @@ EXPORT_SYMBOL(lm3530_lcd_backlight_pwm_disable);
static int bl_set_intensity(struct backlight_device *bd) static int bl_set_intensity(struct backlight_device *bd)
{ {
lm3530_lcd_backlight_set_level(bd->props.brightness); int brightness = bd->props.brightness;
if ((bd->props.state & BL_CORE_FBBLANK) ||
(bd->props.state & BL_CORE_SUSPENDED))
brightness = 0;
else if (brightness == 0)
brightness = DEFAULT_LEVEL;
lm3530_lcd_backlight_set_level(brightness);
return 0; return 0;
} }