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

Commit 61dc0c1e authored by Vijayavardhan Vennapusa's avatar Vijayavardhan Vennapusa
Browse files

USB: phy-msm: Don't use pm_runtime_put_sync while stopping host mode



Currently driver is using pm_runtime_put_sync() during stop host mode.
Due to this, USB enters low power mode immediately and results in
unnecessarily USB exiting & entering low power mode in B_IDLE state.
pm_runtime_autosuspend() doesn't put device in low power mode immediately
rather it starts autosuspend timer of autosuspend delay. This helps in
avoiding unnecessary exit and enter low power mode. Hence fix this by
using pm_runtime_autosuspend() after updating device busy time while
coming back to idle from host role.

Change-Id: I02c9d61685ab36bef830389839a9fc964acb2ae3
Signed-off-by: default avatarVijayavardhan Vennapusa <vvreddy@codeaurora.org>
parent 9d17b246
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1862,7 +1862,9 @@ static void msm_otg_start_host(struct usb_otg *otg, int on)
	}
	msm_otg_dbg_log_event(&motg->phy, "PM RT: StartHost PUT",
				     get_pm_runtime_counter(motg->phy.dev), 0);
	pm_runtime_put_sync(otg->phy->dev);

	pm_runtime_mark_last_busy(otg->phy->dev);
	pm_runtime_put_autosuspend(otg->phy->dev);
}

static void msm_hsusb_vbus_power(struct msm_otg *motg, bool on)
@@ -2041,7 +2043,8 @@ static void msm_otg_start_peripheral(struct usb_otg *otg, int on)
	}
	msm_otg_dbg_log_event(&motg->phy, "PM RT: StartPeri PUT",
				     get_pm_runtime_counter(motg->phy.dev), 0);
	pm_runtime_put(otg->phy->dev);
	pm_runtime_mark_last_busy(otg->phy->dev);
	pm_runtime_put_autosuspend(otg->phy->dev);
}

static int msm_otg_set_peripheral(struct usb_otg *otg,