Download raw body.
acpithinkpad: don't unmask brightness events on version 2 machines
On my X13 gen 1, the screen brightness down button sets the screen to
minimum brightness, which is not very pleasant. This turns out to be
because both acpithinkpad(4) and acpivout(4) are processing these events,
even though this is a 'version 2' machine where acpithinkpad declines to
take control of screen brightness.
The diff below resolves this by only unmasking the brightness up/down
events on version 1 machines. Without these events unmasked, only
acpivout is trying to apply screen brightness changes, and everything
works properly.
Has anyone seen this problem on other thinkpads? Could this change
cause problems anywhere else?
Index: acpithinkpad.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpithinkpad.c,v
diff -u -p -r1.74 acpithinkpad.c
--- acpithinkpad.c 7 Jul 2023 07:37:59 -0000 1.74
+++ acpithinkpad.c 19 May 2025 08:26:54 -0000
@@ -428,10 +428,11 @@ thinkpad_enable_events(struct acpithinkp
}
/* Enable events we need to know about */
- mask |= (THINKPAD_MASK_MIC_MUTE |
- THINKPAD_MASK_BRIGHTNESS_UP |
- THINKPAD_MASK_BRIGHTNESS_DOWN |
- THINKPAD_MASK_KBD_BACKLIGHT);
+ mask |= THINKPAD_MASK_MIC_MUTE |
+ THINKPAD_MASK_KBD_BACKLIGHT;
+ if (sc->sc_hkey_version == THINKPAD_HKEY_VERSION1)
+ mask |= THINKPAD_MASK_BRIGHTNESS_UP |
+ THINKPAD_MASK_BRIGHTNESS_DOWN;
DPRINTF(("%s: setting event mask to 0x%llx\n", DEVNAME(sc), mask));
acpithinkpad: don't unmask brightness events on version 2 machines