From 49ceb526b258d173ebf3ad4febb12372b6a20156 Mon Sep 17 00:00:00 2001 From: Ajay Agarwal Date: Mon, 21 Sep 2020 10:40:50 +0530 Subject: [PATCH] usb: phy: snps: Enable auto resume feature only in host mode 'Commit f62b4c27d0df ("usb: phy: snps: Enable auto-resume during host mode bus suspend")' started enabling USB auto resume for peripheral mode bus suspend as well. If the auto resume feature is enabled in device mode, the device is unable to detect the resume signalling by the host in some cases. And the auto resume feature is applicable only in host mode. So, enable the auto resume feature only in host mode. Change-Id: I59155bc122ac4f5c9bb04cb4ff487c7a6ba89e47 Signed-off-by: Ajay Agarwal --- drivers/usb/phy/phy-msm-snps-hs.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/usb/phy/phy-msm-snps-hs.c b/drivers/usb/phy/phy-msm-snps-hs.c index ac6a4ef288ad..35a46f7360aa 100644 --- a/drivers/usb/phy/phy-msm-snps-hs.c +++ b/drivers/usb/phy/phy-msm-snps-hs.c @@ -485,14 +485,13 @@ static int msm_hsphy_set_suspend(struct usb_phy *uphy, int suspend) suspend: if (suspend) { /* Bus suspend */ - if (phy->cable_connected || - (phy->phy.flags & PHY_HOST_MODE)) { - /* Enable auto-resume functionality only when - * there is some peripheral connected and real - * bus suspend happened + if (phy->cable_connected) { + /* Enable auto-resume functionality only during host + * mode bus suspend with some peripheral connected. */ - if ((phy->phy.flags & PHY_HSFS_MODE) || - (phy->phy.flags & PHY_LS_MODE)) { + if ((phy->phy.flags & PHY_HOST_MODE) && + ((phy->phy.flags & PHY_HSFS_MODE) || + (phy->phy.flags & PHY_LS_MODE))) { /* Enable auto-resume functionality by pulsing * signal */