aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet/wacom_wac.c
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2014-07-24 15:51:03 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2014-07-25 21:53:48 -0400
commit3813810c7103f90eb2a0ec43fbd637265360c618 (patch)
treef72a7fa4f1edafb4a752108b79a2c892efb14150 /drivers/input/tablet/wacom_wac.c
parent422b0314b9f29a2c61d426fdaf1864556809ac1c (diff)
Input: wacom - split out the pad device for Graphire G4 and MO
MSC_SERIAL can be safely removed from pad devices. If it is not here, xf86-input-wacom correctly generates ones for its internal use. 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>
Diffstat (limited to 'drivers/input/tablet/wacom_wac.c')
-rw-r--r--drivers/input/tablet/wacom_wac.c44
1 files changed, 27 insertions, 17 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index d3aef3af1921..f170277b6f28 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -262,6 +262,7 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
262 struct wacom_features *features = &wacom->features; 262 struct wacom_features *features = &wacom->features;
263 unsigned char *data = wacom->data; 263 unsigned char *data = wacom->data;
264 struct input_dev *input = wacom->input; 264 struct input_dev *input = wacom->input;
265 struct input_dev *pad_input = wacom->pad_input;
265 int prox; 266 int prox;
266 int rw = 0; 267 int rw = 0;
267 int retval = 0; 268 int retval = 0;
@@ -322,7 +323,6 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
322 wacom->id[0] = 0; 323 wacom->id[0] = 0;
323 input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */ 324 input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */
324 input_report_key(input, wacom->tool[0], prox); 325 input_report_key(input, wacom->tool[0], prox);
325 input_event(input, EV_MSC, MSC_SERIAL, 1);
326 input_sync(input); /* sync last event */ 326 input_sync(input); /* sync last event */
327 } 327 }
328 328
@@ -332,14 +332,13 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
332 prox = data[7] & 0xf8; 332 prox = data[7] & 0xf8;
333 if (prox || wacom->id[1]) { 333 if (prox || wacom->id[1]) {
334 wacom->id[1] = PAD_DEVICE_ID; 334 wacom->id[1] = PAD_DEVICE_ID;
335 input_report_key(input, BTN_BACK, (data[7] & 0x40)); 335 input_report_key(pad_input, BTN_BACK, (data[7] & 0x40));
336 input_report_key(input, BTN_FORWARD, (data[7] & 0x80)); 336 input_report_key(pad_input, BTN_FORWARD, (data[7] & 0x80));
337 rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3); 337 rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3);
338 input_report_rel(input, REL_WHEEL, rw); 338 input_report_rel(pad_input, REL_WHEEL, rw);
339 if (!prox) 339 if (!prox)
340 wacom->id[1] = 0; 340 wacom->id[1] = 0;
341 input_report_abs(input, ABS_MISC, wacom->id[1]); 341 input_report_abs(pad_input, ABS_MISC, wacom->id[1]);
342 input_event(input, EV_MSC, MSC_SERIAL, 0xf0);
343 retval = 1; 342 retval = 1;
344 } 343 }
345 break; 344 break;
@@ -348,15 +347,14 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
348 prox = (data[7] & 0xf8) || data[8]; 347 prox = (data[7] & 0xf8) || data[8];
349 if (prox || wacom->id[1]) { 348 if (prox || wacom->id[1]) {
350 wacom->id[1] = PAD_DEVICE_ID; 349 wacom->id[1] = PAD_DEVICE_ID;
351 input_report_key(input, BTN_BACK, (data[7] & 0x08)); 350 input_report_key(pad_input, BTN_BACK, (data[7] & 0x08));
352 input_report_key(input, BTN_LEFT, (data[7] & 0x20)); 351 input_report_key(pad_input, BTN_LEFT, (data[7] & 0x20));
353 input_report_key(input, BTN_FORWARD, (data[7] & 0x10)); 352 input_report_key(pad_input, BTN_FORWARD, (data[7] & 0x10));
354 input_report_key(input, BTN_RIGHT, (data[7] & 0x40)); 353 input_report_key(pad_input, BTN_RIGHT, (data[7] & 0x40));
355 input_report_abs(input, ABS_WHEEL, (data[8] & 0x7f)); 354 input_report_abs(pad_input, ABS_WHEEL, (data[8] & 0x7f));
356 if (!prox) 355 if (!prox)
357 wacom->id[1] = 0; 356 wacom->id[1] = 0;
358 input_report_abs(input, ABS_MISC, wacom->id[1]); 357 input_report_abs(pad_input, ABS_MISC, wacom->id[1]);
359 input_event(input, EV_MSC, MSC_SERIAL, 0xf0);
360 retval = 1; 358 retval = 1;
361 } 359 }
362 break; 360 break;
@@ -1624,10 +1622,6 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
1624 /* fall through */ 1622 /* fall through */
1625 1623
1626 case WACOM_G4: 1624 case WACOM_G4:
1627 input_set_capability(input_dev, EV_MSC, MSC_SERIAL);
1628
1629 __set_bit(BTN_BACK, input_dev->keybit);
1630 __set_bit(BTN_FORWARD, input_dev->keybit);
1631 /* fall through */ 1625 /* fall through */
1632 1626
1633 case GRAPHIRE: 1627 case GRAPHIRE:
@@ -1854,6 +1848,22 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
1854 input_set_abs_params(input_dev, ABS_Y, 0, 1, 0, 0); 1848 input_set_abs_params(input_dev, ABS_Y, 0, 1, 0, 0);
1855 1849
1856 switch (features->type) { 1850 switch (features->type) {
1851 case WACOM_MO:
1852 __set_bit(BTN_BACK, input_dev->keybit);
1853 __set_bit(BTN_LEFT, input_dev->keybit);
1854 __set_bit(BTN_FORWARD, input_dev->keybit);
1855 __set_bit(BTN_RIGHT, input_dev->keybit);
1856 input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0);
1857 break;
1858
1859 case WACOM_G4:
1860 __set_bit(BTN_BACK, input_dev->keybit);
1861 __set_bit(BTN_LEFT, input_dev->keybit);
1862 __set_bit(BTN_FORWARD, input_dev->keybit);
1863 __set_bit(BTN_RIGHT, input_dev->keybit);
1864 input_set_capability(input_dev, EV_REL, REL_WHEEL);
1865 break;
1866
1857 case WACOM_24HD: 1867 case WACOM_24HD:
1858 __set_bit(BTN_A, input_dev->keybit); 1868 __set_bit(BTN_A, input_dev->keybit);
1859 __set_bit(BTN_B, input_dev->keybit); 1869 __set_bit(BTN_B, input_dev->keybit);