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

Commit 45b0bc49 authored by Mayank Rana's avatar Mayank Rana
Browse files

usb: pd: start USB host mode with DR_SWAP when current_dr is UFP



Commit 38e9b250 ("usb: pd: Start USB host mode functionality with
SRC_STARTUP") has removed functionality which was starting USB host
mode after finding DP capable device. This results into no USB host
mode functionality with DR_SWAP request when current_dr is UFP. Fix
this issue by starting USB host mode with super speed on receiving
DR_SWAP request when current_dr is UFP.

CRs-Fixed: 2082369
Change-Id: I47ab6d55f495c6884eb5b6bb18181aa8deaf0ac1
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 70be28c9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1432,6 +1432,7 @@ static void reset_vdm_state(struct usbpd *pd)
static void dr_swap(struct usbpd *pd)
{
	reset_vdm_state(pd);
	usbpd_dbg(&pd->dev, "dr_swap: current_dr(%d)\n", pd->current_dr);

	if (pd->current_dr == DR_DFP) {
		stop_usb_host(pd);
@@ -1439,9 +1440,9 @@ static void dr_swap(struct usbpd *pd)
		pd->current_dr = DR_UFP;
	} else if (pd->current_dr == DR_UFP) {
		stop_usb_peripheral(pd);
		start_usb_host(pd, true);
		pd->current_dr = DR_DFP;

		/* don't start USB host until after SVDM discovery */
		usbpd_send_svdm(pd, USBPD_SID, USBPD_SVDM_DISCOVER_IDENTITY,
				SVDM_CMD_TYPE_INITIATOR, 0, NULL, 0);
	}