OSDN Git Service

Merge remote-tracking branch 'asoc/topic/dapm' into asoc-next
authorMark Brown <broonie@kernel.org>
Mon, 6 Oct 2014 11:48:52 +0000 (12:48 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 6 Oct 2014 11:48:52 +0000 (12:48 +0100)
1  2 
include/sound/soc-dapm.h
sound/soc/soc-dapm.c

diff --combined include/sound/soc-dapm.h
@@@ -432,6 -432,7 +432,7 @@@ int snd_soc_dapm_force_enable_pin_unloc
  int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm,
                                const char *pin);
  void snd_soc_dapm_auto_nc_pins(struct snd_soc_card *card);
+ unsigned int dapm_kcontrol_get_value(const struct snd_kcontrol *kcontrol);
  
  /* Mostly internal - should not normally be used */
  void dapm_mark_io_dirty(struct snd_soc_dapm_context *dapm);
@@@ -593,6 -594,7 +594,6 @@@ struct snd_soc_dapm_context 
  
        struct device *dev; /* from parent - for debug */
        struct snd_soc_component *component; /* parent component */
 -      struct snd_soc_codec *codec; /* parent codec */
        struct snd_soc_card *card; /* parent card */
  
        /* used during DAPM updates */
diff --combined sound/soc/soc-dapm.c
@@@ -326,12 -326,13 +326,13 @@@ static struct list_head *dapm_kcontrol_
        list_for_each_entry(path, dapm_kcontrol_get_path_list(kcontrol), \
                list_kcontrol)
  
static unsigned int dapm_kcontrol_get_value(const struct snd_kcontrol *kcontrol)
+ unsigned int dapm_kcontrol_get_value(const struct snd_kcontrol *kcontrol)
  {
        struct dapm_kcontrol_data *data = snd_kcontrol_chip(kcontrol);
  
        return data->value;
  }
+ EXPORT_SYMBOL_GPL(dapm_kcontrol_get_value);
  
  static bool dapm_kcontrol_set_value(const struct snd_kcontrol *kcontrol,
        unsigned int value)
@@@ -2860,14 -2861,12 +2861,14 @@@ int snd_soc_dapm_get_enum_double(struc
        struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol);
        struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
        unsigned int reg_val, val;
 -      int ret = 0;
  
 -      if (e->reg != SND_SOC_NOPM)
 -              ret = soc_dapm_read(dapm, e->reg, &reg_val);
 -      else
 +      if (e->reg != SND_SOC_NOPM) {
 +              int ret = soc_dapm_read(dapm, e->reg, &reg_val);
 +              if (ret)
 +                      return ret;
 +      } else {
                reg_val = dapm_kcontrol_get_value(kcontrol);
 +      }
  
        val = (reg_val >> e->shift_l) & e->mask;
        ucontrol->value.enumerated.item[0] = snd_soc_enum_val_to_item(e, val);
                ucontrol->value.enumerated.item[1] = val;
        }
  
 -      return ret;
 +      return 0;
  }
  EXPORT_SYMBOL_GPL(snd_soc_dapm_get_enum_double);
  
@@@ -3109,8 -3108,7 +3110,8 @@@ snd_soc_dapm_new_control(struct snd_soc
        }
  
        w->dapm = dapm;
 -      w->codec = dapm->codec;
 +      if (dapm->component)
 +              w->codec = dapm->component->codec;
        INIT_LIST_HEAD(&w->sources);
        INIT_LIST_HEAD(&w->sinks);
        INIT_LIST_HEAD(&w->list);