diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-17 10:43:53 +0100 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 12:17:04 +0100 |
commit | 89173bd41439bc6304e3e20f742e52266208ccad (patch) | |
tree | b17197935f7039dce756ca27730fa329095a27f8 /sound | |
parent | b9b4bdd9f1c98388f13591608d574650a9873717 (diff) | |
download | linux-89173bd41439bc6304e3e20f742e52266208ccad.tar.bz2 |
[ALSA] emu10k1x - Minor clean up
Modules: EMU10K1/EMU10K2 driver
Minor clean up of the emu10k1x interrupt handler code.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/emu10k1/emu10k1x.c | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c index ca402e994696..6c61ac60afd7 100644 --- a/sound/pci/emu10k1/emu10k1x.c +++ b/sound/pci/emu10k1/emu10k1x.c @@ -795,44 +795,43 @@ static irqreturn_t snd_emu10k1x_interrupt(int irq, void *dev_id, status = inl(chip->port + IPR); - if(status) { - // capture interrupt - if(status & (IPR_CAP_0_LOOP | IPR_CAP_0_HALF_LOOP)) { - emu10k1x_voice_t *pvoice = &chip->capture_voice; - if(pvoice->use) - snd_emu10k1x_pcm_interrupt(chip, pvoice); - else - snd_emu10k1x_intr_disable(chip, - INTE_CAP_0_LOOP | - INTE_CAP_0_HALF_LOOP); - } - - mask = IPR_CH_0_LOOP|IPR_CH_0_HALF_LOOP; - for(i = 0; i < 3; i++) { - if(status & mask) { - if(pvoice->use) - snd_emu10k1x_pcm_interrupt(chip, pvoice); - else - snd_emu10k1x_intr_disable(chip, mask); - } - pvoice++; - mask <<= 1; - } + if (! status) + return IRQ_NONE; + + // capture interrupt + if (status & (IPR_CAP_0_LOOP | IPR_CAP_0_HALF_LOOP)) { + emu10k1x_voice_t *pvoice = &chip->capture_voice; + if(pvoice->use) + snd_emu10k1x_pcm_interrupt(chip, pvoice); + else + snd_emu10k1x_intr_disable(chip, + INTE_CAP_0_LOOP | + INTE_CAP_0_HALF_LOOP); + } - if (status & (IPR_MIDITRANSBUFEMPTY|IPR_MIDIRECVBUFEMPTY)) { - if (chip->midi.interrupt) - chip->midi.interrupt(chip, status); - else - snd_emu10k1x_intr_disable(chip, INTE_MIDITXENABLE|INTE_MIDIRXENABLE); + mask = IPR_CH_0_LOOP|IPR_CH_0_HALF_LOOP; + for (i = 0; i < 3; i++) { + if (status & mask) { + if (pvoice->use) + snd_emu10k1x_pcm_interrupt(chip, pvoice); + else + snd_emu10k1x_intr_disable(chip, mask); } + pvoice++; + mask <<= 1; + } - // acknowledge the interrupt if necessary - if(status) - outl(status, chip->port+IPR); - -// snd_printk(KERN_INFO "interrupt %08x\n", status); + if (status & (IPR_MIDITRANSBUFEMPTY|IPR_MIDIRECVBUFEMPTY)) { + if (chip->midi.interrupt) + chip->midi.interrupt(chip, status); + else + snd_emu10k1x_intr_disable(chip, INTE_MIDITXENABLE|INTE_MIDIRXENABLE); } + + // acknowledge the interrupt if necessary + outl(status, chip->port + IPR); + // snd_printk(KERN_INFO "interrupt %08x\n", status); return IRQ_HANDLED; } |