mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
ASoC: tegra-alt: Reading Mixer RX Gain always returns 0
Reading the mixer RX Gain always returns 0 and this is because the function to return the gain setting has not been implemented completely. Fix this by returning the programmed gain value in the function tegra210_mixer_get_format(). Bug 2438553 Change-Id: I4e6e5a6fe3373982cbb063ce3276428e0a1a2c1a Signed-off-by: Jonathan Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1945622 GVS: Gerrit_Virtual_Submit Reviewed-by: Sameer Pujar <spujar@nvidia.com> Reviewed-by: Bibek Basu <bbasu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Sameer Pujar
parent
0f9b5bd384
commit
1120a5768f
@@ -181,6 +181,17 @@ static int tegra210_mixer_get_format(struct snd_kcontrol *kcontrol,
|
|||||||
static int tegra210_mixer_get_gain(struct snd_kcontrol *kcontrol,
|
static int tegra210_mixer_get_gain(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
struct snd_ctl_elem_value *ucontrol)
|
||||||
{
|
{
|
||||||
|
struct soc_mixer_control *mc =
|
||||||
|
(struct soc_mixer_control *)kcontrol->private_value;
|
||||||
|
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
|
||||||
|
struct tegra210_mixer *mixer = snd_soc_codec_get_drvdata(codec);
|
||||||
|
unsigned int reg = mc->reg;
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
|
i = (reg - TEGRA210_MIXER_AHUBRAMCTL_GAIN_CONFIG_RAM_ADDR_0) /
|
||||||
|
TEGRA210_MIXER_AHUBRAMCTL_GAIN_CONFIG_RAM_ADDR_STRIDE;
|
||||||
|
ucontrol->value.integer.value[0] = mixer->gain_value[i];
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user