summaryrefslogtreecommitdiff
path: root/wcfxs.c
diff options
context:
space:
mode:
Diffstat (limited to 'wcfxs.c')
-rwxr-xr-xwcfxs.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/wcfxs.c b/wcfxs.c
index 73f6e32..623ca84 100755
--- a/wcfxs.c
+++ b/wcfxs.c
@@ -218,7 +218,7 @@ static inline void wcfxs_receiveprep(struct wcfxs *wc, unsigned char ints)
if (ints & 0x08)
readchunk = wc->readchunk + ZT_CHUNKSIZE;
else
- /* Read is not at interrupt address. Valid data is available at normal offset */
+ /* Read is at interrupt address. Valid data is available at normal offset */
readchunk = wc->readchunk;
for (x=0;x<ZT_CHUNKSIZE;x++) {
if (wc->cardflag & (1 << 0))
@@ -265,7 +265,7 @@ static void wcfxs_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (ints & 0x0f) {
wc->intcount++;
- x = wc->intcount % 10;
+ x = wc->intcount % 4;
if ((x < wc->cards) && (wc->cardflag & (1 << x))) {
wcfxs_check_hook(wc, x);
}
@@ -792,14 +792,14 @@ static inline void wcfxs_check_hook(struct wcfxs *wc, int card)
res = wcfxs_getreg(wc, card, 68);
hook = (res & 1);
if (hook != wc->lastrxhook[card]) {
- /* Reset the debounce */
- wc->debounce[card] = 10;
+ /* Reset the debounce (must be multiple of 4ms) */
+ wc->debounce[card] = 3 * 4 * 8;
#if 0
printk("Resetting debounce card %d hook %d, %d\n", card, hook, wc->debounce[card]);
#endif
} else {
if (wc->debounce[card] > 0) {
- wc->debounce[card]--;
+ wc->debounce[card]-= 4 * ZT_CHUNKSIZE;
#if 0
printk("Sustaining hook %d, %d\n", hook, wc->debounce[card]);
#endif
@@ -1017,11 +1017,11 @@ static int wcfxs_hardware_init(struct wcfxs *wc)
/* Setup DMA Addresses */
outl(wc->writedma, wc->ioaddr + WC_DMAWS); /* Write start */
- outl(wc->writedma + ZT_CHUNKSIZE * 4, wc->ioaddr + WC_DMAWI); /* Middle (interrupt) */
+ outl(wc->writedma + ZT_CHUNKSIZE * 4 - 4, wc->ioaddr + WC_DMAWI); /* Middle (interrupt) */
outl(wc->writedma + ZT_CHUNKSIZE * 8 - 4, wc->ioaddr + WC_DMAWE); /* End */
outl(wc->readdma, wc->ioaddr + WC_DMARS); /* Read start */
- outl(wc->readdma + ZT_CHUNKSIZE * 4, wc->ioaddr + WC_DMARI); /* Middle (interrupt) */
+ outl(wc->readdma + ZT_CHUNKSIZE * 4 - 4, wc->ioaddr + WC_DMARI); /* Middle (interrupt) */
outl(wc->readdma + ZT_CHUNKSIZE * 8 - 4, wc->ioaddr + WC_DMARE); /* End */
/* Clear interrupts */