ASoC: move dma_data from snd_soc_dai to snd_soc_pcm_stream
[safe/jmp/linux-2.6] / include / sound / soc-dai.h
index ca24e7f..377693a 100644 (file)
@@ -16,6 +16,8 @@
 
 #include <linux/list.h>
 
+#include <sound/soc.h>
+
 struct snd_pcm_substream;
 
 /*
@@ -180,6 +182,12 @@ struct snd_soc_dai_ops {
                struct snd_soc_dai *);
        int (*trigger)(struct snd_pcm_substream *, int,
                struct snd_soc_dai *);
+       /*
+        * For hardware based FIFO caused delay reporting.
+        * Optional.
+        */
+       snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *,
+               struct snd_soc_dai *);
 };
 
 /*
@@ -213,11 +221,9 @@ struct snd_soc_dai {
        unsigned int symmetric_rates:1;
 
        /* DAI runtime info */
-       struct snd_pcm_runtime *runtime;
        struct snd_soc_codec *codec;
        unsigned int active;
        unsigned char pop_wait:1;
-       void *dma_data;
 
        /* DAI private data */
        void *private_data;
@@ -228,4 +234,21 @@ struct snd_soc_dai {
        struct list_head list;
 };
 
+static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai,
+                                            const struct snd_pcm_substream *ss)
+{
+       return (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) ?
+               dai->playback.dma_data : dai->capture.dma_data;
+}
+
+static inline void snd_soc_dai_set_dma_data(struct snd_soc_dai *dai,
+                                           const struct snd_pcm_substream *ss,
+                                           void *data)
+{
+       if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
+               dai->playback.dma_data = data;
+       else
+               dai->capture.dma_data = data;
+}
+
 #endif