public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
From: Sheetal <sheetal@nvidia.com>
To: Mark Brown <broonie@kernel.org>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Jaroslav Kysela <perex@perex.cz>, "Takashi Iwai" <tiwai@suse.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Thierry Reding <thierry.reding@kernel.org>,
	Jonathan Hunter <jonathanh@nvidia.com>
Cc: Mohan Kumar <mkumard@nvidia.com>, <linux-sound@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-tegra@vger.kernel.org>,
	Sheetal <sheetal@nvidia.com>
Subject: [PATCH 1/2] ASoC: simple-card-utils: add ignore_zero_sysclk flag
Date: Tue, 17 Mar 2026 09:49:09 +0000	[thread overview]
Message-ID: <20260317094910.1582011-2-sheetal@nvidia.com> (raw)
In-Reply-To: <20260317094910.1582011-1-sheetal@nvidia.com>

Commit 2458adb8f92a ("SoC: simple-card-utils: set 0Hz to
sysclk when shutdown") updated the simple-card-util driver to
send 0Hz frequency requests during stream shutdown, which can
request frequencies lower than a platform may support.

Add ignore_zero_sysclk flag to struct simple_util_priv to allow drivers
to ignore these 0Hz sysclk requests when they would result in a clock
frequency below the hardware's minimum allowed rate.

Signed-off-by: Sheetal <sheetal@nvidia.com>
---
 include/sound/simple_card_utils.h     | 1 +
 sound/soc/generic/simple-card-utils.c | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h
index 915e6ae5f68d..02ede92e8269 100644
--- a/include/sound/simple_card_utils.h
+++ b/include/sound/simple_card_utils.h
@@ -81,6 +81,7 @@ struct simple_util_priv {
 	const struct snd_soc_ops *ops;
 	unsigned int dpcm_selectable:1;
 	unsigned int force_dpcm:1;
+	unsigned int ignore_zero_sysclk:1;
 };
 #define simple_priv_to_card(priv)	(&(priv)->snd_card)
 #define simple_priv_to_props(priv, i)	((priv)->dai_props + (i))
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index 3115e1f37c0c..04ae242a51d0 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -383,7 +383,8 @@ void simple_util_shutdown(struct snd_pcm_substream *substream)
 	for_each_prop_dai_cpu(props, i, dai) {
 		struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, i);
 
-		if (props->mclk_fs && !dai->clk_fixed && !snd_soc_dai_active(cpu_dai))
+		if (!priv->ignore_zero_sysclk && props->mclk_fs &&
+		    !dai->clk_fixed && !snd_soc_dai_active(cpu_dai))
 			snd_soc_dai_set_sysclk(cpu_dai, 0, 0, dai->clk_direction);
 
 		simple_clk_disable(dai);
@@ -391,7 +392,8 @@ void simple_util_shutdown(struct snd_pcm_substream *substream)
 	for_each_prop_dai_codec(props, i, dai) {
 		struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, i);
 
-		if (props->mclk_fs && !dai->clk_fixed && !snd_soc_dai_active(codec_dai))
+		if (!priv->ignore_zero_sysclk && props->mclk_fs &&
+		    !dai->clk_fixed && !snd_soc_dai_active(codec_dai))
 			snd_soc_dai_set_sysclk(codec_dai, 0, 0, dai->clk_direction);
 
 		simple_clk_disable(dai);
-- 
2.17.1


  reply	other threads:[~2026-03-17  9:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-17  9:49 [PATCH 0/2] ASoC: Add flag to ignore 0Hz sysclk requests Sheetal
2026-03-17  9:49 ` Sheetal [this message]
2026-03-17 13:39   ` [PATCH 1/2] ASoC: simple-card-utils: add ignore_zero_sysclk flag Mark Brown
2026-03-17 23:02     ` Kuninori Morimoto
2026-03-18  9:06       ` Sheetal .
2026-03-18 11:56         ` Mark Brown
2026-03-25  5:27           ` Sheetal .
2026-03-17  9:49 ` [PATCH 2/2] ASoC: tegra: enable ignore_zero_sysclk for Tegra Sheetal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260317094910.1582011-2-sheetal@nvidia.com \
    --to=sheetal@nvidia.com \
    --cc=broonie@kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mkumard@nvidia.com \
    --cc=perex@perex.cz \
    --cc=thierry.reding@kernel.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox