提交 7abcacb0 编写于 作者: A Andres Salomon 提交者: Jaroslav Kysela

[ALSA] cs5535audio: correctly set dma->substream

We're never actually setting dma->substream to the current substream; that
means the dma->substream checks that we do in the suspend/resume path
are never satisfied, and the PRD registers are never correctly managed.  This
changes it so that we set the substream when constructing the specific
bus master DMA, and unsetting it when we tear down the BM's DMA.
Signed-off-by: NAndres Salomon <dilinger@debian.org>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
Signed-off-by: NJaroslav Kysela <perex@suse.cz>
上级 9e05b7a3
...@@ -161,6 +161,7 @@ static int cs5535audio_build_dma_packets(struct cs5535audio *cs5535au, ...@@ -161,6 +161,7 @@ static int cs5535audio_build_dma_packets(struct cs5535audio *cs5535au,
jmpprd_addr = cpu_to_le32(lastdesc->addr + jmpprd_addr = cpu_to_le32(lastdesc->addr +
(sizeof(struct cs5535audio_dma_desc)*periods)); (sizeof(struct cs5535audio_dma_desc)*periods));
dma->substream = substream;
dma->period_bytes = period_bytes; dma->period_bytes = period_bytes;
dma->periods = periods; dma->periods = periods;
spin_lock_irq(&cs5535au->reg_lock); spin_lock_irq(&cs5535au->reg_lock);
...@@ -238,6 +239,7 @@ static void cs5535audio_clear_dma_packets(struct cs5535audio *cs5535au, ...@@ -238,6 +239,7 @@ static void cs5535audio_clear_dma_packets(struct cs5535audio *cs5535au,
{ {
snd_dma_free_pages(&dma->desc_buf); snd_dma_free_pages(&dma->desc_buf);
dma->desc_buf.area = NULL; dma->desc_buf.area = NULL;
dma->substream = NULL;
} }
static int snd_cs5535audio_hw_params(struct snd_pcm_substream *substream, static int snd_cs5535audio_hw_params(struct snd_pcm_substream *substream,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册