当前位置: 首页>>代码示例>>C++>>正文


C++ pm_runtime_get_noresume函数代码示例

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


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

示例1: intel_sst_remove

/**
* intel_sst_remove - PCI remove function
*
* @pci:	PCI device structure
*
* This function is called by OS when a device is unloaded
* This frees the interrupt etc
*/
static void __devexit intel_sst_remove(struct pci_dev *pci)
{
	pm_runtime_get_noresume(&pci->dev);
	pm_runtime_forbid(&pci->dev);
	pci_dev_put(sst_drv_ctx->pci);
	mutex_lock(&sst_drv_ctx->sst_lock);
	sst_drv_ctx->sst_state = SST_UN_INIT;
	mutex_unlock(&sst_drv_ctx->sst_lock);
	misc_deregister(&lpe_ctrl);
	free_irq(pci->irq, sst_drv_ctx);
	iounmap(sst_drv_ctx->dram);
	iounmap(sst_drv_ctx->iram);
	iounmap(sst_drv_ctx->mailbox);
	iounmap(sst_drv_ctx->shim);
	sst_drv_ctx->pmic_state = SND_MAD_UN_INIT;
	if (sst_drv_ctx->pci_id == SST_MRST_PCI_ID) {
		misc_deregister(&lpe_dev);
		kfree(sst_drv_ctx->mmap_mem);
	} else
		kfree(sst_drv_ctx->fw_cntx);
	flush_scheduled_work();
	destroy_workqueue(sst_drv_ctx->process_reply_wq);
	destroy_workqueue(sst_drv_ctx->process_msg_wq);
	destroy_workqueue(sst_drv_ctx->post_msg_wq);
	destroy_workqueue(sst_drv_ctx->mad_wq);
	kfree(pci_get_drvdata(pci));
	sst_drv_ctx = NULL;
	pci_release_regions(pci);
	pci_disable_device(pci);
	pci_set_drvdata(pci, NULL);
}
开发者ID:303750856,项目名称:linux-3.1,代码行数:39,代码来源:intel_sst.c

示例2: wil_pm_runtime_forbid

void wil_pm_runtime_forbid(struct wil6210_priv *wil)
{
	struct device *dev = wil_to_dev(wil);

	pm_runtime_forbid(dev);
	pm_runtime_get_noresume(dev);
}
开发者ID:avagin,项目名称:linux,代码行数:7,代码来源:pm.c

示例3: xhci_ush_pci_remove

static void xhci_ush_pci_remove(struct pci_dev *dev)
{
	struct xhci_hcd *xhci;

	xhci = hcd_to_xhci(pci_get_drvdata(dev));
	if (xhci->shared_hcd) {
		usb_remove_hcd(xhci->shared_hcd);
		usb_put_hcd(xhci->shared_hcd);
	}

	if (!pci_dev_run_wake(dev))
		pm_runtime_get_noresume(&dev->dev);

	pm_runtime_forbid(&dev->dev);

	usb_hcd_pci_remove(dev);

	/* Free the aux irq */
	hsic_aux_irq_free();
	hsic_wakeup_irq_free();
	gpio_free(hsic.aux_gpio);
	gpio_free(hsic.wakeup_gpio);

	hsic.port_disconnect = 1;
	hsic_enable = 0;
	wake_lock_destroy(&(hsic.resume_wake_lock));
	wake_lock_destroy(&hsic.s3_wake_lock);
	usb_unregister_notify(&hsic.hsic_pm_nb);
	unregister_pm_notifier(&hsic.hsic_s3_entry_nb);

	kfree(xhci);
}
开发者ID:NotKit,项目名称:android-ia_kernel_intel_baytrail,代码行数:32,代码来源:xhci-ush-pci.c

示例4: cyttsp4_btn_release

static int cyttsp4_btn_release(struct cyttsp4_device *ttsp)
{
	struct device *dev = &ttsp->dev;
	struct cyttsp4_btn_data *bd = dev_get_drvdata(dev);

	dev_dbg(dev, "%s\n", __func__);

#ifdef CONFIG_HAS_EARLYSUSPEND
	/*
	 * This check is to prevent pm_runtime usage_count drop below zero
	 * because of removing the module while in suspended state
	 */
	if (bd->is_suspended)
		pm_runtime_get_noresume(dev);

	unregister_early_suspend(&bd->es);
#endif

	if (bd->input_device_registered) {
		input_unregister_device(bd->input);
	} else {
		input_free_device(bd->input);
		cyttsp4_unsubscribe_attention(ttsp, CY_ATTEN_STARTUP,
			cyttsp4_setup_input_attention, 0);
	}

	pm_runtime_suspend(dev);
	pm_runtime_disable(dev);

	dev_set_drvdata(dev, NULL);
	kfree(bd);
	return 0;
}
开发者ID:XePeleato,项目名称:android_kernel_huawei_venus,代码行数:33,代码来源:cyttsp4_btn.c

