Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2758429pxb; Mon, 1 Nov 2021 00:55:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9RcG+20m7fDrL4scdW8F5KBdMOv92WLg/R2Zlz0GwWCgiyj/iF/NGFIadMWUov7oiRTR8 X-Received: by 2002:a05:6638:d90:: with SMTP id l16mr20558015jaj.36.1635753323915; Mon, 01 Nov 2021 00:55:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635753323; cv=none; d=google.com; s=arc-20160816; b=t5veRnimAEywcSVtk0vjPMVVnWymQVoIu5AArJ9LsYBseuwxXGlWf8y3S5Zr+116ny PwvJGSnBfEnP7JlcHMq9fpv8SbOMZvtzczIXiCcPpCcBu4J5R7DjiQJloK6wgAamDPEZ WSRG5jM6/1SJw4kS4AYxBL0kllE49eUEpEnn0FSMKmoxZKn2Cz1nj6MKepT8e/wDoLTh /E3DP6A7UlF9IPQ+OifDwwU0uumGOuVIlZUE4PNSiIEv4qNj2JNlTSO2o2hQm89wj84D Y7OwtGjbaFgGg7PQG/Cq/gR3Syttn9wdxiE8pWFo7vdAoy9EgJY8G+rjbyIbFi12NQUX oCeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=/dGbJwQrb7mIH2L3gPr4VAO0cqhCcHBMzM34REo4rAE=; b=mmsXp8znvl8OAGp7S2ygWS5WkhNv0HcM0Oe1LEWX+sXHFJWlvW7X9aAqi23bMcaGTl z+SjFJ+/+wIkOsp7LO3nE+EHxUati1DLq26U4Sb66NLyvLj/xArVtLAQ5mUd1TCWbXxW bVRfdo89vYEkyyHsuVfpUKWtAjHg2zUPV9/7DX43hppM8ZDSSP64VavZIRCGQtXP0hbS sGcEmi+dR2SUtdB3LJfDM/b0k88d8YJdgec0phu026jkeL1UNkm2rlf/k0iuMDi1bHuz 85v9QaY7lewSI+aqOdp7aShT33Wu6uO7IqRGtzsqukThmMfpbHZqCIdAsCK9GhSD5Pc9 Nptw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=rtmZaUn+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n19si23871089jat.68.2021.11.01.00.55.12; Mon, 01 Nov 2021 00:55:23 -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; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=rtmZaUn+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231384AbhKAH4u (ORCPT + 99 others); Mon, 1 Nov 2021 03:56:50 -0400 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:49575 "EHLO alexa-out-sd-02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231437AbhKAH4p (ORCPT ); Mon, 1 Nov 2021 03:56:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1635753252; x=1667289252; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=/dGbJwQrb7mIH2L3gPr4VAO0cqhCcHBMzM34REo4rAE=; b=rtmZaUn+BeUGwz/c0anT8bHwWWsQnHxGWNKj+i/J1fq2NvzJUMoEx3Gk CiAOMMlnuG8FjBR9j8e04/gt6gbDXNRu7C57BYEOMSY7sKktJTAUa1DBq yswYTL5Az5wEGa89L3BNE+VzDj/21yW3ZPMIRMJ85WSZfQJCN+NY2hM52 Q=; Received: from unknown (HELO ironmsg02-sd.qualcomm.com) ([10.53.140.142]) by alexa-out-sd-02.qualcomm.com with ESMTP; 01 Nov 2021 00:54:12 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg02-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2021 00:54:12 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.7; Mon, 1 Nov 2021 00:54:11 -0700 Received: from c-sanm-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.7; Mon, 1 Nov 2021 00:54:07 -0700 From: Sandeep Maheswaram To: Andy Gross , Bjorn Andersson , Greg Kroah-Hartman , Felipe Balbi , Stephen Boyd , Doug Anderson , "Matthias Kaehlcke" , Mathias Nyman CC: , , , , , Sandeep Maheswaram Subject: [PATCH v9 3/5] usb: dwc3: qcom: Add helper functions to enable,disable wake irqs Date: Mon, 1 Nov 2021 13:23:42 +0530 Message-ID: <1635753224-23975-4-git-send-email-quic_c_sanm@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1635753224-23975-1-git-send-email-quic_c_sanm@quicinc.com> References: <1635753224-23975-1-git-send-email-quic_c_sanm@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) 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 9abbd01..54461f1 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) -- 2.7.4