summaryrefslogtreecommitdiff
path: root/sound/soc/intel/boards
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2023-08-08 16:20:08 +0300
committerMark Brown <broonie@kernel.org>2023-08-08 20:57:21 +0300
commit0e82229fb74a26cfaf6ae3772cbdefdb643f98a5 (patch)
tree03e1c9bc0d65738c77549c408f4750ccfdf6d4ee /sound/soc/intel/boards
parentc3d7e29ad82ee689b1adf5ea7806b9d06eb098c0 (diff)
downloadlinux-0e82229fb74a26cfaf6ae3772cbdefdb643f98a5.tar.xz
ASoC: intel: sof_sdw: Update DLC index each time one is added
In create_sdw_dailink, rather than bulk updating the index into the DAI link components array, at the end of processing a link, do so each time the code adds a new component. This simplifies things slightly, as an intermediate variable is no longer needed to track the current place in the DAI link components array. Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230808132013.889419-7-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/boards')
-rw-r--r--sound/soc/intel/boards/sof_sdw.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c
index 5c154628236c..b381fb261994 100644
--- a/sound/soc/intel/boards/sof_sdw.c
+++ b/sound/soc/intel/boards/sof_sdw.c
@@ -1387,7 +1387,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, int *link_index,
}
for (j = adr_index; j < adr_link_next->num_adr; j++) {
- int codec_index, comp_index;
+ int codec_index;
u64 adr = adr_link_next->adr_d[j].adr;
codec_index = find_codec_info_part(adr);
@@ -1399,24 +1399,22 @@ static int create_sdw_dailink(struct snd_soc_card *card, int *link_index,
}
_codec_index = codec_index;
- comp_index = j - adr_index + codec_dlc_index;
-
ret = fill_sdw_codec_dlc(dev, adr_link_next,
- &codecs[comp_index],
+ &codecs[codec_dlc_index],
codec_index, j, dai_index);
if (ret)
return ret;
- codec_conf[*codec_conf_index].dlc = codecs[comp_index];
+ codec_conf[*codec_conf_index].dlc = codecs[codec_dlc_index];
codec_conf[*codec_conf_index].name_prefix =
adr_link_next->adr_d[j].name_prefix;
+ codec_dlc_index++;
(*codec_conf_index)++;
}
/* check next link to create codec dai in the processed group */
i++;
- codec_dlc_index += adr_link_next->num_adr;
}
/* find codec info to create BE DAI */