HID: nintendo: ratelimit subcommands and rumble
authorDaniel J. Ogorchock <djogorchock@gmail.com>
Sat, 11 Sep 2021 17:36:38 +0000 (13:36 -0400)
committerJiri Kosina <jkosina@suse.cz>
Wed, 27 Oct 2021 08:05:52 +0000 (10:05 +0200)
commite93363f716a23e61b46adfefbc3d01e99c240b5d
tree11d5161ec55310bef6770b168f96187a9dc5966c
parent4c048f6b2c25ff0fc0a7bdedc285ab8fe97df2fc
HID: nintendo: ratelimit subcommands and rumble

It has been found that sending subcommands and rumble data packets at
too great a rate can result in controller disconnects. This patch limits
the rate of subcommands/rumble to once every 25 milliseconds.

Similar to sending subcommands, it is more reliable to send the rumble
data packets immediately after we've received an input report from the
controller. This results in far fewer bluetooth disconnects for the
controller.

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