From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from m13-130.163.com (m13-130.163.com [220.181.13.130]) by ozlabs.org (Postfix) with SMTP id A9C46DDF15 for ; Sun, 1 Jul 2007 12:34:47 +1000 (EST) Date: Sun, 1 Jul 2007 10:03:41 +0800 (CST) From: silicom To: linuxppc-embedded@ozlabs.org Message-ID: <1719162188.1761901183255421508.JavaMail.coremail@bj163app130.163.com> Subject: Can anyone send me a copy of ac97 driver with interrupt function MIME-Version: 1.0 Content-Type: multipart/Alternative; boundary="----=_Part_176124_1184048470.1183255421507" List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , ------=_Part_176124_1184048470.1183255421507 Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: quoted-printable Hi I'm writing an ac97 driver with interrupt mode,below is my code:stat= icirqreturn_t ac97_interrupt_handler(int irq,void *dev_id,struct pt_regs *r= egs){ disable_irq(7); wake_up_interruptible(ac97_queue); return IR= Q_HANDLED;} static int xilinx_ac97_write(struct file *filp,char *buffer,siz= e_t count,loff_t *ppos){ ...... if(XAC97_isInFIFOFull(baseAddress)) = wait_event_interruptible(ac97_queue,...); else XAC97_mSetIn= FifoData(baseAddress,...); ......} Int the write function,when the pl= ay back fifo is not full,I send the PCM code to the fifo,else I make the wr= ite 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 t= he fifo. 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 a= nyone give some advice on writing interupt handler or send me a copy of ac9= 7 driver with interrupt mode? thanks a lot ------=_Part_176124_1184048470.1183255421507 Content-Type: text/html; charset=gbk Content-Transfer-Encoding: quoted-printable
 
Hi
    I'm writing an ac97 driver with interrupt mode,belo= w is my code:
static irqreturn_t ac97_interrupt_handler(int irq,void = *dev_id,struct pt_regs *regs)
{
    disable_irq(7);
    wake_up_interruptible(ac97_queue);
    return IRQ_HANDLED;
}
 
static int xilinx_ac97_write(struct file *filp,char *bu= ffer,size_t count,loff_t *ppos)
{
    ......
    if(XAC97_isInFIFOFull(baseAddress))<= /FONT>
        wait_event_i= nterruptible(ac97_queue,...);
    else
        XAC97_mSetIn= FifoData(baseAddress,...);
    ......
}
    Int the write function,when the = ;play back fifo is not full,I send the PCM code to the fifo,else I mak= e the write process sleep,and in the interrupt handler(when the fifo half e= mpty,an interrupt occure),I wake up the write process,and go on write&= nbsp;PCM code to the fifo.
    But I find the play speed is rather faster than reg= ular 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



150 =CD= =F2 =C8=CB =CD=AC =CA=B1 =D4=DA =CD=E6 =B5=C4 =CD=F8 =D3=CE=A3=AC=C4=E3 =B2= =BB =CA=D4 =CA=D4 =C2=F0 =A3=BF ------=_Part_176124_1184048470.1183255421507--