|
@@ -134,13 +134,38 @@ static void print_amp_caps(struct snd_info_buffer *buffer,
|
|
(caps & AC_AMPCAP_MUTE) >> AC_AMPCAP_MUTE_SHIFT);
|
|
(caps & AC_AMPCAP_MUTE) >> AC_AMPCAP_MUTE_SHIFT);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/* is this a stereo widget or a stereo-to-mono mix? */
|
|
|
|
+static bool is_stereo_amps(struct hda_codec *codec, hda_nid_t nid,
|
|
|
|
+ int dir, unsigned int wcaps, int indices)
|
|
|
|
+{
|
|
|
|
+ hda_nid_t conn;
|
|
|
|
+
|
|
|
|
+ if (wcaps & AC_WCAP_STEREO)
|
|
|
|
+ return true;
|
|
|
|
+ /* check for a stereo-to-mono mix; it must be:
|
|
|
|
+ * only a single connection, only for input, and only a mixer widget
|
|
|
|
+ */
|
|
|
|
+ if (indices != 1 || dir != HDA_INPUT ||
|
|
|
|
+ get_wcaps_type(wcaps) != AC_WID_AUD_MIX)
|
|
|
|
+ return false;
|
|
|
|
+
|
|
|
|
+ if (snd_hda_get_raw_connections(codec, nid, &conn, 1) < 0)
|
|
|
|
+ return false;
|
|
|
|
+ /* the connection source is a stereo? */
|
|
|
|
+ wcaps = snd_hda_param_read(codec, conn, AC_PAR_AUDIO_WIDGET_CAP);
|
|
|
|
+ return !!(wcaps & AC_WCAP_STEREO);
|
|
|
|
+}
|
|
|
|
+
|
|
static void print_amp_vals(struct snd_info_buffer *buffer,
|
|
static void print_amp_vals(struct snd_info_buffer *buffer,
|
|
struct hda_codec *codec, hda_nid_t nid,
|
|
struct hda_codec *codec, hda_nid_t nid,
|
|
- int dir, int stereo, int indices)
|
|
|
|
|
|
+ int dir, unsigned int wcaps, int indices)
|
|
{
|
|
{
|
|
unsigned int val;
|
|
unsigned int val;
|
|
|
|
+ bool stereo;
|
|
int i;
|
|
int i;
|
|
|
|
|
|
|
|
+ stereo = is_stereo_amps(codec, nid, dir, wcaps, indices);
|
|
|
|
+
|
|
dir = dir == HDA_OUTPUT ? AC_AMP_GET_OUTPUT : AC_AMP_GET_INPUT;
|
|
dir = dir == HDA_OUTPUT ? AC_AMP_GET_OUTPUT : AC_AMP_GET_INPUT;
|
|
for (i = 0; i < indices; i++) {
|
|
for (i = 0; i < indices; i++) {
|
|
snd_iprintf(buffer, " [");
|
|
snd_iprintf(buffer, " [");
|
|
@@ -757,12 +782,10 @@ static void print_codec_info(struct snd_info_entry *entry,
|
|
(codec->single_adc_amp &&
|
|
(codec->single_adc_amp &&
|
|
wid_type == AC_WID_AUD_IN))
|
|
wid_type == AC_WID_AUD_IN))
|
|
print_amp_vals(buffer, codec, nid, HDA_INPUT,
|
|
print_amp_vals(buffer, codec, nid, HDA_INPUT,
|
|
- wid_caps & AC_WCAP_STEREO,
|
|
|
|
- 1);
|
|
|
|
|
|
+ wid_caps, 1);
|
|
else
|
|
else
|
|
print_amp_vals(buffer, codec, nid, HDA_INPUT,
|
|
print_amp_vals(buffer, codec, nid, HDA_INPUT,
|
|
- wid_caps & AC_WCAP_STEREO,
|
|
|
|
- conn_len);
|
|
|
|
|
|
+ wid_caps, 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: ");
|
|
@@ -771,11 +794,10 @@ static void print_codec_info(struct snd_info_entry *entry,
|
|
if (wid_type == AC_WID_PIN &&
|
|
if (wid_type == AC_WID_PIN &&
|
|
codec->pin_amp_workaround)
|
|
codec->pin_amp_workaround)
|
|
print_amp_vals(buffer, codec, nid, HDA_OUTPUT,
|
|
print_amp_vals(buffer, codec, nid, HDA_OUTPUT,
|
|
- wid_caps & AC_WCAP_STEREO,
|
|
|
|
- conn_len);
|
|
|
|
|
|
+ wid_caps, conn_len);
|
|
else
|
|
else
|
|
print_amp_vals(buffer, codec, nid, HDA_OUTPUT,
|
|
print_amp_vals(buffer, codec, nid, HDA_OUTPUT,
|
|
- wid_caps & AC_WCAP_STEREO, 1);
|
|
|
|
|
|
+ wid_caps, 1);
|
|
}
|
|
}
|
|
|
|
|
|
switch (wid_type) {
|
|
switch (wid_type) {
|