aboutsummaryrefslogtreecommitdiff
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-12-18 14:22:45 +0100
committerTakashi Iwai <tiwai@suse.de>2013-01-12 08:30:30 +0100
commit37c042076521a854239241eaac94788076046231 (patch)
tree46a7604b988f53553cb50d30946c6139ffc31c07 /sound/pci/hda/patch_realtek.c
parentdf1d1fb09aed7aae0f94a5ba1a39d0477dee6f1d (diff)
ALSA: hda/realtek - Allow different pins for shared hp/mic vref check
Add a new field to indicate the possible pin NID for alternative vref setup for the shared hp/mic. Although 0x18 is valid for all Realtek codecs, it'll be different on other vendor's codecs. Also, drop the sanity check in update_shared_mic_hp() since the reference pin is set explicitly in the caller side. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 0d6e9d884594..c6cc833f4d2a 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -187,6 +187,7 @@ struct alc_spec {
unsigned int dyn_adc_idx[HDA_MAX_NUM_INPUTS];
int int_mic_idx, ext_mic_idx, dock_mic_idx; /* for auto-mic */
hda_nid_t inv_dmic_pin;
+ hda_nid_t shared_mic_vref_pin;
/* DAC list */
int num_all_dacs;
@@ -343,15 +344,11 @@ static void update_shared_mic_hp(struct hda_codec *codec, bool set_as_mic)
/* This pin does not have vref caps - let's enable vref on pin 0x18
instead, as suggested by Realtek */
- if (val == AC_PINCTL_VREF_HIZ) {
- const hda_nid_t vref_pin = 0x18;
- /* Sanity check pin 0x18 */
- if (get_wcaps_type(get_wcaps(codec, vref_pin)) == AC_WID_PIN &&
- get_defcfg_connect(snd_hda_codec_get_pincfg(codec, vref_pin)) == AC_JACK_PORT_NONE) {
- unsigned int vref_val = snd_hda_get_default_vref(codec, vref_pin);
- if (vref_val != AC_PINCTL_VREF_HIZ)
- snd_hda_set_pin_ctl(codec, vref_pin, PIN_IN | (set_as_mic ? vref_val : 0));
- }
+ if (val == AC_PINCTL_VREF_HIZ && spec->shared_mic_vref_pin) {
+ const hda_nid_t vref_pin = spec->shared_mic_vref_pin;
+ unsigned int vref_val = snd_hda_get_default_vref(codec, vref_pin);
+ if (vref_val != AC_PINCTL_VREF_HIZ)
+ snd_hda_set_pin_ctl(codec, vref_pin, PIN_IN | (set_as_mic ? vref_val : 0));
}
val = set_as_mic ? val | PIN_IN : PIN_HP;
@@ -5642,6 +5639,7 @@ static int patch_alc262(struct hda_codec *codec)
return err;
spec = codec->spec;
+ spec->shared_mic_vref_pin = 0x18;
#if 0
/* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
@@ -6431,6 +6429,7 @@ static int patch_alc269(struct hda_codec *codec)
return err;
spec = codec->spec;
+ spec->shared_mic_vref_pin = 0x18;
alc_pick_fixup(codec, alc269_fixup_models,
alc269_fixup_tbl, alc269_fixups);