summaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-06-27 15:48:17 +0200
committerTakashi Iwai <tiwai@suse.de>2011-06-27 15:48:17 +0200
commit050ea75317f33e376cc413359c0319ad5cc86e2a (patch)
tree76e05218f79b29456d6d6df963515dbc42c79c2e /sound/pci
parent39fa84e94a7df64a6ba27669ef98b51994fb6894 (diff)
downloadop-kernel-dev-050ea75317f33e376cc413359c0319ad5cc86e2a.zip
op-kernel-dev-050ea75317f33e376cc413359c0319ad5cc86e2a.tar.gz
ALSA: hda - Fix volume-init of ALC299 & co
ALC269 and compatible codecs have the output volume in DACs, thus we can't use the ALC880's code as is. Fixed by checking the amp caps and picking up the right widget for initialization. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_realtek.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 783017d..5293f7f 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5605,17 +5605,28 @@ static int get_pin_type(int line_out_type)
return PIN_OUT;
}
-static void alc880_auto_init_dac(struct hda_codec *codec, hda_nid_t nid)
+static void alc880_auto_init_dac(struct hda_codec *codec, hda_nid_t dac)
{
- if (!nid)
+ hda_nid_t nid, mix;
+
+ if (!dac)
return;
- nid = alc880_idx_to_mixer(alc880_dac_to_idx(nid));
- snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE,
- AMP_OUT_ZERO);
- snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE,
- AMP_IN_UNMUTE(0));
- snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE,
- AMP_IN_UNMUTE(1));
+ mix = alc880_idx_to_mixer(alc880_dac_to_idx(dac));
+ if (query_amp_caps(codec, dac, HDA_OUTPUT) & AC_AMPCAP_NUM_STEPS)
+ nid = dac;
+ else if (query_amp_caps(codec, mix, HDA_OUTPUT) & AC_AMPCAP_NUM_STEPS)
+ nid = mix;
+ else
+ nid = 0;
+ if (nid)
+ snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE,
+ AMP_OUT_ZERO);
+ if (query_amp_caps(codec, mix, HDA_INPUT) & AC_AMPCAP_MUTE) {
+ snd_hda_codec_write(codec, mix, 0, AC_VERB_SET_AMP_GAIN_MUTE,
+ AMP_IN_UNMUTE(0));
+ snd_hda_codec_write(codec, mix, 0, AC_VERB_SET_AMP_GAIN_MUTE,
+ AMP_IN_UNMUTE(1));
+ }
}
static void alc880_auto_init_multi_out(struct hda_codec *codec)
OpenPOWER on IntegriCloud