Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2655
b: refs/heads/master
c: 3e289f1
h: refs/heads/master
i:
  2653: 8bd70c5
  2651: cf7de90
  2647: 36cbed5
  2639: 6ca2606
  2623: c36ff29
v: v3
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed Jun 22, 2005
1 parent cd3e47d commit afaba92
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1ccc67d692c52dcc02e70206338ff36ac145a939
refs/heads/master: 3e289f16ec2e08bbb37ce57a31386ed135887da4
44 changes: 27 additions & 17 deletions trunk/sound/pci/hda/hda_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,27 @@ static void print_amp_caps(snd_info_buffer_t *buffer,

static void print_amp_vals(snd_info_buffer_t *buffer,
struct hda_codec *codec, hda_nid_t nid,
int dir, int stereo)
int dir, int stereo, int indices)
{
unsigned int val;
if (stereo) {
int i;

if (dir == HDA_OUTPUT)
dir = AC_AMP_GET_OUTPUT;
else
dir = AC_AMP_GET_INPUT;
for (i = 0; i < indices; i++) {
snd_iprintf(buffer, " [");
if (stereo) {
val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_AMP_GAIN_MUTE,
AC_AMP_GET_LEFT | dir | i);
snd_iprintf(buffer, "0x%02x ", val);
}
val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_AMP_GAIN_MUTE,
AC_AMP_GET_LEFT |
(dir == HDA_OUTPUT ? AC_AMP_GET_OUTPUT :
AC_AMP_GET_INPUT));
snd_iprintf(buffer, "0x%02x ", val);
AC_AMP_GET_RIGHT | dir | i);
snd_iprintf(buffer, "0x%02x]", val);
}
val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_AMP_GAIN_MUTE,
AC_AMP_GET_RIGHT |
(dir == HDA_OUTPUT ? AC_AMP_GET_OUTPUT :
AC_AMP_GET_INPUT));
snd_iprintf(buffer, "0x%02x\n", val);
snd_iprintf(buffer, "\n");
}

static void print_pcm_caps(snd_info_buffer_t *buffer,
Expand Down Expand Up @@ -217,6 +223,9 @@ static void print_codec_info(snd_info_entry_t *entry, snd_info_buffer_t *buffer)
unsigned int wid_caps = snd_hda_param_read(codec, nid,
AC_PAR_AUDIO_WIDGET_CAP);
unsigned int wid_type = (wid_caps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;
int conn_len = 0;
hda_nid_t conn[HDA_MAX_CONNECTIONS];

snd_iprintf(buffer, "Node 0x%02x [%s] wcaps 0x%x:", nid,
get_wid_type_name(wid_type), wid_caps);
if (wid_caps & AC_WCAP_STEREO)
Expand All @@ -231,19 +240,23 @@ static void print_codec_info(snd_info_entry_t *entry, snd_info_buffer_t *buffer)
snd_iprintf(buffer, " Amp-Out");
snd_iprintf(buffer, "\n");

if (wid_caps & AC_WCAP_CONN_LIST)
conn_len = snd_hda_get_connections(codec, nid, conn,
HDA_MAX_CONNECTIONS);

if (wid_caps & AC_WCAP_IN_AMP) {
snd_iprintf(buffer, " Amp-In caps: ");
print_amp_caps(buffer, codec, nid, HDA_INPUT);
snd_iprintf(buffer, " Amp-In vals: ");
print_amp_vals(buffer, codec, nid, HDA_INPUT,
wid_caps & AC_WCAP_STEREO);
wid_caps & AC_WCAP_STEREO, conn_len);
}
if (wid_caps & AC_WCAP_OUT_AMP) {
snd_iprintf(buffer, " Amp-Out caps: ");
print_amp_caps(buffer, codec, nid, HDA_OUTPUT);
snd_iprintf(buffer, " Amp-Out vals: ");
print_amp_vals(buffer, codec, nid, HDA_OUTPUT,
wid_caps & AC_WCAP_STEREO);
wid_caps & AC_WCAP_STEREO, 1);
}

if (wid_type == AC_WID_PIN) {
Expand All @@ -267,10 +280,7 @@ static void print_codec_info(snd_info_entry_t *entry, snd_info_buffer_t *buffer)
}

if (wid_caps & AC_WCAP_CONN_LIST) {
hda_nid_t conn[HDA_MAX_CONNECTIONS];
int c, conn_len, curr = -1;
conn_len = snd_hda_get_connections(codec, nid, conn,
HDA_MAX_CONNECTIONS);
int c, curr = -1;
if (conn_len > 1 && wid_type != AC_WID_AUD_MIX)
curr = snd_hda_codec_read(codec, nid, 0,
AC_VERB_GET_CONNECT_SEL, 0);
Expand Down

0 comments on commit afaba92

Please sign in to comment.