| .. | .. |
|---|
| 27 | 27 | #include <sound/soc.h> |
|---|
| 28 | 28 | |
|---|
| 29 | 29 | #include <sound/dmaengine_pcm.h> |
|---|
| 30 | +#include "pcm_local.h" |
|---|
| 30 | 31 | |
|---|
| 31 | 32 | struct dmaengine_pcm_runtime_data { |
|---|
| 32 | 33 | struct dma_chan *dma_chan; |
|---|
| .. | .. |
|---|
| 140 | 141 | static void dmaengine_pcm_dma_complete(void *arg) |
|---|
| 141 | 142 | { |
|---|
| 142 | 143 | struct snd_pcm_substream *substream = arg; |
|---|
| 143 | | - struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream); |
|---|
| 144 | + struct dmaengine_pcm_runtime_data *prtd; |
|---|
| 145 | + |
|---|
| 146 | + snd_pcm_stream_lock_irq(substream); |
|---|
| 147 | + if (PCM_RUNTIME_CHECK(substream)) { |
|---|
| 148 | + snd_pcm_stream_unlock_irq(substream); |
|---|
| 149 | + return; |
|---|
| 150 | + } |
|---|
| 151 | + |
|---|
| 152 | + prtd = substream_to_prtd(substream); |
|---|
| 144 | 153 | |
|---|
| 145 | 154 | prtd->pos += snd_pcm_lib_period_bytes(substream); |
|---|
| 146 | 155 | if (prtd->pos >= snd_pcm_lib_buffer_bytes(substream)) |
|---|
| 147 | 156 | prtd->pos = 0; |
|---|
| 157 | + snd_pcm_stream_unlock_irq(substream); |
|---|
| 148 | 158 | |
|---|
| 149 | 159 | snd_pcm_period_elapsed(substream); |
|---|
| 150 | 160 | } |
|---|