diff options
author | Takashi Iwai <tiwai@suse.de> | 2006-11-07 10:10:06 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@server.perex.cz> | 2006-12-20 02:55:49 -0500 |
commit | b90d7760ea784f916cb1fc0d8123410f1f0c9194 (patch) | |
tree | b40cadc849a01602f085601e9725134abab76149 /sound/pci | |
parent | ee3527b0362e3b1b2e212d6161869aff9a8a98a0 (diff) |
[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 <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | 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 e695655e88db..17df4d0fe135 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, | |||
88 | snd_iprintf(buffer, "\n"); | 88 | snd_iprintf(buffer, "\n"); |
89 | } | 89 | } |
90 | 90 | ||
91 | static void print_pcm_rates(struct snd_info_buffer *buffer, unsigned int pcm) | ||
92 | { | ||
93 | static unsigned int rates[] = { | ||
94 | 8000, 11025, 16000, 22050, 32000, 44100, 48000, 88200, | ||
95 | 96000, 176400, 192000, 384000 | ||
96 | }; | ||
97 | int i; | ||
98 | |||
99 | pcm &= AC_SUPPCM_RATES; | ||
100 | snd_iprintf(buffer, " rates [0x%x]:", pcm); | ||
101 | for (i = 0; i < ARRAY_SIZE(rates); i++) | ||
102 | if (pcm & (1 << i)) | ||
103 | snd_iprintf(buffer, " %d", rates[i]); | ||
104 | snd_iprintf(buffer, "\n"); | ||
105 | } | ||
106 | |||
107 | static void print_pcm_bits(struct snd_info_buffer *buffer, unsigned int pcm) | ||
108 | { | ||
109 | static unsigned int bits[] = { 8, 16, 20, 24, 32 }; | ||
110 | int i; | ||
111 | |||
112 | pcm = (pcm >> 16) & 0xff; | ||
113 | snd_iprintf(buffer, " bits [0x%x]:", pcm); | ||
114 | for (i = 0; i < ARRAY_SIZE(bits); i++) | ||
115 | if (pcm & (1 << i)) | ||
116 | snd_iprintf(buffer, " %d", bits[i]); | ||
117 | snd_iprintf(buffer, "\n"); | ||
118 | } | ||
119 | |||
120 | static void print_pcm_formats(struct snd_info_buffer *buffer, | ||
121 | unsigned int streams) | ||
122 | { | ||
123 | snd_iprintf(buffer, " formats [0x%x]:", streams & 0xf); | ||
124 | if (streams & AC_SUPFMT_PCM) | ||
125 | snd_iprintf(buffer, " PCM"); | ||
126 | if (streams & AC_SUPFMT_FLOAT32) | ||
127 | snd_iprintf(buffer, " FLOAT"); | ||
128 | if (streams & AC_SUPFMT_AC3) | ||
129 | snd_iprintf(buffer, " AC3"); | ||
130 | snd_iprintf(buffer, "\n"); | ||
131 | } | ||
132 | |||
91 | static void print_pcm_caps(struct snd_info_buffer *buffer, | 133 | static void print_pcm_caps(struct snd_info_buffer *buffer, |
92 | struct hda_codec *codec, hda_nid_t nid) | 134 | struct hda_codec *codec, hda_nid_t nid) |
93 | { | 135 | { |
@@ -97,8 +139,9 @@ static void print_pcm_caps(struct snd_info_buffer *buffer, | |||
97 | snd_iprintf(buffer, "N/A\n"); | 139 | snd_iprintf(buffer, "N/A\n"); |
98 | return; | 140 | return; |
99 | } | 141 | } |
100 | snd_iprintf(buffer, "rates 0x%03x, bits 0x%02x, types 0x%x\n", | 142 | print_pcm_rates(buffer, pcm); |
101 | pcm & AC_SUPPCM_RATES, (pcm >> 16) & 0xff, stream & 0xf); | 143 | print_pcm_bits(buffer, pcm); |
144 | print_pcm_formats(buffer, stream); | ||
102 | } | 145 | } |
103 | 146 | ||
104 | static const char *get_jack_location(u32 cfg) | 147 | 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 | |||
210 | snd_iprintf(buffer, "Revision Id: 0x%x\n", codec->revision_id); | 253 | snd_iprintf(buffer, "Revision Id: 0x%x\n", codec->revision_id); |
211 | if (! codec->afg) | 254 | if (! codec->afg) |
212 | return; | 255 | return; |
213 | snd_iprintf(buffer, "Default PCM: "); | 256 | snd_iprintf(buffer, "Default PCM:\n"); |
214 | print_pcm_caps(buffer, codec, codec->afg); | 257 | print_pcm_caps(buffer, codec, codec->afg); |
215 | snd_iprintf(buffer, "Default Amp-In caps: "); | 258 | snd_iprintf(buffer, "Default Amp-In caps: "); |
216 | print_amp_caps(buffer, codec, codec->afg, HDA_INPUT); | 259 | 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 | |||
278 | 321 | ||
279 | if ((wid_type == AC_WID_AUD_OUT || wid_type == AC_WID_AUD_IN) && | 322 | if ((wid_type == AC_WID_AUD_OUT || wid_type == AC_WID_AUD_IN) && |
280 | (wid_caps & AC_WCAP_FORMAT_OVRD)) { | 323 | (wid_caps & AC_WCAP_FORMAT_OVRD)) { |
281 | snd_iprintf(buffer, " PCM: "); | 324 | snd_iprintf(buffer, " PCM:\n"); |
282 | print_pcm_caps(buffer, codec, nid); | 325 | print_pcm_caps(buffer, codec, nid); |
283 | } | 326 | } |
284 | 327 | ||