From patchwork Wed Feb 17 17:22:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ahelenia_Ziemia=C5=84ska?= X-Patchwork-Id: 384115 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, USER_AGENT_SANE_1 autolearn=ham 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 78865C4332E for ; Wed, 17 Feb 2021 17:33:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 51C8664DCF for ; Wed, 17 Feb 2021 17:33:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234467AbhBQRdD (ORCPT ); Wed, 17 Feb 2021 12:33:03 -0500 Received: from [139.28.40.42] ([139.28.40.42]:46860 "EHLO tarta.nabijaczleweli.xyz" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S234397AbhBQRcs (ORCPT ); Wed, 17 Feb 2021 12:32:48 -0500 Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 4CB7136015E; Wed, 17 Feb 2021 18:22:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=nabijaczleweli.xyz; s=202006; t=1613582564; bh=dwHu+sdeHIKyUfCS/scRSx02f3iaHYUimdvjlNSpccM=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=evr3z80W83GUYD2f9mLHoZBgTi/kkMo+NJwI8ez2dQGpQKCU3HtMoqicGg4LTtKSx I/Fk42oy7dQI1vj9B0tXm93jZmRwhkLO40gfzT4Nbxeq+sulKoPtFzlb2g71HsXcZc jEoj5QNgbDRRyDUNpIdpEBTtWiOSLU+NlYPUYrXM8gxP9bQNSAhtcdkG6uorKkO8hX 9BgGJ3NBrYZJTbK7CkgSZVxKl0jK0/tdExCMzTAD2CPjRl15Snoy+sLnO8XFxfRClV jKWswq5f2iVR2EW73Sf9UH6bT+NXrYrYvIz9LQ3N+Pv8zhh4cSzRTVXv/qDXmWwjyK N6eXk54ZiahWw== Date: Wed, 17 Feb 2021 18:22:43 +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 3/4] HID: input: replace outdated HID numbers+comments with macros Message-ID: <394d6b11ae029c64a0bb44a00bef902069087d03.1613582014.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 on 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));