diff options
Diffstat (limited to 'drivers/isdn/hisax/avm_a1p.c')
-rw-r--r-- | drivers/isdn/hisax/avm_a1p.c | 152 |
1 files changed, 76 insertions, 76 deletions
diff --git a/drivers/isdn/hisax/avm_a1p.c b/drivers/isdn/hisax/avm_a1p.c index 3039c6d..3934719 100644 --- a/drivers/isdn/hisax/avm_a1p.c +++ b/drivers/isdn/hisax/avm_a1p.c @@ -39,7 +39,7 @@ #define ASL0_R_ISAC 0x20 /* active low */ #define ASL0_R_HSCX 0x40 /* active low */ #define ASL0_R_TESTBIT 0x80 -#define ASL0_R_IRQPENDING (ASL0_R_ISAC|ASL0_R_HSCX|ASL0_R_TIMER) +#define ASL0_R_IRQPENDING (ASL0_R_ISAC | ASL0_R_HSCX | ASL0_R_TIMER) /* write bits ASL0 */ #define ASL0_W_RESET 0x01 @@ -52,8 +52,8 @@ #define ASL1_W_LED0 0x10 #define ASL1_W_LED1 0x20 #define ASL1_W_ENABLE_S0 0xC0 - -#define byteout(addr,val) outb(val,addr) + +#define byteout(addr, val) outb(val, addr) #define bytein(addr) inb(addr) static const char *avm_revision = "$Revision: 2.9.2.5 $"; @@ -61,34 +61,34 @@ static const char *avm_revision = "$Revision: 2.9.2.5 $"; static inline u_char ReadISAC(struct IsdnCardState *cs, u_char offset) { - u_char ret; + u_char ret; - offset -= 0x20; - byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET,ISAC_REG_OFFSET+offset); - ret = bytein(cs->hw.avm.cfg_reg+DATAREG_OFFSET); + offset -= 0x20; + byteout(cs->hw.avm.cfg_reg + ADDRREG_OFFSET, ISAC_REG_OFFSET + offset); + ret = bytein(cs->hw.avm.cfg_reg + DATAREG_OFFSET); return ret; } static inline void WriteISAC(struct IsdnCardState *cs, u_char offset, u_char value) { - offset -= 0x20; - byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET,ISAC_REG_OFFSET+offset); - byteout(cs->hw.avm.cfg_reg+DATAREG_OFFSET, value); + offset -= 0x20; + byteout(cs->hw.avm.cfg_reg + ADDRREG_OFFSET, ISAC_REG_OFFSET + offset); + byteout(cs->hw.avm.cfg_reg + DATAREG_OFFSET, value); } static inline void -ReadISACfifo(struct IsdnCardState *cs, u_char * data, int size) +ReadISACfifo(struct IsdnCardState *cs, u_char *data, int size) { - byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET,ISAC_FIFO_OFFSET); - insb(cs->hw.avm.cfg_reg+DATAREG_OFFSET, data, size); + byteout(cs->hw.avm.cfg_reg + ADDRREG_OFFSET, ISAC_FIFO_OFFSET); + insb(cs->hw.avm.cfg_reg + DATAREG_OFFSET, data, size); } static inline void -WriteISACfifo(struct IsdnCardState *cs, u_char * data, int size) +WriteISACfifo(struct IsdnCardState *cs, u_char *data, int size) { - byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET,ISAC_FIFO_OFFSET); - outsb(cs->hw.avm.cfg_reg+DATAREG_OFFSET, data, size); + byteout(cs->hw.avm.cfg_reg + ADDRREG_OFFSET, ISAC_FIFO_OFFSET); + outsb(cs->hw.avm.cfg_reg + DATAREG_OFFSET, data, size); } static inline u_char @@ -96,36 +96,36 @@ ReadHSCX(struct IsdnCardState *cs, int hscx, u_char offset) { u_char ret; - offset -= 0x20; - byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET, - HSCX_REG_OFFSET+hscx*HSCX_CH_DIFF+offset); - ret = bytein(cs->hw.avm.cfg_reg+DATAREG_OFFSET); + offset -= 0x20; + byteout(cs->hw.avm.cfg_reg + ADDRREG_OFFSET, + HSCX_REG_OFFSET + hscx * HSCX_CH_DIFF + offset); + ret = bytein(cs->hw.avm.cfg_reg + DATAREG_OFFSET); return ret; } static inline void WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value) { - offset -= 0x20; - byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET, - HSCX_REG_OFFSET+hscx*HSCX_CH_DIFF+offset); - byteout(cs->hw.avm.cfg_reg+DATAREG_OFFSET, value); + offset -= 0x20; + byteout(cs->hw.avm.cfg_reg + ADDRREG_OFFSET, + HSCX_REG_OFFSET + hscx * HSCX_CH_DIFF + offset); + byteout(cs->hw.avm.cfg_reg + DATAREG_OFFSET, value); } static inline void -ReadHSCXfifo(struct IsdnCardState *cs, int hscx, u_char * data, int size) +ReadHSCXfifo(struct IsdnCardState *cs, int hscx, u_char *data, int size) { - byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET, - HSCX_FIFO_OFFSET+hscx*HSCX_CH_DIFF); - insb(cs->hw.avm.cfg_reg+DATAREG_OFFSET, data, size); + byteout(cs->hw.avm.cfg_reg + ADDRREG_OFFSET, + HSCX_FIFO_OFFSET + hscx * HSCX_CH_DIFF); + insb(cs->hw.avm.cfg_reg + DATAREG_OFFSET, data, size); } static inline void -WriteHSCXfifo(struct IsdnCardState *cs, int hscx, u_char * data, int size) +WriteHSCXfifo(struct IsdnCardState *cs, int hscx, u_char *data, int size) { - byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET, - HSCX_FIFO_OFFSET+hscx*HSCX_CH_DIFF); - outsb(cs->hw.avm.cfg_reg+DATAREG_OFFSET, data, size); + byteout(cs->hw.avm.cfg_reg + ADDRREG_OFFSET, + HSCX_FIFO_OFFSET + hscx * HSCX_CH_DIFF); + outsb(cs->hw.avm.cfg_reg + DATAREG_OFFSET, data, size); } /* @@ -134,7 +134,7 @@ WriteHSCXfifo(struct IsdnCardState *cs, int hscx, u_char * data, int size) #define READHSCX(cs, nr, reg) ReadHSCX(cs, nr, reg) #define WRITEHSCX(cs, nr, reg, data) WriteHSCX(cs, nr, reg, data) -#define READHSCXFIFO(cs, nr, ptr, cnt) ReadHSCXfifo(cs, nr, ptr, cnt) +#define READHSCXFIFO(cs, nr, ptr, cnt) ReadHSCXfifo(cs, nr, ptr, cnt) #define WRITEHSCXFIFO(cs, nr, ptr, cnt) WriteHSCXfifo(cs, nr, ptr, cnt) #include "hscx_irq.c" @@ -147,11 +147,11 @@ avm_a1p_interrupt(int intno, void *dev_id) u_long flags; spin_lock_irqsave(&cs->lock, flags); - while ((sval = (~bytein(cs->hw.avm.cfg_reg+ASL0_OFFSET) & ASL0_R_IRQPENDING))) { + while ((sval = (~bytein(cs->hw.avm.cfg_reg + ASL0_OFFSET) & ASL0_R_IRQPENDING))) { if (cs->debug & L1_DEB_INTSTAT) debugl1(cs, "avm IntStatus %x", sval); if (sval & ASL0_R_HSCX) { - val = ReadHSCX(cs, 1, HSCX_ISTA); + val = ReadHSCX(cs, 1, HSCX_ISTA); if (val) hscx_int_main(cs, val); } @@ -177,38 +177,38 @@ AVM_card_msg(struct IsdnCardState *cs, int mt, void *arg) u_long flags; switch (mt) { - case CARD_RESET: - spin_lock_irqsave(&cs->lock, flags); - byteout(cs->hw.avm.cfg_reg+ASL0_OFFSET,0x00); - HZDELAY(HZ / 5 + 1); - byteout(cs->hw.avm.cfg_reg+ASL0_OFFSET,ASL0_W_RESET); - HZDELAY(HZ / 5 + 1); - byteout(cs->hw.avm.cfg_reg+ASL0_OFFSET,0x00); - spin_unlock_irqrestore(&cs->lock, flags); - return 0; - - case CARD_RELEASE: - /* free_irq is done in HiSax_closecard(). */ - /* free_irq(cs->irq, cs); */ - return 0; - - case CARD_INIT: - spin_lock_irqsave(&cs->lock, flags); - byteout(cs->hw.avm.cfg_reg+ASL0_OFFSET,ASL0_W_TDISABLE|ASL0_W_TRESET|ASL0_W_IRQENABLE); - clear_pending_isac_ints(cs); - clear_pending_hscx_ints(cs); - inithscxisac(cs, 1); - inithscxisac(cs, 2); - spin_unlock_irqrestore(&cs->lock, flags); - return 0; - - case CARD_TEST: - /* we really don't need it for the PCMCIA Version */ - return 0; - - default: - /* all card drivers ignore others, so we do the same */ - return 0; + case CARD_RESET: + spin_lock_irqsave(&cs->lock, flags); + byteout(cs->hw.avm.cfg_reg + ASL0_OFFSET, 0x00); + HZDELAY(HZ / 5 + 1); + byteout(cs->hw.avm.cfg_reg + ASL0_OFFSET, ASL0_W_RESET); + HZDELAY(HZ / 5 + 1); + byteout(cs->hw.avm.cfg_reg + ASL0_OFFSET, 0x00); + spin_unlock_irqrestore(&cs->lock, flags); + return 0; + + case CARD_RELEASE: + /* free_irq is done in HiSax_closecard(). */ + /* free_irq(cs->irq, cs); */ + return 0; + + case CARD_INIT: + spin_lock_irqsave(&cs->lock, flags); + byteout(cs->hw.avm.cfg_reg + ASL0_OFFSET, ASL0_W_TDISABLE | ASL0_W_TRESET | ASL0_W_IRQENABLE); + clear_pending_isac_ints(cs); + clear_pending_hscx_ints(cs); + inithscxisac(cs, 1); + inithscxisac(cs, 2); + spin_unlock_irqrestore(&cs->lock, flags); + return 0; + + case CARD_TEST: + /* we really don't need it for the PCMCIA Version */ + return 0; + + default: + /* all card drivers ignore others, so we do the same */ + return 0; } return 0; } @@ -222,7 +222,7 @@ int __devinit setup_avm_a1_pcmcia(struct IsdnCard *card) strcpy(tmp, avm_revision); printk(KERN_INFO "HiSax: AVM A1 PCMCIA driver Rev. %s\n", - HiSax_getrev(tmp)); + HiSax_getrev(tmp)); if (cs->typ != ISDN_CTYPE_A1_PCMCIA) return (0); @@ -230,20 +230,20 @@ int __devinit setup_avm_a1_pcmcia(struct IsdnCard *card) cs->irq = card->para[0]; - byteout(cs->hw.avm.cfg_reg+ASL1_OFFSET, ASL1_W_ENABLE_S0); - byteout(cs->hw.avm.cfg_reg+ASL0_OFFSET,0x00); + byteout(cs->hw.avm.cfg_reg + ASL1_OFFSET, ASL1_W_ENABLE_S0); + byteout(cs->hw.avm.cfg_reg + ASL0_OFFSET, 0x00); HZDELAY(HZ / 5 + 1); - byteout(cs->hw.avm.cfg_reg+ASL0_OFFSET,ASL0_W_RESET); + byteout(cs->hw.avm.cfg_reg + ASL0_OFFSET, ASL0_W_RESET); HZDELAY(HZ / 5 + 1); - byteout(cs->hw.avm.cfg_reg+ASL0_OFFSET,0x00); + byteout(cs->hw.avm.cfg_reg + ASL0_OFFSET, 0x00); - byteout(cs->hw.avm.cfg_reg+ASL0_OFFSET, ASL0_W_TDISABLE|ASL0_W_TRESET); + byteout(cs->hw.avm.cfg_reg + ASL0_OFFSET, ASL0_W_TDISABLE | ASL0_W_TRESET); - model = bytein(cs->hw.avm.cfg_reg+MODREG_OFFSET); - vers = bytein(cs->hw.avm.cfg_reg+VERREG_OFFSET); + model = bytein(cs->hw.avm.cfg_reg + MODREG_OFFSET); + vers = bytein(cs->hw.avm.cfg_reg + VERREG_OFFSET); printk(KERN_INFO "AVM A1 PCMCIA: io 0x%x irq %d model %d version %d\n", - cs->hw.avm.cfg_reg, cs->irq, model, vers); + cs->hw.avm.cfg_reg, cs->irq, model, vers); setup_isac(cs); cs->readisac = &ReadISAC; |