概述
/kernel-4.14/drivers/power/supply/mediatek/battery/mtk_battery_core.c
1 | struct mtk_battery gm; ->kthread_run(power_misc_routine_thread, &sdc, "power_misc_thread"); |
/kernel-4.14/drivers/power/supply/mediatek/battery/mtk_battery_core.c
1 | int battery_update_routine(void *x) |
/kernel-4.14/drivers/power/supply/mediatek/battery/mtk_battery_core.c
1 | /* ============================================================ */ |
gm.log_level在mtk_battery_init()被初始化为3,所以ktime被设置为60s
(我觉得这里逻辑有问题),因为log数字越小,等级越高,所以应该写成:
if (bat_get_debug_level() < BMLOG_DEBUG_LEVEL)
ktime = ktime_set(10, 0); //log_level小于7,说明等级高,从而应该更频繁地打印log
else
ktime = ktime_set(60, 0);
/kernel-4.14/drivers/power/supply/mediatek/battery/mtk_battery.c
1 | int bat_get_debug_level(void) |
/kernel-4.14/drivers/power/supply/mediatek/battery/mtk_battery_internal.h
1 | /* ============================================================ */ |
另外,以下两个定时器也可以唤醒线程battery_update_routine:
/kernel-4.14/drivers/power/supply/mediatek/battery/mtk_battery_core.c
1 | /* ============================================================ */ |
最后
以上就是专一衬衫为你收集整理的04.“battery_thread“线程的全部内容,希望文章能够帮你解决04.“battery_thread“线程所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复