Ideas for spec for PMU/ACPI, Was: Patch to hal-spec : 1/6-pmu-acpi

David Zeuthen david at fubar.dk
Mon Jan 17 10:28:12 PST 2005


On Mon, 2005-01-17 at 17:50 +0000, Richard Hughes wrote:
> Sure, but my way *is* suggesting the system.stuff is ACPI and PMU neutral
> - it's just they will require acpi and pmu specifics for the addon code:
> 

Don't you think it's easier, from a maintainability point of view, to
have
separate code for ACPI and PMU?

> Applications would query:
> 
> hal-get-property 
>  --udi device=/org/freedesktop/Hal/devices/batery_1
>  --key battery.charge_level.current
> 
> And the battery polling code would read :
> hal-get-property 
>  --udi device=/org/freedesktop/Hal/devices/batery_1
>  --key linux.procfs_path
> and then update 
> hal-set-property 
>  --udi device=/org/freedesktop/Hal/devices/batery_1
>  --key battery.charge_level.current
>  --int VALUE_OF{linux.procfs_path}
> 
> Therefore the application is ACPI/PMU neutral, with a shared polling addon
> that either queries linux.procfs_path or linux.pmu_device.
> 
> > On the point of common battery polling code, I don't really think
> > this is useful as an addon should really be a small piece of code
> > reading stuff and populating the appropriate properties. I could
> > be wrong though.
> 
> Have i got the wrong idea on how the addon code is inheriting properties
> from the devices?
> 

Addons will be able to access all properties, yeah. The way I'd like 
this to be is

 - hald discovers ACPI functionality and adds suitable device objects
   with linux.acpi.* properties. Also adds properties system.* and
   battery.* as appropriate 
 - we merge properties saying execute the ACPI battery polling addon
   if the linux.acpi.type (or whatever) says it's a battery
 - the ACPI battery polling addon sets appropriate battery.* properties

One thing to keep in mind is that the addon should be minimal; do as
much as you can in hald without requiring the addon (basically, only
set the battery.charge_level.current). 

PMU implementations would do something similar.

How does that sound?

David


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



More information about the Hal mailing list