ARM: tegra: stingray: Log when hard reset buttons are pushed
authorColin Cross <ccross@android.com>
Fri, 7 Jan 2011 22:52:26 +0000 (14:52 -0800)
committerColin Cross <ccross@android.com>
Sat, 8 Jan 2011 01:24:33 +0000 (17:24 -0800)
Change-Id: Ie8b7cccbf616b2e72a01a88afafc06820f9a3efb
Signed-off-by: Colin Cross <ccross@android.com>
arch/arm/mach-tegra/board-stingray-keypad.c

index f1c0b1f9614059d6b193bb4747405fca47993d08..3fd5c9ea09659cd70ee19e3f970734f60d61d6fb 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <linux/platform_device.h>
 #include <linux/input.h>
+#include <linux/keyreset.h>
 #include <linux/gpio_event.h>
 #include <linux/gpio.h>
 #include <asm/mach-types.h>
@@ -82,10 +83,34 @@ static struct platform_device stingray_keypad_device = {
        },
 };
 
+int stingray_log_reset(void)
+{
+       pr_warn("Hard reset buttons pushed\n");
+       return 0;
+}
+
+static struct keyreset_platform_data stingray_reset_keys_pdata = {
+       .reset_fn = stingray_log_reset,
+       .keys_down = {
+               KEY_END,
+               KEY_VOLUMEUP,
+               0
+       },
+};
+
+struct platform_device stingray_keyreset_device = {
+       .name   = KEYRESET_NAME,
+       .dev    = {
+               .platform_data = &stingray_reset_keys_pdata,
+       },
+};
+
+
 int __init stingray_keypad_init(void)
 {
        tegra_gpio_enable(TEGRA_GPIO_PR0);
        tegra_gpio_enable(TEGRA_GPIO_PR1);
        tegra_gpio_enable(TEGRA_GPIO_PQ0);
+       platform_device_register(&stingray_keyreset_device);
        return platform_device_register(&stingray_keypad_device);
 }