aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthijs Kooijman <matthijs@stdin.nl>2013-08-30 12:45:19 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-30 17:14:53 -0400
commit08b9f9db707bae6c56c0b0b0232a1338ca58e3ce (patch)
treed712806183ccaafe0e60a96779df6a9d16e1be88
parentc35205aa051244a5ee8ed1e124b9c7b890d97ad9 (diff)
staging: dwc2: remove redundant register reads
For calculating FIFO offsets, the sizes of preceding fifos need to be known. For filling the GDFIFOCFG register, these fifo sizes were read from hardware registers. However, these values were written to these registers just a few lines before, so we can just use the values written instead. Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/dwc2/core.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/staging/dwc2/core.c b/drivers/staging/dwc2/core.c
index 5799f478980c..f6494df799c9 100644
--- a/drivers/staging/dwc2/core.c
+++ b/drivers/staging/dwc2/core.c
@@ -507,7 +507,7 @@ void dwc2_disable_host_interrupts(struct dwc2_hsotg *hsotg)
507static void dwc2_config_fifos(struct dwc2_hsotg *hsotg) 507static void dwc2_config_fifos(struct dwc2_hsotg *hsotg)
508{ 508{
509 struct dwc2_core_params *params = hsotg->core_params; 509 struct dwc2_core_params *params = hsotg->core_params;
510 u32 rxfsiz, nptxfsiz, hptxfsiz, dfifocfg; 510 u32 nptxfsiz, hptxfsiz, dfifocfg;
511 511
512 if (!params->enable_dynamic_fifo) 512 if (!params->enable_dynamic_fifo)
513 return; 513 return;
@@ -555,11 +555,10 @@ static void dwc2_config_fifos(struct dwc2_hsotg *hsotg)
555 * include RxFIFO, NPTXFIFO and HPTXFIFO 555 * include RxFIFO, NPTXFIFO and HPTXFIFO
556 */ 556 */
557 dfifocfg = readl(hsotg->regs + GDFIFOCFG); 557 dfifocfg = readl(hsotg->regs + GDFIFOCFG);
558 rxfsiz = readl(hsotg->regs + GRXFSIZ) & 0x0000ffff;
559 nptxfsiz = readl(hsotg->regs + GNPTXFSIZ) >> 16 & 0xffff;
560 hptxfsiz = readl(hsotg->regs + HPTXFSIZ) >> 16 & 0xffff;
561 dfifocfg &= ~GDFIFOCFG_EPINFOBASE_MASK; 558 dfifocfg &= ~GDFIFOCFG_EPINFOBASE_MASK;
562 dfifocfg |= (rxfsiz + nptxfsiz + hptxfsiz) << 559 dfifocfg |= (params->host_rx_fifo_size +
560 params->host_nperio_tx_fifo_size +
561 params->host_perio_tx_fifo_size) <<
563 GDFIFOCFG_EPINFOBASE_SHIFT & 562 GDFIFOCFG_EPINFOBASE_SHIFT &
564 GDFIFOCFG_EPINFOBASE_MASK; 563 GDFIFOCFG_EPINFOBASE_MASK;
565 writel(dfifocfg, hsotg->regs + GDFIFOCFG); 564 writel(dfifocfg, hsotg->regs + GDFIFOCFG);