summaryrefslogtreecommitdiffstats
path: root/sound/soc/generic
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 17:40:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 17:40:19 +0000
commit9f0fc191371843c4fc000a226b0a26b6c059aacd (patch)
tree35f8be3ef04506ac891ad001e8c41e535ae8d01d /sound/soc/generic
parentReleasing progress-linux version 6.6.15-2~progress7.99u1. (diff)
downloadlinux-9f0fc191371843c4fc000a226b0a26b6c059aacd.tar.xz
linux-9f0fc191371843c4fc000a226b0a26b6c059aacd.zip
Merging upstream version 6.7.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sound/soc/generic')
-rw-r--r--sound/soc/generic/audio-graph-card.c116
-rw-r--r--sound/soc/generic/audio-graph-card2-custom-sample.c32
-rw-r--r--sound/soc/generic/audio-graph-card2.c110
-rw-r--r--sound/soc/generic/simple-card-utils.c221
-rw-r--r--sound/soc/generic/simple-card.c149
-rw-r--r--sound/soc/generic/test-component.c4
6 files changed, 312 insertions, 320 deletions
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c
index 844a2ef159..76a9f1e8cd 100644
--- a/sound/soc/generic/audio-graph-card.c
+++ b/sound/soc/generic/audio-graph-card.c
@@ -13,8 +13,6 @@
#include <linux/gpio/consumer.h>
#include <linux/module.h>
#include <linux/of.h>
-#include <linux/of_device.h>
-#include <linux/of_gpio.h>
#include <linux/of_graph.h>
#include <linux/platform_device.h>
#include <linux/string.h>
@@ -27,7 +25,7 @@ static int graph_outdrv_event(struct snd_soc_dapm_widget *w,
int event)
{
struct snd_soc_dapm_context *dapm = w->dapm;
- struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(dapm->card);
+ struct simple_util_priv *priv = snd_soc_card_get_drvdata(dapm->card);
switch (event) {
case SND_SOC_DAPM_POST_PMU:
@@ -50,9 +48,9 @@ static const struct snd_soc_dapm_widget graph_dapm_widgets[] = {
};
static const struct snd_soc_ops graph_ops = {
- .startup = asoc_simple_startup,
- .shutdown = asoc_simple_shutdown,
- .hw_params = asoc_simple_hw_params,
+ .startup = simple_util_startup,
+ .shutdown = simple_util_shutdown,
+ .hw_params = simple_util_hw_params,
};
static bool soc_component_is_pcm(struct snd_soc_dai_link_component *dlc)
@@ -68,18 +66,18 @@ static bool soc_component_is_pcm(struct snd_soc_dai_link_component *dlc)
static void graph_parse_convert(struct device *dev,
struct device_node *ep,
- struct asoc_simple_data *adata)
+ struct simple_util_data *adata)
{
struct device_node *top = dev->of_node;
struct device_node *port = of_get_parent(ep);
struct device_node *ports = of_get_parent(port);
struct device_node *node = of_graph_get_port_parent(ep);
- asoc_simple_parse_convert(top, NULL, adata);
+ simple_util_parse_convert(top, NULL, adata);
if (of_node_name_eq(ports, "ports"))
- asoc_simple_parse_convert(ports, NULL, adata);
- asoc_simple_parse_convert(port, NULL, adata);
- asoc_simple_parse_convert(ep, NULL, adata);
+ simple_util_parse_convert(ports, NULL, adata);
+ simple_util_parse_convert(port, NULL, adata);
+ simple_util_parse_convert(ep, NULL, adata);
of_node_put(port);
of_node_put(ports);
@@ -103,7 +101,7 @@ static void graph_parse_mclk_fs(struct device_node *top,
of_node_put(ports);
}
-static int graph_parse_node(struct asoc_simple_priv *priv,
+static int graph_parse_node(struct simple_util_priv *priv,
struct device_node *ep,
struct link_info *li,
int *cpu)
@@ -113,35 +111,35 @@ static int graph_parse_node(struct asoc_simple_priv *priv,
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link);
struct snd_soc_dai_link_component *dlc;
- struct asoc_simple_dai *dai;
+ struct simple_util_dai *dai;
int ret;
if (cpu) {
- dlc = asoc_link_to_cpu(dai_link, 0);
+ dlc = snd_soc_link_to_cpu(dai_link, 0);
dai = simple_props_to_dai_cpu(dai_props, 0);
} else {
- dlc = asoc_link_to_codec(dai_link, 0);
+ dlc = snd_soc_link_to_codec(dai_link, 0);
dai = simple_props_to_dai_codec(dai_props, 0);
}
graph_parse_mclk_fs(top, ep, dai_props);
- ret = asoc_graph_parse_dai(dev, ep, dlc, cpu);
+ ret = graph_util_parse_dai(dev, ep, dlc, cpu);
if (ret < 0)
return ret;
- ret = asoc_simple_parse_tdm(ep, dai);
+ ret = simple_util_parse_tdm(ep, dai);
if (ret < 0)
return ret;
- ret = asoc_simple_parse_clk(dev, ep, dai, dlc);
+ ret = simple_util_parse_clk(dev, ep, dai, dlc);
if (ret < 0)
return ret;
return 0;
}
-static int graph_link_init(struct asoc_simple_priv *priv,
+static int graph_link_init(struct simple_util_priv *priv,
struct device_node *cpu_ep,
struct device_node *codec_ep,
struct link_info *li,
@@ -151,20 +149,20 @@ static int graph_link_init(struct asoc_simple_priv *priv,
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
int ret;
- ret = asoc_simple_parse_daifmt(dev, cpu_ep, codec_ep,
+ ret = simple_util_parse_daifmt(dev, cpu_ep, codec_ep,
NULL, &dai_link->dai_fmt);
if (ret < 0)
return ret;
- dai_link->init = asoc_simple_dai_init;
+ dai_link->init = simple_util_dai_init;
dai_link->ops = &graph_ops;
if (priv->ops)
dai_link->ops = priv->ops;
- return asoc_simple_set_dailink_name(dev, dai_link, name);
+ return simple_util_set_dailink_name(dev, dai_link, name);
}
-static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
+static int graph_dai_link_of_dpcm(struct simple_util_priv *priv,
struct device_node *cpu_ep,
struct device_node *codec_ep,
struct link_info *li)
@@ -181,8 +179,8 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
if (li->cpu) {
struct snd_soc_card *card = simple_priv_to_card(priv);
- struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0);
- struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0);
+ struct snd_soc_dai_link_component *cpus = snd_soc_link_to_cpu(dai_link, 0);
+ struct snd_soc_dai_link_component *platforms = snd_soc_link_to_platform(dai_link, 0);
int is_single_links = 0;
/* Codec is dummy */
@@ -209,14 +207,14 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
*/
if (card->component_chaining && !soc_component_is_pcm(cpus)) {
dai_link->no_pcm = 1;
- dai_link->be_hw_params_fixup = asoc_simple_be_hw_params_fixup;
+ dai_link->be_hw_params_fixup = simple_util_be_hw_params_fixup;
}
- asoc_simple_canonicalize_cpu(cpus, is_single_links);
- asoc_simple_canonicalize_platform(platforms, cpus);
+ simple_util_canonicalize_cpu(cpus, is_single_links);
+ simple_util_canonicalize_platform(platforms, cpus);
} else {
struct snd_soc_codec_conf *cconf = simple_props_to_codec_conf(dai_props, 0);
- struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0);
+ struct snd_soc_dai_link_component *codecs = snd_soc_link_to_codec(dai_link, 0);
struct device_node *port;
struct device_node *ports;
@@ -224,7 +222,7 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
/* BE settings */
dai_link->no_pcm = 1;
- dai_link->be_hw_params_fixup = asoc_simple_be_hw_params_fixup;
+ dai_link->be_hw_params_fixup = simple_util_be_hw_params_fixup;
ret = graph_parse_node(priv, codec_ep, li, NULL);
if (ret < 0)
@@ -258,16 +256,16 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
return ret;
}
-static int graph_dai_link_of(struct asoc_simple_priv *priv,
+static int graph_dai_link_of(struct simple_util_priv *priv,
struct device_node *cpu_ep,
struct device_node *codec_ep,
struct link_info *li)
{
struct device *dev = simple_priv_to_dev(priv);
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
- struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0);
- struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0);
- struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0);
+ struct snd_soc_dai_link_component *cpus = snd_soc_link_to_cpu(dai_link, 0);
+ struct snd_soc_dai_link_component *codecs = snd_soc_link_to_codec(dai_link, 0);
+ struct snd_soc_dai_link_component *platforms = snd_soc_link_to_platform(dai_link, 0);
char dai_name[64];
int ret, is_single_links = 0;
@@ -284,8 +282,8 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv,
snprintf(dai_name, sizeof(dai_name),
"%s-%s", cpus->dai_name, codecs->dai_name);
- asoc_simple_canonicalize_cpu(cpus, is_single_links);
- asoc_simple_canonicalize_platform(platforms, cpus);
+ simple_util_canonicalize_cpu(cpus, is_single_links);
+ simple_util_canonicalize_platform(platforms, cpus);
ret = graph_link_init(priv, cpu_ep, codec_ep, li, dai_name);
if (ret < 0)
@@ -296,9 +294,9 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv,
return 0;
}
-static inline bool parse_as_dpcm_link(struct asoc_simple_priv *priv,
+static inline bool parse_as_dpcm_link(struct simple_util_priv *priv,
struct device_node *codec_port,
- struct asoc_simple_data *adata)
+ struct simple_util_data *adata)
{
if (priv->force_dpcm)
return true;
@@ -312,19 +310,19 @@ static inline bool parse_as_dpcm_link(struct asoc_simple_priv *priv,
* or has convert-xxx property
*/
if ((of_get_child_count(codec_port) > 1) ||
- asoc_simple_is_convert_required(adata))
+ simple_util_is_convert_required(adata))
return true;
return false;
}
-static int __graph_for_each_link(struct asoc_simple_priv *priv,
+static int __graph_for_each_link(struct simple_util_priv *priv,
struct link_info *li,
- int (*func_noml)(struct asoc_simple_priv *priv,
+ int (*func_noml)(struct simple_util_priv *priv,
struct device_node *cpu_ep,
struct device_node *codec_ep,
struct link_info *li),
- int (*func_dpcm)(struct asoc_simple_priv *priv,
+ int (*func_dpcm)(struct simple_util_priv *priv,
struct device_node *cpu_ep,
struct device_node *codec_ep,
struct link_info *li))
@@ -337,7 +335,7 @@ static int __graph_for_each_link(struct asoc_simple_priv *priv,
struct device_node *codec_ep;
struct device_node *codec_port;
struct device_node *codec_port_old = NULL;
- struct asoc_simple_data adata;
+ struct simple_util_data adata;
int rc, ret = 0;
/* loop for all listed CPU port */
@@ -392,13 +390,13 @@ static int __graph_for_each_link(struct asoc_simple_priv *priv,
return 0;
}
-static int graph_for_each_link(struct asoc_simple_priv *priv,
+static int graph_for_each_link(struct simple_util_priv *priv,
struct link_info *li,
- int (*func_noml)(struct asoc_simple_priv *priv,
+ int (*func_noml)(struct simple_util_priv *priv,
struct device_node *cpu_ep,
struct device_node *codec_ep,
struct link_info *li),
- int (*func_dpcm)(struct asoc_simple_priv *priv,
+ int (*func_dpcm)(struct simple_util_priv *priv,
struct device_node *cpu_ep,
struct device_node *codec_ep,
struct link_info *li))
@@ -425,7 +423,7 @@ static int graph_for_each_link(struct asoc_simple_priv *priv,
return ret;
}
-static int graph_count_noml(struct asoc_simple_priv *priv,
+static int graph_count_noml(struct simple_util_priv *priv,
struct device_node *cpu_ep,
struct device_node *codec_ep,
struct link_info *li)
@@ -454,7 +452,7 @@ static int graph_count_noml(struct asoc_simple_priv *priv,
return 0;
}
-static int graph_count_dpcm(struct asoc_simple_priv *priv,
+static int graph_count_dpcm(struct simple_util_priv *priv,
struct device_node *cpu_ep,
struct device_node *codec_ep,
struct link_info *li)
@@ -487,7 +485,7 @@ static int graph_count_dpcm(struct asoc_simple_priv *priv,
return 0;
}
-static int graph_get_dais_count(struct asoc_simple_priv *priv,
+static int graph_get_dais_count(struct simple_util_priv *priv,
struct link_info *li)
{
/*
@@ -541,7 +539,7 @@ static int graph_get_dais_count(struct asoc_simple_priv *priv,
graph_count_dpcm);
}
-int audio_graph_parse_of(struct asoc_simple_priv *priv, struct device *dev)
+int audio_graph_parse_of(struct simple_util_priv *priv, struct device *dev)
{
struct snd_soc_card *card = simple_priv_to_card(priv);
struct link_info *li;
@@ -561,7 +559,7 @@ int audio_graph_parse_of(struct asoc_simple_priv *priv, struct device *dev)
if (!li->link)
return -EINVAL;
- ret = asoc_simple_init_priv(priv, li);
+ ret = simple_util_init_priv(priv, li);
if (ret < 0)
return ret;
@@ -572,11 +570,11 @@ int audio_graph_parse_of(struct asoc_simple_priv *priv, struct device *dev)
return ret;
}
- ret = asoc_simple_parse_widgets(card, NULL);
+ ret = simple_util_parse_widgets(card, NULL);
if (ret < 0)
return ret;
- ret = asoc_simple_parse_routing(card, NULL);
+ ret = simple_util_parse_routing(card, NULL);
if (ret < 0)
return ret;
@@ -587,13 +585,13 @@ int audio_graph_parse_of(struct asoc_simple_priv *priv, struct device *dev)
if (ret < 0)
goto err;
- ret = asoc_simple_parse_card_name(card, NULL);
+ ret = simple_util_parse_card_name(card, NULL);
if (ret < 0)
goto err;
snd_soc_card_set_drvdata(card, priv);
- asoc_simple_debug_info(priv);
+ simple_util_debug_info(priv);
ret = devm_snd_soc_register_card(dev, card);
if (ret < 0)
@@ -603,7 +601,7 @@ int audio_graph_parse_of(struct asoc_simple_priv *priv, struct device *dev)
return 0;
err:
- asoc_simple_clean_reference(card);
+ simple_util_clean_reference(card);
return dev_err_probe(dev, ret, "parse error\n");
}
@@ -611,7 +609,7 @@ EXPORT_SYMBOL_GPL(audio_graph_parse_of);
static int graph_probe(struct platform_device *pdev)
{
- struct asoc_simple_priv *priv;
+ struct simple_util_priv *priv;
struct device *dev = &pdev->dev;
struct snd_soc_card *card;
@@ -623,7 +621,7 @@ static int graph_probe(struct platform_device *pdev)
card = simple_priv_to_card(priv);
card->dapm_widgets = graph_dapm_widgets;
card->num_dapm_widgets = ARRAY_SIZE(graph_dapm_widgets);
- card->probe = asoc_graph_card_probe;
+ card->probe = graph_util_card_probe;
if (of_device_get_match_data(dev))
priv->dpcm_selectable = 1;
@@ -646,7 +644,7 @@ static struct platform_driver graph_card = {
.of_match_table = graph_of_match,
},
.probe = graph_probe,
- .remove = asoc_simple_remove,
+ .remove_new = simple_util_remove,
};
module_platform_driver(graph_card);
diff --git a/sound/soc/generic/audio-graph-card2-custom-sample.c b/sound/soc/generic/audio-graph-card2-custom-sample.c
index a3142be932..1b6ccd2de9 100644
--- a/sound/soc/generic/audio-graph-card2-custom-sample.c
+++ b/sound/soc/generic/audio-graph-card2-custom-sample.c
@@ -12,10 +12,10 @@
/*
* Custom driver can have own priv
- * which includes asoc_simple_priv.
+ * which includes simple_util_priv.
*/
struct custom_priv {
- struct asoc_simple_priv simple_priv;
+ struct simple_util_priv simple_priv;
/* custom driver's own params */
int custom_params;
@@ -26,7 +26,7 @@ struct custom_priv {
static int custom_card_probe(struct snd_soc_card *card)
{
- struct asoc_simple_priv *simple_priv = snd_soc_card_get_drvdata(card);
+ struct simple_util_priv *simple_priv = snd_soc_card_get_drvdata(card);
struct custom_priv *custom_priv = simple_to_custom(simple_priv);
struct device *dev = simple_priv_to_dev(simple_priv);
@@ -35,10 +35,10 @@ static int custom_card_probe(struct snd_soc_card *card)
custom_priv->custom_params = 1;
/* you can use generic probe function */
- return asoc_graph_card_probe(card);
+ return graph_util_card_probe(card);
}
-static int custom_hook_pre(struct asoc_simple_priv *priv)
+static int custom_hook_pre(struct simple_util_priv *priv)
{
struct device *dev = simple_priv_to_dev(priv);
@@ -48,7 +48,7 @@ static int custom_hook_pre(struct asoc_simple_priv *priv)
return 0;
}
-static int custom_hook_post(struct asoc_simple_priv *priv)
+static int custom_hook_post(struct simple_util_priv *priv)
{
struct device *dev = simple_priv_to_dev(priv);
struct snd_soc_card *card;
@@ -63,7 +63,7 @@ static int custom_hook_post(struct asoc_simple_priv *priv)
return 0;
}
-static int custom_normal(struct asoc_simple_priv *priv,
+static int custom_normal(struct simple_util_priv *priv,
struct device_node *lnk,
struct link_info *li)
{
@@ -78,7 +78,7 @@ static int custom_normal(struct asoc_simple_priv *priv,
return audio_graph2_link_normal(priv, lnk, li);
}
-static int custom_dpcm(struct asoc_simple_priv *priv,
+static int custom_dpcm(struct simple_util_priv *priv,
struct device_node *lnk,
struct link_info *li)
{
@@ -93,7 +93,7 @@ static int custom_dpcm(struct asoc_simple_priv *priv,
return audio_graph2_link_dpcm(priv, lnk, li);
}
-static int custom_c2c(struct asoc_simple_priv *priv,
+static int custom_c2c(struct simple_util_priv *priv,
struct device_node *lnk,
struct link_info *li)
{
@@ -121,26 +121,26 @@ static struct graph2_custom_hooks custom_hooks = {
static int custom_startup(struct snd_pcm_substream *substream)
{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card);
+ struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
+ struct simple_util_priv *priv = snd_soc_card_get_drvdata(rtd->card);
struct device *dev = simple_priv_to_dev(priv);
dev_info(dev, "custom startup\n");
- return asoc_simple_startup(substream);
+ return simple_util_startup(substream);
}
/* You can use custom ops */
static const struct snd_soc_ops custom_ops = {
.startup = custom_startup,
- .shutdown = asoc_simple_shutdown,
- .hw_params = asoc_simple_hw_params,
+ .shutdown = simple_util_shutdown,
+ .hw_params = simple_util_hw_params,
};
static int custom_probe(struct platform_device *pdev)
{
struct custom_priv *custom_priv;
- struct asoc_simple_priv *simple_priv;
+ struct simple_util_priv *simple_priv;
struct device *dev = &pdev->dev;
int ret;
@@ -176,7 +176,7 @@ static struct platform_driver custom_card = {
.of_match_table = custom_of_match,
},
.probe = custom_probe,
- .remove = asoc_simple_remove,
+ .remove_new = simple_util_remove,
};
module_platform_driver(custom_card);
diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c
index b1c675c6b6..7146611df7 100644
--- a/sound/soc/generic/audio-graph-card2.c
+++ b/sound/soc/generic/audio-graph-card2.c
@@ -12,8 +12,6 @@
#include <linux/gpio/consumer.h>
#include <linux/module.h>
#include <linux/of.h>
-#include <linux/of_device.h>
-#include <linux/of_gpio.h>
#include <linux/of_graph.h>
#include <linux/platform_device.h>
#include <linux/string.h>
@@ -282,7 +280,7 @@ out_put:
}
-static enum graph_type graph_get_type(struct asoc_simple_priv *priv,
+static enum graph_type graph_get_type(struct simple_util_priv *priv,
struct device_node *lnk)
{
enum graph_type type = __graph_get_type(lnk);
@@ -298,7 +296,7 @@ static enum graph_type graph_get_type(struct asoc_simple_priv *priv,
switch (type) {
case GRAPH_DPCM:
- if (asoc_graph_is_ports0(lnk))
+ if (graph_util_is_ports0(lnk))
str = "DPCM Front-End";
else
str = "DPCM Back-End";
@@ -360,9 +358,9 @@ static struct device_node *graph_get_next_multi_ep(struct device_node **port)
}
static const struct snd_soc_ops graph_ops = {
- .startup = asoc_simple_startup,
- .shutdown = asoc_simple_shutdown,
- .hw_params = asoc_simple_hw_params,
+ .startup = simple_util_startup,
+ .shutdown = simple_util_shutdown,
+ .hw_params = simple_util_hw_params,
};
static void graph_parse_convert(struct device_node *ep,
@@ -370,12 +368,12 @@ static void graph_parse_convert(struct device_node *ep,
{
struct device_node *port = of_get_parent(ep);
struct device_node *ports = of_get_parent(port);
- struct asoc_simple_data *adata = &props->adata;
+ struct simple_util_data *adata = &props->adata;
if (of_node_name_eq(ports, "ports"))
- asoc_simple_parse_convert(ports, NULL, adata);
- asoc_simple_parse_convert(port, NULL, adata);
- asoc_simple_parse_convert(ep, NULL, adata);
+ simple_util_parse_convert(ports, NULL, adata);
+ simple_util_parse_convert(port, NULL, adata);
+ simple_util_parse_convert(ep, NULL, adata);
of_node_put(port);
of_node_put(ports);
@@ -396,7 +394,7 @@ static void graph_parse_mclk_fs(struct device_node *ep,
of_node_put(ports);
}
-static int __graph_parse_node(struct asoc_simple_priv *priv,
+static int __graph_parse_node(struct simple_util_priv *priv,
enum graph_type gtype,
struct device_node *ep,
struct link_info *li,
@@ -406,32 +404,32 @@ static int __graph_parse_node(struct asoc_simple_priv *priv,
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link);
struct snd_soc_dai_link_component *dlc;
- struct asoc_simple_dai *dai;
+ struct simple_util_dai *dai;
int ret, is_single_links = 0;
if (is_cpu) {
- dlc = asoc_link_to_cpu(dai_link, idx);
+ dlc = snd_soc_link_to_cpu(dai_link, idx);
dai = simple_props_to_dai_cpu(dai_props, idx);
} else {
- dlc = asoc_link_to_codec(dai_link, idx);
+ dlc = snd_soc_link_to_codec(dai_link, idx);
dai = simple_props_to_dai_codec(dai_props, idx);
}
graph_parse_mclk_fs(ep, dai_props);
- ret = asoc_graph_parse_dai(dev, ep, dlc, &is_single_links);
+ ret = graph_util_parse_dai(dev, ep, dlc, &is_single_links);
if (ret < 0)
return ret;
- ret = asoc_simple_parse_tdm(ep, dai);
+ ret = simple_util_parse_tdm(ep, dai);
if (ret < 0)
return ret;
- ret = asoc_simple_parse_tdm_width_map(dev, ep, dai);
+ ret = simple_util_parse_tdm_width_map(dev, ep, dai);
if (ret < 0)
return ret;
- ret = asoc_simple_parse_clk(dev, ep, dai, dlc);
+ ret = simple_util_parse_clk(dev, ep, dai, dlc);
if (ret < 0)
return ret;
@@ -440,7 +438,7 @@ static int __graph_parse_node(struct asoc_simple_priv *priv,
*/
if (!dai_link->name) {
struct snd_soc_dai_link_component *cpus = dlc;
- struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, idx);
+ struct snd_soc_dai_link_component *codecs = snd_soc_link_to_codec(dai_link, idx);
char *cpu_multi = "";
char *codec_multi = "";
@@ -453,22 +451,22 @@ static int __graph_parse_node(struct asoc_simple_priv *priv,
case GRAPH_NORMAL:
/* run is_cpu only. see audio_graph2_link_normal() */
if (is_cpu)
- asoc_simple_set_dailink_name(dev, dai_link, "%s%s-%s%s",
+ simple_util_set_dailink_name(dev, dai_link, "%s%s-%s%s",
cpus->dai_name, cpu_multi,
codecs->dai_name, codec_multi);
break;
case GRAPH_DPCM:
if (is_cpu)
- asoc_simple_set_dailink_name(dev, dai_link, "fe.%pOFP.%s%s",
+ simple_util_set_dailink_name(dev, dai_link, "fe.%pOFP.%s%s",
cpus->of_node, cpus->dai_name, cpu_multi);
else
- asoc_simple_set_dailink_name(dev, dai_link, "be.%pOFP.%s%s",
+ simple_util_set_dailink_name(dev, dai_link, "be.%pOFP.%s%s",
codecs->of_node, codecs->dai_name, codec_multi);
break;
case GRAPH_C2C:
/* run is_cpu only. see audio_graph2_link_c2c() */
if (is_cpu)
- asoc_simple_set_dailink_name(dev, dai_link, "c2c.%s%s-%s%s",
+ simple_util_set_dailink_name(dev, dai_link, "c2c.%s%s-%s%s",
cpus->dai_name, cpu_multi,
codecs->dai_name, codec_multi);
break;
@@ -482,7 +480,7 @@ static int __graph_parse_node(struct asoc_simple_priv *priv,
* if DPCM-BE case
*/
if (!is_cpu && gtype == GRAPH_DPCM) {
- struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, idx);
+ struct snd_soc_dai_link_component *codecs = snd_soc_link_to_codec(dai_link, idx);
struct snd_soc_codec_conf *cconf = simple_props_to_codec_conf(dai_props, idx);
struct device_node *rport = of_get_parent(ep);
struct device_node *rports = of_get_parent(rport);
@@ -497,16 +495,16 @@ static int __graph_parse_node(struct asoc_simple_priv *priv,
if (is_cpu) {
struct snd_soc_dai_link_component *cpus = dlc;
- struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, idx);
+ struct snd_soc_dai_link_component *platforms = snd_soc_link_to_platform(dai_link, idx);
- asoc_simple_canonicalize_cpu(cpus, is_single_links);
- asoc_simple_canonicalize_platform(platforms, cpus);
+ simple_util_canonicalize_cpu(cpus, is_single_links);
+ simple_util_canonicalize_platform(platforms, cpus);
}
return 0;
}
-static int graph_parse_node(struct asoc_simple_priv *priv,
+static int graph_parse_node(struct simple_util_priv *priv,
enum graph_type gtype,
struct device_node *port,
struct link_info *li, int is_cpu)
@@ -590,7 +588,7 @@ static void graph_parse_daifmt(struct device_node *node,
update_daifmt(INV);
}
-static void graph_link_init(struct asoc_simple_priv *priv,
+static void graph_link_init(struct simple_util_priv *priv,
struct device_node *port,
struct link_info *li,
int is_cpu_node)
@@ -638,13 +636,13 @@ static void graph_link_init(struct asoc_simple_priv *priv,
daiclk = snd_soc_daifmt_clock_provider_flipped(daiclk);
dai_link->dai_fmt = daifmt | daiclk;
- dai_link->init = asoc_simple_dai_init;
+ dai_link->init = simple_util_dai_init;
dai_link->ops = &graph_ops;
if (priv->ops)
dai_link->ops = priv->ops;
}
-int audio_graph2_link_normal(struct asoc_simple_priv *priv,
+int audio_graph2_link_normal(struct simple_util_priv *priv,
struct device_node *lnk,
struct link_info *li)
{
@@ -678,7 +676,7 @@ err:
}
EXPORT_SYMBOL_GPL(audio_graph2_link_normal);
-int audio_graph2_link_dpcm(struct asoc_simple_priv *priv,
+int audio_graph2_link_dpcm(struct simple_util_priv *priv,
struct device_node *lnk,
struct link_info *li)
{
@@ -687,7 +685,7 @@ int audio_graph2_link_dpcm(struct asoc_simple_priv *priv,
struct device_node *rport = of_graph_get_remote_port(ep);
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link);
- int is_cpu = asoc_graph_is_ports0(lnk);
+ int is_cpu = graph_util_is_ports0(lnk);
int ret;
if (is_cpu) {
@@ -713,7 +711,7 @@ int audio_graph2_link_dpcm(struct asoc_simple_priv *priv,
/*
* setup CPU here, Codec is already set as dummy.
* see
- * asoc_simple_init_priv()
+ * simple_util_init_priv()
*/
dai_link->dynamic = 1;
dai_link->dpcm_merged_format = 1;
@@ -744,12 +742,12 @@ int audio_graph2_link_dpcm(struct asoc_simple_priv *priv,
/*
* setup Codec here, CPU is already set as dummy.
* see
- * asoc_simple_init_priv()
+ * simple_util_init_priv()
*/
/* BE settings */
dai_link->no_pcm = 1;
- dai_link->be_hw_params_fixup = asoc_simple_be_hw_params_fixup;
+ dai_link->be_hw_params_fixup = simple_util_be_hw_params_fixup;
ret = graph_parse_node(priv, GRAPH_DPCM, rport, li, 0);
if (ret < 0)
@@ -771,7 +769,7 @@ err:
}
EXPORT_SYMBOL_GPL(audio_graph2_link_dpcm);
-int audio_graph2_link_c2c(struct asoc_simple_priv *priv,
+int audio_graph2_link_c2c(struct simple_util_priv *priv,
struct device_node *lnk,
struct link_info *li)
{
@@ -807,7 +805,7 @@ int audio_graph2_link_c2c(struct asoc_simple_priv *priv,
* Card2 can use original Codec2Codec settings if DT has.
* It will use default settings if no settings on DT.
* see
- * asoc_simple_init_for_codec2codec()
+ * simple_util_init_for_codec2codec()
*
* Add more settings here if needed
*/
@@ -868,7 +866,7 @@ err1:
}
EXPORT_SYMBOL_GPL(audio_graph2_link_c2c);
-static int graph_link(struct asoc_simple_priv *priv,
+static int graph_link(struct simple_util_priv *priv,
struct graph2_custom_hooks *hooks,
enum graph_type gtype,
struct device_node *lnk,
@@ -940,7 +938,7 @@ static int graph_counter(struct device_node *lnk)
return 1;
}
-static int graph_count_normal(struct asoc_simple_priv *priv,
+static int graph_count_normal(struct simple_util_priv *priv,
struct device_node *lnk,
struct link_info *li)
{
@@ -969,7 +967,7 @@ static int graph_count_normal(struct asoc_simple_priv *priv,
return 0;
}
-static int graph_count_dpcm(struct asoc_simple_priv *priv,
+static int graph_count_dpcm(struct simple_util_priv *priv,
struct device_node *lnk,
struct link_info *li)
{
@@ -991,7 +989,7 @@ static int graph_count_dpcm(struct asoc_simple_priv *priv,
* };
*/
- if (asoc_graph_is_ports0(lnk)) {
+ if (graph_util_is_ports0(lnk)) {
/*
* DON'T REMOVE platforms
* see
@@ -1009,7 +1007,7 @@ static int graph_count_dpcm(struct asoc_simple_priv *priv,
return 0;
}
-static int graph_count_c2c(struct asoc_simple_priv *priv,
+static int graph_count_c2c(struct simple_util_priv *priv,
struct device_node *lnk,
struct link_info *li)
{
@@ -1051,7 +1049,7 @@ static int graph_count_c2c(struct asoc_simple_priv *priv,
return 0;
}
-static int graph_count(struct asoc_simple_priv *priv,
+static int graph_count(struct simple_util_priv *priv,
struct graph2_custom_hooks *hooks,
enum graph_type gtype,
struct device_node *lnk,
@@ -1094,10 +1092,10 @@ err:
return ret;
}
-static int graph_for_each_link(struct asoc_simple_priv *priv,
+static int graph_for_each_link(struct simple_util_priv *priv,
struct graph2_custom_hooks *hooks,
struct link_info *li,
- int (*func)(struct asoc_simple_priv *priv,
+ int (*func)(struct simple_util_priv *priv,
struct graph2_custom_hooks *hooks,
enum graph_type gtype,
struct device_node *lnk,
@@ -1124,7 +1122,7 @@ static int graph_for_each_link(struct asoc_simple_priv *priv,
return 0;
}
-int audio_graph2_parse_of(struct asoc_simple_priv *priv, struct device *dev,
+int audio_graph2_parse_of(struct simple_util_priv *priv, struct device *dev,
struct graph2_custom_hooks *hooks)
{
struct snd_soc_card *card = simple_priv_to_card(priv);
@@ -1135,7 +1133,7 @@ int audio_graph2_parse_of(struct asoc_simple_priv *priv, struct device *dev,
if (!li)
return -ENOMEM;
- card->probe = asoc_graph_card_probe;
+ card->probe = graph_util_card_probe;
card->owner = THIS_MODULE;
card->dev = dev;
@@ -1151,7 +1149,7 @@ int audio_graph2_parse_of(struct asoc_simple_priv *priv, struct device *dev,
if (ret < 0)
goto err;
- ret = asoc_simple_init_priv(priv, li);
+ ret = simple_util_init_priv(priv, li);
if (ret < 0)
goto err;
@@ -1162,11 +1160,11 @@ int audio_graph2_parse_of(struct asoc_simple_priv *priv, struct device *dev,
goto err;
}
- ret = asoc_simple_parse_widgets(card, NULL);
+ ret = simple_util_parse_widgets(card, NULL);
if (ret < 0)
goto err;
- ret = asoc_simple_parse_routing(card, NULL);
+ ret = simple_util_parse_routing(card, NULL);
if (ret < 0)
goto err;
@@ -1175,7 +1173,7 @@ int audio_graph2_parse_of(struct asoc_simple_priv *priv, struct device *dev,
if (ret < 0)
goto err;
- ret = asoc_simple_parse_card_name(card, NULL);
+ ret = simple_util_parse_card_name(card, NULL);
if (ret < 0)
goto err;
@@ -1187,7 +1185,7 @@ int audio_graph2_parse_of(struct asoc_simple_priv *priv, struct device *dev,
goto err;
}
- asoc_simple_debug_info(priv);
+ simple_util_debug_info(priv);
ret = devm_snd_soc_register_card(dev, card);
err:
@@ -1202,7 +1200,7 @@ EXPORT_SYMBOL_GPL(audio_graph2_parse_of);
static int graph_probe(struct platform_device *pdev)
{
- struct asoc_simple_priv *priv;
+ struct simple_util_priv *priv;
struct device *dev = &pdev->dev;
/* Allocate the private data and the DAI link array */
@@ -1226,7 +1224,7 @@ static struct platform_driver graph_card = {
.of_match_table = graph_of_match,
},
.probe = graph_probe,
- .remove = asoc_simple_remove,
+ .remove_new = simple_util_remove,
};
module_platform_driver(graph_card);
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index 2588ec735d..cfa70a56ff 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -14,7 +14,7 @@
#include <sound/pcm_params.h>
#include <sound/simple_card_utils.h>
-static void asoc_simple_fixup_sample_fmt(struct asoc_simple_data *data,
+static void simple_fixup_sample_fmt(struct simple_util_data *data,
struct snd_pcm_hw_params *params)
{
int i;
@@ -41,9 +41,9 @@ static void asoc_simple_fixup_sample_fmt(struct asoc_simple_data *data,
}
}
-void asoc_simple_parse_convert(struct device_node *np,
+void simple_util_parse_convert(struct device_node *np,
char *prefix,
- struct asoc_simple_data *data)
+ struct simple_util_data *data)
{
char prop[128];
@@ -62,24 +62,24 @@ void asoc_simple_parse_convert(struct device_node *np,
snprintf(prop, sizeof(prop), "%s%s", prefix, "convert-sample-format");
of_property_read_string(np, prop, &data->convert_sample_format);
}
-EXPORT_SYMBOL_GPL(asoc_simple_parse_convert);
+EXPORT_SYMBOL_GPL(simple_util_parse_convert);
/**
- * asoc_simple_is_convert_required() - Query if HW param conversion was requested
+ * simple_util_is_convert_required() - Query if HW param conversion was requested
* @data: Link data.
*
* Returns true if any HW param conversion was requested for this DAI link with
* any "convert-xxx" properties.
*/
-bool asoc_simple_is_convert_required(const struct asoc_simple_data *data)
+bool simple_util_is_convert_required(const struct simple_util_data *data)
{
return data->convert_rate ||
data->convert_channels ||
data->convert_sample_format;
}
-EXPORT_SYMBOL_GPL(asoc_simple_is_convert_required);
+EXPORT_SYMBOL_GPL(simple_util_is_convert_required);
-int asoc_simple_parse_daifmt(struct device *dev,
+int simple_util_parse_daifmt(struct device *dev,
struct device_node *node,
struct device_node *codec,
char *prefix,
@@ -113,10 +113,10 @@ int asoc_simple_parse_daifmt(struct device *dev,
return 0;
}
-EXPORT_SYMBOL_GPL(asoc_simple_parse_daifmt);
+EXPORT_SYMBOL_GPL(simple_util_parse_daifmt);
-int asoc_simple_parse_tdm_width_map(struct device *dev, struct device_node *np,
- struct asoc_simple_dai *dai)
+int simple_util_parse_tdm_width_map(struct device *dev, struct device_node *np,
+ struct simple_util_dai *dai)
{
u32 *array_values, *p;
int n, i, ret;
@@ -158,9 +158,9 @@ out:
return ret;
}
-EXPORT_SYMBOL_GPL(asoc_simple_parse_tdm_width_map);
+EXPORT_SYMBOL_GPL(simple_util_parse_tdm_width_map);
-int asoc_simple_set_dailink_name(struct device *dev,
+int simple_util_set_dailink_name(struct device *dev,
struct snd_soc_dai_link *dai_link,
const char *fmt, ...)
{
@@ -181,9 +181,9 @@ int asoc_simple_set_dailink_name(struct device *dev,
return ret;
}
-EXPORT_SYMBOL_GPL(asoc_simple_set_dailink_name);
+EXPORT_SYMBOL_GPL(simple_util_set_dailink_name);
-int asoc_simple_parse_card_name(struct snd_soc_card *card,
+int simple_util_parse_card_name(struct snd_soc_card *card,
char *prefix)
{
int ret;
@@ -207,9 +207,9 @@ int asoc_simple_parse_card_name(struct snd_soc_card *card,
return 0;
}
-EXPORT_SYMBOL_GPL(asoc_simple_parse_card_name);
+EXPORT_SYMBOL_GPL(simple_util_parse_card_name);
-static int asoc_simple_clk_enable(struct asoc_simple_dai *dai)
+static int simple_clk_enable(struct simple_util_dai *dai)
{
if (dai)
return clk_prepare_enable(dai->clk);
@@ -217,15 +217,15 @@ static int asoc_simple_clk_enable(struct asoc_simple_dai *dai)
return 0;
}
-static void asoc_simple_clk_disable(struct asoc_simple_dai *dai)
+static void simple_clk_disable(struct simple_util_dai *dai)
{
if (dai)
clk_disable_unprepare(dai->clk);
}
-int asoc_simple_parse_clk(struct device *dev,
+int simple_util_parse_clk(struct device *dev,
struct device_node *node,
- struct asoc_simple_dai *simple_dai,
+ struct simple_util_dai *simple_dai,
struct snd_soc_dai_link_component *dlc)
{
struct clk *clk;
@@ -258,10 +258,10 @@ int asoc_simple_parse_clk(struct device *dev,
return 0;
}
-EXPORT_SYMBOL_GPL(asoc_simple_parse_clk);
+EXPORT_SYMBOL_GPL(simple_util_parse_clk);
-static int asoc_simple_check_fixed_sysclk(struct device *dev,
- struct asoc_simple_dai *dai,
+static int simple_check_fixed_sysclk(struct device *dev,
+ struct simple_util_dai *dai,
unsigned int *fixed_sysclk)
{
if (dai->clk_fixed) {
@@ -276,30 +276,30 @@ static int asoc_simple_check_fixed_sysclk(struct device *dev,
return 0;
}
-int asoc_simple_startup(struct snd_pcm_substream *substream)
+int simple_util_startup(struct snd_pcm_substream *substream)
{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card);
+ struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
+ struct simple_util_priv *priv = snd_soc_card_get_drvdata(rtd->card);
struct simple_dai_props *props = simple_priv_to_props(priv, rtd->num);
- struct asoc_simple_dai *dai;
+ struct simple_util_dai *dai;
unsigned int fixed_sysclk = 0;
int i1, i2, i;
int ret;
for_each_prop_dai_cpu(props, i1, dai) {
- ret = asoc_simple_clk_enable(dai);
+ ret = simple_clk_enable(dai);
if (ret)
goto cpu_err;
- ret = asoc_simple_check_fixed_sysclk(rtd->dev, dai, &fixed_sysclk);
+ ret = simple_check_fixed_sysclk(rtd->dev, dai, &fixed_sysclk);
if (ret)
goto cpu_err;
}
for_each_prop_dai_codec(props, i2, dai) {
- ret = asoc_simple_clk_enable(dai);
+ ret = simple_clk_enable(dai);
if (ret)
goto codec_err;
- ret = asoc_simple_check_fixed_sysclk(rtd->dev, dai, &fixed_sysclk);
+ ret = simple_check_fixed_sysclk(rtd->dev, dai, &fixed_sysclk);
if (ret)
goto codec_err;
}
@@ -325,49 +325,49 @@ codec_err:
for_each_prop_dai_codec(props, i, dai) {
if (i >= i2)
break;
- asoc_simple_clk_disable(dai);
+ simple_clk_disable(dai);
}
cpu_err:
for_each_prop_dai_cpu(props, i, dai) {
if (i >= i1)
break;
- asoc_simple_clk_disable(dai);
+ simple_clk_disable(dai);
}
return ret;
}
-EXPORT_SYMBOL_GPL(asoc_simple_startup);
+EXPORT_SYMBOL_GPL(simple_util_startup);
-void asoc_simple_shutdown(struct snd_pcm_substream *substream)
+void simple_util_shutdown(struct snd_pcm_substream *substream)
{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card);
+ struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
+ struct simple_util_priv *priv = snd_soc_card_get_drvdata(rtd->card);
struct simple_dai_props *props = simple_priv_to_props(priv, rtd->num);
- struct asoc_simple_dai *dai;
+ struct simple_util_dai *dai;
int i;
for_each_prop_dai_cpu(props, i, dai) {
- struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, i);
+ struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, i);
if (props->mclk_fs && !dai->clk_fixed && !snd_soc_dai_active(cpu_dai))
snd_soc_dai_set_sysclk(cpu_dai,
0, 0, SND_SOC_CLOCK_OUT);
- asoc_simple_clk_disable(dai);
+ simple_clk_disable(dai);
}
for_each_prop_dai_codec(props, i, dai) {
- struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, i);
+ struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, i);
if (props->mclk_fs && !dai->clk_fixed && !snd_soc_dai_active(codec_dai))
snd_soc_dai_set_sysclk(codec_dai,
0, 0, SND_SOC_CLOCK_IN);
- asoc_simple_clk_disable(dai);
+ simple_clk_disable(dai);
}
}
-EXPORT_SYMBOL_GPL(asoc_simple_shutdown);
+EXPORT_SYMBOL_GPL(simple_util_shutdown);
-static int asoc_simple_set_clk_rate(struct device *dev,
- struct asoc_simple_dai *simple_dai,
+static int simple_set_clk_rate(struct device *dev,
+ struct simple_util_dai *simple_dai,
unsigned long rate)
{
if (!simple_dai)
@@ -387,8 +387,8 @@ static int asoc_simple_set_clk_rate(struct device *dev,
return clk_set_rate(simple_dai->clk, rate);
}
-static int asoc_simple_set_tdm(struct snd_soc_dai *dai,
- struct asoc_simple_dai *simple_dai,
+static int simple_set_tdm(struct snd_soc_dai *dai,
+ struct simple_util_dai *simple_dai,
struct snd_pcm_hw_params *params)
{
int sample_bits = params_width(params);
@@ -425,13 +425,13 @@ static int asoc_simple_set_tdm(struct snd_soc_dai *dai,
return 0;
}
-int asoc_simple_hw_params(struct snd_pcm_substream *substream,
+int simple_util_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct asoc_simple_dai *pdai;
+ struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
+ struct simple_util_dai *pdai;
struct snd_soc_dai *sdai;
- struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card);
+ struct simple_util_priv *priv = snd_soc_card_get_drvdata(rtd->card);
struct simple_dai_props *props = simple_priv_to_props(priv, rtd->num);
unsigned int mclk, mclk_fs = 0;
int i, ret;
@@ -444,13 +444,13 @@ int asoc_simple_hw_params(struct snd_pcm_substream *substream,
mclk = params_rate(params) * mclk_fs;
for_each_prop_dai_codec(props, i, pdai) {
- ret = asoc_simple_set_clk_rate(rtd->dev, pdai, mclk);
+ ret = simple_set_clk_rate(rtd->dev, pdai, mclk);
if (ret < 0)
return ret;
}
for_each_prop_dai_cpu(props, i, pdai) {
- ret = asoc_simple_set_clk_rate(rtd->dev, pdai, mclk);
+ ret = simple_set_clk_rate(rtd->dev, pdai, mclk);
if (ret < 0)
return ret;
}
@@ -480,29 +480,29 @@ int asoc_simple_hw_params(struct snd_pcm_substream *substream,
}
for_each_prop_dai_codec(props, i, pdai) {
- sdai = asoc_rtd_to_codec(rtd, i);
- ret = asoc_simple_set_tdm(sdai, pdai, params);
+ sdai = snd_soc_rtd_to_codec(rtd, i);
+ ret = simple_set_tdm(sdai, pdai, params);
if (ret < 0)
return ret;
}
for_each_prop_dai_cpu(props, i, pdai) {
- sdai = asoc_rtd_to_cpu(rtd, i);
- ret = asoc_simple_set_tdm(sdai, pdai, params);
+ sdai = snd_soc_rtd_to_cpu(rtd, i);
+ ret = simple_set_tdm(sdai, pdai, params);
if (ret < 0)
return ret;
}
return 0;
}
-EXPORT_SYMBOL_GPL(asoc_simple_hw_params);
+EXPORT_SYMBOL_GPL(simple_util_hw_params);
-int asoc_simple_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
+int simple_util_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params)
{
- struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card);
+ struct simple_util_priv *priv = snd_soc_card_get_drvdata(rtd->card);
struct simple_dai_props *dai_props = simple_priv_to_props(priv, rtd->num);
- struct asoc_simple_data *data = &dai_props->adata;
+ struct simple_util_data *data = &dai_props->adata;
struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
@@ -515,14 +515,13 @@ int asoc_simple_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
channels->max = data->convert_channels;
if (data->convert_sample_format)
- asoc_simple_fixup_sample_fmt(data, params);
+ simple_fixup_sample_fmt(data, params);
return 0;
}
-EXPORT_SYMBOL_GPL(asoc_simple_be_hw_params_fixup);
+EXPORT_SYMBOL_GPL(simple_util_be_hw_params_fixup);
-static int asoc_simple_init_dai(struct snd_soc_dai *dai,
- struct asoc_simple_dai *simple_dai)
+static int simple_init_dai(struct snd_soc_dai *dai, struct simple_util_dai *simple_dai)
{
int ret;
@@ -553,13 +552,13 @@ static int asoc_simple_init_dai(struct snd_soc_dai *dai,
return 0;
}
-static inline int asoc_simple_component_is_codec(struct snd_soc_component *component)
+static inline int simple_component_is_codec(struct snd_soc_component *component)
{
return component->driver->endianness;
}
-static int asoc_simple_init_for_codec2codec(struct snd_soc_pcm_runtime *rtd,
- struct simple_dai_props *dai_props)
+static int simple_init_for_codec2codec(struct snd_soc_pcm_runtime *rtd,
+ struct simple_dai_props *dai_props)
{
struct snd_soc_dai_link *dai_link = rtd->dai_link;
struct snd_soc_component *component;
@@ -577,7 +576,7 @@ static int asoc_simple_init_for_codec2codec(struct snd_soc_pcm_runtime *rtd,
/* Only Codecs */
for_each_rtd_components(rtd, i, component) {
- if (!asoc_simple_component_is_codec(component))
+ if (!simple_component_is_codec(component))
return 0;
}
@@ -610,33 +609,33 @@ static int asoc_simple_init_for_codec2codec(struct snd_soc_pcm_runtime *rtd,
return 0;
}
-int asoc_simple_dai_init(struct snd_soc_pcm_runtime *rtd)
+int simple_util_dai_init(struct snd_soc_pcm_runtime *rtd)
{
- struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card);
+ struct simple_util_priv *priv = snd_soc_card_get_drvdata(rtd->card);
struct simple_dai_props *props = simple_priv_to_props(priv, rtd->num);
- struct asoc_simple_dai *dai;
+ struct simple_util_dai *dai;
int i, ret;
for_each_prop_dai_codec(props, i, dai) {
- ret = asoc_simple_init_dai(asoc_rtd_to_codec(rtd, i), dai);
+ ret = simple_init_dai(snd_soc_rtd_to_codec(rtd, i), dai);
if (ret < 0)
return ret;
}
for_each_prop_dai_cpu(props, i, dai) {
- ret = asoc_simple_init_dai(asoc_rtd_to_cpu(rtd, i), dai);
+ ret = simple_init_dai(snd_soc_rtd_to_cpu(rtd, i), dai);
if (ret < 0)
return ret;
}
- ret = asoc_simple_init_for_codec2codec(rtd, props);
+ ret = simple_init_for_codec2codec(rtd, props);
if (ret < 0)
return ret;
return 0;
}
-EXPORT_SYMBOL_GPL(asoc_simple_dai_init);
+EXPORT_SYMBOL_GPL(simple_util_dai_init);
-void asoc_simple_canonicalize_platform(struct snd_soc_dai_link_component *platforms,
+void simple_util_canonicalize_platform(struct snd_soc_dai_link_component *platforms,
struct snd_soc_dai_link_component *cpus)
{
/*
@@ -652,9 +651,9 @@ void asoc_simple_canonicalize_platform(struct snd_soc_dai_link_component *platfo
if (!platforms->of_node)
snd_soc_dlc_use_cpu_as_platform(platforms, cpus);
}
-EXPORT_SYMBOL_GPL(asoc_simple_canonicalize_platform);
+EXPORT_SYMBOL_GPL(simple_util_canonicalize_platform);
-void asoc_simple_canonicalize_cpu(struct snd_soc_dai_link_component *cpus,
+void simple_util_canonicalize_cpu(struct snd_soc_dai_link_component *cpus,
int is_single_links)
{
/*
@@ -669,9 +668,9 @@ void asoc_simple_canonicalize_cpu(struct snd_soc_dai_link_component *cpus,
if (is_single_links)
cpus->dai_name = NULL;
}
-EXPORT_SYMBOL_GPL(asoc_simple_canonicalize_cpu);
+EXPORT_SYMBOL_GPL(simple_util_canonicalize_cpu);
-void asoc_simple_clean_reference(struct snd_soc_card *card)
+void simple_util_clean_reference(struct snd_soc_card *card)
{
struct snd_soc_dai_link *dai_link;
struct snd_soc_dai_link_component *cpu;
@@ -685,9 +684,9 @@ void asoc_simple_clean_reference(struct snd_soc_card *card)
of_node_put(codec->of_node);
}
}
-EXPORT_SYMBOL_GPL(asoc_simple_clean_reference);
+EXPORT_SYMBOL_GPL(simple_util_clean_reference);
-int asoc_simple_parse_routing(struct snd_soc_card *card,
+int simple_util_parse_routing(struct snd_soc_card *card,
char *prefix)
{
struct device_node *node = card->dev->of_node;
@@ -703,9 +702,9 @@ int asoc_simple_parse_routing(struct snd_soc_card *card,
return snd_soc_of_parse_audio_routing(card, prop);
}
-EXPORT_SYMBOL_GPL(asoc_simple_parse_routing);
+EXPORT_SYMBOL_GPL(simple_util_parse_routing);
-int asoc_simple_parse_widgets(struct snd_soc_card *card,
+int simple_util_parse_widgets(struct snd_soc_card *card,
char *prefix)
{
struct device_node *node = card->dev->of_node;
@@ -722,9 +721,9 @@ int asoc_simple_parse_widgets(struct snd_soc_card *card,
/* no widgets is not error */
return 0;
}
-EXPORT_SYMBOL_GPL(asoc_simple_parse_widgets);
+EXPORT_SYMBOL_GPL(simple_util_parse_widgets);
-int asoc_simple_parse_pin_switches(struct snd_soc_card *card,
+int simple_util_parse_pin_switches(struct snd_soc_card *card,
char *prefix)
{
char prop[128];
@@ -736,10 +735,10 @@ int asoc_simple_parse_pin_switches(struct snd_soc_card *card,
return snd_soc_of_parse_pin_switches(card, prop);
}
-EXPORT_SYMBOL_GPL(asoc_simple_parse_pin_switches);
+EXPORT_SYMBOL_GPL(simple_util_parse_pin_switches);
-int asoc_simple_init_jack(struct snd_soc_card *card,
- struct asoc_simple_jack *sjack,
+int simple_util_init_jack(struct snd_soc_card *card,
+ struct simple_util_jack *sjack,
int is_hp, char *prefix,
char *pin)
{
@@ -794,9 +793,9 @@ int asoc_simple_init_jack(struct snd_soc_card *card,
return 0;
}
-EXPORT_SYMBOL_GPL(asoc_simple_init_jack);
+EXPORT_SYMBOL_GPL(simple_util_init_jack);
-int asoc_simple_init_aux_jacks(struct asoc_simple_priv *priv, char *prefix)
+int simple_util_init_aux_jacks(struct simple_util_priv *priv, char *prefix)
{
struct snd_soc_card *card = simple_priv_to_card(priv);
struct snd_soc_component *component;
@@ -843,16 +842,16 @@ int asoc_simple_init_aux_jacks(struct asoc_simple_priv *priv, char *prefix)
}
return 0;
}
-EXPORT_SYMBOL_GPL(asoc_simple_init_aux_jacks);
+EXPORT_SYMBOL_GPL(simple_util_init_aux_jacks);
-int asoc_simple_init_priv(struct asoc_simple_priv *priv,
+int simple_util_init_priv(struct simple_util_priv *priv,
struct link_info *li)
{
struct snd_soc_card *card = simple_priv_to_card(priv);
struct device *dev = simple_priv_to_dev(priv);
struct snd_soc_dai_link *dai_link;
struct simple_dai_props *dai_props;
- struct asoc_simple_dai *dais;
+ struct simple_util_dai *dais;
struct snd_soc_dai_link_component *dlcs;
struct snd_soc_codec_conf *cconf = NULL;
int i, dai_num = 0, dlc_num = 0, cnf_num = 0;
@@ -913,7 +912,7 @@ int asoc_simple_init_priv(struct asoc_simple_priv *priv,
dais += li->num[i].cpus;
} else {
/* DPCM Be's CPU = dummy */
- dai_link[i].cpus = &asoc_dummy_dlc;
+ dai_link[i].cpus = &snd_soc_dummy_dlc;
dai_props[i].num.cpus =
dai_link[i].num_cpus = 1;
}
@@ -935,7 +934,7 @@ int asoc_simple_init_priv(struct asoc_simple_priv *priv,
}
} else {
/* DPCM Fe's Codec = dummy */
- dai_link[i].codecs = &asoc_dummy_dlc;
+ dai_link[i].codecs = &snd_soc_dummy_dlc;
dai_props[i].num.codecs =
dai_link[i].num_codecs = 1;
}
@@ -957,36 +956,34 @@ int asoc_simple_init_priv(struct asoc_simple_priv *priv,
return 0;
}
-EXPORT_SYMBOL_GPL(asoc_simple_init_priv);
+EXPORT_SYMBOL_GPL(simple_util_init_priv);
-int asoc_simple_remove(struct platform_device *pdev)
+void simple_util_remove(struct platform_device *pdev)
{
struct snd_soc_card *card = platform_get_drvdata(pdev);
- asoc_simple_clean_reference(card);
-
- return 0;
+ simple_util_clean_reference(card);
}
-EXPORT_SYMBOL_GPL(asoc_simple_remove);
+EXPORT_SYMBOL_GPL(simple_util_remove);
-int asoc_graph_card_probe(struct snd_soc_card *card)
+int graph_util_card_probe(struct snd_soc_card *card)
{
- struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(card);
+ struct simple_util_priv *priv = snd_soc_card_get_drvdata(card);
int ret;
- ret = asoc_simple_init_hp(card, &priv->hp_jack, NULL);
+ ret = simple_util_init_hp(card, &priv->hp_jack, NULL);
if (ret < 0)
return ret;
- ret = asoc_simple_init_mic(card, &priv->mic_jack, NULL);
+ ret = simple_util_init_mic(card, &priv->mic_jack, NULL);
if (ret < 0)
return ret;
return 0;
}
-EXPORT_SYMBOL_GPL(asoc_graph_card_probe);
+EXPORT_SYMBOL_GPL(graph_util_card_probe);
-int asoc_graph_is_ports0(struct device_node *np)
+int graph_util_is_ports0(struct device_node *np)
{
struct device_node *port, *ports, *ports0, *top;
int ret;
@@ -1012,7 +1009,7 @@ int asoc_graph_is_ports0(struct device_node *np)
return ret;
}
-EXPORT_SYMBOL_GPL(asoc_graph_is_ports0);
+EXPORT_SYMBOL_GPL(graph_util_is_ports0);
static int graph_get_dai_id(struct device_node *ep)
{
@@ -1067,7 +1064,7 @@ static int graph_get_dai_id(struct device_node *ep)
return id;
}
-int asoc_graph_parse_dai(struct device *dev, struct device_node *ep,
+int graph_util_parse_dai(struct device *dev, struct device_node *ep,
struct snd_soc_dai_link_component *dlc, int *is_single_link)
{
struct device_node *node;
@@ -1130,7 +1127,7 @@ parse_dai_end:
return 0;
}
-EXPORT_SYMBOL_GPL(asoc_graph_parse_dai);
+EXPORT_SYMBOL_GPL(graph_util_parse_dai);
/* Module information */
MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 274417e39e..9c79ff6a56 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -9,7 +9,7 @@
#include <linux/device.h>
#include <linux/module.h>
#include <linux/of.h>
-#include <linux/of_device.h>
+#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/string.h>
#include <sound/simple_card.h>
@@ -23,13 +23,12 @@
#define PREFIX "simple-audio-card,"
static const struct snd_soc_ops simple_ops = {
- .startup = asoc_simple_startup,
- .shutdown = asoc_simple_shutdown,
- .hw_params = asoc_simple_hw_params,
+ .startup = simple_util_startup,
+ .shutdown = simple_util_shutdown,
+ .hw_params = simple_util_hw_params,
};
-static int asoc_simple_parse_platform(struct device_node *node,
- struct snd_soc_dai_link_component *dlc)
+static int simple_parse_platform(struct device_node *node, struct snd_soc_dai_link_component *dlc)
{
struct of_phandle_args args;
int ret;
@@ -52,10 +51,10 @@ static int asoc_simple_parse_platform(struct device_node *node,
return 0;
}
-static int asoc_simple_parse_dai(struct device *dev,
- struct device_node *node,
- struct snd_soc_dai_link_component *dlc,
- int *is_single_link)
+static int simple_parse_dai(struct device *dev,
+ struct device_node *node,
+ struct snd_soc_dai_link_component *dlc,
+ int *is_single_link)
{
struct of_phandle_args args;
struct snd_soc_dai *dai;
@@ -117,15 +116,15 @@ parse_dai_end:
static void simple_parse_convert(struct device *dev,
struct device_node *np,
- struct asoc_simple_data *adata)
+ struct simple_util_data *adata)
{
struct device_node *top = dev->of_node;
struct device_node *node = of_get_parent(np);
- asoc_simple_parse_convert(top, PREFIX, adata);
- asoc_simple_parse_convert(node, PREFIX, adata);
- asoc_simple_parse_convert(node, NULL, adata);
- asoc_simple_parse_convert(np, NULL, adata);
+ simple_util_parse_convert(top, PREFIX, adata);
+ simple_util_parse_convert(node, PREFIX, adata);
+ simple_util_parse_convert(node, NULL, adata);
+ simple_util_parse_convert(np, NULL, adata);
of_node_put(node);
}
@@ -148,7 +147,7 @@ static void simple_parse_mclk_fs(struct device_node *top,
of_node_put(node);
}
-static int simple_parse_node(struct asoc_simple_priv *priv,
+static int simple_parse_node(struct simple_util_priv *priv,
struct device_node *np,
struct link_info *li,
char *prefix,
@@ -159,35 +158,35 @@ static int simple_parse_node(struct asoc_simple_priv *priv,
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link);
struct snd_soc_dai_link_component *dlc;
- struct asoc_simple_dai *dai;
+ struct simple_util_dai *dai;
int ret;
if (cpu) {
- dlc = asoc_link_to_cpu(dai_link, 0);
+ dlc = snd_soc_link_to_cpu(dai_link, 0);
dai = simple_props_to_dai_cpu(dai_props, 0);
} else {
- dlc = asoc_link_to_codec(dai_link, 0);
+ dlc = snd_soc_link_to_codec(dai_link, 0);
dai = simple_props_to_dai_codec(dai_props, 0);
}
simple_parse_mclk_fs(top, np, dai_props, prefix);
- ret = asoc_simple_parse_dai(dev, np, dlc, cpu);
+ ret = simple_parse_dai(dev, np, dlc, cpu);
if (ret)
return ret;
- ret = asoc_simple_parse_clk(dev, np, dai, dlc);
+ ret = simple_util_parse_clk(dev, np, dai, dlc);
if (ret)
return ret;
- ret = asoc_simple_parse_tdm(np, dai);
+ ret = simple_util_parse_tdm(np, dai);
if (ret)
return ret;
return 0;
}
-static int simple_link_init(struct asoc_simple_priv *priv,
+static int simple_link_init(struct simple_util_priv *priv,
struct device_node *node,
struct device_node *codec,
struct link_info *li,
@@ -197,18 +196,18 @@ static int simple_link_init(struct asoc_simple_priv *priv,
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
int ret;
- ret = asoc_simple_parse_daifmt(dev, node, codec,
+ ret = simple_util_parse_daifmt(dev, node, codec,
prefix, &dai_link->dai_fmt);
if (ret < 0)
return 0;
- dai_link->init = asoc_simple_dai_init;
+ dai_link->init = simple_util_dai_init;
dai_link->ops = &simple_ops;
- return asoc_simple_set_dailink_name(dev, dai_link, name);
+ return simple_util_set_dailink_name(dev, dai_link, name);
}
-static int simple_dai_link_of_dpcm(struct asoc_simple_priv *priv,
+static int simple_dai_link_of_dpcm(struct simple_util_priv *priv,
struct device_node *np,
struct device_node *codec,
struct link_info *li,
@@ -230,8 +229,8 @@ static int simple_dai_link_of_dpcm(struct asoc_simple_priv *priv,
prefix = PREFIX;
if (li->cpu) {
- struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0);
- struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0);
+ struct snd_soc_dai_link_component *cpus = snd_soc_link_to_cpu(dai_link, 0);
+ struct snd_soc_dai_link_component *platforms = snd_soc_link_to_platform(dai_link, 0);
int is_single_links = 0;
/* Codec is dummy */
@@ -246,17 +245,17 @@ static int simple_dai_link_of_dpcm(struct asoc_simple_priv *priv,
snprintf(dai_name, sizeof(dai_name), "fe.%s", cpus->dai_name);
- asoc_simple_canonicalize_cpu(cpus, is_single_links);
- asoc_simple_canonicalize_platform(platforms, cpus);
+ simple_util_canonicalize_cpu(cpus, is_single_links);
+ simple_util_canonicalize_platform(platforms, cpus);
} else {
- struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0);
+ struct snd_soc_dai_link_component *codecs = snd_soc_link_to_codec(dai_link, 0);
struct snd_soc_codec_conf *cconf;
/* CPU is dummy */
/* BE settings */
dai_link->no_pcm = 1;
- dai_link->be_hw_params_fixup = asoc_simple_be_hw_params_fixup;
+ dai_link->be_hw_params_fixup = simple_util_be_hw_params_fixup;
cconf = simple_props_to_codec_conf(dai_props, 0);
@@ -288,7 +287,7 @@ out_put_node:
return ret;
}
-static int simple_dai_link_of(struct asoc_simple_priv *priv,
+static int simple_dai_link_of(struct simple_util_priv *priv,
struct device_node *np,
struct device_node *codec,
struct link_info *li,
@@ -296,9 +295,9 @@ static int simple_dai_link_of(struct asoc_simple_priv *priv,
{
struct device *dev = simple_priv_to_dev(priv);
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
- struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0);
- struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0);
- struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0);
+ struct snd_soc_dai_link_component *cpus = snd_soc_link_to_cpu(dai_link, 0);
+ struct snd_soc_dai_link_component *codecs = snd_soc_link_to_codec(dai_link, 0);
+ struct snd_soc_dai_link_component *platforms = snd_soc_link_to_platform(dai_link, 0);
struct device_node *cpu = NULL;
struct device_node *node = NULL;
struct device_node *plat = NULL;
@@ -327,15 +326,15 @@ static int simple_dai_link_of(struct asoc_simple_priv *priv,
if (ret < 0)
goto dai_link_of_err;
- ret = asoc_simple_parse_platform(plat, platforms);
+ ret = simple_parse_platform(plat, platforms);
if (ret < 0)
goto dai_link_of_err;
snprintf(dai_name, sizeof(dai_name),
"%s-%s", cpus->dai_name, codecs->dai_name);
- asoc_simple_canonicalize_cpu(cpus, single_cpu);
- asoc_simple_canonicalize_platform(platforms, cpus);
+ simple_util_canonicalize_cpu(cpus, single_cpu);
+ simple_util_canonicalize_platform(platforms, cpus);
ret = simple_link_init(priv, node, codec, li, prefix, dai_name);
@@ -348,13 +347,13 @@ dai_link_of_err:
return ret;
}
-static int __simple_for_each_link(struct asoc_simple_priv *priv,
+static int __simple_for_each_link(struct simple_util_priv *priv,
struct link_info *li,
- int (*func_noml)(struct asoc_simple_priv *priv,
+ int (*func_noml)(struct simple_util_priv *priv,
struct device_node *np,
struct device_node *codec,
struct link_info *li, bool is_top),
- int (*func_dpcm)(struct asoc_simple_priv *priv,
+ int (*func_dpcm)(struct simple_util_priv *priv,
struct device_node *np,
struct device_node *codec,
struct link_info *li, bool is_top))
@@ -378,7 +377,7 @@ static int __simple_for_each_link(struct asoc_simple_priv *priv,
/* loop for all dai-link */
do {
- struct asoc_simple_data adata;
+ struct simple_util_data adata;
struct device_node *codec;
struct device_node *plat;
struct device_node *np;
@@ -419,7 +418,7 @@ static int __simple_for_each_link(struct asoc_simple_priv *priv,
* or has convert-xxx property
*/
if (dpcm_selectable &&
- (num > 2 || asoc_simple_is_convert_required(&adata))) {
+ (num > 2 || simple_util_is_convert_required(&adata))) {
/*
* np
* |1(CPU)|0(Codec) li->cpu
@@ -459,13 +458,13 @@ static int __simple_for_each_link(struct asoc_simple_priv *priv,
return ret;
}
-static int simple_for_each_link(struct asoc_simple_priv *priv,
+static int simple_for_each_link(struct simple_util_priv *priv,
struct link_info *li,
- int (*func_noml)(struct asoc_simple_priv *priv,
+ int (*func_noml)(struct simple_util_priv *priv,
struct device_node *np,
struct device_node *codec,
struct link_info *li, bool is_top),
- int (*func_dpcm)(struct asoc_simple_priv *priv,
+ int (*func_dpcm)(struct simple_util_priv *priv,
struct device_node *np,
struct device_node *codec,
struct link_info *li, bool is_top))
@@ -494,12 +493,12 @@ static int simple_for_each_link(struct asoc_simple_priv *priv,
static void simple_depopulate_aux(void *data)
{
- struct asoc_simple_priv *priv = data;
+ struct simple_util_priv *priv = data;
of_platform_depopulate(simple_priv_to_dev(priv));
}
-static int simple_populate_aux(struct asoc_simple_priv *priv)
+static int simple_populate_aux(struct simple_util_priv *priv)
{
struct device *dev = simple_priv_to_dev(priv);
struct device_node *node;
@@ -517,20 +516,20 @@ static int simple_populate_aux(struct asoc_simple_priv *priv)
return devm_add_action_or_reset(dev, simple_depopulate_aux, priv);
}
-static int simple_parse_of(struct asoc_simple_priv *priv, struct link_info *li)
+static int simple_parse_of(struct simple_util_priv *priv, struct link_info *li)
{
struct snd_soc_card *card = simple_priv_to_card(priv);
int ret;
- ret = asoc_simple_parse_widgets(card, PREFIX);
+ ret = simple_util_parse_widgets(card, PREFIX);
if (ret < 0)
return ret;
- ret = asoc_simple_parse_routing(card, PREFIX);
+ ret = simple_util_parse_routing(card, PREFIX);
if (ret < 0)
return ret;
- ret = asoc_simple_parse_pin_switches(card, PREFIX);
+ ret = simple_util_parse_pin_switches(card, PREFIX);
if (ret < 0)
return ret;
@@ -542,7 +541,7 @@ static int simple_parse_of(struct asoc_simple_priv *priv, struct link_info *li)
if (ret < 0)
return ret;
- ret = asoc_simple_parse_card_name(card, PREFIX);
+ ret = simple_util_parse_card_name(card, PREFIX);
if (ret < 0)
return ret;
@@ -555,7 +554,7 @@ static int simple_parse_of(struct asoc_simple_priv *priv, struct link_info *li)
return ret;
}
-static int simple_count_noml(struct asoc_simple_priv *priv,
+static int simple_count_noml(struct simple_util_priv *priv,
struct device_node *np,
struct device_node *codec,
struct link_info *li, bool is_top)
@@ -579,7 +578,7 @@ static int simple_count_noml(struct asoc_simple_priv *priv,
* ignored by snd_soc_rtd_add_component().
*
* see
- * simple-card-utils.c :: asoc_simple_canonicalize_platform()
+ * simple-card-utils.c :: simple_util_canonicalize_platform()
*/
li->num[li->link].cpus = 1;
li->num[li->link].platforms = 1;
@@ -591,7 +590,7 @@ static int simple_count_noml(struct asoc_simple_priv *priv,
return 0;
}
-static int simple_count_dpcm(struct asoc_simple_priv *priv,
+static int simple_count_dpcm(struct simple_util_priv *priv,
struct device_node *np,
struct device_node *codec,
struct link_info *li, bool is_top)
@@ -622,7 +621,7 @@ static int simple_count_dpcm(struct asoc_simple_priv *priv,
return 0;
}
-static int simple_get_dais_count(struct asoc_simple_priv *priv,
+static int simple_get_dais_count(struct simple_util_priv *priv,
struct link_info *li)
{
struct device *dev = simple_priv_to_dev(priv);
@@ -690,27 +689,27 @@ static int simple_get_dais_count(struct asoc_simple_priv *priv,
static int simple_soc_probe(struct snd_soc_card *card)
{
- struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(card);
+ struct simple_util_priv *priv = snd_soc_card_get_drvdata(card);
int ret;
- ret = asoc_simple_init_hp(card, &priv->hp_jack, PREFIX);
+ ret = simple_util_init_hp(card, &priv->hp_jack, PREFIX);
if (ret < 0)
return ret;
- ret = asoc_simple_init_mic(card, &priv->mic_jack, PREFIX);
+ ret = simple_util_init_mic(card, &priv->mic_jack, PREFIX);
if (ret < 0)
return ret;
- ret = asoc_simple_init_aux_jacks(priv, PREFIX);
+ ret = simple_util_init_aux_jacks(priv, PREFIX);
if (ret < 0)
return ret;
return 0;
}
-static int asoc_simple_probe(struct platform_device *pdev)
+static int simple_probe(struct platform_device *pdev)
{
- struct asoc_simple_priv *priv;
+ struct simple_util_priv *priv;
struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node;
struct snd_soc_card *card;
@@ -739,7 +738,7 @@ static int asoc_simple_probe(struct platform_device *pdev)
if (!li->link)
return -EINVAL;
- ret = asoc_simple_init_priv(priv, li);
+ ret = simple_util_init_priv(priv, li);
if (ret < 0)
return ret;
@@ -752,7 +751,7 @@ static int asoc_simple_probe(struct platform_device *pdev)
}
} else {
- struct asoc_simple_card_info *cinfo;
+ struct simple_util_info *cinfo;
struct snd_soc_dai_link_component *cpus;
struct snd_soc_dai_link_component *codecs;
struct snd_soc_dai_link_component *platform;
@@ -772,7 +771,7 @@ static int asoc_simple_probe(struct platform_device *pdev)
!cinfo->codec ||
!cinfo->platform ||
!cinfo->cpu_dai.name) {
- dev_err(dev, "insufficient asoc_simple_card_info settings\n");
+ dev_err(dev, "insufficient simple_util_info settings\n");
goto err;
}
@@ -790,7 +789,7 @@ static int asoc_simple_probe(struct platform_device *pdev)
dai_link->name = cinfo->name;
dai_link->stream_name = cinfo->name;
dai_link->dai_fmt = cinfo->daifmt;
- dai_link->init = asoc_simple_dai_init;
+ dai_link->init = simple_util_dai_init;
memcpy(dai_props->cpu_dai, &cinfo->cpu_dai,
sizeof(*dai_props->cpu_dai));
memcpy(dai_props->codec_dai, &cinfo->codec_dai,
@@ -799,7 +798,7 @@ static int asoc_simple_probe(struct platform_device *pdev)
snd_soc_card_set_drvdata(card, priv);
- asoc_simple_debug_info(priv);
+ simple_util_debug_info(priv);
ret = devm_snd_soc_register_card(dev, card);
if (ret < 0)
@@ -808,7 +807,7 @@ static int asoc_simple_probe(struct platform_device *pdev)
devm_kfree(dev, li);
return 0;
err:
- asoc_simple_clean_reference(card);
+ simple_util_clean_reference(card);
return ret;
}
@@ -821,17 +820,17 @@ static const struct of_device_id simple_of_match[] = {
};
MODULE_DEVICE_TABLE(of, simple_of_match);
-static struct platform_driver asoc_simple_card = {
+static struct platform_driver simple_card = {
.driver = {
.name = "asoc-simple-card",
.pm = &snd_soc_pm_ops,
.of_match_table = simple_of_match,
},
- .probe = asoc_simple_probe,
- .remove = asoc_simple_remove,
+ .probe = simple_probe,
+ .remove_new = simple_util_remove,
};
-module_platform_driver(asoc_simple_card);
+module_platform_driver(simple_card);
MODULE_ALIAS("platform:asoc-simple-card");
MODULE_LICENSE("GPL v2");
diff --git a/sound/soc/generic/test-component.c b/sound/soc/generic/test-component.c
index e10e5bf284..e4967540a2 100644
--- a/sound/soc/generic/test-component.c
+++ b/sound/soc/generic/test-component.c
@@ -6,7 +6,7 @@
// Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
#include <linux/slab.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
#include <linux/of_graph.h>
#include <linux/module.h>
#include <linux/workqueue.h>
@@ -352,7 +352,7 @@ static const struct snd_pcm_hardware test_component_hardware = {
static int test_component_open(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
+ struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
mile_stone(component);