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

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

Merge "usb: dwc3-msm: Fix maximum_speed determination"

parents 6ad501a2 f820fe83
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -2737,8 +2737,6 @@ static void dwc3_resume_work(struct work_struct *w)

	/* Check speed and Type-C polarity values in order to configure PHY */
	if (edev && extcon_get_state(edev, extcon_id)) {
		/* Use default dwc->maximum_speed if speed isn't reported */
		if (dwc->maximum_speed > dwc->max_hw_supp_speed)
		dwc->maximum_speed = dwc->max_hw_supp_speed;

		ret = extcon_get_property(edev, extcon_id,
@@ -2747,12 +2745,12 @@ static void dwc3_resume_work(struct work_struct *w)
		if (!ret && val.intval == 0)
			dwc->maximum_speed = USB_SPEED_HIGH;

		if (mdwc->override_usb_speed) {
		if (mdwc->override_usb_speed &&
				mdwc->override_usb_speed < dwc->maximum_speed) {
			dwc->maximum_speed = mdwc->override_usb_speed;
			dwc->gadget.max_speed = dwc->maximum_speed;
			dbg_event(0xFF, "override_speed",
					mdwc->override_usb_speed);
			mdwc->override_usb_speed = 0;
		}

		dbg_event(0xFF, "speed", dwc->maximum_speed);
@@ -3309,6 +3307,8 @@ static ssize_t speed_store(struct device *dev, struct device_attribute *attr,
			req_speed <= dwc->max_hw_supp_speed) {
		mdwc->override_usb_speed = req_speed;
		schedule_work(&mdwc->restart_usb_work);
	} else if (req_speed >= dwc->max_hw_supp_speed) {
		mdwc->override_usb_speed = 0;
	}

	return count;