From d5be4c92a4919fa45b7848c6531cd29bfe0dc3e6 Mon Sep 17 00:00:00 2001 From: Asha Talambedu Date: Tue, 6 Aug 2019 11:26:22 +0530 Subject: [PATCH] ASoC: tegra-alt: Fix MVC mute issue MVC Mute Mixer ctrl setting is not reflecting correct status as the mute ctrl register is not cached and therefore getting reset to default in resume call that is being called after reading the mixer ctrl. To avoid this, MVC mute register is made non-volatile and get_sync/put_sync is avoided for reading this cached register Mute status reset in cache everytime after setting volume for proper reflection of mute status in mixer controls. Note that cached value will be synced to hardware on resume. Bug 200532059 Change-Id: I9ee072d84c8103facdad22b2708113c4bcdda039 Signed-off-by: Asha Talambedu Reviewed-on: https://git-master.nvidia.com/r/2165774 (cherry picked from commit 85badb30954b503121f139a66eba4dc02eb90068) Reviewed-on: https://git-master.nvidia.com/r/2185120 Reviewed-by: mobile promotions Tested-by: mobile promotions --- sound/soc/tegra-alt/tegra210_mvc_alt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sound/soc/tegra-alt/tegra210_mvc_alt.c b/sound/soc/tegra-alt/tegra210_mvc_alt.c index b1b33f81..510227c3 100644 --- a/sound/soc/tegra-alt/tegra210_mvc_alt.c +++ b/sound/soc/tegra-alt/tegra210_mvc_alt.c @@ -146,9 +146,7 @@ static int tegra210_mvc_get_vol(struct snd_kcontrol *kcontrol, } else { u32 val; - pm_runtime_get_sync(codec->dev); regmap_read(mvc->regmap, reg, &val); - pm_runtime_put(codec->dev); ucontrol->value.integer.value[0] = ((val & TEGRA210_MVC_MUTE_MASK) != 0); } @@ -207,6 +205,10 @@ static int tegra210_mvc_put_vol(struct snd_kcontrol *kcontrol, end: pm_runtime_put(codec->dev); + if (reg == TEGRA210_MVC_TARGET_VOL) + ret |= regmap_update_bits(mvc->regmap, TEGRA210_MVC_CTRL, + TEGRA210_MVC_MUTE_MASK, 0); + return ret; } @@ -573,7 +575,6 @@ static bool tegra210_mvc_volatile_reg(struct device *dev, unsigned int reg) case TEGRA210_MVC_AHUBRAMCTL_CONFIG_RAM_CTRL: case TEGRA210_MVC_AHUBRAMCTL_CONFIG_RAM_DATA: case TEGRA210_MVC_PEAK_VALUE: - case TEGRA210_MVC_CTRL: return true; default: return false;