summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2016-05-14 15:44:24 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2016-05-14 15:44:24 +0000
commit49a89c50ebc74042dbb50484ed31b1d7217d7c93 (patch)
treec732686ff4427105ef2ac09963c0607ae4b3da15 /sys/arch
parenteb3203413ef0ff5ec4b92294de70653a789b6f84 (diff)
Return correct rpm values for all fans.
ok kettenis
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/macppc/dev/smu.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/arch/macppc/dev/smu.c b/sys/arch/macppc/dev/smu.c
index a88e19446f6..ef24c864fbe 100644
--- a/sys/arch/macppc/dev/smu.c
+++ b/sys/arch/macppc/dev/smu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smu.c,v 1.28 2016/05/04 08:20:58 mpi Exp $ */
+/* $OpenBSD: smu.c,v 1.29 2016/05/14 15:44:23 mglocker Exp $ */
/*
* Copyright (c) 2005 Mark Kettenis
@@ -565,15 +565,15 @@ smu_fan_refresh(struct smu_softc *sc, struct smu_fan *fan)
int error;
cmd->cmd = SMU_FAN;
- cmd->len = 2;
+ cmd->len = 1;
cmd->data[0] = 0x01; /* fan-rpm-control */
- cmd->data[1] = 0x01 << fan->reg;
error = smu_do_cmd(sc, 800);
if (error) {
fan->sensor.flags = SENSOR_FINVALID;
return (error);
}
- fan->sensor.value = (cmd->data[1] << 8) + cmd->data[2];
+ fan->sensor.value =
+ (cmd->data[fan->reg * 2 + 1] << 8) | cmd->data[fan->reg * 2 + 2];
fan->sensor.flags = 0;
return (0);
}