Commit Graph

5 Commits

Author SHA1 Message Date
Nate Lawson
987b1ad6d5 Remove unused variable.
Coverity ID:	548
Found by:	Coverity Prevent
2006-02-21 03:16:58 +00:00
Bruno Ducrot
ab033fa0e3 * fix bst.status. We mark some bits, but forgot to reset all of them
before.  The symptom is that the battery inform us its charge and discharge
  at the same time...

* fix bst.rate to correctly output the (dis)charging rate.  We'll use
  the current average over one minute command and not the at_rate command.
  Note that this method is not correct if the capacity_mode is set, but
  since we don't set it ourself, it is not a problem.

  The at_rate do not give the actual rate but is used to compute the
  estimated time for (dis)charging a battery.  We should actually
  write an estimation of the actual rate using at_rate cmd and then
  perform a read to the various estimators.

Approved by:	njl
MFC after:	2 days
2006-01-12 21:56:37 +00:00
Nate Lawson
1f6e47a324 Only copy out the battery status/info if there was no error. 2005-11-24 05:23:56 +00:00
Hajimu UMEMOTO
4796860760 Cache the result of battery info retrieval from smbat as well
as cmbat.

Reviewed by:	njl
MFC after:	3 days
2005-11-22 03:34:09 +00:00
Nate Lawson
a7e59a7679 Import ACPI smart battery support. Newer systems (Acer, mostly) do not
support the CM-battery interface.  Smart batteries can eventually be
supported without ACPI via a separate SMBus interface.  The ACPI interface
uses the embedded controller for reading/writing to the SMBus, and normal
ASL definitions for locating the battery controller (since SMBus can't be
enumerated.)  Also import definitions for the smart battery interface.

This was written by Hans Petter Selasky with minor cleanups from myself.

Submitted by:	Hans Petter Selasky <hselasky / c2i.net>
2005-10-23 00:20:13 +00:00