mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
auxdisplay: Make use of enum for backlight on / off
To turn the backlight on or off use our new enum CHARLCD_ON / CHARLCD_OFF. Reviewed-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
This commit is contained in:
parent
2bf82b5a80
commit
bd26b181d1
@ -115,7 +115,7 @@ static void charlcd_bl_off(struct work_struct *work)
|
|||||||
if (priv->bl_tempo) {
|
if (priv->bl_tempo) {
|
||||||
priv->bl_tempo = false;
|
priv->bl_tempo = false;
|
||||||
if (!(priv->flags & LCD_FLAG_L))
|
if (!(priv->flags & LCD_FLAG_L))
|
||||||
priv->lcd.ops->backlight(&priv->lcd, 0);
|
priv->lcd.ops->backlight(&priv->lcd, CHARLCD_OFF);
|
||||||
}
|
}
|
||||||
mutex_unlock(&priv->bl_tempo_lock);
|
mutex_unlock(&priv->bl_tempo_lock);
|
||||||
}
|
}
|
||||||
@ -132,7 +132,7 @@ void charlcd_poke(struct charlcd *lcd)
|
|||||||
|
|
||||||
mutex_lock(&priv->bl_tempo_lock);
|
mutex_lock(&priv->bl_tempo_lock);
|
||||||
if (!priv->bl_tempo && !(priv->flags & LCD_FLAG_L))
|
if (!priv->bl_tempo && !(priv->flags & LCD_FLAG_L))
|
||||||
lcd->ops->backlight(lcd, 1);
|
lcd->ops->backlight(lcd, CHARLCD_ON);
|
||||||
priv->bl_tempo = true;
|
priv->bl_tempo = true;
|
||||||
schedule_delayed_work(&priv->bl_work, LCD_BL_TEMPO_PERIOD * HZ);
|
schedule_delayed_work(&priv->bl_work, LCD_BL_TEMPO_PERIOD * HZ);
|
||||||
mutex_unlock(&priv->bl_tempo_lock);
|
mutex_unlock(&priv->bl_tempo_lock);
|
||||||
@ -829,7 +829,7 @@ int charlcd_unregister(struct charlcd *lcd)
|
|||||||
the_charlcd = NULL;
|
the_charlcd = NULL;
|
||||||
if (lcd->ops->backlight) {
|
if (lcd->ops->backlight) {
|
||||||
cancel_delayed_work_sync(&priv->bl_work);
|
cancel_delayed_work_sync(&priv->bl_work);
|
||||||
priv->lcd.ops->backlight(&priv->lcd, 0);
|
priv->lcd.ops->backlight(&priv->lcd, CHARLCD_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user