Messages in this thread | | | Date | Mon, 17 Feb 2014 18:06:03 +0100 | From | Lars-Peter Clausen <> | Subject | Re: [PATCH 02/15] ASoC: dapm: Add locked version of snd_soc_dapm_xxxx_pin functions |
| |
[...] > +int snd_soc_dapm_enable_pin_locked(struct snd_soc_dapm_context *dapm, > + const char *pin) > +{ > + return snd_soc_dapm_set_pin(dapm, pin, 1); > +} > +EXPORT_SYMBOL_GPL(snd_soc_dapm_enable_pin_locked); > + > +/** > * snd_soc_dapm_enable_pin - enable pin. > * @dapm: DAPM context > * @pin: pin name > * > * Enables input/output pin and its parents or children widgets iff there is > * a valid audio route and active audio stream. > + * > * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to > * do any widget power switching. > */ > int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, const char *pin) > { > - return snd_soc_dapm_set_pin(dapm, pin, 1); > + int ret; > + > + mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); > + > + ret = snd_soc_dapm_set_pin(dapm, pin, 1); > + > + mutex_unlock(&dapm->card->dapm_mutex); > + > + return ret; > }
Hm, this is a bit confusing. For other functions in ASoC when we have a pair of functions with the _locked suffix and without the one with _locked takes the lock, the other one doesn't. E.g. snd_soc_update_bits_locked. Here we do it the other way around.
- Lars
| |