* [PATCH 0/5] ASoC: clarify Codec2Codec params
@ 2023-03-27 0:09 Kuninori Morimoto
2023-03-27 0:09 ` [PATCH 1/5] ASoC: soc.h: " Kuninori Morimoto
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Kuninori Morimoto @ 2023-03-27 0:09 UTC (permalink / raw)
To: Mark Brown; +Cc: Linux-ALSA
Hi Mark
ASoC is supporting Codec2Codec, but its parameter name is
"params" and "num_params" which are very unclear naming.
This patch-set clarifies it by replacing to c2c_params / num_c2c_params.
Kuninori Morimoto (5):
ASoC: soc.h: clarify Codec2Codec params
ASoC: audio-graph-card2: switch to use c2c_params instead of params
ASoC: meson: switch to use c2c_params instead of params
ASoC: samsung: switch to use c2c_params instead of params
ASoC: soc.h: remove unused params/num_params
include/sound/soc.h | 9 ++++--
sound/soc/generic/audio-graph-card2.c | 4 +--
sound/soc/generic/simple-card-utils.c | 24 +++++++--------
sound/soc/meson/axg-card.c | 3 +-
sound/soc/meson/gx-card.c | 3 +-
sound/soc/meson/meson-codec-glue.c | 5 +--
sound/soc/samsung/aries_wm8994.c | 6 ++--
sound/soc/samsung/bells.c | 21 ++++++++-----
sound/soc/samsung/littlemill.c | 3 +-
sound/soc/samsung/lowland.c | 3 +-
sound/soc/samsung/speyside.c | 3 +-
sound/soc/soc-dapm.c | 44 +++++++++++++--------------
sound/soc/soc-pcm.c | 10 +++---
13 files changed, 78 insertions(+), 60 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/5] ASoC: soc.h: clarify Codec2Codec params
2023-03-27 0:09 [PATCH 0/5] ASoC: clarify Codec2Codec params Kuninori Morimoto
@ 2023-03-27 0:09 ` Kuninori Morimoto
2023-03-27 0:10 ` [PATCH 2/5] ASoC: audio-graph-card2: switch to use c2c_params instead of params Kuninori Morimoto
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Kuninori Morimoto @ 2023-03-27 0:09 UTC (permalink / raw)
To: Mark Brown; +Cc: Linux-ALSA
snd_soc_dai_link has params/num_params, but it is unclear that
params for what. This patch clarify it is params for Codec2Codec.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
include/sound/soc.h | 12 +++++++++---
sound/soc/soc-core.c | 11 +++++++++++
sound/soc/soc-dapm.c | 44 ++++++++++++++++++++++----------------------
sound/soc/soc-pcm.c | 10 +++++-----
4 files changed, 47 insertions(+), 30 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h
index e58b43b5da7c..08fc69cf6b74 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -684,8 +684,14 @@ struct snd_soc_dai_link {
int id; /* optional ID for machine driver link identification */
- const struct snd_soc_pcm_stream *params;
- unsigned int num_params;
+ /*
+ * for Codec2Codec
+ */
+ const struct snd_soc_pcm_stream *c2c_params;
+ unsigned int num_c2c_params;
+
+ const struct snd_soc_pcm_stream *params; /* REMOVE ME */
+ unsigned int num_params; /* REMOVE ME */
unsigned int dai_fmt; /* format to set on init */
@@ -1065,7 +1071,7 @@ struct snd_soc_pcm_runtime {
struct snd_soc_dai_link *dai_link;
struct snd_pcm_ops ops;
- unsigned int params_select; /* currently selected param for dai link */
+ unsigned int c2c_params_select; /* currently selected c2c_param for dai link */
/* Dynamic PCM BE runtime data */
struct snd_soc_dpcm_runtime dpcm[SNDRV_PCM_STREAM_LAST + 1];
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 2faa0d8d0d8e..f3450478e20c 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2283,6 +2283,9 @@ EXPORT_SYMBOL_GPL(snd_soc_add_dai_controls);
*/
int snd_soc_register_card(struct snd_soc_card *card)
{
+ struct snd_soc_dai_link *dai_link;
+ int i;
+
if (!card->name || !card->dev)
return -EINVAL;
@@ -2303,6 +2306,14 @@ int snd_soc_register_card(struct snd_soc_card *card)
mutex_init(&card->dapm_mutex);
mutex_init(&card->pcm_mutex);
+ /* REMOVE ME */
+ for_each_card_prelinks(card, i, dai_link) {
+ if (!dai_link->c2c_params) {
+ dai_link->c2c_params = dai_link->params;
+ dai_link->num_c2c_params = dai_link->num_params;
+ }
+ }
+
return snd_soc_bind_card(card);
}
EXPORT_SYMBOL_GPL(snd_soc_register_card);
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 5d9a671e50f1..3fa30a3afec2 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1075,7 +1075,7 @@ static int dapm_new_dai_link(struct snd_soc_dapm_widget *w)
struct snd_soc_pcm_runtime *rtd = w->priv;
/* create control for links with > 1 config */
- if (rtd->dai_link->num_params <= 1)
+ if (rtd->dai_link->num_c2c_params <= 1)
return 0;
/* add kcontrol */
@@ -3864,7 +3864,7 @@ snd_soc_dai_link_event_pre_pmu(struct snd_soc_dapm_widget *w,
* either party on the link to alter the configuration if
* necessary
*/
- config = rtd->dai_link->params + rtd->params_select;
+ config = rtd->dai_link->c2c_params + rtd->c2c_params_select;
if (!config) {
dev_err(w->dapm->dev, "ASoC: link config missing\n");
ret = -EINVAL;
@@ -4010,7 +4010,7 @@ static int snd_soc_dapm_dai_link_get(struct snd_kcontrol *kcontrol,
struct snd_soc_dapm_widget *w = snd_kcontrol_chip(kcontrol);
struct snd_soc_pcm_runtime *rtd = w->priv;
- ucontrol->value.enumerated.item[0] = rtd->params_select;
+ ucontrol->value.enumerated.item[0] = rtd->c2c_params_select;
return 0;
}
@@ -4025,13 +4025,13 @@ static int snd_soc_dapm_dai_link_put(struct snd_kcontrol *kcontrol,
if (w->power)
return -EBUSY;
- if (ucontrol->value.enumerated.item[0] == rtd->params_select)
+ if (ucontrol->value.enumerated.item[0] == rtd->c2c_params_select)
return 0;
- if (ucontrol->value.enumerated.item[0] >= rtd->dai_link->num_params)
+ if (ucontrol->value.enumerated.item[0] >= rtd->dai_link->num_c2c_params)
return -EINVAL;
- rtd->params_select = ucontrol->value.enumerated.item[0];
+ rtd->c2c_params_select = ucontrol->value.enumerated.item[0];
return 1;
}
@@ -4039,7 +4039,7 @@ static int snd_soc_dapm_dai_link_put(struct snd_kcontrol *kcontrol,
static void
snd_soc_dapm_free_kcontrol(struct snd_soc_card *card,
unsigned long *private_value,
- int num_params,
+ int num_c2c_params,
const char **w_param_text)
{
int count;
@@ -4049,7 +4049,7 @@ snd_soc_dapm_free_kcontrol(struct snd_soc_card *card,
if (!w_param_text)
return;
- for (count = 0 ; count < num_params; count++)
+ for (count = 0 ; count < num_c2c_params; count++)
devm_kfree(card->dev, (void *)w_param_text[count]);
devm_kfree(card->dev, w_param_text);
}
@@ -4057,8 +4057,8 @@ snd_soc_dapm_free_kcontrol(struct snd_soc_card *card,
static struct snd_kcontrol_new *
snd_soc_dapm_alloc_kcontrol(struct snd_soc_card *card,
char *link_name,
- const struct snd_soc_pcm_stream *params,
- int num_params, const char **w_param_text,
+ const struct snd_soc_pcm_stream *c2c_params,
+ int num_c2c_params, const char **w_param_text,
unsigned long *private_value)
{
struct soc_enum w_param_enum[] = {
@@ -4070,10 +4070,10 @@ snd_soc_dapm_alloc_kcontrol(struct snd_soc_card *card,
snd_soc_dapm_dai_link_put),
};
struct snd_kcontrol_new *kcontrol_news;
- const struct snd_soc_pcm_stream *config = params;
+ const struct snd_soc_pcm_stream *config = c2c_params;
int count;
- for (count = 0 ; count < num_params; count++) {
+ for (count = 0 ; count < num_c2c_params; count++) {
if (!config->stream_name) {
dev_warn(card->dapm.dev,
"ASoC: anonymous config %d for dai link %s\n",
@@ -4093,7 +4093,7 @@ snd_soc_dapm_alloc_kcontrol(struct snd_soc_card *card,
config++;
}
- w_param_enum[0].items = num_params;
+ w_param_enum[0].items = num_c2c_params;
w_param_enum[0].texts = w_param_text;
*private_value =
@@ -4118,7 +4118,7 @@ snd_soc_dapm_alloc_kcontrol(struct snd_soc_card *card,
return kcontrol_news;
outfree_w_param:
- snd_soc_dapm_free_kcontrol(card, private_value, num_params, w_param_text);
+ snd_soc_dapm_free_kcontrol(card, private_value, num_c2c_params, w_param_text);
return NULL;
}
@@ -4146,17 +4146,17 @@ snd_soc_dapm_new_dai(struct snd_soc_card *card,
w_param_text = NULL;
kcontrol_news = NULL;
num_kcontrols = 0;
- if (rtd->dai_link->num_params > 1) {
+ if (rtd->dai_link->num_c2c_params > 1) {
w_param_text = devm_kcalloc(card->dev,
- rtd->dai_link->num_params,
+ rtd->dai_link->num_c2c_params,
sizeof(char *), GFP_KERNEL);
if (!w_param_text)
goto param_fail;
num_kcontrols = 1;
kcontrol_news = snd_soc_dapm_alloc_kcontrol(card, link_name,
- rtd->dai_link->params,
- rtd->dai_link->num_params,
+ rtd->dai_link->c2c_params,
+ rtd->dai_link->num_c2c_params,
w_param_text, &private_value);
if (!kcontrol_news)
goto param_fail;
@@ -4187,7 +4187,7 @@ snd_soc_dapm_new_dai(struct snd_soc_card *card,
outfree_kcontrol_news:
devm_kfree(card->dev, (void *)template.kcontrol_news);
snd_soc_dapm_free_kcontrol(card, &private_value,
- rtd->dai_link->num_params, w_param_text);
+ rtd->dai_link->num_c2c_params, w_param_text);
param_fail:
devm_kfree(card->dev, link_name);
name_fail:
@@ -4336,7 +4336,7 @@ static void dapm_connect_dai_pair(struct snd_soc_card *card,
struct snd_pcm_str *streams = rtd->pcm->streams;
int stream;
- if (dai_link->params) {
+ if (dai_link->c2c_params) {
playback_cpu = snd_soc_dai_get_widget_capture(cpu_dai);
capture_cpu = snd_soc_dai_get_widget_playback(cpu_dai);
} else {
@@ -4349,7 +4349,7 @@ static void dapm_connect_dai_pair(struct snd_soc_card *card,
codec = snd_soc_dai_get_widget(codec_dai, stream);
if (playback_cpu && codec) {
- if (dai_link->params && !rtd->c2c_widget[stream]) {
+ if (dai_link->c2c_params && !rtd->c2c_widget[stream]) {
substream = streams[stream].substream;
dai = snd_soc_dapm_new_dai(card, substream, "playback");
if (IS_ERR(dai))
@@ -4368,7 +4368,7 @@ static void dapm_connect_dai_pair(struct snd_soc_card *card,
codec = snd_soc_dai_get_widget(codec_dai, stream);
if (codec && capture_cpu) {
- if (dai_link->params && !rtd->c2c_widget[stream]) {
+ if (dai_link->c2c_params && !rtd->c2c_widget[stream]) {
substream = streams[stream].substream;
dai = snd_soc_dapm_new_dai(card, substream, "capture");
if (IS_ERR(dai))
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index f6b5f72df65e..d88b94b5a0e3 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -2789,9 +2789,9 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd,
struct snd_soc_dai *codec_dai;
/* Adapt stream for codec2codec links */
- int cpu_capture = rtd->dai_link->params ?
+ int cpu_capture = rtd->dai_link->c2c_params ?
SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE;
- int cpu_playback = rtd->dai_link->params ?
+ int cpu_playback = rtd->dai_link->c2c_params ?
SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK;
for_each_rtd_codec_dais(rtd, i, codec_dai) {
@@ -2835,7 +2835,7 @@ static int soc_create_pcm(struct snd_pcm **pcm,
int ret;
/* create the PCM */
- if (rtd->dai_link->params) {
+ if (rtd->dai_link->c2c_params) {
snprintf(new_name, sizeof(new_name), "codec2codec(%s)",
rtd->dai_link->stream_name);
@@ -2892,7 +2892,7 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
* don't interface with the outside world or application layer
* we don't have to do any special handling on close.
*/
- if (!rtd->dai_link->params)
+ if (!rtd->dai_link->c2c_params)
rtd->close_delayed_work_func = snd_soc_close_delayed_work;
rtd->pcm = pcm;
@@ -2900,7 +2900,7 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
pcm->private_data = rtd;
pcm->no_device_suspend = true;
- if (rtd->dai_link->no_pcm || rtd->dai_link->params) {
+ if (rtd->dai_link->no_pcm || rtd->dai_link->c2c_params) {
if (playback)
pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->private_data = rtd;
if (capture)
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/5] ASoC: audio-graph-card2: switch to use c2c_params instead of params
2023-03-27 0:09 [PATCH 0/5] ASoC: clarify Codec2Codec params Kuninori Morimoto
2023-03-27 0:09 ` [PATCH 1/5] ASoC: soc.h: " Kuninori Morimoto
@ 2023-03-27 0:10 ` Kuninori Morimoto
2023-03-27 0:10 ` [PATCH 3/5] ASoC: meson: " Kuninori Morimoto
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Kuninori Morimoto @ 2023-03-27 0:10 UTC (permalink / raw)
To: Mark Brown; +Cc: Linux-ALSA
ASoC is now using c2c_params instead of params.
This patch replace it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
sound/soc/generic/audio-graph-card2.c | 4 ++--
sound/soc/generic/simple-card-utils.c | 24 ++++++++++++------------
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c
index d145b74d41e4..25aa79dd55b3 100644
--- a/sound/soc/generic/audio-graph-card2.c
+++ b/sound/soc/generic/audio-graph-card2.c
@@ -920,8 +920,8 @@ int audio_graph2_link_c2c(struct asoc_simple_priv *priv,
c2c_conf->channels_min =
c2c_conf->channels_max = 2; /* update ME */
- dai_link->params = c2c_conf;
- dai_link->num_params = 1;
+ dai_link->c2c_params = c2c_conf;
+ dai_link->num_c2c_params = 1;
}
ep0 = port_to_endpoint(port0);
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index 34a9b91e676f..467edd96eae5 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -562,12 +562,12 @@ static int asoc_simple_init_for_codec2codec(struct snd_soc_pcm_runtime *rtd,
{
struct snd_soc_dai_link *dai_link = rtd->dai_link;
struct snd_soc_component *component;
- struct snd_soc_pcm_stream *params;
+ struct snd_soc_pcm_stream *c2c_params;
struct snd_pcm_hardware hw;
int i, ret, stream;
/* Do nothing if it already has Codec2Codec settings */
- if (dai_link->params)
+ if (dai_link->c2c_params)
return 0;
/* Do nothing if it was DPCM :: BE */
@@ -592,19 +592,19 @@ static int asoc_simple_init_for_codec2codec(struct snd_soc_pcm_runtime *rtd,
return ret;
}
- params = devm_kzalloc(rtd->dev, sizeof(*params), GFP_KERNEL);
- if (!params)
+ c2c_params = devm_kzalloc(rtd->dev, sizeof(*c2c_params), GFP_KERNEL);
+ if (!c2c_params)
return -ENOMEM;
- params->formats = hw.formats;
- params->rates = hw.rates;
- params->rate_min = hw.rate_min;
- params->rate_max = hw.rate_max;
- params->channels_min = hw.channels_min;
- params->channels_max = hw.channels_max;
+ c2c_params->formats = hw.formats;
+ c2c_params->rates = hw.rates;
+ c2c_params->rate_min = hw.rate_min;
+ c2c_params->rate_max = hw.rate_max;
+ c2c_params->channels_min = hw.channels_min;
+ c2c_params->channels_max = hw.channels_max;
- dai_link->params = params;
- dai_link->num_params = 1;
+ dai_link->c2c_params = c2c_params;
+ dai_link->num_c2c_params = 1;
return 0;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/5] ASoC: meson: switch to use c2c_params instead of params
2023-03-27 0:09 [PATCH 0/5] ASoC: clarify Codec2Codec params Kuninori Morimoto
2023-03-27 0:09 ` [PATCH 1/5] ASoC: soc.h: " Kuninori Morimoto
2023-03-27 0:10 ` [PATCH 2/5] ASoC: audio-graph-card2: switch to use c2c_params instead of params Kuninori Morimoto
@ 2023-03-27 0:10 ` Kuninori Morimoto
2023-03-27 0:10 ` [PATCH 4/5] ASoC: samsung: " Kuninori Morimoto
2023-03-27 0:10 ` [PATCH 5/5] ASoC: soc.h: remove unused params/num_params Kuninori Morimoto
4 siblings, 0 replies; 6+ messages in thread
From: Kuninori Morimoto @ 2023-03-27 0:10 UTC (permalink / raw)
To: Mark Brown; +Cc: Linux-ALSA
ASoC is now using c2c_params instead of params. This patch replace it.
num_c2c_params (was num_params) was not mandatory before,
but let's set it by this patch.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
sound/soc/meson/axg-card.c | 3 ++-
sound/soc/meson/gx-card.c | 3 ++-
sound/soc/meson/meson-codec-glue.c | 5 +++--
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/sound/soc/meson/axg-card.c b/sound/soc/meson/axg-card.c
index 2b77010c2c5c..a25c397c66c5 100644
--- a/sound/soc/meson/axg-card.c
+++ b/sound/soc/meson/axg-card.c
@@ -337,7 +337,8 @@ static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np,
return ret;
if (axg_card_cpu_is_codec(dai_link->cpus->of_node)) {
- dai_link->params = &codec_params;
+ dai_link->c2c_params = &codec_params;
+ dai_link->num_c2c_params = 1;
} else {
dai_link->no_pcm = 1;
snd_soc_dai_link_set_capabilities(dai_link);
diff --git a/sound/soc/meson/gx-card.c b/sound/soc/meson/gx-card.c
index 5119434a81c4..58c411d3c489 100644
--- a/sound/soc/meson/gx-card.c
+++ b/sound/soc/meson/gx-card.c
@@ -104,7 +104,8 @@ static int gx_card_add_link(struct snd_soc_card *card, struct device_node *np,
/* Or apply codec to codec params if necessary */
if (gx_card_cpu_identify(dai_link->cpus, "CODEC CTRL")) {
- dai_link->params = &codec_params;
+ dai_link->c2c_params = &codec_params;
+ dai_link->num_c2c_params = 1;
} else {
dai_link->no_pcm = 1;
snd_soc_dai_link_set_capabilities(dai_link);
diff --git a/sound/soc/meson/meson-codec-glue.c b/sound/soc/meson/meson-codec-glue.c
index 5913486c43ab..e702d408ee96 100644
--- a/sound/soc/meson/meson-codec-glue.c
+++ b/sound/soc/meson/meson-codec-glue.c
@@ -105,13 +105,14 @@ int meson_codec_glue_output_startup(struct snd_pcm_substream *substream,
if (!in_data)
return -ENODEV;
- if (WARN_ON(!rtd->dai_link->params)) {
+ if (WARN_ON(!rtd->dai_link->c2c_params)) {
dev_warn(dai->dev, "codec2codec link expected\n");
return -EINVAL;
}
/* Replace link params with the input params */
- rtd->dai_link->params = &in_data->params;
+ rtd->dai_link->c2c_params = &in_data->params;
+ rtd->dai_link->num_c2c_params = 1;
return snd_soc_runtime_set_dai_fmt(rtd, in_data->fmt);
}
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/5] ASoC: samsung: switch to use c2c_params instead of params
2023-03-27 0:09 [PATCH 0/5] ASoC: clarify Codec2Codec params Kuninori Morimoto
` (2 preceding siblings ...)
2023-03-27 0:10 ` [PATCH 3/5] ASoC: meson: " Kuninori Morimoto
@ 2023-03-27 0:10 ` Kuninori Morimoto
2023-03-27 0:10 ` [PATCH 5/5] ASoC: soc.h: remove unused params/num_params Kuninori Morimoto
4 siblings, 0 replies; 6+ messages in thread
From: Kuninori Morimoto @ 2023-03-27 0:10 UTC (permalink / raw)
To: Mark Brown; +Cc: Linux-ALSA
ASoC is now using c2c_params instead of params. This patch replace it.
num_c2c_params (was num_params) was not mandatory before,
but let's set it by this patch.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
sound/soc/samsung/aries_wm8994.c | 6 ++++--
sound/soc/samsung/bells.c | 21 ++++++++++++++-------
sound/soc/samsung/littlemill.c | 3 ++-
sound/soc/samsung/lowland.c | 3 ++-
sound/soc/samsung/speyside.c | 3 ++-
5 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/sound/soc/samsung/aries_wm8994.c b/sound/soc/samsung/aries_wm8994.c
index 0fbbf3b02c09..7492bb41456c 100644
--- a/sound/soc/samsung/aries_wm8994.c
+++ b/sound/soc/samsung/aries_wm8994.c
@@ -483,14 +483,16 @@ static struct snd_soc_dai_link aries_dai[] = {
.name = "WM8994 AIF2",
.stream_name = "Baseband",
.init = &aries_baseband_init,
- .params = &baseband_params,
+ .c2c_params = &baseband_params,
+ .num_c2c_params = 1,
.ignore_suspend = 1,
SND_SOC_DAILINK_REG(baseband),
},
{
.name = "WM8994 AIF3",
.stream_name = "Bluetooth",
- .params = &bluetooth_params,
+ .c2c_params = &bluetooth_params,
+ .num_c2c_params = 1,
.ignore_suspend = 1,
SND_SOC_DAILINK_REG(bluetooth),
},
diff --git a/sound/soc/samsung/bells.c b/sound/soc/samsung/bells.c
index 76998a4a4cad..70b63d4faa99 100644
--- a/sound/soc/samsung/bells.c
+++ b/sound/soc/samsung/bells.c
@@ -264,7 +264,8 @@ static struct snd_soc_dai_link bells_dai_wm2200[] = {
.stream_name = "DSP-CODEC",
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
| SND_SOC_DAIFMT_CBM_CFM,
- .params = &sub_params,
+ .c2c_params = &sub_params,
+ .num_c2c_params = 1,
.ignore_suspend = 1,
SND_SOC_DAILINK_REG(wm2200_dsp_codec),
},
@@ -300,7 +301,8 @@ static struct snd_soc_dai_link bells_dai_wm5102[] = {
.stream_name = "DSP-CODEC",
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
| SND_SOC_DAIFMT_CBM_CFM,
- .params = &sub_params,
+ .c2c_params = &sub_params,
+ .num_c2c_params = 1,
.ignore_suspend = 1,
SND_SOC_DAILINK_REG(wm5102_dsp_codec),
},
@@ -310,7 +312,8 @@ static struct snd_soc_dai_link bells_dai_wm5102[] = {
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
| SND_SOC_DAIFMT_CBM_CFM,
.ignore_suspend = 1,
- .params = &baseband_params,
+ .c2c_params = &baseband_params,
+ .num_c2c_params = 1,
SND_SOC_DAILINK_REG(wm5102_baseband),
},
{
@@ -319,7 +322,8 @@ static struct snd_soc_dai_link bells_dai_wm5102[] = {
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
| SND_SOC_DAIFMT_CBS_CFS,
.ignore_suspend = 1,
- .params = &sub_params,
+ .c2c_params = &sub_params,
+ .num_c2c_params = 1,
SND_SOC_DAILINK_REG(wm5102_sub),
},
};
@@ -355,7 +359,8 @@ static struct snd_soc_dai_link bells_dai_wm5110[] = {
.stream_name = "DSP-CODEC",
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
| SND_SOC_DAIFMT_CBM_CFM,
- .params = &sub_params,
+ .c2c_params = &sub_params,
+ .num_c2c_params = 1,
.ignore_suspend = 1,
SND_SOC_DAILINK_REG(wm5110_dsp_codec),
},
@@ -365,7 +370,8 @@ static struct snd_soc_dai_link bells_dai_wm5110[] = {
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
| SND_SOC_DAIFMT_CBM_CFM,
.ignore_suspend = 1,
- .params = &baseband_params,
+ .c2c_params = &baseband_params,
+ .num_c2c_params = 1,
SND_SOC_DAILINK_REG(wm5110_baseband),
},
{
@@ -374,7 +380,8 @@ static struct snd_soc_dai_link bells_dai_wm5110[] = {
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
| SND_SOC_DAIFMT_CBS_CFS,
.ignore_suspend = 1,
- .params = &sub_params,
+ .c2c_params = &sub_params,
+ .num_c2c_params = 1,
SND_SOC_DAILINK_REG(wm5110_sub),
},
};
diff --git a/sound/soc/samsung/littlemill.c b/sound/soc/samsung/littlemill.c
index 411e25cec591..5d8118e69359 100644
--- a/sound/soc/samsung/littlemill.c
+++ b/sound/soc/samsung/littlemill.c
@@ -167,7 +167,8 @@ static struct snd_soc_dai_link littlemill_dai[] = {
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
| SND_SOC_DAIFMT_CBM_CFM,
.ignore_suspend = 1,
- .params = &baseband_params,
+ .c2c_params = &baseband_params,
+ .num_c2c_params = 1,
SND_SOC_DAILINK_REG(baseband),
},
};
diff --git a/sound/soc/samsung/lowland.c b/sound/soc/samsung/lowland.c
index b44f5e92224f..106770be6fc5 100644
--- a/sound/soc/samsung/lowland.c
+++ b/sound/soc/samsung/lowland.c
@@ -119,7 +119,8 @@ static struct snd_soc_dai_link lowland_dai[] = {
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
SND_SOC_DAIFMT_CBM_CFM,
.ignore_suspend = 1,
- .params = &sub_params,
+ .c2c_params = &sub_params,
+ .num_c2c_params = 1,
.init = lowland_wm9081_init,
SND_SOC_DAILINK_REG(speaker),
},
diff --git a/sound/soc/samsung/speyside.c b/sound/soc/samsung/speyside.c
index 69d7b0115b38..22e2ad63d64d 100644
--- a/sound/soc/samsung/speyside.c
+++ b/sound/soc/samsung/speyside.c
@@ -219,7 +219,8 @@ static struct snd_soc_dai_link speyside_dai[] = {
.init = speyside_wm8996_init,
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
| SND_SOC_DAIFMT_CBM_CFM,
- .params = &dsp_codec_params,
+ .c2c_params = &dsp_codec_params,
+ .num_c2c_params = 1,
.ignore_suspend = 1,
SND_SOC_DAILINK_REG(dsp_codec),
},
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 5/5] ASoC: soc.h: remove unused params/num_params
2023-03-27 0:09 [PATCH 0/5] ASoC: clarify Codec2Codec params Kuninori Morimoto
` (3 preceding siblings ...)
2023-03-27 0:10 ` [PATCH 4/5] ASoC: samsung: " Kuninori Morimoto
@ 2023-03-27 0:10 ` Kuninori Morimoto
4 siblings, 0 replies; 6+ messages in thread
From: Kuninori Morimoto @ 2023-03-27 0:10 UTC (permalink / raw)
To: Mark Brown; +Cc: Linux-ALSA
No drivers are using params/num_params any more.
Let's remove these.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
include/sound/soc.h | 3 ---
sound/soc/soc-core.c | 11 -----------
2 files changed, 14 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 08fc69cf6b74..371c254aa74b 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -690,9 +690,6 @@ struct snd_soc_dai_link {
const struct snd_soc_pcm_stream *c2c_params;
unsigned int num_c2c_params;
- const struct snd_soc_pcm_stream *params; /* REMOVE ME */
- unsigned int num_params; /* REMOVE ME */
-
unsigned int dai_fmt; /* format to set on init */
enum snd_soc_dpcm_trigger trigger[2]; /* trigger type for DPCM */
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index f3450478e20c..2faa0d8d0d8e 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2283,9 +2283,6 @@ EXPORT_SYMBOL_GPL(snd_soc_add_dai_controls);
*/
int snd_soc_register_card(struct snd_soc_card *card)
{
- struct snd_soc_dai_link *dai_link;
- int i;
-
if (!card->name || !card->dev)
return -EINVAL;
@@ -2306,14 +2303,6 @@ int snd_soc_register_card(struct snd_soc_card *card)
mutex_init(&card->dapm_mutex);
mutex_init(&card->pcm_mutex);
- /* REMOVE ME */
- for_each_card_prelinks(card, i, dai_link) {
- if (!dai_link->c2c_params) {
- dai_link->c2c_params = dai_link->params;
- dai_link->num_c2c_params = dai_link->num_params;
- }
- }
-
return snd_soc_bind_card(card);
}
EXPORT_SYMBOL_GPL(snd_soc_register_card);
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-03-27 0:12 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-27 0:09 [PATCH 0/5] ASoC: clarify Codec2Codec params Kuninori Morimoto
2023-03-27 0:09 ` [PATCH 1/5] ASoC: soc.h: " Kuninori Morimoto
2023-03-27 0:10 ` [PATCH 2/5] ASoC: audio-graph-card2: switch to use c2c_params instead of params Kuninori Morimoto
2023-03-27 0:10 ` [PATCH 3/5] ASoC: meson: " Kuninori Morimoto
2023-03-27 0:10 ` [PATCH 4/5] ASoC: samsung: " Kuninori Morimoto
2023-03-27 0:10 ` [PATCH 5/5] ASoC: soc.h: remove unused params/num_params Kuninori Morimoto
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.