Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3461517pxv; Mon, 28 Jun 2021 05:10:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8/sv8/qcOcSZnvdMU/L0Y4paI4sXJ9lq+JBWK37FWOwxrLvbbnMWuCd0s8OzArO3XmevR X-Received: by 2002:aa7:c301:: with SMTP id l1mr32451057edq.215.1624882259050; Mon, 28 Jun 2021 05:10:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624882259; cv=none; d=google.com; s=arc-20160816; b=CiKxkizCeSH25b0ur7XD+x7sc/6lQ1deUhCcJia+BQjacyanQE6ECRrbfFshUUVwEa Ek97arNm4zchaKF7cbLjfsOSYrmPehmlCs4BK8/gSwrY6DGh40sU3Q3d0HWbknlETreY yPVslpKIxdKBhXxUw8XZ6HbR0jtORQbo5o0e6HM2vio5xGgU6oaOKKkiuHCslKnPDIB0 z8nTdoRl46m93NJKiqRicpy533PCCbtspD+vwu7zwI8wKxWWt4TFdIxOiuGVPSAhVQkm psTchNYHaWLuejXz35ztm10S01Csnk+JrcM2hvyoFq2Y+dBdxMbHmKKJ/YhsCufLqsef zCgw== 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=kWoKPpTNDfv6Z0gMegr6O/SuUj0Xo5p1PoV0++eh9ew=; b=ecXcfAE6nyD1AuKPbp+3Estz/oEjATdQLCYdgjatgPhfh49/cnQAzpAxSVcrpJ7N1B MNK8PDsT74gA448TsxULgTDFs/1XpAPgzcN1INh15RY8HCqDlas9I9Gc8rXiomIQ9M2G U2nHnaBz+h9ey3KxQREOL/zSaNMqVTWxb54FmbHogDDdSGJ+wpi0LO3sdnnRiXS1ekVc 4ai5ihSaUzP+er1GK3FvOIf4IRMs8Qbnl9UrACn6F/GAsQOkJD4hUa+7SfV4iRNtx+wc esSg0Qc8Eymw2wzDKtnWKJE5dcAfF4EPkJmjawOguxDA1s0RZtlQ7QSu2t+blqveS72R k0Wg== 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 d2si14938972ejd.638.2021.06.28.05.10.35; Mon, 28 Jun 2021 05:10:59 -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 S232979AbhF1ML3 (ORCPT + 99 others); Mon, 28 Jun 2021 08:11:29 -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 S232933AbhF1MLY (ORCPT ); Mon, 28 Jun 2021 08:11:24 -0400 Received: from ironmsg09-lv.qualcomm.com ([10.47.202.153]) by alexa-out.qualcomm.com with ESMTP; 28 Jun 2021 05:08:59 -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:57 -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:30 +0530 Received: by c-sanm-linux.qualcomm.com (Postfix, from userid 2343233) id C871C3A48; Mon, 28 Jun 2021 17:38:28 +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 4/6] usb: dwc3: qcom: Add helper functions to enable,disable wake irqs Date: Mon, 28 Jun 2021 17:38:15 +0530 Message-Id: <1624882097-23265-5-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 Adding helper functions to enable,disable wake irqs to make the code simple and readable. Signed-off-by: Sandeep Maheswaram Reviewed-by: Matthias Kaehlcke --- drivers/usb/dwc3/dwc3-qcom.c | 58 ++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 32 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c index 49e6ca9..66183c6 100644 --- a/drivers/usb/dwc3/dwc3-qcom.c +++ b/drivers/usb/dwc3/dwc3-qcom.c @@ -296,50 +296,44 @@ static void dwc3_qcom_interconnect_exit(struct dwc3_qcom *qcom) icc_put(qcom->icc_path_apps); } +static void dwc3_qcom_enable_wakeup_irq(int irq) +{ + if (!irq) + return; + + enable_irq(irq); + enable_irq_wake(irq); +} + +static void dwc3_qcom_disable_wakeup_irq(int irq) +{ + if (!irq) + return; + + disable_irq_wake(irq); + disable_irq_nosync(irq); +} + static void dwc3_qcom_disable_interrupts(struct dwc3_qcom *qcom) { - if (qcom->hs_phy_irq) { - disable_irq_wake(qcom->hs_phy_irq); - disable_irq_nosync(qcom->hs_phy_irq); - } + dwc3_qcom_disable_wakeup_irq(qcom->hs_phy_irq); - if (qcom->dp_hs_phy_irq) { - disable_irq_wake(qcom->dp_hs_phy_irq); - disable_irq_nosync(qcom->dp_hs_phy_irq); - } + dwc3_qcom_disable_wakeup_irq(qcom->dp_hs_phy_irq); - if (qcom->dm_hs_phy_irq) { - disable_irq_wake(qcom->dm_hs_phy_irq); - disable_irq_nosync(qcom->dm_hs_phy_irq); - } + dwc3_qcom_disable_wakeup_irq(qcom->dm_hs_phy_irq); - if (qcom->ss_phy_irq) { - disable_irq_wake(qcom->ss_phy_irq); - disable_irq_nosync(qcom->ss_phy_irq); - } + dwc3_qcom_disable_wakeup_irq(qcom->ss_phy_irq); } static void dwc3_qcom_enable_interrupts(struct dwc3_qcom *qcom) { - if (qcom->hs_phy_irq) { - enable_irq(qcom->hs_phy_irq); - enable_irq_wake(qcom->hs_phy_irq); - } + dwc3_qcom_enable_wakeup_irq(qcom->hs_phy_irq); - if (qcom->dp_hs_phy_irq) { - enable_irq(qcom->dp_hs_phy_irq); - enable_irq_wake(qcom->dp_hs_phy_irq); - } + dwc3_qcom_enable_wakeup_irq(qcom->dp_hs_phy_irq); - if (qcom->dm_hs_phy_irq) { - enable_irq(qcom->dm_hs_phy_irq); - enable_irq_wake(qcom->dm_hs_phy_irq); - } + dwc3_qcom_enable_wakeup_irq(qcom->dm_hs_phy_irq); - if (qcom->ss_phy_irq) { - enable_irq(qcom->ss_phy_irq); - enable_irq_wake(qcom->ss_phy_irq); - } + dwc3_qcom_enable_wakeup_irq(qcom->ss_phy_irq); } static int dwc3_qcom_suspend(struct dwc3_qcom *qcom) -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation