OSDN Git Service

ASoC: msm: qdsp6v2: increase max Rx DTMF duration
authorTimothy Sham <tsham@codeaurora.org>
Thu, 3 May 2018 15:45:54 +0000 (11:45 -0400)
committerGerrit - the friendly Code Review server <code-review@localhost>
Tue, 8 May 2018 21:27:20 +0000 (14:27 -0700)
Increase the maximum value of the DTMF Rx Generate
mixer command and change the read to int16 to allow
for clients to be able to set '-1', infinite tone.

Change-Id: I44eed4712bb05a70b4464d9db38c348c131a3f61
Signed-off-by: Timothy Sham <tsham@codeaurora.org>
sound/soc/msm/qdsp6v2/msm-pcm-dtmf-v2.c

index ea7989c..abbcfed 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2014, 2018, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
@@ -97,12 +97,12 @@ static int msm_dtmf_rx_generate_put(struct snd_kcontrol *kcontrol,
 {
        uint16_t low_freq = ucontrol->value.integer.value[0];
        uint16_t high_freq = ucontrol->value.integer.value[1];
-       int64_t duration = ucontrol->value.integer.value[2];
+       int16_t duration = ucontrol->value.integer.value[2];
        uint16_t gain = ucontrol->value.integer.value[3];
 
        pr_debug("%s: low_freq=%d high_freq=%d duration=%d gain=%d\n",
                 __func__, low_freq, high_freq, (int)duration, gain);
-       afe_dtmf_generate_rx(duration, high_freq, low_freq, gain);
+       afe_dtmf_generate_rx((int64_t) duration, high_freq, low_freq, gain);
        return 0;
 }
 
@@ -154,7 +154,7 @@ static int msm_dtmf_detect_volte_rx_get(struct snd_kcontrol *kcontrol,
 
 static struct snd_kcontrol_new msm_dtmf_controls[] = {
        SOC_SINGLE_MULTI_EXT("DTMF_Generate Rx Low High Duration Gain",
-                            SND_SOC_NOPM, 0, 5000, 0, 4,
+                            SND_SOC_NOPM, 0, 65535, 0, 4,
                             msm_dtmf_rx_generate_get,
                             msm_dtmf_rx_generate_put),
        SOC_SINGLE_EXT("DTMF_Detect Rx Voice enable", SND_SOC_NOPM, 0, 1, 0,