Bluetooth: Add USB autosuspend support to btusb driver
authorOliver Neukum <oliver@neukum.org>
Mon, 24 Aug 2009 21:44:59 +0000 (23:44 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 24 Aug 2009 23:31:24 +0000 (16:31 -0700)
commit7bee549e197c9c0e92b89857a409675c1d5e9dff
treede18e51c34faf4c53fd2bd6b7f0c8ab2b2caf6e5
parentd2e353f7c3c5fbb3add0341c10ae167ee745d23b
Bluetooth: Add USB autosuspend support to btusb driver

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: Oliver Neukum <oliver@neukum.org>
Tested-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/btusb.c