Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp40491pxy; Tue, 27 Apr 2021 22:13:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdxLFGkYYC1unHsbSYNHBQ9eA7atE/Yv1+pdS7Up3E3ze3CTwl5coxKFx3aGwgWTGsRoRn X-Received: by 2002:a17:90a:d24a:: with SMTP id o10mr1984417pjw.138.1619586837290; Tue, 27 Apr 2021 22:13:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619586837; cv=none; d=google.com; s=arc-20160816; b=MGArFU2mW2JC0/mbNiFgILy2k6JDEpU0JUh4j69Fb2fOj32CtfThhAcsBp08iAZoGP dioks+Zbe9ILZUnMYbQmm1COsB2mEUNUXjoycDRtgk7tOwVPIGBPKX5czDbgduBBFogj heBB/9qpGY7vQ7OaxEVmd6bbxmPn5AWKsWR9PQehKi1KTDnK5llBtqkxXp+PYep805cJ a8WjtLsXE+z6vlWlAF+q7uWnDFSODFBEpdBXu5GU/veDxQW46fWNVRJDcNlYdT2sH5HE 4k0KoyBKf1H9ASbQBGjIIrdZPlU2CT+i24LAY7/Qg8j3UcrqGwy4ZA3PdHHwTebBz7F7 t4qg== 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=IJaOpar38FNSUSkFsg636PUT0JkTr/phppjFgRc6HXmlMLmj8Hj+7jzS+BdqYxNS1V VuKM+P7k0Ry8uF8vZwX9Gnca6sJQQk6F6NCFmT9CvWbuoUd9YP+DTzV6FiNKuuHF3LLJ fZ+IUlfWvtuxP7EQwQpmTsAKdtsnTbtQFy0midGCXMnyjlkOe5xdpQAjT200Y9tW8tmh fQl6+bbVtuS2Nlg7Ez2RzHsYa1EzRJqx0LD8nDYRNa4h/LyhLHsr7EvriZKpl7dflQb3 N//u+bUhz40bN3IezZWHUlbIhjtJQefg2f9sg7X63kGQbh4tlZMHUpfo1ht9lrmkmTsG gsmA== 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 t5si2096356pgk.379.2021.04.27.22.13.32; Tue, 27 Apr 2021 22:13:57 -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 S234350AbhD1FNO (ORCPT + 99 others); Wed, 28 Apr 2021 01:13:14 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:37157 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbhD1FNN (ORCPT ); Wed, 28 Apr 2021 01:13:13 -0400 Received: from ironmsg09-lv.qualcomm.com ([10.47.202.153]) by alexa-out.qualcomm.com with ESMTP; 27 Apr 2021 22:12:28 -0700 X-QCInternal: smtphost Received: from ironmsg01-blr.qualcomm.com ([10.86.208.130]) by ironmsg09-lv.qualcomm.com with ESMTP/TLS/AES256-SHA; 27 Apr 2021 22:12:26 -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:02 +0530 Received: by c-sanm-linux.qualcomm.com (Postfix, from userid 2343233) id 4B5C139A6; Wed, 28 Apr 2021 10:42:01 +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 3/5] usb: dwc3: qcom: Add helper functions to enable,disable wake irqs Date: Wed, 28 Apr 2021 10:41:54 +0530 Message-Id: <1619586716-8687-4-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 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