diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-11-15 20:40:46 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-11-15 20:40:46 +0000 |
commit | 17af9534d85f69d406b6d05d5ecd1d3a866ccc38 (patch) | |
tree | 5d28448eed5e7f21430e450adbae45a128b84f6c | |
parent | 21e1df7ad3595f1cf73922b6c672c3c0e8b21ebf (diff) |
temperature readings of 0x80 mean "diode not connected", i think; kettenis ok
-rw-r--r-- | sys/dev/i2c/lm87.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/i2c/lm87.c b/sys/dev/i2c/lm87.c index da1699b6978..cbda3e501db 100644 --- a/sys/dev/i2c/lm87.c +++ b/sys/dev/i2c/lm87.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lm87.c,v 1.4 2005/11/15 20:28:04 kettenis Exp $ */ +/* $OpenBSD: lm87.c,v 1.5 2005/11/15 20:40:45 deraadt Exp $ */ /* * Copyright (c) 2005 Mark Kettenis @@ -232,8 +232,11 @@ lmenv_refresh(void *arg) break; case LMENV_EXT_TEMP: case LMENV_INT_TEMP: - sc->sc_sensor[sensor].value = - (int8_t)data * 1000000 + 273150000; + if (data == 0x80) + sc->sc_sensor[sensor].flags |= SENSOR_FINVALID; + else + sc->sc_sensor[sensor].value = + (int8_t)data * 1000000 + 273150000; break; case LMENV_FAN1: tmp = data * sc->sc_fan1_div; |