mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-09 17:11:42 +00:00
oak: Clean up CONFIG_PMIC_FW_LONG_PRESS_TIMER related codes
CONFIG_PMIC_FW_LONG_PRESS_TIMER was ported long time ago from Tegra, but the codes are actually not used and erroneous. It might wrongly trigger set_pmic_pwron(0), and turn off PMIC power accidentally. This causes POWER_GOOD lost and power state will go back to S5 during boot up. Clean up the codes by referencing check_for_power_off_event() of Rockchip. BRANCH=none BUG=none TEST=bootup and press power button quickly right after we are in S0. Bootup should still complete normally. Change-Id: Ie034efa3575dbebae4debb1afc206fddd9116350 Signed-off-by: Koro Chen <koro.chen@mediatek.com> Reviewed-on: https://chromium-review.googlesource.com/332724 Reviewed-by: Rong Chang <rongchang@chromium.org>
This commit is contained in:
@@ -83,7 +83,6 @@
|
||||
#define CONFIG_LID_SWITCH
|
||||
#define CONFIG_LOW_POWER_IDLE
|
||||
#define CONFIG_MKBP_EVENT
|
||||
#define CONFIG_PMIC_FW_LONG_PRESS_TIMER
|
||||
#define CONFIG_POWER_BUTTON
|
||||
#define CONFIG_POWER_COMMON
|
||||
#define CONFIG_USB_CHARGER
|
||||
|
||||
@@ -325,23 +325,12 @@ static int check_for_power_off_event(void)
|
||||
|
||||
now = get_time();
|
||||
if (pressed) {
|
||||
#ifndef CONFIG_PMIC_FW_LONG_PRESS_TIMER
|
||||
/*
|
||||
* Only assert PMIC_PWRON if PMIC supports long-press
|
||||
* power off.
|
||||
*/
|
||||
CPRINTS("PMIC long-press power off\n");
|
||||
set_pmic_pwron(1);
|
||||
#endif
|
||||
|
||||
if (!power_button_was_pressed) {
|
||||
power_off_deadline.val = now.val + DELAY_FORCE_SHUTDOWN;
|
||||
CPRINTS("power waiting for long press %u",
|
||||
power_off_deadline.le.lo);
|
||||
#ifdef CONFIG_PMIC_FW_LONG_PRESS_TIMER
|
||||
/* Ensure we will wake up to check the power key */
|
||||
timer_arm(power_off_deadline, TASK_ID_CHIPSET);
|
||||
#endif
|
||||
} else if (timestamp_expired(power_off_deadline, &now)) {
|
||||
power_off_deadline.val = 0;
|
||||
CPRINTS("power off after long press now=%u, %u",
|
||||
@@ -350,10 +339,7 @@ static int check_for_power_off_event(void)
|
||||
}
|
||||
} else if (power_button_was_pressed) {
|
||||
CPRINTS("power off cancel");
|
||||
set_pmic_pwron(0);
|
||||
#ifdef CONFIG_PMIC_FW_LONG_PRESS_TIMER
|
||||
timer_cancel(TASK_ID_CHIPSET);
|
||||
#endif
|
||||
}
|
||||
|
||||
power_button_was_pressed = pressed;
|
||||
|
||||
Reference in New Issue
Block a user