From: Ping Cheng <pinglinux@gmail.com>
To: jkosina@suse.cz
Cc: linux-input@vger.kernel.org, Ping Cheng <pingc@wacom.com>
Subject: [PATCH] HID: wacom - Bamboo pen only tablet does not support PAD
Date: Mon, 17 Nov 2014 13:45:55 -0800 [thread overview]
Message-ID: <1416260755-13635-1-git-send-email-pingc@wacom.com> (raw)
Bamboo models do not support HID_DG_CONTACTMAX. We should not rely
on that description to decide touch_max for them. Plus, no Bamboo
device supports single touch.
Signed-off-by: Ping Cheng <pingc@wacom.com>
---
drivers/hid/wacom_sys.c | 4 ++--
drivers/hid/wacom_wac.c | 30 ++++++++++++++++++++++--------
2 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 8593047..46147b4 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -192,8 +192,8 @@ static void wacom_usage_mapping(struct hid_device *hdev,
if (!pen && !finger)
return;
- if (finger && !features->touch_max)
- /* touch device at least supports one touch point */
+ if (finger && !features->touch_max && (features->type != BAMBOO_PT))
+ /* ISDv4 touch devices at least supports one touch point */
features->touch_max = 1;
switch (usage->hid) {
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 586b240..fc9b492 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -2402,7 +2402,7 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
case INTUOSPS:
/* touch interface does not have the pad device */
if (features->device_type != BTN_TOOL_PEN)
- return 1;
+ goto no_pad;
for (i = 0; i < 7; i++)
__set_bit(BTN_0 + i, input_dev->keybit);
@@ -2447,22 +2447,36 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
case BAMBOO_PT:
/* pad device is on the touch interface */
if (features->device_type != BTN_TOOL_FINGER)
- return 1;
+ goto no_pad;
__clear_bit(ABS_MISC, input_dev->absbit);
- __set_bit(BTN_LEFT, input_dev->keybit);
- __set_bit(BTN_FORWARD, input_dev->keybit);
- __set_bit(BTN_BACK, input_dev->keybit);
- __set_bit(BTN_RIGHT, input_dev->keybit);
+ /* Bamboo Pen only tablet does not have pad */
+ if ((features->type != BAMBOO_PT) ||
+ ((features->type == BAMBOO_PT) && features->touch_max)) {
+ __set_bit(BTN_LEFT, input_dev->keybit);
+ __set_bit(BTN_FORWARD, input_dev->keybit);
+ __set_bit(BTN_BACK, input_dev->keybit);
+ __set_bit(BTN_RIGHT, input_dev->keybit);
+ } else
+ goto no_pad;
break;
default:
- /* no pad supported */
- return 1;
+ goto no_pad;
}
return 0;
+
+no_pad:
+ input_dev->evbit[0] &= ~BIT_MASK(EV_KEY) & ~BIT_MASK(EV_ABS);
+ __clear_bit(ABS_MISC, input_dev->absbit);
+ __clear_bit(ABS_X, input_dev->absbit);
+ __clear_bit(ABS_Y, input_dev->absbit);
+ __clear_bit(BTN_STYLUS, input_dev->keybit);
+
+ return 1;
+
}
static const struct wacom_features wacom_features_0x00 =
--
1.9.1
next reply other threads:[~2014-11-17 21:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-17 21:45 Ping Cheng [this message]
2014-11-17 22:38 ` [PATCH] HID: wacom - Bamboo pen only tablet does not support PAD Benjamin Tissoires
2014-11-18 0:13 ` Ping Cheng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1416260755-13635-1-git-send-email-pingc@wacom.com \
--to=pinglinux@gmail.com \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=pingc@wacom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox