From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCBCE27127E; Mon, 24 Feb 2025 11:20:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740396009; cv=none; b=Hn1ZpshbA6GMvcmKnpuJFQhq/Aec+yNQ4rSG3yMsGS8yOiDUOWxktlapCBKWQyD+uyuXHcOcGiPjsl4uu+mlYYkbmQVUzh8Z2Dkprtg3/DjTG4BcguSSPjHowh3VVeEwyxZ+pvbnm7U07c3/bTZ3IHPKLB129fW4fx3+12Z32+U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740396009; c=relaxed/simple; bh=tfHDYuIBJF+s43JwKRQ0lf1idI/XD9P3wtKl1vqBbGE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=dc9GOYzA88hHtcZKvH5PMjtz+4JQDUcZbb91wGYa/dizXZCahUbeHWgd6FZHTHPfgeuL1ajO7g4luu/fTzHKH4mEStBIjzIsbk78AlGHfV1NwqPIW4ylAsN3cWVZ89aNcElF6Eiy52rJhVX2KsGvY4I9PSo+mXlxi1NIhYUvNi8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AeEdRXHp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AeEdRXHp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47334C4CEE6; Mon, 24 Feb 2025 11:20:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740396009; bh=tfHDYuIBJF+s43JwKRQ0lf1idI/XD9P3wtKl1vqBbGE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AeEdRXHpfR/ixvxaTfOt2D9+vellNSBDo4p3Lbs4bvFddfQ3pf3CQ+zp3BOgcvCZ8 LZz4uVRCViy0xH/zQSVLjl/fYac7lTq0BIs2uu5WixMjUNZC3jkN7YoalhV31rf+jr x6a07INvn4xpvSdOsWuS0uf14KtSDovF6uzvrxKYBVBQiMeL4Rn3vzuZeAPKTLc8RT xrf0dr/A9TvX5ZkTshvUJqq/NwkizXzXacMqEIaDcR9FiJf+So1Hi8J62YwYGoBIdO zs7ydzrlI5rZKxr2YJm510HQ3u8ecCT5ad4I8V1xSBDNGtXAfI7Vl/nMt3j57TpBTI dqbj3B1IRfDBQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Kuninori Morimoto , Yoshihiro Shimoda , Mark Brown , Sasha Levin , lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, prabhakar.mahadev-lad.rj@bp.renesas.com, u.kleine-koenig@baylibre.com, krzysztof.kozlowski@linaro.org, linux-sound@vger.kernel.org Subject: [PATCH AUTOSEL 6.1 02/12] ASoC: rsnd: don't indicate warning on rsnd_kctrl_accept_runtime() Date: Mon, 24 Feb 2025 06:19:50 -0500 Message-Id: <20250224112002.2214613-2-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250224112002.2214613-1-sashal@kernel.org> References: <20250224112002.2214613-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.1.129 Content-Transfer-Encoding: 8bit From: Kuninori Morimoto [ Upstream commit c3fc002b206c6c83d1e3702b979733002ba6fb2c ] rsnd_kctrl_accept_runtime() (1) is used for runtime convert rate (= Synchronous SRC Mode). Now, rsnd driver has 2 kctrls for it (A): "SRC Out Rate Switch" (B): "SRC Out Rate" // it calls (1) (A): can be called anytime (B): can be called only runtime, and will indicate warning if it was used at non-runtime. To use runtime convert rate (= Synchronous SRC Mode), user might uses command in below order. (X): > amixer set "SRC Out Rate" on > aplay xxx.wav & (Y): > amixer set "SRC Out Rate" 48010 // convert rate to 48010Hz (Y): calls B (X): calls both A and B. In this case, when user calls (X), it calls both (A) and (B), but it is not yet start running. So, (B) will indicate warning. This warning was added by commit b5c088689847 ("ASoC: rsnd: add warning message to rsnd_kctrl_accept_runtime()"), but the message sounds like the operation was not correct. Let's update warning message. The message is very SRC specific, implement it in src.c Signed-off-by: Kuninori Morimoto Reviewed-by: Yoshihiro Shimoda Link: https://patch.msgid.link/8734gt2qed.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/sh/rcar/core.c | 14 -------------- sound/soc/sh/rcar/rsnd.h | 1 - sound/soc/sh/rcar/src.c | 18 +++++++++++++++++- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 7e380d71b0f88..0964b4e3fbdfb 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1694,20 +1694,6 @@ int rsnd_kctrl_accept_anytime(struct rsnd_dai_stream *io) return 1; } -int rsnd_kctrl_accept_runtime(struct rsnd_dai_stream *io) -{ - struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); - struct rsnd_priv *priv = rsnd_io_to_priv(io); - struct device *dev = rsnd_priv_to_dev(priv); - - if (!runtime) { - dev_warn(dev, "Can't update kctrl when idle\n"); - return 0; - } - - return 1; -} - struct rsnd_kctrl_cfg *rsnd_kctrl_init_m(struct rsnd_kctrl_cfg_m *cfg) { cfg->cfg.val = cfg->val; diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index f8ef6836ef84e..690f4932357c1 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -742,7 +742,6 @@ struct rsnd_kctrl_cfg_s { #define rsnd_kctrl_vals(x) ((x).val) /* = (x).cfg.val[0] */ int rsnd_kctrl_accept_anytime(struct rsnd_dai_stream *io); -int rsnd_kctrl_accept_runtime(struct rsnd_dai_stream *io); struct rsnd_kctrl_cfg *rsnd_kctrl_init_m(struct rsnd_kctrl_cfg_m *cfg); struct rsnd_kctrl_cfg *rsnd_kctrl_init_s(struct rsnd_kctrl_cfg_s *cfg); int rsnd_kctrl_new(struct rsnd_mod *mod, diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index f832165e46bc0..9893839666d7b 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -530,6 +530,22 @@ static irqreturn_t rsnd_src_interrupt(int irq, void *data) return IRQ_HANDLED; } +static int rsnd_src_kctrl_accept_runtime(struct rsnd_dai_stream *io) +{ + struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); + + if (!runtime) { + struct rsnd_priv *priv = rsnd_io_to_priv(io); + struct device *dev = rsnd_priv_to_dev(priv); + + dev_warn(dev, "\"SRC Out Rate\" can use during running\n"); + + return 0; + } + + return 1; +} + static int rsnd_src_probe_(struct rsnd_mod *mod, struct rsnd_dai_stream *io, struct rsnd_priv *priv) @@ -593,7 +609,7 @@ static int rsnd_src_pcm_new(struct rsnd_mod *mod, rsnd_io_is_play(io) ? "SRC Out Rate" : "SRC In Rate", - rsnd_kctrl_accept_runtime, + rsnd_src_kctrl_accept_runtime, rsnd_src_set_convert_rate, &src->sync, 192000); -- 2.39.5