Skip to content

Commit 733a892

Browse files
soyersoyerdtor
authored andcommitted
Input: add ABS_SND_PROFILE
ABS_SND_PROFILE used to describe the state of a multi-value sound profile switch. This will be used for the alert-slider on OnePlus phones or other phones. Profile values added as SND_PROFLE_(SILENT|VIBRATE|RING) identifiers to input-event-codes.h so they can be used from DTS. Signed-off-by: Gergo Koteles <soyer@irl.hu> Reviewed-by: Bjorn Andersson <andersson@kernel.org> Tested-by: Guido Günther <agx@sigxcpu.org> # oneplus,fajita & oneplus,enchilada Reviewed-by: Guido Günther <agx@sigxcpu.org> Signed-off-by: David Heidelberg <david@ixit.cz> Reviewed-by: Pavel Machek <pavel@ucw.cz> Link: https://patch.msgid.link/20251113-op6-tri-state-v8-1-54073f3874bc@ixit.cz Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent d579478 commit 733a892

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

Documentation/input/event-codes.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,12 @@ A few EV_ABS codes have special meanings:
241241
emitted only when the selected profile changes, indicating the newly
242242
selected profile value.
243243

244+
* ABS_SND_PROFILE:
245+
246+
- Used to describe the state of a multi-value sound profile switch.
247+
An event is emitted only when the selected profile changes,
248+
indicating the newly selected profile value.
249+
244250
* ABS_MT_<name>:
245251

246252
- Used to describe multitouch input events. Please see

drivers/hid/hid-debug.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3513,6 +3513,7 @@ static const char *absolutes[ABS_CNT] = {
35133513
[ABS_DISTANCE] = "Distance", [ABS_TILT_X] = "XTilt",
35143514
[ABS_TILT_Y] = "YTilt", [ABS_TOOL_WIDTH] = "ToolWidth",
35153515
[ABS_VOLUME] = "Volume", [ABS_PROFILE] = "Profile",
3516+
[ABS_SND_PROFILE] = "SoundProfile",
35163517
[ABS_MISC] = "Misc",
35173518
[ABS_MT_SLOT] = "MTSlot",
35183519
[ABS_MT_TOUCH_MAJOR] = "MTMajor",

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,7 @@
891891

892892
#define ABS_VOLUME 0x20
893893
#define ABS_PROFILE 0x21
894+
#define ABS_SND_PROFILE 0x22
894895

895896
#define ABS_MISC 0x28
896897

@@ -1000,4 +1001,12 @@
10001001
#define SND_MAX 0x07
10011002
#define SND_CNT (SND_MAX+1)
10021003

1004+
/*
1005+
* ABS_SND_PROFILE values
1006+
*/
1007+
1008+
#define SND_PROFILE_SILENT 0x00
1009+
#define SND_PROFILE_VIBRATE 0x01
1010+
#define SND_PROFILE_RING 0x02
1011+
10031012
#endif

0 commit comments

Comments
 (0)