Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions sound/soc/codecs/rt711.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,8 @@ static int rt711_set_amp_gain_put(struct snd_kcontrol *kcontrol,
unsigned int read_ll, read_rl;
int i;

mutex_lock(&rt711->calibrate_mutex);

/* Can't use update bit function, so read the original value first */
addr_h = mc->reg;
addr_l = mc->rreg;
Expand Down Expand Up @@ -547,6 +549,8 @@ static int rt711_set_amp_gain_put(struct snd_kcontrol *kcontrol,
if (dapm->bias_level <= SND_SOC_BIAS_STANDBY)
regmap_write(rt711->regmap,
RT711_SET_AUDIO_POWER_STATE, AC_PWRST_D3);

mutex_unlock(&rt711->calibrate_mutex);
return 0;
}

Expand Down Expand Up @@ -859,9 +863,11 @@ static int rt711_set_bias_level(struct snd_soc_component *component,
break;

case SND_SOC_BIAS_STANDBY:
mutex_lock(&rt711->calibrate_mutex);
regmap_write(rt711->regmap,
RT711_SET_AUDIO_POWER_STATE,
AC_PWRST_D3);
mutex_unlock(&rt711->calibrate_mutex);
break;

default:
Expand Down