Message ID | 20171213080555.29032-2-kai.heng.feng@canonical.com |
---|---|
State | New |
Headers | show |
Series | [SRU,Artful/linux-oem,1/1] Bluetooth: btusb: driver to enable the usb-wakeup feature | expand |
Clean cherry-pick. Acked-by: Aaron Ma <aaron.ma@canonical.com> On 12/13/2017 04:05 PM, Kai-Heng Feng wrote: > From: Sukumar Ghorai <sukumar.ghorai@intel.com> > > BugLink: https://bugs.launchpad.net/bugs/1737890 > > 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 <sukumar.ghorai@intel.com> > Signed-off-by: Amit K Bag <amit.k.bag@intel.com> > Acked-by: Oliver Neukum <oneukum@suse.com> > Signed-off-by: Marcel Holtmann <marcel@holtmann.org> > (cherry picked from commit a0085f2510e8976614ad8f766b209448b385492f) > Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> > --- > drivers/bluetooth/btusb.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c > index 99c97f65149e..d563ec8c008b 100644 > --- a/drivers/bluetooth/btusb.c > +++ b/drivers/bluetooth/btusb.c > @@ -1077,6 +1077,10 @@ static int btusb_open(struct hci_dev *hdev) > } > > data->intf->needs_remote_wakeup = 1; > + /* device specific wakeup source enabled and required for USB > + * remote wakeup while host is suspended > + */ > + device_wakeup_enable(&data->udev->dev); > > if (test_and_set_bit(BTUSB_INTR_RUNNING, &data->flags)) > goto done; > @@ -1140,6 +1144,7 @@ static int btusb_close(struct hci_dev *hdev) > goto failed; > > data->intf->needs_remote_wakeup = 0; > + device_wakeup_disable(&data->udev->dev); > usb_autopm_put_interface(data->intf); > > failed: >
Applied to artful On 2017-12-13 16:05:55 , Kai-Heng Feng wrote: > From: Sukumar Ghorai <sukumar.ghorai@intel.com> > > BugLink: https://bugs.launchpad.net/bugs/1737890 > > 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 <sukumar.ghorai@intel.com> > Signed-off-by: Amit K Bag <amit.k.bag@intel.com> > Acked-by: Oliver Neukum <oneukum@suse.com> > Signed-off-by: Marcel Holtmann <marcel@holtmann.org> > (cherry picked from commit a0085f2510e8976614ad8f766b209448b385492f) > Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> > --- > drivers/bluetooth/btusb.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c > index 99c97f65149e..d563ec8c008b 100644 > --- a/drivers/bluetooth/btusb.c > +++ b/drivers/bluetooth/btusb.c > @@ -1077,6 +1077,10 @@ static int btusb_open(struct hci_dev *hdev) > } > > data->intf->needs_remote_wakeup = 1; > + /* device specific wakeup source enabled and required for USB > + * remote wakeup while host is suspended > + */ > + device_wakeup_enable(&data->udev->dev); > > if (test_and_set_bit(BTUSB_INTR_RUNNING, &data->flags)) > goto done; > @@ -1140,6 +1144,7 @@ static int btusb_close(struct hci_dev *hdev) > goto failed; > > data->intf->needs_remote_wakeup = 0; > + device_wakeup_disable(&data->udev->dev); > usb_autopm_put_interface(data->intf); > > failed: > -- > 2.14.1 > > > -- > kernel-team mailing list > kernel-team@lists.ubuntu.com > https://lists.ubuntu.com/mailman/listinfo/kernel-team
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 99c97f65149e..d563ec8c008b 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -1077,6 +1077,10 @@ static int btusb_open(struct hci_dev *hdev) } data->intf->needs_remote_wakeup = 1; + /* device specific wakeup source enabled and required for USB + * remote wakeup while host is suspended + */ + device_wakeup_enable(&data->udev->dev); if (test_and_set_bit(BTUSB_INTR_RUNNING, &data->flags)) goto done; @@ -1140,6 +1144,7 @@ static int btusb_close(struct hci_dev *hdev) goto failed; data->intf->needs_remote_wakeup = 0; + device_wakeup_disable(&data->udev->dev); usb_autopm_put_interface(data->intf); failed: