您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ usb_hcd_resume_root_hub函数代码示例

51自学网 2021-06-03 09:20:12
  C++
这篇教程C++ usb_hcd_resume_root_hub函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中usb_hcd_resume_root_hub函数的典型用法代码示例。如果您正苦于以下问题:C++ usb_hcd_resume_root_hub函数的具体用法?C++ usb_hcd_resume_root_hub怎么用?C++ usb_hcd_resume_root_hub使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了usb_hcd_resume_root_hub函数的21个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ehci_arc_resume

static int ehci_arc_resume(struct platform_device *pdev){	struct usb_hcd *hcd = platform_get_drvdata(pdev);	struct ehci_hcd *ehci = hcd_to_ehci(hcd);	u32 tmp;	struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;	dbg("%s pdev=0x%p  pdata=0x%p  ehci=0x%p  hcd=0x%p/n",	    __FUNCTION__, pdev, pdata, ehci, hcd);	vdbg("%s ehci->regs=0x%p  hcd->regs=0x%p  usbmode=0x%x/n",	     __FUNCTION__, ehci->regs, hcd->regs, pdata->usbmode);	tmp = USBMODE_CM_HOST;	if (ehci_big_endian_mmio(ehci))		tmp |= USBMODE_BE;	ehci_writel(ehci, tmp, (u32 *)pdata->usbmode);	memcpy(ehci->regs, (void *)&usb_ehci_regs, sizeof(struct ehci_regs));	set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);	hcd->state = HC_STATE_RUNNING;	pdev->dev.power.power_state = PMSG_ON;	tmp = ehci_readl(ehci, &ehci->regs->command);	tmp |= CMD_RUN;	ehci_writel(ehci, tmp, &ehci->regs->command);	fsl_platform_set_vbus_power(pdata, 1);	usb_hcd_resume_root_hub(hcd);	return 0;}
开发者ID:mrtos,项目名称:Logitech-Revue,代码行数:35,


示例2: tegra_ehci_irq

static irqreturn_t tegra_ehci_irq(struct usb_hcd *hcd){	struct tegra_ehci_hcd *tegra = dev_get_drvdata(hcd->self.controller);	struct ehci_hcd *ehci = hcd_to_ehci(hcd);	irqreturn_t irq_status;	spin_lock(&ehci->lock);	irq_status = tegra_usb_phy_irq(tegra->phy);	if (irq_status == IRQ_NONE) {		spin_unlock(&ehci->lock);		return irq_status;	}	if (tegra_usb_phy_pmc_wakeup(tegra->phy)) {		ehci_dbg(ehci, "pmc wakeup detected/n");		usb_hcd_resume_root_hub(hcd);		spin_unlock(&ehci->lock);		return irq_status;	}	spin_unlock(&ehci->lock);	EHCI_DBG("%s() cmd = 0x%x, int_sts = 0x%x, portsc = 0x%x/n", __func__,		ehci_readl(ehci, &ehci->regs->command),		ehci_readl(ehci, &ehci->regs->status),		ehci_readl(ehci, &ehci->regs->port_status[0]));	irq_status = ehci_irq(hcd);	if (ehci->controller_remote_wakeup) {		ehci->controller_remote_wakeup = false;		tegra_usb_phy_pre_resume(tegra->phy, true);		tegra->port_resuming = 1;	}	return irq_status;}
开发者ID:Mrchenkeyu,项目名称:android_kernel_zte_pluto,代码行数:34,


示例3: ehci_mid_runtime_resume_host

static int ehci_mid_runtime_resume_host(struct intel_mid_otg_xceiv *iotg){	int		retval;	struct device	*dev;	struct pci_dev	*pci_dev;	struct usb_hcd	*hcd;	if (iotg == NULL)		return -EINVAL;	if (ehci_otg_driver.driver.pm == NULL)		return -EINVAL;	dev = iotg->otg.dev;	pci_dev = to_pci_dev(dev);	hcd = pci_get_drvdata(pci_dev);	retval = ehci_otg_driver.driver.pm->runtime_resume(dev);	if (retval)		dev_warn(dev, "runtime suspend failed/n");	/* Workaround: EHCI currently unable to deal with interrupt	*  when remote wakeup happens,	*  so a manuallly root-hub resuming is performed here.	*/	if (!retval) {		dev_dbg(dev, "resume root hub/n");		usb_hcd_resume_root_hub(hcd);	}	return retval;}
开发者ID:AirShark,项目名称:android_kernel_lenovo_redhookbay,代码行数:32,


