[alsa-devel] Question: Can aux_dev suspend/resume ?

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Thu Jan 16 06:28:31 CET 2020


Hi ALSA ML

I'm checking ALSA SoC framework.
Now, many Components are connected to Card.
When we want to do something to all Components,
we have 2 type of loops

1)	for_each_card_components(card, component) {
		...
	}

2)	for_each_card_rtds(card, rtd) {
		for_each_rtd_components(rtd, i, component) {
			...
		}
	}

But, I noticed that these 1) and 2) are not same.

Please double check it.
We have 3 ways to connect Component to Card.

	a) via Card pre-linked Aux  (= card->aux_dev)
	b) via Card pre-linked link (= card->dai_link)
	c) via Topology dai_link

	static int snd_soc_bind_card(struct snd_soc_card *card)
	{
		...
	a)	ret = soc_bind_aux_dev(card);
		...

		for_each_card_prelinks(card, i, dai_link) {
	b)		ret = snd_soc_add_pcm_runtime(card, dai_link);
			...
		}
		...

	c)	ret = snd_soc_card_probe(card);
		...

	X)	ret = soc_probe_link_components(card);
		...

	Y)	ret = soc_probe_aux_devices(card);
		...

Here, b) and c) has dai_link / rtd.
And, connected Component are probed at X) (= b) + c)) Y) (= a)).
Then, probed Component are connected to card->component_dev_list.
Above 1) loop is based on it.

In total, 1) and 2) loop difference are

	1) loop is for a) + b) + c)
	2) loop is for      b) + c)

Now, ALSA SoC suspend/resume checks below,
but a) doesn't have it.

	rtd->dai_link->ignore_suspend.

Thus, "suspend" is using 2) loop,
but,  "resume"  is using 1) loop.

My question here is that can AUX suspend/resume ?
I think we need/want to use 1) loop for it.

Thank you for your help !!
Best regards
---
Kuninori Morimoto


More information about the Alsa-devel mailing list