Commit 2941bdd1 authored by Rob Herring's avatar Rob Herring Committed by Greg Kroah-Hartman

ARM: highbank: handle soft poweroff and reset key events

commit 38431148 upstream.

Graceful reboot and poweroff via IPMI commands to the management
processor don't work. Power and reset keys are events from the
management processor which are generated via IPC messages. Passing
the keys to userspace does not work as neither acpid nor a desktop
environment are present.

This adds a notifier handler for the IPC messages so the kernel can
handle the key events directly and IPMI graceful shutdown will work.
Signed-off-by: default avatarRob Herring <rob.herring@calxeda.com>
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 448211a1
...@@ -17,12 +17,15 @@ ...@@ -17,12 +17,15 @@
#include <linux/clkdev.h> #include <linux/clkdev.h>
#include <linux/clocksource.h> #include <linux/clocksource.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/input.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/irqchip.h> #include <linux/irqchip.h>
#include <linux/mailbox.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_irq.h> #include <linux/of_irq.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/reboot.h>
#include <linux/amba/bus.h> #include <linux/amba/bus.h>
#include <linux/clk-provider.h> #include <linux/clk-provider.h>
...@@ -153,6 +156,24 @@ static struct notifier_block highbank_platform_nb = { ...@@ -153,6 +156,24 @@ static struct notifier_block highbank_platform_nb = {
.notifier_call = highbank_platform_notifier, .notifier_call = highbank_platform_notifier,
}; };
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) static void __init highbank_init(void)
{ {
pm_power_off = highbank_power_off; pm_power_off = highbank_power_off;
...@@ -161,6 +182,8 @@ static void __init highbank_init(void) ...@@ -161,6 +182,8 @@ static void __init highbank_init(void)
bus_register_notifier(&platform_bus_type, &highbank_platform_nb); bus_register_notifier(&platform_bus_type, &highbank_platform_nb);
bus_register_notifier(&amba_bustype, &highbank_amba_nb); bus_register_notifier(&amba_bustype, &highbank_amba_nb);
pl320_ipc_register_notifier(&hb_keys_nb);
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment