[PATCH] different in acpi.c

Danny Kukawka danny.kukawka at web.de
Wed Aug 10 05:56:09 PDT 2005


Hi,

this is a patch to fix several things in the ACPI related code:

* Status for battery.reporting.last_full is now read by
  battery_poll_infrequently ().  This saves several open/read
  calls to /proc/acpi/battery/*/{info,state} and enables reuse of
  the information gathered (makes reopening of the {info,state}
  proc entries unnecessary).

  battery_poll_infrequently () is invoked              
  * every 60 minutes 
    and
  * once a AC adapter ACPI event occurs

  This prevents battery.reporting.last_full to be changed more
  often then intended.

* battery.present is now read from /proc/acpi/battery/*/state
  instead of reading the information from /proc/acpi/battery/*/info 
  since reading from the info proc entry takes very long on several 
  systems.

* If a ACPI battery event occurs, we now also gather the information
  for ac_adapter.present.  This helps to detect the AC online/offline 
  state for machine which do not trigger an ACPI event for AC 
  online/offline but still report battery events by an issuing 
  ACPI event.

* Splitted acpi_poll() into acpi_poll_battery() and acpi_poll_acadapt().

Tested on several system having either a proper or broken ACPI
implementation for battery and AC adapter events.

Please review.

Cheers,

Danny

acpi.c |  217 ++++++++++++++++++++++++++++++++++++++----------------------
 1 files changed, 141 insertions(+), 76 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hal-fix-poll_bat.last.full_v3.diff
Type: text/x-diff
Size: 8262 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20050810/1f87dfa9/hal-fix-poll_bat.last.full_v3.bin
-------------- next part --------------
_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal


More information about the Hal mailing list