示例4: ehci_msm_pm_resume

static int ehci_msm_pm_resume(struct device *dev){	struct usb_hcd *hcd = dev_get_drvdata(dev);	int ret;	u32 portsc;	dev_dbg(dev, "ehci-msm PM resume/n");	if (!hcd->rh_registered)		return 0;	/* Notify OTG to bring hw out of LPM before restoring wakeup flags */	ret = usb_phy_set_suspend(phy, 0);	if (ret)		return ret;	ehci_resume(hcd, false);	portsc = readl_relaxed(USB_PORTSC);	portsc &= ~PORT_RWC_BITS;	portsc |= PORT_RESUME;	writel_relaxed(portsc, USB_PORTSC);	/* Resume root-hub to handle USB event if any else initiate LPM again */	usb_hcd_resume_root_hub(hcd);	return ret;}
开发者ID:Menpiko,项目名称:SnaPKernel-N6P,代码行数:25,


示例5: ehci_fsl_drv_resume

static int ehci_fsl_drv_resume(struct platform_device *pdev){    struct usb_hcd *hcd = platform_get_drvdata(pdev);    struct ehci_hcd *ehci = hcd_to_ehci(hcd);    u32 tmp;    struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;    /* set host mode */    tmp = USBMODE_CM_HOST | (pdata->es ? USBMODE_ES : 0);    ehci_writel(ehci, tmp, hcd->regs + FSL_SOC_USB_USBMODE);    /* restore EHCI registers */    ehci_writel(ehci, usb_ehci_regs.command, &ehci->regs->command);    ehci_writel(ehci, usb_ehci_regs.intr_enable, &ehci->regs->intr_enable);    ehci_writel(ehci, usb_ehci_regs.frame_index, &ehci->regs->frame_index);    ehci_writel(ehci, usb_ehci_regs.segment, &ehci->regs->segment);    ehci_writel(ehci, usb_ehci_regs.frame_list, &ehci->regs->frame_list);    ehci_writel(ehci, usb_ehci_regs.async_next, &ehci->regs->async_next);    ehci_writel(ehci, usb_ehci_regs.configured_flag,                &ehci->regs->configured_flag);    ehci_writel(ehci, usb_ehci_regs.frame_list, &ehci->regs->frame_list);    ehci_writel(ehci, usb_ehci_portsc, &ehci->regs->port_status[0]);    set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);    hcd->state = HC_STATE_RUNNING;    pdev->dev.power.power_state = PMSG_ON;    tmp = ehci_readl(ehci, &ehci->regs->command);    tmp |= CMD_RUN;    ehci_writel(ehci, tmp, &ehci->regs->command);    usb_hcd_resume_root_hub(hcd);    return 0;}
开发者ID:R0-Developers,项目名称:YP-R0_Kernel,代码行数:35,


示例6: compliance_mode_recovery

static void compliance_mode_recovery(unsigned long arg){	struct xhci_hcd *xhci;	struct usb_hcd *hcd;	u32 temp;	int i;	xhci = (struct xhci_hcd *)arg;	for (i = 0; i < xhci->num_usb3_ports; i++) {		temp = readl(xhci->usb3_ports[i]);		if ((temp & PORT_PLS_MASK) == USB_SS_PORT_LS_COMP_MOD) {			/*			 * Compliance Mode Detected. Letting USB Core			 * handle the Warm Reset			 */			xhci_dbg_trace(xhci, trace_xhci_dbg_quirks,					"Compliance mode detected->port %d",					i + 1);			xhci_dbg_trace(xhci, trace_xhci_dbg_quirks,					"Attempting compliance mode recovery");			hcd = xhci->shared_hcd;			if (hcd->state == HC_STATE_SUSPENDED)				usb_hcd_resume_root_hub(hcd);			usb_hcd_poll_rh_status(hcd);		}	}	if (xhci->port_status_u0 != ((1 << xhci->num_usb3_ports)-1))		mod_timer(&xhci->comp_mode_recovery_timer,			jiffies + msecs_to_jiffies(COMP_MODE_RCVRY_MSECS));}
开发者ID:redareda9,项目名称:linux,代码行数:34,


示例7: mxhci_hsic_resume

static int mxhci_hsic_resume(struct mxhci_hsic_hcd *mxhci){	struct usb_hcd *hcd = hsic_to_hcd(mxhci);	int ret;	unsigned long flags;	if (!mxhci->in_lpm) {		dev_dbg(mxhci->dev, "%s called in !in_lpm/n", __func__);		return 0;	}	pm_stay_awake(mxhci->dev);	/* enable force-on mode for periph_on */	clk_set_flags(mxhci->system_clk, CLKFLAG_RETAIN_PERIPH);	if (mxhci->bus_perf_client) {		mxhci->bus_vote = true;		queue_work(mxhci->wq, &mxhci->bus_vote_w);	}	spin_lock_irqsave(&mxhci->wakeup_lock, flags);	if (mxhci->wakeup_irq_enabled) {		disable_irq_wake(mxhci->wakeup_irq);		disable_irq_nosync(mxhci->wakeup_irq);		mxhci->wakeup_irq_enabled = 0;	}	if (mxhci->pm_usage_cnt) {		mxhci->pm_usage_cnt = 0;		pm_runtime_put_noidle(mxhci->dev);	}	spin_unlock_irqrestore(&mxhci->wakeup_lock, flags);	ret = regulator_set_voltage(mxhci->hsic_vddcx, mxhci->vdd_low_vol_level,			mxhci->vdd_high_vol_level);	if (ret < 0)		dev_err(mxhci->dev,			"unable to set nominal vddcx voltage (no VDD MIN)/n");	clk_prepare_enable(mxhci->system_clk);	clk_prepare_enable(mxhci->cal_clk);	clk_prepare_enable(mxhci->hsic_clk);	clk_prepare_enable(mxhci->utmi_clk);	clk_prepare_enable(mxhci->core_clk);	if (mxhci->wakeup_irq)		usb_hcd_resume_root_hub(hcd);	mxhci->in_lpm = 0;	dev_dbg(mxhci->dev, "HSIC-USB exited from low power mode/n");	xhci_dbg_log_event(&dbg_hsic, NULL, "Controller resumed", 0);	return 0;}
开发者ID:AD5GB,项目名称:wicked_kernel_lge_hammerhead,代码行数:58,


示例8: uhci_hub_status_data

static int uhci_hub_status_data(struct usb_hcd *hcd, char *buf){	struct uhci_hcd *uhci = hcd_to_uhci(hcd);	unsigned long flags;	int status = 0;	spin_lock_irqsave(&uhci->lock, flags);	uhci_scan_schedule(uhci);	if (!HCD_HW_ACCESSIBLE(hcd) || uhci->dead)		goto done;	uhci_check_ports(uhci);	status = get_hub_status_data(uhci, buf);	switch (uhci->rh_state) {	    case UHCI_RH_SUSPENDED:				if (status || uhci->resuming_ports) {			status = 1;			usb_hcd_resume_root_hub(hcd);		}		break;	    case UHCI_RH_AUTO_STOPPED:				if (status)			wakeup_rh(uhci);		break;	    case UHCI_RH_RUNNING:				if (!any_ports_active(uhci)) {			uhci->rh_state = UHCI_RH_RUNNING_NODEVS;			uhci->auto_stop_time = jiffies + HZ;		}		break;	    case UHCI_RH_RUNNING_NODEVS:				if (any_ports_active(uhci))			uhci->rh_state = UHCI_RH_RUNNING;		else if (time_after_eq(jiffies, uhci->auto_stop_time) &&				!uhci->wait_for_hp)			suspend_rh(uhci, UHCI_RH_AUTO_STOPPED);		break;	    default:		break;	}done:	spin_unlock_irqrestore(&uhci->lock, flags);	return status;}
开发者ID:mjduddin,项目名称:B14CKB1RD_kernel_m8,代码行数:55,


示例9: ehci_hcd_omap_hack_handler

static irqreturn_t ehci_hcd_omap_hack_handler(int irq, void *dev){	struct ehci_hcd_omap *omap = dev_get_drvdata(dev);	struct ehci_hcd *ehci = omap->ehci;        struct usb_hcd *hcd = ehci_to_hcd(ehci);	/* resume root hub? */	usb_hcd_resume_root_hub(hcd);		return IRQ_HANDLED;}
开发者ID:Aircell,项目名称:asp-kernel,代码行数:11,


示例10: str9100_ohci_resume

static int str9100_ohci_resume(struct platform_device *pdev){	struct ohci_hcd	*ohci = hcd_to_ohci(platform_get_drvdata(pdev));	if (time_before(jiffies, ohci->next_statechange))		msleep(5);	ohci->next_statechange = jiffies;	pdev->power.power_state = PMSG_ON;	usb_hcd_resume_root_hub(dev_get_drvdata(pdev));	return 0;}
开发者ID:ena30,项目名称:snake-os,代码行数:11,


示例11: uhci_hub_status_data

static int uhci_hub_status_data(struct usb_hcd *hcd, char *buf){	struct uhci_hcd *uhci = hcd_to_uhci(hcd);	unsigned long flags;	int status = 0;	spin_lock_irqsave(&uhci->lock, flags);	uhci_scan_schedule(uhci);	if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags) || uhci->dead)		goto done;	uhci_check_ports(uhci);	status = get_hub_status_data(uhci, buf);	switch (uhci->rh_state) {	    case UHCI_RH_SUSPENDING:	    case UHCI_RH_SUSPENDED:		/* if port change, ask to be resumed */		if (status)			usb_hcd_resume_root_hub(hcd);		break;	    case UHCI_RH_AUTO_STOPPED:		/* if port change, auto start */		if (status)			wakeup_rh(uhci);		break;	    case UHCI_RH_RUNNING:		/* are any devices attached? */		if (!any_ports_active(uhci)) {			uhci->rh_state = UHCI_RH_RUNNING_NODEVS;			uhci->auto_stop_time = jiffies + HZ;		}		break;	    case UHCI_RH_RUNNING_NODEVS:		/* auto-stop if nothing connected for 1 second */		if (any_ports_active(uhci))			uhci->rh_state = UHCI_RH_RUNNING;		else if (time_after_eq(jiffies, uhci->auto_stop_time))			suspend_rh(uhci, UHCI_RH_AUTO_STOPPED);		break;	    default:		break;	}done:	spin_unlock_irqrestore(&uhci->lock, flags);	return status;}
开发者ID:B-Rich,项目名称:linux_drivers,代码行数:53,


示例12: ohci_omap_resume

static int ohci_omap_resume(struct platform_device *dev){	struct ohci_hcd	*ohci = hcd_to_ohci(platform_get_drvdata(dev));	if (time_before(jiffies, ohci->next_statechange))		msleep(5);	ohci->next_statechange = jiffies;	omap_ohci_clock_power(1);	dev->dev.power.power_state = PMSG_ON;	usb_hcd_resume_root_hub(platform_get_drvdata(dev));	return 0;}
开发者ID:mrtos,项目名称:Logitech-Revue,代码行数:13,


示例13: msm_hsusb_request_host

