Commit 7abd01cf authored by Aidan MacDonald's avatar Aidan MacDonald Committed by Mark Brown

ASoC: jz4740-i2s: Support S20_LE and S24_LE sample formats

The audio controller on JZ47xx SoCs can transfer 20- and 24-bit
samples in the FIFO, so allow those formats to be used with the
I2S driver. Although the FIFO doesn't care about the in-memory
sample format, we only support 4-byte format variants because the
DMA controller on these SoCs cannot transfer in 3-byte multiples.
Reviewed-by: default avatarPaul Cercueil <paul@crapouillou.net>
Signed-off-by: default avatarAidan MacDonald <aidanmacdonald.0x0@gmail.com>
Link: https://lore.kernel.org/r/20221023143328.160866-7-aidanmacdonald.0x0@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent dacc06b8
...@@ -237,9 +237,15 @@ static int jz4740_i2s_hw_params(struct snd_pcm_substream *substream, ...@@ -237,9 +237,15 @@ static int jz4740_i2s_hw_params(struct snd_pcm_substream *substream,
case SNDRV_PCM_FORMAT_S8: case SNDRV_PCM_FORMAT_S8:
sample_size = 0; sample_size = 0;
break; break;
case SNDRV_PCM_FORMAT_S16: case SNDRV_PCM_FORMAT_S16_LE:
sample_size = 1; sample_size = 1;
break; break;
case SNDRV_PCM_FORMAT_S20_LE:
sample_size = 3;
break;
case SNDRV_PCM_FORMAT_S24_LE:
sample_size = 4;
break;
default: default:
return -EINVAL; return -EINVAL;
} }
...@@ -374,7 +380,9 @@ static const struct snd_soc_dai_ops jz4740_i2s_dai_ops = { ...@@ -374,7 +380,9 @@ static const struct snd_soc_dai_ops jz4740_i2s_dai_ops = {
}; };
#define JZ4740_I2S_FMTS (SNDRV_PCM_FMTBIT_S8 | \ #define JZ4740_I2S_FMTS (SNDRV_PCM_FMTBIT_S8 | \
SNDRV_PCM_FMTBIT_S16_LE) SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FMTBIT_S20_LE | \
SNDRV_PCM_FMTBIT_S24_LE)
static struct snd_soc_dai_driver jz4740_i2s_dai = { static struct snd_soc_dai_driver jz4740_i2s_dai = {
.probe = jz4740_i2s_dai_probe, .probe = jz4740_i2s_dai_probe,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment