Skip to content

Commit df70793

Browse files
jigpuJiri Kosina
authored andcommitted
HID: wacom: Expect 'touch_max' touches if HID_DG_CONTACTCOUNT not present
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). Cc: [email protected] Signed-off-by: Jason Gerecke <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 499522c commit df70793

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/hid/wacom_wac.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,8 +1740,8 @@ static void wacom_wac_finger_pre_report(struct hid_device *hdev,
17401740
}
17411741
}
17421742
}
1743-
1744-
if (hid_data->cc_index >= 0) {
1743+
if (hid_data->cc_report != 0 &&
1744+
hid_data->cc_index >= 0) {
17451745
struct hid_field *field = report->field[hid_data->cc_index];
17461746
int value = field->value[hid_data->cc_value_index];
17471747
if (value)

0 commit comments

Comments
 (0)