[ALSA] hda-codec - Make the mixer capability check more robust
authorTakashi Iwai <tiwai@suse.de>
Thu, 10 May 2007 14:56:09 +0000 (16:56 +0200)
committerJaroslav Kysela <perex@suse.cz>
Wed, 16 May 2007 09:45:28 +0000 (11:45 +0200)
In some cases, mixer elements return -EINVAL because it couldn't
obtain proper amp_cap bits.  The patch improves the robustness,
trying the amp_cap query again in such a case.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
sound/pci/hda/hda_codec.c

index 14649d54b49342bc55b5636fd63c75c1a522a585..8e89d56b6400d2721a6d68e505aa11358c47113e 100644 (file)
@@ -707,7 +707,8 @@ static u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction)
                                                    direction == HDA_OUTPUT ?
                                                    AC_PAR_AMP_OUT_CAP :
                                                    AC_PAR_AMP_IN_CAP);
-               info->status |= INFO_AMP_CAPS;
+               if (info->amp_caps)
+                       info->status |= INFO_AMP_CAPS;
        }
        return info->amp_caps;
 }