示例#1
0
static int generic_suspend(struct usb_device *udev, pm_message_t msg)
{
	int rc;

	MYDBG("udev : %x", (unsigned int)udev);

	/* Normal USB devices suspend through their upstream port.
	 * Root hubs don't have upstream ports to suspend,
	 * so we have to shut down their downstream HC-to-USB
	 * interfaces manually by doing a bus (or "global") suspend.
	 */
	if (!udev->parent)
	{
		MYDBG("");
		rc = hcd_bus_suspend(udev, msg);
	}

	/* Non-root devices don't need to do anything for FREEZE or PRETHAW */
	else if (msg.event == PM_EVENT_FREEZE || msg.event == PM_EVENT_PRETHAW)
	{
		MYDBG("");
		rc = 0;
	}
	else
	{
		MYDBG("");
		rc = usb_port_suspend(udev, msg);
	}

	return rc;
}
示例#2
0
static int generic_suspend(struct usb_device *udev, pm_message_t msg)
{
	/* USB devices enter SUSPEND state through their hubs, but can be
	 * marked for FREEZE as soon as their children are already idled.
	 * But those semantics are useless, so we equate the two (sigh).
	 */
	return usb_port_suspend(udev);
}