Linux Sound subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: phucduc.bui@gmail.com
Cc: linux-sound@vger.kernel.org
Subject: Re: [RFC PATCH 1/2] ASoC: atmel: mchp-spdifrx: Fix 16-bit big-endian format check
Date: Fri, 20 Nov 2026 04:07:45 +0000	[thread overview]
Message-ID: <sashiko-outbox-224436@kernel.org> (raw)
In-Reply-To: <20261120035939.12774-2-phucduc.bui@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] ASoC: atmel: mchp-spdifrx: wrong 16-bit BE format in
  mchp_spdifrx_hw_params()
--

commit 35438546e4acb88091a245628184b5c5fc916afd
Author: bui duc phuc <phucduc.bui@gmail.com>

ASoC: atmel: mchp-spdifrx: Fix 16-bit big-endian format check

This commit replaces SNDRV_PCM_FORMAT_S16_BE with SNDRV_PCM_FORMAT_U16_BE
in mchp_spdifrx_hw_params() to match MCHP_SPDIF_FORMATS.

> diff --git a/sound/soc/atmel/mchp-spdifrx.c b/sound/soc/atmel/mchp-spdifrx.c
> index 63089ac3ebdc9..80a64af0878b5 100644
> --- a/sound/soc/atmel/mchp-spdifrx.c
> +++ b/sound/soc/atmel/mchp-spdifrx.c
> @@ -455,7 +455,7 @@ static int mchp_spdifrx_hw_params(struct snd_pcm_substream *substream,
>  	}
>  
>  	switch (params_format(params)) {
> -	case SNDRV_PCM_FORMAT_S16_BE:
> +	case SNDRV_PCM_FORMAT_U16_BE:
>  	case SNDRV_PCM_FORMAT_S20_3BE:
>  	case SNDRV_PCM_FORMAT_S24_3BE:
>  	case SNDRV_PCM_FORMAT_S24_BE:

[Severity: Medium]
Should MCHP_SPDIF_FORMATS be changed from SNDRV_PCM_FMTBIT_U16_BE to
SNDRV_PCM_FMTBIT_S16_BE instead?

IEC-60958 linear PCM samples are signed two's-complement values, and
SPDIFRX_MR_ENDIAN_BIG only switches the byte order in SPDIFRX_MR without
converting signed samples to unsigned.  All other format pairs in
MCHP_SPDIF_FORMATS are signed, and the companion linux,spdif-dir codec
(sound/soc/codecs/spdif_receiver.c) used with this controller only
supports S16_LE and S16_BE, so advertising U16_BE prevents 16-bit
big-endian capture from being negotiated (or delivers signed samples into
an unsigned stream if paired with a codec that permits U16_BE).

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261120035939.12774-1-phucduc.bui@gmail.com?part=1

  reply	other threads:[~2026-11-20  4:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20  3:59 [RFC PATCH 0/2] ASoC: atmel: mchp-spdifrx: Fix format handling and MR configuration phucduc.bui
2026-11-20  3:59 ` [RFC PATCH 1/2] ASoC: atmel: mchp-spdifrx: Fix 16-bit big-endian format check phucduc.bui
2026-11-20  4:07   ` sashiko-bot [this message]
2026-11-20  3:59 ` [RFC PATCH 2/2] ASoC: atmel: mchp-spdifrx: Preserve MR defaults in hw_params phucduc.bui

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=sashiko-outbox-224436@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=phucduc.bui@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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