Skip to content

Commit 1260cd0

Browse files
nate-yocomdtor
authored andcommitted
Input: add ABS_PROFILE to uapi and documentation
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>
1 parent f45aaae commit 1260cd0

4 files changed

Lines changed: 15 additions & 1 deletion

File tree

Documentation/input/event-codes.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,12 @@ A few EV_ABS codes have special meanings:
235235
BTN_TOOL_<name> signals the type of tool that is currently detected by the
236236
hardware and is otherwise independent of ABS_DISTANCE and/or BTN_TOUCH.
237237

238+
* ABS_PROFILE:
239+
240+
- Used to describe the state of a multi-value profile switch. An event is
241+
emitted only when the selected profile changes, indicating the newly
242+
selected profile value.
243+
238244
* ABS_MT_<name>:
239245

240246
- Used to describe multitouch input events. Please see

Documentation/input/gamepad.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,3 +189,9 @@ Gamepads report the following events:
189189
- Rumble:
190190

191191
Rumble is advertised as FF_RUMBLE.
192+
193+
- Profile:
194+
195+
Some pads provide a multi-value profile selection switch. An example is the
196+
XBox Adaptive and the XBox Elite 2 controllers. When the active profile is
197+
switched, its newly selected value is emitted as an ABS_PROFILE event.

drivers/hid/hid-debug.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,8 @@ static const char *absolutes[ABS_CNT] = {
10141014
[ABS_HAT3Y] = "Hat 3Y", [ABS_PRESSURE] = "Pressure",
10151015
[ABS_DISTANCE] = "Distance", [ABS_TILT_X] = "XTilt",
10161016
[ABS_TILT_Y] = "YTilt", [ABS_TOOL_WIDTH] = "ToolWidth",
1017-
[ABS_VOLUME] = "Volume", [ABS_MISC] = "Misc",
1017+
[ABS_VOLUME] = "Volume", [ABS_PROFILE] = "Profile",
1018+
[ABS_MISC] = "Misc",
10181019
[ABS_MT_TOUCH_MAJOR] = "MTMajor",
10191020
[ABS_MT_TOUCH_MINOR] = "MTMinor",
10201021
[ABS_MT_WIDTH_MAJOR] = "MTMajorW",

include/uapi/linux/input-event-codes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,7 @@
862862
#define ABS_TOOL_WIDTH 0x1c
863863

864864
#define ABS_VOLUME 0x20
865+
#define ABS_PROFILE 0x21
865866

866867
#define ABS_MISC 0x28
867868

0 commit comments

Comments
 (0)