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

Commit eedee622 authored by Sriharsha Allenki's avatar Sriharsha Allenki
Browse files

usb: dwc3: Change to simulate VBUS without extcon/PMI



On targets that does not have any mechanism for VBUS
and ID notifications, simulate a VBUS connect to put
the core in peripheral mode by default.

Signed-off-by: default avatarSriharsha Allenki <sallenki@codeaurora.org>
Change-Id: I951af6d98820bc2ee1bd8f7d3affa3832b4695f9
parent e7cc30f3
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -2907,9 +2907,17 @@ static int dwc3_msm_extcon_register(struct dwc3_msm *mdwc)
	struct extcon_dev *edev;
	int idx, extcon_cnt, ret = 0;
	bool check_vbus_state, check_id_state, phandle_found = false;
	struct dwc3 *dwc = platform_get_drvdata(mdwc->dwc3);

	if (!of_property_read_bool(node, "extcon"))
	if (!of_property_read_bool(node, "extcon") &&
				(dwc->dr_mode == USB_DR_MODE_OTG)) {
		dev_dbg(mdwc->dev, "%s: no extcon, simulate vbus connect\n",
								__func__);
		mdwc->vbus_active = true;
		dwc->vbus_active = true;
		queue_work(mdwc->dwc3_wq, &mdwc->resume_work);
		return 0;
	}

	extcon_cnt = of_count_phandle_with_args(node, "extcon", NULL);
	if (extcon_cnt < 0) {