diff options
author | Matthias Reichl <hias@horus.com> | 2016-04-25 09:39:38 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-04-25 12:39:05 -0400 |
commit | a34b027dca5ea840fbc84121db66488375acfdea (patch) | |
tree | cc46d5c017caf38f8cecace0e0627b48b536ae62 | |
parent | f55532a0c0b8bb6148f4e07853b876ef73bc69ca (diff) |
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: Florian Meier <florian.meier@koalo.de>
Signed-off-by: Matthias Reichl <hias@horus.com>
Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/bcm/bcm2835-i2s.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sound/soc/bcm/bcm2835-i2s.c b/sound/soc/bcm/bcm2835-i2s.c index 1c1f2210387b..d2663e79ece1 100644 --- a/sound/soc/bcm/bcm2835-i2s.c +++ b/sound/soc/bcm/bcm2835-i2s.c | |||
@@ -259,6 +259,9 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream, | |||
259 | case SNDRV_PCM_FORMAT_S16_LE: | 259 | case SNDRV_PCM_FORMAT_S16_LE: |
260 | data_length = 16; | 260 | data_length = 16; |
261 | break; | 261 | break; |
262 | case SNDRV_PCM_FORMAT_S24_LE: | ||
263 | data_length = 24; | ||
264 | break; | ||
262 | case SNDRV_PCM_FORMAT_S32_LE: | 265 | case SNDRV_PCM_FORMAT_S32_LE: |
263 | data_length = 32; | 266 | data_length = 32; |
264 | break; | 267 | break; |
@@ -279,7 +282,7 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream, | |||
279 | /* Setup the frame format */ | 282 | /* Setup the frame format */ |
280 | format = BCM2835_I2S_CHEN; | 283 | format = BCM2835_I2S_CHEN; |
281 | 284 | ||
282 | if (data_length > 24) | 285 | if (data_length >= 24) |
283 | format |= BCM2835_I2S_CHWEX; | 286 | format |= BCM2835_I2S_CHWEX; |
284 | 287 | ||
285 | format |= BCM2835_I2S_CHWID((data_length-8)&0xf); | 288 | format |= BCM2835_I2S_CHWID((data_length-8)&0xf); |
@@ -570,6 +573,7 @@ static struct snd_soc_dai_driver bcm2835_i2s_dai = { | |||
570 | .channels_max = 2, | 573 | .channels_max = 2, |
571 | .rates = SNDRV_PCM_RATE_8000_192000, | 574 | .rates = SNDRV_PCM_RATE_8000_192000, |
572 | .formats = SNDRV_PCM_FMTBIT_S16_LE | 575 | .formats = SNDRV_PCM_FMTBIT_S16_LE |
576 | | SNDRV_PCM_FMTBIT_S24_LE | ||
573 | | SNDRV_PCM_FMTBIT_S32_LE | 577 | | SNDRV_PCM_FMTBIT_S32_LE |
574 | }, | 578 | }, |
575 | .capture = { | 579 | .capture = { |
@@ -577,6 +581,7 @@ static struct snd_soc_dai_driver bcm2835_i2s_dai = { | |||
577 | .channels_max = 2, | 581 | .channels_max = 2, |
578 | .rates = SNDRV_PCM_RATE_8000_192000, | 582 | .rates = SNDRV_PCM_RATE_8000_192000, |
579 | .formats = SNDRV_PCM_FMTBIT_S16_LE | 583 | .formats = SNDRV_PCM_FMTBIT_S16_LE |
584 | | SNDRV_PCM_FMTBIT_S24_LE | ||
580 | | SNDRV_PCM_FMTBIT_S32_LE | 585 | | SNDRV_PCM_FMTBIT_S32_LE |
581 | }, | 586 | }, |
582 | .ops = &bcm2835_i2s_dai_ops, | 587 | .ops = &bcm2835_i2s_dai_ops, |