pm_runtime

Early suspend mechanism is totally replaced by the concept of pm_runtime. 
Theusage is totally changed.
Difference: Early suspend is totally controlled by kernel, while pm_runtimeexports interface to user space, and let user space to decide when device is ready to enter lower power mode.
When you try to implement early suspend in your driver, you need to modify codenot only in BSP Level, but also in Android Level. 

 How to use pm_runtime in your driver?
1.      Initial the instance



2.      Enable the device’s pm_runtime

 What’s done in Android Level?
Below is MRVL’s current implement. Only four devices are controlled by Android, which replace early suspend mechanism.they are Touch, LCD, GC and FM.
Source code patch:[hardware/libhardware/modules/power/power.c] 
28 #definePM_TOUCH_CONTROL"/sys/bus/i2c/devices/2-0039/power/control"                                                                                                
29 #define PM_TOUCH_STATE"/sys/bus/i2c/devices/2-0039/power/runtime_status"                                                                                           
30                                                                                                                                                                     
31 #definePM_LCD_CONTROL"/sys/devices/platform/pxa168-fb.0/power/control"                                                                                            
32 #define PM_LCD_STATE"/sys/devices/platform/pxa168-fb.0/power/runtime_status"                                                                                       
33                                                                                                                                                                     
34 #definePM_LCD1_CONTROL"/sys/devices/platform/pxa168-fb.1/power/control"                                                                                          
 35 #define PM_LCD1_STATE"/sys/devices/platform/pxa168-fb.1/power/runtime_status"                                                                                     
 36                                                                                                                                                                     
37 #definePM_GC_CONTROL"/sys/devices/platform/galcore/power/control"                                                                                                 
38 #define PM_GC_STATE"/sys/devices/platform/galcore/power/runtime_status"                                                                                           
 39                                                                                                                                                                    
 40 #definePM_FM_CONTROL"/sys/devices/platform/mrvl8xxx_fm.0/power/control"                                                                                           
41 #define PM_FM_STATE"/sys/devices/platform/mrvl8xxx_fm.0/power/runtime_status"   

Example
When you        
 # echoauto>/sys/devices/platform/pxa168-fb.0/power/control
LCD will call runtime_suspend();
When you         
#echoon> /sys/devices/platform/pxa168-fb.0/power/control
LCD will call runtime_resume

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值