From 7f0b345c5620a144d103f5594d3e444bcd2e370e Mon Sep 17 00:00:00 2001 From: mattf Date: Thu, 16 Aug 2007 17:01:18 +0000 Subject: Make sure the gain adjustment is only done if the VPM100M is present git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@2852 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- wctdm24xxp/base.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'wctdm24xxp') diff --git a/wctdm24xxp/base.c b/wctdm24xxp/base.c index 1fc3763..f499707 100644 --- a/wctdm24xxp/base.c +++ b/wctdm24xxp/base.c @@ -1916,14 +1916,6 @@ static int wctdm_init_voicedaa(struct wctdm *wc, int card, int fast, int manual, /* Enable on-hook line monitor */ wctdm_setreg(wc, card, 5, 0x08); - /* Apply negative Tx gain of 4.5db to DAA */ - wctdm_setreg(wc, card, 38, 0x14); /* 4db */ - wctdm_setreg(wc, card, 40, 0x15); /* 0.5db */ - - /* Apply negative Rx gain of 4.5db to DAA */ - wctdm_setreg(wc, card, 39, 0x14); /* 4db */ - wctdm_setreg(wc, card, 41, 0x15); /* 0.5db */ - return 0; } @@ -3174,6 +3166,20 @@ static void wctdm_vpm_init(struct wctdm *wc) wc->vpm = 2; else wc->vpm = 1; + + printk("Enabling VPM100 gain adjustments on any FXO ports found\n"); + for (i = 0; i < wc->type; i++) { + if (wc->modtype[i] == MOD_TYPE_FXO) { + /* Apply negative Tx gain of 4.5db to DAA */ + wctdm_setreg(wc, i, 38, 0x14); /* 4db */ + wctdm_setreg(wc, i, 40, 0x15); /* 0.5db */ + + /* Apply negative Rx gain of 4.5db to DAA */ + wctdm_setreg(wc, i, 39, 0x14); /* 4db */ + wctdm_setreg(wc, i, 41, 0x15); /* 0.5db */ + } + } + } #endif -- cgit v1.2.3