summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2007-10-22 22:21:53 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2007-10-22 22:21:53 +0000
commitf25cf2b5c44ee9f2e81a86e41fa23d47b51f3401 (patch)
treecb1902baa59bdf3139183d9faa766ca47a680bd4 /sys/arch/sparc64
parent323fb3e0ba92d4f25decb144a0ca8df20a8836ee (diff)
CPU temperature sensors on the E450 have a conversion factor of 1/1 instead of
0/0 like the E250. Handle both.
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r--sys/arch/sparc64/dev/pcf8591_envctrl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/arch/sparc64/dev/pcf8591_envctrl.c b/sys/arch/sparc64/dev/pcf8591_envctrl.c
index 288bfac0bff..58da4f6c2eb 100644
--- a/sys/arch/sparc64/dev/pcf8591_envctrl.c
+++ b/sys/arch/sparc64/dev/pcf8591_envctrl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcf8591_envctrl.c,v 1.3 2007/10/22 20:53:10 cnst Exp $ */
+/* $OpenBSD: pcf8591_envctrl.c,v 1.4 2007/10/22 22:21:52 kettenis Exp $ */
/*
* Copyright (c) 2006 Damien Miller <djm@openbsd.org>
@@ -117,12 +117,15 @@ ecadc_attach(struct device *parent, struct device *self, void *aux)
if (addr != (ia->ia_addr << 1))
continue;
+ if (num == 0 || den == 0)
+ num = den = 1;
+
sensor = &sc->sc_channels[sc->sc_nchan].chan_sensor;
sensor->type = SENSOR_TEMP;
strlcpy(sensor->desc, desc, sizeof(sensor->desc));
sc->sc_channels[sc->sc_nchan].chan_num = chan;
- if (num == 0 || den == 0)
+ if (num == 1 && den == 1)
sc->sc_channels[sc->sc_nchan].chan_factor = 0;
else
sc->sc_channels[sc->sc_nchan].chan_factor =