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

Commit e446b985 authored by Manu Gautam's avatar Manu Gautam
Browse files

USB: phy-msm-usb: Disable VBUS OTG during REBOOT



Some PMICs preserve OTG state across reboots. This can
result in VBUS detection failure if target was rebooted
in host mode. To fix this make sure that VBUS OTG is
turned off during shutdown. With this PMIC boots up with
OTG (or host) mode disabled and can correctly detect VBUS
state after reboot.

CRs-fixed: 650765
Change-Id: If68bb5351577ba1020d1e88077bb9ae85654733a
Signed-off-by: default avatarManu Gautam <mgautam@codeaurora.org>
parent 04f8a4e5
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -5091,6 +5091,14 @@ static int msm_otg_remove(struct platform_device *pdev)
	return 0;
}

static void msm_otg_shutdown(struct platform_device *pdev)
{
	struct msm_otg *motg = platform_get_drvdata(pdev);

	dev_dbg(&pdev->dev, "OTG shutdown\n");
	msm_hsusb_vbus_power(motg, 0);
}

#ifdef CONFIG_PM_RUNTIME
static int msm_otg_runtime_idle(struct device *dev)
{
@@ -5203,6 +5211,7 @@ static struct of_device_id msm_otg_dt_match[] = {
static struct platform_driver msm_otg_driver = {
	.probe = msm_otg_probe,
	.remove = msm_otg_remove,
	.shutdown = msm_otg_shutdown,
	.driver = {
		.name = DRIVER_NAME,
		.owner = THIS_MODULE,