Commit 79c944ad authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA: hda-intel - do not mix audio and modem function IDs

The function IDs are different for audio and modem. Do not mix them.
Also, show the unsolicited bit in the function_id register.
Signed-off-by: default avatarJaroslav Kysela <perex@perex.cz>
parent 08b45098
...@@ -730,15 +730,17 @@ static void /*__devinit*/ setup_fg_nodes(struct hda_codec *codec) ...@@ -730,15 +730,17 @@ static void /*__devinit*/ setup_fg_nodes(struct hda_codec *codec)
total_nodes = snd_hda_get_sub_nodes(codec, AC_NODE_ROOT, &nid); total_nodes = snd_hda_get_sub_nodes(codec, AC_NODE_ROOT, &nid);
for (i = 0; i < total_nodes; i++, nid++) { for (i = 0; i < total_nodes; i++, nid++) {
function_id = snd_hda_param_read(codec, nid, function_id = snd_hda_param_read(codec, nid,
AC_PAR_FUNCTION_TYPE) & 0xff; AC_PAR_FUNCTION_TYPE);
switch (function_id) { switch (function_id) {
case AC_GRP_AUDIO_FUNCTION: case AC_GRP_AUDIO_FUNCTION:
codec->afg = nid; codec->afg = nid;
codec->function_id = function_id; codec->afg_function_id = function_id & 0xff;
codec->afg_unsol = (function_id >> 8) & 1;
break; break;
case AC_GRP_MODEM_FUNCTION: case AC_GRP_MODEM_FUNCTION:
codec->mfg = nid; codec->mfg = nid;
codec->function_id = function_id; codec->mfg_function_id = function_id & 0xff;
codec->mfg_unsol = (function_id >> 8) & 1;
break; break;
default: default:
break; break;
......
...@@ -760,7 +760,10 @@ struct hda_codec { ...@@ -760,7 +760,10 @@ struct hda_codec {
hda_nid_t mfg; /* MFG node id */ hda_nid_t mfg; /* MFG node id */
/* ids */ /* ids */
u32 function_id; u8 afg_function_id;
u8 mfg_function_id;
u8 afg_unsol;
u8 mfg_unsol;
u32 vendor_id; u32 vendor_id;
u32 subsystem_id; u32 subsystem_id;
u32 revision_id; u32 revision_id;
......
...@@ -557,7 +557,12 @@ static void print_codec_info(struct snd_info_entry *entry, ...@@ -557,7 +557,12 @@ static void print_codec_info(struct snd_info_entry *entry,
else else
snd_iprintf(buffer, "Not Set\n"); snd_iprintf(buffer, "Not Set\n");
snd_iprintf(buffer, "Address: %d\n", codec->addr); snd_iprintf(buffer, "Address: %d\n", codec->addr);
snd_iprintf(buffer, "Function Id: 0x%x\n", codec->function_id); if (codec->afg)
snd_iprintf(buffer, "AFG Function Id: 0x%x (unsol %u)\n",
codec->afg_function_id, codec->afg_unsol);
if (codec->mfg)
snd_iprintf(buffer, "MFG Function Id: 0x%x (unsol %u)\n",
codec->mfg_function_id, codec->mfg_unsol);
snd_iprintf(buffer, "Vendor Id: 0x%08x\n", codec->vendor_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, "Subsystem Id: 0x%08x\n", codec->subsystem_id);
snd_iprintf(buffer, "Revision Id: 0x%x\n", codec->revision_id); snd_iprintf(buffer, "Revision Id: 0x%x\n", codec->revision_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment