Merge remote-tracking branch 'asoc/topic/spear' into asoc-next
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 12 Apr 2013 12:57:17 +0000 (13:57 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 12 Apr 2013 12:57:17 +0000 (13:57 +0100)
1  2 
sound/soc/spear/spear_pcm.c

@@@ -25,7 -25,7 +25,7 @@@
  #include <sound/soc.h>
  #include <sound/spear_dma.h>
  
- struct snd_pcm_hardware spear_pcm_hardware = {
+ static struct snd_pcm_hardware spear_pcm_hardware = {
        .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
                 SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID |
                 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME),
@@@ -64,7 -64,21 +64,7 @@@ static int spear_pcm_open(struct snd_pc
        if (ret)
                return ret;
  
 -      ret = snd_dmaengine_pcm_open(substream, dma_data->filter, dma_data);
 -      if (ret)
 -              return ret;
 -
 -      snd_dmaengine_pcm_set_data(substream, dma_data);
 -
 -      return 0;
 -}
 -
 -static int spear_pcm_close(struct snd_pcm_substream *substream)
 -{
 -
 -      snd_dmaengine_pcm_close(substream);
 -
 -      return 0;
 +      return snd_dmaengine_pcm_open(substream, dma_data->filter, dma_data)
  }
  
  static int spear_pcm_mmap(struct snd_pcm_substream *substream,
@@@ -79,7 -93,7 +79,7 @@@
  
  static struct snd_pcm_ops spear_pcm_ops = {
        .open           = spear_pcm_open,
 -      .close          = spear_pcm_close,
 +      .close          = snd_dmaengine_pcm_close,
        .ioctl          = snd_pcm_lib_ioctl,
        .hw_params      = spear_pcm_hw_params,
        .hw_free        = spear_pcm_hw_free,
@@@ -135,9 -149,9 +135,9 @@@ static void spear_pcm_free(struct snd_p
  
  static u64 spear_pcm_dmamask = DMA_BIT_MASK(32);
  
 -static int spear_pcm_new(struct snd_card *card,
 -              struct snd_soc_dai *dai, struct snd_pcm *pcm)
 +static int spear_pcm_new(struct snd_soc_pcm_runtime *rtd)
  {
 +      struct snd_card *card = rtd->card->snd_card;
        int ret;
  
        if (!card->dev->dma_mask)
        if (!card->dev->coherent_dma_mask)
                card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
  
 -      if (dai->driver->playback.channels_min) {
 -              ret = spear_pcm_preallocate_dma_buffer(pcm,
 +      if (rtd->cpu_dai->driver->playback.channels_min) {
 +              ret = spear_pcm_preallocate_dma_buffer(rtd->pcm,
                                SNDRV_PCM_STREAM_PLAYBACK,
                                spear_pcm_hardware.buffer_bytes_max);
                if (ret)
                        return ret;
        }
  
 -      if (dai->driver->capture.channels_min) {
 -              ret = spear_pcm_preallocate_dma_buffer(pcm,
 +      if (rtd->cpu_dai->driver->capture.channels_min) {
 +              ret = spear_pcm_preallocate_dma_buffer(rtd->pcm,
                                SNDRV_PCM_STREAM_CAPTURE,
                                spear_pcm_hardware.buffer_bytes_max);
                if (ret)
        return 0;
  }
  
- struct snd_soc_platform_driver spear_soc_platform = {
+ static struct snd_soc_platform_driver spear_soc_platform = {
        .ops            =       &spear_pcm_ops,
        .pcm_new        =       spear_pcm_new,
        .pcm_free       =       spear_pcm_free,