video: rockchip: fb: delele obsolete code for box
[firefly-linux-kernel-4.4.55.git] / include / sound / soc-dai.h
index 1bafe95dcf411dbd813ecff5b13aa2f2c3a074f6..ae9a227d35d3538c233b2b1cb777afcbcb4e639d 100644 (file)
@@ -17,6 +17,8 @@
 #include <linux/list.h>
 
 struct snd_pcm_substream;
+struct snd_soc_dapm_widget;
+struct snd_compr_stream;
 
 /*
  * DAI hardware audio formats.
@@ -24,13 +26,13 @@ struct snd_pcm_substream;
  * Describes the physical PCM data formating and clocking. Add new formats
  * to the end.
  */
-#define SND_SOC_DAIFMT_I2S             0 /* I2S mode */
-#define SND_SOC_DAIFMT_RIGHT_J         1 /* Right Justified mode */
-#define SND_SOC_DAIFMT_LEFT_J          2 /* Left Justified mode */
-#define SND_SOC_DAIFMT_DSP_A           3 /* L data MSB after FRM LRC */
-#define SND_SOC_DAIFMT_DSP_B           4 /* L data MSB during FRM LRC */
-#define SND_SOC_DAIFMT_AC97            5 /* AC97 */
-#define SND_SOC_DAIFMT_PDM             6 /* Pulse density modulation */
+#define SND_SOC_DAIFMT_I2S             1 /* I2S mode */
+#define SND_SOC_DAIFMT_RIGHT_J         2 /* Right Justified mode */
+#define SND_SOC_DAIFMT_LEFT_J          3 /* Left Justified mode */
+#define SND_SOC_DAIFMT_DSP_A           4 /* L data MSB after FRM LRC */
+#define SND_SOC_DAIFMT_DSP_B           5 /* L data MSB during FRM LRC */
+#define SND_SOC_DAIFMT_AC97            6 /* AC97 */
+#define SND_SOC_DAIFMT_PDM             7 /* Pulse density modulation */
 
 /* left and right justified also known as MSB and LSB respectively */
 #define SND_SOC_DAIFMT_MSB             SND_SOC_DAIFMT_LEFT_J
@@ -42,8 +44,8 @@ struct snd_pcm_substream;
  * DAI bit clocks can be be gated (disabled) when the DAI is not
  * sending or receiving PCM data in a frame. This can be used to save power.
  */
-#define SND_SOC_DAIFMT_CONT            (0 << 4) /* continuous clock */
-#define SND_SOC_DAIFMT_GATED           (1 << 4) /* clock is gated */
+#define SND_SOC_DAIFMT_CONT            (1 << 4) /* continuous clock */
+#define SND_SOC_DAIFMT_GATED           (0 << 4) /* clock is gated */
 
 /*
  * DAI hardware signal inversions.
@@ -52,9 +54,9 @@ struct snd_pcm_substream;
  * format.
  */
 #define SND_SOC_DAIFMT_NB_NF           (0 << 8) /* normal bit clock + frame */
-#define SND_SOC_DAIFMT_NB_IF           (1 << 8) /* normal BCLK + inv FRM */
-#define SND_SOC_DAIFMT_IB_NF           (2 << 8) /* invert BCLK + nor FRM */
-#define SND_SOC_DAIFMT_IB_IF           (3 << 8) /* invert BCLK + FRM */
+#define SND_SOC_DAIFMT_NB_IF           (2 << 8) /* normal BCLK + inv FRM */
+#define SND_SOC_DAIFMT_IB_NF           (3 << 8) /* invert BCLK + nor FRM */
+#define SND_SOC_DAIFMT_IB_IF           (4 << 8) /* invert BCLK + FRM */
 
 /*
  * DAI hardware clock masters.
@@ -63,10 +65,10 @@ struct snd_pcm_substream;
  * i.e. if the codec is clk and FRM master then the interface is
  * clk and frame slave.
  */
