summaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorMengdong Lin2015-12-02 07:11:22 +0100
committerMark Brown2015-12-08 19:05:09 +0100
commitf8f80361d07d503093940097e967a7edaa134ca2 (patch)
tree54806e1eff53dc701d9258ee204d04c67bd31177 /include/sound
parentASoC: Change 2nd argument of soc_bind_dai_link() to DAI link pointer (diff)
downloadkernel-qcow2-linux-f8f80361d07d503093940097e967a7edaa134ca2.tar.gz
kernel-qcow2-linux-f8f80361d07d503093940097e967a7edaa134ca2.tar.xz
kernel-qcow2-linux-f8f80361d07d503093940097e967a7edaa134ca2.zip
ASoC: Implement DAI links in a list & define API to add/remove a link
Implement a dai link list for the soc card. Add APIs to add/remove a DAI links dynamically, e.g. by topology. And a dobj is embedded into the struct snd_soc_dai_link. Topology can use the dobj to find the links created by it and remove them when the topology component is unloaded. The predefined DAI links are reserved to keep backward compatibility. And they will also be added to the list. Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/soc.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 232b30d3fa68..410cb0b422be 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1037,6 +1037,9 @@ struct snd_soc_dai_link {
/* pmdown_time is ignored at stop */
unsigned int ignore_pmdown_time:1;
+
+ struct list_head list; /* DAI link list of the soc card */
+ struct snd_soc_dobj dobj; /* For topology */
};
struct snd_soc_codec_conf {
@@ -1104,8 +1107,11 @@ struct snd_soc_card {
long pmdown_time;
/* CPU <--> Codec DAI links */
- struct snd_soc_dai_link *dai_link;
- int num_links;
+ struct snd_soc_dai_link *dai_link; /* predefined links only */
+ int num_links; /* predefined links only */
+ struct list_head dai_link_list; /* all links */
+ int num_dai_links;
+
struct list_head rtd_list;
int num_rtd;
@@ -1647,6 +1653,11 @@ int snd_soc_of_get_dai_link_codecs(struct device *dev,
struct device_node *of_node,
struct snd_soc_dai_link *dai_link);
+int snd_soc_add_dai_link(struct snd_soc_card *card,
+ struct snd_soc_dai_link *dai_link);
+void snd_soc_remove_dai_link(struct snd_soc_card *card,
+ struct snd_soc_dai_link *dai_link);
+
#include <sound/soc-dai.h>
#ifdef CONFIG_DEBUG_FS