Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp342249pxb; Tue, 12 Apr 2022 03:19:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7/EjhPGsQtDEuqahqpuUUa3fVZZhsDK+M65gpAnyhqsJbK7szro27KNplQoCQS6K3avxf X-Received: by 2002:a17:906:c54:b0:6e4:bbee:f17f with SMTP id t20-20020a1709060c5400b006e4bbeef17fmr33970151ejf.180.1649758788019; Tue, 12 Apr 2022 03:19:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649758788; cv=none; d=google.com; s=arc-20160816; b=lrW4wYm7boZa2H+5uCciAnmNagNAGK5m7QAnCO2TzNcQO6c9Q2OavmzFKZvZSu32HJ RNP/r8OzVR7tLxGDLT0zEz0uMQJ7zJjMb+Kf5+wT0EGHbVzA8TzQGi8QBp351Cs6Prvs 6Q4rn0GfZFtmARfggQP5LHeDey7037E7SIySJGi93ZFZ/eGB955el9b5akOrt4rqcGeh Vo63XXYNmYlBXaAio6e4JMMRGhJQGF6pW+janwrRCsciRob3pbLYPR9dzyb38qefR/Eh bNs+nDDXohXoGlQBLNoTVM1TovQSMbKJ2677YozIb9+7jv1l8ATS9DKm2sABGDo4+h9I NnBw== 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=WFGpLDxRVTs98MC5t/07QQuxx1lsVnFTuP4gRL79AO950vuGEgetPt1GH+jAym5XdU rKE9Nr2ECZauaFQSyGy9ECF+I5+eGcDEevL2MpkbJUzbn4NB7cTLTH3zR/Tl/v4W1EPc 8i/oDMCq2aDk14FvtDk2DT8KyCXXnCYOHHtTzZ6a3/j9/W/Syd4nApCODDpRqJ1nosJb Vu0MQw+mYRIBT1OK6S2rmVxEPPtdwy62fuiofslFdbYNeOVF3L/DrKRtEe512LVZOkk+ hUfFEGI6SUgHHeAj7zWPRhq8YgalW7mXgNHNw6WOa8xE3xowiSYNIH0lluoPXBa/we4e tyIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=NOk0wO3T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q13-20020a170906940d00b006e89e2b6fffsi2562319ejx.479.2022.04.12.03.19.11; Tue, 12 Apr 2022 03:19:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=NOk0wO3T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1349556AbiDKTUD (ORCPT + 99 others); Mon, 11 Apr 2022 15:20:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349574AbiDKTTz (ORCPT ); Mon, 11 Apr 2022 15:19:55 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D09B83701B; Mon, 11 Apr 2022 12:17:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1649704660; x=1681240660; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=wk85P/Va31o9qzS6/lj0BoC5eFOyfop6d/XOvNpS/dI=; b=NOk0wO3TFsnSiDmvWLuiMmzUzl1VTHcxWpHjo72LKENIN8g3Cg22Ajei WwJWUFO6EKMnYtBONgfFAUkuOgjrvVk5sFNKRLbVAtyO8wN6W327kZUzi Yu2VHhw7kNwi5EHMuifE4JOq9ue8lRSz+cfZ9IsVdklau2gVRZ0XrEaVa Q=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 11 Apr 2022 12:17:39 -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; 11 Apr 2022 12:17:39 -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; Mon, 11 Apr 2022 12:17:38 -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; Mon, 11 Apr 2022 12:17:32 -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 v13 4/6] usb: dwc3: qcom: Configure wakeup interrupts during suspend Date: Tue, 12 Apr 2022 00:46:52 +0530 Message-ID: <1649704614-31518-5-git-send-email-quic_c_sanm@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1649704614-31518-1-git-send-email-quic_c_sanm@quicinc.com> References: <1649704614-31518-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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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