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

Commit d5ee68b8 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "dwc3-msm: Skip querying speed and cc_state with EUD extcon device"

parents 6cd86f4a bab513b2
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -3194,10 +3194,11 @@ static void dwc3_resume_work(struct work_struct *w)
	union extcon_property_value val;
	unsigned int extcon_id;
	struct extcon_dev *edev = NULL;
	const char *edev_name;
	char *eud_str;
	int ret = 0;

	dev_dbg(mdwc->dev, "%s: dwc3 resume work\n", __func__);

	if (mdwc->extcon && mdwc->vbus_active && !mdwc->in_restart) {
		extcon_id = EXTCON_USB;
		edev = mdwc->extcon[mdwc->ext_idx].edev;
@@ -3206,6 +3207,15 @@ static void dwc3_resume_work(struct work_struct *w)
		edev = mdwc->extcon[mdwc->ext_idx].edev;
	}

	if (edev) {
		edev_name = extcon_get_edev_name(edev);
		dbg_log_string("edev:%s\n", edev_name);
		/* Skip querying speed and cc_state for EUD edev */
		eud_str = strnstr(edev_name, "eud", strlen(edev_name));
		if (eud_str)
			goto skip_update;
	}

	/* Check speed and Type-C polarity values in order to configure PHY */
	if (edev && extcon_get_state(edev, extcon_id)) {
		dwc->maximum_speed = dwc->max_hw_supp_speed;
@@ -3237,6 +3247,7 @@ static void dwc3_resume_work(struct work_struct *w)
		dbg_event(0xFF, "cc_state", mdwc->typec_orientation);
	}

skip_update:
	/*
	 * Skip scheduling sm work if no work is pending. When boot-up
	 * with USB cable connected, usb state m/c is skipped to avoid