From 7d77fc2d19559804abde1369627b9e6909c14490 Mon Sep 17 00:00:00 2001 From: Joshua Stein Date: Mon, 21 Oct 2019 16:45:49 +0000 Subject: 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. --- sys/dev/acpi/acpithinkpad.c | 8 +++++--- 1 file 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 * @@ -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; } -- cgit v1.2.3