summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
diff options
context:
space:
mode:
authormartin <martin@NetBSD.org>2022-08-03 15:44:24 +0000
committermartin <martin@NetBSD.org>2022-08-03 15:44:24 +0000
commit0ab3990ac5ddd2972f00db1d14bb283e5091c9bf (patch)
tree768c04d5f45ab6f9cba9ab9916cb5efa91a8fa0c /sys/dev/acpi
parentf49676af09827dfd63e6b9561cea1a42e486a5c4 (diff)
Pull up following revision(s) (requested by riastradh in ticket #1490):
sys/dev/acpi/thinkpad_acpi.c: revision 1.48 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 (limited to 'sys/dev/acpi')
-rw-r--r--sys/dev/acpi/thinkpad_acpi.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/acpi/thinkpad_acpi.c b/sys/dev/acpi/thinkpad_acpi.c
index caed825c7ac..20a7f80a8d5 100644
--- a/sys/dev/acpi/thinkpad_acpi.c
+++ b/sys/dev/acpi/thinkpad_acpi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: thinkpad_acpi.c,v 1.46.24.1 2020/01/31 11:17:32 martin Exp $ */
+/* $NetBSD: thinkpad_acpi.c,v 1.46.24.2 2022/08/03 15:44:24 martin Exp $ */
/*-
* Copyright (c) 2007 Jared D. McNeill <jmcneill@invisible.ca>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: thinkpad_acpi.c,v 1.46.24.1 2020/01/31 11:17:32 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: thinkpad_acpi.c,v 1.46.24.2 2022/08/03 15:44:24 martin Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -702,6 +702,13 @@ thinkpad_fan_refresh(struct sysmon_envsys *sme, envsys_data_t *edata)
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;