]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Apr 2015 10:03:53 +0000 (12:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Apr 2015 10:03:53 +0000 (12:03 +0200)
added patches:
input-synaptics-do-not-retrieve-the-board-id-on-old-firmwares.patch
input-synaptics-fix-middle-button-on-lenovo-2015-products.patch
input-synaptics-handle-spurious-release-of-trackstick-buttons.patch
input-synaptics-log-queried-and-quirked-dimension-values.patch
input-synaptics-query-min-dimensions-for-fw-v8.1.patch
input-synaptics-remove-obsolete-min-max-quirk-for-x240.patch
input-synaptics-skip-quirks-when-post-2013-dimensions.patch
input-synaptics-split-synaptics_resolution-query-first.patch
input-synaptics-support-min-max-board-id-in-min_max_pnpid_table.patch

queue-3.19/input-synaptics-do-not-retrieve-the-board-id-on-old-firmwares.patch [new file with mode: 0644]
queue-3.19/input-synaptics-fix-middle-button-on-lenovo-2015-products.patch [new file with mode: 0644]
queue-3.19/input-synaptics-handle-spurious-release-of-trackstick-buttons.patch [new file with mode: 0644]
queue-3.19/input-synaptics-log-queried-and-quirked-dimension-values.patch [new file with mode: 0644]
queue-3.19/input-synaptics-query-min-dimensions-for-fw-v8.1.patch [new file with mode: 0644]
queue-3.19/input-synaptics-remove-obsolete-min-max-quirk-for-x240.patch [new file with mode: 0644]
queue-3.19/input-synaptics-skip-quirks-when-post-2013-dimensions.patch [new file with mode: 0644]
queue-3.19/input-synaptics-split-synaptics_resolution-query-first.patch [new file with mode: 0644]
queue-3.19/input-synaptics-support-min-max-board-id-in-min_max_pnpid_table.patch [new file with mode: 0644]
queue-3.19/series

diff --git a/queue-3.19/input-synaptics-do-not-retrieve-the-board-id-on-old-firmwares.patch b/queue-3.19/input-synaptics-do-not-retrieve-the-board-id-on-old-firmwares.patch
new file mode 100644 (file)
index 0000000..b4c3fbb
--- /dev/null
@@ -0,0 +1,33 @@
+From b57a7128be24062b5b5b26032b7cd58f1651547e Mon Sep 17 00:00:00 2001
+From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Date: Sun, 8 Mar 2015 22:33:36 -0700
+Subject: Input: synaptics - do not retrieve the board id on old firmwares
+
+From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+
+commit b57a7128be24062b5b5b26032b7cd58f1651547e upstream.
+
+The board id capability has been added in firmware 7.5.
+
+Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Acked-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/input/mouse/synaptics.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/input/mouse/synaptics.c
++++ b/drivers/input/mouse/synaptics.c
+@@ -250,6 +250,10 @@ static int synaptics_board_id(struct psm
+       struct synaptics_data *priv = psmouse->private;
+       unsigned char bid[3];
++      /* firmwares prior 7.5 have no board_id encoded */
++      if (SYN_ID_FULL(priv->identity) < 0x705)
++              return 0;
++
+       if (synaptics_send_cmd(psmouse, SYN_QUE_MODES, bid))
+               return -1;
+       priv->board_id = ((bid[0] & 0xfc) << 6) | bid[1];
diff --git a/queue-3.19/input-synaptics-fix-middle-button-on-lenovo-2015-products.patch b/queue-3.19/input-synaptics-fix-middle-button-on-lenovo-2015-products.patch
new file mode 100644 (file)
index 0000000..4c2066f
--- /dev/null
@@ -0,0 +1,101 @@
+From dc5465dc8a6d5cae8a0e1d8826bdcb2e4cb261ab Mon Sep 17 00:00:00 2001
+From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Date: Sun, 8 Mar 2015 22:30:43 -0700
+Subject: Input: synaptics - fix middle button on Lenovo 2015 products
+
+From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+
+commit dc5465dc8a6d5cae8a0e1d8826bdcb2e4cb261ab upstream.
+
+On the X1 Carbon 3rd gen (with a 2015 broadwell cpu), the physical middle
+button of the trackstick (attached to the touchpad serio device, of course)
+seems to get lost.
+
+Actually, the touchpads reports 3 extra buttons, which falls in the switch
+below to the '2' case. Let's handle the case of odd numbers also, so that
+the middle button finds its way back.
+
+Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Acked-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/input/mouse/synaptics.c |   44 +++++++++++++++++++---------------------
+ 1 file changed, 21 insertions(+), 23 deletions(-)
+
+--- a/drivers/input/mouse/synaptics.c
++++ b/drivers/input/mouse/synaptics.c
+@@ -658,6 +658,18 @@ static void synaptics_parse_agm(const un
+       priv->agm_pending = true;
+ }
++static void synaptics_parse_ext_buttons(const unsigned char buf[],
++                                      struct synaptics_data *priv,
++                                      struct synaptics_hw_state *hw)
++{
++      unsigned int ext_bits =
++              (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) + 1) >> 1;
++      unsigned int ext_mask = GENMASK(ext_bits - 1, 0);
++
++      hw->ext_buttons = buf[4] & ext_mask;
++      hw->ext_buttons |= (buf[5] & ext_mask) << ext_bits;
++}
++
+ static bool is_forcepad;
+ static int synaptics_parse_hw_state(const unsigned char buf[],
+@@ -744,28 +756,9 @@ static int synaptics_parse_hw_state(cons
+                       hw->down = ((buf[0] ^ buf[3]) & 0x02) ? 1 : 0;
+               }
+-              if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) &&
++              if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) > 0 &&
+                   ((buf[0] ^ buf[3]) & 0x02)) {
+-                      switch (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) & ~0x01) {
+-                      default:
+-                              /*
+-                               * if nExtBtn is greater than 8 it should be
+-                               * considered invalid and treated as 0
+-                               */
+-                              break;
+-                      case 8:
+-                              hw->ext_buttons |= ((buf[5] & 0x08)) ? 0x80 : 0;
+-                              hw->ext_buttons |= ((buf[4] & 0x08)) ? 0x40 : 0;
+-                      case 6:
+-                              hw->ext_buttons |= ((buf[5] & 0x04)) ? 0x20 : 0;
+-                              hw->ext_buttons |= ((buf[4] & 0x04)) ? 0x10 : 0;
+-                      case 4:
+-                              hw->ext_buttons |= ((buf[5] & 0x02)) ? 0x08 : 0;
+-                              hw->ext_buttons |= ((buf[4] & 0x02)) ? 0x04 : 0;
+-                      case 2:
+-                              hw->ext_buttons |= ((buf[5] & 0x01)) ? 0x02 : 0;
+-                              hw->ext_buttons |= ((buf[4] & 0x01)) ? 0x01 : 0;
+-                      }
++                      synaptics_parse_ext_buttons(buf, priv, hw);
+               }
+       } else {
+               hw->x = (((buf[1] & 0x1f) << 8) | buf[2]);
+@@ -832,6 +825,7 @@ static void synaptics_report_buttons(str
+ {
+       struct input_dev *dev = psmouse->dev;
+       struct synaptics_data *priv = psmouse->private;
++      int ext_bits = (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) + 1) >> 1;
+       int i;
+       input_report_key(dev, BTN_LEFT, hw->left);
+@@ -845,8 +839,12 @@ static void synaptics_report_buttons(str
+               input_report_key(dev, BTN_BACK, hw->down);
+       }
+-      for (i = 0; i < SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap); i++)
+-              input_report_key(dev, BTN_0 + i, hw->ext_buttons & (1 << i));
++      for (i = 0; i < ext_bits; i++) {
++              input_report_key(dev, BTN_0 + 2 * i,
++                               hw->ext_buttons & (1 << i));
++              input_report_key(dev, BTN_1 + 2 * i,
++                               hw->ext_buttons & (1 << (i + ext_bits)));
++      }
+ }
+ static void synaptics_report_slot(struct input_dev *dev, int slot,
diff --git a/queue-3.19/input-synaptics-handle-spurious-release-of-trackstick-buttons.patch b/queue-3.19/input-synaptics-handle-spurious-release-of-trackstick-buttons.patch
new file mode 100644 (file)
index 0000000..c824894
--- /dev/null
@@ -0,0 +1,77 @@
+From ebc80840b850db72f7ae84fbcf77630ae5409629 Mon Sep 17 00:00:00 2001
+From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Date: Sun, 8 Mar 2015 22:32:43 -0700
+Subject: Input: synaptics - handle spurious release of trackstick buttons
+
+From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+
+commit ebc80840b850db72f7ae84fbcf77630ae5409629 upstream.
+
+The Fimware 8.1 has a bug in which the extra buttons are only sent when the
+ExtBit is 1.  This should be fixed in a future FW update which should have
+a bump of the minor version.
+
+Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Acked-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/input/mouse/synaptics.c |   33 +++++++++++++++++++++++++--------
+ 1 file changed, 25 insertions(+), 8 deletions(-)
+
+--- a/drivers/input/mouse/synaptics.c
++++ b/drivers/input/mouse/synaptics.c
+@@ -820,14 +820,36 @@ static void synaptics_report_semi_mt_dat
+       }
+ }
+-static void synaptics_report_buttons(struct psmouse *psmouse,
+-                                   const struct synaptics_hw_state *hw)
++static void synaptics_report_ext_buttons(struct psmouse *psmouse,
++                                       const struct synaptics_hw_state *hw)
+ {
+       struct input_dev *dev = psmouse->dev;
+       struct synaptics_data *priv = psmouse->private;
+       int ext_bits = (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) + 1) >> 1;
+       int i;
++      if (!SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap))
++              return;
++
++      /* Bug in FW 8.1, buttons are reported only when ExtBit is 1 */
++      if (SYN_ID_FULL(priv->identity) == 0x801 &&
++          !((psmouse->packet[0] ^ psmouse->packet[3]) & 0x02))
++              return;
++
++      for (i = 0; i < ext_bits; i++) {
++              input_report_key(dev, BTN_0 + 2 * i,
++                      hw->ext_buttons & (1 << i));
++              input_report_key(dev, BTN_1 + 2 * i,
++                      hw->ext_buttons & (1 << (i + ext_bits)));
++      }
++}
++
++static void synaptics_report_buttons(struct psmouse *psmouse,
++                                   const struct synaptics_hw_state *hw)
++{
++      struct input_dev *dev = psmouse->dev;
++      struct synaptics_data *priv = psmouse->private;
++
+       input_report_key(dev, BTN_LEFT, hw->left);
+       input_report_key(dev, BTN_RIGHT, hw->right);
+@@ -839,12 +861,7 @@ static void synaptics_report_buttons(str
+               input_report_key(dev, BTN_BACK, hw->down);
+       }
+-      for (i = 0; i < ext_bits; i++) {
+-              input_report_key(dev, BTN_0 + 2 * i,
+-                               hw->ext_buttons & (1 << i));
+-              input_report_key(dev, BTN_1 + 2 * i,
+-                               hw->ext_buttons & (1 << (i + ext_bits)));
+-      }
++      synaptics_report_ext_buttons(psmouse, hw);
+ }
+ static void synaptics_report_slot(struct input_dev *dev, int slot,
diff --git a/queue-3.19/input-synaptics-log-queried-and-quirked-dimension-values.patch b/queue-3.19/input-synaptics-log-queried-and-quirked-dimension-values.patch
new file mode 100644 (file)
index 0000000..7221ef4
--- /dev/null
@@ -0,0 +1,57 @@
+From 9aff65982d0f58a78a27769fba7e97bc937b2593 Mon Sep 17 00:00:00 2001
+From: Daniel Martin <consume.noise@gmail.com>
+Date: Sun, 8 Mar 2015 22:28:29 -0700
+Subject: Input: synaptics - log queried and quirked dimension values
+
+From: Daniel Martin <consume.noise@gmail.com>
+
+commit 9aff65982d0f58a78a27769fba7e97bc937b2593 upstream.
+
+Logging the dimension values we queried and the values we use from a quirk
+to overwrite can be helpful for debugging.
+
+This partly relates to bug:
+    https://bugzilla.kernel.org/show_bug.cgi?id=91541
+
+Signed-off-by: Daniel Martin <consume.noise@gmail.com>
+Acked-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/input/mouse/synaptics.c |   10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/drivers/input/mouse/synaptics.c
++++ b/drivers/input/mouse/synaptics.c
+@@ -362,6 +362,9 @@ static int synaptics_resolution(struct p
+               } else {
+                       priv->x_max = (resp[0] << 5) | ((resp[1] & 0x0f) << 1);
+                       priv->y_max = (resp[2] << 5) | ((resp[1] & 0xf0) >> 3);
++                      psmouse_info(psmouse,
++                                   "queried max coordinates: x [..%d], y [..%d]\n",
++                                   priv->x_max, priv->y_max);
+               }
+       }
+@@ -373,6 +376,9 @@ static int synaptics_resolution(struct p
+               } else {
+                       priv->x_min = (resp[0] << 5) | ((resp[1] & 0x0f) << 1);
+                       priv->y_min = (resp[2] << 5) | ((resp[1] & 0xf0) >> 3);
++                      psmouse_info(psmouse,
++                                   "queried min coordinates: x [%d..], y [%d..]\n",
++                                   priv->x_min, priv->y_min);
+               }
+       }
+@@ -395,6 +401,10 @@ static void synaptics_apply_quirks(struc
+                       priv->x_max = min_max_pnpid_table[i].x_max;
+                       priv->y_min = min_max_pnpid_table[i].y_min;
+                       priv->y_max = min_max_pnpid_table[i].y_max;
++                      psmouse_info(psmouse,
++                                   "quirked min/max coordinates: x [%d..%d], y [%d..%d]\n",
++                                   priv->x_min, priv->x_max,
++                                   priv->y_min, priv->y_max);
+                       break;
+               }
+       }
diff --git a/queue-3.19/input-synaptics-query-min-dimensions-for-fw-v8.1.patch b/queue-3.19/input-synaptics-query-min-dimensions-for-fw-v8.1.patch
new file mode 100644 (file)
index 0000000..96783d3
--- /dev/null
@@ -0,0 +1,48 @@
+From ac097930f0730a9b777737de2b51e0fc49d2be7a Mon Sep 17 00:00:00 2001
+From: Daniel Martin <consume.noise@gmail.com>
+Date: Sun, 8 Mar 2015 22:28:40 -0700
+Subject: Input: synaptics - query min dimensions for fw v8.1
+
+From: Daniel Martin <consume.noise@gmail.com>
+
+commit ac097930f0730a9b777737de2b51e0fc49d2be7a upstream.
+
+Query the min dimensions even if the check
+SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 7 fails, but we know that the
+firmware version 8.1 is safe.
+
+With that we don't need quirks for post-2013 models anymore as they expose
+correct min and max dimensions.
+
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=91541
+
+Signed-off-by: Daniel Martin <consume.noise@gmail.com>
+  re-order the tests to check SYN_CAP_MIN_DIMENSIONS even on FW 8.1
+Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Acked-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/input/mouse/synaptics.c |   10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+--- a/drivers/input/mouse/synaptics.c
++++ b/drivers/input/mouse/synaptics.c
+@@ -368,8 +368,14 @@ static int synaptics_resolution(struct p
+               }
+       }
+-      if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 7 &&
+-          SYN_CAP_MIN_DIMENSIONS(priv->ext_cap_0c)) {
++      if (SYN_CAP_MIN_DIMENSIONS(priv->ext_cap_0c) &&
++          (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 7 ||
++           /*
++            * Firmware v8.1 does not report proper number of extended
++            * capabilities, but has been proven to report correct min
++            * coordinates.
++            */
++           SYN_ID_FULL(priv->identity) == 0x801)) {
+               if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_MIN_COORDS, resp)) {
+                       psmouse_warn(psmouse,
+                                    "device claims to have min coordinates query, but I'm not able to read it.\n");
diff --git a/queue-3.19/input-synaptics-remove-obsolete-min-max-quirk-for-x240.patch b/queue-3.19/input-synaptics-remove-obsolete-min-max-quirk-for-x240.patch
new file mode 100644 (file)
index 0000000..15240b7
--- /dev/null
@@ -0,0 +1,33 @@
+From b05f4d1c332a22f98c037fa64f249aa30877adaf Mon Sep 17 00:00:00 2001
+From: Daniel Martin <consume.noise@gmail.com>
+Date: Sun, 8 Mar 2015 22:29:07 -0700
+Subject: Input: synaptics - remove obsolete min/max quirk for X240
+
+From: Daniel Martin <consume.noise@gmail.com>
+
+commit b05f4d1c332a22f98c037fa64f249aa30877adaf upstream.
+
+The firmware of the X240 (LEN0035, 2013/12) exposes the same values
+    x [1232..5710], y [1156..4696]
+as the quirk applies.
+
+Signed-off-by: Daniel Martin <consume.noise@gmail.com>
+Acked-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/input/mouse/synaptics.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/input/mouse/synaptics.c
++++ b/drivers/input/mouse/synaptics.c
+@@ -131,7 +131,7 @@ static const struct min_max_quirk min_ma
+               1024, 5052, 2258, 4832
+       },
+       {
+-              (const char * const []){"LEN0035", "LEN0042", NULL},
++              (const char * const []){"LEN0042", NULL},
+               1232, 5710, 1156, 4696
+       },
+       {
diff --git a/queue-3.19/input-synaptics-skip-quirks-when-post-2013-dimensions.patch b/queue-3.19/input-synaptics-skip-quirks-when-post-2013-dimensions.patch
new file mode 100644 (file)
index 0000000..0974186
--- /dev/null
@@ -0,0 +1,40 @@
+From 02e07492cdfae9c86e3bd21c0beec88dbcc1e9e8 Mon Sep 17 00:00:00 2001
+From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Date: Sun, 8 Mar 2015 22:29:25 -0700
+Subject: Input: synaptics - skip quirks when post-2013 dimensions
+
+From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+
+commit 02e07492cdfae9c86e3bd21c0beec88dbcc1e9e8 upstream.
+
+Post-2013 Lenovo laptops provide correct min/max dimensions, which are
+different with the ones currently quirked.  According to
+https://bugzilla.kernel.org/show_bug.cgi?id=91541 the following board ids
+are assigned in the post-2013 touchpads:
+
+t440p/t440s: LEN0036 -> 2964/2962
+t540p:       LEN0034 -> 2964
+
+Using 2961 as the common minimum makes these 3 laptops OK. We may need
+to update those values later if other pnp_ids has a lower board_id.
+
+Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Acked-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/input/mouse/synaptics.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/input/mouse/synaptics.c
++++ b/drivers/input/mouse/synaptics.c
+@@ -144,7 +144,7 @@ static const struct min_max_quirk min_ma
+               (const char * const []){"LEN0034", "LEN0036", "LEN0037",
+                                       "LEN0039", "LEN2002", "LEN2004",
+                                       NULL},
+-              {ANY_BOARD_ID, ANY_BOARD_ID},
++              {ANY_BOARD_ID, 2961},
+               1024, 5112, 2024, 4832
+       },
+       {
diff --git a/queue-3.19/input-synaptics-split-synaptics_resolution-query-first.patch b/queue-3.19/input-synaptics-split-synaptics_resolution-query-first.patch
new file mode 100644 (file)
index 0000000..5eed7eb
--- /dev/null
@@ -0,0 +1,88 @@
+From 8b04baba10b007f8b6c245a50be73cf09cc3a414 Mon Sep 17 00:00:00 2001
+From: Daniel Martin <consume.noise@gmail.com>
+Date: Sun, 8 Mar 2015 22:27:37 -0700
+Subject: Input: synaptics - split synaptics_resolution(), query first
+
+From: Daniel Martin <consume.noise@gmail.com>
+
+commit 8b04baba10b007f8b6c245a50be73cf09cc3a414 upstream.
+
+Split the function synaptics_resolution() into synaptics_resolution() and
+synaptics_quirks().  synaptics_resolution() will be called before
+synaptics_quirks() to query dimensions and resolutions before overwriting
+them with quirks.
+
+Signed-off-by: Daniel Martin <consume.noise@gmail.com>
+Acked-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/input/mouse/synaptics.c |   35 +++++++++++++++++++++++------------
+ 1 file changed, 23 insertions(+), 12 deletions(-)
+
+--- a/drivers/input/mouse/synaptics.c
++++ b/drivers/input/mouse/synaptics.c
+@@ -343,7 +343,6 @@ static int synaptics_resolution(struct p
+ {
+       struct synaptics_data *priv = psmouse->private;
+       unsigned char resp[3];
+-      int i;
+       if (SYN_ID_MAJOR(priv->identity) < 4)
+               return 0;
+@@ -355,17 +354,6 @@ static int synaptics_resolution(struct p
+               }
+       }
+-      for (i = 0; min_max_pnpid_table[i].pnp_ids; i++) {
+-              if (psmouse_matches_pnp_id(psmouse,
+-                                         min_max_pnpid_table[i].pnp_ids)) {
+-                      priv->x_min = min_max_pnpid_table[i].x_min;
+-                      priv->x_max = min_max_pnpid_table[i].x_max;
+-                      priv->y_min = min_max_pnpid_table[i].y_min;
+-                      priv->y_max = min_max_pnpid_table[i].y_max;
+-                      return 0;
+-              }
+-      }
+-
+       if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 5 &&
+           SYN_CAP_MAX_DIMENSIONS(priv->ext_cap_0c)) {
+               if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_MAX_COORDS, resp)) {
+@@ -391,6 +379,27 @@ static int synaptics_resolution(struct p
+       return 0;
+ }
++/*
++ * Apply quirk(s) if the hardware matches
++ */
++
++static void synaptics_apply_quirks(struct psmouse *psmouse)
++{
++      struct synaptics_data *priv = psmouse->private;
++      int i;
++
++      for (i = 0; min_max_pnpid_table[i].pnp_ids; i++) {
++              if (psmouse_matches_pnp_id(psmouse,
++                                         min_max_pnpid_table[i].pnp_ids)) {
++                      priv->x_min = min_max_pnpid_table[i].x_min;
++                      priv->x_max = min_max_pnpid_table[i].x_max;
++                      priv->y_min = min_max_pnpid_table[i].y_min;
++                      priv->y_max = min_max_pnpid_table[i].y_max;
++                      break;
++              }
++      }
++}
++
+ static int synaptics_query_hardware(struct psmouse *psmouse)
+ {
+       if (synaptics_identify(psmouse))
+@@ -406,6 +415,8 @@ static int synaptics_query_hardware(stru
+       if (synaptics_resolution(psmouse))
+               return -1;
++      synaptics_apply_quirks(psmouse);
++
+       return 0;
+ }
diff --git a/queue-3.19/input-synaptics-support-min-max-board-id-in-min_max_pnpid_table.patch b/queue-3.19/input-synaptics-support-min-max-board-id-in-min_max_pnpid_table.patch
new file mode 100644 (file)
index 0000000..5620928
--- /dev/null
@@ -0,0 +1,108 @@
+From 5b3089ddb540401c1ad2e385a03d7e89ff954585 Mon Sep 17 00:00:00 2001
+From: Daniel Martin <daniel.martin@secunet.com>
+Date: Sun, 8 Mar 2015 22:29:15 -0700
+Subject: Input: synaptics - support min/max board id in min_max_pnpid_table
+
+From: Daniel Martin <daniel.martin@secunet.com>
+
+commit 5b3089ddb540401c1ad2e385a03d7e89ff954585 upstream.
+
+Add a min/max range for board ids to the min/max coordinates quirk. This
+makes it possible to restrict quirks to specific models based upon their
+board id. The define ANY_BOARD_ID (0) serves as a wild card.
+
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=91541
+
+Signed-off-by: Daniel Martin <daniel.martin@secunet.com>
+Acked-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/input/mouse/synaptics.c |   42 ++++++++++++++++++++++++++++------------
+ 1 file changed, 30 insertions(+), 12 deletions(-)
+
+--- a/drivers/input/mouse/synaptics.c
++++ b/drivers/input/mouse/synaptics.c
+@@ -120,32 +120,41 @@ void synaptics_reset(struct psmouse *psm
+ static bool cr48_profile_sensor;
++#define ANY_BOARD_ID 0
+ struct min_max_quirk {
+       const char * const *pnp_ids;
++      struct {
++              unsigned long int min, max;
++      } board_id;
+       int x_min, x_max, y_min, y_max;
+ };
+ static const struct min_max_quirk min_max_pnpid_table[] = {
+       {
+               (const char * const []){"LEN0033", NULL},
++              {ANY_BOARD_ID, ANY_BOARD_ID},
+               1024, 5052, 2258, 4832
+       },
+       {
+               (const char * const []){"LEN0042", NULL},
++              {ANY_BOARD_ID, ANY_BOARD_ID},
+               1232, 5710, 1156, 4696
+       },
+       {
+               (const char * const []){"LEN0034", "LEN0036", "LEN0037",
+                                       "LEN0039", "LEN2002", "LEN2004",
+                                       NULL},
++              {ANY_BOARD_ID, ANY_BOARD_ID},
+               1024, 5112, 2024, 4832
+       },
+       {
+               (const char * const []){"LEN2001", NULL},
++              {ANY_BOARD_ID, ANY_BOARD_ID},
+               1024, 5022, 2508, 4832
+       },
+       {
+               (const char * const []){"LEN2006", NULL},
++              {ANY_BOARD_ID, ANY_BOARD_ID},
+               1264, 5675, 1171, 4688
+       },
+       { }
+@@ -401,18 +410,27 @@ static void synaptics_apply_quirks(struc
+       int i;
+       for (i = 0; min_max_pnpid_table[i].pnp_ids; i++) {
+-              if (psmouse_matches_pnp_id(psmouse,
+-                                         min_max_pnpid_table[i].pnp_ids)) {
+-                      priv->x_min = min_max_pnpid_table[i].x_min;
+-                      priv->x_max = min_max_pnpid_table[i].x_max;
+-                      priv->y_min = min_max_pnpid_table[i].y_min;
+-                      priv->y_max = min_max_pnpid_table[i].y_max;
+-                      psmouse_info(psmouse,
+-                                   "quirked min/max coordinates: x [%d..%d], y [%d..%d]\n",
+-                                   priv->x_min, priv->x_max,
+-                                   priv->y_min, priv->y_max);
+-                      break;
+-              }
++              if (!psmouse_matches_pnp_id(psmouse,
++                                          min_max_pnpid_table[i].pnp_ids))
++                      continue;
++
++              if (min_max_pnpid_table[i].board_id.min != ANY_BOARD_ID &&
++                  priv->board_id < min_max_pnpid_table[i].board_id.min)
++                      continue;
++
++              if (min_max_pnpid_table[i].board_id.max != ANY_BOARD_ID &&
++                  priv->board_id > min_max_pnpid_table[i].board_id.max)
++                      continue;
++
++              priv->x_min = min_max_pnpid_table[i].x_min;
++              priv->x_max = min_max_pnpid_table[i].x_max;
++              priv->y_min = min_max_pnpid_table[i].y_min;
++              priv->y_max = min_max_pnpid_table[i].y_max;
++              psmouse_info(psmouse,
++                           "quirked min/max coordinates: x [%d..%d], y [%d..%d]\n",
++                           priv->x_min, priv->x_max,
++                           priv->y_min, priv->y_max);
++              break;
+       }
+ }
index cc07c6fa0b388e38f495eff0a5d3aba62d91ad65..3c69242a49cdbe3ce8e2e5a50c0fb0ae5a9edd81 100644 (file)
@@ -24,3 +24,12 @@ regmap-introduce-regmap_name-to-fix-syscon-regmap-trace-events.patch
 clocksource-efm32-fix-a-null-pointer-dereference.patch
 tcm_fc-missing-curly-braces-in-ft_invl_hw_context.patch
 tcm_qla2xxx-fix-incorrect-use-of-__transport_register_session.patch
+input-synaptics-split-synaptics_resolution-query-first.patch
+input-synaptics-log-queried-and-quirked-dimension-values.patch
+input-synaptics-query-min-dimensions-for-fw-v8.1.patch
+input-synaptics-remove-obsolete-min-max-quirk-for-x240.patch
+input-synaptics-support-min-max-board-id-in-min_max_pnpid_table.patch
+input-synaptics-skip-quirks-when-post-2013-dimensions.patch
+input-synaptics-fix-middle-button-on-lenovo-2015-products.patch
+input-synaptics-handle-spurious-release-of-trackstick-buttons.patch
+input-synaptics-do-not-retrieve-the-board-id-on-old-firmwares.patch