Commit 7f728318 authored by Jameson Thies's avatar Jameson Thies Committed by Greg Kroah-Hartman
Browse files

usb: typec: ucsi: resume work after EC init



A manual EC sysjump will restart the PPM and break communication with
the UCSI driver by disabling notifications in the initial PPM state.
Update cros_ec_ucsi to listen for PPM init events and treat them as a
system resume to re-establish communication with the PPM (ChromeOS EC).

Signed-off-by: default avatarJameson Thies <jthies@google.com>
Reviewed-by: default avatarŁukasz Bartosik <ukaszb@chromium.org>
Reviewed-by: default avatarBenson Leung <bleung@chromium.org>
Link: https://lore.kernel.org/r/20250204024600.4138776-3-jthies@google.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dcba6971
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -206,12 +206,19 @@ static int cros_ucsi_event(struct notifier_block *nb,
{
	struct cros_ucsi_data *udata = container_of(nb, struct cros_ucsi_data, nb);

	if (!(host_event & PD_EVENT_PPM))
		return NOTIFY_OK;
	if (host_event & PD_EVENT_INIT) {
		/* Late init event received from ChromeOS EC. Treat this as a
		 * system resume to re-enable communication with the PPM.
		 */
		dev_dbg(udata->dev, "Late PD init received\n");
		ucsi_resume(udata->ucsi);
	}

	if (host_event & PD_EVENT_PPM) {
		dev_dbg(udata->dev, "UCSI notification received\n");
		flush_work(&udata->work);
		schedule_work(&udata->work);
	}

	return NOTIFY_OK;
}