Skip to content

Commit 05c4ede

Browse files
endriftJiri Kosina
authored andcommitted
HID: hid-steam: Fix issues with disabling both gamepad mode and lizard mode
When lizard mode is disabled, there were two issues: 1. Switching between gamepad mode and desktop mode still functioned, even though desktop mode did not. This lead to the ability to "break" gamepad mode by holding down the Options key even while lizard mode is disabled 2. If you were in desktop mode when lizard mode is disabled, you would immediately enter this faulty mode. This patch properly disables the ability to switch between gamepad mode and the faulty desktop mode by holding the Options key, as well as effectively removing the faulty mode by bypassing the early returns if lizard mode is disabled. Reported-by: Eugeny Shcheglov <[email protected]> Signed-off-by: Vicki Pfau <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 363236d commit 05c4ede

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/hid/hid-steam.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,10 +1050,10 @@ static void steam_mode_switch_cb(struct work_struct *work)
10501050
struct steam_device, mode_switch);
10511051
unsigned long flags;
10521052
bool client_opened;
1053-
steam->gamepad_mode = !steam->gamepad_mode;
10541053
if (!lizard_mode)
10551054
return;
10561055

1056+
steam->gamepad_mode = !steam->gamepad_mode;
10571057
if (steam->gamepad_mode)
10581058
steam_set_lizard_mode(steam, false);
10591059
else {
@@ -1599,7 +1599,7 @@ static void steam_do_deck_input_event(struct steam_device *steam,
15991599
schedule_delayed_work(&steam->mode_switch, 45 * HZ / 100);
16001600
}
16011601

1602-
if (!steam->gamepad_mode)
1602+
if (!steam->gamepad_mode && lizard_mode)
16031603
return;
16041604

16051605
lpad_touched = b10 & BIT(3);
@@ -1669,7 +1669,7 @@ static void steam_do_deck_sensors_event(struct steam_device *steam,
16691669
*/
16701670
steam->sensor_timestamp_us += 4000;
16711671

1672-
if (!steam->gamepad_mode)
1672+
if (!steam->gamepad_mode && lizard_mode)
16731673
return;
16741674

16751675
input_event(sensors, EV_MSC, MSC_TIMESTAMP, steam->sensor_timestamp_us);

0 commit comments

Comments
 (0)