From 04f1ad23f1c4fc8d0d62c90ec9d24608c04bbf84 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Mon, 12 Mar 2018 11:46:34 +0000 Subject: [PATCH] ASoC: tegra-alt: Fix DMIC boost gain upper limit The Tegra DMIC 'Boost Gain' control shows an upper limit of '25600'. nvidia@tegra-ubuntu:~$ amixer -c 1 sget "DMIC3 Boost Gain" Simple mixer control 'DMIC3 Boost Gain',0 Capabilities: volume volume-joined Playback channels: Mono Capture channels: Mono Limits: 0 - 25600 Mono: 0 [0%] However, if a user attempts to set it to this the following error is seen ... [ 314.961362] tegra210-dmic tegra210-dmic.2: Boost Gain overflow [ 314.970917] tegra210-dmic tegra210-dmic.2: Boost Gain overflow Software only allows a max value of '25599' to be written to this control and so fix this. Bug 2069481 Change-Id: Ibdfa6f2c43e3855c72d2ec6fed6848f1395ccef8 Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/1673437 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Sameer Pujar Reviewed-by: Viswanath L Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Bibek Basu Reviewed-by: mobile promotions Tested-by: mobile promotions --- sound/soc/tegra-alt/tegra210_dmic_alt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/tegra-alt/tegra210_dmic_alt.c b/sound/soc/tegra-alt/tegra210_dmic_alt.c index dda437f8..f2acd525 100644 --- a/sound/soc/tegra-alt/tegra210_dmic_alt.c +++ b/sound/soc/tegra-alt/tegra210_dmic_alt.c @@ -491,7 +491,7 @@ static const struct soc_enum tegra210_dmic_osr_enum = tegra210_dmic_osr_text); static const struct snd_kcontrol_new tegra210_dmic_controls[] = { - SOC_SINGLE_EXT("Boost Gain", 0, 0, 25600, 0, + SOC_SINGLE_EXT("Boost Gain", 0, 0, 25599, 0, tegra210_dmic_get_control, tegra210_dmic_put_control), SOC_ENUM_EXT("Mono Channel Select", tegra210_dmic_ch_enum, tegra210_dmic_get_control, tegra210_dmic_put_control),