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

Commit dcc2087a authored by Dov Levenglick's avatar Dov Levenglick
Browse files

usb: dwc3: add support to skip power collapse



Adds support for skipping the power collapse flow
(dwc3_msm_config_gdsc) when peforming the suspend/disconnect
flows.
This is necessary until the device-specific flow for supporting
power collapse is implemented on each new device. As such,
usage this flag is expected to be done only in the earlier
stages of a product's life cycle.

Change-Id: Idd133664242665fecc5491d42d65e7adbe0ccaa3
Signed-off-by: default avatarDov Levenglick <dovl@codeaurora.org>
parent 072185c6
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -51,6 +51,7 @@ Optional properties :
- qcom,usb-dbm : phandle for the DBM device
- qcom,usb-dbm : phandle for the DBM device
- qcom,usbin-vadc: Corresponding vadc device's phandle to read usbin voltage using VADC.
- qcom,usbin-vadc: Corresponding vadc device's phandle to read usbin voltage using VADC.
	This will be used to get value of usb power supply's VOLTAGE_NOW property,
	This will be used to get value of usb power supply's VOLTAGE_NOW property,
- qcom,no-power-collapse: If present, the USB core will not perform power collapse


Sub nodes:
Sub nodes:
- Sub node for "DWC3- USB3 controller".
- Sub node for "DWC3- USB3 controller".
+6 −2
Original line number Original line Diff line number Diff line
@@ -192,6 +192,7 @@ struct dwc3_msm {
	struct completion ext_chg_wait;
	struct completion ext_chg_wait;
	unsigned int scm_dev_id;
	unsigned int scm_dev_id;
	bool suspend_resume_no_support;
	bool suspend_resume_no_support;
	bool disable_power_collapse;
};
};


#define USB_HSPHY_3P3_VOL_MIN		3050000 /* uV */
#define USB_HSPHY_3P3_VOL_MIN		3050000 /* uV */
@@ -1450,7 +1451,7 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc)
	wmb();
	wmb();


	/* remove vote for controller power collapse */
	/* remove vote for controller power collapse */
	if (!host_bus_suspend)
	if (!host_bus_suspend && !mdwc->disable_power_collapse)
		dwc3_msm_config_gdsc(mdwc, 0);
		dwc3_msm_config_gdsc(mdwc, 0);


	clk_disable_unprepare(mdwc->iface_clk);
	clk_disable_unprepare(mdwc->iface_clk);
@@ -1533,7 +1534,7 @@ static int dwc3_msm_resume(struct dwc3_msm *mdwc)
	}
	}


	/* add vote for controller power collapse */
	/* add vote for controller power collapse */
	if (!host_bus_suspend)
	if (!host_bus_suspend && !mdwc->disable_power_collapse)
		dwc3_msm_config_gdsc(mdwc, 1);
		dwc3_msm_config_gdsc(mdwc, 1);


	clk_prepare_enable(mdwc->utmi_clk);
	clk_prepare_enable(mdwc->utmi_clk);
@@ -2427,6 +2428,9 @@ static int dwc3_msm_probe(struct platform_device *pdev)


	mdwc->suspend_resume_no_support = of_property_read_bool(node,
	mdwc->suspend_resume_no_support = of_property_read_bool(node,
				"qcom,no-suspend-resume");
				"qcom,no-suspend-resume");

	mdwc->disable_power_collapse = of_property_read_bool(node,
				"qcom,no-power-collapse");
	/*
	/*
	 * DWC3 has separate IRQ line for OTG events (ID/BSV) and for
	 * DWC3 has separate IRQ line for OTG events (ID/BSV) and for
	 * DP and DM linestate transitions during low power mode.
	 * DP and DM linestate transitions during low power mode.