Commit 3827b7ca authored by Bard Liao's avatar Bard Liao Committed by Mark Brown

ASoC: intel: sof_sdw: add trace for dai links

We create dai links dynamically, so it is not easy to know what dai
links are created. So adding trace for dai link name and id.
Reviewed-by: default avatarRander Wang <rander.wang@intel.com>
Signed-off-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@intel.com>
Link: https://lore.kernel.org/r/20210208233336.59449-7-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent f88dcb9b
......@@ -476,15 +476,14 @@ static int get_sdw_dailink_info(const struct snd_soc_acpi_link_adr *links,
return 0;
}
static void init_dai_link(struct snd_soc_dai_link *dai_links, int be_id,
char *name, int playback, int capture,
struct snd_soc_dai_link_component *cpus,
int cpus_num,
struct snd_soc_dai_link_component *codecs,
int codecs_num,
static void init_dai_link(struct device *dev, struct snd_soc_dai_link *dai_links,
int be_id, char *name, int playback, int capture,
struct snd_soc_dai_link_component *cpus, int cpus_num,
struct snd_soc_dai_link_component *codecs, int codecs_num,
int (*init)(struct snd_soc_pcm_runtime *rtd),
const struct snd_soc_ops *ops)
{
dev_dbg(dev, "create dai link %s, id %d\n", name, be_id);
dai_links->id = be_id;
dai_links->name = name;
dai_links->platforms = platform_component;
......@@ -822,7 +821,7 @@ static int create_sdw_dailink(struct device *dev, int *be_index,
playback = (stream == SNDRV_PCM_STREAM_PLAYBACK);
capture = (stream == SNDRV_PCM_STREAM_CAPTURE);
init_dai_link(dai_links + *be_index, *be_index, name,
init_dai_link(dev, dai_links + *be_index, *be_index, name,
playback, capture,
cpus + *cpu_id, cpu_dai_num,
codecs, codec_num,
......@@ -1061,7 +1060,7 @@ static int sof_card_dai_links_create(struct device *dev,
playback = info->direction[SNDRV_PCM_STREAM_PLAYBACK];
capture = info->direction[SNDRV_PCM_STREAM_CAPTURE];
init_dai_link(links + link_id, be_id, name,
init_dai_link(dev, links + link_id, be_id, name,
playback, capture,
cpus + cpu_id, 1,
ssp_components, 1,
......@@ -1078,7 +1077,7 @@ static int sof_card_dai_links_create(struct device *dev,
/* dmic */
if (dmic_num > 0) {
cpus[cpu_id].dai_name = "DMIC01 Pin";
init_dai_link(links + link_id, be_id, "dmic01",
init_dai_link(dev, links + link_id, be_id, "dmic01",
0, 1, // DMIC only supports capture
cpus + cpu_id, 1,
dmic_component, 1,
......@@ -1086,7 +1085,7 @@ static int sof_card_dai_links_create(struct device *dev,
INC_ID(be_id, cpu_id, link_id);
cpus[cpu_id].dai_name = "DMIC16k Pin";
init_dai_link(links + link_id, be_id, "dmic16k",
init_dai_link(dev, links + link_id, be_id, "dmic16k",
0, 1, // DMIC only supports capture
cpus + cpu_id, 1,
dmic_component, 1,
......@@ -1129,7 +1128,7 @@ static int sof_card_dai_links_create(struct device *dev,
return -ENOMEM;
cpus[cpu_id].dai_name = cpu_name;
init_dai_link(links + link_id, be_id, name,
init_dai_link(dev, links + link_id, be_id, name,
1, 0, // HDMI only supports playback
cpus + cpu_id, 1,
idisp_components + i, 1,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment