aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 20:16:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 20:16:10 -0400
commitfc47912d9cda50ae6bd9ca30e97e8c03de5b7b60 (patch)
treed7da6ce3b23c1524e681ee33aa6e21d3c0586108 /drivers/input/mouse
parent06fe918e9f177dc2a0592b0ad40a6ce4920b2033 (diff)
parentdde3ada3d0069855eeb353707b2b0f946191cfd6 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov: "A few drivers were updated with device tree bindings and others got a few small cleanups and fixes." Fix trivial conflict in drivers/input/keyboard/omap-keypad.c due to changes clashing with a whitespace cleanup. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (28 commits) Input: wacom - mark Intuos5 pad as in-prox when touching buttons Input: synaptics - adjust threshold for treating position values as negative Input: hgpk - use %*ph to dump small buffer Input: gpio_keys_polled - fix dt pdata->nbuttons Input: Add KD[GS]KBDIACRUC ioctls to the compatible list Input: omap-keypad - fixed formatting Input: tegra - move platform data header Input: wacom - add support for EMR on Cintiq 24HD touch Input: s3c2410_ts - make s3c_ts_pmops const Input: samsung-keypad - use of_get_child_count() helper Input: samsung-keypad - use of_match_ptr() Input: uinput - fix formatting Input: uinput - specify exact bit sizes on userspace APIs Input: uinput - mark failed submission requests as free Input: uinput - fix race that can block nonblocking read Input: uinput - return -EINVAL when read buffer size is too small Input: uinput - take event lock when fetching events from buffer Input: get rid of MATCH_BIT() macro Input: rotary-encoder - add DT bindings Input: rotary-encoder - constify platform data pointers ...
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r--drivers/input/mouse/hgpk.c9
-rw-r--r--drivers/input/mouse/synaptics.c31
2 files changed, 26 insertions, 14 deletions
diff --git a/drivers/input/mouse/hgpk.c b/drivers/input/mouse/hgpk.c
index 575f880727fe..62be888e83d0 100644
--- a/drivers/input/mouse/hgpk.c
+++ b/drivers/input/mouse/hgpk.c
@@ -334,11 +334,8 @@ static bool hgpk_is_byte_valid(struct psmouse *psmouse, unsigned char *packet)
334 334
335 if (!valid) 335 if (!valid)
336 psmouse_dbg(psmouse, 336 psmouse_dbg(psmouse,
337 "bad data, mode %d (%d) %02x %02x %02x %02x %02x %02x\n", 337 "bad data, mode %d (%d) %*ph\n",
338 priv->mode, pktcnt, 338 priv->mode, pktcnt, 6, psmouse->packet);
339 psmouse->packet[0], psmouse->packet[1],
340 psmouse->packet[2], psmouse->packet[3],
341 psmouse->packet[4], psmouse->packet[5]);
342 339
343 return valid; 340 return valid;
344} 341}
@@ -1030,7 +1027,7 @@ static enum hgpk_model_t hgpk_get_model(struct psmouse *psmouse)
1030 return -EIO; 1027 return -EIO;
1031 } 1028 }
1032 1029
1033 psmouse_dbg(psmouse, "ID: %02x %02x %02x\n", param[0], param[1], param[2]); 1030 psmouse_dbg(psmouse, "ID: %*ph\n", 3, param);
1034 1031
1035 /* HGPK signature: 0x67, 0x00, 0x<model> */ 1032 /* HGPK signature: 0x67, 0x00, 0x<model> */
1036 if (param[0] != 0x67 || param[1] != 0x00) 1033 if (param[0] != 0x67 || param[1] != 0x00)
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 37033ade79d3..12d12ca3fee0 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -53,14 +53,19 @@
53#define ABS_POS_BITS 13 53#define ABS_POS_BITS 13
54 54
55/* 55/*
56 * Any position values from the hardware above the following limits are 56 * These values should represent the absolute maximum value that will
57 * treated as "wrapped around negative" values that have been truncated to 57 * be reported for a positive position value. Some Synaptics firmware
58 * the 13-bit reporting range of the hardware. These are just reasonable 58 * uses this value to indicate a finger near the edge of the touchpad
59 * guesses and can be adjusted if hardware is found that operates outside 59 * whose precise position cannot be determined.
60 * of these parameters. 60 *
61 * At least one touchpad is known to report positions in excess of this
62 * value which are actually negative values truncated to the 13-bit
63 * reporting range. These values have never been observed to be lower
64 * than 8184 (i.e. -8), so we treat all values greater than 8176 as
65 * negative and any other value as positive.
61 */ 66 */
62#define X_MAX_POSITIVE (((1 << ABS_POS_BITS) + XMAX) / 2) 67#define X_MAX_POSITIVE 8176
63#define Y_MAX_POSITIVE (((1 << ABS_POS_BITS) + YMAX) / 2) 68#define Y_MAX_POSITIVE 8176
64 69
65/***************************************************************************** 70/*****************************************************************************
66 * Stuff we need even when we do not want native Synaptics support 71 * Stuff we need even when we do not want native Synaptics support
@@ -604,11 +609,21 @@ static int synaptics_parse_hw_state(const unsigned char buf[],
604 hw->right = (buf[0] & 0x02) ? 1 : 0; 609 hw->right = (buf[0] & 0x02) ? 1 : 0;
605 } 610 }
606 611
607 /* Convert wrap-around values to negative */ 612 /*
613 * Convert wrap-around values to negative. (X|Y)_MAX_POSITIVE
614 * is used by some firmware to indicate a finger at the edge of
615 * the touchpad whose precise position cannot be determined, so
616 * convert these values to the maximum axis value.
617 */
608 if (hw->x > X_MAX_POSITIVE) 618 if (hw->x > X_MAX_POSITIVE)
609 hw->x -= 1 << ABS_POS_BITS; 619 hw->x -= 1 << ABS_POS_BITS;
620 else if (hw->x == X_MAX_POSITIVE)
621 hw->x = XMAX;
622
610 if (hw->y > Y_MAX_POSITIVE) 623 if (hw->y > Y_MAX_POSITIVE)
611 hw->y -= 1 << ABS_POS_BITS; 624 hw->y -= 1 << ABS_POS_BITS;
625 else if (hw->y == Y_MAX_POSITIVE)
626 hw->y = YMAX;
612 627
613 return 0; 628 return 0;
614} 629}