static void msm_hsusb_request_host(void *handle, int request){	struct msmusb_hcd *mhcd = handle;	struct usb_hcd *hcd = mhcd_to_hcd(mhcd);	struct msm_usb_host_platform_data *pdata = mhcd->pdata;	switch (request) {	case REQUEST_RESUME:		usb_hcd_resume_root_hub(hcd);		break;	case REQUEST_START:		if (mhcd->running)			break;		wake_lock(&mhcd->wlock);		msm_xusb_pm_qos_update(mhcd, 1);		msm_xusb_enable_clks(mhcd);		if (PHY_TYPE(pdata->phy_info) == USB_PHY_INTEGRATED)			clk_enable(mhcd->clk);		if (pdata->vbus_power)			pdata->vbus_power(pdata->phy_info, 1);		if (pdata->config_gpio)			pdata->config_gpio(1);		usb_add_hcd(hcd, hcd->irq, IRQF_SHARED);		mhcd->running = 1;		if (PHY_TYPE(pdata->phy_info) == USB_PHY_INTEGRATED)			clk_disable(mhcd->clk);		break;	case REQUEST_STOP:		if (!mhcd->running)			break;		mhcd->running = 0;		/* come out of lpm before deregistration */		usb_lpm_exit(hcd);		if (cancel_work_sync(&(mhcd->lpm_exit_work)))			usb_lpm_exit_w(&mhcd->lpm_exit_work);		usb_remove_hcd(hcd);		if (pdata->config_gpio)			pdata->config_gpio(0);		if (pdata->vbus_power)			pdata->vbus_power(pdata->phy_info, 0);		msm_xusb_disable_clks(mhcd);		wake_lock_timeout(&mhcd->wlock, HZ/2);		msm_xusb_pm_qos_update(mhcd, 0);		break;	}}
开发者ID:rex12345,项目名称:kernel-2.6.29-M860,代码行数:46,


示例14: s5p_ehci_runtime_resume

static int s5p_ehci_runtime_resume(struct device *dev){	struct platform_device *pdev = to_platform_device(dev);	struct s5p_ehci_platdata *pdata = pdev->dev.platform_data;	struct usb_hcd *hcd = platform_get_drvdata(pdev);	struct s5p_ehci_hcd *s5p_ehci = to_s5p_ehci(hcd);	int rc = 0;	if (dev->power.is_suspended)		return 0;	dev_dbg(dev, "%s/n", __func__);	if (s5p_ehci->phy) {		struct usb_phy *phy = s5p_ehci->phy;		if (s5p_ehci->post_lpa_resume)			usb_phy_init(phy);		pm_runtime_get_sync(phy->dev);	} else if (pdata && pdata->phy_resume) {		rc = pdata->phy_resume(pdev, USB_PHY_TYPE_HOST);		s5p_ehci->post_lpa_resume = !!rc;	}	if (s5p_ehci->post_lpa_resume)		s5p_ehci_configurate(hcd);	ehci_resume(hcd, false);	/*	 * REVISIT: in case of LPA bus won't be resumed, so we do it here.	 * Alternatively, we can try to setup HC in such a way that it starts	 * to sense connections. In this case, root hub will be resumed from	 * interrupt (ehci_irq()).	 */	if (s5p_ehci->post_lpa_resume)		usb_hcd_resume_root_hub(hcd);	s5p_ehci->post_lpa_resume = 0;	return 0;}
开发者ID:ShedrockN4,项目名称:wiliteneo,代码行数:42,


示例15: msm_ehci_dock_connect_irq

static irqreturn_t msm_ehci_dock_connect_irq(int irq, void *data){	const struct msm_usb_host_platform_data *pdata;	struct msm_hcd *mhcd = data;	struct usb_hcd *hcd = mhcd_to_hcd(mhcd);	pdata = mhcd->dev->platform_data;	if (atomic_read(&mhcd->in_lpm))		usb_hcd_resume_root_hub(hcd);	if (irq_read_line(pdata->dock_connect_irq)) {		dev_dbg(mhcd->dev, "%s:Dock removed disable vbus/n", __func__);		msm_ehci_vbus_power(mhcd, 0);	} else {		dev_dbg(mhcd->dev, "%s:Dock connected enable vbus/n", __func__);		msm_ehci_vbus_power(mhcd, 1);	}	return IRQ_HANDLED;}
开发者ID:joutcast,项目名称:ASUS_A80_source,代码行数:21,


示例16: ehci_msm_pm_resume

static int ehci_msm_pm_resume(struct device *dev){    struct usb_hcd *hcd = dev_get_drvdata(dev);    int ret;    dev_dbg(dev, "ehci-msm PM resume/n");    if (!hcd->rh_registered)        return 0;    /* Notify OTG to bring hw out of LPM before restoring wakeup flags */    ret = usb_phy_set_suspend(phy, 0);    if (ret)        return ret;    ehci_prepare_ports_for_controller_resume(hcd_to_ehci(hcd));    /* Resume root-hub to handle USB event if any else initiate LPM again */    usb_hcd_resume_root_hub(hcd);    return ret;}
开发者ID:itsmerajit,项目名称:kernel_otus,代码行数:21,


