本文整理汇总了C++中pm_runtime_put_noidle函数的典型用法代码示例。如果您正苦于以下问题:C++ pm_runtime_put_noidle函数的具体用法?C++ pm_runtime_put_noidle怎么用?C++ pm_runtime_put_noidle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pm_runtime_put_noidle函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wil_pm_runtime_allow
void wil_pm_runtime_allow(struct wil6210_priv *wil)
{
struct device *dev = wil_to_dev(wil);
pm_runtime_put_noidle(dev);
pm_runtime_set_autosuspend_delay(dev, WIL6210_AUTOSUSPEND_DELAY_MS);
pm_runtime_use_autosuspend(dev);
pm_runtime_allow(dev);
}
示例2: 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;
}
示例3: omap2430_musb_init
static int omap2430_musb_init(struct musb *musb)
{
u32 l;
int status = 0;
struct device *dev = musb->controller;
struct musb_hdrc_platform_data *plat = dev->platform_data;
struct omap_musb_board_data *data = plat->board_data;
musb->xceiv = usb_get_transceiver();
if (!musb->xceiv) {
pr_err("HS USB OTG: no transceiver configured\n");
return -ENODEV;
}
INIT_WORK(&musb->otg_notifier_work, musb_otg_notifier_work);
status = pm_runtime_get_sync(dev);
if (status < 0) {
dev_err(dev, "pm_runtime_get_sync FAILED %d\n", status);
goto err1;
}
l = musb_readl(musb->mregs, OTG_INTERFSEL);
if (data->interface_type == MUSB_INTERFACE_UTMI) {
l &= ~ULPI_12PIN;
l |= UTMI_8BIT;
} else {
l |= ULPI_12PIN;
}
musb_writel(musb->mregs, OTG_INTERFSEL, l);
pr_debug("HS USB OTG: revision 0x%x, sysconfig 0x%02x, "
"sysstatus 0x%x, intrfsel 0x%x, simenable 0x%x\n",
musb_readl(musb->mregs, OTG_REVISION),
musb_readl(musb->mregs, OTG_SYSCONFIG),
musb_readl(musb->mregs, OTG_SYSSTATUS),
musb_readl(musb->mregs, OTG_INTERFSEL),
musb_readl(musb->mregs, OTG_SIMENABLE));
musb->nb.notifier_call = musb_otg_notifications;
status = usb_register_notifier(musb->xceiv, &musb->nb);
if (status)
dev_dbg(musb->controller, "notification register failed\n");
setup_timer(&musb_idle_timer, musb_do_idle, (unsigned long) musb);
pm_runtime_put_noidle(musb->controller);
return 0;
err1:
return status;
}
示例4: amba_remove
static int amba_remove(struct device *dev)
{
struct amba_device *pcdev = to_amba_device(dev);
struct amba_driver *drv = to_amba_driver(dev->driver);
int ret;
pm_runtime_get_sync(dev);
ret = drv->remove(pcdev);
pm_runtime_put_noidle(dev);
/* Undo the runtime PM settings in amba_probe() */
pm_runtime_disable(dev);
pm_runtime_set_suspended(dev);
pm_runtime_put_noidle(dev);
amba_put_disable_pclk(pcdev);
return ret;
}
示例5: exynos_ohci_bus_suspend
static int exynos_ohci_bus_suspend(struct usb_hcd *hcd)
{
int ret;
ret = ohci_bus_suspend(hcd);
/* Decrease pm_count that was increased at s5p_ehci_resume func. */
pm_runtime_put_noidle(hcd->self.controller);
return ret;
}
示例6: 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;
}
示例7: usb_autopm_put_interface_no_suspend
/**
* usb_autopm_put_interface_no_suspend - decrement a USB interface's PM-usage counter
* @intf: the usb_interface whose counter should be decremented
*
* This routine decrements @intf's usage counter but does not carry out an
* autosuspend.
*
* This routine can run in atomic context.
*/
void usb_autopm_put_interface_no_suspend(struct usb_interface *intf)
{
struct usb_device *udev = interface_to_usbdev(intf);
usb_mark_last_busy(udev);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
atomic_dec(&intf->pm_usage_cnt);
#else
intf->pm_usage_cnt--;
#endif
pm_runtime_put_noidle(&intf->dev);
}
示例8: cyttsp5_spi_read_default_nosize
static int cyttsp5_spi_read_default_nosize(struct cyttsp5_adapter *adap,
void *buf, int max)
{
struct cyttsp5_spi *ts = dev_get_drvdata(adap->dev);
int rc;
pm_runtime_get_noresume(adap->dev);
mutex_lock(&ts->lock);
rc = cyttsp5_spi_read_default_nosize_(adap, buf, max);
mutex_unlock(&ts->lock);
pm_runtime_put_noidle(adap->dev);
return rc;
}
示例9: iommu_enable
static int iommu_enable(struct omap_iommu *obj)
{
int ret;
if (!arch_iommu)
return -ENODEV;
ret = pm_runtime_get_sync(obj->dev);
if (ret < 0)
pm_runtime_put_noidle(obj->dev);
return ret < 0 ? ret : 0;
}
示例10: cyttsp5_spi_write_read_specific
static int cyttsp5_spi_write_read_specific(struct cyttsp5_adapter *adap,
u8 write_len, u8 *write_buf, u8 *read_buf)
{
struct cyttsp5_spi *ts = dev_get_drvdata(adap->dev);
int rc;
pm_runtime_get_noresume(adap->dev);
mutex_lock(&ts->lock);
rc = cyttsp5_spi_write_read_specific_(adap, write_len, write_buf,
read_buf);
mutex_unlock(&ts->lock);
pm_runtime_put_noidle(adap->dev);
return rc;
}
示例11: omap_rng_probe
static int omap_rng_probe(struct platform_device *pdev)
{
struct omap_rng_dev *priv;
struct resource *res;
struct device *dev = &pdev->dev;
int ret;
priv = devm_kzalloc(dev, sizeof(struct omap_rng_dev), GFP_KERNEL);
if (!priv)
return -ENOMEM;
omap_rng_ops.priv = (unsigned long)priv;
platform_set_drvdata(pdev, priv);
priv->dev = dev;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
priv->base = devm_ioremap_resource(dev, res);
if (IS_ERR(priv->base)) {
ret = PTR_ERR(priv->base);
goto err_ioremap;
}
pm_runtime_enable(&pdev->dev);
ret = pm_runtime_get_sync(&pdev->dev);
if (ret) {
dev_err(&pdev->dev, "Failed to runtime_get device: %d\n", ret);
pm_runtime_put_noidle(&pdev->dev);
goto err_ioremap;
}
ret = (dev->of_node) ? of_get_omap_rng_device_details(priv, pdev) :
get_omap_rng_device_details(priv);
if (ret)
goto err_ioremap;
ret = hwrng_register(&omap_rng_ops);
if (ret)
goto err_register;
dev_info(&pdev->dev, "OMAP Random Number Generator ver. %02x\n",
omap_rng_read(priv, RNG_REV_REG));
return 0;
err_register:
priv->base = NULL;
pm_runtime_disable(&pdev->dev);
err_ioremap:
dev_err(dev, "initialization failed.\n");
return ret;
}
示例12: cyttsp4_i2c_write
static int cyttsp4_i2c_write(struct cyttsp4_adapter *adap, u8 addr,
const void *buf, int size)
{
struct cyttsp4_i2c *ts = dev_get_drvdata(adap->dev);
int rc;
pm_runtime_get_noresume(adap->dev);
mutex_lock(&ts->lock);
rc = cyttsp4_i2c_write_block_data(ts, addr, size, buf);
mutex_unlock(&ts->lock);
pm_runtime_put_noidle(adap->dev);
return rc;
}
示例13: pa12203001_set_power_state
static int pa12203001_set_power_state(struct pa12203001_data *data, bool on,
u8 mask)
{
#ifdef CONFIG_PM
int ret;
if (on && (mask & PA12203001_ALS_EN_MASK)) {
mutex_lock(&data->lock);
if (data->px_enabled) {
ret = pa12203001_als_enable(data,
PA12203001_ALS_EN_MASK);
if (ret < 0)
goto err;
} else {
data->als_needs_enable = true;
}
mutex_unlock(&data->lock);
}
if (on && (mask & PA12203001_PX_EN_MASK)) {
mutex_lock(&data->lock);
if (data->als_enabled) {
ret = pa12203001_px_enable(data, PA12203001_PX_EN_MASK);
if (ret < 0)
goto err;
} else {
data->px_needs_enable = true;
}
mutex_unlock(&data->lock);
}
if (on) {
ret = pm_runtime_get_sync(&data->client->dev);
if (ret < 0)
pm_runtime_put_noidle(&data->client->dev);
} else {
pm_runtime_mark_last_busy(&data->client->dev);
ret = pm_runtime_put_autosuspend(&data->client->dev);
}
return ret;
err:
mutex_unlock(&data->lock);
return ret;
#endif
return 0;
}
示例14: cyttsp4_spi_read
static int cyttsp4_spi_read(struct cyttsp4_adapter *adap, u16 addr,
void *buf, int size, int max_xfer)
{
struct cyttsp4_spi *ts = dev_get_drvdata(adap->dev);
int rc;
pm_runtime_get_noresume(adap->dev);
mutex_lock(&ts->lock);
rc = cyttsp4_spi_read_block_data(ts, addr, size, buf, max_xfer);
mutex_unlock(&ts->lock);
pm_runtime_put_noidle(adap->dev);
return rc;
}
示例15: wil_pm_runtime_get
int wil_pm_runtime_get(struct wil6210_priv *wil)
{
int rc;
struct device *dev = wil_to_dev(wil);
rc = pm_runtime_get_sync(dev);
if (rc < 0) {
wil_err(wil, "pm_runtime_get_sync() failed, rc = %d\n", rc);
pm_runtime_put_noidle(dev);
return rc;
}
return 0;
}