diff options
Diffstat (limited to 'sound/pci/hda/hda_proc.c')
-rw-r--r-- | sound/pci/hda/hda_proc.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c index ac15066fd300..e94944f34ffd 100644 --- a/sound/pci/hda/hda_proc.c +++ b/sound/pci/hda/hda_proc.c | |||
@@ -58,7 +58,8 @@ static void print_amp_caps(struct snd_info_buffer *buffer, | |||
58 | snd_iprintf(buffer, "N/A\n"); | 58 | snd_iprintf(buffer, "N/A\n"); |
59 | return; | 59 | return; |
60 | } | 60 | } |
61 | snd_iprintf(buffer, "ofs=0x%02x, nsteps=0x%02x, stepsize=0x%02x, mute=%x\n", | 61 | snd_iprintf(buffer, "ofs=0x%02x, nsteps=0x%02x, stepsize=0x%02x, " |
62 | "mute=%x\n", | ||
62 | caps & AC_AMPCAP_OFFSET, | 63 | caps & AC_AMPCAP_OFFSET, |
63 | (caps & AC_AMPCAP_NUM_STEPS) >> AC_AMPCAP_NUM_STEPS_SHIFT, | 64 | (caps & AC_AMPCAP_NUM_STEPS) >> AC_AMPCAP_NUM_STEPS_SHIFT, |
64 | (caps & AC_AMPCAP_STEP_SIZE) >> AC_AMPCAP_STEP_SIZE_SHIFT, | 65 | (caps & AC_AMPCAP_STEP_SIZE) >> AC_AMPCAP_STEP_SIZE_SHIFT, |
@@ -76,11 +77,13 @@ static void print_amp_vals(struct snd_info_buffer *buffer, | |||
76 | for (i = 0; i < indices; i++) { | 77 | for (i = 0; i < indices; i++) { |
77 | snd_iprintf(buffer, " ["); | 78 | snd_iprintf(buffer, " ["); |
78 | if (stereo) { | 79 | if (stereo) { |
79 | val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_AMP_GAIN_MUTE, | 80 | val = snd_hda_codec_read(codec, nid, 0, |
81 | AC_VERB_GET_AMP_GAIN_MUTE, | ||
80 | AC_AMP_GET_LEFT | dir | i); | 82 | AC_AMP_GET_LEFT | dir | i); |
81 | snd_iprintf(buffer, "0x%02x ", val); | 83 | snd_iprintf(buffer, "0x%02x ", val); |
82 | } | 84 | } |
83 | val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_AMP_GAIN_MUTE, | 85 | val = snd_hda_codec_read(codec, nid, 0, |
86 | AC_VERB_GET_AMP_GAIN_MUTE, | ||
84 | AC_AMP_GET_RIGHT | dir | i); | 87 | AC_AMP_GET_RIGHT | dir | i); |
85 | snd_iprintf(buffer, "0x%02x]", val); | 88 | snd_iprintf(buffer, "0x%02x]", val); |
86 | } | 89 | } |
@@ -237,7 +240,8 @@ static void print_pin_caps(struct snd_info_buffer *buffer, | |||
237 | } | 240 | } |
238 | 241 | ||
239 | 242 | ||
240 | static void print_codec_info(struct snd_info_entry *entry, struct snd_info_buffer *buffer) | 243 | static void print_codec_info(struct snd_info_entry *entry, |
244 | struct snd_info_buffer *buffer) | ||
241 | { | 245 | { |
242 | struct hda_codec *codec = entry->private_data; | 246 | struct hda_codec *codec = entry->private_data; |
243 | char buf[32]; | 247 | char buf[32]; |
@@ -258,6 +262,7 @@ static void print_codec_info(struct snd_info_entry *entry, struct snd_info_buffe | |||
258 | 262 | ||
259 | if (! codec->afg) | 263 | if (! codec->afg) |
260 | return; | 264 | return; |
265 | snd_hda_power_up(codec); | ||
261 | snd_iprintf(buffer, "Default PCM:\n"); | 266 | snd_iprintf(buffer, "Default PCM:\n"); |
262 | print_pcm_caps(buffer, codec, codec->afg); | 267 | print_pcm_caps(buffer, codec, codec->afg); |
263 | snd_iprintf(buffer, "Default Amp-In caps: "); | 268 | snd_iprintf(buffer, "Default Amp-In caps: "); |
@@ -268,12 +273,15 @@ static void print_codec_info(struct snd_info_entry *entry, struct snd_info_buffe | |||
268 | nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid); | 273 | nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid); |
269 | if (! nid || nodes < 0) { | 274 | if (! nid || nodes < 0) { |
270 | snd_iprintf(buffer, "Invalid AFG subtree\n"); | 275 | snd_iprintf(buffer, "Invalid AFG subtree\n"); |
276 | snd_hda_power_down(codec); | ||
271 | return; | 277 | return; |
272 | } | 278 | } |
273 | for (i = 0; i < nodes; i++, nid++) { | 279 | for (i = 0; i < nodes; i++, nid++) { |
274 | unsigned int wid_caps = snd_hda_param_read(codec, nid, | 280 | unsigned int wid_caps = |
275 | AC_PAR_AUDIO_WIDGET_CAP); | 281 | snd_hda_param_read(codec, nid, |
276 | unsigned int wid_type = (wid_caps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; | 282 | AC_PAR_AUDIO_WIDGET_CAP); |
283 | unsigned int wid_type = | ||
284 | (wid_caps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; | ||
277 | int conn_len = 0; | 285 | int conn_len = 0; |
278 | hda_nid_t conn[HDA_MAX_CONNECTIONS]; | 286 | hda_nid_t conn[HDA_MAX_CONNECTIONS]; |
279 | 287 | ||
@@ -313,7 +321,9 @@ static void print_codec_info(struct snd_info_entry *entry, struct snd_info_buffe | |||
313 | if (wid_type == AC_WID_PIN) { | 321 | if (wid_type == AC_WID_PIN) { |
314 | unsigned int pinctls; | 322 | unsigned int pinctls; |
315 | print_pin_caps(buffer, codec, nid); | 323 | print_pin_caps(buffer, codec, nid); |
316 | pinctls = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_WIDGET_CONTROL, 0); | 324 | pinctls = snd_hda_codec_read(codec, nid, 0, |
325 | AC_VERB_GET_PIN_WIDGET_CONTROL, | ||
326 | 0); | ||
317 | snd_iprintf(buffer, " Pin-ctls: 0x%02x:", pinctls); | 327 | snd_iprintf(buffer, " Pin-ctls: 0x%02x:", pinctls); |
318 | if (pinctls & AC_PINCTL_IN_EN) | 328 | if (pinctls & AC_PINCTL_IN_EN) |
319 | snd_iprintf(buffer, " IN"); | 329 | snd_iprintf(buffer, " IN"); |
@@ -333,7 +343,8 @@ static void print_codec_info(struct snd_info_entry *entry, struct snd_info_buffe | |||
333 | if (wid_caps & AC_WCAP_POWER) | 343 | if (wid_caps & AC_WCAP_POWER) |
334 | snd_iprintf(buffer, " Power: 0x%x\n", | 344 | snd_iprintf(buffer, " Power: 0x%x\n", |
335 | snd_hda_codec_read(codec, nid, 0, | 345 | snd_hda_codec_read(codec, nid, 0, |
336 | AC_VERB_GET_POWER_STATE, 0)); | 346 | AC_VERB_GET_POWER_STATE, |
347 | 0)); | ||
337 | 348 | ||
338 | if (wid_caps & AC_WCAP_CONN_LIST) { | 349 | if (wid_caps & AC_WCAP_CONN_LIST) { |
339 | int c, curr = -1; | 350 | int c, curr = -1; |
@@ -350,6 +361,7 @@ static void print_codec_info(struct snd_info_entry *entry, struct snd_info_buffe | |||
350 | snd_iprintf(buffer, "\n"); | 361 | snd_iprintf(buffer, "\n"); |
351 | } | 362 | } |
352 | } | 363 | } |
364 | snd_hda_power_down(codec); | ||
353 | } | 365 | } |
354 | 366 | ||
355 | /* | 367 | /* |