summaryrefslogtreecommitdiff
path: root/sys/dev/i2c
diff options
context:
space:
mode:
authorpgoyette <pgoyette@NetBSD.org>2009-05-19 23:43:27 +0000
committerpgoyette <pgoyette@NetBSD.org>2009-05-19 23:43:27 +0000
commit9cce088ba81bb9ff4cf51234e5cb0ef4426360f8 (patch)
treec9f47a7675fe4d939f5b3afa62e1cc52cca36b64 /sys/dev/i2c
parenta76a7fd159eca05dd7921f1774b76dee564f6756 (diff)
When displaying boot-time trip-register settings, shift to exclude
fractional bits. Otherwise, a setting of 52C reports 832 during boot, and that's way too hot for any memory!
Diffstat (limited to 'sys/dev/i2c')
-rw-r--r--sys/dev/i2c/sdtemp.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/dev/i2c/sdtemp.c b/sys/dev/i2c/sdtemp.c
index 7450122f46a..e7ab974da18 100644
--- a/sys/dev/i2c/sdtemp.c
+++ b/sys/dev/i2c/sdtemp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sdtemp.c,v 1.1 2009/05/09 15:04:25 pgoyette Exp $ */
+/* $NetBSD: sdtemp.c,v 1.2 2009/05/19 23:43:27 pgoyette Exp $ */
/*
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdtemp.c,v 1.1 2009/05/09 15:04:25 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdtemp.c,v 1.2 2009/05/19 23:43:27 pgoyette Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -282,17 +282,20 @@ sdtemp_attach(device_t parent, device_t self, void *aux)
iic_acquire_bus(sc->sc_tag, 0);
if (sdtemp_read_16(sc, SDTEMP_REG_LOWER_LIM, &sc->sc_low_lim) == 0 &&
sc->sc_low_lim != 0) {
- aprint_normal("low limit %d ", sc->sc_low_lim);
+ sc->sc_low_lim >>= 4;
+ aprint_normal("low limit %dC ", sc->sc_low_lim);
i++;
}
if (sdtemp_read_16(sc, SDTEMP_REG_UPPER_LIM, &sc->sc_high_lim) == 0 &&
sc->sc_high_lim != 0) {
- aprint_normal("high limit %d ", sc->sc_high_lim);
+ sc->sc_high_lim >>= 4;
+ aprint_normal("high limit %dC ", sc->sc_high_lim);
i++;
}
if (sdtemp_read_16(sc, SDTEMP_REG_CRIT_LIM, &sc->sc_crit_lim) == 0 &&
sc->sc_crit_lim != 0) {
- aprint_normal("critical limit %d ", sc->sc_crit_lim);
+ sc->sc_crit_lim >>= 4;
+ aprint_normal("critical limit %dC ", sc->sc_crit_lim);
i++;
}
iic_release_bus(sc->sc_tag, 0);