From 603ac13145461cfa908797365e12d3239b631c1a Mon Sep 17 00:00:00 2001 From: Sam Hurst Date: Sat, 21 Jan 2023 20:08:36 -0800 Subject: [PATCH] usb-c: tcpc: Correctly detect Hard Reset sent detection The Hard Reset sent signal was tested twice in the same "if else" structure but only handled in the last test. This change removes the first detection so that Hard Reset can be correctly detected. Signed-off-by: Sam Hurst --- drivers/usb_c/tcpc/ucpd_stm32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb_c/tcpc/ucpd_stm32.c b/drivers/usb_c/tcpc/ucpd_stm32.c index a0764bbef54..5bff82557b7 100644 --- a/drivers/usb_c/tcpc/ucpd_stm32.c +++ b/drivers/usb_c/tcpc/ucpd_stm32.c @@ -1135,7 +1135,7 @@ static void ucpd_isr(const struct device *dev_inst[]) */ if (sr & tx_done_mask) { /* Check for tx message complete */ - if (sr & (UCPD_SR_TXMSGSENT | UCPD_SR_HRSTSENT)) { + if (sr & UCPD_SR_TXMSGSENT) { atomic_set_bit(&info->evt, UCPD_EVT_TX_MSG_SUCCESS); } else if (sr & (UCPD_SR_TXMSGABT | UCPD_SR_TXUND)) { atomic_set_bit(&info->evt, UCPD_EVT_TX_MSG_FAIL);