ALSA: hda - VIA: Fix VT1708 can't build up Headphone control issue
authorLydia Wang <lydiawang@viatech.com.cn>
Tue, 22 Mar 2011 08:26:36 +0000 (16:26 +0800)
committerTakashi Iwai <tiwai@suse.de>
Tue, 22 Mar 2011 11:56:06 +0000 (12:56 +0100)
Since VT1708 didn't support the control of getting connection number,
building of headphone control will fail in via_hp_build() function.

Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_via.c

index 7e317f933a06002813c685e77ca14c46f9630d93..1371b57c11e823209336a3a2f86b6274e550a0b9 100644 (file)
@@ -1266,9 +1266,12 @@ static int via_hp_build(struct hda_codec *codec)
                break;
        }
 
-       nums = snd_hda_get_connections(codec, nid, conn, HDA_MAX_CONNECTIONS);
-       if (nums <= 1)
-               return 0;
+       if (spec->codec_type != VT1708) {
+               nums = snd_hda_get_connections(codec, nid,
+                                              conn, HDA_MAX_CONNECTIONS);
+               if (nums <= 1)
+                       return 0;
+       }
 
        knew = via_clone_control(spec, &via_hp_mixer[0]);
        if (knew == NULL)