usb: dwc3-msm: Don't allow dynamic speed change for host mode

Dynamic speed change is not supported for Host mode.
Return operation not permitted for the same.

Change-Id: I926c1f7cf5f5c65729a1d3fe2a89dc11f97970ad
Signed-off-by: Harsh Agarwal <quic_harshq@quicinc.com>
Signed-off-by: Prashanth K <quic_prashk@quicinc.com>
This commit is contained in:
Prashanth K 2022-05-13 12:00:07 +05:30 committed by Gerrit - the friendly Code Review server
parent db78883a87
commit aa4f081314

View File

@ -4884,6 +4884,10 @@ static ssize_t speed_store(struct device *dev, struct device_attribute *attr,
struct dwc3_msm *mdwc = dev_get_drvdata(dev);
enum usb_device_speed req_speed = USB_SPEED_UNKNOWN;
/* no speed change in host mode */
if (!test_bit(ID, &mdwc->inputs))
return -EPERM;
/* DEVSPD can only have values SS(0x4), HS(0x0) and FS(0x1).
* per 3.20a data book. Allow only these settings. Note that,
* xhci does not support full-speed only mode.