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

Commit 386758a7 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

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

parents 03e4c061 45b0bc49
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);
	}