示例5: amba_probe

/*
 * These are the device model conversion veneers; they convert the
 * device model structures to our more specific structures.
 */
static int amba_probe(struct device *dev)
{
    struct amba_device *pcdev = to_amba_device(dev);
    struct amba_driver *pcdrv = to_amba_driver(dev->driver);
    const struct amba_id *id = amba_lookup(pcdrv->id_table, pcdev);
    int ret;

    do {
        ret = amba_get_enable_pclk(pcdev);
        if (ret)
            break;

        pm_runtime_get_noresume(dev);
        pm_runtime_set_active(dev);
        pm_runtime_enable(dev);

        ret = pcdrv->probe(pcdev, id);
        if (ret == 0)
            break;

        pm_runtime_disable(dev);
        pm_runtime_set_suspended(dev);
        pm_runtime_put_noidle(dev);

        amba_put_disable_pclk(pcdev);
    } while (0);

    return ret;
}
开发者ID:mozzwald,项目名称:linux-2.6,代码行数:33,代码来源:bus.c

示例6: dw_mci_rockchip_probe

static int dw_mci_rockchip_probe(struct platform_device *pdev)
{
	const struct dw_mci_drv_data *drv_data;
	const struct of_device_id *match;
	int ret;

	if (!pdev->dev.of_node)
		return -ENODEV;

	match = of_match_node(dw_mci_rockchip_match, pdev->dev.of_node);
	drv_data = match->data;

	pm_runtime_get_noresume(&pdev->dev);
	pm_runtime_set_active(&pdev->dev);
	pm_runtime_enable(&pdev->dev);
	pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
	pm_runtime_use_autosuspend(&pdev->dev);

	ret = dw_mci_pltfm_register(pdev, drv_data);
	if (ret) {
		pm_runtime_disable(&pdev->dev);
		pm_runtime_set_suspended(&pdev->dev);
		pm_runtime_put_noidle(&pdev->dev);
		return ret;
	}

	pm_runtime_put_autosuspend(&pdev->dev);

	return 0;
}
开发者ID:forgivemyheart,项目名称:linux,代码行数:30,代码来源:dw_mmc-rockchip.c

示例7: __device_release_driver

/*
 * __device_release_driver() must be called with @dev lock held.
 * When called for a USB interface, @dev->parent lock must be held as well.
 */
static void __device_release_driver(struct device *dev)
{
	struct device_driver *drv;

	drv = dev->driver;
	if (drv) {
		pm_runtime_get_noresume(dev);
		pm_runtime_barrier(dev);

		driver_sysfs_remove(dev);

		if (dev->bus)
			blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
						     BUS_NOTIFY_UNBIND_DRIVER,
						     dev);

		if (dev->bus && dev->bus->remove)
			dev->bus->remove(dev);
		else if (drv->remove)
			drv->remove(dev);
		devres_release_all(dev);
		dev->driver = NULL;
		klist_remove(&dev->p->knode_driver);
		if (dev->bus)
			blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
						     BUS_NOTIFY_UNBOUND_DRIVER,
						     dev);

		pm_runtime_put_sync(dev);
	}
}
开发者ID:A2109devs,项目名称:lenovo_a2109a_kernel,代码行数:35,代码来源:dd.c

示例8: device_attach

/**
 * device_attach - try to attach device to a driver.
 * @dev: device.
 *
 * Walk the list of drivers that the bus has and call
 * driver_probe_device() for each pair. If a compatible
 * pair is found, break out and return.
 *
 * Returns 1 if the device was bound to a driver;
 * 0 if no matching driver was found;
 * -ENODEV if the device is not registered.
 *
 * When called for a USB interface, @dev->parent lock must be held.
 */
