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

Commit 6fe2c698 authored by Mayank Rana's avatar Mayank Rana
Browse files

dwc3-msm: Update maximum speed using extcon for high speed case only



EXTCON_PROP_USB_SS property only supports boolean value (i.e 0 - high
speed and 1 - super speed). Hence this property can't be used to
select super speed plus as speed. Hence use hardware supported maximum
speed always and use EXTCON_PROP_USB_SS property based value if it
suggests as high speed.

Change-Id: I157e63bfbb4cf8f756882a7e9573d8c99ea3a73d
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 649ae129
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -2523,17 +2523,16 @@ 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)) {
		ret = extcon_get_property(edev, extcon_id,
					EXTCON_PROP_USB_SS, &val);

		/* Use default dwc->maximum_speed if speed isn't reported */
		if (!ret)
			dwc->maximum_speed = (val.intval == 0) ?
					USB_SPEED_HIGH : USB_SPEED_SUPER;

		if (dwc->maximum_speed > dwc->max_hw_supp_speed)
			dwc->maximum_speed = dwc->max_hw_supp_speed;

		ret = extcon_get_property(edev, extcon_id,
				EXTCON_PROP_USB_SS, &val);

		if (!ret && val.intval == 0)
			dwc->maximum_speed = USB_SPEED_HIGH;

		if (mdwc->override_usb_speed) {
			dwc->maximum_speed = mdwc->override_usb_speed;
			dwc->gadget.max_speed = dwc->maximum_speed;