[PATCH] different in acpi.c
David Zeuthen
david at fubar.dk
Wed Aug 10 16:36:04 PDT 2005
On Wed, 2005-08-10 at 14:56 +0200, Danny Kukawka wrote:
> 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.
I agree this is a good thing, however note we only send out
PropertyModified if the property actually changes value. It still make
the code more clean though so I like this.
> * 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.
Looks good to commit. Much thanks!
Cheers,
David
_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal
More information about the Hal
mailing list