• Oliver Neukum's avatar
    Bluetooth: Add USB autosuspend support to btusb driver · 7bee549e
    Oliver Neukum authored
    This patch adds support of USB autosuspend to the btusb driver.
    
    If the device doesn't support remote wakeup, simple support based on
    up/down is provided. If the device supports remote wakeup, additional
    support for autosuspend while the interface is up is provided. This is
    done by queueing URBs in an anchor structure and waking the device up
    from a work queue on sending. Reception triggers remote wakeup.
    
    The last busy facility of the USB autosuspend code is used. To close
    a race between autosuspend and transmission, a counter of ongoing
    transmissions is maintained.
    
    Add #ifdefs for CONFIG_PM as necessary.
    Signed-off-by: default avatarOliver Neukum <oliver@neukum.org>
    Tested-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
    Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
    7bee549e
btusb.c 27.2 KB