From: Kuninori Morimoto Date: Tue, 12 May 2026 00:47:50 +0000 (+0000) Subject: ASoC: soc-dapm: move card->pop_time to soc-dapm.c X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9639a6875ea9926ab021484ee46c432a1df7c209;p=thirdparty%2Fkernel%2Flinux.git ASoC: soc-dapm: move card->pop_time to soc-dapm.c 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 Link: https://patch.msgid.link/87tssdwj0p.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 4f8fb7622a139..f24eafefbdff2 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -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); diff --git a/include/sound/soc.h b/include/sound/soc.h index 5e3eb617d8323..453548988d381 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -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; diff --git a/sound/soc/codecs/cx20442.c b/sound/soc/codecs/cx20442.c index 3a1455b79cd32..0dea84cd8ef2d 100644 --- a/sound/soc/codecs/cx20442.c +++ b/sound/soc/codecs/cx20442.c @@ -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; } diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 3fecf9fc903c0..033121911b08c 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -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) diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index d6192204e613d..10f5fb771e301 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -40,6 +40,8 @@ #include +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) {