(1)添加头文件:
#include "core.h"
在core.h文件中有:
#ifdef CONFIG_HAS_EARLYSUSPEND
#include <linux/earlysuspend.h>
#endif
(2)在wifi驱动ath6kl结构体中添加early_suspend结构:
#ifdef CONFIG_HAS_EARLYSUSPEND
struct early_suspend early_suspend;
bool screen_off;
#endif
(3)在wifi驱动的电源管理文件pm.c中填充early_suspend结构体,并将其向android电源管理系统注册:
#ifdef CONFIG_HAS_EARLYSUSPEND
ar->screen_off = false;
ar->early_suspend.suspend = ath6kl_early_suspend;
ar->early_suspend.resume = ath6kl_late_resume;
ar->