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

Commit 8c155eaf authored by Mayank Rana's avatar Mayank Rana
Browse files

dwc3-msm: Add support to disable host mode PM runtime



In host mode different issues like PHY is not going into IN_L2 state on
device disconnect or PORTSC interrupt is not seen on device connect case.
Hence add support to disable host mode PM runtime which prevent USB host
bus suspend.

Change-Id: Ic189de889db5368ee91accf4965a1a2866bdb69c
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent a69c694d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -48,6 +48,8 @@ Optional properties :
  present if this property is defined.
- qcom,ext-hub-reset-gpio: This corresponds to gpio which is used for HUB reset.
- qcom,disable-dev-mode-pm: If present, it disables PM runtime functionality for device mode.
- qcom,disable-host-mode-pm: If present, it disables XHCI PM runtime functionality when USB
  host mode is used.
Sub nodes:
- Sub node for "DWC3- USB3 controller".
  This sub node is required property for device node. The properties of this subnode
+12 −0
Original line number Diff line number Diff line
@@ -207,6 +207,7 @@ struct dwc3_msm {
	bool			vbus_active;
	bool			suspend;
	bool			ext_inuse;
	bool			disable_host_mode_pm;
	enum dwc3_id_state	id_state;
	unsigned long		lpm_flags;
#define MDWC3_SS_PHY_SUSPEND		BIT(0)
@@ -2333,6 +2334,9 @@ static int dwc3_msm_probe(struct platform_device *pdev)
		dev_err(&pdev->dev,
			"unable to read platform data tx fifo size\n");

	mdwc->disable_host_mode_pm = of_property_read_bool(node,
				"qcom,disable-host-mode-pm");

	dwc3_set_notifier(&dwc3_msm_notify_event);

	/* Assumes dwc3 is the only DT child of dwc3-msm */
@@ -2605,6 +2609,14 @@ static int dwc3_otg_start_host(struct dwc3_msm *mdwc, int on)
			return ret;
		}

		/*
		 * In some cases it is observed that USB PHY is not going into
		 * suspend with host mode suspend functionality. Hence disable
		 * XHCI's runtime PM here if disable_host_mode_pm is set.
		 */
		if (mdwc->disable_host_mode_pm)
			pm_runtime_disable(&dwc->xhci->dev);

		hcd = platform_get_drvdata(dwc->xhci);

		mdwc->in_host_mode = true;