diff options
author | Matthew Fredrickson <creslin@digium.com> | 2009-10-02 16:31:58 +0000 |
---|---|---|
committer | Matthew Fredrickson <creslin@digium.com> | 2009-10-02 16:31:58 +0000 |
commit | edad00b3c06d0f574f6d607cebfb3e96a9832979 (patch) | |
tree | 74df9558f4d5f54c6a03a8d0630d1355f2e0bf83 /drivers/dahdi/wctdm24xxp/base.c | |
parent | 2baba3425563c7293163d711e481516ae2b59246 (diff) |
Implement API update to do per-channel companding selection for VPMADT032
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7309 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/wctdm24xxp/base.c')
-rw-r--r-- | drivers/dahdi/wctdm24xxp/base.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c index e3053d2..57a4f5c 100644 --- a/drivers/dahdi/wctdm24xxp/base.c +++ b/drivers/dahdi/wctdm24xxp/base.c @@ -311,18 +311,7 @@ void setchanconfig_from_state(struct vpmadt032 *vpm, int channel, GpakChannelCon chanconfig->MuteToneB = Disabled; chanconfig->FaxCngDetB = Disabled; - switch (vpm->span->deflaw) { - case DAHDI_LAW_MULAW: - chanconfig->SoftwareCompand = cmpPCMU; - break; - case DAHDI_LAW_ALAW: - chanconfig->SoftwareCompand = cmpPCMA; - break; - default: - chanconfig->SoftwareCompand = cmpPCMU; - break; - } - + chanconfig->SoftwareCompand = (vpm->desiredecstate[channel].companding = ADT_COMP_ALAW) ? cmpPCMA : cmpPCMU; chanconfig->FrameRate = rate2ms; p = &chanconfig->EcanParametersA; @@ -337,7 +326,7 @@ void setchanconfig_from_state(struct vpmadt032 *vpm, int channel, GpakChannelCon sizeof(chanconfig->EcanParametersB)); } -static int config_vpmadt032(struct vpmadt032 *vpm) +static int config_vpmadt032(struct vpmadt032 *vpm, struct wctdm *wc) { int res, i; GpakPortConfig_t portconfig = {0}; @@ -426,11 +415,12 @@ static int config_vpmadt032(struct vpmadt032 *vpm) return -1; } - for (i = 0; i < vpm->span->channels; ++i) { + for (i = 0; i < vpm->options.channels; ++i) { vpm->curecstate[i].tap_length = 0; vpm->curecstate[i].nlp_type = vpm->options.vpmnlptype; vpm->curecstate[i].nlp_threshold = vpm->options.vpmnlpthresh; vpm->curecstate[i].nlp_max_suppress = vpm->options.vpmnlpmaxsupp; + vpm->curecstate[i].companding = (wc->span.deflaw == DAHDI_LAW_MULAW) ? ADT_COMP_ULAW : ADT_COMP_ALAW; memcpy(&vpm->desiredecstate[i], &vpm->curecstate[i], sizeof(vpm->curecstate[i])); /* set_vpmadt032_chanconfig_from_state(&vpm->curecstate[i], &vpm->options, i, &chanconfig); !!! */ @@ -448,6 +438,11 @@ static int config_vpmadt032(struct vpmadt032 *vpm) printk(KERN_NOTICE "Unable to disable echo can on channel %d (reason %d:%d)\n", i + 1, res, algstatus); return -1; } + + if ((res = gpakAlgControl(vpm->dspid, i, BypassSwCompanding, &algstatus))) { + printk(KERN_NOTICE "Unable to disable echo can on channel %d (reason %d:%d)\n", i + 1, res, algstatus); + return -1; + } } if ((res = gpakPingDsp(vpm->dspid, &vpm->version))) { @@ -3679,7 +3674,7 @@ retry: wc->vpmadt032->setchanconfig_from_state = setchanconfig_from_state; wc->vpmadt032->context = wc; - wc->vpmadt032->span = &wc->span; + wc->vpmadt032->options.channels = wc->span.channels; get_default_portconfig(&portconfig); res = vpmadt032_init(wc->vpmadt032, wc->vb); /* In case there was an error while we were loading the VPM module. */ @@ -3696,7 +3691,7 @@ retry: /* Now we need to configure the VPMADT032 module for this * particular board. */ - res = config_vpmadt032(wc->vpmadt032); + res = config_vpmadt032(wc->vpmadt032, wc); if (res) { vpmadt032_free(wc->vpmadt032); wc->vpmadt032 = NULL; |