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 0B9102EF9C2; Thu, 3 Jul 2025 14:51:39 +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=1751554299; cv=none; b=Keah/MO/Y/42Kz0zD+OM3rmqb1TKonjIHkfc3o1x9fKc5HJe0SzL0Yxc/shgR2t7pSZ71PBxkmlAAu+gxY/YcR38yQ3E+49CBosry9ieetbcOEDuLPWNfRIstUtsB8UiaJhfY6LqRhStkxDEa51cyEdN4MQMoYzP7NyODc1nfJk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751554299; c=relaxed/simple; bh=KruklGAiXj+4euSnLrVY5r3Il7NKUU9sqPq9SxJvEuY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MapgP6FNrsfCfrUXydF7wQH/jcPLBYKoAyiupm7lKMOMECbG7xrBEzLKu6Breu33Lh4m8WdsyLtnVeUmjjMND5IJM2Mr3cbczmCZd115CTCwsJftSYocGQ+Uj3jngvCv0gW4fg9PybUlTV29rcSrSkLkPvaOD7DTee009b1ZQzk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=MwFjKUnc; 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="MwFjKUnc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E304C4CEE3; Thu, 3 Jul 2025 14:51:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1751554298; bh=KruklGAiXj+4euSnLrVY5r3Il7NKUU9sqPq9SxJvEuY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MwFjKUncgoqCiiKX/IBnlgQ8tZElJAn/x5PWkXmDf6ZoXn6k5C7Ak1QKqlTalA5s0 nUMo9YUuvVFtMjpaQXVALavhbeMYDKL2NvDgI78Z+ceR7LwX36bQe1BpVu3NQ2IrMy mKZOTh7qXo3txBbI/M6OcpvlkJIceQjzlqRkW1Yo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Iusico Maxim , Jiri Kosina Subject: [PATCH 6.12 142/218] HID: lenovo: Restrict F7/9/11 mode to compact keyboards only Date: Thu, 3 Jul 2025 16:41:30 +0200 Message-ID: <20250703144001.801812016@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250703143955.956569535@linuxfoundation.org> References: <20250703143955.956569535@linuxfoundation.org> User-Agent: quilt/0.68 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.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Iusico Maxim commit 9327e3ee5b077c4ab4495a09b67624f670ed88b6 upstream. Commit 2f2bd7cbd1d1 ("hid: lenovo: Resend all settings on reset_resume for compact keyboards") introduced a regression for ThinkPad TrackPoint Keyboard II by removing the conditional check for enabling F7/9/11 mode needed for compact keyboards only. As a result, the non-compact keyboards can no longer toggle Fn-lock via Fn+Esc, although it can be controlled via sysfs knob that directly sends raw commands. This patch restores the previous conditional check without any additions. Cc: stable@vger.kernel.org Fixes: 2f2bd7cbd1d1 ("hid: lenovo: Resend all settings on reset_resume for compact keyboards") Signed-off-by: Iusico Maxim Signed-off-by: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- drivers/hid/hid-lenovo.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) --- a/drivers/hid/hid-lenovo.c +++ b/drivers/hid/hid-lenovo.c @@ -529,11 +529,14 @@ static void lenovo_features_set_cptkbd(s /* * Tell the keyboard a driver understands it, and turn F7, F9, F11 into - * regular keys + * regular keys (Compact only) */ - ret = lenovo_send_cmd_cptkbd(hdev, 0x01, 0x03); - if (ret) - hid_warn(hdev, "Failed to switch F7/9/11 mode: %d\n", ret); + if (hdev->product == USB_DEVICE_ID_LENOVO_CUSBKBD || + hdev->product == USB_DEVICE_ID_LENOVO_CBTKBD) { + ret = lenovo_send_cmd_cptkbd(hdev, 0x01, 0x03); + if (ret) + hid_warn(hdev, "Failed to switch F7/9/11 mode: %d\n", ret); + } /* Switch middle button to native mode */ ret = lenovo_send_cmd_cptkbd(hdev, 0x09, 0x01);