From 4acd57c3de62374fe5bb52e5cd24538190f4eab2 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 29 Nov 2009 16:39:52 +0000 Subject: ALSA: AACI: fix AC97 multiple-open bug Signed-off-by: Russell King Cc: Signed-off-by: Takashi Iwai --- sound/arm/aaci.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sound/arm') diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c index 1f0f8213e2d5..1cb7c282a1fb 100644 --- a/sound/arm/aaci.c +++ b/sound/arm/aaci.c @@ -504,6 +504,10 @@ static int aaci_pcm_hw_params(struct snd_pcm_substream *substream, int err; aaci_pcm_hw_free(substream); + if (aacirun->pcm_open) { + snd_ac97_pcm_close(aacirun->pcm); + aacirun->pcm_open = 0; + } err = devdma_hw_alloc(NULL, substream, params_buffer_bytes(params)); -- cgit v1.2.3 From 8ee763b9c82c6ca0a59a7271ce4fa29d7baf5c09 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 29 Nov 2009 16:39:59 +0000 Subject: ALSA: AACI: fix recording bug pcm->r[1].slots is the double rate slot information, not the capture information. For capture, 'pcm' will already be the capture ac97 pcm structure. Signed-off-by: Russell King Cc: Signed-off-by: Takashi Iwai --- sound/arm/aaci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/arm') diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c index 1cb7c282a1fb..6c160a038b23 100644 --- a/sound/arm/aaci.c +++ b/sound/arm/aaci.c @@ -521,7 +521,7 @@ static int aaci_pcm_hw_params(struct snd_pcm_substream *substream, else err = snd_ac97_pcm_open(aacirun->pcm, params_rate(params), params_channels(params), - aacirun->pcm->r[1].slots); + aacirun->pcm->r[0].slots); if (err) goto out; -- cgit v1.2.3