Subject: Re: acpi/apm code only uses last battery?
To: None <port-i386@netbsd.org>
From: Greg Troxel <gdt@ir.bbn.com>
List: port-i386
Date: 10/11/2006 15:28:46
--=-=-=
Content-Transfer-Encoding: quoted-printable


  This is clearly wrong, and it's because the loop in
  src/sys/dev/acpi/acpi_apm.c:acpiapm_get_powstat overwrites the battery
  info as it finds each battery while looping over the data.

  One fix would be to aggregate the 'design cap' and 'charge' levels, to
  give the impression of a single battery with the sum of the charges.
  Another would be to represent each battery as an apm battery.

I have fixed this; /dev/apm (via apm(8) and the gnome battery applet)
now reports aggregated fractional charge via the acpi compat code.
The discharge rate is aggregated too, so one gets sane remaining times
on either battery.

=2D-=20

    Greg Troxel <gdt@ir.bbn.com>

--=-=-=
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (NetBSD)

iD8DBQFFLUXx+vesoDJhHiURAtPRAJ9puxh80pIrrfaETLqImCTB0LU7WwCeNvop
9tmySS/oUmVK/mgnKhIT2wQ=
=H11M
-----END PGP SIGNATURE-----
--=-=-=--