示例17: hcd_start

/** Initializes the DWC_otg controller and its root hub and prepares it for host * mode operation. Activates the root port. Returns 0 on success and a negative * error code on failure. */int hcd_start(struct usb_hcd *hcd){	dwc_otg_hcd_t *dwc_otg_hcd = hcd_to_dwc_otg_hcd(hcd);	struct usb_bus *bus;	DWC_DEBUGPL(DBG_HCD, "DWC OTG HCD START/n");	bus = hcd_to_bus(hcd);	hcd->state = HC_STATE_RUNNING;	if (dwc_otg_hcd_start(dwc_otg_hcd, &hcd_fops)) {		return 0;	}	/* Initialize and connect root hub if one is not already attached */	if (bus->root_hub) {		DWC_DEBUGPL(DBG_HCD, "DWC OTG HCD Has Root Hub/n");		/* Inform the HUB driver to resume. */		usb_hcd_resume_root_hub(hcd);	}	return 0;}
开发者ID:AmesianX,项目名称:telechips-linux,代码行数:25,


示例18: xhci_resume

//.........这里部分代码省略.........				!(xhci_all_ports_seen_u0(xhci))) {			del_timer_sync(&xhci->comp_mode_recovery_timer);			xhci_dbg_trace(xhci, trace_xhci_dbg_quirks,				"Compliance Mode Recovery Timer deleted!");		}		/* Let the USB core know _both_ roothubs lost power. */		usb_root_hub_lost_power(xhci->main_hcd->self.root_hub);		usb_root_hub_lost_power(xhci->shared_hcd->self.root_hub);		xhci_dbg(xhci, "Stop HCD/n");		xhci_halt(xhci);		xhci_reset(xhci);		spin_unlock_irq(&xhci->lock);		xhci_cleanup_msix(xhci);		xhci_dbg(xhci, "// Disabling event ring interrupts/n");		temp = readl(&xhci->op_regs->status);		writel(temp & ~STS_EINT, &xhci->op_regs->status);		temp = readl(&xhci->ir_set->irq_pending);		writel(ER_IRQ_DISABLE(temp), &xhci->ir_set->irq_pending);		xhci_print_ir_set(xhci, 0);		xhci_dbg(xhci, "cleaning up memory/n");		xhci_mem_cleanup(xhci);		xhci_dbg(xhci, "xhci_stop completed - status = %x/n",			    readl(&xhci->op_regs->status));		/* USB core calls the PCI reinit and start functions twice:		 * first with the primary HCD, and then with the secondary HCD.		 * If we don't do the same, the host will never be started.		 */		if (!usb_hcd_is_primary_hcd(hcd))			secondary_hcd = hcd;		else			secondary_hcd = xhci->shared_hcd;		xhci_dbg(xhci, "Initialize the xhci_hcd/n");		retval = xhci_init(hcd->primary_hcd);		if (retval)			return retval;		comp_timer_running = true;		xhci_dbg(xhci, "Start the primary HCD/n");		retval = xhci_run(hcd->primary_hcd);		if (!retval) {			xhci_dbg(xhci, "Start the secondary HCD/n");			retval = xhci_run(secondary_hcd);		}		hcd->state = HC_STATE_SUSPENDED;		xhci->shared_hcd->state = HC_STATE_SUSPENDED;		goto done;	}	/* step 4: set Run/Stop bit */	command = readl(&xhci->op_regs->command);	command |= CMD_RUN;	writel(command, &xhci->op_regs->command);	xhci_handshake(&xhci->op_regs->status, STS_HALT,		  0, 250 * 1000);	/* step 5: walk topology and initialize portsc,	 * portpmsc and portli	 */	/* this is done in bus_resume */	/* step 6: restart each of the previously	 * Running endpoints by ringing their doorbells	 */	spin_unlock_irq(&xhci->lock); done:	if (retval == 0) {		/* Resume root hubs only when have pending events. */		status = readl(&xhci->op_regs->status);		if (status & STS_EINT) {			usb_hcd_resume_root_hub(hcd);			usb_hcd_resume_root_hub(xhci->shared_hcd);		}	}	/*	 * If system is subject to the Quirk, Compliance Mode Timer needs to	 * be re-initialized Always after a system resume. Ports are subject	 * to suffer the Compliance Mode issue again. It doesn't matter if	 * ports have entered previously to U0 before system's suspension.	 */	if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) && !comp_timer_running)		compliance_mode_recovery_timer_init(xhci);	/* Re-enable port polling. */	xhci_dbg(xhci, "%s: starting port polling./n", __func__);	set_bit(HCD_FLAG_POLL_RH, &hcd->flags);	usb_hcd_poll_rh_status(hcd);	set_bit(HCD_FLAG_POLL_RH, &xhci->shared_hcd->flags);	usb_hcd_poll_rh_status(xhci->shared_hcd);	return retval;}
开发者ID:redareda9,项目名称:linux,代码行数:101,


