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

Commit a5706c4f 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: Re-check for disconnect after PR swap"

parents 7961b236 439cb810
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -723,6 +723,15 @@ static void usbpd_set_state(struct usbpd *pd, enum usbpd_state next_state)
		break;

	/* Source states */
	case PE_SRC_DISABLED:
		/* are we still connected? */
		if (pd->typec_mode == POWER_SUPPLY_TYPEC_NONE) {
			pd->current_pr = PR_NONE;
			kick_sm(pd, 0);
		}

		break;

	case PE_SRC_STARTUP:
		if (pd->current_dr == DR_NONE) {
			pd->current_dr = DR_DFP;
@@ -853,6 +862,10 @@ static void usbpd_set_state(struct usbpd *pd, enum usbpd_state next_state)

	case PE_SRC_HARD_RESET:
	case PE_SNK_HARD_RESET:
		/* are we still connected? */
		if (pd->typec_mode == POWER_SUPPLY_TYPEC_NONE)
			pd->current_pr = PR_NONE;

		/* hard reset may sleep; handle it in the workqueue */
		kick_sm(pd, 0);
		break;