]> Pileus Git - ~andy/linux/blobdiff - include/sound/soc.h
ASoC: Move active copy of CODEC read and write into runtime structure
[~andy/linux] / include / sound / soc.h
index af23f4228869c694e5a126e348cb817fd1478e3b..714a70441bf2a5230929ffe4500413c7ea5b0844 100644 (file)
@@ -256,7 +256,7 @@ enum snd_soc_control_type {
 };
 
 enum snd_soc_compress_type {
-       SND_SOC_NO_COMPRESSION,
+       SND_SOC_FLAT_COMPRESSION,
        SND_SOC_LZO_COMPRESSION,
        SND_SOC_RBTREE_COMPRESSION
 };
@@ -450,6 +450,7 @@ struct snd_soc_cache_ops {
 /* SoC Audio Codec device */
 struct snd_soc_codec {
        const char *name;
+       const char *name_prefix;
        int id;
        struct device *dev;
        struct snd_soc_codec_driver *driver;
@@ -475,6 +476,8 @@ struct snd_soc_codec {
        void *control_data; /* codec control (i2c/3wire) data */
        hw_write_t hw_write;
        unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int);
+       unsigned int (*read)(struct snd_soc_codec *, unsigned int);
+       int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
        void *reg_cache;
        const struct snd_soc_cache_ops *cache_ops;
        struct mutex cache_rw_mutex;
@@ -577,6 +580,19 @@ struct snd_soc_dai_link {
        struct snd_soc_ops *ops;
 };
 
+struct snd_soc_prefix_map {
+       const char *dev_name;
+       const char *name_prefix;
+};
+
+struct snd_soc_aux_dev {
+       const char *name;               /* Codec name */
+       const char *codec_name;         /* for multi-codec */
+
+       /* codec/machine specific init - e.g. add machine controls */
+       int (*init)(struct snd_soc_dapm_context *dapm);
+};
+
 /* SoC card */
 struct snd_soc_card {
        const char *name;
@@ -611,6 +627,22 @@ struct snd_soc_card {
        struct snd_soc_pcm_runtime *rtd;
        int num_rtd;
 
+       /*
+        * optional map of kcontrol, widget and path name prefixes that are
+        * associated per device
+        */
+       struct snd_soc_prefix_map *prefix_map;
+       int num_prefixes;
+
+       /*
+        * optional auxiliary devices such as amplifiers or codecs with DAI
+        * link unused
+        */
+       struct snd_soc_aux_dev *aux_dev;
+       int num_aux_devs;
+       struct snd_soc_pcm_runtime *rtd_aux;
+       int num_aux_rtd;
+
        struct work_struct deferred_resume_work;
 
        /* lists of probed devices belonging to this card */