本文整理汇总了C++中pm_runtime_use_autosuspend函数的典型用法代码示例。如果您正苦于以下问题:C++ pm_runtime_use_autosuspend函数的具体用法?C++ pm_runtime_use_autosuspend怎么用?C++ pm_runtime_use_autosuspend使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pm_runtime_use_autosuspend函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: sunxi_mali_platform_device_register
/*
***************************************************************
@Function :sunxi_mali_platform_device_register
@Description :Register mali platform device
@Input :None
@Return :0 or error code
***************************************************************
*/
int sunxi_mali_platform_device_register(void)
{
int err;
unsigned long mem_size = 0;
struct __fb_addr_para fb_addr_para={0};
sunxi_get_fb_addr_para(&fb_addr_para);
err = platform_device_add_resources(&mali_gpu_device, mali_gpu_resources, sizeof(mali_gpu_resources) / sizeof(mali_gpu_resources[0]));
if (0 == err){
mali_gpu_data.fb_start = fb_addr_para.fb_paddr;
mali_gpu_data.fb_size = fb_addr_para.fb_size;
mem_size = (totalram_pages * PAGE_SIZE )/1024; /* KB */
if(mem_size > 512*1024)
{
mali_gpu_data.shared_mem_size = 1024*1024*1024;
}
else
{
mali_gpu_data.shared_mem_size = 512*1024*1024;
}
err = platform_device_add_data(&mali_gpu_device, &mali_gpu_data, sizeof(mali_gpu_data));
if(0 == err)
{
err = platform_device_register(&mali_gpu_device);
if (0 == err){
if(_MALI_OSK_ERR_OK != mali_platform_init())
{
return _MALI_OSK_ERR_FAULT;
}
#ifdef CONFIG_PM_RUNTIME
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
pm_runtime_set_autosuspend_delay(&(mali_gpu_device.dev), 1000);
pm_runtime_use_autosuspend(&(mali_gpu_device.dev));
#endif
pm_runtime_enable(&(mali_gpu_device.dev));
#endif /* CONFIG_PM_RUNTIME */
/* print mali gpu information */
printk(KERN_INFO "=========================================================\n");
printk(KERN_INFO " Mali GPU Information \n");
printk(KERN_INFO "voltage : %d mV\n", regulator_get_voltage(mali_regulator)/1000);
printk(KERN_INFO "initial frequency : %ld MHz\n", clk_get_rate(h_mali_clk)/(1000*1000));
printk(KERN_INFO "frame buffer address: 0x%lx - 0x%lx\n", mali_gpu_data.fb_start, mali_gpu_data.fb_start + mali_gpu_data.shared_mem_size);
printk(KERN_INFO "frame buffer size : %ld MB\n", mali_gpu_data.shared_mem_size/(1024*1024));
printk(KERN_INFO "=========================================================\n");
return 0;
}
}
platform_device_unregister(&mali_gpu_device);
}
#ifdef CONFIG_CPU_BUDGET_THERMAL
register_budget_cooling_notifier(&mali_throttle_notifier);
#endif /* CONFIG_CPU_BUDGET_THERMAL */
return err;
}
示例3: gr2d_probe
static int __devinit gr2d_probe(struct platform_device *dev)
{
int err = 0;
struct nvhost_device_data *pdata = NULL;
if (dev->dev.of_node) {
const struct of_device_id *match;
match = of_match_device(tegra_gr2d_of_match, &dev->dev);
if (match)
pdata = (struct nvhost_device_data *)match->data;
} else
pdata = (struct nvhost_device_data *)dev->dev.platform_data;
WARN_ON(!pdata);
if (!pdata) {
dev_info(&dev->dev, "no platform data\n");
return -ENODATA;
}
pdata->pdev = dev;
platform_set_drvdata(dev, pdata);
err = nvhost_client_device_init(dev);
if (err)
return err;
pm_runtime_use_autosuspend(&dev->dev);
pm_runtime_set_autosuspend_delay(&dev->dev, 100);
pm_runtime_enable(&dev->dev);
return 0;
}
示例4: msenc_probe
static int __devinit msenc_probe(struct platform_device *dev)
{
int err = 0;
struct nvhost_device_data *pdata =
(struct nvhost_device_data *)dev->dev.platform_data;
pdata->pdev = dev;
pdata->init = nvhost_msenc_init;
pdata->deinit = nvhost_msenc_deinit;
pdata->finalize_poweron = nvhost_msenc_finalize_poweron;
platform_set_drvdata(dev, pdata);
err = nvhost_client_device_get_resources(dev);
if (err)
return err;
err = nvhost_client_device_init(dev);
if (err)
return err;
pm_runtime_use_autosuspend(&dev->dev);
pm_runtime_set_autosuspend_delay(&dev->dev, 100);
pm_runtime_enable(&dev->dev);
return 0;
}
示例5: mali_platform_device_register
int mali_platform_device_register(void)
{
int err;
MALI_DEBUG_PRINT(4, ("mali_platform_device_register() called\n"));
/* Connect resources to the device */
err = platform_device_add_resources(&exynos4_device_g3d, mali_gpu_resources, sizeof(mali_gpu_resources) / sizeof(mali_gpu_resources[0]));
if (0 == err)
{
err = platform_device_add_data(&exynos4_device_g3d, &mali_gpu_data, sizeof(mali_gpu_data));
if (0 == err)
{
mali_platform_init(&(exynos4_device_g3d.dev));
#ifdef CONFIG_PM_RUNTIME
pm_runtime_set_autosuspend_delay(&(exynos4_device_g3d.dev), 50);
pm_runtime_use_autosuspend(&(exynos4_device_g3d.dev));
pm_runtime_enable(&(exynos4_device_g3d.dev));
#endif
return 0;
}
}
return err;
}
示例6: blk_pm_runtime_init
/**
* blk_pm_runtime_init - Block layer runtime PM initialization routine
* @q: the queue of the device
* @dev: the device the queue belongs to
*
* Description:
* Initialize runtime-PM-related fields for @q and start auto suspend for
* @dev. Drivers that want to take advantage of request-based runtime PM
* should call this function after @dev has been initialized, and its
* request queue @q has been allocated, and runtime PM for it can not happen
* yet(either due to disabled/forbidden or its usage_count > 0). In most
* cases, driver should call this function before any I/O has taken place.
*
* This function takes care of setting up using auto suspend for the device,
* the autosuspend delay is set to -1 to make runtime suspend impossible
* until an updated value is either set by user or by driver. Drivers do
* not need to touch other autosuspend settings.
*
* The block layer runtime PM is request based, so only works for drivers
* that use request as their IO unit instead of those directly use bio's.
*/
void blk_pm_runtime_init(struct request_queue *q, struct device *dev)
{
q->dev = dev;
q->rpm_status = RPM_ACTIVE;
pm_runtime_set_autosuspend_delay(q->dev, -1);
pm_runtime_use_autosuspend(q->dev);
}
示例7: mali_platform_device_register
/*****************************************************************************
function name : mali_platform_device_register
description : mali platform device register
input vars : void
output vars : NA
return value : void
calls : mali_platform_init
called : os
history :
1.data : 18/10/2012
modify : new
*****************************************************************************/
int mali_platform_device_register(void)
{
int err = -1;
MALI_DEBUG_PRINT(4, ("mali_platform_device_register() called\n"));
MALI_DEBUG_PRINT(4, ("Registering Mali-450 MP8 device\n"));
/* init the mem first of hisi */
mali_hisi_mem_init();
mali_gpu_device.num_resources = ARRAY_SIZE(mali_gpu_resources_m450_mp4);
mali_gpu_device.resource = mali_gpu_resources_m450_mp4;
/* Register the platform device */
err = platform_device_register(&mali_gpu_device);
if (0 == err)
{
mali_platform_init();
#ifdef CONFIG_PM_RUNTIME
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
pm_runtime_set_autosuspend_delay(&(mali_gpu_device.dev), 1000);
pm_runtime_use_autosuspend(&(mali_gpu_device.dev));
#endif
pm_runtime_enable(&(mali_gpu_device.dev));
#endif
return 0;
}
return err;
}
示例8: mali_platform_device_register
int mali_platform_device_register(void)
{
int err;
MALI_DEBUG_PRINT(4, ("mali_platform_device_register() called\n"));
/* Connect resources to the device */
err = platform_device_add_resources(&exynos4_device_g3d,
mali_gpu_resources,
sizeof(mali_gpu_resources) /
sizeof(mali_gpu_resources[0]));
if (0 == err) {
err = platform_device_add_data(&exynos4_device_g3d,
&mali_gpu_data,
sizeof(mali_gpu_data));
if (0 == err) {
mali_platform_init(&(exynos4_device_g3d.dev));
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
pm_runtime_set_autosuspend_delay(&(exynos4_device_g3d.dev), 200);
pm_runtime_use_autosuspend(&(exynos4_device_g3d.dev));
#endif
pm_runtime_enable(&(exynos4_device_g3d.dev));
return 0;
}
}
return err;
}
示例9: mali_platform_device_register
int mali_platform_device_register(void)
{
int err = -1;
MALI_DEBUG_PRINT(1, ("%s\n", __FUNCTION__));
err = platform_device_register(&mali_gpu_device);
if (0 == err)
{
mali_pmm_init();
#ifdef CONFIG_PM_RUNTIME
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
pm_runtime_set_autosuspend_delay(&(mali_gpu_device.dev), 1000);
pm_runtime_use_autosuspend(&(mali_gpu_device.dev));
#endif
pm_runtime_enable(&(mali_gpu_device.dev));
#endif
#if defined(__MALI_CORE_SCALING_ENABLE__)
mali_core_scaling_init(num_pp_cores);
#endif
return 0;
}
MALI_DEBUG_PRINT(1, ("%s err=%d\n",__FUNCTION__, err));
platform_device_unregister(&mali_gpu_device);
return err;
}
示例10: escore_pm_enable
void escore_pm_enable(void)
{
struct escore_priv *escore = &escore_priv;
int ret = 0;
dev_dbg(escore->dev, "%s()\n", __func__);
if (escore->pm_enable) {
pr_err("%s(): Already Enabled\n", __func__);
return;
}
escore->pm_enable = ES_PM_ON;
escore->pm_status = ES_PM_ON;
pm_runtime_set_active(escore->dev);
pm_runtime_mark_last_busy(escore->dev);
pm_runtime_set_autosuspend_delay(escore->dev, ES_PM_AUTOSUSPEND_DELAY);
pm_runtime_use_autosuspend(escore->dev);
pm_runtime_enable(escore->dev);
device_init_wakeup(escore->dev, true);
if (pm_runtime_get_sync(escore->dev) >= 0) {
ret = pm_runtime_put_sync_autosuspend(escore->dev);
if (ret < 0) {
dev_err(escore->dev,
"%s() escore PM put failed ret = %d\n",
__func__, ret);
}
} else
dev_err(escore->dev,
"%s() escore PM get failed ret = %d\n", __func__, ret);
return;
}
示例11: tb_domain_add
/**
* tb_domain_add() - Add domain to the system
* @tb: Domain to add
*
* Starts the domain and adds it to the system. Hotplugging devices will
* work after this has been returned successfully. In order to remove
* and release the domain after this function has been called, call
* tb_domain_remove().
*
* Return: %0 in case of success and negative errno in case of error
*/
int tb_domain_add(struct tb *tb)
{
int ret;
if (WARN_ON(!tb->cm_ops))
return -EINVAL;
mutex_lock(&tb->lock);
tb->ctl = tb_ctl_alloc(tb->nhi, tb_domain_event_cb, tb);
if (!tb->ctl) {
ret = -ENOMEM;
goto err_unlock;
}
/*
* tb_schedule_hotplug_handler may be called as soon as the config
* channel is started. Thats why we have to hold the lock here.
*/
tb_ctl_start(tb->ctl);
if (tb->cm_ops->driver_ready) {
ret = tb->cm_ops->driver_ready(tb);
if (ret)
goto err_ctl_stop;
}
ret = device_add(&tb->dev);
if (ret)
goto err_ctl_stop;
/* Start the domain */
if (tb->cm_ops->start) {
ret = tb->cm_ops->start(tb);
if (ret)
goto err_domain_del;
}
/* This starts event processing */
mutex_unlock(&tb->lock);
pm_runtime_no_callbacks(&tb->dev);
pm_runtime_set_active(&tb->dev);
pm_runtime_enable(&tb->dev);
pm_runtime_set_autosuspend_delay(&tb->dev, TB_AUTOSUSPEND_DELAY);
pm_runtime_mark_last_busy(&tb->dev);
pm_runtime_use_autosuspend(&tb->dev);
return 0;
err_domain_del:
device_del(&tb->dev);
err_ctl_stop:
tb_ctl_stop(tb->ctl);
err_unlock:
mutex_unlock(&tb->lock);
return ret;
}
示例12: omap3_thermal_probe
static int omap3_thermal_probe(struct platform_device *pdev)
{
struct thermal_zone_device *omap3_thermal = NULL;
struct omap3_thermal_dev *tdev;
int ret = 0;
struct resource *stres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!stres) {
dev_err(&pdev->dev, "memory resource missing\n");
return -ENODEV;
}
tdev = devm_kzalloc(&pdev->dev, sizeof(*tdev), GFP_KERNEL);
if (!tdev)
return -ENOMEM;
tdev->dev = &pdev->dev;
if (cpu_is_omap3630()) {
tdev->bgap_soc_mask = BIT(9);
tdev->bgap_eocz_mask = BIT(8);
tdev->adc_to_temp = omap3630_adc_to_temp;
} else if (cpu_is_omap34xx()) {
tdev->bgap_soc_mask = BIT(8);
tdev->bgap_eocz_mask = BIT(7);
tdev->adc_to_temp = omap3530_adc_to_temp;
} else {
dev_err(&pdev->dev, "not OMAP3 family\n");
return -ENODEV;
}
tdev->thermal_base = devm_ioremap(&pdev->dev, stres->start,
resource_size(stres));
if (!tdev->thermal_base) {
dev_err(&pdev->dev, "ioremap failed\n");
return -ENOMEM;
}
pm_runtime_enable(&pdev->dev);
pm_runtime_set_autosuspend_delay(&pdev->dev, 2000);
pm_runtime_use_autosuspend(&pdev->dev);
omap3_thermal = thermal_zone_device_register("omap3-thermal", 0,
tdev, &omap3_thermal_ops, 0, 0, 0, 0);
if (!omap3_thermal) {
dev_err(&pdev->dev, "thermal zone device is NULL\n");
ret = -EINVAL;
goto put_pm;
}
platform_set_drvdata(pdev, omap3_thermal);
return 0;
put_pm:
pm_runtime_disable(&pdev->dev);
return ret;
}
示例13: amdgpu_driver_load_kms
/**
* amdgpu_driver_load_kms - Main load function for KMS.
*
* @dev: drm dev pointer
* @flags: device flags
*
* This is the main load function for KMS (all asics).
* Returns 0 on success, error on failure.
*/
int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
{
struct amdgpu_device *adev;
int r, acpi_status;
adev = kzalloc(sizeof(struct amdgpu_device), GFP_KERNEL);
if (adev == NULL) {
return -ENOMEM;
}
dev->dev_private = (void *)adev;
if ((amdgpu_runtime_pm != 0) &&
amdgpu_has_atpx() &&
((flags & AMD_IS_APU) == 0))
flags |= AMD_IS_PX;
/* amdgpu_device_init should report only fatal error
* like memory allocation failure or iomapping failure,
* or memory manager initialization failure, it must
* properly initialize the GPU MC controller and permit
* VRAM allocation
*/
r = amdgpu_device_init(adev, dev, dev->pdev, flags);
if (r) {
dev_err(&dev->pdev->dev, "Fatal error during GPU init\n");
goto out;
}
/* Call ACPI methods: require modeset init
* but failure is not fatal
*/
if (!r) {
acpi_status = amdgpu_acpi_init(adev);
if (acpi_status)
dev_dbg(&dev->pdev->dev,
"Error during ACPI methods call\n");
}
amdgpu_amdkfd_load_interface(adev);
amdgpu_amdkfd_device_probe(adev);
amdgpu_amdkfd_device_init(adev);
if (amdgpu_device_is_px(dev)) {
pm_runtime_use_autosuspend(dev->dev);
pm_runtime_set_autosuspend_delay(dev->dev, 5000);
pm_runtime_set_active(dev->dev);
pm_runtime_allow(dev->dev);
pm_runtime_mark_last_busy(dev->dev);
pm_runtime_put_autosuspend(dev->dev);
}
out:
if (r)
amdgpu_driver_unload_kms(dev);
return r;
}
示例14: hi3630_pcm_hdmi_probe
static int hi3630_pcm_hdmi_probe(struct platform_device *pdev)
{
int ret = -1;
struct device *dev = &pdev->dev;
struct hi3630_hdmi_data *pdata = NULL;
if (!dev) {
loge("platform_device has no device\n");
return -ENOENT;
}
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata){
dev_err(dev, "cannot allocate hi3630 hdmi platform data\n");
return -ENOMEM;
}
pdata->hi3630_asp_irq = dev_get_drvdata(pdev->dev.parent);
if (!pdata->hi3630_asp_irq) {
dev_err(dev, "get parent device error\n");
return -ENOENT;
}
pdata->irq = platform_get_irq_byname(pdev, "asp_irq_hdmi");
if (0 > pdata->irq) {
dev_err(dev, "cannot get irq\n");
return -ENOENT;
}
pdata->regu.supply = "hdmi-pcm";
ret = devm_regulator_bulk_get(dev, 1, &(pdata->regu));
if (0 != ret) {
dev_err(dev, "couldn't get regulators %d\n", ret);
return -ENOENT;
}
pdata->dev = dev;
#ifdef CONFIG_PM_RUNTIME
pm_runtime_set_autosuspend_delay(dev, 100); /* 100ms*/
pm_runtime_use_autosuspend(dev);
pm_runtime_enable(dev);
#endif
platform_set_drvdata(pdev, pdata);
dev_set_name(dev, "hi3630-pcm-hdmi");
ret = snd_soc_register_platform(dev, &hi3630_pcm_hdmi_platform);
if (ret) {
loge("snd_soc_register_platform return %d\n", ret);
return -ENODEV;
}
return ret;
}
示例15: 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);
}