diff options
-rw-r--r-- | drivers/input/tablet/aiptek.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c index 0c990e61ed73..3a5e0aafa115 100644 --- a/drivers/input/tablet/aiptek.c +++ b/drivers/input/tablet/aiptek.c | |||
@@ -377,26 +377,6 @@ static const char *map_val_to_str(const struct aiptek_map *map, int val) | |||
377 | } | 377 | } |
378 | 378 | ||
379 | /*********************************************************************** | 379 | /*********************************************************************** |
380 | * Relative reports deliver values in 2's complement format to | ||
381 | * deal with negative offsets. | ||
382 | */ | ||
383 | static int aiptek_convert_from_2s_complement(unsigned char c) | ||
384 | { | ||
385 | int ret; | ||
386 | unsigned char b = c; | ||
387 | int negate = 0; | ||
388 | |||
389 | if ((b & 0x80) != 0) { | ||
390 | b = ~b; | ||
391 | b--; | ||
392 | negate = 1; | ||
393 | } | ||
394 | ret = b; | ||
395 | ret = (negate == 1) ? -ret : ret; | ||
396 | return ret; | ||
397 | } | ||
398 | |||
399 | /*********************************************************************** | ||
400 | * aiptek_irq can receive one of six potential reports. | 380 | * aiptek_irq can receive one of six potential reports. |
401 | * The documentation for each is in the body of the function. | 381 | * The documentation for each is in the body of the function. |
402 | * | 382 | * |
@@ -473,8 +453,8 @@ static void aiptek_irq(struct urb *urb) | |||
473 | aiptek->diagnostic = | 453 | aiptek->diagnostic = |
474 | AIPTEK_DIAGNOSTIC_SENDING_RELATIVE_IN_ABSOLUTE; | 454 | AIPTEK_DIAGNOSTIC_SENDING_RELATIVE_IN_ABSOLUTE; |
475 | } else { | 455 | } else { |
476 | x = aiptek_convert_from_2s_complement(data[2]); | 456 | x = (signed char) data[2]; |
477 | y = aiptek_convert_from_2s_complement(data[3]); | 457 | y = (signed char) data[3]; |
478 | 458 | ||
479 | /* jitterable keeps track of whether any button has been pressed. | 459 | /* jitterable keeps track of whether any button has been pressed. |
480 | * We're also using it to remap the physical mouse button mask | 460 | * We're also using it to remap the physical mouse button mask |