diff options
author | Abhishek Pandit-Subedi <abhishekpandit@chromium.org> | 2020-05-13 05:19:27 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2020-05-13 10:12:04 +0300 |
commit | b7d0bf11a7ad0e97721a5c4a209ba749649f8b9e (patch) | |
tree | c37511127a594e3864dc00fe519048d4b1285663 | |
parent | 81dafad53c67abe4f09b0b04131fe490e76e5602 (diff) | |
download | linux-b7d0bf11a7ad0e97721a5c4a209ba749649f8b9e.tar.xz |
Bluetooth: btusb: Implement hdev->prevent_wake
Implement the prevent_wake hook by checking device_may_wakeup on the usb
interface. This prevents the Bluetooth core from enabling scanning when
the device isn't expected to wake from suspend.
Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Reviewed-by: Alain Michaud <alainm@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r-- | drivers/bluetooth/btusb.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 8ae3ad7a6013..c17359c0e320 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -3698,6 +3698,13 @@ static void btusb_check_needs_reset_resume(struct usb_interface *intf) interface_to_usbdev(intf)->quirks |= USB_QUIRK_RESET_RESUME; } +static bool btusb_prevent_wake(struct hci_dev *hdev) +{ + struct btusb_data *data = hci_get_drvdata(hdev); + + return !device_may_wakeup(&data->udev->dev); +} + static int btusb_probe(struct usb_interface *intf, const struct usb_device_id *id) { @@ -3831,6 +3838,7 @@ static int btusb_probe(struct usb_interface *intf, hdev->flush = btusb_flush; hdev->send = btusb_send_frame; hdev->notify = btusb_notify; + hdev->prevent_wake = btusb_prevent_wake; #ifdef CONFIG_PM err = btusb_config_oob_wake(hdev); |