aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-06-10 13:45:09 -0400
committerJaroslav Kysela <perex@suse.cz>2005-06-22 06:28:36 -0400
commit3e289f16ec2e08bbb37ce57a31386ed135887da4 (patch)
tree037fd85697a028057d13cedc70aaece0e6ca1a2c /sound
parent1ccc67d692c52dcc02e70206338ff36ac145a939 (diff)
[ALSA] hda-codec - Print all AMP IN values
HDA generic driver Print all AMP IN values when multiple nodes are connected. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_proc.c44
1 files changed, 27 insertions, 17 deletions
diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c
index 15df7162f17e..de1217bd8e68 100644
--- a/sound/pci/hda/hda_proc.c
+++ b/sound/pci/hda/hda_proc.c
@@ -68,21 +68,27 @@ static void print_amp_caps(snd_info_buffer_t *buffer,
68 68
69static void print_amp_vals(snd_info_buffer_t *buffer, 69static void print_amp_vals(snd_info_buffer_t *buffer,
70 struct hda_codec *codec, hda_nid_t nid, 70 struct hda_codec *codec, hda_nid_t nid,
71 int dir, int stereo) 71 int dir, int stereo, int indices)
72{ 72{
73 unsigned int val; 73 unsigned int val;
74 if (stereo) { 74 int i;
75
76 if (dir == HDA_OUTPUT)
77 dir = AC_AMP_GET_OUTPUT;
78 else
79 dir = AC_AMP_GET_INPUT;
80 for (i = 0; i < indices; i++) {
81 snd_iprintf(buffer, " [");
82 if (stereo) {
83 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_AMP_GAIN_MUTE,
84 AC_AMP_GET_LEFT | dir | i);
85 snd_iprintf(buffer, "0x%02x ", val);
86 }
75 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_AMP_GAIN_MUTE, 87 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_AMP_GAIN_MUTE,
76 AC_AMP_GET_LEFT | 88 AC_AMP_GET_RIGHT | dir | i);
77 (dir == HDA_OUTPUT ? AC_AMP_GET_OUTPUT : 89 snd_iprintf(buffer, "0x%02x]", val);
78 AC_AMP_GET_INPUT));
79 snd_iprintf(buffer, "0x%02x ", val);
80 } 90 }
81 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_AMP_GAIN_MUTE, 91 snd_iprintf(buffer, "\n");
82 AC_AMP_GET_RIGHT |
83 (dir == HDA_OUTPUT ? AC_AMP_GET_OUTPUT :
84 AC_AMP_GET_INPUT));
85 snd_iprintf(buffer, "0x%02x\n", val);
86} 92}
87 93
88static void print_pcm_caps(snd_info_buffer_t *buffer, 94static void print_pcm_caps(snd_info_buffer_t *buffer,
@@ -217,6 +223,9 @@ static void print_codec_info(snd_info_entry_t *entry, snd_info_buffer_t *buffer)
217 unsigned int wid_caps = snd_hda_param_read(codec, nid, 223 unsigned int wid_caps = snd_hda_param_read(codec, nid,
218 AC_PAR_AUDIO_WIDGET_CAP); 224 AC_PAR_AUDIO_WIDGET_CAP);
219 unsigned int wid_type = (wid_caps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; 225 unsigned int wid_type = (wid_caps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;
226 int conn_len = 0;
227 hda_nid_t conn[HDA_MAX_CONNECTIONS];
228
220 snd_iprintf(buffer, "Node 0x%02x [%s] wcaps 0x%x:", nid, 229 snd_iprintf(buffer, "Node 0x%02x [%s] wcaps 0x%x:", nid,
221 get_wid_type_name(wid_type), wid_caps); 230 get_wid_type_name(wid_type), wid_caps);
222 if (wid_caps & AC_WCAP_STEREO) 231 if (wid_caps & AC_WCAP_STEREO)
@@ -231,19 +240,23 @@ static void print_codec_info(snd_info_entry_t *entry, snd_info_buffer_t *buffer)
231 snd_iprintf(buffer, " Amp-Out"); 240 snd_iprintf(buffer, " Amp-Out");
232 snd_iprintf(buffer, "\n"); 241 snd_iprintf(buffer, "\n");
233 242
243 if (wid_caps & AC_WCAP_CONN_LIST)
244 conn_len = snd_hda_get_connections(codec, nid, conn,
245 HDA_MAX_CONNECTIONS);
246
234 if (wid_caps & AC_WCAP_IN_AMP) { 247 if (wid_caps & AC_WCAP_IN_AMP) {
235 snd_iprintf(buffer, " Amp-In caps: "); 248 snd_iprintf(buffer, " Amp-In caps: ");
236 print_amp_caps(buffer, codec, nid, HDA_INPUT); 249 print_amp_caps(buffer, codec, nid, HDA_INPUT);
237 snd_iprintf(buffer, " Amp-In vals: "); 250 snd_iprintf(buffer, " Amp-In vals: ");
238 print_amp_vals(buffer, codec, nid, HDA_INPUT, 251 print_amp_vals(buffer, codec, nid, HDA_INPUT,
239 wid_caps & AC_WCAP_STEREO); 252 wid_caps & AC_WCAP_STEREO, conn_len);
240 } 253 }
241 if (wid_caps & AC_WCAP_OUT_AMP) { 254 if (wid_caps & AC_WCAP_OUT_AMP) {
242 snd_iprintf(buffer, " Amp-Out caps: "); 255 snd_iprintf(buffer, " Amp-Out caps: ");
243 print_amp_caps(buffer, codec, nid, HDA_OUTPUT); 256 print_amp_caps(buffer, codec, nid, HDA_OUTPUT);
244 snd_iprintf(buffer, " Amp-Out vals: "); 257 snd_iprintf(buffer, " Amp-Out vals: ");
245 print_amp_vals(buffer, codec, nid, HDA_OUTPUT, 258 print_amp_vals(buffer, codec, nid, HDA_OUTPUT,
246 wid_caps & AC_WCAP_STEREO); 259 wid_caps & AC_WCAP_STEREO, 1);
247 } 260 }
248 261
249 if (wid_type == AC_WID_PIN) { 262 if (wid_type == AC_WID_PIN) {
@@ -267,10 +280,7 @@ static void print_codec_info(snd_info_entry_t *entry, snd_info_buffer_t *buffer)
267 } 280 }
268 281
269 if (wid_caps & AC_WCAP_CONN_LIST) { 282 if (wid_caps & AC_WCAP_CONN_LIST) {
270 hda_nid_t conn[HDA_MAX_CONNECTIONS]; 283 int c, curr = -1;
271 int c, conn_len, curr = -1;
272 conn_len = snd_hda_get_connections(codec, nid, conn,
273 HDA_MAX_CONNECTIONS);
274 if (conn_len > 1 && wid_type != AC_WID_AUD_MIX) 284 if (conn_len > 1 && wid_type != AC_WID_AUD_MIX)
275 curr = snd_hda_codec_read(codec, nid, 0, 285 curr = snd_hda_codec_read(codec, nid, 0,
276 AC_VERB_GET_CONNECT_SEL, 0); 286 AC_VERB_GET_CONNECT_SEL, 0);