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

Commit 456aec26 authored by Mayank Rana's avatar Mayank Rana
Browse files

USB: dwc3-msm: Add module param to override USB LPM functionality



It is required to support USB LPM functionality with particular
composition to allow XO shutdown. This change adds module param
as usb_lpm_override. By default it is not set, set the same as
echo 1 > /sys/module/dwc3_msm/parameters/usb_lpm_override.
This would overrides currently used suspend_resume_no_support
variable and allows USB LPM on USB cable disconnect.

Change-Id: I220e65a714cd3ab5607c18ab459b9376418567c7
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent f2e6c2d4
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -76,6 +76,10 @@ static bool prop_chg_detect;
module_param(prop_chg_detect, bool, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(prop_chg_detect, "Enable Proprietary charger detection");

static bool usb_lpm_override;
module_param(usb_lpm_override, bool, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(usb_lpm_override, "Override no_suspend_resume with USB");

#define USB3_PORTSC		(0x430)
#define PORT_PE			(0x1 << 1)
/**
@@ -1281,9 +1285,10 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc)
	bool host_ss_active;
	bool can_suspend_ssphy;

	dev_dbg(mdwc->dev, "%s: entering lpm\n", __func__);
	dev_dbg(mdwc->dev, "%s: entering lpm. usb_lpm_override:%d\n",
					 __func__, usb_lpm_override);

	if (mdwc->suspend_resume_no_support) {
	if (!usb_lpm_override && mdwc->suspend_resume_no_support) {
		dev_dbg(mdwc->dev, "%s no support for suspend\n", __func__);
		return -EPERM;
	}