]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.19.4/input-synaptics-split-synaptics_resolution-query-first.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.19.4 / input-synaptics-split-synaptics_resolution-query-first.patch
CommitLineData
3243ae9b
GKH
1From 8b04baba10b007f8b6c245a50be73cf09cc3a414 Mon Sep 17 00:00:00 2001
2From: Daniel Martin <consume.noise@gmail.com>
3Date: Sun, 8 Mar 2015 22:27:37 -0700
4Subject: Input: synaptics - split synaptics_resolution(), query first
5
6From: Daniel Martin <consume.noise@gmail.com>
7
8commit 8b04baba10b007f8b6c245a50be73cf09cc3a414 upstream.
9
10Split the function synaptics_resolution() into synaptics_resolution() and
11synaptics_quirks(). synaptics_resolution() will be called before
12synaptics_quirks() to query dimensions and resolutions before overwriting
13them with quirks.
14
15Signed-off-by: Daniel Martin <consume.noise@gmail.com>
16Acked-by: Hans de Goede <hdegoede@redhat.com>
17Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
18Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20---
21 drivers/input/mouse/synaptics.c | 35 +++++++++++++++++++++++------------
22 1 file changed, 23 insertions(+), 12 deletions(-)
23
24--- a/drivers/input/mouse/synaptics.c
25+++ b/drivers/input/mouse/synaptics.c
26@@ -343,7 +343,6 @@ static int synaptics_resolution(struct p
27 {
28 struct synaptics_data *priv = psmouse->private;
29 unsigned char resp[3];
30- int i;
31
32 if (SYN_ID_MAJOR(priv->identity) < 4)
33 return 0;
34@@ -355,17 +354,6 @@ static int synaptics_resolution(struct p
35 }
36 }
37
38- for (i = 0; min_max_pnpid_table[i].pnp_ids; i++) {
39- if (psmouse_matches_pnp_id(psmouse,
40- min_max_pnpid_table[i].pnp_ids)) {
41- priv->x_min = min_max_pnpid_table[i].x_min;
42- priv->x_max = min_max_pnpid_table[i].x_max;
43- priv->y_min = min_max_pnpid_table[i].y_min;
44- priv->y_max = min_max_pnpid_table[i].y_max;
45- return 0;
46- }
47- }
48-
49 if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 5 &&
50 SYN_CAP_MAX_DIMENSIONS(priv->ext_cap_0c)) {
51 if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_MAX_COORDS, resp)) {
52@@ -391,6 +379,27 @@ static int synaptics_resolution(struct p
53 return 0;
54 }
55
56+/*
57+ * Apply quirk(s) if the hardware matches
58+ */
59+
60+static void synaptics_apply_quirks(struct psmouse *psmouse)
61+{
62+ struct synaptics_data *priv = psmouse->private;
63+ int i;
64+
65+ for (i = 0; min_max_pnpid_table[i].pnp_ids; i++) {
66+ if (psmouse_matches_pnp_id(psmouse,
67+ min_max_pnpid_table[i].pnp_ids)) {
68+ priv->x_min = min_max_pnpid_table[i].x_min;
69+ priv->x_max = min_max_pnpid_table[i].x_max;
70+ priv->y_min = min_max_pnpid_table[i].y_min;
71+ priv->y_max = min_max_pnpid_table[i].y_max;
72+ break;
73+ }
74+ }
75+}
76+
77 static int synaptics_query_hardware(struct psmouse *psmouse)
78 {
79 if (synaptics_identify(psmouse))
80@@ -406,6 +415,8 @@ static int synaptics_query_hardware(stru
81 if (synaptics_resolution(psmouse))
82 return -1;
83
84+ synaptics_apply_quirks(psmouse);
85+
86 return 0;
87 }
88