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

Commit 91d216f4 authored by Pratham Pratap's avatar Pratham Pratap
Browse files

usb: pd: Don't retry sending Source Capabilities if PD capable



If connected to a sink that we already know is PD capable, the
next time Source Capabilities is sent, whether due to reset or
in response Get_Source_Capabilities, upon failure should not
retry for nCapsCount times. Instead, simply issue a Soft Reset.

Change-Id: Ia45600f013555814c008edf60e0daf599d9f9dee
Signed-off-by: default avatarPratham Pratap <prathampratap@codeaurora.org>
parent 3b501c04
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -899,6 +899,7 @@ static void pd_send_hard_reset(struct usbpd *pd)
	pd->hard_reset_count++;
	pd_phy_signal(HARD_RESET_SIG);
	pd->in_pr_swap = false;
	pd->pd_connected = false;
	power_supply_set_property(pd->usb_psy, POWER_SUPPLY_PROP_PR_SWAP, &val);
}

@@ -2213,6 +2214,10 @@ static void handle_state_src_send_capabilities(struct usbpd *pd,
	ret = pd_send_msg(pd, MSG_SOURCE_CAPABILITIES, default_src_caps,
			ARRAY_SIZE(default_src_caps), SOP_MSG);
	if (ret) {
		if (pd->pd_connected) {
			usbpd_set_state(pd, PE_SEND_SOFT_RESET);
			return;
		}
		/*
		 * Technically this is PE_SRC_Discovery, but we can
		 * handle it by setting a timer to come back to the