summaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2017-11-22 11:19:51 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-22 09:37:16 +0100
commit0c53c557f4de212696d5e94ce096ec34df437a22 (patch)
tree341feabbdce3b983cbbf2ca0e4698f04e0f1f7eb /drivers/hid
parent53165057044801541802f899ee3d415e8252b699 (diff)
downloadlinux-stable-0c53c557f4de212696d5e94ce096ec34df437a22.tar.gz
linux-stable-0c53c557f4de212696d5e94ce096ec34df437a22.tar.bz2
linux-stable-0c53c557f4de212696d5e94ce096ec34df437a22.zip
HID: elo: clear BTN_LEFT mapping
[ Upstream commit 9abd04af951e5734c9d5cfee9b49790844b734cf ] ELO devices have one Button usage in GenDesk field, which makes hid-input map it to BTN_LEFT; that confuses userspace, which then considers the device to be a mouse/touchpad instead of touchscreen. Fix that by unmapping BTN_LEFT and keeping only BTN_TOUCH in place. Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-elo.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/hid/hid-elo.c b/drivers/hid/hid-elo.c
index d0c8a1c1e1fe..2fc43ad7f0b6 100644
--- a/drivers/hid/hid-elo.c
+++ b/drivers/hid/hid-elo.c
@@ -42,6 +42,12 @@ static void elo_input_configured(struct hid_device *hdev,
{
struct input_dev *input = hidinput->input;
+ /*
+ * ELO devices have one Button usage in GenDesk field, which makes
+ * hid-input map it to BTN_LEFT; that confuses userspace, which then
+ * considers the device to be a mouse/touchpad instead of touchscreen.
+ */
+ clear_bit(BTN_LEFT, input->keybit);
set_bit(BTN_TOUCH, input->keybit);
set_bit(ABS_PRESSURE, input->absbit);
input_set_abs_params(input, ABS_PRESSURE, 0, 256, 0, 0);