Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1034314iob; Fri, 13 May 2022 20:27:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyGi9gOpbSMg1CO3rP6yPlacaC0iFjmBZ2ODfXJJaMVQ/hKmp2yTQog346Ib6expF/NgFM X-Received: by 2002:a7b:c081:0:b0:394:789b:915 with SMTP id r1-20020a7bc081000000b00394789b0915mr6996461wmh.105.1652498835631; Fri, 13 May 2022 20:27:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652498835; cv=none; d=google.com; s=arc-20160816; b=ud65KZn9V7Fj2tEw2x6BQL2ZdGZPL4JjIdu31MkJnXMQ4ehdafYs2N/LO0T/1/i8h9 TlqN+PXTDmY+6JAnXntekZfJXxseZzH3G8B18LdGrCzND3v3pn0To06qSDuQGydFiLlG hsYY4LfmHHnKHYs5oU/5VS0LxZFF7LZ8jeqny9R5wp/2r19nl2Dsa2mcW2mN6oOf39Ff ctKe4/ORUz7PDixdGXNSQ48nWgNQ87RyJNZmOs20gqfR1pIQDb0SSn2gIbGESW8Ljd9K 95ljIDmZ7OtcOhTkIGuy9QpdVLEh+S5VjYvXU3BZGCdo9tHVB7bj/GGGnzbaaHAR9WtK kuvA== 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=wbPSwTWKs4eXkxIn4y3Us29ei2iTX+Mu5DDySjzbpls=; b=P32n0DZ27ltCRcu/GXj526ZZOr/NpF9+c914SspjsWJJfthw2i/GyJTqt2QlcOOty0 NSCgAVG2bHAjtS2N2qBsPsBXNALnSHhJO15cmsVGOvdeqR/Ph5IrZ+CjuidWsJ3MZm7D RqNHw1suN/C/q6TOicPo8Eta6/r1IKMAzBsxDdvsqb1m7R7XJtVMa/i8eMiGjkQgonmi IkerASYXmESyGnJuSxikdG1odpVcibT1SfK234D+XRQAOl0xgoO9zf0Gq9MW+9tB1bUg upk1h1V2qulIe7ui0v8hK+A1icx/2C8OOL1Bwu3ZLYG7/DDifOqs5rDZB5H2Rtfz/MID CkkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b="oH/cFMe5"; 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 k25-20020a05600c1c9900b00393f95cb984si8550734wms.123.2022.05.13.20.27.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 20:27:15 -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="oH/cFMe5"; 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 0412C41581D; Fri, 13 May 2022 17:04:12 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357665AbiELSYL (ORCPT + 99 others); Thu, 12 May 2022 14:24:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357651AbiELSYF (ORCPT ); Thu, 12 May 2022 14:24:05 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E7C45F8C2; Thu, 12 May 2022 11:24:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652379842; x=1683915842; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=wbPSwTWKs4eXkxIn4y3Us29ei2iTX+Mu5DDySjzbpls=; b=oH/cFMe5OGG6F3xRhGRE9Wjzhlj1blo46sZSTWTMJH0KJxqtFsYlpY/l RcBj2cGmK3Zr1m9wCft08OujVpcBa7bAAFeBm80k15YF+O8Q3kn6cdeJX oEwKjTqpTcbXgsiKC8+aR5klJsrxPcsMAqNortchHl6tIZ3c5iuV91SB9 E=; Received: from ironmsg09-lv.qualcomm.com ([10.47.202.153]) by alexa-out.qualcomm.com with ESMTP; 12 May 2022 11:24:01 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg09-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2022 11:24:01 -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:24:00 -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:54 -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 4/5] usb: dwc3: qcom: Configure wakeup interrupts during suspend Date: Thu, 12 May 2022 23:53:21 +0530 Message-ID: <1652379802-8318-5-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 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 Signed-off-by: Krishna Kurapati --- 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