Skip to content

Commit 057f6d7

Browse files
authored
fwk: needs to limit the current during the PD voltage transition (#894)
Signed-off-by: Josh-Tsai <josh_tsai@compal.com>
1 parent 851d7d5 commit 057f6d7

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

zephyr/program/lotus/src/cypress_pd_common.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1833,6 +1833,8 @@ void cypd_port_int(int controller, int port)
18331833
uint16_t addr_flags = pd_chip_config[controller].addr_flags;
18341834
int port_idx = (controller << 1) + port;
18351835
enum tcpci_msg_type sop_type;
1836+
static int snk_transition_flags;
1837+
18361838
/* enum pd_msg_type sop_type; */
18371839
rv = i2c_read_offset16_block(i2c_port, addr_flags,
18381840
CCG_PORT_PD_RESPONSE_REG(port), data2, 4);
@@ -1902,12 +1904,20 @@ void cypd_port_int(int controller, int port)
19021904
pd_port_states[port_idx].epr_support = 1;
19031905
CPRINTS("P%d EPR mode capable", port_idx);
19041906
}
1907+
snk_transition_flags = 1;
19051908
break;
19061909
case CCG_RESPONSE_EPR_EVENT:
19071910
CPRINTS("CCG_RESPONSE_EPR_EVENT %d", port_idx);
19081911
cypd_update_epr_state(controller, port, response_len);
19091912
cypd_update_port_state(controller, port);
19101913
break;
1914+
case CCG_RESPONSE_ACCEPT_MSG_RX:
1915+
CPRINTS("CCG_RESPONSE_ACCEPT_MSG_RX %d", port_idx);
1916+
if (snk_transition_flags) {
1917+
charge_manager_force_ceil(port_idx, 500);
1918+
snk_transition_flags = 0;
1919+
}
1920+
break;
19111921
case CCG_RESPONSE_EXT_MSG_SOP_RX:
19121922
case CCG_RESPONSE_EXT_SOP1_RX:
19131923
case CCG_RESPONSE_EXT_SOP2_RX:

0 commit comments

Comments
 (0)