Quickstart Button ACPI driver to serve PNP0C32 ACPI devices
Subsystems (4)
RFC PATCH 1/1 Quickstart Button ACPI driver to serve PNP0C32 ACPI devices
Hi,
if you have a recent Microsoft Office format reader you find some documentation here:
http://www.microsoft.com/whdc/system/platform/firmware/DirAppLaunch.mspx
I finally got it converted and these should be readable in OpenOffice as well:
ftp.suse.com/pub/people/trenn/hotstart_quickstart_docu
The idea of these buttons is that they are undefined from BIOS/kernel point of view. Userspace has to map a functionality to them. Therefore the idea to modify the input event keycode via sysfs file. There should be 2 situations that perfectly are triggered via userspace:
- DMI match (or similar) and assign the correct buttons on the known machine. I know that hal could do this rather well and had dmi tables pre-defined. AFAIK hal is already obsolete? What userspace tools/lists would be best to ask?
- If the button is undefined, a higher level userspace X application could ask the user to set it to something useful. For this to happen the usage id has to be passed somehow through the input layer. Not sure how realistic such an implementation is and what is still needed in X to make this happen.
I based my work on an out-of-tree driver from Angelo.
Works here with a laptop with one such button
(always throws 0x2 -> woken up from suspend,
even it did not wake up suspend, but that should not matter). The key isn't reachable otherwise, neither with WMI,
nor scancodes.
I didn't test the main feature (from the spec perspective): wake up from suspend and launch the appropriate application.
I first like to have some opinions about this approach. Especially the re-registering of the input device is not that nice, but I couldn't see how to modify an input device' capabilities on the fly. Seems as if it's not made for that.
Anyway, it works in this way.
Also be aware that I tested this a bit. But on review you should be able to find the one or other bug. Hints/review appreciated.
Thanks,
Thomas
X86 platform drivers: Introduce Quickstart Button ACPI driver to serve PNP0C32 ACPI devices
drivers/platform/x86/Kconfig +11 -0
@@ -537,4 +537,15 @@ config INTEL_SCU_IPC some embedded Intel x86 platforms. This is not needed for PC-type machines. +config ACPI_QUICKSTART + tristate "ACPI QUICKSTART quick launch button support" + depends on ACPI + select INPUT + default n + help + Some media and other buttons could get driven by this driver. + It could get identified which button woke the machine up after + a suspend and appropriate action, e.g. launch an application + could be taken by userspace. + endif # X86_PLATFORM_DEVICES
drivers/platform/x86/Makefile +1 -0
@@ -25,4 +25,5 @@ obj-$(CONFIG_ACPI_ASUS) += asus_acpi.o obj-$(CONFIG_TOPSTAR_LAPTOP) += topstar-laptop.o obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o obj-$(CONFIG_TOSHIBA_BT_RFKILL) += toshiba_bluetooth.o +obj-$(CONFIG_ACPI_QUICKSTART) += quickstart.o obj-$(CONFIG_INTEL_SCU_IPC) += intel_scu_ipc.o
drivers/platform/x86/quickstart.c new file +374 -0
374 lines not on this page · raw message
Quoted 6 lines · Thomas Renninger
Hi,
if you have a recent Microsoft Office format reader you find some documentation here:
http://www.microsoft.com/whdc/system/platform/firmware/DirAppLaunch.mspx
Quoted 6 lines
I finally got it converted and these should be readable in OpenOffice as well:
ftp.suse.com/pub/people/trenn/hotstart_quickstart_docuThe idea of these buttons is that they are undefined from BIOS/kernel point of view. Userspace has to map a functionality to them. Therefore the idea to modify the input event keycode via sysfs file.
What s wrong with using EVIOCSKEYCODE to adjust the mapping. Note that the issue of handlers not re-binding after keymap change should be solved regardless.
Quoted 5 lines
There should be 2 situations that perfectly are triggered via userspace:
- DMI match (or similar) and assign the correct buttons on the known machine. I know that hal could do this rather well and had dmi tables pre-defined. AFAIK hal is already obsolete? What userspacetools/listswould be best to ask?
udev/hal remap keys on laptop keyboards, they should have facilities to do that here as well.
Quoted 6 lines
- If the button is undefined, a higher level userspace X application could ask the user to set it to something useful. For this to happen the usage id has to be passed somehow through the input layer. Not sure how realistic such an implementation is and what is still needed in X to make this happen.
Yes, KEY_UNKNOWN is expected to cause such behavior.
Signature · 1 line
Dmitry
Quoted 4 lines · Thomas Renninger
The idea of these buttons is that they are undefined from BIOS/kernel point of view. Userspace has to map a functionality to them. Therefore the idea to modify the input event keycode via sysfs file. There should be 2 situations that perfectly are triggered via userspace:
They're logically buttons, so the right mechanism is for them to be configured via the standard keymap ioctls. There's already infrastructure for setting this via udev - see /lib/udev/keymaps on recent systems. That should let you avoid the need to unregister/reregister.
Signature · 1 line
Matthew Garrett | [email protected]