diff --git a/sound/soc/tegra/tegra210_mvc.c b/sound/soc/tegra/tegra210_mvc.c index 7062235b..b05c1e70 100644 --- a/sound/soc/tegra/tegra210_mvc.c +++ b/sound/soc/tegra/tegra210_mvc.c @@ -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[] = { diff --git a/sound/soc/tegra/tegra210_mvc.h b/sound/soc/tegra/tegra210_mvc.h index 9231243b..85b63e57 100644 --- a/sound/soc/tegra/tegra210_mvc.h +++ b/sound/soc/tegra/tegra210_mvc.h @@ -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