From: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz,
tiwai@suse.com, heiko@sntech.de,
linux-rockchip@lists.infradead.org, linux-sound@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Pei Xiao <xiaopei01@kylinos.cn>
Cc: Pei Xiao <xiaopei01@kylinos.cn>
Subject: Re: [PATCH v2 1/2] ASOC: rockchip: fix capture stream handling in rockchip_sai_xfer_stop
Date: Fri, 06 Jun 2025 11:48:38 +0200 [thread overview]
Message-ID: <9468228.NyiUUSuA9g@workhorse> (raw)
In-Reply-To: <c374aae92c177aaf42c0f1371eccdbc7e9615786.1749201126.git.xiaopei01@kylinos.cn>
On Friday, 6 June 2025 11:18:21 Central European Summer Time Pei Xiao wrote:
> Correcting the capture stream handling which was incorrectly setting
> playback=true for capture streams.
>
> The original code mistakenly set playback=true for capture streams,
> causing incorrect behavior.
>
> Fixes: cc78d1eaabad ("ASoC: rockchip: add Serial Audio Interface (SAI) driver")
> Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
> ---
> sound/soc/rockchip/rockchip_sai.c | 16 +++-------------
> 1 file changed, 3 insertions(+), 13 deletions(-)
>
> diff --git a/sound/soc/rockchip/rockchip_sai.c b/sound/soc/rockchip/rockchip_sai.c
> index 602f1ddfad00..916af63f1c2c 100644
> --- a/sound/soc/rockchip/rockchip_sai.c
> +++ b/sound/soc/rockchip/rockchip_sai.c
> @@ -378,19 +378,9 @@ static void rockchip_sai_xfer_start(struct rk_sai_dev *sai, int stream)
> static void rockchip_sai_xfer_stop(struct rk_sai_dev *sai, int stream)
> {
> unsigned int msk = 0, val = 0, clr = 0;
> - bool playback;
> - bool capture;
> -
> - if (stream < 0) {
> - playback = true;
> - capture = true;
> - } else if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
> - playback = true;
> - capture = false;
> - } else {
> - playback = true;
> - capture = false;
> - }
> + bool capture = stream == SNDRV_PCM_STREAM_CAPTURE || stream < 0;
> + bool playback = stream == SNDRV_PCM_STREAM_PLAYBACK || stream < 0;
> + /* could be <= 0 but we don't want to depend on enum values */
>
> if (playback) {
> msk |= SAI_XFER_TXS_MASK;
>
Tested-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Acked-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Thank you!
next prev parent reply other threads:[~2025-06-06 9:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-06 9:18 [PATCH v2 0/2] Cleanup in rockchip_sai.c Pei Xiao
2025-06-06 9:18 ` [PATCH v2 1/2] ASOC: rockchip: fix capture stream handling in rockchip_sai_xfer_stop Pei Xiao
2025-06-06 9:48 ` Nicolas Frattaroli [this message]
2025-06-06 9:18 ` [PATCH v2 2/2] ASOC: rockchip: Use helper function devm_clk_get_enabled() Pei Xiao
2025-06-06 9:51 ` Nicolas Frattaroli
2025-06-09 21:00 ` [PATCH v2 0/2] Cleanup in rockchip_sai.c Mark Brown
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=9468228.NyiUUSuA9g@workhorse \
--to=nicolas.frattaroli@collabora.com \
--cc=broonie@kernel.org \
--cc=heiko@sntech.de \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
--cc=xiaopei01@kylinos.cn \
/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