aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2012-07-30 01:34:47 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-07-30 01:34:47 -0400
commitcf45b5a2525d9e7473db955750a8db9d4160b6ab (patch)
treefa0d5db50adfbf4906313567c9f8f72984fadb0e /drivers/input/mouse
parent314820c9e892d8f41ba4db300ec96770d9c8294b (diff)
parentc0394506e69b37c47d391c2a7bbea3ea236d8ec8 (diff)
Merge branch 'next' into for-linus
Prepare second set of changes for 3.6 merge window.
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r--drivers/input/mouse/synaptics.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index d5b390f75c9..14eaecea2b7 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -40,11 +40,27 @@
40 * Note that newer firmware allows querying device for maximum useable 40 * Note that newer firmware allows querying device for maximum useable
41 * coordinates. 41 * coordinates.
42 */ 42 */
43#define XMIN 0
44#define XMAX 6143
45#define YMIN 0
46#define YMAX 6143
43#define XMIN_NOMINAL 1472 47#define XMIN_NOMINAL 1472
44#define XMAX_NOMINAL 5472 48#define XMAX_NOMINAL 5472
45#define YMIN_NOMINAL 1408 49#define YMIN_NOMINAL 1408
46#define YMAX_NOMINAL 4448 50#define YMAX_NOMINAL 4448
47 51
52/* Size in bits of absolute position values reported by the hardware */
53#define ABS_POS_BITS 13
54
55/*
56 * Any position values from the hardware above the following limits are
57 * treated as "wrapped around negative" values that have been truncated to
58 * the 13-bit reporting range of the hardware. These are just reasonable
59 * guesses and can be adjusted if hardware is found that operates outside
60 * of these parameters.
61 */
62#define X_MAX_POSITIVE (((1 << ABS_POS_BITS) + XMAX) / 2)
63#define Y_MAX_POSITIVE (((1 << ABS_POS_BITS) + YMAX) / 2)
48 64
49/***************************************************************************** 65/*****************************************************************************
50 * Stuff we need even when we do not want native Synaptics support 66 * Stuff we need even when we do not want native Synaptics support
@@ -588,6 +604,12 @@ static int synaptics_parse_hw_state(const unsigned char buf[],
588 hw->right = (buf[0] & 0x02) ? 1 : 0; 604 hw->right = (buf[0] & 0x02) ? 1 : 0;
589 } 605 }
590 606
607 /* Convert wrap-around values to negative */
608 if (hw->x > X_MAX_POSITIVE)
609 hw->x -= 1 << ABS_POS_BITS;
610 if (hw->y > Y_MAX_POSITIVE)
611 hw->y -= 1 << ABS_POS_BITS;
612
591 return 0; 613 return 0;
592} 614}
593 615