Skip to content

Commit a731361

Browse files
committed
acpithinkpad: re-assert backlight control
Revision 1.67 made acpithinkpad not take over screen backlight control and let inteldrm or some other driver handle it. This was done to support fine-grained levels of backlight control rather than the dozen steps that the native EC interface supports. Unfortunately this has the drawback of the EC getting confused about what the backlight level actually is and it still tries to change the backlight automatically in response to Fn+F# keys or plug/unplug events. Notably if you have the laptop plugged in with a backlight value of something high, then unplug it and later lower it with xbacklight, when you plug it back in, the EC automatically adjusts the backlight up to that high value. I don't know how to tell the EC to stop adjusting the backlight automatically on power changes, so I would like to revert this change and go back to only having native EC-controlled backlight with xbacklight or wsconsctl. patrick@ confirmed that he can still change backlight values on the ThinkPad X395 with this backed out, even though part of the reason for this initial change was to help that machine.
1 parent d779dde commit a731361

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

sys/dev/acpi/acpithinkpad.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,13 +364,15 @@ thinkpad_attach(struct device *parent, struct device *self, void *aux)
364364
wskbd_set_backlight = thinkpad_set_kbd_backlight;
365365
}
366366

367-
/* On version 2 and newer, let *drm or acpivout control brightness */
368-
if (sc->sc_hkey_version == THINKPAD_HKEY_VERSION1 &&
369-
(aml_evalinteger(sc->sc_acpi, sc->sc_devnode, "PBLG",
370-
0, NULL, &sc->sc_brightness) == 0)) {
367+
if (
368+
#if 0
369+
sc->sc_hkey_version == THINKPAD_HKEY_VERSION1 &&
370+
#endif
371+
thinkpad_get_brightness(sc) == 0) {
371372
ws_get_param = thinkpad_get_param;
372373
ws_set_param = thinkpad_set_param;
373374
}
375+
/* On version 2 and newer, let *drm or acpivout control brightness */
374376

375377
memset(&arg, 0, sizeof(arg));
376378
arg.type = AML_OBJTYPE_INTEGER;

0 commit comments

Comments
 (0)