Name

usb_suspend_device — suspend a usb device

Synopsis

int usb_suspend_device (struct usb_device *  udev,
 pm_message_t  state);

Arguments

udev

device that's no longer in active use

state

PMSG_SUSPEND to suspend

Context

must be able to sleep; device not locked

Description

Suspends a USB device that isn't in active use, conserving power. Devices may wake out of a suspend, if anything important happens, using the remote wakeup mechanism. They may also be taken out of suspend by the host, using usb_resume_device. It's also routine to disconnect devices while they are suspended.

Suspending OTG devices may trigger HNP, if that's been enabled between a pair of dual-role devices. That will change roles, such as from A-Host to A-Peripheral or from B-Host back to B-Peripheral.

Returns 0 on success, else negative errno.