summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPing Cheng <pinglinux@gmail.com>2017-04-04 19:32:31 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-12 12:42:11 +0200
commit2dca786b85e236f84410c0421132e77b66aa9fd5 (patch)
tree54ea04de962a74ef4d811e59f001d278b275814d
parent6ac0617424d43e1c5cff654e73dbc333065b33f9 (diff)
downloadtalos-obmc-linux-2dca786b85e236f84410c0421132e77b66aa9fd5.tar.gz
talos-obmc-linux-2dca786b85e236f84410c0421132e77b66aa9fd5.zip
HID: wacom: don't apply generic settings to old devices
[ Upstream commit e7deb1570a527d3c74be4e21a72b1b459605c501 ] Non-generic devices have numbered_buttons set for both pen and touch interfaces by default. The actual number of buttons on the interface is normally manually decided later, which is different from what those HID generic devices are processed, where number of buttons are directly retrieved from HID descriptors. This patch adds the missed HID_GENERIC check and moves the statement to wacom_setup_pad_input_capabilities since it's not a quirk anymore. Signed-off-by: Ping Cheng <ping.cheng@wacom.com> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/hid/wacom_wac.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 672145b0d8f5..6ef4f2fcfe43 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -3290,6 +3290,9 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
{
struct wacom_features *features = &wacom_wac->features;
+ if ((features->type == HID_GENERIC) && features->numbered_buttons > 0)
+ features->device_type |= WACOM_DEVICETYPE_PAD;
+
if (!(features->device_type & WACOM_DEVICETYPE_PAD))
return -ENODEV;
OpenPOWER on IntegriCloud