Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp1261608lfc; Wed, 1 Jun 2022 13:26:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtemFyf1Xsryqmi0u9P0HnBz86E3mTPyNc8QkawYUn5v/0R0o5XiaAlUXH4xdb6DdPXOJZ X-Received: by 2002:a63:f955:0:b0:3fc:cf92:cd26 with SMTP id q21-20020a63f955000000b003fccf92cd26mr962713pgk.137.1654115180397; Wed, 01 Jun 2022 13:26:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654115180; cv=none; d=google.com; s=arc-20160816; b=hiJzrTMYvu377NsWbiD+Z5ap7wlDRsGCKF8AogelBQpaWNJo2XQGk/7IXtJqbhq9M5 4gOsiGBXlUVev2dr1xDqMRkYSwRs+LpKPOfSxF/d+u/dMa6McqmS8Wvynk5EZFSSpkVo LjVEH4lD6JlEEtf2SfyRfYjVbCQ4cJecG6ACNyvRQR2alhJywdoIZUSlZYLBc2yNNL1Z kgiZju/FC4MLVp84m9gt93snKaI7HW1T8DkwYRjwWtnvbTnykYiXaBgzNbcvj0yc04K3 lShJ42dF8z0odE3HDeb5tovnbkPVvIe8jfCvHxERzBUY8aCw8oqMTv+sK+IBb7rkFVt7 OeWQ== 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=fbHeenntSSPdq2EgFZACo8JZZW7jBXIXIadxCJAgUrY=; b=pPWCkxbO7gl2pEpxZbxk2TX92Xcfg3SI1Cfq0B6XILzFu5mhrlJZQueSA8rubMpKyv Ug0VWBRVeaYiI8V9G5Sj3m+XGdJWPWCtnKx2RxGmdOykKp0N6cHyns1aSddCIE6+ickm FZIHs2TmwUhnwWbVFNuwuYhn81Ecc0FJfZeMsovG+6zQozqC6ygSn5uOjysHlLWPbMBI OFULnWs+Qlfz85Xh2er2vuJ7akAtxJ4hXxkO+3C6e2c9ETThbnHyp7++Qbcpc/aE6JMc 0Wx8NCpcuoVja2VAQc2mos9WcoXi5LrcsS3qvh+zmuKxPat8FNoLNkl10BGPAi0L7iSK MWYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ultrarare.space header.s=dkim header.b=xuage0qi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id nu10-20020a17090b1b0a00b001e3415b6b1dsi7012888pjb.103.2022.06.01.13.26.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 13:26:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@ultrarare.space header.s=dkim header.b=xuage0qi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=ultrarare.space Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EB7281DBD42; Wed, 1 Jun 2022 12:38:04 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345195AbiEaOLh (ORCPT + 99 others); Tue, 31 May 2022 10:11:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345171AbiEaOLa (ORCPT ); Tue, 31 May 2022 10:11:30 -0400 Received: from mail.boiledscript.com (unknown [192.151.158.155]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31B1367D14; Tue, 31 May 2022 07:11:28 -0700 (PDT) Received: from localhost (unknown [192.168.203.1]) by mail.boiledscript.com (Postfix) with ESMTP id BCA323009A2; Tue, 31 May 2022 14:11:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=dkim; t=1654006279; 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=fbHeenntSSPdq2EgFZACo8JZZW7jBXIXIadxCJAgUrY=; b=xuage0qiYOSk4R/3XKJmjg6hqpwS0qB04L8sTBmZ6FpUbyehtyb98eXDoJzwidrBzGRSUd 5F5e8t2sn7+XI2UmGWvxInQTJF3bBc+ojRXe9vb0tPUmEEfx5E48GLw33ByUbY12OtnrJK 0bpDcWGeBZFXyje2mC3pcwC/tHt+Bmh80x5nSv8XDFsj18OBPcy0X9hGc+XV2qycdkno2c lT1r3yvpoy1nAB5Gluh3A9btWNL2O5q/0+/dvJl6Z7mCnaqhFEgAekxGu6kJU2aUgDRYpE DJjJ6VeUK1WpiS1pIsx6swtoFB/lHN8XpEQsARVUSrS+0FIerquq9XQUf4O5+Q== Date: Tue, 31 May 2022 22:11:02 +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: Re: [PATCH] HID: apple: Reset quirks when Fn key is not found Message-ID: <20220531221102.7bd7da7d@ultrarare.space> In-Reply-To: <20220530061812.GA10391@elementary> References: <20220529180230.17e9a0f9@ultrarare.space> <20220529182036.10226-1-jose.exposito89@gmail.com> <20220530083752.1973a905@ultrarare.space> <20220530061812.GA10391@elementary> 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=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: + Authentication-Results: mail.boiledscript.com; none X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Mon, 30 May 2022 08:18:12 +0200 Jos=C3=A9 Exp=C3=B3sito wrote: > That could be problematic because Apple keyboards can be renamed after > connecting=C2=A0them to a Mac. > > For example, the name of my keyboard is: "Jos=C3=A9 Exp=C3=B3sito=E2=80= =99s Keyboard". Well, editable name. I have a bad feeling about this... > I think it'd be safer to assume that the device is an Apple keyboard > and create exceptions for know non-Apple keyboards because the > majority of the devices handled by this driver are Apple keyboards and > because there is already a config option available (real_fnmode) to fix > the problematic devices in the meanwhile. > > In my opinion, creating a function like "apple_is_non_apple_keyboard" > (or similar) containing all the rules to identify devices from > Keychron, GANSS, etc could do the trick. Something similar to: > > if (apple_is_non_apple_keyboard(hdev)) { > hid_info(hdev, "Non-apple keyboard detected; function keys will= default to fnmode=3D2 behavior\n"); > asc->quirks |=3D APPLE_IS_NON_APPLE; > } Done. However I couldn't figure out corresponding names from other known bug reports, so that the initial array only contains two devices. > Unfortunately, I can't think of a generic way to detect those devices > as they have the same vendor and product as the Apple ones :S T^T Stay boiled, Chain