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

Commit aef66391 authored by Ajay Agarwal's avatar Ajay Agarwal
Browse files

usb: dwc3-msm: Add support for default host mode if extcon absent



Currently the driver starts peripheral mode if DWC3 is dual role
capable but does not have extcon handle. But on some platforms
like automotive, the objective is to start host mode by default
if extcon is not present. Add required support for the same
based on DT property.

Change-Id: I397fe6aa9652e913e9ef9f8a82cc438706026405
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent 582df5da
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -82,6 +82,8 @@ Optional properties :
- qcom,host-poweroff-in-pm-suspend: If present, allow PM suspend to happen
	irrespective of runtimePM state of host and power collapse the core.
	This also leads to reset-resume of connected devices on PM resume.
- qcom,default-mode-host: If present, start host mode on probe for an OTG
	capable DWC3 which does not have extcon handle.

Sub nodes:
- Sub node for "DWC3- USB3 controller".
+7 −5
Original line number Diff line number Diff line
@@ -3675,13 +3675,15 @@ static int dwc3_msm_probe(struct platform_device *pdev)
		if (ret)
			goto put_dwc3;
	} else {
		if (dwc->dr_mode == USB_DR_MODE_OTG ||
		if ((dwc->dr_mode == USB_DR_MODE_OTG &&
		     !of_property_read_bool(node, "qcom,default-mode-host")) ||
		     dwc->dr_mode == USB_DR_MODE_PERIPHERAL) {
			dev_dbg(mdwc->dev, "%s: no extcon, simulate vbus connect\n",
			dev_dbg(mdwc->dev, "%s: no extcon, start peripheral mode\n",
								__func__);
			mdwc->vbus_active = true;
		} else if (dwc->dr_mode == USB_DR_MODE_HOST) {
			dev_dbg(mdwc->dev, "DWC3 in host only mode\n");
		} else {
			dev_dbg(mdwc->dev, "%s: no extcon, start host mode\n",
								__func__);
			mdwc->id_state = DWC3_ID_GROUND;
		}