ASoC: SOF: Intel: hda-dai: remove use of cpu_dai->component drvdata
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fri, 12 May 2023 18:16:55 +0000 (13:16 -0500)
committerMark Brown <broonie@kernel.org>
Mon, 15 May 2023 11:13:58 +0000 (20:13 +0900)
commitde8e2d5d8024670eaa35ae4c9b9efb76ca6cc8de
tree2b82fde373de11909f77b0fdcef63af4dabce800
parent3886518fdb6d4c3f5a84648474a857d63749af78
ASoC: SOF: Intel: hda-dai: remove use of cpu_dai->component drvdata

The existing code relies on conversions from cpu_dai to the sdev
structure pointer based on the cpu_dai component. This works fine for
HDaudio but will not work for SoundWire DAIs which are registered by a
different component. That's a problem preventing reuse of the HDaudio
DMA stream allocation for SoundWire DAIs starting with the LunarLake
platform.

This patch introduces a set of helpers to perform the conversion, and
an indirect way of retrieving the sdev pointer based on the
swidget->comp intermediate pointer.

Suggested-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com
Reviewed-by: Rander Wang <rander.wang@intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Link: https://lore.kernel.org/r/20230512181702.117483-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
sound/soc/sof/intel/hda-dai.c