From: Aditya Garg <gargaditya08@live.com>
To: Jiri Kosina <jikos@kernel.org>, Jiri Kosina <jkosina@suse.com>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>,
"bentiss@kernel.org" <bentiss@kernel.org>
Cc: Kerem Karabay <kekrby@gmail.com>,
Orlando Chamberlain <orlandoch.dev@gmail.com>,
Aun-Ali Zaidi <admin@kodeit.net>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>
Subject: [PATCH RESEND 2/5] HID: multitouch: support getting the tip state from HID_DG_TOUCH fields in Apple Touch Bar
Date: Mon, 10 Mar 2025 09:12:37 +0000 [thread overview]
Message-ID: <0699DD36-24C5-4859-85BF-75480B87128F@live.com> (raw)
In-Reply-To: <ECE4880B-2A87-4147-B83B-2D832639F3B2@live.com>
From: Kerem Karabay <kekrby@gmail.com>
In Apple Touch Bar, the tip state is contained in fields with the
HID_DG_TOUCH usage. This feature is gated by a quirk in order to
prevent breaking other devices, see commit c2ef8f21ea8f
("HID: multitouch: add support for trackpads").
Signed-off-by: Kerem Karabay <kekrby@gmail.com>
Co-developed-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Aditya Garg <gargaditya08@live.com>
---
drivers/hid/hid-multitouch.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 6e7f34a47..70fdd8cf9 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -827,6 +827,17 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
MT_STORE_FIELD(confidence_state);
return 1;
+ case HID_DG_TOUCH:
+ /*
+ * Legacy devices use TIPSWITCH and not TOUCH.
+ * One special case here is of the Apple Touch Bars.
+ * In these devices, the tip state is contained in
+ * fields with the HID_DG_TOUCH usage.
+ * Let's just ignore this field for other devices.
+ */
+ if (!(cls->quirks & MT_QUIRK_APPLE_TOUCHBAR))
+ return -1;
+ fallthrough;
case HID_DG_TIPSWITCH:
if (field->application != HID_GD_SYSTEM_MULTIAXIS)
input_set_capability(hi->input,
@@ -897,10 +908,6 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
case HID_DG_CONTACTMAX:
/* contact max are global to the report */
return -1;
- case HID_DG_TOUCH:
- /* Legacy devices use TIPSWITCH and not TOUCH.
- * Let's just ignore this field. */
- return -1;
}
/* let hid-input decide for the others */
return 0;
--
2.43.0
next prev parent reply other threads:[~2025-03-10 9:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-10 9:10 [PATCH RESEND 0/5] HID: multitouch: Add support for Touch Bars on x86 MacBook Pros Aditya Garg
2025-03-10 9:12 ` [PATCH RESEND 1/5] HID: multitouch: Get the contact ID from HID_DG_TRANSDUCER_INDEX fields in case of Apple Touch Bar Aditya Garg
2025-03-10 9:12 ` Aditya Garg [this message]
2025-03-10 9:13 ` [PATCH RESEND 3/5] HID: multitouch: take cls->maxcontacts into account for Apple Touch Bar even without a HID_DG_CONTACTMAX field Aditya Garg
2025-03-10 9:13 ` [PATCH RESEND 4/5] HID: multitouch: specify that Apple Touch Bar is direct Aditya Garg
2025-03-10 9:14 ` [PATCH RESEND 5/5] HID: multitouch: add device ID for Apple Touch Bar Aditya Garg
2025-03-25 13:13 ` Benjamin Tissoires
2025-03-25 13:38 ` Aditya Garg
2025-03-25 16:11 ` Benjamin Tissoires
2025-03-25 12:52 ` [PATCH RESEND 0/5] HID: multitouch: Add support for Touch Bars on x86 MacBook Pros Jiri Kosina
2025-03-25 13:13 ` Benjamin Tissoires
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0699DD36-24C5-4859-85BF-75480B87128F@live.com \
--to=gargaditya08@live.com \
--cc=admin@kodeit.net \
--cc=benjamin.tissoires@redhat.com \
--cc=bentiss@kernel.org \
--cc=jikos@kernel.org \
--cc=jkosina@suse.com \
--cc=kekrby@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=orlandoch.dev@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox