Commit 4f32456e authored by Michael Karcher's avatar Michael Karcher Committed by Takashi Iwai

ALSA: hda - Fix proc output for ADC amp values of CX20549

The CX20549 has only one single input amp on it's input converter
widget. Fix printing of values in the codec file in /proc/asound.
Signed-off-by: default avatarMichael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 92fd918c
...@@ -851,6 +851,9 @@ struct hda_codec { ...@@ -851,6 +851,9 @@ struct hda_codec {
unsigned int pin_amp_workaround:1; /* pin out-amp takes index unsigned int pin_amp_workaround:1; /* pin out-amp takes index
* (e.g. Conexant codecs) * (e.g. Conexant codecs)
*/ */
unsigned int single_adc_amp:1; /* adc in-amp takes no index
* (e.g. CX20549 codec)
*/
unsigned int no_sticky_stream:1; /* no sticky-PCM stream assignment */ unsigned int no_sticky_stream:1; /* no sticky-PCM stream assignment */
unsigned int pins_shutup:1; /* pins are shut up */ unsigned int pins_shutup:1; /* pins are shut up */
unsigned int no_trigger_sense:1; /* don't trigger at pin-sensing */ unsigned int no_trigger_sense:1; /* don't trigger at pin-sensing */
......
...@@ -651,9 +651,16 @@ static void print_codec_info(struct snd_info_entry *entry, ...@@ -651,9 +651,16 @@ static void print_codec_info(struct snd_info_entry *entry,
snd_iprintf(buffer, " Amp-In caps: "); snd_iprintf(buffer, " Amp-In caps: ");
print_amp_caps(buffer, codec, nid, HDA_INPUT); print_amp_caps(buffer, codec, nid, HDA_INPUT);
snd_iprintf(buffer, " Amp-In vals: "); snd_iprintf(buffer, " Amp-In vals: ");
print_amp_vals(buffer, codec, nid, HDA_INPUT, if (wid_type == AC_WID_PIN ||
wid_caps & AC_WCAP_STEREO, (codec->single_adc_amp &&
wid_type == AC_WID_PIN ? 1 : conn_len); wid_type == AC_WID_AUD_IN))
print_amp_vals(buffer, codec, nid, HDA_INPUT,
wid_caps & AC_WCAP_STEREO,
1);
else
print_amp_vals(buffer, codec, nid, HDA_INPUT,
wid_caps & AC_WCAP_STEREO,
conn_len);
} }
if (wid_caps & AC_WCAP_OUT_AMP) { if (wid_caps & AC_WCAP_OUT_AMP) {
snd_iprintf(buffer, " Amp-Out caps: "); snd_iprintf(buffer, " Amp-Out caps: ");
......
...@@ -141,7 +141,6 @@ struct conexant_spec { ...@@ -141,7 +141,6 @@ struct conexant_spec {
unsigned int hp_laptop:1; unsigned int hp_laptop:1;
unsigned int asus:1; unsigned int asus:1;
unsigned int pin_eapd_ctrls:1; unsigned int pin_eapd_ctrls:1;
unsigned int single_adc_amp:1;
unsigned int adc_switching:1; unsigned int adc_switching:1;
...@@ -1111,6 +1110,7 @@ static int patch_cxt5045(struct hda_codec *codec) ...@@ -1111,6 +1110,7 @@ static int patch_cxt5045(struct hda_codec *codec)
return -ENOMEM; return -ENOMEM;
codec->spec = spec; codec->spec = spec;
codec->pin_amp_workaround = 1; codec->pin_amp_workaround = 1;
codec->single_adc_amp = 1;
spec->multiout.max_channels = 2; spec->multiout.max_channels = 2;
spec->multiout.num_dacs = ARRAY_SIZE(cxt5045_dac_nids); spec->multiout.num_dacs = ARRAY_SIZE(cxt5045_dac_nids);
...@@ -4220,7 +4220,7 @@ static int cx_auto_add_capture_volume(struct hda_codec *codec, hda_nid_t nid, ...@@ -4220,7 +4220,7 @@ static int cx_auto_add_capture_volume(struct hda_codec *codec, hda_nid_t nid,
int idx = get_input_connection(codec, adc_nid, nid); int idx = get_input_connection(codec, adc_nid, nid);
if (idx < 0) if (idx < 0)
continue; continue;
if (spec->single_adc_amp) if (codec->single_adc_amp)
idx = 0; idx = 0;
return cx_auto_add_volume_idx(codec, label, pfx, return cx_auto_add_volume_idx(codec, label, pfx,
cidx, adc_nid, HDA_INPUT, idx); cidx, adc_nid, HDA_INPUT, idx);
...@@ -4275,7 +4275,7 @@ static int cx_auto_build_input_controls(struct hda_codec *codec) ...@@ -4275,7 +4275,7 @@ static int cx_auto_build_input_controls(struct hda_codec *codec)
if (cidx < 0) if (cidx < 0)
continue; continue;
input_conn[i] = spec->imux_info[i].adc; input_conn[i] = spec->imux_info[i].adc;
if (!spec->single_adc_amp) if (!codec->single_adc_amp)
input_conn[i] |= cidx << 8; input_conn[i] |= cidx << 8;
if (i > 0 && input_conn[i] != input_conn[0]) if (i > 0 && input_conn[i] != input_conn[0])
multi_connection = 1; multi_connection = 1;
...@@ -4470,7 +4470,7 @@ static int patch_conexant_auto(struct hda_codec *codec) ...@@ -4470,7 +4470,7 @@ static int patch_conexant_auto(struct hda_codec *codec)
switch (codec->vendor_id) { switch (codec->vendor_id) {
case 0x14f15045: case 0x14f15045:
spec->single_adc_amp = 1; codec->single_adc_amp = 1;
break; break;
case 0x14f15051: case 0x14f15051:
add_cx5051_fake_mutes(codec); add_cx5051_fake_mutes(codec);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment