From f25cf2b5c44ee9f2e81a86e41fa23d47b51f3401 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Mon, 22 Oct 2007 22:21:53 +0000 Subject: CPU temperature sensors on the E450 have a conversion factor of 1/1 instead of 0/0 like the E250. Handle both. --- sys/arch/sparc64/dev/pcf8591_envctrl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sys/arch/sparc64') 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 @@ -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 = -- cgit v1.2.3