Skip to content

Commit 3d416f2

Browse files
Josh-Tsaiamstan
authored andcommitted
fwk: dogwood: don't enter 5vsb when force to enable PSU
In this commit 871089f, I missed the condition "force_enable_psu" to call power_5vsb_enter() and caused the system to drop the power when the system enters suspend with force_enable_psu. This change adds the logic to the power_5vsb_enter() function. When the force_enable_psu flag is set, just return the function and do not run the turn-off sequence. BRANCH=fwk-dogwood-27111 BUG=https://app.clickup.com/t/86etpj066 TEST=Enable the "force_enable_psu", system can enter/exit from standby mode. The PSU does not be turned off. TEST=disable the "force_enable_psu", system can enter/exit from standby mode. The PSU is turned off. Signed-off-by: Josh Tsai <Josh_Tsai@compal.com>
1 parent 1e368a6 commit 3d416f2

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

zephyr/program/framework/dogwood/src/power_sequence.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,10 @@ DECLARE_DEFERRED(system_hang_detect);
351351

352352
void power_5vsb_enter(void)
353353
{
354+
/* Don't enter 5vsb if the user forces enabling PSU */
355+
if (force_enable_psu)
356+
return;
357+
354358
CPRINTS("power 5vsb enter");
355359

356360
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_en_s0ix), 1);
@@ -679,10 +683,9 @@ enum power_state power_handle_state(enum power_state state)
679683
}
680684

681685
/**
682-
* Don't convert the 5VALW to 5VSB if the user enables to force
683-
* on PSU in standby mode or the 5V current is over 2.4A.
686+
* Don't convert the 5VALW to 5VSB if the 5V current is over 2.4A.
684687
*/
685-
if (!force_enable_psu && !power_monitor_get_5vsb_alert()) {
688+
if (!power_monitor_get_5vsb_alert()) {
686689
k_msleep(10);
687690
power_5vsb_enter();
688691
}

0 commit comments

Comments
 (0)