From patchwork Mon Dec 3 06:46:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Chiu X-Patchwork-Id: 10708671 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 0C5B5109C for ; Mon, 3 Dec 2018 06:46:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F03F729B45 for ; Mon, 3 Dec 2018 06:46:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E49572AC62; Mon, 3 Dec 2018 06:46:37 +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 6B02D2AC61 for ; Mon, 3 Dec 2018 06:46:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725921AbeLCGqc (ORCPT ); Mon, 3 Dec 2018 01:46:32 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:44845 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725920AbeLCGqc (ORCPT ); Mon, 3 Dec 2018 01:46:32 -0500 Received: by mail-pl1-f196.google.com with SMTP id k8so5935811pls.11 for ; Sun, 02 Dec 2018 22:46:30 -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:in-reply-to:references; bh=DMiwCO/LzfHiirOee4XUq+AAox1MmJBmWKL+nCVtjmI=; b=f+83RxbM0ThG0q7TaJrDNwESeRo6qO8ridfKR4zUTCNQCUGzAjelvOdunwO0nhJf3S DI7UkAd/A77gYjZXkbRE0kKvKi6O5pxSBexuA/fCJKnjv/DKgnd/QE6k6aVRWQkrrBlt snbX7zR5BJFL3m4BjiKKL9aB1wG4eulk8oYwK8ua3/z2QYFuBPjbfXbzKahOBNPYkMNC DkSWMwbUJ5L3mpXlX1zcry2ZgQuxw1lHs8/W32I+J44XMcVLQr5QRmIcKDMK1Uvg/AHO pfROP0csoZLJok/a5o3jlMPtLxTb5esGbcCZV7RNMiEz2UWG+/m9l6oa0e/xvkB/1PL1 zMFg== 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:in-reply-to :references; bh=DMiwCO/LzfHiirOee4XUq+AAox1MmJBmWKL+nCVtjmI=; b=Mn8gX/+H/ecN1NTqxWpyRgYLE7RxzdL5nZXN7hPrjYV+scHOdcWe44tfXfW8+TgW6x k4gAupVrvU1qOH7Kl2tMy5Tm3QkLAfDor4gxO4k/7jOJ+MfimeM7Bv0MrfuRljycSZay lxrRb9XFEToS0Bc8PwCp4KR5+x+1vMI/Gam/G9idGJ6XKDhMnReBAP+lio1ygF5PrE83 E+F23H8YocK+t3n8wrfUuG3smJBQKHgeds9E+Lejku90y97orbaPiebhKcQ/b12eOuBB aqw1HBQVxMczTRiSW6KSima3A9thBArej+BIuEx0sA/3XQzHsk2G4m75pP/fQlE6PX1A co6A== X-Gm-Message-State: AA+aEWZofEb4mxCQDc9T2ZbSTdRX1VvcKxnhfcS/ojGPLpx5DB4NRrga UXzGl15F1RW5bZAbg5Tn8Kglbw== X-Google-Smtp-Source: AFSGD/UEX8a/EB8cPmIRLQEqIxE2U6RCYcPNM3VEsuiFyMV3eAp+wymk0GcIJ8seFydhEtJYx0UAaQ== X-Received: by 2002:a17:902:4:: with SMTP id 4mr14873639pla.20.1543819589669; Sun, 02 Dec 2018 22:46:29 -0800 (PST) Received: from localhost.localdomain (220-133-8-225.HINET-IP.hinet.net. [220.133.8.225]) by smtp.gmail.com with ESMTPSA id v70sm22692874pfa.152.2018.12.02.22.46.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 02 Dec 2018 22:46:28 -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 Subject: [PATCH 2/2] HID: input: support Microsoft wireless radio control hotkey Date: Mon, 3 Dec 2018 14:46:21 +0800 Message-Id: <20181203064621.69876-2-chiu@endlessm.com> X-Mailer: git-send-email 2.17.2 (Apple Git-113) In-Reply-To: <20181203064621.69876-1-chiu@endlessm.com> References: <20181203064621.69876-1-chiu@endlessm.com> 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 mechanism of airplane mode toggle hotkey. On the ASUS P5440FF, it presents as a HID device connecting via I2C, named i2c-AMPD0001. When pressing it, the Embedded Controller send hid report 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 have 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 makes more sense to support it as a generic input application. Signed-off-by: Chris Chiu --- include/linux/hid.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/hid.h b/include/linux/hid.h index ce5f996c8d3d..42079116fb61 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -840,7 +840,8 @@ static inline bool hid_is_using_ll_driver(struct hid_device *hdev, #define IS_INPUT_APPLICATION(a) \ (((a >= HID_UP_GENDESK) && (a <= HID_GD_MULTIAXIS)) \ || ((a >= HID_DG_PEN) && (a <= HID_DG_WHITEBOARD)) \ - || (a == HID_GD_SYSTEM_CONTROL) || (a == HID_CP_CONSUMER_CONTROL)) + || (a == HID_GD_SYSTEM_CONTROL) || (a == HID_CP_CONSUMER_CONTROL) \ + || (a == HID_GD_WIRELESS_RADIO_CTLS)) /* HID core API */