From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ABFE627056D; Tue, 30 Sep 2025 15:00:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759244454; cv=none; b=BSGW716J0Au9wyfCk9goAf6TODIgguBgcx9IK1vzAMZelXdXGyLFyVo1SvKac3PTlrs1QAgNqcaJ27Uda8ziAKb3iybVwDsNDlZ7ZtAGz8kFEY+RPaK+WAHjtYFpVgxvr2SgIu9uJ6HFnLoy11CndITn4a3JdL2Sq0xl1peD+sY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759244454; c=relaxed/simple; bh=hF4Bu2/c2EgFiHlUjHng9T/5S2RRpYsSL3YSe4RLbUk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b8Zlfg/pKzjcF8G6oNHQV0wX1XoHcJmBOBvepEVmVwQf29WDAJhOYs9R7aFsm2rbSf61c6Fw0k3w14WTtRNdqkZKg0hgesCYPq5Wm1iiyWCI1YUypxnf73sAPFyuwJGORC2cf2BPjhs6JXH/cHmSsEgnkWXTU35BFDuHsEctOKA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ph16WTCe; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ph16WTCe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29706C4CEF0; Tue, 30 Sep 2025 15:00:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759244454; bh=hF4Bu2/c2EgFiHlUjHng9T/5S2RRpYsSL3YSe4RLbUk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ph16WTCeYluZj/oAh/qmGu2FZsPXn46cGNgVwOAV1qBv+SPbRZqcScC+LfJlhbXnH gCS9sEjnBYepbweWPLLd2kQOlrRFFpr2souoJZMgK5xJKF0W9modu62rg1367e9WBI +6ATPYh7uXo9Noh8c470/Z+cJBHykOKkyZXvse/Q= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Benjamin Tissoires , Kerem Karabay , Aditya Garg , Jiri Kosina , Sasha Levin Subject: [PATCH 6.16 012/143] HID: multitouch: support getting the tip state from HID_DG_TOUCH fields in Apple Touch Bar Date: Tue, 30 Sep 2025 16:45:36 +0200 Message-ID: <20250930143831.735949136@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250930143831.236060637@linuxfoundation.org> References: <20250930143831.236060637@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kerem Karabay [ Upstream commit e0976a61a543b5e03bc0d08030a0ea036ee3751d ] 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"). Acked-by: Benjamin Tissoires Signed-off-by: Kerem Karabay Co-developed-by: Aditya Garg Signed-off-by: Aditya Garg Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- 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 c1be2978c0987..20e0958d0fa9f 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.51.0