• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ pm_runtime_suspend函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: cyttsp4_debug_release

static int cyttsp4_debug_release(struct cyttsp4_device *ttsp)
{
	struct device *dev = &ttsp->dev;
	struct cyttsp4_debug_data *dd = dev_get_drvdata(dev);
	int rc = 0;
	dev_dbg(dev, "%s\n", __func__);

	if (dev_get_drvdata(&ttsp->core->dev) == NULL) {
		dev_err(dev, "%s: Error, core driver does not exist. "
			       "Unable to un-subscribe attention\n",
				__func__);
		goto cyttsp4_debug_release_exit;
	}

	rc = cyttsp4_unsubscribe_attention(ttsp, CY_ATTEN_IRQ,
		cyttsp4_debug_attention, CY_MODE_OPERATIONAL);
	if (rc < 0) {
		dev_err(dev, "%s: Error, "
				"could not un-subscribe attention\n",
				__func__);
		goto cyttsp4_debug_release_exit;
	}

cyttsp4_debug_release_exit:
	pm_runtime_suspend(dev);
	pm_runtime_disable(dev);
	device_remove_file(dev, &dev_attr_int_count);
	dev_set_drvdata(dev, NULL);
	kfree(dd);

	return rc;
}
开发者ID:C457,项目名称:android_kernel_samsung_t110,代码行数:32,代码来源:cyttsp4_debug.c


示例2: cyttsp4_proximity_release

