Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a838dde authored by Jack Pham's avatar Jack Pham
Browse files

usb: pd: qpnp-pdphy: Fix reception of Get_Battery_Cap



Get_Battery_Cap is a PD 3.0 extended message but has the same
MessageID as a BIST data message. Currently the handling for
the latter mistakenly treats Get_Battery_Cap as a BIST and
does not pass it up to the policy engine. Fix this by adding
a check for the 15th bit of the message header which indicates
it is an extended message.

Change-Id: I5ebe4dc3c765303a570b48e47dfb2e40750b3843
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 9fb7efdb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -734,7 +734,7 @@ static irqreturn_t pdphy_msg_rx_irq(int irq, void *data)
	/* ack to change ownership of rx buffer back to PDPHY RX HW */
	pdphy_reg_write(pdphy, USB_PDPHY_RX_ACKNOWLEDGE, 0);

	if (((buf[0] & 0xf) == PD_MSG_BIST) && size >= 5) { /* BIST */
	if (((buf[0] & 0xf) == PD_MSG_BIST) && !(buf[1] & 0x80) && size >= 5) {
		u8 mode = buf[5] >> 4; /* [31:28] of 1st data object */

		pd_phy_bist_mode(mode);