usb: diag_bridge: support autosuspend and autoresume
Allow automatic power management by the USB core by enabling
autosuspend in the DIAG Bridge driver. This allows the MDM device
to be suspended and draw minimal power when idle.
In the diagfwd_hsic driver, register suspend and resume callbacks
to know when to temporarily halt queuing read or write requests to
the bridge which would otherwise prevent the HSIC device from
triggering an autosuspend.
Similarly, close the bridge when the USB cable is disconnected to
signify that it is done using it, or else there would forever be a
pending read or write on the bridge that would keep the HSIC active.
Revert allocation flags in diag_bridge_read() and diag_bridge_write()
to GFP_KERNEL, as they now can only be called in process context.
Change-Id: I124460bbc90ff10a1a7f8e6ab94dab0fbfc5d0df
Signed-off-by: Jack Pham <jackp@codeaurora.org>
4 files changed