diff options
| -rw-r--r-- | sound/soc/omap/omap-mcbsp.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index 2d33a89f147a..6f44cb4d30b8 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c | |||
| @@ -320,8 +320,18 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream, | |||
| 320 | omap_mcbsp_dai_dma_params[id][substream->stream].dma_req = dma; | 320 | omap_mcbsp_dai_dma_params[id][substream->stream].dma_req = dma; |
| 321 | omap_mcbsp_dai_dma_params[id][substream->stream].port_addr = port; | 321 | omap_mcbsp_dai_dma_params[id][substream->stream].port_addr = port; |
| 322 | omap_mcbsp_dai_dma_params[id][substream->stream].sync_mode = sync_mode; | 322 | omap_mcbsp_dai_dma_params[id][substream->stream].sync_mode = sync_mode; |
| 323 | omap_mcbsp_dai_dma_params[id][substream->stream].data_type = | 323 | switch (params_format(params)) { |
| 324 | OMAP_DMA_DATA_TYPE_S16; | 324 | case SNDRV_PCM_FORMAT_S16_LE: |
| 325 | omap_mcbsp_dai_dma_params[id][substream->stream].data_type = | ||
| 326 | OMAP_DMA_DATA_TYPE_S16; | ||
| 327 | break; | ||
| 328 | case SNDRV_PCM_FORMAT_S32_LE: | ||
| 329 | omap_mcbsp_dai_dma_params[id][substream->stream].data_type = | ||
| 330 | OMAP_DMA_DATA_TYPE_S32; | ||
| 331 | break; | ||
| 332 | default: | ||
| 333 | return -EINVAL; | ||
| 334 | } | ||
| 325 | 335 | ||
| 326 | snd_soc_dai_set_dma_data(cpu_dai, substream, | 336 | snd_soc_dai_set_dma_data(cpu_dai, substream, |
| 327 | &omap_mcbsp_dai_dma_params[id][substream->stream]); | 337 | &omap_mcbsp_dai_dma_params[id][substream->stream]); |
| @@ -356,6 +366,14 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream, | |||
| 356 | regs->xcr2 |= XWDLEN2(OMAP_MCBSP_WORD_16); | 366 | regs->xcr2 |= XWDLEN2(OMAP_MCBSP_WORD_16); |
| 357 | regs->xcr1 |= XWDLEN1(OMAP_MCBSP_WORD_16); | 367 | regs->xcr1 |= XWDLEN1(OMAP_MCBSP_WORD_16); |
| 358 | break; | 368 | break; |
| 369 | case SNDRV_PCM_FORMAT_S32_LE: | ||
| 370 | /* Set word lengths */ | ||
| 371 | wlen = 32; | ||
| 372 | regs->rcr2 |= RWDLEN2(OMAP_MCBSP_WORD_32); | ||
| 373 | regs->rcr1 |= RWDLEN1(OMAP_MCBSP_WORD_32); | ||
| 374 | regs->xcr2 |= XWDLEN2(OMAP_MCBSP_WORD_32); | ||
| 375 | regs->xcr1 |= XWDLEN1(OMAP_MCBSP_WORD_32); | ||
| 376 | break; | ||
| 359 | default: | 377 | default: |
| 360 | /* Unsupported PCM format */ | 378 | /* Unsupported PCM format */ |
| 361 | return -EINVAL; | 379 | return -EINVAL; |
| @@ -659,13 +677,15 @@ static struct snd_soc_dai_ops omap_mcbsp_dai_ops = { | |||
| 659 | .channels_min = 1, \ | 677 | .channels_min = 1, \ |
| 660 | .channels_max = 16, \ | 678 | .channels_max = 16, \ |
| 661 | .rates = OMAP_MCBSP_RATES, \ | 679 | .rates = OMAP_MCBSP_RATES, \ |
| 662 | .formats = SNDRV_PCM_FMTBIT_S16_LE, \ | 680 | .formats = SNDRV_PCM_FMTBIT_S16_LE | \ |
| 681 | SNDRV_PCM_FMTBIT_S32_LE, \ | ||
| 663 | }, \ | 682 | }, \ |
| 664 | .capture = { \ | 683 | .capture = { \ |
| 665 | .channels_min = 1, \ | 684 | .channels_min = 1, \ |
| 666 | .channels_max = 16, \ | 685 | .channels_max = 16, \ |
| 667 | .rates = OMAP_MCBSP_RATES, \ | 686 | .rates = OMAP_MCBSP_RATES, \ |
| 668 | .formats = SNDRV_PCM_FMTBIT_S16_LE, \ | 687 | .formats = SNDRV_PCM_FMTBIT_S16_LE | \ |
| 688 | SNDRV_PCM_FMTBIT_S32_LE, \ | ||
| 669 | }, \ | 689 | }, \ |
| 670 | .ops = &omap_mcbsp_dai_ops, \ | 690 | .ops = &omap_mcbsp_dai_ops, \ |
| 671 | .private_data = &mcbsp_data[(link_id)].bus_id, \ | 691 | .private_data = &mcbsp_data[(link_id)].bus_id, \ |
