public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: codekipper@gmail.com
To: linux-kernel@vger.kernel.org, linux-arm-kernel@vger.kernel.org,
	linux-sunxi@googlegroups.com, linux-sunxi@lists.linux.dev,
	linux-sound@vger.kernel.org, lander@jagmn.com
Cc: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz,
	tiwai@suse.com, jernej.skrabec@gmail.com, samuel@sholland.org,
	andre.przywara@arm.com, wens@csie.org,
	u.kleine-koenig@baylibre.com,
	Marcus Cooper <codekipper@gmail.com>
Subject: [PATCH 3/3] ASoC: sun4i-spdif: Add working 24bit audio support
Date: Mon, 11 Nov 2024 17:55:31 +0100	[thread overview]
Message-ID: <20241111165600.57219-4-codekipper@gmail.com> (raw)
In-Reply-To: <20241111165600.57219-1-codekipper@gmail.com>

From: Marcus Cooper <codekipper@gmail.com>

24 bit audio file can be detected by the alsa driver as S32_LE.
Add this format to what is supported and change the DMA address
width.

Signed-off-by: Marcus Cooper <codekipper@gmail.com>
---
 sound/soc/sunxi/sun4i-spdif.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c
index 5a9407aaa1a19..41caf1795d09b 100644
--- a/sound/soc/sunxi/sun4i-spdif.c
+++ b/sound/soc/sunxi/sun4i-spdif.c
@@ -287,14 +287,17 @@ static int sun4i_spdif_hw_params(struct snd_pcm_substream *substream,
 		return -EINVAL;
 	}
 
+	host->dma_params_tx.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
 	switch (params_format(params)) {
 	case SNDRV_PCM_FORMAT_S16_LE:
 		fmt |= SUN4I_SPDIF_TXCFG_FMT16BIT;
+		host->dma_params_tx.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
 		break;
 	case SNDRV_PCM_FORMAT_S20_3LE:
 		fmt |= SUN4I_SPDIF_TXCFG_FMT20BIT;
 		break;
 	case SNDRV_PCM_FORMAT_S24_LE:
+	case SNDRV_PCM_FORMAT_S32_LE:
 		fmt |= SUN4I_SPDIF_TXCFG_FMT24BIT;
 		break;
 	default:
@@ -526,9 +529,10 @@ static const struct regmap_config sun4i_spdif_regmap_config = {
 
 #define SUN4I_RATES	SNDRV_PCM_RATE_8000_192000
 
-#define SUN4I_FORMATS	(SNDRV_PCM_FORMAT_S16_LE | \
-				SNDRV_PCM_FORMAT_S20_3LE | \
-				SNDRV_PCM_FORMAT_S24_LE)
+#define SUN4I_FORMATS	(SNDRV_PCM_FMTBIT_S16_LE | \
+				SNDRV_PCM_FMTBIT_S20_3LE | \
+				SNDRV_PCM_FMTBIT_S24_LE | \
+				SNDRV_PCM_FMTBIT_S32_LE)
 
 static struct snd_soc_dai_driver sun4i_spdif_dai = {
 	.playback = {
-- 
2.47.0


  parent reply	other threads:[~2024-11-11 16:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-11 16:55 [PATCH 0/3] ASoC: sun4i-spdif: Add 24bit support codekipper
2024-11-11 16:55 ` [PATCH 1/3] ASoC: sun4i-spdif: Add clock multiplier settings codekipper
2024-11-11 16:55 ` [PATCH 2/3] ASoC: sun4i-spdif: Always set the valid data to be the MSB codekipper
2024-11-11 16:55 ` codekipper [this message]
2024-12-10 13:36 ` [PATCH 0/3] ASoC: sun4i-spdif: Add 24bit support 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=20241111165600.57219-4-codekipper@gmail.com \
    --to=codekipper@gmail.com \
    --cc=andre.przywara@arm.com \
    --cc=broonie@kernel.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=lander@jagmn.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=perex@perex.cz \
    --cc=samuel@sholland.org \
    --cc=tiwai@suse.com \
    --cc=u.kleine-koenig@baylibre.com \
    --cc=wens@csie.org \
    /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