All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] input: wacom - Bring Bamboo in sync with other models
@ 2010-11-19  1:56 Ping Cheng
  0 siblings, 0 replies; only message in thread
From: Ping Cheng @ 2010-11-19  1:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: dmitry.torokhov, Ping Cheng, Ping Cheng

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-11-19  1:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-19  1:56 [PATCH] input: wacom - Bring Bamboo in sync with other models Ping Cheng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.