[PATCH] input: wacom - Bring Bamboo in sync with other models

From: Ping Cheng
Date: Thu Nov 18 2010 - 20:56:14 EST


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@xxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/