ALSA: ASoC: Export dapm_reg_event() fully
[safe/jmp/linux-2.6] / include / sound / soc.h
index 1f5c621..1890d87 100644 (file)
@@ -221,8 +221,7 @@ struct snd_soc_pcm_stream;
 struct snd_soc_ops;
 struct snd_soc_dai_mode;
 struct snd_soc_pcm_runtime;
-struct snd_soc_codec_dai;
-struct snd_soc_cpu_dai;
+struct snd_soc_dai;
 struct snd_soc_codec;
 struct snd_soc_machine_config;
 struct soc_enum;
@@ -257,6 +256,27 @@ int snd_soc_new_ac97_codec(struct snd_soc_codec *codec,
        struct snd_ac97_bus_ops *ops, int num);
 void snd_soc_free_ac97_codec(struct snd_soc_codec *codec);
 
+/* Digital Audio Interface clocking API.*/
+int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id,
+       unsigned int freq, int dir);
+
+int snd_soc_dai_set_clkdiv(struct snd_soc_dai *dai,
+       int div_id, int div);
+
+int snd_soc_dai_set_pll(struct snd_soc_dai *dai,
+       int pll_id, unsigned int freq_in, unsigned int freq_out);
+
+/* Digital Audio interface formatting */
+int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt);
+
+int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai,
+       unsigned int mask, int slots);
+
+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);
+
 /*
  *Controls
  */
@@ -317,50 +337,24 @@ struct snd_soc_ops {
 /* ASoC DAI ops */
 struct snd_soc_dai_ops {
        /* DAI clocking configuration */
-       int (*set_sysclk)(struct snd_soc_codec_dai *codec_dai,
+       int (*set_sysclk)(struct snd_soc_dai *dai,
                int clk_id, unsigned int freq, int dir);
-       int (*set_pll)(struct snd_soc_codec_dai *codec_dai,
+       int (*set_pll)(struct snd_soc_dai *dai,
                int pll_id, unsigned int freq_in, unsigned int freq_out);
-       int (*set_clkdiv)(struct snd_soc_codec_dai *codec_dai,
-               int div_id, int div);
+       int (*set_clkdiv)(struct snd_soc_dai *dai, int div_id, int div);
 
        /* DAI format configuration */
-       int (*set_fmt)(struct snd_soc_codec_dai *codec_dai,
-               unsigned int fmt);
-       int (*set_tdm_slot)(struct snd_soc_codec_dai *codec_dai,
+       int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt);
+       int (*set_tdm_slot)(struct snd_soc_dai *dai,
                unsigned int mask, int slots);
-       int (*set_tristate)(struct snd_soc_codec_dai *, int tristate);
+       int (*set_tristate)(struct snd_soc_dai *dai, int tristate);
 
        /* digital mute */
-       int (*digital_mute)(struct snd_soc_codec_dai *, int mute);
+       int (*digital_mute)(struct snd_soc_dai *dai, int mute);
 };
 
-/* SoC Codec DAI */
-struct snd_soc_codec_dai {
-       char *name;
-       int id;
-       unsigned char type;
-
-       /* DAI capabilities */
-       struct snd_soc_pcm_stream playback;
-       struct snd_soc_pcm_stream capture;
-
-       /* DAI runtime info */
-       struct snd_soc_codec *codec;
-       unsigned int active;
-       unsigned char pop_wait:1;
-
-       /* ops */
-       struct snd_soc_ops ops;
-       struct snd_soc_dai_ops dai_ops;
-
-       /* DAI private data */
-       void *private_data;
-};
-
-/* SoC CPU DAI */
-struct snd_soc_cpu_dai {
-
+/* SoC  DAI (Digital Audio Interface) */
+struct snd_soc_dai {
        /* DAI description */
        char *name;
        unsigned int id;
@@ -368,13 +362,13 @@ struct snd_soc_cpu_dai {
 
        /* DAI callbacks */
        int (*probe)(struct platform_device *pdev,
-                    struct snd_soc_cpu_dai *dai);
+                    struct snd_soc_dai *dai);
        void (*remove)(struct platform_device *pdev,
-                      struct snd_soc_cpu_dai *dai);
+                      struct snd_soc_dai *dai);
        int (*suspend)(struct platform_device *pdev,
-               struct snd_soc_cpu_dai *cpu_dai);
+               struct snd_soc_dai *dai);
        int (*resume)(struct platform_device *pdev,
-               struct snd_soc_cpu_dai *cpu_dai);
+               struct snd_soc_dai *dai);
 
        /* ops */
        struct snd_soc_ops ops;
@@ -386,7 +380,9 @@ struct snd_soc_cpu_dai {
 
        /* DAI runtime info */
        struct snd_pcm_runtime *runtime;
-       unsigned char active:1;
+       struct snd_soc_codec *codec;
+       unsigned int active;
+       unsigned char pop_wait:1;
        void *dma_data;
 
        /* DAI private data */
@@ -428,7 +424,7 @@ struct snd_soc_codec {
        struct delayed_work delayed_work;
 
        /* codec DAI's */
-       struct snd_soc_codec_dai *dai;
+       struct snd_soc_dai *dai;
        unsigned int num_dai;
 };
 
@@ -447,12 +443,12 @@ struct snd_soc_platform {
        int (*probe)(struct platform_device *pdev);
        int (*remove)(struct platform_device *pdev);
        int (*suspend)(struct platform_device *pdev,
-               struct snd_soc_cpu_dai *cpu_dai);
+               struct snd_soc_dai *dai);
        int (*resume)(struct platform_device *pdev,
-               struct snd_soc_cpu_dai *cpu_dai);
+               struct snd_soc_dai *dai);
 
        /* pcm creation and destruction */
-       int (*pcm_new)(struct snd_card *, struct snd_soc_codec_dai *,
+       int (*pcm_new)(struct snd_card *, struct snd_soc_dai *,
                struct snd_pcm *);
        void (*pcm_free)(struct snd_pcm *);
 
@@ -466,8 +462,8 @@ struct snd_soc_dai_link  {
        char *stream_name;              /* Stream name */
 
        /* DAI */
-       struct snd_soc_codec_dai *codec_dai;
-       struct snd_soc_cpu_dai *cpu_dai;
+       struct snd_soc_dai *codec_dai;
+       struct snd_soc_dai *cpu_dai;
 
        /* machine stream operations */
        struct snd_soc_ops *ops;
@@ -510,6 +506,7 @@ struct snd_soc_device {
        struct snd_soc_codec *codec;
        struct snd_soc_codec_device *codec_dev;
        struct delayed_work delayed_work;
+       struct work_struct deferred_resume_work;
        void *codec_data;
 };