HID: steam: remove input device when a hid client is running.
authorRodrigo Rivas Costa <rodrigorivascosta@gmail.com>
Sun, 14 Oct 2018 17:36:43 +0000 (19:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 1 Dec 2018 08:37:24 +0000 (09:37 +0100)
commitfb87a92b43961c89bf4a115d8a700885d8959cb1
tree3cb3417faa1ec22fe9033c3fd5ea9dd00ae6e6e8
parentb32d16ec995683be888520d12d8f2833efee5dae
HID: steam: remove input device when a hid client is running.

commit 385a4886778f6d6e61eff1d4d295af332d7130e1 upstream.

Previously, when a HID client such as the Steam Client was running, this
driver disabled its input device to avoid doubling the input events.

While it worked mostly fine, some games got confused by the idle gamepad,
and switched to two player mode, or asked the user to choose which gamepad
to use. Other games just crashed, probably a bug in Unity [1].

With this commit, when a HID client starts, the input device is removed;
when the HID client ends the input device is recreated.

[1]: https://github.com/ValveSoftware/steam-for-linux/issues/5645

Signed-off-by: Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Cc: Pierre-Loup Griffais <pgriffais@valvesoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-steam.c