[v4,2/5] input: add an EV_REL event for high-res vertical wheel
diff mbox

Message ID 5656f59d7fb0590dd139c5e6b597bd56e823bd94.1491917052.git.mchehab@s-opensource.com
State New, archived
Headers show

Commit Message

Mauro Carvalho Chehab April 11, 2017, 1:29 p.m. UTC
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 <mchehab@s-opensource.com>
---
 Documentation/input/event-codes.txt    | 17 ++++++++++++++---
 include/uapi/linux/input-event-codes.h |  1 +
 2 files changed, 15 insertions(+), 3 deletions(-)

Patch
diff mbox

diff --git a/Documentation/input/event-codes.txt b/Documentation/input/event-codes.txt
index 575415f4cef0..50352ab5f6d4 100644
--- a/Documentation/input/event-codes.txt
+++ b/Documentation/input/event-codes.txt
@@ -156,9 +156,20 @@  instead of EV_REL codes.
 
 A few EV_REL codes have special meanings:
 
-* REL_WHEEL, REL_HWHEEL:
-  - These codes are used for vertical and horizontal scroll wheels,
-    respectively.
+* REL_WHEEL:
+
+  - 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 444956ba832c..da48d4079511 100644
--- a/include/uapi/linux/input-event-codes.h
+++ b/include/uapi/linux/input-event-codes.h
@@ -710,6 +710,7 @@ 
 #define REL_MISC_4		0x0d
 #define REL_MISC_5		0x0e
 #define REL_MISC_6		0x0f
+#define REL_HIRES_WHEEL		0x10
 #define REL_MAX			0x1f
 #define REL_CNT			(REL_MAX+1)