Skip to content

Commit bfbd45e

Browse files
tedd-anholtmann
authored andcommitted
Bluetooth: Add device shutdown routine for Intel Bluetooth device
This patch adds the device shutdown routine for Intel Bluetooth device. Some platforms have BT LED issue with Intel Bluetooth device that BT LED goes off 5 seconds after BT is turned off For Intel Bluetooth device, the BT LED is turned off when: - there is no active connection or radio activity - USB is suspend So, when the BT is turned off, it takes 5 seconds because USB suspend timeone is 5 seconds by default. And if the USB suspend is not enabled, BT LED won't be turned off. To fix this issue, recently Intel Bluetooth firmware patch had been submitted to turn off the BT LED immediately by the vendor specific command(0xFC3F). And this patch sends this command to the device before closing the device. For backward compatibility of this command with old firmware, this command was supported before, but it behaves same as HCI_RESET internally. So, it won't be the problem even if the system doesn't have the latest firmware patch. Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
1 parent a44fecb commit bfbd45e

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

‎drivers/bluetooth/btusb.c‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2321,6 +2321,27 @@ static int btusb_set_bdaddr_intel(struct hci_dev *hdev, const bdaddr_t *bdaddr)
23212321
return 0;
23222322
}
23232323

2324+
static int btusb_shutdown_intel(struct hci_dev *hdev)
2325+
{
2326+
struct sk_buff *skb;
2327+
long ret;
2328+
2329+
/* Some platforms have an issue with BT LED when the interface is
2330+
* down or BT radio is turned off, which takes 5 seconds to BT LED
2331+
* goes off. This command turns off the BT LED immediately.
2332+
*/
2333+
skb = __hci_cmd_sync(hdev, 0xfc3f, 0, NULL, HCI_INIT_TIMEOUT);
2334+
if (IS_ERR(skb)) {
2335+
ret = PTR_ERR(skb);
2336+
BT_ERR("%s: turning off Intel device LED failed (%ld)",
2337+
hdev->name, ret);
2338+
return ret;
2339+
}
2340+
kfree_skb(skb);
2341+
2342+
return 0;
2343+
}
2344+
23242345
static int btusb_set_bdaddr_marvell(struct hci_dev *hdev,
23252346
const bdaddr_t *bdaddr)
23262347
{
@@ -2698,6 +2719,7 @@ static int btusb_probe(struct usb_interface *intf,
26982719

26992720
if (id->driver_info & BTUSB_INTEL) {
27002721
hdev->setup = btusb_setup_intel;
2722+
hdev->shutdown = btusb_shutdown_intel;
27012723
hdev->set_bdaddr = btusb_set_bdaddr_intel;
27022724
set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
27032725
}

0 commit comments

Comments
 (0)