From patchwork Fri Nov 30 06:46:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Chiu X-Patchwork-Id: 10705769 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F29921057 for ; Fri, 30 Nov 2018 06:46:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E426D2F54D for ; Fri, 30 Nov 2018 06:46:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D81EC2F624; Fri, 30 Nov 2018 06:46:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 603DC2F54D for ; Fri, 30 Nov 2018 06:46:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726386AbeK3Ry4 (ORCPT ); Fri, 30 Nov 2018 12:54:56 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:38996 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726545AbeK3Ryz (ORCPT ); Fri, 30 Nov 2018 12:54:55 -0500 Received: by mail-pf1-f193.google.com with SMTP id c72so2308320pfc.6 for ; Thu, 29 Nov 2018 22:46:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=endlessm-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=G1/NvKYWaeZu0h9wMdNm03wH2eQ+T8ZxVLtW8EssGt4=; b=Gim6DL1Isbmyz5t6h8Q4iGA7/hVPjUdJtASvQDtxtaSbydO+FN44atEs0Xs0qN6Vok CgS+KzcP5QcpTlmD+0zxAywJSu/wSjCZVHELqSuFsuOljZTNxrId+51e6Jve9vtsFfy/ z5u5K+I/OAO6nloONnMn5PCDMPwE7kQZOzIirMLEF/nATORP+0iJYZnQy6wtQQsDmcNT cdQe9LXIEBNaGcVx+swYj0mn+wzVKRH27712QMYT/Q4167PvQdmFKBAB6kNg1GGPEez3 S3bGxbSB3uWNZmgnfC0O0GjOz4a3t9GnUxxhunPWrt6zhHczDZiA5R3fYYOMFGSx2jX+ GTTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=G1/NvKYWaeZu0h9wMdNm03wH2eQ+T8ZxVLtW8EssGt4=; b=sDks4sfA3eiJij2Q+ygjnt26ALZxRYFXMw2vv8GwN/e7YSiW4UCMlwpjLHpX6TlI2Z 6QXhRKohObnLWEzCuJoCBUEpXh2Z39EfRJsfRcOHITv1NXvoxUDtVF/snb3WcF9n8euZ l8VS6qsXkuuCVaOsVv/b1SckZE9+CaIQm0UZqe/ONIQjKNGyJLIYOMF/XyZZuvAM2k2+ kTPa/D6QdqtZVOE283yMzdKj3s1gTVVjPX/B2yhKdMMZM8gIHTGjNMa2RUDUfqRmcptS /9fpXdwkDLE65L2x6fj+WGkHz0NsL8+xwUVYKD0rwsEfDdPokiAKGl6OGwDQUjGBFPsG FBrA== X-Gm-Message-State: AA+aEWaLtdSoQ0wEXfLhS1/GGgIHmgKysjj13wgEEDDfyqEzfzNET2vI 4UGztrm6y71VDK0UGF2miku3GQ== X-Google-Smtp-Source: AFSGD/WP9gM0w31XtDMzKNHyqV0u2U/l8J9Zyy3t/KXWkV45tX+zYpRcQvT2EXbGidfjG44t9S5TOg== X-Received: by 2002:a63:4566:: with SMTP id u38mr3860937pgk.4.1543560398953; Thu, 29 Nov 2018 22:46:38 -0800 (PST) Received: from localhost.localdomain (125-227-158-176.HINET-IP.hinet.net. [125.227.158.176]) by smtp.gmail.com with ESMTPSA id c65sm9937251pfa.90.2018.11.29.22.46.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Nov 2018 22:46:38 -0800 (PST) From: Chris Chiu To: jikos@kernel.org, benjamin.tissoires@redhat.com, rydberg@bitmath.org Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux@endlessm.com, Chris Chiu Subject: [PATCH] HID: input: support Microsoft wireless radio control hotkey Date: Fri, 30 Nov 2018 14:46:17 +0800 Message-Id: <20181130064617.67920-1-chiu@endlessm.com> X-Mailer: git-send-email 2.17.2 (Apple Git-113) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The ASUS laptops start to support the airplane mode radio management to replace the original machanism of airplane mode toggle hotkey. On the ASUS P5440FF, it presents as a HID device connecting via I2C, name i2c-AMPD0001. When pressing hotkey, the Embedded Controller send hid report up via I2C and switch the airplane mode indicator LED based on the status. However, it's not working because it fails to be identified as a hidinput device. It fails in hidinput_connect() due to the macro IS_INPUT_APPLICATION doesn't identify HID_GD_WIRELESS_RADIO_CTLS as a legit application code. It's easy to add the HID I2C vendor and product id to the quirk list and apply HID_QUIRK_HIDINPUT_FORCE to make it work. But it can be more generic to support such kind of application on PC. Signed-off-by: Chris Chiu --- include/linux/hid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/hid.h b/include/linux/hid.h index d44a78362942..f4805f605fed 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -836,7 +836,7 @@ static inline bool hid_is_using_ll_driver(struct hid_device *hdev, /* Applications from HID Usage Tables 4/8/99 Version 1.1 */ /* We ignore a few input applications that are not widely used */ -#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001) || ((a >= 0x000d0002) && (a <= 0x000d0006))) +#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || || (a == 0x0001000c) || (a == 0x000c0001) || ((a >= 0x000d0002) && (a <= 0x000d0006))) /* HID core API */