diff options
author | Rob Herring <rob.herring@calxeda.com> | 2012-06-21 16:06:54 -0500 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2012-08-15 23:46:26 -0600 |
commit | 84bb6fd0cac7f18db8ae8cd221f12c26a1d3ac2e (patch) | |
tree | a355f9a79ec4c187632d5436169a044da0d79f75 | |
parent | 19fe2dcc129c23dc592e219283c63d54ce9e5489 (diff) | |
download | linux-topics-84bb6fd0cac7f18db8ae8cd221f12c26a1d3ac2e.tar.gz |
UBUNTU: SAUCE: ARM: highbank: add soft power and reset key event handling
BugLink: http://launchpad.net/bugs/1008345
Power and reset keys come from management processor via ipc messages.
Passing them to userspace does not work in a non-desktop environment
as acpid is used in that case. So we handle the keys directly.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-rw-r--r-- | arch/arm/mach-highbank/highbank.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c index d75b0a78d88..4ed8211b7fd 100644 --- a/arch/arm/mach-highbank/highbank.c +++ b/arch/arm/mach-highbank/highbank.c @@ -15,6 +15,7 @@ */ #include <linux/clk.h> #include <linux/clkdev.h> +#include <linux/input.h> #include <linux/io.h> #include <linux/irq.h> #include <linux/irqdomain.h> @@ -22,6 +23,7 @@ #include <linux/of_irq.h> #include <linux/of_platform.h> #include <linux/of_address.h> +#include <linux/reboot.h> #include <linux/smp.h> #include <asm/cacheflush.h> @@ -35,6 +37,7 @@ #include <asm/mach/arch.h> #include <asm/mach/map.h> #include <asm/mach/time.h> +#include <mach/pl320-ipc.h> #include "core.h" #include "sysregs.h" @@ -149,9 +152,28 @@ static void highbank_power_off(void) cpu_do_idle(); } +static int hb_keys_notifier(struct notifier_block *nb, unsigned long event, void *data) +{ + u32 key = *(u32 *)data; + + if (event != 0x1000) + return 0; + + if (key == KEY_POWER) + orderly_poweroff(false); + else if (key == 0xffff) + ctrl_alt_del(); + + return 0; +} +static struct notifier_block hb_keys_nb = { + .notifier_call = hb_keys_notifier, +}; + static void __init highbank_init(void) { pm_power_off = highbank_power_off; + pl320_ipc_register_notifier(&hb_keys_nb); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); } |