Module Name: src
Committed By: macallan
Date: Thu Jun 28 21:21:03 UTC 2018
Modified Files:
src/sys/dev/i2c: fcu.c
Log Message:
fix a tpyo so now we get the correct maximum speed for CPU intake fans
while there, be a bit more responsive to temperature changes
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/i2c/fcu.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/i2c/fcu.c
diff -u src/sys/dev/i2c/fcu.c:1.6 src/sys/dev/i2c/fcu.c:1.7
--- src/sys/dev/i2c/fcu.c:1.6 Tue Jun 26 06:03:57 2018
+++ src/sys/dev/i2c/fcu.c Thu Jun 28 21:21:03 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: fcu.c,v 1.6 2018/06/26 06:03:57 thorpej Exp $ */
+/* $NetBSD: fcu.c,v 1.7 2018/06/28 21:21:03 macallan Exp $ */
/*-
* Copyright (c) 2018 Michael Lorenz
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fcu.c,v 1.6 2018/06/26 06:03:57 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fcu.c,v 1.7 2018/06/28 21:21:03 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -256,7 +256,7 @@ fcu_attach(device_t parent, device_t sel
} else if (strstr(descr, "INTAKE") != NULL) {
KASSERT(eeprom != NULL);
memcpy(&rmin, &eeprom[0x4c], 2);
- memcpy(&rmax, &eeprom[0x5e], 2);
+ memcpy(&rmax, &eeprom[0x4e], 2);
fan->base_rpm = rmin;
fan->max_rpm = rmax;
fan->step = (rmax - rmin) / 30;
@@ -276,6 +276,8 @@ fcu_attach(device_t parent, device_t sel
fan->max_rpm = 3000;
fan->step = 100;
}
+ DPRINTF("fan %s: %d - %d rpm, step %d\n",
+ descr, fan->base_rpm, fan->max_rpm, fan->step);
/* now stuff them into zones */
if (strstr(descr, "CPU A") != NULL) {
@@ -503,7 +505,7 @@ fcu_adjust(void *cookie)
sc->sc_pwm = FALSE;
for (i = 0; i < FCU_ZONE_COUNT; i++)
fcu_adjust_zone(sc, i);
- kpause("fanctrl", true, mstohz(sc->sc_pwm ? 2000 : 30000), NULL);
+ kpause("fanctrl", true, mstohz(sc->sc_pwm ? 1000 : 5000), NULL);
}
kthread_exit(0);
}