diff options
Diffstat (limited to 'zephyr/emul/tcpc/emul_tcpci_partner_drp.c')
-rw-r--r-- | zephyr/emul/tcpc/emul_tcpci_partner_drp.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/zephyr/emul/tcpc/emul_tcpci_partner_drp.c b/zephyr/emul/tcpc/emul_tcpci_partner_drp.c index 08a6fd7b5e..f69ebc5d85 100644 --- a/zephyr/emul/tcpc/emul_tcpci_partner_drp.c +++ b/zephyr/emul/tcpc/emul_tcpci_partner_drp.c @@ -240,6 +240,22 @@ static void tcpci_drp_emul_rx_consumed_op( tcpci_partner_free_msg(msg); } +/** + * @brief Function called when emulator is disconnected from TCPCI + * + * @param emul Pointer to TCPCI emulator + * @param ops Pointer to partner operations structure + */ +static void tcpci_drp_emul_disconnect_op( + const struct emul *emul, + const struct tcpci_emul_partner_ops *ops) +{ + struct tcpci_drp_emul *drp_emul = + CONTAINER_OF(ops, struct tcpci_drp_emul, ops); + + tcpci_partner_common_disconnect(&drp_emul->common_data); +} + /** Check description in emul_tcpci_partner_drp.h */ int tcpci_drp_emul_connect_to_tcpci(struct tcpci_drp_emul_data *data, struct tcpci_src_emul_data *src_data, @@ -270,6 +286,7 @@ void tcpci_drp_emul_init(struct tcpci_drp_emul *emul) emul->ops.transmit = tcpci_drp_emul_transmit_op; emul->ops.rx_consumed = tcpci_drp_emul_rx_consumed_op; emul->ops.control_change = NULL; + emul->ops.disconnect = tcpci_drp_emul_disconnect_op; emul->data.sink = true; emul->data.in_pwr_swap = false; |