public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ping Cheng <pinglinux@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: dmitry.torokhov@gmail.com, Ping Cheng <pinglinux@gmail.com>,
	Ping Cheng <pingc@wacom.com>
Subject: [PATCH] input: wacom - Bring Bamboo in sync with other models
Date: Thu, 18 Nov 2010 17:56:09 -0800	[thread overview]
Message-ID: <1290131769-18380-1-git-send-email-pinglinux@gmail.com> (raw)

Tablet buttons are considered as a separate tool in the user land.
All existing tablet models, wacom and hanwang, send PAD_DEVICE_ID
and MSC_SERIAL events. Add them to Bamboo so clients can process
them consistently accross models.

Signed-off-by: Ping Cheng <pingc@wacom.com>
---
 drivers/input/tablet/wacom_wac.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 360ce4a..e4da526 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -901,11 +901,15 @@ static int wacom_bpt_touch(struct wacom_wac *wacom)
 	input_report_abs(input, ABS_PRESSURE, sp);
 	input_report_abs(input, ABS_X, sx);
 	input_report_abs(input, ABS_Y, sy);
+	input_sync(input);
 
 	input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0);
 	input_report_key(input, BTN_FORWARD, (data[1] & 0x04) != 0);
 	input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0);
 	input_report_key(input, BTN_RIGHT, (data[1] & 0x01) != 0);
+	input_report_key(input, BTN_TOOL_BUTTONS, 0xf0);
+	input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
+	input_event(input, EV_MSC, MSC_SERIAL, 0xf0);
 
 	input_sync(input);
 
@@ -1261,9 +1265,8 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
 		break;
 
 	case BAMBOO_PT:
-		__clear_bit(ABS_MISC, input_dev->absbit);
-
 		if (features->device_type == BTN_TOOL_TRIPLETAP) {
+			__set_bit(BTN_TOOL_BUTTONS, input_dev->keybit);
 			__set_bit(BTN_LEFT, input_dev->keybit);
 			__set_bit(BTN_FORWARD, input_dev->keybit);
 			__set_bit(BTN_BACK, input_dev->keybit);
@@ -1284,7 +1287,9 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
 					     features->pressure_fuzz, 0);
 			input_set_abs_params(input_dev, ABS_MT_TRACKING_ID, 0,
 					     MAX_TRACKING_ID, 0, 0);
-		} else if (features->device_type == BTN_TOOL_PEN) {
+		} 
+
+		if (features->device_type == BTN_TOOL_PEN) {
 			__set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
 			__set_bit(BTN_TOOL_PEN, input_dev->keybit);
 			__set_bit(BTN_STYLUS, input_dev->keybit);
-- 
1.7.2.3


                 reply	other threads:[~2010-11-19  1:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1290131769-18380-1-git-send-email-pinglinux@gmail.com \
    --to=pinglinux@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-kernel@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