Bluetooth: hci_h5: Add power reset via gpio in h5_btrtl_open
authorVyacheslav Bocharov <adeep@lexina.in>
Wed, 26 Jan 2022 07:39:05 +0000 (10:39 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 26 Jan 2022 13:39:35 +0000 (14:39 +0100)
commitadce573b927adf827f2f8627f05c2ba90031ebc9
treef57f7cd60c8ac88e1b186d1cabddde1b8a259e30
parentb050c5bbbccfb9e6cbf29c8ee7a41c1bba972bdf
Bluetooth: hci_h5: Add power reset via gpio in h5_btrtl_open

Add power reset for bluetooth via enable-gpios in h5_btrtl_open function.

While testing the RTL8822CS SDIO WiFi/BT adapter, it was found that in
some cases the kernel could not initialize BT firmware. However,
manually resetting the adapter via gpio (off/on sequence) allows it to
start correctly.
Apparently, when the system starts, the adapter is in an undefined state
(including unknown gpio state after starting uboot). A forced reset helps
to initialize the adapter in most cases. It has been found experimentally
that 100 ms is sufficient for a reset.

Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/hci_h5.c