All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "HID: wacom: Expect 'touch_max' touches if HID_DG_CONTACTCOUNT" has been added to the 4.3-stable tree
@ 2016-01-27  6:55 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-01-27  6:55 UTC (permalink / raw)
  To: killertofu, gregkh, jason.gerecke, jkosina; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    HID: wacom: Expect 'touch_max' touches if HID_DG_CONTACTCOUNT

to the 4.3-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     hid-wacom-expect-touch_max-touches-if-hid_dg_contactcount.patch
and it can be found in the queue-4.3 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From df7079380554e6e8e13a0812c7e6c72f669aba5c Mon Sep 17 00:00:00 2001
From: Jason Gerecke <killertofu@gmail.com>
Date: Wed, 7 Oct 2015 16:54:22 -0700
Subject: HID: wacom: Expect 'touch_max' touches if HID_DG_CONTACTCOUNT
 not present

From: Jason Gerecke <killertofu@gmail.com>

commit df7079380554e6e8e13a0812c7e6c72f669aba5c upstream.

When introduced in commit 1b5d514, the check 'if (hid_data->cc_index >= 0)'
in 'wacom_wac_finger_pre_report' was intended to switch where the driver
got the expected number of contacts from: HID_DG_CONTACTCOUNT if the usage
was present, or 'touch_max' otherwise. Unfortunately, an oversight worthy
of a brown paper bag (specifically, that 'cc_index' could never be negative)
meant that the latter 'else' clause would never be entered.

The patch prior to this one introduced a way for 'cc_index' to be negative,
but only if HID_DG_CONTACTCOUNT is present in some report _other_ than the
one being processed. To ensure the 'else' clause is also entered for devices
which don't have HID_DG_CONTACTCOUNT on _any_ report, we add the additional
constraint that 'cc_report' be non-zero (which is true only if the usage is
present in some report).

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/hid/wacom_wac.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -1740,8 +1740,8 @@ static void wacom_wac_finger_pre_report(
 			}
 		}
 	}
-
-	if (hid_data->cc_index >= 0) {
+	if (hid_data->cc_report != 0 &&
+	    hid_data->cc_index >= 0) {
 		struct hid_field *field = report->field[hid_data->cc_index];
 		int value = field->value[hid_data->cc_value_index];
 		if (value)


Patches currently in stable-queue which might be from killertofu@gmail.com are

queue-4.3/hid-wacom-expect-touch_max-touches-if-hid_dg_contactcount.patch
queue-4.3/hid-wacom-tie-cached-hid_dg_contactcount-indices-to-report-id.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-01-27  6:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-27  6:55 Patch "HID: wacom: Expect 'touch_max' touches if HID_DG_CONTACTCOUNT" has been added to the 4.3-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.