summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJoshua Stein <jcs@cvs.openbsd.org>2019-10-21 16:45:49 +0000
committerJoshua Stein <jcs@cvs.openbsd.org>2019-10-21 16:45:49 +0000
commit7d77fc2d19559804abde1369627b9e6909c14490 (patch)
tree17e07cbe15a0ccf496fb450cdd2a96857366b198 /sys/dev
parentc11cfe04dbfa2c4e2e7ab7c207dc3bcce968407f (diff)
On newer ThinkPads reporting HKEY version > 1, don't claim wscons
backlight controls so that acpivout can. This allows using all of the fine-grained backlight BCL steps defined in ACPI (usually 100) instead of the dozen or so available through acpithinkpad's proprietary ACPI or CMOS interfaces. This is also needed for future amdgpu work.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpi/acpithinkpad.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/acpi/acpithinkpad.c b/sys/dev/acpi/acpithinkpad.c
index 66826562848..9c04149f006 100644
--- a/sys/dev/acpi/acpithinkpad.c
+++ b/sys/dev/acpi/acpithinkpad.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpithinkpad.c,v 1.66 2019/10/13 10:56:31 kettenis Exp $ */
+/* $OpenBSD: acpithinkpad.c,v 1.67 2019/10/21 16:45:48 jcs Exp $ */
/*
* Copyright (c) 2008 joshua stein <jcs@openbsd.org>
*
@@ -320,8 +320,10 @@ thinkpad_attach(struct device *parent, struct device *self, void *aux)
wskbd_set_backlight = thinkpad_set_kbd_backlight;
}
- if (aml_evalinteger(sc->sc_acpi, sc->sc_devnode, "PBLG",
- 0, NULL, &sc->sc_brightness) == 0) {
+ /* On version 2 and newer, let *drm or acpivout control brightness */
+ if (sc->sc_hkey_version == THINKPAD_HKEY_VERSION1 &&
+ (aml_evalinteger(sc->sc_acpi, sc->sc_devnode, "PBLG",
+ 0, NULL, &sc->sc_brightness) == 0)) {
ws_get_param = thinkpad_get_param;
ws_set_param = thinkpad_set_param;
}