static int cyttsp4_proximity_release(struct cyttsp4_device *ttsp)
{
	struct device *dev = &ttsp->dev;
	struct cyttsp4_proximity_data *pd = dev_get_drvdata(dev);

	tp_log_debug("%s\n", __func__);

	if (pd->input_device_registered) {
		/* Disable proximity sensing */
		mutex_lock(&pd->sysfs_lock);
		if (pd->enable_count)
			_cyttsp4_proximity_disable(pd, true);
		mutex_unlock(&pd->sysfs_lock);
		device_remove_file(dev, &dev_attr_enable);
		input_unregister_device(pd->input);
	} else {
		input_free_device(pd->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(pd);
	return 0;
}
开发者ID:Menpiko,项目名称:SnaPKernel-N6P,代码行数:28,代码来源:cyttsp4_proximity.c


示例3: rvin_release

static int rvin_release(struct file *file)
{
	struct rvin_dev *vin = video_drvdata(file);
	bool fh_singular;
	int ret;

	mutex_lock(&vin->lock);

	/* Save the singular status before we call the clean-up helper */
	fh_singular = v4l2_fh_is_singular_file(file);

	/* the release helper will cleanup any on-going streaming */
	ret = _vb2_fop_release(file, NULL);

	/*
	 * If this was the last open file.
	 * Then de-initialize hw module.
	 */
	if (fh_singular) {
		pm_runtime_suspend(&vin->vdev.dev);
		pm_runtime_disable(&vin->vdev.dev);
		rvin_power_off(vin);
	}

	mutex_unlock(&vin->lock);

	return ret;
}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:28,代码来源:rcar-v4l2.c


示例4: cyttsp5_device_access_release

static int cyttsp5_device_access_release(struct cyttsp5_device *ttsp)
{
	struct device *dev = &ttsp->dev;
	struct cyttsp5_device_access_data *dad = dev_get_drvdata(dev);

	pm_runtime_suspend(dev);
	pm_runtime_disable(dev);

	if (dad->sysfs_nodes_created) {
		device_remove_file(dev, &dev_attr_command);
		device_remove_file(dev, &dev_attr_status);
		device_remove_file(dev, &dev_attr_response);
		device_remove_file(dev, &dev_attr_responsestr);
#ifdef CONFIG_TCMD 
		device_remove_file(dev, &dev_attr_tcmdresponse);
		device_remove_file(dev, &dev_attr_tcmdresponsesize);
		device_remove_file(dev, &dev_attr_tcmdread_status);
#endif
#ifdef TTHE_TUNER_SUPPORT
		debugfs_remove(dad->tthe_get_panel_data_debugfs);
#endif
	} else {
		cyttsp5_unsubscribe_attention(ttsp, CY_ATTEN_STARTUP,
			cyttsp5_setup_sysfs_attention, 0);
	}

	dev_set_drvdata(dev, NULL);
	kfree(dad);
	return 0;
}
开发者ID:Nokius,项目名称:android_kernel_yotaphone2,代码行数:30,代码来源:cyttsp5_device_access.c


示例5: cyttsp4_debug_release

static int cyttsp4_debug_release(struct cyttsp4_device *ttsp)
{
	struct device *dev = &ttsp->dev;
	struct cyttsp4_debug_data *dd = dev_get_drvdata(dev);
	int rc = 0;
	tp_log_debug( "%s\n", __func__);

	if (dev_get_drvdata(&ttsp->core->dev) == NULL) {
		tp_log_err( "%s: Unable to un-subscribe attention\n",
				__func__);
		goto cyttsp4_debug_release_exit;
	}

	/* Unsubscribe from attentions */
	cyttsp4_unsubscribe_attention(ttsp, CY_ATTEN_IRQ,
		cyttsp4_debug_op_attention, CY_MODE_OPERATIONAL);
	cyttsp4_unsubscribe_attention(ttsp, CY_ATTEN_IRQ,
		cyttsp4_debug_cat_attention, CY_MODE_CAT);
	cyttsp4_unsubscribe_attention(ttsp, CY_ATTEN_STARTUP,
		cyttsp4_debug_startup_attention, 0);

cyttsp4_debug_release_exit:
	pm_runtime_suspend(dev);
	pm_runtime_disable(dev);
	device_remove_file(dev, &dev_attr_int_count);
	dev_set_drvdata(dev, NULL);
	kfree(dd);

	return rc;
}
开发者ID:jarpii,项目名称:android_kernel_huawei_Soulfire,代码行数:30,代码来源:cyttsp4_debug.c


示例6: 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


示例7: platform_pm_runtime_idle

int platform_pm_runtime_idle(struct device *dev)
{
	ret = pm_runtime_suspend(dev);
	dev_dbg(dev, "%s [%d]\n", __func__, ret);

	return 0;
};
开发者ID:AdiPat,项目名称:i9003_Kernel,代码行数:7,代码来源:pm_bus.c


示例8: mmc_runtime_idle

static int mmc_runtime_idle(struct device *dev)
{
	int ret;
	
	DBG("[%s] s\n",__func__);

	ret = pm_runtime_suspend(dev);

	DBG("[%s] e\n",__func__);
	/*return pm_runtime_suspend(dev);*/
	return ret;
}
开发者ID:buddyspike,项目名称:springboard-kernel-bsp,代码行数:12,代码来源:bus.c


示例9: cyttsp5_device_access_probe

static int cyttsp5_device_access_probe(struct cyttsp5_device *ttsp)
{
	struct device *dev = &ttsp->dev;
	struct cyttsp5_device_access_data *dad;
	struct cyttsp5_device_access_platform_data *pdata =
			dev_get_platdata(dev);
	int rc = 0;

	dad = kzalloc(sizeof(*dad), GFP_KERNEL);
	if (dad == NULL) {
		dev_err(dev, "%s: Error, kzalloc\n", __func__);
		rc = -ENOMEM;
		goto cyttsp5_device_access_probe_data_failed;
	}

	mutex_init(&dad->sysfs_lock);
	dad->ttsp = ttsp;
	dad->pdata = pdata;
	dev_set_drvdata(dev, dad);
#ifdef TTHE_TUNER_SUPPORT
	mutex_init(&dad->debugfs_lock);
	dad->heatmap.num_element = 200;
#endif

	pm_runtime_enable(dev);
	pm_runtime_get_sync(dev);

	/* get sysinfo */
	dad->si = cyttsp5_request_sysinfo(ttsp);
	pm_runtime_put(dev);
	if (dad->si) {
		rc = cyttsp5_setup_sysfs(ttsp);
		if (rc)
			goto cyttsp5_device_access_setup_sysfs_failed;
	} else {
		dev_err(dev, "%s: Fail get sysinfo pointer from core p=%p\n",
				__func__, dad->si);
		cyttsp5_subscribe_attention(ttsp, CY_ATTEN_STARTUP,
			cyttsp5_setup_sysfs_attention, 0);
	}

	return 0;

 cyttsp5_device_access_setup_sysfs_failed:
	pm_runtime_suspend(dev);
	pm_runtime_disable(dev);
	dev_set_drvdata(dev, NULL);
	kfree(dad);
 cyttsp5_device_access_probe_data_failed:
	dev_err(dev, "%s failed.\n", __func__);
	return rc;
}
开发者ID:Nokius,项目名称:android_kernel_yotaphone2,代码行数:52,代码来源:cyttsp5_device_access.c


示例10: scsi_runtime_idle

static int scsi_runtime_idle(struct device *dev)
{
    int err;

    dev_dbg(dev, "scsi_runtime_idle\n");

    /* Insert hooks here for targets, hosts, and transport classes */

    if (scsi_is_sdev_device(dev)) {
        struct scsi_device *sdev = to_scsi_device(dev);

        if (sdev->request_queue->dev) {
            pm_runtime_mark_last_busy(dev);
            err = pm_runtime_autosuspend(dev);
        } else {
            err = pm_runtime_suspend(dev);
        }
    } else {
        err = pm_runtime_suspend(dev);
    }
    return err;
}
开发者ID:Niisp,项目名称:MT6795.kernel,代码行数:22,代码来源:scsi_pm.c


示例11: lm3561_remove

static int __devexit lm3561_remove(struct i2c_client *client)
{
	struct lm3561_drv_data *data = dev_get_drvdata(&client->dev);
	struct lm3561_platform_data *pdata = client->dev.platform_data;

	remove_sysfs_interfaces(&client->dev);
	pm_runtime_suspend(&client->dev);
	pm_runtime_disable(&client->dev);
	if (pdata->platform_init)
		pdata->platform_init(&client->dev, false);
	kfree(data);
	return 0;
}
开发者ID:Hadramos,项目名称:android_sony_xperiaz_kernel_sources,代码行数:13,代码来源:lm3561.c


示例12: pm_generic_runtime_idle

/**
 * pm_generic_runtime_idle - Generic runtime idle callback for subsystems.
 * @dev: Device to handle.
 *
 * If PM operations are defined for the @dev's driver and they include
 * ->runtime_idle(), execute it and return its error code, if nonzero.
 * Otherwise, execute pm_runtime_suspend() for the device and return 0.
 */
int pm_generic_runtime_idle(struct device *dev)
{
    const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;

    if (pm && pm->runtime_idle) {
        int ret = pm->runtime_idle(dev);
        if (ret)
            return ret;
    }

    pm_runtime_suspend(dev);
    return 0;
}
开发者ID:TeamBliss-Devices,项目名称:android_kernel_samsung_golden,代码行数:21,代码来源:generic_ops.c


示例13: gpu_power_suspend

static void gpu_power_suspend(struct kbase_device *kbdev)
{
	struct exynos_context *platform = (struct exynos_context *) kbdev->platform_context;
	if (!platform)
		return;

	GPU_LOG(DVFS_INFO, DUMMY, 0u, 0u, "power suspend\n");
	gpu_control_enable_customization(kbdev);

	pm_runtime_suspend(kbdev->dev);

	if (platform->early_clk_gating_status)
		gpu_control_disable_clock(kbdev);
}
开发者ID:MukeshMM,项目名称:android_kernel_samsung_j2lte,代码行数:14,代码来源:gpu_notifier.c


示例14: scsi_runtime_idle

static int scsi_runtime_idle(struct device *dev)
{
	int err;

	dev_dbg(dev, "scsi_runtime_idle\n");

	

	if (scsi_is_sdev_device(dev))
		err = pm_schedule_suspend(dev, 100);
	else
		err = pm_runtime_suspend(dev);
	return err;
}
开发者ID:Albinoman887,项目名称:pyramid-3.4.10,代码行数:14,代码来源:scsi_pm.c


示例15: mali_runtime_idle

static int mali_runtime_idle(struct device *device)
{
	MALI_DEBUG_PRINT(4, ("mali_runtime_idle() called\n"));

	if (NULL != device->driver &&
	    NULL != device->driver->pm &&
	    NULL != device->driver->pm->runtime_idle)
	{
		/* Need to notify Mali driver about this event */
		int ret = device->driver->pm->runtime_idle(device);
		if (0 != ret)
		{
			return ret;
		}
	}

	pm_runtime_suspend(device);

	return 0;
}
开发者ID:SeKwonLee,项目名称:Hongik_NECSST_Tizen2.2_kernel,代码行数:20,代码来源:exynos4.c


示例16: ehci_msm_bus_suspend

static int ehci_msm_bus_suspend(struct usb_hcd *hcd)
{
    int ret;
    struct msmusb_hcd *mhcd = hcd_to_mhcd(hcd);
    struct device *dev = hcd->self.controller;

    ret = ehci_bus_suspend(hcd);
    if (ret) {
        pr_err("ehci_bus suspend faield\n");
        return ret;
    }
    if (PHY_TYPE(mhcd->pdata->phy_info) == USB_PHY_INTEGRATED)
        ret = usb_phy_set_suspend(mhcd->xceiv, 1);
    else
        ret = usb_lpm_enter(hcd);

    pm_runtime_put_noidle(dev);
    pm_runtime_suspend(dev);
    wake_unlock(&mhcd->wlock);
    return ret;
}
开发者ID:weritos666,项目名称:ARCHOS_50_Platinum,代码行数:21,代码来源:ehci-msm72k.c


示例17: lm3561_probe

/*
 ****************************************************************************
 * - Device operation such as;
 *   probe, init/exit, remove
 ****************************************************************************
 */
static int __devinit lm3561_probe(struct i2c_client *client,
	  const struct i2c_device_id *id)
{
	struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
	struct lm3561_platform_data *pdata = client->dev.platform_data;
	struct lm3561_drv_data *data;
	int result;

	dev_dbg(&client->dev, "%s\n", __func__);

	if (!pdata) {
		dev_err(&client->dev,
			"%s(): failed during init",
				__func__);
		return -EINVAL;
	}

	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_I2C_BLOCK)) {
		dev_err(&client->dev,
			"%s(): failed during i2c_check_functionality",
			__func__);
		return -EIO;
	}

	data = kzalloc(sizeof(*data), GFP_KERNEL);
	if (!data) {
		dev_err(&client->dev, "%s(): failed during kzalloc", __func__);
		return -ENOMEM;
	}

	dev_set_drvdata(&client->dev, data);
	data->client = client;
	data->led_nums = 1;
	data->torch_current_shift = 0;
	data->flash_current_shift = 0;
	if (pdata->current_limit >= 1500000) {
		data->reg_flash_duration_limit =
			LM3561_FLASH_DURATION_CL_1500MA;
	} else if (pdata->current_limit >= 1000000) {
		data->reg_flash_duration_limit =
			LM3561_FLASH_DURATION_CL_1000MA;
	} else {
		/* current_limit > 1500000uA || current_limit < 1000000uA */
		dev_err(&data->client->dev,
			"%s(): current_limit(%luuA) is invalid\n",
			__func__, pdata->current_limit);
		result = -EINVAL;
		goto err_init;
	}
	mutex_init(&data->lock);
	pm_runtime_enable(&client->dev);
	pm_suspend_ignore_children(&client->dev, true);
	result = pm_runtime_get_sync(&client->dev);
	if (result < 0)
		goto err_setup;
	result = lm3561_chip_init(data, pdata);
	if (result) {
		dev_err(&client->dev, "%s:chip init error\n", __func__);
		goto err_chip_init;
	}
	result = lm3561_create_sysfs_interfaces(&client->dev);
	if (result) {
		dev_err(&data->client->dev,
			"%s(): create sysfs failed",
				__func__);
		goto err_chip_init;
	}
	pm_runtime_set_autosuspend_delay(&client->dev, autosuspend_delay_ms);
	pm_runtime_use_autosuspend(&client->dev);
	pm_runtime_mark_last_busy(&data->client->dev);
	pm_runtime_put_autosuspend(&data->client->dev);
	dev_info(&data->client->dev, "%s: loaded\n", __func__);
	return 0;

err_chip_init:
	pm_runtime_suspend(&client->dev);
err_setup:
	pm_runtime_disable(&client->dev);
	if (pdata->platform_init)
		pdata->platform_init(&client->dev, 0);
err_init:
	dev_set_drvdata(&client->dev, NULL);
	kfree(data);
	dev_err(&client->dev,
		"%s: failed with code %d.\n", __func__, result);

	return result;
}
开发者ID:Hadramos,项目名称:android_sony_xperiaz_kernel_sources,代码行数:94,代码来源:lm3561.c


