mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
ASoC: tegra-alt: dmic rate control override
Support sampling rate override mixer control for dmic. Bug 1936866 Change-Id: I9a1930bda5220e4668a32f142fa07c1dc4759883 Signed-off-by: Mohan Kumar <mkumard@nvidia.com> Reviewed-on: http://git-master/r/1505570 (cherry picked from commit 6b2799c34edec6ee2084dba1b1a55e34cf7d4aa5) Reviewed-on: https://git-master/r/1508731 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Sameer Pujar <spujar@nvidia.com> Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
This commit is contained in:
committed by
Sameer Pujar
parent
7a1abcd3f1
commit
cb456f677b
@@ -163,6 +163,9 @@ static int tegra210_dmic_hw_params(struct snd_pcm_substream *substream,
|
||||
memset(&cif_conf, 0, sizeof(struct tegra210_xbar_cif_conf));
|
||||
|
||||
srate = params_rate(params);
|
||||
if (dmic->sample_rate_via_control)
|
||||
srate = dmic->sample_rate_via_control;
|
||||
|
||||
dmic_clk = (1 << (6+osr)) * srate;
|
||||
|
||||
if (dmic->ch_select == DMIC_CH_SELECT_NONE) {
|
||||
@@ -297,6 +300,9 @@ static int tegra210_dmic_get_control(struct snd_kcontrol *kcontrol,
|
||||
dmic->tx_mono_to_stereo;
|
||||
else if (strstr(kcontrol->id.name, "output bit format"))
|
||||
ucontrol->value.integer.value[0] = dmic->format_out;
|
||||
else if (strstr(kcontrol->id.name, "Sample Rate"))
|
||||
ucontrol->value.integer.value[0] =
|
||||
dmic->sample_rate_via_control;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -316,6 +322,8 @@ static int tegra210_dmic_put_control(struct snd_kcontrol *kcontrol,
|
||||
dmic->tx_mono_to_stereo = value;
|
||||
else if (strstr(kcontrol->id.name, "output bit format"))
|
||||
dmic->format_out = value;
|
||||
else if (strstr(kcontrol->id.name, "Sample Rate"))
|
||||
dmic->sample_rate_via_control = value;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -412,6 +420,8 @@ static const struct snd_kcontrol_new tegra210_dmic_controls[] = {
|
||||
tegra210_dmic_get_control, tegra210_dmic_put_control),
|
||||
SOC_ENUM_EXT("output bit format", tegra210_dmic_format_enum,
|
||||
tegra210_dmic_get_control, tegra210_dmic_put_control),
|
||||
SOC_SINGLE_EXT("Sample Rate", 0, 0, 48000, 0,
|
||||
tegra210_dmic_get_control, tegra210_dmic_put_control),
|
||||
};
|
||||
|
||||
static struct snd_soc_codec_driver tegra210_dmic_codec = {
|
||||
|
||||
Reference in New Issue
Block a user