[dahdi-commits] tzafrir: linux/trunk r6817 - /linux/trunk/drivers/dahdi/wcb4xxp/base.c
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Thu Jul 2 15:07:39 CDT 2009
Author: tzafrir
Date: Thu Jul 2 15:07:36 2009
New Revision: 6817
URL: http://svn.asterisk.org/svn-view/dahdi?view=rev&rev=6817
Log:
More B410P differences: Clock and NT/TE.
* The B410P reads the NT/TE switches the other way around from other
cards.
* Its clock is also 1/2 of that of other cards, which causes wierd PCM
on an unmodified driver.
Modified:
linux/trunk/drivers/dahdi/wcb4xxp/base.c
Modified: linux/trunk/drivers/dahdi/wcb4xxp/base.c
URL: http://svn.asterisk.org/svn-view/dahdi/linux/trunk/drivers/dahdi/wcb4xxp/base.c?view=diff&rev=6817&r1=6816&r2=6817
==============================================================================
--- linux/trunk/drivers/dahdi/wcb4xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wcb4xxp/base.c Thu Jul 2 15:07:36 2009
@@ -1443,7 +1443,16 @@
s->parent = b4;
s->port = i;
- nt = ((gpio & (1 << (i + 4))) == 0); /* GPIO=0 = NT mode */
+ /* The way the Digium B410P card reads the NT/TE mode
+ * jumper is the oposite of how other HFC-4S cards do:
+ * - In B410P: GPIO=0: NT
+ * - In Junghanns: GPIO=0: TE
+ */
+ if (b4->card_type == B410P)
+ nt = ((gpio & (1 << (i + 4))) == 0);
+ else
+ nt = ((gpio & (1 << (i + 4))) != 0);
+
s->te_mode = !nt;
dev_info(b4->dev, "Port %d: %s mode\n", i + 1, (nt ? "NT" : "TE"));
@@ -1799,9 +1808,15 @@
/*
* set up the clock controller
- * we have a 24.576MHz crystal, so the PCM clock is 2x the incoming clock.
- */
- b4xxp_setreg8(b4, R_BRG_PCM_CFG, 0x02);
+ * B410P has a 24.576MHz crystal, so the PCM clock is 2x the incoming clock.
+ * Other cards have a 49.152Mhz crystal, so the PCM clock equals incoming clock.
+ */
+
+ if (b4->card_type == B410P)
+ b4xxp_setreg8(b4, R_BRG_PCM_CFG, 0x02);
+ else
+ b4xxp_setreg8(b4, R_BRG_PCM_CFG, V_PCM_CLK);
+
flush_pci();
udelay(100); /* wait a bit for clock to settle */
More information about the dahdi-commits
mailing list