asoc: tegra: pcm: If there is no dma information exit from trigger
Nikesh Oswal [Tue, 8 May 2012 11:17:40 +0000 (16:17 +0530)]
If there is no dma information exit from trigger, this is required
for the dummy voice call playback and capture streams

Change-Id: I5276e7ebb72c17268a9785204fea9f395b2e5d3a
Signed-off-by: Nikesh Oswal <noswal@nvidia.com>
Reviewed-on: http://git-master/r/101235
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Scott Peterson <speterson@nvidia.com>

sound/soc/tegra/tegra_pcm.c

index 3b475a2..6ba3c9f 100644 (file)
@@ -257,9 +257,15 @@ int tegra_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
 {
        struct snd_pcm_runtime *runtime = substream->runtime;
        struct tegra_runtime_data *prtd = runtime->private_data;
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct tegra_pcm_dma_params * dmap;
        unsigned long flags;
        int i;
 
+       dmap = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
+       if (!dmap)
+               return 0;
+
        switch (cmd) {
        case SNDRV_PCM_TRIGGER_START:
                prtd->dma_pos = 0;