ASoC: use snd_soc_dai_link_component style for simple card
Kuninori Morimoto
maintainerv2 cover ASoC: use snd_soc_dai_link_component style for simple card
Hi Mark
These are v2 patch of snd_soc_dai_link_component style conversion for simple/audo card driver.
The difference between v1 and v2 was "platform series" was missing code for DT, and tidyuped unreadable code.
[current]
struct snd_soc_dai_link {
...
*cpu_name;
*cpu_of_node;
*cpu_dai_name;
*codec_name;
*codec_of_node;
*codec_dai_name;
*codecs;
num_codecs;
*platform_name;
*platform_of_node;
...
}
[we want]
struct snd_soc_dai_link {
...
*cpus
num_cpus;
*codecs;
num_codecs;
*platform;
...
}Kuninori Morimoto (15):
ASoC: simple_card_utils: support snd_soc_dai_link_component style for codec
ASoC: simple-card: support snd_soc_dai_link_component style for codec
ASoC: simple-scu-card: use simple_dai_props
ASoC: simple-scu-card: support snd_soc_dai_link_component style for codec
ASoC: audio-graph-card: support snd_soc_dai_link_component style for codec
ASoC: audio-graph-scu-card: use simple_dai_props
ASoC: audio-graph-scu-card: support snd_soc_dai_link_component style for codec
ASoC: simple-card-util: remove dai_link compatible code for codec
ASoC: soc-core: use snd_soc_dai_link_component for platform
ASoC: simple-card-util: support snd_soc_dai_link_component style for platform
ASoC: simple-card: support snd_soc_dai_link_component style for platform
ASoC: simple-scu-card: support snd_soc_dai_link_component style for platform
ASoC: audio-graph-card: support snd_soc_dai_link_component style for platform
ASoC: audio-graph-scu-card: support snd_soc_dai_link_component style for platform
ASoC: simple-card-util: remove dai_link compatible code for platform
include/sound/simple_card_utils.h | 27 ++++++++++------ include/sound/soc.h | 2 ++ sound/soc/generic/audio-graph-card.c | 18 +++++++++-- sound/soc/generic/audio-graph-scu-card.c | 55 +++++++++++++++++++++----------- sound/soc/generic/simple-card-utils.c | 47 ++++++++++++++++++++++++--- sound/soc/generic/simple-card.c | 30 ++++++++++++++--- sound/soc/generic/simple-scu-card.c | 54 ++++++++++++++++++++----------- sound/soc/soc-core.c | 48 ++++++++++++++++++++++++---- 8 files changed, 217 insertions(+), 64 deletions(-)
Signature · 1 line
2.7.4
Kuninori Morimoto
maintainerPATCH v2 1/15 ASoC: simple_card_utils: support snd_soc_dai_link_component style for codec
From: Kuninori Morimoto <[email protected]>
Current ASoC is supporting snd_soc_dai_link_component for binding, it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs). CPU will support multi style in the future.
We want to have it on Platform too in the future.
If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for simple_card_utils for codec.
[current]
struct snd_soc_dai_link {
...
*cpu_name;
*cpu_of_node;
*cpu_dai_name;
*codec_name;
*codec_of_node;
*codec_dai_name;
*codecs;
num_codecs;
*platform_name;
*platform_of_node;
...
}[in the future]
struct snd_soc_dai_link {
...
*cpus
num_cpus;
*codecs;
num_codecs;
*platform;
...
}--- include/sound/simple_card_utils.h | 27 ++++++++++++++-------- sound/soc/generic/simple-card-utils.c | 42 +++++++++++++++++++++++++++++++++-- 2 files changed, 58 insertions(+), 11 deletions(-)
include/sound/simple_card_utils.h +18 -9
@@ -51,29 +51,35 @@ int asoc_simple_card_parse_card_name(struct snd_soc_card *card,#define asoc_simple_card_parse_clk_cpu (dev, node, dai_link, simple_dai) \ asoc_simple_card_parse_clk(dev, node, dai_link->cpu_of_node, simple_dai, \ - dai_link->cpu_dai_name) + dai_link->cpu_dai_name, NULL)#define asoc_simple_card_parse_clk_codec (dev, node, dai_link, simple_dai) \ asoc_simple_card_parse_clk(dev, node, dai_link->codec_of_node, simple_dai,\ - dai_link->codec_dai_name) + dai_link->codec_dai_name, dai_link->codecs)int asoc_simple_card_parse_clk (struct device *dev,struct device_node *node,struct device_node *dai_of_node,struct asoc_simple_dai *simple_dai, -const char *name); +const char *dai_name, +struct snd_soc_dai_link_component *dlc);int asoc_simple_card_clk_enable (struct asoc_simple_dai *dai);void asoc_simple_card_clk_disable (struct asoc_simple_dai *dai);#define asoc_simple_card_parse_cpu (node, dai_link, \ list_name, cells_name, is_single_link) \ - asoc_simple_card_parse_dai(node, &dai_link->cpu_of_node, \ + asoc_simple_card_parse_dai(node, NULL, \ + &dai_link->cpu_of_node, \ &dai_link->cpu_dai_name, list_name, cells_name, is_single_link)#define asoc_simple_card_parse_codec (node, dai_link, list_name, cells_name) \ - asoc_simple_card_parse_dai(node, &dai_link->codec_of_node, \ - &dai_link->codec_dai_name, list_name, cells_name, NULL) + asoc_simple_card_parse_dai(node, dai_link->codecs, \ + &dai_link->codec_of_node, \ + &dai_link->codec_dai_name, \ + list_name, cells_name, NULL)#define asoc_simple_card_parse_platform (node, dai_link, list_name, cells_name) \ - asoc_simple_card_parse_dai(node, &dai_link->platform_of_node, \ + asoc_simple_card_parse_dai(node, NULL, \ + &dai_link->platform_of_node, \ NULL, list_name, cells_name, NULL) int asoc_simple_card_parse_dai(struct device_node *node, + struct snd_soc_dai_link_component *dlc, struct device_node **endpoint_np, const char **dai_name, const char *list_name,
@@ -81,12 +87,15 @@ int asoc_simple_card_parse_dai(struct device_node *node, int *is_single_links);#define asoc_simple_card_parse_graph_cpu (ep, dai_link) \ - asoc_simple_card_parse_graph_dai(ep, &dai_link->cpu_of_node, \ + asoc_simple_card_parse_graph_dai(ep, NULL, \ + &dai_link->cpu_of_node, \ &dai_link->cpu_dai_name)#define asoc_simple_card_parse_graph_codec (ep, dai_link) \ - asoc_simple_card_parse_graph_dai(ep, &dai_link->codec_of_node, \ + asoc_simple_card_parse_graph_dai(ep, dai_link->codecs, \ + &dai_link->codec_of_node, \ &dai_link->codec_dai_name)int asoc_simple_card_parse_graph_dai (struct device_node *ep, +struct snd_soc_dai_link_component *dlc,struct device_node **endpoint_np,const char **dai_name);
sound/soc/generic/simple-card-utils.c +40 -2
89 lines not on this page · raw message
Signature · 1 line
2.7.4
Kuninori Morimoto
maintainerPATCH v2 2/15 ASoC: simple-card: support snd_soc_dai_link_component style for codec
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
Current ASoC is supporting snd_soc_dai_link_component for binding, it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs). CPU will support multi style in the future.
We want to have it on Platform too in the future.
If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for simple-card for codec.
[current]
struct snd_soc_dai_link {
...
*cpu_name;
*cpu_of_node;
*cpu_dai_name;
*codec_name;
*codec_of_node;
*codec_dai_name;
*codecs;
num_codecs;
*platform_name;
*platform_of_node;
...
}[in the future]
struct snd_soc_dai_link {
...
*cpus
num_cpus;
*codecs;
num_codecs;
*platform;
...
}--- sound/soc/generic/simple-card.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-)
sound/soc/generic/simple-card.c +19 -4
@@ -20,6 +20,7 @@ struct simple_card_data {struct simple_dai_props {struct asoc_simple_dai cpu_dai;struct asoc_simple_dai codec_dai; +struct snd_soc_dai_link_component codecs;/* single codec */ unsigned int mclk_fs; } *dai_props;unsigned int mclk_fs;
@@ -234,7 +235,7 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, ret =asoc_simple_card_set_dailink_name (dev, dai_link,"%s-%s" , dai_link->cpu_dai_name, - dai_link->codec_dai_name); + dai_link->codecs->dai_name);if (ret <0 ) goto dai_link_of_err;
@@ -363,7 +364,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct device_node *np = dev->of_node;struct snd_soc_card *card; -int num, ret; +int num, ret, i;/* Get the number of DAI links */ if (np &&of_get_child_by_name (np,PREFIX "dai-link" ))
@@ -381,6 +382,17 @@ static int asoc_simple_card_probe(struct platform_device *pdev)if (!dai_props || !dai_link)return -ENOMEM ; +/* +* Use snd_soc_dai_link_component instead of legacy style +* It is codec only. but cpu/platform will be supported in the future. +* see +* soc-core.c :: snd_soc_init_multicodec() +*/ +for (i =0 ; i < num; i++) { + dai_link[i].codecs = &dai_props[i].codecs; + dai_link[i].num_codecs =1 ; + } + priv->dai_props = dai_props; priv->dai_link = dai_link;
@@ -403,6 +415,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev) }else {struct asoc_simple_card_info *cinfo; +struct snd_soc_dai_link_component *codecs; cinfo = dev->platform_data;if (!cinfo) {
@@ -419,13 +432,15 @@ static int asoc_simple_card_probe(struct platform_device *pdev)return -EINVAL ; } + codecs = dai_link->codecs; + codecs->name = cinfo->codec; + codecs->dai_name = cinfo->codec_dai.name; + card->name = (cinfo->card) ? cinfo->card : cinfo->name; dai_link->name = cinfo->name; dai_link->stream_name = cinfo->name; dai_link->platform_name = cinfo->platform; - dai_link->codec_name = cinfo->codec; dai_link->cpu_dai_name = cinfo->cpu_dai.name; - dai_link->codec_dai_name = cinfo->codec_dai.name; dai_link->dai_fmt = cinfo->daifmt; dai_link->init = asoc_simple_card_dai_init; memcpy(&priv->dai_props->cpu_dai, &cinfo->cpu_dai,
Signature · 1 line
2.7.4
Mark Brown
maintainerApplied "ASoC: simple-card: support snd_soc_dai_link_component style for codec" to the asoc tree
The patch
ASoC: simple-card: support snd_soc_dai_link_component style for codec
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
710af9196ce614ee02185c2ec55e617a71843183Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <[email protected]>
Date: Fri, 31 Aug 2018 03:08:24 +0000
Subject: [PATCH] ASoC: simple-card: support snd_soc_dai_link_component style
for codec
Current ASoC is supporting snd_soc_dai_link_component for binding, it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs). CPU will support multi style in the future.
We want to have it on Platform too in the future.
If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for simple-card for codec.
[current]
struct snd_soc_dai_link {
...
*cpu_name;
*cpu_of_node;
*cpu_dai_name;
*codec_name;
*codec_of_node;
*codec_dai_name;
*codecs;
num_codecs;
*platform_name;
*platform_of_node;
...
}[in the future]
struct snd_soc_dai_link {
...
*cpus
num_cpus;
*codecs;
num_codecs;
*platform;
...
}--- sound/soc/generic/simple-card.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-)
sound/soc/generic/simple-card.c +19 -4
@@ -20,6 +20,7 @@ struct simple_card_data {struct simple_dai_props {struct asoc_simple_dai cpu_dai;struct asoc_simple_dai codec_dai; +struct snd_soc_dai_link_component codecs;/* single codec */ unsigned int mclk_fs; } *dai_props;unsigned int mclk_fs;
@@ -234,7 +235,7 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, ret =asoc_simple_card_set_dailink_name (dev, dai_link,"%s-%s" , dai_link->cpu_dai_name, - dai_link->codec_dai_name); + dai_link->codecs->dai_name);if (ret <0 ) goto dai_link_of_err;
@@ -363,7 +364,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct device_node *np = dev->of_node;struct snd_soc_card *card; -int num, ret; +int num, ret, i;/* Get the number of DAI links */ if (np &&of_get_child_by_name (np,PREFIX "dai-link" ))
@@ -381,6 +382,17 @@ static int asoc_simple_card_probe(struct platform_device *pdev)if (!dai_props || !dai_link)return -ENOMEM ; +/* +* Use snd_soc_dai_link_component instead of legacy style +* It is codec only. but cpu/platform will be supported in the future. +* see +* soc-core.c :: snd_soc_init_multicodec() +*/ +for (i =0 ; i < num; i++) { + dai_link[i].codecs = &dai_props[i].codecs; + dai_link[i].num_codecs =1 ; + } + priv->dai_props = dai_props; priv->dai_link = dai_link;
@@ -403,6 +415,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev) }else {struct asoc_simple_card_info *cinfo; +struct snd_soc_dai_link_component *codecs; cinfo = dev->platform_data;if (!cinfo) {
@@ -419,13 +432,15 @@ static int asoc_simple_card_probe(struct platform_device *pdev)return -EINVAL ; } + codecs = dai_link->codecs; + codecs->name = cinfo->codec; + codecs->dai_name = cinfo->codec_dai.name; + card->name = (cinfo->card) ? cinfo->card : cinfo->name; dai_link->name = cinfo->name; dai_link->stream_name = cinfo->name; dai_link->platform_name = cinfo->platform; - dai_link->codec_name = cinfo->codec; dai_link->cpu_dai_name = cinfo->cpu_dai.name; - dai_link->codec_dai_name = cinfo->codec_dai.name; dai_link->dai_fmt = cinfo->daifmt; dai_link->init = asoc_simple_card_dai_init; memcpy(&priv->dai_props->cpu_dai, &cinfo->cpu_dai,
Signature · 1 line
2.19.0.rc1
Kuninori Morimoto
maintainerPATCH v2 3/15 ASoC: simple-scu-card: use simple_dai_props
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
simple-card and simple-scu-card are very similar driver, but using different feature. Thus we are keeping synchronization on these 2 drivers style, because it is easy to confirm / check.
Current big difference between these 2 drivers are "dai_props" on simple_card_data (= priv).
It will be difficult to keep synchronize if we will add new feature on simple-scu-card. Thus, this patch synchronize it.
[simple]
struct simple_card_data {
...
struct simple_dai_props {
...
} *dai_props;
...
};[simple scu]
struct simple_card_data {
...
struct asoc_simple_dai *dai_props;
...
};--- sound/soc/generic/simple-scu-card.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-)
sound/soc/generic/simple-scu-card.c +14 -12
@@ -22,7 +22,9 @@struct simple_card_data {struct snd_soc_card snd_card;struct snd_soc_codec_conf codec_conf; -struct asoc_simple_dai *dai_props; +struct simple_dai_props { +struct asoc_simple_dai dai; + } *dai_props;struct snd_soc_dai_link *dai_link;struct asoc_simple_card_data adata; };
@@ -40,20 +42,20 @@ static int asoc_simple_card_startup(struct snd_pcm_substream *substream) {struct snd_soc_pcm_runtime *rtd = substream->private_data;struct simple_card_data *priv =snd_soc_card_get_drvdata (rtd->card); -struct asoc_simple_dai *dai_props = +struct simple_dai_props *dai_props =simple_priv_to_props (priv, rtd->num); -return asoc_simple_card_clk_enable (dai_props); +return asoc_simple_card_clk_enable (&dai_props->dai); }static void asoc_simple_card_shutdown (struct snd_pcm_substream *substream) {struct snd_soc_pcm_runtime *rtd = substream->private_data;struct simple_card_data *priv =snd_soc_card_get_drvdata (rtd->card); -struct asoc_simple_dai *dai_props = +struct simple_dai_props *dai_props =simple_priv_to_props (priv, rtd->num); -asoc_simple_card_clk_disable (dai_props); +asoc_simple_card_clk_disable (&dai_props->dai); }static const struct snd_soc_ops asoc_simple_card_ops = {
@@ -66,7 +68,7 @@ static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd)struct simple_card_data *priv =snd_soc_card_get_drvdata (rtd->card);struct snd_soc_dai *dai;struct snd_soc_dai_link *dai_link; -struct asoc_simple_dai *dai_props; +struct simple_dai_props *dai_props;int num = rtd->num; dai_link =simple_priv_to_link (priv, num);
@@ -75,7 +77,7 @@ static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd) rtd->cpu_dai : rtd->codec_dai; -return asoc_simple_card_init_dai (dai, dai_props); +return asoc_simple_card_init_dai (dai, &dai_props->dai); } static int asoc_simple_card_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
@@ -95,7 +97,7 @@ static int asoc_simple_card_dai_link_of(struct device_node *np, {struct device *dev =simple_priv_to_dev (priv);struct snd_soc_dai_link *dai_link =simple_priv_to_link (priv, idx); -struct asoc_simple_dai *dai_props =simple_priv_to_props (priv, idx); +struct simple_dai_props *dai_props =simple_priv_to_props (priv, idx);struct snd_soc_card *card =simple_priv_to_card (priv);int ret;
@@ -116,7 +118,7 @@ static int asoc_simple_card_dai_link_of(struct device_node *np,if (ret)return ret; - ret =asoc_simple_card_parse_clk_cpu (dev, np, dai_link, dai_props); + ret =asoc_simple_card_parse_clk_cpu (dev, np, dai_link, &dai_props->dai);if (ret <0 )return ret;
@@ -141,7 +143,7 @@ static int asoc_simple_card_dai_link_of(struct device_node *np,if (ret <0 )return ret; - ret =asoc_simple_card_parse_clk_codec (dev, np, dai_link, dai_props); + ret =asoc_simple_card_parse_clk_codec (dev, np, dai_link, &dai_props->dai);if (ret <0 )return ret;
@@ -157,7 +159,7 @@ static int asoc_simple_card_dai_link_of(struct device_node *np, PREFIX "prefix"); } - ret =asoc_simple_card_of_parse_tdm (np, dai_props); + ret =asoc_simple_card_of_parse_tdm (np, &dai_props->dai);if (ret)return ret;
@@ -230,7 +232,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev) {struct simple_card_data *priv;struct snd_soc_dai_link *dai_link; -struct asoc_simple_dai *dai_props; +struct simple_dai_props *dai_props;struct snd_soc_card *card;struct device *dev = &pdev->dev;struct device_node *np = dev->of_node;
Signature · 1 line
2.7.4
Kuninori Morimoto
maintainerPATCH v2 4/15 ASoC: simple-scu-card: support snd_soc_dai_link_component style for codec
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
Current ASoC is supporting snd_soc_dai_link_component for binding, it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs). CPU will support multi style in the future.
We want to have it on Platform too in the future.
If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for simple-scu-card for codec.
[current]
struct snd_soc_dai_link {
...
*cpu_name;
*cpu_of_node;
*cpu_dai_name;
*codec_name;
*codec_of_node;
*codec_dai_name;
*codecs;
num_codecs;
*platform_name;
*platform_of_node;
...
}[in the future]
struct snd_soc_dai_link {
...
*cpus
num_cpus;
*codecs;
num_codecs;
*platform;
...
}--- sound/soc/generic/simple-scu-card.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-)
sound/soc/generic/simple-scu-card.c +20 -6
@@ -24,6 +24,7 @@ struct simple_card_data {struct snd_soc_codec_conf codec_conf;struct simple_dai_props {struct asoc_simple_dai dai; +struct snd_soc_dai_link_component codecs; } *dai_props;struct snd_soc_dai_link *dai_link;struct asoc_simple_card_data adata;
@@ -103,11 +104,13 @@ static int asoc_simple_card_dai_link_of(struct device_node *np,if (is_fe) {int is_single_links =0 ; +struct snd_soc_dai_link_component *codecs;/* BE is dummy */ - dai_link->codec_of_node =NULL ; - dai_link->codec_dai_name ="snd-soc-dummy-dai" ; - dai_link->codec_name ="snd-soc-dummy" ; + codecs = dai_link->codecs; + codecs->of_node =NULL ; + codecs->dai_name ="snd-soc-dummy-dai" ; + codecs->name ="snd-soc-dummy" ;/* FE settings */ dai_link->dynamic =1 ;
@@ -149,13 +152,13 @@ static int asoc_simple_card_dai_link_of(struct device_node *np, ret =asoc_simple_card_set_dailink_name (dev, dai_link,"be.%s" , - dai_link->codec_dai_name); + dai_link->codecs->dai_name);if (ret <0 )return ret;snd_soc_of_parse_audio_prefix (card, &priv->codec_conf, - dai_link->codec_of_node, + dai_link->codecs->of_node,PREFIX "prefix" ); }
@@ -236,7 +239,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev)struct snd_soc_card *card;struct device *dev = &pdev->dev;struct device_node *np = dev->of_node; -int num, ret; +int num, ret, i;/* Allocate the private data */ priv =devm_kzalloc (dev,sizeof (*priv),GFP_KERNEL );
@@ -250,6 +253,17 @@ static int asoc_simple_card_probe(struct platform_device *pdev)if (!dai_props || !dai_link)return -ENOMEM ; +/* +* Use snd_soc_dai_link_component instead of legacy style +* It is codec only. but cpu/platform will be supported in the future. +* see +* soc-core.c :: snd_soc_init_multicodec() +*/ +for (i =0 ; i < num; i++) { + dai_link[i].codecs = &dai_props[i].codecs; + dai_link[i].num_codecs =1 ; + } + priv->dai_props = dai_props; priv->dai_link = dai_link;
Signature · 1 line
2.7.4
Mark Brown
maintainerApplied "ASoC: simple-scu-card: support snd_soc_dai_link_component style for codec" to the asoc tree
The patch
ASoC: simple-scu-card: support snd_soc_dai_link_component style for codec
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
2289cc1c78574653d30b80696327646ba340babfMon Sep 17 00:00:00 2001
From: Kuninori Morimoto <[email protected]>
Date: Fri, 31 Aug 2018 03:08:51 +0000
Subject: [PATCH] ASoC: simple-scu-card: support snd_soc_dai_link_component
style for codec
Current ASoC is supporting snd_soc_dai_link_component for binding, it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs). CPU will support multi style in the future.
We want to have it on Platform too in the future.
If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for simple-scu-card for codec.
[current]
struct snd_soc_dai_link {
...
*cpu_name;
*cpu_of_node;
*cpu_dai_name;
*codec_name;
*codec_of_node;
*codec_dai_name;
*codecs;
num_codecs;
*platform_name;
*platform_of_node;
...
}[in the future]
struct snd_soc_dai_link {
...
*cpus
num_cpus;
*codecs;
num_codecs;
*platform;
...
}--- sound/soc/generic/simple-scu-card.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-)
sound/soc/generic/simple-scu-card.c +20 -6
@@ -24,6 +24,7 @@ struct simple_card_data {struct snd_soc_codec_conf codec_conf;struct simple_dai_props {struct asoc_simple_dai dai; +struct snd_soc_dai_link_component codecs; } *dai_props;struct snd_soc_dai_link *dai_link;struct asoc_simple_card_data adata;
@@ -103,11 +104,13 @@ static int asoc_simple_card_dai_link_of(struct device_node *np,if (is_fe) {int is_single_links =0 ; +struct snd_soc_dai_link_component *codecs;/* BE is dummy */ - dai_link->codec_of_node =NULL ; - dai_link->codec_dai_name ="snd-soc-dummy-dai" ; - dai_link->codec_name ="snd-soc-dummy" ; + codecs = dai_link->codecs; + codecs->of_node =NULL ; + codecs->dai_name ="snd-soc-dummy-dai" ; + codecs->name ="snd-soc-dummy" ;/* FE settings */ dai_link->dynamic =1 ;
@@ -149,13 +152,13 @@ static int asoc_simple_card_dai_link_of(struct device_node *np, ret =asoc_simple_card_set_dailink_name (dev, dai_link,"be.%s" , - dai_link->codec_dai_name); + dai_link->codecs->dai_name);if (ret <0 )return ret;snd_soc_of_parse_audio_prefix (card, &priv->codec_conf, - dai_link->codec_of_node, + dai_link->codecs->of_node,PREFIX "prefix" ); }
@@ -236,7 +239,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev)struct snd_soc_card *card;struct device *dev = &pdev->dev;struct device_node *np = dev->of_node; -int num, ret; +int num, ret, i;/* Allocate the private data */ priv =devm_kzalloc (dev,sizeof (*priv),GFP_KERNEL );
@@ -250,6 +253,17 @@ static int asoc_simple_card_probe(struct platform_device *pdev)if (!dai_props || !dai_link)return -ENOMEM ; +/* +* Use snd_soc_dai_link_component instead of legacy style +* It is codec only. but cpu/platform will be supported in the future. +* see +* soc-core.c :: snd_soc_init_multicodec() +*/ +for (i =0 ; i < num; i++) { + dai_link[i].codecs = &dai_props[i].codecs; + dai_link[i].num_codecs =1 ; + } + priv->dai_props = dai_props; priv->dai_link = dai_link;
Signature · 1 line
2.19.0.rc1
Kuninori Morimoto
maintainerPATCH v2 5/15 ASoC: audio-graph-card: support snd_soc_dai_link_component style for codec
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
Current ASoC is supporting snd_soc_dai_link_component for binding, it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs). CPU will support multi style in the future.
We want to have it on Platform too in the future.
If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for audio-graph-card for codec.
[current]
struct snd_soc_dai_link {
...
*cpu_name;
*cpu_of_node;
*cpu_dai_name;
*codec_name;
*codec_of_node;
*codec_dai_name;
*codecs;
num_codecs;
*platform_name;
*platform_of_node;
...
}[in the future]
struct snd_soc_dai_link {
...
*cpus
num_cpus;
*codecs;
num_codecs;
*platform;
...
}--- sound/soc/generic/audio-graph-card.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
sound/soc/generic/audio-graph-card.c +14 -2
@@ -25,6 +25,7 @@ struct graph_card_data {struct graph_dai_props {struct asoc_simple_dai cpu_dai;struct asoc_simple_dai codec_dai; +struct snd_soc_dai_link_component codecs;/* single codec */ unsigned int mclk_fs; } *dai_props;unsigned int mclk_fs;
@@ -213,7 +214,7 @@ static int asoc_graph_card_dai_link_of(struct device_node *cpu_port, ret =asoc_simple_card_set_dailink_name (dev, dai_link,"%s-%s" , dai_link->cpu_dai_name, - dai_link->codec_dai_name); + dai_link->codecs->dai_name);if (ret <0 ) goto dai_link_of_err;
@@ -299,7 +300,7 @@ static int asoc_graph_card_probe(struct platform_device *pdev)struct graph_dai_props *dai_props;struct device *dev = &pdev->dev;struct snd_soc_card *card; -int num, ret; +int num, ret, i;/* Allocate the private data and the DAI link array */ priv =devm_kzalloc (dev,sizeof (*priv),GFP_KERNEL );
@@ -315,6 +316,17 @@ static int asoc_graph_card_probe(struct platform_device *pdev)if (!dai_props || !dai_link)return -ENOMEM ; +/* +* Use snd_soc_dai_link_component instead of legacy style +* It is codec only. but cpu/platform will be supported in the future. +* see +* soc-core.c :: snd_soc_init_multicodec() +*/ +for (i =0 ; i < num; i++) { + dai_link[i].codecs = &dai_props[i].codecs; + dai_link[i].num_codecs =1 ; + } + priv->pa_gpio =devm_gpiod_get_optional (dev,"pa" ,GPIOD_OUT_LOW );if (IS_ERR (priv->pa_gpio)) { ret =PTR_ERR (priv->pa_gpio);
Signature · 1 line
2.7.4
Kuninori Morimoto
maintainerPATCH v2 6/15 ASoC: audio-graph-scu-card: use simple_dai_props
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
audi-graph-card and audio-graph-scu-card are very similar driver, but using different feature. Thus we are keeping synchronization on these 2 drivers style, because it is easy to confirm / check.
Current big difference between these 2 drivers are "dai_props" on graph_card_data (= priv).
It will be difficult to keep synchronize if we will add new feature on audio-graph-scu-card. Thus, this patch synchronize it.
[audio-graph]
struct graph_card_data {
...
struct graph_dai_props {
...
} *dai_props;
...
};[audio-graph-scu]
struct graph_card_data {
...
struct asoc_simple_dai *dai_props;
...
};--- sound/soc/generic/audio-graph-scu-card.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-)
sound/soc/generic/audio-graph-scu-card.c +14 -12
@@ -25,7 +25,9 @@struct graph_card_data {struct snd_soc_card snd_card;struct snd_soc_codec_conf codec_conf; -struct asoc_simple_dai *dai_props; +struct graph_dai_props { +struct asoc_simple_dai dai; + } *dai_props;struct snd_soc_dai_link *dai_link;struct asoc_simple_card_data adata; };
@@ -39,18 +41,18 @@ static int asoc_graph_card_startup(struct snd_pcm_substream *substream) {struct snd_soc_pcm_runtime *rtd = substream->private_data;struct graph_card_data *priv =snd_soc_card_get_drvdata (rtd->card); -struct asoc_simple_dai *dai_props =graph_priv_to_props (priv, rtd->num); +struct graph_dai_props *dai_props =graph_priv_to_props (priv, rtd->num); -return asoc_simple_card_clk_enable (dai_props); +return asoc_simple_card_clk_enable (&dai_props->dai); }static void asoc_graph_card_shutdown (struct snd_pcm_substream *substream) {struct snd_soc_pcm_runtime *rtd = substream->private_data;struct graph_card_data *priv =snd_soc_card_get_drvdata (rtd->card); -struct asoc_simple_dai *dai_props =graph_priv_to_props (priv, rtd->num); +struct graph_dai_props *dai_props =graph_priv_to_props (priv, rtd->num); -asoc_simple_card_clk_disable (dai_props); +asoc_simple_card_clk_disable (&dai_props->dai); }static const struct snd_soc_ops asoc_graph_card_ops = {
@@ -63,7 +65,7 @@ static int asoc_graph_card_dai_init(struct snd_soc_pcm_runtime *rtd)struct graph_card_data *priv =snd_soc_card_get_drvdata (rtd->card);struct snd_soc_dai *dai;struct snd_soc_dai_link *dai_link; -struct asoc_simple_dai *dai_props; +struct graph_dai_props *dai_props;int num = rtd->num; dai_link =graph_priv_to_link (priv, num);
@@ -72,7 +74,7 @@ static int asoc_graph_card_dai_init(struct snd_soc_pcm_runtime *rtd) rtd->cpu_dai : rtd->codec_dai; -return asoc_simple_card_init_dai (dai, dai_props); +return asoc_simple_card_init_dai (dai, &dai_props->dai); } static int asoc_graph_card_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
@@ -92,7 +94,7 @@ static int asoc_graph_card_dai_link_of(struct device_node *ep, {struct device *dev =graph_priv_to_dev (priv);struct snd_soc_dai_link *dai_link =graph_priv_to_link (priv, idx); -struct asoc_simple_dai *dai_props =graph_priv_to_props (priv, idx); +struct graph_dai_props *dai_props =graph_priv_to_props (priv, idx);struct snd_soc_card *card =graph_priv_to_card (priv);int ret;
@@ -110,7 +112,7 @@ static int asoc_graph_card_dai_link_of(struct device_node *ep,if (ret)return ret; - ret =asoc_simple_card_parse_clk_cpu (dev, ep, dai_link, dai_props); + ret =asoc_simple_card_parse_clk_cpu (dev, ep, dai_link, &dai_props->dai);if (ret <0 )return ret;
@@ -137,7 +139,7 @@ static int asoc_graph_card_dai_link_of(struct device_node *ep,if (ret <0 )return ret; - ret =asoc_simple_card_parse_clk_codec (dev, ep, dai_link, dai_props); + ret =asoc_simple_card_parse_clk_codec (dev, ep, dai_link, &dai_props->dai);if (ret <0 )return ret;
@@ -153,7 +155,7 @@ static int asoc_graph_card_dai_link_of(struct device_node *ep, "prefix"); } - ret =asoc_simple_card_of_parse_tdm (ep, dai_props); + ret =asoc_simple_card_of_parse_tdm (ep, &dai_props->dai);if (ret)return ret;
@@ -331,7 +333,7 @@ static int asoc_graph_card_probe(struct platform_device *pdev) {struct graph_card_data *priv;struct snd_soc_dai_link *dai_link; -struct asoc_simple_dai *dai_props; +struct graph_dai_props *dai_props;struct device *dev = &pdev->dev;struct snd_soc_card *card;int num, ret;
Signature · 1 line
2.7.4
Kuninori Morimoto
maintainerPATCH v2 7/15 ASoC: audio-graph-scu-card: support snd_soc_dai_link_component style for codec
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
Current ASoC is supporting snd_soc_dai_link_component for binding, it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs). CPU will support multi style in the future.
We want to have it on Platform too in the future.
If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for audio-graph-scu-card for codec.
[current]
struct snd_soc_dai_link {
...
*cpu_name;
*cpu_of_node;
*cpu_dai_name;
*codec_name;
*codec_of_node;
*codec_dai_name;
*codecs;
num_codecs;
*platform_name;
*platform_of_node;
...
}[in the future]
struct snd_soc_dai_link {
...
*cpus
num_cpus;
*codecs;
num_codecs;
*platform;
...
}--- sound/soc/generic/audio-graph-scu-card.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-)
sound/soc/generic/audio-graph-scu-card.c +21 -6
@@ -27,6 +27,7 @@ struct graph_card_data {struct snd_soc_codec_conf codec_conf;struct graph_dai_props {struct asoc_simple_dai dai; +struct snd_soc_dai_link_component codecs; } *dai_props;struct snd_soc_dai_link *dai_link;struct asoc_simple_card_data adata;
@@ -99,10 +100,13 @@ static int asoc_graph_card_dai_link_of(struct device_node *ep,int ret;if (is_fe) { +struct snd_soc_dai_link_component *codecs; +/* BE is dummy */ - dai_link->codec_of_node =NULL ; - dai_link->codec_dai_name ="snd-soc-dummy-dai" ; - dai_link->codec_name ="snd-soc-dummy" ; + codecs = dai_link->codecs; + codecs->of_node =NULL ; + codecs->dai_name ="snd-soc-dummy-dai" ; + codecs->name ="snd-soc-dummy" ;/* FE settings */ dai_link->dynamic =1 ;
@@ -145,13 +149,13 @@ static int asoc_graph_card_dai_link_of(struct device_node *ep, ret =asoc_simple_card_set_dailink_name (dev, dai_link,"be.%s" , - dai_link->codec_dai_name); + dai_link->codecs->dai_name);if (ret <0 )return ret;snd_soc_of_parse_audio_prefix (card, &priv->codec_conf, - dai_link->codec_of_node, + dai_link->codecs->of_node,"prefix" ); }
@@ -336,7 +340,7 @@ static int asoc_graph_card_probe(struct platform_device *pdev)struct graph_dai_props *dai_props;struct device *dev = &pdev->dev;struct snd_soc_card *card; -int num, ret; +int num, ret, i;/* Allocate the private data and the DAI link array */ priv =devm_kzalloc (dev,sizeof (*priv),GFP_KERNEL );
@@ -352,6 +356,17 @@ static int asoc_graph_card_probe(struct platform_device *pdev)if (!dai_props || !dai_link)return -ENOMEM ; +/* +* Use snd_soc_dai_link_component instead of legacy style +* It is codec only. but cpu/platform will be supported in the future. +* see +* soc-core.c :: snd_soc_init_multicodec() +*/ +for (i =0 ; i < num; i++) { + dai_link[i].codecs = &dai_props[i].codecs; + dai_link[i].num_codecs =1 ; + } + priv->dai_props = dai_props; priv->dai_link = dai_link;
Signature · 1 line
2.7.4
Mark Brown
maintainerApplied "ASoC: audio-graph-scu-card: support snd_soc_dai_link_component style for codec" to the asoc tree
The patch
ASoC: audio-graph-scu-card: support snd_soc_dai_link_component style for codec
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
04f7267aa8d17773917580951c740496e8059cbaMon Sep 17 00:00:00 2001
From: Kuninori Morimoto <[email protected]>
Date: Fri, 31 Aug 2018 03:09:33 +0000
Subject: [PATCH] ASoC: audio-graph-scu-card: support
snd_soc_dai_link_component style for codec
Current ASoC is supporting snd_soc_dai_link_component for binding, it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs). CPU will support multi style in the future.
We want to have it on Platform too in the future.
If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for audio-graph-scu-card for codec.
[current]
struct snd_soc_dai_link {
...
*cpu_name;
*cpu_of_node;
*cpu_dai_name;
*codec_name;
*codec_of_node;
*codec_dai_name;
*codecs;
num_codecs;
*platform_name;
*platform_of_node;
...
}[in the future]
struct snd_soc_dai_link {
...
*cpus
num_cpus;
*codecs;
num_codecs;
*platform;
...
}--- sound/soc/generic/audio-graph-scu-card.c | 27 ++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-)
sound/soc/generic/audio-graph-scu-card.c +21 -6
@@ -27,6 +27,7 @@ struct graph_card_data {struct snd_soc_codec_conf codec_conf;struct graph_dai_props {struct asoc_simple_dai dai; +struct snd_soc_dai_link_component codecs; } *dai_props;struct snd_soc_dai_link *dai_link;struct asoc_simple_card_data adata;
@@ -99,10 +100,13 @@ static int asoc_graph_card_dai_link_of(struct device_node *ep,int ret;if (is_fe) { +struct snd_soc_dai_link_component *codecs; +/* BE is dummy */ - dai_link->codec_of_node =NULL ; - dai_link->codec_dai_name ="snd-soc-dummy-dai" ; - dai_link->codec_name ="snd-soc-dummy" ; + codecs = dai_link->codecs; + codecs->of_node =NULL ; + codecs->dai_name ="snd-soc-dummy-dai" ; + codecs->name ="snd-soc-dummy" ;/* FE settings */ dai_link->dynamic =1 ;
@@ -145,13 +149,13 @@ static int asoc_graph_card_dai_link_of(struct device_node *ep, ret =asoc_simple_card_set_dailink_name (dev, dai_link,"be.%s" , - dai_link->codec_dai_name); + dai_link->codecs->dai_name);if (ret <0 )return ret;snd_soc_of_parse_audio_prefix (card, &priv->codec_conf, - dai_link->codec_of_node, + dai_link->codecs->of_node,"prefix" ); }
@@ -336,7 +340,7 @@ static int asoc_graph_card_probe(struct platform_device *pdev)struct graph_dai_props *dai_props;struct device *dev = &pdev->dev;struct snd_soc_card *card; -int num, ret; +int num, ret, i;/* Allocate the private data and the DAI link array */ priv =devm_kzalloc (dev,sizeof (*priv),GFP_KERNEL );
@@ -352,6 +356,17 @@ static int asoc_graph_card_probe(struct platform_device *pdev)if (!dai_props || !dai_link)return -ENOMEM ; +/* +* Use snd_soc_dai_link_component instead of legacy style +* It is codec only. but cpu/platform will be supported in the future. +* see +* soc-core.c :: snd_soc_init_multicodec() +*/ +for (i =0 ; i < num; i++) { + dai_link[i].codecs = &dai_props[i].codecs; + dai_link[i].num_codecs =1 ; + } + priv->dai_props = dai_props; priv->dai_link = dai_link;
Signature · 1 line
2.19.0.rc1
Kuninori Morimoto
maintainerPATCH v2 8/15 ASoC: simple-card-util: remove dai_link compatible code for codec
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
Now no simple/audio cards are using legacy dai_link style for codec. Let's remove compatible code.
--- sound/soc/generic/simple-card-utils.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/generic/simple-card-utils.c +1 -3
@@ -409,9 +409,7 @@ int asoc_simple_card_clean_reference(struct snd_soc_card *card) num_links < card->num_links; num_links++, dai_link++) {of_node_put (dai_link->cpu_of_node); -of_node_put (dai_link->codec_of_node); -if (dai_link->codecs) -of_node_put (dai_link->codecs->of_node); +of_node_put (dai_link->codecs->of_node); }return 0 ; }
Signature · 1 line
2.7.4
Kuninori Morimoto
maintainerPATCH v2 9/15 ASoC: soc-core: use snd_soc_dai_link_component for platform
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
Current struct snd_soc_dai_link is supporting multicodec, and it is supporting legacy style of
codec_name
codec_of_node
code_dai_name
This is handled as single entry of multicodec.
We don't have multicpu support yet, but in the future we will. In such case, we can use snd_soc_dai_link_component for both cpu/codec. Then the code will be more simple and readble.
As next step, we want to use it for platform, too. This patch adds snd_soc_dai_link_component style for platform. We might have multiplatform support in the future, but we don't know yet. To avoid un-known issue / complex code, this patch supports just single-platform as 1st step.
If we could use snd_soc_dai_link_component for all CPU/Codec/Platform, we will switch to new style, and remove legacy code.
This is prepare for it.
--- include/sound/soc.h | 2 ++ sound/soc/soc-core.c | 48 +++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 43 insertions(+), 7 deletions(-)
include/sound/soc.h +2 -0
@@ -915,6 +915,8 @@ struct snd_soc_dai_link {*/ const char *platform_name;struct device_node *platform_of_node; +struct snd_soc_dai_link_component *platform; +int id;/* optional ID for machine driver link identification */ const struct snd_soc_pcm_stream *params;
sound/soc/soc-core.c +41 -7
89 lines not on this page · raw message
Signature · 1 line
2.7.4
Kuninori Morimoto
maintainerPATCH v2 10/15 ASoC: simple-card-util: support snd_soc_dai_link_component style for platform
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
Current ASoC is supporting snd_soc_dai_link_component for binding, it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs). CPU will support multi style in the future.
We want to have it on Platform too in the future.
If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for simple-card-util for platform.
[current]
struct snd_soc_dai_link {
...
*cpu_name;
*cpu_of_node;
*cpu_dai_name;
*codec_name;
*codec_of_node;
*codec_dai_name;
*codecs;
num_codecs;
*platform_name;
*platform_of_node;
...
}[in the future]
struct snd_soc_dai_link {
...
*cpus
num_cpus;
*codecs;
num_codecs;
*platform;
...
}--- include/sound/simple_card_utils.h | 2 +- sound/soc/generic/simple-card-utils.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-)
include/sound/simple_card_utils.h +1 -1
@@ -75,7 +75,7 @@ void asoc_simple_card_clk_disable(struct asoc_simple_dai *dai); &dai_link->codec_dai_name, \ list_name, cells_name, NULL)#define asoc_simple_card_parse_platform (node, dai_link, list_name, cells_name) \ - asoc_simple_card_parse_dai(node, NULL, \ + asoc_simple_card_parse_dai(node, dai_link->platform, \ &dai_link->platform_of_node, \ NULL, list_name, cells_name, NULL) int asoc_simple_card_parse_dai(struct device_node *node,
sound/soc/generic/simple-card-utils.c +8 -3
@@ -376,10 +376,15 @@ EXPORT_SYMBOL_GPL(asoc_simple_card_init_dai);int asoc_simple_card_canonicalize_dailink (struct snd_soc_dai_link *dai_link) {/* Assumes platform == cpu */ -if (!dai_link->platform_of_node) - dai_link->platform_of_node = dai_link->cpu_of_node; - +if (dai_link->platform) { +if (!dai_link->platform->of_node) + dai_link->platform->of_node = dai_link->cpu_of_node; + }else { +if (!dai_link->platform_of_node) + dai_link->platform_of_node = dai_link->cpu_of_node; + }return 0 ; + }EXPORT_SYMBOL_GPL (asoc_simple_card_canonicalize_dailink);
Signature · 1 line
2.7.4
Mark Brown
maintainerApplied "ASoC: simple-card-util: support snd_soc_dai_link_component style for platform" to the asoc tree
The patch
ASoC: simple-card-util: support snd_soc_dai_link_component style for platform
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
868cdb4690699b04ca4d09b1e0178dfc680dbd8eMon Sep 17 00:00:00 2001
From: Kuninori Morimoto <[email protected]>
Date: Fri, 31 Aug 2018 03:10:20 +0000
Subject: [PATCH] ASoC: simple-card-util: support snd_soc_dai_link_component
style for platform
Current ASoC is supporting snd_soc_dai_link_component for binding, it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs). CPU will support multi style in the future.
We want to have it on Platform too in the future.
If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for simple-card-util for platform.
[current]
struct snd_soc_dai_link {
...
*cpu_name;
*cpu_of_node;
*cpu_dai_name;
*codec_name;
*codec_of_node;
*codec_dai_name;
*codecs;
num_codecs;
*platform_name;
*platform_of_node;
...
}[in the future]
struct snd_soc_dai_link {
...
*cpus
num_cpus;
*codecs;
num_codecs;
*platform;
...
}--- include/sound/simple_card_utils.h | 2 +- sound/soc/generic/simple-card-utils.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-)
include/sound/simple_card_utils.h +1 -1
@@ -75,7 +75,7 @@ void asoc_simple_card_clk_disable(struct asoc_simple_dai *dai); &dai_link->codec_dai_name, \ list_name, cells_name, NULL)#define asoc_simple_card_parse_platform (node, dai_link, list_name, cells_name) \ - asoc_simple_card_parse_dai(node, NULL, \ + asoc_simple_card_parse_dai(node, dai_link->platform, \ &dai_link->platform_of_node, \ NULL, list_name, cells_name, NULL) int asoc_simple_card_parse_dai(struct device_node *node,
sound/soc/generic/simple-card-utils.c +8 -3
@@ -376,10 +376,15 @@ EXPORT_SYMBOL_GPL(asoc_simple_card_init_dai);int asoc_simple_card_canonicalize_dailink (struct snd_soc_dai_link *dai_link) {/* Assumes platform == cpu */ -if (!dai_link->platform_of_node) - dai_link->platform_of_node = dai_link->cpu_of_node; - +if (dai_link->platform) { +if (!dai_link->platform->of_node) + dai_link->platform->of_node = dai_link->cpu_of_node; + }else { +if (!dai_link->platform_of_node) + dai_link->platform_of_node = dai_link->cpu_of_node; + }return 0 ; + }EXPORT_SYMBOL_GPL (asoc_simple_card_canonicalize_dailink);
Signature · 1 line
2.19.0.rc1
Kuninori Morimoto
maintainerPATCH v2 11/15 ASoC: simple-card: support snd_soc_dai_link_component style for platform
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
Current ASoC is supporting snd_soc_dai_link_component for binding, it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs). CPU will support multi style in the future.
We want to have it on Platform too in the future.
If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for simple-card for platform.
[current]
struct snd_soc_dai_link {
...
*cpu_name;
*cpu_of_node;
*cpu_dai_name;
*codec_name;
*codec_of_node;
*codec_dai_name;
*codecs;
num_codecs;
*platform_name;
*platform_of_node;
...
}[in the future]
struct snd_soc_dai_link {
...
*cpus
num_cpus;
*codecs;
num_codecs;
*platform;
...
}--- sound/soc/generic/simple-card.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
sound/soc/generic/simple-card.c +6 -1
@@ -21,6 +21,7 @@ struct simple_card_data {struct asoc_simple_dai cpu_dai;struct asoc_simple_dai codec_dai;struct snd_soc_dai_link_component codecs;/* single codec */ +struct snd_soc_dai_link_component platform;unsigned int mclk_fs; } *dai_props;unsigned int mclk_fs;
@@ -391,6 +392,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev)for (i =0 ; i < num; i++) { dai_link[i].codecs = &dai_props[i].codecs; dai_link[i].num_codecs =1 ; + dai_link[i].platform = &dai_props[i].platform; } priv->dai_props = dai_props;
@@ -416,6 +418,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev) }else {struct asoc_simple_card_info *cinfo;struct snd_soc_dai_link_component *codecs; +struct snd_soc_dai_link_component *platform; cinfo = dev->platform_data;if (!cinfo) {
@@ -436,10 +439,12 @@ static int asoc_simple_card_probe(struct platform_device *pdev) codecs->name = cinfo->codec; codecs->dai_name = cinfo->codec_dai.name; + platform = dai_link->platform; + platform->name = cinfo->platform; + card->name = (cinfo->card) ? cinfo->card : cinfo->name; dai_link->name = cinfo->name; dai_link->stream_name = cinfo->name; - dai_link->platform_name = cinfo->platform; dai_link->cpu_dai_name = cinfo->cpu_dai.name; dai_link->dai_fmt = cinfo->daifmt; dai_link->init = asoc_simple_card_dai_init;
Signature · 1 line
2.7.4
Mark Brown
maintainerApplied "ASoC: simple-card: support snd_soc_dai_link_component style for platform" to the asoc tree
The patch
ASoC: simple-card: support snd_soc_dai_link_component style for platform
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
e58f41e41185c6906bd11c73c4e76aa5fc3ea685Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <[email protected]>
Date: Fri, 31 Aug 2018 03:10:33 +0000
Subject: [PATCH] ASoC: simple-card: support snd_soc_dai_link_component style
for platform
Current ASoC is supporting snd_soc_dai_link_component for binding, it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs). CPU will support multi style in the future.
We want to have it on Platform too in the future.
If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for simple-card for platform.
[current]
struct snd_soc_dai_link {
...
*cpu_name;
*cpu_of_node;
*cpu_dai_name;
*codec_name;
*codec_of_node;
*codec_dai_name;
*codecs;
num_codecs;
*platform_name;
*platform_of_node;
...
}[in the future]
struct snd_soc_dai_link {
...
*cpus
num_cpus;
*codecs;
num_codecs;
*platform;
...
}--- sound/soc/generic/simple-card.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
sound/soc/generic/simple-card.c +6 -1
@@ -21,6 +21,7 @@ struct simple_card_data {struct asoc_simple_dai cpu_dai;struct asoc_simple_dai codec_dai;struct snd_soc_dai_link_component codecs;/* single codec */ +struct snd_soc_dai_link_component platform;unsigned int mclk_fs; } *dai_props;unsigned int mclk_fs;
@@ -391,6 +392,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev)for (i =0 ; i < num; i++) { dai_link[i].codecs = &dai_props[i].codecs; dai_link[i].num_codecs =1 ; + dai_link[i].platform = &dai_props[i].platform; } priv->dai_props = dai_props;
@@ -416,6 +418,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev) }else {struct asoc_simple_card_info *cinfo;struct snd_soc_dai_link_component *codecs; +struct snd_soc_dai_link_component *platform; cinfo = dev->platform_data;if (!cinfo) {
@@ -436,10 +439,12 @@ static int asoc_simple_card_probe(struct platform_device *pdev) codecs->name = cinfo->codec; codecs->dai_name = cinfo->codec_dai.name; + platform = dai_link->platform; + platform->name = cinfo->platform; + card->name = (cinfo->card) ? cinfo->card : cinfo->name; dai_link->name = cinfo->name; dai_link->stream_name = cinfo->name; - dai_link->platform_name = cinfo->platform; dai_link->cpu_dai_name = cinfo->cpu_dai.name; dai_link->dai_fmt = cinfo->daifmt; dai_link->init = asoc_simple_card_dai_init;
Signature · 1 line
2.19.0.rc1
Kuninori Morimoto
maintainerPATCH v2 12/15 ASoC: simple-scu-card: support snd_soc_dai_link_component style for platform
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
Current ASoC is supporting snd_soc_dai_link_component for binding, it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs). CPU will support multi style in the future.
We want to have it on Platform too in the future.
If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for simple-scu-card for platform.
[current]
struct snd_soc_dai_link {
...
*cpu_name;
*cpu_of_node;
*cpu_dai_name;
*codec_name;
*codec_of_node;
*codec_dai_name;
*codecs;
num_codecs;
*platform_name;
*platform_of_node;
...
}[in the future]
struct snd_soc_dai_link {
...
*cpus
num_cpus;
*codecs;
num_codecs;
*platform;
...
}--- sound/soc/generic/simple-scu-card.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/generic/simple-scu-card.c +2 -0
@@ -25,6 +25,7 @@ struct simple_card_data {struct simple_dai_props {struct asoc_simple_dai dai;struct snd_soc_dai_link_component codecs; +struct snd_soc_dai_link_component platform; } *dai_props;struct snd_soc_dai_link *dai_link;struct asoc_simple_card_data adata;
@@ -262,6 +263,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev)for (i =0 ; i < num; i++) { dai_link[i].codecs = &dai_props[i].codecs; dai_link[i].num_codecs =1 ; + dai_link[i].platform = &dai_props[i].platform; } priv->dai_props = dai_props;
Signature · 1 line
2.7.4
Kuninori Morimoto
maintainerPATCH v2 13/15 ASoC: audio-graph-card: support snd_soc_dai_link_component style for platform
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
Current ASoC is supporting snd_soc_dai_link_component for binding, it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs). CPU will support multi style in the future.
We want to have it on Platform too in the future.
If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for audio-graph-card for platform.
[current]
struct snd_soc_dai_link {
...
*cpu_name;
*cpu_of_node;
*cpu_dai_name;
*codec_name;
*codec_of_node;
*codec_dai_name;
*codecs;
num_codecs;
*platform_name;
*platform_of_node;
...
}[in the future]
struct snd_soc_dai_link {
...
*cpus
num_cpus;
*codecs;
num_codecs;
*platform;
...
}--- sound/soc/generic/audio-graph-card.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/generic/audio-graph-card.c +2 -0
@@ -26,6 +26,7 @@ struct graph_card_data {struct asoc_simple_dai cpu_dai;struct asoc_simple_dai codec_dai;struct snd_soc_dai_link_component codecs;/* single codec */ +struct snd_soc_dai_link_component platform;unsigned int mclk_fs; } *dai_props;unsigned int mclk_fs;
@@ -325,6 +326,7 @@ static int asoc_graph_card_probe(struct platform_device *pdev)for (i =0 ; i < num; i++) { dai_link[i].codecs = &dai_props[i].codecs; dai_link[i].num_codecs =1 ; + dai_link[i].platform = &dai_props[i].platform; } priv->pa_gpio =devm_gpiod_get_optional (dev,"pa" ,GPIOD_OUT_LOW );
Signature · 1 line
2.7.4
Kuninori Morimoto
maintainerPATCH v2 14/15 ASoC: audio-graph-scu-card: support snd_soc_dai_link_component style for platform
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
Current ASoC is supporting snd_soc_dai_link_component for binding, it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs). CPU will support multi style in the future.
We want to have it on Platform too in the future.
If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for audio-graph-scu-card for platform.
[current]
struct snd_soc_dai_link {
...
*cpu_name;
*cpu_of_node;
*cpu_dai_name;
*codec_name;
*codec_of_node;
*codec_dai_name;
*codecs;
num_codecs;
*platform_name;
*platform_of_node;
...
}[in the future]
struct snd_soc_dai_link {
...
*cpus
num_cpus;
*codecs;
num_codecs;
*platform;
...
}--- sound/soc/generic/audio-graph-scu-card.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/generic/audio-graph-scu-card.c +2 -0
@@ -28,6 +28,7 @@ struct graph_card_data {struct graph_dai_props {struct asoc_simple_dai dai;struct snd_soc_dai_link_component codecs; +struct snd_soc_dai_link_component platform; } *dai_props;struct snd_soc_dai_link *dai_link;struct asoc_simple_card_data adata;
@@ -365,6 +366,7 @@ static int asoc_graph_card_probe(struct platform_device *pdev)for (i =0 ; i < num; i++) { dai_link[i].codecs = &dai_props[i].codecs; dai_link[i].num_codecs =1 ; + dai_link[i].platform = &dai_props[i].platform; } priv->dai_props = dai_props;
Signature · 1 line
2.7.4
Kuninori Morimoto
maintainerPATCH v2 15/15 ASoC: simple-card-util: remove dai_link compatible code for platform
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
Now no simple/audio cards are using legacy dai_link style for platform. Let's remove compatible code.
--- sound/soc/generic/simple-card-utils.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
sound/soc/generic/simple-card-utils.c +3 -7
@@ -376,13 +376,9 @@ EXPORT_SYMBOL_GPL(asoc_simple_card_init_dai);int asoc_simple_card_canonicalize_dailink (struct snd_soc_dai_link *dai_link) {/* Assumes platform == cpu */ -if (dai_link->platform) { -if (!dai_link->platform->of_node) - dai_link->platform->of_node = dai_link->cpu_of_node; - }else { -if (!dai_link->platform_of_node) - dai_link->platform_of_node = dai_link->cpu_of_node; - } +if (!dai_link->platform->of_node) + dai_link->platform->of_node = dai_link->cpu_of_node; +return 0 ; }
Signature · 1 line
2.7.4