[zaptel-commits] branch 1.2 r940 - /branches/1.2/wctdm24xxp.c

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Fri Feb 10 14:08:10 MST 2006


Author: markster
Date: Fri Feb 10 15:08:09 2006
New Revision: 940

URL: http://svn.digium.com/view/zaptel?rev=940&view=rev
Log:
More updates for Rev B VPM

Modified:
    branches/1.2/wctdm24xxp.c

Modified: branches/1.2/wctdm24xxp.c
URL: http://svn.digium.com/view/zaptel/branches/1.2/wctdm24xxp.c?rev=940&r1=939&r2=940&view=diff
==============================================================================
--- branches/1.2/wctdm24xxp.c (original)
+++ branches/1.2/wctdm24xxp.c Fri Feb 10 15:08:09 2006
@@ -1291,9 +1291,11 @@
 	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 @@
 	}
 
 	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 @@
 		/* 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 @@
 	/* 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 @@
 #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



More information about the zaptel-commits mailing list