diff options
| -rw-r--r-- | sound/soc/fsl/fsl_ssi.c | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 6daeb5fbdc9b..198656fd171d 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c | |||
| @@ -383,30 +383,11 @@ static int fsl_ssi_setup(struct fsl_ssi_private *ssi_private) | |||
| 383 | &ssi->sfcsr); | 383 | &ssi->sfcsr); |
| 384 | 384 | ||
| 385 | /* | 385 | /* |
| 386 | * For non-ac97 setups, we keep the SSI disabled because if we enable | ||
| 387 | * it, then the DMA controller will start. It's not supposed to start | ||
| 388 | * until the SCR.TE (or SCR.RE) bit is set, but it does anyway. The DMA | ||
| 389 | * controller will transfer one "BWC" of data (i.e. the amount of data | ||
| 390 | * that the MR.BWC bits are set to). The reason this is bad is because | ||
| 391 | * at this point, the PCM driver has not finished initializing the DMA | ||
| 392 | * controller. | ||
| 393 | */ | ||
| 394 | |||
| 395 | |||
| 396 | /* | ||
| 397 | * For ac97 interrupts are enabled with the startup of the substream | 386 | * For ac97 interrupts are enabled with the startup of the substream |
| 398 | * because it is also running without an active substream. Normally SSI | 387 | * because it is also running without an active substream. Normally SSI |
| 399 | * is only enabled when there is a substream. | 388 | * is only enabled when there is a substream. |
| 400 | */ | 389 | */ |
| 401 | if (!ssi_private->imx_ac97) { | 390 | if (ssi_private->imx_ac97) { |
| 402 | /* Enable the interrupts and DMA requests */ | ||
| 403 | if (ssi_private->use_dma) | ||
| 404 | write_ssi(SIER_FLAGS, &ssi->sier); | ||
| 405 | else | ||
| 406 | write_ssi(CCSR_SSI_SIER_TIE | CCSR_SSI_SIER_TFE0_EN | | ||
| 407 | CCSR_SSI_SIER_RIE | | ||
| 408 | CCSR_SSI_SIER_RFF0_EN, &ssi->sier); | ||
| 409 | } else { | ||
| 410 | /* | 391 | /* |
| 411 | * Setup the clock control register | 392 | * Setup the clock control register |
| 412 | */ | 393 | */ |
| @@ -574,6 +555,27 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd, | |||
| 574 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 555 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
| 575 | struct fsl_ssi_private *ssi_private = snd_soc_dai_get_drvdata(rtd->cpu_dai); | 556 | struct fsl_ssi_private *ssi_private = snd_soc_dai_get_drvdata(rtd->cpu_dai); |
| 576 | struct ccsr_ssi __iomem *ssi = ssi_private->ssi; | 557 | struct ccsr_ssi __iomem *ssi = ssi_private->ssi; |
| 558 | unsigned int sier_bits; | ||
| 559 | |||
| 560 | /* | ||
| 561 | * Enable only the interrupts and DMA requests | ||
| 562 | * that are needed for the channel. As the fiq | ||
| 563 | * is polling for this bits, we have to ensure | ||
| 564 | * that this are aligned with the preallocated | ||
| 565 | * buffers | ||
| 566 | */ | ||
| 567 | |||
| 568 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { | ||
| 569 | if (ssi_private->use_dma) | ||
| 570 | sier_bits = SIER_FLAGS; | ||
| 571 | else | ||
| 572 | sier_bits = CCSR_SSI_SIER_TIE | CCSR_SSI_SIER_TFE0_EN; | ||
| 573 | } else { | ||
| 574 | if (ssi_private->use_dma) | ||
| 575 | sier_bits = SIER_FLAGS; | ||
| 576 | else | ||
| 577 | sier_bits = CCSR_SSI_SIER_RIE | CCSR_SSI_SIER_RFF0_EN; | ||
| 578 | } | ||
| 577 | 579 | ||
| 578 | switch (cmd) { | 580 | switch (cmd) { |
| 579 | case SNDRV_PCM_TRIGGER_START: | 581 | case SNDRV_PCM_TRIGGER_START: |
| @@ -602,6 +604,8 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd, | |||
| 602 | return -EINVAL; | 604 | return -EINVAL; |
| 603 | } | 605 | } |
| 604 | 606 | ||
| 607 | write_ssi(sier_bits, &ssi->sier); | ||
| 608 | |||
| 605 | return 0; | 609 | return 0; |
| 606 | } | 610 | } |
| 607 | 611 | ||
