Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e171613949e350966f5cc8c9b0023a5f746f7a5d
Commit:     e171613949e350966f5cc8c9b0023a5f746f7a5d
Parent:     9b1fffddc80949fb4aa93fdcc57544bc2108ced3
Author:     Takashi Iwai <[EMAIL PROTECTED]>
AuthorDate: Fri Nov 16 17:52:39 2007 +0100
Committer:  Jaroslav Kysela <[EMAIL PROTECTED]>
CommitDate: Thu Jan 31 17:29:26 2008 +0100

    [ALSA] hda-intel - Show more volume-knob attributes
    
    Show more attributs of volume-knob widgets.
    Also don't put empty lines when no connection list is found.
    
    Signed-off-by: Takashi Iwai <[EMAIL PROTECTED]>
    Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]>
---
 sound/pci/hda/hda_codec.h |    1 +
 sound/pci/hda/hda_proc.c  |   32 +++++++++++++++++++++++---------
 2 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
index 2bce925..0331510 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
@@ -135,6 +135,7 @@ enum {
 #define AC_PAR_PROC_CAP                        0x10
 #define AC_PAR_GPIO_CAP                        0x11
 #define AC_PAR_AMP_OUT_CAP             0x12
+#define AC_PAR_VOL_KNB_CAP             0x13
 
 /*
  * AC_VERB_PARAMETERS results (32bit)
diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c
index 000c6c4..7df1d16 100644
--- a/sound/pci/hda/hda_proc.c
+++ b/sound/pci/hda/hda_proc.c
@@ -305,6 +305,12 @@ static void print_codec_info(struct snd_info_entry *entry,
                        snd_iprintf(buffer, " Amp-Out");
                snd_iprintf(buffer, "\n");
 
+               /* volume knob is a special widget that always have connection
+                * list
+                */
+               if (wid_type == AC_WID_VOL_KNB)
+                       wid_caps |= AC_WCAP_CONN_LIST;
+
                if (wid_caps & AC_WCAP_CONN_LIST)
                        conn_len = snd_hda_get_connections(codec, nid, conn,
                                                           HDA_MAX_CONNECTIONS);
@@ -340,9 +346,15 @@ static void print_codec_info(struct snd_info_entry *entry,
                        snd_iprintf(buffer, "\n");
                        break;
                case AC_WID_VOL_KNB:
-                       snd_iprintf(buffer, "  Volume-Knob: 0x%x\n",
-                                   snd_hda_codec_read(codec, nid, 0,
-                                       AC_VERB_GET_VOLUME_KNOB_CONTROL, 0));
+                       pinctls = snd_hda_param_read(codec, nid,
+                                                    AC_PAR_VOL_KNB_CAP);
+                       snd_iprintf(buffer, "  Volume-Knob: delta=%d, "
+                                   "steps=%d, ",
+                                   (pinctls >> 7) & 1, pinctls & 0x7f);
+                       pinctls = snd_hda_codec_read(codec, nid, 0,
+                                       AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
+                       snd_iprintf(buffer, "direct=%d, val=%d\n",
+                                   (pinctls >> 7) & 1, pinctls & 0x7f);
                        break;
                case AC_WID_AUD_OUT:
                case AC_WID_AUD_IN:
@@ -365,13 +377,15 @@ static void print_codec_info(struct snd_info_entry *entry,
                                curr = snd_hda_codec_read(codec, nid, 0,
                                        AC_VERB_GET_CONNECT_SEL, 0);
                        snd_iprintf(buffer, "  Connection: %d\n", conn_len);
-                       snd_iprintf(buffer, "    ");
-                       for (c = 0; c < conn_len; c++) {
-                               snd_iprintf(buffer, " 0x%02x", conn[c]);
-                               if (c == curr)
-                                       snd_iprintf(buffer, "*");
+                       if (conn_len > 0) {
+                               snd_iprintf(buffer, "    ");
+                               for (c = 0; c < conn_len; c++) {
+                                       snd_iprintf(buffer, " 0x%02x", conn[c]);
+                                       if (c == curr)
+                                               snd_iprintf(buffer, "*");
+                               }
+                               snd_iprintf(buffer, "\n");
                        }
-                       snd_iprintf(buffer, "\n");
                }
        }
        snd_hda_power_down(codec);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to