OSDN Git Service

Bluetooth: btusb: Support Bluetooth Reset for Mediatek Chip(MT7921)
authormark-yw.chen <mark-yw.chen@mediatek.com>
Wed, 4 Aug 2021 09:06:47 +0000 (17:06 +0800)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 4 Aug 2021 14:48:08 +0000 (16:48 +0200)
commite947802657cb6f540ba04f498dfd4938ed6c569e
tree0bfe95080810a8a98f683af9899d1897ec634cb0
parent0b10c8c84c0c78ba4456bdbeb8a5b6ee58f47e39
Bluetooth: btusb: Support Bluetooth Reset for Mediatek Chip(MT7921)

When the firmware hang or command no response, driver can reset the
bluetooth mcu via USB to recovery it. The reset steps as follows.

1. Cancel USB transfer requests before reset.
2. It use speicific USB HW Register to reset Bluetooth MCU, at the
   same time, the USB Endpoint0 still keep alive.
3. Poll the USB HW register until reset is completed by Endpoint0.
4. To recovery unexpected USB state and behavior during resetting the
   Bluetooth MCU, the driver need to reset the USB device for MT7921.
5. After the reset is completed, the Bluetooth MCU need to re-setup,
   such as download patch, power-on sequence and etc.

Signed-off-by: mark-yw.chen <mark-yw.chen@mediatek.com>
Reviewed-by: Michael Sun <michaelfsun@google.com>
Reviewed-by: Archie Pusaka <apusaka@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/btusb.c