usb: typec: tcpci: husb311: fix tx failure

Since the hardware bug of HUSB311, its TX fifo become abnormal
when plug in a PD charger after plug out the cable from the PC.

As a workaround, we do ResetTransmitBuffer after each TX packet
is finished to prepare for the next.

Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Change-Id: Ieebd090879a45ee2b5a1720e3debf860712e162c
This commit is contained in:
Frank Wang
2024-04-09 11:09:37 +08:00
parent f1a9ea8906
commit f4fdb8d83f

View File

@@ -207,6 +207,10 @@ static irqreturn_t husb311_irq(int irq, void *dev_id)
}
}
/* TCPCI Spec. Table 4-27 ResetTransmitBuffer */
if (status & (TCPC_ALERT_TX_SUCCESS | TCPC_ALERT_TX_DISCARDED | TCPC_ALERT_TX_FAILED))
husb311_write8(chip, TCPC_COMMAND, 0xdd);
return tcpci_irq(chip->tcpci);
}