Skip to content

Commit 4b37daa

Browse files
Josh-Tsaiamstan
authored andcommitted
fwk: dogwood: allow to change the PDO if the PSU already turns on
To avoid the system browns-out with sudden load during suspend, only allow the type-c device can request 5V/3A if the PSU already turns on. BRANCH=fwk-dogwood-27111 BUG=https://app.clickup.com/t/86etza0y1 TEST=check the EC log, EC receives the PD response "Negotiation complete" after the PSU turns on. Signed-off-by: Josh Tsai <[email protected]>
1 parent f1faa89 commit 4b37daa

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,12 @@ bool power_5vsb_exit(void)
485485

486486
power_check_12vb_apu();
487487

488+
/**
489+
* Call cypd event CCG_EVT_RDO_MISMATCH to check if we can provide more
490+
* power for RDO mismatch device.
491+
*/
492+
task_set_event(TASK_ID_CYPD, CCG_EVT_RDO_MISMATCH);
493+
488494
return true;
489495
}
490496

@@ -1001,6 +1007,15 @@ __override int chipset_in_low_power_mode(void)
10011007
return in_low_power_mode;
10021008
}
10031009

1010+
__override bool cypd_allow_increase_rdo_profile(void)
1011+
{
1012+
/* Only allow the PD chips to increase the current when the PSU is on */
1013+
if (gpio_pin_get_dt(GPIO_DT_FROM_NODELABEL(gpio_pok_l)) == 1)
1014+
return true;
1015+
else
1016+
return false;
1017+
}
1018+
10041019
static int cmd_psu_s3_keep(int argc, const char **argv)
10051020
{
10061021
char *e;

0 commit comments

Comments
 (0)