示例18: sh_mmcif_probe


//.........这里部分代码省略.........
	host->addr	= reg;
	host->timeout	= msecs_to_jiffies(10000);
	host->ccs_enable = !pd || !pd->ccs_unsupported;
	host->clk_ctrl2_enable = pd && pd->clk_ctrl2_present;

	host->pd = pdev;

	spin_lock_init(&host->lock);

	mmc->ops = &sh_mmcif_ops;
	sh_mmcif_init_ocr(host);

	mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_WAIT_WHILE_BUSY;
	if (pd && pd->caps)
		mmc->caps |= pd->caps;
	mmc->max_segs = 32;
	mmc->max_blk_size = 512;
	mmc->max_req_size = PAGE_CACHE_SIZE * mmc->max_segs;
	mmc->max_blk_count = mmc->max_req_size / mmc->max_blk_size;
	mmc->max_seg_size = mmc->max_req_size;

	platform_set_drvdata(pdev, host);

	pm_runtime_enable(&pdev->dev);
	host->power = false;

	host->hclk = clk_get(&pdev->dev, NULL);
	if (IS_ERR(host->hclk)) {
		ret = PTR_ERR(host->hclk);
		dev_err(&pdev->dev, "cannot get clock: %d\n", ret);
		goto eclkget;
	}
	ret = sh_mmcif_clk_update(host);
	if (ret < 0)
		goto eclkupdate;

	ret = pm_runtime_resume(&pdev->dev);
	if (ret < 0)
		goto eresume;

	INIT_DELAYED_WORK(&host->timeout_work, mmcif_timeout_work);

	sh_mmcif_sync_reset(host);
	sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, MASK_ALL);

	name = irq[1] < 0 ? dev_name(&pdev->dev) : "sh_mmc:error";
	ret = request_threaded_irq(irq[0], sh_mmcif_intr, sh_mmcif_irqt, 0, name, host);
	if (ret) {
		dev_err(&pdev->dev, "request_irq error (%s)\n", name);
		goto ereqirq0;
	}
	if (irq[1] >= 0) {
		ret = request_threaded_irq(irq[1], sh_mmcif_intr, sh_mmcif_irqt,
					   0, "sh_mmc:int", host);
		if (ret) {
			dev_err(&pdev->dev, "request_irq error (sh_mmc:int)\n");
			goto ereqirq1;
		}
	}

	if (pd && pd->use_cd_gpio) {
		ret = mmc_gpio_request_cd(mmc, pd->cd_gpio, 0);
		if (ret < 0)
			goto erqcd;
	}

	mutex_init(&host->thread_lock);

	clk_disable_unprepare(host->hclk);
	ret = mmc_add_host(mmc);
	if (ret < 0)
		goto emmcaddh;

	dev_pm_qos_expose_latency_limit(&pdev->dev, 100);

	dev_info(&pdev->dev, "driver version %s\n", DRIVER_VERSION);
	dev_dbg(&pdev->dev, "chip ver H'%04x\n",
		sh_mmcif_readl(host->addr, MMCIF_CE_VERSION) & 0x0000ffff);
	return ret;

