Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3460973pxv; Mon, 28 Jun 2021 05:10:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzIVbkZkTDNql1qVZDPNAfT9ZnqreTGBmoCtdQ01zX29M22KYlfp6adwIXD9Gzrt02Q0Ue X-Received: by 2002:a05:6402:51:: with SMTP id f17mr32064624edu.359.1624882213669; Mon, 28 Jun 2021 05:10:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624882213; cv=none; d=google.com; s=arc-20160816; b=lKOaraUBBwKP2IR+lUpgDL1W+MnjlUtj76/wmusPgUeQymBwE1qsM6bsMm8hlQJEB/ x5gnzxgI0TGx2TfA7eOsX+PgHO+7BmEMwQyWAw/xc9Y+lY8cjFAx2bBcPw0O41czQmQE h+DU1/JeMWOfbvZLHVGUXbaKJGcgqmqtwh2Xnzdo4E8Q2oG8aU4Q7tMI7UaNxBEHl2Gh nxwOPFqBiKjkHcgn5QBefFNQyNyrFG+rBND8O05T0DSeQ1SD9WKm3EqoAcLi7+q5wnC9 v5P6ePgTIatYpEQnF78DmvQV90wvIWJ+QKrydFpPQV6NLfO+RdFj2s37FZJ2AF6ZM1pC ccMQ== 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=vvvic953lVDDR7rRY0d6d9GUPtdktvKWN/SBQJgK3s+FG1WnMjLGHF7XvhHna4vTm9 1A+l+glm2Bwjwqde165UcUdiqsUDB+HO/BRQAq5Nx0FTPYDMNK4cFwZmtDhmWBlT6i8a 2jIULzVghteNo4GEyqLYmJqAdQOSxrmW4gH1Z3zRY2TAd88Rx1xs6iG91xkJVZM4EkmA 9oYE5xxDP6l+0cin4zuOseoHLDy3GO2K2Lj84sK6QDi0oMW8TeXDlfmjF3rUiEkKHbhd Sin4ppLzWv6LbbB7e9X5Yldn48AGxgy6ol9WPpZodnNFqrwDlzaN+JCMARrX8CPoT+yX mXng== 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 z6si12794001edd.214.2021.06.28.05.09.50; Mon, 28 Jun 2021 05:10:13 -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 S232923AbhF1MLX (ORCPT + 99 others); Mon, 28 Jun 2021 08:11:23 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:8336 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232608AbhF1MLV (ORCPT ); Mon, 28 Jun 2021 08:11:21 -0400 Received: from ironmsg09-lv.qualcomm.com ([10.47.202.153]) by alexa-out.qualcomm.com with ESMTP; 28 Jun 2021 05:08:56 -0700 X-QCInternal: smtphost Received: from ironmsg02-blr.qualcomm.com ([10.86.208.131]) by ironmsg09-lv.qualcomm.com with ESMTP/TLS/AES256-SHA; 28 Jun 2021 05:08:54 -0700 X-QCInternal: smtphost Received: from c-sanm-linux.qualcomm.com ([10.206.25.31]) by ironmsg02-blr.qualcomm.com with ESMTP; 28 Jun 2021 17:38:31 +0530 Received: by c-sanm-linux.qualcomm.com (Postfix, from userid 2343233) id 139473A50; Mon, 28 Jun 2021 17:38:30 +0530 (IST) From: Sandeep Maheswaram To: Andy Gross , Bjorn Andersson , Greg Kroah-Hartman , Felipe Balbi , Stephen Boyd , Doug Anderson , Matthias Kaehlcke , Mathias Nyman Cc: linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Pratham Pratap , Sandeep Maheswaram Subject: [PATCH v8 5/6] usb: dwc3: qcom: Configure wakeup interrupts during suspend Date: Mon, 28 Jun 2021 17:38:16 +0530 Message-Id: <1624882097-23265-6-git-send-email-sanm@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1624882097-23265-1-git-send-email-sanm@codeaurora.org> References: <1624882097-23265-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