Commit 7dfe48bd authored by Kerem Karabay's avatar Kerem Karabay Committed by Jiri Kosina
Browse files

HID: multitouch: take cls->maxcontacts into account for Apple Touch Bar even...


HID: multitouch: take cls->maxcontacts into account for Apple Touch Bar even without a HID_DG_CONTACTMAX field

In Apple Touch Bar, the HID_DG_CONTACTMAX is not present, but the maximum
contact count is still greater than the default. Add quirks for the same.

Acked-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
Signed-off-by: default avatarKerem Karabay <kekrby@gmail.com>
Co-developed-by: default avatarAditya Garg <gargaditya08@live.com>
Signed-off-by: default avatarAditya Garg <gargaditya08@live.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.com>
parent e0976a61
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1335,6 +1335,13 @@ static int mt_touch_input_configured(struct hid_device *hdev,
	struct input_dev *input = hi->input;
	int ret;

	/*
	 * HID_DG_CONTACTMAX field is not present on Apple Touch Bars,
	 * but the maximum contact count is greater than the default.
	 */
	if (cls->quirks & MT_QUIRK_APPLE_TOUCHBAR && cls->maxcontacts)
		td->maxcontacts = cls->maxcontacts;

	if (!td->maxcontacts)
		td->maxcontacts = MT_DEFAULT_MAXCONTACT;