From owner-freebsd-bugs@freebsd.org Fri Jul 28 17:55:53 2017 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50BC4DCB0CB for ; Fri, 28 Jul 2017 17:55:53 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E5EA6A1F6 for ; Fri, 28 Jul 2017 17:55:53 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v6SHtqaq059461 for ; Fri, 28 Jul 2017 17:55:53 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 221071] NCT6779D - implement support for sensor readings Date: Fri, 28 Jul 2017 17:55:53 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.1-RELEASE X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: nbe@renzel.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jul 2017 17:55:53 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D221071 --- Comment #2 from Nils Beyer --- I don't get it; for instance, CPU temperature - bank 4, register 91h reads 36h =3D 54 so, the logic in NetBSD code is as following: ----------------------------------------------------------------------- data =3D (*sc->lm_readreg)(sc, sc->lm_sensors[n].reg) << 1; data +=3D (*sc->lm_readreg)(sc, sc->lm_sensors[n].reg + 1) >> 7; if (data > 0xfffffff || (data > 0x0fa && data < 0x1a6)) { sc->sensors[n].state =3D ENVSYS_SINVALID; } else { if (data & 0x100) data -=3D 0x200; sc->sensors[n].state =3D ENVSYS_SVALID; sc->sensors[n].value_cur =3D data * 500000 + 273150000; } ----------------------------------------------------------------------- 1) shift original value one left -> 6Ch =3D 108 2) shift value of next register seven right (0) and add that to original va= lue -> 6Ch stays 2) bit-and that with 100h, if true then subtract 200h -> it's false, so 6Ch stays 3) multiply that with 500000 -> 0337f980h =3D 54000000 4) add 273150000 -> 137FE9B0h =3D 327150000 So, I have exceeded the safe temperature of my CPU and of the solar system's sun... --=20 You are receiving this mail because: You are the assignee for the bug.=