diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2006-01-28 13:48:14 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2006-01-28 13:48:14 +0000 |
commit | 85fd30c12636d22cc49467c0b9e3173fe082031f (patch) | |
tree | 7e94c9c93ed3a7ecf031f78ad01a3ce7202bf7c5 /sys/dev/ic/lm78.c | |
parent | 78cbc65e7f16ece7329179196e75de7bd3d90de0 (diff) |
Consider temperatures below -45 degC to be invalid for Winbond chips.
Diffstat (limited to 'sys/dev/ic/lm78.c')
-rw-r--r-- | sys/dev/ic/lm78.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/ic/lm78.c b/sys/dev/ic/lm78.c index b1733a3b154..467bf4fcdbf 100644 --- a/sys/dev/ic/lm78.c +++ b/sys/dev/ic/lm78.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lm78.c,v 1.6 2006/01/26 22:07:14 kettenis Exp $ */ +/* $OpenBSD: lm78.c,v 1.7 2006/01/28 13:48:13 kettenis Exp $ */ /* * Copyright (c) 2005, 2006 Mark Kettenis @@ -644,13 +644,14 @@ wb_refresh_temp(struct lm_softc *sc, int n) /* * The data sheet suggests that the range of the temperature - * sensor is between -55 degC and +125 degC. However, -48 - * degC seems to be a very common bogus value, and is already - * unreasonably low. + * sensor is between -55 degC and +125 degC. However, values + * around -48 degC seem to be a very common bogus values. + * Since such values are unreasonably low, we use -45 degC for + * the lower limit instead. */ sdata = sc->lm_readreg(sc, sc->lm_sensors[n].reg) << 1; sdata += sc->lm_readreg(sc, sc->lm_sensors[n].reg + 1) >> 7; - if ((sdata > 0x0fa && sdata < 0x192) || sdata == 0x1a0) { + if (sdata > 0x0fa && sdata < 0x1a6) { sensor->flags |= SENSOR_FINVALID; sensor->value = 0; } else { |