(1)添加头文件: #include <linux/earlysuspend.h> (2)在特定驱动结构体中添加early_suspend结构: #ifdef CONFIG_HAS_EARLYSUSPEND (3)在驱动probe函数中注册相关early_suspend结构体: #ifdef CONFIG_HAS_EARLYSUSPEND (4)在驱动remove函数取消early_suspend结构体的注册: #ifdef CONFIG_HAS_EARLYSUSPEND (5)定义相关suspend和resume函数: #ifdef CONFIG_HAS_EARLYSUSPEND static void stm_ts_late_resume(struct early_suspend *h) (6)在系统驱动结构体中设置未使用earlysuspend的函数接口: #ifndef CONFIG_HAS_EARLYSUSPEND |
|
来自: barry525 > 《linux api》