From patchwork Mon Dec 3 06:46:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Chiu X-Patchwork-Id: 10708669 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 5A5E6109C for ; Mon, 3 Dec 2018 06:46:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49DD229B45 for ; Mon, 3 Dec 2018 06:46:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A5792AC62; Mon, 3 Dec 2018 06:46:31 +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 A19FA29B45 for ; Mon, 3 Dec 2018 06:46:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725916AbeLCGq3 (ORCPT ); Mon, 3 Dec 2018 01:46:29 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:45932 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725830AbeLCGq3 (ORCPT ); Mon, 3 Dec 2018 01:46:29 -0500 Received: by mail-pl1-f196.google.com with SMTP id a14so5938319plm.12 for ; Sun, 02 Dec 2018 22:46:27 -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=NzrGkHPfMw5PpRz7JX5QXHjmYPGlb8Ry+SBoB6V49Io=; b=s4lueP4Xt7kL0VZh1u9KdXTuMLDIPsNFuuRkiQYz7bXfxUALSuUYiGL3kjKpcz8sRH gfR7dizrzh5ExJ7nwmrd+24yt5SsEKGjX/LCelaie3i2Mg8/5SFuDMGCPDAL+1IZDUFI k+CHVv2Bb+QV6G6K21N4OotDq3USPmsYMtuuMfYjrR2OwTh7nMcSivZ8GvH1xTEqkn/n vLN77UZjSFghiHWblrWuxkGBb3JJkXPKpEBxserWOO5PM738yT7LPjsL1qEj7o5VACNA jj98Q1KAmVvIcotQL+yYqIu/unf6+bMQnOKgnnc8V0UBh/XcAGUSGHAgfoRc/bkEyp8a 0mUw== 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=NzrGkHPfMw5PpRz7JX5QXHjmYPGlb8Ry+SBoB6V49Io=; b=LPIw49x7edd03kjkd4agOOfrXMfEH5W2lH2K4YmGq/baJGBItx4OgWXTYy68Qsg77x q8S8COH1RkxqTT188bj4jHnfIgaymKaRSOac8yMfvbM6PtCX3ieR2VfJxgMABsxm9Cux 8ZlaLCtA5F2gAlqU2pi7Z9l4X6PqMhcH4Hyn1hYQlbLkSwUKjWbA50Hjnn8ntlr5Zo3x 4roNxaJNpOWcqTnLO3x5ToWr3i5IQzJN+7KCiGl8KAq1cG2niDOMFTR8Zy7uH6xRcg8z ei5Qyp+ZilaQLedJmljUgzHjqvdoQu/1456bOCzxm9UVFgMtnjDAwXEqPuoztUNFZ5ND 57Uw== X-Gm-Message-State: AA+aEWbo9v7d5SbCRj6yk0j4HO9BZ6bK8a1Rxn4LhxLygqzxsbcj+8sL LLMFLQZS5DCAIjSw5oKDnsYXdA== X-Google-Smtp-Source: AFSGD/WoDaFCDw3AFwYAPtqQi4WV1jGAHocJGNRVPpMvxEFKZdjU5cjcr3pOuFJw/1vhHFuBRHlvGg== X-Received: by 2002:a17:902:a58a:: with SMTP id az10mr15260269plb.151.1543819587140; Sun, 02 Dec 2018 22:46:27 -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.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 02 Dec 2018 22:46:26 -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 1/2] HID: use macros in IS_INPUT_APPLICATION Date: Mon, 3 Dec 2018 14:46:20 +0800 Message-Id: <20181203064621.69876-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 Add missing definition for HID_DG_WHITEBOARD then replace the hid usage hex with macros for better readibility. Signed-off-by: Chris Chiu --- include/linux/hid.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/linux/hid.h b/include/linux/hid.h index a355d61940f2..ce5f996c8d3d 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -238,6 +238,7 @@ struct hid_item { #define HID_DG_LIGHTPEN 0x000d0003 #define HID_DG_TOUCHSCREEN 0x000d0004 #define HID_DG_TOUCHPAD 0x000d0005 +#define HID_DG_WHITEBOARD 0x000d0006 #define HID_DG_STYLUS 0x000d0020 #define HID_DG_PUCK 0x000d0021 #define HID_DG_FINGER 0x000d0022 @@ -836,7 +837,10 @@ 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 >= 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)) /* HID core API */