diff options
| author | jmcneill <jmcneill@NetBSD.org> | 2014-11-21 22:31:09 +0000 |
|---|---|---|
| committer | jmcneill <jmcneill@NetBSD.org> | 2014-11-21 22:31:09 +0000 |
| commit | b89a6c8647a72a6216e0d0e9620bf5bea1b7ecda (patch) | |
| tree | 17cb399c9584118674704167338286040e5375de /sys/dev | |
| parent | c7df815efb4b8c20b83c4c30d54ae225d3c64ad4 (diff) | |
Change internal temperature base from -267.7C to -243.7C. The AXP223
datasheet says that the value is between -267.7C and 165.8C in steps of 0.1C,
but this doesn't make sense for a 12-bit field. If we take the maximum value
and subtract 4095 we get -243.7C, effectively adding +24C to the reported
temp. On my A31 board, this changes a chilly 15.3C to a more reasonable 39.3C.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/i2c/axp22x.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/i2c/axp22x.c b/sys/dev/i2c/axp22x.c index 6b3c21ee951..e2038fe2e08 100644 --- a/sys/dev/i2c/axp22x.c +++ b/sys/dev/i2c/axp22x.c @@ -1,4 +1,4 @@ -/* $NetBSD: axp22x.c,v 1.1 2014/10/12 23:58:42 jmcneill Exp $ */ +/* $NetBSD: axp22x.c,v 1.2 2014/11/21 22:31:09 jmcneill Exp $ */ /*- * Copyright (c) 2014 Jared D. McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: axp22x.c,v 1.1 2014/10/12 23:58:42 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: axp22x.c,v 1.2 2014/11/21 22:31:09 jmcneill Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -108,8 +108,8 @@ axp22x_sensors_refresh(struct sysmon_envsys *sme, envsys_data_t *edata) if (error) { edata->state = ENVSYS_SINVALID; } else { - /* between -267.7C and 165.8C, step +0.1C */ - edata->value_cur = (((buf[0] << 4) | (buf[1] & 0xf)) - 2677) + /* between -243.7C and 165.8C, step +0.1C */ + edata->value_cur = (((buf[0] << 4) | (buf[1] & 0xf)) - 2437) * 100000 + 273150000; edata->state = ENVSYS_SVALID; } |
