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

Commit 5b9ccc72 authored by Jack Pham's avatar Jack Pham
Browse files

usb: pd: Fix SOP' message header



An outgoing SOP'/SOP'' message header has different meaning for
the data/power role fields used for SOP. These should be 0.

Change-Id: Iac44320a55ed9d814112bb9ae6ca20cc4e898f04
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 42f765e7
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -674,8 +674,13 @@ static int pd_send_msg(struct usbpd *pd, u8 msg_type, const u32 *data,
	if (pd->hard_reset_recvd)
		return -EBUSY;

	if (sop == SOP_MSG)
		hdr = PD_MSG_HDR(msg_type, pd->current_dr, pd->current_pr,
				pd->tx_msgid[sop], num_data, pd->spec_rev);
	else
		/* sending SOP'/SOP'' to a cable, PR/DR fields should be 0 */
		hdr = PD_MSG_HDR(msg_type, 0, 0, pd->tx_msgid[sop], num_data,
				pd->spec_rev);

	ret = pd_phy_write(hdr, (u8 *)data, num_data * sizeof(u32), sop);
	if (ret) {