diff options
Diffstat (limited to 'sound/pci/hda/hda_proc.c')
-rw-r--r-- | sound/pci/hda/hda_proc.c | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c index 045e5d32f5de..0fee8fae590a 100644 --- a/sound/pci/hda/hda_proc.c +++ b/sound/pci/hda/hda_proc.c | |||
@@ -22,6 +22,7 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/slab.h> | ||
25 | #include <sound/core.h> | 26 | #include <sound/core.h> |
26 | #include "hda_codec.h" | 27 | #include "hda_codec.h" |
27 | #include "hda_local.h" | 28 | #include "hda_local.h" |
@@ -138,16 +139,17 @@ static void print_amp_vals(struct snd_info_buffer *buffer, | |||
138 | dir = dir == HDA_OUTPUT ? AC_AMP_GET_OUTPUT : AC_AMP_GET_INPUT; | 139 | dir = dir == HDA_OUTPUT ? AC_AMP_GET_OUTPUT : AC_AMP_GET_INPUT; |
139 | for (i = 0; i < indices; i++) { | 140 | for (i = 0; i < indices; i++) { |
140 | snd_iprintf(buffer, " ["); | 141 | snd_iprintf(buffer, " ["); |
142 | val = snd_hda_codec_read(codec, nid, 0, | ||
143 | AC_VERB_GET_AMP_GAIN_MUTE, | ||
144 | AC_AMP_GET_LEFT | dir | i); | ||
145 | snd_iprintf(buffer, "0x%02x", val); | ||
141 | if (stereo) { | 146 | if (stereo) { |
142 | val = snd_hda_codec_read(codec, nid, 0, | 147 | val = snd_hda_codec_read(codec, nid, 0, |
143 | AC_VERB_GET_AMP_GAIN_MUTE, | 148 | AC_VERB_GET_AMP_GAIN_MUTE, |
144 | AC_AMP_GET_LEFT | dir | i); | 149 | AC_AMP_GET_RIGHT | dir | i); |
145 | snd_iprintf(buffer, "0x%02x ", val); | 150 | snd_iprintf(buffer, " 0x%02x", val); |
146 | } | 151 | } |
147 | val = snd_hda_codec_read(codec, nid, 0, | 152 | snd_iprintf(buffer, "]"); |
148 | AC_VERB_GET_AMP_GAIN_MUTE, | ||
149 | AC_AMP_GET_RIGHT | dir | i); | ||
150 | snd_iprintf(buffer, "0x%02x]", val); | ||
151 | } | 153 | } |
152 | snd_iprintf(buffer, "\n"); | 154 | snd_iprintf(buffer, "\n"); |
153 | } | 155 | } |
@@ -603,6 +605,8 @@ static void print_codec_info(struct snd_info_entry *entry, | |||
603 | print_amp_caps(buffer, codec, codec->afg, HDA_INPUT); | 605 | print_amp_caps(buffer, codec, codec->afg, HDA_INPUT); |
604 | snd_iprintf(buffer, "Default Amp-Out caps: "); | 606 | snd_iprintf(buffer, "Default Amp-Out caps: "); |
605 | print_amp_caps(buffer, codec, codec->afg, HDA_OUTPUT); | 607 | print_amp_caps(buffer, codec, codec->afg, HDA_OUTPUT); |
608 | snd_iprintf(buffer, "State of AFG node 0x%02x:\n", codec->afg); | ||
609 | print_power_state(buffer, codec, codec->afg); | ||
606 | 610 | ||
607 | nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid); | 611 | nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid); |
608 | if (! nid || nodes < 0) { | 612 | if (! nid || nodes < 0) { |
@@ -620,7 +624,7 @@ static void print_codec_info(struct snd_info_entry *entry, | |||
620 | snd_hda_param_read(codec, nid, | 624 | snd_hda_param_read(codec, nid, |
621 | AC_PAR_AUDIO_WIDGET_CAP); | 625 | AC_PAR_AUDIO_WIDGET_CAP); |
622 | unsigned int wid_type = get_wcaps_type(wid_caps); | 626 | unsigned int wid_type = get_wcaps_type(wid_caps); |
623 | hda_nid_t conn[HDA_MAX_CONNECTIONS]; | 627 | hda_nid_t *conn = NULL; |
624 | int conn_len = 0; | 628 | int conn_len = 0; |
625 | 629 | ||
626 | snd_iprintf(buffer, "Node 0x%02x [%s] wcaps 0x%x:", nid, | 630 | snd_iprintf(buffer, "Node 0x%02x [%s] wcaps 0x%x:", nid, |
@@ -657,9 +661,18 @@ static void print_codec_info(struct snd_info_entry *entry, | |||
657 | if (wid_type == AC_WID_VOL_KNB) | 661 | if (wid_type == AC_WID_VOL_KNB) |
658 | wid_caps |= AC_WCAP_CONN_LIST; | 662 | wid_caps |= AC_WCAP_CONN_LIST; |
659 | 663 | ||
660 | if (wid_caps & AC_WCAP_CONN_LIST) | 664 | if (wid_caps & AC_WCAP_CONN_LIST) { |
661 | conn_len = snd_hda_get_raw_connections(codec, nid, conn, | 665 | conn_len = snd_hda_get_num_raw_conns(codec, nid); |
662 | HDA_MAX_CONNECTIONS); | 666 | if (conn_len > 0) { |
667 | conn = kmalloc(sizeof(hda_nid_t) * conn_len, | ||
668 | GFP_KERNEL); | ||
669 | if (!conn) | ||
670 | return; | ||
671 | if (snd_hda_get_raw_connections(codec, nid, conn, | ||
672 | conn_len) < 0) | ||
673 | conn_len = 0; | ||
674 | } | ||
675 | } | ||
663 | 676 | ||
664 | if (wid_caps & AC_WCAP_IN_AMP) { | 677 | if (wid_caps & AC_WCAP_IN_AMP) { |
665 | snd_iprintf(buffer, " Amp-In caps: "); | 678 | snd_iprintf(buffer, " Amp-In caps: "); |
@@ -732,6 +745,8 @@ static void print_codec_info(struct snd_info_entry *entry, | |||
732 | 745 | ||
733 | if (codec->proc_widget_hook) | 746 | if (codec->proc_widget_hook) |
734 | codec->proc_widget_hook(buffer, codec, nid); | 747 | codec->proc_widget_hook(buffer, codec, nid); |
748 | |||
749 | kfree(conn); | ||
735 | } | 750 | } |
736 | snd_hda_power_down(codec); | 751 | snd_hda_power_down(codec); |
737 | } | 752 | } |