emmcaddh:
erqcd:
	if (irq[1] >= 0)
		free_irq(irq[1], host);
ereqirq1:
	free_irq(irq[0], host);
ereqirq0:
	pm_runtime_suspend(&pdev->dev);
eresume:
	clk_disable_unprepare(host->hclk);
eclkupdate:
	clk_put(host->hclk);
eclkget:
	pm_runtime_disable(&pdev->dev);
eofparse:
	mmc_free_host(mmc);
ealloch:
	iounmap(reg);
	return ret;
}
开发者ID:daltenty,项目名称:kernel-ubuntu.trusty-vgt,代码行数:101,代码来源:sh_mmcif.c


示例19: cyttsp4_btn_probe

static int cyttsp4_btn_probe(struct cyttsp4_device *ttsp)
{
	struct cyttsp4_btn_data *bd;
	struct device *dev = &ttsp->dev;
	struct cyttsp4_btn_platform_data *pdata = dev_get_platdata(dev);
	int rc = 0;

	dev_info(dev, "%s\n", __func__);
	dev_dbg(dev, "%s: debug on\n", __func__);
	dev_vdbg(dev, "%s: verbose debug on\n", __func__);

/*Increase the judgment conditions*/
	if (pdata == NULL) {
		dev_err(dev, "%s: Missing platform data\n", __func__);
		rc = -ENODEV;
		goto error_no_pdata;
	}
	bd = kzalloc(sizeof(*bd), GFP_KERNEL);
	if (bd == NULL) {
		dev_err(dev, "%s: Error, kzalloc\n", __func__);
		rc = -ENOMEM;
		goto error_alloc_data_failed;
	}

	mutex_init(&bd->report_lock);
	bd->ttsp = ttsp;
	bd->pdata = pdata;
	dev_set_drvdata(dev, bd);
	/* Create the input device and register it. */
	dev_vdbg(dev, "%s: Create the input device and register it\n",
		__func__);
	bd->input = input_allocate_device();
	if (bd->input == NULL) {
		dev_err(dev, "%s: Error, failed to allocate input device\n",
			__func__);
		rc = -ENOSYS;
		goto error_alloc_failed;
	}

	bd->input->name = ttsp->name;
	scnprintf(bd->phys, sizeof(bd->phys)-1, "%s", dev_name(dev));
	bd->input->phys = bd->phys;
	bd->input->dev.parent = &bd->ttsp->dev;
	bd->input->open = cyttsp4_btn_open;
	bd->input->close = cyttsp4_btn_close;
	input_set_drvdata(bd->input, bd);

	pm_runtime_enable(dev);

	/* get sysinfo */
	bd->si = cyttsp4_request_sysinfo(ttsp);
	if (bd->si) {
		rc = cyttsp4_setup_input_device(ttsp);
		if (rc)
			goto error_init_input;
	} else {
		dev_err(dev, "%s: Fail get sysinfo pointer from core p=%p\n",
			__func__, bd->si);
		cyttsp4_subscribe_attention(ttsp, CY_ATTEN_STARTUP,
			cyttsp4_setup_input_attention, 0);
	}

#ifdef CONFIG_HAS_EARLYSUSPEND
	bd->es.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 1;
	bd->es.suspend = cyttsp4_btn_early_suspend;
	bd->es.resume = cyttsp4_btn_late_resume;
	register_early_suspend(&bd->es);
#endif

	dev_dbg(dev, "%s: ok\n", __func__);
	return 0;

error_init_input:
	pm_runtime_suspend(dev);
	pm_runtime_disable(dev);
	input_free_device(bd->input);
error_alloc_failed:
	dev_set_drvdata(dev, NULL);
	kfree(bd);
error_alloc_data_failed:
error_no_pdata:
	dev_err(dev, "%s failed.\n", __func__);
	return rc;
}
开发者ID:XePeleato,项目名称:android_kernel_huawei_venus,代码行数:84,代码来源:cyttsp4_btn.c


