From patchwork Mon Mar 8 17:42:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?0L3QsNCx?= X-Patchwork-Id: 12123089 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DAD1C43333 for ; Mon, 8 Mar 2021 17:42:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 79FDE652AE for ; Mon, 8 Mar 2021 17:42:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230250AbhCHRmR (ORCPT ); Mon, 8 Mar 2021 12:42:17 -0500 Received: from [139.28.40.42] ([139.28.40.42]:54276 "EHLO tarta.nabijaczleweli.xyz" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S230050AbhCHRmP (ORCPT ); Mon, 8 Mar 2021 12:42:15 -0500 Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 5F75C360009; Mon, 8 Mar 2021 18:42:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=nabijaczleweli.xyz; s=202006; t=1615225334; bh=BYaCJkUhOQoa5P9mbJc0BTz9QByHDKu5+BcbBE3FaPk=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=P6DptIHR+1gLikE+wsuxmKyIwCg+FhMgWgKfcv5jdmRH8XRFd9aKffS8xEygcqYtT Vc28+aZrHepEg9lFeXk/xy5GVj7EtR0DZ3Vz+neOZB57iEsknpXaR3zNWr/EgxiyO7 IpzoiTuUBnm/Y0pH0kV4xRh24t5GbX9S61lzh2X+IIoyioTG+MoKGF/nKT8MQ94ju/ 9fcLO2/BU9efkfCe8yJV3pAq1KfAJ0ZaEgvkOhpwaX2WBLwkm/h8DC0RIYDtGvztQH E7jIdJN5EjDZYjQH8ZZz31HyTk/nk//D033PcLHevFWyW40raLvEpfgdVYeIJFOcRY Pew0GQeju0knQ== Date: Mon, 8 Mar 2021 18:42:13 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= Cc: Benjamin Tissoires , Peter Hutterer , Jiri Kosina , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/4] HID: input: replace outdated HID numbers+comments with macros Message-ID: <78bb4e254edc8a7c99b5e9991e84145dbe7407fb.1615224800.git.nabijaczleweli@nabijaczleweli.xyz> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20210205 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org These were untouched since 2.3.99-pre3, and the explanatory comment for HID_DG_TIPPRESSURE is TipPressure in other places Signed-off-by: Ahelenia ZiemiaƄska --- drivers/hid/hid-input.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index f23027d2795b..a5ba92978473 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -1301,12 +1301,12 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct return; } - if (usage->hid == (HID_UP_DIGITIZER | 0x003c)) { /* Invert */ + if (usage->hid == HID_DG_INVERT) { *quirks = value ? (*quirks | HID_QUIRK_INVERT) : (*quirks & ~HID_QUIRK_INVERT); return; } - if (usage->hid == (HID_UP_DIGITIZER | 0x0032)) { /* InRange */ + if (usage->hid == HID_DG_INRANGE) { if (value) { input_event(input, usage->type, (*quirks & HID_QUIRK_INVERT) ? BTN_TOOL_RUBBER : usage->code, 1); return; @@ -1316,7 +1316,7 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct return; } - if (usage->hid == (HID_UP_DIGITIZER | 0x0030) && (*quirks & HID_QUIRK_NOTOUCH)) { /* Pressure */ + if (usage->hid == HID_DG_TIPPRESSURE && (*quirks & HID_QUIRK_NOTOUCH)) { int a = field->logical_minimum; int b = field->logical_maximum; input_event(input, EV_KEY, BTN_TOUCH, value > a + ((b - a) >> 3));