ASoC: tegra: Add MVC Bypass support

- Add "MVC Bypass" kcontrol to enable MVC Bypass
  mode.
- The change is required to verify MVC bypass mode
  during bring up.

Bug 200683609

Change-Id: Ic0f2c947fa2e9bd6e9b429b86ff35e053775ec80
Signed-off-by: sheetal <sheetal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2546568
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
sheetal
2021-06-17 15:46:21 +05:30
committed by Sameer Pujar
parent 9e4c08a7c2
commit 47e3d32fc0
2 changed files with 15 additions and 0 deletions

View File

@@ -337,6 +337,8 @@ static int tegra210_mvc_get_format(struct snd_kcontrol *kcontrol,
ucontrol->value.integer.value[0] = mvc->format_in;
else if (strstr(kcontrol->id.name, "Audio Channels"))
ucontrol->value.integer.value[0] = mvc->cif_channels;
else if (strstr(kcontrol->id.name, "Bypass"))
ucontrol->value.integer.value[0] = mvc->bypass_mode;
return 0;
}
@@ -353,6 +355,8 @@ static int tegra210_mvc_put_format(struct snd_kcontrol *kcontrol,
mvc->format_in = value;
else if (strstr(kcontrol->id.name, "Audio Channels"))
mvc->cif_channels = value;
else if (strstr(kcontrol->id.name, "Bypass"))
mvc->bypass_mode = value;
return 0;
}
@@ -455,6 +459,11 @@ static int tegra210_mvc_hw_params(struct snd_pcm_substream *substream,
/* program duration_inv */
regmap_write(mvc->regmap, TEGRA210_MVC_DURATION_INV, mvc->duration_inv);
/* set bypass mode */
regmap_update_bits(mvc->regmap, TEGRA210_MVC_CTRL,
TEGRA210_MVC_BYPASS_MODE_MASK,
mvc->bypass_mode << TEGRA210_MVC_BYPASS_MODE_SHIFT);
return err;
}
@@ -517,6 +526,8 @@ static const struct snd_kcontrol_new tegra210_mvc_vol_ctrl[] = {
tegra210_mvc_get_format, tegra210_mvc_put_format),
SOC_ENUM_EXT("Audio Bit Format", tegra210_mvc_format_enum,
tegra210_mvc_get_format, tegra210_mvc_put_format),
SOC_SINGLE_EXT("Bypass", TEGRA210_MVC_CTRL, 0, 1, 0,
tegra210_mvc_get_format, tegra210_mvc_put_format),
};
static struct snd_soc_dai_driver tegra210_mvc_dais[] = {

View File

@@ -81,6 +81,9 @@
#define TEGRA210_MVC_INIT_VOL_DEFAULT_POLY 0x01000000
#define TEGRA210_MVC_INIT_VOL_DEFAULT_LINEAR 0x00000000
#define TEGRA210_MVC_BYPASS_MODE_SHIFT 31
#define TEGRA210_MVC_BYPASS_MODE_MASK (1 << TEGRA210_MVC_BYPASS_MODE_SHIFT)
/* Fields in TEGRA210_MVC ram ctrl */
#define TEGRA210_MVC_CFG_RAM_CTRL_RW_SHIFT 14
#define TEGRA210_MVC_CFG_RAM_CTRL_RW_WRITE (1 << TEGRA210_MVC_CFG_RAM_CTRL_RW_SHIFT)
@@ -113,6 +116,7 @@ struct tegra210_mvc {
unsigned int cif_channels;
unsigned int audio_bits;
unsigned int format_in;
bool bypass_mode;
};
#endif