mirror of
https://github.com/LineageOS/android_kernel_fxtec_sm6115.git
synced 2026-08-20 22:31:07 +00:00
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: I5a53073f5473575e7206e1fdd344b8f14affddc2 Signed-off-by: Jack Pham <jackp@codeaurora.org>
This commit is contained in:
@ -1915,6 +1915,16 @@ 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);
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Technically this is PE_SRC_Discovery, but we can
|
||||
* handle it by setting a timer to come back to the
|
||||
* same state for the next retry.
|
||||
*/
|
||||
pd->caps_count++;
|
||||
if (pd->caps_count >= PD_CAPS_COUNT) {
|
||||
usbpd_dbg(&pd->dev, "Src CapsCounter exceeded, disabling PD\n");
|
||||
|
||||
Reference in New Issue
Block a user