Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1010603iob; Fri, 13 May 2022 19:31:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGMvWLXFpJ8UASH/T3ZQJHn+ilqSZAjvfCeWSh4eLeS/GaDAbQkyHXCpEYea0Sp7rCR/lC X-Received: by 2002:a05:6000:1a88:b0:20c:6842:d7a7 with SMTP id f8-20020a0560001a8800b0020c6842d7a7mr5894203wry.91.1652495464692; Fri, 13 May 2022 19:31:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652495464; cv=none; d=google.com; s=arc-20160816; b=VfaWHXAET4cgSeZeg8NnwMLsfdV+4Dzlsp9FKuqG5oyRXzqnetzl7YualgueALcIOH HQXBpqcxsDFKufb/XqV7sk1vEka2GnLyY+8W6SMh63l1qesVTC5lV2OM2BmIpks7TG7D qFXBImq7IMM27BZ4tt/5+csWaiHdW/OiJVxT2skHFvkORTYyWMo5LohfDtliL0EEhIpt ObcW9BkBqI98nSksIiaJQMbBtpfd48wnSPs2jubypDUU7zzF6IIBirujDnjyYu6DqgpO PS8RAUVHS/eaAJbha9sLuai0j0uhmSdITyDrn4aCJyZznTkQr1OdFWwG2u9rHVW4gxdY n+Qw== 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=nVZawyLsTGAdtwgBjsftV6LyNLkqYxD0nYoLvZTXsOY=; b=jY0E9jiCB/jgZioS8l8IrkdyOryYrs1loDo8YQtUA4BVh6iRdhMmGTqaczqKtCLp70 RxIPliTSbEdr8FMZdJP0jEWEUTVbqEmwx139+n7YabtUNY/Qx0yhB5ahOmqnXTY8QUVu htyvtKEbP7ft9MZl+PEa++IRqaO5BK4CnFrKA422YK14dWjujU2iqD1/2IkM5tOiyOQ9 NcNJf+7oMFzpLLZKpppVDcwtBJ1kAcD2yY7+o4iog8tzjdyQSc8NS/8bT1gy1l+Z4Mbm H9H1/coFh+pR4kJzFMwwkohpeNOey3ujuyo/kpilBQ20HlmhN1b8czm4rifPv/reC9vv Nt7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b="aRL28w7/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b12-20020adfc74c000000b00203e901965bsi3712393wrh.991.2022.05.13.19.31.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 19:31:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b="aRL28w7/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 226E44DF77D; Fri, 13 May 2022 17:44:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357609AbiELSYC (ORCPT + 99 others); Thu, 12 May 2022 14:24:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357637AbiELSYA (ORCPT ); Thu, 12 May 2022 14:24:00 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D701D2701A7; Thu, 12 May 2022 11:23:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652379834; x=1683915834; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=nVZawyLsTGAdtwgBjsftV6LyNLkqYxD0nYoLvZTXsOY=; b=aRL28w7/ljQ5r5mWaPz9xHEkZ3EX6Sqn/MOCOV9/aB3n3yIIHPGzgz8d XdEADRlxyCGzVx4wj+D7s9svHPNYD6+t4Q21WbsFdbSVfKHuEDMzJV/hv szj+2cr3kkBLmUtp+m5VvLEprTHbagJlYIncQPmxTtQA7Bn5OKs5DvFi2 c=; Received: from unknown (HELO ironmsg02-sd.qualcomm.com) ([10.53.140.142]) by alexa-out-sd-01.qualcomm.com with ESMTP; 12 May 2022 11:23:54 -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; 12 May 2022 11:23:54 -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.986.22; Thu, 12 May 2022 11:23:53 -0700 Received: from hu-kriskura-hyd.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.986.22; Thu, 12 May 2022 11:23:47 -0700 From: Krishna Kurapati To: Krzysztof Kozlowski , Rob Herring , Andy Gross , Bjorn Andersson , Greg Kroah-Hartman , Felipe Balbi , Stephen Boyd , Doug Anderson , "Matthias Kaehlcke" , Mathias Nyman CC: , , , , , , , , Sandeep Maheswaram , Krishna Kurapati Subject: [v16 3/5] usb: dwc3: qcom: Add helper functions to enable,disable wake irqs Date: Thu, 12 May 2022 23:53:20 +0530 Message-ID: <1652379802-8318-4-git-send-email-quic_kriskura@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1652379802-8318-1-git-send-email-quic_kriskura@quicinc.com> References: <1652379802-8318-1-git-send-email-quic_kriskura@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) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sandeep Maheswaram Adding helper functions to enable,disable wake irqs to make the code simple and readable. Signed-off-by: Sandeep Maheswaram Reviewed-by: Matthias Kaehlcke Signed-off-by: Krishna Kurapati --- 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 6cba990..7352124 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