Skip to content

Commit ad75bd8

Browse files
committed
platform/x86: sony-laptop: Don't turn off 0x153 keyboard backlight during probe
The 0x153 version of the kbd backlight control SNC handle has no separate address to probe if the backlight is there. This turns the probe call into a set keyboard backlight call with a value of 0 turning off the keyboard backlight. Skip probing when there is no separate probe address to avoid this. Link: https://bugzilla.redhat.com/show_bug.cgi?id=1583752 Fixes: 800f201 ("Keyboard backlight control for some Vaio Fit models") Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Mattia Dongili <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 1b929c0 commit ad75bd8

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

drivers/platform/x86/sony-laptop.c

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1887,14 +1887,21 @@ static int sony_nc_kbd_backlight_setup(struct platform_device *pd,
18871887
break;
18881888
}
18891889

1890-
ret = sony_call_snc_handle(handle, probe_base, &result);
1891-
if (ret)
1892-
return ret;
1890+
/*
1891+
* Only probe if there is a separate probe_base, otherwise the probe call
1892+
* is equivalent to __sony_nc_kbd_backlight_mode_set(0), resulting in
1893+
* the keyboard backlight being turned off.
1894+
*/
1895+
if (probe_base) {
1896+
ret = sony_call_snc_handle(handle, probe_base, &result);
1897+
if (ret)
1898+
return ret;
18931899

1894-
if ((handle == 0x0137 && !(result & 0x02)) ||
1895-
!(result & 0x01)) {
1896-
dprintk("no backlight keyboard found\n");
1897-
return 0;
1900+
if ((handle == 0x0137 && !(result & 0x02)) ||
1901+
!(result & 0x01)) {
1902+
dprintk("no backlight keyboard found\n");
1903+
return 0;
1904+
}
18981905
}
18991906

19001907
kbdbl_ctl = kzalloc(sizeof(*kbdbl_ctl), GFP_KERNEL);

0 commit comments

Comments
 (0)