[PATCH] was RE: [Asterisk-Dev] Raising loop current limit on the Proslic(reg.71)

Brancaleoni Matteo mbrancaleoni at espia.it
Fri Mar 5 16:22:04 MST 2004


ok,
just to who wanna try that.... here's the patch.

I'm not sending it to bugs.digium.com unless
for Digium that's ok.

I'm using it and seems to work.
Now I'm not experiencing anymore module reset
caused by power alarms...

lemme know

*DISCLAIMER*
Altough that is believed to be safe, I cannot take
any responsibility on any damage that patch could
do :) . You at your own risk.

Matteo

P.S. the mA could be set from 20 to 41 mA.
look the first define in the wcfxs.c for
what you need to set to change the values.
Default is 35 mA.


-- 
Brancaleoni Matteo <mbrancaleoni at espia.it>
Espia - Emmegi Srl
-------------- next part --------------
--- zaptel/wcfxs.c	2004-03-06 00:09:51.000000000 +0100
+++ wcfxs.c	2004-03-06 00:16:11.000000000 +0100
@@ -35,6 +35,22 @@
 #include "proslic.h"
 #include "wcfxs.h"
 
+/*
+  Experimental max loop current limit for the proslic
+  Loop current limit is from 20 mA to 41 mA in steps of 3
+  (according to datasheet)
+  So set the value below to:
+  0x00 : 20mA (default)
+  0x01 : 23mA
+  0x02 : 26mA
+  0x03 : 29mA
+  0x04 : 32mA
+  0x05 : 35mA
+  0x06 : 37mA
+  0x07 : 41mA
+*/
+#define WC_ILIM	0x05
+
 static alpha  indirect_regs[] =
 {
 {0,"DTMF_ROW_0_PEAK",0x55C2},
@@ -744,6 +760,9 @@
 		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)));
 	}
+	
+	/* Proslic max allowed loop current, reg 71 */
+	wcfxs_setreg(wc,card,71,WC_ILIM);	
 
 #if 0
 	/* Perform DC-DC calibration */
@@ -1345,6 +1364,7 @@
 	unsigned char ver;
 	unsigned char x,y;
 	int failed;
+	int ilim;
 
 	/* Signal Reset */
 	outb(0x01, wc->ioaddr + WC_CNTL);
@@ -1426,6 +1446,9 @@
 		if (!(ret=wcfxs_init_proslic(wc, x, 0, 0, sane))) {
 			wc->cardflag |= (1 << x);
 			printk("Module %d: Installed -- AUTO FXS\n",x);
+                        ilim = wcfxs_getreg(wc,x,71);
+                        printk("Proslic module %d current is %dmA\n",x,
+				((ilim*3)+20));
 		} else {
 			if(ret!=-2) {
 				sane=1;
@@ -1433,6 +1456,10 @@
 				if (!wcfxs_init_proslic(wc, x, 0, 1, sane)) {
 					wc->cardflag |= (1 << x);
 					printk("Module %d: Installed -- MANUAL FXS\n",x);
+					printk("Module %d: Installed -- AUTO FXS\n",x);
+                        		ilim = wcfxs_getreg(wc,x,71);
+                        		printk("Proslic module %d current is %dmA\n",x,
+						((ilim*3)+20));
 				} else {
 					printk("Module %d: FAILED FXS\n", x);
 				} 


More information about the asterisk-dev mailing list