ALSA: hda - Fix wrong dirty check in snd_hda_codec_resume_amp()
The dirty entry has to be checked at the beginning in the loop, not in the inner loop for channels. This caused a regression that the right channel isn't properly written. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
3bbcd274c2
commit
8565f052c5
@ -1969,6 +1969,9 @@ void snd_hda_codec_resume_amp(struct hda_codec *codec)
|
|||||||
unsigned int idx, dir, ch;
|
unsigned int idx, dir, ch;
|
||||||
|
|
||||||
buffer = snd_array_elem(&codec->amp_cache.buf, i);
|
buffer = snd_array_elem(&codec->amp_cache.buf, i);
|
||||||
|
if (!buffer->head.dirty)
|
||||||
|
continue;
|
||||||
|
buffer->head.dirty = 0;
|
||||||
key = buffer->head.key;
|
key = buffer->head.key;
|
||||||
if (!key)
|
if (!key)
|
||||||
continue;
|
continue;
|
||||||
@ -1978,9 +1981,6 @@ void snd_hda_codec_resume_amp(struct hda_codec *codec)
|
|||||||
for (ch = 0; ch < 2; ch++) {
|
for (ch = 0; ch < 2; ch++) {
|
||||||
if (!(buffer->head.val & INFO_AMP_VOL(ch)))
|
if (!(buffer->head.val & INFO_AMP_VOL(ch)))
|
||||||
continue;
|
continue;
|
||||||
if (!buffer->head.dirty)
|
|
||||||
continue;
|
|
||||||
buffer->head.dirty = 0;
|
|
||||||
mutex_unlock(&codec->hash_mutex);
|
mutex_unlock(&codec->hash_mutex);
|
||||||
put_vol_mute(codec, buffer, nid, ch, dir, idx,
|
put_vol_mute(codec, buffer, nid, ch, dir, idx,
|
||||||
buffer->vol[ch]);
|
buffer->vol[ch]);
|
||||||
|
Loading…
Reference in New Issue
Block a user