mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sevak Arakelyan <SEVAK.ARAKELYAN@synopsys.com>
To: John Youn <John.Youn@synopsys.com>,
	Felipe Balbi <balbi@kernel.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: Sevak Arakelyan <SEVAK.ARAKELYAN@synopsys.com>
Subject: [PATCH 5/9] usb: dwc2: Enable LPM Transaction Received interrupt.
Date: Fri, 28 Apr 2017 12:55:01 +0400	[thread overview]
Message-ID: <aa6dbef62269726dd0c02ee4ce64126c0cbe1330.1493369198.git.sevaka@synopsys.com> (raw)
In-Reply-To: <cover.1493369198.git.sevaka@synopsys.com>

Enable LPM Trasaction Received interrupt.

Signed-off-by: Sevak Arakelyan <sevaka@synopsys.com>
---
 drivers/usb/dwc2/core_intr.c | 5 +++--
 drivers/usb/dwc2/gadget.c    | 3 ++-
 drivers/usb/dwc2/hcd.c       | 3 +++
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/dwc2/core_intr.c b/drivers/usb/dwc2/core_intr.c
index 663d56a293af..ea4a6efc33b0 100644
--- a/drivers/usb/dwc2/core_intr.c
+++ b/drivers/usb/dwc2/core_intr.c
@@ -553,7 +553,7 @@ static void dwc2_handle_lpm_intr(struct dwc2_hsotg *hsotg)
 	hird_thres = (glpmcfg & GLPMCFG_HIRD_MASK & ~GLPMCFG_HIRD_THRES_EN) >>
 		     GLPMCFG_HIRD_THRES_SHIFT;
 	hird_thres_en = glpmcfg & GLPMCFG_HIRD_THRES_EN;
-	enslpm = glpmcfg & GLPMCFG_SNDLPM;
+	enslpm = glpmcfg & GLPMCFG_ENBLSLPM;
 
 	if (dwc2_is_device_mode(hsotg)) {
 		dev_dbg(hsotg->dev, "HIRD_THRES_EN = %d\n", hird_thres_en);
@@ -588,7 +588,8 @@ static void dwc2_handle_lpm_intr(struct dwc2_hsotg *hsotg)
 #define GINTMSK_COMMON	(GINTSTS_WKUPINT | GINTSTS_SESSREQINT |		\
 			 GINTSTS_CONIDSTSCHNG | GINTSTS_OTGINT |	\
 			 GINTSTS_MODEMIS | GINTSTS_DISCONNINT |		\
-			 GINTSTS_USBSUSP | GINTSTS_PRTINT)
+			 GINTSTS_USBSUSP | GINTSTS_PRTINT |		\
+			 GINTSTS_LPMTRANRCVD)
 
 /*
  * This function returns the Core Interrupt register
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index bc3b3fda5000..c763e0e7d64f 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3315,7 +3315,8 @@ void dwc2_hsotg_core_init_disconnected(struct dwc2_hsotg *hsotg,
 		GINTSTS_GOUTNAKEFF | GINTSTS_GINNAKEFF |
 		GINTSTS_USBRST | GINTSTS_RESETDET |
 		GINTSTS_ENUMDONE | GINTSTS_OTGINT |
-		GINTSTS_USBSUSP | GINTSTS_WKUPINT;
+		GINTSTS_USBSUSP | GINTSTS_WKUPINT |
+		GINTSTS_LPMTRANRCVD;
 
 	if (!using_desc_dma(hsotg))
 		intmsk |= GINTSTS_INCOMPL_SOIN | GINTSTS_INCOMPL_SOOUT;
diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
index 740c7e86d31b..b41a64b061b2 100644
--- a/drivers/usb/dwc2/hcd.c
+++ b/drivers/usb/dwc2/hcd.c
@@ -90,6 +90,9 @@ static void dwc2_enable_common_interrupts(struct dwc2_hsotg *hsotg)
 	intmsk |= GINTSTS_WKUPINT | GINTSTS_USBSUSP |
 		  GINTSTS_SESSREQINT;
 
+	if (dwc2_is_device_mode(hsotg) && hsotg->params.lpm)
+		intmsk |= GINTSTS_LPMTRANRCVD;
+
 	dwc2_writel(intmsk, hsotg->regs + GINTMSK);
 }
 
-- 
2.11.0

  parent reply	other threads:[~2017-04-28  8:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-28  8:46 [PATCH 0/9] usb: dwc2: gadget: Add LPM functionality Sevak Arakelyan
2017-04-28  8:47 ` [PATCH 1/9] usb: dwc2: Fix GLPMCFG... definitions Sevak Arakelyan
2017-04-28  8:48 ` [PATCH 2/9] usb: dwc2: Add core parameters for LPM support Sevak Arakelyan
2017-04-28  8:48 ` [PATCH 3/9] usb: dwc2: gadget: Add functionality to exit from LPM L1 state Sevak Arakelyan
2017-04-28  8:48 ` [PATCH 4/9] usb: dwc2: gadget: LPM interrupt handler Sevak Arakelyan
2017-04-28  8:55 ` Sevak Arakelyan [this message]
2017-04-28  8:55 ` [PATCH 6/9] usb: dwc2: gadget: Configure the core to enable LPM Sevak Arakelyan
2017-04-28  8:55 ` [PATCH 7/9] [HSLPM] usb: gadget: composite: Exclude SS Dev Cap Desc Sevak Arakelyan
2017-04-28  8:55 ` [PATCH 8/9] [HSLPM] usb: gadget: Allow a non-SuperSpeed gadget to support LPM Sevak Arakelyan
2017-04-28  8:56 ` [PATCH 9/9] [HSLPM] usb: dwc2: Enable LPM Sevak Arakelyan
2017-04-28  9:24   ` Greg Kroah-Hartman
2017-06-02  8:20     ` Felipe Balbi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa6dbef62269726dd0c02ee4ce64126c0cbe1330.1493369198.git.sevaka@synopsys.com \
    --to=sevak.arakelyan@synopsys.com \
    --cc=John.Youn@synopsys.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®