int device_attach(struct device *dev)
{
	int ret = 0;

	device_lock(dev);
	if (dev->driver) {
		if (klist_node_attached(&dev->p->knode_driver)) {
			ret = 1;
			goto out_unlock;
		}
		ret = device_bind_driver(dev);
		if (ret == 0)
			ret = 1;
		else {
			dev->driver = NULL;
			ret = 0;
		}
	} else {
		pm_runtime_get_noresume(dev);
		ret = bus_for_each_drv(dev->bus, NULL, dev, __device_attach);
		pm_runtime_put_sync(dev);
	}
out_unlock:
	device_unlock(dev);
	return ret;
}
开发者ID:andi34,项目名称:Dhollmen_Kernel,代码行数:40,代码来源:dd.c

示例9: xhci_ush_pci_remove

static void xhci_ush_pci_remove(struct pci_dev *dev)
{
	struct xhci_hcd *xhci;

	xhci = hcd_to_xhci(pci_get_drvdata(dev));
	if (xhci->shared_hcd) {
		usb_remove_hcd(xhci->shared_hcd);
		usb_put_hcd(xhci->shared_hcd);
	}

	if (!pci_dev_run_wake(dev))
		pm_runtime_get_noresume(&dev->dev);

	pm_runtime_forbid(&dev->dev);

	usb_hcd_pci_remove(dev);

	/* Free the aux irq */
	hsic_aux_irq_free();
	hsic_wakeup_irq_free();
	gpio_free(hsic.aux_gpio);
	gpio_free(hsic.wakeup_gpio);

	hsic.hsic_stopped = 1;
	hsic_enable = 0;

	kfree(xhci);
}
开发者ID:AirShark,项目名称:android_kernel_lenovo_redhookbay,代码行数:28,代码来源:xhci-ush-pci.c

示例10: hsic_send

static int hsic_send(struct link_device *ld, struct io_device *iod,
							struct sk_buff *skb)
{
	int ret, rpm_state;
	struct usb_link_device *usb_ld = to_usb_link_device(ld);
	struct link_pm_data *pm_data = usb_ld->link_pm_data;

	if (!usb_ld->if_usb_connected)
		goto link_disconnect;

	/* delay for net channel, limited by xmm6260 capacity */
	if (iod->send_delay && (iod->io_typ == IODEV_NET) \
			&& (1400 == skb->len))
		udelay(iod->send_delay);

	rpm_state = hsic_pm_runtime_get_active_async(pm_data);
	if (rpm_state == -ENODEV)
		goto link_disconnect;

	pm_runtime_get_noresume(&usb_ld->usbdev->dev);

	ret = hsic_tx_skb(&usb_ld->devdata[iod->id], skb);

	usb_mark_last_busy(usb_ld->usbdev);
	pm_runtime_put(&usb_ld->usbdev->dev);

	return ret;

link_disconnect:
	if (iod->io_typ != IODEV_NET)
		report_modem_state(ld, MODEM_EVENT_DISCONN);
	return -EINVAL;
}
开发者ID:hedongjie,项目名称:m35x,代码行数:33,代码来源:modem_hsic.c

示例11: wl1271_remove

static void wl1271_remove(struct sdio_func *func)
{
	struct wl12xx_sdio_glue *glue = sdio_get_drvdata(func);

	/* Undo decrement done above in wl1271_probe */
	pm_runtime_get_noresume(&func->dev);

	platform_device_unregister(glue->core);
}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:9,代码来源:sdio.c

示例12: ufshcd_pci_remove

/**
 * ufshcd_pci_remove - de-allocate PCI/SCSI host and host memory space
 *		data structure memory
 * @pdev - pointer to PCI handle
 */
static void ufshcd_pci_remove(struct pci_dev *pdev)
{
	struct ufs_hba *hba = pci_get_drvdata(pdev);

	pm_runtime_forbid(&pdev->dev);
	pm_runtime_get_noresume(&pdev->dev);
	ufshcd_remove(hba);
	pci_set_drvdata(pdev, NULL);
}
开发者ID:AD5GB,项目名称:wicked_kernel_lge_hammerhead,代码行数:14,代码来源:ufshcd-pci.c

示例13: exynos_drd_switch_start_host

/**
 * exynos_drd_switch_start_host -  helper function for starting/stoping the host
 * controller driver.
 *
 * @otg: Pointer to the usb_otg structure.
 * @on: start / stop the host controller driver.
 *
 * Returns 0 on success otherwise negative errno.
 */
