Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361333
b: refs/heads/master
c: 303985f
h: refs/heads/master
i:
  361331: fb272e9
v: v3
  • Loading branch information
David Henningsson authored and Takashi Iwai committed Mar 14, 2013
1 parent d2945ca commit 55a0613
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b5f82b1044daef74059f454353a2ee97acbbe620
refs/heads/master: 303985f81019571db0b3a6f01fc7f03eb350657e
29 changes: 29 additions & 0 deletions trunk/sound/pci/hda/patch_sigmatel.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,29 @@ static int find_mute_led_cfg(struct hda_codec *codec, int default_polarity)
return 0;
}

/* check whether a built-in speaker is included in parsed pins */
static bool has_builtin_speaker(struct hda_codec *codec)
{
struct sigmatel_spec *spec = codec->spec;
hda_nid_t *nid_pin;
int nids, i;

if (spec->gen.autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT) {
nid_pin = spec->gen.autocfg.line_out_pins;
nids = spec->gen.autocfg.line_outs;
} else {
nid_pin = spec->gen.autocfg.speaker_pins;
nids = spec->gen.autocfg.speaker_outs;
}

for (i = 0; i < nids; i++) {
unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid_pin[i]);
if (snd_hda_get_input_pin_attr(def_conf) == INPUT_PIN_ATTR_INT)
return true;
}
return false;
}

/*
* PC beep controls
*/
Expand Down Expand Up @@ -3890,6 +3913,12 @@ static int patch_stac92hd73xx(struct hda_codec *codec)
return err;
}

/* Don't GPIO-mute speakers if there are no internal speakers, because
* the GPIO might be necessary for Headphone
*/
if (spec->eapd_switch && !has_builtin_speaker(codec))
spec->eapd_switch = 0;

codec->proc_widget_hook = stac92hd7x_proc_hook;

snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
Expand Down

0 comments on commit 55a0613

Please sign in to comment.