Changeset 772 for GPL/trunk/alsa-kernel/pci/emu10k1/irq.c
- Timestamp:
- Apr 19, 2025, 8:08:37 PM (5 months ago)
- Location:
- GPL/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
- Property svn:mergeinfo changed
/GPL/branches/uniaud32-6.6-LTS (added) merged: 765,768-769 /GPL/branches/uniaud32-exp (added) merged: 735-741,743-744,748-751,753-760,762-764 /GPL/branches/uniaud32-next merged: 718-734
- Property svn:mergeinfo changed
-
GPL/trunk/alsa-kernel/pci/emu10k1/irq.c
r679 r772 4 4 * Creative Labs, Inc. 5 5 * Routines for IRQ control of EMU10K1 chips 6 *7 * BUGS:8 * --9 *10 * TODO:11 * --12 6 */ 13 7 … … 19 13 { 20 14 struct snd_emu10k1 *emu = dev_id; 21 unsigned int status, status2, orig_status, orig_status2;15 unsigned int status, orig_status; 22 16 int handled = 0; 23 17 int timeout = 0; 24 18 25 while (((status = inl(emu->port + IPR)) != 0) && (timeout < 1000)) { 26 timeout++; 27 orig_status = status; 19 while ((status = inl(emu->port + IPR)) != 0) { 28 20 handled = 1; 29 21 if ((status & 0xffffffff) == 0xffffffff) { … … 32 24 break; 33 25 } 26 if (++timeout == 1000) { 27 dev_info(emu->card->dev, "emu10k1 irq routine failure\n"); 28 break; 29 } 30 orig_status = status; 34 31 if (status & IPR_PCIERROR) { 35 32 dev_err(emu->card->dev, "interrupt: PCI error\n"); … … 45 42 } 46 43 if (status & IPR_CHANNELLOOP) { 44 struct snd_emu10k1_voice *pvoice; 47 45 int voice; 48 46 int voice_max = status & IPR_CHANNELNUMBERMASK; 49 47 u32 val; 50 struct snd_emu10k1_voice *pvoice = emu->voices;51 48 52 49 val = snd_emu10k1_ptr_read(emu, CLIPL, 0); 50 pvoice = emu->voices; 53 51 for (voice = 0; voice <= voice_max; voice++) { 54 52 if (voice == 0x20) … … 66 64 } 67 65 val = snd_emu10k1_ptr_read(emu, HLIPL, 0); 66 pvoice = emu->voices; 68 67 for (voice = 0; voice <= voice_max; voice++) { 69 68 if (voice == 0x20) … … 80 79 pvoice++; 81 80 } 82 status &= ~ IPR_CHANNELLOOP;81 status &= ~(IPR_CHANNELLOOP | IPR_CHANNELNUMBERMASK); 83 82 } 84 status &= ~IPR_CHANNELNUMBERMASK;85 83 if (status & (IPR_ADCBUFFULL|IPR_ADCBUFHALFFULL)) { 86 84 if (emu->capture_interrupt) … … 140 138 } 141 139 if (status & IPR_P16V) { 142 while ((status2 = inl(emu->port + IPR2)) != 0) { 143 u32 mask = INTE2_PLAYBACK_CH_0_LOOP; /* Full Loop */ 144 struct snd_emu10k1_voice *pvoice = &(emu->p16v_voices[0]); 145 struct snd_emu10k1_voice *cvoice = &(emu->p16v_capture_voice); 146 147 /* dev_dbg(emu->card->dev, "status2=0x%x\n", status2); */ 148 orig_status2 = status2; 149 if(status2 & mask) { 150 if(pvoice->use) { 151 snd_pcm_period_elapsed(pvoice->epcm->substream); 152 } else { 153 dev_err(emu->card->dev, 154 "p16v: status: 0x%08x, mask=0x%08x, pvoice=%p, use=%d\n", 155 status2, mask, pvoice, 156 pvoice->use); 157 } 158 } 159 if(status2 & 0x110000) { 160 /* dev_info(emu->card->dev, "capture int found\n"); */ 161 if(cvoice->use) { 162 /* dev_info(emu->card->dev, "capture period_elapsed\n"); */ 163 snd_pcm_period_elapsed(cvoice->epcm->substream); 164 } 165 } 166 outl(orig_status2, emu->port + IPR2); /* ack all */ 167 } 140 if (emu->p16v_interrupt) 141 emu->p16v_interrupt(emu); 142 else 143 outl(0, emu->port + INTE2); 168 144 status &= ~IPR_P16V; 145 } 146 if (status & IPR_A_GPIO) { 147 if (emu->gpio_interrupt) 148 emu->gpio_interrupt(emu); 149 else 150 snd_emu10k1_intr_disable(emu, INTE_A_GPIOENABLE); 151 status &= ~IPR_A_GPIO; 169 152 } 170 153 171 154 if (status) { 172 unsigned int bits;173 155 dev_err(emu->card->dev, 174 156 "unhandled interrupt: 0x%08x\n", status); 175 //make sure any interrupts we don't handle are disabled:176 bits = INTE_FXDSPENABLE |177 INTE_PCIERRORENABLE |178 INTE_VOLINCRENABLE |179 INTE_VOLDECRENABLE |180 INTE_MUTEENABLE |181 INTE_MICBUFENABLE |182 INTE_ADCBUFENABLE |183 INTE_EFXBUFENABLE |184 INTE_GPSPDIFENABLE |185 INTE_CDSPDIFENABLE |186 INTE_INTERVALTIMERENB |187 INTE_MIDITXENABLE |188 INTE_MIDIRXENABLE;189 if (emu->audigy)190 bits |= INTE_A_MIDITXENABLE2 | INTE_A_MIDIRXENABLE2;191 snd_emu10k1_intr_disable(emu, bits);192 157 } 193 158 outl(orig_status, emu->port + IPR); /* ack all */ 194 159 } 195 if (timeout == 1000)196 dev_info(emu->card->dev, "emu10k1 irq routine failure\n");197 160 198 161 return IRQ_RETVAL(handled);
Note:
See TracChangeset
for help on using the changeset viewer.