input: cros_ec_keyb: Add an EC event for sysrq
Subsystems (4)
PATCH 1/1 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)
--- drivers/input/keyboard/cros_ec_keyb.c | 7 +++++++ include/linux/mfd/cros_ec_commands.h | 4 ++++ 2 files changed, 11 insertions(+)
drivers/input/keyboard/cros_ec_keyb.c +7 -0
@@ -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 :/*
include/linux/mfd/cros_ec_commands.h +4 -0
@@ -2041,6 +2041,9 @@ enum ec_mkbp_event {/* The state of the switches have changed. */ EC_MKBP_EVENT_SWITCH =4 , +/* EC sent a sysrq command */ +EC_MKBP_EVENT_SYSRQ =6 , +/* Number of MKBP events */ EC_MKBP_EVENT_COUNT, };
@@ -2053,6 +2056,7 @@ union ec_response_get_next_data {uint32_t buttons;uint32_t switches; +uint32_t sysrq; } __packed;struct ec_response_get_next_event {
Signature · 1 line
2.12.2.564.g063fe858b8-goog
Dmitry Torokhov
maintainerQuoted 11 lines · Rajat Jain
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 <[email protected]>
Lee, is it OK to route through my tree or you want to take it?
Quoted 55 lines
--- drivers/input/keyboard/cros_ec_keyb.c | 7 +++++++ include/linux/mfd/cros_ec_commands.h | 4 ++++ 2 files changed, 11 insertions(+)drivers/input/keyboard/cros_ec_keyb.c +7
-0@@ -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 :/* include/linux/mfd/cros_ec_commands.h +4
-0@@ -2041,6 +2041,9 @@ enum ec_mkbp_event {/* The state of the switches have changed. */ EC_MKBP_EVENT_SWITCH =4 , +/* EC sent a sysrq command */ +EC_MKBP_EVENT_SYSRQ =6 , +/* Number of MKBP events */ EC_MKBP_EVENT_COUNT, };@@ -2053,6 +2056,7 @@ union ec_response_get_next_data {uint32_t buttons;uint32_t switches; +uint32_t sysrq; } __packed;struct ec_response_get_next_event {Signature · 1 line
2.12.2.564.g063fe858b8-goog
Signature · 1 line
Dmitry
Lee Jones
Acked-byQuoted 8 lines · Dmitry Torokhov
Quoted 7 lines · Rajat Jain
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.
Quoted 6 lines
Quoted 4 lines
(We're skipping event number 5 because it has been reserved for something else)
Signed-off-by Rajat Jain <[email protected]>Lee, is it OK to route through my tree or you want to take it?
Looks trivial enough:
Quoted 53 lines
Quoted 52 lines
--- drivers/input/keyboard/cros_ec_keyb.c | 7 +++++++ include/linux/mfd/cros_ec_commands.h | 4 ++++ 2 files changed, 11 insertions(+)drivers/input/keyboard/cros_ec_keyb.c +7
-0@@ -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 :/* include/linux/mfd/cros_ec_commands.h +4
-0@@ -2041,6 +2041,9 @@ enum ec_mkbp_event {/* The state of the switches have changed. */ EC_MKBP_EVENT_SWITCH =4 , +/* EC sent a sysrq command */ +EC_MKBP_EVENT_SYSRQ =6 , +/* Number of MKBP events */ EC_MKBP_EVENT_COUNT, };@@ -2053,6 +2056,7 @@ union ec_response_get_next_data {uint32_t buttons;uint32_t switches; +uint32_t sysrq; } __packed;struct ec_response_get_next_event {
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Quoted 13 lines · Lee Jones
Quoted 11 lines · Dmitry Torokhov
Quoted 10 lines · Rajat Jain
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)
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Rajat Jain <[email protected]>Lee, is it OK to route through my tree or you want to take it?
Looks trivial enough:
Acked-by Lee Jones <[email protected]>
Applied, thank you.
Quoted 60 lines
Quoted 54 lines
Quoted 53 lines
--- drivers/input/keyboard/cros_ec_keyb.c | 7 +++++++ include/linux/mfd/cros_ec_commands.h | 4 ++++ 2 files changed, 11 insertions(+)drivers/input/keyboard/cros_ec_keyb.c +7
-0@@ -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 :/* include/linux/mfd/cros_ec_commands.h +4
-0@@ -2041,6 +2041,9 @@ enum ec_mkbp_event {/* The state of the switches have changed. */ EC_MKBP_EVENT_SWITCH =4 , +/* EC sent a sysrq command */ +EC_MKBP_EVENT_SYSRQ =6 , +/* Number of MKBP events */ EC_MKBP_EVENT_COUNT, };@@ -2053,6 +2056,7 @@ union ec_response_get_next_data {uint32_t buttons;uint32_t switches; +uint32_t sysrq; } __packed;struct ec_response_get_next_event {Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Signature · 1 line
Dmitry