From patchwork Fri Apr 7 11:31:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 9669339 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 86F9D602B3 for ; Fri, 7 Apr 2017 11:32:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78A3320373 for ; Fri, 7 Apr 2017 11:32:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6CCC7280DE; Fri, 7 Apr 2017 11:32:00 +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=-6.9 required=2.0 tests=BAYES_00,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 EB90420373 for ; Fri, 7 Apr 2017 11:31:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932598AbdDGLb6 (ORCPT ); Fri, 7 Apr 2017 07:31:58 -0400 Received: from ec2-52-27-115-49.us-west-2.compute.amazonaws.com ([52.27.115.49]:48280 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933425AbdDGLbv (ORCPT ); Fri, 7 Apr 2017 07:31:51 -0400 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id ACF3CA05F5; Fri, 7 Apr 2017 11:32:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osg.samsung.com X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from osg.samsung.com ([127.0.0.1]) by localhost (s-opensource.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OBfwz7_tQEpi; Fri, 7 Apr 2017 11:32:15 +0000 (UTC) Received: from smtp.s-opensource.com (unknown [177.133.62.101]) by osg.samsung.com (Postfix) with ESMTPSA id 27043A05F2; Fri, 7 Apr 2017 11:32:14 +0000 (UTC) Received: from mchehab by smtp.s-opensource.com with local (Exim 4.87) (envelope-from ) id 1cwS70-00013q-25; Fri, 07 Apr 2017 08:31:30 -0300 From: Mauro Carvalho Chehab To: linux-input@vger.kernel.org, Dmitry Torokhov Cc: Mauro Carvalho Chehab , Jonathan Corbet , Peter Hutterer , Hans Verkuil , Ping Cheng , Kamil Debski , Douglas Anderson , linux-doc@vger.kernel.org Subject: [PATCH v3 1/4] input: add an EV_REL event for high-res vertical wheel Date: Fri, 7 Apr 2017 08:31:24 -0300 Message-Id: X-Mailer: git-send-email 2.9.3 In-Reply-To: References: In-Reply-To: References: 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 As some devices can produce either low-res or high-res vertical wheel EV_REL events, add a new event to allow userspace to distinguish between them. Signed-off-by: Mauro Carvalho Chehab --- Documentation/input/event-codes.rst | 16 +++++++++++++--- include/uapi/linux/input-event-codes.h | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Documentation/input/event-codes.rst b/Documentation/input/event-codes.rst index 92db50954169..0c8591d39bc6 100644 --- a/Documentation/input/event-codes.rst +++ b/Documentation/input/event-codes.rst @@ -185,10 +185,20 @@ instead of EV_REL codes. A few EV_REL codes have special meanings: -* REL_WHEEL, REL_HWHEEL: +* REL_WHEEL: - - These codes are used for vertical and horizontal scroll wheels, - respectively. + - These codes are used for vertical scroll wheels. + + - REL_WHEEL is for normal wheel operational mode, e. g. low-resolution + (line-based) scroll. + + - REL_HIRES_WHEEL should be used when the wheel has two resolutions and it + is in high-resolution mode, e. g. the same angular movement that would + produce a single REL_WHEEL will produce multiple REL_HIRES_WHEEL events. + +* REL_HWHEEL: + + - This code is used for horizontal scroll wheels. EV_ABS ------ diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h index 3af60ee69053..23b2d377af59 100644 --- a/include/uapi/linux/input-event-codes.h +++ b/include/uapi/linux/input-event-codes.h @@ -703,6 +703,7 @@ #define REL_DIAL 0x07 #define REL_WHEEL 0x08 #define REL_MISC 0x09 +#define REL_HIRES_WHEEL 0x0a #define REL_MAX 0x0f #define REL_CNT (REL_MAX+1)