Skip to content

Commit f95e1a4

Browse files
LeoCX-Tsaiquinchou77
authored andcommitted
fwk: cypd: fix multi-port switch affect by new request
if have a new request from charger task we should make sure the port is connected and must be an active port. BRANCH=fwk-main BUG=when unplug second port adp(bigger adp), the small one won't charge battery TEST=test on Lotus, plug in 65w adp to port2, and plug 180w to port3, than unplug 180w, make sure 65w still can charge, type cypdstatus 1 check port2 VBUS-FET is EC ON. Signed-off-by: LeoCX_Tsai <[email protected]> (cherry picked from commit b922b830a1b1d374889a034e3b0a9c092e9f4c06)
1 parent 45bb4d1 commit f95e1a4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

zephyr/program/framework/src/cypress_pd_common.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2031,7 +2031,8 @@ void pd_set_new_power_request(int port)
20312031
* eg: after PD send again CCG_RESPONSE_PD_CONTRACT_NEGOTIATION_COMPLETE
20322032
* will set a new power request, the VBUS port need to open again.
20332033
*/
2034-
board_set_active_charge_port(port);
2034+
if (get_active_charge_pd_port() == port && pd_is_connected(port))
2035+
board_set_active_charge_port(port);
20352036
return;
20362037
}
20372038

0 commit comments

Comments
 (0)