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

Commit 9b1743cb authored by Linyu Yuan's avatar Linyu Yuan
Browse files

usb: misc: nb7vpq904m: disable chip when boot up without cable



When boot up without USB cable, first UCSI_GET_CONNECTOR_STATUS command
will return all zero message,

Example UCSI IPC log:
40.319381997:   sync_write: CONTROL: 12 00 01 00 00 00 00 00
40.319507987:   read: CCI: 00 09 00 80
40.319620018:   read: MSG_IN: 00 00 00 00 00 00 00 00 00

Disable chip when connect status not set.

Change-Id: I6c91e462b10a8fc6798d95148be799706861ab46
Signed-off-by: default avatarLinyu Yuan <linyyuan@codeaurora.org>
parent b5c362f0
Loading
Loading
Loading
Loading
+13 −10
Original line number Diff line number Diff line
@@ -458,13 +458,17 @@ static int ssusb_redriver_ucsi_notifier(struct notifier_block *nb,
	if (info->connect && !info->partner_change)
		return NOTIFY_DONE;

	if (!info->connect) {
		if (info->partner_usb || info->partner_alternate_mode)
			dev_err(redriver->dev, "set partner when no connection\n");
		op_mode = OP_MODE_NONE;
	} else if (info->partner_usb && info->partner_alternate_mode) {
		/*
		 * when connect a DP only cable,
		 * ucsi set usb flag first, then set usb and alternate mode
		 * after dp start link training.
		 * it should only set alternate_mode flag ???
		 */
	if (info->partner_usb && info->partner_alternate_mode) {
		if (redriver->op_mode == OP_MODE_DP)
			return NOTIFY_OK;
		op_mode = OP_MODE_USB_AND_DP;
@@ -472,10 +476,9 @@ static int ssusb_redriver_ucsi_notifier(struct notifier_block *nb,
		if (redriver->op_mode == OP_MODE_DP)
			return NOTIFY_OK;
		op_mode = OP_MODE_USB;
	}
	else if (info->partner_alternate_mode)
	} else if (info->partner_alternate_mode) {
		op_mode = OP_MODE_DP;
	else
	} else
		op_mode = OP_MODE_NONE;

	if (redriver->op_mode == op_mode)