Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Mar 2010 00:49:05 +1100 (EST)
From:      Ian Smith <smithi@nimnet.asn.au>
To:        Dan Lukes <dan@obluda.cz>
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:  <20100320002156.L85436@sola.nimnet.asn.au>
In-Reply-To: <4BA34277.1000509@obluda.cz>
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> <4BA34277.1000509@obluda.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 19 Mar 2010, Dan Lukes wrote:
 > 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.

Indeed.  I was confused by the later reference to method C1AC at line 
5666, and see it references \_SB.C074.C0E3.C149.C1AC - I haven't quite 
grasped the scoping yet ..

 > > 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

Can you / anyone suggest a good basic tutorial for ASL/AML?  The last 
time I tried following it from the ACPI specs I nearly drowned :)

 > > 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.

Ok.

 > > 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

Ok, Local3 being remainder I guess?  I need to study the language better 
before thrashing around with guesswork; it seems sensibly orthogonal.

 > 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.

Design and Lastfull Capacity being set equal, so equally suspicious ..

Thanks Dan,

cheers, Ian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100320002156.L85436>