Commit 5e09f98e authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Vinod Koul

dmaengine: dw: move dwc->paused to dwc->flags

We have already dedicated variable for flags, therefore no need to create an
additional storage for that. Convert dwc->paused to use dwc->flags.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 7794e5b9
...@@ -999,7 +999,7 @@ static int dwc_pause(struct dma_chan *chan) ...@@ -999,7 +999,7 @@ static int dwc_pause(struct dma_chan *chan)
while (!(channel_readl(dwc, CFG_LO) & DWC_CFGL_FIFO_EMPTY) && count--) while (!(channel_readl(dwc, CFG_LO) & DWC_CFGL_FIFO_EMPTY) && count--)
udelay(2); udelay(2);
dwc->paused = true; set_bit(DW_DMA_IS_PAUSED, &dwc->flags);
spin_unlock_irqrestore(&dwc->lock, flags); spin_unlock_irqrestore(&dwc->lock, flags);
...@@ -1012,7 +1012,7 @@ static inline void dwc_chan_resume(struct dw_dma_chan *dwc) ...@@ -1012,7 +1012,7 @@ static inline void dwc_chan_resume(struct dw_dma_chan *dwc)
channel_writel(dwc, CFG_LO, cfglo & ~DWC_CFGL_CH_SUSP); channel_writel(dwc, CFG_LO, cfglo & ~DWC_CFGL_CH_SUSP);
dwc->paused = false; clear_bit(DW_DMA_IS_PAUSED, &dwc->flags);
} }
static int dwc_resume(struct dma_chan *chan) static int dwc_resume(struct dma_chan *chan)
...@@ -1020,12 +1020,10 @@ static int dwc_resume(struct dma_chan *chan) ...@@ -1020,12 +1020,10 @@ static int dwc_resume(struct dma_chan *chan)
struct dw_dma_chan *dwc = to_dw_dma_chan(chan); struct dw_dma_chan *dwc = to_dw_dma_chan(chan);
unsigned long flags; unsigned long flags;
if (!dwc->paused)
return 0;
spin_lock_irqsave(&dwc->lock, flags); spin_lock_irqsave(&dwc->lock, flags);
dwc_chan_resume(dwc); if (test_bit(DW_DMA_IS_PAUSED, &dwc->flags))
dwc_chan_resume(dwc);
spin_unlock_irqrestore(&dwc->lock, flags); spin_unlock_irqrestore(&dwc->lock, flags);
...@@ -1094,7 +1092,7 @@ dwc_tx_status(struct dma_chan *chan, ...@@ -1094,7 +1092,7 @@ dwc_tx_status(struct dma_chan *chan,
if (ret != DMA_COMPLETE) if (ret != DMA_COMPLETE)
dma_set_residue(txstate, dwc_get_residue(dwc)); dma_set_residue(txstate, dwc_get_residue(dwc));
if (dwc->paused && ret == DMA_IN_PROGRESS) if (test_bit(DW_DMA_IS_PAUSED, &dwc->flags) && ret == DMA_IN_PROGRESS)
return DMA_PAUSED; return DMA_PAUSED;
return ret; return ret;
......
...@@ -216,6 +216,7 @@ enum dw_dma_msize { ...@@ -216,6 +216,7 @@ enum dw_dma_msize {
enum dw_dmac_flags { enum dw_dmac_flags {
DW_DMA_IS_CYCLIC = 0, DW_DMA_IS_CYCLIC = 0,
DW_DMA_IS_SOFT_LLP = 1, DW_DMA_IS_SOFT_LLP = 1,
DW_DMA_IS_PAUSED = 2,
}; };
struct dw_dma_chan { struct dw_dma_chan {
...@@ -224,7 +225,6 @@ struct dw_dma_chan { ...@@ -224,7 +225,6 @@ struct dw_dma_chan {
u8 mask; u8 mask;
u8 priority; u8 priority;
enum dma_transfer_direction direction; enum dma_transfer_direction direction;
bool paused;
bool initialized; bool initialized;
/* software emulation of the LLP transfers */ /* software emulation of the LLP transfers */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment