Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp53946pxh; Thu, 7 Apr 2022 13:46:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqBoNikdJfXA41Kwq0Joj1FClHIwOrDRH4FMp3ZSforJBQekZiHr7n0gfMmAdDh1TZtVdg X-Received: by 2002:a17:902:7895:b0:156:4db2:d32d with SMTP id q21-20020a170902789500b001564db2d32dmr15171352pll.91.1649364377083; Thu, 07 Apr 2022 13:46:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649364377; cv=none; d=google.com; s=arc-20160816; b=hK1XoHMFd5EORljFgmojc68adU1d/I8ThP0dFShJlYj7aj7kTAsVgOO1C7rZzumGXH nyezmGXvnMkgw0Gz2cpHOlJb8QZ4ZnuyhvvZqMWPAwaXbQ/Mv3Uy95SwT9F+Sb8Vl34R BedyPfMyQ5Dvpd6QFSFGcrgrfXYZeIpavKH6yQAGkIWsgjCkD45HpIIMm4sGO0Kbm7Ln AtUgve8NK+7Ni+C6GPdnhFroGn7JsbIXTn7yaiJeQ8fDdTsN7+RtXZ20ZAWjiGV8sdYN DhI0HZhs0Xw5UL2hHYY8ooeae3Tsy8f22i/0FTi/TsheUnBMc6ImSqSCwPoMnHImwZ2V GOjA== 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=wk85P/Va31o9qzS6/lj0BoC5eFOyfop6d/XOvNpS/dI=; b=BhN33jz6Duj4f8ygQ8SOXduwR2f/lk4OMyCcrwwzvwPQ6v+YVYgQ0PhllzYqDTopRC QKeDsnL0yQ/BMCi9Qb/yp533ibNw68oSbbUAd3nH40FM5d0ilOhU1+7pViuh4tKNbbzD C1CMEuY8IQNyCC7Hpf+UQ/uU3Vzln1oyxoRlUDkPKkD6fQq4EMIOeEk8uCr4sH/b7+1Q t28eoDl+Eu78oSHh8bwgB/nrRFXHiK+M3WSzLygVppn4BrIDF8/eaePna78cog2bfpZp siQQYQjfiSuWCNQ6IDs8TMFSMzs+2vnE05BPvR8LtMSqEaGYF+lCp2dwtmAEfZXvgNmq BAQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=hwBK8OP2; 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 rj14-20020a17090b3e8e00b001ca9cff7894si2578897pjb.58.2022.04.07.13.46.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 13:46:17 -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=hwBK8OP2; 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 AF60C261DED; Thu, 7 Apr 2022 12:54:45 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243326AbiDGIsC (ORCPT + 99 others); Thu, 7 Apr 2022 04:48:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243317AbiDGIrl (ORCPT ); Thu, 7 Apr 2022 04:47:41 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 826A91925BE; Thu, 7 Apr 2022 01:45:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1649321141; x=1680857141; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=wk85P/Va31o9qzS6/lj0BoC5eFOyfop6d/XOvNpS/dI=; b=hwBK8OP2JGd4GRfrPjW8lcSBD8C/eXBpnrpBmqkduVanQx+Lrx4oo/9Z WSAbHzriPw6ksZiQij8f1+jzjjVaP1U7iNDsaoP0NCaAZkkTXAedvANyZ 2T8q4P9Tjvob7XbWEJBMQeG49rd39+l8FUDVkWEgZKtQIEb04NCq6Sdgz 8=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 07 Apr 2022 01:45:41 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2022 01:45:40 -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, 7 Apr 2022 01:45:40 -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.986.22; Thu, 7 Apr 2022 01:45:34 -0700 From: Sandeep Maheswaram To: Rob Herring , Andy Gross , "Bjorn Andersson" , Greg Kroah-Hartman , Felipe Balbi , Stephen Boyd , Doug Anderson , "Matthias Kaehlcke" , Mathias Nyman , Krzysztof Kozlowski CC: , , , , , , , , Sandeep Maheswaram Subject: [PATCH v12 3/6] usb: dwc3: qcom: Configure wakeup interrupts during suspend Date: Thu, 7 Apr 2022 14:15:01 +0530 Message-ID: <1649321104-31322-4-git-send-email-quic_c_sanm@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1649321104-31322-1-git-send-email-quic_c_sanm@quicinc.com> References: <1649321104-31322-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) 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, URIBL_BLOCKED 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 Configure DP/DM interrupts to detect line state changes based on hs_phy_mode. Enable the triggers opposite of what the current DP, DM levels. For HS/FS mode enable DM interrupt and for LS enable DP interrupt. 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 7352124..9804a19 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); } -- 2.7.4