Add input event to APM event bridge for embedded devices
Subsystems (2)
RFC PATCH 1/1 Add input event to APM event bridge for embedded devices
This patch adds a very simple input power event to APM user suspend event bridge. Its currently only works for the systems using the emulated APM driver but could easily be extended to work with anything with a true APM BIOS too.
This covers a standard embedded system need which is to suspend when the user presses a suspend button. It leaves options open to system integrators to ignore (or unload) this code and implement their own more complex event handling system.
Its hidden behind the EMBEDDED Kconfig option since its only likely to be of use to embedded style systems. It can be built as a module so the "hardcoded" policy can easily be removed from the kernel at runtime if desired too.
---
drivers/input/Kconfig | 12 ++++ drivers/input/Makefile | 1 drivers/input/apm-power.c | 125 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 138 insertions(+)
drivers/input/Kconfig +12 -0
@@ -137,6 +137,18 @@ config INPUT_EVBUG To compile this driver as a module, choose M here: the module will be called evbug. +config INPUT_APMPOWER + tristate "Input Power Event -> APM Bridge" if EMBEDDED + depends on INPUT && APM_EMULATION + ---help--- + Say Y here if you want suspend key events to trigger a user + requested suspend through APM. This is useful on embedded + systems where such behviour is desired without userspace + interaction. If unsure, say N. + + To compile this driver as a module, choose M here: the + module will be called apm-power. + comment "Input Device Drivers" source "drivers/input/keyboard/Kconfig"
drivers/input/Makefile +1 -0
@@ -22,3 +22,4 @@ obj-$(CONFIG_INPUT_TABLET) += tablet/ obj-$(CONFIG_INPUT_TOUCHSCREEN) += touchscreen/ obj-$(CONFIG_INPUT_MISC) += misc/ +obj-$(CONFIG_INPUT_APMPOWER) += apm-power.o
drivers/input/apm-power.c new file +125 -0
125 lines not on this page · raw message