aboutsummaryrefslogtreecommitdiff
path: root/drivers/hid/hid-input.c
diff options
context:
space:
mode:
authorAnders Roxell <anders.roxell@linaro.org>2015-03-20 21:03:53 +0100
committerAnders Roxell <anders.roxell@linaro.org>2015-03-20 21:03:53 +0100
commite20e8b472345ea5babd805db6726d1a7000f7673 (patch)
tree1aaff25991578806a867ba3efcb0f7fd59940388 /drivers/hid/hid-input.c
parent588956edf5bb33741de41687677f21f5c37671da (diff)
parentc59ecb2edfc11b725a0fa4cb5420c4dbae482c17 (diff)
Merge tag 'v3.14.36-rt31-lno1' into linux-linaro-lsk-v3.14-rt
Linux 3.14.36-rt31 Signed-off-by: Anders Roxell <anders.roxell@linaro.org> Conflicts: arch/arm64/kernel/setup.c arch/x86/kernel/traps.c
Diffstat (limited to 'drivers/hid/hid-input.c')
-rw-r--r--drivers/hid/hid-input.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 4b87bb164f30..a413f76e84d4 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1066,6 +1066,23 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
return;
}
+ /*
+ * Ignore reports for absolute data if the data didn't change. This is
+ * not only an optimization but also fixes 'dead' key reports. Some
+ * RollOver implementations for localized keys (like BACKSLASH/PIPE; HID
+ * 0x31 and 0x32) report multiple keys, even though a localized keyboard
+ * can only have one of them physically available. The 'dead' keys
+ * report constant 0. As all map to the same keycode, they'd confuse
+ * the input layer. If we filter the 'dead' keys on the HID level, we
+ * skip the keycode translation and only forward real events.
+ */
+ if (!(field->flags & (HID_MAIN_ITEM_RELATIVE |
+ HID_MAIN_ITEM_BUFFERED_BYTE)) &&
+ (field->flags & HID_MAIN_ITEM_VARIABLE) &&
+ usage->usage_index < field->maxusage &&
+ value == field->value[usage->usage_index])
+ return;
+
/* report the usage code as scancode if the key status has changed */
if (usage->type == EV_KEY && !!test_bit(usage->code, input->key) != value)
input_event(input, EV_MSC, MSC_SCAN, usage->hid);