summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-04-17 18:04:41 +0200
committerTakashi Iwai <tiwai@suse.de>2009-04-17 18:04:41 +0200
commit93e82ae781e1ca4797cf2a226d3c303975bd99c7 (patch)
treeaff94e83114b5644b0b0abfe1c3880c4fa59b4a7
parent4dc1f87f079d5c6b01284d08b28eff2c4fbd15c4 (diff)
downloadlinux-93e82ae781e1ca4797cf2a226d3c303975bd99c7.tar.bz2
ALSA: hda - Set function_id only on FG nodes
(Re)set function_id only from the value on FG nodes. The current code overrides the value with the last widget. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/hda_codec.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index fd6e6f337d10..8820faf6c9d8 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -642,19 +642,21 @@ static int get_codec_name(struct hda_codec *codec)
*/
static void /*__devinit*/ setup_fg_nodes(struct hda_codec *codec)
{
- int i, total_nodes;
+ int i, total_nodes, function_id;
hda_nid_t nid;
total_nodes = snd_hda_get_sub_nodes(codec, AC_NODE_ROOT, &nid);
for (i = 0; i < total_nodes; i++, nid++) {
- codec->function_id = snd_hda_param_read(codec, nid,
+ function_id = snd_hda_param_read(codec, nid,
AC_PAR_FUNCTION_TYPE) & 0xff;
- switch (codec->function_id) {
+ switch (function_id) {
case AC_GRP_AUDIO_FUNCTION:
codec->afg = nid;
+ codec->function_id = function_id;
break;
case AC_GRP_MODEM_FUNCTION:
codec->mfg = nid;
+ codec->function_id = function_id;
break;
default:
break;