diff options
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/imx-sdma.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 850edda2ea10..99367455fcda 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -1080,31 +1080,6 @@ static int sdma_load_context(struct sdma_channel *sdmac) return ret; } -static int sdma_save_restore_context(struct sdma_engine *sdma, bool save) -{ - struct sdma_context_data *context = sdma->context; - struct sdma_buffer_descriptor *bd0 = sdma->bd0; - unsigned long flags; - int ret; - - spin_lock_irqsave(&sdma->channel_0_lock, flags); - - if (save) - bd0->mode.command = C0_GETDM; - else - bd0->mode.command = C0_SETDM; - - bd0->mode.status = BD_DONE | BD_WRAP | BD_EXTD; - bd0->mode.count = MAX_DMA_CHANNELS * sizeof(*context) / 4; - bd0->buffer_addr = sdma->context_phys; - bd0->ext_buffer_addr = 2048; - ret = sdma_run_channel0(sdma); - - spin_unlock_irqrestore(&sdma->channel_0_lock, flags); - - return ret; -} - static struct sdma_channel *to_sdma_chan(struct dma_chan *chan) { return container_of(chan, struct sdma_channel, vc.chan); @@ -2466,6 +2441,31 @@ static int sdma_remove(struct platform_device *pdev) } #ifdef CONFIG_PM_SLEEP +static int sdma_save_restore_context(struct sdma_engine *sdma, bool save) +{ + struct sdma_context_data *context = sdma->context; + struct sdma_buffer_descriptor *bd0 = sdma->bd0; + unsigned long flags; + int ret; + + spin_lock_irqsave(&sdma->channel_0_lock, flags); + + if (save) + bd0->mode.command = C0_GETDM; + else + bd0->mode.command = C0_SETDM; + + bd0->mode.status = BD_DONE | BD_WRAP | BD_EXTD; + bd0->mode.count = MAX_DMA_CHANNELS * sizeof(*context) / 4; + bd0->buffer_addr = sdma->context_phys; + bd0->ext_buffer_addr = 2048; + ret = sdma_run_channel0(sdma); + + spin_unlock_irqrestore(&sdma->channel_0_lock, flags); + + return ret; +} + static int sdma_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); |