Example #1
0
void dsp_mailbox_init(void)
{
#if 0
	mailbox_reg1=(struct mail_msg *)MAILBOX1_REG(0);
	mailbox_reg2=(struct mail_msg *)MAILBOX2_REG(0);
	memset((void*)mailbox_reg1,0,sizeof(mailbox_reg1));
	memset((void*)mailbox_reg2,0,sizeof(mailbox_reg2));
	memset((void*)mailbox_irqlist,0,sizeof(mailbox_irqlist));
	dsp_cache_wback((unsigned long)mailbox_reg1, sizeof(mailbox_reg1));
	dsp_cache_wback((unsigned long)mailbox_reg2, sizeof(mailbox_reg2));
	dsp_cache_wback((unsigned long)mailbox_irqlist, sizeof(mailbox_irqlist));
#endif
}
int audiodsp_init_mailbox(struct audiodsp_priv *priv)
{
    int err;
#if MESON_CPU_TYPE >= MESON_CPU_TYPE_MESON8		
	err = request_irq(INT_ASSIST_MBOX1, audiodsp_mailbox_irq,
                    IRQF_SHARED, "audiodsp_mailbox", (void *)priv);
#else
	err = request_irq(INT_MAILBOX_1B, audiodsp_mailbox_irq,
                    IRQF_SHARED, "audiodsp_mailbox", (void *)priv);
#endif
    if(err != 0){
      printk("request IRQ for dsp mailbox failed: errno = %x\n", err);
      return -1;
    }
	//WRITE_MPEG_REG(ASSIST_MBOX0_MASK, 0xffffffff);
	priv->mailbox_reg=(struct mail_msg *)MAILBOX1_REG(0);
	priv->mailbox_reg2=(struct mail_msg *)MAILBOX2_REG(0);
	
	INIT_WORK(&audiodsp_work.audiodsp_workqueue, audiodsp_mailbox_work_queue);
	
	return 0;
}