RE: [PATCH v2 1/2] ASoC: renesas: rz-ssi: Fix channel swap issue in full duplex mode

From: Biju Das

Date: Thu Nov 13 2025 - 05:35:17 EST


Hi Geert,

Thanks for the feedback.

> -----Original Message-----
> From: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
> Sent: 13 November 2025 08:51
> Subject: Re: [PATCH v2 1/2] ASoC: renesas: rz-ssi: Fix channel swap issue in full duplex mode
>
> Hi Biju,
>
> On Thu, 13 Nov 2025 at 09:25, Biju <biju.das.au@xxxxxxxxx> wrote:
> > From: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
> >
> > The full duplex audio starts with half duplex mode and then switch to
> > full duplex mode (another FIFO reset) when both playback/capture
> > streams available leading to random audio left/right channel swap
> > issue. Fix this channel swap issue by detecting the full duplex
> > condition by populating struct dup variable in startup() callback and
> > synchronize starting both the play and capture at the same time in
> > rz_ssi_start().
> >
> > Cc: stable@xxxxxxxxxx
> > Fixes: 4f8cd05a4305 ("ASoC: sh: rz-ssi: Add full duplex support")
> > Co-developed-by: Tony Tang <tony.tang.ks@xxxxxxxxxxx>
> > Signed-off-by: Tony Tang <tony.tang.ks@xxxxxxxxxxx>
> > Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
> > Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
>
> Thanks for your patch!
>
> > --- a/sound/soc/renesas/rz-ssi.c
> > +++ b/sound/soc/renesas/rz-ssi.c
> > @@ -374,12 +379,18 @@ static int rz_ssi_start(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm)
> > SSISR_RUIRQ), 0);
> >
> > strm->running = 1;
> > - if (is_full_duplex)
> > - ssicr |= SSICR_TEN | SSICR_REN;
> > - else
> > + if (is_full_duplex) {
> > + if (ssi->dup.one_stream_triggered) {
> > + ssicr |= SSICR_TEN | SSICR_REN;
> > + rz_ssi_reg_writel(ssi, SSICR, ssicr);
> > + ssi->dup.one_stream_triggered = false;
> > + } else {
> > + ssi->dup.one_stream_triggered = true;
> > + }
> > + } else {
> > ssicr |= is_play ? SSICR_TEN : SSICR_REN;
> > -
> > - rz_ssi_reg_writel(ssi, SSICR, ssicr);
> > + rz_ssi_reg_writel(ssi, SSICR, ssicr);
> > + }
>
> You can reduce indentation by restructuring the tests:
>
> if (!is_full_duplex) {
> ...
> } else if (ssi->dup.one_stream_triggered) {
> ...
> } else {
> ...
> }

Agreed, will update in next version.

Cheers,
Biju