summaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/btrtl.c
diff options
context:
space:
mode:
authorHilda Wu <hildawu@realtek.com>2021-09-30 12:36:34 +0200
committerMarcel Holtmann <marcel@holtmann.org>2021-10-01 11:40:47 +0200
commitcd36742a957c37f6cd17124dac6dd1d61aeba4ab (patch)
tree2d4c8c168423e78eb6adf77c0a9cab584845fad4 /drivers/bluetooth/btrtl.c
parentBluetooth: btusb: Add support for TP-Link UB500 Adapter (diff)
downloadlinux-cd36742a957c37f6cd17124dac6dd1d61aeba4ab.tar.xz
linux-cd36742a957c37f6cd17124dac6dd1d61aeba4ab.zip
Bluetooth: btrtl: Ask ic_info to drop firmware
Some un-support wakeup platforms keep USB power and suspend signal is coming late, this makes Realtek some chip keep its firmware, and make it never load new firmware. So use vendor specific HCI command to ask them drop its firmware after system shutdown or resume. Signed-off-by: Hilda Wu <hildawu@realtek.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/btrtl.c')
-rw-r--r--drivers/bluetooth/btrtl.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index 08582effb25e..c2bdd1e6060e 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -601,8 +601,10 @@ struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev,
hci_rev = le16_to_cpu(resp->hci_rev);
lmp_subver = le16_to_cpu(resp->lmp_subver);
- if (resp->hci_ver == 0x8 && le16_to_cpu(resp->hci_rev) == 0x826c &&
- resp->lmp_ver == 0x8 && le16_to_cpu(resp->lmp_subver) == 0xa99e)
+ btrtl_dev->ic_info = btrtl_match_ic(lmp_subver, hci_rev, hci_ver,
+ hdev->bus);
+
+ if (!btrtl_dev->ic_info)
btrtl_dev->drop_fw = true;
if (btrtl_dev->drop_fw) {
@@ -641,13 +643,13 @@ struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev,
hci_ver = resp->hci_ver;
hci_rev = le16_to_cpu(resp->hci_rev);
lmp_subver = le16_to_cpu(resp->lmp_subver);
+
+ btrtl_dev->ic_info = btrtl_match_ic(lmp_subver, hci_rev, hci_ver,
+ hdev->bus);
}
out_free:
kfree_skb(skb);
- btrtl_dev->ic_info = btrtl_match_ic(lmp_subver, hci_rev, hci_ver,
- hdev->bus);
-
if (!btrtl_dev->ic_info) {
rtl_dev_info(hdev, "unknown IC info, lmp subver %04x, hci rev %04x, hci ver %04x",
lmp_subver, hci_rev, hci_ver);