static int exynos_drd_switch_start_host(struct usb_otg *otg, int on)
{
    struct exynos_drd_switch *drd_switch = container_of(otg,
                                           struct exynos_drd_switch, otg);
    struct usb_hcd *hcd;
    struct device *xhci_dev;
    int ret = 0;

    if (!otg->host)
        return -EINVAL;

    dev_dbg(otg->phy->dev, "Turn %s host %s\n",
            on ? "on" : "off", otg->host->bus_name);

    hcd = bus_to_hcd(otg->host);
    xhci_dev = hcd->self.controller;

    if (on) {
#if !defined(CONFIG_USB_HOST_NOTIFY)
        wake_lock(&drd_switch->wakelock);
#endif
        /*
         * Clear runtime_error flag. The flag could be
         * set when user space accessed the host while DRD
         * was in B-Dev mode.
         */
        pm_runtime_disable(xhci_dev);
        if (pm_runtime_status_suspended(xhci_dev))
            pm_runtime_set_suspended(xhci_dev);
        else
            pm_runtime_set_active(xhci_dev);
        pm_runtime_enable(xhci_dev);

        ret = pm_runtime_get_sync(xhci_dev);
        if (ret < 0 && ret != -EINPROGRESS) {
            pm_runtime_put_noidle(xhci_dev);
            goto err;
        }

        exynos_drd_switch_ases_vbus_ctrl(drd_switch, 1);
    } else {
        exynos_drd_switch_ases_vbus_ctrl(drd_switch, 0);

        ret = pm_runtime_put_sync(xhci_dev);
        if (ret == -EAGAIN)
            pm_runtime_get_noresume(xhci_dev);
#if !defined(CONFIG_USB_HOST_NOTIFY)
        else
            wake_unlock(&drd_switch->wakelock);
#endif
    }

err:
    /* ret can be 1 after pm_runtime_get_sync */
    return (ret < 0) ? ret : 0;
}
开发者ID:halaszk,项目名称:android_kernel_samsung_lt03,代码行数:65,代码来源:exynos-drd-switch.c

示例14: serial_hsu_pci_port_remove

static void serial_hsu_pci_port_remove(struct pci_dev *pdev)
{
	struct uart_hsu_port *up = pci_get_drvdata(pdev);

	pm_runtime_forbid(&pdev->dev);
	pm_runtime_get_noresume(&pdev->dev);
	serial_hsu_port_free(up);
	pci_set_drvdata(pdev, NULL);
	pci_disable_device(pdev);
}
开发者ID:Katarzynasrom,项目名称:android_kernel_lenovo_spark,代码行数:10,代码来源:mfd_pci.c

示例15: replicator_probe

static int replicator_probe(struct platform_device *pdev)
{
	int ret;
	struct device *dev = &pdev->dev;
	struct coresight_platform_data *pdata = NULL;
	struct replicator_drvdata *drvdata;
	struct coresight_desc desc = { 0 };
	struct device_node *np = pdev->dev.of_node;

	if (np) {
		pdata = of_get_coresight_platform_data(dev, np);
		if (IS_ERR(pdata))
			return PTR_ERR(pdata);
		pdev->dev.platform_data = pdata;
	}

	drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
	if (!drvdata)
		return -ENOMEM;

	drvdata->dev = &pdev->dev;
	drvdata->atclk = devm_clk_get(&pdev->dev, "atclk"); /* optional */
	if (!IS_ERR(drvdata->atclk)) {
		ret = clk_prepare_enable(drvdata->atclk);
		if (ret)
			return ret;
	}
	pm_runtime_get_noresume(&pdev->dev);
	pm_runtime_set_active(&pdev->dev);
	pm_runtime_enable(&pdev->dev);
	platform_set_drvdata(pdev, drvdata);

	desc.type = CORESIGHT_DEV_TYPE_LINK;
	desc.subtype.link_subtype = CORESIGHT_DEV_SUBTYPE_LINK_SPLIT;
	desc.ops = &replicator_cs_ops;
	desc.pdata = pdev->dev.platform_data;
	desc.dev = &pdev->dev;
	drvdata->csdev = coresight_register(&desc);
	if (IS_ERR(drvdata->csdev)) {
		ret = PTR_ERR(drvdata->csdev);
		goto out_disable_pm;
	}

	pm_runtime_put(&pdev->dev);

	return 0;

out_disable_pm:
	if (!IS_ERR(drvdata->atclk))
		clk_disable_unprepare(drvdata->atclk);
	pm_runtime_put_noidle(&pdev->dev);
	pm_runtime_disable(&pdev->dev);

	return ret;
}
开发者ID:AshishNamdev,项目名称:linux,代码行数:55,代码来源:coresight-replicator.c


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