From: Takashi Iwai Date: Thu, 20 Dec 2012 10:33:20 +0000 (+0100) Subject: ALSA: hda - Flush dirty amp caches before writing inv_dmic fix X-Git-Tag: next-20130218~63^2~62^2~134 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c4f3ebed3c5bc59c88eb2ccda825a12686b58341;p=karo-tx-linux.git ALSA: hda - Flush dirty amp caches before writing inv_dmic fix The inverted dmic fix overwrites the right channel amp value, but it would work only when the amp values have been already actually written. Put snd_hda_codec_resume_amp() before the amp write for flushing caches. Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 896bc2cc9293..caf6fa5e6a70 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -633,6 +633,9 @@ static void alc_inv_dmic_sync_adc(struct hda_codec *codec, int adc_idx) parm = AC_AMP_SET_RIGHT | (dir == HDA_OUTPUT ? AC_AMP_SET_OUTPUT : AC_AMP_SET_INPUT); + /* flush all cached amps at first */ + snd_hda_codec_resume_amp(codec); + /* we care only right channel */ val = snd_hda_codec_amp_read(codec, nid, 1, dir, 0); if (val & 0x80) /* if already muted, we don't need to touch */