diff mbox series

[v4,16/23] ASoC: soc-pcm: Get all BEs along DAPM path

Message ID 1593233625-14961-17-git-send-email-spujar@nvidia.com (mailing list archive)
State New, archived
Headers show
Series Add support for Tegra210 Audio | expand

Commit Message

Sameer Pujar June 27, 2020, 4:53 a.m. UTC
dpcm_end_walk_at_be() stops the graph walk when first BE is found for
the given FE component. In a component model we may want to connect
multiple DAIs from different components. A new flag is introduced in
'snd_soc_card', which when set allows DAI/component chaining. Later
PCM operations can be called for all these listed components for a
valid DAPM path.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
---
 include/sound/soc.h | 1 +
 sound/soc/soc-pcm.c | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

Kuninori Morimoto June 29, 2020, 1:41 a.m. UTC | #1
Hi Sameer

> dpcm_end_walk_at_be() stops the graph walk when first BE is found for
> the given FE component. In a component model we may want to connect
> multiple DAIs from different components. A new flag is introduced in
> 'snd_soc_card', which when set allows DAI/component chaining. Later
> PCM operations can be called for all these listed components for a
> valid DAPM path.
(snip)
> @@ -1069,6 +1069,7 @@ struct snd_soc_card {
>  	int num_of_dapm_widgets;
>  	const struct snd_soc_dapm_route *of_dapm_routes;
>  	int num_of_dapm_routes;
> +	bool component_chaining;

snd_soc_card has many /* bit field */ variables.
Please use it instead of bool.

Thank you for your help !!

Best regards
---
Kuninori Morimoto
Sameer Pujar June 29, 2020, 5:29 p.m. UTC | #2
On 6/29/2020 7:11 AM, Kuninori Morimoto wrote:
> External email: Use caution opening links or attachments
>
>
> Hi Sameer
>
>> dpcm_end_walk_at_be() stops the graph walk when first BE is found for
>> the given FE component. In a component model we may want to connect
>> multiple DAIs from different components. A new flag is introduced in
>> 'snd_soc_card', which when set allows DAI/component chaining. Later
>> PCM operations can be called for all these listed components for a
>> valid DAPM path.
> (snip)
>> @@ -1069,6 +1069,7 @@ struct snd_soc_card {
>>        int num_of_dapm_widgets;
>>        const struct snd_soc_dapm_route *of_dapm_routes;
>>        int num_of_dapm_routes;
>> +     bool component_chaining;
> snd_soc_card has many /* bit field */ variables.
> Please use it instead of bool.

OK, will use.
>
> Thank you for your help !!
>
> Best regards
> ---
> Kuninori Morimoto
diff mbox series

Patch

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 1e0376f..95e02a7 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1069,6 +1069,7 @@  struct snd_soc_card {
 	int num_of_dapm_widgets;
 	const struct snd_soc_dapm_route *of_dapm_routes;
 	int num_of_dapm_routes;
+	bool component_chaining;
 
 	/* lists of probed devices belonging to this card */
 	struct list_head component_dev_list;
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 6dc21b6..7f612e3 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -1322,7 +1322,8 @@  int dpcm_path_get(struct snd_soc_pcm_runtime *fe,
 
 	/* get number of valid DAI paths and their widgets */
 	paths = snd_soc_dapm_dai_get_connected_widgets(cpu_dai, stream, list,
-			dpcm_end_walk_at_be);
+			fe->card->component_chaining ?
+				NULL : dpcm_end_walk_at_be);
 
 	dev_dbg(fe->dev, "ASoC: found %d audio %s paths\n", paths,
 			stream ? "capture" : "playback");