]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ALSA: hda - Fix mono amp values in proc output
authorTakashi Iwai <tiwai@suse.de>
Mon, 10 Dec 2012 14:58:34 +0000 (15:58 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 10 Jan 2013 09:34:27 +0000 (10:34 +0100)
The mono widget is always connected to the left channel, thus the left
channel amp value also should be referred for mono widgets instead of
the right channel.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_proc.c

index 045e5d32f5ded3d2e5b54f3f344e99a29ab09aac..740f46ac98db7fcf88508a4e72a4ac23501edd20 100644 (file)
@@ -138,16 +138,17 @@ static void print_amp_vals(struct snd_info_buffer *buffer,
        dir = dir == HDA_OUTPUT ? AC_AMP_GET_OUTPUT : AC_AMP_GET_INPUT;
        for (i = 0; i < indices; i++) {
                snd_iprintf(buffer, " [");
+               val = snd_hda_codec_read(codec, nid, 0,
+                                        AC_VERB_GET_AMP_GAIN_MUTE,
+                                        AC_AMP_GET_LEFT | dir | i);
+               snd_iprintf(buffer, "0x%02x", val);
                if (stereo) {
                        val = snd_hda_codec_read(codec, nid, 0,
                                                 AC_VERB_GET_AMP_GAIN_MUTE,
-                                                AC_AMP_GET_LEFT | dir | i);
-                       snd_iprintf(buffer, "0x%02x ", val);
+                                                AC_AMP_GET_RIGHT | dir | i);
+                       snd_iprintf(buffer, " 0x%02x", val);
                }
-               val = snd_hda_codec_read(codec, nid, 0,
-                                        AC_VERB_GET_AMP_GAIN_MUTE,
-                                        AC_AMP_GET_RIGHT | dir | i);
-               snd_iprintf(buffer, "0x%02x]", val);
+               snd_iprintf(buffer, "]");
        }
        snd_iprintf(buffer, "\n");
 }