コード例 #1
0
ファイル: ohci-rbus.c プロジェクト: OpenHMR/Open-HMR600
static int ohci_rbus_resume (struct usb_hcd *hcd)
{
	struct ohci_hcd		*ohci = hcd_to_ohci (hcd);
	int			retval = 0;

#ifdef CONFIG_PMAC_PBOOK
	if (_machine == _MACH_Pmac) {
		struct device_node *of_node;

		/* Re-enable USB PAD & cell clock */
		of_node = pci_device_to_OF_node (to_pci_dev(hcd->self.controller));
		if (of_node)
			pmac_call_feature (PMAC_FTR_USB_ENABLE, of_node, 0, 1);
	}
#endif /* CONFIG_PMAC_PBOOK */

	/* resume root hub */
	if (time_before (jiffies, ohci->next_statechange))
		msleep (100);
#ifdef	CONFIG_USB_SUSPEND
	/* get extra cleanup even if remote wakeup isn't in use */
	retval = usb_resume_device (hcd->self.root_hub);
#else
	usb_lock_device (hcd->self.root_hub);
	retval = ohci_hub_resume (hcd);
	usb_unlock_device (hcd->self.root_hub);
#endif

	return retval;
}
コード例 #2
0
static int ohci_omap_resume(struct device *dev, u32 level)
{
	struct ohci_hcd	*ohci = hcd_to_ohci(dev_get_drvdata(dev));
	int		status = 0;

	if (level != RESUME_POWER_ON)
		return 0;

	switch (dev->power.power_state) {
	case 0:
		break;
	case 4:
		if (time_before(jiffies, ohci->next_statechange))
			msleep(5);
		ohci->next_statechange = jiffies;
		omap_ohci_clock_power(1);
		/* FALLTHROUGH */
	default:
		dev_dbg(dev, "resume from %d\n", dev->power.power_state);
#ifdef	CONFIG_USB_SUSPEND
		/* get extra cleanup even if remote wakeup isn't in use */
		status = usb_resume_device(ohci_to_hcd(ohci)->self.root_hub);
#else
		down(&ohci_to_hcd(ohci)->self.root_hub->serialize);
		status = ohci_hub_resume(ohci_to_hcd(ohci));
		up(&ohci_to_hcd(ohci)->self.root_hub->serialize);
#endif
		if (status == 0)
			dev->power.power_state = 0;
		break;
	}
	return status;
}
コード例 #3
0
ファイル: ohci-hub.c プロジェクト: OpenHMR/Open-HMR600
static void ohci_rh_resume (void *_hcd)
{
	struct usb_hcd	*hcd = _hcd;

	usb_lock_device (hcd->self.root_hub);
	(void) ohci_hub_resume (hcd);
	usb_unlock_device (hcd->self.root_hub);
}
コード例 #4
0
static void ohci_rh_resume (void *_hcd)
{
	struct usb_hcd	*hcd = _hcd;

	down (&hcd->self.root_hub->serialize);
	(void) ohci_hub_resume (hcd);
	up (&hcd->self.root_hub->serialize);
}