mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 21:22:09 -04:00
Merge "usb: dwc3-msm: Prevent switch to peripheral for host-mode only core"
This commit is contained in:
commit
d7006445cf
1 changed files with 6 additions and 0 deletions
|
|
@ -3869,8 +3869,14 @@ static ssize_t mode_store(struct device *dev, struct device_attribute *attr,
|
|||
const char *buf, size_t count)
|
||||
{
|
||||
struct dwc3_msm *mdwc = dev_get_drvdata(dev);
|
||||
struct dwc3 *dwc = platform_get_drvdata(mdwc->dwc3);
|
||||
|
||||
if (sysfs_streq(buf, "peripheral")) {
|
||||
if (dwc->dr_mode == USB_DR_MODE_HOST) {
|
||||
dev_err(dev, "Core supports host mode only.\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
mdwc->vbus_active = true;
|
||||
mdwc->id_state = DWC3_ID_FLOAT;
|
||||
} else if (sysfs_streq(buf, "host")) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue