4 Sep
2014
4 Sep
'14
5:53 a.m.
Hi Charles and Lars-Peter : Thanks for your feedback. I will split into two patch (Modify De-emphasis and Using SOC_ENUM_SINGLE_DECL macro to replace SOC_ENUM_SINGLE macro) and use local mutex to replace the snd_soc_codec mutex.
Thanks.
BR, Xavier
2014-09-02 22:56 GMT+08:00 Lars-Peter Clausen lars@metafoo.de:
On 09/02/2014 05:27 AM, Xavier Hsu wrote: [...]
+static int wm8971_put_deemph(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)+{
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);struct wm8971_priv *wm8971 = snd_soc_codec_get_drvdata(codec);int deemph = ucontrol->value.enumerated.item[0];int ret = 0;if (deemph > 1)return -EINVAL;mutex_lock(&codec->mutex);Please use a driver local mutex. The snd_soc_codec mutex is going to be removed sooner or later and we shouldn't add new users.
if (wm8971->deemph != deemph) {
wm8971->deemph = deemph;wm8971_set_deemph(codec);ret = 1;}mutex_unlock(&codec->mutex);return ret;+}