<DIV> </DIV>
<DIV>Hi</DIV>
<DIV> I'm writing an ac97 driver with interrupt mode,below is my code:</DIV>
<DIV>static <FONT size=2>irqreturn_t ac97_interrupt_handler(int irq,void *dev_id,struct pt_regs *regs)</FONT></DIV>
<DIV><FONT size=2>{</FONT></DIV>
<DIV><FONT size=2> disable_irq(7);</FONT></DIV>
<DIV><FONT size=2> wake_up_interruptible(ac97_queue);</FONT></DIV>
<DIV><FONT size=2> return IRQ_HANDLED;</FONT></DIV>
<DIV><FONT size=2>}</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>static int xilinx_ac97_write(struct file *filp,char *buffer,size_t count,loff_t *ppos)</FONT></DIV>
<DIV><FONT size=2>{</FONT></DIV>
<DIV><FONT size=2> ......</FONT></DIV>
<DIV><FONT size=2> if(XAC97_isInFIFOFull(baseAddress))</FONT></DIV>
<DIV><FONT size=2> wait_event_interruptible(ac97_queue,...);</FONT></DIV>
<DIV><FONT size=2> else</FONT></DIV>
<DIV><FONT size=2> XAC97_mSetInFifoData(baseAddress,...);</FONT></DIV>
<DIV><FONT size=2> ......</FONT></DIV>
<DIV><FONT size=2>}</FONT></DIV>
<DIV><FONT size=2> Int the write function,when the play back fifo is not full,I send the PCM code to the fifo,else I make the write process sleep,and in the interrupt handler(when the fifo half empty,an interrupt occure),I wake up the write process,and go on write PCM code to the fifo.</FONT></DIV>
<DIV> But I find the play speed is rather faster than regular and can't hear the voice(I have set the pcm rate correctly),I don't know why,can anyone give some advice on writing interupt handler or send me a copy of ac97 driver with interrupt mode? thanks a lot</DIV><br><!-- footer --><br><hr>
<a style="font-size:14px;line-height:15px; color:#000; text-decoration:none" href="http://event.mail.163.com/chanel/xyq.htm?from=163_NO1" target="_blank"><span style="text-decoration:underline; color:blue">150 万 人 同 时 在 玩 的 网 游,你 不 试 试 吗 ? </span> </a>