19 static const char *mic_revision =
"$Revision: 1.12.2.4 $";
21 #define byteout(addr, val) outb(val, addr)
22 #define bytein(addr) inb(addr)
45 insb(adr, data, size);
60 outsb(adr, data, size);
68 return (
readreg(cs->hw.mic.adr, cs->hw.mic.isac, offset));
74 writereg(cs->hw.mic.adr, cs->hw.mic.isac, offset, value);
80 readfifo(cs->hw.mic.adr, cs->hw.mic.isac, 0, data, size);
86 writefifo(cs->hw.mic.adr, cs->hw.mic.isac, 0, data, size);
93 cs->hw.mic.hscx, offset + (hscx ? 0x40 : 0)));
100 cs->hw.mic.hscx, offset + (hscx ? 0x40 : 0), value);
107 #define READHSCX(cs, nr, reg) readreg(cs->hw.mic.adr, \
108 cs->hw.mic.hscx, reg + (nr ? 0x40 : 0))
109 #define WRITEHSCX(cs, nr, reg, data) writereg(cs->hw.mic.adr, \
110 cs->hw.mic.hscx, reg + (nr ? 0x40 : 0), data)
112 #define READHSCXFIFO(cs, nr, ptr, cnt) readfifo(cs->hw.mic.adr, \
113 cs->hw.mic.hscx, (nr ? 0x40 : 0), ptr, cnt)
115 #define WRITEHSCXFIFO(cs, nr, ptr, cnt) writefifo(cs->hw.mic.adr, \
116 cs->hw.mic.hscx, (nr ? 0x40 : 0), ptr, cnt)
121 mic_interrupt(
int intno,
void *
dev_id)
123 struct IsdnCardState *cs =
dev_id;
131 hscx_int_main(cs, val);
138 if (cs->debug & L1_DEB_HSCX)
139 debugl1(cs,
"HSCX IntStat after IntRoutine");
144 if (cs->debug & L1_DEB_ISAC)
145 debugl1(cs,
"ISAC IntStat after IntRoutine");
154 spin_unlock_irqrestore(&cs->lock, flags);
159 release_io_mic(
struct IsdnCardState *cs)
163 if (cs->hw.mic.cfg_reg)
168 mic_card_msg(
struct IsdnCardState *cs,
int mt,
void *
arg)
182 spin_unlock_irqrestore(&cs->lock, flags);
194 struct IsdnCardState *cs = card->
cs;
197 strcpy(tmp, mic_revision);
203 cs->hw.mic.cfg_reg = card->
para[1];
204 cs->irq = card->
para[0];
205 cs->hw.mic.adr = cs->hw.mic.cfg_reg +
MIC_ADR;
206 cs->hw.mic.isac = cs->hw.mic.cfg_reg +
MIC_ISAC;
207 cs->hw.mic.hscx = cs->hw.mic.cfg_reg +
MIC_HSCX;
211 "HiSax: ith mic config port %x-%x already in use\n",
213 cs->hw.mic.cfg_reg + bytecnt);
217 cs->hw.mic.cfg_reg, cs->irq);
221 cs->readisacfifo = &ReadISACfifo;
222 cs->writeisacfifo = &WriteISACfifo;
225 cs->BC_Send_Data = &hscx_fill_fifo;
226 cs->cardmsg = &mic_card_msg;
227 cs->irq_func = &mic_interrupt;
231 "mic: wrong HSCX versions check IO address\n");