platform/x86: asus-wmi: Fix keyboard brightness cannot be set to 0

Some of ASUS laptops like UX431FL keyboard backlight cannot be set to
brightness 0. According to ASUS' information, the brightness should be
0x80 ~ 0x83. This patch fixes it by following the logic.

Fixes: e9809c0b96 ("asus-wmi: add keyboard backlight support")
Signed-off-by: Jian-Hong Pan <jian-hong@endlessm.com>
Reviewed-by: Daniel Drake <drake@endlessm.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
This commit is contained in:
Jian-Hong Pan 2019-12-30 16:30:45 +08:00 committed by Andy Shevchenko
parent 4eedc97300
commit 26e66a0cf2

View File

@ -520,13 +520,7 @@ static void kbd_led_update(struct asus_wmi *asus)
{
int ctrl_param = 0;
/*
* bits 0-2: level
* bit 7: light on/off
*/
if (asus->kbd_led_wk > 0)
ctrl_param = 0x80 | (asus->kbd_led_wk & 0x7F);
ctrl_param = 0x80 | (asus->kbd_led_wk & 0x7F);
asus_wmi_set_devstate(ASUS_WMI_DEVID_KBD_BACKLIGHT, ctrl_param, NULL);
}