ALSA: intel-nhlt: add helper to detect SSP link mask
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tue, 8 Mar 2022 19:25:54 +0000 (13:25 -0600)
committerMark Brown <broonie@kernel.org>
Wed, 9 Mar 2022 13:30:16 +0000 (13:30 +0000)
commit0c470db0399e17310ed2ba54dd1c25cfa16ce0d3
treee7eeb04faf7b19984f34afb59113d2d76c60b84d
parent92c1b7c0f780f0084f7b114be316ae4e182676e5
ALSA: intel-nhlt: add helper to detect SSP link mask

The NHLT information can be used to figure out which SSPs are enabled
in a platform.

The 'SSP' link type is too broad for machine drivers, since it can
cover the Bluetooth sideband and the analog audio codec connections,
so this helper exposes a parameter to filter with the device
type (DEVICE_I2S refers to analog audio codec in NHLT parlance).

The helper returns a mask, since more than one SSP may be used for
analog audio, e.g. the NHLT spec describes the use of SSP0 for
amplifiers and SSP1 for headset codec. Note that if more than one bit
is set, it's impossible to determine which SSP is connected to what
external component. Additional platform-specific information based on
e.g. DMI quirks would still be required in the machine driver to
configure the relevant dailinks.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20220308192610.392950-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/intel-nhlt.h
sound/hda/intel-nhlt.c