diff options
author | Tony Vroon <tony@linx.net> | 2008-03-14 12:09:18 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-04-24 06:00:24 -0400 |
commit | 5d9fab2d84963ec598810c54a67332decdd922a8 (patch) | |
tree | af8da0eeef0858268525decad03458f111d6d94b /sound/pci | |
parent | ee9d6b9a30ae83f15fe8c8d2337ebc0a38151d38 (diff) |
[ALSA] hda-codec - Fujitsu Lifebook port replicator/dock headphone jack sense
The docking station headphone output had no audio and jack sense
was not considered.
Jack information from the laptop itself and the dock are combined, as
the dock does not obscure the connector.
Signed-off-by: Tony Vroon <tony@linx.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index c85da5766d39..bf729f518f87 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -8725,7 +8725,8 @@ static void alc262_hippo1_unsol_event(struct hda_codec *codec, | |||
8725 | 8725 | ||
8726 | /* | 8726 | /* |
8727 | * fujitsu model | 8727 | * fujitsu model |
8728 | * 0x14 = headphone/spdif-out, 0x15 = internal speaker | 8728 | * 0x14 = headphone/spdif-out, 0x15 = internal speaker, |
8729 | * 0x1b = port replicator headphone out | ||
8729 | */ | 8730 | */ |
8730 | 8731 | ||
8731 | #define ALC_HP_EVENT 0x37 | 8732 | #define ALC_HP_EVENT 0x37 |
@@ -8733,6 +8734,8 @@ static void alc262_hippo1_unsol_event(struct hda_codec *codec, | |||
8733 | static struct hda_verb alc262_fujitsu_unsol_verbs[] = { | 8734 | static struct hda_verb alc262_fujitsu_unsol_verbs[] = { |
8734 | {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT}, | 8735 | {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT}, |
8735 | {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, | 8736 | {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, |
8737 | {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT}, | ||
8738 | {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, | ||
8736 | {} | 8739 | {} |
8737 | }; | 8740 | }; |
8738 | 8741 | ||
@@ -8773,12 +8776,16 @@ static void alc262_fujitsu_automute(struct hda_codec *codec, int force) | |||
8773 | unsigned int mute; | 8776 | unsigned int mute; |
8774 | 8777 | ||
8775 | if (force || !spec->sense_updated) { | 8778 | if (force || !spec->sense_updated) { |
8776 | unsigned int present; | 8779 | unsigned int present_int_hp, present_dock_hp; |
8777 | /* need to execute and sync at first */ | 8780 | /* need to execute and sync at first */ |
8778 | snd_hda_codec_read(codec, 0x14, 0, AC_VERB_SET_PIN_SENSE, 0); | 8781 | snd_hda_codec_read(codec, 0x14, 0, AC_VERB_SET_PIN_SENSE, 0); |
8779 | present = snd_hda_codec_read(codec, 0x14, 0, | 8782 | present_int_hp = snd_hda_codec_read(codec, 0x14, 0, |
8780 | AC_VERB_GET_PIN_SENSE, 0); | 8783 | AC_VERB_GET_PIN_SENSE, 0); |
8781 | spec->jack_present = (present & 0x80000000) != 0; | 8784 | snd_hda_codec_read(codec, 0x1B, 0, AC_VERB_SET_PIN_SENSE, 0); |
8785 | present_dock_hp = snd_hda_codec_read(codec, 0x1b, 0, | ||
8786 | AC_VERB_GET_PIN_SENSE, 0); | ||
8787 | spec->jack_present = (present_int_hp & 0x80000000) != 0; | ||
8788 | spec->jack_present |= (present_dock_hp & 0x80000000) != 0; | ||
8782 | spec->sense_updated = 1; | 8789 | spec->sense_updated = 1; |
8783 | } | 8790 | } |
8784 | if (spec->jack_present) { | 8791 | if (spec->jack_present) { |
@@ -8820,12 +8827,13 @@ static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol, | |||
8820 | long *valp = ucontrol->value.integer.value; | 8827 | long *valp = ucontrol->value.integer.value; |
8821 | int change; | 8828 | int change; |
8822 | 8829 | ||
8823 | change = snd_hda_codec_amp_update(codec, 0x14, 0, HDA_OUTPUT, 0, | 8830 | change = snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0, |
8824 | HDA_AMP_MUTE, | 8831 | HDA_AMP_MUTE, |
8825 | valp[0] ? 0 : HDA_AMP_MUTE); | 8832 | valp ? 0 : HDA_AMP_MUTE); |
8826 | change |= snd_hda_codec_amp_update(codec, 0x14, 1, HDA_OUTPUT, 0, | 8833 | change |= snd_hda_codec_amp_stereo(codec, 0x1b, HDA_OUTPUT, 0, |
8827 | HDA_AMP_MUTE, | 8834 | HDA_AMP_MUTE, |
8828 | valp[1] ? 0 : HDA_AMP_MUTE); | 8835 | valp ? 0 : HDA_AMP_MUTE); |
8836 | |||
8829 | if (change) | 8837 | if (change) |
8830 | alc262_fujitsu_automute(codec, 0); | 8838 | alc262_fujitsu_automute(codec, 0); |
8831 | return change; | 8839 | return change; |