ASoC: topology: Fix bclk and fsync inversion in set_link_hw_format()
The values of bclk and fsync are inverted WRT the codec. But the existing solution already works for Broadwell, see the alsa-lib config: `alsa-lib/src/conf/topology/broadwell/broadwell.conf` This commit provides the backwards-compatible solution to fix this misuse. Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Tested-by: Pan Xiuli <xiuli.pan@linux.intel.com> Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.de> Cc: Mark Brown <broonie@kernel.org> Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com> Cc: linux-kernel@vger.kernel.org Cc: alsa-devel@alsa-project.org Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:

committed by
Mark Brown

parent
8a2278b7fb
commit
a941e2fab3
@@ -2019,13 +2019,15 @@ static void set_link_hw_format(struct snd_soc_dai_link *link,
|
||||
link->dai_fmt |= SND_SOC_DAIFMT_IB_IF;
|
||||
|
||||
/* clock masters */
|
||||
bclk_master = hw_config->bclk_master;
|
||||
fsync_master = hw_config->fsync_master;
|
||||
if (!bclk_master && !fsync_master)
|
||||
bclk_master = (hw_config->bclk_master ==
|
||||
SND_SOC_TPLG_BCLK_CM);
|
||||
fsync_master = (hw_config->fsync_master ==
|
||||
SND_SOC_TPLG_FSYNC_CM);
|
||||
if (bclk_master && fsync_master)
|
||||
link->dai_fmt |= SND_SOC_DAIFMT_CBM_CFM;
|
||||
else if (bclk_master && !fsync_master)
|
||||
link->dai_fmt |= SND_SOC_DAIFMT_CBS_CFM;
|
||||
else if (!bclk_master && fsync_master)
|
||||
link->dai_fmt |= SND_SOC_DAIFMT_CBS_CFM;
|
||||
else if (bclk_master && !fsync_master)
|
||||
link->dai_fmt |= SND_SOC_DAIFMT_CBM_CFS;
|
||||
else
|
||||
link->dai_fmt |= SND_SOC_DAIFMT_CBS_CFS;
|
||||
|
Reference in New Issue
Block a user