diff mbox series

[v1,2/2] usb: dwc2: gadget: Accept LPM token when TxFIFO is not empty

Message ID bc2298fb18bfbc1b3188b166f4eff0bc0de0c30b.1541168990.git.arturp@synopsys.com (mailing list archive)
State Mainlined
Commit 9aed8c08c82d8498769119b73358d070a7cbb54c
Headers show
Series usb: dwc2: gadget: Fix Service Interval support. | expand

Commit Message

Artur Petrosyan Nov. 2, 2018, 3:29 p.m. UTC
Set GLPMCFG_LPM_ACCEPT_CTRL_ISOC bit in GLPMCFG register
to accept LPM token during ISOC transfers when TxFIFO is
not empty.

- Added two definitions.
  	#define GLPMCFG_LPM_ACCEPT_CTRL_CONTROL        BIT(21)
  	#define GLPMCFG_LPM_ACCEPT_CTRL_ISOC   BIT(22)
  This patch uses GLPMCFG_LPM_ACCEPT_CTRL_ISOC.
  GLPMCFG_LPM_ACCEPT_CTRL_CONTROL is defined for further use.

- Added setting GLPMCFG_LPM_ACCEPT_CTRL_ISOC bit in GLPMCFG
  register in dwc2_gadget_init_lpm function.

Signed-off-by: Artur Petrosyan <arturp@synopsys.com>
Signed-off-by: Minas Harutyunyan <hminas@synopsys.com>
---
 drivers/usb/dwc2/gadget.c | 1 +
 drivers/usb/dwc2/hw.h     | 2 ++
 2 files changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 6bd4054e894d..94f3ba995580 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -5026,6 +5026,7 @@  void dwc2_gadget_init_lpm(struct dwc2_hsotg *hsotg)
 	val |= hsotg->params.lpm_clock_gating ? GLPMCFG_ENBLSLPM : 0;
 	val |= hsotg->params.hird_threshold << GLPMCFG_HIRD_THRES_SHIFT;
 	val |= hsotg->params.besl ? GLPMCFG_ENBESL : 0;
+	val |= GLPMCFG_LPM_ACCEPT_CTRL_ISOC;
 	dwc2_writel(hsotg, val, GLPMCFG);
 	dev_dbg(hsotg->dev, "GLPMCFG=0x%08x\n", dwc2_readl(hsotg, GLPMCFG));
 
diff --git a/drivers/usb/dwc2/hw.h b/drivers/usb/dwc2/hw.h
index 2b1ea441b7d4..98af924a9a5c 100644
--- a/drivers/usb/dwc2/hw.h
+++ b/drivers/usb/dwc2/hw.h
@@ -333,6 +333,8 @@ 
 #define GLPMCFG_SNDLPM			BIT(24)
 #define GLPMCFG_RETRY_CNT_MASK		(0x7 << 21)
 #define GLPMCFG_RETRY_CNT_SHIFT		21
+#define GLPMCFG_LPM_ACCEPT_CTRL_CONTROL	BIT(21)
+#define GLPMCFG_LPM_ACCEPT_CTRL_ISOC	BIT(22)
 #define GLPMCFG_LPM_CHNL_INDX_MASK	(0xf << 17)
 #define GLPMCFG_LPM_CHNL_INDX_SHIFT	17
 #define GLPMCFG_L1RESUMEOK		BIT(16)