]> git.baikalelectronics.ru Git - kernel.git/commitdiff
Input: add ABS_PROFILE to uapi and documentation
authorNate Yocom <nate@yocom.org>
Thu, 29 Sep 2022 01:23:22 +0000 (18:23 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 29 Sep 2022 01:31:37 +0000 (18:31 -0700)
Define new ABS_PROFILE axis for input devices which need it, e.g. X-Box
Adaptive Controller and X-Box Elite 2.

Signed-off-by: Nate Yocom <nate@yocom.org>
Link: https://lore.kernel.org/r/20220908173930.28940-4-nate@yocom.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Documentation/input/event-codes.rst
Documentation/input/gamepad.rst
drivers/hid/hid-debug.c
include/uapi/linux/input-event-codes.h

index 8741d390b1843b92070f8e2f918760fd102a4b79..b4557462edd7b3fef9e9cd6c2c3cb2d05bb531ab 100644 (file)
@@ -235,6 +235,12 @@ A few EV_ABS codes have special meanings:
     BTN_TOOL_<name> signals the type of tool that is currently detected by the
     hardware and is otherwise independent of ABS_DISTANCE and/or BTN_TOUCH.
 
+* ABS_PROFILE:
+
+  - Used to describe the state of a multi-value profile switch.  An event is
+    emitted only when the selected profile changes, indicating the newly
+    selected profile value.
+
 * ABS_MT_<name>:
 
   - Used to describe multitouch input events. Please see
index 4d5e7fb80a8456599608817dc8ca00478e2ee1be..71019de4603679ea618dff92b0ee692121145963 100644 (file)
@@ -189,3 +189,9 @@ Gamepads report the following events:
 - Rumble:
 
   Rumble is advertised as FF_RUMBLE.
+
+- Profile:
+
+  Some pads provide a multi-value profile selection switch.  An example is the
+  XBox Adaptive and the XBox Elite 2 controllers.  When the active profile is
+  switched, its newly selected value is emitted as an ABS_PROFILE event.
index 81e7e404a5fce7bc0cf5d779b657475f8862f1f9..2ca6ab600bc9f24c8b6778470f571fddd92ce826 100644 (file)
@@ -1014,7 +1014,8 @@ static const char *absolutes[ABS_CNT] = {
        [ABS_HAT3Y] = "Hat 3Y",         [ABS_PRESSURE] = "Pressure",
        [ABS_DISTANCE] = "Distance",    [ABS_TILT_X] = "XTilt",
        [ABS_TILT_Y] = "YTilt",         [ABS_TOOL_WIDTH] = "ToolWidth",
-       [ABS_VOLUME] = "Volume",        [ABS_MISC] = "Misc",
+       [ABS_VOLUME] = "Volume",        [ABS_PROFILE] = "Profile",
+       [ABS_MISC] = "Misc",
        [ABS_MT_TOUCH_MAJOR] = "MTMajor",
        [ABS_MT_TOUCH_MINOR] = "MTMinor",
        [ABS_MT_WIDTH_MAJOR] = "MTMajorW",
index dff8e7f17074851211eba754d7eeb19da806931b..7ad931a329706c7253914b9a04fa5902c3d8b194 100644 (file)
 #define ABS_TOOL_WIDTH         0x1c
 
 #define ABS_VOLUME             0x20
+#define ABS_PROFILE            0x21
 
 #define ABS_MISC               0x28