* [PATCH] ASoC: core: Support INPUT and OUTPUT DAPM widgets in DT
@ 2026-08-05 14:56 Ivaylo Dimitrov
2026-08-05 16:40 ` Mark Brown
0 siblings, 1 reply; 6+ messages in thread
From: Ivaylo Dimitrov @ 2026-08-05 14:56 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai
Cc: linux-sound, linux-kernel, Ivaylo Dimitrov
Allow the DT audio graph parser to instantiate INPUT and OUTPUT DAPM
widgets.
This extends the set of DAPM widgets that can be described in DT and
allows modelling external audio endpoints as part of the DAPM graph.
This is useful for more complex topologies, such as codec-to-codec links
or multi-DAI audio paths, where routing through external endpoints needs
to be expressed using standard DAPM routes.
Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
---
sound/soc/soc-core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 44f9bb4473f5..ce71579b5e79 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2864,6 +2864,8 @@ static const struct snd_soc_dapm_widget simple_widgets[] = {
SND_SOC_DAPM_LINE("Line", NULL),
SND_SOC_DAPM_HP("Headphone", NULL),
SND_SOC_DAPM_SPK("Speaker", NULL),
+ SND_SOC_DAPM_INPUT("Input"),
+ SND_SOC_DAPM_OUTPUT("Output"),
};
int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card,
--
2.39.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: core: Support INPUT and OUTPUT DAPM widgets in DT
2026-08-05 14:56 [PATCH] ASoC: core: Support INPUT and OUTPUT DAPM widgets in DT Ivaylo Dimitrov
@ 2026-08-05 16:40 ` Mark Brown
2026-08-05 17:16 ` Ivaylo Dimitrov
0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2026-08-05 16:40 UTC (permalink / raw)
To: Ivaylo Dimitrov
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, linux-sound,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 582 bytes --]
On Wed, Aug 05, 2026 at 05:56:25PM +0300, Ivaylo Dimitrov wrote:
> Allow the DT audio graph parser to instantiate INPUT and OUTPUT DAPM
> widgets.
> This extends the set of DAPM widgets that can be described in DT and
> allows modelling external audio endpoints as part of the DAPM graph.
> This is useful for more complex topologies, such as codec-to-codec links
> or multi-DAI audio paths, where routing through external endpoints needs
> to be expressed using standard DAPM routes.
What specific cases do you have where one of the more specific endpoint
types isn't suitable?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: core: Support INPUT and OUTPUT DAPM widgets in DT
2026-08-05 16:40 ` Mark Brown
@ 2026-08-05 17:16 ` Ivaylo Dimitrov
2026-08-05 17:23 ` Mark Brown
0 siblings, 1 reply; 6+ messages in thread
From: Ivaylo Dimitrov @ 2026-08-05 17:16 UTC (permalink / raw)
To: Mark Brown
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, linux-sound,
linux-kernel
On 5.08.26 г. 19:40 ч., Mark Brown wrote:
> On Wed, Aug 05, 2026 at 05:56:25PM +0300, Ivaylo Dimitrov wrote:
>
>> Allow the DT audio graph parser to instantiate INPUT and OUTPUT DAPM
>> widgets.
>
>> This extends the set of DAPM widgets that can be described in DT and
>> allows modelling external audio endpoints as part of the DAPM graph.
>> This is useful for more complex topologies, such as codec-to-codec links
>> or multi-DAI audio paths, where routing through external endpoints needs
>> to be expressed using standard DAPM routes.
>
> What specific cases do you have where one of the more specific endpoint
> types isn't suitable?
The use case is a codec-to-codec DAI connection, where the remote
endpoint is another digital audio interface (for example a modem or
Bluetooth codec), rather than a physical microphone, speaker or
line-level interface.
I have an out-of-tree audio-graph-card2 based machine description for
Motorola OMAP4 devices using the CPCAP codec together with an external
modem codec. Without modelling the remote endpoint as a DAPM
INPUT/OUTPUT widget, the DAPM graph is incomplete and one side of the
codec-to-codec link does not become active as expected, so runtime PM
does not resume one of the devices in the link during a call.
With this change, voice calls using the audio-graph-card2 based machine
description work correctly, as the codec-to-codec DAPM path is properly
represented.
The topology I'm referring to is here:
https://git.maemo.org/leste-upstream-forks/droid4-linux/src/branch/leste/maemo-6.18.y/arch/arm/boot/dts/ti/omap/motorola-mapphone-handset.dtsi#L65
The hardware schematic diagram is here:
https://lkml.org/lkml/2018/3/27/1225
I used INPUT/OUTPUT because they appear to be the generic DAPM endpoint
widgets for this type of digital connection. If there is a more
appropriate existing widget type for modelling such a remote DAI
endpoint, I'd be happy to use that instead.
Thanks,
Ivo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: core: Support INPUT and OUTPUT DAPM widgets in DT
2026-08-05 17:16 ` Ivaylo Dimitrov
@ 2026-08-05 17:23 ` Mark Brown
2026-08-05 21:36 ` Ivaylo Dimitrov
2026-08-06 6:14 ` Ivaylo Dimitrov
0 siblings, 2 replies; 6+ messages in thread
From: Mark Brown @ 2026-08-05 17:23 UTC (permalink / raw)
To: Ivaylo Dimitrov
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, linux-sound,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1000 bytes --]
On Wed, Aug 05, 2026 at 08:16:10PM +0300, Ivaylo Dimitrov wrote:
> I have an out-of-tree audio-graph-card2 based machine description for
> Motorola OMAP4 devices using the CPCAP codec together with an external modem
> codec. Without modelling the remote endpoint as a DAPM INPUT/OUTPUT widget,
> the DAPM graph is incomplete and one side of the codec-to-codec link does
> not become active as expected, so runtime PM does not resume one of the
> devices in the link during a call.
Why is it appropriate that the remote endpoint be a raw widget of this
non-specific type?
> I used INPUT/OUTPUT because they appear to be the generic DAPM endpoint
> widgets for this type of digital connection. If there is a more appropriate
> existing widget type for modelling such a remote DAI endpoint, I'd be happy
> to use that instead.
If it's a DAI to DAI link you need a custom machine driver, we don't
have anything like the infrastructure to put DAI<->DAI links in DT.
These should be using AIF widgets.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: core: Support INPUT and OUTPUT DAPM widgets in DT
2026-08-05 17:23 ` Mark Brown
@ 2026-08-05 21:36 ` Ivaylo Dimitrov
2026-08-06 6:14 ` Ivaylo Dimitrov
1 sibling, 0 replies; 6+ messages in thread
From: Ivaylo Dimitrov @ 2026-08-05 21:36 UTC (permalink / raw)
To: Mark Brown
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, linux-sound,
linux-kernel
On 5.08.26 г. 20:23 ч., Mark Brown wrote:
> On Wed, Aug 05, 2026 at 08:16:10PM +0300, Ivaylo Dimitrov wrote:
>
>> I have an out-of-tree audio-graph-card2 based machine description for
>> Motorola OMAP4 devices using the CPCAP codec together with an external modem
>> codec. Without modelling the remote endpoint as a DAPM INPUT/OUTPUT widget,
>> the DAPM graph is incomplete and one side of the codec-to-codec link does
>> not become active as expected, so runtime PM does not resume one of the
>> devices in the link during a call.
>
> Why is it appropriate that the remote endpoint be a raw widget of this
> non-specific type?
>
>> I used INPUT/OUTPUT because they appear to be the generic DAPM endpoint
>> widgets for this type of digital connection. If there is a more appropriate
>> existing widget type for modelling such a remote DAI endpoint, I'd be happy
>> to use that instead.
>
> If it's a DAI to DAI link you need a custom machine driver, we don't
> have anything like the infrastructure to put DAI<->DAI links in DT.
> These should be using AIF widgets.
Ok, that discussion helped me remember the original reason for the patch.
The issue was not the codec-to-codec DAI link itself. The modem codec
has playback and capture streams which both need to stay active during a
voice call, but there was no DAPM path coupling them, so one side of the
link was not getting activated and runtime PM did not resume the
corresponding device.
I dropped the DT INPUT/OUTPUT widget addition and the corresponding DT
routing, and instead added a small DAPM graph fragment in the modem
codec driver:
SND_SOC_DAPM_MIXER("Voice Call", SND_SOC_NOPM, 0, 0, NULL, 0)
{
"Voice Call", NULL, "Voice Call Playback",
},
{
"Voice Call Capture", NULL, "Voice Call",
},
This represents the internal hostless voice-call path in the modem codec
and makes the codec2codec voice call work.
This may not be the final form I want to use, but it seems to be the
right place for this piece of topology since it is a property of the
modem codec rather than of the board routing. I will revisit the
representation when I prepare the modem codec driver for upstream
submission.
Thanks for the clarification.
Ivo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: core: Support INPUT and OUTPUT DAPM widgets in DT
2026-08-05 17:23 ` Mark Brown
2026-08-05 21:36 ` Ivaylo Dimitrov
@ 2026-08-06 6:14 ` Ivaylo Dimitrov
1 sibling, 0 replies; 6+ messages in thread
From: Ivaylo Dimitrov @ 2026-08-06 6:14 UTC (permalink / raw)
To: Mark Brown
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, linux-sound,
linux-kernel
On 5.08.26 г. 20:23 ч., Mark Brown wrote:
> On Wed, Aug 05, 2026 at 08:16:10PM +0300, Ivaylo Dimitrov wrote:
>
>> I have an out-of-tree audio-graph-card2 based machine description for
>> Motorola OMAP4 devices using the CPCAP codec together with an external modem
>> codec. Without modelling the remote endpoint as a DAPM INPUT/OUTPUT widget,
>> the DAPM graph is incomplete and one side of the codec-to-codec link does
>> not become active as expected, so runtime PM does not resume one of the
>> devices in the link during a call.
>
> Why is it appropriate that the remote endpoint be a raw widget of this
> non-specific type?
>
>> I used INPUT/OUTPUT because they appear to be the generic DAPM endpoint
>> widgets for this type of digital connection. If there is a more appropriate
>> existing widget type for modelling such a remote DAI endpoint, I'd be happy
>> to use that instead.
>
> If it's a DAI to DAI link you need a custom machine driver, we don't
> have anything like the infrastructure to put DAI<->DAI links in DT.
> These should be using AIF widgets.
Thanks for the pointer. It turned out that everything needed was already
there; I had simply misunderstood the codec2codec example (or perhaps it
could be a bit clearer).
The missing piece was to route the modem DAI stream widgets to the CPCAP
AIF widgets in the audio-graph-card2 routing:
/* codec2codec */
"Voice RX", "Voice Call Playback",
"Voice Call Capture", "Voice TX";
With that in place, the codec-to-codec DAPM graph is complete and voice
calls work correctly, so there is no need for my DT parser patch after all.
I'm sending this follow-up mainly as a reference in case someone else
runs into the same issue in the future.
Thanks again for pointing me in the right direction.
Best regards,
Ivo
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-08-06 6:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-05 14:56 [PATCH] ASoC: core: Support INPUT and OUTPUT DAPM widgets in DT Ivaylo Dimitrov
2026-08-05 16:40 ` Mark Brown
2026-08-05 17:16 ` Ivaylo Dimitrov
2026-08-05 17:23 ` Mark Brown
2026-08-05 21:36 ` Ivaylo Dimitrov
2026-08-06 6:14 ` Ivaylo Dimitrov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox