diff options
author | kpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-01-31 01:38:30 +0000 |
---|---|---|
committer | kpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-01-31 01:38:30 +0000 |
commit | d1d2141cfc7fd6e87641568e6b414a7a7769c3f8 (patch) | |
tree | c397b2726ea3f55e751f8f1bed4102a70d13c144 /wctdm24xxp.c | |
parent | 7a70ea6d38e3a3ec9f227bfc2e7a2d510b7d44b0 (diff) |
Merged revisions 907,922 via svnmerge from
https://origsvn.digium.com/svn/zaptel/branches/1.2
........
r907 | russell | 2006-01-17 22:52:46 -0600 (Tue, 17 Jan 2006) | 2 lines
remove extremely old ChangeLog ... they will now only exist in tags
........
r922 | markster | 2006-01-30 19:26:56 -0600 (Mon, 30 Jan 2006) | 2 lines
Add support for VPM100M Rev B
........
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@923 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wctdm24xxp.c')
-rw-r--r-- | wctdm24xxp.c | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/wctdm24xxp.c b/wctdm24xxp.c index 464a3b4..dae289e 100644 --- a/wctdm24xxp.c +++ b/wctdm24xxp.c @@ -2462,6 +2462,7 @@ static void wctdm_vpm_init(struct wctdm *wc) unsigned char reg; unsigned int mask; unsigned int ver; + unsigned char vpmver; unsigned int i, x, y; if (!vpmsupport) { @@ -2483,10 +2484,19 @@ static void wctdm_vpm_init(struct wctdm *wc) return; } + if (!x) { + vpmver = wctdm_vpm_in(wc, x, 0x1a6) & 0xf; + printk("VPM Revision: %02x\n", vpmver); + } + + /* Setup GPIO's */ for (y=0;y<4;y++) { wctdm_vpm_out(wc, x, 0x1a8 + y, 0x00); /* GPIO out */ - wctdm_vpm_out(wc, x, 0x1ac + y, 0x00); /* GPIO dir */ + if (x != 3) + wctdm_vpm_out(wc, x, 0x1ac + y, 0x00); /* GPIO dir */ + else + wctdm_vpm_out(wc, x, 0x1ac + y, 0xff); /* GPIO dir */ wctdm_vpm_out(wc, x, 0x1b0 + y, 0x00); /* GPIO sel */ } @@ -2494,15 +2504,21 @@ static void wctdm_vpm_init(struct wctdm *wc) reg = wctdm_vpm_in(wc, x, 0x1a3); /* misc_con */ wctdm_vpm_out(wc, x, 0x1a3, reg & ~2); - /* Setup timeslots */ - wctdm_vpm_out(wc, x, 0x02f, 0x20 | (x << 3)); - /* Setup Echo length (256 taps) */ wctdm_vpm_out(wc, x, 0x022, 0); - wctdm_vpm_out(wc, x, 0x023, 0x7f); - + + /* Setup timeslots */ + if (vpmver == 0x01) { + wctdm_vpm_out(wc, x, 0x02f, 0x00); + wctdm_vpm_out(wc, x, 0x023, 0xff); + mask = 0x11111111 << x; + } else { + wctdm_vpm_out(wc, x, 0x02f, 0x20 | (x << 3)); + wctdm_vpm_out(wc, x, 0x023, 0x3f); + mask = 0x0000003f; + } + /* Setup the tdm channel masks for all chips*/ - mask = 0x0000003f; for (i = 0; i < 4; i++) wctdm_vpm_out(wc, x, 0x33 - i, (mask >> (i << 3)) & 0xff); @@ -2544,7 +2560,10 @@ static void wctdm_vpm_init(struct wctdm *wc) /* Enable DTMF detectors (always DTMF detect all spans) */ for (i = 0; i < 6; i++) { - wctdm_vpm_out(wc, x, 0x98 + i, 0x40 | i); + if (vpmver == 0x01) + wctdm_vpm_out(wc, x, 0x98 + i, 0x40 | (i << 2) | x); + else + wctdm_vpm_out(wc, x, 0x98 + i, 0x40 | i); } for (i = 0xB8; i < 0xC0; i++) |