Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/acpi thinkpad(4): Attach at LEN0268 with v2 Thinkpad...



details:   https://anonhg.NetBSD.org/src/rev/2cd99c3509aa
branches:  trunk
changeset: 983563:2cd99c3509aa
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat May 29 16:49:39 2021 +0000

description:
thinkpad(4): Attach at LEN0268 with v2 Thinkpad hotkeys too.

diffstat:

 sys/dev/acpi/thinkpad_acpi.c |  17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diffs (57 lines):

diff -r 2960d3c038e5 -r 2cd99c3509aa sys/dev/acpi/thinkpad_acpi.c
--- a/sys/dev/acpi/thinkpad_acpi.c      Sat May 29 16:49:30 2021 +0000
+++ b/sys/dev/acpi/thinkpad_acpi.c      Sat May 29 16:49:39 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: thinkpad_acpi.c,v 1.49 2021/01/29 15:49:55 thorpej Exp $ */
+/* $NetBSD: thinkpad_acpi.c,v 1.50 2021/05/29 16:49:39 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: thinkpad_acpi.c,v 1.49 2021/01/29 15:49:55 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: thinkpad_acpi.c,v 1.50 2021/05/29 16:49:39 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -111,7 +111,8 @@
 #define        THINKPAD_CMOS_BRIGHTNESS_UP     0x04
 #define        THINKPAD_CMOS_BRIGHTNESS_DOWN   0x05
 
-#define        THINKPAD_HKEY_VERSION           0x0100
+#define        THINKPAD_HKEY_VERSION_1         0x0100
+#define        THINKPAD_HKEY_VERSION_2         0x0200
 
 #define        THINKPAD_DISPLAY_LCD            0x01
 #define        THINKPAD_DISPLAY_CRT            0x02
@@ -164,6 +165,7 @@
 static const struct device_compatible_entry compat_data[] = {
        { .compat = "IBM0068" },
        { .compat = "LEN0068" },
+       { .compat = "LEN0268" },
        DEVICE_COMPAT_EOL
 };
 
@@ -178,13 +180,18 @@
        if (ret == 0)
                return 0;
 
-       /* We only support hotkey version 0x0100 */
+       /* We only support hotkey versions 0x0100 and 0x0200 */
        if (ACPI_FAILURE(acpi_eval_integer(aa->aa_node->ad_handle, "MHKV",
            &ver)))
                return 0;
 
-       if (ver != THINKPAD_HKEY_VERSION)
+       switch (ver) {
+       case THINKPAD_HKEY_VERSION_1:
+       case THINKPAD_HKEY_VERSION_2:
+               break;
+       default:
                return 0;
+       }
 
        /* Cool, looks like we're good to go */
        return ret;



Home | Main Index | Thread Index | Old Index