From d187b0a68efa486f95c0b3de32336b256a382b7b Mon Sep 17 00:00:00 2001 From: Libin Yang Date: Mon, 7 Mar 2022 22:07:22 +0800 Subject: [PATCH] ASoC: intel: sof_sdw: adjust BE id for AMP Some AMPs, such as rt1308, don't support capture stream. While others, such as rt1316, support capture stream. This will cause AMPs use different number of BE id. This may cause HDMI BE ids are different if there are no SDW DMICs on different configurations. This patch always assigns one BE id to AMP capture stream (no matter the capture stream really exists or not). This will simplify the topolgy development. Topology developer doesn't need to calculate the HDMI ID manually. Signed-off-by: Libin Yang --- sound/soc/intel/boards/sof_sdw.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index b37859a44ab066..b8b007368d63d4 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1229,6 +1229,18 @@ static int sof_card_dai_links_create(struct device *dev, } } + /* + * BE id fixup + * AMP is always assigned one capture BE ID no matter + * it has capture link or not + * So if be_id is SDW_AMP_DAI_ID + 1, it mean + * the AMP capture BE ID is not reserved. Let's + * adjust it to the proper value before going through + * the other links. + */ + if (be_id == SDW_AMP_DAI_ID + 1) + be_id++; + SSP: /* SSP */ if (!ssp_num)