HID: nintendo: reinitialize USB Pro Controller after resuming from suspend
authorMartino Fontana <tinozzo123@gmail.com>
Sun, 24 Sep 2023 14:06:01 +0000 (16:06 +0200)
committerJiri Kosina <jkosina@suse.cz>
Thu, 5 Oct 2023 10:50:34 +0000 (12:50 +0200)
commit95ea4d9fd385fe335b989f22d409df079a042b7a
tree5f0f8b87b275436d5c158ab67c0f1752ab5784dc
parentaa80f391e97a3fa5ca6bd822047950aa0584f6bf
HID: nintendo: reinitialize USB Pro Controller after resuming from suspend

When suspending the computer, a Switch Pro Controller connected via USB will
lose its internal status. However, because the USB connection was technically
never lost, when resuming the computer, the driver will attempt to communicate
with the controller as if nothing happened (and fail).
Because of this, the user was forced to manually disconnect the controller
(or to press the sync button on the controller to power it off), so that it
can be re-initialized.

With this patch, the controller will be automatically re-initialized after
resuming from suspend.

Closes: https://bugzilla.kernel.org/show_bug.cgi?id=216233

Signed-off-by: Martino Fontana <tinozzo123@gmail.com>
Reviewed-by: Daniel J. Ogorchock <djogorchock@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-nintendo.c