Skip to content

Commit 4f67c41

Browse files
endriftdtor
authored andcommitted
HID: hid-steam: Use new BTN_GRIP* buttons
Make use of the newly defined BTN_GRIP* codes instead of using BTN_TRIGGER_HAPPY* and other less suited button codes. Signed-off-by: Vicki Pfau <[email protected]> Acked-by: Jiri Kosina <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 89c5214 commit 4f67c41

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

drivers/hid/hid-steam.c

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -755,15 +755,12 @@ static int steam_input_register(struct steam_device *steam)
755755
input_set_capability(input, EV_KEY, BTN_THUMBL);
756756
input_set_capability(input, EV_KEY, BTN_THUMB);
757757
input_set_capability(input, EV_KEY, BTN_THUMB2);
758+
input_set_capability(input, EV_KEY, BTN_GRIPL);
759+
input_set_capability(input, EV_KEY, BTN_GRIPR);
758760
if (steam->quirks & STEAM_QUIRK_DECK) {
759761
input_set_capability(input, EV_KEY, BTN_BASE);
760-
input_set_capability(input, EV_KEY, BTN_TRIGGER_HAPPY1);
761-
input_set_capability(input, EV_KEY, BTN_TRIGGER_HAPPY2);
762-
input_set_capability(input, EV_KEY, BTN_TRIGGER_HAPPY3);
763-
input_set_capability(input, EV_KEY, BTN_TRIGGER_HAPPY4);
764-
} else {
765-
input_set_capability(input, EV_KEY, BTN_GEAR_DOWN);
766-
input_set_capability(input, EV_KEY, BTN_GEAR_UP);
762+
input_set_capability(input, EV_KEY, BTN_GRIPL2);
763+
input_set_capability(input, EV_KEY, BTN_GRIPR2);
767764
}
768765

769766
input_set_abs_params(input, ABS_X, -32767, 32767, 0, 0);
@@ -1419,8 +1416,8 @@ static inline s16 steam_le16(u8 *data)
14191416
* 9.4 | BTN_SELECT | menu left
14201417
* 9.5 | BTN_MODE | steam logo
14211418
* 9.6 | BTN_START | menu right
1422-
* 9.7 | BTN_GEAR_DOWN | left back lever
1423-
* 10.0 | BTN_GEAR_UP | right back lever
1419+
* 9.7 | BTN_GRIPL | left back lever
1420+
* 10.0 | BTN_GRIPR | right back lever
14241421
* 10.1 | -- | left-pad clicked
14251422
* 10.2 | BTN_THUMBR | right-pad clicked
14261423
* 10.3 | BTN_THUMB | left-pad touched (but see explanation below)
@@ -1485,8 +1482,8 @@ static void steam_do_input_event(struct steam_device *steam,
14851482
input_event(input, EV_KEY, BTN_SELECT, !!(b9 & BIT(4)));
14861483
input_event(input, EV_KEY, BTN_MODE, !!(b9 & BIT(5)));
14871484
input_event(input, EV_KEY, BTN_START, !!(b9 & BIT(6)));
1488-
input_event(input, EV_KEY, BTN_GEAR_DOWN, !!(b9 & BIT(7)));
1489-
input_event(input, EV_KEY, BTN_GEAR_UP, !!(b10 & BIT(0)));
1485+
input_event(input, EV_KEY, BTN_GRIPL, !!(b9 & BIT(7)));
1486+
input_event(input, EV_KEY, BTN_GRIPR, !!(b10 & BIT(0)));
14901487
input_event(input, EV_KEY, BTN_THUMBR, !!(b10 & BIT(2)));
14911488
input_event(input, EV_KEY, BTN_THUMBL, !!(b10 & BIT(6)));
14921489
input_event(input, EV_KEY, BTN_THUMB, lpad_touched || lpad_and_joy);
@@ -1547,8 +1544,8 @@ static void steam_do_input_event(struct steam_device *steam,
15471544
* 9.4 | BTN_SELECT | menu left
15481545
* 9.5 | BTN_MODE | steam logo
15491546
* 9.6 | BTN_START | menu right
1550-
* 9.7 | BTN_TRIGGER_HAPPY3 | left bottom grip button
1551-
* 10.0 | BTN_TRIGGER_HAPPY4 | right bottom grip button
1547+
* 9.7 | BTN_GRIPL2 | left bottom grip button
1548+
* 10.0 | BTN_GRIPR2 | right bottom grip button
15521549
* 10.1 | BTN_THUMB | left pad pressed
15531550
* 10.2 | BTN_THUMB2 | right pad pressed
15541551
* 10.3 | -- | left pad touched
@@ -1573,8 +1570,8 @@ static void steam_do_input_event(struct steam_device *steam,
15731570
* 12.6 | -- | unknown
15741571
* 12.7 | -- | unknown
15751572
* 13.0 | -- | unknown
1576-
* 13.1 | BTN_TRIGGER_HAPPY1 | left top grip button
1577-
* 13.2 | BTN_TRIGGER_HAPPY2 | right top grip button
1573+
* 13.1 | BTN_GRIPL | left top grip button
1574+
* 13.2 | BTN_GRIPR | right top grip button
15781575
* 13.3 | -- | unknown
15791576
* 13.4 | -- | unknown
15801577
* 13.5 | -- | unknown
@@ -1659,8 +1656,8 @@ static void steam_do_deck_input_event(struct steam_device *steam,
16591656
input_event(input, EV_KEY, BTN_SELECT, !!(b9 & BIT(4)));
16601657
input_event(input, EV_KEY, BTN_MODE, !!(b9 & BIT(5)));
16611658
input_event(input, EV_KEY, BTN_START, !!(b9 & BIT(6)));
1662-
input_event(input, EV_KEY, BTN_TRIGGER_HAPPY3, !!(b9 & BIT(7)));
1663-
input_event(input, EV_KEY, BTN_TRIGGER_HAPPY4, !!(b10 & BIT(0)));
1659+
input_event(input, EV_KEY, BTN_GRIPL2, !!(b9 & BIT(7)));
1660+
input_event(input, EV_KEY, BTN_GRIPR2, !!(b10 & BIT(0)));
16641661
input_event(input, EV_KEY, BTN_THUMBL, !!(b10 & BIT(6)));
16651662
input_event(input, EV_KEY, BTN_THUMBR, !!(b11 & BIT(2)));
16661663
input_event(input, EV_KEY, BTN_DPAD_UP, !!(b9 & BIT(0)));
@@ -1669,8 +1666,8 @@ static void steam_do_deck_input_event(struct steam_device *steam,
16691666
input_event(input, EV_KEY, BTN_DPAD_DOWN, !!(b9 & BIT(3)));
16701667
input_event(input, EV_KEY, BTN_THUMB, !!(b10 & BIT(1)));
16711668
input_event(input, EV_KEY, BTN_THUMB2, !!(b10 & BIT(2)));
1672-
input_event(input, EV_KEY, BTN_TRIGGER_HAPPY1, !!(b13 & BIT(1)));
1673-
input_event(input, EV_KEY, BTN_TRIGGER_HAPPY2, !!(b13 & BIT(2)));
1669+
input_event(input, EV_KEY, BTN_GRIPL, !!(b13 & BIT(1)));
1670+
input_event(input, EV_KEY, BTN_GRIPR, !!(b13 & BIT(2)));
16741671
input_event(input, EV_KEY, BTN_BASE, !!(b14 & BIT(2)));
16751672

16761673
input_sync(input);

0 commit comments

Comments
 (0)