Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a34b027d authored by Matthias Reichl's avatar Matthias Reichl Committed by Mark Brown
Browse files

ASoC: bcm2835: add 24bit support



This adds 24 bit support to the I2S driver of the BCM2835

Code ported from bcm2708-i2s driver in Raspberry Pi tree.

Signed-off-by: default avatarFlorian Meier <florian.meier@koalo.de>
Signed-off-by: default avatarMatthias Reichl <hias@horus.com>
Signed-off-by: default avatarMartin Sperl <kernel@martin.sperl.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent f55532a0
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -259,6 +259,9 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream,
	case SNDRV_PCM_FORMAT_S16_LE:
		data_length = 16;
		break;
	case SNDRV_PCM_FORMAT_S24_LE:
		data_length = 24;
		break;
	case SNDRV_PCM_FORMAT_S32_LE:
		data_length = 32;
		break;
@@ -279,7 +282,7 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream,
	/* Setup the frame format */
	format = BCM2835_I2S_CHEN;

	if (data_length > 24)
	if (data_length >= 24)
		format |= BCM2835_I2S_CHWEX;

	format |= BCM2835_I2S_CHWID((data_length-8)&0xf);
@@ -570,6 +573,7 @@ static struct snd_soc_dai_driver bcm2835_i2s_dai = {
		.channels_max = 2,
		.rates =	SNDRV_PCM_RATE_8000_192000,
		.formats =	SNDRV_PCM_FMTBIT_S16_LE
				| SNDRV_PCM_FMTBIT_S24_LE
				| SNDRV_PCM_FMTBIT_S32_LE
		},
	.capture = {
@@ -577,6 +581,7 @@ static struct snd_soc_dai_driver bcm2835_i2s_dai = {
		.channels_max = 2,
		.rates =	SNDRV_PCM_RATE_8000_192000,
		.formats =	SNDRV_PCM_FMTBIT_S16_LE
				| SNDRV_PCM_FMTBIT_S24_LE
				| SNDRV_PCM_FMTBIT_S32_LE
		},
	.ops = &bcm2835_i2s_dai_ops,