]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: hda: intel-nhlt: add intel_nhlt_ssp_mclk_mask()
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Mon, 19 Sep 2022 11:53:49 +0000 (13:53 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 20 Sep 2022 11:25:03 +0000 (12:25 +0100)
commitebc31edd7cb0477467e81469d1c88b3e4c647553
treeea24a57f2a4a8bdb2a0c05cbb4aeaf901132a1af
parentdad4713f16c7c0b739f9959e5358a317a028f295
ALSA: hda: intel-nhlt: add intel_nhlt_ssp_mclk_mask()

SOF topologies hard-code the MCLK used for SSP connections. That was a
bad idea in hindsight, this information should really come from BIOS
and/or machine driver.

This patch introduces a helper to scan all SSP endpoints connected to
a codec, and all formats to see what MCLK is used. When BIT(0) of the
mdivc offset if set in the SSP blob, MCLK0 is used, and likewise when
BIT(1) is set MCLK1 is used.

The case where both MCLKs are used is possible but has never been seen
in practice so should be treated as an error by the caller.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20220919115350.43104-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/intel-nhlt.h
sound/hda/intel-nhlt.c