summaryrefslogtreecommitdiff
path: root/wctdm.c
diff options
context:
space:
mode:
Diffstat (limited to 'wctdm.c')
-rwxr-xr-xwctdm.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/wctdm.c b/wctdm.c
index 2e6cd86..f0b99c5 100755
--- a/wctdm.c
+++ b/wctdm.c
@@ -246,6 +246,7 @@ static inline void wcfxs_receiveprep(struct wcfxs *wc, unsigned char ints)
}
static inline void wcfxs_check_hook(struct wcfxs *wc, int card);
+static inline void wcfxs_recheck_sanity(struct wcfxs *wc, int card);
static void wcfxs_stop_dma(struct wcfxs *wc);
static void wcfxs_reset_tdm(struct wcfxs *wc);
@@ -281,6 +282,8 @@ static void wcfxs_interrupt(int irq, void *dev_id, struct pt_regs *regs)
x = wc->intcount % 4;
if ((x < wc->cards) && (wc->cardflag & (1 << x))) {
wcfxs_check_hook(wc, x);
+ if (!(wc->intcount & 0xfc))
+ wcfxs_recheck_sanity(wc, x);
}
if (!(wc->intcount % 10000)) {
/* Accept an alarm once per 10 seconds */
@@ -899,14 +902,9 @@ static int wcfxs_init_proslic(struct wcfxs *wc, int card, int fast, int manual,
return 0;
}
-static inline void wcfxs_check_hook(struct wcfxs *wc, int card)
+static inline void wcfxs_recheck_sanity(struct wcfxs *wc, int card)
{
- char res;
- int hook;
-
- /* For some reason we have to debounce the
- hook detector. */
-
+ int res;
/* Check loopback */
res = wcfxs_getreg(wc, card, 8);
if (res) {
@@ -926,6 +924,16 @@ static inline void wcfxs_check_hook(struct wcfxs *wc, int card)
}
}
}
+}
+
+static inline void wcfxs_check_hook(struct wcfxs *wc, int card)
+{
+ char res;
+ int hook;
+
+ /* For some reason we have to debounce the
+ hook detector. */
+
res = wcfxs_getreg(wc, card, 68);
hook = (res & 1);
if (hook != wc->lastrxhook[card]) {