summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Cooper <codekipper@gmail.com>2024-11-11 17:55:31 +0100
committerMark Brown <broonie@kernel.org>2024-12-09 14:07:58 +0000
commit6e750d3ec7410c8d3aa6a006d37142eb837b3c03 (patch)
treeb37c6a810b4f5841f8b83a7274183f0052fc0b93
parent80ac12ffb3a9e19a2f11eb1975ed31c9a39183c8 (diff)
ASoC: sun4i-spdif: Add working 24bit audio support
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> Link: https://patch.msgid.link/20241111165600.57219-4-codekipper@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/sunxi/sun4i-spdif.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c
index 5a9407aaa1a1..41caf1795d09 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 = {