Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp40790pxy; Tue, 27 Apr 2021 22:14:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw53NYZiUr4UIGIxGuODJ4p0ZcyfbFXsDgTI+19vRw/QHWn/XL1MRtcb/QQRrgPC5VJXSUy X-Received: by 2002:a05:6a00:1494:b029:278:a4bc:957f with SMTP id v20-20020a056a001494b0290278a4bc957fmr10150900pfu.55.1619586869633; Tue, 27 Apr 2021 22:14:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619586869; cv=none; d=google.com; s=arc-20160816; b=OUCISNRXwztG2ZR0P1InY/nhtWuwiukWeLsVrNMBAHKpr+cTM/BZDA9aOTVfczFDRW 8yp6SgNz1WDRXhApeu0yesgsFUCXvBsYe4lH5ukGxmQZBbdVx+lP7mF6ziZPlp2yEAIR 6iYiGpX+fn8EVWpwZp206K5P2rR7OrmcBshRbe/8Nh6g1S1JdYAgFa80Z5yOgKsrhqzu dewcaz9ko1Su/+UF538PDi+vBgS+nZ7HJU4HqBvSV1/7z0TxDxtdm/dgDU17q9t8kiFg ZcXCXQfGjvw+tVEepWPubDupxIcqBCHDJ+pM17lILI1Ge1wUpK6YgJzv77GmYkzfXm0S BvGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=q92VnfR23mnyLFNlo7QBZ7pxCrucE2/2rPoCQsGOpAI=; b=yiruoM2AG8ysbkFHOmRRhtR7SVh2AqWt1FWVRJmmHzuul/MiAJG0V9+k4VF7DMoXR2 Bey7DNCAfPj5IhluX+WpssusdFX+MkRkar5Yc5aV9vnSPZI5oEKo0C/WwBlTxKmdmZMV b2k9hVJzsY4REtdYaBv3+VckLCPiz4isIl3UgcvagOJHRAYnILcEyyhAOSq6Wg8bFc/N kg8dbtBdJGXzxk+BuyJUMAjwYaznfdVgOzR2RDjntYGuvLD26suBdsJSpMxr/NO+cvVE GKdVH+8hjJhLbfY5B5OtcOjQwYRjV9AJRZY9WaBOEnOWwdTYS/C6WiE7dhClFfHW+kHx tebA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z12si6518829pfa.306.2021.04.27.22.14.15; Tue, 27 Apr 2021 22:14:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232012AbhD1FNa (ORCPT + 99 others); Wed, 28 Apr 2021 01:13:30 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:55773 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235529AbhD1FNR (ORCPT ); Wed, 28 Apr 2021 01:13:17 -0400 Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 27 Apr 2021 22:12:33 -0700 X-QCInternal: smtphost Received: from ironmsg01-blr.qualcomm.com ([10.86.208.130]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/AES256-SHA; 27 Apr 2021 22:12:31 -0700 X-QCInternal: smtphost Received: from c-sanm-linux.qualcomm.com ([10.206.25.31]) by ironmsg01-blr.qualcomm.com with ESMTP; 28 Apr 2021 10:42:03 +0530 Received: by c-sanm-linux.qualcomm.com (Postfix, from userid 2343233) id 26EF9399E; Wed, 28 Apr 2021 10:42:02 +0530 (IST) From: Sandeep Maheswaram To: Andy Gross , Bjorn Andersson , Greg Kroah-Hartman , Felipe Balbi , Stephen Boyd , Doug Anderson , Matthias Kaehlcke Cc: linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Manu Gautam , Sandeep Maheswaram Subject: [PATCH v7 4/5] usb: dwc3: qcom: Configure wakeup interrupts during suspend Date: Wed, 28 Apr 2021 10:41:55 +0530 Message-Id: <1619586716-8687-5-git-send-email-sanm@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1619586716-8687-1-git-send-email-sanm@codeaurora.org> References: <1619586716-8687-1-git-send-email-sanm@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Configure interrupts based on hs_phy_mode to avoid triggering of interrupts during system suspend and suspend the device successfully. Signed-off-by: Sandeep Maheswaram Reviewed-by: Matthias Kaehlcke --- drivers/usb/dwc3/dwc3-qcom.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c index 66183c6..82125bc 100644 --- a/drivers/usb/dwc3/dwc3-qcom.c +++ b/drivers/usb/dwc3/dwc3-qcom.c @@ -316,22 +316,36 @@ static void dwc3_qcom_disable_wakeup_irq(int irq) static void dwc3_qcom_disable_interrupts(struct dwc3_qcom *qcom) { - dwc3_qcom_disable_wakeup_irq(qcom->hs_phy_irq); + struct dwc3 *dwc = platform_get_drvdata(qcom->dwc3); - dwc3_qcom_disable_wakeup_irq(qcom->dp_hs_phy_irq); + dwc3_qcom_disable_wakeup_irq(qcom->hs_phy_irq); - dwc3_qcom_disable_wakeup_irq(qcom->dm_hs_phy_irq); + if (dwc->hs_phy_mode & PHY_MODE_USB_HOST_LS) { + dwc3_qcom_disable_wakeup_irq(qcom->dp_hs_phy_irq); + } else if (dwc->hs_phy_mode & PHY_MODE_USB_HOST_HS) { + dwc3_qcom_disable_wakeup_irq(qcom->dm_hs_phy_irq); + } else { + dwc3_qcom_disable_wakeup_irq(qcom->dp_hs_phy_irq); + dwc3_qcom_disable_wakeup_irq(qcom->dm_hs_phy_irq); + } dwc3_qcom_disable_wakeup_irq(qcom->ss_phy_irq); } static void dwc3_qcom_enable_interrupts(struct dwc3_qcom *qcom) { - dwc3_qcom_enable_wakeup_irq(qcom->hs_phy_irq); + struct dwc3 *dwc = platform_get_drvdata(qcom->dwc3); - dwc3_qcom_enable_wakeup_irq(qcom->dp_hs_phy_irq); + dwc3_qcom_enable_wakeup_irq(qcom->hs_phy_irq); - dwc3_qcom_enable_wakeup_irq(qcom->dm_hs_phy_irq); + if (dwc->hs_phy_mode & PHY_MODE_USB_HOST_LS) { + dwc3_qcom_enable_wakeup_irq(qcom->dp_hs_phy_irq); + } else if (dwc->hs_phy_mode & PHY_MODE_USB_HOST_HS) { + dwc3_qcom_enable_wakeup_irq(qcom->dm_hs_phy_irq); + } else { + dwc3_qcom_enable_wakeup_irq(qcom->dp_hs_phy_irq); + dwc3_qcom_enable_wakeup_irq(qcom->dm_hs_phy_irq); + } dwc3_qcom_enable_wakeup_irq(qcom->ss_phy_irq); } -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation