From 21224b4ad18a623fbfc481242048e28fdbfaea86 Mon Sep 17 00:00:00 2001 From: markster Date: Fri, 6 Jun 2003 02:47:53 +0000 Subject: FXS fixes, ring debounce git-svn-id: http://svn.digium.com/svn/zaptel/trunk@191 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- wctdm.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'wctdm.c') diff --git a/wctdm.c b/wctdm.c index 2e81dd9..7afb82a 100755 --- a/wctdm.c +++ b/wctdm.c @@ -560,12 +560,12 @@ static int wcfxs_powerleak_test(struct wcfxs *wc, int card) /* Wait for one second */ origjiffies = jiffies; - while((vbat = wcfxs_getreg(wc, card, 82)) > 0x3) { - if ((jiffies - origjiffies) >= HZ) + while((vbat = wcfxs_getreg(wc, card, 82)) > 0x6) { + if ((jiffies - origjiffies) >= (HZ/2)) break;; } - if (vbat < 0x04) { + if (vbat < 0x06) { printk("Excessive leakage detected on module %d: %d volts (%02x) after %d ms\n", card, 376 * vbat / 1000, vbat, (int)((jiffies - origjiffies) * 1000 / HZ)); return -1; @@ -581,10 +581,10 @@ static int wcfxs_powerup_proslic(struct wcfxs *wc, int card) unsigned long origjiffies; /* Set period of DC-DC converter to 1/64 khz */ - wcfxs_setreg(wc, card, 92, 0xff); + wcfxs_setreg(wc, card, 92, 0x7f /* was 0xff */); /* Engage DC-DC converter */ - wcfxs_setreg(wc, card, 93, 0x19); + wcfxs_setreg(wc, card, 93, 0x99 /* was 0x19 */); /* Wait for VBat to powerup */ origjiffies = jiffies; @@ -599,10 +599,6 @@ static int wcfxs_powerup_proslic(struct wcfxs *wc, int card) } } -#if 0 - printk("jiffies - origjiffies: %d\n", ((int)(jiffies - origjiffies))); -#endif - if (vbat < 0xc0) { printk("ProSLIC on module %d failed to powerup within %d ms\n", card, (int)(((jiffies - origjiffies) * 1000 / HZ))); @@ -611,8 +607,10 @@ static int wcfxs_powerup_proslic(struct wcfxs *wc, int card) printk("ProSLIC on module %d powered up to -%d volts (%02x) in %d ms\n", card, vbat * 376 / 1000, vbat, (int)(((jiffies - origjiffies) * 1000 / HZ))); } + +#if 0 /* Perform DC-DC calibration */ - wcfxs_setreg(wc, card, 93, 0x80); + /* wcfxs_setreg(wc, card, 93, 0x80); */ origjiffies = jiffies; while(0x80 & wcfxs_getreg(wc, card, 93)) { @@ -630,6 +628,7 @@ static int wcfxs_powerup_proslic(struct wcfxs *wc, int card) vbat = wcfxs_getreg(wc, card, 82); printk("ProSLIC on module %d powered up to -%d volts (%02x) in %d ms\n", card, vbat * 376 / 1000, vbat, (int)(((jiffies - origjiffies) * 1000 / HZ))); +#endif #endif return 0; -- cgit v1.2.3