Skip to content

Commit 7d85486

Browse files
committed
fwk: dogwood: Fix DVT1 suspend
We used to have nice code that prevented all the 5vsb stuff from happening in suspend, but that has since bitrotted since we always forget to test it, so it's been broken for quite a few versions. Add the check back so we don't have the issue. Let's also add more printouts so we know what's going on. BUG=DVT1 boards cannot suspend TEST=DVT1 boards can suspend TEST=DVT2 boards can still suspend with force_psu_on TEST=Newer boards suspend nicely too BRANCH=fwk-dogwood-27111
1 parent 4c2b2bc commit 7d85486

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

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

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,13 +365,19 @@ DECLARE_DEFERRED(system_hang_detect);
365365

366366
void power_5vsb_enter(void)
367367
{
368-
/* Don't enter 5vsb if the user forces enabling PSU */
369-
if (force_enable_psu)
370-
return;
371-
372368
CPRINTS("current was low (<%dmA) for a long time, switching to 5vsb",
373369
INA236_MONITOR_5V_LOWER_CURRENT_MA);
374370

371+
if (board_get_version() < BOARD_VERSION_8) {
372+
CPRINTS("...this board is too old to turn power supply off");
373+
return;
374+
}
375+
376+
if (force_enable_psu) {
377+
CPRINTS("...but we want to force power supply on");
378+
return;
379+
}
380+
375381
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_en_s0ix), 1);
376382

377383
k_msleep(20);
@@ -402,6 +408,11 @@ bool power_5vsb_exit(void)
402408
if (!power_enable_psu(1))
403409
return false;
404410

411+
if (board_get_version() < BOARD_VERSION_8) {
412+
CPRINTS("...power supply was already forced on because board is old");
413+
return true;
414+
}
415+
405416
k_msleep(10);
406417
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_en_rvsp_l), 1);
407418
CPRINTS("switched to high power rails");

0 commit comments

Comments
 (0)