Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi With the recent change of the EC address space ...



details:   https://anonhg.NetBSD.org/src/rev/808e075b4861
branches:  trunk
changeset: 1010182:808e075b4861
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sun May 17 11:32:51 2020 +0000

description:
With the recent change of the EC address space handler, we no longer get
an ACPI_INTEGER in host byte order but a byte sized buffer with little
endian data.

Extract only the low 8 bits from buffer to get the fan speed again.

diffstat:

 sys/dev/acpi/thinkpad_acpi.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r 628babeb5d8e -r 808e075b4861 sys/dev/acpi/thinkpad_acpi.c
--- a/sys/dev/acpi/thinkpad_acpi.c      Sun May 17 09:37:48 2020 +0000
+++ b/sys/dev/acpi/thinkpad_acpi.c      Sun May 17 11:32:51 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: thinkpad_acpi.c,v 1.47 2019/08/05 10:09:35 msaitoh Exp $ */
+/* $NetBSD: thinkpad_acpi.c,v 1.48 2020/05/17 11:32:51 mlelstv 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.47 2019/08/05 10:09:35 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: thinkpad_acpi.c,v 1.48 2020/05/17 11:32:51 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -702,6 +702,13 @@
                edata->state = ENVSYS_SINVALID;
                return;
        }
+
+       /*
+        * Extract the low bytes from buffers
+        */
+       lo = ((uint8_t *)&lo)[0];
+       hi = ((uint8_t *)&hi)[0];
+
        rpm = ((((int)hi) << 8) | ((int)lo));
        if (rpm < 0) {
                edata->state = ENVSYS_SINVALID;



Home | Main Index | Thread Index | Old Index