diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-07 13:38:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-07 13:38:46 -0400 |
commit | 8b8a7df9a1d87ba413fce246b11f54c636bb456a (patch) | |
tree | 797265037b52117fa633b32cbe3feacb1b1b0f07 /drivers/tty | |
parent | b04c99e3b845892d754ee8052d6324c39c4040de (diff) | |
parent | 07176b988ebb20f46a317a60ee1d983fe1630203 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov:
"A new driver for slidebar on Ideapad laptops and a bunch of assorted
driver fixes"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (32 commits)
Input: add SYN_MAX and SYN_CNT constants
Input: max11801_ts - convert to devm
Input: egalax-ts - fix typo and improve text
Input: MAINTAINERS - change maintainer for cyttsp driver
Input: cyttsp4 - kill 'defined but not used' compiler warnings
Input: add driver for slidebar on Lenovo IdeaPad laptops
Input: omap-keypad - set up irq type from DT
Input: omap-keypad - enable wakeup capability for keypad.
Input: omap-keypad - clear interrupts on open
Input: omap-keypad - convert to threaded IRQ
Input: omap-keypad - use bitfiled instead of hardcoded values
Input: cyttsp4 - remove useless NULL test from cyttsp4_watchdog_timer()
Input: wacom - fix error return code in wacom_probe()
Input: as5011 - fix error return code in as5011_probe()
Input: keyboard, serio - simplify use of devm_ioremap_resource
Input: tegra-kbc - simplify use of devm_ioremap_resource
Input: htcpen - fix incorrect placement of __initdata
Input: qt1070 - add power management ops
Input: wistron_btns - add MODULE_DEVICE_TABLE
Input: wistron_btns - mark the Medion MD96500 keymap as tested
...
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/sysrq.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c index d5cc3acecfd3..40a9fe9d3b10 100644 --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c | |||
@@ -45,6 +45,7 @@ | |||
45 | #include <linux/moduleparam.h> | 45 | #include <linux/moduleparam.h> |
46 | #include <linux/jiffies.h> | 46 | #include <linux/jiffies.h> |
47 | #include <linux/syscalls.h> | 47 | #include <linux/syscalls.h> |
48 | #include <linux/of.h> | ||
48 | 49 | ||
49 | #include <asm/ptrace.h> | 50 | #include <asm/ptrace.h> |
50 | #include <asm/irq_regs.h> | 51 | #include <asm/irq_regs.h> |
@@ -681,6 +682,40 @@ static void sysrq_detect_reset_sequence(struct sysrq_state *state, | |||
681 | } | 682 | } |
682 | } | 683 | } |
683 | 684 | ||
685 | #ifdef CONFIG_OF | ||
686 | static void sysrq_of_get_keyreset_config(void) | ||
687 | { | ||
688 | u32 key; | ||
689 | struct device_node *np; | ||
690 | struct property *prop; | ||
691 | const __be32 *p; | ||
692 | |||
693 | np = of_find_node_by_path("/chosen/linux,sysrq-reset-seq"); | ||
694 | if (!np) { | ||
695 | pr_debug("No sysrq node found"); | ||
696 | return; | ||
697 | } | ||
698 | |||
699 | /* Reset in case a __weak definition was present */ | ||
700 | sysrq_reset_seq_len = 0; | ||
701 | |||
702 | of_property_for_each_u32(np, "keyset", prop, p, key) { | ||
703 | if (key == KEY_RESERVED || key > KEY_MAX || | ||
704 | sysrq_reset_seq_len == SYSRQ_KEY_RESET_MAX) | ||
705 | break; | ||
706 | |||
707 | sysrq_reset_seq[sysrq_reset_seq_len++] = (unsigned short)key; | ||
708 | } | ||
709 | |||
710 | /* Get reset timeout if any. */ | ||
711 | of_property_read_u32(np, "timeout-ms", &sysrq_reset_downtime_ms); | ||
712 | } | ||
713 | #else | ||
714 | static void sysrq_of_get_keyreset_config(void) | ||
715 | { | ||
716 | } | ||
717 | #endif | ||
718 | |||
684 | static void sysrq_reinject_alt_sysrq(struct work_struct *work) | 719 | static void sysrq_reinject_alt_sysrq(struct work_struct *work) |
685 | { | 720 | { |
686 | struct sysrq_state *sysrq = | 721 | struct sysrq_state *sysrq = |
@@ -914,6 +949,7 @@ static inline void sysrq_register_handler(void) | |||
914 | int error; | 949 | int error; |
915 | int i; | 950 | int i; |
916 | 951 | ||
952 | /* First check if a __weak interface was instantiated. */ | ||
917 | for (i = 0; i < ARRAY_SIZE(sysrq_reset_seq); i++) { | 953 | for (i = 0; i < ARRAY_SIZE(sysrq_reset_seq); i++) { |
918 | key = platform_sysrq_reset_seq[i]; | 954 | key = platform_sysrq_reset_seq[i]; |
919 | if (key == KEY_RESERVED || key > KEY_MAX) | 955 | if (key == KEY_RESERVED || key > KEY_MAX) |
@@ -922,6 +958,12 @@ static inline void sysrq_register_handler(void) | |||
922 | sysrq_reset_seq[sysrq_reset_seq_len++] = key; | 958 | sysrq_reset_seq[sysrq_reset_seq_len++] = key; |
923 | } | 959 | } |
924 | 960 | ||
961 | /* | ||
962 | * DT configuration takes precedence over anything that would | ||
963 | * have been defined via the __weak interface. | ||
964 | */ | ||
965 | sysrq_of_get_keyreset_config(); | ||
966 | |||
925 | error = input_register_handler(&sysrq_handler); | 967 | error = input_register_handler(&sysrq_handler); |
926 | if (error) | 968 | if (error) |
927 | pr_err("Failed to register input handler, error %d", error); | 969 | pr_err("Failed to register input handler, error %d", error); |