ASoC: tegra-alt: Remove unsupported modes from I2S control

The I2S interfaces only support configurations where both the bit clock
and frame sync are master or are both slave. Therefore, remove support
for modes where the bit clock is master and frame sync is slave and
vice-versa from the 'I2Sx codec master mode' mixer controls.

Bug 2046053
Bug 2746555

Change-Id: I288a1a372fe200b5faf2eb0f3d7c481a34c1f545
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2230060
(cherry picked from commit 79a002b42a9c25cd26832c967f95f82e08935ca9)
Reviewed-on: https://git-master.nvidia.com/r/2237275
GVS: Gerrit_Virtual_Submit
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:
Jon Hunter
2019-11-01 12:36:19 +00:00
committed by Sameer Pujar
parent 3b9d9c345c
commit 5e32b94e91

View File

@@ -3635,7 +3635,7 @@ static int tegra_machine_codec_set_dai_fmt(struct snd_soc_pcm_runtime *rtd,
unsigned int frame_mode, unsigned int frame_mode,
unsigned int master_mode) unsigned int master_mode)
{ {
unsigned int shift, fmt = rtd->dai_link->dai_fmt; unsigned int fmt = rtd->dai_link->dai_fmt;
if (frame_mode) { if (frame_mode) {
fmt &= ~SND_SOC_DAIFMT_FORMAT_MASK; fmt &= ~SND_SOC_DAIFMT_FORMAT_MASK;
@@ -3644,8 +3644,12 @@ static int tegra_machine_codec_set_dai_fmt(struct snd_soc_pcm_runtime *rtd,
if (master_mode) { if (master_mode) {
fmt &= ~SND_SOC_DAIFMT_MASTER_MASK; fmt &= ~SND_SOC_DAIFMT_MASTER_MASK;
shift = ffs(SND_SOC_DAIFMT_MASTER_MASK) - 1; master_mode <<= ffs(SND_SOC_DAIFMT_MASTER_MASK) - 1;
fmt |= master_mode << shift;
if (master_mode == SND_SOC_DAIFMT_CBM_CFM)
fmt |= SND_SOC_DAIFMT_CBM_CFM;
else
fmt |= SND_SOC_DAIFMT_CBS_CFS;
} }
return snd_soc_runtime_set_dai_fmt(rtd, fmt); return snd_soc_runtime_set_dai_fmt(rtd, fmt);
@@ -3692,16 +3696,9 @@ static int tegra_machine_codec_put_frame_mode(struct snd_kcontrol *kcontrol,
return 0; return 0;
} }
/*
* The order of the below must not be changed as this
* aligns with the SND_SOC_DAIFMT_XXX definitions in
* include/sound/soc-dai.h.
*/
static const char * const tegra_machine_master_mode_text[] = { static const char * const tegra_machine_master_mode_text[] = {
"None", "None",
"cbm-cfm", "cbm-cfm",
"cbs-cfm",
"cbm-cfs",
"cbs-cfs", "cbs-cfs",
}; };