int __init setup_mic(struct IsdnCard *card) { int bytecnt; struct IsdnCardState *cs = card->cs; char tmp[64]; strcpy(tmp, mic_revision); printk(KERN_INFO "HiSax: mic driver Rev. %s\n", HiSax_getrev(tmp)); if (cs->typ != ISDN_CTYPE_MIC) return (0); bytecnt = 8; cs->hw.mic.cfg_reg = card->para[1]; cs->irq = card->para[0]; cs->hw.mic.adr = cs->hw.mic.cfg_reg + MIC_ADR; cs->hw.mic.isac = cs->hw.mic.cfg_reg + MIC_ISAC; cs->hw.mic.hscx = cs->hw.mic.cfg_reg + MIC_HSCX; if (check_region((cs->hw.mic.cfg_reg), bytecnt)) { printk(KERN_WARNING "HiSax: %s config port %x-%x already in use\n", CardType[card->typ], cs->hw.mic.cfg_reg, cs->hw.mic.cfg_reg + bytecnt); return (0); } else { request_region(cs->hw.mic.cfg_reg, bytecnt, "mic isdn"); } printk(KERN_INFO "mic: defined at 0x%x IRQ %d\n", cs->hw.mic.cfg_reg, cs->irq); cs->readisac = &ReadISAC; cs->writeisac = &WriteISAC; cs->readisacfifo = &ReadISACfifo; cs->writeisacfifo = &WriteISACfifo; cs->BC_Read_Reg = &ReadHSCX; cs->BC_Write_Reg = &WriteHSCX; cs->BC_Send_Data = &hscx_fill_fifo; cs->cardmsg = &mic_card_msg; cs->irq_func = &mic_interrupt; ISACVersion(cs, "mic:"); if (HscxVersion(cs, "mic:")) { printk(KERN_WARNING "mic: wrong HSCX versions check IO address\n"); release_io_mic(cs); return (0); } return (1); }
static int mic_card_msg(struct IsdnCardState *cs, int mt, void *arg) { switch (mt) { case CARD_RESET: return(0); case CARD_RELEASE: release_io_mic(cs); return(0); case CARD_INIT: inithscx(cs); /* /RTSA := ISAC RST */ inithscxisac(cs, 3); return(0); case CARD_TEST: return(0); } return(0); }
static int mic_card_msg(struct IsdnCardState *cs, int mt, void *arg) { u_long flags; switch (mt) { case CARD_RESET: return(0); case CARD_RELEASE: release_io_mic(cs); return(0); case CARD_INIT: spin_lock_irqsave(&cs->lock, flags); inithscx(cs); /* /RTSA := ISAC RST */ inithscxisac(cs, 3); spin_unlock_irqrestore(&cs->lock, flags); return(0); case CARD_TEST: return(0); } return(0); }