* [PATCH v2 1/9] ASoC: soc-dai: use snd_soc_dai_stream_active()
2026-09-18 1:40 [PATCH v2 0/9] ASoC: add new DAI functions Kuninori Morimoto
@ 2026-09-18 1:41 ` Kuninori Morimoto
2026-09-24 9:34 ` Alvin Šipraga
2026-09-18 1:41 ` [PATCH v2 2/9] ASoC: soc-dai: add snd_soc_dai_id() Kuninori Morimoto
` (8 subsequent siblings)
9 siblings, 1 reply; 15+ messages in thread
From: Kuninori Morimoto @ 2026-09-18 1:41 UTC (permalink / raw)
To: Mark Brown, Alvin Sipraga; +Cc: linux-sound
We already have snd_soc_dai_stream_active(). Let's use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
sound/soc/soc-dai.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c
index 83d030e14bb0b..0cf70f0903dc8 100644
--- a/sound/soc/soc-dai.c
+++ b/sound/soc/soc-dai.c
@@ -688,7 +688,7 @@ int snd_soc_dai_active(const struct snd_soc_dai *dai)
active = 0;
for_each_pcm_streams(stream)
- active += dai->stream[stream].active;
+ active += snd_soc_dai_stream_active(dai, stream);
return active;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 2/9] ASoC: soc-dai: add snd_soc_dai_id()
2026-09-18 1:40 [PATCH v2 0/9] ASoC: add new DAI functions Kuninori Morimoto
2026-09-18 1:41 ` [PATCH v2 1/9] ASoC: soc-dai: use snd_soc_dai_stream_active() Kuninori Morimoto
@ 2026-09-18 1:41 ` Kuninori Morimoto
2026-09-18 1:43 ` [PATCH v2 3/9] ASoC: soc-dai: add snd_soc_dai_to_component() Kuninori Morimoto
` (7 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Kuninori Morimoto @ 2026-09-18 1:41 UTC (permalink / raw)
To: Mark Brown, Alvin Sipraga; +Cc: linux-sound
DAI parameter will be capsuled soon, will be not enable to access from
each drivers. Add snd_soc_dai_id() to get ID from DAI.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Alvin Šipraga <alvin.sipraga@analog.com>
---
include/sound/soc-dai.h | 1 +
sound/soc/soc-dai.c | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 7e64e049d71d5..02b52fed97c9e 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -283,6 +283,7 @@ int snd_soc_dai_matches_args(const struct snd_soc_dai *dai,
int snd_soc_dai_matches_dlc(struct snd_soc_dai *dai,
const struct snd_soc_dai_link_component *dlc);
const char *snd_soc_dai_name(const struct snd_soc_dai *dai);
+int snd_soc_dai_id(const struct snd_soc_dai *dai);
struct snd_soc_dai_ops {
/* DAI driver callbacks */
diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c
index 0cf70f0903dc8..71de29bfbbd0c 100644
--- a/sound/soc/soc-dai.c
+++ b/sound/soc/soc-dai.c
@@ -1073,6 +1073,12 @@ const char *snd_soc_dai_name(const struct snd_soc_dai *dai)
}
EXPORT_SYMBOL_GPL(snd_soc_dai_name);
+int snd_soc_dai_id(const struct snd_soc_dai *dai)
+{
+ return dai->id;
+}
+EXPORT_SYMBOL_GPL(snd_soc_dai_id);
+
const struct snd_soc_pcm_stream *
snd_soc_dai_pcm_stream_get_i(const struct snd_soc_dai *dai, int stream)
{
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 3/9] ASoC: soc-dai: add snd_soc_dai_to_component()
2026-09-18 1:40 [PATCH v2 0/9] ASoC: add new DAI functions Kuninori Morimoto
2026-09-18 1:41 ` [PATCH v2 1/9] ASoC: soc-dai: use snd_soc_dai_stream_active() Kuninori Morimoto
2026-09-18 1:41 ` [PATCH v2 2/9] ASoC: soc-dai: add snd_soc_dai_id() Kuninori Morimoto
@ 2026-09-18 1:43 ` Kuninori Morimoto
2026-09-18 1:43 ` [PATCH v2 4/9] ASoC: soc-dai: add snd_soc_dai_to_driver() Kuninori Morimoto
` (6 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Kuninori Morimoto @ 2026-09-18 1:43 UTC (permalink / raw)
To: Mark Brown, Alvin Sipraga; +Cc: linux-sound
DAI parameter will be capsuled soon, will be not enable to access from
each drivers. Add snd_soc_dai_to_component() to get component from DAI.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Alvin Šipraga <alvin.sipraga@analog.com>
---
include/sound/soc-dai.h | 1 +
sound/soc/soc-dai.c | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 02b52fed97c9e..7f8a64db0dc7f 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -212,6 +212,7 @@ int snd_soc_dai_get_channel_map(const struct snd_soc_dai *dai,
unsigned int *tx_num, unsigned int *tx_slot,
unsigned int *rx_num, unsigned int *rx_slot);
+struct snd_soc_component *snd_soc_dai_to_component(const struct snd_soc_dai *dai);
int snd_soc_dai_is_dummy(const struct snd_soc_dai *dai);
int snd_soc_dai_add_controls(struct snd_soc_dai *dai,
const struct snd_kcontrol_new *controls, int num_controls);
diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c
index 71de29bfbbd0c..a859acc4b28f3 100644
--- a/sound/soc/soc-dai.c
+++ b/sound/soc/soc-dai.c
@@ -20,6 +20,12 @@ static inline int _soc_dai_ret(const struct snd_soc_dai *dai,
"at %s() on %s\n", func, dai->name);
}
+struct snd_soc_component *snd_soc_dai_to_component(const struct snd_soc_dai *dai)
+{
+ return dai->component;
+}
+EXPORT_SYMBOL_GPL(snd_soc_dai_to_component);
+
/*
* We might want to check substream by using list.
* In such case, we can update these macros.
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 4/9] ASoC: soc-dai: add snd_soc_dai_to_driver()
2026-09-18 1:40 [PATCH v2 0/9] ASoC: add new DAI functions Kuninori Morimoto
` (2 preceding siblings ...)
2026-09-18 1:43 ` [PATCH v2 3/9] ASoC: soc-dai: add snd_soc_dai_to_component() Kuninori Morimoto
@ 2026-09-18 1:43 ` Kuninori Morimoto
2026-09-18 1:43 ` [PATCH v2 5/9] ASoC: soc-dai: add snd_soc_dai_{to/from}_list() Kuninori Morimoto
` (5 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Kuninori Morimoto @ 2026-09-18 1:43 UTC (permalink / raw)
To: Mark Brown, Alvin Sipraga; +Cc: linux-sound
DAI parameter will be capsuled soon, will be not enable to access from
each drivers. Add snd_soc_dai_to_driver() to get driver from DAI.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Alvin Šipraga <alvin.sipraga@analog.com>
---
include/sound/soc-dai.h | 1 +
sound/soc/soc-dai.c | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 7f8a64db0dc7f..375a8674d1452 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -213,6 +213,7 @@ int snd_soc_dai_get_channel_map(const struct snd_soc_dai *dai,
unsigned int *rx_num, unsigned int *rx_slot);
struct snd_soc_component *snd_soc_dai_to_component(const struct snd_soc_dai *dai);
+struct snd_soc_dai_driver *snd_soc_dai_to_driver(const struct snd_soc_dai *dai);
int snd_soc_dai_is_dummy(const struct snd_soc_dai *dai);
int snd_soc_dai_add_controls(struct snd_soc_dai *dai,
const struct snd_kcontrol_new *controls, int num_controls);
diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c
index a859acc4b28f3..3e553e8c0535e 100644
--- a/sound/soc/soc-dai.c
+++ b/sound/soc/soc-dai.c
@@ -26,6 +26,12 @@ struct snd_soc_component *snd_soc_dai_to_component(const struct snd_soc_dai *dai
}
EXPORT_SYMBOL_GPL(snd_soc_dai_to_component);
+struct snd_soc_dai_driver *snd_soc_dai_to_driver(const struct snd_soc_dai *dai)
+{
+ return dai->driver;
+}
+EXPORT_SYMBOL_GPL(snd_soc_dai_to_driver);
+
/*
* We might want to check substream by using list.
* In such case, we can update these macros.
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 5/9] ASoC: soc-dai: add snd_soc_dai_{to/from}_list()
2026-09-18 1:40 [PATCH v2 0/9] ASoC: add new DAI functions Kuninori Morimoto
` (3 preceding siblings ...)
2026-09-18 1:43 ` [PATCH v2 4/9] ASoC: soc-dai: add snd_soc_dai_to_driver() Kuninori Morimoto
@ 2026-09-18 1:43 ` Kuninori Morimoto
2026-09-18 1:44 ` [PATCH v2 6/9] ASoC: soc-dai: add snd_soc_dai_get_symmetric_xxx() Kuninori Morimoto
` (4 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Kuninori Morimoto @ 2026-09-18 1:43 UTC (permalink / raw)
To: Mark Brown, Alvin Sipraga; +Cc: linux-sound
DAI parameter will be capsuled soon, will be not enable to access from
each drivers. Add snd_soc_dai_{to/from}_list() to use for_each macro.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Alvin Šipraga <alvin.sipraga@analog.com>
---
include/sound/soc-component.h | 14 ++++++++++----
include/sound/soc-dai.h | 2 ++
sound/soc/soc-dai.c | 12 ++++++++++++
3 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h
index c49b59630101f..6c1acc984ecb0 100644
--- a/include/sound/soc-component.h
+++ b/include/sound/soc-component.h
@@ -258,10 +258,16 @@ struct snd_soc_component {
void *priv;
};
-#define for_each_component_dais(component, dai)\
- list_for_each_entry(dai, &(component)->dai_list, list)
-#define for_each_component_dais_safe(component, dai, _dai)\
- list_for_each_entry_safe(dai, _dai, &(component)->dai_list, list)
+#define for_each_component_dais(component, dai) \
+ for (dai = snd_soc_dai_from_list((component)->dai_list.next); \
+ snd_soc_dai_to_list(dai) != &(component)->dai_list; \
+ dai = snd_soc_dai_from_list(snd_soc_dai_to_list(dai)->next))
+
+#define for_each_component_dais_safe(component, dai, _dai) \
+ for (dai = snd_soc_dai_from_list((component)->dai_list.next), \
+ _dai = snd_soc_dai_from_list(snd_soc_dai_to_list(dai)->next); \
+ snd_soc_dai_to_list(dai) != &(component)->dai_list; \
+ dai = _dai, _dai = snd_soc_dai_from_list(snd_soc_dai_to_list(_dai)->next))
/**
* snd_soc_component_to_dapm() - Returns the DAPM context associated with a
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 375a8674d1452..bd714c3bbf3df 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -561,6 +561,8 @@ struct snd_soc_dai *snd_soc_dai_register(struct snd_soc_component *component,
struct snd_soc_dai_driver *dai_drv,
bool legacy_dai_naming);
void snd_soc_dai_unregister(struct snd_soc_dai *dai);
+struct snd_soc_dai *snd_soc_dai_from_list(struct list_head *list);
+struct list_head *snd_soc_dai_to_list(struct snd_soc_dai *dai);
/* REMOVE ME */
#define snd_soc_dai_get_pcm_stream snd_soc_dai_pcm_stream_get
diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c
index 3e553e8c0535e..69a3df3c56a80 100644
--- a/sound/soc/soc-dai.c
+++ b/sound/soc/soc-dai.c
@@ -32,6 +32,18 @@ struct snd_soc_dai_driver *snd_soc_dai_to_driver(const struct snd_soc_dai *dai)
}
EXPORT_SYMBOL_GPL(snd_soc_dai_to_driver);
+struct snd_soc_dai *snd_soc_dai_from_list(struct list_head *list)
+{
+ return list_entry(list, struct snd_soc_dai, list);
+}
+EXPORT_SYMBOL_GPL(snd_soc_dai_from_list);
+
+struct list_head *snd_soc_dai_to_list(struct snd_soc_dai *dai)
+{
+ return &dai->list;
+}
+EXPORT_SYMBOL_GPL(snd_soc_dai_to_list);
+
/*
* We might want to check substream by using list.
* In such case, we can update these macros.
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 6/9] ASoC: soc-dai: add snd_soc_dai_get_symmetric_xxx()
2026-09-18 1:40 [PATCH v2 0/9] ASoC: add new DAI functions Kuninori Morimoto
` (4 preceding siblings ...)
2026-09-18 1:43 ` [PATCH v2 5/9] ASoC: soc-dai: add snd_soc_dai_{to/from}_list() Kuninori Morimoto
@ 2026-09-18 1:44 ` Kuninori Morimoto
2026-09-24 9:35 ` Alvin Šipraga
2026-09-18 1:45 ` [PATCH v2 7/9] ASoC: soc-dai: add snd_soc_dai_{set/to}_priv() Kuninori Morimoto
` (3 subsequent siblings)
9 siblings, 1 reply; 15+ messages in thread
From: Kuninori Morimoto @ 2026-09-18 1:44 UTC (permalink / raw)
To: Mark Brown, Matthias Brugger, AngeloGioacchino Del Regno; +Cc: linux-sound
DAI parameter will be capsuled soon, will be not enable to access from
each drivers. Add snd_soc_dai_get_symmetric_xxx() to get symmetric
param from DAI.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
include/sound/soc-dai.h | 3 +++
sound/soc/soc-dai.c | 18 ++++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index bd714c3bbf3df..fc23221766b63 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -563,6 +563,9 @@ struct snd_soc_dai *snd_soc_dai_register(struct snd_soc_component *component,
void snd_soc_dai_unregister(struct snd_soc_dai *dai);
struct snd_soc_dai *snd_soc_dai_from_list(struct list_head *list);
struct list_head *snd_soc_dai_to_list(struct snd_soc_dai *dai);
+unsigned int snd_soc_dai_get_symmetric_rate(struct snd_soc_dai *dai);
+unsigned int snd_soc_dai_get_symmetric_channels(struct snd_soc_dai *dai);
+unsigned int snd_soc_dai_get_symmetric_sample_bits(struct snd_soc_dai *dai);
/* REMOVE ME */
#define snd_soc_dai_get_pcm_stream snd_soc_dai_pcm_stream_get
diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c
index 69a3df3c56a80..9787d7913c308 100644
--- a/sound/soc/soc-dai.c
+++ b/sound/soc/soc-dai.c
@@ -1263,6 +1263,24 @@ struct snd_soc_dai *snd_soc_dai_register(struct snd_soc_component *component,
}
EXPORT_SYMBOL_GPL(snd_soc_dai_register);
+unsigned int snd_soc_dai_get_symmetric_rate(struct snd_soc_dai *dai)
+{
+ return dai->symmetric_rate;
+}
+EXPORT_SYMBOL_GPL(snd_soc_dai_get_symmetric_rate);
+
+unsigned int snd_soc_dai_get_symmetric_channels(struct snd_soc_dai *dai)
+{
+ return dai->symmetric_channels;
+}
+EXPORT_SYMBOL_GPL(snd_soc_dai_get_symmetric_channels);
+
+unsigned int snd_soc_dai_get_symmetric_sample_bits(struct snd_soc_dai *dai)
+{
+ return dai->symmetric_sample_bits;
+}
+EXPORT_SYMBOL_GPL(snd_soc_dai_get_symmetric_sample_bits);
+
void snd_soc_dai_symmetric_set_params(struct snd_soc_dai *dai,
struct snd_pcm_hw_params *params)
{
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 7/9] ASoC: soc-dai: add snd_soc_dai_{set/to}_priv()
2026-09-18 1:40 [PATCH v2 0/9] ASoC: add new DAI functions Kuninori Morimoto
` (5 preceding siblings ...)
2026-09-18 1:44 ` [PATCH v2 6/9] ASoC: soc-dai: add snd_soc_dai_get_symmetric_xxx() Kuninori Morimoto
@ 2026-09-18 1:45 ` Kuninori Morimoto
2026-09-18 1:45 ` [PATCH v2 8/9] ASoC: soc-dai: add snd_soc_dai_get_bclk[_ratio]() Kuninori Morimoto
` (2 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Kuninori Morimoto @ 2026-09-18 1:45 UTC (permalink / raw)
To: Mark Brown, Charles Keepax, Maciej Strozek, Bard Liao,
Pierre-Louis Bossart, Alvin Sipraga
Cc: linux-sound
DAI parameter will be capsuled soon, will be not enable to access from
each drivers. DAI priv has been mainly referred from SoundWire driver.
Let's add snd_soc_dai_{set/to}_priv() for it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Alvin Šipraga <alvin.sipraga@analog.com>
---
include/sound/soc-dai.h | 2 ++
sound/soc/sdca/sdca_asoc.c | 4 ++--
sound/soc/soc-dai.c | 12 ++++++++++++
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index fc23221766b63..be4781b619891 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -566,6 +566,8 @@ struct list_head *snd_soc_dai_to_list(struct snd_soc_dai *dai);
unsigned int snd_soc_dai_get_symmetric_rate(struct snd_soc_dai *dai);
unsigned int snd_soc_dai_get_symmetric_channels(struct snd_soc_dai *dai);
unsigned int snd_soc_dai_get_symmetric_sample_bits(struct snd_soc_dai *dai);
+void snd_soc_dai_set_priv(struct snd_soc_dai *dai, void *priv);
+void *snd_soc_dai_to_priv(struct snd_soc_dai *dai);
/* REMOVE ME */
#define snd_soc_dai_get_pcm_stream snd_soc_dai_pcm_stream_get
diff --git a/sound/soc/sdca/sdca_asoc.c b/sound/soc/sdca/sdca_asoc.c
index ce2e7c2707657..ccc579f878ff1 100644
--- a/sound/soc/sdca/sdca_asoc.c
+++ b/sound/soc/sdca/sdca_asoc.c
@@ -1507,7 +1507,7 @@ int sdca_asoc_set_constraints(struct device *dev, struct regmap *regmap,
return ret;
}
- dai->priv = constraint;
+ snd_soc_dai_set_priv(dai, constraint);
return 0;
}
@@ -1523,7 +1523,7 @@ EXPORT_SYMBOL_NS(sdca_asoc_set_constraints, "SND_SOC_SDCA");
void sdca_asoc_free_constraints(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- struct snd_pcm_hw_constraint_list *constraint = dai->priv;
+ struct snd_pcm_hw_constraint_list *constraint = snd_soc_dai_to_priv(dai);
kfree(constraint);
}
diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c
index 9787d7913c308..7412294eaea46 100644
--- a/sound/soc/soc-dai.c
+++ b/sound/soc/soc-dai.c
@@ -32,6 +32,18 @@ struct snd_soc_dai_driver *snd_soc_dai_to_driver(const struct snd_soc_dai *dai)
}
EXPORT_SYMBOL_GPL(snd_soc_dai_to_driver);
+void snd_soc_dai_set_priv(struct snd_soc_dai *dai, void *priv)
+{
+ dai->priv = priv;
+}
+EXPORT_SYMBOL_GPL(snd_soc_dai_set_priv);
+
+void *snd_soc_dai_to_priv(struct snd_soc_dai *dai)
+{
+ return dai->priv;
+}
+EXPORT_SYMBOL_GPL(snd_soc_dai_to_priv);
+
struct snd_soc_dai *snd_soc_dai_from_list(struct list_head *list)
{
return list_entry(list, struct snd_soc_dai, list);
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 8/9] ASoC: soc-dai: add snd_soc_dai_get_bclk[_ratio]()
2026-09-18 1:40 [PATCH v2 0/9] ASoC: add new DAI functions Kuninori Morimoto
` (6 preceding siblings ...)
2026-09-18 1:45 ` [PATCH v2 7/9] ASoC: soc-dai: add snd_soc_dai_{set/to}_priv() Kuninori Morimoto
@ 2026-09-18 1:45 ` Kuninori Morimoto
2026-09-24 9:36 ` Alvin Šipraga
2026-09-18 1:46 ` [PATCH v2 9/9] ASoC: soc-dai: rename snd_soc_dai_action() to snd_soc_dai_active_update() Kuninori Morimoto
2026-09-28 12:36 ` [PATCH v2 0/9] ASoC: add new DAI functions Mark Brown
9 siblings, 1 reply; 15+ messages in thread
From: Kuninori Morimoto @ 2026-09-18 1:45 UTC (permalink / raw)
To: Mark Brown, Alvin Sipraga; +Cc: linux-sound
DAI parameter will be capsuled soon, will be not enable to access from
each drivers. Add snd_soc_dai_get_bclk[_ratio]() for internal use.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
sound/soc/soc-dai.c | 10 ++++++++++
sound/soc/soc-internal.h | 2 ++
sound/soc/soc-pcm.c | 19 +++++++++++++------
3 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c
index 7412294eaea46..edf7d808e46ea 100644
--- a/sound/soc/soc-dai.c
+++ b/sound/soc/soc-dai.c
@@ -1391,3 +1391,13 @@ void snd_soc_dai_symmetric_update(struct snd_pcm_substream *substream)
if (symmetry)
substream->runtime->hw.info |= SNDRV_PCM_INFO_JOINT_DUPLEX;
}
+
+struct clk *snd_soc_dai_get_bclk(struct snd_soc_dai *dai)
+{
+ return dai->bclk;
+}
+
+unsigned int snd_soc_dai_get_bclk_ratio(struct snd_soc_dai *dai)
+{
+ return dai->bclk_ratio;
+}
diff --git a/sound/soc/soc-internal.h b/sound/soc/soc-internal.h
index 3afc50d5760eb..f350fe5280e38 100644
--- a/sound/soc/soc-internal.h
+++ b/sound/soc/soc-internal.h
@@ -32,5 +32,7 @@ void snd_soc_dai_symmetric_set_params(struct snd_soc_dai *dai,
int snd_soc_dai_symmetric_apply(struct snd_pcm_substream *substream, struct snd_soc_dai *dai);
int snd_soc_dai_symmetric_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params);
void snd_soc_dai_symmetric_update(struct snd_pcm_substream *substream);
+struct clk *snd_soc_dai_get_bclk(struct snd_soc_dai *dai);
+unsigned int snd_soc_dai_get_bclk_ratio(struct snd_soc_dai *dai);
#endif /* __SOC_INTERNAL_H */
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index a446e9c1c9887..e63b6317f21d2 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -445,17 +445,24 @@ static int soc_pcm_shared_bclk_rule_rate(struct snd_pcm_hw_params *params,
struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
struct snd_interval constraint = { .empty = 1 };
unsigned int target_rate;
+ struct clk *dai_bclk;
+ unsigned int dai_bclk_ratio;
int i;
/* Protect the rtd list traversal with the ASoC card mutex helper. */
guard(snd_soc_card_mutex)(card);
+ dai_bclk = snd_soc_dai_get_bclk(dai);
+ dai_bclk_ratio = snd_soc_dai_get_bclk_ratio(dai);
+
/* Scan all DAIs on the card for an active peer sharing the same BCLK */
for_each_card_rtds(card, rtd) {
for_each_rtd_cpu_dais(rtd, i, other_dai) {
+ struct clk *other_dai_bclk = snd_soc_dai_get_bclk(other_dai);
+
if (other_dai == dai)
continue;
- if (!other_dai->bclk)
+ if (!other_dai_bclk)
continue;
if (!snd_soc_dai_active(other_dai))
continue;
@@ -467,10 +474,10 @@ static int soc_pcm_shared_bclk_rule_rate(struct snd_pcm_hw_params *params,
*/
if (!other_dai->symmetric_rate)
continue;
- if (!clk_is_match(dai->bclk, other_dai->bclk))
+ if (!clk_is_match(dai_bclk, other_dai_bclk))
continue;
- active_bclk_rate = clk_get_rate(other_dai->bclk);
+ active_bclk_rate = clk_get_rate(other_dai_bclk);
if (active_bclk_rate)
goto found;
}
@@ -479,13 +486,13 @@ static int soc_pcm_shared_bclk_rule_rate(struct snd_pcm_hw_params *params,
return 0;
found:
- if (dai->bclk_ratio) {
+ if (dai_bclk_ratio) {
/*
* Driver has set an explicit BCLK ratio (e.g. for TDM where
* BCLK = rate * slots * slot_width). The only valid rate is
* active_bclk_rate / bclk_ratio.
*/
- target_rate = active_bclk_rate / dai->bclk_ratio;
+ target_rate = active_bclk_rate / dai_bclk_ratio;
constraint.min = target_rate;
constraint.max = target_rate;
@@ -522,7 +529,7 @@ static int soc_pcm_shared_bclk_rule_rate(struct snd_pcm_hw_params *params,
static int soc_pcm_apply_shared_bclk(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- if (!dai->bclk)
+ if (!snd_soc_dai_get_bclk(dai))
return 0;
dev_dbg(dai->dev,
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 9/9] ASoC: soc-dai: rename snd_soc_dai_action() to snd_soc_dai_active_update()
2026-09-18 1:40 [PATCH v2 0/9] ASoC: add new DAI functions Kuninori Morimoto
` (7 preceding siblings ...)
2026-09-18 1:45 ` [PATCH v2 8/9] ASoC: soc-dai: add snd_soc_dai_get_bclk[_ratio]() Kuninori Morimoto
@ 2026-09-18 1:46 ` Kuninori Morimoto
2026-09-24 9:33 ` Alvin Šipraga
2026-09-28 12:36 ` [PATCH v2 0/9] ASoC: add new DAI functions Mark Brown
9 siblings, 1 reply; 15+ messages in thread
From: Kuninori Morimoto @ 2026-09-18 1:46 UTC (permalink / raw)
To: Mark Brown, Alvin Sipraga; +Cc: linux-sound
We have snd_soc_dai_action() to update .active. and in the same time,
we have snd_soc_dai_active() to get .active.
They are confusing name. Let's rename _action() to _active_update().
And in the same time, we have snd_soc_dai_action() and has its wrapper
macro _activate/deactivate(). But callers are using both original/wrapper.
Let's remove wrapper to remove confusion.
It is used only from ASoC framework, let's move it to soc-internal.h
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
include/sound/soc-dai.h | 13 +------------
sound/soc/soc-dai.c | 6 ++----
sound/soc/soc-dapm.c | 9 +++++----
sound/soc/soc-internal.h | 1 +
sound/soc/soc-pcm.c | 2 +-
5 files changed, 10 insertions(+), 21 deletions(-)
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index be4781b619891..c044909ef10d8 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -231,18 +231,7 @@ void snd_soc_dai_suspend(struct snd_soc_dai *dai);
void snd_soc_dai_resume(struct snd_soc_dai *dai);
int snd_soc_dai_compress_new(struct snd_soc_dai *dai, struct snd_soc_pcm_runtime *rtd);
bool snd_soc_dai_stream_valid(const struct snd_soc_dai *dai, int stream);
-void snd_soc_dai_action(struct snd_soc_dai *dai,
- int stream, int action);
-static inline void snd_soc_dai_activate(struct snd_soc_dai *dai,
- int stream)
-{
- snd_soc_dai_action(dai, stream, 1);
-}
-static inline void snd_soc_dai_deactivate(struct snd_soc_dai *dai,
- int stream)
-{
- snd_soc_dai_action(dai, stream, -1);
-}
+
int snd_soc_dai_active(const struct snd_soc_dai *dai);
int snd_soc_pcm_dai_probe(struct snd_soc_pcm_runtime *rtd, int order);
diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c
index edf7d808e46ea..d124b6afb1b8d 100644
--- a/sound/soc/soc-dai.c
+++ b/sound/soc/soc-dai.c
@@ -707,8 +707,7 @@ bool snd_soc_dai_stream_valid(const struct snd_soc_dai *dai, int dir)
return stream->channels_min;
}
-void snd_soc_dai_action(struct snd_soc_dai *dai,
- int stream, int action)
+void snd_soc_dai_active_update(struct snd_soc_dai *dai, int stream, int action)
{
/* see snd_soc_dai_stream_active() */
dai->stream[stream].active += action;
@@ -716,7 +715,6 @@ void snd_soc_dai_action(struct snd_soc_dai *dai,
/* see snd_soc_component_active() */
dai->component->active += action;
}
-EXPORT_SYMBOL_GPL(snd_soc_dai_action);
int snd_soc_dai_active(const struct snd_soc_dai *dai)
{
@@ -1161,7 +1159,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_stream_tdm_mask_set);
unsigned int snd_soc_dai_stream_active(const struct snd_soc_dai *dai, int stream)
{
- /* see snd_soc_dai_action() for setup */
+ /* see snd_soc_dai_active_update() for setup */
return dai->stream[stream].active;
}
EXPORT_SYMBOL_GPL(snd_soc_dai_stream_active);
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 06b85313af126..74be5e2094933 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -37,6 +37,7 @@
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/initval.h>
+#include "soc-internal.h"
#include <trace/events/asoc.h>
@@ -4010,7 +4011,7 @@ static int dapm_dai_link_event_pre_pmu(struct snd_soc_dapm_widget *w,
if (ret < 0)
return ret;
- snd_soc_dai_activate(source, substream->stream);
+ snd_soc_dai_active_update(source, substream->stream, 1);
}
substream->stream = SNDRV_PCM_STREAM_PLAYBACK;
@@ -4021,7 +4022,7 @@ static int dapm_dai_link_event_pre_pmu(struct snd_soc_dapm_widget *w,
if (ret < 0)
return ret;
- snd_soc_dai_activate(sink, substream->stream);
+ snd_soc_dai_active_update(sink, substream->stream, 1);
}
substream->hw_opened = 1;
@@ -4150,14 +4151,14 @@ static int dapm_dai_link_event(struct snd_soc_dapm_widget *w,
substream->stream = SNDRV_PCM_STREAM_CAPTURE;
snd_soc_dapm_widget_for_each_source_path(w, path) {
source = path->source->priv;
- snd_soc_dai_deactivate(source, substream->stream);
+ snd_soc_dai_active_update(source, substream->stream, -1);
snd_soc_dai_shutdown(source, substream, 0);
}
substream->stream = SNDRV_PCM_STREAM_PLAYBACK;
snd_soc_dapm_widget_for_each_sink_path(w, path) {
sink = path->sink->priv;
- snd_soc_dai_deactivate(sink, substream->stream);
+ snd_soc_dai_active_update(sink, substream->stream, -1);
snd_soc_dai_shutdown(sink, substream, 0);
}
break;
diff --git a/sound/soc/soc-internal.h b/sound/soc/soc-internal.h
index f350fe5280e38..31559918355f8 100644
--- a/sound/soc/soc-internal.h
+++ b/sound/soc/soc-internal.h
@@ -34,5 +34,6 @@ int snd_soc_dai_symmetric_params(struct snd_pcm_substream *substream, struct snd
void snd_soc_dai_symmetric_update(struct snd_pcm_substream *substream);
struct clk *snd_soc_dai_get_bclk(struct snd_soc_dai *dai);
unsigned int snd_soc_dai_get_bclk_ratio(struct snd_soc_dai *dai);
+void snd_soc_dai_active_update(struct snd_soc_dai *dai, int stream, int action);
#endif /* __SOC_INTERNAL_H */
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index e63b6317f21d2..1ddf199edc93c 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -368,7 +368,7 @@ void snd_soc_runtime_action(struct snd_soc_pcm_runtime *rtd,
snd_soc_dpcm_mutex_assert_held(rtd);
for_each_rtd_dais(rtd, i, dai)
- snd_soc_dai_action(dai, stream, action);
+ snd_soc_dai_active_update(dai, stream, action);
/* Increments/Decrements the active count for components without DAIs */
for_each_rtd_components(rtd, i, component) {
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v2 9/9] ASoC: soc-dai: rename snd_soc_dai_action() to snd_soc_dai_active_update()
2026-09-18 1:46 ` [PATCH v2 9/9] ASoC: soc-dai: rename snd_soc_dai_action() to snd_soc_dai_active_update() Kuninori Morimoto
@ 2026-09-24 9:33 ` Alvin Šipraga
0 siblings, 0 replies; 15+ messages in thread
From: Alvin Šipraga @ 2026-09-24 9:33 UTC (permalink / raw)
To: Kuninori Morimoto; +Cc: Mark Brown, linux-sound
On Fri, Sep 18, 2026 at 01:46:17AM +0000, Kuninori Morimoto wrote:
> We have snd_soc_dai_action() to update .active. and in the same time,
> we have snd_soc_dai_active() to get .active.
> They are confusing name. Let's rename _action() to _active_update().
>
> And in the same time, we have snd_soc_dai_action() and has its wrapper
> macro _activate/deactivate(). But callers are using both original/wrapper.
> Let's remove wrapper to remove confusion.
>
> It is used only from ASoC framework, let's move it to soc-internal.h
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Alvin Šipraga <alvin.sipraga@analog.com>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/9] ASoC: add new DAI functions
2026-09-18 1:40 [PATCH v2 0/9] ASoC: add new DAI functions Kuninori Morimoto
` (8 preceding siblings ...)
2026-09-18 1:46 ` [PATCH v2 9/9] ASoC: soc-dai: rename snd_soc_dai_action() to snd_soc_dai_active_update() Kuninori Morimoto
@ 2026-09-28 12:36 ` Mark Brown
9 siblings, 0 replies; 15+ messages in thread
From: Mark Brown @ 2026-09-28 12:36 UTC (permalink / raw)
To: Alvin Sipraga, Kuninori Morimoto; +Cc: linux-sound
On Fri, 18 Sep 2026 01:40:45 +0000, Kuninori Morimoto wrote:
> ASoC: add new DAI functions
>
> Hi Mark
>
> This is v2 patch-set.
> I'm now posting ASoC Capsuling patches.
> Current status, and this patch-set postion is below.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4
Thanks!
[1/9] ASoC: soc-dai: use snd_soc_dai_stream_active()
https://git.kernel.org/broonie/sound/c/37e117c23563
[2/9] ASoC: soc-dai: add snd_soc_dai_id()
https://git.kernel.org/broonie/sound/c/d4c557f621db
[3/9] ASoC: soc-dai: add snd_soc_dai_to_component()
https://git.kernel.org/broonie/sound/c/724da1c8b630
[4/9] ASoC: soc-dai: add snd_soc_dai_to_driver()
https://git.kernel.org/broonie/sound/c/e90c02200738
[5/9] ASoC: soc-dai: add snd_soc_dai_{to/from}_list()
https://git.kernel.org/broonie/sound/c/f54b3dd4aa35
[6/9] ASoC: soc-dai: add snd_soc_dai_get_symmetric_xxx()
https://git.kernel.org/broonie/sound/c/ee4f730ac8f7
[7/9] ASoC: soc-dai: add snd_soc_dai_{set/to}_priv()
https://git.kernel.org/broonie/sound/c/9ec8ccc97dd9
[8/9] ASoC: soc-dai: add snd_soc_dai_get_bclk[_ratio]()
https://git.kernel.org/broonie/sound/c/d47f591c9a8d
[9/9] ASoC: soc-dai: rename snd_soc_dai_action() to snd_soc_dai_active_update()
https://git.kernel.org/broonie/sound/c/885ce49a700c
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
^ permalink raw reply [flat|nested] 15+ messages in thread