Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b90d7760ea784f916cb1fc0d8123410f1f0c9194
Commit:     b90d7760ea784f916cb1fc0d8123410f1f0c9194
Parent:     ee3527b0362e3b1b2e212d6161869aff9a8a98a0
Author:     Takashi Iwai <[EMAIL PROTECTED]>
AuthorDate: Tue Nov 7 16:10:06 2006 +0100
Committer:  Jaroslav Kysela <[EMAIL PROTECTED]>
CommitDate: Wed Dec 20 08:55:49 2006 +0100

    [ALSA] hda-codec - Verbose proc output for PCM parameters
    
    Make the output for PCM parameters more verbose, showing
    each rate, bits and format.
    
    Signed-off-by: Takashi Iwai <[EMAIL PROTECTED]>
    Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]>
---
 sound/pci/hda/hda_proc.c |   51 ++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 47 insertions(+), 4 deletions(-)

diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c
index e695655..17df4d0 100644
--- a/sound/pci/hda/hda_proc.c
+++ b/sound/pci/hda/hda_proc.c
@@ -88,6 +88,48 @@ static void print_amp_vals(struct snd_info_buffer *buffer,
        snd_iprintf(buffer, "\n");
 }
 
+static void print_pcm_rates(struct snd_info_buffer *buffer, unsigned int pcm)
+{
+       static unsigned int rates[] = {
+               8000, 11025, 16000, 22050, 32000, 44100, 48000, 88200,
+               96000, 176400, 192000, 384000
+       };
+       int i;
+
+       pcm &= AC_SUPPCM_RATES;
+       snd_iprintf(buffer, "    rates [0x%x]:", pcm);
+       for (i = 0; i < ARRAY_SIZE(rates); i++) 
+               if (pcm & (1 << i))
+                       snd_iprintf(buffer, " %d", rates[i]);
+       snd_iprintf(buffer, "\n");
+}
+
+static void print_pcm_bits(struct snd_info_buffer *buffer, unsigned int pcm)
+{
+       static unsigned int bits[] = { 8, 16, 20, 24, 32 };
+       int i;
+
+       pcm = (pcm >> 16) & 0xff;
+       snd_iprintf(buffer, "    bits [0x%x]:", pcm);
+       for (i = 0; i < ARRAY_SIZE(bits); i++)
+               if (pcm & (1 << i))
+                       snd_iprintf(buffer, " %d", bits[i]);
+       snd_iprintf(buffer, "\n");
+}
+
+static void print_pcm_formats(struct snd_info_buffer *buffer,
+                             unsigned int streams)
+{
+       snd_iprintf(buffer, "    formats [0x%x]:", streams & 0xf);
+       if (streams & AC_SUPFMT_PCM)
+               snd_iprintf(buffer, " PCM");
+       if (streams & AC_SUPFMT_FLOAT32)
+               snd_iprintf(buffer, " FLOAT");
+       if (streams & AC_SUPFMT_AC3)
+               snd_iprintf(buffer, " AC3");
+       snd_iprintf(buffer, "\n");
+}
+
 static void print_pcm_caps(struct snd_info_buffer *buffer,
                           struct hda_codec *codec, hda_nid_t nid)
 {
@@ -97,8 +139,9 @@ static void print_pcm_caps(struct snd_info_buffer *buffer,
                snd_iprintf(buffer, "N/A\n");
                return;
        }
-       snd_iprintf(buffer, "rates 0x%03x, bits 0x%02x, types 0x%x\n",
-                   pcm & AC_SUPPCM_RATES, (pcm >> 16) & 0xff, stream & 0xf);
+       print_pcm_rates(buffer, pcm);
+       print_pcm_bits(buffer, pcm);
+       print_pcm_formats(buffer, stream);
 }
 
 static const char *get_jack_location(u32 cfg)
@@ -210,7 +253,7 @@ static void print_codec_info(struct snd_info_entry *entry, 
struct snd_info_buffe
        snd_iprintf(buffer, "Revision Id: 0x%x\n", codec->revision_id);
        if (! codec->afg)
                return;
-       snd_iprintf(buffer, "Default PCM: ");
+       snd_iprintf(buffer, "Default PCM:\n");
        print_pcm_caps(buffer, codec, codec->afg);
        snd_iprintf(buffer, "Default Amp-In caps: ");
        print_amp_caps(buffer, codec, codec->afg, HDA_INPUT);
@@ -278,7 +321,7 @@ static void print_codec_info(struct snd_info_entry *entry, 
struct snd_info_buffe
 
                if ((wid_type == AC_WID_AUD_OUT || wid_type == AC_WID_AUD_IN) &&
                    (wid_caps & AC_WCAP_FORMAT_OVRD)) {
-                       snd_iprintf(buffer, "  PCM: ");
+                       snd_iprintf(buffer, "  PCM:\n");
                        print_pcm_caps(buffer, codec, nid);
                }
 
-
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