示例20: cyttsp4_debug_probe

static int cyttsp4_debug_probe(struct cyttsp4_device *ttsp)
{
	struct device *dev = &ttsp->dev;
	struct cyttsp4_debug_data *dd;
	struct cyttsp4_debug_platform_data *pdata = dev_get_platdata(dev);
	int rc;

	tp_log_info( "%s: startup\n", __func__);
	tp_log_debug( "%s: debug on\n", __func__);
	tp_log_debug( "%s: verbose debug on\n", __func__);

	/* get context and debug print buffers */
	dd = kzalloc(sizeof(*dd), GFP_KERNEL);
	if (dd == NULL) {
		tp_log_err( "%s: Error, kzalloc\n", __func__);
		rc = -ENOMEM;
		goto cyttsp4_debug_probe_alloc_failed;
	}

	rc = device_create_file(dev, &dev_attr_int_count);
	if (rc) {
		tp_log_err( "%s: Error, could not create int_count\n",
				__func__);
		goto cyttsp4_debug_probe_create_int_count_failed;
	}

	rc = device_create_file(dev, &dev_attr_formated_output);
	if (rc) {
		tp_log_err( "%s: Error, could not create formated_output\n",
				__func__);
		goto cyttsp4_debug_probe_create_formated_failed;
	}

	mutex_init(&dd->sysfs_lock);
	dd->ttsp = ttsp;
	dd->pdata = pdata;
	dev_set_drvdata(dev, dd);

	pm_runtime_enable(dev);

	dd->si = cyttsp4_request_sysinfo(ttsp);
	if (dd->si == NULL) {
		tp_log_err( "%s: Fail get sysinfo pointer from core\n",
				__func__);
		rc = -ENODEV;
		goto cyttsp4_debug_probe_sysinfo_failed;
	}

	rc = cyttsp4_subscribe_attention(ttsp, CY_ATTEN_IRQ,
		cyttsp4_debug_op_attention, CY_MODE_OPERATIONAL);
	if (rc < 0) {
		tp_log_err( "%s: Error, could not subscribe Operating mode attention cb\n",
				__func__);
		goto cyttsp4_debug_probe_subscribe_op_failed;
	}

	rc = cyttsp4_subscribe_attention(ttsp, CY_ATTEN_IRQ,
		cyttsp4_debug_cat_attention, CY_MODE_CAT);
	if (rc < 0) {
		tp_log_err( "%s: Error, could not subscribe CaT mode attention cb\n",
				__func__);
		goto cyttsp4_debug_probe_subscribe_cat_failed;
	}

	rc = cyttsp4_subscribe_attention(ttsp, CY_ATTEN_STARTUP,
		cyttsp4_debug_startup_attention, 0);
	if (rc < 0) {
		tp_log_err( "%s: Error, could not subscribe startup attention cb\n",
				__func__);
		goto cyttsp4_debug_probe_subscribe_startup_failed;
	}
	return 0;

cyttsp4_debug_probe_subscribe_startup_failed:
	cyttsp4_unsubscribe_attention(ttsp, CY_ATTEN_IRQ,
		cyttsp4_debug_cat_attention, CY_MODE_CAT);
cyttsp4_debug_probe_subscribe_cat_failed:
	cyttsp4_unsubscribe_attention(ttsp, CY_ATTEN_IRQ,
		cyttsp4_debug_op_attention, CY_MODE_OPERATIONAL);
cyttsp4_debug_probe_subscribe_op_failed:
cyttsp4_debug_probe_sysinfo_failed:
	pm_runtime_suspend(dev);
	pm_runtime_disable(dev);
	dev_set_drvdata(dev, NULL);
	device_remove_file(dev, &dev_attr_formated_output);
cyttsp4_debug_probe_create_formated_failed:
	device_remove_file(dev, &dev_attr_int_count);
cyttsp4_debug_probe_create_int_count_failed:
	kfree(dd);
cyttsp4_debug_probe_alloc_failed:
	tp_log_err( "%s failed.\n", __func__);
	return rc;
}
开发者ID:jarpii,项目名称:android_kernel_huawei_Soulfire,代码行数:93,代码来源:cyttsp4_debug.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ pm_runtime_suspended函数代码示例发布时间:2022-05-30
下一篇:
C++ pm_runtime_status_suspended函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap