FIX ac_adaptor.present for *really* broken BIOS (Was: Question re on battery vs on mains)

David Zeuthen david at fubar.dk
Tue Aug 2 09:24:01 PDT 2005


On Tue, 2005-08-02 at 09:44 +0100, Richard Hughes wrote:
> On Tue, 2005-08-02 at 09:02 +0100, Richard Hughes wrote:
> > HAL only does the 30 second fallback reading for battery.type = primary.
> > This needs to be fixed.
> 
> First part of the fix attached. 
> 
> For ChangeLog:
> 
> hald/linux2/acpi.c (ac_adapter_refresh_poll): New function, just set the
> present key. This is quicker than setting the capability and category on
> every forced refresh.
> (ac_adapter_refresh): Use ac_adapter_refresh_poll and while we are here,
> add device_property_atomic_update_begin and
> device_property_atomic_update_end to make atomic.
> (acpi_poll): Add the ac_adapter updates to make sure we get the value of
> ac_adapter correct at least on every 30 second forced refresh. This
> fixes really broken ACPI BIOS's that don't emit acad or batt events.

I've committed this while also fixing a memory leak.

> I'll fix the fairly common "no acad events, yes bat events" case this
> afternoon, but this patch is a bit more involved.

Hmm, what exactly needs to be done here?

Cheers,
David


_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list