Skip to content

Commit a0085f2

Browse files
sghoraiholtmann
authored andcommitted
Bluetooth: btusb: driver to enable the usb-wakeup feature
BT-Controller connected as platform non-root-hub device and usb-driver initialize such device with wakeup disabled, Ref. usb_new_device(). At present wakeup-capability get enabled by hid-input device from usb function driver(e.g. BT HID device) at runtime. Again some functional driver does not set usb-wakeup capability(e.g LE HID device implement as HID-over-GATT), and can't wakeup the host on USB. Most of the device operation (such as mass storage) initiated from host (except HID) and USB wakeup aligned with host resume procedure. For BT device, usb-wakeup capability need to enable form btusc driver as a generic solution for multiple profile use case and required for USB remote wakeup (in-bus wakeup) while host is suspended. Also usb-wakeup feature need to enable/disable with HCI interface up and down. Signed-off-by: Sukumar Ghorai <[email protected]> Signed-off-by: Amit K Bag <[email protected]> Acked-by: Oliver Neukum <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 9834e58 commit a0085f2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/bluetooth/btusb.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,10 @@ static int btusb_open(struct hci_dev *hdev)
10881088
}
10891089

10901090
data->intf->needs_remote_wakeup = 1;
1091+
/* device specific wakeup source enabled and required for USB
1092+
* remote wakeup while host is suspended
1093+
*/
1094+
device_wakeup_enable(&data->udev->dev);
10911095

10921096
if (test_and_set_bit(BTUSB_INTR_RUNNING, &data->flags))
10931097
goto done;
@@ -1151,6 +1155,7 @@ static int btusb_close(struct hci_dev *hdev)
11511155
goto failed;
11521156

11531157
data->intf->needs_remote_wakeup = 0;
1158+
device_wakeup_disable(&data->udev->dev);
11541159
usb_autopm_put_interface(data->intf);
11551160

11561161
failed:

0 commit comments

Comments
 (0)