ACPI buttons

Richard Hughes hughsient at gmail.com
Wed Feb 22 05:43:29 PST 2006


Currently in g-p-m, there are two different types of ButtonPressed
handlers:

There is one, for keyboard buttons (thanks to Matthew) which produce a:

udi="foo_Kbd_Port_logicaldev_input", condition="ButtonPressed",
details="sleep"

for each type of button. Easy to process, and efficient.

And there is the acpi type buttons that produce:

udi="acpi_foo", condition="ButtonPressed", details="";

and then we have to query

button.type="power"

so we can do the correct action.

Instead of probing buttons in the DSDT like we do now (buttons present
in the /proc/acpi/buttons tree) and adding them as discrete objects,
I've got a better suggestion.

We create one generic "/org/freedesktop/Hal/devices/button_hardware"
object, that all the ACPI events can be "ButtonPressed"d from. This even
lets us handle the PMU stuff nicer. And Toshiba.

This would solve http://bugzilla.gnome.org/show_bug.cgi?id=331758 and
potentially others for where acpi gets events of a hardware button, but
where the button is not expressed in the DSDT.

For the expressed buttons in the DSDT, we can have different properties
on this single object.

button.known_types (stringlist) = "lid", "suspend", shutdown"

for programs that want to know what sort of buttons the hardware has
attached (like the preferences in gnome-power-manager). This also allows
us to match faulty descriptions with FDI files, that would allow us to
add other types that we couldn't work out from the presented acpi tree.

And it unifies the ButtonPressed logic into something easier to process
and understand.

Comments please.

Richard.



More information about the hal mailing list