示例19: msm_hsic_resume

static int msm_hsic_resume(struct msm_hsic_hcd *mehci){	struct usb_hcd *hcd = hsic_to_hcd(mehci);	int cnt = 0, ret;	unsigned temp;	int min_vol, max_vol;	if (!atomic_read(&mehci->in_lpm)) {		dev_dbg(mehci->dev, "%s called in !in_lpm/n", __func__);		return 0;	}	if (mehci->wakeup_irq_enabled) {		disable_irq_wake(mehci->wakeup_irq);		disable_irq_nosync(mehci->wakeup_irq);		mehci->wakeup_irq_enabled = 0;	}	wake_lock(&mehci->wlock);	if (mehci->bus_perf_client && debug_bus_voting_enabled) {		mehci->bus_vote = true;		queue_work(ehci_wq, &mehci->bus_vote_w);	}	min_vol = vdd_val[mehci->vdd_type][VDD_MIN];	max_vol = vdd_val[mehci->vdd_type][VDD_MAX];	ret = regulator_set_voltage(mehci->hsic_vddcx, min_vol, max_vol);	if (ret < 0)		dev_err(mehci->dev, "unable to set nominal vddcx voltage (no VDD MIN)/n");	clk_prepare_enable(mehci->core_clk);	clk_prepare_enable(mehci->phy_clk);	clk_prepare_enable(mehci->cal_clk);	clk_prepare_enable(mehci->ahb_clk);	temp = readl_relaxed(USB_USBCMD);	temp &= ~ASYNC_INTR_CTRL;	temp &= ~ULPI_STP_CTRL;	writel_relaxed(temp, USB_USBCMD);	if (!(readl_relaxed(USB_PORTSC) & PORTSC_PHCD))		goto skip_phy_resume;	temp = readl_relaxed(USB_PORTSC);	temp &= ~(PORT_RWC_BITS | PORTSC_PHCD);	writel_relaxed(temp, USB_PORTSC);	while (cnt < PHY_RESUME_TIMEOUT_USEC) {		if (!(readl_relaxed(USB_PORTSC) & PORTSC_PHCD) &&			(readl_relaxed(USB_ULPI_VIEWPORT) & ULPI_SYNC_STATE))			break;		udelay(1);		cnt++;	}	if (cnt >= PHY_RESUME_TIMEOUT_USEC) {		/*		 * This is a fatal error. Reset the link and		 * PHY to make hsic working.		 */		dev_err(mehci->dev, "Unable to resume USB. Reset the hsic/n");		msm_hsic_config_gpios(mehci, 0);		msm_hsic_reset(mehci);	}skip_phy_resume:	usb_hcd_resume_root_hub(hcd);	atomic_set(&mehci->in_lpm, 0);	if (mehci->async_int) {		mehci->async_int = false;		pm_runtime_put_noidle(mehci->dev);		enable_irq(hcd->irq);	}	if (atomic_read(&mehci->pm_usage_cnt)) {		atomic_set(&mehci->pm_usage_cnt, 0);		pm_runtime_put_noidle(mehci->dev);	}	dev_dbg(mehci->dev, "HSIC-USB exited from low power mode/n");	return 0;}
开发者ID:x942,项目名称:GuardianKernel-Mako,代码行数:87,


