aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/intel/boards/sof_sdw_common.h
diff options
context:
space:
mode:
authorGravatar Bard Liao <yung-chuan.liao@linux.intel.com> 2023-06-02 15:22:00 -0500
committerGravatar Mark Brown <broonie@kernel.org> 2023-06-05 14:00:10 +0100
commitb274586533f516b35519f409a4d089341a9c2690 (patch)
treef1ff9480dbf49de5feae4c8a1f629c61a714811c /sound/soc/intel/boards/sof_sdw_common.h
parentASoC: Intel: sof_sdw: add dai info (diff)
downloadlinux-b274586533f516b35519f409a4d089341a9c2690.tar.gz
linux-b274586533f516b35519f409a4d089341a9c2690.tar.bz2
linux-b274586533f516b35519f409a4d089341a9c2690.zip
ASoC: Intel: sof_sdw: use predefine dailink id
Currently, we assign dailink ids in order, and shift with codec type. The purpose is to have consistent dailink ids for topologies. This can be simplified if we have a predefined dailink id in sof_sdw_dai_info. We reuse the existing ids as the predefine ids. So the dailink ids will not be changed by this commit. With this change, we no longer need to check the adr order described in a snd_soc_acpi_link_adr array. Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20230602202225.249209-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/boards/sof_sdw_common.h')
-rw-r--r--sound/soc/intel/boards/sof_sdw_common.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h
index e6d539bd63ec..def2d47323bf 100644
--- a/sound/soc/intel/boards/sof_sdw_common.h
+++ b/sound/soc/intel/boards/sof_sdw_common.h
@@ -15,7 +15,11 @@
#define MAX_NO_PROPS 2
#define MAX_HDMI_NUM 4
-#define SDW_AMP_DAI_ID 2
+#define SDW_UNUSED_DAI_ID -1
+#define SDW_JACK_OUT_DAI_ID 0
+#define SDW_JACK_IN_DAI_ID 1
+#define SDW_AMP_OUT_DAI_ID 2
+#define SDW_AMP_IN_DAI_ID 3
#define SDW_DMIC_DAI_ID 4
#define SDW_MAX_CPU_DAIS 16
#define SDW_INTEL_BIDIR_PDI_BASE 2
@@ -68,6 +72,7 @@ struct sof_sdw_dai_info {
const bool direction[2]; /* playback & capture support */
const char *dai_name;
const int dai_type;
+ const int dailink[2]; /* dailink id for each direction */
int (*init)(struct snd_soc_card *card,
const struct snd_soc_acpi_link_adr *link,
struct snd_soc_dai_link *dai_links,