PM_RUNTIME 问题
诶呦 2013-09-03 04:37:19 pm_runtime_enable(&client->dev);
pm_runtime_get_sync(&client->dev);
pm_runtime_put_sync_suspend(&client->dev);
pm_runtime_forbid(&client->dev);
对于这四个函数的理解,我不是很清楚,希望大家帮忙解释一下。
我先说说我的理解
pm_runtime_enable(&client->dev);
初始化时,PM runtime对所有的设备都是无效的,在pm_runtime_enable()中对disable_depth进行--操作,直到disable_depth==0,就可以正常工作了
pm_runtime_get_sync(&client->dev);
usage counter + 1,并运行pm_runtime_resume(dev),最后返回结果
pm_runtime_put_sync_suspend(&client->dev);
usage counter - 1, 如果result==0,运行pm_runtime_suspend(dev),最后返回结果
pm_runtime_forbid(&client->dev);
标志power.runtime_auto设为false,并且usage counter + 1
问题:
1.pm runtime中的函数为什么叫做helper function
2.pm_runtime_forbid()中的power.runtime_auto有什么作用
3.pm_runtime_forbid()中usage counter为什么要+1