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

Commit 1965ae98 authored by Vijayavardhan Vennapusa's avatar Vijayavardhan Vennapusa Committed by Mayank Rana
Browse files

USB: dwc3-msm: Use maximum_speed as speed if no speed information



Speed is not notified in case of platforms having micro USB connector
instead of USB type C connector. In this case, use already set value
of maximum_speed as speed. maximum_speed can be set using devicetree
entry. If it is not set using devicetree entry, it is set as super
speed by default with dwc3_probe() API.

Change-Id: I6f29914ca9e2345157330651464b7a0c151f1f97
Signed-off-by: default avatarVijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent eba7cc0e
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -2591,7 +2591,11 @@ static int dwc3_msm_id_notifier(struct notifier_block *nb,
	dbg_event(0xFF, "cc_state", mdwc->typec_orientation);

	speed = extcon_get_cable_state_(edev, EXTCON_USB_SPEED);
	dwc->maximum_speed = (speed == 0) ? USB_SPEED_HIGH : USB_SPEED_SUPER;
	/* Use default dwc->maximum_speed if extcon doesn't report speed. */
	if (speed >= 0)
		dwc->maximum_speed =
			(speed == 0) ? USB_SPEED_HIGH : USB_SPEED_SUPER;

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

@@ -2634,7 +2638,11 @@ static int dwc3_msm_vbus_notifier(struct notifier_block *nb,
	dbg_event(0xFF, "cc_state", mdwc->typec_orientation);

	speed = extcon_get_cable_state_(edev, EXTCON_USB_SPEED);
	dwc->maximum_speed = (speed == 0) ? USB_SPEED_HIGH : USB_SPEED_SUPER;
	/* Use default dwc->maximum_speed if extcon doesn't report speed. */
	if (speed >= 0)
		dwc->maximum_speed =
			(speed == 0) ? USB_SPEED_HIGH : USB_SPEED_SUPER;

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