summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2005-11-21 22:13:31 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2005-11-21 22:13:31 +0000
commit55f878399cca48d19c4b0c509422809c7f61467b (patch)
tree8f484a85887275a38a360250a4493571f9c005a3 /sys/arch/i386
parent111114f9b27d6d4d6d41f0783757a02392bd0306 (diff)
normalise the values read off the hw for the voltages
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/esm.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/arch/i386/i386/esm.c b/sys/arch/i386/i386/esm.c
index 3fecb325ea6..e9b0db828ff 100644
--- a/sys/arch/i386/i386/esm.c
+++ b/sys/arch/i386/i386/esm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: esm.c,v 1.3 2005/11/21 22:07:49 deraadt Exp $ */
+/* $OpenBSD: esm.c,v 1.4 2005/11/21 22:13:30 dlg Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -105,6 +105,7 @@ int esm_smb_cmd(struct esm_softc *, struct esm_smb_req *,
struct esm_smb_resp *);
int64_t esm_val2temp(u_int16_t);
+int64_t esm_val2volts(u_int16_t);
int
esm_match(struct device *parent, void *match, void *aux)
@@ -198,6 +199,9 @@ esm_refresh(void *arg)
case SENSOR_TEMP:
sensor->es_sensor.value = esm_val2temp(val->v_reading);
break;
+ case SENSOR_VOLTS_DC:
+ sensor->es_sensor.value = esm_val2volts(val->v_reading);
+ break;
default:
sensor->es_sensor.value = val->v_reading;
break;
@@ -562,3 +566,9 @@ esm_val2temp(u_int16_t value)
{
return (((int64_t)value/10 * 1000000) + 273150000);
}
+
+int64_t
+esm_val2volts(u_int16_t value)
+{
+ return ((int64_t)value * 1000);
+}