ASoC: tegra-alt: Remove on fly curve change support

on the fly curve type change needs hw soft reset or MVC disable
and enable programming sequence to be followed with re-programming
all the required register. Current driver code support is not
fully compliant with the IAS programming sequence. So to better
handling remove the on fly curve type support from the mvc driver.

Bug 200532059

Change-Id: I55a44134b07d1ddfebf103796d47930158ff770d
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2180060
(cherry picked from commit 608bcd2adf33b3f1daa5dad37441295351ea6e0c)
Reviewed-on: https://git-master.nvidia.com/r/2184303
GVS: Gerrit_Virtual_Submit
Reviewed-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Mohan Kumar
2019-08-21 14:05:56 +05:30
committed by Sameer Pujar
parent b6debbfd49
commit aa1f1ad292

View File

@@ -226,42 +226,15 @@ static int tegra210_mvc_put_curve_type(struct snd_kcontrol *kcontrol,
{
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct tegra210_mvc *mvc = snd_soc_codec_get_drvdata(codec);
unsigned int reg = TEGRA210_MVC_CTRL;
int ret = 0;
/* if no change in curve type, do nothing */
if (mvc->curve_type == ucontrol->value.integer.value[0])
return ret;
pm_runtime_get_sync(codec->dev);
/* change curve type */
ret |= regmap_update_bits(mvc->regmap, reg,
TEGRA210_MVC_CURVE_TYPE_MASK,
ucontrol->value.integer.value[0] <<
TEGRA210_MVC_CURVE_TYPE_SHIFT);
mvc->curve_type = ucontrol->value.integer.value[0];
ret = tegra210_mvc_soft_reset(mvc);
if (ret < 0) {
dev_err(codec->dev, "SOFT_RESET error: %d\n", ret);
return ret;
}
/* change volume to default init for new curve type */
if (ucontrol->value.integer.value[0] == CURVE_POLY)
if (mvc->curve_type == CURVE_POLY)
mvc->volume = TEGRA210_MVC_INIT_VOL_DEFAULT_POLY;
else
mvc->volume = TEGRA210_MVC_INIT_VOL_DEFAULT_LINEAR;
regmap_write(mvc->regmap, TEGRA210_MVC_TARGET_VOL, mvc->volume);
ret |= regmap_update_bits(mvc->regmap, TEGRA210_MVC_SWITCH,
TEGRA210_MVC_VOLUME_SWITCH_MASK,
TEGRA210_MVC_VOLUME_SWITCH_TRIGGER);
pm_runtime_put(codec->dev);
return ret;
return 0;
}
static int tegra210_mvc_get_audio_bits(struct snd_kcontrol *kcontrol,
@@ -409,6 +382,12 @@ static int tegra210_mvc_hw_params(struct snd_pcm_substream *substream,
TEGRA210_MVC_PER_CHAN_CTRL_EN_MASK,
~(TEGRA210_MVC_PER_CHAN_CTRL_EN_MASK));
/* change curve type */
ret = regmap_update_bits(mvc->regmap, TEGRA210_MVC_CTRL,
TEGRA210_MVC_CURVE_TYPE_MASK,
mvc->curve_type <<
TEGRA210_MVC_CURVE_TYPE_SHIFT);
/* init the default volume=1 for MVC */
regmap_write(mvc->regmap, TEGRA210_MVC_INIT_VOL, mvc->volume);