summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-06-21 21:54:15 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-06-21 21:54:15 +0000
commit8ad434c95444cf438845f57b2c63ba4114ee1e5e (patch)
tree42b146e72e6d1744374adad33a4d746b2821a708
parent80df834f1ee899277641d62f50e3ab3b10808f13 (diff)
Add special check for R19 calibration
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@417 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rwxr-xr-xwcfxs.c8
-rwxr-xr-xwctdm.c8
2 files changed, 16 insertions, 0 deletions
diff --git a/wcfxs.c b/wcfxs.c
index 251443d..a1c851f 100755
--- a/wcfxs.c
+++ b/wcfxs.c
@@ -810,6 +810,7 @@ static int wcfxs_proslic_powerleak_test(struct wcfxs *wc, int card)
static int wcfxs_powerup_proslic(struct wcfxs *wc, int card, int fast)
{
unsigned char vbat;
+ unsigned char r19;
unsigned long origjiffies;
/* Set period of DC-DC converter to 1/64 khz */
@@ -845,6 +846,13 @@ static int wcfxs_powerup_proslic(struct wcfxs *wc, int card, int fast)
/* Engage DC-DC converter */
wcfxs_setreg(wc, card, 93, 0x99 /* was 0x19 */);
+ r19 = wcfxs_getreg(wc, card, 107);
+ if ((r19 < 0x2) || (r19 > 0xd)) {
+ if (debug)
+ printk("DC-DC cal has a surprising direct 107 of 0x%02x!\n", r19);
+ wcfxs_setreg(wc, card, 107, 0x8);
+ }
+
#if 0
origjiffies = jiffies;
while(0x80 & wcfxs_getreg(wc, card, 93)) {
diff --git a/wctdm.c b/wctdm.c
index 251443d..a1c851f 100755
--- a/wctdm.c
+++ b/wctdm.c
@@ -810,6 +810,7 @@ static int wcfxs_proslic_powerleak_test(struct wcfxs *wc, int card)
static int wcfxs_powerup_proslic(struct wcfxs *wc, int card, int fast)
{
unsigned char vbat;
+ unsigned char r19;
unsigned long origjiffies;
/* Set period of DC-DC converter to 1/64 khz */
@@ -845,6 +846,13 @@ static int wcfxs_powerup_proslic(struct wcfxs *wc, int card, int fast)
/* Engage DC-DC converter */
wcfxs_setreg(wc, card, 93, 0x99 /* was 0x19 */);
+ r19 = wcfxs_getreg(wc, card, 107);
+ if ((r19 < 0x2) || (r19 > 0xd)) {
+ if (debug)
+ printk("DC-DC cal has a surprising direct 107 of 0x%02x!\n", r19);
+ wcfxs_setreg(wc, card, 107, 0x8);
+ }
+
#if 0
origjiffies = jiffies;
while(0x80 & wcfxs_getreg(wc, card, 93)) {