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 756301C5F26; Wed, 19 Mar 2025 14:37: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=1742395059; cv=none; b=BrtOx1uSKqT+i0xOg0lTVngAMnSHonxp/uVSjxpRP8bK2xYvvA5Xly9hGki5iba+HKQejx7jKz5H4zXMGSn98Mwc9V7rpI/TDjECkOTA/YOuoeQuMSQiH5Fh7bApQCtihhM9g8NJp0kQ8WzGivobBLR1rf7PssigV8Fwj0yGxrk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742395059; c=relaxed/simple; bh=0hCo/093ZbQXNkS+pl6Hqb6/dKgfD90o//H6h31A250=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FMHtZqOOoeLoUaWlz2tC8ItkDClLn/sa4QhGZ3aD3MRQ7RvjeVumOlVdaadSAFfxnQKmf1iIs/QwU98s4CwJvYVNLcX14AqLPw6UK9o8G7i8vydQGtkNc7r2JbWs9Sbgck29Hc1Taz6CgmpQFxdsRr7FI85wJ5ZWxbT0oHM6+E8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=TvSMitmi; 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="TvSMitmi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 473F5C4CEE4; Wed, 19 Mar 2025 14:37:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1742395059; bh=0hCo/093ZbQXNkS+pl6Hqb6/dKgfD90o//H6h31A250=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TvSMitmiXNfU//79No+E9RDlCcTj77DR9+Q2OGuLGtYs9itrYYRR2zo6w7+zc1d8+ xqPGWPlD75pZhGYkuGkiId1y9wPbKkTzTr8lN9KyBYWTVmtWrIgOtAP0qjrJQy9JUN 30VxctZ4S6J7CwXeeWO+jGAln9qFd0o9DWLLS77g= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Alex Henrie , Jiri Kosina , Sasha Levin Subject: [PATCH 6.12 084/231] HID: apple: fix up the F6 key on the Omoton KB066 keyboard Date: Wed, 19 Mar 2025 07:29:37 -0700 Message-ID: <20250319143028.913498008@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250319143026.865956961@linuxfoundation.org> References: <20250319143026.865956961@linuxfoundation.org> User-Agent: quilt/0.68 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.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alex Henrie [ Upstream commit 819083cb6eedcc8495cbf84845877bcc741b93b3 ] The Omoton KB066 is an Apple A1255 keyboard clone (HID product code 05ac:022c). On both keyboards, the F6 key becomes Num Lock when the Fn key is held. But unlike its Apple exemplar, when the Omoton's F6 key is pressed without Fn, it sends the usage code 0xC0301 from the reserved section of the consumer page instead of the standard F6 usage code 0x7003F from the keyboard page. The nonstandard code is translated to KEY_UNKNOWN and becomes useless on Linux. The Omoton KB066 is a pretty popular keyboard, judging from its 29,058 reviews on Amazon at time of writing, so let's account for its quirk to make it more usable. By the way, it would be nice if we could automatically set fnmode to 0 for Omoton keyboards because they handle the Fn key internally and the kernel's Fn key handling creates undesirable side effects such as making F1 and F2 always Brightness Up and Brightness Down in fnmode=1 (the default) or always F1 and F2 in fnmode=2. Unfortunately I don't think there's a way to identify Bluetooth keyboards more specifically than the HID product code which is obviously inaccurate. Users of Omoton keyboards will just have to set fnmode to 0 manually to get full Fn key functionality. Signed-off-by: Alex Henrie Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/hid-apple.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c index 3c3f67d0bfcfe..49812a76b7edd 100644 --- a/drivers/hid/hid-apple.c +++ b/drivers/hid/hid-apple.c @@ -546,6 +546,9 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input, } } + if (usage->hid == 0xc0301) /* Omoton KB066 quirk */ + code = KEY_F6; + if (usage->code != code) { input_event_with_scancode(input, usage->type, code, usage->hid, value); -- 2.39.5