diff options
| -rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 83d5335ac348..dafe04ae8c72 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 */ | ||
| 819 | static 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 | */ |
| @@ -3890,6 +3913,12 @@ static int patch_stac92hd73xx(struct hda_codec *codec) | |||
| 3890 | return err; | 3913 | return err; |
| 3891 | } | 3914 | } |
| 3892 | 3915 | ||
| 3916 | /* Don't GPIO-mute speakers if there are no internal speakers, because | ||
| 3917 | * the GPIO might be necessary for Headphone | ||
| 3918 | */ | ||
| 3919 | if (spec->eapd_switch && !has_builtin_speaker(codec)) | ||
| 3920 | spec->eapd_switch = 0; | ||
| 3921 | |||
| 3893 | codec->proc_widget_hook = stac92hd7x_proc_hook; | 3922 | codec->proc_widget_hook = stac92hd7x_proc_hook; |
| 3894 | 3923 | ||
| 3895 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); | 3924 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
