From: Thinh Nguyen Date: Thu, 8 Nov 2018 01:55:06 +0000 (-0800) Subject: usb: dwc3: debugfs: Print eps Tx/RxFIFO in bytes X-Git-Tag: v5.15~7302^2~16^2~54 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0f874f79dc81aec0229babebd6ef04e591a548d2;p=platform%2Fkernel%2Flinux-starfive.git usb: dwc3: debugfs: Print eps Tx/RxFIFO in bytes TxFIFO and RxFIFO from GDBGFIFOSPACE are fifo depths in MDWIDTH. Convert them into bytes for easier read. Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c index 17238bb..bd3d75b 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);