Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src/sys/dev/i2c Pull up following revision(s) (requested by j...



details:   https://anonhg.NetBSD.org/src/rev/be4c466c5584
branches:  netbsd-7
changeset: 798612:be4c466c5584
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Nov 23 13:13:26 2014 +0000

description:
Pull up following revision(s) (requested by jmcneill in ticket #255):
        sys/dev/i2c/axp22x.c: revision 1.2
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:

 sys/dev/i2c/axp22x.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r f105fe3ad883 -r be4c466c5584 sys/dev/i2c/axp22x.c
--- a/sys/dev/i2c/axp22x.c      Sun Nov 23 13:11:02 2014 +0000
+++ b/sys/dev/i2c/axp22x.c      Sun Nov 23 13:13:26 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: axp22x.c,v 1.1.2.2 2014/11/14 10:04:40 martin Exp $ */
+/* $NetBSD: axp22x.c,v 1.1.2.3 2014/11/23 13:13:26 martin Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: axp22x.c,v 1.1.2.2 2014/11/14 10:04:40 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: axp22x.c,v 1.1.2.3 2014/11/23 13:13:26 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -108,8 +108,8 @@
        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;
        }



Home | Main Index | Thread Index | Old Index