Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/i2c fix a tpyo so now we get the correct maximum spe...



details:   https://anonhg.NetBSD.org/src/rev/1bf376923950
branches:  trunk
changeset: 323747:1bf376923950
user:      macallan <macallan%NetBSD.org@localhost>
date:      Thu Jun 28 21:21:03 2018 +0000

description:
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

diffstat:

 sys/dev/i2c/fcu.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (45 lines):

diff -r f3c599f4dd6e -r 1bf376923950 sys/dev/i2c/fcu.c
--- a/sys/dev/i2c/fcu.c Thu Jun 28 17:22:09 2018 +0000
+++ b/sys/dev/i2c/fcu.c Thu Jun 28 21:21:03 2018 +0000
@@ -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 @@
                        } 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 @@
                                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 @@
                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);
 }



Home | Main Index | Thread Index | Old Index