Date: Fri, 19 Mar 2010 10:23:03 +0100 From: Dan Lukes <dan@obluda.cz> To: Ian Smith <smithi@nimnet.asn.au> Cc: Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>, freebsd-acpi@freebsd.org, "Alexandre \"Sunny\" Kovalenko" <gaijin.k@ovi.com> Subject: Re: Funny battery values (nx6325) Message-ID: <4BA34277.1000509@obluda.cz> In-Reply-To: <20100319155246.L85436@sola.nimnet.asn.au> References: <20100315062028.GC52442@uriah.heep.sax.de> <20100317070428.GA2924@server.vk2pj.dyndns.org> <20100317074549.GC52442@uriah.heep.sax.de> <1268829363.6171.13.camel@RabbitsDen> <20100318195312.GQ52442@uriah.heep.sax.de> <1268963804.47240.16.camel@RabbitsDen> <20100319155246.L85436@sola.nimnet.asn.au>
next in thread | previous in thread | raw e-mail | index | archive | help
On 03/19/10 06:18, Ian Smith: > > Method (C1AC, 1, Serialized) > > { > > ... > > If (C14C) > > { > > Store (Arg0, C160) > > Store (C164, Local0) > > // This is your design capacity > > Store (Local0, Index (DerefOf (Index (C1AF, Arg0)), 0x01)) > > // This is your last full capacity > > Store (Local0, Index (DerefOf (Index (C1AF, Arg0)), 0x02)) > > // And yes they are the same by design of your BIOS ;) > > ... > Hardly smarter than yourself :) but I notice there's another Method C1AC > in the EC section, Scope (C0E3), The above fragment is from method you are speaking about. > these calculations around line 2767 of Joerg's file. It's way too > complicated with double derefs etc for me to follow Easy: Store (Local0, Index (DerefOf (Index (C1AF, Arg0)), 0x01)) ... do this: C1AF[1] = Local0 > but it does maths and refers to C1AF a lot, so might be updating those values? C1AF is array returned by _BIF; C1AF[1] is it's "Design Capacity" item. C1AC method extract values from EC's memory into array returned by _BIF. Mostly with no math. > I notice a > couple of divide by 100 after adding 99 .. if I'm reading it right .. > > Divide (Add (Local1, 0x63), 0x64, Local3, Local2) > > where something may be out by 10 in the manner Peter mentioned earlier? It do this: Local2 = (Local1 + 99) / 100 e.g. Local1 / 100 rounded up Local2 is then stored into C1AF[5] (first case) or C1AF[6] (second case). The C1AF[5] is "Design Capacity of Warning", C1AF[6] is "Design Capacity of Low". Suspicious values for C1AF[2] / "Last Full Charge Capacity" come from EC's C164 with no math. Dan
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4BA34277.1000509>