提交 66d4e49b 编写于 作者: T Takashi Iwai 提交者: Yang Yingliang

ALSA: aica: Fix a long-time build breakage

[ Upstream commit 534420c6ff87d3052540f1fd346e0adcff440819 ]

The build of aica sound driver has been broken since the timer API
conversion and some code rewrite.  This patch fixes the breakage by
using the common substream field, as well as a bit cleaning up wrt the
timer handling in the code.

Fixes: d522bb6a ("ALSA: sh: aica: Convert timers to use timer_setup()")
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 0e6d4edf
...@@ -303,7 +303,7 @@ static void aica_period_elapsed(struct timer_list *t) ...@@ -303,7 +303,7 @@ static void aica_period_elapsed(struct timer_list *t)
{ {
struct snd_card_aica *dreamcastcard = from_timer(dreamcastcard, struct snd_card_aica *dreamcastcard = from_timer(dreamcastcard,
t, timer); t, timer);
struct snd_pcm_substream *substream = dreamcastcard->timer_substream; struct snd_pcm_substream *substream = dreamcastcard->substream;
/*timer function - so cannot sleep */ /*timer function - so cannot sleep */
int play_period; int play_period;
struct snd_pcm_runtime *runtime; struct snd_pcm_runtime *runtime;
...@@ -335,13 +335,6 @@ static void spu_begin_dma(struct snd_pcm_substream *substream) ...@@ -335,13 +335,6 @@ static void spu_begin_dma(struct snd_pcm_substream *substream)
dreamcastcard = substream->pcm->private_data; dreamcastcard = substream->pcm->private_data;
/*get the queue to do the work */ /*get the queue to do the work */
schedule_work(&(dreamcastcard->spu_dma_work)); schedule_work(&(dreamcastcard->spu_dma_work));
/* Timer may already be running */
if (unlikely(dreamcastcard->timer_substream)) {
mod_timer(&dreamcastcard->timer, jiffies + 4);
return;
}
timer_setup(&dreamcastcard->timer, aica_period_elapsed, 0);
dreamcastcard->timer_substream = substream;
mod_timer(&dreamcastcard->timer, jiffies + 4); mod_timer(&dreamcastcard->timer, jiffies + 4);
} }
...@@ -379,8 +372,8 @@ static int snd_aicapcm_pcm_close(struct snd_pcm_substream ...@@ -379,8 +372,8 @@ static int snd_aicapcm_pcm_close(struct snd_pcm_substream
{ {
struct snd_card_aica *dreamcastcard = substream->pcm->private_data; struct snd_card_aica *dreamcastcard = substream->pcm->private_data;
flush_work(&(dreamcastcard->spu_dma_work)); flush_work(&(dreamcastcard->spu_dma_work));
if (dreamcastcard->timer_substream) del_timer(&dreamcastcard->timer);
del_timer(&dreamcastcard->timer); dreamcastcard->substream = NULL;
kfree(dreamcastcard->channel); kfree(dreamcastcard->channel);
spu_disable(); spu_disable();
return 0; return 0;
...@@ -615,6 +608,7 @@ static int snd_aica_probe(struct platform_device *devptr) ...@@ -615,6 +608,7 @@ static int snd_aica_probe(struct platform_device *devptr)
"Yamaha AICA Super Intelligent Sound Processor for SEGA Dreamcast"); "Yamaha AICA Super Intelligent Sound Processor for SEGA Dreamcast");
/* Prepare to use the queue */ /* Prepare to use the queue */
INIT_WORK(&(dreamcastcard->spu_dma_work), run_spu_dma); INIT_WORK(&(dreamcastcard->spu_dma_work), run_spu_dma);
timer_setup(&dreamcastcard->timer, aica_period_elapsed, 0);
/* Load the PCM 'chip' */ /* Load the PCM 'chip' */
err = snd_aicapcmchip(dreamcastcard, 0); err = snd_aicapcmchip(dreamcastcard, 0);
if (unlikely(err < 0)) if (unlikely(err < 0))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册