diff options
author | Ping Cheng <pingc@wacom.com> | 2009-12-15 03:35:25 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-12-15 03:36:20 -0500 |
commit | 0f5e182dff576e6f3cd9b805834f18d11f2882aa (patch) | |
tree | b4a278799bfa6b61a4d2d3c3ea43f22e2b788341 /drivers/input | |
parent | cad7470084686d876ebfecf55a9ce039075f9134 (diff) |
Input: wacom - separate pen from express keys on Graphire
Since Graphire/Bamboo devices report pen and expresskeys in the same
data packet, we need to send a input_sync event to separate pen data
from expresskeys for X11 driver to process them properly.
Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/tablet/wacom_wac.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index e4e8c3636940..1056f149fe31 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
@@ -154,6 +154,7 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo) | |||
154 | { | 154 | { |
155 | unsigned char *data = wacom->data; | 155 | unsigned char *data = wacom->data; |
156 | int x, y, rw; | 156 | int x, y, rw; |
157 | static int penData = 0; | ||
157 | 158 | ||
158 | if (data[0] != WACOM_REPORT_PENABLED) { | 159 | if (data[0] != WACOM_REPORT_PENABLED) { |
159 | dbg("wacom_graphire_irq: received unknown report #%d", data[0]); | 160 | dbg("wacom_graphire_irq: received unknown report #%d", data[0]); |
@@ -162,6 +163,7 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo) | |||
162 | 163 | ||
163 | if (data[1] & 0x80) { | 164 | if (data[1] & 0x80) { |
164 | /* in prox and not a pad data */ | 165 | /* in prox and not a pad data */ |
166 | penData = 1; | ||
165 | 167 | ||
166 | switch ((data[1] >> 5) & 3) { | 168 | switch ((data[1] >> 5) & 3) { |
167 | 169 | ||
@@ -231,7 +233,11 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo) | |||
231 | switch (wacom->features->type) { | 233 | switch (wacom->features->type) { |
232 | case WACOM_G4: | 234 | case WACOM_G4: |
233 | if (data[7] & 0xf8) { | 235 | if (data[7] & 0xf8) { |
234 | wacom_input_sync(wcombo); /* sync last event */ | 236 | if (penData) { |
237 | wacom_input_sync(wcombo); /* sync last event */ | ||
238 | if (!wacom->id[0]) | ||
239 | penData = 0; | ||
240 | } | ||
235 | wacom->id[1] = PAD_DEVICE_ID; | 241 | wacom->id[1] = PAD_DEVICE_ID; |
236 | wacom_report_key(wcombo, BTN_0, (data[7] & 0x40)); | 242 | wacom_report_key(wcombo, BTN_0, (data[7] & 0x40)); |
237 | wacom_report_key(wcombo, BTN_4, (data[7] & 0x80)); | 243 | wacom_report_key(wcombo, BTN_4, (data[7] & 0x80)); |
@@ -241,10 +247,15 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo) | |||
241 | wacom_report_abs(wcombo, ABS_MISC, wacom->id[1]); | 247 | wacom_report_abs(wcombo, ABS_MISC, wacom->id[1]); |
242 | wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0); | 248 | wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0); |
243 | } else if (wacom->id[1]) { | 249 | } else if (wacom->id[1]) { |
244 | wacom_input_sync(wcombo); /* sync last event */ | 250 | if (penData) { |
251 | wacom_input_sync(wcombo); /* sync last event */ | ||
252 | if (!wacom->id[0]) | ||
253 | penData = 0; | ||
254 | } | ||
245 | wacom->id[1] = 0; | 255 | wacom->id[1] = 0; |
246 | wacom_report_key(wcombo, BTN_0, (data[7] & 0x40)); | 256 | wacom_report_key(wcombo, BTN_0, (data[7] & 0x40)); |
247 | wacom_report_key(wcombo, BTN_4, (data[7] & 0x80)); | 257 | wacom_report_key(wcombo, BTN_4, (data[7] & 0x80)); |
258 | wacom_report_rel(wcombo, REL_WHEEL, 0); | ||
248 | wacom_report_key(wcombo, BTN_TOOL_FINGER, 0); | 259 | wacom_report_key(wcombo, BTN_TOOL_FINGER, 0); |
249 | wacom_report_abs(wcombo, ABS_MISC, 0); | 260 | wacom_report_abs(wcombo, ABS_MISC, 0); |
250 | wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0); | 261 | wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0); |
@@ -252,7 +263,11 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo) | |||
252 | break; | 263 | break; |
253 | case WACOM_MO: | 264 | case WACOM_MO: |
254 | if ((data[7] & 0xf8) || (data[8] & 0xff)) { | 265 | if ((data[7] & 0xf8) || (data[8] & 0xff)) { |
255 | wacom_input_sync(wcombo); /* sync last event */ | 266 | if (penData) { |
267 | wacom_input_sync(wcombo); /* sync last event */ | ||
268 | if (!wacom->id[0]) | ||
269 | penData = 0; | ||
270 | } | ||
256 | wacom->id[1] = PAD_DEVICE_ID; | 271 | wacom->id[1] = PAD_DEVICE_ID; |
257 | wacom_report_key(wcombo, BTN_0, (data[7] & 0x08)); | 272 | wacom_report_key(wcombo, BTN_0, (data[7] & 0x08)); |
258 | wacom_report_key(wcombo, BTN_1, (data[7] & 0x20)); | 273 | wacom_report_key(wcombo, BTN_1, (data[7] & 0x20)); |
@@ -263,7 +278,11 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo) | |||
263 | wacom_report_abs(wcombo, ABS_MISC, wacom->id[1]); | 278 | wacom_report_abs(wcombo, ABS_MISC, wacom->id[1]); |
264 | wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0); | 279 | wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0); |
265 | } else if (wacom->id[1]) { | 280 | } else if (wacom->id[1]) { |
266 | wacom_input_sync(wcombo); /* sync last event */ | 281 | if (penData) { |
282 | wacom_input_sync(wcombo); /* sync last event */ | ||
283 | if (!wacom->id[0]) | ||
284 | penData = 0; | ||
285 | } | ||
267 | wacom->id[1] = 0; | 286 | wacom->id[1] = 0; |
268 | wacom_report_key(wcombo, BTN_0, (data[7] & 0x08)); | 287 | wacom_report_key(wcombo, BTN_0, (data[7] & 0x08)); |
269 | wacom_report_key(wcombo, BTN_1, (data[7] & 0x20)); | 288 | wacom_report_key(wcombo, BTN_1, (data[7] & 0x20)); |