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

Commit 0ee2387c authored by Ajay Agarwal's avatar Ajay Agarwal Committed by Jack Pham
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 3fce55b0
Loading
Loading
Loading
Loading
+7 −5
Original line number Original line Diff line number Diff line
@@ -3665,13 +3665,15 @@ static int dwc3_msm_probe(struct platform_device *pdev)
		if (ret)
		if (ret)
			goto put_dwc3;
			goto put_dwc3;
	} else {
	} else {
		if (dwc3_is_otg_or_drd(dwc) ||
		if ((dwc3_is_otg_or_drd(dwc) &&
		     !of_property_read_bool(node, "qcom,default-mode-host")) ||
		     dwc->dr_mode == USB_DR_MODE_PERIPHERAL) {
		     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__);
								__func__);
			mdwc->vbus_active = true;
			mdwc->vbus_active = true;
		} else if (dwc->dr_mode == USB_DR_MODE_HOST) {
		} else {
			dev_dbg(mdwc->dev, "DWC3 in host only mode\n");
			dev_dbg(mdwc->dev, "%s: no extcon, start host mode\n",
								__func__);
			mdwc->id_state = DWC3_ID_GROUND;
			mdwc->id_state = DWC3_ID_GROUND;
		}
		}