diff options
| author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2014-06-08 01:37:47 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-06-08 02:20:46 -0400 |
| commit | d49cb7aeebb974713f9f7ab2991352d3050b095b (patch) | |
| tree | f9f8b73c046bd5ac83d57a6f3f23ba42dc519f41 | |
| parent | 0f68f39c393bc06ac5ccc8794f0e2ed841e41c3e (diff) | |
Input: synaptics - fix resolution for manually provided min/max
commit 421e08c41fda fixed the reported min/max for the X and Y axis,
but unfortunately, it broke the resolution of those same axis.
On the t540p, the resolution is the same regarding X and Y. It is not
a problem for xf86-input-synaptics because this driver is only interested
in the ratio between X and Y.
Unfortunately, xf86-input-cmt uses directly the resolution, and having a
null resolution leads to some divide by 0 errors, which are translated by
-infinity in the resulting coordinates.
Reported-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
| -rw-r--r-- | drivers/input/mouse/synaptics.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index c5ec703c727e..ec772d962f06 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
| @@ -347,15 +347,6 @@ static int synaptics_resolution(struct psmouse *psmouse) | |||
| 347 | unsigned char resp[3]; | 347 | unsigned char resp[3]; |
| 348 | int i; | 348 | int i; |
| 349 | 349 | ||
| 350 | for (i = 0; min_max_pnpid_table[i].pnp_ids; i++) | ||
| 351 | if (matches_pnp_id(psmouse, min_max_pnpid_table[i].pnp_ids)) { | ||
| 352 | priv->x_min = min_max_pnpid_table[i].x_min; | ||
| 353 | priv->x_max = min_max_pnpid_table[i].x_max; | ||
| 354 | priv->y_min = min_max_pnpid_table[i].y_min; | ||
| 355 | priv->y_max = min_max_pnpid_table[i].y_max; | ||
| 356 | return 0; | ||
| 357 | } | ||
| 358 | |||
| 359 | if (SYN_ID_MAJOR(priv->identity) < 4) | 350 | if (SYN_ID_MAJOR(priv->identity) < 4) |
| 360 | return 0; | 351 | return 0; |
| 361 | 352 | ||
| @@ -366,6 +357,16 @@ static int synaptics_resolution(struct psmouse *psmouse) | |||
| 366 | } | 357 | } |
| 367 | } | 358 | } |
| 368 | 359 | ||
| 360 | for (i = 0; min_max_pnpid_table[i].pnp_ids; i++) { | ||
| 361 | if (matches_pnp_id(psmouse, min_max_pnpid_table[i].pnp_ids)) { | ||
| 362 | priv->x_min = min_max_pnpid_table[i].x_min; | ||
| 363 | priv->x_max = min_max_pnpid_table[i].x_max; | ||
| 364 | priv->y_min = min_max_pnpid_table[i].y_min; | ||
| 365 | priv->y_max = min_max_pnpid_table[i].y_max; | ||
| 366 | return 0; | ||
| 367 | } | ||
| 368 | } | ||
| 369 | |||
| 369 | if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 5 && | 370 | if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 5 && |
| 370 | SYN_CAP_MAX_DIMENSIONS(priv->ext_cap_0c)) { | 371 | SYN_CAP_MAX_DIMENSIONS(priv->ext_cap_0c)) { |
| 371 | if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_MAX_COORDS, resp)) { | 372 | if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_MAX_COORDS, resp)) { |
