MTK Android ipo唤醒失败

mtk ipo流程休眠通过powerkey长按弹窗点击standby进入,唤醒时通过长按powerkey唤醒

1. powerkey: 使用PMIC的powerkey

2. powerkey长按的时间是通过外部ic控制的,时长为1s

异常:休眠下去后长按powerkey发现机器无法唤醒

异常log:

 源码:

#define LONG_PRESS_DEFAULT_DURATION 50
static int longPressDuration = LONG_PRESS_DEFAULT_DURATION; 

static void* key_thread_routine(void *arg) 
 {
        while(powerKeyPressed) {
            usleep(1000*50); //200ms
            ipod_log("start to exit_ipod-EXIT_POWER_UP");  //每200ms打印一次
            if (gsensor_bt_Keycode == KEY_SENSORINT) {
                property_set(GSENSOR_BOOT,"1");
                property_set(IPO_RESUME_REASON,"gsensor");
                ipod_log("<ipo resume system>IPO_RESUME_REASON:gsensor.\n");
                exit_ipod(EXIT_POWER_UP);
                gsensor_bt_Keycode = -1;
            } else if(gsensor_bt_Keycode == KEY_BT_POWERKEY && bt_flag == 1) {
                property_set(GSENSOR_BOOT,"1");
                property_set(IPO_RESUME_REASON,"bt");
                ipod_log("<wangxy><ipo resume system>IPO_RESUME_REASON:bt.\n");
                exit_ipod(EXIT_POWER_UP);
                gsensor_bt_Keycode = -1; 
                bt_flag = 0;
            }

            if(time_exceed(start, longPressDuration)) {
                ipod_log("pwr key reaches boot condition"); //长按触发唤醒流程打印一次
                //if(get_voltage() > VBAT_POWER_ON || tbl_bypass_batt_check()) {
                    // ready to boot up.
                    ipod_log("pwr key inotify_rm_watch.");
                    inotify_rm_watch(ufds[0].fd, wd);
                    if (keyDownPressed || keyUpPressed) {
                        /*modified for ALPS02661892*/
                        set_gpio_status();
                        ipod_log("keyDownPressed || keyUpPressed, start to exit_ipod-EXIT_REBOOT_UBOOT");
                        property_set(IPO_RESUME_REASON,"powerkey");
                        ipod_log("<ipo resume system>IPO_RESUME_REASON:powerkey.\n");
                        exit_ipod(EXIT_REBOOT_UBOOT);
                    } else {						
                        property_set(IPO_RESUME_REASON,"powerkey");
                        ipod_log("<wangxy><ipo resume system>IPO_RESUME_REASON:powerkey.\n");
                        exit_ipod(EXIT_POWER_UP);
                    }
                /*} else {
                    ipod_log("VBAT <= %d", VBAT_POWER_ON);
                    if ((access(VOLTAGE_AVG_PATH,F_OK)==-1)) {
                        exit_ipod(EXIT_POWER_UP);
                    } else
                        status_cb(EVENT_LOWBATT_FAIL_BOOT, 0, 0);
                }*/
            }
        }

        if (needShowChargingAnimation) {
            ipod_log("check pwr key show anim...");  //powerkey不再按下时退出while循环打印
            if (is_charging_source_available()) {
                ipod_log("need to show anim");
                start_charging_anim(TRIGGER_ANIM_KEY);
                wait_wakelock(IPOD_CHARGING_WAKELOCK, WAIT_WAKELOCK_TIMEOUT);
            }
            needShowChargingAnimation = false;
        }
    
}

从源码中可以看到几个关键点的log

1 powerkey循环每200ms打印一次的: ipod_log("start to exit_ipod-EXIT_POWER_UP");

2. 触发长按唤醒机器的log: ipod_log("pwr key reaches boot condition");

3.退出 powerkey循环打印的log: ipod_log("check pwr key show anim...");

根据异常log中 start to exit_ipod-EXIT_POWER_UP的时间间隔以及 check pwr key show anim的打印时间,判断出 外部长按1s的时长但是ipd检测powerkey按下的时长根本就不满足大于500ms所以无法唤醒机器,唤醒流程中的log:pwr key reaches boot condition也没打印

修复方案:

  延长外部powerkey的时长让其触发ipo唤醒流程

正常流程log:

 延长按下时间后可以看到关键log: pwr key reaches boot condition

ipo需要长按大于500ms才可以唤醒机器但是系统是通过检测/dev/input的事件来计算长按时长,所以会与外部实际按下powerkey的时长有差异 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

猿-源

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值