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

Commit b5c362f0 authored by Linyu Yuan's avatar Linyu Yuan
Browse files

usb: misc: nb7vpq904m: check partner changed flag



Certain Type-C USB adapters (which doesn't support PD),
when connected switch the USB port type from USB3 to USB2.
This is because the response for GET_CONNECTOR_STATUS
has empty partner type.

Example UCSI IPC log:
213.212929:   sync_write: CONTROL: 12 00 01 00 00 00 00 00
213.216613:   read: CCI: 02 09 00 80
213.221135:   read: MSG_IN: 00 00 0d 00 00 00 00 00 00

Parsing the logs gives the following information:
Connect Status: connected
Power Operation Mode: USB Type-C Current - 3A
Power Direction: consumer
Connector Partner Type: Reserved

Fix this by checking whether partner change flag is set
and not process if it is not set.

Change-Id: Ic5884f52e3d0c6936eae6a87b2e133d3e2032428
Signed-off-by: default avatarLinyu Yuan <linyyuan@codeaurora.org>
parent 0e0e41ea
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -455,6 +455,9 @@ static int ssusb_redriver_ucsi_notifier(struct notifier_block *nb,
	struct ucsi_glink_constat_info *info = data;
	enum operation_mode op_mode;

	if (info->connect && !info->partner_change)
		return NOTIFY_DONE;

	/*
	 * when connect a DP only cable,
	 * ucsi set usb flag first, then set usb and alternate mode