summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSameer Pujar <spujar@nvidia.com>2021-11-18 10:06:58 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-12-08 11:04:48 +0300
commit7e83ca5d78bbcf2bb1051697cd5ead0ba7b770c1 (patch)
treeb3301dd54d337c0fc87a0c4b1ff4dc15b1f95cdb
parent36358b208cdb2709b94c3f6d6d021c2d6ba412b7 (diff)
downloadlinux-7e83ca5d78bbcf2bb1051697cd5ead0ba7b770c1.tar.xz
ASoC: tegra: Fix wrong value type in DMIC
commit 559d234569a998a4004de1bd1f12da5487fb826e upstream. The enum controls are expected to use enumerated value type. Update relevant references in control get/put callbacks. Fixes: 8c8ff982e9e2 ("ASoC: tegra: Add Tegra210 based DMIC driver") Suggested-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sameer Pujar <spujar@nvidia.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/1637219231-406-4-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--sound/soc/tegra/tegra210_dmic.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/sound/soc/tegra/tegra210_dmic.c b/sound/soc/tegra/tegra210_dmic.c
index b096478cd2ef..ee2aedb0440f 100644
--- a/sound/soc/tegra/tegra210_dmic.c
+++ b/sound/soc/tegra/tegra210_dmic.c
@@ -165,15 +165,15 @@ static int tegra210_dmic_get_control(struct snd_kcontrol *kcontrol,
if (strstr(kcontrol->id.name, "Boost Gain Volume"))
ucontrol->value.integer.value[0] = dmic->boost_gain;
else if (strstr(kcontrol->id.name, "Channel Select"))
- ucontrol->value.integer.value[0] = dmic->ch_select;
+ ucontrol->value.enumerated.item[0] = dmic->ch_select;
else if (strstr(kcontrol->id.name, "Mono To Stereo"))
- ucontrol->value.integer.value[0] = dmic->mono_to_stereo;
+ ucontrol->value.enumerated.item[0] = dmic->mono_to_stereo;
else if (strstr(kcontrol->id.name, "Stereo To Mono"))
- ucontrol->value.integer.value[0] = dmic->stereo_to_mono;
+ ucontrol->value.enumerated.item[0] = dmic->stereo_to_mono;
else if (strstr(kcontrol->id.name, "OSR Value"))
- ucontrol->value.integer.value[0] = dmic->osr_val;
+ ucontrol->value.enumerated.item[0] = dmic->osr_val;
else if (strstr(kcontrol->id.name, "LR Polarity Select"))
- ucontrol->value.integer.value[0] = dmic->lrsel;
+ ucontrol->value.enumerated.item[0] = dmic->lrsel;
return 0;
}
@@ -183,20 +183,19 @@ static int tegra210_dmic_put_control(struct snd_kcontrol *kcontrol,
{
struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol);
struct tegra210_dmic *dmic = snd_soc_component_get_drvdata(comp);
- int value = ucontrol->value.integer.value[0];
if (strstr(kcontrol->id.name, "Boost Gain Volume"))
- dmic->boost_gain = value;
+ dmic->boost_gain = ucontrol->value.integer.value[0];
else if (strstr(kcontrol->id.name, "Channel Select"))
- dmic->ch_select = ucontrol->value.integer.value[0];
+ dmic->ch_select = ucontrol->value.enumerated.item[0];
else if (strstr(kcontrol->id.name, "Mono To Stereo"))
- dmic->mono_to_stereo = value;
+ dmic->mono_to_stereo = ucontrol->value.enumerated.item[0];
else if (strstr(kcontrol->id.name, "Stereo To Mono"))
- dmic->stereo_to_mono = value;
+ dmic->stereo_to_mono = ucontrol->value.enumerated.item[0];
else if (strstr(kcontrol->id.name, "OSR Value"))
- dmic->osr_val = value;
+ dmic->osr_val = ucontrol->value.enumerated.item[0];
else if (strstr(kcontrol->id.name, "LR Polarity Select"))
- dmic->lrsel = value;
+ dmic->lrsel = ucontrol->value.enumerated.item[0];
return 0;
}