-#define SND_SOC_DAIFMT_CBM_CFM         (0 << 12) /* codec clk & FRM master */
-#define SND_SOC_DAIFMT_CBS_CFM         (1 << 12) /* codec clk slave & FRM master */
-#define SND_SOC_DAIFMT_CBM_CFS         (2 << 12) /* codec clk master & frame slave */
-#define SND_SOC_DAIFMT_CBS_CFS         (3 << 12) /* codec clk & FRM slave */
+#define SND_SOC_DAIFMT_CBM_CFM         (1 << 12) /* codec clk & FRM master */
+#define SND_SOC_DAIFMT_CBS_CFM         (2 << 12) /* codec clk slave & FRM master */
+#define SND_SOC_DAIFMT_CBM_CFS         (3 << 12) /* codec clk master & frame slave */
+#define SND_SOC_DAIFMT_CBS_CFS         (4 << 12) /* codec clk & FRM slave */
 
 #define SND_SOC_DAIFMT_FORMAT_MASK     0x000f
 #define SND_SOC_DAIFMT_CLOCK_MASK      0x00f0
@@ -93,14 +95,6 @@ struct snd_soc_dai_driver;
 struct snd_soc_dai;
 struct snd_ac97_bus_ops;
 
-/* Digital Audio Interface registration */
-int snd_soc_register_dai(struct device *dev,
-               struct snd_soc_dai_driver *dai_drv);
-void snd_soc_unregister_dai(struct device *dev);
-int snd_soc_register_dais(struct device *dev,
-               struct snd_soc_dai_driver *dai_drv, size_t count);
-void snd_soc_unregister_dais(struct device *dev, size_t count);
-
 /* Digital Audio Interface clocking API.*/
 int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id,
        unsigned int freq, int dir);
@@ -124,7 +118,8 @@ int snd_soc_dai_set_channel_map(struct snd_soc_dai *dai,
 int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate);
 
 /* Digital Audio Interface mute */
-int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute);
+int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute,
+                            int direction);
 
 struct snd_soc_dai_ops {
        /*
@@ -155,6 +150,7 @@ struct snd_soc_dai_ops {
         * Called by soc-core to minimise any pops.
         */
        int (*digital_mute)(struct snd_soc_dai *dai, int mute);
+       int (*mute_stream)(struct snd_soc_dai *dai, int mute, int stream);
 
        /*
         * ALSA PCM audio operations - all optional.
@@ -172,6 +168,8 @@ struct snd_soc_dai_ops {
                struct snd_soc_dai *);
        int (*trigger)(struct snd_pcm_substream *, int,
                struct snd_soc_dai *);
+       int (*bespoke_trigger)(struct snd_pcm_substream *, int,
+               struct snd_soc_dai *);
        /*
         * For hardware based FIFO caused delay reporting.
         * Optional.
@@ -195,12 +193,15 @@ struct snd_soc_dai_driver {
        const char *name;
        unsigned int id;
        int ac97_control;
+       unsigned int base;
 
        /* DAI driver callbacks */
        int (*probe)(struct snd_soc_dai *dai);
        int (*remove)(struct snd_soc_dai *dai);
        int (*suspend)(struct snd_soc_dai *dai);
        int (*resume)(struct snd_soc_dai *dai);
+       /* compress dai */
+       bool compress_dai;
 
        /* ops */
        const struct snd_soc_dai_ops *ops;
@@ -209,6 +210,10 @@ struct snd_soc_dai_driver {
        struct snd_soc_pcm_stream capture;
        struct snd_soc_pcm_stream playback;
        unsigned int symmetric_rates:1;
+
+       /* probe ordering - for components with runtime dependencies */
+       int probe_order;
+       int remove_order;
 };
 
 /*
@@ -231,18 +236,23 @@ struct snd_soc_dai {
        unsigned int symmetric_rates:1;
        struct snd_pcm_runtime *runtime;
        unsigned int active;
-       unsigned char pop_wait:1;
        unsigned char probed:1;
 
+       struct snd_soc_dapm_widget *playback_widget;
+       struct snd_soc_dapm_widget *capture_widget;
+       struct snd_soc_dapm_context dapm;
+
        /* DAI DMA data */
        void *playback_dma_data;
        void *capture_dma_data;
 
+       /* Symmetry data - only valid if symmetry is being enforced */
+       unsigned int rate;
+
        /* parent platform/codec */
-       union {
-               struct snd_soc_platform *platform;
-               struct snd_soc_codec *codec;
-       };
+       struct snd_soc_platform *platform;
+       struct snd_soc_codec *codec;
+
        struct snd_soc_card *card;
 
        struct list_head list;