summaryrefslogtreecommitdiff
path: root/drivers/input/keyboard
diff options
context:
space:
mode:
authorRajat Jain <rajatja@google.com>2017-04-03 21:53:41 +0300
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2017-04-03 21:59:57 +0300
commite6eba3fac9a0eb2018a85505b91740e27c60fdba (patch)
treee765d4afcbf56564654c2af9562c6159d88cec47 /drivers/input/keyboard
parentf6f08c55cced6885f1e1448cd0806098e836c5f5 (diff)
downloadlinux-e6eba3fac9a0eb2018a85505b91740e27c60fdba.tar.xz
Input: cros_ec_keyb - add an EC event for sysrq
Some form factors (detachables/tablets) may not have a keyboard and thus user may have to resort to using a defined EC UI to send sysrq(s) to the kernel in order to collect crash info etc. This UI typically is in the form of user pressing volume / power buttons in some specific sequence and for some specific time. Add a new EC event that allows EC to communicate the sysrq to the AP. (We're skipping event number 5 because it has been reserved for something else) Signed-off-by: Rajat Jain <rajatja@google.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r--drivers/input/keyboard/cros_ec_keyb.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
index 6a250d65f8fe..c7a8120b13c0 100644
--- a/drivers/input/keyboard/cros_ec_keyb.c
+++ b/drivers/input/keyboard/cros_ec_keyb.c
@@ -30,6 +30,7 @@
#include <linux/notifier.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
+#include <linux/sysrq.h>
#include <linux/input/matrix_keypad.h>
#include <linux/mfd/cros_ec.h>
#include <linux/mfd/cros_ec_commands.h>
@@ -260,6 +261,12 @@ static int cros_ec_keyb_work(struct notifier_block *nb,
ckdev->ec->event_size);
break;
+ case EC_MKBP_EVENT_SYSRQ:
+ val = get_unaligned_le32(&ckdev->ec->event_data.data.sysrq);
+ dev_dbg(ckdev->dev, "sysrq code from EC: %#x\n", val);
+ handle_sysrq(val);
+ break;
+
case EC_MKBP_EVENT_BUTTON:
case EC_MKBP_EVENT_SWITCH:
/*