diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-17 04:43:53 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:17:04 -0500 |
commit | 89173bd41439bc6304e3e20f742e52266208ccad (patch) | |
tree | b17197935f7039dce756ca27730fa329095a27f8 /sound/pci/emu10k1 | |
parent | b9b4bdd9f1c98388f13591608d574650a9873717 (diff) |
[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/pci/emu10k1')
-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, | |||
795 | 795 | ||
796 | status = inl(chip->port + IPR); | 796 | status = inl(chip->port + IPR); |
797 | 797 | ||
798 | if(status) { | 798 | if (! status) |
799 | // capture interrupt | 799 | return IRQ_NONE; |
800 | if(status & (IPR_CAP_0_LOOP | IPR_CAP_0_HALF_LOOP)) { | 800 | |
801 | emu10k1x_voice_t *pvoice = &chip->capture_voice; | 801 | // capture interrupt |
802 | if(pvoice->use) | 802 | if (status & (IPR_CAP_0_LOOP | IPR_CAP_0_HALF_LOOP)) { |
803 | snd_emu10k1x_pcm_interrupt(chip, pvoice); | 803 | emu10k1x_voice_t *pvoice = &chip->capture_voice; |
804 | else | 804 | if(pvoice->use) |
805 | snd_emu10k1x_intr_disable(chip, | 805 | snd_emu10k1x_pcm_interrupt(chip, pvoice); |
806 | INTE_CAP_0_LOOP | | 806 | else |
807 | INTE_CAP_0_HALF_LOOP); | 807 | snd_emu10k1x_intr_disable(chip, |
808 | } | 808 | INTE_CAP_0_LOOP | |
809 | 809 | INTE_CAP_0_HALF_LOOP); | |
810 | mask = IPR_CH_0_LOOP|IPR_CH_0_HALF_LOOP; | 810 | } |
811 | for(i = 0; i < 3; i++) { | ||
812 | if(status & mask) { | ||
813 | if(pvoice->use) | ||
814 | snd_emu10k1x_pcm_interrupt(chip, pvoice); | ||
815 | else | ||
816 | snd_emu10k1x_intr_disable(chip, mask); | ||
817 | } | ||
818 | pvoice++; | ||
819 | mask <<= 1; | ||
820 | } | ||
821 | 811 | ||
822 | if (status & (IPR_MIDITRANSBUFEMPTY|IPR_MIDIRECVBUFEMPTY)) { | 812 | mask = IPR_CH_0_LOOP|IPR_CH_0_HALF_LOOP; |
823 | if (chip->midi.interrupt) | 813 | for (i = 0; i < 3; i++) { |
824 | chip->midi.interrupt(chip, status); | 814 | if (status & mask) { |
825 | else | 815 | if (pvoice->use) |
826 | snd_emu10k1x_intr_disable(chip, INTE_MIDITXENABLE|INTE_MIDIRXENABLE); | 816 | snd_emu10k1x_pcm_interrupt(chip, pvoice); |
817 | else | ||
818 | snd_emu10k1x_intr_disable(chip, mask); | ||
827 | } | 819 | } |
820 | pvoice++; | ||
821 | mask <<= 1; | ||
822 | } | ||
828 | 823 | ||
829 | // acknowledge the interrupt if necessary | 824 | if (status & (IPR_MIDITRANSBUFEMPTY|IPR_MIDIRECVBUFEMPTY)) { |
830 | if(status) | 825 | if (chip->midi.interrupt) |
831 | outl(status, chip->port+IPR); | 826 | chip->midi.interrupt(chip, status); |
832 | 827 | else | |
833 | // snd_printk(KERN_INFO "interrupt %08x\n", status); | 828 | snd_emu10k1x_intr_disable(chip, INTE_MIDITXENABLE|INTE_MIDIRXENABLE); |
834 | } | 829 | } |
830 | |||
831 | // acknowledge the interrupt if necessary | ||
832 | outl(status, chip->port + IPR); | ||
835 | 833 | ||
834 | // snd_printk(KERN_INFO "interrupt %08x\n", status); | ||
836 | return IRQ_HANDLED; | 835 | return IRQ_HANDLED; |
837 | } | 836 | } |
838 | 837 | ||