Commit 8fa894ae authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN/HiSax: Add B-Channel FIFO ops

Preparing for un-inlining hscx_irq.c, we add operations needed
to access the B-Channel FIFO's, similar to what we already have
for the D-Channel.
parent 32610705
...@@ -153,20 +153,34 @@ static struct dc_hw_ops ipac_dc_ops = { ...@@ -153,20 +153,34 @@ static struct dc_hw_ops ipac_dc_ops = {
}; };
static u8 static u8
ReadHSCX(struct IsdnCardState *cs, int hscx, u8 offset) hscx_read(struct IsdnCardState *cs, int hscx, u8 offset)
{ {
return readreg(cs, cs->hw.asus.hscx, offset + (hscx ? 0x40 : 0)); return readreg(cs, cs->hw.asus.hscx, offset + (hscx ? 0x40 : 0));
} }
static void static void
WriteHSCX(struct IsdnCardState *cs, int hscx, u8 offset, u8 value) hscx_write(struct IsdnCardState *cs, int hscx, u8 offset, u8 value)
{ {
writereg(cs, cs->hw.asus.hscx, offset + (hscx ? 0x40 : 0), value); writereg(cs, cs->hw.asus.hscx, offset + (hscx ? 0x40 : 0), value);
} }
static void
hscx_read_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
readfifo(cs, cs->hw.asus.hscx, hscx ? 0x40 : 0, data, size);
}
static void
hscx_write_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
writefifo(cs, cs->hw.asus.hscx, hscx ? 0x40 : 0, data, size);
}
static struct bc_hw_ops hscx_ops = { static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX, .read_reg = hscx_read,
.write_reg = WriteHSCX, .write_reg = hscx_write,
.read_fifo = hscx_read_fifo,
.write_fifo = hscx_write_fifo,
}; };
/* /*
......
...@@ -51,54 +51,66 @@ write_fifo(unsigned int adr, u8 * data, int size) ...@@ -51,54 +51,66 @@ write_fifo(unsigned int adr, u8 * data, int size)
outsb(adr, data, size); outsb(adr, data, size);
} }
/* Interface functions */
static u8 static u8
ReadISAC(struct IsdnCardState *cs, u8 offset) isac_read(struct IsdnCardState *cs, u8 offset)
{ {
return (readreg(cs->hw.avm.isac, offset)); return readreg(cs->hw.avm.isac, offset);
} }
static void static void
WriteISAC(struct IsdnCardState *cs, u8 offset, u8 value) isac_write(struct IsdnCardState *cs, u8 offset, u8 value)
{ {
writereg(cs->hw.avm.isac, offset, value); writereg(cs->hw.avm.isac, offset, value);
} }
static void static void
ReadISACfifo(struct IsdnCardState *cs, u8 * data, int size) isac_read_fifo(struct IsdnCardState *cs, u8 * data, int size)
{ {
read_fifo(cs->hw.avm.isacfifo, data, size); read_fifo(cs->hw.avm.isacfifo, data, size);
} }
static void static void
WriteISACfifo(struct IsdnCardState *cs, u8 * data, int size) isac_write_fifo(struct IsdnCardState *cs, u8 * data, int size)
{ {
write_fifo(cs->hw.avm.isacfifo, data, size); write_fifo(cs->hw.avm.isacfifo, data, size);
} }
static struct dc_hw_ops isac_ops = { static struct dc_hw_ops isac_ops = {
.read_reg = ReadISAC, .read_reg = isac_read,
.write_reg = WriteISAC, .write_reg = isac_write,
.read_fifo = ReadISACfifo, .read_fifo = isac_read_fifo,
.write_fifo = WriteISACfifo, .write_fifo = isac_write_fifo,
}; };
static u8 static u8
ReadHSCX(struct IsdnCardState *cs, int hscx, u8 offset) hscx_read(struct IsdnCardState *cs, int hscx, u8 offset)
{ {
return (readreg(cs->hw.avm.hscx[hscx], offset)); return (readreg(cs->hw.avm.hscx[hscx], offset));
} }
static void static void
WriteHSCX(struct IsdnCardState *cs, int hscx, u8 offset, u8 value) hscx_write(struct IsdnCardState *cs, int hscx, u8 offset, u8 value)
{ {
writereg(cs->hw.avm.hscx[hscx], offset, value); writereg(cs->hw.avm.hscx[hscx], offset, value);
} }
static void
hscx_read_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
read_fifo(cs->hw.avm.hscxfifo[hscx], data, size);
}
static void
hscx_write_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
write_fifo(cs->hw.avm.hscxfifo[hscx], data, size);
}
static struct bc_hw_ops hscx_ops = { static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX, .read_reg = hscx_read,
.write_reg = WriteHSCX, .write_reg = hscx_write,
.read_fifo = hscx_read_fifo,
.write_fifo = hscx_write_fifo,
}; };
/* /*
......
...@@ -137,43 +137,45 @@ static struct dc_hw_ops isac_ops = { ...@@ -137,43 +137,45 @@ static struct dc_hw_ops isac_ops = {
.write_fifo = isac_write_fifo, .write_fifo = isac_write_fifo,
}; };
static inline u8 static u8
ReadHSCX(struct IsdnCardState *cs, int hscx, u8 adr) hscx_read(struct IsdnCardState *cs, int hscx, u8 adr)
{ {
return readreg(cs, HSCX_REG_OFFSET + hscx*HSCX_CH_DIFF, adr); return readreg(cs, HSCX_REG_OFFSET + hscx*HSCX_CH_DIFF, adr);
} }
static inline void static void
WriteHSCX(struct IsdnCardState *cs, int hscx, u8 adr, u8 value) hscx_write(struct IsdnCardState *cs, int hscx, u8 adr, u8 value)
{ {
writereg(cs, HSCX_REG_OFFSET + hscx*HSCX_CH_DIFF, adr, value); writereg(cs, HSCX_REG_OFFSET + hscx*HSCX_CH_DIFF, adr, value);
} }
static inline void static void
ReadHSCXfifo(struct IsdnCardState *cs, int hscx, u8 * data, int size) hscx_read_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{ {
return readfifo(cs, HSCX_FIFO_OFFSET + hscx*HSCX_CH_DIFF, data, size); return readfifo(cs, HSCX_FIFO_OFFSET + hscx*HSCX_CH_DIFF, data, size);
} }
static inline void static void
WriteHSCXfifo(struct IsdnCardState *cs, int hscx, u8 * data, int size) hscx_write_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{ {
writefifo(cs, HSCX_FIFO_OFFSET + hscx*HSCX_CH_DIFF, data, size); writefifo(cs, HSCX_FIFO_OFFSET + hscx*HSCX_CH_DIFF, data, size);
} }
static struct bc_hw_ops hscx_ops = { static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX, .read_reg = hscx_read,
.write_reg = WriteHSCX, .write_reg = hscx_write,
.read_fifo = hscx_read_fifo,
.write_fifo = hscx_write_fifo,
}; };
/* /*
* fast interrupt HSCX stuff goes here * fast interrupt HSCX stuff goes here
*/ */
#define READHSCX(cs, nr, reg) ReadHSCX(cs, nr, reg) #define READHSCX(cs, nr, reg) hscx_read(cs, nr, reg)
#define WRITEHSCX(cs, nr, reg, data) WriteHSCX(cs, nr, reg, data) #define WRITEHSCX(cs, nr, reg, data) hscx_write(cs, nr, reg, data)
#define READHSCXFIFO(cs, nr, ptr, cnt) ReadHSCXfifo(cs, nr, ptr, cnt) #define READHSCXFIFO(cs, nr, ptr, cnt) hscx_read_fifo(cs, nr, ptr, cnt)
#define WRITEHSCXFIFO(cs, nr, ptr, cnt) WriteHSCXfifo(cs, nr, ptr, cnt) #define WRITEHSCXFIFO(cs, nr, ptr, cnt) hscx_write_fifo(cs, nr, ptr, cnt)
#include "hscx_irq.c" #include "hscx_irq.c"
...@@ -188,7 +190,7 @@ avm_a1p_interrupt(int intno, void *dev_id, struct pt_regs *regs) ...@@ -188,7 +190,7 @@ avm_a1p_interrupt(int intno, void *dev_id, struct pt_regs *regs)
if (cs->debug & L1_DEB_INTSTAT) if (cs->debug & L1_DEB_INTSTAT)
debugl1(cs, "avm IntStatus %x", sval); debugl1(cs, "avm IntStatus %x", sval);
if (sval & ASL0_R_HSCX) { if (sval & ASL0_R_HSCX) {
val = ReadHSCX(cs, 1, HSCX_ISTA); val = hscx_read(cs, 1, HSCX_ISTA);
if (val) if (val)
hscx_int_main(cs, val); hscx_int_main(cs, val);
} }
...@@ -198,12 +200,12 @@ avm_a1p_interrupt(int intno, void *dev_id, struct pt_regs *regs) ...@@ -198,12 +200,12 @@ avm_a1p_interrupt(int intno, void *dev_id, struct pt_regs *regs)
isac_interrupt(cs, val); isac_interrupt(cs, val);
} }
} }
WriteHSCX(cs, 0, HSCX_MASK, 0xff); hscx_write(cs, 0, HSCX_MASK, 0xFF);
WriteHSCX(cs, 1, HSCX_MASK, 0xff); hscx_write(cs, 1, HSCX_MASK, 0xFF);
isac_write(cs, ISAC_MASK, 0xff); isac_write(cs, ISAC_MASK, 0xFF);
isac_write(cs, ISAC_MASK, 0x00); isac_write(cs, ISAC_MASK, 0x0);
WriteHSCX(cs, 0, HSCX_MASK, 0x00); hscx_write(cs, 0, HSCX_MASK, 0x0);
WriteHSCX(cs, 1, HSCX_MASK, 0x00); hscx_write(cs, 1, HSCX_MASK, 0x0);
spin_unlock(&cs->lock); spin_unlock(&cs->lock);
} }
......
...@@ -122,20 +122,34 @@ static struct dc_hw_ops ipac_dc_ops = { ...@@ -122,20 +122,34 @@ static struct dc_hw_ops ipac_dc_ops = {
}; };
static u8 static u8
ReadHSCX(struct IsdnCardState *cs, int hscx, u8 offset) hscx_read(struct IsdnCardState *cs, int hscx, u8 offset)
{ {
return readreg(cs, offset + (hscx ? 0x40 : 0)); return readreg(cs, offset + (hscx ? 0x40 : 0));
} }
static void static void
WriteHSCX(struct IsdnCardState *cs, int hscx, u8 offset, u8 value) hscx_write(struct IsdnCardState *cs, int hscx, u8 offset, u8 value)
{ {
writereg(cs, offset + (hscx ? 0x40 : 0), value); writereg(cs, offset + (hscx ? 0x40 : 0), value);
} }
static void
hscx_read_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
readfifo(cs, hscx ? 0x40 : 0, data, size);
}
static void
hscx_write_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
writefifo(cs, hscx ? 0x40 : 0, data, size);
}
static struct bc_hw_ops hscx_ops = { static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX, .read_reg = hscx_read,
.write_reg = WriteHSCX, .write_reg = hscx_write,
.read_fifo = hscx_read_fifo,
.write_fifo = hscx_write_fifo,
}; };
/* Set the specific ipac to active */ /* Set the specific ipac to active */
......
...@@ -204,22 +204,36 @@ static struct dc_hw_ops ipac_dc_ops = { ...@@ -204,22 +204,36 @@ static struct dc_hw_ops ipac_dc_ops = {
}; };
static u8 static u8
ReadHSCX(struct IsdnCardState *cs, int hscx, u8 offset) hscx_read(struct IsdnCardState *cs, int hscx, u8 offset)
{ {
return(readreg(cs->hw.diva.hscx_adr, return readreg(cs->hw.diva.hscx_adr, cs->hw.diva.hscx,
cs->hw.diva.hscx, offset + (hscx ? 0x40 : 0))); offset + (hscx ? 0x40 : 0));
} }
static void static void
WriteHSCX(struct IsdnCardState *cs, int hscx, u8 offset, u8 value) hscx_write(struct IsdnCardState *cs, int hscx, u8 offset, u8 value)
{ {
writereg(cs->hw.diva.hscx_adr, writereg(cs->hw.diva.hscx_adr, cs->hw.diva.hscx,
cs->hw.diva.hscx, offset + (hscx ? 0x40 : 0), value); offset + (hscx ? 0x40 : 0), value);
}
static void
hscx_read_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
readfifo(cs->hw.diva.hscx_adr, cs->hw.diva.hscx, hscx ? 0x40 : 0, data, size);
}
static void
hscx_write_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
writefifo(cs->hw.diva.hscx_adr, cs->hw.diva.hscx, hscx ? 0x40 : 0, data, size);
} }
static struct bc_hw_ops hscx_ops = { static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX, .read_reg = hscx_read,
.write_reg = WriteHSCX, .write_reg = hscx_write,
.read_fifo = hscx_read_fifo,
.write_fifo = hscx_write_fifo,
}; };
static u8 static u8
...@@ -256,20 +270,20 @@ static struct dc_hw_ops mem_ipac_dc_ops = { ...@@ -256,20 +270,20 @@ static struct dc_hw_ops mem_ipac_dc_ops = {
}; };
static u8 static u8
MemReadHSCX(struct IsdnCardState *cs, int hscx, u8 offset) mem_hscx_read(struct IsdnCardState *cs, int hscx, u8 offset)
{ {
return(memreadreg(cs->hw.diva.cfg_reg, offset + (hscx ? 0x40 : 0))); return memreadreg(cs->hw.diva.cfg_reg, offset + (hscx ? 0x40 : 0));
} }
static void static void
MemWriteHSCX(struct IsdnCardState *cs, int hscx, u8 offset, u8 value) mem_hscx_write(struct IsdnCardState *cs, int hscx, u8 offset, u8 value)
{ {
memwritereg(cs->hw.diva.cfg_reg, offset + (hscx ? 0x40 : 0), value); memwritereg(cs->hw.diva.cfg_reg, offset + (hscx ? 0x40 : 0), value);
} }
static struct bc_hw_ops mem_hscx_ops = { static struct bc_hw_ops mem_hscx_ops = {
.read_reg = MemReadHSCX, .read_reg = mem_hscx_read,
.write_reg = MemWriteHSCX, .write_reg = mem_hscx_write,
}; };
/* IO-Functions for IPACX type cards */ /* IO-Functions for IPACX type cards */
...@@ -307,22 +321,22 @@ static struct dc_hw_ops ipacx_dc_ops = { ...@@ -307,22 +321,22 @@ static struct dc_hw_ops ipacx_dc_ops = {
}; };
static u8 static u8
MemReadHSCX_IPACX(struct IsdnCardState *cs, int hscx, u8 offset) ipacx_bc_read(struct IsdnCardState *cs, int hscx, u8 offset)
{ {
return(memreadreg(cs->hw.diva.cfg_reg, offset + return memreadreg(cs->hw.diva.cfg_reg, offset +
(hscx ? IPACX_OFF_B2 : IPACX_OFF_B1))); (hscx ? IPACX_OFF_B2 : IPACX_OFF_B1));
} }
static void static void
MemWriteHSCX_IPACX(struct IsdnCardState *cs, int hscx, u8 offset, u8 value) ipacx_bc_write(struct IsdnCardState *cs, int hscx, u8 offset, u8 value)
{ {
memwritereg(cs->hw.diva.cfg_reg, offset + memwritereg(cs->hw.diva.cfg_reg, offset +
(hscx ? IPACX_OFF_B2 : IPACX_OFF_B1), value); (hscx ? IPACX_OFF_B2 : IPACX_OFF_B1), value);
} }
static struct bc_hw_ops mem_ipacx_bc_ops = { static struct bc_hw_ops ipacx_bc_ops = {
.read_reg = MemReadHSCX_IPACX, .read_reg = ipacx_bc_read,
.write_reg = MemWriteHSCX_IPACX, .write_reg = ipacx_bc_write,
}; };
/* /*
...@@ -422,7 +436,7 @@ MemwaitforCEC(struct IsdnCardState *cs, int hscx) ...@@ -422,7 +436,7 @@ MemwaitforCEC(struct IsdnCardState *cs, int hscx)
{ {
int to = 50; int to = 50;
while ((MemReadHSCX(cs, hscx, HSCX_STAR) & 0x04) && to) { while ((mem_hscx_read(cs, hscx, HSCX_STAR) & 0x04) && to) {
udelay(1); udelay(1);
to--; to--;
} }
...@@ -436,7 +450,7 @@ MemwaitforXFW(struct IsdnCardState *cs, int hscx) ...@@ -436,7 +450,7 @@ MemwaitforXFW(struct IsdnCardState *cs, int hscx)
{ {
int to = 50; int to = 50;
while ((!(MemReadHSCX(cs, hscx, HSCX_STAR) & 0x44) == 0x40) && to) { while ((!(mem_hscx_read(cs, hscx, HSCX_STAR) & 0x44) == 0x40) && to) {
udelay(1); udelay(1);
to--; to--;
} }
...@@ -451,7 +465,7 @@ MemWriteHSCXCMDR(struct IsdnCardState *cs, int hscx, u8 data) ...@@ -451,7 +465,7 @@ MemWriteHSCXCMDR(struct IsdnCardState *cs, int hscx, u8 data)
spin_lock_irqsave(&diva_lock, flags); spin_lock_irqsave(&diva_lock, flags);
MemwaitforCEC(cs, hscx); MemwaitforCEC(cs, hscx);
MemWriteHSCX(cs, hscx, HSCX_CMDR, data); mem_hscx_write(cs, hscx, HSCX_CMDR, data);
spin_unlock_irqrestore(&diva_lock, flags); spin_unlock_irqrestore(&diva_lock, flags);
} }
...@@ -524,7 +538,7 @@ Memhscx_interrupt(struct IsdnCardState *cs, u8 val, u8 hscx) ...@@ -524,7 +538,7 @@ Memhscx_interrupt(struct IsdnCardState *cs, u8 val, u8 hscx)
return; return;
if (val & 0x80) { /* RME */ if (val & 0x80) { /* RME */
r = MemReadHSCX(cs, hscx, HSCX_RSTA); r = mem_hscx_read(cs, hscx, HSCX_RSTA);
if ((r & 0xf0) != 0xa0) { if ((r & 0xf0) != 0xa0) {
if (!(r & 0x80)) if (!(r & 0x80))
if (cs->debug & L1_DEB_WARN) if (cs->debug & L1_DEB_WARN)
...@@ -538,7 +552,7 @@ Memhscx_interrupt(struct IsdnCardState *cs, u8 val, u8 hscx) ...@@ -538,7 +552,7 @@ Memhscx_interrupt(struct IsdnCardState *cs, u8 val, u8 hscx)
debugl1(cs, "HSCX CRC error"); debugl1(cs, "HSCX CRC error");
MemWriteHSCXCMDR(cs, hscx, 0x80); MemWriteHSCXCMDR(cs, hscx, 0x80);
} else { } else {
count = MemReadHSCX(cs, hscx, HSCX_RBCL) & ( count = mem_hscx_read(cs, hscx, HSCX_RBCL) & (
test_bit(HW_IPAC, &cs->HW_Flags)? 0x3f: 0x1f); test_bit(HW_IPAC, &cs->HW_Flags)? 0x3f: 0x1f);
if (count == 0) if (count == 0)
count = fifo_size; count = fifo_size;
...@@ -591,7 +605,7 @@ Memhscx_int_main(struct IsdnCardState *cs, u8 val) ...@@ -591,7 +605,7 @@ Memhscx_int_main(struct IsdnCardState *cs, u8 val)
if (val & 0x01) { // EXB if (val & 0x01) { // EXB
bcs = cs->bcs + 1; bcs = cs->bcs + 1;
exval = MemReadHSCX(cs, 1, HSCX_EXIR); exval = mem_hscx_read(cs, 1, HSCX_EXIR);
if (exval & 0x40) { if (exval & 0x40) {
if (cs->debug & L1_DEB_HSCX) if (cs->debug & L1_DEB_HSCX)
debugl1(cs, "HSCX B EXIR %x", exval); debugl1(cs, "HSCX B EXIR %x", exval);
...@@ -605,7 +619,7 @@ Memhscx_int_main(struct IsdnCardState *cs, u8 val) ...@@ -605,7 +619,7 @@ Memhscx_int_main(struct IsdnCardState *cs, u8 val)
} }
if (val & 0x02) { // EXA if (val & 0x02) { // EXA
bcs = cs->bcs; bcs = cs->bcs;
exval = MemReadHSCX(cs, 0, HSCX_EXIR); exval = mem_hscx_read(cs, 0, HSCX_EXIR);
if (exval & 0x40) { if (exval & 0x40) {
if (cs->debug & L1_DEB_HSCX) if (cs->debug & L1_DEB_HSCX)
debugl1(cs, "HSCX A EXIR %x", exval); debugl1(cs, "HSCX A EXIR %x", exval);
...@@ -613,7 +627,7 @@ Memhscx_int_main(struct IsdnCardState *cs, u8 val) ...@@ -613,7 +627,7 @@ Memhscx_int_main(struct IsdnCardState *cs, u8 val)
} }
} }
if (val & 0x04) { // ICA if (val & 0x04) { // ICA
exval = MemReadHSCX(cs, 0, HSCX_ISTA); exval = mem_hscx_read(cs, 0, HSCX_ISTA);
if (cs->debug & L1_DEB_HSCX) if (cs->debug & L1_DEB_HSCX)
debugl1(cs, "HSCX A interrupt %x", exval); debugl1(cs, "HSCX A interrupt %x", exval);
Memhscx_interrupt(cs, exval, 0); Memhscx_interrupt(cs, exval, 0);
...@@ -1123,7 +1137,7 @@ setup_diva(struct IsdnCard *card) ...@@ -1123,7 +1137,7 @@ setup_diva(struct IsdnCard *card)
printk(KERN_INFO "Diva: IPAC version %x\n", val); printk(KERN_INFO "Diva: IPAC version %x\n", val);
} else if (cs->subtyp == DIVA_IPACX_PCI) { } else if (cs->subtyp == DIVA_IPACX_PCI) {
cs->dc_hw_ops = &ipacx_dc_ops; cs->dc_hw_ops = &ipacx_dc_ops;
cs->bc_hw_ops = &mem_ipacx_bc_ops; cs->bc_hw_ops = &ipacx_bc_ops;
cs->BC_Send_Data = &ipacx_fill_fifo; cs->BC_Send_Data = &ipacx_fill_fifo;
cs->irq_func = &diva_irq_ipacx_pci; cs->irq_func = &diva_irq_ipacx_pci;
printk(KERN_INFO "Diva: IPACX Design Id: %x\n", printk(KERN_INFO "Diva: IPACX Design Id: %x\n",
......
...@@ -251,33 +251,47 @@ static struct dc_hw_ops ipac_dc_ops = { ...@@ -251,33 +251,47 @@ static struct dc_hw_ops ipac_dc_ops = {
}; };
static u8 static u8
ReadHSCX(struct IsdnCardState *cs, int hscx, u8 offset) hscx_read(struct IsdnCardState *cs, int hscx, u8 offset)
{ {
return readreg(cs, cs->hw.elsa.hscx, offset + (hscx ? 0x40 : 0)); return readreg(cs, cs->hw.elsa.hscx, offset + (hscx ? 0x40 : 0));
} }
static void static void
WriteHSCX(struct IsdnCardState *cs, int hscx, u8 offset, u8 value) hscx_write(struct IsdnCardState *cs, int hscx, u8 offset, u8 value)
{ {
writereg(cs, cs->hw.elsa.hscx, offset + (hscx ? 0x40 : 0), value); writereg(cs, cs->hw.elsa.hscx, offset + (hscx ? 0x40 : 0), value);
} }
static void
hscx_read_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
writefifo(cs, cs->hw.elsa.hscx, hscx ? 0x40 : 0, data, size);
}
static void
hscx_write_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
writefifo(cs, cs->hw.elsa.hscx, hscx ? 0x40 : 0, data, size);
}
static struct bc_hw_ops hscx_ops = { static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX, .read_reg = hscx_read,
.write_reg = WriteHSCX, .write_reg = hscx_write,
.read_fifo = hscx_read_fifo,
.write_fifo = hscx_write_fifo,
}; };
static inline u8 static inline u8
readitac(struct IsdnCardState *cs, u8 off) readitac(struct IsdnCardState *cs, u8 off)
{ {
register u8 ret; u8 ret;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&elsa_lock, flags); spin_lock_irqsave(&elsa_lock, flags);
byteout(cs->hw.elsa.ale, off); byteout(cs->hw.elsa.ale, off);
ret = bytein(cs->hw.elsa.itac); ret = bytein(cs->hw.elsa.itac);
spin_unlock_irqrestore(&elsa_lock, flags); spin_unlock_irqrestore(&elsa_lock, flags);
return (ret); return ret;
} }
static inline void static inline void
......
...@@ -180,84 +180,86 @@ static struct dc_hw_ops isac_ops = { ...@@ -180,84 +180,86 @@ static struct dc_hw_ops isac_ops = {
.write_fifo = isac_write_fifo, .write_fifo = isac_write_fifo,
}; };
static void static u8
ReadHSCXfifo(struct IsdnCardState *cs, int hscx, u8 * data, int size) hscx_read(struct IsdnCardState *cs, int hscx, u8 offset)
{ {
u_short off2 = offset;
switch (cs->subtyp) { switch (cs->subtyp) {
case R647: case R647:
off2 = ((off2 << 8 & 0xf000) | (off2 & 0xf));
case R685: case R685:
read_fifo(cs->hw.gazel.hscxfifo[hscx], data, size); return readreg(cs->hw.gazel.hscx[hscx], off2);
break;
case R753: case R753:
case R742: case R742:
read_fifo_ipac(cs, hscx * 0x40, data, size); return readreg_ipac(cs, hscx * 0x40 + off2);
break;
} }
return 0;
} }
static void static void
WriteHSCXfifo(struct IsdnCardState *cs, int hscx, u8 * data, int size) hscx_write(struct IsdnCardState *cs, int hscx, u8 offset, u8 value)
{ {
u_short off2 = offset;
switch (cs->subtyp) { switch (cs->subtyp) {
case R647: case R647:
off2 = ((off2 << 8 & 0xf000) | (off2 & 0xf));
case R685: case R685:
write_fifo(cs->hw.gazel.hscxfifo[hscx], data, size); writereg(cs->hw.gazel.hscx[hscx], off2, value);
break; break;
case R753: case R753:
case R742: case R742:
write_fifo_ipac(cs, hscx * 0x40, data, size); writereg_ipac(cs, hscx * 0x40 + off2, value);
break; break;
} }
} }
static u8 static void
ReadHSCX(struct IsdnCardState *cs, int hscx, u8 offset) hscx_read_fifo(struct IsdnCardState *cs, int hscx, u8 * data, int size)
{ {
u_short off2 = offset;
switch (cs->subtyp) { switch (cs->subtyp) {
case R647: case R647:
off2 = ((off2 << 8 & 0xf000) | (off2 & 0xf));
case R685: case R685:
return readreg(cs->hw.gazel.hscx[hscx], off2); read_fifo(cs->hw.gazel.hscxfifo[hscx], data, size);
break;
case R753: case R753:
case R742: case R742:
return readreg_ipac(cs, hscx * 0x40 + off2); read_fifo_ipac(cs, hscx * 0x40, data, size);
break;
} }
return 0;
} }
static void static void
WriteHSCX(struct IsdnCardState *cs, int hscx, u8 offset, u8 value) hscx_write_fifo(struct IsdnCardState *cs, int hscx, u8 * data, int size)
{ {
u_short off2 = offset;
switch (cs->subtyp) { switch (cs->subtyp) {
case R647: case R647:
off2 = ((off2 << 8 & 0xf000) | (off2 & 0xf));
case R685: case R685:
writereg(cs->hw.gazel.hscx[hscx], off2, value); write_fifo(cs->hw.gazel.hscxfifo[hscx], data, size);
break; break;
case R753: case R753:
case R742: case R742:
writereg_ipac(cs, hscx * 0x40 + off2, value); write_fifo_ipac(cs, hscx * 0x40, data, size);
break; break;
} }
} }
static struct bc_hw_ops hscx_ops = { static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX, .read_reg = hscx_read,
.write_reg = WriteHSCX, .write_reg = hscx_write,
.read_fifo = hscx_read_fifo,
.write_fifo = hscx_write_fifo,
}; };
/* /*
* fast interrupt HSCX stuff goes here * fast interrupt HSCX stuff goes here
*/ */
#define READHSCX(cs, nr, reg) ReadHSCX(cs, nr, reg) #define READHSCX(cs, nr, reg) hscx_read(cs, nr, reg)
#define WRITEHSCX(cs, nr, reg, data) WriteHSCX(cs, nr, reg, data) #define WRITEHSCX(cs, nr, reg, data) hscx_write(cs, nr, reg, data)
#define READHSCXFIFO(cs, nr, ptr, cnt) ReadHSCXfifo(cs, nr, ptr, cnt) #define READHSCXFIFO(cs, nr, ptr, cnt) hscx_read_fifo(cs, nr, ptr, cnt)
#define WRITEHSCXFIFO(cs, nr, ptr, cnt) WriteHSCXfifo(cs, nr, ptr, cnt) #define WRITEHSCXFIFO(cs, nr, ptr, cnt) hscx_write_fifo(cs, nr, ptr, cnt)
#include "hscx_irq.c" #include "hscx_irq.c"
...@@ -271,7 +273,7 @@ gazel_interrupt(int intno, void *dev_id, struct pt_regs *regs) ...@@ -271,7 +273,7 @@ gazel_interrupt(int intno, void *dev_id, struct pt_regs *regs)
spin_lock(&cs->lock); spin_lock(&cs->lock);
do { do {
valhscx = ReadHSCX(cs, 1, HSCX_ISTA); valhscx = hscx_read(cs, 1, HSCX_ISTA);
if (valhscx) if (valhscx)
hscx_int_main(cs, valhscx); hscx_int_main(cs, valhscx);
valisac = isac_read(cs, ISAC_ISTA); valisac = isac_read(cs, ISAC_ISTA);
...@@ -280,12 +282,12 @@ gazel_interrupt(int intno, void *dev_id, struct pt_regs *regs) ...@@ -280,12 +282,12 @@ gazel_interrupt(int intno, void *dev_id, struct pt_regs *regs)
count++; count++;
} while ((valhscx || valisac) && (count < MAXCOUNT)); } while ((valhscx || valisac) && (count < MAXCOUNT));
WriteHSCX(cs, 0, HSCX_MASK, 0xFF); hscx_write(cs, 0, HSCX_MASK, 0xFF);
WriteHSCX(cs, 1, HSCX_MASK, 0xFF); hscx_write(cs, 1, HSCX_MASK, 0xFF);
isac_write(cs, ISAC_MASK, 0xFF); isac_write(cs, ISAC_MASK, 0xFF);
isac_write(cs, ISAC_MASK, 0x0); isac_write(cs, ISAC_MASK, 0x0);
WriteHSCX(cs, 0, HSCX_MASK, 0x0); hscx_write(cs, 0, HSCX_MASK, 0x0);
WriteHSCX(cs, 1, HSCX_MASK, 0x0); hscx_write(cs, 1, HSCX_MASK, 0x0);
spin_unlock(&cs->lock); spin_unlock(&cs->lock);
} }
...@@ -304,7 +306,7 @@ gazel_interrupt_ipac(int intno, void *dev_id, struct pt_regs *regs) ...@@ -304,7 +306,7 @@ gazel_interrupt_ipac(int intno, void *dev_id, struct pt_regs *regs)
ista = readreg_ipac(cs, IPAC_ISTA); ista = readreg_ipac(cs, IPAC_ISTA);
do { do {
if (ista & 0x0f) { if (ista & 0x0f) {
val = ReadHSCX(cs, 1, HSCX_ISTA); val = hscx_read(cs, 1, HSCX_ISTA);
if (ista & 0x01) if (ista & 0x01)
val |= 0x01; val |= 0x01;
if (ista & 0x04) if (ista & 0x04)
......
...@@ -351,8 +351,10 @@ struct l3_process { ...@@ -351,8 +351,10 @@ struct l3_process {
struct IsdnCardState; struct IsdnCardState;
struct bc_hw_ops { struct bc_hw_ops {
u8 (*read_reg) (struct IsdnCardState *, int, u8); u8 (*read_reg) (struct IsdnCardState *, int, u8);
void (*write_reg) (struct IsdnCardState *, int, u8, u8); void (*write_reg) (struct IsdnCardState *, int, u8, u8);
void (*read_fifo) (struct IsdnCardState *, int, u8 *, int);
void (*write_fifo) (struct IsdnCardState *, int, u8 *, int);
}; };
struct hscx_hw { struct hscx_hw {
......
...@@ -41,7 +41,7 @@ waitforXFW(struct IsdnCardState *cs, int hscx) ...@@ -41,7 +41,7 @@ waitforXFW(struct IsdnCardState *cs, int hscx)
} }
static inline void static inline void
WriteHSCXCMDR(struct IsdnCardState *cs, int hscx, u8 data) hscx_writeCMDR(struct IsdnCardState *cs, int hscx, u8 data)
{ {
waitforCEC(cs, hscx); waitforCEC(cs, hscx);
WRITEHSCX(cs, hscx, HSCX_CMDR, data); WRITEHSCX(cs, hscx, HSCX_CMDR, data);
...@@ -60,14 +60,14 @@ hscx_empty_fifo(struct BCState *bcs, int count) ...@@ -60,14 +60,14 @@ hscx_empty_fifo(struct BCState *bcs, int count)
if (bcs->hw.hscx.rcvidx + count > HSCX_BUFMAX) { if (bcs->hw.hscx.rcvidx + count > HSCX_BUFMAX) {
if (cs->debug & L1_DEB_WARN) if (cs->debug & L1_DEB_WARN)
debugl1(cs, "hscx_empty_fifo: incoming packet too large"); debugl1(cs, "hscx_empty_fifo: incoming packet too large");
WriteHSCXCMDR(cs, bcs->hw.hscx.hscx, 0x80); hscx_writeCMDR(cs, bcs->hw.hscx.hscx, 0x80);
bcs->hw.hscx.rcvidx = 0; bcs->hw.hscx.rcvidx = 0;
return; return;
} }
ptr = bcs->hw.hscx.rcvbuf + bcs->hw.hscx.rcvidx; ptr = bcs->hw.hscx.rcvbuf + bcs->hw.hscx.rcvidx;
bcs->hw.hscx.rcvidx += count; bcs->hw.hscx.rcvidx += count;
READHSCXFIFO(cs, bcs->hw.hscx.hscx, ptr, count); READHSCXFIFO(cs, bcs->hw.hscx.hscx, ptr, count);
WriteHSCXCMDR(cs, bcs->hw.hscx.hscx, 0x80); hscx_writeCMDR(cs, bcs->hw.hscx.hscx, 0x80);
if (cs->debug & L1_DEB_HSCX_FIFO) { if (cs->debug & L1_DEB_HSCX_FIFO) {
char *t = bcs->blog; char *t = bcs->blog;
...@@ -107,7 +107,7 @@ hscx_fill_fifo(struct BCState *bcs) ...@@ -107,7 +107,7 @@ hscx_fill_fifo(struct BCState *bcs)
bcs->tx_cnt -= count; bcs->tx_cnt -= count;
bcs->count += count; bcs->count += count;
WRITEHSCXFIFO(cs, bcs->hw.hscx.hscx, ptr, count); WRITEHSCXFIFO(cs, bcs->hw.hscx.hscx, ptr, count);
WriteHSCXCMDR(cs, bcs->hw.hscx.hscx, more ? 0x8 : 0xa); hscx_writeCMDR(cs, bcs->hw.hscx.hscx, more ? 0x8 : 0xa);
if (cs->debug & L1_DEB_HSCX_FIFO) { if (cs->debug & L1_DEB_HSCX_FIFO) {
char *t = bcs->blog; char *t = bcs->blog;
...@@ -155,7 +155,7 @@ hscx_interrupt(struct IsdnCardState *cs, u8 val, u8 hscx) ...@@ -155,7 +155,7 @@ hscx_interrupt(struct IsdnCardState *cs, u8 val, u8 hscx)
bcs->err_crc++; bcs->err_crc++;
#endif #endif
} }
WriteHSCXCMDR(cs, hscx, 0x80); hscx_writeCMDR(cs, hscx, 0x80);
} else { } else {
count = READHSCX(cs, hscx, HSCX_RBCL) & ( count = READHSCX(cs, hscx, HSCX_RBCL) & (
test_bit(HW_IPAC, &cs->HW_Flags)? 0x3f: 0x1f); test_bit(HW_IPAC, &cs->HW_Flags)? 0x3f: 0x1f);
...@@ -198,7 +198,7 @@ hscx_interrupt(struct IsdnCardState *cs, u8 val, u8 hscx) ...@@ -198,7 +198,7 @@ hscx_interrupt(struct IsdnCardState *cs, u8 val, u8 hscx)
static void static void
reset_xmit(struct BCState *bcs) reset_xmit(struct BCState *bcs)
{ {
WriteHSCXCMDR(bcs->cs, bcs->hw.hscx.hscx, 0x01); hscx_writeCMDR(bcs->cs, bcs->hw.hscx.hscx, 0x01);
} }
static inline void static inline void
......
...@@ -119,20 +119,34 @@ static struct dc_hw_ops isac_ops = { ...@@ -119,20 +119,34 @@ static struct dc_hw_ops isac_ops = {
}; };
static u8 static u8
ReadHSCX(struct IsdnCardState *cs, int hscx, u8 offset) hscx_read(struct IsdnCardState *cs, int hscx, u8 offset)
{ {
return readreg(cs, cs->hw.ix1.hscx, offset + (hscx ? 0x40 : 0)); return readreg(cs, cs->hw.ix1.hscx, offset + (hscx ? 0x40 : 0));
} }
static void static void
WriteHSCX(struct IsdnCardState *cs, int hscx, u8 offset, u8 value) hscx_write(struct IsdnCardState *cs, int hscx, u8 offset, u8 value)
{ {
writereg(cs, cs->hw.ix1.hscx, offset + (hscx ? 0x40 : 0), value); writereg(cs, cs->hw.ix1.hscx, offset + (hscx ? 0x40 : 0), value);
} }
static void
hscx_read_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
readfifo(cs, cs->hw.ix1.hscx, hscx ? 0x40 : 0, data, size);
}
static void
hscx_write_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
writefifo(cs, cs->hw.ix1.hscx, hscx ? 0x40 : 0, data, size);
}
static struct bc_hw_ops hscx_ops = { static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX, .read_reg = hscx_read,
.write_reg = WriteHSCX, .write_reg = hscx_write,
.read_fifo = hscx_read_fifo,
.write_fifo = hscx_write_fifo,
}; };
#define READHSCX(cs, nr, reg) readreg(cs, \ #define READHSCX(cs, nr, reg) readreg(cs, \
......
...@@ -110,22 +110,36 @@ static struct dc_hw_ops isac_ops = { ...@@ -110,22 +110,36 @@ static struct dc_hw_ops isac_ops = {
}; };
static u8 static u8
ReadHSCX(struct IsdnCardState *cs, int hscx, u8 offset) hscx_read(struct IsdnCardState *cs, int hscx, u8 offset)
{ {
return readreg(cs, cs->hw.mic.hscx, offset + (hscx ? 0x40 : 0)); return readreg(cs, cs->hw.mic.hscx, offset + (hscx ? 0x40 : 0));
} }
static void static void
WriteHSCX(struct IsdnCardState *cs, int hscx, u8 offset, u8 value) hscx_write(struct IsdnCardState *cs, int hscx, u8 offset, u8 value)
{ {
writereg(cs, cs->hw.mic.hscx, offset + (hscx ? 0x40 : 0), value); writereg(cs, cs->hw.mic.hscx, offset + (hscx ? 0x40 : 0), value);
} }
static void
hscx_read_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
readfifo(cs, cs->hw.mic.hscx, hscx ? 0x40 : 0, data, size);
}
static void
hscx_write_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
writefifo(cs, cs->hw.mic.hscx, hscx ? 0x40 : 0, data, size);
}
static struct bc_hw_ops hscx_ops = { static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX, .read_reg = hscx_read,
.write_reg = WriteHSCX, .write_reg = hscx_write,
.read_fifo = hscx_read_fifo,
.write_fifo = hscx_write_fifo,
}; };
/* /*
* fast interrupt HSCX stuff goes here * fast interrupt HSCX stuff goes here
*/ */
......
...@@ -125,24 +125,40 @@ static struct dc_hw_ops isac_ops = { ...@@ -125,24 +125,40 @@ static struct dc_hw_ops isac_ops = {
}; };
static u8 static u8
ReadHSCX(struct IsdnCardState *cs, int hscx, u8 offset) hscx_read(struct IsdnCardState *cs, int hscx, u8 offset)
{ {
return (readreg(cs->hw.niccy.hscx_ale, return readreg(cs->hw.niccy.hscx_ale,
cs->hw.niccy.hscx, offset + (hscx ? 0x40 : 0))); cs->hw.niccy.hscx, offset + (hscx ? 0x40 : 0));
} }
static void static void
WriteHSCX(struct IsdnCardState *cs, int hscx, u8 offset, u8 value) hscx_write(struct IsdnCardState *cs, int hscx, u8 offset, u8 value)
{ {
writereg(cs->hw.niccy.hscx_ale, writereg(cs->hw.niccy.hscx_ale,
cs->hw.niccy.hscx, offset + (hscx ? 0x40 : 0), value); cs->hw.niccy.hscx, offset + (hscx ? 0x40 : 0), value);
} }
static void
hscx_read_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
readfifo(cs->hw.niccy.hscx_ale, cs->hw.niccy.hscx,
hscx ? 0x40 : 0, data, size);
}
static void
hscx_write_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
writefifo(cs->hw.niccy.hscx_ale, cs->hw.niccy.hscx,
hscx ? 0x40 : 0, data, size);
}
static struct bc_hw_ops hscx_ops = { static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX, .read_reg = hscx_read,
.write_reg = WriteHSCX, .write_reg = hscx_write,
.read_fifo = hscx_read_fifo,
.write_fifo = hscx_write_fifo,
}; };
#define READHSCX(cs, nr, reg) readreg(cs->hw.niccy.hscx_ale, \ #define READHSCX(cs, nr, reg) readreg(cs->hw.niccy.hscx_ale, \
cs->hw.niccy.hscx, reg + (nr ? 0x40 : 0)) cs->hw.niccy.hscx, reg + (nr ? 0x40 : 0))
#define WRITEHSCX(cs, nr, reg, data) writereg(cs->hw.niccy.hscx_ale, \ #define WRITEHSCX(cs, nr, reg, data) writereg(cs->hw.niccy.hscx_ale, \
......
...@@ -136,22 +136,36 @@ static struct dc_hw_ops isac_ops = { ...@@ -136,22 +136,36 @@ static struct dc_hw_ops isac_ops = {
}; };
static u8 static u8
ReadHSCX(struct IsdnCardState *cs, int hscx, u8 offset) hscx_read(struct IsdnCardState *cs, int hscx, u8 offset)
{ {
return readreg(cs, cs->hw.teles3.hscx[hscx], offset); return readreg(cs, cs->hw.teles3.hscx[hscx], offset);
} }
static void static void
WriteHSCX(struct IsdnCardState *cs, int hscx, u8 offset, u8 value) hscx_write(struct IsdnCardState *cs, int hscx, u8 offset, u8 value)
{ {
writereg(cs, cs->hw.teles3.hscx[hscx], offset, value); writereg(cs, cs->hw.teles3.hscx[hscx], offset, value);
} }
static void
hscx_read_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
read_fifo(cs, cs->hw.teles3.hscxfifo[hscx], data, size);
}
static void
hscx_write_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
write_fifo(cs, cs->hw.teles3.hscxfifo[hscx], data, size);
}
static struct bc_hw_ops hscx_ops = { static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX, .read_reg = hscx_read,
.write_reg = WriteHSCX, .write_reg = hscx_write,
.read_fifo = hscx_read_fifo,
.write_fifo = hscx_write_fifo,
}; };
/* /*
* fast interrupt HSCX stuff goes here * fast interrupt HSCX stuff goes here
*/ */
......
...@@ -110,22 +110,36 @@ static struct dc_hw_ops isac_ops = { ...@@ -110,22 +110,36 @@ static struct dc_hw_ops isac_ops = {
}; };
static u8 static u8
ReadHSCX(struct IsdnCardState *cs, int hscx, u8 offset) hscx_read(struct IsdnCardState *cs, int hscx, u8 offset)
{ {
return readreg(cs, cs->hw.saphir.hscx, offset + (hscx ? 0x40 : 0)); return readreg(cs, cs->hw.saphir.hscx, offset + (hscx ? 0x40 : 0));
} }
static void static void
WriteHSCX(struct IsdnCardState *cs, int hscx, u8 offset, u8 value) hscx_write(struct IsdnCardState *cs, int hscx, u8 offset, u8 value)
{ {
writereg(cs, cs->hw.saphir.hscx, offset + (hscx ? 0x40 : 0), value); writereg(cs, cs->hw.saphir.hscx, offset + (hscx ? 0x40 : 0), value);
} }
static void
hscx_read_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
readfifo(cs, cs->hw.saphir.hscx, hscx ? 0x40 : 0, data, size);
}
static void
hscx_write_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
writefifo(cs, cs->hw.saphir.hscx, hscx ? 0x40 : 0, data, size);
}
static struct bc_hw_ops hscx_ops = { static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX, .read_reg = hscx_read,
.write_reg = WriteHSCX, .write_reg = hscx_write,
.read_fifo = hscx_read_fifo,
.write_fifo = hscx_write_fifo,
}; };
#define READHSCX(cs, nr, reg) readreg(cs, \ #define READHSCX(cs, nr, reg) readreg(cs, \
cs->hw.saphir.hscx, reg + (nr ? 0x40 : 0)) cs->hw.saphir.hscx, reg + (nr ? 0x40 : 0))
#define WRITEHSCX(cs, nr, reg, data) writereg(cs, \ #define WRITEHSCX(cs, nr, reg, data) writereg(cs, \
......
...@@ -228,20 +228,34 @@ static struct dc_hw_ops ipac_dc_ops = { ...@@ -228,20 +228,34 @@ static struct dc_hw_ops ipac_dc_ops = {
}; };
static u8 static u8
ReadHSCX(struct IsdnCardState *cs, int hscx, u8 offset) hscx_read(struct IsdnCardState *cs, int hscx, u8 offset)
{ {
return readreg(cs, cs->hw.sedl.hscx, offset + (hscx ? 0x40 : 0)); return readreg(cs, cs->hw.sedl.hscx, offset + (hscx ? 0x40 : 0));
} }
static void static void
WriteHSCX(struct IsdnCardState *cs, int hscx, u8 offset, u8 value) hscx_write(struct IsdnCardState *cs, int hscx, u8 offset, u8 value)
{ {
writereg(cs, cs->hw.sedl.hscx, offset + (hscx ? 0x40 : 0), value); writereg(cs, cs->hw.sedl.hscx, offset + (hscx ? 0x40 : 0), value);
} }
static void
hscx_read_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
readfifo(cs, cs->hw.sedl.hscx, hscx ? 0x40 : 0, data, size);
}
static void
hscx_write_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
writefifo(cs, cs->hw.sedl.hscx, hscx ? 0x40 : 0, data, size);
}
static struct bc_hw_ops hscx_ops = { static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX, .read_reg = hscx_read,
.write_reg = WriteHSCX, .write_reg = hscx_write,
.read_fifo = hscx_read_fifo,
.write_fifo = hscx_write_fifo,
}; };
/* ISAR access routines /* ISAR access routines
...@@ -251,30 +265,32 @@ static struct bc_hw_ops hscx_ops = { ...@@ -251,30 +265,32 @@ static struct bc_hw_ops hscx_ops = {
*/ */
static u8 static u8
ReadISAR(struct IsdnCardState *cs, int mode, u8 offset) isar_read(struct IsdnCardState *cs, int mode, u8 offset)
{ {
if (mode == 0) if (mode == 0)
return readreg(cs, cs->hw.sedl.hscx, offset); return readreg(cs, cs->hw.sedl.hscx, offset);
else if (mode == 1)
if (mode == 1)
byteout(cs->hw.sedl.adr, offset); byteout(cs->hw.sedl.adr, offset);
return(bytein(cs->hw.sedl.hscx));
return bytein(cs->hw.sedl.hscx);
} }
static void static void
WriteISAR(struct IsdnCardState *cs, int mode, u8 offset, u8 value) isar_write(struct IsdnCardState *cs, int mode, u8 offset, u8 value)
{ {
if (mode == 0) if (mode == 0)
writereg(cs, cs->hw.sedl.hscx, offset, value); return writereg(cs, cs->hw.sedl.hscx, offset, value);
else {
if (mode == 1) if (mode == 1)
byteout(cs->hw.sedl.adr, offset); byteout(cs->hw.sedl.adr, offset);
byteout(cs->hw.sedl.hscx, value);
} byteout(cs->hw.sedl.hscx, value);
} }
static struct bc_hw_ops isar_ops = { static struct bc_hw_ops isar_ops = {
.read_reg = ReadISAR, .read_reg = isar_read,
.write_reg = WriteISAR, .write_reg = isar_write,
}; };
/* /*
......
...@@ -81,20 +81,34 @@ static struct dc_hw_ops isac_ops = { ...@@ -81,20 +81,34 @@ static struct dc_hw_ops isac_ops = {
}; };
static u8 static u8
ReadHSCX(struct IsdnCardState *cs, int hscx, u8 offset) hscx_read(struct IsdnCardState *cs, int hscx, u8 offset)
{ {
return (bytein(calc_off(cs->hw.spt.hscx[hscx], offset))); return bytein(calc_off(cs->hw.spt.hscx[hscx], offset));
} }
static void static void
WriteHSCX(struct IsdnCardState *cs, int hscx, u8 offset, u8 value) hscx_write(struct IsdnCardState *cs, int hscx, u8 offset, u8 value)
{ {
byteout(calc_off(cs->hw.spt.hscx[hscx], offset), value); byteout(calc_off(cs->hw.spt.hscx[hscx], offset), value);
} }
static void
hscx_read_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
read_fifo(cs->hw.spt.hscx[hscx], data, size);
}
static void
hscx_write_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
write_fifo(cs->hw.spt.hscx[hscx], data, size);
}
static struct bc_hw_ops hscx_ops = { static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX, .read_reg = hscx_read,
.write_reg = WriteHSCX, .write_reg = hscx_write,
.read_fifo = hscx_read_fifo,
.write_fifo = hscx_write_fifo,
}; };
/* /*
......
...@@ -70,64 +70,54 @@ static struct dc_hw_ops isac_ops = { ...@@ -70,64 +70,54 @@ static struct dc_hw_ops isac_ops = {
.write_fifo = isac_write_fifo, .write_fifo = isac_write_fifo,
}; };
static inline u8 static u8
readhscx(unsigned long adr, int hscx, u8 off) hscx_read(struct IsdnCardState *cs, int hscx, u8 off)
{ {
return readb(adr + (hscx ? 0x1c0 : 0x180) + return readb(cs->hw.teles0.membase + (hscx ? 0x1c0 : 0x180) +
((off & 1) ? 0x1ff : 0) + off); ((off & 1) ? 0x1ff : 0) + off);
} }
static inline void static void
writehscx(unsigned long adr, int hscx, u8 off, u8 data) hscx_write(struct IsdnCardState *cs, int hscx, u8 off, u8 data)
{ {
writeb(data, adr + (hscx ? 0x1c0 : 0x180) + writeb(data, cs->hw.teles0.membase + (hscx ? 0x1c0 : 0x180) +
((off & 1) ? 0x1ff : 0) + off); mb(); ((off & 1) ? 0x1ff : 0) + off); mb();
} }
static inline void static void
read_fifo_hscx(unsigned long adr, int hscx, u8 * data, int size) hscx_read_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{ {
register int i; int i;
register u8 *ad = (u8 *) (adr + (hscx ? 0x1c0 : 0x180)); unsigned long ad = cs->hw.teles0.membase + (hscx ? 0x1c0 : 0x180);
for (i = 0; i < size; i++) for (i = 0; i < size; i++)
data[i] = readb(ad); data[i] = readb(ad);
} }
static inline void static void
write_fifo_hscx(unsigned long adr, int hscx, u8 * data, int size) hscx_write_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{ {
int i; int i;
register u8 *ad = (u8 *) (adr + (hscx ? 0x1c0 : 0x180)); unsigned long ad = cs->hw.teles0.membase + (hscx ? 0x1c0 : 0x180);
for (i = 0; i < size; i++) { for (i = 0; i < size; i++) {
writeb(data[i], ad); mb(); writeb(data[i], ad);
} }
} }
static u8
ReadHSCX(struct IsdnCardState *cs, int hscx, u8 offset)
{
return (readhscx(cs->hw.teles0.membase, hscx, offset));
}
static void
WriteHSCX(struct IsdnCardState *cs, int hscx, u8 offset, u8 value)
{
writehscx(cs->hw.teles0.membase, hscx, offset, value);
}
static struct bc_hw_ops hscx_ops = { static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX, .read_reg = hscx_read,
.write_reg = WriteHSCX, .write_reg = hscx_write,
.read_fifo = hscx_read_fifo,
.write_fifo = hscx_write_fifo,
}; };
/* /*
* fast interrupt HSCX stuff goes here * fast interrupt HSCX stuff goes here
*/ */
#define READHSCX(cs, nr, reg) readhscx(cs->hw.teles0.membase, nr, reg) #define READHSCX(cs, nr, reg) hscx_read(cs, nr, reg)
#define WRITEHSCX(cs, nr, reg, data) writehscx(cs->hw.teles0.membase, nr, reg, data) #define WRITEHSCX(cs, nr, reg, data) hscx_write(cs, nr, reg, data)
#define READHSCXFIFO(cs, nr, ptr, cnt) read_fifo_hscx(cs->hw.teles0.membase, nr, ptr, cnt) #define READHSCXFIFO(cs, nr, ptr, cnt) hscx_read_fifo(cs, nr, ptr, cnt)
#define WRITEHSCXFIFO(cs, nr, ptr, cnt) write_fifo_hscx(cs->hw.teles0.membase, nr, ptr, cnt) #define WRITEHSCXFIFO(cs, nr, ptr, cnt) hscx_write_fifo(cs, nr, ptr, cnt)
#include "hscx_irq.c" #include "hscx_irq.c"
...@@ -139,7 +129,7 @@ teles0_interrupt(int intno, void *dev_id, struct pt_regs *regs) ...@@ -139,7 +129,7 @@ teles0_interrupt(int intno, void *dev_id, struct pt_regs *regs)
int count = 0; int count = 0;
spin_lock(&cs->lock); spin_lock(&cs->lock);
val = readhscx(cs->hw.teles0.membase, 1, HSCX_ISTA); val = hscx_read(cs, 1, HSCX_ISTA);
Start_HSCX: Start_HSCX:
if (val) if (val)
hscx_int_main(cs, val); hscx_int_main(cs, val);
...@@ -148,7 +138,7 @@ teles0_interrupt(int intno, void *dev_id, struct pt_regs *regs) ...@@ -148,7 +138,7 @@ teles0_interrupt(int intno, void *dev_id, struct pt_regs *regs)
if (val) if (val)
isac_interrupt(cs, val); isac_interrupt(cs, val);
count++; count++;
val = readhscx(cs->hw.teles0.membase, 1, HSCX_ISTA); val = hscx_read(cs, 1, HSCX_ISTA);
if (val && count < 5) { if (val && count < 5) {
if (cs->debug & L1_DEB_HSCX) if (cs->debug & L1_DEB_HSCX)
debugl1(cs, "HSCX IntStat after IntRoutine"); debugl1(cs, "HSCX IntStat after IntRoutine");
...@@ -160,12 +150,12 @@ teles0_interrupt(int intno, void *dev_id, struct pt_regs *regs) ...@@ -160,12 +150,12 @@ teles0_interrupt(int intno, void *dev_id, struct pt_regs *regs)
debugl1(cs, "ISAC IntStat after IntRoutine"); debugl1(cs, "ISAC IntStat after IntRoutine");
goto Start_ISAC; goto Start_ISAC;
} }
writehscx(cs->hw.teles0.membase, 0, HSCX_MASK, 0xFF); hscx_write(cs, 0, HSCX_MASK, 0xFF);
writehscx(cs->hw.teles0.membase, 1, HSCX_MASK, 0xFF); hscx_write(cs, 1, HSCX_MASK, 0xFF);
isac_write(cs, ISAC_MASK, 0xFF); isac_write(cs, ISAC_MASK, 0xFF);
isac_write(cs, ISAC_MASK, 0x0); isac_write(cs, ISAC_MASK, 0x0);
writehscx(cs->hw.teles0.membase, 0, HSCX_MASK, 0x0); hscx_write(cs, 0, HSCX_MASK, 0x0);
writehscx(cs->hw.teles0.membase, 1, HSCX_MASK, 0x0); hscx_write(cs, 1, HSCX_MASK, 0x0);
spin_unlock(&cs->lock); spin_unlock(&cs->lock);
} }
......
...@@ -83,20 +83,34 @@ static struct dc_hw_ops isac_ops = { ...@@ -83,20 +83,34 @@ static struct dc_hw_ops isac_ops = {
}; };
static u8 static u8
ReadHSCX(struct IsdnCardState *cs, int hscx, u8 offset) hscx_read(struct IsdnCardState *cs, int hscx, u8 offset)
{ {
return (readreg(cs->hw.teles3.hscx[hscx], offset)); return readreg(cs->hw.teles3.hscx[hscx], offset);
} }
static void static void
WriteHSCX(struct IsdnCardState *cs, int hscx, u8 offset, u8 value) hscx_write(struct IsdnCardState *cs, int hscx, u8 offset, u8 value)
{ {
writereg(cs->hw.teles3.hscx[hscx], offset, value); writereg(cs->hw.teles3.hscx[hscx], offset, value);
} }
static void
hscx_read_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
read_fifo(cs->hw.teles3.hscxfifo[hscx], data, size);
}
static void
hscx_write_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
write_fifo(cs->hw.teles3.hscxfifo[hscx], data, size);
}
static struct bc_hw_ops hscx_ops = { static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX, .read_reg = hscx_read,
.write_reg = WriteHSCX, .write_reg = hscx_write,
.read_fifo = hscx_read_fifo,
.write_fifo = hscx_write_fifo,
}; };
/* /*
......
...@@ -39,23 +39,23 @@ const char *telespci_revision = "$Revision: 2.16.6.5 $"; ...@@ -39,23 +39,23 @@ const char *telespci_revision = "$Revision: 2.16.6.5 $";
#define WRITE_DATA_HSCX (ZORAN_PO_WR | ZORAN_PO_GID1 | ZORAN_PO_GREG1) #define WRITE_DATA_HSCX (ZORAN_PO_WR | ZORAN_PO_GID1 | ZORAN_PO_GREG1)
#define ZORAN_WAIT_NOBUSY do { \ #define ZORAN_WAIT_NOBUSY do { \
portdata = readl(adr + 0x200); \ portdata = readl(adr); \
} while (portdata & ZORAN_PO_RQ_PEN) } while (portdata & ZORAN_PO_RQ_PEN)
static u8 static u8
isac_read(struct IsdnCardState *cs, u8 off) isac_read(struct IsdnCardState *cs, u8 off)
{ {
unsigned long adr = cs->hw.teles0.membase; unsigned long adr = cs->hw.teles0.membase + 0x200;
unsigned int portdata; unsigned int portdata;
ZORAN_WAIT_NOBUSY; ZORAN_WAIT_NOBUSY;
/* set address for ISAC */ /* set address for ISAC */
writel(WRITE_ADDR_ISAC | off, adr + 0x200); writel(WRITE_ADDR_ISAC | off, adr);
ZORAN_WAIT_NOBUSY; ZORAN_WAIT_NOBUSY;
/* read data from ISAC */ /* read data from ISAC */
writel(READ_DATA_ISAC, adr + 0x200); writel(READ_DATA_ISAC, adr);
ZORAN_WAIT_NOBUSY; ZORAN_WAIT_NOBUSY;
return((u8)(portdata & ZORAN_PO_DMASK)); return((u8)(portdata & ZORAN_PO_DMASK));
} }
...@@ -63,24 +63,24 @@ isac_read(struct IsdnCardState *cs, u8 off) ...@@ -63,24 +63,24 @@ isac_read(struct IsdnCardState *cs, u8 off)
static void static void
isac_write(struct IsdnCardState *cs, u8 off, u8 data) isac_write(struct IsdnCardState *cs, u8 off, u8 data)
{ {
unsigned long adr = cs->hw.teles0.membase; unsigned long adr = cs->hw.teles0.membase + 0x200;
unsigned int portdata; unsigned int portdata;
ZORAN_WAIT_NOBUSY; ZORAN_WAIT_NOBUSY;
/* set address for ISAC */ /* set address for ISAC */
writel(WRITE_ADDR_ISAC | off, adr + 0x200); writel(WRITE_ADDR_ISAC | off, adr);
ZORAN_WAIT_NOBUSY; ZORAN_WAIT_NOBUSY;
/* write data to ISAC */ /* write data to ISAC */
writel(WRITE_DATA_ISAC | data, adr + 0x200); writel(WRITE_DATA_ISAC | data, adr);
ZORAN_WAIT_NOBUSY; ZORAN_WAIT_NOBUSY;
} }
static void static void
isac_read_fifo(struct IsdnCardState *cs, u8 *data, int size) isac_read_fifo(struct IsdnCardState *cs, u8 *data, int size)
{ {
unsigned long adr = cs->hw.teles0.membase; unsigned long adr = cs->hw.teles0.membase + 0x200;
unsigned int portdata; unsigned int portdata;
int i; int i;
...@@ -90,7 +90,7 @@ isac_read_fifo(struct IsdnCardState *cs, u8 *data, int size) ...@@ -90,7 +90,7 @@ isac_read_fifo(struct IsdnCardState *cs, u8 *data, int size)
/* set address for ISAC fifo */ /* set address for ISAC fifo */
writel(WRITE_ADDR_ISAC | 0x1E, adr); writel(WRITE_ADDR_ISAC | 0x1E, adr);
ZORAN_WAIT_NOBUSY; ZORAN_WAIT_NOBUSY;
writel(READ_DATA_ISAC, adr + 0x200); writel(READ_DATA_ISAC, adr);
ZORAN_WAIT_NOBUSY; ZORAN_WAIT_NOBUSY;
data[i] = (u8)(portdata & ZORAN_PO_DMASK); data[i] = (u8)(portdata & ZORAN_PO_DMASK);
} }
...@@ -99,7 +99,7 @@ isac_read_fifo(struct IsdnCardState *cs, u8 *data, int size) ...@@ -99,7 +99,7 @@ isac_read_fifo(struct IsdnCardState *cs, u8 *data, int size)
static void static void
isac_write_fifo(struct IsdnCardState *cs, u8 *data, int size) isac_write_fifo(struct IsdnCardState *cs, u8 *data, int size)
{ {
unsigned long adr = cs->hw.teles0.membase; unsigned long adr = cs->hw.teles0.membase + 0x200;
unsigned int portdata; unsigned int portdata;
int i; int i;
...@@ -109,7 +109,7 @@ isac_write_fifo(struct IsdnCardState *cs, u8 *data, int size) ...@@ -109,7 +109,7 @@ isac_write_fifo(struct IsdnCardState *cs, u8 *data, int size)
/* set address for ISAC fifo */ /* set address for ISAC fifo */
writel(WRITE_ADDR_ISAC | 0x1E, adr); writel(WRITE_ADDR_ISAC | 0x1E, adr);
ZORAN_WAIT_NOBUSY; ZORAN_WAIT_NOBUSY;
writel(WRITE_DATA_ISAC | data[i], adr + 0x200); writel(WRITE_DATA_ISAC | data[i], adr);
ZORAN_WAIT_NOBUSY; ZORAN_WAIT_NOBUSY;
} }
} }
...@@ -121,98 +121,92 @@ static struct dc_hw_ops isac_ops = { ...@@ -121,98 +121,92 @@ static struct dc_hw_ops isac_ops = {
.write_fifo = isac_write_fifo, .write_fifo = isac_write_fifo,
}; };
static inline u8 static u8
readhscx(unsigned long adr, int hscx, u8 off) hscx_read(struct IsdnCardState *cs, int hscx, u8 off)
{ {
register unsigned int portdata; unsigned long adr = cs->hw.teles0.membase + 0x200;
unsigned int portdata;
ZORAN_WAIT_NOBUSY; ZORAN_WAIT_NOBUSY;
/* set address for HSCX */ /* set address for HSCX */
writel(WRITE_ADDR_HSCX | ((hscx ? 0x40:0) + off), adr + 0x200); writel(WRITE_ADDR_HSCX | ((hscx ? 0x40:0) + off), adr);
ZORAN_WAIT_NOBUSY; ZORAN_WAIT_NOBUSY;
/* read data from HSCX */ /* read data from HSCX */
writel(READ_DATA_HSCX, adr + 0x200); writel(READ_DATA_HSCX, adr);
ZORAN_WAIT_NOBUSY; ZORAN_WAIT_NOBUSY;
return ((u8)(portdata & ZORAN_PO_DMASK)); return ((u8)(portdata & ZORAN_PO_DMASK));
} }
static inline void static void
writehscx(unsigned long adr, int hscx, u8 off, u8 data) hscx_write(struct IsdnCardState *cs, int hscx, u8 off, u8 data)
{ {
register unsigned int portdata; unsigned long adr = cs->hw.teles0.membase + 0x200;
unsigned int portdata;
ZORAN_WAIT_NOBUSY; ZORAN_WAIT_NOBUSY;
/* set address for HSCX */ /* set address for HSCX */
writel(WRITE_ADDR_HSCX | ((hscx ? 0x40:0) + off), adr + 0x200); writel(WRITE_ADDR_HSCX | ((hscx ? 0x40:0) + off), adr);
ZORAN_WAIT_NOBUSY; ZORAN_WAIT_NOBUSY;
/* write data to HSCX */ /* write data to HSCX */
writel(WRITE_DATA_HSCX | data, adr + 0x200); writel(WRITE_DATA_HSCX | data, adr);
ZORAN_WAIT_NOBUSY; ZORAN_WAIT_NOBUSY;
} }
static inline void static void
read_fifo_hscx(unsigned long adr, int hscx, u8 * data, int size) hscx_read_fifo(struct IsdnCardState *cs, int hscx, u8 * data, int size)
{ {
register unsigned int portdata; unsigned long adr = cs->hw.teles0.membase + 0x200;
register int i; unsigned int portdata;
int i;
ZORAN_WAIT_NOBUSY; ZORAN_WAIT_NOBUSY;
/* read data from HSCX */ /* read data from HSCX */
for (i = 0; i < size; i++) { for (i = 0; i < size; i++) {
/* set address for HSCX fifo */ /* set address for HSCX fifo */
writel(WRITE_ADDR_HSCX |(hscx ? 0x5F:0x1F), adr + 0x200); writel(WRITE_ADDR_HSCX |(hscx ? 0x5F:0x1F), adr);
ZORAN_WAIT_NOBUSY; ZORAN_WAIT_NOBUSY;
writel(READ_DATA_HSCX, adr + 0x200); writel(READ_DATA_HSCX, adr);
ZORAN_WAIT_NOBUSY; ZORAN_WAIT_NOBUSY;
data[i] = (u8) (portdata & ZORAN_PO_DMASK); data[i] = (u8) (portdata & ZORAN_PO_DMASK);
} }
} }
static inline void static void
write_fifo_hscx(unsigned long adr, int hscx, u8 * data, int size) hscx_write_fifo(struct IsdnCardState *cs, int hscx, u8 * data, int size)
{ {
unsigned long adr = cs->hw.teles0.membase + 0x200;
unsigned int portdata; unsigned int portdata;
register int i; int i;
ZORAN_WAIT_NOBUSY; ZORAN_WAIT_NOBUSY;
/* write data to HSCX */ /* write data to HSCX */
for (i = 0; i < size; i++) { for (i = 0; i < size; i++) {
/* set address for HSCX fifo */ /* set address for HSCX fifo */
writel(WRITE_ADDR_HSCX |(hscx ? 0x5F:0x1F), adr + 0x200); writel(WRITE_ADDR_HSCX |(hscx ? 0x5F:0x1F), adr);
ZORAN_WAIT_NOBUSY; ZORAN_WAIT_NOBUSY;
writel(WRITE_DATA_HSCX | data[i], adr + 0x200); writel(WRITE_DATA_HSCX | data[i], adr);
ZORAN_WAIT_NOBUSY; ZORAN_WAIT_NOBUSY;
udelay(10); udelay(10);
} }
} }
static u8
ReadHSCX(struct IsdnCardState *cs, int hscx, u8 offset)
{
return (readhscx(cs->hw.teles0.membase, hscx, offset));
}
static void
WriteHSCX(struct IsdnCardState *cs, int hscx, u8 offset, u8 value)
{
writehscx(cs->hw.teles0.membase, hscx, offset, value);
}
static struct bc_hw_ops hscx_ops = { static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX, .read_reg = hscx_read,
.write_reg = WriteHSCX, .write_reg = hscx_write,
.read_fifo = hscx_read_fifo,
.write_fifo = hscx_write_fifo,
}; };
/* /*
* fast interrupt HSCX stuff goes here * fast interrupt HSCX stuff goes here
*/ */
#define READHSCX(cs, nr, reg) readhscx(cs->hw.teles0.membase, nr, reg) #define READHSCX(cs, nr, reg) hscx_read(cs, nr, reg)
#define WRITEHSCX(cs, nr, reg, data) writehscx(cs->hw.teles0.membase, nr, reg, data) #define WRITEHSCX(cs, nr, reg, data) hscx_write(cs, nr, reg, data)
#define READHSCXFIFO(cs, nr, ptr, cnt) read_fifo_hscx(cs->hw.teles0.membase, nr, ptr, cnt) #define READHSCXFIFO(cs, nr, ptr, cnt) hscx_read_fifo(cs, nr, ptr, cnt)
#define WRITEHSCXFIFO(cs, nr, ptr, cnt) write_fifo_hscx(cs->hw.teles0.membase, nr, ptr, cnt) #define WRITEHSCXFIFO(cs, nr, ptr, cnt) hscx_write_fifo(cs, nr, ptr, cnt)
#include "hscx_irq.c" #include "hscx_irq.c"
...@@ -224,7 +218,7 @@ telespci_interrupt(int intno, void *dev_id, struct pt_regs *regs) ...@@ -224,7 +218,7 @@ telespci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
u8 val; u8 val;
spin_lock(&cs->lock); spin_lock(&cs->lock);
val = readhscx(cs->hw.teles0.membase, 1, HSCX_ISTA); val = hscx_read(cs, 1, HSCX_ISTA);
if (val) if (val)
hscx_int_main(cs, val); hscx_int_main(cs, val);
val = isac_read(cs, ISAC_ISTA); val = isac_read(cs, ISAC_ISTA);
...@@ -233,12 +227,12 @@ telespci_interrupt(int intno, void *dev_id, struct pt_regs *regs) ...@@ -233,12 +227,12 @@ telespci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
/* Clear interrupt register for Zoran PCI controller */ /* Clear interrupt register for Zoran PCI controller */
writel(0x70000000, cs->hw.teles0.membase + 0x3C); writel(0x70000000, cs->hw.teles0.membase + 0x3C);
writehscx(cs->hw.teles0.membase, 0, HSCX_MASK, 0xFF); hscx_write(cs, 0, HSCX_MASK, 0xFF);
writehscx(cs->hw.teles0.membase, 1, HSCX_MASK, 0xFF); hscx_write(cs, 1, HSCX_MASK, 0xFF);
isac_write(cs, ISAC_MASK, 0xFF); isac_write(cs, ISAC_MASK, 0xFF);
isac_write(cs, ISAC_MASK, 0x0); isac_write(cs, ISAC_MASK, 0x0);
writehscx(cs->hw.teles0.membase, 0, HSCX_MASK, 0x0); hscx_write(cs, 0, HSCX_MASK, 0x0);
writehscx(cs->hw.teles0.membase, 1, HSCX_MASK, 0x0); hscx_write(cs, 1, HSCX_MASK, 0x0);
spin_unlock(&cs->lock); spin_unlock(&cs->lock);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment