summaryrefslogtreecommitdiff
path: root/wctdm24xxp.c
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-02-10 21:08:21 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-02-10 21:08:21 +0000
commitcca6e6ed26607274600066fb2df14b88486c1c30 (patch)
tree71cc38321740e9debbe599bc4c5886f77a29cc44 /wctdm24xxp.c
parentd47f20263306c21a9a79a1f90494c2883dedd490 (diff)
More updates for VPM Rev B
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@941 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wctdm24xxp.c')
-rw-r--r--wctdm24xxp.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/wctdm24xxp.c b/wctdm24xxp.c
index 1c4786e..ded188f 100644
--- a/wctdm24xxp.c
+++ b/wctdm24xxp.c
@@ -1291,9 +1291,11 @@ static int wctdm_echocan(struct zt_chan *chan, int eclen)
int unit;
if (!wc->vpm)
return -ENODEV;
-
- channel = (chan->chanpos - 1) >> 2;
+ channel = (chan->chanpos - 1);
unit = (chan->chanpos - 1) & 0x3;
+ if (wc->vpm < 2)
+ channel >>= 2;
+
if(debug)
printk("echocan: Unit is %d, Channel is %d length %d\n",
unit, channel, eclen);
@@ -2472,12 +2474,9 @@ static void wctdm_vpm_init(struct wctdm *wc)
}
for (x=0;x<NUM_EC;x++) {
-#if 0
- ver = wctdm_vpm_in(wc, x, 0x1ac); /* revision */
- printk("VPM: Chip %d: ver2 %02x\n", x, ver);
-#endif
ver = wctdm_vpm_in(wc, x, 0x1a0); /* revision */
- printk("VPM: Chip %d: ver %02x\n", x, ver);
+ if (debug)
+ printk("VPM: Chip %d: ver %02x\n", x, ver);
if (ver != 0x33) {
printk("VPM: %s\n", x ? "Inoperable" : "Not Present");
wc->vpm = 0;
@@ -2493,7 +2492,7 @@ static void wctdm_vpm_init(struct wctdm *wc)
/* Setup GPIO's */
for (y=0;y<4;y++) {
wctdm_vpm_out(wc, x, 0x1a8 + y, 0x00); /* GPIO out */
- if (x != 3)
+ if (y == 3)
wctdm_vpm_out(wc, x, 0x1ac + y, 0x00); /* GPIO dir */
else
wctdm_vpm_out(wc, x, 0x1ac + y, 0xff); /* GPIO dir */
@@ -2575,7 +2574,10 @@ static void wctdm_vpm_init(struct wctdm *wc)
/* set DTMF detection threshold */
wctdm_vpm_set_dtmf_threshold(wc, dtmfthreshold);
- wc->vpm = 1;
+ if (vpmver == 0x01)
+ wc->vpm = 2;
+ else
+ wc->vpm = 1;
}
#endif
@@ -2659,7 +2661,7 @@ static void wctdm_locate_modules(struct wctdm *wc)
#ifdef VPM_SUPPORT
wctdm_vpm_init(wc);
if (wc->vpm) {
- printk("VPM: Present and operational\n");
+ printk("VPM: Present and operational (Rev %c)\n", 'A' + wc->vpm - 1);
wc->ctlreg |= 0x10;
}
#endif