]> www.infradead.org Git - users/hch/misc.git/commitdiff
ASoC: soc-dapm: rename snd_soc_kcontrol_component() to snd_soc_kcontrol_to_component()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 26 Aug 2025 06:22:26 +0000 (06:22 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 1 Sep 2025 12:37:59 +0000 (13:37 +0100)
We have 2 similar functions, both converts date from snd_kcontrol to
snd_soc_component.

(A) snd_soc_kcontrol_component()
(B) snd_soc_dapm_kcontrol_component()

(A) is just wrapper for snd_kcontrol_chip().
(B) is for more complex conversion.

Having similar functions is confusable. So (A) will be replaced to
original snd_kcontrol_chip(). (B) will be stay, but the function
name should be xx_to_xx().

And it is defined at soc-component.h. It should be implemented at
soc-dapm.c.

This patch renames it to snd_soc_dapm_kcontrol_to_component(), and
move to soc-dapm.c.

This patch keeps compatible by using define, but old name will be replaced
on each drivers and removed from ASoC in the future.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/871poyy53x.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc-component.h
include/sound/soc-dapm.h
sound/soc/soc-dapm.c

index 54bfa0cb1085b9c7f35cbafcbd1d584f0fc10a47..48e45cbe82e53b98fb4eddbb062e192bd9e05c16 100644 (file)
@@ -286,20 +286,6 @@ static inline struct snd_soc_dapm_context *snd_soc_component_get_dapm(
        return &component->dapm;
 }
 
-/**
- * snd_soc_dapm_kcontrol_component() - Returns the component associated to a
- * kcontrol
- * @kcontrol: The kcontrol
- *
- * This function must only be used on DAPM contexts that are known to be part of
- * a COMPONENT (e.g. in a COMPONENT driver). Otherwise the behavior is undefined
- */
-static inline struct snd_soc_component *snd_soc_dapm_kcontrol_component(
-       struct snd_kcontrol *kcontrol)
-{
-       return snd_soc_dapm_to_component(snd_soc_dapm_kcontrol_dapm(kcontrol));
-}
-
 /**
  * snd_soc_component_cache_sync() - Sync the register cache with the hardware
  * @component: COMPONENT to sync
index cd02fedb2624d3ec77779da77aed9f3ab796703d..ed39458b94bf9b5c594def913dc16123456cdf50 100644 (file)
@@ -719,6 +719,7 @@ void snd_soc_dapm_dai_free_widgets(struct snd_soc_dapm_widget_list **list);
 
 struct snd_soc_dapm_context *snd_soc_dapm_kcontrol_to_dapm(struct snd_kcontrol *kcontrol);
 struct snd_soc_dapm_widget *snd_soc_dapm_kcontrol_to_widget(struct snd_kcontrol *kcontrol);
+struct snd_soc_component *snd_soc_dapm_kcontrol_to_component(struct snd_kcontrol *kcontrol);
 unsigned int snd_soc_dapm_kcontrol_get_value(const struct snd_kcontrol *kcontrol);
 
 int snd_soc_dapm_force_bias_level(struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level);
@@ -732,6 +733,7 @@ void snd_soc_dapm_init_bias_level(struct snd_soc_dapm_context *dapm, enum snd_so
 #define snd_soc_dapm_kcontrol_widget                   snd_soc_dapm_kcontrol_to_widget
 #define snd_soc_dapm_kcontrol_dapm                     snd_soc_dapm_kcontrol_to_dapm
 #define dapm_kcontrol_get_value                                snd_soc_dapm_kcontrol_get_value
+#define snd_soc_dapm_kcontrol_component                        snd_soc_dapm_kcontrol_to_component
 
 #define for_each_dapm_widgets(list, i, widget)                         \
        for ((i) = 0;                                                   \
index f8ecf86a3d2b1692e490f2916bf8d05a575d342d..d74c096cc20840e66b04c58f677f14c34008ccc6 100644 (file)
@@ -900,6 +900,20 @@ struct snd_soc_dapm_context *snd_soc_dapm_kcontrol_to_dapm(struct snd_kcontrol *
 }
 EXPORT_SYMBOL_GPL(snd_soc_dapm_kcontrol_to_dapm);
 
+/**
+ * snd_soc_dapm_kcontrol_to_component() - Returns the component associated to a
+ * kcontrol
+ * @kcontrol: The kcontrol
+ *
+ * This function must only be used on DAPM contexts that are known to be part of
+ * a COMPONENT (e.g. in a COMPONENT driver). Otherwise the behavior is undefined
+ */
+struct snd_soc_component *snd_soc_dapm_kcontrol_to_component(struct snd_kcontrol *kcontrol)
+{
+       return snd_soc_dapm_to_component(snd_soc_dapm_kcontrol_to_dapm(kcontrol));
+}
+EXPORT_SYMBOL_GPL(snd_soc_dapm_kcontrol_to_component);
+
 static void dapm_reset(struct snd_soc_card *card)
 {
        struct snd_soc_dapm_widget *w;