diff mbox series

[v2,2/5] usb: dwc3: debugfs: Print eps Tx/RxFIFO in bytes

Message ID 6a7aa15d180186cce33af5a351beb4ad0552c9f9.1541641164.git.thinhn@synopsys.com (mailing list archive)
State Mainlined
Commit 0f874f79dc81aec0229babebd6ef04e591a548d2
Headers show
Series usb: dwc3: debugfs: Add various updates | expand

Commit Message

Thinh Nguyen Nov. 8, 2018, 1:55 a.m. UTC
TxFIFO and RxFIFO from GDBGFIFOSPACE are fifo depths in MDWIDTH. Convert
them into bytes for easier read.

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
---
Change in v2:
 - New patch, no previous change

 drivers/usb/dwc3/debugfs.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c
index 17238bbe9733..bd3d75b2f8bc 100644
--- a/drivers/usb/dwc3/debugfs.c
+++ b/drivers/usb/dwc3/debugfs.c
@@ -505,6 +505,10 @@  static int dwc3_tx_fifo_size_show(struct seq_file *s, void *unused)
 
 	spin_lock_irqsave(&dwc->lock, flags);
 	val = dwc3_core_fifo_space(dep, DWC3_TXFIFO);
+
+	/* Convert to bytes */
+	val *= DWC3_MDWIDTH(dwc->hwparams.hwparams0);
+	val >>= 3;
 	seq_printf(s, "%u\n", val);
 	spin_unlock_irqrestore(&dwc->lock, flags);
 
@@ -520,6 +524,10 @@  static int dwc3_rx_fifo_size_show(struct seq_file *s, void *unused)
 
 	spin_lock_irqsave(&dwc->lock, flags);
 	val = dwc3_core_fifo_space(dep, DWC3_RXFIFO);
+
+	/* Convert to bytes */
+	val *= DWC3_MDWIDTH(dwc->hwparams.hwparams0);
+	val >>= 3;
 	seq_printf(s, "%u\n", val);
 	spin_unlock_irqrestore(&dwc->lock, flags);