]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: soc-dapm: move card->pop_time to soc-dapm.c
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 12 May 2026 00:47:50 +0000 (00:47 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 20 May 2026 12:36:50 +0000 (13:36 +0100)
Card has pop_time which have used only from TI, and it is now stop using
it. This pop_time is used for debug, and can be access from debugfs.
Let's move it from Card to soc-dapm.c local.
This patch renames it as asoc/${card}/pop_time to asoc/dapm_pop_time.

This patch moves it from Card to soc-dapm.c, tidyup soc-dapm.c
accordingly, and remove card->pop_time from cx20442.c which is no longer
needed.

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

index 4f8fb7622a139d763f9186dff9080abc4a54a881..f24eafefbdff2aee6ea17758840d3a7389395deb 100644 (file)
@@ -673,6 +673,7 @@ int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_context *dapm,
 /* dapm sys fs - used by the core */
 extern struct attribute *snd_soc_dapm_dev_attrs[];
 void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm, struct dentry *parent);
+void snd_soc_dapm_debugfs_pop_time(struct dentry *parent);
 
 /* dapm audio pin control and status */
 int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, const char *pin);
index 5e3eb617d8323ac64a4d7567059363bf12606ade..453548988d381698a563f2c7fb9b6fc0202cc426 100644 (file)
@@ -1081,8 +1081,6 @@ struct snd_soc_card {
 #ifdef CONFIG_PM_SLEEP
        struct work_struct deferred_resume_work;
 #endif
-       u32 pop_time;
-
        /* bit field */
        unsigned int instantiated:1;
        unsigned int topology_shortname_created:1;
index 3a1455b79cd32b7231f80ef8b242577fc4636a5d..0dea84cd8ef2d91c2f17599f6168529d61280e09 100644 (file)
@@ -250,7 +250,6 @@ static void v253_close(struct tty_struct *tty)
        /* Prevent the codec driver from further accessing the modem */
        cx20442->tty = NULL;
        codec->ready = false;
-       component->card->pop_time = 0;
 }
 
 /* Line discipline .hangup() */
@@ -278,7 +277,6 @@ static void v253_receive(struct tty_struct *tty, const u8 *cp, const u8 *fp,
                /* Set up codec driver access to modem controls */
                cx20442->tty = tty;
                codec->ready = true;
-               component->card->pop_time = 1;
        }
 }
 
@@ -379,7 +377,6 @@ static int cx20442_component_probe(struct snd_soc_component *component)
        cx20442->tty = NULL;
 
        snd_soc_component_set_drvdata(component, cx20442);
-       component->card->pop_time = 0;
 
        return 0;
 }
index 3fecf9fc903c004c7c39f7ebca7f8291656c4257..033121911b08c4777febd4e3f505ef09325d1ac7 100644 (file)
@@ -194,9 +194,6 @@ static void soc_init_card_debugfs(struct snd_soc_card *card)
        card->debugfs_card_root = debugfs_create_dir(card->name,
                                                     snd_soc_debugfs_root);
 
-       debugfs_create_u32("dapm_pop_time", 0644, card->debugfs_card_root,
-                          &card->pop_time);
-
        snd_soc_dapm_debugfs_init(snd_soc_card_to_dapm(card), card->debugfs_card_root);
 }
 
@@ -215,6 +212,8 @@ static void snd_soc_debugfs_init(void)
 
        debugfs_create_file("components", 0444, snd_soc_debugfs_root, NULL,
                            &component_list_fops);
+
+       snd_soc_dapm_debugfs_pop_time(snd_soc_debugfs_root);
 }
 
 static void snd_soc_debugfs_exit(void)
index d6192204e613da0f02a3e9df045df4bf32a16aa5..10f5fb771e301e82ad97bbef4f75d17bb76bfb36 100644 (file)
@@ -40,6 +40,8 @@
 
 #include <trace/events/asoc.h>
 
+static u32 pop_time;
+
 /* DAPM context */
 struct snd_soc_dapm_context {
        enum snd_soc_bias_level bias_level;
@@ -161,14 +163,14 @@ static void dapm_assert_locked(struct snd_soc_dapm_context *dapm)
                snd_soc_dapm_mutex_assert_held(dapm);
 }
 
-static void dapm_pop_wait(u32 pop_time)
+static void dapm_pop_wait(void)
 {
        if (pop_time)
                schedule_timeout_uninterruptible(msecs_to_jiffies(pop_time));
 }
 
-__printf(3, 4)
-static void dapm_pop_dbg(struct device *dev, u32 pop_time, const char *fmt, ...)
+__printf(2, 3)
+static void dapm_pop_dbg(struct device *dev, const char *fmt, ...)
 {
        va_list args;
        char *buf;
@@ -1872,8 +1874,7 @@ static void dapm_seq_check_event(struct snd_soc_card *card,
        if (w->event && (w->event_flags & event)) {
                int ret;
 
-               dapm_pop_dbg(dev, card->pop_time, "pop test : %s %s\n",
-                       w->name, ev_name);
+               dapm_pop_dbg(dev, "pop test : %s %s\n", w->name, ev_name);
                dapm_async_complete(w->dapm);
                trace_snd_soc_dapm_widget_event_start(w, event);
                ret = w->event(w, NULL, event);
@@ -1909,7 +1910,7 @@ static void dapm_seq_run_coalesced(struct snd_soc_card *card,
                else
                        value |= w->off_val << w->shift;
 
-               dapm_pop_dbg(dev, card->pop_time,
+               dapm_pop_dbg(dev,
                        "pop test : Queue %s: reg=0x%x, 0x%x/0x%x\n",
                        w->name, reg, value, mask);
 
@@ -1923,10 +1924,10 @@ static void dapm_seq_run_coalesced(struct snd_soc_card *card,
                 * same register.
                 */
 
-               dapm_pop_dbg(dev, card->pop_time,
+               dapm_pop_dbg(dev,
                        "pop test : Applying 0x%x/0x%x to %x in %dms\n",
-                       value, mask, reg, card->pop_time);
-               dapm_pop_wait(card->pop_time);
+                       value, mask, reg, pop_time);
+               dapm_pop_wait();
                dapm_update_bits(dapm, reg, mask, value);
        }
 
@@ -2392,9 +2393,9 @@ static int dapm_power_widgets(struct snd_soc_card *card, int event,
                        return ret;
        }
 
-       dapm_pop_dbg(card->dev, card->pop_time,
-               "DAPM sequencing finished, waiting %dms\n", card->pop_time);
-       dapm_pop_wait(card->pop_time);
+       dapm_pop_dbg(card->dev,
+               "DAPM sequencing finished, waiting %dms\n", pop_time);
+       dapm_pop_wait();
 
        trace_snd_soc_dapm_done(card, event);
 
@@ -2561,6 +2562,11 @@ static const struct file_operations dapm_bias_fops = {
        .llseek = default_llseek,
 };
 
+void snd_soc_dapm_debugfs_pop_time(struct dentry *parent)
+{
+       debugfs_create_u32("dapm_pop_time", 0644, parent, &pop_time);
+}
+
 void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm,
        struct dentry *parent)
 {