ALSA: hda - Add function id to proc output
authorPascal de Bruijn <pascal@unilogicnetworks.net>
Mon, 23 Mar 2009 10:15:59 +0000 (11:15 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 23 Mar 2009 10:55:36 +0000 (11:55 +0100)
This patch does two things:
 Output Intel HDA Function Id in /proc/asound/cardX/codec#X
 Align Vendor/Subsystem/Revision Ids to 8 characters, front-padded with zeros

Before:
 Vendor Id: 0x11d41884
 Subsystem Id: 0x103c281a
 Revision Id: 0x100100

After:
 Function Id: 0x1
 Vendor Id: 0x11d41884
 Subsystem Id: 0x103c281a
 Revision Id: 0x0100100

As report on the Kernel Bugzilla #12888

Signed-off-by: Pascal de Bruijn <pascal@unilogicnetworks.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_codec.h
sound/pci/hda/hda_proc.c

index b90a2400f53dfe61b4ecabfabb7b40e4e941ec0f..1b5575ecb0a4d3bb9416b07f8cca42b0d8af88bc 100644 (file)
@@ -647,9 +647,9 @@ static void /*__devinit*/ setup_fg_nodes(struct hda_codec *codec)
 
        total_nodes = snd_hda_get_sub_nodes(codec, AC_NODE_ROOT, &nid);
        for (i = 0; i < total_nodes; i++, nid++) {
-               unsigned int func;
-               func = snd_hda_param_read(codec, nid, AC_PAR_FUNCTION_TYPE);
-               switch (func & 0xff) {
+               codec->function_id = snd_hda_param_read(codec, nid,
+                                               AC_PAR_FUNCTION_TYPE) & 0xff;
+               switch (codec->function_id) {
                case AC_GRP_AUDIO_FUNCTION:
                        codec->afg = nid;
                        break;
index 079e1ab718d40554cd31619f6223fc03d097173f..2fdecf4b0eb631b89ef15f47ef1f37c3ac2e13ed 100644 (file)
@@ -739,6 +739,7 @@ struct hda_codec {
        hda_nid_t mfg;  /* MFG node id */
 
        /* ids */
+       u32 function_id;
        u32 vendor_id;
        u32 subsystem_id;
        u32 revision_id;
index 639cf0edaa98c64f7a27489d97d58efdf2035d75..93d7499350c6609f3e4a5a9af6396bf0ac6c8447 100644 (file)
@@ -469,8 +469,9 @@ static void print_codec_info(struct snd_info_entry *entry,
        snd_iprintf(buffer, "Codec: %s\n",
                    codec->name ? codec->name : "Not Set");
        snd_iprintf(buffer, "Address: %d\n", codec->addr);
-       snd_iprintf(buffer, "Vendor Id: 0x%x\n", codec->vendor_id);
-       snd_iprintf(buffer, "Subsystem Id: 0x%x\n", codec->subsystem_id);
+       snd_iprintf(buffer, "Function Id: 0x%x\n", codec->function_id);
+       snd_iprintf(buffer, "Vendor Id: 0x%08x\n", codec->vendor_id);
+       snd_iprintf(buffer, "Subsystem Id: 0x%08x\n", codec->subsystem_id);
        snd_iprintf(buffer, "Revision Id: 0x%x\n", codec->revision_id);
 
        if (codec->mfg)