示例20: ohci_pci_resume

static int ohci_pci_resume (struct usb_hcd *hcd){	set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);	usb_hcd_resume_root_hub(hcd);	return 0;}
开发者ID:B-Rich,项目名称:linux_drivers,代码行数:6,


示例21: msm_ehci_resume

static int msm_ehci_resume(struct msm_hcd *mhcd){	struct usb_hcd *hcd = mhcd_to_hcd(mhcd);	unsigned long timeout;	unsigned temp;	int ret;	if (!atomic_read(&mhcd->in_lpm)) {		dev_dbg(mhcd->dev, "%s called in !in_lpm/n", __func__);		return 0;	}	//ASUS_BSP+++ BennyCheng "implement ehci3 phy power collapse mode"	mutex_lock(&mhcd->ehci_mutex);	//ASUS_BSP--- BennyCheng "implement ehci3 phy power collapse mode"	if (mhcd->pmic_gpio_dp_irq_enabled) {		disable_irq_wake(mhcd->pmic_gpio_dp_irq);		disable_irq_nosync(mhcd->pmic_gpio_dp_irq);		mhcd->pmic_gpio_dp_irq_enabled = 0;	}	wake_lock(&mhcd->wlock);	/* Vote for TCXO when waking up the phy */	ret = msm_xo_mode_vote(mhcd->xo_handle, MSM_XO_MODE_ON);	if (ret)		dev_err(mhcd->dev, "%s failed to vote for "			"TCXO D0 buffer%d/n", __func__, ret);	clk_prepare_enable(mhcd->core_clk);	clk_prepare_enable(mhcd->iface_clk);	msm_ehci_config_vddcx(mhcd, 1);	//ASUS_BSP+++ BennyCheng "implement ehci3 phy power collapse mode"	if (mhcd->lpm_flags & PHY_PWR_COLLAPSED) {		msm_ehci_ldo_enable(mhcd, 1);		mhcd->lpm_flags &= ~PHY_PWR_COLLAPSED;	}	//ASUS_BSP--- BennyCheng "implement ehci3 phy power collapse mode"	temp = readl_relaxed(USB_USBCMD);	temp &= ~ASYNC_INTR_CTRL;	temp &= ~ULPI_STP_CTRL;	writel_relaxed(temp, USB_USBCMD);	if (!(readl_relaxed(USB_PORTSC) & PORTSC_PHCD))		goto skip_phy_resume;	temp = readl_relaxed(USB_PORTSC) & ~PORTSC_PHCD;	writel_relaxed(temp, USB_PORTSC);	timeout = jiffies + usecs_to_jiffies(PHY_RESUME_TIMEOUT_USEC);	while ((readl_relaxed(USB_PORTSC) & PORTSC_PHCD) ||			!(readl_relaxed(USB_ULPI_VIEWPORT) & ULPI_SYNC_STATE)) {		if (time_after(jiffies, timeout)) {			/*This is a fatal error. Reset the link and PHY*/			dev_err(mhcd->dev, "Unable to resume USB. Resetting the h/w/n");			msm_hsusb_reset(mhcd);			break;		}		udelay(1);	}skip_phy_resume:	usb_hcd_resume_root_hub(hcd);	atomic_set(&mhcd->in_lpm, 0);	if (mhcd->async_int) {		mhcd->async_int = false;		pm_runtime_put_noidle(mhcd->dev);		enable_irq(hcd->irq);	}	if (atomic_read(&mhcd->pm_usage_cnt)) {		atomic_set(&mhcd->pm_usage_cnt, 0);		pm_runtime_put_noidle(mhcd->dev);	}	//ASUS_BSP+++ BennyCheng "implement ehci3 phy power collapse mode"	mutex_unlock(&mhcd->ehci_mutex);	//ASUS_BSP--- BennyCheng "implement ehci3 phy power collapse mode"	dev_info(mhcd->dev, "EHCI USB exited from low power mode/n");	return 0;}
开发者ID:joutcast,项目名称:ASUS_A80_source,代码行数:88,



注:本文中的usb_hcd_resume_root_hub函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ usb_ifnum_to_if函数代码示例
C++ usb_hcd_pci_remove函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。