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 7A91D24418F; Tue, 30 Sep 2025 15:20: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=1759245654; cv=none; b=YKxJNzfRu3OdzgpJ7OBRxPb/oPYzW5CJ3Do8BIQ2hHkg5/h8Twd0Mr9dxMavtK1xWwbxAe4HrZZ+s1qR6J8C2xsxwpIReVcVsUncCmOZbvKESQfWGbK2uBhxif8APX5Dbo0qgctDRPdjETuHZ7TCozcGurzZy54sa0T70e21oxs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759245654; c=relaxed/simple; bh=kBCRpGyK1Xc6asJDVNcmkUbBZeUyjven2dnHWwCAnxM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NmNudzg/siai8UtDznyjctVjtp04LcdwdBGVn/aTHfN5ha65FsKn1HtdKNMwNE14Rxmx8sbL3vFFNC34/vFySSQTv6yXowshrgK2kaC4ufVgf0Z8NUG4MZh779jm51pDDqVCmAr3qdgtkVIKWBBPVzra88c4nmFX3qr/eskdPzI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0ndkVUdA; 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="0ndkVUdA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBDA2C4CEF0; Tue, 30 Sep 2025 15:20:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759245654; bh=kBCRpGyK1Xc6asJDVNcmkUbBZeUyjven2dnHWwCAnxM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0ndkVUdAAjjmCytlISqO1JnU1TXA5MzVj9RUDC2ZMv1oqYOpzALfbA7POFCLerATL cGOOEskQUaDqYZt7K5Ml4VII3N5iWLUOMOZK5bdS1QAx+Ir+6j0EB5mzWKjQ7vaIBz uqLcAwrz+0DP2IpioNxTZ9q1DihpTXd9+mp7GkEY= 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.6 10/91] HID: multitouch: support getting the tip state from HID_DG_TOUCH fields in Apple Touch Bar Date: Tue, 30 Sep 2025 16:47:09 +0200 Message-ID: <20250930143821.545230509@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250930143821.118938523@linuxfoundation.org> References: <20250930143821.118938523@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.6-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 35426e702b301..d0b2e866dadaf 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -814,6 +814,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, @@ -884,10 +895,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