All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: simple-card: Add dummy dai support simple sound card
@ 2021-02-25 12:08 Shengjiu Wang
  2021-02-25 13:15   ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Shengjiu Wang @ 2021-02-25 12:08 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, pierre-louis.bossart, stephan,
	guennadi.liakhovetski, kai.vehmanen, alsa-devel, linux-kernel

If sound card doesn't need specific codec device, just
dummy codec is enough, then we can link the dummy component
directly.

In this case, user needs to specify below setting in
devicetree. Previously the sound-dai is a node of codec,
now we check if it is zero before parsing the node, zero
means dummy component is specified.

	simple-audio-card,codec {
		sound-dai = <0>;
	};

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 sound/soc/generic/simple-card.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index c262281bc64d..8b0cabd1bad1 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -34,10 +34,19 @@ static int asoc_simple_parse_dai(struct device_node *node,
 {
 	struct of_phandle_args args;
 	int ret;
+	u32 val;
 
 	if (!node)
 		return 0;
 
+	ret = of_property_read_u32(node, DAI, &val);
+	if (val == 0) {
+		dlc->of_node       = NULL;
+		dlc->dai_name      = "snd-soc-dummy-dai";
+		dlc->name          = "snd-soc-dummy";
+		return 0;
+	}
+
 	/*
 	 * Get node via "sound-dai = <&phandle port>"
 	 * it will be used as xxx_of_node on soc_bind_dai_link()
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] ASoC: simple-card: Add dummy dai support simple sound card
  2021-02-25 12:08 [PATCH] ASoC: simple-card: Add dummy dai support simple sound card Shengjiu Wang
@ 2021-02-25 13:15   ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2021-02-25 13:15 UTC (permalink / raw)
  To: Shengjiu Wang
  Cc: lgirdwood, perex, tiwai, pierre-louis.bossart, stephan,
	guennadi.liakhovetski, kai.vehmanen, alsa-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 468 bytes --]

On Thu, Feb 25, 2021 at 08:08:32PM +0800, Shengjiu Wang wrote:

> If sound card doesn't need specific codec device, just
> dummy codec is enough, then we can link the dummy component
> directly.

This is a big red flag - what circumstances are these?  If it's a simple
CODEC with no control then the general approach is to provide a driver
which announces the capabilities of the CODEC and can be bound to as
normal, the dummy component should never actively be used.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ASoC: simple-card: Add dummy dai support simple sound card
@ 2021-02-25 13:15   ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2021-02-25 13:15 UTC (permalink / raw)
  To: Shengjiu Wang
  Cc: guennadi.liakhovetski, alsa-devel, kai.vehmanen, stephan,
	lgirdwood, linux-kernel, pierre-louis.bossart, tiwai

[-- Attachment #1: Type: text/plain, Size: 468 bytes --]

On Thu, Feb 25, 2021 at 08:08:32PM +0800, Shengjiu Wang wrote:

> If sound card doesn't need specific codec device, just
> dummy codec is enough, then we can link the dummy component
> directly.

This is a big red flag - what circumstances are these?  If it's a simple
CODEC with no control then the general approach is to provide a driver
which announces the capabilities of the CODEC and can be bound to as
normal, the dummy component should never actively be used.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ASoC: simple-card: Add dummy dai support simple sound card
  2021-02-25 13:15   ` Mark Brown
@ 2021-02-26  6:05     ` Shengjiu Wang
  -1 siblings, 0 replies; 7+ messages in thread
From: Shengjiu Wang @ 2021-02-26  6:05 UTC (permalink / raw)
  To: Mark Brown
  Cc: Shengjiu Wang, guennadi.liakhovetski, alsa-devel, kai.vehmanen,
	stephan, Liam Girdwood, linux-kernel, Pierre-Louis Bossart,
	Takashi Iwai

On Thu, Feb 25, 2021 at 9:17 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Thu, Feb 25, 2021 at 08:08:32PM +0800, Shengjiu Wang wrote:
>
> > If sound card doesn't need specific codec device, just
> > dummy codec is enough, then we can link the dummy component
> > directly.
>
> This is a big red flag - what circumstances are these?  If it's a simple
> CODEC with no control then the general approach is to provide a driver
> which announces the capabilities of the CODEC and can be bound to as
> normal, the dummy component should never actively be used.

For the DMIC, SPDIF, HDMI ARC device or other
similar device that there is no codec connected,  then dummy codec is
just used for registering the sound card.

best regards
wang shengjiu

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ASoC: simple-card: Add dummy dai support simple sound card
@ 2021-02-26  6:05     ` Shengjiu Wang
  0 siblings, 0 replies; 7+ messages in thread
From: Shengjiu Wang @ 2021-02-26  6:05 UTC (permalink / raw)
  To: Mark Brown
  Cc: guennadi.liakhovetski, alsa-devel, kai.vehmanen, stephan,
	Shengjiu Wang, Takashi Iwai, Liam Girdwood, linux-kernel,
	Pierre-Louis Bossart

On Thu, Feb 25, 2021 at 9:17 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Thu, Feb 25, 2021 at 08:08:32PM +0800, Shengjiu Wang wrote:
>
> > If sound card doesn't need specific codec device, just
> > dummy codec is enough, then we can link the dummy component
> > directly.
>
> This is a big red flag - what circumstances are these?  If it's a simple
> CODEC with no control then the general approach is to provide a driver
> which announces the capabilities of the CODEC and can be bound to as
> normal, the dummy component should never actively be used.

For the DMIC, SPDIF, HDMI ARC device or other
similar device that there is no codec connected,  then dummy codec is
just used for registering the sound card.

best regards
wang shengjiu

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ASoC: simple-card: Add dummy dai support simple sound card
  2021-02-26  6:05     ` Shengjiu Wang
@ 2021-03-02 16:32       ` Mark Brown
  -1 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2021-03-02 16:32 UTC (permalink / raw)
  To: Shengjiu Wang
  Cc: Shengjiu Wang, guennadi.liakhovetski, alsa-devel, kai.vehmanen,
	stephan, Liam Girdwood, linux-kernel, Pierre-Louis Bossart,
	Takashi Iwai

[-- Attachment #1: Type: text/plain, Size: 991 bytes --]

On Fri, Feb 26, 2021 at 02:05:29PM +0800, Shengjiu Wang wrote:
> On Thu, Feb 25, 2021 at 9:17 PM Mark Brown <broonie@kernel.org> wrote:
> > On Thu, Feb 25, 2021 at 08:08:32PM +0800, Shengjiu Wang wrote:

> > > If sound card doesn't need specific codec device, just
> > > dummy codec is enough, then we can link the dummy component
> > > directly.

> > This is a big red flag - what circumstances are these?  If it's a simple
> > CODEC with no control then the general approach is to provide a driver
> > which announces the capabilities of the CODEC and can be bound to as
> > normal, the dummy component should never actively be used.

> For the DMIC, SPDIF, HDMI ARC device or other
> similar device that there is no codec connected,  then dummy codec is
> just used for registering the sound card.

There are logical CODECs there, and we already have devices set up for
those (like dmic.c for example).  All the above cases have at least
some constraints from the spec for the interface.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ASoC: simple-card: Add dummy dai support simple sound card
@ 2021-03-02 16:32       ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2021-03-02 16:32 UTC (permalink / raw)
  To: Shengjiu Wang
  Cc: guennadi.liakhovetski, alsa-devel, kai.vehmanen, stephan,
	Shengjiu Wang, Takashi Iwai, Liam Girdwood, linux-kernel,
	Pierre-Louis Bossart

[-- Attachment #1: Type: text/plain, Size: 991 bytes --]

On Fri, Feb 26, 2021 at 02:05:29PM +0800, Shengjiu Wang wrote:
> On Thu, Feb 25, 2021 at 9:17 PM Mark Brown <broonie@kernel.org> wrote:
> > On Thu, Feb 25, 2021 at 08:08:32PM +0800, Shengjiu Wang wrote:

> > > If sound card doesn't need specific codec device, just
> > > dummy codec is enough, then we can link the dummy component
> > > directly.

> > This is a big red flag - what circumstances are these?  If it's a simple
> > CODEC with no control then the general approach is to provide a driver
> > which announces the capabilities of the CODEC and can be bound to as
> > normal, the dummy component should never actively be used.

> For the DMIC, SPDIF, HDMI ARC device or other
> similar device that there is no codec connected,  then dummy codec is
> just used for registering the sound card.

There are logical CODECs there, and we already have devices set up for
those (like dmic.c for example).  All the above cases have at least
some constraints from the spec for the interface.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-02 22:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-25 12:08 [PATCH] ASoC: simple-card: Add dummy dai support simple sound card Shengjiu Wang
2021-02-25 13:15 ` Mark Brown
2021-02-25 13:15   ` Mark Brown
2021-02-26  6:05   ` Shengjiu Wang
2021-02-26  6:05     ` Shengjiu Wang
2021-03-02 16:32     ` Mark Brown
2021-03-02 16:32       ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.