~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/oss/emu10k1/irqmgr.c

Version: ~ [ linux-5.2-rc1 ] ~ [ linux-5.1.2 ] ~ [ linux-5.0.16 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.43 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.119 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.176 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.179 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.139 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.67 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  **********************************************************************
  3  *     irqmgr.c - IRQ manager for emu10k1 driver
  4  *     Copyright 1999, 2000 Creative Labs, Inc.
  5  *
  6  **********************************************************************
  7  *
  8  *     Date                 Author          Summary of changes
  9  *     ----                 ------          ------------------
 10  *     October 20, 1999     Bertrand Lee    base code release
 11  *
 12  **********************************************************************
 13  *
 14  *     This program is free software; you can redistribute it and/or
 15  *     modify it under the terms of the GNU General Public License as
 16  *     published by the Free Software Foundation; either version 2 of
 17  *     the License, or (at your option) any later version.
 18  *
 19  *     This program is distributed in the hope that it will be useful,
 20  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 21  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 22  *     GNU General Public License for more details.
 23  *
 24  *     You should have received a copy of the GNU General Public
 25  *     License along with this program; if not, write to the Free
 26  *     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
 27  *     USA.
 28  *
 29  **********************************************************************
 30  */
 31 
 32 #include "hwaccess.h"
 33 #include "8010.h"
 34 #include "cardmi.h"
 35 #include "cardmo.h"
 36 #include "irqmgr.h"
 37 
 38 /* Interrupt handler */
 39 
 40 irqreturn_t emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 41 {
 42         struct emu10k1_card *card = (struct emu10k1_card *) dev_id;
 43         u32 irqstatus, irqstatus_tmp;
 44         int handled = 0;
 45 
 46         DPD(4, "emu10k1_interrupt called, irq =  %u\n", irq);
 47 
 48         /*
 49          ** NOTE :
 50          ** We do a 'while loop' here cos on certain machines, with both
 51          ** playback and recording going on at the same time, IRQs will
 52          ** stop coming in after a while. Checking IPND indeed shows that
 53          ** there are interrupts pending but the PIC says no IRQs pending.
 54          ** I suspect that some boards need edge-triggered IRQs but are not
 55          ** getting that condition if we don't completely clear the IPND
 56          ** (make sure no more interrupts are pending).
 57          ** - Eric
 58          */
 59 
 60         while ((irqstatus = inl(card->iobase + IPR))) {
 61                 DPD(4, "irq status %#x\n", irqstatus);
 62 
 63                 irqstatus_tmp = irqstatus;
 64 
 65                 if (irqstatus & IRQTYPE_TIMER) {
 66                         emu10k1_timer_irqhandler(card);
 67                         irqstatus &= ~IRQTYPE_TIMER;
 68                 }
 69 
 70                 if (irqstatus & IRQTYPE_DSP) {
 71                         emu10k1_dsp_irqhandler(card);
 72                         irqstatus &= ~IRQTYPE_DSP;
 73                 }
 74 
 75                 if (irqstatus & IRQTYPE_MPUIN) {
 76                         emu10k1_mpuin_irqhandler(card);
 77                         irqstatus &= ~IRQTYPE_MPUIN;
 78                 }
 79 
 80                 if (irqstatus & IRQTYPE_MPUOUT) {
 81                         emu10k1_mpuout_irqhandler(card);
 82                         irqstatus &= ~IRQTYPE_MPUOUT;
 83                 }
 84 
 85                 if (irqstatus & IPR_MUTE) {
 86                         emu10k1_mute_irqhandler(card);
 87                         irqstatus &=~IPR_MUTE;
 88                 }
 89 
 90                 if (irqstatus & IPR_VOLINCR) {
 91                         emu10k1_volincr_irqhandler(card);
 92                         irqstatus &=~IPR_VOLINCR;
 93                 }
 94 
 95                 if (irqstatus & IPR_VOLDECR) {
 96                         emu10k1_voldecr_irqhandler(card);
 97                         irqstatus &=~IPR_VOLDECR;
 98                 }
 99 
100                 if (irqstatus){
101                         printk(KERN_ERR "emu10k1: Warning, unhandled interrupt: %#08x\n", irqstatus);
102                         //make sure any interrupts we don't handle are disabled:
103                         emu10k1_irq_disable(card, ~(INTE_MIDIRXENABLE | INTE_MIDITXENABLE | INTE_INTERVALTIMERENB |
104                                                 INTE_VOLDECRENABLE | INTE_VOLINCRENABLE | INTE_MUTEENABLE |
105                                                 INTE_FXDSPENABLE));
106                 }
107 
108                 /* acknowledge interrupt */
109                 outl(irqstatus_tmp, card->iobase + IPR);
110                 handled = 1;
111         }
112         return IRQ_RETVAL(handled);
113 }
114 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp