Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <eugenyshcheglov@gmail.com>
Signed-off-by: Vicki Pfau <vi@endrift.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>

authored by

Vicki Pfau and committed by
Jiri Kosina
05c4ede6 363236d7

+3 -3
+3 -3
drivers/hid/hid-steam.c
··· 1050 1050 struct steam_device, mode_switch); 1051 1051 unsigned long flags; 1052 1052 bool client_opened; 1053 - steam->gamepad_mode = !steam->gamepad_mode; 1054 1053 if (!lizard_mode) 1055 1054 return; 1056 1055 1056 + steam->gamepad_mode = !steam->gamepad_mode; 1057 1057 if (steam->gamepad_mode) 1058 1058 steam_set_lizard_mode(steam, false); 1059 1059 else { ··· 1599 1599 schedule_delayed_work(&steam->mode_switch, 45 * HZ / 100); 1600 1600 } 1601 1601 1602 - if (!steam->gamepad_mode) 1602 + if (!steam->gamepad_mode && lizard_mode) 1603 1603 return; 1604 1604 1605 1605 lpad_touched = b10 & BIT(3); ··· 1669 1669 */ 1670 1670 steam->sensor_timestamp_us += 4000; 1671 1671 1672 - if (!steam->gamepad_mode) 1672 + if (!steam->gamepad_mode && lizard_mode) 1673 1673 return; 1674 1674 1675 1675 input_event(sensors, EV_MSC, MSC_TIMESTAMP, steam->sensor_timestamp_us);