From: Andreas Eversberg Date: Fri, 22 May 2009 11:04:58 +0000 (+0000) Subject: mISDN: Fix DTMF detection enable/disable X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b0579d7459aaa979b96016f3cac5e59fd3cb72b5;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git mISDN: Fix DTMF detection enable/disable DTMF detection was enabled when it was not supposed to. Signed-off-by: Andreas Eversberg Signed-off-by: Karsten Keil Signed-off-by: David S. Miller --- diff --git a/drivers/isdn/mISDN/dsp.h b/drivers/isdn/mISDN/dsp.h index 564ea3efd5e3..18af86879c05 100644 --- a/drivers/isdn/mISDN/dsp.h +++ b/drivers/isdn/mISDN/dsp.h @@ -116,6 +116,7 @@ struct dsp_conf { #define ECHOCAN_BUFF_MASK 0x3ff /* -1 */ struct dsp_dtmf { + int enable; /* dtmf is enabled */ int treshold; /* above this is dtmf (square of) */ int software; /* dtmf uses software decoding */ int hardware; /* dtmf uses hardware decoding */ diff --git a/drivers/isdn/mISDN/dsp_core.c b/drivers/isdn/mISDN/dsp_core.c index c35750647c66..c12cd2f94254 100644 --- a/drivers/isdn/mISDN/dsp_core.c +++ b/drivers/isdn/mISDN/dsp_core.c @@ -306,6 +306,7 @@ dsp_control_req(struct dsp *dsp, struct mISDNhead *hh, struct sk_buff *skb) "to %d\n", *((int *)data)); dsp->dtmf.treshold = (*(int *)data) * 10000; } + dsp->dtmf.enable = 1; /* init goertzel */ dsp_dtmf_goertzel_init(dsp); @@ -316,6 +317,7 @@ dsp_control_req(struct dsp *dsp, struct mISDNhead *hh, struct sk_buff *skb) case DTMF_TONE_STOP: /* turn off DTMF */ if (dsp_debug & DEBUG_DSP_CORE) printk(KERN_DEBUG "%s: stop dtmf\n", __func__); + dsp->dtmf.enable = 0; dsp->dtmf.hardware = 0; dsp->dtmf.software = 0; break; diff --git a/drivers/isdn/mISDN/dsp_dtmf.c b/drivers/isdn/mISDN/dsp_dtmf.c index efc371c1f0dc..9ae2d33b06f7 100644 --- a/drivers/isdn/mISDN/dsp_dtmf.c +++ b/drivers/isdn/mISDN/dsp_dtmf.c @@ -51,6 +51,9 @@ void dsp_dtmf_hardware(struct dsp *dsp) { int hardware = 1; + if (!dsp->dtmf.enable) + return; + if (!dsp->features.hfc_dtmf) hardware = 0;