Lines Matching refs:hw
194 return (readreg(cs->hw.elsa.ale, cs->hw.elsa.isac, offset)); in ReadISAC()
200 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, offset, value); in WriteISAC()
206 readfifo(cs->hw.elsa.ale, cs->hw.elsa.isac, 0, data, size); in ReadISACfifo()
212 writefifo(cs->hw.elsa.ale, cs->hw.elsa.isac, 0, data, size); in WriteISACfifo()
218 return (readreg(cs->hw.elsa.ale, cs->hw.elsa.isac, offset+0x80)); in ReadISAC_IPAC()
224 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, offset|0x80, value); in WriteISAC_IPAC()
230 readfifo(cs->hw.elsa.ale, cs->hw.elsa.isac, 0x80, data, size); in ReadISACfifo_IPAC()
236 writefifo(cs->hw.elsa.ale, cs->hw.elsa.isac, 0x80, data, size); in WriteISACfifo_IPAC()
242 return (readreg(cs->hw.elsa.ale, in ReadHSCX()
243 cs->hw.elsa.hscx, offset + (hscx ? 0x40 : 0))); in ReadHSCX()
249 writereg(cs->hw.elsa.ale, in WriteHSCX()
250 cs->hw.elsa.hscx, offset + (hscx ? 0x40 : 0), value); in WriteHSCX()
261 byteout(cs->hw.elsa.ale, off); in readitac()
262 ret = bytein(cs->hw.elsa.itac); in readitac()
274 byteout(cs->hw.elsa.ale, off); in writeitac()
275 byteout(cs->hw.elsa.itac, data); in writeitac()
284 v = bytein(cs->hw.elsa.cfg); in TimerRun()
295 #define READHSCX(cs, nr, reg) readreg(cs->hw.elsa.ale, \
296 cs->hw.elsa.hscx, reg + (nr ? 0x40 : 0))
297 #define WRITEHSCX(cs, nr, reg, data) writereg(cs->hw.elsa.ale, \
298 cs->hw.elsa.hscx, reg + (nr ? 0x40 : 0), data)
300 #define READHSCXFIFO(cs, nr, ptr, cnt) readfifo(cs->hw.elsa.ale, \
301 cs->hw.elsa.hscx, (nr ? 0x40 : 0), ptr, cnt)
303 #define WRITEHSCXFIFO(cs, nr, ptr, cnt) writefifo(cs->hw.elsa.ale, \
304 cs->hw.elsa.hscx, (nr ? 0x40 : 0), ptr, cnt)
326 if (cs->hw.elsa.MFlag) { in elsa_interrupt()
334 val = readreg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_ISTA + 0x40); in elsa_interrupt()
339 val = readreg(cs->hw.elsa.ale, cs->hw.elsa.isac, ISAC_ISTA); in elsa_interrupt()
344 val = readreg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_ISTA + 0x40); in elsa_interrupt()
351 val = readreg(cs->hw.elsa.ale, cs->hw.elsa.isac, ISAC_ISTA); in elsa_interrupt()
360 writereg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_MASK, 0xFF); in elsa_interrupt()
361 writereg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_MASK + 0x40, 0xFF); in elsa_interrupt()
362 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, ISAC_MASK, 0xFF); in elsa_interrupt()
363 if (cs->hw.elsa.status & ELSA_TIMER_AKTIV) { in elsa_interrupt()
366 byteout(cs->hw.elsa.timer, 0); in elsa_interrupt()
367 cs->hw.elsa.counter++; in elsa_interrupt()
371 if (cs->hw.elsa.MFlag) { in elsa_interrupt()
380 if (cs->hw.elsa.trig) in elsa_interrupt()
381 byteout(cs->hw.elsa.trig, 0x00); in elsa_interrupt()
382 writereg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_MASK, 0x0); in elsa_interrupt()
383 writereg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_MASK + 0x40, 0x0); in elsa_interrupt()
384 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, ISAC_MASK, 0x0); in elsa_interrupt()
399 val = bytein(cs->hw.elsa.cfg + 0x4c); /* PCI IRQ */ in elsa_interrupt_ipac()
404 if (cs->hw.elsa.MFlag) { in elsa_interrupt_ipac()
412 ista = readreg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_ISTA); in elsa_interrupt_ipac()
417 val = readreg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_ISTA + 0x40); in elsa_interrupt_ipac()
428 val = 0xfe & readreg(cs->hw.elsa.ale, cs->hw.elsa.isac, ISAC_ISTA + 0x80); in elsa_interrupt_ipac()
437 ista = readreg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_ISTA); in elsa_interrupt_ipac()
444 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_MASK, 0xFF); in elsa_interrupt_ipac()
445 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_MASK, 0xC0); in elsa_interrupt_ipac()
453 del_timer(&cs->hw.elsa.tl); in release_io_elsa()
457 if (cs->hw.elsa.ctrl) in release_io_elsa()
458 byteout(cs->hw.elsa.ctrl, 0); /* LEDs Out */ in release_io_elsa()
460 byteout(cs->hw.elsa.cfg + 0x4c, 0x01); /* disable IRQ */ in release_io_elsa()
461 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_ATX, 0xff); in release_io_elsa()
463 release_region(cs->hw.elsa.cfg, 0x80); in release_io_elsa()
466 byteout(cs->hw.elsa.cfg + 0x4c, 0x03); /* disable ELSA PCI IRQ */ in release_io_elsa()
467 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_ATX, 0xff); in release_io_elsa()
468 release_region(cs->hw.elsa.cfg, 0x80); in release_io_elsa()
471 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_ATX, 0xff); in release_io_elsa()
482 if (cs->hw.elsa.base) in release_io_elsa()
483 release_region(cs->hw.elsa.base, bytecnt); in release_io_elsa()
491 if (cs->hw.elsa.timer) { in reset_elsa()
493 byteout(cs->hw.elsa.timer, 0); in reset_elsa()
495 cs->hw.elsa.ctrl_reg |= 0x50; in reset_elsa()
496 cs->hw.elsa.ctrl_reg &= ~ELSA_ISDN_RESET; /* Reset On */ in reset_elsa()
497 byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg); in reset_elsa()
499 byteout(cs->hw.elsa.timer, 0); in reset_elsa()
501 cs->hw.elsa.ctrl_reg |= ELSA_ISDN_RESET; /* Reset Off */ in reset_elsa()
502 byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg); in reset_elsa()
504 byteout(cs->hw.elsa.timer, 0); in reset_elsa()
506 if (cs->hw.elsa.trig) in reset_elsa()
507 byteout(cs->hw.elsa.trig, 0xff); in reset_elsa()
512 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_POTA2, 0x20); in reset_elsa()
515 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_POTA2, 0x00); in reset_elsa()
517 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_MASK, 0xc0); in reset_elsa()
521 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_ACFG, 0x0); in reset_elsa()
522 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_AOE, 0x3c); in reset_elsa()
524 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_PCFG, 0x10); in reset_elsa()
525 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_ACFG, 0x4); in reset_elsa()
526 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_AOE, 0xf8); in reset_elsa()
528 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_ATX, 0xff); in reset_elsa()
530 byteout(cs->hw.elsa.cfg + 0x4c, 0x41); /* enable ELSA PCI IRQ */ in reset_elsa()
532 byteout(cs->hw.elsa.cfg + 0x4c, 0x43); /* enable ELSA PCI IRQ */ in reset_elsa()
599 cs->hw.elsa.base+8); in check_arcofi()
600 release_region(cs->hw.elsa.base, 8); in check_arcofi()
601 if (check_region(cs->hw.elsa.base, 16)) { in check_arcofi()
605 cs->hw.elsa.base + 8, in check_arcofi()
606 cs->hw.elsa.base + 16); in check_arcofi()
608 request_region(cs->hw.elsa.base, 16, in check_arcofi()
615 cs->hw.elsa.base+8); in check_arcofi()
616 release_region(cs->hw.elsa.base, 8); in check_arcofi()
617 if (check_region(cs->hw.elsa.base, 16)) { in check_arcofi()
621 cs->hw.elsa.base + 8, in check_arcofi()
622 cs->hw.elsa.base + 16); in check_arcofi()
624 request_region(cs->hw.elsa.base, 16, in check_arcofi()
630 cs->hw.elsa.base+8); in check_arcofi()
646 del_timer(&cs->hw.elsa.tl); in elsa_led_handler()
647 if (cs->hw.elsa.status & ELSA_ASSIGN) in elsa_led_handler()
648 cs->hw.elsa.ctrl_reg |= ELSA_STAT_LED; in elsa_led_handler()
649 else if (cs->hw.elsa.status & ELSA_BAD_PWR) in elsa_led_handler()
650 cs->hw.elsa.ctrl_reg &= ~ELSA_STAT_LED; in elsa_led_handler()
652 cs->hw.elsa.ctrl_reg ^= ELSA_STAT_LED; in elsa_led_handler()
655 if (cs->hw.elsa.status & 0xf000) in elsa_led_handler()
656 cs->hw.elsa.ctrl_reg |= ELSA_LINE_LED; in elsa_led_handler()
657 else if (cs->hw.elsa.status & 0x0f00) { in elsa_led_handler()
658 cs->hw.elsa.ctrl_reg ^= ELSA_LINE_LED; in elsa_led_handler()
661 cs->hw.elsa.ctrl_reg &= ~ELSA_LINE_LED; in elsa_led_handler()
666 if (cs->hw.elsa.ctrl_reg & ELSA_LINE_LED) in elsa_led_handler()
668 if (cs->hw.elsa.ctrl_reg & ELSA_STAT_LED) in elsa_led_handler()
670 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_ATX, led); in elsa_led_handler()
672 byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg); in elsa_led_handler()
674 init_timer(&cs->hw.elsa.tl); in elsa_led_handler()
675 cs->hw.elsa.tl.expires = jiffies + ((blink * HZ) / 1000); in elsa_led_handler()
676 add_timer(&cs->hw.elsa.tl); in elsa_led_handler()
699 byteout(cs->hw.elsa.timer, 0); in Elsa_card_msg()
701 if (cs->hw.elsa.trig) in Elsa_card_msg()
702 byteout(cs->hw.elsa.trig, 0xff); in Elsa_card_msg()
714 cs->hw.elsa.counter = 0; in Elsa_card_msg()
716 cs->hw.elsa.ctrl_reg |= ELSA_ENA_TIMER_INT; in Elsa_card_msg()
717 cs->hw.elsa.status |= ELSA_TIMER_AKTIV; in Elsa_card_msg()
718 byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg); in Elsa_card_msg()
719 byteout(cs->hw.elsa.timer, 0); in Elsa_card_msg()
723 cs->hw.elsa.ctrl_reg &= ~ELSA_ENA_TIMER_INT; in Elsa_card_msg()
724 byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg); in Elsa_card_msg()
725 cs->hw.elsa.status &= ~ELSA_TIMER_AKTIV; in Elsa_card_msg()
727 cs->hw.elsa.counter); in Elsa_card_msg()
728 if ((cs->hw.elsa.counter > 10) && in Elsa_card_msg()
729 (cs->hw.elsa.counter < 16)) { in Elsa_card_msg()
735 cs->hw.elsa.counter, cs->irq); in Elsa_card_msg()
747 cs->hw.elsa.status &= 0; in Elsa_card_msg()
750 cs->hw.elsa.status |= ELSA_ASSIGN; in Elsa_card_msg()
754 cs->hw.elsa.status |= 0x0200; in Elsa_card_msg()
756 cs->hw.elsa.status |= 0x0100; in Elsa_card_msg()
760 cs->hw.elsa.status |= 0x2000; in Elsa_card_msg()
762 cs->hw.elsa.status |= 0x1000; in Elsa_card_msg()
766 cs->hw.elsa.status &= ~0x2000; in Elsa_card_msg()
767 cs->hw.elsa.status &= ~0x0200; in Elsa_card_msg()
769 cs->hw.elsa.status &= ~0x1000; in Elsa_card_msg()
770 cs->hw.elsa.status &= ~0x0100; in Elsa_card_msg()
775 if (cs->hw.elsa.MFlag) { in Elsa_card_msg()
790 int pwr = bytein(cs->hw.elsa.ale); in Elsa_card_msg()
792 cs->hw.elsa.status |= ELSA_BAD_PWR; in Elsa_card_msg()
794 cs->hw.elsa.status &= ~ELSA_BAD_PWR; in Elsa_card_msg()
893 cs->hw.elsa.ctrl_reg = 0; in setup_elsa()
894 cs->hw.elsa.status = 0; in setup_elsa()
895 cs->hw.elsa.MFlag = 0; in setup_elsa()
898 cs->hw.elsa.base = card->para[0]; in setup_elsa()
900 if (cs->hw.elsa.base) { in setup_elsa()
901 if (!(cs->subtyp = probe_elsa_adr(cs->hw.elsa.base, in setup_elsa()
905 cs->hw.elsa.base); in setup_elsa()
909 cs->hw.elsa.base = probe_elsa(cs); in setup_elsa()
910 if (cs->hw.elsa.base) { in setup_elsa()
911 cs->hw.elsa.cfg = cs->hw.elsa.base + ELSA_CONFIG; in setup_elsa()
912 cs->hw.elsa.ctrl = cs->hw.elsa.base + ELSA_CONTROL; in setup_elsa()
913 cs->hw.elsa.ale = cs->hw.elsa.base + ELSA_ALE; in setup_elsa()
914 cs->hw.elsa.isac = cs->hw.elsa.base + ELSA_ISAC; in setup_elsa()
915 cs->hw.elsa.itac = cs->hw.elsa.base + ELSA_ITAC; in setup_elsa()
916 cs->hw.elsa.hscx = cs->hw.elsa.base + ELSA_HSCX; in setup_elsa()
917 cs->hw.elsa.trig = cs->hw.elsa.base + ELSA_TRIG_IRQ; in setup_elsa()
918 cs->hw.elsa.timer = cs->hw.elsa.base + ELSA_START_TIMER; in setup_elsa()
919 val = bytein(cs->hw.elsa.cfg); in setup_elsa()
933 val = bytein(cs->hw.elsa.ale) & ELSA_HW_RELEASE; in setup_elsa()
944 cs->hw.elsa.base, in setup_elsa()
946 val = bytein(cs->hw.elsa.ale) & ELSA_S0_POWER_BAD; in setup_elsa()
950 cs->hw.elsa.status |= ELSA_BAD_PWR; in setup_elsa()
1005 cs->hw.elsa.base = card->para[1]; in setup_elsa()
1012 cs->hw.elsa.cfg = cs->hw.elsa.base + ELSA_CONFIG; in setup_elsa()
1013 cs->hw.elsa.ale = cs->hw.elsa.base + ELSA_ALE; in setup_elsa()
1014 cs->hw.elsa.isac = cs->hw.elsa.base + ELSA_ISAC; in setup_elsa()
1015 cs->hw.elsa.hscx = cs->hw.elsa.base + ELSA_HSCX; in setup_elsa()
1016 cs->hw.elsa.trig = cs->hw.elsa.base + ELSA_TRIG_IRQ; in setup_elsa()
1017 cs->hw.elsa.timer = cs->hw.elsa.base + ELSA_START_TIMER; in setup_elsa()
1018 cs->hw.elsa.ctrl = cs->hw.elsa.base + ELSA_CONTROL; in setup_elsa()
1022 cs->hw.elsa.base, in setup_elsa()
1025 cs->hw.elsa.base = card->para[1]; in setup_elsa()
1027 val = readreg(cs->hw.elsa.base + 0, cs->hw.elsa.base + 2, IPAC_ID); in setup_elsa()
1030 cs->hw.elsa.ale = cs->hw.elsa.base + 0; in setup_elsa()
1031 cs->hw.elsa.isac = cs->hw.elsa.base + 2; in setup_elsa()
1032 cs->hw.elsa.hscx = cs->hw.elsa.base + 2; in setup_elsa()
1036 cs->hw.elsa.ale = cs->hw.elsa.base + ELSA_ALE_PCM; in setup_elsa()
1037 cs->hw.elsa.isac = cs->hw.elsa.base + ELSA_ISAC_PCM; in setup_elsa()
1038 cs->hw.elsa.hscx = cs->hw.elsa.base + ELSA_HSCX; in setup_elsa()
1040 cs->hw.elsa.timer = 0; in setup_elsa()
1041 cs->hw.elsa.trig = 0; in setup_elsa()
1042 cs->hw.elsa.ctrl = 0; in setup_elsa()
1046 cs->hw.elsa.base, in setup_elsa()
1061 cs->hw.elsa.cfg = pci_resource_start(dev_qs1000, 1); in setup_elsa()
1062 cs->hw.elsa.base = pci_resource_start(dev_qs1000, 3); in setup_elsa()
1069 cs->hw.elsa.cfg = pci_resource_start(dev_qs3000, 1); in setup_elsa()
1070 cs->hw.elsa.base = pci_resource_start(dev_qs3000, 3); in setup_elsa()
1080 if (!(cs->hw.elsa.base && cs->hw.elsa.cfg)) { in setup_elsa()
1084 if ((cs->hw.elsa.cfg & 0xff) || (cs->hw.elsa.base & 0xf)) { in setup_elsa()
1094 cs->hw.elsa.ale = cs->hw.elsa.base; in setup_elsa()
1095 cs->hw.elsa.isac = cs->hw.elsa.base +1; in setup_elsa()
1096 cs->hw.elsa.hscx = cs->hw.elsa.base +1; in setup_elsa()
1098 cs->hw.elsa.timer = 0; in setup_elsa()
1099 cs->hw.elsa.trig = 0; in setup_elsa()
1104 cs->hw.elsa.base, in setup_elsa()
1105 cs->hw.elsa.cfg, in setup_elsa()
1141 if (cs->typ != ISDN_CTYPE_ELSA_PCMCIA && check_region(cs->hw.elsa.base, bytecnt)) { in setup_elsa()
1145 cs->hw.elsa.base, in setup_elsa()
1146 cs->hw.elsa.base + bytecnt); in setup_elsa()
1149 request_region(cs->hw.elsa.base, bytecnt, "elsa isdn"); in setup_elsa()
1152 if (check_region(cs->hw.elsa.cfg, 0x80)) { in setup_elsa()
1156 cs->hw.elsa.cfg, in setup_elsa()
1157 cs->hw.elsa.cfg + 0x80); in setup_elsa()
1158 release_region(cs->hw.elsa.base, bytecnt); in setup_elsa()
1161 request_region(cs->hw.elsa.cfg, 0x80, "elsa isdn pci"); in setup_elsa()
1167 cs->hw.elsa.tl.function = (void *) elsa_led_handler; in setup_elsa()
1168 cs->hw.elsa.tl.data = (long) cs; in setup_elsa()
1169 init_timer(&cs->hw.elsa.tl); in setup_elsa()
1171 if (cs->hw.elsa.timer) { in setup_elsa()
1172 byteout(cs->hw.elsa.trig, 0xff); in setup_elsa()
1173 byteout(cs->hw.elsa.timer, 0); in setup_elsa()
1175 byteout(cs->hw.elsa.timer, 0); /* 2. Versuch */ in setup_elsa()
1205 val = readreg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_ID); in setup_elsa()