diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2014-07-24 15:50:10 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-07-25 21:53:47 -0400 |
commit | 3116871f427386933a1fcd87e831ea664cbd0bf2 (patch) | |
tree | b19e2519a6df08a8c6d0956bf3084547e7d9c718 | |
parent | 10059cdc0ad0be9dc8f7df2fbf2e21b406a94539 (diff) |
Input: wacom - split out the pad device for Bamboos
We rely on the return code of wacom_bpt*() to do the input_sync().
wacom_wac_irq() then properly sync the input devices.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Ping Cheng <pingc@wacom.com>
Reviewed-by: Jason Gerecke <killertofu@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r-- | drivers/input/tablet/wacom_wac.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 8807ab511974..5aaa3d2e9afc 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
@@ -1143,6 +1143,7 @@ static int wacom_bpt_touch(struct wacom_wac *wacom) | |||
1143 | { | 1143 | { |
1144 | struct wacom_features *features = &wacom->features; | 1144 | struct wacom_features *features = &wacom->features; |
1145 | struct input_dev *input = wacom->input; | 1145 | struct input_dev *input = wacom->input; |
1146 | struct input_dev *pad_input = wacom->pad_input; | ||
1146 | unsigned char *data = wacom->data; | 1147 | unsigned char *data = wacom->data; |
1147 | int i; | 1148 | int i; |
1148 | 1149 | ||
@@ -1177,14 +1178,12 @@ static int wacom_bpt_touch(struct wacom_wac *wacom) | |||
1177 | 1178 | ||
1178 | input_mt_report_pointer_emulation(input, true); | 1179 | input_mt_report_pointer_emulation(input, true); |
1179 | 1180 | ||
1180 | input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0); | 1181 | input_report_key(pad_input, BTN_LEFT, (data[1] & 0x08) != 0); |
1181 | input_report_key(input, BTN_FORWARD, (data[1] & 0x04) != 0); | 1182 | input_report_key(pad_input, BTN_FORWARD, (data[1] & 0x04) != 0); |
1182 | input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0); | 1183 | input_report_key(pad_input, BTN_BACK, (data[1] & 0x02) != 0); |
1183 | input_report_key(input, BTN_RIGHT, (data[1] & 0x01) != 0); | 1184 | input_report_key(pad_input, BTN_RIGHT, (data[1] & 0x01) != 0); |
1184 | |||
1185 | input_sync(input); | ||
1186 | 1185 | ||
1187 | return 0; | 1186 | return 1; |
1188 | } | 1187 | } |
1189 | 1188 | ||
1190 | static void wacom_bpt3_touch_msg(struct wacom_wac *wacom, unsigned char *data) | 1189 | static void wacom_bpt3_touch_msg(struct wacom_wac *wacom, unsigned char *data) |
@@ -1232,7 +1231,7 @@ static void wacom_bpt3_touch_msg(struct wacom_wac *wacom, unsigned char *data) | |||
1232 | 1231 | ||
1233 | static void wacom_bpt3_button_msg(struct wacom_wac *wacom, unsigned char *data) | 1232 | static void wacom_bpt3_button_msg(struct wacom_wac *wacom, unsigned char *data) |
1234 | { | 1233 | { |
1235 | struct input_dev *input = wacom->input; | 1234 | struct input_dev *input = wacom->pad_input; |
1236 | struct wacom_features *features = &wacom->features; | 1235 | struct wacom_features *features = &wacom->features; |
1237 | 1236 | ||
1238 | if (features->type == INTUOSHT) { | 1237 | if (features->type == INTUOSHT) { |
@@ -1269,9 +1268,7 @@ static int wacom_bpt3_touch(struct wacom_wac *wacom) | |||
1269 | } | 1268 | } |
1270 | input_mt_report_pointer_emulation(input, true); | 1269 | input_mt_report_pointer_emulation(input, true); |
1271 | 1270 | ||
1272 | input_sync(input); | 1271 | return 1; |
1273 | |||
1274 | return 0; | ||
1275 | } | 1272 | } |
1276 | 1273 | ||
1277 | static int wacom_bpt_pen(struct wacom_wac *wacom) | 1274 | static int wacom_bpt_pen(struct wacom_wac *wacom) |
@@ -1806,11 +1803,6 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
1806 | 1803 | ||
1807 | if (features->device_type == BTN_TOOL_FINGER) { | 1804 | if (features->device_type == BTN_TOOL_FINGER) { |
1808 | 1805 | ||
1809 | __set_bit(BTN_LEFT, input_dev->keybit); | ||
1810 | __set_bit(BTN_FORWARD, input_dev->keybit); | ||
1811 | __set_bit(BTN_BACK, input_dev->keybit); | ||
1812 | __set_bit(BTN_RIGHT, input_dev->keybit); | ||
1813 | |||
1814 | if (features->touch_max) { | 1806 | if (features->touch_max) { |
1815 | /* touch interface */ | 1807 | /* touch interface */ |
1816 | unsigned int flags = INPUT_MT_POINTER; | 1808 | unsigned int flags = INPUT_MT_POINTER; |
@@ -1993,6 +1985,21 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev, | |||
1993 | 1985 | ||
1994 | break; | 1986 | break; |
1995 | 1987 | ||
1988 | case INTUOSHT: | ||
1989 | case BAMBOO_PT: | ||
1990 | /* pad device is on the touch interface */ | ||
1991 | if (features->device_type != BTN_TOOL_FINGER) | ||
1992 | return 1; | ||
1993 | |||
1994 | __clear_bit(ABS_MISC, input_dev->absbit); | ||
1995 | |||
1996 | __set_bit(BTN_LEFT, input_dev->keybit); | ||
1997 | __set_bit(BTN_FORWARD, input_dev->keybit); | ||
1998 | __set_bit(BTN_BACK, input_dev->keybit); | ||
1999 | __set_bit(BTN_RIGHT, input_dev->keybit); | ||
2000 | |||
2001 | break; | ||
2002 | |||
1996 | default: | 2003 | default: |
1997 | /* no pad supported */ | 2004 | /* no pad supported */ |
1998 | return 1; | 2005 | return 1; |