Funny battery values (nx6325)
Dan Lukes
dan at obluda.cz
Fri Mar 19 09:23:09 UTC 2010
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
More information about the freebsd-acpi
mailing list