diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-06-24 08:10:15 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-06-24 08:10:15 -0400 |
commit | 03c405ad314d3c4e049b8d04500e54e833d16747 (patch) | |
tree | 62935c0863da2a852582a0a1114318dcf780aac8 /sound/pci | |
parent | 16d11a829ed197b719723f81d82e7f1a42f5c681 (diff) |
ALSA: hda - Generalize the pin-detect quirk for Lenovo N100
Add a new flag to ad_spec struct so that the same hack can be used for
any other models (if any). This also allows other models to reuse the
auto-mute functions.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/patch_analog.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 592423c878f2..8c2b23f54f95 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -72,6 +72,7 @@ struct ad198x_spec { | |||
72 | hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS]; | 72 | hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS]; |
73 | 73 | ||
74 | unsigned int jack_present :1; | 74 | unsigned int jack_present :1; |
75 | unsigned int inv_jack_detect:1; | ||
75 | 76 | ||
76 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 77 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
77 | struct hda_loopback_check loopback; | 78 | struct hda_loopback_check loopback; |
@@ -756,8 +757,9 @@ static void ad1986a_hp_automute(struct hda_codec *codec) | |||
756 | unsigned int present; | 757 | unsigned int present; |
757 | 758 | ||
758 | present = snd_hda_codec_read(codec, 0x1a, 0, AC_VERB_GET_PIN_SENSE, 0); | 759 | present = snd_hda_codec_read(codec, 0x1a, 0, AC_VERB_GET_PIN_SENSE, 0); |
759 | /* Lenovo N100 seems to report the reversed bit for HP jack-sensing */ | 760 | spec->jack_present = !!(present & 0x80000000); |
760 | spec->jack_present = !(present & 0x80000000); | 761 | if (spec->inv_jack_detect) |
762 | spec->jack_present = !spec->jack_present; | ||
761 | ad1986a_update_hp(codec); | 763 | ad1986a_update_hp(codec); |
762 | } | 764 | } |
763 | 765 | ||
@@ -1113,6 +1115,10 @@ static int patch_ad1986a(struct hda_codec *codec) | |||
1113 | spec->input_mux = &ad1986a_laptop_eapd_capture_source; | 1115 | spec->input_mux = &ad1986a_laptop_eapd_capture_source; |
1114 | codec->patch_ops.unsol_event = ad1986a_hp_unsol_event; | 1116 | codec->patch_ops.unsol_event = ad1986a_hp_unsol_event; |
1115 | codec->patch_ops.init = ad1986a_hp_init; | 1117 | codec->patch_ops.init = ad1986a_hp_init; |
1118 | /* Lenovo N100 seems to report the reversed bit | ||
1119 | * for HP jack-sensing | ||
1120 | */ | ||
1121 | spec->inv_jack_detect = 1; | ||
1116 | break; | 1122 | break; |
1117 | case AD1986A_ULTRA: | 1123 | case AD1986A_ULTRA: |
1118 | spec->mixers[0] = ad1986a_laptop_eapd_mixers; | 1124 | spec->mixers[0] = ad1986a_laptop_eapd_mixers; |