From: Ping Cheng <pingli...@gmail.com>

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.ch...@wacom.com>
Reviewed-by: Jason Gerecke <jason.gere...@wacom.com>
Signed-off-by: Jiri Kosina <jkos...@suse.cz>
[jason.gere...@wacom.com: Imported into input-wacom repository (e7deb15)]
Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
[aaron.sko...@wacom.com: Backported from input-wacom repository (da8bf11)]
Signed-off-by: Aaron Armstrong Skomra <aaron.sko...@wacom.com>
---
 3.17/wacom_wac.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/3.17/wacom_wac.c b/3.17/wacom_wac.c
index c51631a..acab3b3 100644
--- a/3.17/wacom_wac.c
+++ b/3.17/wacom_wac.c
@@ -2997,8 +2997,6 @@ void wacom_setup_device_quirks(struct wacom *wacom)
        struct wacom_features *features = &wacom->wacom_wac.features;
 
        /* The pen and pad share the same interface on most devices */
-       if (features->numbered_buttons > 0)
-               features->device_type |= WACOM_DEVICETYPE_PAD;
        if (features->type == GRAPHIRE_BT || features->type == WACOM_G4 ||
            features->type == DTUS ||
            (features->type >= INTUOS3S && features->type <= WACOM_MO)) {
@@ -3446,6 +3444,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;
 
-- 
2.7.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to