ASoc: Fix for dtmf tone play issue
Fix the data corruption happening because of misaligned datatypes so that DTMF can be played for more than 32767 seconds. Change-Id: I199d6d10e9f184665d8f03a2265d0bcd8ae16590 Signed-off-by: Jhansi Konathala <cjkonat@codeaurora.org>
此提交包含在:
@@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
#define DRV_NAME "msm-pcm-dtmf-v2"
|
#define DRV_NAME "msm-pcm-dtmf-v2"
|
||||||
|
|
||||||
|
#define DTMF_MAX_DURATION 65535
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
DTMF_IN_RX,
|
DTMF_IN_RX,
|
||||||
DTMF_IN_TX,
|
DTMF_IN_TX,
|
||||||
@@ -94,8 +96,12 @@ static int msm_dtmf_rx_generate_put(struct snd_kcontrol *kcontrol,
|
|||||||
int64_t duration = ucontrol->value.integer.value[2];
|
int64_t duration = ucontrol->value.integer.value[2];
|
||||||
uint16_t gain = ucontrol->value.integer.value[3];
|
uint16_t gain = ucontrol->value.integer.value[3];
|
||||||
|
|
||||||
pr_debug("%s: low_freq=%d high_freq=%d duration=%d gain=%d\n",
|
pr_debug("%s: low_freq=%d high_freq=%d duration=%lld gain=%d\n",
|
||||||
__func__, low_freq, high_freq, (int)duration, gain);
|
__func__, low_freq, high_freq, (int)duration, gain);
|
||||||
|
|
||||||
|
if (duration == DTMF_MAX_DURATION)
|
||||||
|
duration = -1;
|
||||||
|
|
||||||
afe_dtmf_generate_rx(duration, high_freq, low_freq, gain);
|
afe_dtmf_generate_rx(duration, high_freq, low_freq, gain);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
新增問題並參考
封鎖使用者