Merge remote-tracking branch 'asoc/topic/devm' into asoc-next
authorMark Brown <broonie@linaro.org>
Fri, 8 Nov 2013 10:43:27 +0000 (10:43 +0000)
committerMark Brown <broonie@linaro.org>
Fri, 8 Nov 2013 10:43:27 +0000 (10:43 +0000)
1  2 
include/sound/soc.h

diff --combined include/sound/soc.h
@@@ -13,7 -13,6 +13,7 @@@
  #ifndef __LINUX_SND_SOC_H
  #define __LINUX_SND_SOC_H
  
 +#include <linux/of.h>
  #include <linux/platform_device.h>
  #include <linux/types.h>
  #include <linux/notifier.h>
@@@ -331,6 -330,7 +331,6 @@@ struct soc_enum
  struct snd_soc_jack;
  struct snd_soc_jack_zone;
  struct snd_soc_jack_pin;
 -struct snd_soc_cache_ops;
  #include <sound/soc-dapm.h>
  #include <sound/soc-dpcm.h>
  
@@@ -348,6 -348,10 +348,6 @@@ enum snd_soc_control_type 
        SND_SOC_REGMAP,
  };
  
 -enum snd_soc_compress_type {
 -      SND_SOC_FLAT_COMPRESSION = 1,
 -};
 -
  enum snd_soc_pcm_subclass {
        SND_SOC_PCM_CLASS_PCM   = 0,
        SND_SOC_PCM_CLASS_BE    = 1,
@@@ -365,6 -369,7 +365,7 @@@ int snd_soc_codec_set_pll(struct snd_so
  
  int snd_soc_register_card(struct snd_soc_card *card);
  int snd_soc_unregister_card(struct snd_soc_card *card);
+ int devm_snd_soc_register_card(struct device *dev, struct snd_soc_card *card);
  int snd_soc_suspend(struct device *dev);
  int snd_soc_resume(struct device *dev);
  int snd_soc_poweroff(struct device *dev);
@@@ -382,6 -387,9 +383,9 @@@ void snd_soc_unregister_codec(struct de
  int snd_soc_register_component(struct device *dev,
                         const struct snd_soc_component_driver *cmpnt_drv,
                         struct snd_soc_dai_driver *dai_drv, int num_dai);
+ int devm_snd_soc_register_component(struct device *dev,
+                        const struct snd_soc_component_driver *cmpnt_drv,
+                        struct snd_soc_dai_driver *dai_drv, int num_dai);
  void snd_soc_unregister_component(struct device *dev);
  int snd_soc_codec_volatile_register(struct snd_soc_codec *codec,
                                    unsigned int reg);
@@@ -399,6 -407,12 +403,6 @@@ int snd_soc_cache_write(struct snd_soc_
                        unsigned int reg, unsigned int value);
  int snd_soc_cache_read(struct snd_soc_codec *codec,
                       unsigned int reg, unsigned int *value);
 -int snd_soc_default_volatile_register(struct snd_soc_codec *codec,
 -                                    unsigned int reg);
 -int snd_soc_default_readable_register(struct snd_soc_codec *codec,
 -                                    unsigned int reg);
 -int snd_soc_default_writable_register(struct snd_soc_codec *codec,
 -                                    unsigned int reg);
  int snd_soc_platform_read(struct snd_soc_platform *platform,
                                        unsigned int reg);
  int snd_soc_platform_write(struct snd_soc_platform *platform,
@@@ -531,6 -545,22 +535,6 @@@ int snd_soc_get_strobe(struct snd_kcont
  int snd_soc_put_strobe(struct snd_kcontrol *kcontrol,
        struct snd_ctl_elem_value *ucontrol);
  
 -/**
 - * struct snd_soc_reg_access - Describes whether a given register is
 - * readable, writable or volatile.
 - *
 - * @reg: the register number
 - * @read: whether this register is readable
 - * @write: whether this register is writable
 - * @vol: whether this register is volatile
 - */
 -struct snd_soc_reg_access {
 -      u16 reg;
 -      u16 read;
 -      u16 write;
 -      u16 vol;
 -};
 -
  /**
   * struct snd_soc_jack_pin - Describes a pin to update based on jack detection
   *
@@@ -631,26 -661,17 +635,26 @@@ struct snd_soc_compr_ops 
        int (*trigger)(struct snd_compr_stream *);
  };
  
 -/* SoC cache ops */
 -struct snd_soc_cache_ops {
 +/* component interface */
 +struct snd_soc_component_driver {
        const char *name;
 -      enum snd_soc_compress_type id;
 -      int (*init)(struct snd_soc_codec *codec);
 -      int (*exit)(struct snd_soc_codec *codec);
 -      int (*read)(struct snd_soc_codec *codec, unsigned int reg,
 -              unsigned int *value);
 -      int (*write)(struct snd_soc_codec *codec, unsigned int reg,
 -              unsigned int value);
 -      int (*sync)(struct snd_soc_codec *codec);
 +
 +      /* DT */
 +      int (*of_xlate_dai_name)(struct snd_soc_component *component,
 +                               struct of_phandle_args *args,
 +                               const char **dai_name);
 +};
 +
 +struct snd_soc_component {
 +      const char *name;
 +      int id;
 +      struct device *dev;
 +      struct list_head list;
 +
 +      struct snd_soc_dai_driver *dai_drv;
 +      int num_dai;
 +
 +      const struct snd_soc_component_driver *driver;
  };
  
  /* SoC Audio Codec device */
@@@ -666,6 -687,8 +670,6 @@@ struct snd_soc_codec 
        struct list_head list;
        struct list_head card_list;
        int num_dai;
 -      enum snd_soc_compress_type compress_type;
 -      size_t reg_size;        /* reg_cache_size * reg_word_size */
        int (*volatile_register)(struct snd_soc_codec *, unsigned int);
        int (*readable_register)(struct snd_soc_codec *, unsigned int);
        int (*writable_register)(struct snd_soc_codec *, unsigned int);
        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);
 -      int (*bulk_write_raw)(struct snd_soc_codec *, unsigned int, const void *, size_t);
        void *reg_cache;
 -      const void *reg_def_copy;
 -      const struct snd_soc_cache_ops *cache_ops;
        struct mutex cache_rw_mutex;
        int val_bytes;
  
 +      /* component */
 +      struct snd_soc_component component;
 +
        /* dapm */
        struct snd_soc_dapm_context dapm;
        unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */
@@@ -714,7 -737,6 +718,7 @@@ struct snd_soc_codec_driver 
        int (*remove)(struct snd_soc_codec *);
        int (*suspend)(struct snd_soc_codec *);
        int (*resume)(struct snd_soc_codec *);
 +      struct snd_soc_component_driver component_driver;
  
        /* Default control and setup, added after probe() is run */
        const struct snd_kcontrol_new *controls;
        short reg_cache_step;
        short reg_word_size;
        const void *reg_cache_default;
 -      short reg_access_size;
 -      const struct snd_soc_reg_access *reg_access_default;
 -      enum snd_soc_compress_type compress_type;
  
        /* codec bias level */
        int (*set_bias_level)(struct snd_soc_codec *,
@@@ -828,6 -853,20 +832,6 @@@ struct snd_soc_platform 
  #endif
  };
  
 -struct snd_soc_component_driver {
 -      const char *name;
 -};
 -
 -struct snd_soc_component {
 -      const char *name;
 -      int id;
 -      int num_dai;
 -      struct device *dev;
 -      struct list_head list;
 -
 -      const struct snd_soc_component_driver *driver;
 -};
 -
  struct snd_soc_dai_link {
        /* config - must be set by machine driver */
        const char *name;                       /* Codec name */
@@@ -909,6 -948,12 +913,6 @@@ struct snd_soc_codec_conf 
         * associated per device
         */
        const char *name_prefix;
 -
 -      /*
 -       * set this to the desired compression type if you want to
 -       * override the one supplied in codec->driver->compress_type
 -       */
 -      enum snd_soc_compress_type compress_type;
  };
  
  struct snd_soc_aux_dev {
@@@ -1080,6 -1125,8 +1084,6 @@@ struct soc_enum 
  unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg);
  unsigned int snd_soc_write(struct snd_soc_codec *codec,
                           unsigned int reg, unsigned int val);
 -unsigned int snd_soc_bulk_write_raw(struct snd_soc_codec *codec,
 -                                  unsigned int reg, const void *data, size_t len);
  
  /* device driver data */
  
@@@ -1158,8 -1205,6 +1162,8 @@@ int snd_soc_of_parse_audio_routing(stru
                                   const char *propname);
  unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
                                     const char *prefix);
 +int snd_soc_of_get_dai_name(struct device_node *of_node,
 +                          const char **dai_name);
  
  #include <sound/soc-dai.h>