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
...全文
313 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
echoyin59 2013-09-03
  • 打赏
  • 举报
回复
第三个问题:
unsigned int runtime_auto;
- if set, indicates that the user space has allowed the device driver to
power manage the device at run time via the /sys/devices/.../power/control
interface; it may only be modified with the help of the pm_runtime_allow()
and pm_runtime_forbid() helper functions

应该是禁止user space去操作它

1,319

社区成员

发帖
与我相关
我的任务
社区描述
主要是开发驱动技术
社区管理员
  • 驱动程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