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 1BE68217F55; Tue, 30 Sep 2025 15:18:08 +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=1759245488; cv=none; b=VLPUVMXkXbhZcaJCjH0X0oR1M/ZJ+OfVFp4yBb/Xh4dRf9btjUtTXdKPv+vhYzlZcM/iBo9HlqQ2lnS7QHzY0nggXJlmJq9zuEjI1NH4rHqORVG3FDb6HKxEH5SOwG3FPVA9V4HN5OVXoZNqKK453EQ1pbGpsIBCBPPhFvFXiR4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759245488; c=relaxed/simple; bh=eq3U8jUKBhecchcGnxlMSE798oHLegVpq7zLICaEeJk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ubZvqvm+GO4I6AqaiU4YEgLxI5ZYDYRjcXSt3tJCLhKP0T+ug+ur7gGK+s1Uq0vuPsFa3nPNbdYM4OpXYX3AnpS6zlt9lThxjWO4OMn3HH9z+I36aHUdLCsMNb6oigxRH84SgpwqExtCwMu8V2t5VioXsf2O5H22lMCN67icgR0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=OkdFtsVz; 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="OkdFtsVz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86072C4CEF0; Tue, 30 Sep 2025 15:18:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759245488; bh=eq3U8jUKBhecchcGnxlMSE798oHLegVpq7zLICaEeJk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OkdFtsVzA6m33tdlCHq3+UbTNDM8PJVzWUSSzpDWHcdpDo+I298zPqq+9lZuVNQ4p lTSbI/vSvPVeje/YRis663HD/DfmSnrv0oTFtM9GIm2oSXbLAue3EDHaE54okhvBhL Pb+pCPjgQB6y5shrWD0LbpZZBrafsGoL04ADrIy8= 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.1 08/73] HID: multitouch: support getting the tip state from HID_DG_TOUCH fields in Apple Touch Bar Date: Tue, 30 Sep 2025 16:47:12 +0200 Message-ID: <20250930143820.906178993@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250930143820.537407601@linuxfoundation.org> References: <20250930143820.537407601@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-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