aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_sigmatel.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r--sound/pci/hda/patch_sigmatel.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index d57c81e79edd..356673106788 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -815,6 +815,29 @@ static int find_mute_led_cfg(struct hda_codec *codec, int default_polarity)
815 return 0; 815 return 0;
816} 816}
817 817
818/* check whether a built-in speaker is included in parsed pins */
819static bool has_builtin_speaker(struct hda_codec *codec)
820{
821 struct sigmatel_spec *spec = codec->spec;
822 hda_nid_t *nid_pin;
823 int nids, i;
824
825 if (spec->gen.autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT) {
826 nid_pin = spec->gen.autocfg.line_out_pins;
827 nids = spec->gen.autocfg.line_outs;
828 } else {
829 nid_pin = spec->gen.autocfg.speaker_pins;
830 nids = spec->gen.autocfg.speaker_outs;
831 }
832
833 for (i = 0; i < nids; i++) {
834 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid_pin[i]);
835 if (snd_hda_get_input_pin_attr(def_conf) == INPUT_PIN_ATTR_INT)
836 return true;
837 }
838 return false;
839}
840
818/* 841/*
819 * PC beep controls 842 * PC beep controls
820 */ 843 */
@@ -3891,6 +3914,12 @@ static int patch_stac92hd73xx(struct hda_codec *codec)
3891 return err; 3914 return err;
3892 } 3915 }
3893 3916
3917 /* Don't GPIO-mute speakers if there are no internal speakers, because
3918 * the GPIO might be necessary for Headphone
3919 */
3920 if (spec->eapd_switch && !has_builtin_speaker(codec))
3921 spec->eapd_switch = 0;
3922
3894 codec->proc_widget_hook = stac92hd7x_proc_hook; 3923 codec->proc_widget_hook = stac92hd7x_proc_hook;
3895 3924
3896 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 3925 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);