Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3644587ioo; Mon, 30 May 2022 06:42:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbRGAGhAtXKr/zk1/eX7FzPzquq7sAv28qi+0D7N27mA/aCDCOUV4EywspFvYSKHdeE0d5 X-Received: by 2002:a17:90a:3f8c:b0:1df:28c5:e87a with SMTP id m12-20020a17090a3f8c00b001df28c5e87amr23292977pjc.170.1653918165397; Mon, 30 May 2022 06:42:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653918165; cv=none; d=google.com; s=arc-20160816; b=LI2bz+GgGPMe+TGVOOGrA69qCgbhoJY3oGGc+U5xl9MjGCfk1H2vDqy48ZNx0bA4xW FyeEW4GGSRy8XGqI+ya6ZWZy2Y3H7TlU8Odmpdp6kVMg4/I18wMg8rBZVRe+BB4Hk0N4 AMyHjFEyYCgUKm/g14h9YnYksGqw1M6nsRx0/z2v/loZXDkuTZmSHLj75RlwGUIgseiE 06OlQg+knN3p6nCOwUT9mr4jBBSAOMwpHwoDjmxG+N0fc0iJq9jW9cIIcGLBcHWLDosU w2yK4zIcLmBCG6cn1EqZZPw6oX79nhWyvNi4MmSxhH9eSOLL8jZ4pkHFSI9RP94o+9tQ iX0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=lbjr5jPtIZSbFT/L4XEbOX84sdmNhtUofdql/o6UFQ0=; b=aum1JDKLY3VpnYm4a7nc135w8rRLGV1CrZ7L5CIDkhNOxjBdOODDzE0+YXrxqU6I+I jmr13dniwijnikAAgbTZ9jMr0VShcrqoXOBvoKXf2xIH51PKydy1C9qzmrGPH2sOApvy L3T1XdZd/qPhkpYmo2xscWNCZgnD2IbzEMRnrksCCaHLoIGKsCIIVG3WMmbuGQ/dGjSr xZVKezsX4FI9+6aRYkmn/3bmsbeES0d2uylCzC+v0MpSVskFChpPOVyljWl11PyYHS9O k1pEazRGJaq/nmbIilDoXLNGlKtaHRQS6E7Dzh1DmaRLP4qKUmChiEchnH8OTOYnt9Lh achQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ultrarare.space header.s=dkim header.b=E6cE1dB2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=ultrarare.space Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p12-20020a1709028a8c00b00163a8899c9bsi8836582plo.103.2022.05.30.06.42.29; Mon, 30 May 2022 06:42:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ultrarare.space header.s=dkim header.b=E6cE1dB2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=ultrarare.space Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232120AbiE3Bma (ORCPT + 99 others); Sun, 29 May 2022 21:42:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230337AbiE3Bm2 (ORCPT ); Sun, 29 May 2022 21:42:28 -0400 Received: from mail.boiledscript.com (unknown [192.151.158.155]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 961FFD13E; Sun, 29 May 2022 18:42:27 -0700 (PDT) Received: from localhost (unknown [192.168.203.1]) by mail.boiledscript.com (Postfix) with ESMTP id B13113007FD; Mon, 30 May 2022 01:42:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=dkim; t=1653874946; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lbjr5jPtIZSbFT/L4XEbOX84sdmNhtUofdql/o6UFQ0=; b=E6cE1dB2AdRfJGrHJgwwxdTw23Z8WYHbocs68f/xpOncS8ffoXaS/sOd4kn+Fvk0zjqWuK zLqbBS7b+Q3f3tutpBNMbqUg3qvs6Rzyk1bcSj9bxRjTAAzrm+Z3jATaqNh9nVJ4nUpU4u 34BXvpP6Xou+9acQ4tkoLhmySqvodTZkw95QAJakjENkZU3oyutP5Fdyf+NutxTEOCmIHC w8jz7itwL0U5z+syuEy4qY+hudV5LYbpjp8FDsarBoxuCak9FGpBlkLGIWTS4le3YM/9Nr dxNQsgp7BEFILsMkfGd3PVvdWHu5QJkwuX3n0fp+QG44oFsLZnKovzHMYY0eYw== Date: Mon, 30 May 2022 09:42:15 +0800 From: Hilton Chain To: =?UTF-8?B?Sm9zw6kgRXhww7NzaXRv?= Cc: bryancain3@gmail.com, jikos@kernel.org, benjamin.tissoires@redhat.com, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: [PATCH] HID: apple: Properly handle function keys on misset non-apple keyboards Message-ID: <20220530094215.646432cd@ultrarare.space> In-Reply-To: <20220530083752.1973a905@ultrarare.space> References: <20220529180230.17e9a0f9@ultrarare.space> <20220529182036.10226-1-jose.exposito89@gmail.com> <20220530083752.1973a905@ultrarare.space> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spamd-Bar: + Authentication-Results: mail.boiledscript.com; none X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This commit extends fa33382c7f74 ("HID: apple: Properly handle function keys on Keychron keyboards") to support all misset non-apple keyboards. Signed-off-by: Hilton Chain --- drivers/hid/hid-apple.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c index 42a568902f49..3b15753be467 100644 --- a/drivers/hid/hid-apple.c +++ b/drivers/hid/hid-apple.c @@ -36,7 +36,7 @@ #define APPLE_NUMLOCK_EMULATION BIT(8) #define APPLE_RDESC_BATTERY BIT(9) #define APPLE_BACKLIGHT_CTL BIT(10) -#define APPLE_IS_KEYCHRON BIT(11) +#define APPLE_IS_BAD_APPLE BIT(11) #define APPLE_FLAG_FKEY 0x01 @@ -363,7 +363,7 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input, } if (fnmode == 3) { - real_fnmode = (asc->quirks & APPLE_IS_KEYCHRON) ? 2 : 1; + real_fnmode = (asc->quirks & APPLE_IS_BAD_APPLE) ? 2 : 1; } else { real_fnmode = fnmode; } @@ -669,9 +669,9 @@ static int apple_input_configured(struct hid_device *hdev, asc->quirks &= ~APPLE_HAS_FN; } - if (strncmp(hdev->name, "Keychron", 8) == 0) { - hid_info(hdev, "Keychron keyboard detected; function keys will default to fnmode=2 behavior\n"); - asc->quirks |= APPLE_IS_KEYCHRON; + if (strncmp(hdev->name, "Apple", 5)) { + hid_info(hdev, "Non-apple keyboard detected; function keys will default to fnmode=2 behavior\n"); + asc->quirks |= APPLE_IS_BAD_APPLE; } return 0; base-commit: b00ed48bb0a7c295facf9036135a573a5cdbe7de -- 2.36.1