2 * Universal Interface for Intel High Definition Audio Codec
4 * Generic proc interface
6 * Copyright (c) 2004 Takashi Iwai <tiwai@suse.de>
9 * This driver is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This driver is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include <linux/init.h>
25 #include <sound/core.h>
26 #include "hda_codec.h"
27 #include "hda_local.h"
29 static char *bits_names(unsigned int bits, char *names[], int size)
34 for (i = 0, n = 0; i < size; i++) {
35 if (bits & (1U<<i) && names[i])
36 n += snprintf(buf + n, sizeof(buf) - n, " %s",
44 static const char *get_wid_type_name(unsigned int wid_value)
46 static char *names[16] = {
47 [AC_WID_AUD_OUT] = "Audio Output",
48 [AC_WID_AUD_IN] = "Audio Input",
49 [AC_WID_AUD_MIX] = "Audio Mixer",
50 [AC_WID_AUD_SEL] = "Audio Selector",
51 [AC_WID_PIN] = "Pin Complex",
52 [AC_WID_POWER] = "Power Widget",
53 [AC_WID_VOL_KNB] = "Volume Knob Widget",
54 [AC_WID_BEEP] = "Beep Generator Widget",
55 [AC_WID_VENDOR] = "Vendor Defined Widget",
59 return names[wid_value];
61 return "UNKNOWN Widget";
64 static void print_nid_mixers(struct snd_info_buffer *buffer,
65 struct hda_codec *codec, hda_nid_t nid)
68 struct hda_nid_item *items = codec->mixers.list;
69 struct snd_kcontrol *kctl;
70 for (i = 0; i < codec->mixers.used; i++) {
71 if (items[i].nid == nid) {
74 " Control: name=\"%s\", index=%i, device=%i\n",
75 kctl->id.name, kctl->id.index, kctl->id.device);
80 static void print_nid_pcms(struct snd_info_buffer *buffer,
81 struct hda_codec *codec, hda_nid_t nid)
85 for (pcm = 0; pcm < codec->num_pcms; pcm++) {
86 cpcm = &codec->pcm_info[pcm];
87 for (type = 0; type < 2; type++) {
88 if (cpcm->stream[type].nid != nid || cpcm->pcm == NULL)
90 snd_iprintf(buffer, " Device: name=\"%s\", "
91 "type=\"%s\", device=%i\n",
93 snd_hda_pcm_type_name[cpcm->pcm_type],
99 static void print_amp_caps(struct snd_info_buffer *buffer,
100 struct hda_codec *codec, hda_nid_t nid, int dir)
103 caps = snd_hda_param_read(codec, nid,
105 AC_PAR_AMP_OUT_CAP : AC_PAR_AMP_IN_CAP);
106 if (caps == -1 || caps == 0) {
107 snd_iprintf(buffer, "N/A\n");
110 snd_iprintf(buffer, "ofs=0x%02x, nsteps=0x%02x, stepsize=0x%02x, "
112 caps & AC_AMPCAP_OFFSET,
113 (caps & AC_AMPCAP_NUM_STEPS) >> AC_AMPCAP_NUM_STEPS_SHIFT,
114 (caps & AC_AMPCAP_STEP_SIZE) >> AC_AMPCAP_STEP_SIZE_SHIFT,
115 (caps & AC_AMPCAP_MUTE) >> AC_AMPCAP_MUTE_SHIFT);
118 static void print_amp_vals(struct snd_info_buffer *buffer,
119 struct hda_codec *codec, hda_nid_t nid,
120 int dir, int stereo, int indices)
125 dir = dir == HDA_OUTPUT ? AC_AMP_GET_OUTPUT : AC_AMP_GET_INPUT;
126 for (i = 0; i < indices; i++) {
127 snd_iprintf(buffer, " [");
129 val = snd_hda_codec_read(codec, nid, 0,
130 AC_VERB_GET_AMP_GAIN_MUTE,
131 AC_AMP_GET_LEFT | dir | i);
132 snd_iprintf(buffer, "0x%02x ", val);
134 val = snd_hda_codec_read(codec, nid, 0,
135 AC_VERB_GET_AMP_GAIN_MUTE,
136 AC_AMP_GET_RIGHT | dir | i);
137 snd_iprintf(buffer, "0x%02x]", val);
139 snd_iprintf(buffer, "\n");
142 static void print_pcm_rates(struct snd_info_buffer *buffer, unsigned int pcm)
144 char buf[SND_PRINT_RATES_ADVISED_BUFSIZE];
146 pcm &= AC_SUPPCM_RATES;
147 snd_iprintf(buffer, " rates [0x%x]:", pcm);
148 snd_print_pcm_rates(pcm, buf, sizeof(buf));
149 snd_iprintf(buffer, "%s\n", buf);
152 static void print_pcm_bits(struct snd_info_buffer *buffer, unsigned int pcm)
154 char buf[SND_PRINT_BITS_ADVISED_BUFSIZE];
156 snd_iprintf(buffer, " bits [0x%x]:", (pcm >> 16) & 0xff);
157 snd_print_pcm_bits(pcm, buf, sizeof(buf));
158 snd_iprintf(buffer, "%s\n", buf);
161 static void print_pcm_formats(struct snd_info_buffer *buffer,
162 unsigned int streams)
164 snd_iprintf(buffer, " formats [0x%x]:", streams & 0xf);
165 if (streams & AC_SUPFMT_PCM)
166 snd_iprintf(buffer, " PCM");
167 if (streams & AC_SUPFMT_FLOAT32)
168 snd_iprintf(buffer, " FLOAT");
169 if (streams & AC_SUPFMT_AC3)
170 snd_iprintf(buffer, " AC3");
171 snd_iprintf(buffer, "\n");
174 static void print_pcm_caps(struct snd_info_buffer *buffer,
175 struct hda_codec *codec, hda_nid_t nid)
177 unsigned int pcm = snd_hda_param_read(codec, nid, AC_PAR_PCM);
178 unsigned int stream = snd_hda_param_read(codec, nid, AC_PAR_STREAM);
179 if (pcm == -1 || stream == -1) {
180 snd_iprintf(buffer, "N/A\n");
183 print_pcm_rates(buffer, pcm);
184 print_pcm_bits(buffer, pcm);
185 print_pcm_formats(buffer, stream);
188 static const char *get_jack_connection(u32 cfg)
190 static char *names[16] = {
191 "Unknown", "1/8", "1/4", "ATAPI",
192 "RCA", "Optical","Digital", "Analog",
193 "DIN", "XLR", "RJ11", "Comb",
194 NULL, NULL, NULL, "Other"
196 cfg = (cfg & AC_DEFCFG_CONN_TYPE) >> AC_DEFCFG_CONN_TYPE_SHIFT;
203 static const char *get_jack_color(u32 cfg)
205 static char *names[16] = {
206 "Unknown", "Black", "Grey", "Blue",
207 "Green", "Red", "Orange", "Yellow",
208 "Purple", "Pink", NULL, NULL,
209 NULL, NULL, "White", "Other",
211 cfg = (cfg & AC_DEFCFG_COLOR) >> AC_DEFCFG_COLOR_SHIFT;
218 static void print_pin_caps(struct snd_info_buffer *buffer,
219 struct hda_codec *codec, hda_nid_t nid,
222 static char *jack_conns[4] = { "Jack", "N/A", "Fixed", "Both" };
223 unsigned int caps, val;
225 caps = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP);
226 snd_iprintf(buffer, " Pincap 0x%08x:", caps);
227 if (caps & AC_PINCAP_IN)
228 snd_iprintf(buffer, " IN");
229 if (caps & AC_PINCAP_OUT)
230 snd_iprintf(buffer, " OUT");
231 if (caps & AC_PINCAP_HP_DRV)
232 snd_iprintf(buffer, " HP");
233 if (caps & AC_PINCAP_EAPD)
234 snd_iprintf(buffer, " EAPD");
235 if (caps & AC_PINCAP_PRES_DETECT)
236 snd_iprintf(buffer, " Detect");
237 if (caps & AC_PINCAP_BALANCE)
238 snd_iprintf(buffer, " Balanced");
239 if (caps & AC_PINCAP_HDMI) {
240 /* Realtek uses this bit as a different meaning */
241 if ((codec->vendor_id >> 16) == 0x10ec)
242 snd_iprintf(buffer, " R/L");
244 snd_iprintf(buffer, " HDMI");
246 if (caps & AC_PINCAP_TRIG_REQ)
247 snd_iprintf(buffer, " Trigger");
248 if (caps & AC_PINCAP_IMP_SENSE)
249 snd_iprintf(buffer, " ImpSense");
250 snd_iprintf(buffer, "\n");
251 if (caps & AC_PINCAP_VREF) {
253 (caps & AC_PINCAP_VREF) >> AC_PINCAP_VREF_SHIFT;
254 snd_iprintf(buffer, " Vref caps:");
255 if (vref & AC_PINCAP_VREF_HIZ)
256 snd_iprintf(buffer, " HIZ");
257 if (vref & AC_PINCAP_VREF_50)
258 snd_iprintf(buffer, " 50");
259 if (vref & AC_PINCAP_VREF_GRD)
260 snd_iprintf(buffer, " GRD");
261 if (vref & AC_PINCAP_VREF_80)
262 snd_iprintf(buffer, " 80");
263 if (vref & AC_PINCAP_VREF_100)
264 snd_iprintf(buffer, " 100");
265 snd_iprintf(buffer, "\n");
269 if (caps & AC_PINCAP_EAPD) {
270 val = snd_hda_codec_read(codec, nid, 0,
271 AC_VERB_GET_EAPD_BTLENABLE, 0);
272 snd_iprintf(buffer, " EAPD 0x%x:", val);
273 if (val & AC_EAPDBTL_BALANCED)
274 snd_iprintf(buffer, " BALANCED");
275 if (val & AC_EAPDBTL_EAPD)
276 snd_iprintf(buffer, " EAPD");
277 if (val & AC_EAPDBTL_LR_SWAP)
278 snd_iprintf(buffer, " R/L");
279 snd_iprintf(buffer, "\n");
281 caps = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONFIG_DEFAULT, 0);
282 snd_iprintf(buffer, " Pin Default 0x%08x: [%s] %s at %s %s\n", caps,
283 jack_conns[(caps & AC_DEFCFG_PORT_CONN) >> AC_DEFCFG_PORT_CONN_SHIFT],
284 snd_hda_get_jack_type(caps),
285 snd_hda_get_jack_connectivity(caps),
286 snd_hda_get_jack_location(caps));
287 snd_iprintf(buffer, " Conn = %s, Color = %s\n",
288 get_jack_connection(caps),
289 get_jack_color(caps));
290 /* Default association and sequence values refer to default grouping
291 * of pin complexes and their sequence within the group. This is used
292 * for priority and resource allocation.
294 snd_iprintf(buffer, " DefAssociation = 0x%x, Sequence = 0x%x\n",
295 (caps & AC_DEFCFG_DEF_ASSOC) >> AC_DEFCFG_ASSOC_SHIFT,
296 caps & AC_DEFCFG_SEQUENCE);
297 if (((caps & AC_DEFCFG_MISC) >> AC_DEFCFG_MISC_SHIFT) &
298 AC_DEFCFG_MISC_NO_PRESENCE) {
299 /* Miscellaneous bit indicates external hardware does not
300 * support presence detection even if the pin complex
301 * indicates it is supported.
303 snd_iprintf(buffer, " Misc = NO_PRESENCE\n");
307 static void print_pin_ctls(struct snd_info_buffer *buffer,
308 struct hda_codec *codec, hda_nid_t nid,
311 unsigned int pinctls;
313 pinctls = snd_hda_codec_read(codec, nid, 0,
314 AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
315 snd_iprintf(buffer, " Pin-ctls: 0x%02x:", pinctls);
316 if (pinctls & AC_PINCTL_IN_EN)
317 snd_iprintf(buffer, " IN");
318 if (pinctls & AC_PINCTL_OUT_EN)
319 snd_iprintf(buffer, " OUT");
320 if (pinctls & AC_PINCTL_HP_EN)
321 snd_iprintf(buffer, " HP");
323 int vref = pinctls & AC_PINCTL_VREFEN;
325 case AC_PINCTL_VREF_HIZ:
326 snd_iprintf(buffer, " VREF_HIZ");
328 case AC_PINCTL_VREF_50:
329 snd_iprintf(buffer, " VREF_50");
331 case AC_PINCTL_VREF_GRD:
332 snd_iprintf(buffer, " VREF_GRD");
334 case AC_PINCTL_VREF_80:
335 snd_iprintf(buffer, " VREF_80");
337 case AC_PINCTL_VREF_100:
338 snd_iprintf(buffer, " VREF_100");
342 snd_iprintf(buffer, "\n");
345 static void print_vol_knob(struct snd_info_buffer *buffer,
346 struct hda_codec *codec, hda_nid_t nid)
348 unsigned int cap = snd_hda_param_read(codec, nid,
350 snd_iprintf(buffer, " Volume-Knob: delta=%d, steps=%d, ",
351 (cap >> 7) & 1, cap & 0x7f);
352 cap = snd_hda_codec_read(codec, nid, 0,
353 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
354 snd_iprintf(buffer, "direct=%d, val=%d\n",
355 (cap >> 7) & 1, cap & 0x7f);
358 static void print_audio_io(struct snd_info_buffer *buffer,
359 struct hda_codec *codec, hda_nid_t nid,
360 unsigned int wid_type)
362 int conv = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONV, 0);
364 " Converter: stream=%d, channel=%d\n",
365 (conv & AC_CONV_STREAM) >> AC_CONV_STREAM_SHIFT,
366 conv & AC_CONV_CHANNEL);
368 if (wid_type == AC_WID_AUD_IN && (conv & AC_CONV_CHANNEL) == 0) {
369 int sdi = snd_hda_codec_read(codec, nid, 0,
370 AC_VERB_GET_SDI_SELECT, 0);
371 snd_iprintf(buffer, " SDI-Select: %d\n",
372 sdi & AC_SDI_SELECT);
376 static void print_digital_conv(struct snd_info_buffer *buffer,
377 struct hda_codec *codec, hda_nid_t nid)
379 unsigned int digi1 = snd_hda_codec_read(codec, nid, 0,
380 AC_VERB_GET_DIGI_CONVERT_1, 0);
381 snd_iprintf(buffer, " Digital:");
382 if (digi1 & AC_DIG1_ENABLE)
383 snd_iprintf(buffer, " Enabled");
384 if (digi1 & AC_DIG1_V)
385 snd_iprintf(buffer, " Validity");
386 if (digi1 & AC_DIG1_VCFG)
387 snd_iprintf(buffer, " ValidityCfg");
388 if (digi1 & AC_DIG1_EMPHASIS)
389 snd_iprintf(buffer, " Preemphasis");
390 if (digi1 & AC_DIG1_COPYRIGHT)
391 snd_iprintf(buffer, " Copyright");
392 if (digi1 & AC_DIG1_NONAUDIO)
393 snd_iprintf(buffer, " Non-Audio");
394 if (digi1 & AC_DIG1_PROFESSIONAL)
395 snd_iprintf(buffer, " Pro");
396 if (digi1 & AC_DIG1_LEVEL)
397 snd_iprintf(buffer, " GenLevel");
398 snd_iprintf(buffer, "\n");
399 snd_iprintf(buffer, " Digital category: 0x%x\n",
400 (digi1 >> 8) & AC_DIG2_CC);
403 static const char *get_pwr_state(u32 state)
405 static const char *buf[4] = {
406 "D0", "D1", "D2", "D3"
413 static void print_power_state(struct snd_info_buffer *buffer,
414 struct hda_codec *codec, hda_nid_t nid)
416 static char *names[] = {
417 [ilog2(AC_PWRST_D0SUP)] = "D0",
418 [ilog2(AC_PWRST_D1SUP)] = "D1",
419 [ilog2(AC_PWRST_D2SUP)] = "D2",
420 [ilog2(AC_PWRST_D3SUP)] = "D3",
421 [ilog2(AC_PWRST_D3COLDSUP)] = "D3cold",
422 [ilog2(AC_PWRST_S3D3COLDSUP)] = "S3D3cold",
423 [ilog2(AC_PWRST_CLKSTOP)] = "CLKSTOP",
424 [ilog2(AC_PWRST_EPSS)] = "EPSS",
427 int sup = snd_hda_param_read(codec, nid, AC_PAR_POWER_STATE);
428 int pwr = snd_hda_codec_read(codec, nid, 0,
429 AC_VERB_GET_POWER_STATE, 0);
431 snd_iprintf(buffer, " Power states: %s\n",
432 bits_names(sup, names, ARRAY_SIZE(names)));
434 snd_iprintf(buffer, " Power: setting=%s, actual=%s\n",
435 get_pwr_state(pwr & AC_PWRST_SETTING),
436 get_pwr_state((pwr & AC_PWRST_ACTUAL) >>
437 AC_PWRST_ACTUAL_SHIFT));
440 static void print_unsol_cap(struct snd_info_buffer *buffer,
441 struct hda_codec *codec, hda_nid_t nid)
443 int unsol = snd_hda_codec_read(codec, nid, 0,
444 AC_VERB_GET_UNSOLICITED_RESPONSE, 0);
446 " Unsolicited: tag=%02x, enabled=%d\n",
447 unsol & AC_UNSOL_TAG,
448 (unsol & AC_UNSOL_ENABLED) ? 1 : 0);
451 static void print_proc_caps(struct snd_info_buffer *buffer,
452 struct hda_codec *codec, hda_nid_t nid)
454 unsigned int proc_caps = snd_hda_param_read(codec, nid,
456 snd_iprintf(buffer, " Processing caps: benign=%d, ncoeff=%d\n",
457 proc_caps & AC_PCAP_BENIGN,
458 (proc_caps & AC_PCAP_NUM_COEF) >> AC_PCAP_NUM_COEF_SHIFT);
461 static void print_conn_list(struct snd_info_buffer *buffer,
462 struct hda_codec *codec, hda_nid_t nid,
463 unsigned int wid_type, hda_nid_t *conn,
469 wid_type != AC_WID_AUD_MIX &&
470 wid_type != AC_WID_VOL_KNB &&
471 wid_type != AC_WID_POWER)
472 curr = snd_hda_codec_read(codec, nid, 0,
473 AC_VERB_GET_CONNECT_SEL, 0);
474 snd_iprintf(buffer, " Connection: %d\n", conn_len);
476 snd_iprintf(buffer, " ");
477 for (c = 0; c < conn_len; c++) {
478 snd_iprintf(buffer, " 0x%02x", conn[c]);
480 snd_iprintf(buffer, "*");
482 snd_iprintf(buffer, "\n");
486 static void print_gpio(struct snd_info_buffer *buffer,
487 struct hda_codec *codec, hda_nid_t nid)
490 snd_hda_param_read(codec, codec->afg, AC_PAR_GPIO_CAP);
491 unsigned int enable, direction, wake, unsol, sticky, data;
493 snd_iprintf(buffer, "GPIO: io=%d, o=%d, i=%d, "
494 "unsolicited=%d, wake=%d\n",
495 gpio & AC_GPIO_IO_COUNT,
496 (gpio & AC_GPIO_O_COUNT) >> AC_GPIO_O_COUNT_SHIFT,
497 (gpio & AC_GPIO_I_COUNT) >> AC_GPIO_I_COUNT_SHIFT,
498 (gpio & AC_GPIO_UNSOLICITED) ? 1 : 0,
499 (gpio & AC_GPIO_WAKE) ? 1 : 0);
500 max = gpio & AC_GPIO_IO_COUNT;
503 enable = snd_hda_codec_read(codec, nid, 0,
504 AC_VERB_GET_GPIO_MASK, 0);
505 direction = snd_hda_codec_read(codec, nid, 0,
506 AC_VERB_GET_GPIO_DIRECTION, 0);
507 wake = snd_hda_codec_read(codec, nid, 0,
508 AC_VERB_GET_GPIO_WAKE_MASK, 0);
509 unsol = snd_hda_codec_read(codec, nid, 0,
510 AC_VERB_GET_GPIO_UNSOLICITED_RSP_MASK, 0);
511 sticky = snd_hda_codec_read(codec, nid, 0,
512 AC_VERB_GET_GPIO_STICKY_MASK, 0);
513 data = snd_hda_codec_read(codec, nid, 0,
514 AC_VERB_GET_GPIO_DATA, 0);
515 for (i = 0; i < max; ++i)
517 " IO[%d]: enable=%d, dir=%d, wake=%d, "
518 "sticky=%d, data=%d, unsol=%d\n", i,
519 (enable & (1<<i)) ? 1 : 0,
520 (direction & (1<<i)) ? 1 : 0,
521 (wake & (1<<i)) ? 1 : 0,
522 (sticky & (1<<i)) ? 1 : 0,
523 (data & (1<<i)) ? 1 : 0,
524 (unsol & (1<<i)) ? 1 : 0);
525 /* FIXME: add GPO and GPI pin information */
526 print_nid_mixers(buffer, codec, nid);
529 static void print_codec_info(struct snd_info_entry *entry,
530 struct snd_info_buffer *buffer)
532 struct hda_codec *codec = entry->private_data;
536 snd_iprintf(buffer, "Codec: ");
537 if (codec->vendor_name && codec->chip_name)
538 snd_iprintf(buffer, "%s %s\n",
539 codec->vendor_name, codec->chip_name);
541 snd_iprintf(buffer, "Not Set\n");
542 snd_iprintf(buffer, "Address: %d\n", codec->addr);
543 snd_iprintf(buffer, "Function Id: 0x%x\n", codec->function_id);
544 snd_iprintf(buffer, "Vendor Id: 0x%08x\n", codec->vendor_id);
545 snd_iprintf(buffer, "Subsystem Id: 0x%08x\n", codec->subsystem_id);
546 snd_iprintf(buffer, "Revision Id: 0x%x\n", codec->revision_id);
549 snd_iprintf(buffer, "Modem Function Group: 0x%x\n", codec->mfg);
551 snd_iprintf(buffer, "No Modem Function Group found\n");
555 snd_hda_power_up(codec);
556 snd_iprintf(buffer, "Default PCM:\n");
557 print_pcm_caps(buffer, codec, codec->afg);
558 snd_iprintf(buffer, "Default Amp-In caps: ");
559 print_amp_caps(buffer, codec, codec->afg, HDA_INPUT);
560 snd_iprintf(buffer, "Default Amp-Out caps: ");
561 print_amp_caps(buffer, codec, codec->afg, HDA_OUTPUT);
563 nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid);
564 if (! nid || nodes < 0) {
565 snd_iprintf(buffer, "Invalid AFG subtree\n");
566 snd_hda_power_down(codec);
570 print_gpio(buffer, codec, codec->afg);
571 if (codec->proc_widget_hook)
572 codec->proc_widget_hook(buffer, codec, codec->afg);
574 for (i = 0; i < nodes; i++, nid++) {
575 unsigned int wid_caps =
576 snd_hda_param_read(codec, nid,
577 AC_PAR_AUDIO_WIDGET_CAP);
578 unsigned int wid_type = get_wcaps_type(wid_caps);
579 hda_nid_t conn[HDA_MAX_CONNECTIONS];
582 snd_iprintf(buffer, "Node 0x%02x [%s] wcaps 0x%x:", nid,
583 get_wid_type_name(wid_type), wid_caps);
584 if (wid_caps & AC_WCAP_STEREO) {
585 unsigned int chans = get_wcaps_channels(wid_caps);
587 snd_iprintf(buffer, " Stereo");
589 snd_iprintf(buffer, " %d-Channels", chans);
591 snd_iprintf(buffer, " Mono");
592 if (wid_caps & AC_WCAP_DIGITAL)
593 snd_iprintf(buffer, " Digital");
594 if (wid_caps & AC_WCAP_IN_AMP)
595 snd_iprintf(buffer, " Amp-In");
596 if (wid_caps & AC_WCAP_OUT_AMP)
597 snd_iprintf(buffer, " Amp-Out");
598 if (wid_caps & AC_WCAP_STRIPE)
599 snd_iprintf(buffer, " Stripe");
600 if (wid_caps & AC_WCAP_LR_SWAP)
601 snd_iprintf(buffer, " R/L");
602 if (wid_caps & AC_WCAP_CP_CAPS)
603 snd_iprintf(buffer, " CP");
604 snd_iprintf(buffer, "\n");
606 print_nid_mixers(buffer, codec, nid);
607 print_nid_pcms(buffer, codec, nid);
609 /* volume knob is a special widget that always have connection
612 if (wid_type == AC_WID_VOL_KNB)
613 wid_caps |= AC_WCAP_CONN_LIST;
615 if (wid_caps & AC_WCAP_CONN_LIST)
616 conn_len = snd_hda_get_connections(codec, nid, conn,
617 HDA_MAX_CONNECTIONS);
619 if (wid_caps & AC_WCAP_IN_AMP) {
620 snd_iprintf(buffer, " Amp-In caps: ");
621 print_amp_caps(buffer, codec, nid, HDA_INPUT);
622 snd_iprintf(buffer, " Amp-In vals: ");
623 print_amp_vals(buffer, codec, nid, HDA_INPUT,
624 wid_caps & AC_WCAP_STEREO,
625 wid_type == AC_WID_PIN ? 1 : conn_len);
627 if (wid_caps & AC_WCAP_OUT_AMP) {
628 snd_iprintf(buffer, " Amp-Out caps: ");
629 print_amp_caps(buffer, codec, nid, HDA_OUTPUT);
630 snd_iprintf(buffer, " Amp-Out vals: ");
631 if (wid_type == AC_WID_PIN &&
632 codec->pin_amp_workaround)
633 print_amp_vals(buffer, codec, nid, HDA_OUTPUT,
634 wid_caps & AC_WCAP_STEREO,
637 print_amp_vals(buffer, codec, nid, HDA_OUTPUT,
638 wid_caps & AC_WCAP_STEREO, 1);
644 print_pin_caps(buffer, codec, nid, &supports_vref);
645 print_pin_ctls(buffer, codec, nid, supports_vref);
649 print_vol_knob(buffer, codec, nid);
653 print_audio_io(buffer, codec, nid, wid_type);
654 if (wid_caps & AC_WCAP_DIGITAL)
655 print_digital_conv(buffer, codec, nid);
656 if (wid_caps & AC_WCAP_FORMAT_OVRD) {
657 snd_iprintf(buffer, " PCM:\n");
658 print_pcm_caps(buffer, codec, nid);
663 if (wid_caps & AC_WCAP_UNSOL_CAP)
664 print_unsol_cap(buffer, codec, nid);
666 if (wid_caps & AC_WCAP_POWER)
667 print_power_state(buffer, codec, nid);
669 if (wid_caps & AC_WCAP_DELAY)
670 snd_iprintf(buffer, " Delay: %d samples\n",
671 (wid_caps & AC_WCAP_DELAY) >>
672 AC_WCAP_DELAY_SHIFT);
674 if (wid_caps & AC_WCAP_CONN_LIST)
675 print_conn_list(buffer, codec, nid, wid_type,
678 if (wid_caps & AC_WCAP_PROC_WID)
679 print_proc_caps(buffer, codec, nid);
681 if (codec->proc_widget_hook)
682 codec->proc_widget_hook(buffer, codec, nid);
684 snd_hda_power_down(codec);
690 int snd_hda_codec_proc_new(struct hda_codec *codec)
693 struct snd_info_entry *entry;
696 snprintf(name, sizeof(name), "codec#%d", codec->addr);
697 err = snd_card_proc_new(codec->bus->card, name, &entry);
701 snd_info_set_text_ops(entry, codec, print_codec_info);