Skip to contentSkip to conversation

ASoC: topology: Add support for FE DAI & DAI links

PATCH In review [email protected] 1 participant 4 messages Feb 16, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v3 cover ASoC: topology: Add support for FE DAI & DAI links

From: Mengdong Lin <[email protected]>

This series allows topology to create FE DAI and DAI links from the PCM topology objects defined by the user space.

History:
v2: Remove first 2 patches in v1 that were accepted.
Add Ack by Takashi to patch 'ALSA: pcm: Add snd_pcm_rate_range_to_bits()' and add his comments on the function's assumption to c file.

v3: remove 1st patch in v2 that was accepted.
Revise setting of a stream's rates/rate_min/rate_max as Lars suggested.

Mengdong Lin (2):
ASoC: topology: Add FE DAIs dynamically
ASoC: topology: Add FE DAI links dynamically

 include/sound/soc-topology.h |  21 +++--
 include/sound/soc.h          |   2 +-
 sound/soc/soc-topology.c     | 195 ++++++++++++++++++++++++++++++++++---------
 3 files changed, 165 insertions(+), 53 deletions(-)
Signature · 1 line
2.5.0
#1 lore raw

PATCH v3 1/2 ASoC: topology: Add FE DAIs dynamically

From: Mengdong Lin <[email protected]>

Topology will create FE DAIs dynamically from the PCM objects, and register them to the component.

A PCM topoplogy object describes a FE DAI and DAI link. Later patch will add FE DAI links as well.

Change tplg load ops for DAI:
- Only process a DAI.
- Pass the DAI driver pointer to the component driver for extra initialization.

include/sound/soc-topology.h +4 -11
index 73713e6..ec562d0 100644
@@ -56,12 +56,6 @@ struct snd_soc_dobj_widget {
 	unsigned int kcontrol_enum:1;	/* this widget is an enum kcontrol */
 };
 
-/* dynamic PCM DAI object */
-struct snd_soc_dobj_pcm_dai {
-	struct snd_soc_tplg_pcm_dai *pd;
-	unsigned int count;
-};
-
 /* generic dynamic object - all dynamic objects belong to this struct */
 struct snd_soc_dobj {
 	enum snd_soc_dobj_type type;
@@ -71,7 +65,6 @@ struct snd_soc_dobj {
 	union {
 		struct snd_soc_dobj_control control;
 		struct snd_soc_dobj_widget widget;
-		struct snd_soc_dobj_pcm_dai pcm_dai;
 	};
 	void *private; /* core does not touch this */
 };
@@ -126,10 +119,10 @@ struct snd_soc_tplg_ops {
 	int (*widget_unload)(struct snd_soc_component *,
 		struct snd_soc_dobj *);
 
-	/* FE - used for any driver specific init */
-	int (*pcm_dai_load)(struct snd_soc_component *,
-		struct snd_soc_tplg_pcm_dai *pcm_dai, int num_fe);
-	int (*pcm_dai_unload)(struct snd_soc_component *,
+	/* FE DAI - used for any driver specific init */
+	int (*dai_load)(struct snd_soc_component *,
+		struct snd_soc_dai_driver *dai_drv);
+	int (*dai_unload)(struct snd_soc_component *,
 		struct snd_soc_dobj *);
 
 	/* callback to handle vendor bespoke data */
include/sound/soc.h +1 -1
index 7afb72c..02b4a21 100644
@@ -27,7 +27,6 @@
 #include <sound/compress_driver.h>
 #include <sound/control.h>
 #include <sound/ac97_codec.h>
-#include <sound/soc-topology.h>
 
 /*
  * Convenience kcontrol builders
@@ -404,6 +403,7 @@ struct snd_soc_jack_zone;
 struct snd_soc_jack_pin;
 #include <sound/soc-dapm.h>
 #include <sound/soc-dpcm.h>
+#include <sound/soc-topology.h>
 
 struct snd_soc_jack_gpio;
 
sound/soc/soc-topology.c +87 -42

184 lines not on this page · raw message

Signature · 1 line
2.5.0
#2 lore raw

PATCH v3 2/2 ASoC: topology: Add FE DAI links dynamically

In reply to [email protected]

From: Mengdong Lin <[email protected]>

Topology will also create FE DAI links dynamically from the PCM objects. These links will be removed when the component is removed and its topology info is unloaded.

The component driver can implement link_load/unload ops for extra intialization (e.g. error check) and destruction.

include/sound/soc-topology.h +6 -0
index ec562d0..d318fe4 100644
@@ -125,6 +125,12 @@ struct snd_soc_tplg_ops {
 	int (*dai_unload)(struct snd_soc_component *,
 		struct snd_soc_dobj *);
 
+	/* DAI link - used for any driver specific init */
+	int (*link_load)(struct snd_soc_component *,
+		struct snd_soc_dai_link *link);
+	int (*link_unload)(struct snd_soc_component *,
+		struct snd_soc_dobj *);
+
 	/* callback to handle vendor bespoke data */
 	int (*vendor_load)(struct snd_soc_component *,
 		struct snd_soc_tplg_hdr *);
sound/soc/soc-topology.c +69 -1

97 lines not on this page · raw message

Signature · 1 line
2.5.0
#3 lore raw
In reply to [email protected]

Please overlook this v3 series, since the v2 were just applied.

I've sent out a separate patch to fix setting of a stream's rates:
[PATCH] ASoC: topology: Fix setting of stream rates, rate_min and rate_max

Quoted 23 lines · On 02/16/2016 01:39 PM, [email protected] wrote:

From: Mengdong Lin <[email protected]>

This series allows topology to create FE DAI and DAI links from the PCM topology objects defined by the user space.

History:
v2: Remove first 2 patches in v1 that were accepted.
Add Ack by Takashi to patch 'ALSA: pcm: Add snd_pcm_rate_range_to_bits()' and add his comments on the function's assumption to c file.

v3: remove 1st patch in v2 that was accepted.
Revise setting of a stream's rates/rate_min/rate_max as Lars suggested.

Mengdong Lin (2):
ASoC: topology: Add FE DAIs dynamically
ASoC: topology: Add FE DAI links dynamically

  include/sound/soc-topology.h |  21 +++--
  include/sound/soc.h          |   2 +-
  sound/soc/soc-topology.c     | 195 ++++++++++++++++++++++++++++++++++---------
  3 files changed, 165 insertions(+), 53 deletions(-)