Skip to content

Commit b48624b

Browse files
authored
Merge pull request #813 from FrameworkComputer/fwk.fix_dual_pd_reset
dont reset PD twice on boot
2 parents cdfea15 + 4eb3180 commit b48624b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

zephyr/program/lotus/src/cypress_pd_common.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1309,18 +1309,20 @@ static void port_to_safe_mode(int port)
13091309
CPRINTS("P%d: Safe", port);
13101310

13111311
}
1312-
1312+
bool cypd_boot_flag;
13131313
void update_system_power_state(int controller)
13141314
{
13151315
enum power_state ps = power_get_state();
13161316
switch (ps) {
13171317
case POWER_G3:
13181318
case POWER_S5G3:
1319+
cypd_boot_flag = true;
13191320
cypd_set_power_state(CCG_POWERSTATE_G3, controller);
13201321
break;
13211322
case POWER_S5:
13221323
case POWER_S3S5:
13231324
case POWER_S4S5:
1325+
cypd_boot_flag = true;
13241326
cypd_set_power_state(CCG_POWERSTATE_S5, controller);
13251327
break;
13261328
case POWER_S3:
@@ -1354,7 +1356,10 @@ void cypd_set_power_active(void)
13541356

13551357
void cypd_port_reset(void)
13561358
{
1359+
if (cypd_boot_flag) {
13571360
task_set_event(TASK_ID_CYPD, CCG_EVT_PLT_RESET);
1361+
cypd_boot_flag = false;
1362+
}
13581363
}
13591364

13601365

0 commit comments

Comments
 (0)